fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / sparc / kernel / sun4d_irq.c
index e271941..0e27e22 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/smp_lock.h>
 #include <linux/spinlock.h>
 #include <linux/seq_file.h>
-#include <linux/vs_context.h>
 
 #include <asm/ptrace.h>
 #include <asm/processor.h>
@@ -39,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 */
@@ -199,8 +199,8 @@ 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;
-       struct vx_info_save vxis;
        int cpu = smp_processor_id();
        /* SBUS IRQ level (1 - 7) */
        int sbusl = pil_to_sbus[irq];
@@ -210,15 +210,15 @@ 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]++;
-       __enter_vx_admin(&vxis);
        if (!sbusl) {
                action = *(irq + irq_action);
                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 {
@@ -245,15 +245,15 @@ 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);
                                        }
                        }
        }
-       __leave_vx_admin(&vxis);
        irq_exit();
+       set_irq_regs(old_regs);
 }
 
 unsigned int sun4d_build_irq(struct sbus_dev *sdev, int irq)
@@ -276,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;
@@ -327,7 +327,7 @@ int sun4d_request_irq(unsigned int irq,
        }
        
        if (action == NULL)
-               action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
+               action = kmalloc(sizeof(struct irqaction),
                                                     GFP_ATOMIC);
        
        if (!action) { 
@@ -470,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;
@@ -545,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;