summaryrefslogtreecommitdiff
path: root/firmware/target/arm/system-arm.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/system-arm.c')
-rw-r--r--firmware/target/arm/system-arm.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/firmware/target/arm/system-arm.c b/firmware/target/arm/system-arm.c
index c4692bbf29..e687e1d82b 100644
--- a/firmware/target/arm/system-arm.c
+++ b/firmware/target/arm/system-arm.c
@@ -36,6 +36,56 @@ static const char* const uiename[] = {
36 "SWI" 36 "SWI"
37}; 37};
38 38
39void __attribute__((weak,naked)) data_abort_handler(void)
40{
41 asm volatile(
42 "sub r0, lr, #8 \n"
43 "mov r1, #2 \n"
44 "b UIE \n"
45 );
46}
47
48void __attribute__((weak,naked)) software_int_handler(void)
49{
50 asm volatile(
51 "sub r0, lr, #4 \n"
52 "mov r1, #4 \n"
53 "b UIE \n"
54 );
55}
56
57void __attribute__((weak,naked)) reserved_handler(void)
58{
59 asm volatile(
60 "sub r0, lr, #4 \n"
61 "mov r1, #4 \n"
62 "b UIE \n"
63 );
64}
65
66void __attribute__((weak,naked)) prefetch_abort_handler(void)
67{
68 asm volatile(
69 "sub r0, lr, #4 \n"
70 "mov r1, #1 \n"
71 "b UIE \n"
72 );
73}
74
75void __attribute__((weak,naked)) undef_instr_handler(void)
76{
77 asm volatile(
78 "sub r0, lr, #4 \n"
79#ifdef USE_THUMB
80 "mrs r1, spsr \n"
81 "tst r1, #(1 << 5) \n" // T bit set ?
82 "subne r0, lr, #2 \n" // if yes, offset to THUMB instruction
83#endif
84 "mov r1, #0 \n"
85 "b UIE \n"
86 );
87}
88
39/* Unexpected Interrupt or Exception handler. Currently only deals with 89/* Unexpected Interrupt or Exception handler. Currently only deals with
40 exceptions, but will deal with interrupts later. 90 exceptions, but will deal with interrupts later.
41 */ 91 */