diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-06-25 08:47:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:00:57 -0400 |
commit | 68387c448b7f2b3e2bfa0f606391cd3b602b1997 (patch) | |
tree | a6a5d209ae09a3bbaf4e1614ea4b2bd4920e6c56 /include/asm-m68k | |
parent | b5dc7840b3ebe9c7967dd8ba73db957767009ff9 (diff) |
[PATCH] m68k: convert generic irq code to irq controller
Convert the generic irq code to use irq controller, this gets rid of the
machine specific callbacks and gives better control over irq handling without
duplicating lots of code.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-m68k')
-rw-r--r-- | include/asm-m68k/irq.h | 65 | ||||
-rw-r--r-- | include/asm-m68k/machdep.h | 6 | ||||
-rw-r--r-- | include/asm-m68k/traps.h | 2 |
3 files changed, 25 insertions, 48 deletions
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index 7fa8733bb4cc..f4ae7d8feac6 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h | |||
@@ -1,25 +1,30 @@ | |||
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/linkage.h> | ||
4 | #include <linux/hardirq.h> | 5 | #include <linux/hardirq.h> |
5 | #include <linux/spinlock_types.h> | 6 | #include <linux/spinlock_types.h> |
6 | 7 | ||
7 | /* | 8 | /* |
8 | * # of m68k auto vector 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 | 9 | * This should be the same as the max(NUM_X_SOURCES) for all the |
15 | * different m68k hosts compiled into the kernel. | 10 | * different m68k hosts compiled into the kernel. |
16 | * 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 |
17 | * 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. |
18 | */ | 13 | */ |
19 | #if defined(CONFIG_ATARI) || defined(CONFIG_MAC) | 14 | #if defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X) |
20 | #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 | ||
21 | #else | 26 | #else |
22 | #define NR_IRQS (24+SYS_IRQS) | 27 | #error unknown nr of irqs |
23 | #endif | 28 | #endif |
24 | 29 | ||
25 | /* | 30 | /* |
@@ -53,39 +58,13 @@ | |||
53 | 58 | ||
54 | #define IRQ_USER 8 | 59 | #define IRQ_USER 8 |
55 | 60 | ||
56 | static __inline__ int irq_canonicalize(int irq) | 61 | extern unsigned int irq_canonicalize(unsigned int irq); |
57 | { | 62 | extern void enable_irq(unsigned int); |
58 | return irq; | 63 | extern void disable_irq(unsigned int); |
59 | } | ||
60 | |||
61 | /* | ||
62 | * Machine specific interrupt sources. | ||
63 | * | ||
64 | * Adding an interrupt service routine for a source with this bit | ||
65 | * set indicates a special machine specific interrupt source. | ||
66 | * The machine specific files define these sources. | ||
67 | * | ||
68 | * The IRQ_MACHSPEC bit is now gone - the only thing it did was to | ||
69 | * introduce unnecessary overhead. | ||
70 | * | ||
71 | * All interrupt handling is actually machine specific so it is better | ||
72 | * to use function pointers, as used by the Sparc port, and select the | ||
73 | * interrupt handling functions when initializing the kernel. This way | ||
74 | * we save some unnecessary overhead at run-time. | ||
75 | * 01/11/97 - Jes | ||
76 | */ | ||
77 | |||
78 | extern void (*enable_irq)(unsigned int); | ||
79 | extern void (*disable_irq)(unsigned int); | ||
80 | #define disable_irq_nosync disable_irq | 64 | #define disable_irq_nosync disable_irq |
81 | 65 | ||
82 | struct pt_regs; | 66 | struct pt_regs; |
83 | 67 | ||
84 | extern int cpu_request_irq(unsigned int, | ||
85 | int (*)(int, void *, struct pt_regs *), | ||
86 | unsigned long, const char *, void *); | ||
87 | extern void cpu_free_irq(unsigned int, void *); | ||
88 | |||
89 | /* | 68 | /* |
90 | * various flags for request_irq() - the Amiga now uses the standard | 69 | * various flags for request_irq() - the Amiga now uses the standard |
91 | * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ | 70 | * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ |
@@ -133,12 +112,16 @@ struct irq_controller { | |||
133 | extern int m68k_irq_startup(unsigned int); | 112 | extern int m68k_irq_startup(unsigned int); |
134 | extern void m68k_irq_shutdown(unsigned int); | 113 | extern void m68k_irq_shutdown(unsigned int); |
135 | 114 | ||
136 | /* count of spurious interrupts */ | ||
137 | extern volatile unsigned int num_spurious; | ||
138 | |||
139 | /* | 115 | /* |
140 | * This function returns a new irq_node_t | 116 | * This function returns a new irq_node_t |
141 | */ | 117 | */ |
142 | extern irq_node_t *new_irq_node(void); | 118 | extern irq_node_t *new_irq_node(void); |
143 | 119 | ||
120 | extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *)); | ||
121 | extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, | ||
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 *); | ||
126 | |||
144 | #endif /* _M68K_IRQ_H_ */ | 127 | #endif /* _M68K_IRQ_H_ */ |
diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h index 7d3fee342369..df898f27e434 100644 --- a/include/asm-m68k/machdep.h +++ b/include/asm-m68k/machdep.h | |||
@@ -13,14 +13,8 @@ struct buffer_head; | |||
13 | extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *)); | 13 | extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *)); |
14 | /* machine dependent irq functions */ | 14 | /* machine dependent irq functions */ |
15 | extern void (*mach_init_IRQ) (void); | 15 | extern void (*mach_init_IRQ) (void); |
16 | extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *); | ||
17 | extern int (*mach_request_irq) (unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), | ||
18 | unsigned long flags, const char *devname, void *dev_id); | ||
19 | extern void (*mach_free_irq) (unsigned int irq, void *dev_id); | ||
20 | extern void (*mach_get_model) (char *model); | 16 | extern void (*mach_get_model) (char *model); |
21 | extern int (*mach_get_hardware_list) (char *buffer); | 17 | extern int (*mach_get_hardware_list) (char *buffer); |
22 | extern int (*mach_get_irq_list) (struct seq_file *p, void *v); | ||
23 | extern irqreturn_t (*mach_process_int) (int irq, struct pt_regs *fp); | ||
24 | /* machine dependent timer functions */ | 18 | /* machine dependent timer functions */ |
25 | extern unsigned long (*mach_gettimeoffset)(void); | 19 | extern unsigned long (*mach_gettimeoffset)(void); |
26 | extern int (*mach_hwclk)(int, struct rtc_time*); | 20 | extern int (*mach_hwclk)(int, struct rtc_time*); |
diff --git a/include/asm-m68k/traps.h b/include/asm-m68k/traps.h index 771519473285..8caef25624c7 100644 --- a/include/asm-m68k/traps.h +++ b/include/asm-m68k/traps.h | |||
@@ -19,7 +19,7 @@ | |||
19 | typedef void (*e_vector)(void); | 19 | typedef void (*e_vector)(void); |
20 | 20 | ||
21 | asmlinkage void auto_inthandler(void); | 21 | asmlinkage void auto_inthandler(void); |
22 | asmlinkage void mach_inthandler(void); | 22 | asmlinkage void user_inthandler(void); |
23 | asmlinkage void bad_inthandler(void); | 23 | asmlinkage void bad_inthandler(void); |
24 | 24 | ||
25 | extern e_vector vectors[]; | 25 | extern e_vector vectors[]; |