Skip to content

Commit

Permalink
RTOS2/RTX: Fixed compiler issues for IAR.
Browse files Browse the repository at this point in the history
  • Loading branch information
JonatanAntoni committed Oct 18, 2017
1 parent b91922a commit ef55319
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 6 additions & 7 deletions CMSIS/RTOS2/RTX/Source/IAR/irq_ca.s
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ TCB_SP_OFS EQU 56 ; osRtxThread_t.sp offset


PRESERVE8
ARM


SECTION .rodata:DATA:NOROOT(2)
Expand Down Expand Up @@ -370,19 +369,19 @@ osRtxContextSave

VMRS R2, FPSCR
STMDB R3!, {R2,R12} ; Push FPSCR, maintain 8-byte alignment
IF {TARGET_FEATURE_EXTENSION_REGISTER_COUNT} == 16
#if (TARGET_FEATURE_EXTENSION_REGISTER_COUNT == 16)
VSTMDB R3!, {D0-D15}
LDRB R2, [R0, #TCB_SP_FRAME] ; Record in TCB that VFP/D16 state is stacked
ORR R2, R2, #2
STRB R2, [R0, #TCB_SP_FRAME]
ENDIF
IF {TARGET_FEATURE_EXTENSION_REGISTER_COUNT} == 32
#endif
#if (TARGET_FEATURE_EXTENSION_REGISTER_COUNT == 32)
VSTMDB R3!, {D0-D15}
VSTMDB R3!, {D16-D31}
LDRB R2, [R0, #TCB_SP_FRAME] ; Record in TCB that NEON/D32 state is stacked
ORR R2, R2, #4
STRB R2, [R0, #TCB_SP_FRAME]
ENDIF
#endif

osRtxContextSave1
STR R3, [R0, #TCB_SP_OFS] ; Store user sp to osRtxInfo.thread.run.curr
Expand All @@ -399,9 +398,9 @@ osRtxContextRestore
MCR p15, 0, R2, c1, c0, 2 ; Write CPACR
BEQ osRtxContextRestore1 ; No VFP
ISB ; Only sync if we enabled VFP, otherwise we will context switch before next VFP instruction anyway
IF {TARGET_FEATURE_EXTENSION_REGISTER_COUNT} == 32
#if (TARGET_FEATURE_EXTENSION_REGISTER_COUNT == 32)
VLDMIA R3!, {D16-D31}
ENDIF
#endif
VLDMIA R3!, {D0-D15}
LDR R2, [R3]
VMSR FPSCR, R2
Expand Down
2 changes: 2 additions & 0 deletions CMSIS/RTOS2/RTX/Source/rtx_core_ca.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ __STATIC_INLINE uint32_t __get_PSP (void) {
register uint32_t ret;

__asm volatile (
#if !defined ( __ICCARM__ )
".syntax unified\n\t"
".arm\n\t"
#endif
"sub sp,sp,#4\n\t"
"stm sp,{sp}^\n\t"
"pop {%[ret]}\n\t"
Expand Down

0 comments on commit ef55319

Please sign in to comment.