|
22 | 22 | #include <linker/linker-defs.h>
|
23 | 23 | #include <kernel_internal.h>
|
24 | 24 | #include <arch/arm/cortex_m/cmsis.h>
|
25 |
| -#include <cortex_m/stack.h> |
26 | 25 |
|
27 | 26 | #if defined(__GNUC__)
|
28 | 27 | /*
|
|
37 | 36 |
|
38 | 37 | #include <string.h>
|
39 | 38 |
|
40 |
| -static inline void switch_sp_to_psp(void) |
41 |
| -{ |
42 |
| - __set_CONTROL(__get_CONTROL() | CONTROL_SPSEL_Msk); |
43 |
| - /* |
44 |
| - * When changing the stack pointer, software must use an ISB instruction |
45 |
| - * immediately after the MSR instruction. This ensures that instructions |
46 |
| - * after the ISB instruction execute using the new stack pointer. |
47 |
| - */ |
48 |
| - __ISB(); |
49 |
| -} |
50 |
| - |
51 |
| -static inline void set_and_switch_to_psp(void) |
52 |
| -{ |
53 |
| - u32_t process_sp; |
54 |
| - |
55 |
| - process_sp = (u32_t)&_interrupt_stack + CONFIG_ISR_STACK_SIZE; |
56 |
| - __set_PSP(process_sp); |
57 |
| - switch_sp_to_psp(); |
58 |
| -} |
59 |
| - |
60 |
| -void lock_interrupts(void) |
61 |
| -{ |
62 |
| -#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) |
63 |
| - __disable_irq(); |
64 |
| -#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) |
65 |
| - __set_BASEPRI(_EXC_IRQ_DEFAULT_PRIO); |
66 |
| -#else |
67 |
| -#error Unknown ARM architecture |
68 |
| -#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */ |
69 |
| -} |
70 |
| - |
71 |
| -#ifdef CONFIG_INIT_STACKS |
72 |
| -static inline void init_stacks(void) |
73 |
| -{ |
74 |
| - memset(&_interrupt_stack, 0xAA, CONFIG_ISR_STACK_SIZE); |
75 |
| -} |
76 |
| -#endif |
77 |
| - |
78 | 39 | #ifdef CONFIG_CPU_CORTEX_M_HAS_VTOR
|
79 | 40 |
|
80 | 41 | #ifdef CONFIG_XIP
|
@@ -191,14 +152,6 @@ extern void z_IntLibInit(void);
|
191 | 152 | #endif
|
192 | 153 | void _PrepC(void)
|
193 | 154 | {
|
194 |
| -#ifdef CONFIG_INIT_STACKS |
195 |
| - init_stacks(); |
196 |
| -#endif |
197 |
| - /* |
198 |
| - * Set PSP and use it to boot without using MSP, so that it |
199 |
| - * gets set to _interrupt_stack during initialization. |
200 |
| - */ |
201 |
| - set_and_switch_to_psp(); |
202 | 155 | relocate_vector_table();
|
203 | 156 | enable_floating_point();
|
204 | 157 | z_bss_zero();
|
|
0 commit comments