Ensure the PIC32 interrupt stack is 8 byte aligned for all values of configISR_STACK_SIZE.

This commit is contained in:
Richard Barry 2017-04-09 20:13:48 +00:00
parent 96db5a3600
commit 8ca40d80a9
4 changed files with 14 additions and 8 deletions

View file

@ -188,11 +188,11 @@ volatile UBaseType_t uxInterruptNesting = 0x01;
UBaseType_t uxSavedTaskStackPointer = 0;
/* The stack used by interrupt service routines that cause a context switch. */
StackType_t xISRStack[ configISR_STACK_SIZE ] = { 0 };
__attribute__ ((aligned(8))) StackType_t xISRStack[ configISR_STACK_SIZE ] = { 0 };
/* The top of stack value ensures there is enough space to store 6 registers on
the callers stack, as some functions seem to want to do this. */
const StackType_t * const xISRStackTop = &( xISRStack[ configISR_STACK_SIZE - 7 ] );
const StackType_t * const xISRStackTop = &( xISRStack[ ( configISR_STACK_SIZE & ~portBYTE_ALIGNMENT_MASK ) - 8 ] );
/*-----------------------------------------------------------*/