Skip to content

Commit b3543a8

Browse files
author
none
committed
Merge branch 'main' of https://github.com/FreeRTOS/FreeRTOS-Kernel into update-cortex-a9-alignment
2 parents ac50eb5 + 4c4089b commit b3543a8

File tree

4 files changed

+37
-71
lines changed

4 files changed

+37
-71
lines changed

include/FreeRTOS.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -924,12 +924,6 @@
924924
#endif
925925

926926
/* Sanity check the configuration. */
927-
#if ( configUSE_TICKLESS_IDLE != 0 )
928-
#if ( INCLUDE_vTaskSuspend != 1 )
929-
#error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0
930-
#endif /* INCLUDE_vTaskSuspend */
931-
#endif /* configUSE_TICKLESS_IDLE */
932-
933927
#if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
934928
#error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
935929
#endif

include/task.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ typedef struct xTASK_STATUS
167167
/* Possible return values for eTaskConfirmSleepModeStatus(). */
168168
typedef enum
169169
{
170-
eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPRESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
171-
eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
172-
eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */
170+
eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPRESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
171+
eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
172+
#if ( INCLUDE_vTaskSuspend == 1 )
173+
eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */
174+
#endif /* INCLUDE_vTaskSuspend */
173175
} eSleepModeStatus;
174176

175177
/**

queue.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,11 +2756,10 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
27562756
const char * pcQueueName ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
27572757
{
27582758
UBaseType_t ux;
2759+
QueueRegistryItem_t * pxEntryToWrite = NULL;
27592760

27602761
configASSERT( xQueue );
27612762

2762-
QueueRegistryItem_t * pxEntryToWrite = NULL;
2763-
27642763
if( pcQueueName != NULL )
27652764
{
27662765
/* See if there is an empty space in the registry. A NULL name denotes

tasks.c

Lines changed: 31 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,9 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
527527
*/
528528
static void prvResetNextTaskUnblockTime( void ) PRIVILEGED_FUNCTION;
529529

530-
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )
530+
#if ( ( ( configUSE_TRACE_FACILITY == 1 ) || ( configGENERATE_RUN_TIME_STATS == 1 ) ) && \
531+
( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && \
532+
( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
531533

532534
/*
533535
* Helper function used to pad task names with spaces when printing out
@@ -602,6 +604,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
602604
/* The memory used for the task's TCB and stack are passed into this
603605
* function - use them. */
604606
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. */
607+
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
605608
pxNewTCB->pxStack = ( StackType_t * ) puxStackBuffer;
606609

607610
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
@@ -643,6 +646,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
643646
* on the implementation of the port malloc function and whether or
644647
* not static allocation is being used. */
645648
pxNewTCB = ( TCB_t * ) pxTaskDefinition->pxTaskBuffer;
649+
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
646650

647651
/* Store the stack location in the TCB. */
648652
pxNewTCB->pxStack = pxTaskDefinition->puxStackBuffer;
@@ -692,6 +696,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
692696

693697
if( pxNewTCB != NULL )
694698
{
699+
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
700+
695701
/* Store the stack location in the TCB. */
696702
pxNewTCB->pxStack = pxTaskDefinition->puxStackBuffer;
697703

@@ -747,6 +753,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
747753

748754
if( pxNewTCB != NULL )
749755
{
756+
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
757+
750758
/* Allocate space for the stack used by the task being created.
751759
* The base of the stack memory stored in the TCB so the task can
752760
* be deleted later if required. */
@@ -774,6 +782,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
774782

775783
if( pxNewTCB != NULL )
776784
{
785+
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
786+
777787
/* Store the stack location in the TCB. */
778788
pxNewTCB->pxStack = pxStack;
779789
}
@@ -910,9 +920,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
910920
}
911921
else
912922
{
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;
923+
mtCOVERAGE_TEST_MARKER();
916924
}
917925

918926
/* This is used as an array index so must ensure it's not too large. */
@@ -931,7 +939,6 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
931939
#if ( configUSE_MUTEXES == 1 )
932940
{
933941
pxNewTCB->uxBasePriority = uxPriority;
934-
pxNewTCB->uxMutexesHeld = 0;
935942
}
936943
#endif /* configUSE_MUTEXES */
937944

@@ -946,24 +953,6 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
946953
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. */
947954
listSET_LIST_ITEM_OWNER( &( pxNewTCB->xEventListItem ), pxNewTCB );
948955

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-
967956
#if ( portUSING_MPU_WRAPPERS == 1 )
968957
{
969958
vPortStoreTaskMPUSettings( &( pxNewTCB->xMPUSettings ), xRegions, pxNewTCB->pxStack, ulStackDepth );
@@ -975,19 +964,6 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
975964
}
976965
#endif
977966

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-
991967
#if ( configUSE_NEWLIB_REENTRANT == 1 )
992968
{
993969
/* Initialise this task's Newlib reent structure.
@@ -997,12 +973,6 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
997973
}
998974
#endif
999975

1000-
#if ( INCLUDE_xTaskAbortDelay == 1 )
1001-
{
1002-
pxNewTCB->ucDelayAborted = pdFALSE;
1003-
}
1004-
#endif
1005-
1006976
/* Initialize the TCB stack to look as if the task was already running,
1007977
* but had been interrupted by the scheduler. The return address is set
1008978
* to the start of the task function. Once the stack has been initialised
@@ -1122,10 +1092,6 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
11221092
{
11231093
/* Add a counter into the TCB for tracing only. */
11241094
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;
11291095
}
11301096
#endif /* configUSE_TRACE_FACILITY */
11311097
traceTASK_CREATE( pxNewTCB );
@@ -3563,8 +3529,11 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
35633529

35643530
eSleepModeStatus eTaskConfirmSleepModeStatus( void )
35653531
{
3566-
/* The idle task exists in addition to the application tasks. */
3567-
const UBaseType_t uxNonApplicationTasks = 1;
3532+
#if ( INCLUDE_vTaskSuspend == 1 )
3533+
/* The idle task exists in addition to the application tasks. */
3534+
const UBaseType_t uxNonApplicationTasks = 1;
3535+
#endif /* INCLUDE_vTaskSuspend */
3536+
35683537
eSleepModeStatus eReturn = eStandardSleep;
35693538

35703539
/* This function must be called from a critical section. */
@@ -3585,20 +3554,20 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
35853554
* because the scheduler is suspended. */
35863555
eReturn = eAbortSleep;
35873556
}
3588-
else
3589-
{
3590-
/* If all the tasks are in the suspended list (which might mean they
3591-
* have an infinite block time rather than actually being suspended)
3592-
* then it is safe to turn all clocks off and just wait for external
3593-
* interrupts. */
3594-
if( listCURRENT_LIST_LENGTH( &xSuspendedTaskList ) == ( uxCurrentNumberOfTasks - uxNonApplicationTasks ) )
3557+
3558+
#if ( INCLUDE_vTaskSuspend == 1 )
3559+
else if( listCURRENT_LIST_LENGTH( &xSuspendedTaskList ) == ( uxCurrentNumberOfTasks - uxNonApplicationTasks ) )
35953560
{
3561+
/* If all the tasks are in the suspended list (which might mean they
3562+
* have an infinite block time rather than actually being suspended)
3563+
* then it is safe to turn all clocks off and just wait for external
3564+
* interrupts. */
35963565
eReturn = eNoTasksWaitingTimeout;
35973566
}
3598-
else
3599-
{
3600-
mtCOVERAGE_TEST_MARKER();
3601-
}
3567+
#endif /* INCLUDE_vTaskSuspend */
3568+
else
3569+
{
3570+
mtCOVERAGE_TEST_MARKER();
36023571
}
36033572

36043573
return eReturn;
@@ -4412,7 +4381,9 @@ static void prvResetNextTaskUnblockTime( void )
44124381
#endif /* portCRITICAL_NESTING_IN_TCB */
44134382
/*-----------------------------------------------------------*/
44144383

4415-
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )
4384+
#if ( ( ( configUSE_TRACE_FACILITY == 1 ) || ( configGENERATE_RUN_TIME_STATS == 1 ) ) && \
4385+
( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && \
4386+
( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
44164387

44174388
static char * prvWriteNameToBuffer( char * pcBuffer,
44184389
const char * pcTaskName )

0 commit comments

Comments
 (0)