36#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
48#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
52#if ( configUSE_STATS_FORMATTING_FUNCTIONS == 1 )
61#if ( configUSE_PREEMPTION == 0 )
65 #define taskYIELD_IF_USING_PREEMPTION()
67 #define taskYIELD_IF_USING_PREEMPTION() portYIELD_WITHIN_API()
71#define taskNOT_WAITING_NOTIFICATION ( ( uint8_t ) 0 )
72#define taskWAITING_NOTIFICATION ( ( uint8_t ) 1 )
73#define taskNOTIFICATION_RECEIVED ( ( uint8_t ) 2 )
79#define tskSTACK_FILL_BYTE ( 0xa5U )
82#define tskDYNAMICALLY_ALLOCATED_STACK_AND_TCB ( ( uint8_t ) 0 )
83#define tskSTATICALLY_ALLOCATED_STACK_ONLY ( ( uint8_t ) 1 )
84#define tskSTATICALLY_ALLOCATED_STACK_AND_TCB ( ( uint8_t ) 2 )
89#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) || ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 ) )
90 #define tskSET_NEW_STACKS_TO_KNOWN_VALUE 1
92 #define tskSET_NEW_STACKS_TO_KNOWN_VALUE 0
98#define tskRUNNING_CHAR ( 'X' )
99#define tskBLOCKED_CHAR ( 'B' )
100#define tskREADY_CHAR ( 'R' )
101#define tskDELETED_CHAR ( 'D' )
102#define tskSUSPENDED_CHAR ( 'S' )
108#ifdef portREMOVE_STATIC_QUALIFIER
114#ifndef configIDLE_TASK_NAME
115 #define configIDLE_TASK_NAME "IDLE"
118#if ( configUSE_PORT_OPTIMISED_TASK_SELECTION == 0 )
126 #define taskRECORD_READY_PRIORITY( uxPriority ) \
128 if( ( uxPriority ) > uxTopReadyPriority ) \
130 uxTopReadyPriority = ( uxPriority ); \
136 #define taskSELECT_HIGHEST_PRIORITY_TASK() \
138 UBaseType_t uxTopPriority = uxTopReadyPriority; \
141 while( listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxTopPriority ] ) ) ) \
143 configASSERT( uxTopPriority ); \
149 listGET_OWNER_OF_NEXT_ENTRY( pxCurrentTCB, &( pxReadyTasksLists[ uxTopPriority ] ) ); \
150 uxTopReadyPriority = uxTopPriority; \
158 #define taskRESET_READY_PRIORITY( uxPriority )
159 #define portRESET_READY_PRIORITY( uxPriority, uxTopReadyPriority )
168 #define taskRECORD_READY_PRIORITY( uxPriority ) portRECORD_READY_PRIORITY( ( uxPriority ), uxTopReadyPriority )
172 #define taskSELECT_HIGHEST_PRIORITY_TASK() \
174 UBaseType_t uxTopPriority; \
177 portGET_HIGHEST_PRIORITY( uxTopPriority, uxTopReadyPriority ); \
178 configASSERT( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ uxTopPriority ] ) ) > 0 ); \
179 listGET_OWNER_OF_NEXT_ENTRY( pxCurrentTCB, &( pxReadyTasksLists[ uxTopPriority ] ) ); \
187 #define taskRESET_READY_PRIORITY( uxPriority ) \
189 if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ ( uxPriority ) ] ) ) == ( UBaseType_t ) 0 ) \
191 portRESET_READY_PRIORITY( ( uxPriority ), ( uxTopReadyPriority ) ); \
201#define taskSWITCH_DELAYED_LISTS() \
206 configASSERT( ( listLIST_IS_EMPTY( pxDelayedTaskList ) ) ); \
208 pxTemp = pxDelayedTaskList; \
209 pxDelayedTaskList = pxOverflowDelayedTaskList; \
210 pxOverflowDelayedTaskList = pxTemp; \
212 prvResetNextTaskUnblockTime(); \
221#define prvAddTaskToReadyList( pxTCB ) \
223 traceMOVED_TASK_TO_READY_STATE( pxTCB ); \
224 taskRECORD_READY_PRIORITY( ( pxTCB )->uxPriority ); \
225 listINSERT_END( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xStateListItem ) ); \
226 tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB ); \
236#define prvGetTCBFromHandle( pxHandle ) ( ( ( pxHandle ) == NULL ) ? pxCurrentTCB : ( pxHandle ) )
246#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
247 #define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x8000U
248#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
249 #define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x80000000UL
250#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
251 #define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x8000000000000000ULL
263 #if ( portUSING_MPU_WRAPPERS == 1 )
264 xMPU_SETTINGS xMPUSettings;
273 #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
277 #if ( portCRITICAL_NESTING_IN_TCB == 1 )
281 #if ( configUSE_TRACE_FACILITY == 1 )
286 #if ( configUSE_MUTEXES == 1 )
291 #if ( configUSE_APPLICATION_TASK_TAG == 1 )
295 #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
299 #if ( configGENERATE_RUN_TIME_STATS == 1 )
303 #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
307 #if ( configUSE_TASK_NOTIFICATIONS == 1 )
314 #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
315 uint8_t ucStaticallyAllocated;
318 #if ( INCLUDE_xTaskAbortDelay == 1 )
319 uint8_t ucDelayAborted;
322 #if ( configUSE_POSIX_ERRNO == 1 )
346#if ( INCLUDE_vTaskDelete == 1 )
353#if ( INCLUDE_vTaskSuspend == 1 )
361#if ( configUSE_POSIX_ERRNO == 1 )
362 int FreeRTOS_errno = 0;
392#if ( configGENERATE_RUN_TIME_STATS == 1 )
412#if ( INCLUDE_vTaskSuspend == 1 )
444#if ( INCLUDE_vTaskDelete == 1 )
472#if ( configUSE_TRACE_FACILITY == 1 )
484#if ( INCLUDE_xTaskGetHandle == 1 )
486 static TCB_t * prvSearchForNameWithinSingleList(
List_t * pxList,
496#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 ) )
511#if ( configUSE_TICKLESS_IDLE != 0 )
523#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
529 static char * prvWriteNameToBuffer(
char * pcBuffer,
539 const char *
const pcName,
540 const uint32_t ulStackDepth,
541 void *
const pvParameters,
558#ifdef FREERTOS_TASKS_C_ADDITIONS_INIT
566#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
569 const char *
const pcName,
570 const uint32_t ulStackDepth,
571 void *
const pvParameters,
582 #if ( configASSERT_DEFINED == 1 )
593 if( ( pxTaskBuffer !=
NULL ) && ( puxStackBuffer !=
NULL ) )
597 pxNewTCB = (
TCB_t * ) pxTaskBuffer;
598 memset( (
void * ) pxNewTCB, 0x00,
sizeof(
TCB_t ) );
599 pxNewTCB->pxStack = (
StackType_t * ) puxStackBuffer;
601 #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
609 prvInitialiseNewTask( pxTaskCode, pcName, ulStackDepth, pvParameters, uxPriority, &xReturn, pxNewTCB,
NULL );
623#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
639 pxNewTCB = (
TCB_t * ) pxTaskDefinition->pxTaskBuffer;
640 memset( (
void * ) pxNewTCB, 0x00,
sizeof(
TCB_t ) );
645 #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
653 prvInitialiseNewTask( pxTaskDefinition->
pvTaskCode,
658 pxCreatedTask, pxNewTCB,
671#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
688 if( pxNewTCB !=
NULL )
690 memset( (
void * ) pxNewTCB, 0x00,
sizeof(
TCB_t ) );
695 #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
704 prvInitialiseNewTask( pxTaskDefinition->
pvTaskCode,
709 pxCreatedTask, pxNewTCB,
723#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
726 const char *
const pcName,
728 void *
const pvParameters,
738 #if ( portSTACK_GROWTH > 0 )
745 if( pxNewTCB !=
NULL )
747 memset( (
void * ) pxNewTCB, 0x00,
sizeof(
TCB_t ) );
754 if( pxNewTCB->pxStack ==
NULL )
769 if( pxStack !=
NULL )
774 if( pxNewTCB !=
NULL )
776 memset( (
void * ) pxNewTCB, 0x00,
sizeof(
TCB_t ) );
779 pxNewTCB->pxStack = pxStack;
795 if( pxNewTCB !=
NULL )
797 #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
805 prvInitialiseNewTask( pxTaskCode, pcName, ( uint32_t ) usStackDepth, pvParameters, uxPriority, pxCreatedTask, pxNewTCB,
NULL );
821 const char *
const pcName,
822 const uint32_t ulStackDepth,
823 void *
const pvParameters,
832 #if ( portUSING_MPU_WRAPPERS == 1 )
848 #if ( tskSET_NEW_STACKS_TO_KNOWN_VALUE == 1 )
859 #if ( portSTACK_GROWTH < 0 )
861 pxTopOfStack = &( pxNewTCB->
pxStack[ ulStackDepth - ( uint32_t ) 1 ] );
867 #if ( configRECORD_STACK_HIGH_ADDRESS == 1 )
871 pxNewTCB->pxEndOfStack = pxTopOfStack;
877 pxTopOfStack = pxNewTCB->
pxStack;
884 pxNewTCB->pxEndOfStack = pxNewTCB->
pxStack + ( ulStackDepth - ( uint32_t ) 1 );
898 if( pcName[ x ] == (
char ) 0x00 )
930 #if ( configUSE_MUTEXES == 1 )
932 pxNewTCB->uxBasePriority = uxPriority;
947 #if ( portUSING_MPU_WRAPPERS == 1 )
949 vPortStoreTaskMPUSettings( &( pxNewTCB->xMPUSettings ), xRegions, pxNewTCB->
pxStack, ulStackDepth );
958 #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
969 #if ( portUSING_MPU_WRAPPERS == 1 )
974 #if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
976 #if ( portSTACK_GROWTH < 0 )
997 #if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
999 #if ( portSTACK_GROWTH < 0 )
1017 if( pxCreatedTask !=
NULL )
1080 #if ( configUSE_TRACE_FACILITY == 1 )
1114#if ( INCLUDE_vTaskDelete == 1 )
1164 ++uxDeletedTasksWaitingCleanUp;
1194 prvDeleteTCB( pxTCB );
1216#if ( INCLUDE_xTaskDelayUntil == 1 )
1235 xTimeToWake = *pxPreviousWakeTime + xTimeIncrement;
1237 if( xConstTickCount < *pxPreviousWakeTime )
1244 if( ( xTimeToWake < *pxPreviousWakeTime ) && ( xTimeToWake > xConstTickCount ) )
1258 if( ( xTimeToWake < *pxPreviousWakeTime ) || ( xTimeToWake > xConstTickCount ) )
1269 *pxPreviousWakeTime = xTimeToWake;
1288 if( xAlreadyYielded ==
pdFALSE )
1297 return xShouldDelay;
1303#if ( INCLUDE_vTaskDelay == 1 )
1335 if( xAlreadyYielded ==
pdFALSE )
1348#if ( ( INCLUDE_eTaskGetState == 1 ) || ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_xTaskAbortDelay == 1 ) )
1353 List_t const * pxStateList;
1354 List_t const * pxEventList;
1355 List_t const * pxDelayedList;
1356 List_t const * pxOverflowedDelayedList;
1357 const TCB_t *
const pxTCB = xTask;
1384 else if( ( pxStateList == pxDelayedList ) || ( pxStateList == pxOverflowedDelayedList ) )
1391 #if ( INCLUDE_vTaskSuspend == 1 )
1392 else if( pxStateList == &xSuspendedTaskList )
1399 #if ( configUSE_TASK_NOTIFICATIONS == 1 )
1432 #if ( INCLUDE_vTaskDelete == 1 )
1433 else if( ( pxStateList == &xTasksWaitingTermination ) || ( pxStateList ==
NULL ) )
1456#if ( INCLUDE_uxTaskPriorityGet == 1 )
1460 TCB_t const * pxTCB;
1478#if ( INCLUDE_uxTaskPriorityGet == 1 )
1482 TCB_t const * pxTCB;
1502 portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
1519#if ( INCLUDE_vTaskPrioritySet == 1 )
1525 UBaseType_t uxCurrentBasePriority, uxPriorityUsedOnEntry;
1548 #if ( configUSE_MUTEXES == 1 )
1550 uxCurrentBasePriority = pxTCB->uxBasePriority;
1558 if( uxCurrentBasePriority != uxNewPriority )
1562 if( uxNewPriority > uxCurrentBasePriority )
1604 #if ( configUSE_MUTEXES == 1 )
1608 if( pxTCB->uxBasePriority == pxTCB->
uxPriority )
1618 pxTCB->uxBasePriority = uxNewPriority;
1665 if( xYieldRequired !=
pdFALSE )
1676 ( void ) uxPriorityUsedOnEntry;
1685#if ( INCLUDE_vTaskSuspend == 1 )
1722 #if ( configUSE_TASK_NOTIFICATIONS == 1 )
1791#if ( INCLUDE_vTaskSuspend == 1 )
1796 const TCB_t *
const pxTCB = xTask;
1837#if ( INCLUDE_vTaskSuspend == 1 )
1841 TCB_t *
const pxTCB = xTaskToResume;
1852 if( prvTaskIsTaskSuspended( pxTCB ) !=
pdFALSE )
1891#if ( ( INCLUDE_xTaskResumeFromISR == 1 ) && ( INCLUDE_vTaskSuspend == 1 ) )
1896 TCB_t *
const pxTCB = xTaskToResume;
1917 portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
1921 if( prvTaskIsTaskSuspended( pxTCB ) !=
pdFALSE )
1962 return xYieldRequired;
1973 #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
1977 uint32_t ulIdleTaskStackSize;
1981 vApplicationGetIdleTaskMemory( &pxIdleTaskTCBBuffer, &pxIdleTaskStackBuffer, &ulIdleTaskStackSize );
1984 ulIdleTaskStackSize,
1987 pxIdleTaskStackBuffer,
1988 pxIdleTaskTCBBuffer );
2002 xReturn = xTaskCreate( prvIdleTask,
2011 #if ( configUSE_TIMERS == 1 )
2029 #ifdef FREERTOS_TASKS_C_ADDITIONS_INIT
2031 freertos_tasks_c_additions_init();
2042 #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
2125#if ( configUSE_TICKLESS_IDLE != 0 )
2127 static TickType_t prvGetExpectedIdleTime(
void )
2136 #if ( configUSE_PORT_OPTIMISED_TASK_SELECTION == 0 )
2140 uxHigherPriorityReadyTasks =
pdTRUE;
2154 uxHigherPriorityReadyTasks =
pdTRUE;
2170 else if( uxHigherPriorityReadyTasks !=
pdFALSE )
2264 }
while( xPendedCounts > (
TickType_t ) 0U );
2276 #if ( configUSE_PREEMPTION != 0 )
2278 xAlreadyYielded =
pdTRUE;
2296 return xAlreadyYielded;
2334 portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
2366#if ( INCLUDE_xTaskGetHandle == 1 )
2368 static TCB_t * prvSearchForNameWithinSingleList(
List_t * pxList,
2369 const char pcNameToQuery[] )
2396 if( cNextChar != pcNameToQuery[ x ] )
2401 else if( cNextChar == (
char ) 0x00 )
2405 pxReturn = pxNextTCB;
2419 if( pxReturn !=
NULL )
2424 }
while( pxNextTCB != pxFirstTCB );
2437#if ( INCLUDE_xTaskGetHandle == 1 )
2473 #if ( INCLUDE_vTaskSuspend == 1 )
2478 pxTCB = prvSearchForNameWithinSingleList( &xSuspendedTaskList, pcNameToQuery );
2483 #if ( INCLUDE_vTaskDelete == 1 )
2488 pxTCB = prvSearchForNameWithinSingleList( &xTasksWaitingTermination, pcNameToQuery );
2501#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
2515 #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 )
2519 *ppuxStackBuffer = pxTCB->
pxStack;
2525 *ppuxStackBuffer = pxTCB->
pxStack;
2526 *ppxTaskBuffer =
NULL;
2536 *ppuxStackBuffer = pxTCB->
pxStack;
2548#if ( configUSE_TRACE_FACILITY == 1 )
2566 uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &(
pxReadyTasksLists[ uxQueue ] ),
eReady );
2574 #if ( INCLUDE_vTaskDelete == 1 )
2578 uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &xTasksWaitingTermination,
eDeleted );
2582 #if ( INCLUDE_vTaskSuspend == 1 )
2586 uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &xSuspendedTaskList,
eSuspended );
2590 #if ( configGENERATE_RUN_TIME_STATS == 1 )
2592 if( pulTotalRunTime !=
NULL )
2594 #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
2595 portALT_GET_RUN_TIME_COUNTER_VALUE( ( *pulTotalRunTime ) );
2603 if( pulTotalRunTime !=
NULL )
2605 *pulTotalRunTime = 0;
2623#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
2640#if ( configUSE_TICKLESS_IDLE != 0 )
2697 return xYieldOccurred;
2701#if ( INCLUDE_xTaskAbortDelay == 1 )
2705 TCB_t * pxTCB = xTask;
2736 pxTCB->ucDelayAborted =
pdTRUE;
2750 #if ( configUSE_PREEMPTION == 1 )
2838 if( xConstTickCount < xItemValue )
2873 #if ( configUSE_PREEMPTION == 1 )
2885 xSwitchRequired =
pdTRUE;
2900 #if ( ( configUSE_PREEMPTION == 1 ) && ( configUSE_TIME_SLICING == 1 ) )
2904 xSwitchRequired =
pdTRUE;
2913 #if ( configUSE_TICK_HOOK == 1 )
2919 vApplicationTickHook();
2928 #if ( configUSE_PREEMPTION == 1 )
2932 xSwitchRequired =
pdTRUE;
2947 #if ( configUSE_TICK_HOOK == 1 )
2949 vApplicationTickHook();
2954 return xSwitchRequired;
2958#if ( configUSE_APPLICATION_TASK_TAG == 1 )
2980 xTCB->pxTaskTag = pxHookFunction;
2988#if ( configUSE_APPLICATION_TASK_TAG == 1 )
3002 xReturn = pxTCB->pxTaskTag;
3012#if ( configUSE_APPLICATION_TASK_TAG == 1 )
3027 xReturn = pxTCB->pxTaskTag;
3037#if ( configUSE_APPLICATION_TASK_TAG == 1 )
3040 void * pvParameter )
3055 if( xTCB->pxTaskTag !=
NULL )
3057 xReturn = xTCB->pxTaskTag( pvParameter );
3083 #if ( configGENERATE_RUN_TIME_STATS == 1 )
3085 #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
3086 portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime );
3098 if( ulTotalRunTime > ulTaskSwitchedInTime )
3100 pxCurrentTCB->ulRunTimeCounter += ( ulTotalRunTime - ulTaskSwitchedInTime );
3107 ulTaskSwitchedInTime = ulTotalRunTime;
3115 #if ( configUSE_POSIX_ERRNO == 1 )
3127 #if ( configUSE_POSIX_ERRNO == 1 )
3133 #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
3195#if ( configUSE_TIMERS == 1 )
3218 if( xWaitIndefinitely !=
pdFALSE )
3232 TCB_t * pxUnblockedTCB;
3257 #if ( configUSE_TICKLESS_IDLE != 0 )
3301 TCB_t * pxUnblockedTCB;
3316 #if ( configUSE_TICKLESS_IDLE != 0 )
3381 #if ( INCLUDE_xTaskAbortDelay == 1 )
3392 #if ( INCLUDE_vTaskSuspend == 1 )
3413 else if( xElapsedTime < *pxTicksToWait )
3416 *pxTicksToWait -= xElapsedTime;
3438#if ( configUSE_TRACE_FACILITY == 1 )
3443 TCB_t const * pxTCB;
3448 uxReturn = pxTCB->uxTaskNumber;
3461#if ( configUSE_TRACE_FACILITY == 1 )
3471 pxTCB->uxTaskNumber = uxHandle;
3492 ( void ) pvParameters;
3508 #if ( configUSE_PREEMPTION == 0 )
3518 #if ( ( configUSE_PREEMPTION == 1 ) && ( configIDLE_SHOULD_YIELD == 1 ) )
3540 #if ( configUSE_IDLE_HOOK == 1 )
3551 #if ( configUSE_TICKLESS_IDLE != 0 )
3560 xExpectedIdleTime = prvGetExpectedIdleTime();
3570 xExpectedIdleTime = prvGetExpectedIdleTime();
3600#if ( configUSE_TICKLESS_IDLE != 0 )
3604 #if ( INCLUDE_vTaskSuspend == 1 )
3630 #if ( INCLUDE_vTaskSuspend == 1 )
3637 eReturn = eNoTasksWaitingTimeout;
3651#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )
3653 void vTaskSetThreadLocalStoragePointer(
TaskHandle_t xTaskToSet,
3659 if( ( xIndex >= 0 ) &&
3664 pxTCB->pvThreadLocalStoragePointers[ xIndex ] = pvValue;
3671#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )
3673 void * pvTaskGetThreadLocalStoragePointer(
TaskHandle_t xTaskToQuery,
3676 void * pvReturn =
NULL;
3679 if( ( xIndex >= 0 ) &&
3683 pvReturn = pxTCB->pvThreadLocalStoragePointers[ xIndex ];
3696#if ( portUSING_MPU_WRAPPERS == 1 )
3707 vPortStoreTaskMPUSettings( &( pxTCB->xMPUSettings ), xRegions,
NULL, 0 );
3726 #if ( INCLUDE_vTaskDelete == 1 )
3732 #if ( INCLUDE_vTaskSuspend == 1 )
3749 #if ( INCLUDE_vTaskDelete == 1 )
3755 while( uxDeletedTasksWaitingCleanUp > (
UBaseType_t ) 0U )
3762 --uxDeletedTasksWaitingCleanUp;
3766 prvDeleteTCB( pxTCB );
3773#if ( configUSE_TRACE_FACILITY == 1 )
3789 #if ( ( portSTACK_GROWTH > 0 ) && ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
3791 pxTaskStatus->pxEndOfStack = pxTCB->pxEndOfStack;
3795 #if ( configUSE_MUTEXES == 1 )
3805 #if ( configGENERATE_RUN_TIME_STATS == 1 )
3828 #if ( INCLUDE_vTaskSuspend == 1 )
3867 if( xGetFreeStackSpace !=
pdFALSE )
3869 #if ( portSTACK_GROWTH > 0 )
3871 pxTaskStatus->
usStackHighWaterMark = prvTaskCheckFreeStackSpace( ( uint8_t * ) pxTCB->pxEndOfStack );
3888#if ( configUSE_TRACE_FACILITY == 1 )
3911 }
while( pxNextTCB != pxFirstTCB );
3924#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 ) )
3928 uint32_t ulCount = 0U;
3944#if ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 )
3954 uint8_t * pucEndOfStack;
3966 #if portSTACK_GROWTH < 0
3968 pucEndOfStack = ( uint8_t * ) pxTCB->
pxStack;
3972 pucEndOfStack = ( uint8_t * ) pxTCB->pxEndOfStack;
3976 uxReturn = prvTaskCheckFreeStackSpace( pucEndOfStack );
3984#if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 )
3989 uint8_t * pucEndOfStack;
3994 #if portSTACK_GROWTH < 0
3996 pucEndOfStack = ( uint8_t * ) pxTCB->
pxStack;
4000 pucEndOfStack = ( uint8_t * ) pxTCB->pxEndOfStack;
4004 uxReturn = (
UBaseType_t ) prvTaskCheckFreeStackSpace( pucEndOfStack );
4012#if ( INCLUDE_vTaskDelete == 1 )
4014 static void prvDeleteTCB(
TCB_t * pxTCB )
4021 #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
4028 #if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( portUSING_MPU_WRAPPERS == 0 ) )
4035 #elif ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
4088#if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) )
4105#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
4133#if ( configUSE_MUTEXES == 1 )
4137 TCB_t *
const pxMutexHolderTCB = pxMutexHolder;
4143 if( pxMutexHolder !=
NULL )
4195 if( pxMutexHolderTCB->uxBasePriority <
pxCurrentTCB->uxPriority )
4223#if ( configUSE_MUTEXES == 1 )
4227 TCB_t *
const pxTCB = pxMutexHolder;
4230 if( pxMutexHolder !=
NULL )
4238 ( pxTCB->uxMutexesHeld )--;
4242 if( pxTCB->
uxPriority != pxTCB->uxBasePriority )
4303#if ( configUSE_MUTEXES == 1 )
4308 TCB_t *
const pxTCB = pxMutexHolder;
4309 UBaseType_t uxPriorityUsedOnEntry, uxPriorityToUse;
4312 if( pxMutexHolder !=
NULL )
4322 if( pxTCB->uxBasePriority < uxHighestPriorityWaitingTask )
4324 uxPriorityToUse = uxHighestPriorityWaitingTask;
4328 uxPriorityToUse = pxTCB->uxBasePriority;
4338 if( pxTCB->uxMutexesHeld == uxOnlyOneMutexHeld )
4409#if ( portCRITICAL_NESTING_IN_TCB == 1 )
4411 void vTaskEnterCritical(
void )
4439#if ( portCRITICAL_NESTING_IN_TCB == 1 )
4441 void vTaskExitCritical(
void )
4472#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
4474 static char * prvWriteNameToBuffer(
char * pcBuffer,
4475 const char * pcTaskName )
4480 strcpy( pcBuffer, pcTaskName );
4486 pcBuffer[
x ] =
' ';
4490 pcBuffer[
x ] = ( char ) 0x00;
4493 return &( pcBuffer[
x ] );
4499#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )
4535 *pcWriteBuffer = ( char ) 0x00;
4546 if( pxTaskStatusArray !=
NULL )
4552 for( x = 0;
x < uxArraySize;
x++ )
4554 switch( pxTaskStatusArray[ x ].eCurrentState )
4579 cStatus = ( char ) 0x00;
4585 pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
4588 sprintf( pcWriteBuffer,
"\t%c\t%u\t%u\t%u\r\n", cStatus, (
unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority, (
unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark, (
unsigned int ) pxTaskStatusArray[ x ].xTaskNumber );
4589 pcWriteBuffer += strlen( pcWriteBuffer );
4605#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configUSE_TRACE_FACILITY == 1 ) )
4639 *pcWriteBuffer = ( char ) 0x00;
4650 if( pxTaskStatusArray !=
NULL )
4656 ulTotalTime /= 100UL;
4659 if( ulTotalTime > 0UL )
4662 for( x = 0;
x < uxArraySize;
x++ )
4672 pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
4674 if( ulStatsAsPercentage > 0UL )
4676 #ifdef portLU_PRINTF_SPECIFIER_REQUIRED
4678 sprintf( pcWriteBuffer,
"\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );
4684 sprintf( pcWriteBuffer,
"\t%u\t\t%u%%\r\n", (
unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter, (
unsigned int ) ulStatsAsPercentage );
4692 #ifdef portLU_PRINTF_SPECIFIER_REQUIRED
4694 sprintf( pcWriteBuffer,
"\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].ulRunTimeCounter );
4700 sprintf( pcWriteBuffer,
"\t%u\t\t<1%%\r\n", (
unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter );
4705 pcWriteBuffer += strlen( pcWriteBuffer );
4740#if ( configUSE_MUTEXES == 1 )
4757#if ( configUSE_TASK_NOTIFICATIONS == 1 )
4770 if(
pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ] == 0UL )
4801 ulReturn =
pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ];
4803 if( ulReturn != 0UL )
4805 if( xClearCountOnExit !=
pdFALSE )
4811 pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ] = ulReturn - ( uint32_t ) 1;
4829#if ( configUSE_TASK_NOTIFICATIONS == 1 )
4832 uint32_t ulBitsToClearOnEntry,
4833 uint32_t ulBitsToClearOnExit,
4834 uint32_t * pulNotificationValue,
4849 pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ] &= ~ulBitsToClearOnEntry;
4881 if( pulNotificationValue !=
NULL )
4885 *pulNotificationValue =
pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ];
4901 pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ] &= ~ulBitsToClearOnExit;
4915#if ( configUSE_TASK_NOTIFICATIONS == 1 )
4921 uint32_t * pulPreviousNotificationValue )
4925 uint8_t ucOriginalNotifyState;
4929 pxTCB = xTaskToNotify;
4933 if( pulPreviousNotificationValue !=
NULL )
4935 *pulPreviousNotificationValue = pxTCB->ulNotifiedValue[ uxIndexToNotify ];
4938 ucOriginalNotifyState = pxTCB->ucNotifyState[ uxIndexToNotify ];
4945 pxTCB->ulNotifiedValue[ uxIndexToNotify ] |= ulValue;
4949 ( pxTCB->ulNotifiedValue[ uxIndexToNotify ] )++;
4953 pxTCB->ulNotifiedValue[ uxIndexToNotify ] = ulValue;
4960 pxTCB->ulNotifiedValue[ uxIndexToNotify ] = ulValue;
4998 #if ( configUSE_TICKLESS_IDLE != 0 )
5038#if ( configUSE_TASK_NOTIFICATIONS == 1 )
5044 uint32_t * pulPreviousNotificationValue,
5048 uint8_t ucOriginalNotifyState;
5071 portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
5073 pxTCB = xTaskToNotify;
5077 if( pulPreviousNotificationValue !=
NULL )
5079 *pulPreviousNotificationValue = pxTCB->ulNotifiedValue[ uxIndexToNotify ];
5082 ucOriginalNotifyState = pxTCB->ucNotifyState[ uxIndexToNotify ];
5088 pxTCB->ulNotifiedValue[ uxIndexToNotify ] |= ulValue;
5092 ( pxTCB->ulNotifiedValue[ uxIndexToNotify ] )++;
5096 pxTCB->ulNotifiedValue[ uxIndexToNotify ] = ulValue;
5103 pxTCB->ulNotifiedValue[ uxIndexToNotify ] = ulValue;
5153 if( pxHigherPriorityTaskWoken !=
NULL )
5155 *pxHigherPriorityTaskWoken =
pdTRUE;
5177#if ( configUSE_TASK_NOTIFICATIONS == 1 )
5184 uint8_t ucOriginalNotifyState;
5206 portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
5208 pxTCB = xTaskToNotify;
5212 ucOriginalNotifyState = pxTCB->ucNotifyState[ uxIndexToNotify ];
5217 ( pxTCB->ulNotifiedValue[ uxIndexToNotify ] )++;
5244 if( pxHigherPriorityTaskWoken !=
NULL )
5246 *pxHigherPriorityTaskWoken =
pdTRUE;
5266#if ( configUSE_TASK_NOTIFICATIONS == 1 )
5300#if ( configUSE_TASK_NOTIFICATIONS == 1 )
5304 uint32_t ulBitsToClear )
5319 ulReturn = pxTCB->ulNotifiedValue[ uxIndexToClear ];
5320 pxTCB->ulNotifiedValue[ uxIndexToClear ] &= ~ulBitsToClear;
5330#if ( configGENERATE_RUN_TIME_STATS == 1 )
5334 return xTask->ulRunTimeCounter;
5340#if ( configGENERATE_RUN_TIME_STATS == 1 )
5354 ulReturn = xTask->ulRunTimeCounter / ulTotalTime;
5367#if ( configGENERATE_RUN_TIME_STATS == 1 )
5377#if ( configGENERATE_RUN_TIME_STATS == 1 )
5393 #if ( INCLUDE_xTaskAbortDelay == 1 )
5415 #if ( INCLUDE_vTaskSuspend == 1 )
5429 xTimeToWake = xConstTickCount + xTicksToWait;
5434 if( xTimeToWake < xConstTickCount )
5465 xTimeToWake = xConstTickCount + xTicksToWait;
5470 if( xTimeToWake < xConstTickCount )
5494 ( void ) xCanBlockIndefinitely;
5500#if ( portUSING_MPU_WRAPPERS == 1 )
5502 xMPU_SETTINGS * xTaskGetMPUSettings(
TaskHandle_t xTask )
5508 return &( pxTCB->xMPUSettings );
5518#ifdef FREERTOS_MODULE_TEST
5519 #include "tasks_test_access_functions.h"
5523#if ( configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H == 1 )
5525 #include "freertos_tasks_c_additions.h"
5527 #ifdef FREERTOS_TASKS_C_ADDITIONS_INIT
5528 static void freertos_tasks_c_additions_init(
void )
5530 FREERTOS_TASKS_C_ADDITIONS_INIT();
#define configMINIMAL_STACK_SIZE
#define configMAX_PRIORITIES
#define configMAX_TASK_NAME_LEN
#define portASSERT_IF_IN_ISR()
#define portSOFTWARE_BARRIER()
#define portPRIVILEGE_BIT
#define portALLOCATE_SECURE_CONTEXT(ulSecureStackSize)
#define traceTASK_SWITCHED_IN()
#define portTICK_TYPE_EXIT_CRITICAL()
#define traceTASK_NOTIFY_TAKE_BLOCK(uxIndexToWait)
#define portCLEAN_UP_TCB(pxTCB)
#define traceTASK_PRIORITY_INHERIT(pxTCBOfMutexHolder, uxInheritedPriority)
#define traceTASK_CREATE(pxNewTCB)
#define traceTASK_SWITCHED_OUT()
#define traceTASK_NOTIFY_FROM_ISR(uxIndexToNotify)
#define traceTASK_NOTIFY_GIVE_FROM_ISR(uxIndexToNotify)
#define traceTASK_RESUME(pxTaskToResume)
#define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING(x)
#define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR(x)
#define portPOINTER_SIZE_TYPE
#define configTASK_NOTIFICATION_ARRAY_ENTRIES
#define portTICK_TYPE_ENTER_CRITICAL()
#define traceTASK_NOTIFY_WAIT_BLOCK(uxIndexToWait)
#define portPRE_TASK_DELETE_HOOK(pvTaskToDelete, pxYieldPending)
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
#define traceINCREASE_TICK_COUNT(x)
#define traceTASK_RESUME_FROM_ISR(pxTaskToResume)
#define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR()
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS
#define traceTASK_NOTIFY(uxIndexToNotify)
#define traceLOW_POWER_IDLE_END()
#define traceTASK_NOTIFY_WAIT(uxIndexToWait)
#define traceTASK_NOTIFY_TAKE(uxIndexToWait)
#define traceTASK_SUSPEND(pxTaskToSuspend)
#define mtCOVERAGE_TEST_MARKER()
#define traceTASK_DELAY_UNTIL(x)
#define configRUN_TIME_COUNTER_TYPE
#define portSETUP_TCB(pxTCB)
#define traceLOW_POWER_IDLE_BEGIN()
#define traceTASK_PRIORITY_SET(pxTask, uxNewPriority)
#define traceTASK_DELAY()
#define configSTACK_DEPTH_TYPE
#define configINITIAL_TICK_COUNT
#define traceTASK_INCREMENT_TICK(xTickCount)
#define traceTASK_PRIORITY_DISINHERIT(pxTCBOfMutexHolder, uxOriginalPriority)
struct xSTATIC_TCB StaticTask_t
#define traceTASK_DELETE(pxTaskToDelete)
#define portYIELD_WITHIN_API
#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP
void vApplicationIdleHook(void)
#define listCURRENT_LIST_LENGTH(pxList)
struct xLIST_ITEM ListItem_t
#define listGET_OWNER_OF_NEXT_ENTRY(pxTCB, pxList)
#define configLIST_VOLATILE
UBaseType_t uxListRemove(ListItem_t *const pxItemToRemove) PRIVILEGED_FUNCTION
#define listIS_CONTAINED_WITHIN(pxList, pxListItem)
#define listREMOVE_ITEM(pxItemToRemove)
#define listGET_ITEM_VALUE_OF_HEAD_ENTRY(pxList)
#define listGET_OWNER_OF_HEAD_ENTRY(pxList)
void vListInsertEnd(List_t *const pxList, ListItem_t *const pxNewListItem) PRIVILEGED_FUNCTION
#define listINSERT_END(pxList, pxNewListItem)
#define listLIST_ITEM_CONTAINER(pxListItem)
#define listSET_LIST_ITEM_VALUE(pxListItem, xValue)
void vListInsert(List_t *const pxList, ListItem_t *const pxNewListItem) PRIVILEGED_FUNCTION
#define listGET_LIST_ITEM_VALUE(pxListItem)
#define listGET_LIST_ITEM_OWNER(pxListItem)
#define listLIST_IS_EMPTY(pxList)
void vListInitialiseItem(ListItem_t *const pxItem) PRIVILEGED_FUNCTION
#define listSET_LIST_ITEM_OWNER(pxListItem, pxOwner)
void vListInitialise(List_t *const pxList) PRIVILEGED_FUNCTION
void vTaskAllocateMPURegions(TaskHandle_t xTaskToModify, const MemoryRegion_t *const xRegions) PRIVILEGED_FUNCTION
#define PRIVILEGED_FUNCTION
#define configINIT_TLS_BLOCK(xTLSBlock, pxTopOfStack)
#define configSET_TLS_BLOCK(xTLSBlock)
#define configDEINIT_TLS_BLOCK(xTLSBlock)
#define configTLS_BLOCK_TYPE
BaseType_t xPortStartScheduler(void) PRIVILEGED_FUNCTION
void vPortFree(void *pv) PRIVILEGED_FUNCTION
void * pvPortMalloc(size_t xSize) PRIVILEGED_FUNCTION
#define pvPortMallocStack
void vPortEndScheduler(void) PRIVILEGED_FUNCTION
StackType_t * pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters) PRIVILEGED_FUNCTION
#define portSUPPRESS_TICKS_AND_SLEEP(xExpectedIdleTime)
#define portTASK_FUNCTION_PROTO(vFunction, pvParameters)
#define portSET_INTERRUPT_MASK_FROM_ISR()
#define portTASK_FUNCTION(vFunction, pvParameters)
#define portMEMORY_BARRIER()
unsigned long UBaseType_t
#define portDISABLE_INTERRUPTS()
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x)
portSTACK_TYPE StackType_t
#define portENABLE_INTERRUPTS()
#define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY
void(* TaskFunction_t)(void *)
#define taskCHECK_FOR_STACK_OVERFLOW()
ListItem_t xStateListItem
The list that the state list item of a task is reference from denotes the state of that task (Ready,...
ListItem_t xEventListItem
Used to reference a task from an event list.
volatile StackType_t * pxTopOfStack
Points to the location of the last item placed on the tasks stack.
char pcTaskName[configMAX_TASK_NAME_LEN]
Descriptive name given to the task when created.
UBaseType_t uxPriority
The priority of the task.
StackType_t * pxStack
Points to the start of the stack.
TaskFunction_t pvTaskCode
StackType_t * puxStackBuffer
configSTACK_DEPTH_TYPE usStackDepth
MemoryRegion_t xRegions[portNUM_CONFIGURABLE_REGIONS]
StackType_t * pxStackBase
UBaseType_t uxCurrentPriority
UBaseType_t uxBasePriority
configRUN_TIME_COUNTER_TYPE ulRunTimeCounter
configSTACK_DEPTH_TYPE usStackHighWaterMark
TickType_t xTimeOnEntering
BaseType_t xOverflowCount
BaseType_t xTaskGetSchedulerState(void) PRIVILEGED_FUNCTION
BaseType_t xTaskPriorityDisinherit(TaskHandle_t const pxMutexHolder) PRIVILEGED_FUNCTION
configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimeCounter(const TaskHandle_t xTask) PRIVILEGED_FUNCTION
#define taskSCHEDULER_NOT_STARTED
#define taskSCHEDULER_SUSPENDED
uint32_t ulTaskGenericNotifyValueClear(TaskHandle_t xTask, UBaseType_t uxIndexToClear, uint32_t ulBitsToClear) PRIVILEGED_FUNCTION
UBaseType_t uxTaskPriorityGet(const TaskHandle_t xTask) PRIVILEGED_FUNCTION
void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority) PRIVILEGED_FUNCTION
struct tskTaskControlBlock * TaskHandle_t
void vTaskStepTick(TickType_t xTicksToJump) PRIVILEGED_FUNCTION
configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimePercent(const TaskHandle_t xTask) PRIVILEGED_FUNCTION
void vTaskDelete(TaskHandle_t xTaskToDelete) PRIVILEGED_FUNCTION
struct xTASK_PARAMETERS TaskParameters_t
TaskHandle_t xTaskGetIdleTaskHandle(void) PRIVILEGED_FUNCTION
xTaskGetIdleTaskHandle() is only available if INCLUDE_xTaskGetIdleTaskHandle is set to 1 in FreeRTOSC...
TaskHandle_t xTaskGetHandle(const char *pcNameToQuery) PRIVILEGED_FUNCTION
void vTaskGenericNotifyGiveFromISR(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
void vTaskGetRunTimeStats(char *pcWriteBuffer) PRIVILEGED_FUNCTION
TaskHandle_t pvTaskIncrementMutexHeldCount(void) PRIVILEGED_FUNCTION
struct xTIME_OUT TimeOut_t
BaseType_t xTaskGenericNotifyFromISR(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
UBaseType_t uxTaskPriorityGetFromISR(const TaskHandle_t xTask) PRIVILEGED_FUNCTION
task.
UBaseType_t uxTaskGetStackHighWaterMark(TaskHandle_t xTask) PRIVILEGED_FUNCTION
task.h
configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2(TaskHandle_t xTask) PRIVILEGED_FUNCTION
task.h
void vTaskResume(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
void vTaskSuspend(TaskHandle_t xTaskToSuspend) PRIVILEGED_FUNCTION
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounter(void) PRIVILEGED_FUNCTION
TaskHandle_t xTaskGetCurrentTaskHandle(void) PRIVILEGED_FUNCTION
UBaseType_t uxTaskGetSystemState(TaskStatus_t *const pxTaskStatusArray, const UBaseType_t uxArraySize, configRUN_TIME_COUNTER_TYPE *const pulTotalRunTime) PRIVILEGED_FUNCTION
configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for uxTaskGetSystemState() to be av...
BaseType_t xTaskGenericNotifyStateClear(TaskHandle_t xTask, UBaseType_t uxIndexToClear) PRIVILEGED_FUNCTION
#define tskIDLE_PRIORITY
Defines the priority used by the idle task.
eTaskState eTaskGetState(TaskHandle_t xTask) PRIVILEGED_FUNCTION
task.
void vTaskPriorityDisinheritAfterTimeout(TaskHandle_t const pxMutexHolder, UBaseType_t uxHighestPriorityWaitingTask) PRIVILEGED_FUNCTION
void vTaskDelay(const TickType_t xTicksToDelay) PRIVILEGED_FUNCTION
BaseType_t xTaskGenericNotifyWait(UBaseType_t uxIndexToWaitOn, uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
BaseType_t xTaskPriorityInherit(TaskHandle_t const pxMutexHolder) PRIVILEGED_FUNCTION
uint32_t ulTaskGenericNotifyTake(UBaseType_t uxIndexToWaitOn, BaseType_t xClearCountOnExit, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
#define taskEXIT_CRITICAL()
BaseType_t xTaskCallApplicationTaskHook(TaskHandle_t xTask, void *pvParameter) PRIVILEGED_FUNCTION
task.h
#define taskENTER_CRITICAL()
void vTaskList(char *pcWriteBuffer) PRIVILEGED_FUNCTION
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercent(void) PRIVILEGED_FUNCTION
struct xMEMORY_REGION MemoryRegion_t
void vTaskGetInfo(TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState) PRIVILEGED_FUNCTION
#define taskSCHEDULER_RUNNING
eSleepModeStatus eTaskConfirmSleepModeStatus(void) PRIVILEGED_FUNCTION
UBaseType_t uxTaskGetTaskNumber(TaskHandle_t xTask) PRIVILEGED_FUNCTION
void vTaskPlaceOnEventListRestricted(List_t *const pxEventList, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely) PRIVILEGED_FUNCTION
BaseType_t xTaskGenericNotify(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue) PRIVILEGED_FUNCTION
void vTaskSetTaskNumber(TaskHandle_t xTask, const UBaseType_t uxHandle) PRIVILEGED_FUNCTION
struct xTASK_STATUS TaskStatus_t
@ eSetValueWithoutOverwrite
BaseType_t xTaskResumeFromISR(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
BaseType_t xTaskDelayUntil(TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement) PRIVILEGED_FUNCTION
BaseType_t(* TaskHookFunction_t)(void *)
BaseType_t xTaskAbortDelay(TaskHandle_t xTask) PRIVILEGED_FUNCTION
void vTaskSuspendAll(void)
void vTaskPlaceOnUnorderedEventList(List_t *pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait)
static void prvAddNewTaskToReadyList(TCB_t *pxNewTCB)
static PRIVILEGED_DATA volatile BaseType_t xYieldPending
#define portRESET_READY_PRIORITY(uxPriority, uxTopReadyPriority)
const volatile UBaseType_t uxTopUsedPriority
void vTaskMissedYield(void)
#define tskSUSPENDED_CHAR
#define taskEVENT_LIST_ITEM_VALUE_IN_USE
static PRIVILEGED_DATA UBaseType_t uxTaskNumber
UBaseType_t uxTaskGetNumberOfTasks(void)
#define taskNOT_WAITING_NOTIFICATION
static PRIVILEGED_DATA List_t xDelayedTaskList2
Delayed tasks (two lists are used - one for delays that have overflowed the current tick count.
BaseType_t xTaskIncrementTick(void)
void vTaskStartScheduler(void)
void vTaskSetTimeOutState(TimeOut_t *const pxTimeOut)
TickType_t xTaskGetTickCount(void)
struct tskTaskControlBlock tskTCB
BaseType_t xTaskRemoveFromEventList(const List_t *const pxEventList)
static PRIVILEGED_DATA List_t pxReadyTasksLists[configMAX_PRIORITIES]
Prioritised ready tasks.
TickType_t uxTaskResetEventItemValue(void)
static PRIVILEGED_DATA List_t *volatile pxOverflowDelayedTaskList
Points to the delayed task list currently being used to hold tasks that have overflowed the current t...
void vTaskRemoveFromUnorderedEventList(ListItem_t *pxEventListItem, const TickType_t xItemValue)
static void prvCheckTasksWaitingTermination(void)
void vTaskInternalSetTimeOutState(TimeOut_t *const pxTimeOut)
#define prvAddTaskToReadyList(pxTCB)
#define taskRESET_READY_PRIORITY(uxPriority)
#define tskSTATICALLY_ALLOCATED_STACK_AND_TCB
static PRIVILEGED_DATA volatile TickType_t xTickCount
void vTaskSwitchContext(void)
portDONT_DISCARD PRIVILEGED_DATA TCB_t *volatile pxCurrentTCB
#define taskSWITCH_DELAYED_LISTS()
#define taskNOTIFICATION_RECEIVED
static PRIVILEGED_DATA List_t xDelayedTaskList1
Delayed tasks.
#define configIDLE_TASK_NAME
static PRIVILEGED_DATA volatile UBaseType_t uxTopReadyPriority
static PRIVILEGED_DATA volatile TickType_t xPendedTicks
static void prvAddCurrentTaskToDelayedList(TickType_t xTicksToWait, const BaseType_t xCanBlockIndefinitely)
static PRIVILEGED_DATA volatile BaseType_t xNumOfOverflows
static PRIVILEGED_DATA volatile UBaseType_t uxSchedulerSuspended
static PRIVILEGED_DATA TaskHandle_t xIdleTaskHandle
Holds the handle of the idle task.
static PRIVILEGED_DATA volatile TickType_t xNextTaskUnblockTime
char * pcTaskGetName(TaskHandle_t xTaskToQuery)
#define taskYIELD_IF_USING_PREEMPTION()
#define taskWAITING_NOTIFICATION
BaseType_t xTaskCheckForTimeOut(TimeOut_t *const pxTimeOut, TickType_t *const pxTicksToWait)
static void prvResetNextTaskUnblockTime(void)
#define tskSTACK_FILL_BYTE
TickType_t xTaskGetTickCountFromISR(void)
#define tskSTATICALLY_ALLOCATED_STACK_ONLY
#define prvGetTCBFromHandle(pxHandle)
#define taskSELECT_HIGHEST_PRIORITY_TASK()
static PRIVILEGED_DATA volatile UBaseType_t uxCurrentNumberOfTasks
static PRIVILEGED_DATA volatile BaseType_t xSchedulerRunning
void vTaskPlaceOnEventList(List_t *const pxEventList, const TickType_t xTicksToWait)
static PRIVILEGED_DATA List_t *volatile pxDelayedTaskList
Points to the delayed task list currently being used.
BaseType_t xTaskResumeAll(void)
BaseType_t xTaskCatchUpTicks(TickType_t xTicksToCatchUp)
void vTaskEndScheduler(void)
#define tskDYNAMICALLY_ALLOCATED_STACK_AND_TCB
static PRIVILEGED_DATA List_t xPendingReadyList
Tasks that have been readied while the scheduler was suspended.
static void prvInitialiseTaskLists(void)
BaseType_t xTimerCreateTimerTask(void) PRIVILEGED_FUNCTION
BaseType_t xTimerGetStaticBuffer( TimerHandle_t xTimer, StaticTimer_...