1 /* .include "vector_defns.h" */
5 .section .privileged_code, "ax"
11 .weak __mbed_prefetch_abort
12 .weak __mbed_data_abort
17 .global __mbed_init_realmonitor
18 /* .global __mbed_init */
27 __mbed_prefetch_abort:
32 MSR CPSR_c, #0x1F|0x80|0x40
34 STMDB sp!, {r0-r3,r12,lr}
45 LDMFD sp!,{r0-r3,r12,lr}
47 MSR CPSR_c, #0x12|0x80|0x40
51 STMFD sp!, {a4, r4, ip, lr}
58 LDMFD sp!,{r0-r3,r12,lr}
60 MSR CPSR_c, #0x12|0x80|0x40
70 __mbed_reset is called after reset
71 we setup the stacks and realmonitor, then call Reset_Handler like on M3
78 .extern __libc_init_array
85 LDR R0, =__libc_init_array
93 LDR R0, =( __SRAM_segment_end__ )
95 MSR CPSR_c, #0x1B|0x80|0x40
97 SUB R0, R0, #0x00000040
99 MSR CPSR_c, #0x17|0x80|0x40
101 SUB R0, R0, #0x00000040
103 MSR CPSR_c, #0x11|0x80|0x40
105 SUB R0, R0, #0x00000000
107 MSR CPSR_c, #0x12|0x80|0x40
109 SUB R0, R0, #0x00000040
111 MSR CPSR_c, #0x13|0x80|0x40
113 SUB R0, R0, #0x00000040
118 /* Relocate .data section (Copy from ROM to RAM) */
119 LDR R1, =__text_end__ /* _etext */
120 LDR R2, =__data_start__ /* _data */
121 LDR R3, =__data_end__ /* _edata */
130 /* Clear .bss section (Zero init) */
132 LDR R1, =__bss_start__
142 /* Init realmonitor */
143 LDR R0, =__mbed_init_realmonitor
147 /* Go to Reset_Handler */
148 LDR R0, =Reset_Handler