firmware
IEM Firmware Documentation
Loading...
Searching...
No Matches
task.h
Go to the documentation of this file.
1/*
2 * FreeRTOS Kernel V11.1.0
3 * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * SPDX-License-Identifier: MIT
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy of
8 * this software and associated documentation files (the "Software"), to deal in
9 * the Software without restriction, including without limitation the rights to
10 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 * the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * https://www.FreeRTOS.org
25 * https://github.com/FreeRTOS
26 *
27 */
28
29
30#ifndef INC_TASK_H
31#define INC_TASK_H
32
33#ifndef INC_FREERTOS_H
34 #error "include FreeRTOS.h must appear in source files before include task.h"
35#endif
36
37#include "list.h"
38
39/* *INDENT-OFF* */
40#ifdef __cplusplus
41 extern "C" {
42#endif
43/* *INDENT-ON* */
44
45/*-----------------------------------------------------------
46* MACROS AND DEFINITIONS
47*----------------------------------------------------------*/
48
49/*
50 * If tskKERNEL_VERSION_NUMBER ends with + it represents the version in development
51 * after the numbered release.
52 *
53 * The tskKERNEL_VERSION_MAJOR, tskKERNEL_VERSION_MINOR, tskKERNEL_VERSION_BUILD
54 * values will reflect the last released version number.
55 */
56#define tskKERNEL_VERSION_NUMBER "V11.1.0"
57#define tskKERNEL_VERSION_MAJOR 11
58#define tskKERNEL_VERSION_MINOR 1
59#define tskKERNEL_VERSION_BUILD 0
60
61/* MPU region parameters passed in ulParameters
62 * of MemoryRegion_t struct. */
63#define tskMPU_REGION_READ_ONLY ( 1U << 0U )
64#define tskMPU_REGION_READ_WRITE ( 1U << 1U )
65#define tskMPU_REGION_EXECUTE_NEVER ( 1U << 2U )
66#define tskMPU_REGION_NORMAL_MEMORY ( 1U << 3U )
67#define tskMPU_REGION_DEVICE_MEMORY ( 1U << 4U )
68
69/* MPU region permissions stored in MPU settings to
70 * authorize access requests. */
71#define tskMPU_READ_PERMISSION ( 1U << 0U )
72#define tskMPU_WRITE_PERMISSION ( 1U << 1U )
73
74/* The direct to task notification feature used to have only a single notification
75 * per task. Now there is an array of notifications per task that is dimensioned by
76 * configTASK_NOTIFICATION_ARRAY_ENTRIES. For backward compatibility, any use of the
77 * original direct to task notification defaults to using the first index in the
78 * array. */
79#define tskDEFAULT_INDEX_TO_NOTIFY ( 0 )
80
91struct tskTaskControlBlock; /* The old naming convention is used to prevent breaking kernel aware debuggers. */
94
95/*
96 * Defines the prototype to which the application task hook function must
97 * conform.
98 */
99typedef BaseType_t (* TaskHookFunction_t)( void * arg );
100
101/* Task states returned by eTaskGetState. */
102typedef enum
103{
104 eRunning = 0, /* A task is querying the state of itself, so must be running. */
105 eReady, /* The task being queried is in a ready or pending ready list. */
106 eBlocked, /* The task being queried is in the Blocked state. */
107 eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */
108 eDeleted, /* The task being queried has been deleted, but its TCB has not yet been freed. */
109 eInvalid /* Used as an 'invalid state' value. */
110} eTaskState;
111
112/* Actions that can be performed when vTaskNotify() is called. */
113typedef enum
114{
115 eNoAction = 0, /* Notify the task without updating its notify value. */
116 eSetBits, /* Set bits in the task's notification value. */
117 eIncrement, /* Increment the task's notification value. */
118 eSetValueWithOverwrite, /* Set the task's notification value to a specific value even if the previous value has not yet been read by the task. */
119 eSetValueWithoutOverwrite /* Set the task's notification value if the previous value has been read by the task. */
121
122/*
123 * Used internally only.
124 */
130
131/*
132 * Defines the memory ranges allocated to the task when an MPU is used.
133 */
140
141/*
142 * Parameters required to create an MPU protected task.
143 */
144typedef struct xTASK_PARAMETERS
145{
147 const char * pcName;
153 #if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
154 StaticTask_t * const pxTaskBuffer;
155 #endif
157
158/* Used with the uxTaskGetSystemState() function to return the state of each task
159 * in the system. */
160typedef struct xTASK_STATUS
161{
162 TaskHandle_t xHandle; /* The handle of the task to which the rest of the information in the structure relates. */
163 const char * pcTaskName; /* A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */
164 UBaseType_t xTaskNumber; /* A number unique to the task. */
165 eTaskState eCurrentState; /* The state in which the task existed when the structure was populated. */
166 UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */
167 UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
168 configRUN_TIME_COUNTER_TYPE ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See https://www.FreeRTOS.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
169 StackType_t * pxStackBase; /* Points to the lowest address of the task's stack area. */
170 #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
171 StackType_t * pxTopOfStack; /* Points to the top address of the task's stack area. */
172 StackType_t * pxEndOfStack; /* Points to the end address of the task's stack area. */
173 #endif
174 configSTACK_DEPTH_TYPE usStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
175 #if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
176 UBaseType_t uxCoreAffinityMask; /* The core affinity mask for the task */
177 #endif
179
180/* Possible return values for eTaskConfirmSleepModeStatus(). */
181typedef enum
182{
183 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. */
184 eStandardSleep /* Enter a sleep mode that will not last any longer than the expected idle time. */
185 #if ( INCLUDE_vTaskSuspend == 1 )
186 ,
187 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. */
188 #endif /* INCLUDE_vTaskSuspend */
190
196#define tskIDLE_PRIORITY ( ( UBaseType_t ) 0U )
197
203#define tskNO_AFFINITY ( ( UBaseType_t ) -1 )
204
213#define taskYIELD() portYIELD()
214
227#define taskENTER_CRITICAL() portENTER_CRITICAL()
228#if ( configNUMBER_OF_CORES == 1 )
229 #define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
230#else
231 #define taskENTER_CRITICAL_FROM_ISR() portENTER_CRITICAL_FROM_ISR()
232#endif
233
246#define taskEXIT_CRITICAL() portEXIT_CRITICAL()
247#if ( configNUMBER_OF_CORES == 1 )
248 #define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
249#else
250 #define taskEXIT_CRITICAL_FROM_ISR( x ) portEXIT_CRITICAL_FROM_ISR( x )
251#endif
252
261#define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
262
271#define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
272
273/* Definitions returned by xTaskGetSchedulerState(). taskSCHEDULER_SUSPENDED is
274 * 0 to generate more optimal code when configASSERT() is defined as the constant
275 * is used in assert() statements. */
276#define taskSCHEDULER_SUSPENDED ( ( BaseType_t ) 0 )
277#define taskSCHEDULER_NOT_STARTED ( ( BaseType_t ) 1 )
278#define taskSCHEDULER_RUNNING ( ( BaseType_t ) 2 )
279
280/* Checks if core ID is valid. */
281#define taskVALID_CORE_ID( xCoreID ) ( ( ( ( ( BaseType_t ) 0 <= ( xCoreID ) ) && ( ( xCoreID ) < ( BaseType_t ) configNUMBER_OF_CORES ) ) ) ? ( pdTRUE ) : ( pdFALSE ) )
282
283/*-----------------------------------------------------------
284* TASK CREATION API
285*----------------------------------------------------------*/
286
381#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
382 BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,
383 const char * const pcName,
384 const configSTACK_DEPTH_TYPE uxStackDepth,
385 void * const pvParameters,
386 UBaseType_t uxPriority,
387 TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
388#endif
389
390#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
391 BaseType_t xTaskCreateAffinitySet( TaskFunction_t pxTaskCode,
392 const char * const pcName,
393 const configSTACK_DEPTH_TYPE uxStackDepth,
394 void * const pvParameters,
395 UBaseType_t uxPriority,
396 UBaseType_t uxCoreAffinityMask,
397 TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
398#endif
399
508#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
509 TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
510 const char * const pcName,
511 const configSTACK_DEPTH_TYPE uxStackDepth,
512 void * const pvParameters,
513 UBaseType_t uxPriority,
514 StackType_t * const puxStackBuffer,
515 StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION;
516#endif /* configSUPPORT_STATIC_ALLOCATION */
517
518#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
519 TaskHandle_t xTaskCreateStaticAffinitySet( TaskFunction_t pxTaskCode,
520 const char * const pcName,
521 const configSTACK_DEPTH_TYPE uxStackDepth,
522 void * const pvParameters,
523 UBaseType_t uxPriority,
524 StackType_t * const puxStackBuffer,
525 StaticTask_t * const pxTaskBuffer,
526 UBaseType_t uxCoreAffinityMask ) PRIVILEGED_FUNCTION;
527#endif
528
602#if ( portUSING_MPU_WRAPPERS == 1 )
603 BaseType_t xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
604 TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
605#endif
606
607#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
608 BaseType_t xTaskCreateRestrictedAffinitySet( const TaskParameters_t * const pxTaskDefinition,
609 UBaseType_t uxCoreAffinityMask,
610 TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
611#endif
612
698#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
699 BaseType_t xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition,
700 TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
701#endif
702
703#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
704 BaseType_t xTaskCreateRestrictedStaticAffinitySet( const TaskParameters_t * const pxTaskDefinition,
705 UBaseType_t uxCoreAffinityMask,
706 TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
707#endif
708
756#if ( portUSING_MPU_WRAPPERS == 1 )
757 void vTaskAllocateMPURegions( TaskHandle_t xTaskToModify,
758 const MemoryRegion_t * const pxRegions ) PRIVILEGED_FUNCTION;
759#endif
760
803
804/*-----------------------------------------------------------
805* TASK CONTROL API
806*----------------------------------------------------------*/
807
856void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
857
923BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
924 const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION;
925
926/*
927 * vTaskDelayUntil() is the older version of xTaskDelayUntil() and does not
928 * return a value.
929 */
930#define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \
931 do { \
932 ( void ) xTaskDelayUntil( ( pxPreviousWakeTime ), ( xTimeIncrement ) ); \
933 } while( 0 )
934
935
966#if ( INCLUDE_xTaskAbortDelay == 1 )
967 BaseType_t xTaskAbortDelay( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
968#endif
969
1018
1028
1049
1059
1078#if ( ( INCLUDE_eTaskGetState == 1 ) || ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_xTaskAbortDelay == 1 ) )
1079 eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1080#endif
1081
1138#if ( configUSE_TRACE_FACILITY == 1 )
1139 void vTaskGetInfo( TaskHandle_t xTask,
1140 TaskStatus_t * pxTaskStatus,
1141 BaseType_t xGetFreeStackSpace,
1143#endif
1144
1188 UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION;
1189
1242
1293
1324
1325#if ( configUSE_CORE_AFFINITY == 1 )
1326
1360 void vTaskCoreAffinitySet( const TaskHandle_t xTask,
1361 UBaseType_t uxCoreAffinityMask );
1362#endif
1363
1364#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
1365
1412 UBaseType_t vTaskCoreAffinityGet( ConstTaskHandle_t xTask );
1413#endif
1414
1415#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
1416
1446 void vTaskPreemptionDisable( const TaskHandle_t xTask );
1447#endif
1448
1449#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
1450
1480 void vTaskPreemptionEnable( const TaskHandle_t xTask );
1481#endif
1482
1483/*-----------------------------------------------------------
1484* SCHEDULER CONTROL
1485*----------------------------------------------------------*/
1486
1517
1575
1628
1684
1685/*-----------------------------------------------------------
1686* TASK UTILITIES
1687*----------------------------------------------------------*/
1688
1701
1719
1735
1749char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION;
1750
1767#if ( INCLUDE_xTaskGetHandle == 1 )
1768 TaskHandle_t xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION;
1769#endif
1770
1795#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
1796 BaseType_t xTaskGetStaticBuffers( TaskHandle_t xTask,
1797 StackType_t ** ppuxStackBuffer,
1798 StaticTask_t ** ppxTaskBuffer ) PRIVILEGED_FUNCTION;
1799#endif /* configSUPPORT_STATIC_ALLOCATION */
1800
1828#if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 )
1829 UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1830#endif
1831
1859#if ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 )
1860 configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1861#endif
1862
1863/* When using trace macros it is sometimes necessary to include task.h before
1864 * FreeRTOS.h. When this is done TaskHookFunction_t will not yet have been defined,
1865 * so the following two prototypes will cause a compilation error. This can be
1866 * fixed by simply guarding against the inclusion of these two prototypes unless
1867 * they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration
1868 * constant. */
1869#ifdef configUSE_APPLICATION_TASK_TAG
1870 #if configUSE_APPLICATION_TASK_TAG == 1
1871
1882 void vTaskSetApplicationTaskTag( TaskHandle_t xTask,
1883 TaskHookFunction_t pxHookFunction ) PRIVILEGED_FUNCTION;
1884
1895 TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1896
1906 TaskHookFunction_t xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1907 #endif /* configUSE_APPLICATION_TASK_TAG ==1 */
1908#endif /* ifdef configUSE_APPLICATION_TASK_TAG */
1909
1910#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
1911
1912/* Each task contains an array of pointers that is dimensioned by the
1913 * configNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. The
1914 * kernel does not use the pointers itself, so the application writer can use
1915 * the pointers for any purpose they wish. The following two functions are
1916 * used to set and query a pointer respectively. */
1917 void vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
1918 BaseType_t xIndex,
1919 void * pvValue ) PRIVILEGED_FUNCTION;
1920 void * pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
1922
1923#endif
1924
1925#if ( configCHECK_FOR_STACK_OVERFLOW > 0 )
1926
1940 /* MISRA Ref 8.6.1 [External linkage] */
1941 /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
1942 /* coverity[misra_c_2012_rule_8_6_violation] */
1943 void vApplicationStackOverflowHook( TaskHandle_t xTask,
1944 char * pcTaskName );
1945
1946#endif
1947
1948#if ( configUSE_IDLE_HOOK == 1 )
1949
1961 /* MISRA Ref 8.6.1 [External linkage] */
1962 /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
1963 /* coverity[misra_c_2012_rule_8_6_violation] */
1964 void vApplicationIdleHook( void );
1965
1966#endif
1967
1968
1969#if ( configUSE_TICK_HOOK != 0 )
1970
1979 /* MISRA Ref 8.6.1 [External linkage] */
1980 /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
1981 /* coverity[misra_c_2012_rule_8_6_violation] */
1982 void vApplicationTickHook( void );
1983
1984#endif
1985
1986#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
1987
2001 void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
2002 StackType_t ** ppxIdleTaskStackBuffer,
2003 configSTACK_DEPTH_TYPE * puxIdleTaskStackSize );
2004
2029 #if ( configNUMBER_OF_CORES > 1 )
2030 void vApplicationGetPassiveIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
2031 StackType_t ** ppxIdleTaskStackBuffer,
2032 configSTACK_DEPTH_TYPE * puxIdleTaskStackSize,
2033 BaseType_t xPassiveIdleTaskIndex );
2034 #endif /* #if ( configNUMBER_OF_CORES > 1 ) */
2035#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
2036
2050#if ( configUSE_APPLICATION_TASK_TAG == 1 )
2051 BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask,
2052 void * pvParameter ) PRIVILEGED_FUNCTION;
2053#endif
2054
2072#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
2073 #if ( configNUMBER_OF_CORES == 1 )
2074 TaskHandle_t xTaskGetIdleTaskHandle( void ) PRIVILEGED_FUNCTION;
2075 #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
2076
2077 TaskHandle_t xTaskGetIdleTaskHandleForCore( BaseType_t xCoreID ) PRIVILEGED_FUNCTION;
2078#endif /* #if ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) */
2079
2177#if ( configUSE_TRACE_FACILITY == 1 )
2178 UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
2179 const UBaseType_t uxArraySize,
2180 configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) PRIVILEGED_FUNCTION;
2181#endif
2182
2234#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )
2235 void vTaskListTasks( char * pcWriteBuffer,
2236 size_t uxBufferLength ) PRIVILEGED_FUNCTION;
2237#endif
2238
2293#define vTaskList( pcWriteBuffer ) vTaskListTasks( ( pcWriteBuffer ), configSTATS_BUFFER_MAX_LENGTH )
2294
2351#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configUSE_TRACE_FACILITY == 1 ) )
2352 void vTaskGetRunTimeStatistics( char * pcWriteBuffer,
2353 size_t uxBufferLength ) PRIVILEGED_FUNCTION;
2354#endif
2355
2416#define vTaskGetRunTimeStats( pcWriteBuffer ) vTaskGetRunTimeStatistics( ( pcWriteBuffer ), configSTATS_BUFFER_MAX_LENGTH )
2417
2451#if ( configGENERATE_RUN_TIME_STATS == 1 )
2452 configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimeCounter( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
2453 configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimePercent( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
2454#endif
2455
2493#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
2494 configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounter( void ) PRIVILEGED_FUNCTION;
2495 configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercent( void ) PRIVILEGED_FUNCTION;
2496#endif
2497
2607 UBaseType_t uxIndexToNotify,
2608 uint32_t ulValue,
2609 eNotifyAction eAction,
2610 uint32_t * pulPreviousNotificationValue ) PRIVILEGED_FUNCTION;
2611#define xTaskNotify( xTaskToNotify, ulValue, eAction ) \
2612 xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), NULL )
2613#define xTaskNotifyIndexed( xTaskToNotify, uxIndexToNotify, ulValue, eAction ) \
2614 xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), NULL )
2615
2640#define xTaskNotifyAndQuery( xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue ) \
2641 xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
2642#define xTaskNotifyAndQueryIndexed( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotifyValue ) \
2643 xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
2644
2759 UBaseType_t uxIndexToNotify,
2760 uint32_t ulValue,
2761 eNotifyAction eAction,
2762 uint32_t * pulPreviousNotificationValue,
2763 BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
2764#define xTaskNotifyFromISR( xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) \
2765 xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
2766#define xTaskNotifyIndexedFromISR( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) \
2767 xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
2768
2793#define xTaskNotifyAndQueryIndexedFromISR( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) \
2794 xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
2795#define xTaskNotifyAndQueryFromISR( xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) \
2796 xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
2797
2903 uint32_t ulBitsToClearOnEntry,
2904 uint32_t ulBitsToClearOnExit,
2905 uint32_t * pulNotificationValue,
2906 TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
2907#define xTaskNotifyWait( ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ) \
2908 xTaskGenericNotifyWait( tskDEFAULT_INDEX_TO_NOTIFY, ( ulBitsToClearOnEntry ), ( ulBitsToClearOnExit ), ( pulNotificationValue ), ( xTicksToWait ) )
2909#define xTaskNotifyWaitIndexed( uxIndexToWaitOn, ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ) \
2910 xTaskGenericNotifyWait( ( uxIndexToWaitOn ), ( ulBitsToClearOnEntry ), ( ulBitsToClearOnExit ), ( pulNotificationValue ), ( xTicksToWait ) )
2911
2984#define xTaskNotifyGive( xTaskToNotify ) \
2985 xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( 0 ), eIncrement, NULL )
2986#define xTaskNotifyGiveIndexed( xTaskToNotify, uxIndexToNotify ) \
2987 xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( 0 ), eIncrement, NULL )
2988
3069 UBaseType_t uxIndexToNotify,
3070 BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
3071#define vTaskNotifyGiveFromISR( xTaskToNotify, pxHigherPriorityTaskWoken ) \
3072 vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( pxHigherPriorityTaskWoken ) )
3073#define vTaskNotifyGiveIndexedFromISR( xTaskToNotify, uxIndexToNotify, pxHigherPriorityTaskWoken ) \
3074 vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( pxHigherPriorityTaskWoken ) )
3075
3174uint32_t ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
3175 BaseType_t xClearCountOnExit,
3176 TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
3177#define ulTaskNotifyTake( xClearCountOnExit, xTicksToWait ) \
3178 ulTaskGenericNotifyTake( ( tskDEFAULT_INDEX_TO_NOTIFY ), ( xClearCountOnExit ), ( xTicksToWait ) )
3179#define ulTaskNotifyTakeIndexed( uxIndexToWaitOn, xClearCountOnExit, xTicksToWait ) \
3180 ulTaskGenericNotifyTake( ( uxIndexToWaitOn ), ( xClearCountOnExit ), ( xTicksToWait ) )
3181
3240 UBaseType_t uxIndexToClear ) PRIVILEGED_FUNCTION;
3241#define xTaskNotifyStateClear( xTask ) \
3242 xTaskGenericNotifyStateClear( ( xTask ), ( tskDEFAULT_INDEX_TO_NOTIFY ) )
3243#define xTaskNotifyStateClearIndexed( xTask, uxIndexToClear ) \
3244 xTaskGenericNotifyStateClear( ( xTask ), ( uxIndexToClear ) )
3245
3305 UBaseType_t uxIndexToClear,
3306 uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
3307#define ulTaskNotifyValueClear( xTask, ulBitsToClear ) \
3308 ulTaskGenericNotifyValueClear( ( xTask ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulBitsToClear ) )
3309#define ulTaskNotifyValueClearIndexed( xTask, uxIndexToClear, ulBitsToClear ) \
3310 ulTaskGenericNotifyValueClear( ( xTask ), ( uxIndexToClear ), ( ulBitsToClear ) )
3311
3326void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION;
3327
3411BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
3412 TickType_t * const pxTicksToWait ) PRIVILEGED_FUNCTION;
3413
3441
3455
3456
3457/*-----------------------------------------------------------
3458* SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
3459*----------------------------------------------------------*/
3460
3461#if ( configNUMBER_OF_CORES == 1 )
3462 #define taskYIELD_WITHIN_API() portYIELD_WITHIN_API()
3463#else /* #if ( configNUMBER_OF_CORES == 1 ) */
3464 #define taskYIELD_WITHIN_API() vTaskYieldWithinAPI()
3465#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
3466
3467/*
3468 * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
3469 * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
3470 * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
3471 *
3472 * Called from the real time kernel tick (either preemptive or cooperative),
3473 * this increments the tick count and checks if any tasks that are blocked
3474 * for a finite period required removing from a blocked list and placing on
3475 * a ready list. If a non-zero value is returned then a context switch is
3476 * required because either:
3477 * + A task was removed from a blocked list because its timeout had expired,
3478 * or
3479 * + Time slicing is in use and there is a task of equal priority to the
3480 * currently running task.
3481 */
3483
3484/*
3485 * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
3486 * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
3487 *
3488 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
3489 *
3490 * Removes the calling task from the ready list and places it both
3491 * on the list of tasks waiting for a particular event, and the
3492 * list of delayed tasks. The task will be removed from both lists
3493 * and replaced on the ready list should either the event occur (and
3494 * there be no higher priority tasks waiting on the same event) or
3495 * the delay period expires.
3496 *
3497 * The 'unordered' version replaces the event list item value with the
3498 * xItemValue value, and inserts the list item at the end of the list.
3499 *
3500 * The 'ordered' version uses the existing event list item value (which is the
3501 * owning task's priority) to insert the list item into the event list in task
3502 * priority order.
3503 *
3504 * @param pxEventList The list containing tasks that are blocked waiting
3505 * for the event to occur.
3506 *
3507 * @param xItemValue The item value to use for the event list item when the
3508 * event list is not ordered by task priority.
3509 *
3510 * @param xTicksToWait The maximum amount of time that the task should wait
3511 * for the event to occur. This is specified in kernel ticks, the constant
3512 * portTICK_PERIOD_MS can be used to convert kernel ticks into a real time
3513 * period.
3514 */
3515void vTaskPlaceOnEventList( List_t * const pxEventList,
3516 const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
3517void vTaskPlaceOnUnorderedEventList( List_t * pxEventList,
3518 const TickType_t xItemValue,
3519 const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
3520
3521/*
3522 * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
3523 * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
3524 *
3525 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
3526 *
3527 * This function performs nearly the same function as vTaskPlaceOnEventList().
3528 * The difference being that this function does not permit tasks to block
3529 * indefinitely, whereas vTaskPlaceOnEventList() does.
3530 *
3531 */
3532void vTaskPlaceOnEventListRestricted( List_t * const pxEventList,
3533 TickType_t xTicksToWait,
3534 const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
3535
3536/*
3537 * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
3538 * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
3539 *
3540 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
3541 *
3542 * Removes a task from both the specified event list and the list of blocked
3543 * tasks, and places it on a ready queue.
3544 *
3545 * xTaskRemoveFromEventList()/vTaskRemoveFromUnorderedEventList() will be called
3546 * if either an event occurs to unblock a task, or the block timeout period
3547 * expires.
3548 *
3549 * xTaskRemoveFromEventList() is used when the event list is in task priority
3550 * order. It removes the list item from the head of the event list as that will
3551 * have the highest priority owning task of all the tasks on the event list.
3552 * vTaskRemoveFromUnorderedEventList() is used when the event list is not
3553 * ordered and the event list items hold something other than the owning tasks
3554 * priority. In this case the event list item value is updated to the value
3555 * passed in the xItemValue parameter.
3556 *
3557 * @return pdTRUE if the task being removed has a higher priority than the task
3558 * making the call, otherwise pdFALSE.
3559 */
3561void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
3562 const TickType_t xItemValue ) PRIVILEGED_FUNCTION;
3563
3564/*
3565 * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
3566 * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
3567 * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
3568 *
3569 * Sets the pointer to the current TCB to the TCB of the highest priority task
3570 * that is ready to run.
3571 */
3572#if ( configNUMBER_OF_CORES == 1 )
3574#else
3576#endif
3577
3578/*
3579 * THESE FUNCTIONS MUST NOT BE USED FROM APPLICATION CODE. THEY ARE USED BY
3580 * THE EVENT BITS MODULE.
3581 */
3583
3584/*
3585 * Return the handle of the calling task.
3586 */
3588
3589/*
3590 * Return the handle of the task running on specified core.
3591 */
3593
3594/*
3595 * Shortcut used by the queue implementation to prevent unnecessary call to
3596 * taskYIELD();
3597 */
3599
3600/*
3601 * Returns the scheduler state as taskSCHEDULER_RUNNING,
3602 * taskSCHEDULER_NOT_STARTED or taskSCHEDULER_SUSPENDED.
3603 */
3605
3606/*
3607 * Raises the priority of the mutex holder to that of the calling task should
3608 * the mutex holder have a priority less than the calling task.
3609 */
3611
3612/*
3613 * Set the priority of a task back to its proper priority in the case that it
3614 * inherited a higher priority while it was holding a semaphore.
3615 */
3617
3618/*
3619 * If a higher priority task attempting to obtain a mutex caused a lower
3620 * priority task to inherit the higher priority task's priority - but the higher
3621 * priority task then timed out without obtaining the mutex, then the lower
3622 * priority task will disinherit the priority again - but only down as far as
3623 * the highest priority task that is still waiting for the mutex (if there were
3624 * more than one task waiting for the mutex).
3625 */
3627 UBaseType_t uxHighestPriorityWaitingTask ) PRIVILEGED_FUNCTION;
3628
3629/*
3630 * Get the uxTaskNumber assigned to the task referenced by the xTask parameter.
3631 */
3632#if ( configUSE_TRACE_FACILITY == 1 )
3633 UBaseType_t uxTaskGetTaskNumber( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
3634#endif
3635
3636/*
3637 * Set the uxTaskNumber of the task referenced by the xTask parameter to
3638 * uxHandle.
3639 */
3640#if ( configUSE_TRACE_FACILITY == 1 )
3641 void vTaskSetTaskNumber( TaskHandle_t xTask,
3642 const UBaseType_t uxHandle ) PRIVILEGED_FUNCTION;
3643#endif
3644
3645/*
3646 * Only available when configUSE_TICKLESS_IDLE is set to 1.
3647 * If tickless mode is being used, or a low power mode is implemented, then
3648 * the tick interrupt will not execute during idle periods. When this is the
3649 * case, the tick count value maintained by the scheduler needs to be kept up
3650 * to date with the actual execution time by being skipped forward by a time
3651 * equal to the idle period.
3652 */
3653#if ( configUSE_TICKLESS_IDLE != 0 )
3654 void vTaskStepTick( TickType_t xTicksToJump ) PRIVILEGED_FUNCTION;
3655#endif
3656
3657/*
3658 * Only available when configUSE_TICKLESS_IDLE is set to 1.
3659 * Provided for use within portSUPPRESS_TICKS_AND_SLEEP() to allow the port
3660 * specific sleep function to determine if it is ok to proceed with the sleep,
3661 * and if it is ok to proceed, if it is ok to sleep indefinitely.
3662 *
3663 * This function is necessary because portSUPPRESS_TICKS_AND_SLEEP() is only
3664 * called with the scheduler suspended, not from within a critical section. It
3665 * is therefore possible for an interrupt to request a context switch between
3666 * portSUPPRESS_TICKS_AND_SLEEP() and the low power mode actually being
3667 * entered. eTaskConfirmSleepModeStatus() should be called from a short
3668 * critical section between the timer being stopped and the sleep mode being
3669 * entered to ensure it is ok to proceed into the sleep mode.
3670 */
3671#if ( configUSE_TICKLESS_IDLE != 0 )
3672 eSleepModeStatus eTaskConfirmSleepModeStatus( void ) PRIVILEGED_FUNCTION;
3673#endif
3674
3675/*
3676 * For internal use only. Increment the mutex held count when a mutex is
3677 * taken and return the handle of the task that has taken the mutex.
3678 */
3680
3681/*
3682 * For internal use only. Same as vTaskSetTimeOutState(), but without a critical
3683 * section.
3684 */
3686
3687/*
3688 * For internal use only. Same as portYIELD_WITHIN_API() in single core FreeRTOS.
3689 * For SMP this is not defined by the port.
3690 */
3691#if ( configNUMBER_OF_CORES > 1 )
3692 void vTaskYieldWithinAPI( void );
3693#endif
3694
3695/*
3696 * This function is only intended for use when implementing a port of the scheduler
3697 * and is only available when portCRITICAL_NESTING_IN_TCB is set to 1 or configNUMBER_OF_CORES
3698 * is greater than 1. This function can be used in the implementation of portENTER_CRITICAL
3699 * if port wants to maintain critical nesting count in TCB in single core FreeRTOS.
3700 * It should be used in the implementation of portENTER_CRITICAL if port is running a
3701 * multiple core FreeRTOS.
3702 */
3703#if ( ( portCRITICAL_NESTING_IN_TCB == 1 ) || ( configNUMBER_OF_CORES > 1 ) )
3704 void vTaskEnterCritical( void );
3705#endif
3706
3707/*
3708 * This function is only intended for use when implementing a port of the scheduler
3709 * and is only available when portCRITICAL_NESTING_IN_TCB is set to 1 or configNUMBER_OF_CORES
3710 * is greater than 1. This function can be used in the implementation of portEXIT_CRITICAL
3711 * if port wants to maintain critical nesting count in TCB in single core FreeRTOS.
3712 * It should be used in the implementation of portEXIT_CRITICAL if port is running a
3713 * multiple core FreeRTOS.
3714 */
3715#if ( ( portCRITICAL_NESTING_IN_TCB == 1 ) || ( configNUMBER_OF_CORES > 1 ) )
3716 void vTaskExitCritical( void );
3717#endif
3718
3719/*
3720 * This function is only intended for use when implementing a port of the scheduler
3721 * and is only available when configNUMBER_OF_CORES is greater than 1. This function
3722 * should be used in the implementation of portENTER_CRITICAL_FROM_ISR if port is
3723 * running a multiple core FreeRTOS.
3724 */
3725#if ( configNUMBER_OF_CORES > 1 )
3726 UBaseType_t vTaskEnterCriticalFromISR( void );
3727#endif
3728
3729/*
3730 * This function is only intended for use when implementing a port of the scheduler
3731 * and is only available when configNUMBER_OF_CORES is greater than 1. This function
3732 * should be used in the implementation of portEXIT_CRITICAL_FROM_ISR if port is
3733 * running a multiple core FreeRTOS.
3734 */
3735#if ( configNUMBER_OF_CORES > 1 )
3736 void vTaskExitCriticalFromISR( UBaseType_t uxSavedInterruptStatus );
3737#endif
3738
3739#if ( portUSING_MPU_WRAPPERS == 1 )
3740
3741/*
3742 * For internal use only. Get MPU settings associated with a task.
3743 */
3744 xMPU_SETTINGS * xTaskGetMPUSettings( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
3745
3746#endif /* portUSING_MPU_WRAPPERS */
3747
3748
3749#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configENABLE_ACCESS_CONTROL_LIST == 1 ) )
3750
3751/*
3752 * For internal use only. Grant/Revoke a task's access to a kernel object.
3753 */
3754 void vGrantAccessToKernelObject( TaskHandle_t xExternalTaskHandle,
3755 int32_t lExternalKernelObjectHandle ) PRIVILEGED_FUNCTION;
3756 void vRevokeAccessToKernelObject( TaskHandle_t xExternalTaskHandle,
3757 int32_t lExternalKernelObjectHandle ) PRIVILEGED_FUNCTION;
3758
3759/*
3760 * For internal use only. Grant/Revoke a task's access to a kernel object.
3761 */
3762 void vPortGrantAccessToKernelObject( TaskHandle_t xInternalTaskHandle,
3763 int32_t lInternalIndexOfKernelObject ) PRIVILEGED_FUNCTION;
3764 void vPortRevokeAccessToKernelObject( TaskHandle_t xInternalTaskHandle,
3765 int32_t lInternalIndexOfKernelObject ) PRIVILEGED_FUNCTION;
3766
3767#endif /* #if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configENABLE_ACCESS_CONTROL_LIST == 1 ) ) */
3768
3769/* *INDENT-OFF* */
3770#ifdef __cplusplus
3771 }
3772#endif
3773/* *INDENT-ON* */
3774#endif /* INC_TASK_H */
struct xSTATIC_TCB StaticTask_t
#define configRUN_TIME_COUNTER_TYPE
Definition FreeRTOSConfig.h:99
#define configSTACK_DEPTH_TYPE
Definition FreeRTOSConfig.h:107
struct xLIST_ITEM ListItem_t
Definition list.h:154
struct xLIST List_t
#define PRIVILEGED_FUNCTION
Definition mpu_wrappers.h:269
#define portNUM_CONFIGURABLE_REGIONS
Definition portable.h:77
long BaseType_t
Definition portmacro.h:59
unsigned long UBaseType_t
Definition portmacro.h:60
#define portDONT_DISCARD
Definition portmacro.h:81
uint16_t TickType_t
Definition portmacro.h:63
portSTACK_TYPE StackType_t
Definition portmacro.h:58
void(* TaskFunction_t)(void *arg)
Definition projdefs.h:36
Definition tasks.c:359
Definition task.h:135
void * pvBaseAddress
Definition task.h:136
uint32_t ulParameters
Definition task.h:138
uint32_t ulLengthInBytes
Definition task.h:137
Definition task.h:145
TaskFunction_t pvTaskCode
Definition task.h:146
StackType_t * puxStackBuffer
Definition task.h:151
UBaseType_t uxPriority
Definition task.h:150
configSTACK_DEPTH_TYPE usStackDepth
Definition task.h:148
const char * pcName
Definition task.h:147
void * pvParameters
Definition task.h:149
MemoryRegion_t xRegions[portNUM_CONFIGURABLE_REGIONS]
Definition task.h:152
Definition task.h:161
StackType_t * pxStackBase
Definition task.h:169
UBaseType_t uxCurrentPriority
Definition task.h:166
UBaseType_t uxBasePriority
Definition task.h:167
eTaskState eCurrentState
Definition task.h:165
configRUN_TIME_COUNTER_TYPE ulRunTimeCounter
Definition task.h:168
configSTACK_DEPTH_TYPE usStackHighWaterMark
Definition task.h:174
TaskHandle_t xHandle
Definition task.h:162
UBaseType_t xTaskNumber
Definition task.h:164
const char * pcTaskName
Definition task.h:163
Definition task.h:126
TickType_t xTimeOnEntering
Definition task.h:128
BaseType_t xOverflowCount
Definition task.h:127
BaseType_t xTaskResumeAll(void) PRIVILEGED_FUNCTION
Definition tasks.c:3956
BaseType_t xTaskGetSchedulerState(void) PRIVILEGED_FUNCTION
BaseType_t xTaskPriorityDisinherit(TaskHandle_t const pxMutexHolder) PRIVILEGED_FUNCTION
TickType_t xTaskGetTickCountFromISR(void) PRIVILEGED_FUNCTION
Definition tasks.c:4125
BaseType_t xTaskRemoveFromEventList(const List_t *const pxEventList) PRIVILEGED_FUNCTION
Definition tasks.c:5341
uint32_t ulTaskGenericNotifyValueClear(TaskHandle_t xTask, UBaseType_t uxIndexToClear, uint32_t ulBitsToClear) PRIVILEGED_FUNCTION
void vTaskEndScheduler(void) PRIVILEGED_FUNCTION
Definition tasks.c:3768
eTaskState
Definition task.h:103
@ eRunning
Definition task.h:104
@ eReady
Definition task.h:105
@ eInvalid
Definition task.h:109
@ eDeleted
Definition task.h:108
@ eBlocked
Definition task.h:106
@ eSuspended
Definition task.h:107
UBaseType_t uxTaskPriorityGet(const TaskHandle_t xTask) PRIVILEGED_FUNCTION
void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority) PRIVILEGED_FUNCTION
TaskHandle_t xTaskGetCurrentTaskHandleForCore(BaseType_t xCoreID) PRIVILEGED_FUNCTION
struct tskTaskControlBlock * TaskHandle_t
Definition task.h:92
void vTaskDelete(TaskHandle_t xTaskToDelete) PRIVILEGED_FUNCTION
void vTaskRemoveFromUnorderedEventList(ListItem_t *pxEventListItem, const TickType_t xItemValue) PRIVILEGED_FUNCTION
Definition tasks.c:5434
void vTaskSuspendAll(void) PRIVILEGED_FUNCTION
Definition tasks.c:3811
struct xTASK_PARAMETERS TaskParameters_t
BaseType_t xTaskCatchUpTicks(TickType_t xTicksToCatchUp) PRIVILEGED_FUNCTION
Definition tasks.c:4546
BaseType_t xTaskCheckForTimeOut(TimeOut_t *const pxTimeOut, TickType_t *const pxTicksToWait) PRIVILEGED_FUNCTION
Definition tasks.c:5534
void vTaskGenericNotifyGiveFromISR(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, BaseType_t *pxHigherPriorityTaskWoken) 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
void vTaskPlaceOnEventList(List_t *const pxEventList, const TickType_t xTicksToWait) PRIVILEGED_FUNCTION
Definition tasks.c:5243
portDONT_DISCARD void vTaskSwitchContext(BaseType_t xCoreID) PRIVILEGED_FUNCTION
Definition tasks.c:5141
void vTaskSetTimeOutState(TimeOut_t *const pxTimeOut) PRIVILEGED_FUNCTION
Definition tasks.c:5506
UBaseType_t uxTaskGetNumberOfTasks(void) PRIVILEGED_FUNCTION
Definition tasks.c:4160
TickType_t xTaskGetTickCount(void) PRIVILEGED_FUNCTION
Definition tasks.c:4106
UBaseType_t uxTaskPriorityGetFromISR(const TaskHandle_t xTask) PRIVILEGED_FUNCTION
TickType_t uxTaskResetEventItemValue(void) PRIVILEGED_FUNCTION
Definition tasks.c:7569
void vTaskResume(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
void vTaskSuspend(TaskHandle_t xTaskToSuspend) PRIVILEGED_FUNCTION
TaskHandle_t xTaskGetCurrentTaskHandle(void) PRIVILEGED_FUNCTION
BaseType_t xTaskGenericNotifyStateClear(TaskHandle_t xTask, UBaseType_t uxIndexToClear) PRIVILEGED_FUNCTION
BaseType_t xTaskIncrementTick(void) PRIVILEGED_FUNCTION
Definition tasks.c:4670
void vTaskMissedYield(void) PRIVILEGED_FUNCTION
Definition tasks.c:5603
void vTaskInternalSetTimeOutState(TimeOut_t *const pxTimeOut) PRIVILEGED_FUNCTION
Definition tasks.c:5522
void vTaskPlaceOnUnorderedEventList(List_t *pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait) PRIVILEGED_FUNCTION
Definition tasks.c:5272
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
void vTaskStartScheduler(void) PRIVILEGED_FUNCTION
Definition tasks.c:3665
struct xMEMORY_REGION MemoryRegion_t
UBaseType_t uxTaskBasePriorityGet(const TaskHandle_t xTask) PRIVILEGED_FUNCTION
UBaseType_t uxTaskBasePriorityGetFromISR(const TaskHandle_t xTask) PRIVILEGED_FUNCTION
void vTaskResetState(void) PRIVILEGED_FUNCTION
Definition tasks.c:8645
BaseType_t(* TaskHookFunction_t)(void *arg)
Definition task.h:99
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
struct xTASK_STATUS TaskStatus_t
eNotifyAction
Definition task.h:114
@ eIncrement
Definition task.h:117
@ eSetValueWithOverwrite
Definition task.h:118
@ eSetBits
Definition task.h:116
@ eNoAction
Definition task.h:115
@ eSetValueWithoutOverwrite
Definition task.h:119
char * pcTaskGetName(TaskHandle_t xTaskToQuery) PRIVILEGED_FUNCTION
Definition tasks.c:4172
BaseType_t xTaskResumeFromISR(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
const struct tskTaskControlBlock * ConstTaskHandle_t
Definition task.h:93
BaseType_t xTaskDelayUntil(TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement) PRIVILEGED_FUNCTION
eSleepModeStatus
Definition task.h:182
@ eStandardSleep
Definition task.h:184
@ eAbortSleep
Definition task.h:183