Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[pandora-kernel.git] / arch / sparc / kernel / sun4d_irq.c
index 74eed97..cf1b8ba 100644 (file)
@@ -38,6 +38,7 @@
 #include <asm/sbus.h>
 #include <asm/sbi.h>
 #include <asm/cacheflush.h>
+#include <asm/irq_regs.h>
 
 /* If you trust current SCSI layer to handle different SCSI IRQs, enable this. I don't trust it... -jj */
 /* #define DISTRIBUTE_IRQS */
@@ -198,6 +199,7 @@ extern void unexpected_irq(int, void *, struct pt_regs *);
 
 void sun4d_handler_irq(int irq, struct pt_regs * regs)
 {
+       struct pt_regs *old_regs;
        struct irqaction * action;
        int cpu = smp_processor_id();
        /* SBUS IRQ level (1 - 7) */
@@ -208,6 +210,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs)
        
        cc_set_iclr(1 << irq);
        
+       old_regs = set_irq_regs(regs);
        irq_enter();
        kstat_cpu(cpu).irqs[irq]++;
        if (!sbusl) {
@@ -215,7 +218,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs)
                if (!action)
                        unexpected_irq(irq, NULL, regs);
                do {
-                       action->handler(irq, action->dev_id, regs);
+                       action->handler(irq, action->dev_id);
                        action = action->next;
                } while (action);
        } else {
@@ -242,7 +245,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs)
                                                if (!action)
                                                        unexpected_irq(irq, NULL, regs);
                                                do {
-                                                       action->handler(irq, action->dev_id, regs);
+                                                       action->handler(irq, action->dev_id);
                                                        action = action->next;
                                                } while (action);
                                                release_sbi(SBI2DEVID(sbino), slot);
@@ -250,6 +253,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs)
                        }
        }
        irq_exit();
+       set_irq_regs(old_regs);
 }
 
 unsigned int sun4d_build_irq(struct sbus_dev *sdev, int irq)
@@ -272,7 +276,7 @@ unsigned int sun4d_sbint_to_irq(struct sbus_dev *sdev, unsigned int sbint)
 }
 
 int sun4d_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, *tmp = NULL, **actionp;
@@ -466,7 +470,7 @@ static void sun4d_load_profile_irq(int cpu, unsigned int limit)
        bw_set_prof_limit(cpu, limit);
 }
 
-static void __init sun4d_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *))
+static void __init sun4d_init_timers(irq_handler_t counter_fn)
 {
        int irq;
        int cpu;
@@ -541,8 +545,11 @@ void __init sun4d_init_sbi_irq(void)
        nsbi = 0;
        for_each_sbus(sbus)
                nsbi++;
-       sbus_actions = (struct sbus_action *)kmalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC);
-       memset (sbus_actions, 0, (nsbi * 8 * 4 * sizeof(struct sbus_action)));
+       sbus_actions = kzalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC);
+       if (!sbus_actions) {
+               prom_printf("SUN4D: Cannot allocate sbus_actions, halting.\n");
+               prom_halt();
+       }
        for_each_sbus(sbus) {
 #ifdef CONFIG_SMP      
                extern unsigned char boot_cpu_id;