@@ -267,6 +267,14 @@ vPortRestoreTaskContext:
267
267
268
268
/ ******************************************************************************
269
269
* 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
270
278
***************************************************************************** /
271
279
. align 8
272
280
.type FreeRTOS_IRQ_Handler , %function
@@ -303,11 +311,11 @@ FreeRTOS_IRQ_Handler:
303
311
/ * Maintain the interrupt nesting information across the function call . * /
304
312
STP X1 , X5 , [ SP , # - 0x10 ] !
305
313
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. * /
309
317
310
- / * Maintain the ICCIAR value across the function call . * /
318
+ / * Maintain the interrupt ID value across the function call . * /
311
319
STP X0 , X1 , [ SP , # - 0x10 ] !
312
320
313
321
/ * Call the C handler. * /
@@ -318,11 +326,11 @@ FreeRTOS_IRQ_Handler:
318
326
DSB SY
319
327
ISB SY
320
328
321
- / * Restore the ICCIAR value. * /
329
+ / * Restore the interrupt ID value. * /
322
330
LDP X0 , X1 , [ SP ], # 0x10
323
331
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. * /
326
334
327
335
/ * Restore the critical nesting count. * /
328
336
LDP X1 , X5 , [ SP ], # 0x10
0 commit comments