Skip to content

Commit 0226b11

Browse files
VladimirUmekTomoYamanaka
authored andcommitted
RTX5: disabled OS Tick interrupt during post processing in IRQ handler for Cortex-A devices
1 parent 9c62ea3 commit 0226b11

File tree

1 file changed

+18
-5
lines changed
  • rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_CORTEX_A

1 file changed

+18
-5
lines changed

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_CORTEX_A/irq_ca.S

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,22 +212,35 @@ IRQ_End
212212
LDR R0, =SVC_Active
213213
LDRB R0, [R0] ; Load SVC_Active flag
214214
CMP R0, #0
215-
BNE IRQ_SwitchCheck ; Skip post processing when SVC active
215+
BNE IRQ_Exit ; SVC active, exit from IRQ handler
216216

217217
; RTX IRQ post processing check
218+
LDR R4, =IRQ_PendSV ; Load address of IRQ_PendSV flag
219+
LDRB R0, [R4] ; Load PendSV flag
220+
CMP R0, #1 ; Compare PendSV value
221+
BNE IRQ_SwitchCheck ; Skip post processing if not pending
222+
218223
PUSH {R5, R6} ; Save user R5 and R6
219-
MOV R6, #0
220-
LDR R5, =IRQ_PendSV ; Load address of IRQ_PendSV flag
224+
; Disable OS Tick
225+
LDR R5, =osRtxInfo ; Load address of osRtxInfo
226+
LDR R5, [R5, #I_TICK_IRQN_OFS] ; Load OS Tick irqn
227+
MOV R0, R5 ; Set it as function parameter
228+
BLX IRQ_Disable ; Disable OS Tick interrupt
229+
MOV R6, #0 ; Set PendSV clear value
221230
B IRQ_PendCheck
222231
IRQ_PendExec
223-
STRB R6, [R5] ; Clear PendSV flag
232+
STRB R6, [R4] ; Clear PendSV flag
224233
CPSIE i ; Re-enable interrupts
225234
BLX osRtxPendSV_Handler ; Post process pending objects
226235
CPSID i ; Disable interrupts
227236
IRQ_PendCheck
228-
LDRB R0, [R5] ; Load PendSV flag
237+
LDRB R0, [R4] ; Load PendSV flag
229238
CMP R0, #1 ; Compare PendSV value
230239
BEQ IRQ_PendExec ; Branch to IRQ_PendExec if PendSV is set
240+
241+
; Re-enable OS Tick
242+
MOV R0, R5 ; Restore irqn as function parameter
243+
BLX IRQ_Enable ; Enable OS Tick interrupt
231244
POP {R5, R6} ; Restore user R5 and R6
232245

233246
IRQ_SwitchCheck

0 commit comments

Comments
 (0)