aboutsummaryrefslogtreecommitdiff
path: root/interrupt_vector.S
diff options
context:
space:
mode:
Diffstat (limited to 'interrupt_vector.S')
-rw-r--r--interrupt_vector.S49
1 files changed, 45 insertions, 4 deletions
diff --git a/interrupt_vector.S b/interrupt_vector.S
index af80eec..1f5bb3a 100644
--- a/interrupt_vector.S
+++ b/interrupt_vector.S
@@ -1,4 +1,40 @@
+.section ".interrupt_vectors.text"
+
+.global abort_handler
+.local generic_handler
+.global _interrupt_vectors
_interrupt_vectors:
+ ldr pc,reset_handler
+ ldr pc,undefined_handler
+ ldr pc,swi_handler
+ ldr pc,prefetch_handler
+ ldr pc,data_handler
+ ldr pc,unused_handler
+ ldr pc,irq_handler_caller
+ ldr pc,fiq_handler
+ reset_handler: .word abort
+ undefined_handler: .word abort
+ swi_handler: .word abort
+ prefetch_handler: .word abort
+ data_handler: .word abort
+ unused_handler: .word abort
+ irq_handler_caller: .word irq
+ fiq_handler: .word abort
+ //b abort_handler_caller
+ //b abort_handler_caller
+ //b abort_handler_caller
+ //b abort_handler_caller
+ //b abort_handler_caller
+ //b abort_handler_caller
+ //b abort_handler_caller
+
+
+.globl enable_irq
+enable_irq:
+ mrs r0,cpsr
+ bic r0,r0,#0x80
+ msr cpsr_c,r0
+ bx lr
b reset_handler_caller
b undef_handler_caller
b svc_handler_caller
@@ -7,12 +43,12 @@ _interrupt_vectors:
b generic_handler_caller
b irq_handler_caller
b fiq_handler_caller
-
+
reset_handler_caller:
ldr sp, =_supervisor_stack_top
ldr r5, =reset_handler
bx r5
-
+
undef_handler_caller:
ldr sp, =_supervisor_stack_top
ldr r5, =undefined_instruction_vector
@@ -24,7 +60,7 @@ svc_handler_caller:
ldr r5, =supervisor_call_handler
blx r5
ldm sp!, {r5, pc} ^
-
+
abort_handler_caller:
ldr sp, =_supervisor_stack_top
ldr r5, =abort_handler
@@ -47,4 +83,9 @@ fiq_handler_caller:
ldr sp, =_fiq_stack_top
ldr r5, =fiq_handler
bx r5
-
+
+
+irq:
+ mov sp, #0x8000
+ ldr r5, =abort_handler
+ subs pc,lr,#4 \ No newline at end of file