| 1 |
/* SPDX-License-Identifier: BSD-3-Clause */ |
| 2 |
|
| 3 |
.text |
| 4 |
|
| 5 |
.align 6 |
| 6 |
.arm |
| 7 |
.global exception_table |
| 8 |
exception_table: |
| 9 |
b 1f |
| 10 |
b 2f |
| 11 |
b 3f |
| 12 |
b 4f |
| 13 |
b 5f |
| 14 |
b 6f |
| 15 |
b 7f |
| 16 |
b 8f |
| 17 |
|
| 18 |
1: |
| 19 |
ldr sp, _not_used |
| 20 |
b exception_common |
| 21 |
2: |
| 22 |
ldr sp, _undefined_instruction |
| 23 |
b exception_common |
| 24 |
3: |
| 25 |
ldr sp, _software_interrupt |
| 26 |
b exception_common |
| 27 |
4: |
| 28 |
ldr sp, _prefetch_abort |
| 29 |
b exception_common |
| 30 |
5: |
| 31 |
ldr sp, _data_abort |
| 32 |
b exception_common |
| 33 |
6: |
| 34 |
ldr sp, _not_used |
| 35 |
b exception_common |
| 36 |
7: |
| 37 |
ldr sp, _irq |
| 38 |
b exception_common |
| 39 |
8: |
| 40 |
ldr sp, _fiq |
| 41 |
b exception_common |
| 42 |
|
| 43 |
exception_common: |
| 44 |
str sp, exception_handler |
| 45 |
ldr sp, exception_stack_end |
| 46 |
push { lr } |
| 47 |
stmfd sp, { sp, lr }^ |
| 48 |
sub sp, sp, $8 |
| 49 |
push { r0 - r12 } |
| 50 |
mov r0, sp |
| 51 |
mov lr, pc |
| 52 |
ldr pc, exception_handler |
| 53 |
pop { r0 - r12 } |
| 54 |
add sp, sp, $8 |
| 55 |
ldmfd sp!, { pc }^ |
| 56 |
|
| 57 |
|
| 58 |
.align 2 |
| 59 |
_undefined_instruction: .word exception_undefined_instruction |
| 60 |
_software_interrupt: .word exception_software_interrupt |
| 61 |
_prefetch_abort: .word exception_prefetch_abort |
| 62 |
_data_abort: .word exception_data_abort |
| 63 |
_not_used: .word exception_not_used |
| 64 |
_irq: .word exception_irq |
| 65 |
_fiq: .word exception_fiq |
| 66 |
|
| 67 |
.global exception_stack_end |
| 68 |
exception_stack_end: |
| 69 |
.word 0 |
| 70 |
|
| 71 |
exception_handler: |
| 72 |
.word 0 |
| 73 |
|
| 74 |
.thumb |
| 75 |
.global set_vbar |
| 76 |
.thumb_func |
| 77 |
set_vbar: |
| 78 |
mcr p15, 0, r0, c12, c0, 0 |
| 79 |
bx lr |