diff options
Diffstat (limited to 'cpukit/score/cpu/arm/cpu_asm.S')
-rw-r--r-- | cpukit/score/cpu/arm/cpu_asm.S | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/cpukit/score/cpu/arm/cpu_asm.S b/cpukit/score/cpu/arm/cpu_asm.S index f2c4afe39e..0df5ebbb87 100644 --- a/cpukit/score/cpu/arm/cpu_asm.S +++ b/cpukit/score/cpu/arm/cpu_asm.S @@ -68,31 +68,29 @@ DEFINE_FUNCTION_ARM(_CPU_Context_switch) #endif #ifdef RTEMS_SMP - /* Indicate that this context is no longer executing */ + /* The executing context no longer executes on this processor */ dmb mov r3, #0 strb r3, [r0, #ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET] -#endif - -/* Start restoring context */ -_restore: -#ifdef ARM_MULTILIB_HAS_LOAD_STORE_EXCLUSIVE - clrex -#endif -#ifdef RTEMS_SMP - /* Wait for context to stop execution if necessary */ + /* Wait for heir context to stop execution */ 1: ldrb r3, [r1, #ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET] cmp r3, #0 bne 1b - /* Indicate that this context is executing */ + /* The heir context executes now on this processor */ dmb mov r3, #1 strb r3, [r1, #ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET] #endif +/* Start restoring context */ +_restore: +#ifdef ARM_MULTILIB_HAS_LOAD_STORE_EXCLUSIVE + clrex +#endif + #ifdef ARM_MULTILIB_HAS_THREAD_ID_REGISTER ldr r3, [r1, #ARM_CONTEXT_CONTROL_THREAD_ID_OFFSET] mcr p15, 0, r3, c13, c0, 3 |