intr.h revision 236992
1129198Scognet/* $NetBSD: intr.h,v 1.7 2003/06/16 20:01:00 thorpej Exp $ */ 2129198Scognet 3139735Simp/*- 4129198Scognet * Copyright (c) 1997 Mark Brinicombe. 5129198Scognet * All rights reserved. 6129198Scognet * 7129198Scognet * Redistribution and use in source and binary forms, with or without 8129198Scognet * modification, are permitted provided that the following conditions 9129198Scognet * are met: 10129198Scognet * 1. Redistributions of source code must retain the above copyright 11129198Scognet * notice, this list of conditions and the following disclaimer. 12129198Scognet * 2. Redistributions in binary form must reproduce the above copyright 13129198Scognet * notice, this list of conditions and the following disclaimer in the 14129198Scognet * documentation and/or other materials provided with the distribution. 15129198Scognet * 3. All advertising materials mentioning features or use of this software 16129198Scognet * must display the following acknowledgement: 17129198Scognet * This product includes software developed by Mark Brinicombe 18129198Scognet * for the NetBSD Project. 19129198Scognet * 4. The name of the company nor the name of the author may be used to 20129198Scognet * endorse or promote products derived from this software without specific 21129198Scognet * prior written permission. 22129198Scognet * 23129198Scognet * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 24129198Scognet * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25129198Scognet * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26129198Scognet * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 27129198Scognet * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28129198Scognet * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29129198Scognet * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30129198Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31129198Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32129198Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33129198Scognet * SUCH DAMAGE. 34129198Scognet * 35129198Scognet * $FreeBSD: head/sys/arm/include/intr.h 236992 2012-06-13 05:02:51Z imp $ 36129198Scognet * 37129198Scognet */ 38129198Scognet 39129198Scognet#ifndef _MACHINE_INTR_H_ 40129198Scognet#define _MACHINE_INTR_H_ 41129198Scognet 42186352Ssam/* XXX move to std.* files? */ 43170827Scognet#ifdef CPU_XSCALE_81342 44170827Scognet#define NIRQ 128 45179595Sbenno#elif defined(CPU_XSCALE_PXA2X0) 46179595Sbenno#include <arm/xscale/pxa/pxareg.h> 47179595Sbenno#define NIRQ IRQ_GPIO_MAX 48183840Sraj#elif defined(SOC_MV_DISCOVERY) 49183840Sraj#define NIRQ 96 50186352Ssam#elif defined(CPU_ARM9) || defined(SOC_MV_KIRKWOOD) || \ 51186352Ssam defined(CPU_XSCALE_IXP435) 52141820Scognet#define NIRQ 64 53141820Scognet#else 54135650Scognet#define NIRQ 32 55141820Scognet#endif 56129198Scognet 57129198Scognet#include <machine/psl.h> 58129198Scognet 59193847Smarcelint arm_get_next_irq(int); 60147166Scognetvoid arm_mask_irq(uintptr_t); 61147166Scognetvoid arm_unmask_irq(uintptr_t); 62236992Simpvoid arm_setup_irqhandler(const char *, int (*)(void*), void (*)(void*), 63236992Simp void *, int, int, void **); 64182933Srajint arm_remove_irqhandler(int, void *); 65178366Scognetextern void (*arm_post_filter)(void *); 66129198Scognet#endif /* _MACHINE_INTR_H */ 67