|
93 | 93 | const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ |
94 | 94 | const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \ |
95 | 95 | \ |
| 96 | + char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ |
96 | 97 | if( ( pulStack[ 0 ] != ulCheckValue ) || \ |
97 | 98 | ( pulStack[ 1 ] != ulCheckValue ) || \ |
98 | 99 | ( pulStack[ 2 ] != ulCheckValue ) || \ |
99 | 100 | ( pulStack[ 3 ] != ulCheckValue ) ) \ |
100 | 101 | { \ |
101 | | - char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ |
| 102 | + vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ |
| 103 | + } \ |
| 104 | + \ |
| 105 | + /* Is the currently saved stack pointer within the stack limit? */ \ |
| 106 | + if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) \ |
| 107 | + { \ |
102 | 108 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ |
103 | 109 | } \ |
104 | 110 | } while( 0 ) |
|
120 | 126 | \ |
121 | 127 | pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ |
122 | 128 | \ |
| 129 | + char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ |
123 | 130 | /* Has the extremity of the task stack ever been written over? */ \ |
124 | 131 | if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ |
125 | 132 | { \ |
126 | | - char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ |
| 133 | + vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ |
| 134 | + } \ |
| 135 | + \ |
| 136 | + /* Is the currently saved stack pointer within the stack limit? */ \ |
| 137 | + if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \ |
| 138 | + { \ |
127 | 139 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ |
128 | 140 | } \ |
129 | 141 | } while( 0 ) |
|
0 commit comments