Fixed RTOS support for Cortex-M4 without FPU

pull/1052/head
Christoph Plank 2015-04-18 16:32:59 +02:00
parent e66f9ff0aa
commit bd1bfb5c4b
1 changed files with 16 additions and 0 deletions

View File

@ -210,8 +210,12 @@ SVC_Handler_Veneer:
CBZ R1,SVC_Next /* Runtask deleted? */
TST LR,#0x10 /* is it extended frame? */
#ifdef __FPU_PRESENT
ITTE EQ
VSTMDBEQ R12!,{S16-S31} /* yes, stack also VFP hi-regs */
#else
ITE EQ
#endif
MOVEQ R0,#0x01 /* os_tsk->stack_frame val */
MOVNE R0,#0x00
STRB R0,[R1,#TCB_STACKF] /* os_tsk.run->stack_frame = val */
@ -229,8 +233,12 @@ SVC_Next:
LDMIA R12!,{R4-R11} /* Restore New Context */
LDRB R0,[R2,#TCB_STACKF] /* Stack Frame */
CMP R0,#0 /* Basic/Extended Stack Frame */
#ifdef __FPU_PRESENT
ITTE NE
VLDMIANE R12!,{S16-S31} /* restore VFP hi-registers */
#else
ITE NE
#endif
MVNNE LR,#~0xFFFFFFED /* set EXC_RETURN value */
MVNEQ LR,#~0xFFFFFFFD
MSR PSP,R12 /* Write PSP */
@ -303,8 +311,12 @@ Sys_Switch:
MRS R12,PSP /* Read PSP */
TST LR,#0x10 /* is it extended frame? */
#ifdef __FPU_PRESENT
ITTE EQ
VSTMDBEQ R12!,{S16-S31} /* yes, stack also VFP hi-regs */
#else
ITE EQ
#endif
MOVEQ R0,#0x01 /* os_tsk->stack_frame val */
MOVNE R0,#0x00
STRB R0,[R1,#TCB_STACKF] /* os_tsk.run->stack_frame = val */
@ -321,8 +333,12 @@ Sys_Switch:
LDMIA R12!,{R4-R11} /* Restore New Context */
LDRB R0,[R2,#TCB_STACKF] /* Stack Frame */
CMP R0,#0 /* Basic/Extended Stack Frame */
#ifdef __FPU_PRESENT
ITTE NE
VLDMIANE R12!,{S16-S31} /* restore VFP hi-registers */
#else
ITE NE
#endif
MVNNE LR,#~0xFFFFFFED /* set EXC_RETURN value */
MVNEQ LR,#~0xFFFFFFFD
MSR PSP,R12 /* Write PSP */