-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtzvecs.S
45 lines (41 loc) · 964 Bytes
/
tzvecs.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
/*
* Raspberry PI Remote Serial Protocol.
* Copyright 2012 Jamie Iles, jamie@jamieiles.com.
* Licensed under GPLv2.
*/
#include "assembly.h"
.arm
.pushsection .text.tzvectors
.align 12
_monitor_vecs:
b mon_panic @ System reset
b mon_panic @ Undefined instruction
b _vec_smc_tz @ Software interrupt
b mon_panic @ Prefetch abort
b mon_panic @ Data abort
b mon_panic @ Reserved vector
b mon_panic @ IRQ
b _vec_fiq_tz @ FIQ
.popsection
VECTOR(smc_tz)
ex_handler #4, gdbstub_smc_handler, #CPSR_MODE_MON
VECTOR(fiq_tz)
ex_handler #4, gdbstub_io_handler, #CPSR_MODE_MON
/*
* Setup monitor mode. Must be called from supervisor mode.
*
* r0: stack for monitor mode.
* clobbers: r0
*/
.globl init_monitor
init_monitor:
cps #CPSR_MODE_MON
mov sp, r0
cps #CPSR_MODE_SVC
ldr r0, monitor_vec_addr
mcr p15, 0, r0, c12, c0, 1
mov r0, #4
mcr p15, 0, r0, c1, c1, 0 @ FIQ's go to the monitor mode.
bx lr
monitor_vec_addr:
.word _monitor_vecs