Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / arch / sparc / kernel / irq.c
index aac8af5..1c7e6e3 100644 (file)
@@ -11,7 +11,6 @@
  *  Copyright (C) 1998-2000 Anton Blanchard (anton@samba.org)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
@@ -30,6 +29,7 @@
 #include <linux/threads.h>
 #include <linux/spinlock.h>
 #include <linux/seq_file.h>
+#include <linux/vs_context.h>
 
 #include <asm/ptrace.h>
 #include <asm/processor.h>
@@ -192,11 +192,11 @@ int show_interrupts(struct seq_file *p, void *v)
                }
 #endif
                seq_printf(p, " %c %s",
-                       (action->flags & SA_INTERRUPT) ? '+' : ' ',
+                       (action->flags & IRQF_DISABLED) ? '+' : ' ',
                        action->name);
                for (action=action->next; action; action = action->next) {
                        seq_printf(p, ",%s %s",
-                               (action->flags & SA_INTERRUPT) ? " +" : "",
+                               (action->flags & IRQF_DISABLED) ? " +" : "",
                                action->name);
                }
                seq_putc(p, '\n');
@@ -244,7 +244,7 @@ void free_irq(unsigned int irq, void *dev_id)
                        printk("Trying to free free shared IRQ%d\n",irq);
                        goto out_unlock;
                }
-       } else if (action->flags & SA_SHIRQ) {
+       } else if (action->flags & IRQF_SHARED) {
                printk("Trying to free shared IRQ%d with NULL device ID\n", irq);
                goto out_unlock;
        }
@@ -322,6 +322,7 @@ void handler_irq(int irq, struct pt_regs * regs)
 {
        struct irqaction * action;
        int cpu = smp_processor_id();
+       struct vx_info_save vxis;
 #ifdef CONFIG_SMP
        extern void smp4m_irq_rotate(int cpu);
 #endif
@@ -330,18 +331,20 @@ void handler_irq(int irq, struct pt_regs * regs)
        disable_pil_irq(irq);
 #ifdef CONFIG_SMP
        /* Only rotate on lower priority IRQ's (scsi, ethernet, etc.). */
-       if(irq < 10)
+       if((sparc_cpu_model==sun4m) && (irq < 10))
                smp4m_irq_rotate(cpu);
 #endif
        action = sparc_irq[irq].action;
        sparc_irq[irq].flags |= SPARC_IRQ_INPROGRESS;
        kstat_cpu(cpu).irqs[irq]++;
+       __enter_vx_admin(&vxis);
        do {
                if (!action || !action->handler)
                        unexpected_irq(irq, NULL, regs);
                action->handler(irq, action->dev_id, regs);
                action = action->next;
        } while (action);
+       __leave_vx_admin(&vxis);
        sparc_irq[irq].flags &= ~SPARC_IRQ_INPROGRESS;
        enable_pil_irq(irq);
        irq_exit();
@@ -353,11 +356,14 @@ extern void floppy_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
        int cpu = smp_processor_id();
+       struct vx_info_save vxis;
 
        disable_pil_irq(irq);
        irq_enter();
        kstat_cpu(cpu).irqs[irq]++;
+       __enter_vx_admin(&vxis);
        floppy_interrupt(irq, dev_id, regs);
+       __leave_vx_admin(&vxis);
        irq_exit();
        enable_pil_irq(irq);
        // XXX Eek, it's totally changed with preempt_count() and such
@@ -396,9 +402,9 @@ int request_fast_irq(unsigned int irq,
 
        action = sparc_irq[cpu_irq].action;
        if(action) {
-               if(action->flags & SA_SHIRQ)
+               if(action->flags & IRQF_SHARED)
                        panic("Trying to register fast irq when already shared.\n");
-               if(irqflags & SA_SHIRQ)
+               if(irqflags & IRQF_SHARED)
                        panic("Trying to register fast irq as shared.\n");
 
                /* Anyway, someone already owns it so cannot be made fast. */
@@ -498,11 +504,11 @@ int request_irq(unsigned int irq,
        actionp = &sparc_irq[cpu_irq].action;
        action = *actionp;
        if (action) {
-               if (!(action->flags & SA_SHIRQ) || !(irqflags & SA_SHIRQ)) {
+               if (!(action->flags & IRQF_SHARED) || !(irqflags & IRQF_SHARED)) {
                        ret = -EBUSY;
                        goto out_unlock;
                }
-               if ((action->flags & SA_INTERRUPT) != (irqflags & SA_INTERRUPT)) {
+               if ((action->flags & IRQF_DISABLED) != (irqflags & IRQF_DISABLED)) {
                        printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq);
                        ret = -EBUSY;
                        goto out_unlock;