mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-05-15 01:29:03 -04:00
Remove pxCurrentTCB define in SMP
This commit is contained in:
parent
1c9130fbfa
commit
8200e590f1
|
@ -58,11 +58,13 @@
|
||||||
/* Only the current stack state is to be checked. */
|
/* Only the current stack state is to be checked. */
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||||
do { \
|
do { \
|
||||||
|
TCB_t * const pxConstCurrentTCB = prvGetCurrentTaskTCBUnsafe(); \
|
||||||
|
\
|
||||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
/* Is the currently saved stack pointer within the stack limit? */ \
|
||||||
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) \
|
if( pxConstCurrentTCB->pxTopOfStack <= pxConstCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) \
|
||||||
{ \
|
{ \
|
||||||
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
|
char * pcOverflowTaskName = pxConstCurrentTCB->pcTaskName; \
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
|
vApplicationStackOverflowHook( ( TaskHandle_t ) pxConstCurrentTCB, pcOverflowTaskName ); \
|
||||||
} \
|
} \
|
||||||
} while( 0 )
|
} while( 0 )
|
||||||
|
|
||||||
|
@ -74,12 +76,13 @@
|
||||||
/* Only the current stack state is to be checked. */
|
/* Only the current stack state is to be checked. */
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||||
do { \
|
do { \
|
||||||
|
TCB_t * const pxConstCurrentTCB = prvGetCurrentTaskTCBUnsafe(); \
|
||||||
\
|
\
|
||||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
/* Is the currently saved stack pointer within the stack limit? */ \
|
||||||
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \
|
if( pxConstCurrentTCB->pxTopOfStack >= pxConstCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \
|
||||||
{ \
|
{ \
|
||||||
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
|
char * pcOverflowTaskName = pxConstCurrentTCB->pcTaskName; \
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
|
vApplicationStackOverflowHook( ( TaskHandle_t ) pxConstCurrentTCB, pcOverflowTaskName ); \
|
||||||
} \
|
} \
|
||||||
} while( 0 )
|
} while( 0 )
|
||||||
|
|
||||||
|
@ -90,7 +93,8 @@
|
||||||
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||||
do { \
|
do { \
|
||||||
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
|
TCB_t * const pxConstCurrentTCB = prvGetCurrentTaskTCBUnsafe(); \
|
||||||
|
const uint32_t * const pulStack = ( uint32_t * ) pxConstCurrentTCB->pxStack; \
|
||||||
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \
|
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \
|
||||||
\
|
\
|
||||||
if( ( pulStack[ 0 ] != ulCheckValue ) || \
|
if( ( pulStack[ 0 ] != ulCheckValue ) || \
|
||||||
|
@ -98,8 +102,8 @@
|
||||||
( pulStack[ 2 ] != ulCheckValue ) || \
|
( pulStack[ 2 ] != ulCheckValue ) || \
|
||||||
( pulStack[ 3 ] != ulCheckValue ) ) \
|
( pulStack[ 3 ] != ulCheckValue ) ) \
|
||||||
{ \
|
{ \
|
||||||
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
|
char * pcOverflowTaskName = pxConstCurrentTCB->pcTaskName; \
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
|
vApplicationStackOverflowHook( ( TaskHandle_t ) pxConstCurrentTCB, pcOverflowTaskName ); \
|
||||||
} \
|
} \
|
||||||
} while( 0 )
|
} while( 0 )
|
||||||
|
|
||||||
|
@ -110,7 +114,8 @@
|
||||||
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||||
do { \
|
do { \
|
||||||
int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
|
TCB_t * const pxConstCurrentTCB = prvGetCurrentTaskTCBUnsafe(); \
|
||||||
|
int8_t * pcEndOfStack = ( int8_t * ) pxConstCurrentTCB->pxEndOfStack; \
|
||||||
static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
||||||
|
@ -123,8 +128,8 @@
|
||||||
/* Has the extremity of the task stack ever been written over? */ \
|
/* Has the extremity of the task stack ever been written over? */ \
|
||||||
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
|
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
|
||||||
{ \
|
{ \
|
||||||
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
|
char * pcOverflowTaskName = pxConstCurrentTCB->pcTaskName; \
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
|
vApplicationStackOverflowHook( ( TaskHandle_t ) pxConstCurrentTCB, pcOverflowTaskName ); \
|
||||||
} \
|
} \
|
||||||
} while( 0 )
|
} while( 0 )
|
||||||
|
|
||||||
|
|
1
tasks.c
1
tasks.c
|
@ -463,7 +463,6 @@ typedef tskTCB TCB_t;
|
||||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-84 */
|
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-84 */
|
||||||
/* coverity[misra_c_2012_rule_8_4_violation] */
|
/* coverity[misra_c_2012_rule_8_4_violation] */
|
||||||
portDONT_DISCARD PRIVILEGED_DATA TCB_t * volatile pxCurrentTCBs[ configNUMBER_OF_CORES ];
|
portDONT_DISCARD PRIVILEGED_DATA TCB_t * volatile pxCurrentTCBs[ configNUMBER_OF_CORES ];
|
||||||
#define pxCurrentTCB prvGetCurrentTaskTCBUnsafe()
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Lists for ready and blocked tasks. --------------------
|
/* Lists for ready and blocked tasks. --------------------
|
||||||
|
|
Loading…
Reference in a new issue