intr.h revision 186352
155682Smarkm/* 	$NetBSD: intr.h,v 1.7 2003/06/16 20:01:00 thorpej Exp $	*/
2233294Sstas
355682Smarkm/*-
455682Smarkm * Copyright (c) 1997 Mark Brinicombe.
5233294Sstas * All rights reserved.
655682Smarkm *
755682Smarkm * Redistribution and use in source and binary forms, with or without
855682Smarkm * modification, are permitted provided that the following conditions
9233294Sstas * are met:
1055682Smarkm * 1. Redistributions of source code must retain the above copyright
1155682Smarkm *    notice, this list of conditions and the following disclaimer.
12233294Sstas * 2. Redistributions in binary form must reproduce the above copyright
1355682Smarkm *    notice, this list of conditions and the following disclaimer in the
1455682Smarkm *    documentation and/or other materials provided with the distribution.
1555682Smarkm * 3. All advertising materials mentioning features or use of this software
16233294Sstas *    must display the following acknowledgement:
1755682Smarkm *	This product includes software developed by Mark Brinicombe
1855682Smarkm *	for the NetBSD Project.
1955682Smarkm * 4. The name of the company nor the name of the author may be used to
20233294Sstas *    endorse or promote products derived from this software without specific
2155682Smarkm *    prior written permission.
2255682Smarkm *
2355682Smarkm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
2455682Smarkm * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2555682Smarkm * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2655682Smarkm * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
2755682Smarkm * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2855682Smarkm * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2955682Smarkm * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3055682Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3155682Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3255682Smarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3355682Smarkm * SUCH DAMAGE.
3455682Smarkm *
3555682Smarkm * $FreeBSD: head/sys/arm/include/intr.h 186352 2008-12-20 03:26:09Z sam $
3655682Smarkm *
3755682Smarkm */
3855682Smarkm
3955682Smarkm#ifndef _MACHINE_INTR_H_
4055682Smarkm#define _MACHINE_INTR_H_
41233294Sstas
4255682Smarkm/* XXX move to std.* files? */
43233294Sstas#ifdef CPU_XSCALE_81342
4455682Smarkm#define NIRQ		128
4555682Smarkm#elif defined(CPU_XSCALE_PXA2X0)
4655682Smarkm#include <arm/xscale/pxa/pxareg.h>
4755682Smarkm#define	NIRQ		IRQ_GPIO_MAX
48233294Sstas#elif defined(SOC_MV_DISCOVERY)
4955682Smarkm#define NIRQ		96
5055682Smarkm#elif defined(CPU_ARM9) || defined(SOC_MV_KIRKWOOD) || \
5155682Smarkm    defined(CPU_XSCALE_IXP435)
5255682Smarkm#define NIRQ		64
5355682Smarkm#else
5455682Smarkm#define NIRQ		32
5555682Smarkm#endif
5655682Smarkm
5755682Smarkm#include <machine/psl.h>
5855682Smarkm
5955682Smarkmint arm_get_next_irq(void);
6055682Smarkmvoid arm_mask_irq(uintptr_t);
61233294Sstasvoid arm_unmask_irq(uintptr_t);
6255682Smarkmvoid arm_setup_irqhandler(const char *, int (*)(void*), void (*)(void*),
6355682Smarkm    void *, int, int, void **);
6455682Smarkmint arm_remove_irqhandler(int, void *);
6555682Smarkmextern void (*arm_post_filter)(void *);
6655682Smarkm#endif	/* _MACHINE_INTR_H */
6755682Smarkm