Import 2.3.18pre1
[davej-history.git] / include / asm-m68k / irq.h
blob0a62d30ef96a9f6e913c72aa2d393f5cc5cce604
1 #ifndef _M68K_IRQ_H_
2 #define _M68K_IRQ_H_
4 #include <linux/config.h>
6 /*
7 * # of m68k interrupts
8 */
10 #define SYS_IRQS 8
13 * This should be the same as the max(NUM_X_SOURCES) for all the
14 * different m68k hosts compiled into the kernel.
15 * Currently the Atari has 72 and the Amiga 24, but if both are
16 * supported in the kernel it is better to make room for 72.
18 #if defined(CONFIG_ATARI)
19 #define NR_IRQS (72+SYS_IRQS)
20 #else
21 #define NR_IRQS (24+SYS_IRQS)
22 #endif
25 * Interrupt source definitions
26 * General interrupt sources are the level 1-7.
27 * Adding an interrupt service routine for one of these sources
28 * results in the addition of that routine to a chain of routines.
29 * Each one is called in succession. Each individual interrupt
30 * service routine should determine if the device associated with
31 * that routine requires service.
34 #define IRQ1 (1)/* level 1 interrupt */
35 #define IRQ2 (2)/* level 2 interrupt */
36 #define IRQ3 (3)/* level 3 interrupt */
37 #define IRQ4 (4)/* level 4 interrupt */
38 #define IRQ5 (5)/* level 5 interrupt */
39 #define IRQ6 (6)/* level 6 interrupt */
40 #define IRQ7 (7)/* level 7 interrupt (non-maskable) */
43 * "Generic" interrupt sources
46 #define IRQ_SCHED_TIMER (8)/* interrupt source for scheduling timer */
48 static __inline__ intirq_cannonicalize(int irq)
50 return irq;
54 * Machine specific interrupt sources.
56 * Adding an interrupt service routine for a source with this bit
57 * set indicates a special machine specific interrupt source.
58 * The machine specific files define these sources.
60 * The IRQ_MACHSPEC bit is now gone - the only thing it did was to
61 * introduce unnecessary overhead.
63 * All interrupt handling is actually machine specific so it is better
64 * to use function pointers, as used by the Sparc port, and select the
65 * interrupt handling functions when initializing the kernel. This way
66 * we save some unnecessary overhead at run-time.
67 * 01/11/97 - Jes
70 externvoid(*enable_irq)(unsigned int);
71 externvoid(*disable_irq)(unsigned int);
73 #define disable_irq_nosync disable_irq
74 #define enable_irq_nosync enable_irq
76 externintsys_request_irq(unsigned int,
77 void(*)(int,void*,struct pt_regs *),
78 unsigned long,const char*,void*);
79 externvoidsys_free_irq(unsigned int,void*);
82 * various flags for request_irq() - the Amiga now uses the standard
83 * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
84 * are your friends.
86 #ifndef CONFIG_AMIGA
87 #define IRQ_FLG_LOCK (0x0001)/* handler is not replaceable */
88 #define IRQ_FLG_REPLACE (0x0002)/* replace existing handler */
89 #define IRQ_FLG_FAST (0x0004)
90 #define IRQ_FLG_SLOW (0x0008)
91 #define IRQ_FLG_STD (0x8000)/* internally used */
92 #endif
95 * This structure is used to chain together the ISRs for a particular
96 * interrupt source (if it supports chaining).
98 typedefstruct irq_node {
99 void(*handler)(int,void*,struct pt_regs *);
100 unsigned long flags;
101 void*dev_id;
102 const char*devname;
103 struct irq_node *next;
104 } irq_node_t;
107 * This structure has only 4 elements for speed reasons
109 typedefstruct irq_handler {
110 void(*handler)(int,void*,struct pt_regs *);
111 unsigned long flags;
112 void*dev_id;
113 const char*devname;
114 } irq_handler_t;
116 /* count of spurious interrupts */
117 extern volatileunsigned int num_spurious;
120 * This function returns a new irq_node_t
122 extern irq_node_t *new_irq_node(void);
124 #endif/* _M68K_IRQ_H_ */
close