armv7: fixing thread context switching
@@ -74,7 +74,7 @@ disp_resume_context(struct dispatcher_shared_generic *disp, uint32_t *regs)
" ldmia r1, {r0-r15} \n\t"
"disp_resume_context_epilog: \n\t"
" mov r0, r0 ; nop \n\t"
- );
+ ::: "r0", "r1", "r2", "r3");
}
@@ -96,7 +96,7 @@ disp_save_context(uint32_t *regs)
" str r2, [r0, # (" XTR(PC_REG) " * 4)] \n\t"
"disp_save_context_resume: \n\t"
" bx lr \n\t"
- );
+ ::: "r0", "r1", "r2", "r3");
}
///////////////////////////////////////////////////////////////////////////////
@@ -156,13 +156,6 @@ void disp_switch(dispatcher_handle_t handle,
struct dispatcher_shared_arm *disp =
get_dispatcher_shared_arm(handle);
- // make sure arguments survive call to disp_save_context()
- // not sure if our code has a subtle bug or whether ARMv7 GCC
- // (arm-linux-gnueabi-gcc (Ubuntu/Linaro 5.3.1-13ubuntu3) 5.3.1 20160330)
- // is overeager when optimizing code that calls into
- // __attribute__((naked)) functions. -SG, 2016-04-06
- __asm volatile("" : /*out*/ : /*in*/ : "r0", "r1", "r2" );
-
assert_disabled(curdispatcher() == handle);
assert_disabled(disp->d.disabled);
assert_disabled(disp->d.haswork);
@@ -195,13 +188,6 @@ void disp_save(dispatcher_handle_t handle,
struct dispatcher_shared_arm *disp =
get_dispatcher_shared_arm(handle);
- // make sure arguments survive call to disp_save_context()
- // not sure if our code has a subtle bug or whether ARMv7 GCC
- // (arm-linux-gnueabi-gcc (Ubuntu/Linaro 5.3.1-13ubuntu3) 5.3.1 20160330)
- // is overeager when optimizing code that calls into
- // __attribute__((naked)) functions. -SG, 2016-04-06
- __asm volatile("" : /*out*/ : /*in*/ : "r0", "r1", "r2" );
-
assert_disabled(curdispatcher() == handle);
assert_disabled(disp->d.disabled);
