#include <stdlib.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "StackMacros.h"
#include <stdio.h>
Data Structures | |
struct | tskTaskControlBlock |
Macros | |
#define | MPU_WRAPPERS_INCLUDED_FROM_API_FILE |
#define | prvAddTaskToReadyList(pxTCB) |
#define | prvGetTCBFromHandle(pxHandle) ( ( ( pxHandle ) == NULL ) ? ( TCB_t * ) pxCurrentTCB : ( TCB_t * ) ( pxHandle ) ) |
#define | taskEVENT_LIST_ITEM_VALUE_IN_USE 0x80000000UL |
#define | taskRECORD_READY_PRIORITY(uxPriority) portRECORD_READY_PRIORITY( uxPriority, uxTopReadyPriority ) |
#define | taskRESET_READY_PRIORITY(uxPriority) |
#define | taskSELECT_HIGHEST_PRIORITY_TASK() |
#define | taskSWITCH_DELAYED_LISTS() |
#define | taskYIELD_IF_USING_PREEMPTION() portYIELD_WITHIN_API() |
#define | tskBLOCKED_CHAR ( 'B' ) |
#define | tskDELETED_CHAR ( 'D' ) |
#define | tskIDLE_STACK_SIZE configMINIMAL_STACK_SIZE |
#define | tskREADY_CHAR ( 'R' ) |
#define | tskSTACK_FILL_BYTE ( 0xa5U ) |
#define | tskSUSPENDED_CHAR ( 'S' ) |
Typedefs | |
typedef tskTCB | TCB_t |
typedef struct tskTaskControlBlock | tskTCB |
Enumerations | |
enum | eNotifyValue { eNotWaitingNotification = 0, eWaitingNotification, eNotified } |
Functions | |
eTaskState | eTaskGetState (TaskHandle_t xTask) |
task. More... | |
static | portTASK_FUNCTION (prvIdleTask, pvParameters) |
static void | prvAddCurrentTaskToDelayedList (const TickType_t xTimeToWake) |
static TCB_t * | prvAllocateTCBAndStack (const uint16_t usStackDepth, StackType_t *const puxStackBuffer) |
static void | prvCheckTasksWaitingTermination (void) |
static void | prvDeleteTCB (TCB_t *pxTCB) |
static void | prvInitialiseTaskLists (static void prvCheckTasksWaitingTermination void) |
Utility task that simply returns pdTRUE if the task referenced by xTask is currently in the Suspended state, or pdFALSE if the task referenced by xTask is in any other state. More... | |
static void | prvInitialiseTaskLists (void) |
static void | prvInitialiseTCBVariables (TCB_t *const pxTCB, const char *const pcName, UBaseType_t uxPriority, const MemoryRegion_t *const xRegions, const uint16_t usStackDepth) PRIVILEGED_FUNCTION |
static UBaseType_t | prvListTaskWithinSingleList (TaskStatus_t *pxTaskStatusArray, List_t *pxList, eTaskState eState) |
static void | prvResetNextTaskUnblockTime (void) |
static uint16_t | prvTaskCheckFreeStackSpace (const uint8_t *pucStackByte) |
static char * | prvWriteNameToBuffer (char *pcBuffer, const char *pcTaskName) |
void * | pvTaskIncrementMutexHeldCount (void) |
uint32_t | ulTaskNotifyTake (BaseType_t xClearCountOnExit, TickType_t xTicksToWait) |
UBaseType_t | uxTaskGetNumberOfTasks (void) |
UBaseType_t | uxTaskGetSystemState (TaskStatus_t *const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t *const pulTotalRunTime) |
configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for uxTaskGetSystemState() to be available. More... | |
UBaseType_t | uxTaskGetTaskNumber (TaskHandle_t xTask) |
UBaseType_t | uxTaskPriorityGet (TaskHandle_t xTask) |
UBaseType_t | uxTaskPriorityGetFromISR (TaskHandle_t xTask) |
task. More... | |
TickType_t | uxTaskResetEventItemValue (void) |
void | vApplicationStackOverflowHook (TaskHandle_t xTask, char *pcTaskName) |
void | vTaskDelay (const TickType_t xTicksToDelay) |
void | vTaskDelayUntil (TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement) |
void | vTaskDelete (TaskHandle_t xTaskToDelete) |
void | vTaskEndScheduler (void) |
void | vTaskList (char *pcWriteBuffer) |
void | vTaskMissedYield (void) |
void | vTaskNotifyGiveFromISR (TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken) |
void | vTaskPlaceOnEventList (List_t *const pxEventList, const TickType_t xTicksToWait) |
void | vTaskPlaceOnEventListRestricted (List_t *const pxEventList, const TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely) |
void | vTaskPlaceOnUnorderedEventList (List_t *pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait) |
void | vTaskPriorityInherit (TaskHandle_t const pxMutexHolder) |
void | vTaskPrioritySet (TaskHandle_t xTask, UBaseType_t uxNewPriority) |
void | vTaskSetTaskNumber (TaskHandle_t xTask, const UBaseType_t uxHandle) |
void | vTaskSetTimeOutState (TimeOut_t *const pxTimeOut) |
void | vTaskStartScheduler (void) |
void | vTaskSuspendAll (void) |
void | vTaskSwitchContext (void) |
BaseType_t | xTaskCheckForTimeOut (TimeOut_t *const pxTimeOut, TickType_t *const pxTicksToWait) |
BaseType_t | xTaskGenericNotify (TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue) |
BaseType_t | xTaskGenericNotifyFromISR (TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken) |
TaskHandle_t | xTaskGetCurrentTaskHandle (void) |
BaseType_t | xTaskGetSchedulerState (void) |
TickType_t | xTaskGetTickCount (void) |
TickType_t | xTaskGetTickCountFromISR (void) |
BaseType_t | xTaskIncrementTick (void) |
BaseType_t | xTaskNotifyStateClear (TaskHandle_t xTask) |
BaseType_t | xTaskNotifyWait (uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait) |
BaseType_t | xTaskPriorityDisinherit (TaskHandle_t const pxMutexHolder) |
BaseType_t | xTaskRemoveFromEventList (const List_t *const pxEventList) |
BaseType_t | xTaskRemoveFromUnorderedEventList (ListItem_t *pxEventListItem, const TickType_t xItemValue) |
BaseType_t | xTaskResumeAll (void) |
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE |
#define prvAddTaskToReadyList | ( | pxTCB | ) |
Referenced by vTaskNotifyGiveFromISR(), vTaskPriorityInherit(), vTaskPrioritySet(), xTaskGenericNotify(), xTaskGenericNotifyFromISR(), xTaskIncrementTick(), xTaskPriorityDisinherit(), xTaskRemoveFromEventList(), xTaskRemoveFromUnorderedEventList(), and xTaskResumeAll().
#define prvGetTCBFromHandle | ( | pxHandle | ) | ( ( ( pxHandle ) == NULL ) ? ( TCB_t * ) pxCurrentTCB : ( TCB_t * ) ( pxHandle ) ) |
Referenced by uxTaskPriorityGet(), uxTaskPriorityGetFromISR(), vTaskDelete(), vTaskPrioritySet(), and xTaskNotifyStateClear().
#define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x80000000UL |
#define taskRECORD_READY_PRIORITY | ( | uxPriority | ) | portRECORD_READY_PRIORITY( uxPriority, uxTopReadyPriority ) |
#define taskRESET_READY_PRIORITY | ( | uxPriority | ) |
Referenced by vTaskDelete(), vTaskPriorityInherit(), and xTaskPriorityDisinherit().
#define taskSELECT_HIGHEST_PRIORITY_TASK | ( | ) |
Referenced by vTaskSwitchContext().
#define taskSWITCH_DELAYED_LISTS | ( | ) |
Referenced by xTaskIncrementTick().
#define taskYIELD_IF_USING_PREEMPTION | ( | ) | portYIELD_WITHIN_API() |
Referenced by vTaskPrioritySet(), xTaskGenericNotify(), and xTaskResumeAll().
#define tskBLOCKED_CHAR ( 'B' ) |
Referenced by vTaskList().
#define tskDELETED_CHAR ( 'D' ) |
Referenced by vTaskList().
#define tskIDLE_STACK_SIZE configMINIMAL_STACK_SIZE |
Referenced by vTaskStartScheduler().
#define tskREADY_CHAR ( 'R' ) |
Referenced by vTaskList().
#define tskSTACK_FILL_BYTE ( 0xa5U ) |
Referenced by prvAllocateTCBAndStack(), and prvTaskCheckFreeStackSpace().
#define tskSUSPENDED_CHAR ( 'S' ) |
Referenced by vTaskList().
typedef struct tskTaskControlBlock tskTCB |
enum eNotifyValue |
eTaskState eTaskGetState | ( | TaskHandle_t | xTask | ) |
task.
h
eTaskState eTaskGetState( TaskHandle_t xTask );
INCLUDE_eTaskGetState must be defined as 1 for this function to be available. See the configuration section for more information.
Obtain the state of any task. States are encoded by the eTaskState enumerated type.
xTask | Handle of the task to be queried. |
References configASSERT, eBlocked, eDeleted, eReady, eRunning, eSuspended, listLIST_ITEM_CONTAINER, NULL, pxCurrentTCB, pxDelayedTaskList, pxOverflowDelayedTaskList, taskENTER_CRITICAL, taskEXIT_CRITICAL, tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xTasksWaitingTermination.
|
static |
References configASSERT, configEXPECTED_IDLE_TIME_BEFORE_SLEEP, listCURRENT_LIST_LENGTH, mtCOVERAGE_TEST_MARKER, portSUPPRESS_TICKS_AND_SLEEP, prvCheckTasksWaitingTermination(), pxReadyTasksLists, taskYIELD, traceLOW_POWER_IDLE_BEGIN, traceLOW_POWER_IDLE_END, tskIDLE_PRIORITY, void, vTaskSuspendAll(), xNextTaskUnblockTime, xTaskResumeAll(), and xTickCount.
|
static |
References listSET_LIST_ITEM_VALUE, mtCOVERAGE_TEST_MARKER, pxCurrentTCB, pxDelayedTaskList, pxOverflowDelayedTaskList, vListInsert(), tskTaskControlBlock::xGenericListItem, xNextTaskUnblockTime, and xTickCount.
Referenced by ulTaskNotifyTake(), vTaskDelay(), vTaskDelayUntil(), vTaskPlaceOnEventList(), vTaskPlaceOnEventListRestricted(), vTaskPlaceOnUnorderedEventList(), and xTaskNotifyWait().
|
static |
References NULL, pvPortMalloc(), pvPortMallocAligned, tskTaskControlBlock::pxStack, tskSTACK_FILL_BYTE, void, and vPortFree().
References listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, mtCOVERAGE_TEST_MARKER, prvDeleteTCB(), taskENTER_CRITICAL, taskEXIT_CRITICAL, uxCurrentNumberOfTasks, uxListRemove(), uxTasksDeleted, void, vTaskSuspendAll(), tskTaskControlBlock::xGenericListItem, xTaskResumeAll(), and xTasksWaitingTermination.
Referenced by portTASK_FUNCTION().
References portCLEAN_UP_TCB, tskTaskControlBlock::pxStack, vPortFree(), and vPortFreeAligned.
Referenced by prvCheckTasksWaitingTermination().
|
static |
Utility task that simply returns pdTRUE if the task referenced by xTask is currently in the Suspended state, or pdFALSE if the task referenced by xTask is in any other state.
|
static |
References configMAX_PRIORITIES, configMAX_TASK_NAME_LEN, configNUM_THREAD_LOCAL_STORAGE_POINTERS, tskTaskControlBlock::eNotifyState, eNotWaitingNotification, listSET_LIST_ITEM_OWNER, listSET_LIST_ITEM_VALUE, mtCOVERAGE_TEST_MARKER, NULL, tskTaskControlBlock::pcTaskName, tskTaskControlBlock::pxStack, tskTaskControlBlock::ulNotifiedValue, tskTaskControlBlock::uxBasePriority, tskTaskControlBlock::uxMutexesHeld, tskTaskControlBlock::uxPriority, vListInitialiseItem(), void, tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
|
static |
References eBlocked, xTASK_STATUS::eCurrentState, eSuspended, listCURRENT_LIST_LENGTH, listGET_OWNER_OF_NEXT_ENTRY, listLIST_ITEM_CONTAINER, mtCOVERAGE_TEST_MARKER, NULL, tskTaskControlBlock::pcTaskName, xTASK_STATUS::pcTaskName, prvTaskCheckFreeStackSpace(), tskTaskControlBlock::pxStack, xTASK_STATUS::ulRunTimeCounter, xTASK_STATUS::usStackHighWaterMark, tskTaskControlBlock::uxBasePriority, xTASK_STATUS::uxBasePriority, xTASK_STATUS::uxCurrentPriority, tskTaskControlBlock::uxPriority, tskTaskControlBlock::uxTCBNumber, tskTaskControlBlock::xEventListItem, xTASK_STATUS::xHandle, and xTASK_STATUS::xTaskNumber.
Referenced by uxTaskGetSystemState().
References listGET_LIST_ITEM_VALUE, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, pxDelayedTaskList, and xNextTaskUnblockTime.
Referenced by vTaskDelete(), xTaskGenericNotify(), and xTaskRemoveFromEventList().
|
static |
References tskSTACK_FILL_BYTE.
Referenced by prvListTaskWithinSingleList().
|
static |
References configMAX_TASK_NAME_LEN.
Referenced by vTaskList().
References NULL, pxCurrentTCB, and tskTaskControlBlock::uxMutexesHeld.
Referenced by xQueueGenericReceive().
uint32_t ulTaskNotifyTake | ( | BaseType_t | xClearCountOnExit, |
TickType_t | xTicksToWait | ||
) |
References tskTaskControlBlock::eNotifyState, eNotWaitingNotification, eWaitingNotification, mtCOVERAGE_TEST_MARKER, portYIELD_WITHIN_API, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, traceTASK_NOTIFY_TAKE, traceTASK_NOTIFY_TAKE_BLOCK, tskTaskControlBlock::ulNotifiedValue, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vListInsertEnd(), tskTaskControlBlock::xGenericListItem, and xTickCount.
UBaseType_t uxTaskGetNumberOfTasks | ( | void | ) |
References uxCurrentNumberOfTasks.
UBaseType_t uxTaskGetSystemState | ( | TaskStatus_t *const | pxTaskStatusArray, |
const UBaseType_t | uxArraySize, | ||
uint32_t *const | pulTotalRunTime | ||
) |
configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for uxTaskGetSystemState() to be available.
uxTaskGetSystemState() populates an TaskStatus_t structure for each task in the system. TaskStatus_t structures contain, among other things, members for the task handle, task name, task priority, task state, and total amount of run time consumed by the task. See the TaskStatus_t structure definition in this file for the full member list.
NOTE: This function is intended for debugging use only as its use results in the scheduler remaining suspended for an extended period.
pxTaskStatusArray | A pointer to an array of TaskStatus_t structures. The array must contain at least one TaskStatus_t structure for each task that is under the control of the RTOS. The number of tasks under the control of the RTOS can be determined using the uxTaskGetNumberOfTasks() API function. |
uxArraySize | The size of the array pointed to by the pxTaskStatusArray parameter. The size is specified as the number of indexes in the array, or the number of TaskStatus_t structures contained in the array, not by the number of bytes in the array. |
pulTotalRunTime | If configGENERATE_RUN_TIME_STATS is set to 1 in FreeRTOSConfig.h then *pulTotalRunTime is set by uxTaskGetSystemState() to the total run time (as defined by the run time stats clock, see http://www.freertos.org/rtos-run-time-stats.html) since the target booted. pulTotalRunTime can be set to NULL to omit the total run time information. |
Example usage:
This example demonstrates how a human readable table of run time stats information is generated from raw data provided by uxTaskGetSystemState(). The human readable table is written to pcWriteBuffer void vTaskGetRunTimeStats( char *pcWriteBuffer ) { TaskStatus_t *pxTaskStatusArray; volatile UBaseType_t uxArraySize, x; uint32_t ulTotalRunTime, ulStatsAsPercentage;
Make sure the write buffer does not contain a string. pcWriteBuffer = 0x00;
Take a snapshot of the number of tasks in case it changes while this function is executing. uxArraySize = uxTaskGetNumberOfTasks();
Allocate a TaskStatus_t structure for each task. An array could be allocated statically at compile time. pxTaskStatusArray = pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) );
if( pxTaskStatusArray != NULL ) { Generate raw status information about each task. uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalRunTime );
For percentage calculations. ulTotalRunTime /= 100UL;
Avoid divide by zero errors. if( ulTotalRunTime > 0 ) { For each populated position in the pxTaskStatusArray array, format the raw data as human readable ASCII data for( x = 0; x < uxArraySize; x++ ) { What percentage of the total run time has the task used? This will always be rounded down to the nearest integer. ulTotalRunTimeDiv100 has already been divided by 100. ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalRunTime;
if( ulStatsAsPercentage > 0UL ) { sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage ); } else { If the percentage is zero here then the task has consumed less than 1% of the total run time. sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter ); }
pcWriteBuffer += strlen( ( char * ) pcWriteBuffer ); } }
The array is no longer needed, free the memory it consumes. vPortFree( pxTaskStatusArray ); } }
References configMAX_PRIORITIES, eBlocked, eDeleted, eReady, eSuspended, mtCOVERAGE_TEST_MARKER, NULL, prvListTaskWithinSingleList(), pxDelayedTaskList, pxOverflowDelayedTaskList, pxReadyTasksLists, tskIDLE_PRIORITY, uxCurrentNumberOfTasks, void, vTaskSuspendAll(), xTaskResumeAll(), and xTasksWaitingTermination.
Referenced by vTaskList().
UBaseType_t uxTaskGetTaskNumber | ( | TaskHandle_t | xTask | ) |
References NULL, and tskTaskControlBlock::uxTaskNumber.
UBaseType_t uxTaskPriorityGet | ( | TaskHandle_t | xTask | ) |
References prvGetTCBFromHandle, taskENTER_CRITICAL, taskEXIT_CRITICAL, and tskTaskControlBlock::uxPriority.
UBaseType_t uxTaskPriorityGetFromISR | ( | TaskHandle_t | xTask | ) |
task.
h
UBaseType_t uxTaskPriorityGetFromISR( TaskHandle_t xTask );
A version of uxTaskPriorityGet() that can be used from an ISR.
References portASSERT_IF_INTERRUPT_PRIORITY_INVALID, portCLEAR_INTERRUPT_MASK_FROM_ISR, portSET_INTERRUPT_MASK_FROM_ISR, prvGetTCBFromHandle, and tskTaskControlBlock::uxPriority.
TickType_t uxTaskResetEventItemValue | ( | void | ) |
References configMAX_PRIORITIES, listGET_LIST_ITEM_VALUE, listSET_LIST_ITEM_VALUE, pxCurrentTCB, tskTaskControlBlock::uxPriority, and tskTaskControlBlock::xEventListItem.
Referenced by xEventGroupSync(), and xEventGroupWaitBits().
void vApplicationStackOverflowHook | ( | TaskHandle_t | xTask, |
char * | pcTaskName | ||
) |
void vTaskDelay | ( | const TickType_t | xTicksToDelay | ) |
References configASSERT, mtCOVERAGE_TEST_MARKER, pdFALSE, portYIELD_WITHIN_API, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, traceTASK_DELAY, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, uxTopReadyPriority, vTaskSuspendAll(), tskTaskControlBlock::xGenericListItem, xTaskResumeAll(), and xTickCount.
Referenced by ap_task(), http_request(), nm_bsp_sleep(), sta_task(), and wilc_netif_tx_from_queue().
void vTaskDelayUntil | ( | TickType_t *const | pxPreviousWakeTime, |
const TickType_t | xTimeIncrement | ||
) |
References configASSERT, mtCOVERAGE_TEST_MARKER, pdFALSE, pdTRUE, portYIELD_WITHIN_API, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, traceTASK_DELAY_UNTIL, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, uxTopReadyPriority, vTaskSuspendAll(), tskTaskControlBlock::xGenericListItem, xTaskResumeAll(), and xTickCount.
void vTaskDelete | ( | TaskHandle_t | xTaskToDelete | ) |
References configASSERT, listLIST_ITEM_CONTAINER, mtCOVERAGE_TEST_MARKER, NULL, pdFALSE, portPRE_TASK_DELETE_HOOK, portYIELD_WITHIN_API, prvGetTCBFromHandle, prvResetNextTaskUnblockTime(), pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, taskRESET_READY_PRIORITY, traceTASK_DELETE, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, uxTaskNumber, uxTasksDeleted, vListInsertEnd(), void, tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xSchedulerRunning, xTasksWaitingTermination, and xYieldPending.
Referenced by ap_task().
References pdFALSE, vPortEndScheduler(), and xSchedulerRunning.
void vTaskList | ( | char * | pcWriteBuffer | ) |
References eBlocked, eDeleted, eReady, eSuspended, mtCOVERAGE_TEST_MARKER, NULL, prvWriteNameToBuffer(), pvPortMalloc(), tskBLOCKED_CHAR, tskDELETED_CHAR, tskREADY_CHAR, tskSUSPENDED_CHAR, uxCurrentNumberOfTasks, uxTaskGetSystemState(), and vPortFree().
Referenced by http_request().
References pdTRUE, and xYieldPending.
Referenced by prvUnlockQueue().
void vTaskNotifyGiveFromISR | ( | TaskHandle_t | xTaskToNotify, |
BaseType_t * | pxHigherPriorityTaskWoken | ||
) |
References configASSERT, eNotified, tskTaskControlBlock::eNotifyState, eWaitingNotification, listLIST_ITEM_CONTAINER, mtCOVERAGE_TEST_MARKER, NULL, pdTRUE, portASSERT_IF_INTERRUPT_PRIORITY_INVALID, portCLEAR_INTERRUPT_MASK_FROM_ISR, portSET_INTERRUPT_MASK_FROM_ISR, prvAddTaskToReadyList, pxCurrentTCB, traceTASK_NOTIFY_GIVE_FROM_ISR, tskTaskControlBlock::ulNotifiedValue, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListInsertEnd(), void, tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xPendingReadyList.
References configASSERT, mtCOVERAGE_TEST_MARKER, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vListInsert(), vListInsertEnd(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xTickCount.
Referenced by xQueueGenericReceive(), and xQueueGenericSend().
void vTaskPlaceOnEventListRestricted | ( | List_t *const | pxEventList, |
const TickType_t | xTicksToWait, | ||
const BaseType_t | xWaitIndefinitely | ||
) |
References configASSERT, mtCOVERAGE_TEST_MARKER, pdTRUE, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, traceTASK_DELAY_UNTIL, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vListInsertEnd(), void, tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xTickCount.
Referenced by vQueueWaitForMessageRestricted().
void vTaskPlaceOnUnorderedEventList | ( | List_t * | pxEventList, |
const TickType_t | xItemValue, | ||
const TickType_t | xTicksToWait | ||
) |
References configASSERT, listSET_LIST_ITEM_VALUE, mtCOVERAGE_TEST_MARKER, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, taskEVENT_LIST_ITEM_VALUE_IN_USE, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, uxTopReadyPriority, vListInsertEnd(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xTickCount.
Referenced by xEventGroupSync(), and xEventGroupWaitBits().
void vTaskPriorityInherit | ( | TaskHandle_t const | pxMutexHolder | ) |
References configMAX_PRIORITIES, listGET_LIST_ITEM_VALUE, listIS_CONTAINED_WITHIN, listSET_LIST_ITEM_VALUE, mtCOVERAGE_TEST_MARKER, NULL, prvAddTaskToReadyList, pxCurrentTCB, pxReadyTasksLists, taskEVENT_LIST_ITEM_VALUE_IN_USE, taskRESET_READY_PRIORITY, traceTASK_PRIORITY_INHERIT, uxListRemove(), tskTaskControlBlock::uxPriority, tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
Referenced by xQueueGenericReceive().
void vTaskPrioritySet | ( | TaskHandle_t | xTask, |
UBaseType_t | uxNewPriority | ||
) |
References configASSERT, configMAX_PRIORITIES, listGET_LIST_ITEM_VALUE, listIS_CONTAINED_WITHIN, listSET_LIST_ITEM_VALUE, mtCOVERAGE_TEST_MARKER, pdFALSE, pdTRUE, prvAddTaskToReadyList, prvGetTCBFromHandle, pxCurrentTCB, pxReadyTasksLists, taskENTER_CRITICAL, taskEVENT_LIST_ITEM_VALUE_IN_USE, taskEXIT_CRITICAL, taskYIELD_IF_USING_PREEMPTION, traceTASK_PRIORITY_SET, tskTaskControlBlock::uxBasePriority, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, void, tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
void vTaskSetTaskNumber | ( | TaskHandle_t | xTask, |
const UBaseType_t | uxHandle | ||
) |
References NULL, and tskTaskControlBlock::uxTaskNumber.
References configASSERT, xNumOfOverflows, xTIME_OUT::xOverflowCount, xTickCount, and xTIME_OUT::xTimeOnEntering.
Referenced by xQueueGenericReceive(), xQueueGenericSend(), and xTaskCheckForTimeOut().
References configASSERT, mtCOVERAGE_TEST_MARKER, NULL, pdPASS, pdTRUE, portCONFIGURE_TIMER_FOR_RUN_TIME_STATS, pxCurrentTCB, tskIDLE_PRIORITY, tskIDLE_STACK_SIZE, xNextTaskUnblockTime, xPortStartScheduler(), xSchedulerRunning, xTaskCreate, xTickCount, and xTimerCreateTimerTask().
Referenced by main().
References uxSchedulerSuspended.
Referenced by portTASK_FUNCTION(), prvCheckTasksWaitingTermination(), prvProcessTimerOrBlockTask(), pvPortMalloc(), uxTaskGetSystemState(), vEventGroupDelete(), vPortFree(), vTaskDelay(), vTaskDelayUntil(), xEventGroupSetBits(), xEventGroupSync(), xEventGroupWaitBits(), xQueueGenericReceive(), and xQueueGenericSend().
BaseType_t xTaskCheckForTimeOut | ( | TimeOut_t *const | pxTimeOut, |
TickType_t *const | pxTicksToWait | ||
) |
References configASSERT, pdFALSE, pdTRUE, taskENTER_CRITICAL, taskEXIT_CRITICAL, vTaskSetTimeOutState(), xNumOfOverflows, xTIME_OUT::xOverflowCount, xTickCount, and xTIME_OUT::xTimeOnEntering.
Referenced by xQueueGenericReceive(), and xQueueGenericSend().
BaseType_t xTaskGenericNotify | ( | TaskHandle_t | xTaskToNotify, |
uint32_t | ulValue, | ||
eNotifyAction | eAction, | ||
uint32_t * | pulPreviousNotificationValue | ||
) |
References configASSERT, eIncrement, eNoAction, eNotified, tskTaskControlBlock::eNotifyState, eSetBits, eSetValueWithoutOverwrite, eSetValueWithOverwrite, eWaitingNotification, listLIST_ITEM_CONTAINER, mtCOVERAGE_TEST_MARKER, NULL, pdFAIL, pdPASS, prvAddTaskToReadyList, prvResetNextTaskUnblockTime(), pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, taskYIELD_IF_USING_PREEMPTION, traceTASK_NOTIFY, tskTaskControlBlock::ulNotifiedValue, uxListRemove(), tskTaskControlBlock::uxPriority, void, tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
BaseType_t xTaskGenericNotifyFromISR | ( | TaskHandle_t | xTaskToNotify, |
uint32_t | ulValue, | ||
eNotifyAction | eAction, | ||
uint32_t * | pulPreviousNotificationValue, | ||
BaseType_t * | pxHigherPriorityTaskWoken | ||
) |
References configASSERT, eIncrement, eNoAction, eNotified, tskTaskControlBlock::eNotifyState, eSetBits, eSetValueWithoutOverwrite, eSetValueWithOverwrite, eWaitingNotification, listLIST_ITEM_CONTAINER, mtCOVERAGE_TEST_MARKER, NULL, pdFAIL, pdPASS, pdTRUE, portASSERT_IF_INTERRUPT_PRIORITY_INVALID, portCLEAR_INTERRUPT_MASK_FROM_ISR, portSET_INTERRUPT_MASK_FROM_ISR, prvAddTaskToReadyList, pxCurrentTCB, traceTASK_NOTIFY_FROM_ISR, tskTaskControlBlock::ulNotifiedValue, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListInsertEnd(), void, tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xPendingReadyList.
TaskHandle_t xTaskGetCurrentTaskHandle | ( | void | ) |
References pxCurrentTCB.
Referenced by net_in_tcpip_task(), os_hook_dispatch_no_wait(), os_hook_dispatch_wait(), os_m2m_wifi_init_imp(), tcpip_init_done(), xQueueGiveMutexRecursive(), and xQueueTakeMutexRecursive().
BaseType_t xTaskGetSchedulerState | ( | void | ) |
References taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, taskSCHEDULER_SUSPENDED, uxSchedulerSuspended, and xSchedulerRunning.
Referenced by xEventGroupSync(), xEventGroupWaitBits(), xQueueGenericReceive(), xQueueGenericSend(), and xTimerGenericCommand().
TickType_t xTaskGetTickCount | ( | void | ) |
References portTICK_TYPE_ENTER_CRITICAL, portTICK_TYPE_EXIT_CRITICAL, and xTickCount.
Referenced by prvSampleTimeNow(), sys_arch_mbox_fetch(), sys_arch_sem_wait(), and sys_now().
TickType_t xTaskGetTickCountFromISR | ( | void | ) |
BaseType_t xTaskIncrementTick | ( | void | ) |
References listCURRENT_LIST_LENGTH, listGET_LIST_ITEM_VALUE, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, listLIST_ITEM_CONTAINER, mtCOVERAGE_TEST_MARKER, NULL, pdFALSE, pdTRUE, prvAddTaskToReadyList, pxCurrentTCB, pxDelayedTaskList, pxReadyTasksLists, taskSWITCH_DELAYED_LISTS, traceTASK_INCREMENT_TICK, uxListRemove(), uxPendedTicks, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, void, tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xNextTaskUnblockTime, xTickCount, and xYieldPending.
Referenced by xTaskResumeAll().
BaseType_t xTaskNotifyStateClear | ( | TaskHandle_t | xTask | ) |
BaseType_t xTaskNotifyWait | ( | uint32_t | ulBitsToClearOnEntry, |
uint32_t | ulBitsToClearOnExit, | ||
uint32_t * | pulNotificationValue, | ||
TickType_t | xTicksToWait | ||
) |
References eNotified, tskTaskControlBlock::eNotifyState, eNotWaitingNotification, eWaitingNotification, mtCOVERAGE_TEST_MARKER, NULL, pdFALSE, pdTRUE, portYIELD_WITHIN_API, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, traceTASK_NOTIFY_WAIT, traceTASK_NOTIFY_WAIT_BLOCK, tskTaskControlBlock::ulNotifiedValue, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vListInsertEnd(), tskTaskControlBlock::xGenericListItem, and xTickCount.
BaseType_t xTaskPriorityDisinherit | ( | TaskHandle_t const | pxMutexHolder | ) |
References configASSERT, configMAX_PRIORITIES, listSET_LIST_ITEM_VALUE, mtCOVERAGE_TEST_MARKER, NULL, pdFALSE, pdTRUE, prvAddTaskToReadyList, pxCurrentTCB, taskRESET_READY_PRIORITY, traceTASK_PRIORITY_DISINHERIT, tskTaskControlBlock::uxBasePriority, uxListRemove(), tskTaskControlBlock::uxMutexesHeld, tskTaskControlBlock::uxPriority, tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
Referenced by prvCopyDataToQueue().
BaseType_t xTaskRemoveFromEventList | ( | const List_t *const | pxEventList | ) |
References configASSERT, listGET_OWNER_OF_HEAD_ENTRY, pdFALSE, pdTRUE, prvAddTaskToReadyList, prvResetNextTaskUnblockTime(), pxCurrentTCB, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListInsertEnd(), void, tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xPendingReadyList, and xYieldPending.
Referenced by prvNotifyQueueSetContainer(), prvUnlockQueue(), xQueueGenericReceive(), xQueueGenericReset(), xQueueGenericSend(), xQueueGenericSendFromISR(), xQueueGiveFromISR(), and xQueueReceiveFromISR().
BaseType_t xTaskRemoveFromUnorderedEventList | ( | ListItem_t * | pxEventListItem, |
const TickType_t | xItemValue | ||
) |
References configASSERT, listGET_LIST_ITEM_OWNER, listSET_LIST_ITEM_VALUE, pdFALSE, pdTRUE, prvAddTaskToReadyList, pxCurrentTCB, taskEVENT_LIST_ITEM_VALUE_IN_USE, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, void, tskTaskControlBlock::xGenericListItem, and xYieldPending.
Referenced by vEventGroupDelete(), and xEventGroupSetBits().
BaseType_t xTaskResumeAll | ( | void | ) |
References configASSERT, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, mtCOVERAGE_TEST_MARKER, pdFALSE, pdTRUE, prvAddTaskToReadyList, pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, taskYIELD_IF_USING_PREEMPTION, uxCurrentNumberOfTasks, uxListRemove(), uxPendedTicks, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, void, tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xPendingReadyList, xTaskIncrementTick(), and xYieldPending.
Referenced by portTASK_FUNCTION(), prvCheckTasksWaitingTermination(), prvProcessTimerOrBlockTask(), pvPortMalloc(), uxTaskGetSystemState(), vEventGroupDelete(), vPortFree(), vTaskDelay(), vTaskDelayUntil(), xEventGroupSetBits(), xEventGroupSync(), xEventGroupWaitBits(), xQueueGenericReceive(), and xQueueGenericSend().
PRIVILEGED_DATA TCB_t* volatile pxCurrentTCB = NULL |
Referenced by eTaskGetState(), prvAddCurrentTaskToDelayedList(), pvTaskIncrementMutexHeldCount(), ulTaskNotifyTake(), uxTaskResetEventItemValue(), vTaskDelay(), vTaskDelayUntil(), vTaskDelete(), vTaskNotifyGiveFromISR(), vTaskPlaceOnEventList(), vTaskPlaceOnEventListRestricted(), vTaskPlaceOnUnorderedEventList(), vTaskPriorityInherit(), vTaskPrioritySet(), vTaskStartScheduler(), vTaskSwitchContext(), xTaskGenericNotify(), xTaskGenericNotifyFromISR(), xTaskGetCurrentTaskHandle(), xTaskIncrementTick(), xTaskNotifyWait(), xTaskPriorityDisinherit(), xTaskRemoveFromEventList(), xTaskRemoveFromUnorderedEventList(), and xTaskResumeAll().
|
static |
|
static |
Referenced by eTaskGetState(), prvAddCurrentTaskToDelayedList(), prvInitialiseTaskLists(), and uxTaskGetSystemState().
|
static |
|
static |
Referenced by prvCheckTasksWaitingTermination(), uxTaskGetNumberOfTasks(), uxTaskGetSystemState(), vTaskList(), and xTaskResumeAll().
|
static |
Referenced by xTaskIncrementTick(), and xTaskResumeAll().
|
static |
Referenced by vTaskDelay(), vTaskDelayUntil(), vTaskDelete(), vTaskNotifyGiveFromISR(), vTaskPlaceOnUnorderedEventList(), vTaskSuspendAll(), vTaskSwitchContext(), xTaskGenericNotifyFromISR(), xTaskGetSchedulerState(), xTaskIncrementTick(), xTaskRemoveFromEventList(), xTaskRemoveFromUnorderedEventList(), and xTaskResumeAll().
|
static |
Referenced by vTaskDelete().
|
static |
Referenced by prvCheckTasksWaitingTermination(), and vTaskDelete().
|
static |
|
static |
Referenced by prvInitialiseTaskLists().
|
static |
Referenced by prvInitialiseTaskLists().
|
static |
|
static |
Referenced by vTaskSetTimeOutState(), and xTaskCheckForTimeOut().
|
static |
|
static |
Referenced by vTaskDelete(), vTaskEndScheduler(), vTaskStartScheduler(), and xTaskGetSchedulerState().
|
static |
Referenced by eTaskGetState(), prvCheckTasksWaitingTermination(), prvInitialiseTaskLists(), uxTaskGetSystemState(), and vTaskDelete().
|
static |
Referenced by portTASK_FUNCTION(), prvAddCurrentTaskToDelayedList(), ulTaskNotifyTake(), vTaskDelay(), vTaskDelayUntil(), vTaskPlaceOnEventList(), vTaskPlaceOnEventListRestricted(), vTaskPlaceOnUnorderedEventList(), vTaskSetTimeOutState(), vTaskStartScheduler(), xTaskCheckForTimeOut(), xTaskGetTickCount(), xTaskGetTickCountFromISR(), xTaskIncrementTick(), and xTaskNotifyWait().
|
static |