Change to MOVS for all targets

pull/9791/head
Sarah Marsh 2019-02-22 13:37:34 +00:00
parent 3c51257524
commit 3b98ebc5be
1 changed files with 1 additions and 11 deletions

View File

@ -161,11 +161,7 @@ static void powerdown_scb(uint32_t vtor)
__asm static void start_new_application(void *sp, void *pc)
{
#if defined(__CORTEX_M0PLUS)
MOVS R2, #0
#else
MOV R2, #0
#endif
MSR CONTROL, R2 // Switch to main stack
MOV SP, R0
MSR PRIMASK, R2 // Enable interrupts
@ -177,13 +173,7 @@ __asm static void start_new_application(void *sp, void *pc)
void start_new_application(void *sp, void *pc)
{
__asm volatile(
#if defined(__CORTEX_M0PLUS)
"movs r2, #0 \n" // No MOVW instruction on Cortex-M0+
#else
"movw r2, #0 \n" // Fail to compile "mov r2, #0" with ARMC6. Replace with MOVW.
#endif
// We needn't "movt r2, #0" immediately following because MOVW
// will zero-extend the 16-bit immediate.
"movs r2, #0 \n"
"msr control, r2 \n" // Switch to main stack
"mov sp, %0 \n"
"msr primask, r2 \n" // Enable interrupts