mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-11-05 03:02:36 -05:00
Implement MicroBlazeV9 stack protection (#523)
* Implement stack protection for MicroBlaze (without MPU wrappers)
This commit is contained in:
parent
bfe057367d
commit
63f86fc7a2
3 changed files with 75 additions and 11 deletions
|
|
@ -105,7 +105,11 @@ static XIntc xInterruptControllerInstance;
|
|||
*
|
||||
* See the portable.h header file.
|
||||
*/
|
||||
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
||||
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, StackType_t *pxEndOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||
#else
|
||||
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||
#endif
|
||||
{
|
||||
extern void *_SDA2_BASE_, *_SDA_BASE_;
|
||||
const uint32_t ulR2 = ( uint32_t ) &_SDA2_BASE_;
|
||||
|
|
@ -122,6 +126,14 @@ extern void _start1( void );
|
|||
*pxTopOfStack = ( StackType_t ) 0x00000000;
|
||||
pxTopOfStack--;
|
||||
|
||||
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
||||
/* Store the stack limits. */
|
||||
*pxTopOfStack = (StackType_t) (pxTopOfStack + 3);
|
||||
pxTopOfStack--;
|
||||
*pxTopOfStack = (StackType_t) pxEndOfStack;
|
||||
pxTopOfStack--;
|
||||
#endif
|
||||
|
||||
#if( XPAR_MICROBLAZE_USE_FPU != 0 )
|
||||
/* The FSR value placed in the initial task context is just 0. */
|
||||
*pxTopOfStack = portINITIAL_FSR;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue