Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / mips / gt64120 / ev64120 / irq.c
index 537eab3..46c468b 100644 (file)
 #include <linux/timex.h>
 #include <linux/slab.h>
 #include <linux/random.h>
-#include <asm/bitops.h>
+#include <linux/bitops.h>
 #include <asm/bootinfo.h>
 #include <asm/io.h>
 #include <asm/mipsregs.h>
 #include <asm/system.h>
 #include <asm/gt64120.h>
 
-asmlinkage inline void pci_intA(struct pt_regs *regs)
+asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
 {
-       do_IRQ(GT_INTA, regs);
-}
-
-asmlinkage inline void pci_intD(struct pt_regs *regs)
-{
-       do_IRQ(GT_INTD, regs);
+       unsigned int pending = read_c0_status() & read_c0_cause();
+
+       if (pending & STATUSF_IP4)              /* int2 hardware line (timer) */
+               do_IRQ(4, regs);
+       else if (pending & STATUSF_IP2)         /* int0 hardware line */
+               do_IRQ(GT_INTA, regs);
+       else if (pending & STATUSF_IP5)         /* int3 hardware line */
+               do_IRQ(GT_INTD, regs);
+       else if (pending & STATUSF_IP6)         /* int4 hardware line */
+               do_IRQ(6, regs);
+       else if (pending & STATUSF_IP7)         /* compare int */
+               do_IRQ(7, regs);
+       else
+               spurious_interrupt(regs);
 }
 
 static void disable_ev64120_irq(unsigned int irq_nr)
@@ -109,17 +117,12 @@ static struct hw_interrupt_type ev64120_irq_type = {
 
 void gt64120_irq_setup(void)
 {
-       extern asmlinkage void galileo_handle_int(void);
-
        /*
         * Clear all of the interrupts while we change the able around a bit.
         */
        clear_c0_status(ST0_IM);
 
-       /* Sets the exception_handler array. */
-       set_except_vector(0, galileo_handle_int);
-
-       cli();
+       local_irq_disable();
 
        /*
         * Enable timer.  Other interrupts will be enabled as they are
@@ -128,7 +131,7 @@ void gt64120_irq_setup(void)
        set_c0_status(IE_IRQ2);
 }
 
-void __init init_IRQ(void)
+void __init arch_init_irq(void)
 {
        int i;
 
@@ -138,7 +141,7 @@ void __init init_IRQ(void)
                irq_desc[i].handler = &no_irq_type;
                irq_desc[i].action = NULL;
                irq_desc[i].depth = 0;
-               irq_desc[i].lock = SPIN_LOCK_UNLOCKED;
+               spin_lock_init(&irq_desc[i].lock);
        }
 
        gt64120_irq_setup();