aboutsummaryrefslogtreecommitdiff
path: root/interrupt_vector.S
diff options
context:
space:
mode:
Diffstat (limited to 'interrupt_vector.S')
-rw-r--r--interrupt_vector.S53
1 files changed, 47 insertions, 6 deletions
diff --git a/interrupt_vector.S b/interrupt_vector.S
index 3daef05..1f5bb3a 100644
--- a/interrupt_vector.S
+++ b/interrupt_vector.S
@@ -1,10 +1,8 @@
.section ".interrupt_vectors.text"
.global abort_handler
-.global irq_handler
-.local generic_handler
+.local generic_handler
.global _interrupt_vectors
-
_interrupt_vectors:
ldr pc,reset_handler
ldr pc,undefined_handler
@@ -37,13 +35,56 @@ enable_irq:
bic r0,r0,#0x80
msr cpsr_c,r0
bx lr
+ b reset_handler_caller
+ b undef_handler_caller
+ b svc_handler_caller
+ b abort_handler_caller
+ b abort_handler_caller
+ 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
+ bx r5
+
+svc_handler_caller:
+ ldr sp, =_supervisor_stack_top
+ push {r5, lr}
+ ldr r5, =supervisor_call_handler
+ blx r5
+ ldm sp!, {r5, pc} ^
-generic_handler:
- b generic_handler
abort_handler_caller:
- mov sp, #0x8000
+ ldr sp, =_supervisor_stack_top
ldr r5, =abort_handler
bx r5
+
+generic_handler_caller:
+ ldr sp, =_supervisor_stack_top
+ ldr r5, =generic_handler
+ bx r5
+
+irq_handler_caller:
+ ldr sp, =_irq_stack_top
+ sub lr, #4
+ push {r0-r3, lr}
+ ldr r3, =irq_handler
+ blx r3
+ ldm sp!, {r0-r3, pc} ^
+
+fiq_handler_caller:
+ ldr sp, =_fiq_stack_top
+ ldr r5, =fiq_handler
+ bx r5
+
+
irq:
mov sp, #0x8000
ldr r5, =abort_handler