|
88 | 88 |
|
89 | 89 | #if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
|
90 | 90 |
|
91 |
| - #define taskCHECK_FOR_STACK_OVERFLOW() \ |
92 |
| - do { \ |
93 |
| - const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ |
94 |
| - const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \ |
95 |
| - \ |
96 |
| - char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ |
97 |
| - if( ( pulStack[ 0 ] != ulCheckValue ) || \ |
98 |
| - ( pulStack[ 1 ] != ulCheckValue ) || \ |
99 |
| - ( pulStack[ 2 ] != ulCheckValue ) || \ |
100 |
| - ( pulStack[ 3 ] != ulCheckValue ) ) \ |
101 |
| - { \ |
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 |
| - { \ |
108 |
| - vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ |
109 |
| - } \ |
| 91 | + #define taskCHECK_FOR_STACK_OVERFLOW() \ |
| 92 | + do { \ |
| 93 | + const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ |
| 94 | + const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \ |
| 95 | + \ |
| 96 | + if( ( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) || \ |
| 97 | + ( pulStack[ 0 ] != ulCheckValue ) || \ |
| 98 | + ( pulStack[ 1 ] != ulCheckValue ) || \ |
| 99 | + ( pulStack[ 2 ] != ulCheckValue ) || \ |
| 100 | + ( pulStack[ 3 ] != ulCheckValue ) ) \ |
| 101 | + { \ |
| 102 | + char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ |
| 103 | + vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ |
| 104 | + } \ |
110 | 105 | } while( 0 )
|
111 | 106 |
|
112 | 107 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
|
126 | 121 | \
|
127 | 122 | pcEndOfStack -= sizeof( ucExpectedStackBytes ); \
|
128 | 123 | \
|
129 |
| - char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ |
130 |
| - /* Has the extremity of the task stack ever been written over? */ \ |
131 |
| - if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ |
132 |
| - { \ |
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 ) \ |
| 124 | + if( ( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) || \ |
| 125 | + ( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) ) \ |
138 | 126 | { \
|
| 127 | + char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ |
139 | 128 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
|
140 | 129 | } \
|
141 | 130 | } while( 0 )
|
|
0 commit comments