aboutsummaryrefslogtreecommitdiff
path: root/interrupt_vector.S
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-12-31 18:54:28 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2019-12-31 18:54:28 +0100
commit0ec2016f80ffb5971362559b98b10744bb5bf893 (patch)
tree839991c83c04ef157cdc4b3d747a79ca5975445b /interrupt_vector.S
parent97612feede34cdd0099d72d0e6fa125dd65b5e9a (diff)
downloadrpi-MMU-example-0ec2016f80ffb5971362559b98b10744bb5bf893.tar.gz
rpi-MMU-example-0ec2016f80ffb5971362559b98b10744bb5bf893.zip
split stack into irq, fiq and supervisor stacks; add proper handling of those in interrupt handlers (asm code)
Diffstat (limited to 'interrupt_vector.S')
-rw-r--r--interrupt_vector.S25
1 files changed, 14 insertions, 11 deletions
diff --git a/interrupt_vector.S b/interrupt_vector.S
index 88b32bf..af80eec 100644
--- a/interrupt_vector.S
+++ b/interrupt_vector.S
@@ -9,39 +9,42 @@ _interrupt_vectors:
b fiq_handler_caller
reset_handler_caller:
- ldr sp, =_stack_top
+ ldr sp, =_supervisor_stack_top
ldr r5, =reset_handler
bx r5
undef_handler_caller:
- ldr sp, =_stack_top
+ ldr sp, =_supervisor_stack_top
ldr r5, =undefined_instruction_vector
bx r5
svc_handler_caller:
- ldr sp, =_stack_top
+ ldr sp, =_supervisor_stack_top
+ push {r5, lr}
ldr r5, =supervisor_call_handler
- push {lr}
blx r5
- ldm sp!, {pc} ^
+ ldm sp!, {r5, pc} ^
abort_handler_caller:
- ldr sp, =_stack_top
+ ldr sp, =_supervisor_stack_top
ldr r5, =abort_handler
bx r5
generic_handler_caller:
- ldr sp, =_stack_top
+ ldr sp, =_supervisor_stack_top
ldr r5, =generic_handler
bx r5
irq_handler_caller:
- ldr sp, =_stack_top
- ldr r5, =irq_handler
- bx r5
+ 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, =_stack_top
+ ldr sp, =_fiq_stack_top
ldr r5, =fiq_handler
bx r5