@@ -602,6 +602,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
602
602
/* The memory used for the task's TCB and stack are passed into this
603
603
* function - use them. */
604
604
pxNewTCB = ( TCB_t * ) pxTaskBuffer ; /*lint !e740 !e9087 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */
605
+ memset ( ( void * ) pxNewTCB , 0x00 , sizeof ( TCB_t ) );
605
606
pxNewTCB -> pxStack = ( StackType_t * ) puxStackBuffer ;
606
607
607
608
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
@@ -643,6 +644,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
643
644
* on the implementation of the port malloc function and whether or
644
645
* not static allocation is being used. */
645
646
pxNewTCB = ( TCB_t * ) pxTaskDefinition -> pxTaskBuffer ;
647
+ memset ( ( void * ) pxNewTCB , 0x00 , sizeof ( TCB_t ) );
646
648
647
649
/* Store the stack location in the TCB. */
648
650
pxNewTCB -> pxStack = pxTaskDefinition -> puxStackBuffer ;
@@ -692,6 +694,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
692
694
693
695
if ( pxNewTCB != NULL )
694
696
{
697
+ memset ( ( void * ) pxNewTCB , 0x00 , sizeof ( TCB_t ) );
698
+
695
699
/* Store the stack location in the TCB. */
696
700
pxNewTCB -> pxStack = pxTaskDefinition -> puxStackBuffer ;
697
701
@@ -747,6 +751,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
747
751
748
752
if ( pxNewTCB != NULL )
749
753
{
754
+ memset ( ( void * ) pxNewTCB , 0x00 , sizeof ( TCB_t ) );
755
+
750
756
/* Allocate space for the stack used by the task being created.
751
757
* The base of the stack memory stored in the TCB so the task can
752
758
* be deleted later if required. */
@@ -774,6 +780,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
774
780
775
781
if ( pxNewTCB != NULL )
776
782
{
783
+ memset ( ( void * ) pxNewTCB , 0x00 , sizeof ( TCB_t ) );
784
+
777
785
/* Store the stack location in the TCB. */
778
786
pxNewTCB -> pxStack = pxStack ;
779
787
}
@@ -910,9 +918,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
910
918
}
911
919
else
912
920
{
913
- /* The task has not been given a name, so just ensure there is a NULL
914
- * terminator when it is read out. */
915
- pxNewTCB -> pcTaskName [ 0 ] = 0x00 ;
921
+ mtCOVERAGE_TEST_MARKER ();
916
922
}
917
923
918
924
/* This is used as an array index so must ensure it's not too large. */
@@ -931,7 +937,6 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
931
937
#if ( configUSE_MUTEXES == 1 )
932
938
{
933
939
pxNewTCB -> uxBasePriority = uxPriority ;
934
- pxNewTCB -> uxMutexesHeld = 0 ;
935
940
}
936
941
#endif /* configUSE_MUTEXES */
937
942
@@ -946,24 +951,6 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
946
951
listSET_LIST_ITEM_VALUE ( & ( pxNewTCB -> xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxPriority ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
947
952
listSET_LIST_ITEM_OWNER ( & ( pxNewTCB -> xEventListItem ), pxNewTCB );
948
953
949
- #if ( portCRITICAL_NESTING_IN_TCB == 1 )
950
- {
951
- pxNewTCB -> uxCriticalNesting = ( UBaseType_t ) 0U ;
952
- }
953
- #endif /* portCRITICAL_NESTING_IN_TCB */
954
-
955
- #if ( configUSE_APPLICATION_TASK_TAG == 1 )
956
- {
957
- pxNewTCB -> pxTaskTag = NULL ;
958
- }
959
- #endif /* configUSE_APPLICATION_TASK_TAG */
960
-
961
- #if ( configGENERATE_RUN_TIME_STATS == 1 )
962
- {
963
- pxNewTCB -> ulRunTimeCounter = ( configRUN_TIME_COUNTER_TYPE ) 0 ;
964
- }
965
- #endif /* configGENERATE_RUN_TIME_STATS */
966
-
967
954
#if ( portUSING_MPU_WRAPPERS == 1 )
968
955
{
969
956
vPortStoreTaskMPUSettings ( & ( pxNewTCB -> xMPUSettings ), xRegions , pxNewTCB -> pxStack , ulStackDepth );
@@ -975,19 +962,6 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
975
962
}
976
963
#endif
977
964
978
- #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )
979
- {
980
- memset ( ( void * ) & ( pxNewTCB -> pvThreadLocalStoragePointers [ 0 ] ), 0x00 , sizeof ( pxNewTCB -> pvThreadLocalStoragePointers ) );
981
- }
982
- #endif
983
-
984
- #if ( configUSE_TASK_NOTIFICATIONS == 1 )
985
- {
986
- memset ( ( void * ) & ( pxNewTCB -> ulNotifiedValue [ 0 ] ), 0x00 , sizeof ( pxNewTCB -> ulNotifiedValue ) );
987
- memset ( ( void * ) & ( pxNewTCB -> ucNotifyState [ 0 ] ), 0x00 , sizeof ( pxNewTCB -> ucNotifyState ) );
988
- }
989
- #endif
990
-
991
965
#if ( configUSE_NEWLIB_REENTRANT == 1 )
992
966
{
993
967
/* Initialise this task's Newlib reent structure.
@@ -997,12 +971,6 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
997
971
}
998
972
#endif
999
973
1000
- #if ( INCLUDE_xTaskAbortDelay == 1 )
1001
- {
1002
- pxNewTCB -> ucDelayAborted = pdFALSE ;
1003
- }
1004
- #endif
1005
-
1006
974
/* Initialize the TCB stack to look as if the task was already running,
1007
975
* but had been interrupted by the scheduler. The return address is set
1008
976
* to the start of the task function. Once the stack has been initialised
@@ -1122,10 +1090,6 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
1122
1090
{
1123
1091
/* Add a counter into the TCB for tracing only. */
1124
1092
pxNewTCB -> uxTCBNumber = uxTaskNumber ;
1125
-
1126
- /* Initialize the uxTaskNumber member to zero. It is utilized by the
1127
- * application using vTaskSetTaskNumber and uxTaskGetTaskNumber APIs. */
1128
- pxNewTCB -> uxTaskNumber = 0 ;
1129
1093
}
1130
1094
#endif /* configUSE_TRACE_FACILITY */
1131
1095
traceTASK_CREATE ( pxNewTCB );
0 commit comments