aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/irq.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-10-08 09:30:44 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-08 15:32:35 -0400
commit0d84438d98777b0f9425d39121c42f47a06878ca (patch)
tree9d3486664ecf836183f982f7011c5b8b37c4091e /arch/sparc/kernel/irq.c
parent7ff3e52cf2947ebd38c84159af68e5a29d228f6c (diff)
[PATCH] sparc32 pt_regs fixes
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/sparc/kernel/irq.c')
-rw-r--r--arch/sparc/kernel/irq.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index 72f0201051a0..ae4dfc89ca52 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -46,6 +46,7 @@
46#include <asm/pgtable.h> 46#include <asm/pgtable.h>
47#include <asm/pcic.h> 47#include <asm/pcic.h>
48#include <asm/cacheflush.h> 48#include <asm/cacheflush.h>
49#include <asm/irq_regs.h>
49 50
50#ifdef CONFIG_SMP 51#ifdef CONFIG_SMP
51#define SMP_NOP2 "nop; nop;\n\t" 52#define SMP_NOP2 "nop; nop;\n\t"
@@ -133,8 +134,8 @@ static void irq_panic(void)
133 prom_halt(); 134 prom_halt();
134} 135}
135 136
136void (*sparc_init_timers)(irqreturn_t (*)(int, void *,struct pt_regs *)) = 137void (*sparc_init_timers)(irqreturn_t (*)(int, void *)) =
137 (void (*)(irqreturn_t (*)(int, void *,struct pt_regs *))) irq_panic; 138 (void (*)(irqreturn_t (*)(int, void *))) irq_panic;
138 139
139/* 140/*
140 * Dave Redman (djhr@tadpole.co.uk) 141 * Dave Redman (djhr@tadpole.co.uk)
@@ -319,12 +320,14 @@ void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs)
319 320
320void handler_irq(int irq, struct pt_regs * regs) 321void handler_irq(int irq, struct pt_regs * regs)
321{ 322{
323 struct pt_regs *old_regs;
322 struct irqaction * action; 324 struct irqaction * action;
323 int cpu = smp_processor_id(); 325 int cpu = smp_processor_id();
324#ifdef CONFIG_SMP 326#ifdef CONFIG_SMP
325 extern void smp4m_irq_rotate(int cpu); 327 extern void smp4m_irq_rotate(int cpu);
326#endif 328#endif
327 329
330 old_regs = set_irq_regs(regs);
328 irq_enter(); 331 irq_enter();
329 disable_pil_irq(irq); 332 disable_pil_irq(irq);
330#ifdef CONFIG_SMP 333#ifdef CONFIG_SMP
@@ -338,27 +341,31 @@ void handler_irq(int irq, struct pt_regs * regs)
338 do { 341 do {
339 if (!action || !action->handler) 342 if (!action || !action->handler)
340 unexpected_irq(irq, NULL, regs); 343 unexpected_irq(irq, NULL, regs);
341 action->handler(irq, action->dev_id, regs); 344 action->handler(irq, action->dev_id);
342 action = action->next; 345 action = action->next;
343 } while (action); 346 } while (action);
344 sparc_irq[irq].flags &= ~SPARC_IRQ_INPROGRESS; 347 sparc_irq[irq].flags &= ~SPARC_IRQ_INPROGRESS;
345 enable_pil_irq(irq); 348 enable_pil_irq(irq);
346 irq_exit(); 349 irq_exit();
350 set_irq_regs(old_regs);
347} 351}
348 352
349#ifdef CONFIG_BLK_DEV_FD 353#ifdef CONFIG_BLK_DEV_FD
350extern void floppy_interrupt(int irq, void *dev_id, struct pt_regs *regs); 354extern void floppy_interrupt(int irq, void *dev_id)
351 355
352void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs) 356void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
353{ 357{
358 struct pt_regs *old_regs;
354 int cpu = smp_processor_id(); 359 int cpu = smp_processor_id();
355 360
361 old_regs = set_irq_regs(regs);
356 disable_pil_irq(irq); 362 disable_pil_irq(irq);
357 irq_enter(); 363 irq_enter();
358 kstat_cpu(cpu).irqs[irq]++; 364 kstat_cpu(cpu).irqs[irq]++;
359 floppy_interrupt(irq, dev_id, regs); 365 floppy_interrupt(irq, dev_id);
360 irq_exit(); 366 irq_exit();
361 enable_pil_irq(irq); 367 enable_pil_irq(irq);
368 set_irq_regs(old_regs);
362 // XXX Eek, it's totally changed with preempt_count() and such 369 // XXX Eek, it's totally changed with preempt_count() and such
363 // if (softirq_pending(cpu)) 370 // if (softirq_pending(cpu))
364 // do_softirq(); 371 // do_softirq();
@@ -369,7 +376,7 @@ void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
369 * thus no sharing possible. 376 * thus no sharing possible.
370 */ 377 */
371int request_fast_irq(unsigned int irq, 378int request_fast_irq(unsigned int irq,
372 irqreturn_t (*handler)(int, void *, struct pt_regs *), 379 irqreturn_t (*handler)(int, void *),
373 unsigned long irqflags, const char *devname) 380 unsigned long irqflags, const char *devname)
374{ 381{
375 struct irqaction *action; 382 struct irqaction *action;
@@ -468,7 +475,7 @@ out:
468} 475}
469 476
470int request_irq(unsigned int irq, 477int request_irq(unsigned int irq,
471 irqreturn_t (*handler)(int, void *, struct pt_regs *), 478 irqreturn_t (*handler)(int, void *),
472 unsigned long irqflags, const char * devname, void *dev_id) 479 unsigned long irqflags, const char * devname, void *dev_id)
473{ 480{
474 struct irqaction * action, **actionp; 481 struct irqaction * action, **actionp;
@@ -478,7 +485,7 @@ int request_irq(unsigned int irq,
478 485
479 if (sparc_cpu_model == sun4d) { 486 if (sparc_cpu_model == sun4d) {
480 extern int sun4d_request_irq(unsigned int, 487 extern int sun4d_request_irq(unsigned int,
481 irqreturn_t (*)(int, void *, struct pt_regs *), 488 irqreturn_t (*)(int, void *),
482 unsigned long, const char *, void *); 489 unsigned long, const char *, void *);
483 return sun4d_request_irq(irq, handler, irqflags, devname, dev_id); 490 return sun4d_request_irq(irq, handler, irqflags, devname, dev_id);
484 } 491 }