Skip to content

Commit 68ddb32

Browse files
sviaunxpsviauaggarg
authored
Handle interrupt acknowledge register in Cortex-A53 SRE port (#392)
Let the FreeRTOS IRQ handler properly store and restore the ICCIAR register value around the vApplicationIRQHandler() call. Signed-off-by: Stephane Viau <[email protected]> Co-authored-by: Stephane Viau <[email protected]> Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
1 parent a030d0a commit 68ddb32

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

portable/GCC/ARM_CA53_64_BIT_SRE/portASM.S

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@ FreeRTOS_IRQ_Handler:
303303
/* Maintain the interrupt nesting information across the function call. */
304304
STP X1, X5, [SP, #-0x10]!
305305

306+
/* Read value from the interrupt acknowledge register, which is stored in W0
307+
for future parameter and interrupt clearing use. */
308+
MRS X0, S3_0_C12_C12_0 /* read ICC_IAR1_EL1 and store ICCIAR in X0 as parameter */
309+
310+
/* Maintain the ICCIAR value across the function call. */
311+
STP X0, X1, [SP, #-0x10]!
312+
306313
/* Call the C handler. */
307314
BL vApplicationIRQHandler
308315

@@ -311,6 +318,12 @@ FreeRTOS_IRQ_Handler:
311318
DSB SY
312319
ISB SY
313320

321+
/* Restore the ICCIAR value. */
322+
LDP X0, X1, [SP], #0x10
323+
324+
/* End IRQ processing by writing ICCIAR to the EOI register. */
325+
MSR S3_0_C12_C12_1, X0 /* ICC_EOIR1_EL1 */
326+
314327
/* Restore the critical nesting count. */
315328
LDP X1, X5, [SP], #0x10
316329
STR X1, [X5]

0 commit comments

Comments
 (0)