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
84 LDR R0, =__libc_init_array
92 LDR R0, =( __SRAM_segment_end__ )
94 MSR CPSR_c, #0x1B|0x80|0x40
96 SUB R0, R0, #0x00000040
98 MSR CPSR_c, #0x17|0x80|0x40
100 SUB R0, R0, #0x00000040
102 MSR CPSR_c, #0x11|0x80|0x40
104 SUB R0, R0, #0x00000000
106 MSR CPSR_c, #0x12|0x80|0x40
108 SUB R0, R0, #0x00000040
110 MSR CPSR_c, #0x13|0x80|0x40
112 SUB R0, R0, #0x00000040
117 /* Relocate .data section (Copy from ROM to RAM) */
118 LDR R1, =__text_end__ /* _etext */
119 LDR R2, =__data_start__ /* _data */
120 LDR R3, =__data_end__ /* _edata */
129 /* Clear .bss section (Zero init) */
131 LDR R1, =__bss_start__
141 /* Init realmonitor */
142 LDR R0, =__mbed_init_realmonitor
146 /* Go to Reset_Handler */
147 LDR R0, =Reset_Handler