mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-07-10 13:29:45 -04:00
Fix MicroBlaze stack protection context layout
Account for MicroBlaze stack protection registers when sizing the saved context and assigning SLR/SHR offsets for 32-bit and 64-bit builds. Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
This commit is contained in:
parent
a50edad08b
commit
bb002b49ff
1 changed files with 38 additions and 0 deletions
|
|
@ -37,6 +37,15 @@
|
||||||
/* The context is oversized to allow functions called from the ISR to write
|
/* The context is oversized to allow functions called from the ISR to write
|
||||||
back into the caller stack. */
|
back into the caller stack. */
|
||||||
#if defined (__arch64__)
|
#if defined (__arch64__)
|
||||||
|
#if( XPAR_MICROBLAZE_USE_STACK_PROTECTION )
|
||||||
|
#if( XPAR_MICROBLAZE_USE_FPU != 0 )
|
||||||
|
#define portCONTEXT_SIZE 288
|
||||||
|
#define portMINUS_CONTEXT_SIZE -288
|
||||||
|
#else
|
||||||
|
#define portCONTEXT_SIZE 280
|
||||||
|
#define portMINUS_CONTEXT_SIZE -280
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
#if( XPAR_MICROBLAZE_USE_FPU != 0 )
|
#if( XPAR_MICROBLAZE_USE_FPU != 0 )
|
||||||
#define portCONTEXT_SIZE 272
|
#define portCONTEXT_SIZE 272
|
||||||
#define portMINUS_CONTEXT_SIZE -272
|
#define portMINUS_CONTEXT_SIZE -272
|
||||||
|
|
@ -44,6 +53,16 @@ back into the caller stack. */
|
||||||
#define portCONTEXT_SIZE 264
|
#define portCONTEXT_SIZE 264
|
||||||
#define portMINUS_CONTEXT_SIZE -264
|
#define portMINUS_CONTEXT_SIZE -264
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if( XPAR_MICROBLAZE_USE_STACK_PROTECTION )
|
||||||
|
#if( XPAR_MICROBLAZE_USE_FPU != 0 )
|
||||||
|
#define portCONTEXT_SIZE 144
|
||||||
|
#define portMINUS_CONTEXT_SIZE -144
|
||||||
|
#else
|
||||||
|
#define portCONTEXT_SIZE 140
|
||||||
|
#define portMINUS_CONTEXT_SIZE -140
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#if( XPAR_MICROBLAZE_USE_FPU != 0 )
|
#if( XPAR_MICROBLAZE_USE_FPU != 0 )
|
||||||
#define portCONTEXT_SIZE 136
|
#define portCONTEXT_SIZE 136
|
||||||
|
|
@ -53,6 +72,7 @@ back into the caller stack. */
|
||||||
#define portMINUS_CONTEXT_SIZE -132
|
#define portMINUS_CONTEXT_SIZE -132
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Offsets from the stack pointer at which saved registers are placed. */
|
/* Offsets from the stack pointer at which saved registers are placed. */
|
||||||
#if defined (__arch64__)
|
#if defined (__arch64__)
|
||||||
|
|
@ -88,7 +108,16 @@ back into the caller stack. */
|
||||||
#define portR2_OFFSET 240
|
#define portR2_OFFSET 240
|
||||||
#define portCRITICAL_NESTING_OFFSET 248
|
#define portCRITICAL_NESTING_OFFSET 248
|
||||||
#define portMSR_OFFSET 256
|
#define portMSR_OFFSET 256
|
||||||
|
#if( XPAR_MICROBLAZE_USE_FPU != 0 )
|
||||||
#define portFSR_OFFSET 264
|
#define portFSR_OFFSET 264
|
||||||
|
#if( XPAR_MICROBLAZE_USE_STACK_PROTECTION )
|
||||||
|
#define portSLR_OFFSET 272
|
||||||
|
#define portSHR_OFFSET 280
|
||||||
|
#endif
|
||||||
|
#elif( XPAR_MICROBLAZE_USE_STACK_PROTECTION )
|
||||||
|
#define portSLR_OFFSET 264
|
||||||
|
#define portSHR_OFFSET 272
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define portR31_OFFSET 4
|
#define portR31_OFFSET 4
|
||||||
#define portR30_OFFSET 8
|
#define portR30_OFFSET 8
|
||||||
|
|
@ -122,7 +151,16 @@ back into the caller stack. */
|
||||||
#define portR2_OFFSET 120
|
#define portR2_OFFSET 120
|
||||||
#define portCRITICAL_NESTING_OFFSET 124
|
#define portCRITICAL_NESTING_OFFSET 124
|
||||||
#define portMSR_OFFSET 128
|
#define portMSR_OFFSET 128
|
||||||
|
#if( XPAR_MICROBLAZE_USE_FPU != 0 )
|
||||||
#define portFSR_OFFSET 132
|
#define portFSR_OFFSET 132
|
||||||
|
#if( XPAR_MICROBLAZE_USE_STACK_PROTECTION )
|
||||||
|
#define portSLR_OFFSET 136
|
||||||
|
#define portSHR_OFFSET 140
|
||||||
|
#endif
|
||||||
|
#elif( XPAR_MICROBLAZE_USE_STACK_PROTECTION )
|
||||||
|
#define portSLR_OFFSET 132
|
||||||
|
#define portSHR_OFFSET 136
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue