aboutsummaryrefslogtreecommitdiff
path: root/interrupt_vector.S
diff options
context:
space:
mode:
authorvetch <vetch97@gmail.com>2020-01-04 11:26:57 +0100
committervetch <vetch97@gmail.com>2020-01-04 11:26:57 +0100
commit885a097da42317f48cead2d91c0e0240066943a8 (patch)
tree0ee86dbaf5678b32f496b99c48ea81bbd20971f2 /interrupt_vector.S
parent2d31012739a11724844701d07db12e6e1307925e (diff)
parent814d4a5357d849c4988422d48afa4aaa5432ce78 (diff)
downloadrpi-MMU-example-885a097da42317f48cead2d91c0e0240066943a8.tar.gz
rpi-MMU-example-885a097da42317f48cead2d91c0e0240066943a8.zip
Merge branch 'bob' of https://repo.or.cz/RPi-MMU-example into alice
# Conflicts: # demo_functionality.h # interrupt_vector.S # interrupts.c
Diffstat (limited to 'interrupt_vector.S')
-rw-r--r--interrupt_vector.S53
1 files changed, 9 insertions, 44 deletions
diff --git a/interrupt_vector.S b/interrupt_vector.S
index 04561e6..1ec80f7 100644
--- a/interrupt_vector.S
+++ b/interrupt_vector.S
@@ -1,41 +1,4 @@
-.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
- 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
@@ -44,12 +7,12 @@ enable_irq:
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
@@ -57,11 +20,12 @@ undef_handler_caller:
svc_handler_caller:
ldr sp, =_supervisor_stack_top
- push {r5, lr}
+ push {r0-r12, lr}
+ mov r0, sp
ldr r5, =supervisor_call_handler
blx r5
- ldm sp!, {r5, pc} ^
-
+ ldm sp!, {r0-r12, pc} ^
+
abort_handler_caller:
ldr sp, =_supervisor_stack_top
ldr r5, =abort_handler
@@ -75,10 +39,11 @@ generic_handler_caller:
irq_handler_caller:
ldr sp, =_irq_stack_top
sub lr, #4
- push {r0-r3, lr}
+ push {r0-r12, lr}
+ mov r0, sp
ldr r3, =irq_handler
blx r3
- ldm sp!, {r0-r3, pc} ^
+ ldm sp!, {r0-r12, pc} ^
fiq_handler_caller:
ldr sp, =_fiq_stack_top