summaryrefslogtreecommitdiffstats
path: root/arch/mips/orion/int-handler.S
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-10 23:47:44 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-10 23:47:44 +0000
commitce7a3f3db827012e90ceae068572d813643e3d32 (patch)
tree0ae05de73cea41d13e2f5c537dad97ae7e34fc33 /arch/mips/orion/int-handler.S
parentc7c4310f7fc1485925d800628bf50b3aeab535ef (diff)
Support for the Galileo Orion board. From Cort.
Diffstat (limited to 'arch/mips/orion/int-handler.S')
-rw-r--r--arch/mips/orion/int-handler.S53
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/mips/orion/int-handler.S b/arch/mips/orion/int-handler.S
new file mode 100644
index 000000000..e5023b961
--- /dev/null
+++ b/arch/mips/orion/int-handler.S
@@ -0,0 +1,53 @@
+#include <asm/asm.h>
+#include <asm/mipsregs.h>
+#include <asm/regdef.h>
+#include <asm/stackframe.h>
+
+ .text
+ .set mips1
+ .set reorder
+ .set macro
+ .set noat
+ .align 5
+
+NESTED(orionIRQ, PT_SIZE, sp)
+ SAVE_ALL
+ CLI # Important: mark KERNEL mode !
+ /*
+ * Get pending interrupts
+ */
+ mfc0 t0,CP0_CAUSE # get pending interrupts
+ mfc0 t1,CP0_STATUS # get enabled interrupts
+ and t0,t1 # isolate allowed ones
+ andi t0,0xff00 # isolate pending bits
+ sll t0,16 # shift the pending bits down
+ beqz t0,3f # no pending intrs, then spurious
+ nop # delay slot
+
+ /*
+ * Find irq with highest priority
+ * FIXME: This is slow - use binary search
+ */
+ la a0,7
+1: bltz t0,2f # found pending irq
+ subu a0,1
+ sll t0,1
+ b 1b
+ nop # delay slot
+
+call_do_IRQ:
+2: move a1,sp
+ jal do_IRQ
+ nop # delay slot
+
+ mfc0 t0,CP0_STATUS # disable interrupts
+ ori t0,1
+ xori t0,1
+ mtc0 t0,CP0_STATUS
+
+ la a1, ret_from_irq
+ jr a1
+
+3: j spurious_interrupt
+END(orionIRQ)
+