Skip to content

Commit 05fa9d3

Browse files
Merge pull request #260 from deepikabhavnani/develop
Systick handler switch to secure/nonsecure
2 parents bba680e + 05a741a commit 05fa9d3

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

CMSIS/RTOS2/RTX/Source/ARM/irq_armv8mbl.s

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ Sys_ContextSave
234234
BL TZ_StoreContext_S ; Store secure context
235235
MOV LR,R7 ; Set EXC_RETURN
236236
POP {R1,R2,R3,R7} ; Restore registers
237-
LSLS R7,R7,#25 ; Check domain of interrupted thread
238-
BMI Sys_ContextSave1 ; Branch if secure
237+
MOV R0,LR ; Get EXC_RETURN
238+
LSLS R0,R0,#25 ; Check domain of interrupted thread
239+
BPL Sys_ContextSave1 ; Branch if non-secure
239240
MRS R0,PSP ; Get PSP
240241
STR R0,[R1,#TCB_SP_OFS] ; Store SP
241242
B Sys_ContextSave2

CMSIS/RTOS2/RTX/Source/GCC/irq_armv8mbl.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,9 @@ Sys_ContextSave:
238238
BL TZ_StoreContext_S // Store secure context
239239
MOV LR,R7 // Set EXC_RETURN
240240
POP {R1,R2,R3,R7} // Restore registers
241-
LSLS R7,R7,#25 // Check domain of interrupted thread
242-
BMI Sys_ContextSave1 // Branch if secure
241+
MOV R0,LR // Get EXC_RETURN
242+
LSLS R0,R0,#25 // Check domain of interrupted thread
243+
BPL Sys_ContextSave1 // Branch if non-secure
243244
MRS R0,PSP // Get PSP
244245
STR R0,[R1,#TCB_SP_OFS] // Store SP
245246
B Sys_ContextSave2

CMSIS/RTOS2/RTX/Source/IAR/irq_armv8mbl_common.s

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,9 @@ Sys_ContextSave
226226
BL TZ_StoreContext_S ; Store secure context
227227
MOV LR,R7 ; Set EXC_RETURN
228228
POP {R1,R2,R3,R7} ; Restore registers
229-
LSLS R7,R7,#25 ; Check domain of interrupted thread
230-
BMI Sys_ContextSave1 ; Branch if secure
229+
MOV R0,LR ; Get EXC_RETURN
230+
LSLS R0,R0,#25 ; Check domain of interrupted thread
231+
BPL Sys_ContextSave1 ; Branch if non-secure
231232
MRS R0,PSP ; Get PSP
232233
STR R0,[R1,#TCB_SP_OFS] ; Store SP
233234
B Sys_ContextSave2

0 commit comments

Comments
 (0)