blob: 1f569905cb7400cb05a42b7c5725d42288119406 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _M68K_IRQ_H_
2#define _M68K_IRQ_H_
3
4#include <linux/config.h>
5#include <linux/interrupt.h>
6
7/*
8 * # of m68k interrupts
9 */
10
11#define SYS_IRQS 8
12
13/*
14 * This should be the same as the max(NUM_X_SOURCES) for all the
15 * different m68k hosts compiled into the kernel.
16 * Currently the Atari has 72 and the Amiga 24, but if both are
17 * supported in the kernel it is better to make room for 72.
18 */
19#if defined(CONFIG_ATARI) || defined(CONFIG_MAC)
20#define NR_IRQS (72+SYS_IRQS)
21#else
22#define NR_IRQS (24+SYS_IRQS)
23#endif
24
25/*
26 * Interrupt source definitions
27 * General interrupt sources are the level 1-7.
28 * Adding an interrupt service routine for one of these sources
29 * results in the addition of that routine to a chain of routines.
30 * Each one is called in succession. Each individual interrupt
31 * service routine should determine if the device associated with
32 * that routine requires service.
33 */
34
35#define IRQ1 (1) /* level 1 interrupt */
36#define IRQ2 (2) /* level 2 interrupt */
37#define IRQ3 (3) /* level 3 interrupt */
38#define IRQ4 (4) /* level 4 interrupt */
39#define IRQ5 (5) /* level 5 interrupt */
40#define IRQ6 (6) /* level 6 interrupt */
41#define IRQ7 (7) /* level 7 interrupt (non-maskable) */
42
43/*
44 * "Generic" interrupt sources
45 */
46
47#define IRQ_SCHED_TIMER (8) /* interrupt source for scheduling timer */
48
49static __inline__ int irq_canonicalize(int irq)
50{
51 return irq;
52}
53
54/*
55 * Machine specific interrupt sources.
56 *
57 * Adding an interrupt service routine for a source with this bit
58 * set indicates a special machine specific interrupt source.
59 * The machine specific files define these sources.
60 *
61 * The IRQ_MACHSPEC bit is now gone - the only thing it did was to
62 * introduce unnecessary overhead.
63 *
64 * All interrupt handling is actually machine specific so it is better
65 * to use function pointers, as used by the Sparc port, and select the
66 * interrupt handling functions when initializing the kernel. This way
67 * we save some unnecessary overhead at run-time.
68 * 01/11/97 - Jes
69 */
70
71extern void (*enable_irq)(unsigned int);
72extern void (*disable_irq)(unsigned int);
73
74#define disable_irq_nosync disable_irq
75#define enable_irq_nosync enable_irq
76
77struct pt_regs;
78
79extern int cpu_request_irq(unsigned int,
80 irqreturn_t (*)(int, void *, struct pt_regs *),
81 unsigned long, const char *, void *);
82extern void cpu_free_irq(unsigned int, void *);
83
84/*
85 * various flags for request_irq() - the Amiga now uses the standard
86 * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
87 * are your friends.
88 */
89#ifndef MACH_AMIGA_ONLY
90#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
91#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
92#define IRQ_FLG_FAST (0x0004)
93#define IRQ_FLG_SLOW (0x0008)
94#define IRQ_FLG_STD (0x8000) /* internally used */
95#endif
96
97/*
98 * This structure is used to chain together the ISRs for a particular
99 * interrupt source (if it supports chaining).
100 */
101typedef struct irq_node {
102 irqreturn_t (*handler)(int, void *, struct pt_regs *);
103 unsigned long flags;
104 void *dev_id;
105 const char *devname;
106 struct irq_node *next;
107} irq_node_t;
108
109/*
110 * This structure has only 4 elements for speed reasons
111 */
112typedef struct irq_handler {
113 irqreturn_t (*handler)(int, void *, struct pt_regs *);
114 unsigned long flags;
115 void *dev_id;
116 const char *devname;
117} irq_handler_t;
118
119/* count of spurious interrupts */
120extern volatile unsigned int num_spurious;
121
122/*
123 * This function returns a new irq_node_t
124 */
125extern irq_node_t *new_irq_node(void);
126
127struct irqaction;
128struct pt_regs;
129int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
130
131#endif /* _M68K_IRQ_H_ */