Go to the documentation of this file. 29 #ifndef STACK_MACROS_H 30 #define STACK_MACROS_H 48 #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) 51 #define taskCHECK_FOR_STACK_OVERFLOW() \ 54 if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ 56 vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 63 #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) 66 #define taskCHECK_FOR_STACK_OVERFLOW() \ 70 if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ 72 vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 79 #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) 81 #define taskCHECK_FOR_STACK_OVERFLOW() \ 83 const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ 84 const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \ 86 if( ( pulStack[ 0 ] != ulCheckValue ) || \ 87 ( pulStack[ 1 ] != ulCheckValue ) || \ 88 ( pulStack[ 2 ] != ulCheckValue ) || \ 89 ( pulStack[ 3 ] != ulCheckValue ) ) \ 91 vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 98 #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) 100 #define taskCHECK_FOR_STACK_OVERFLOW() \ 102 int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ 103 static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 104 tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 105 tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 106 tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 107 tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ 110 pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ 113 if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ 115 vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 123 #ifndef taskCHECK_FOR_STACK_OVERFLOW 124 #define taskCHECK_FOR_STACK_OVERFLOW()