portCHECK_IF_IN_ISR() in SMP Kernel

Hi All, I’ve been working on porting the SMP kernel to Cortex-A53 SoC. I do see portCHECK_IF_IN_ISR() macro is added in the SMP kernel. In the RP2040 Demo, I see the porting code that the Cortex-M IPSR (Interrupt Program Status Register) is used to implement portCHECK_IF_IN_ISR() function. In Cortex-A53 processor, which CPU (or GIC) register is suitable for this purpose? Or, do I have to implement that functionality with software?

Not a direct reply to your question - but for consistency the preference is to use the name xPortIsInsideInterrupt() rather than portCHECK_IF_IN_ISR() - as per the Cortex-M port example here: FreeRTOS-Kernel/portmacro.h at V10.4.5 · FreeRTOS/FreeRTOS-Kernel · GitHub

Would you be able to use ICC_RPR - Documentation – Arm Developer


Thanks for your reply. Yes, ICC_RPR_EL1 looks like a right one. If it reports the idle priority as the current running priority, then a processor runs a thread.