Fix up mix of man(7)/mdoc(7).
[netbsd-mini2440.git] / sys / arch / acorn32 / include / irqhandler.h
blobc6976f656727271c873ddba206cb9a727353e6a9
1 /* $NetBSD: irqhandler.h,v 1.8 2008/04/29 17:09:47 matt Exp $ */
3 /*
4 * Copyright (c) 1994-1996 Mark Brinicombe.
5 * Copyright (c) 1994 Brini.
6 * All rights reserved.
8 * This code is derived from software written for Brini by Mark Brinicombe
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Mark Brinicombe
21 * for the NetBSD Project.
22 * 4. The name of the company nor the name of the author may be used to
23 * endorse or promote products derived from this software without specific
24 * prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
27 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
30 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
38 * IRQ related stuff (defines + structures)
40 * Created : 30/09/94
43 #ifndef _ARM32_IRQHANDLER_H_
44 #define _ARM32_IRQHANDLER_H_
46 #if defined(_KERNEL_OPT)
47 #include "iomd.h"
48 #endif
50 #ifndef _LOCORE
51 #include <sys/types.h>
52 #endif /* _LOCORE */
54 /* Define the IRQ bits */
57 * XXX this is really getting rather horrible.
58 * Shortly to be replaced with system specific interrupt tables and handling
61 #if NIOMD > 0
63 /* Only for ARM7500 : */
65 /*#define IRQ_PRINTER 0x00*/
66 #define IRQ_INT2 0x00
67 /*#define IRQ_RESERVED0 0x01*/
68 #define IRQ_BUTTON 0x02
69 #define IRQ_NINT1 0x02
70 #define IRQ_FLYBACK 0x03
71 #define IRQ_NPOR 0x04
72 #define IRQ_TIMER0 0x05
73 #define IRQ_TIMER1 0x06
74 #define IRQ_SOFTINT 0x07
76 #define IRQ_DREQ3 0x08
77 #define IRQ_NINT8 0x08
78 /*#define IRQ_HD1 0x09*/
79 #define IRQ_INT7 0x09
80 /*#define IRQ_HD IRQ_HD1*/
81 #define IRQ_DREQ2 0x0A
82 #define IRQ_NINT6 0x0A
83 #define IRQ_INT5 0x0B
84 /*#define IRQ_FLOPPY 0x0C*/
85 #define IRQ_NINT4 0x0C
86 /*#define IRQ_SERIAL 0x0D*/
87 #define IRQ_NINT3 0x0D
88 #define IRQ_KBDTX 0x0E
89 #define IRQ_KBDRX 0x0F
91 #define IRQ_IRQ3 0x10
92 #define IRQ_IRQ4 0x11
93 #define IRQ_IRQ5 0x12
94 #define IRQ_IRQ6 0x13
95 #define IRQ_IRQ7 0x14
96 #define IRQ_IRQ9 0x15
97 #define IRQ_IRQ10 0x16
98 #define IRQ_IRQ11 0x17
100 #define IRQ_IOP0 0x10
101 #define IRQ_IOP1 0x11
102 #define IRQ_IOP2 0x12
103 #define IRQ_IOP3 0x13
104 #define IRQ_IOP4 0x14
105 #define IRQ_IOP5 0x15
106 #define IRQ_IOP6 0x16
107 #define IRQ_IOP7 0x17
109 #define IRQ_MSDRX 0x18
110 #define IRQ_MSDTX 0x19
111 #define IRQ_ATOD 0x1A
112 #define IRQ_NEVENT1 0x1B
113 #define IRQ_CLOCK 0x1B
114 #define IRQ_NEVENT2 0x1C
115 #define IRQ_PANIC 0x1C
116 /*#define IRQ_RESERVED2 0x1D*/
117 /*#define IRQ_RESERVED3 0x1E*/
121 * Note that Sound DMA IRQ is on the 31st vector.
122 * It's not part of the IRQD.
124 #define IRQ_SDMA 0x1F
126 /* Several interrupts are different between the A7000 and RC7500 */
127 #ifdef RC7500
129 #define IRQ_FIQDOWN 0x07
130 #define IRQ_ETHERNET 0x0B
131 #define IRQ_HD2 IRQ_IRQ11
133 #else /* RC7500 */
135 /*#define IRQ_RESERVED1 0x07 */
136 #define IRQ_EXTENDED 0x0B
137 #define IRQ_PODULE 0x0D
139 #endif /* RC7500 */
144 /* for non ARM7500 machines : */
146 /*#define IRQ_PRINTER 0x00*/
147 /*#define IRQ_RESERVED0 0x01*/
148 /*#define IRQ_FLOPPYIDX 0x02*/
149 #define IRQ_FLYBACK 0x03
150 #define IRQ_POR 0x04
151 #define IRQ_TIMER0 0x05
152 #define IRQ_TIMER1 0x06
153 /*#define IRQ_RESERVED1 0x07*/
155 /*#define IRQ_RESERVED2 0x08*/
156 /*#define IRQ_HD 0x09*/
157 /*#define IRQ_SERIAL 0x0A*/
158 #define IRQ_EXTENDED 0x0B
159 /*#define IRQ_FLOPPY 0x0C*/
160 #define IRQ_PODULE 0x0D
161 #define IRQ_KBDTX 0x0E
162 #define IRQ_KBDRX 0x0F
164 #define IRQ_DMACH0 0x10
165 #define IRQ_DMACH1 0x11
166 #define IRQ_DMACH2 0x12
167 #define IRQ_DMACH3 0x13
168 #define IRQ_DMASCH0 0x14
169 #define IRQ_DMASCH1 0x15
170 /*#define IRQ_RESERVED3 0x16*/
171 /*#define IRQ_RESERVED4 0x17*/
175 #endif /* NIOMD > 0 */
177 #define IRQ_VSYNC IRQ_FLYBACK /* Aliased */
178 #define IRQ_NETSLOT IRQ_EXTENDED
180 #define IRQ_INSTRUCT -1
181 #define NIRQS 0x20
183 #include <machine/intr.h>
185 #ifndef _LOCORE
186 typedef struct irqhandler {
187 int (*ih_func)(void *arg);/* handler function */
188 void *ih_arg; /* Argument to handler */
189 int ih_level; /* Interrupt level */
190 int ih_num; /* Interrupt number (for accounting) */
191 const char *ih_name; /* Name of interrupt (for vmstat -i) */
192 u_int ih_flags; /* Interrupt flags */
193 u_int ih_maskaddr; /* mask address for expansion cards */
194 u_int ih_maskbits; /* interrupt bit for expansion cards */
195 struct irqhandler *ih_next; /* next handler */
196 } irqhandler_t;
198 #ifdef _KERNEL
199 extern u_int irqmasks[NIPL];
200 extern irqhandler_t *irqhandlers[NIRQS];
202 void irq_init(void);
203 int irq_claim(int, irqhandler_t *);
204 int irq_release(int, irqhandler_t *);
205 void *intr_claim(int irq, int level, const char *name, int (*func)(void *), void *arg);
206 int intr_release(void *ih);
207 void irq_setmasks(void);
208 void disable_irq(int);
209 void enable_irq(int);
210 void stray_irqhandler(u_int);
211 #endif /* _KERNEL */
212 #endif /* _LOCORE */
214 #define IRQ_FLAG_ACTIVE 0x00000001 /* This is the active handler in list */
216 #endif /* _ARM32_IRQHANDLER_H_ */
218 /* End of irqhandler.h */