diff options
Diffstat (limited to 'include/asm-m68k/irq.h')
-rw-r--r-- | include/asm-m68k/irq.h | 112 |
1 files changed, 51 insertions, 61 deletions
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index b4f48b2a6a57..3257f9881002 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h | |||
@@ -1,13 +1,9 @@ | |||
1 | #ifndef _M68K_IRQ_H_ | 1 | #ifndef _M68K_IRQ_H_ |
2 | #define _M68K_IRQ_H_ | 2 | #define _M68K_IRQ_H_ |
3 | 3 | ||
4 | #include <linux/interrupt.h> | 4 | #include <linux/linkage.h> |
5 | 5 | #include <linux/hardirq.h> | |
6 | /* | 6 | #include <linux/spinlock_types.h> |
7 | * # of m68k interrupts | ||
8 | */ | ||
9 | |||
10 | #define SYS_IRQS 8 | ||
11 | 7 | ||
12 | /* | 8 | /* |
13 | * This should be the same as the max(NUM_X_SOURCES) for all the | 9 | * This should be the same as the max(NUM_X_SOURCES) for all the |
@@ -15,10 +11,20 @@ | |||
15 | * Currently the Atari has 72 and the Amiga 24, but if both are | 11 | * 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. | 12 | * supported in the kernel it is better to make room for 72. |
17 | */ | 13 | */ |
18 | #if defined(CONFIG_ATARI) || defined(CONFIG_MAC) | 14 | #if defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X) |
19 | #define NR_IRQS (72+SYS_IRQS) | 15 | #define NR_IRQS 200 |
16 | #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) | ||
17 | #define NR_IRQS 72 | ||
18 | #elif defined(CONFIG_Q40) | ||
19 | #define NR_IRQS 43 | ||
20 | #elif defined(CONFIG_AMIGA) | ||
21 | #define NR_IRQS 32 | ||
22 | #elif defined(CONFIG_APOLLO) | ||
23 | #define NR_IRQS 24 | ||
24 | #elif defined(CONFIG_HP300) | ||
25 | #define NR_IRQS 8 | ||
20 | #else | 26 | #else |
21 | #define NR_IRQS (24+SYS_IRQS) | 27 | #error unknown nr of irqs |
22 | #endif | 28 | #endif |
23 | 29 | ||
24 | /* | 30 | /* |
@@ -40,57 +46,29 @@ | |||
40 | * that routine requires service. | 46 | * that routine requires service. |
41 | */ | 47 | */ |
42 | 48 | ||
43 | #define IRQ1 (1) /* level 1 interrupt */ | 49 | #define IRQ_SPURIOUS 0 |
44 | #define IRQ2 (2) /* level 2 interrupt */ | ||
45 | #define IRQ3 (3) /* level 3 interrupt */ | ||
46 | #define IRQ4 (4) /* level 4 interrupt */ | ||
47 | #define IRQ5 (5) /* level 5 interrupt */ | ||
48 | #define IRQ6 (6) /* level 6 interrupt */ | ||
49 | #define IRQ7 (7) /* level 7 interrupt (non-maskable) */ | ||
50 | 50 | ||
51 | /* | 51 | #define IRQ_AUTO_1 1 /* level 1 interrupt */ |
52 | * "Generic" interrupt sources | 52 | #define IRQ_AUTO_2 2 /* level 2 interrupt */ |
53 | */ | 53 | #define IRQ_AUTO_3 3 /* level 3 interrupt */ |
54 | 54 | #define IRQ_AUTO_4 4 /* level 4 interrupt */ | |
55 | #define IRQ_SCHED_TIMER (8) /* interrupt source for scheduling timer */ | 55 | #define IRQ_AUTO_5 5 /* level 5 interrupt */ |
56 | #define IRQ_AUTO_6 6 /* level 6 interrupt */ | ||
57 | #define IRQ_AUTO_7 7 /* level 7 interrupt (non-maskable) */ | ||
56 | 58 | ||
57 | static __inline__ int irq_canonicalize(int irq) | 59 | #define IRQ_USER 8 |
58 | { | ||
59 | return irq; | ||
60 | } | ||
61 | |||
62 | /* | ||
63 | * Machine specific interrupt sources. | ||
64 | * | ||
65 | * Adding an interrupt service routine for a source with this bit | ||
66 | * set indicates a special machine specific interrupt source. | ||
67 | * The machine specific files define these sources. | ||
68 | * | ||
69 | * The IRQ_MACHSPEC bit is now gone - the only thing it did was to | ||
70 | * introduce unnecessary overhead. | ||
71 | * | ||
72 | * All interrupt handling is actually machine specific so it is better | ||
73 | * to use function pointers, as used by the Sparc port, and select the | ||
74 | * interrupt handling functions when initializing the kernel. This way | ||
75 | * we save some unnecessary overhead at run-time. | ||
76 | * 01/11/97 - Jes | ||
77 | */ | ||
78 | 60 | ||
79 | extern void (*enable_irq)(unsigned int); | 61 | extern unsigned int irq_canonicalize(unsigned int irq); |
80 | extern void (*disable_irq)(unsigned int); | 62 | extern void enable_irq(unsigned int); |
63 | extern void disable_irq(unsigned int); | ||
81 | #define disable_irq_nosync disable_irq | 64 | #define disable_irq_nosync disable_irq |
82 | 65 | ||
83 | struct pt_regs; | 66 | struct pt_regs; |
84 | 67 | ||
85 | extern int cpu_request_irq(unsigned int, | ||
86 | irqreturn_t (*)(int, void *, struct pt_regs *), | ||
87 | unsigned long, const char *, void *); | ||
88 | extern void cpu_free_irq(unsigned int, void *); | ||
89 | |||
90 | /* | 68 | /* |
91 | * various flags for request_irq() - the Amiga now uses the standard | 69 | * various flags for request_irq() - the Amiga now uses the standard |
92 | * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ | 70 | * mechanism like all other architectures - IRQF_DISABLED and |
93 | * are your friends. | 71 | * IRQF_SHARED are your friends. |
94 | */ | 72 | */ |
95 | #ifndef MACH_AMIGA_ONLY | 73 | #ifndef MACH_AMIGA_ONLY |
96 | #define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */ | 74 | #define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */ |
@@ -105,33 +83,45 @@ extern void cpu_free_irq(unsigned int, void *); | |||
105 | * interrupt source (if it supports chaining). | 83 | * interrupt source (if it supports chaining). |
106 | */ | 84 | */ |
107 | typedef struct irq_node { | 85 | typedef struct irq_node { |
108 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 86 | int (*handler)(int, void *, struct pt_regs *); |
109 | unsigned long flags; | ||
110 | void *dev_id; | 87 | void *dev_id; |
111 | const char *devname; | ||
112 | struct irq_node *next; | 88 | struct irq_node *next; |
89 | unsigned long flags; | ||
90 | const char *devname; | ||
113 | } irq_node_t; | 91 | } irq_node_t; |
114 | 92 | ||
115 | /* | 93 | /* |
116 | * This structure has only 4 elements for speed reasons | 94 | * This structure has only 4 elements for speed reasons |
117 | */ | 95 | */ |
118 | typedef struct irq_handler { | 96 | typedef struct irq_handler { |
119 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 97 | int (*handler)(int, void *, struct pt_regs *); |
120 | unsigned long flags; | 98 | unsigned long flags; |
121 | void *dev_id; | 99 | void *dev_id; |
122 | const char *devname; | 100 | const char *devname; |
123 | } irq_handler_t; | 101 | } irq_handler_t; |
124 | 102 | ||
125 | /* count of spurious interrupts */ | 103 | struct irq_controller { |
126 | extern volatile unsigned int num_spurious; | 104 | const char *name; |
105 | spinlock_t lock; | ||
106 | int (*startup)(unsigned int irq); | ||
107 | void (*shutdown)(unsigned int irq); | ||
108 | void (*enable)(unsigned int irq); | ||
109 | void (*disable)(unsigned int irq); | ||
110 | }; | ||
111 | |||
112 | extern int m68k_irq_startup(unsigned int); | ||
113 | extern void m68k_irq_shutdown(unsigned int); | ||
127 | 114 | ||
128 | /* | 115 | /* |
129 | * This function returns a new irq_node_t | 116 | * This function returns a new irq_node_t |
130 | */ | 117 | */ |
131 | extern irq_node_t *new_irq_node(void); | 118 | extern irq_node_t *new_irq_node(void); |
132 | 119 | ||
133 | struct irqaction; | 120 | extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *)); |
134 | struct pt_regs; | 121 | extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, |
135 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | 122 | void (*handler)(unsigned int, struct pt_regs *)); |
123 | extern void m68k_setup_irq_controller(struct irq_controller *, unsigned int, unsigned int); | ||
124 | |||
125 | asmlinkage void m68k_handle_int(unsigned int, struct pt_regs *); | ||
136 | 126 | ||
137 | #endif /* _M68K_IRQ_H_ */ | 127 | #endif /* _M68K_IRQ_H_ */ |