Hello,
I am upgrading to FreeRTOS Kernel v11.3.0 on MicroBlazeV9 and I get build errors in portasm.S:
-
portSLR_OFFSETundefined -
portSHR_OFFSETundefined
My design uses MicroBlaze Hardware Stack Protection (XPAR_MICROBLAZE_USE_STACK_PROTECTION is enabled in bsp). The port assembly still saves/restores rslr and rshr, but the required stack frame offsets (portSLR_OFFSET, portSHR_OFFSET) are missing in the current FreeRTOS v11.3.0 port.
It appears these definitions existed in older FreeRTOS versions but were removed or changed around commit 5040a67.
According to MicroBlaze document, it provides SLR/SHR registers when stack protection is enabled, so the hardware feature itself is supported.
#if( XPAR_MICROBLAZE_USE_STACK_PROTECTION )
/* Restore the stack limits – must not load from r1 (Stack Pointer)
because if the address of load or store instruction is out of range,
it will trigger Stack Protection Violation exception. */
or r18, r0, r1
lwi r12, r18, portSLR_OFFSET
mts rslr, r12
lwi r12, r18, portSHR_OFFSET
mts rshr, r12
#endif
I am trying to understand Where are portSLR_OFFSET and portSHR_OFFSET supposed to be defined in the FreeRTOS v11.3.0 MicroBlaze port—are they expected to come from the BSP, FreeRTOS port layer, or Xilinx/MicroBlaze headers? Was their removal intentional in newer releases, and what is the correct replacement approach?
Have a good day.