Skip to content

Commit 4145cc0

Browse files
authored
Merge pull request #6029 from deepikabhavnani/update_context_switch_files
RTX5: Pre-processor defines used for assembly
2 parents 342e3ca + 1825ec6 commit 4145cc0

File tree

17 files changed

+25
-60
lines changed

17 files changed

+25
-60
lines changed

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M23/irq_armv8mbl.S

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
; */
2525

2626

27-
IF :LNOT::DEF:__DOMAIN_NS
27+
#ifndef __DOMAIN_NS
2828
__DOMAIN_NS EQU 0
29-
ENDIF
29+
#endif
3030

3131
I_T_RUN_OFS EQU 20 ; osRtxInfo.thread.run offset
3232
TCB_SM_OFS EQU 48 ; TCB.stack_mem offset
@@ -225,8 +225,9 @@ Sys_ContextSave
225225
BL TZ_StoreContext_S ; Store secure context
226226
MOV LR,R7 ; Set EXC_RETURN
227227
POP {R1,R2,R3,R7} ; Restore registers
228-
LSLS R7,R7,#25 ; Check domain of interrupted thread
229-
BMI Sys_ContextSave1 ; Branch if secure
228+
MOV R0,LR ; Get EXC_RETURN
229+
LSLS R0,R0,#25 ; Check domain of interrupted thread
230+
BPL Sys_ContextSave1 ; Branch if non-secure
230231
MRS R0,PSP ; Get PSP
231232
STR R0,[R1,#TCB_SP_OFS] ; Store SP
232233
B Sys_ContextSave2

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M23/irq_armv8mbl_ns.S

Lines changed: 0 additions & 3 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M33/irq_armv8mml.S

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@
2424
; */
2525

2626

27-
IF :LNOT::DEF:__DOMAIN_NS
27+
#ifndef __DOMAIN_NS
2828
__DOMAIN_NS EQU 0
29-
ENDIF
29+
#endif
3030

31-
IF ({FPU}="FPv5-SP") || ({FPU}="FPv5_D16")
32-
__FPU_USED EQU 1
33-
ELSE
31+
#ifndef __FPU_USED
3432
__FPU_USED EQU 0
35-
ENDIF
33+
#endif
3634

3735
I_T_RUN_OFS EQU 20 ; osRtxInfo.thread.run offset
3836
TCB_SM_OFS EQU 48 ; TCB.stack_mem offset

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M33/irq_armv8mml_ns.S

Lines changed: 0 additions & 3 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M23/irq_armv8mbl.S

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
.file "irq_armv8mbl.S"
2828
.syntax unified
2929

30-
.ifndef __DOMAIN_NS
30+
#ifndef __DOMAIN_NS
3131
.equ __DOMAIN_NS, 0
32-
.endif
32+
#endif
3333

3434
.equ I_T_RUN_OFS, 20 // osRtxInfo.thread.run offset
3535
.equ TCB_SM_OFS, 48 // TCB.stack_mem offset
@@ -229,8 +229,9 @@ Sys_ContextSave:
229229
BL TZ_StoreContext_S // Store secure context
230230
MOV LR,R7 // Set EXC_RETURN
231231
POP {R1,R2,R3,R7} // Restore registers
232-
LSLS R7,R7,#25 // Check domain of interrupted thread
233-
BMI Sys_ContextSave1 // Branch if secure
232+
MOV R0,LR // Get EXC_RETURN
233+
LSLS R0,R0,#25 // Check domain of interrupted thread
234+
BPL Sys_ContextSave1 // Branch if not secure
234235
MRS R0,PSP // Get PSP
235236
STR R0,[R1,#TCB_SP_OFS] // Store SP
236237
B Sys_ContextSave2

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M23/irq_armv8mbl_ns.S

Lines changed: 0 additions & 3 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M33/irq_armv8mml.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
.file "irq_armv8mml.S"
2828
.syntax unified
2929

30-
.ifndef __DOMAIN_NS
30+
+#ifndef __DOMAIN_NS
3131
.equ __DOMAIN_NS, 0
32-
.endif
32+
#endif
3333

34-
.ifndef __FPU_USED
34+
#ifndef __FPU_USED
3535
.equ __FPU_USED, 0
36-
.endif
36+
#endif
3737

3838
.equ I_T_RUN_OFS, 20 // osRtxInfo.thread.run offset
3939
.equ TCB_SM_OFS, 48 // TCB.stack_mem offset

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M33/irq_armv8mml_fp.S

Lines changed: 0 additions & 3 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M33/irq_armv8mml_fp_ns.S

Lines changed: 0 additions & 4 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M33/irq_armv8mml_ns.S

Lines changed: 0 additions & 3 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M23/irq_armv8mbl.S

Lines changed: 0 additions & 5 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M23/irq_armv8mbl_common.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,9 @@ Sys_ContextSave
218218
BL TZ_StoreContext_S ; Store secure context
219219
MOV LR,R7 ; Set EXC_RETURN
220220
POP {R1,R2,R3,R7} ; Restore registers
221-
LSLS R7,R7,#25 ; Check domain of interrupted thread
222-
BMI Sys_ContextSave1 ; Branch if secure
221+
MOV R0,LR ; Get EXC_RETURN
222+
LSLS R0,R0,#25 ; Check domain of interrupted thread
223+
BPL Sys_ContextSave1 ; Branch if not secure
223224
MRS R0,PSP ; Get PSP
224225
STR R0,[R1,#TCB_SP_OFS] ; Store SP
225226
B Sys_ContextSave2

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M23/irq_armv8mbl_ns.S

Lines changed: 0 additions & 5 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M33/irq_armv8mml.S

Lines changed: 0 additions & 5 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M33/irq_armv8mml_ns.S

Lines changed: 0 additions & 5 deletions
This file was deleted.

tools/importer/cmsis_importer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@
148148
"e83fd0099a69e6eb865e4e6fcadbfb1328c04c85",
149149
"a019acaf8d6fb1f0512414d072f667cc2749b1d9",
150150
"a884fdc0639ae4e17299838ec9de4fddd83cf93c",
151-
"6c827cb5879bc096e45efd992dfadcb96c1d50bc"
151+
"6c827cb5879bc096e45efd992dfadcb96c1d50bc",
152+
"919282322e106b82fea50878f41b6c75a7eb356b"
152153
]
153154
}
154155

tools/toolchains/gcc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ def __init__(self, target, notify=None, macros=None,
8888

8989
if target.core == "Cortex-M23" or target.core == "Cortex-M33":
9090
self.cpu.append("-mcmse")
91+
elif target.core == "Cortex-M23-NS" or target.core == "Cortex-M33-NS":
92+
self.flags["ld"].append("-D__DOMAIN_NS=1")
9193

9294
self.flags["common"] += self.cpu
9395

0 commit comments

Comments
 (0)