summaryrefslogtreecommitdiff
path: root/firmware/target/arm/pp/thread-pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/pp/thread-pp.c')
-rw-r--r--firmware/target/arm/pp/thread-pp.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/firmware/target/arm/pp/thread-pp.c b/firmware/target/arm/pp/thread-pp.c
index ed4bdbeac1..b2e7fb018d 100644
--- a/firmware/target/arm/pp/thread-pp.c
+++ b/firmware/target/arm/pp/thread-pp.c
@@ -45,7 +45,7 @@ extern uintptr_t cpu_idlestackbegin[];
45extern uintptr_t cpu_idlestackend[]; 45extern uintptr_t cpu_idlestackend[];
46extern uintptr_t cop_idlestackbegin[]; 46extern uintptr_t cop_idlestackbegin[];
47extern uintptr_t cop_idlestackend[]; 47extern uintptr_t cop_idlestackend[];
48static uintptr_t * const idle_stacks[NUM_CORES] = 48uintptr_t * const idle_stacks[NUM_CORES] =
49{ 49{
50 [CPU] = cpu_idlestackbegin, 50 [CPU] = cpu_idlestackbegin,
51 [COP] = cop_idlestackbegin 51 [COP] = cop_idlestackbegin
@@ -92,9 +92,7 @@ static inline void NORETURN_ATTR __attribute__((always_inline))
92{ 92{
93 asm volatile ( 93 asm volatile (
94 "cmp %1, #0 \n" /* CPU? */ 94 "cmp %1, #0 \n" /* CPU? */
95 "ldrne r0, =commit_dcache \n" /* No? write back data */ 95 "blne commit_dcache \n"
96 "movne lr, pc \n"
97 "bxne r0 \n"
98 "mov r0, %0 \n" /* copy thread parameter */ 96 "mov r0, %0 \n" /* copy thread parameter */
99 "mov sp, %2 \n" /* switch to idle stack */ 97 "mov sp, %2 \n" /* switch to idle stack */
100 "bl thread_final_exit_do \n" /* finish removal */ 98 "bl thread_final_exit_do \n" /* finish removal */
@@ -163,9 +161,7 @@ static void __attribute__((naked))
163 "ldr sp, [r0, #32] \n" /* Reload original sp from context structure */ 161 "ldr sp, [r0, #32] \n" /* Reload original sp from context structure */
164 "mov r1, #0 \n" /* Clear start address */ 162 "mov r1, #0 \n" /* Clear start address */
165 "str r1, [r0, #40] \n" 163 "str r1, [r0, #40] \n"
166 "ldr r0, =commit_discard_idcache \n" /* Invalidate new core's cache */ 164 "bl commit_discard_idcache \n" /* Invalidate new core's cache */
167 "mov lr, pc \n"
168 "bx r0 \n"
169 "ldmfd sp!, { r4-r11, pc } \n" /* Restore non-volatile context to new core and return */ 165 "ldmfd sp!, { r4-r11, pc } \n" /* Restore non-volatile context to new core and return */
170 : : "i"(IDLE_STACK_WORDS) 166 : : "i"(IDLE_STACK_WORDS)
171 ); 167 );