]> err.no Git - linux-2.6/blobdiff - arch/mips/sibyte/bcm1480/irq.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6
[linux-2.6] / arch / mips / sibyte / bcm1480 / irq.c
index ed325f0ab28a48be80b366feaa0317c3b0b4f496..a46b75b23ecb1e2ef10f4470279764f23905dacc 100644 (file)
@@ -469,21 +469,6 @@ void bcm1480_kgdb_interrupt(struct pt_regs *regs)
 
 #endif         /* CONFIG_KGDB */
 
-static inline int dclz(unsigned long long x)
-{
-       int lz;
-
-       __asm__ (
-       "       .set    push                                            \n"
-       "       .set    mips64                                          \n"
-       "       dclz    %0, %1                                          \n"
-       "       .set    pop                                             \n"
-       : "=r" (lz)
-       : "r" (x));
-
-       return lz;
-}
-
 extern void bcm1480_timer_interrupt(struct pt_regs *regs);
 extern void bcm1480_mailbox_interrupt(struct pt_regs *regs);
 extern void bcm1480_kgdb_interrupt(struct pt_regs *regs);
@@ -497,7 +482,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
        write_c0_compare(read_c0_count());
 #endif
 
-       pending = read_c0_cause();
+       pending = read_c0_cause() & read_c0_status();
 
 #ifdef CONFIG_SIBYTE_BCM1480_PROF
        if (pending & CAUSEF_IP7)       /* Cpu performance counter interrupt */
@@ -536,9 +521,9 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
 
                if (mask_h) {
                        if (mask_h ^ 1)
-                               do_IRQ(63 - dclz(mask_h), regs);
+                               do_IRQ(fls64(mask_h) - 1, regs);
                        else
-                               do_IRQ(127 - dclz(mask_l), regs);
+                               do_IRQ(63 + fls64(mask_l), regs);
                }
        }
 }