Go to the documentation of this file. 70 #ifndef STACK_MACROS_H 71 #define STACK_MACROS_H 89 #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) 92 #define taskCHECK_FOR_STACK_OVERFLOW() \ 95 if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ 97 vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 104 #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) 107 #define taskCHECK_FOR_STACK_OVERFLOW() \ 111 if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ 113 vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 120 #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) 122 #define taskCHECK_FOR_STACK_OVERFLOW() \ 124 const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ 125 const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \ 127 if( ( pulStack[ 0 ] != ulCheckValue ) || \ 128 ( pulStack[ 1 ] != ulCheckValue ) || \ 129 ( pulStack[ 2 ] != ulCheckValue ) || \ 130 ( pulStack[ 3 ] != ulCheckValue ) ) \ 132 vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 139 #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) 141 #define taskCHECK_FOR_STACK_OVERFLOW() \ 143 int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ 144 static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 145 tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 146 tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 147 tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 148 tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ 151 pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ 154 if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ 156 vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 164 #ifndef taskCHECK_FOR_STACK_OVERFLOW 165 #define taskCHECK_FOR_STACK_OVERFLOW()