Skip to content

Commit 06fb777

Browse files
authored
Update comments for the ARM_CA53_64_BIT_SRE port (#403)
Mention that FreeRTOS_IRQ_Handler should not be used for FIQs and the reason for assuming Group 1 for Interrupt Acknowledge and End Of Interrupt registers. Signed-off-by: Gaurav Aggarwal <[email protected]>
1 parent 68ddb32 commit 06fb777

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

portable/GCC/ARM_CA53_64_BIT_SRE/portASM.S

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,14 @@ vPortRestoreTaskContext:
267267

268268
/******************************************************************************
269269
* FreeRTOS_IRQ_Handler handles IRQ entry and exit.
270+
271+
* This handler is supposed to be used only for IRQs and never for FIQs. Per ARM
272+
* GIC documentation [1], Group 0 interrupts are always signaled as FIQs. Since
273+
* this handler is only for IRQs, We can safely assume Group 1 while accessing
274+
* Interrupt Acknowledge and End Of Interrupt registers and therefore, use
275+
* ICC_IAR1_EL1 and ICC_EOIR1_EL1.
276+
*
277+
* [1] https://developer.arm.com/documentation/198123/0300/Arm-CoreLink-GIC-fundamentals
270278
*****************************************************************************/
271279
.align 8
272280
.type FreeRTOS_IRQ_Handler, %function
@@ -303,11 +311,11 @@ FreeRTOS_IRQ_Handler:
303311
/* Maintain the interrupt nesting information across the function call. */
304312
STP X1, X5, [SP, #-0x10]!
305313

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 */
314+
/* Read interrupt ID from the interrupt acknowledge register and store it
315+
in X0 for future parameter and interrupt clearing use. */
316+
MRS X0, S3_0_C12_C12_0 /* S3_0_C12_C12_0 is ICC_IAR1_EL1. */
309317

310-
/* Maintain the ICCIAR value across the function call. */
318+
/* Maintain the interrupt ID value across the function call. */
311319
STP X0, X1, [SP, #-0x10]!
312320

313321
/* Call the C handler. */
@@ -318,11 +326,11 @@ FreeRTOS_IRQ_Handler:
318326
DSB SY
319327
ISB SY
320328

321-
/* Restore the ICCIAR value. */
329+
/* Restore the interrupt ID value. */
322330
LDP X0, X1, [SP], #0x10
323331

324-
/* End IRQ processing by writing ICCIAR to the EOI register. */
325-
MSR S3_0_C12_C12_1, X0 /* ICC_EOIR1_EL1 */
332+
/* End IRQ processing by writing interrupt ID value to the EOI register. */
333+
MSR S3_0_C12_C12_1, X0 /* S3_0_C12_C12_1 is ICC_EOIR1_EL1. */
326334

327335
/* Restore the critical nesting count. */
328336
LDP X1, X5, [SP], #0x10

0 commit comments

Comments
 (0)