]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc/kernel/irq.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6-omap-h63xx.git] / arch / sparc / kernel / irq.c
index 72f0201051a0bd9fa0cff67c8a3792e5dbf3795c..f257a67bcf933dc3b7d3902b29a9d995f252c2ed 100644 (file)
@@ -1,6 +1,6 @@
 /*  $Id: irq.c,v 1.114 2001/12/11 04:55:51 davem Exp $
  *  arch/sparc/kernel/irq.c:  Interrupt request handling routines. On the
- *                            Sparc the IRQ's are basically 'cast in stone'
+ *                            Sparc the IRQs are basically 'cast in stone'
  *                            and you are supposed to probe the prom's device
  *                            node trees to find out who's got which IRQ.
  *
@@ -24,7 +24,6 @@
 #include <linux/random.h>
 #include <linux/init.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/delay.h>
 #include <linux/threads.h>
 #include <linux/spinlock.h>
@@ -46,6 +45,7 @@
 #include <asm/pgtable.h>
 #include <asm/pcic.h>
 #include <asm/cacheflush.h>
+#include <asm/irq_regs.h>
 
 #ifdef CONFIG_SMP
 #define SMP_NOP2 "nop; nop;\n\t"
@@ -133,8 +133,8 @@ static void irq_panic(void)
     prom_halt();
 }
 
-void (*sparc_init_timers)(irqreturn_t (*)(int, void *,struct pt_regs *)) =
-    (void (*)(irqreturn_t (*)(int, void *,struct pt_regs *))) irq_panic;
+void (*sparc_init_timers)(irq_handler_t ) =
+    (void (*)(irq_handler_t )) irq_panic;
 
 /*
  * Dave Redman (djhr@tadpole.co.uk)
@@ -319,16 +319,18 @@ void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs)
 
 void handler_irq(int irq, struct pt_regs * regs)
 {
+       struct pt_regs *old_regs;
        struct irqaction * action;
        int cpu = smp_processor_id();
 #ifdef CONFIG_SMP
        extern void smp4m_irq_rotate(int cpu);
 #endif
 
+       old_regs = set_irq_regs(regs);
        irq_enter();
        disable_pil_irq(irq);
 #ifdef CONFIG_SMP
-       /* Only rotate on lower priority IRQ's (scsi, ethernet, etc.). */
+       /* Only rotate on lower priority IRQs (scsi, ethernet, etc.). */
        if((sparc_cpu_model==sun4m) && (irq < 10))
                smp4m_irq_rotate(cpu);
 #endif
@@ -338,38 +340,42 @@ void handler_irq(int irq, struct pt_regs * regs)
        do {
                if (!action || !action->handler)
                        unexpected_irq(irq, NULL, regs);
-               action->handler(irq, action->dev_id, regs);
+               action->handler(irq, action->dev_id);
                action = action->next;
        } while (action);
        sparc_irq[irq].flags &= ~SPARC_IRQ_INPROGRESS;
        enable_pil_irq(irq);
        irq_exit();
+       set_irq_regs(old_regs);
 }
 
 #ifdef CONFIG_BLK_DEV_FD
-extern void floppy_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+extern void floppy_interrupt(int irq, void *dev_id);
 
 void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
+       struct pt_regs *old_regs;
        int cpu = smp_processor_id();
 
+       old_regs = set_irq_regs(regs);
        disable_pil_irq(irq);
        irq_enter();
        kstat_cpu(cpu).irqs[irq]++;
-       floppy_interrupt(irq, dev_id, regs);
+       floppy_interrupt(irq, dev_id);
        irq_exit();
        enable_pil_irq(irq);
+       set_irq_regs(old_regs);
        // XXX Eek, it's totally changed with preempt_count() and such
        // if (softirq_pending(cpu))
        //      do_softirq();
 }
 #endif
 
-/* Fast IRQ's on the Sparc can only have one routine attached to them,
+/* Fast IRQs on the Sparc can only have one routine attached to them,
  * thus no sharing possible.
  */
 int request_fast_irq(unsigned int irq,
-                    irqreturn_t (*handler)(int, void *, struct pt_regs *),
+                    irq_handler_t handler,
                     unsigned long irqflags, const char *devname)
 {
        struct irqaction *action;
@@ -418,7 +424,7 @@ int request_fast_irq(unsigned int irq,
        }
        
        if (action == NULL)
-           action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
+           action = kmalloc(sizeof(struct irqaction),
                                                 GFP_ATOMIC);
        
        if (!action) { 
@@ -468,7 +474,7 @@ out:
 }
 
 int request_irq(unsigned int irq,
-               irqreturn_t (*handler)(int, void *, struct pt_regs *),
+               irq_handler_t handler,
                unsigned long irqflags, const char * devname, void *dev_id)
 {
        struct irqaction * action, **actionp;
@@ -478,7 +484,7 @@ int request_irq(unsigned int irq,
        
        if (sparc_cpu_model == sun4d) {
                extern int sun4d_request_irq(unsigned int, 
-                                            irqreturn_t (*)(int, void *, struct pt_regs *),
+                                            irq_handler_t ,
                                             unsigned long, const char *, void *);
                return sun4d_request_irq(irq, handler, irqflags, devname, dev_id);
        }
@@ -521,7 +527,7 @@ int request_irq(unsigned int irq,
        }
        
        if (action == NULL)
-               action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
+               action = kmalloc(sizeof(struct irqaction),
                                                     GFP_ATOMIC);
        
        if (!action) { 
@@ -602,7 +608,7 @@ void __init init_IRQ(void)
                break;
 
        default:
-               prom_printf("Cannot initialize IRQ's on this Sun machine...");
+               prom_printf("Cannot initialize IRQs on this Sun machine...");
                break;
        }
        btfixup();