aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2006-06-25 08:46:58 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:00:56 -0400
commit92445eaaadc1f03f5a177ecc957bda76bf2ba8d5 (patch)
treee327dc2b95b3fe34183428314d6b6e0700e9e72b
parentf2325ecebc5b7988fd49968bd3a660fd1594dc84 (diff)
[PATCH] m68k: separate handler for auto and user vector interrupt
Use separate entry points for auto and user vector interrupts and cleanup naming a little. 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>
-rw-r--r--arch/m68k/atari/ataints.c12
-rw-r--r--arch/m68k/kernel/entry.S84
-rw-r--r--arch/m68k/kernel/ints.c21
-rw-r--r--arch/m68k/kernel/traps.c55
-rw-r--r--include/asm-m68k/traps.h7
5 files changed, 71 insertions, 108 deletions
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c
index 076f47917842..bb54741dd6cd 100644
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -314,7 +314,7 @@ __ALIGN_STR "\n\t"
314 "rte"); 314 "rte");
315 315
316/* Defined in entry.S; only increments 'num_spurious' */ 316/* Defined in entry.S; only increments 'num_spurious' */
317asmlinkage void bad_interrupt(void); 317asmlinkage void bad_inthandler(void);
318 318
319extern void atari_microwire_cmd( int cmd ); 319extern void atari_microwire_cmd( int cmd );
320 320
@@ -337,7 +337,7 @@ void __init atari_init_IRQ(void)
337 337
338 /* initialize the vector table */ 338 /* initialize the vector table */
339 for (i = 0; i < NUM_INT_SOURCES; ++i) { 339 for (i = 0; i < NUM_INT_SOURCES; ++i) {
340 vectors[IRQ_SOURCE_TO_VECTOR(i)] = bad_interrupt; 340 vectors[IRQ_SOURCE_TO_VECTOR(i)] = bad_inthandler;
341 } 341 }
342 342
343 /* Initialize the MFP(s) */ 343 /* Initialize the MFP(s) */
@@ -461,7 +461,7 @@ int atari_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, stru
461 return -EINVAL; 461 return -EINVAL;
462 } 462 }
463 463
464 if (vectors[vector] == bad_interrupt) { 464 if (vectors[vector] == bad_inthandler) {
465 /* int has no handler yet */ 465 /* int has no handler yet */
466 irq_handler[irq].handler = handler; 466 irq_handler[irq].handler = handler;
467 irq_handler[irq].dev_id = dev_id; 467 irq_handler[irq].dev_id = dev_id;
@@ -528,7 +528,7 @@ void atari_free_irq(unsigned int irq, void *dev_id)
528 } 528 }
529 529
530 vector = IRQ_SOURCE_TO_VECTOR(irq); 530 vector = IRQ_SOURCE_TO_VECTOR(irq);
531 if (vectors[vector] == bad_interrupt) 531 if (vectors[vector] == bad_inthandler)
532 goto not_found; 532 goto not_found;
533 533
534 local_irq_save(flags); 534 local_irq_save(flags);
@@ -542,7 +542,7 @@ void atari_free_irq(unsigned int irq, void *dev_id)
542 irq_handler[irq].handler = NULL; 542 irq_handler[irq].handler = NULL;
543 irq_handler[irq].dev_id = NULL; 543 irq_handler[irq].dev_id = NULL;
544 irq_param[irq].devname = NULL; 544 irq_param[irq].devname = NULL;
545 vectors[vector] = bad_interrupt; 545 vectors[vector] = bad_inthandler;
546 /* If MFP int, also disable it */ 546 /* If MFP int, also disable it */
547 atari_disable_irq(irq); 547 atari_disable_irq(irq);
548 atari_turnoff_irq(irq); 548 atari_turnoff_irq(irq);
@@ -617,7 +617,7 @@ int show_atari_interrupts(struct seq_file *p, void *v)
617 int i; 617 int i;
618 618
619 for (i = 0; i < NUM_INT_SOURCES; ++i) { 619 for (i = 0; i < NUM_INT_SOURCES; ++i) {
620 if (vectors[IRQ_SOURCE_TO_VECTOR(i)] == bad_interrupt) 620 if (vectors[IRQ_SOURCE_TO_VECTOR(i)] == bad_inthandler)
621 continue; 621 continue;
622 if (i < STMFP_SOURCE_BASE) 622 if (i < STMFP_SOURCE_BASE)
623 seq_printf(p, "auto %2d: %10u ", 623 seq_printf(p, "auto %2d: %10u ",
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index 522079f8c2ba..1fb88f3311de 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -45,7 +45,7 @@
45#include <asm/asm-offsets.h> 45#include <asm/asm-offsets.h>
46 46
47.globl system_call, buserr, trap, resume 47.globl system_call, buserr, trap, resume
48.globl inthandler, sys_call_table 48.globl sys_call_table
49.globl sys_fork, sys_clone, sys_vfork 49.globl sys_fork, sys_clone, sys_vfork
50.globl ret_from_interrupt, bad_interrupt 50.globl ret_from_interrupt, bad_interrupt
51 51
@@ -191,44 +191,15 @@ do_delayed_trace:
191 jbra resume_userspace 191 jbra resume_userspace
192 192
193 193
194#if 0 194/* This is the main interrupt handler for autovector interrupts */
195#ifdef CONFIG_AMIGA
196ami_inthandler:
197 addql #1,irq_stat+CPUSTAT_LOCAL_IRQ_COUNT
198 SAVE_ALL_INT
199 GET_CURRENT(%d0)
200
201 bfextu %sp@(PT_VECTOR){#4,#12},%d0
202 movel %d0,%a0
203 addql #1,%a0@(kstat+STAT_IRQ-VECOFF(VEC_SPUR))
204 movel %a0@(autoirq_list-VECOFF(VEC_SPUR)),%a0
205
206| amiga vector int handler get the req mask instead of irq vector
207 lea CUSTOMBASE,%a1
208 movew %a1@(C_INTREQR),%d0
209 andw %a1@(C_INTENAR),%d0
210
211| prepare stack (push frame pointer, dev_id & req mask)
212 pea %sp@
213 movel %a0@(IRQ_DEVID),%sp@-
214 movel %d0,%sp@-
215 pea %pc@(ret_from_interrupt:w)
216 jbra @(IRQ_HANDLER,%a0)@(0)
217
218ENTRY(nmi_handler)
219 rte
220#endif
221#endif
222 195
223/* 196ENTRY(auto_inthandler)
224** This is the main interrupt handler, responsible for calling process_int()
225*/
226inthandler:
227 SAVE_ALL_INT 197 SAVE_ALL_INT
228 GET_CURRENT(%d0) 198 GET_CURRENT(%d0)
229 addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) 199 addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
230 | put exception # in d0 200 | put exception # in d0
231 bfextu %sp@(PT_VECTOR){#4,#10},%d0 201 bfextu %sp@(PT_VECTOR){#4,#10},%d0
202 subw #VEC_SPUR,%d0
232 203
233 movel %sp,%sp@- 204 movel %sp,%sp@-
234 movel %d0,%sp@- | put vector # on stack 205 movel %d0,%sp@- | put vector # on stack
@@ -241,15 +212,16 @@ inthandler:
241 jbra 3f 212 jbra 3f
2421: 2131:
243#endif 214#endif
244 jbsr process_int | process the IRQ 215 jsr m68k_handle_int | process the IRQ
2453: addql #8,%sp | pop parameters off stack 2163: addql #8,%sp | pop parameters off stack
246 217
247ret_from_interrupt: 218ret_from_interrupt:
248 subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) 219 subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
249 jeq 1f 220 jeq ret_from_last_interrupt
2502: 2212: RESTORE_ALL
251 RESTORE_ALL 222
2521: 223 ALIGN
224ret_from_last_interrupt:
253 moveq #(~ALLOWINT>>8)&0xff,%d0 225 moveq #(~ALLOWINT>>8)&0xff,%d0
254 andb %sp@(PT_SR),%d0 226 andb %sp@(PT_SR),%d0
255 jne 2b 227 jne 2b
@@ -260,12 +232,40 @@ ret_from_interrupt:
260 pea ret_from_exception 232 pea ret_from_exception
261 jra do_softirq 233 jra do_softirq
262 234
235/* Handler for user defined interrupt vectors */
236
237ENTRY(mach_inthandler)
238 SAVE_ALL_INT
239 GET_CURRENT(%d0)
240 addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
241 | put exception # in d0
242 bfextu %sp@(PT_VECTOR){#4,#10},%d0
243
244 movel %sp,%sp@-
245 movel %d0,%sp@- | put vector # on stack
246 movel mach_process_int,%a0
247 jsr %a0@ | process the IRQ
248 addql #8,%sp | pop parameters off stack
249
250 subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
251 jeq ret_from_last_interrupt
252 RESTORE_ALL
263 253
264/* Handler for uninitialized and spurious interrupts */ 254/* Handler for uninitialized and spurious interrupts */
265 255
266bad_interrupt: 256ENTRY(bad_inthandler)
267 addql #1,num_spurious 257 SAVE_ALL_INT
268 rte 258 GET_CURRENT(%d0)
259 addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
260
261 movel %sp,%sp@-
262 jsr handle_badint
263 addql #4,%sp
264
265 subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
266 jeq ret_from_last_interrupt
267 RESTORE_ALL
268
269 269
270ENTRY(sys_fork) 270ENTRY(sys_fork)
271 SAVE_SWITCH_STACK 271 SAVE_SWITCH_STACK
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c
index 4b85514792e7..895a56d69eba 100644
--- a/arch/m68k/kernel/ints.c
+++ b/arch/m68k/kernel/ints.c
@@ -248,19 +248,16 @@ static void dummy_free_irq(unsigned int irq, void *dev_id)
248 printk("calling uninitialized disable_irq()\n"); 248 printk("calling uninitialized disable_irq()\n");
249} 249}
250 250
251asmlinkage void process_int(unsigned long vec, struct pt_regs *fp) 251asmlinkage void m68k_handle_int(unsigned int irq, struct pt_regs *regs)
252{ 252{
253 if (vec >= VEC_INT1 && vec <= VEC_INT7 && !MACH_IS_BVME6000) { 253 kstat_cpu(0).irqs[irq]++;
254 vec -= VEC_SPUR; 254 irq_list[irq].handler(irq, irq_list[irq].dev_id, regs);
255 kstat_cpu(0).irqs[vec]++; 255}
256 irq_list[vec].handler(vec, irq_list[vec].dev_id, fp); 256
257 } else { 257asmlinkage void handle_badint(struct pt_regs *regs)
258 if (mach_process_int) 258{
259 mach_process_int(vec, fp); 259 kstat_cpu(0).irqs[0]++;
260 else 260 printk("unexpected interrupt from %u\n", regs->vector);
261 panic("Can't process interrupt vector %ld\n", vec);
262 return;
263 }
264} 261}
265 262
266int show_interrupts(struct seq_file *p, void *v) 263int show_interrupts(struct seq_file *p, void *v)
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index 9adf378f8f1e..b19b951fd3e7 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -45,7 +45,6 @@
45asmlinkage void system_call(void); 45asmlinkage void system_call(void);
46asmlinkage void buserr(void); 46asmlinkage void buserr(void);
47asmlinkage void trap(void); 47asmlinkage void trap(void);
48asmlinkage void inthandler(void);
49asmlinkage void nmihandler(void); 48asmlinkage void nmihandler(void);
50#ifdef CONFIG_M68KFPU_EMU 49#ifdef CONFIG_M68KFPU_EMU
51asmlinkage void fpu_emu(void); 50asmlinkage void fpu_emu(void);
@@ -53,51 +52,7 @@ asmlinkage void fpu_emu(void);
53 52
54e_vector vectors[256] = { 53e_vector vectors[256] = {
55 [VEC_BUSERR] = buserr, 54 [VEC_BUSERR] = buserr,
56 [VEC_ADDRERR] = trap,
57 [VEC_ILLEGAL] = trap,
58 [VEC_ZERODIV] = trap,
59 [VEC_CHK] = trap,
60 [VEC_TRAP] = trap,
61 [VEC_PRIV] = trap,
62 [VEC_TRACE] = trap,
63 [VEC_LINE10] = trap,
64 [VEC_LINE11] = trap,
65 [VEC_RESV12] = trap,
66 [VEC_COPROC] = trap,
67 [VEC_FORMAT] = trap,
68 [VEC_UNINT] = trap,
69 [VEC_RESV16] = trap,
70 [VEC_RESV17] = trap,
71 [VEC_RESV18] = trap,
72 [VEC_RESV19] = trap,
73 [VEC_RESV20] = trap,
74 [VEC_RESV21] = trap,
75 [VEC_RESV22] = trap,
76 [VEC_RESV23] = trap,
77 [VEC_SPUR] = inthandler,
78 [VEC_INT1] = inthandler,
79 [VEC_INT2] = inthandler,
80 [VEC_INT3] = inthandler,
81 [VEC_INT4] = inthandler,
82 [VEC_INT5] = inthandler,
83 [VEC_INT6] = inthandler,
84 [VEC_INT7] = inthandler,
85 [VEC_SYS] = system_call, 55 [VEC_SYS] = system_call,
86 [VEC_TRAP1] = trap,
87 [VEC_TRAP2] = trap,
88 [VEC_TRAP3] = trap,
89 [VEC_TRAP4] = trap,
90 [VEC_TRAP5] = trap,
91 [VEC_TRAP6] = trap,
92 [VEC_TRAP7] = trap,
93 [VEC_TRAP8] = trap,
94 [VEC_TRAP9] = trap,
95 [VEC_TRAP10] = trap,
96 [VEC_TRAP11] = trap,
97 [VEC_TRAP12] = trap,
98 [VEC_TRAP13] = trap,
99 [VEC_TRAP14] = trap,
100 [VEC_TRAP15] = trap,
101}; 56};
102 57
103/* nmi handler for the Amiga */ 58/* nmi handler for the Amiga */
@@ -132,12 +87,16 @@ void __init trap_init (void)
132{ 87{
133 int i; 88 int i;
134 89
135 for (i = 48; i < 64; i++) 90 vectors[VEC_SPUR] = bad_inthandler;
91 for (i = VEC_INT1; i <= VEC_INT7; i++)
92 vectors[i] = auto_inthandler;
93
94 for (i = 0; i < VEC_USER; i++)
136 if (!vectors[i]) 95 if (!vectors[i])
137 vectors[i] = trap; 96 vectors[i] = trap;
138 97
139 for (i = 64; i < 256; i++) 98 for (i = VEC_USER; i < 256; i++)
140 vectors[i] = inthandler; 99 vectors[i] = mach_inthandler;
141 100
142#ifdef CONFIG_M68KFPU_EMU 101#ifdef CONFIG_M68KFPU_EMU
143 if (FPU_IS_EMU) 102 if (FPU_IS_EMU)
diff --git a/include/asm-m68k/traps.h b/include/asm-m68k/traps.h
index 475056191252..771519473285 100644
--- a/include/asm-m68k/traps.h
+++ b/include/asm-m68k/traps.h
@@ -13,8 +13,15 @@
13 13
14#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
15 15
16#include <linux/linkage.h>
17#include <asm/ptrace.h>
18
16typedef void (*e_vector)(void); 19typedef void (*e_vector)(void);
17 20
21asmlinkage void auto_inthandler(void);
22asmlinkage void mach_inthandler(void);
23asmlinkage void bad_inthandler(void);
24
18extern e_vector vectors[]; 25extern e_vector vectors[];
19 26
20#endif 27#endif