Skip to content

Commit 007223c

Browse files
committed
RTX - fix missing header guards for Cortex-M4 (GCC ARM)
The HAL CM4 is valid only for FPU present. These guards were added to mbed SDK, as there are targets Cortex-M4.
1 parent aa6f0b8 commit 007223c

File tree

1 file changed

+20
-0
lines changed
  • libraries/rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC

1 file changed

+20
-0
lines changed

libraries/rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC/HAL_CM4.S

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,12 @@ SVC_Handler_Veneer:
220220

221221
SVC_ContextSave:
222222
TST LR,#0x10 /* is it extended frame? */
223+
#ifdef __FPU_PRESENT
223224
ITTE EQ
224225
VSTMDBEQ R12!,{S16-S31} /* yes, stack also VFP hi-regs */
226+
#else
227+
ITE EQ
228+
#endif
225229
MOVEQ R0,#0x01 /* os_tsk->stack_frame val */
226230
MOVNE R0,#0x00
227231
STRB R0,[R1,#TCB_STACKF] /* os_tsk.run->stack_frame = val */
@@ -239,10 +243,16 @@ SVC_ContextRestore:
239243
LDMIA R12!,{R4-R11} /* Restore New Context */
240244
LDRB R0,[R2,#TCB_STACKF] /* Stack Frame */
241245
CMP R0,#0 /* Basic/Extended Stack Frame */
246+
#ifdef __FPU_PRESENT
242247
ITEE EQ
248+
#else
249+
ITE EQ
250+
#endif
243251
MVNEQ LR,#~0xFFFFFFFD /* set EXC_RETURN value */
244252
MVNNE LR,#~0xFFFFFFED
253+
#ifdef __FPU_PRESENT
245254
VLDMIANE R12!,{S16-S31} /* restore VFP hi-registers */
255+
#endif
246256
MSR PSP,R12 /* Write PSP */
247257

248258
SVC_Exit:
@@ -313,8 +323,12 @@ Sys_Switch:
313323

314324
MRS R12,PSP /* Read PSP */
315325
TST LR,#0x10 /* is it extended frame? */
326+
#ifdef __FPU_PRESENT
316327
ITTE EQ
317328
VSTMDBEQ R12!,{S16-S31} /* yes, stack also VFP hi-regs */
329+
#else
330+
ITE EQ
331+
#endif
318332
MOVEQ R0,#0x01 /* os_tsk->stack_frame val */
319333
MOVNE R0,#0x00
320334
STRB R0,[R1,#TCB_STACKF] /* os_tsk.run->stack_frame = val */
@@ -331,10 +345,16 @@ Sys_Switch:
331345
LDMIA R12!,{R4-R11} /* Restore New Context */
332346
LDRB R0,[R2,#TCB_STACKF] /* Stack Frame */
333347
CMP R0,#0 /* Basic/Extended Stack Frame */
348+
#ifdef __FPU_PRESENT
334349
ITEE EQ
350+
#else
351+
ITE EQ
352+
#endif
335353
MVNEQ LR,#~0xFFFFFFFD /* set EXC_RETURN value */
336354
MVNNE LR,#~0xFFFFFFED
355+
#ifdef __FPU_PRESENT
337356
VLDMIANE R12!,{S16-S31} /* restore VFP hi-registers */
357+
#endif
338358
MSR PSP,R12 /* Write PSP */
339359

340360
Sys_Exit:

0 commit comments

Comments
 (0)