2 #include <asm/mipsregs.h>
3 #include <asm/regdef.h>
4 #include <asm/stackframe.h>
13 NESTED(orionIRQ, PT_SIZE, sp)
15 CLI # Important: mark KERNEL mode !
17 * Get pending interrupts
19 mfc0 t0,CP0_CAUSE # get pending interrupts
20 mfc0 t1,CP0_STATUS # get enabled interrupts
21 and t0,t1 # isolate allowed ones
22 andi t0,0xff00 # isolate pending bits
23 sll t0,16 # shift the pending bits down
24 beqz t0,3f # no pending intrs, then spurious
28 * Find irq with highest priority
29 * FIXME: This is slow - use binary search
32 1: bltz t0,2f # found pending irq
43 mfc0 t0,CP0_STATUS # disable interrupts
51 3: j spurious_interrupt