-
Notifications
You must be signed in to change notification settings - Fork 0
/
vectors.s
52 lines (41 loc) · 902 Bytes
/
vectors.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.section .text
.globl banked_sp_init
banked_sp_init:
mrs r0, cpsr
ldr r1, =0xffff1000
// Abort mode
orr r0, #0b10111
msr cpsr_c, r0
mov sp, r1
// Return in Supervisor mode
bic r0, #0b00100
msr cpsr_c, r0
bx lr
.section .rodata
.globl vectors_start, vectors_end
vectors_start:
b _hang // Reset
b _hang // Undefined instructions
b _hang // Software interrupt
b _iabort // Instruction abort
b _dabort // Data abort
b _hang // Reserved
b _hang // Interrupt
b _hang // Fast interrupt
_hang:
b _hang
_iabort:
sub lr, lr, #4
push {r0-r12, lr}
mov r0, lr
mrc p15, 0, r1, c5, c0, 1
ldr pc, =inst_abort_handler
_dabort:
sub lr, lr, #8
push {r0-r12, lr}
mov r0, lr
mrc p15, 0, r1, c6, c0, 0
mrc p15, 0, r2, c5, c0, 0
ldr pc, =data_abort_handler
.ltorg
vectors_end: