|
|
@ -962,7 +962,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
|
|
|
|
|
|
|
|
|
|
|
|
#if ( configRUN_MULTIPLE_PRIORITIES == 0 )
|
|
|
|
#if ( configRUN_MULTIPLE_PRIORITIES == 0 )
|
|
|
|
/* Verify that the calling core always yields to higher priority tasks. */
|
|
|
|
/* Verify that the calling core always yields to higher priority tasks. */
|
|
|
|
if( ( ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) == 0 ) &&
|
|
|
|
if( ( ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) == 0U ) &&
|
|
|
|
( pxTCB->uxPriority > pxCurrentTCBs[ portGET_CORE_ID() ]->uxPriority ) )
|
|
|
|
( pxTCB->uxPriority > pxCurrentTCBs[ portGET_CORE_ID() ]->uxPriority ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
configASSERT( ( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) ||
|
|
|
|
configASSERT( ( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) ||
|
|
|
@ -1044,7 +1044,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
|
|
|
|
* idle tasks, not user tasks at the idle priority. */
|
|
|
|
* idle tasks, not user tasks at the idle priority. */
|
|
|
|
if( uxCurrentPriority < uxTopReadyPriority )
|
|
|
|
if( uxCurrentPriority < uxTopReadyPriority )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( ( pxTCB->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) == 0 )
|
|
|
|
if( ( pxTCB->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) == 0U )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1136,7 +1136,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
|
|
|
|
|
|
|
|
|
|
|
|
for( x = ( BaseType_t ) 0; x < ( BaseType_t ) configNUMBER_OF_CORES; x++ )
|
|
|
|
for( x = ( BaseType_t ) 0; x < ( BaseType_t ) configNUMBER_OF_CORES; x++ )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( ( pxCurrentTCBs[ x ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) != 0 )
|
|
|
|
if( ( pxCurrentTCBs[ x ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) != 0U )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
prvYieldCore( x );
|
|
|
|
prvYieldCore( x );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1854,7 +1854,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
|
|
|
|
|
|
|
|
|
|
|
/* Ensure the name string is terminated in the case that the string length
|
|
|
|
/* Ensure the name string is terminated in the case that the string length
|
|
|
|
* was greater or equal to configMAX_TASK_NAME_LEN. */
|
|
|
|
* was greater or equal to configMAX_TASK_NAME_LEN. */
|
|
|
|
pxNewTCB->pcTaskName[ configMAX_TASK_NAME_LEN - 1 ] = '\0';
|
|
|
|
pxNewTCB->pcTaskName[ configMAX_TASK_NAME_LEN - 1U ] = '\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2165,7 +2165,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
|
|
|
* large to hold the generated string. Return the
|
|
|
|
* large to hold the generated string. Return the
|
|
|
|
* number of characters actually written without
|
|
|
|
* number of characters actually written without
|
|
|
|
* counting the terminating NULL character. */
|
|
|
|
* counting the terminating NULL character. */
|
|
|
|
uxCharsWritten = n - 1;
|
|
|
|
uxCharsWritten = n - 1U;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3873,7 +3873,7 @@ void vTaskSuspendAll( void )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xReturn = 0;
|
|
|
|
xReturn = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > 1 )
|
|
|
|
else if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > 1U )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* There are other idle priority tasks in the ready state. If
|
|
|
|
/* There are other idle priority tasks in the ready state. If
|
|
|
|
* time slicing is used then the very next tick interrupt must be
|
|
|
|
* time slicing is used then the very next tick interrupt must be
|
|
|
@ -4813,7 +4813,7 @@ BaseType_t xTaskIncrementTick( void )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if ( configNUMBER_OF_CORES == 1 )
|
|
|
|
#if ( configNUMBER_OF_CORES == 1 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCB->uxPriority ] ) ) > ( UBaseType_t ) 1 )
|
|
|
|
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCB->uxPriority ] ) ) > 1U )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xSwitchRequired = pdTRUE;
|
|
|
|
xSwitchRequired = pdTRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -4828,7 +4828,7 @@ BaseType_t xTaskIncrementTick( void )
|
|
|
|
|
|
|
|
|
|
|
|
for( xCoreID = 0; xCoreID < ( ( BaseType_t ) configNUMBER_OF_CORES ); xCoreID++ )
|
|
|
|
for( xCoreID = 0; xCoreID < ( ( BaseType_t ) configNUMBER_OF_CORES ); xCoreID++ )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCBs[ xCoreID ]->uxPriority ] ) ) > 1 )
|
|
|
|
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCBs[ xCoreID ]->uxPriority ] ) ) > 1U )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xYieldRequiredForCore[ xCoreID ] = pdTRUE;
|
|
|
|
xYieldRequiredForCore[ xCoreID ] = pdTRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -5807,7 +5807,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
|
|
|
* valid. */
|
|
|
|
* valid. */
|
|
|
|
xExpectedIdleTime = prvGetExpectedIdleTime();
|
|
|
|
xExpectedIdleTime = prvGetExpectedIdleTime();
|
|
|
|
|
|
|
|
|
|
|
|
if( xExpectedIdleTime >= configEXPECTED_IDLE_TIME_BEFORE_SLEEP )
|
|
|
|
if( xExpectedIdleTime >= ( TickType_t ) configEXPECTED_IDLE_TIME_BEFORE_SLEEP )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
vTaskSuspendAll();
|
|
|
|
vTaskSuspendAll();
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -5822,7 +5822,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
|
|
|
* portSUPPRESS_TICKS_AND_SLEEP() to be called. */
|
|
|
|
* portSUPPRESS_TICKS_AND_SLEEP() to be called. */
|
|
|
|
configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( xExpectedIdleTime );
|
|
|
|
configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( xExpectedIdleTime );
|
|
|
|
|
|
|
|
|
|
|
|
if( xExpectedIdleTime >= configEXPECTED_IDLE_TIME_BEFORE_SLEEP )
|
|
|
|
if( xExpectedIdleTime >= ( TickType_t ) configEXPECTED_IDLE_TIME_BEFORE_SLEEP )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
traceLOW_POWER_IDLE_BEGIN();
|
|
|
|
traceLOW_POWER_IDLE_BEGIN();
|
|
|
|
portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime );
|
|
|
|
portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime );
|
|
|
@ -5874,7 +5874,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
|
|
|
|
|
|
|
|
|
|
|
/* This function must be called from a critical section. */
|
|
|
|
/* This function must be called from a critical section. */
|
|
|
|
|
|
|
|
|
|
|
|
if( listCURRENT_LIST_LENGTH( &xPendingReadyList ) != 0 )
|
|
|
|
if( listCURRENT_LIST_LENGTH( &xPendingReadyList ) != 0U )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* A task was made ready while the scheduler was suspended. */
|
|
|
|
/* A task was made ready while the scheduler was suspended. */
|
|
|
|
eReturn = eAbortSleep;
|
|
|
|
eReturn = eAbortSleep;
|
|
|
@ -5884,7 +5884,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
|
|
|
/* A yield was pended while the scheduler was suspended. */
|
|
|
|
/* A yield was pended while the scheduler was suspended. */
|
|
|
|
eReturn = eAbortSleep;
|
|
|
|
eReturn = eAbortSleep;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( xPendedTicks != 0 )
|
|
|
|
else if( xPendedTicks != 0U )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* A tick interrupt has already occurred but was held pending
|
|
|
|
/* A tick interrupt has already occurred but was held pending
|
|
|
|
* because the scheduler is suspended. */
|
|
|
|
* because the scheduler is suspended. */
|
|
|
@ -6898,7 +6898,7 @@ static void prvResetNextTaskUnblockTime( void )
|
|
|
|
* interrupt. Only assert if the critical nesting count is 1 to
|
|
|
|
* interrupt. Only assert if the critical nesting count is 1 to
|
|
|
|
* protect against recursive calls if the assert function also uses a
|
|
|
|
* protect against recursive calls if the assert function also uses a
|
|
|
|
* critical section. */
|
|
|
|
* critical section. */
|
|
|
|
if( pxCurrentTCB->uxCriticalNesting == 1 )
|
|
|
|
if( pxCurrentTCB->uxCriticalNesting == 1U )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
portASSERT_IF_IN_ISR();
|
|
|
|
portASSERT_IF_IN_ISR();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -7269,13 +7269,13 @@ static void prvResetNextTaskUnblockTime( void )
|
|
|
|
* can be printed in tabular form more easily. */
|
|
|
|
* can be printed in tabular form more easily. */
|
|
|
|
pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
|
|
|
|
pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
|
|
|
|
/* Do not count the terminating null character. */
|
|
|
|
/* Do not count the terminating null character. */
|
|
|
|
uxConsumedBufferLength = uxConsumedBufferLength + ( configMAX_TASK_NAME_LEN - 1 );
|
|
|
|
uxConsumedBufferLength = uxConsumedBufferLength + ( configMAX_TASK_NAME_LEN - 1U );
|
|
|
|
|
|
|
|
|
|
|
|
/* Is there space left in the buffer? -1 is done because snprintf
|
|
|
|
/* Is there space left in the buffer? -1 is done because snprintf
|
|
|
|
* writes a terminating null character. So we are essentially
|
|
|
|
* writes a terminating null character. So we are essentially
|
|
|
|
* checking if the buffer has space to write at least one non-null
|
|
|
|
* checking if the buffer has space to write at least one non-null
|
|
|
|
* character. */
|
|
|
|
* character. */
|
|
|
|
if( uxConsumedBufferLength < ( uxBufferLength - 1 ) )
|
|
|
|
if( uxConsumedBufferLength < ( uxBufferLength - 1U ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* Write the rest of the string. */
|
|
|
|
/* Write the rest of the string. */
|
|
|
|
#if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
|
|
|
|
#if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
|
|
|
@ -7411,13 +7411,13 @@ static void prvResetNextTaskUnblockTime( void )
|
|
|
|
* easily. */
|
|
|
|
* easily. */
|
|
|
|
pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
|
|
|
|
pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
|
|
|
|
/* Do not count the terminating null character. */
|
|
|
|
/* Do not count the terminating null character. */
|
|
|
|
uxConsumedBufferLength = uxConsumedBufferLength + ( configMAX_TASK_NAME_LEN - 1 );
|
|
|
|
uxConsumedBufferLength = uxConsumedBufferLength + ( configMAX_TASK_NAME_LEN - 1U );
|
|
|
|
|
|
|
|
|
|
|
|
/* Is there space left in the buffer? -1 is done because snprintf
|
|
|
|
/* Is there space left in the buffer? -1 is done because snprintf
|
|
|
|
* writes a terminating null character. So we are essentially
|
|
|
|
* writes a terminating null character. So we are essentially
|
|
|
|
* checking if the buffer has space to write at least one non-null
|
|
|
|
* checking if the buffer has space to write at least one non-null
|
|
|
|
* character. */
|
|
|
|
* character. */
|
|
|
|
if( uxConsumedBufferLength < ( uxBufferLength - 1 ) )
|
|
|
|
if( uxConsumedBufferLength < ( uxBufferLength - 1U ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( ulStatsAsPercentage > 0UL )
|
|
|
|
if( ulStatsAsPercentage > 0UL )
|
|
|
|
{
|
|
|
|
{
|
|
|
|