Lines Matching refs:pxTCB
71 #define taskYIELD_TASK_CORE_IF_USING_PREEMPTION( pxTCB ) argument
72 #define taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB ) argument
81 #define taskYIELD_TASK_CORE_IF_USING_PREEMPTION( pxTCB ) \ argument
83 ( void ) ( pxTCB ); \
87 #define taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB ) \ argument
89 if( pxCurrentTCB->uxPriority < ( pxTCB )->uxPriority ) \
102 …#define taskYIELD_TASK_CORE_IF_USING_PREEMPTION( pxTCB ) prvYieldCore( ( pxTCB )->xTaskRunState… argument
105 #define taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB ) prvYieldForTask( pxTCB ) argument
268 #define prvAddTaskToReadyList( pxTCB ) … argument
270 …traceMOVED_TASK_TO_READY_STATE( pxTCB ); …
271 …taskRECORD_READY_PRIORITY( ( pxTCB )->uxPriority ); …
272 …listINSERT_END( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xStateListItem ) );…
273 …tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB ); …
309 …#define taskTASK_IS_RUNNING( pxTCB ) ( ( ( pxTCB ) == pxCurrentTCB ) ? ( … argument
310 …#define taskTASK_IS_RUNNING_OR_SCHEDULED_TO_YIELD( pxTCB ) ( ( ( pxTCB ) == pxCurrentTCB ) ? ( … argument
312 …efine taskTASK_IS_RUNNING( pxTCB ) ( ( ( ( pxTCB )->xTaskRunState >= ( Ba… argument
313 …#define taskTASK_IS_RUNNING_OR_SCHEDULED_TO_YIELD( pxTCB ) ( ( ( pxTCB )->xTaskRunState != task… argument
549 static void prvYieldForTask( const TCB_t * pxTCB );
607 static void prvDeleteTCB( TCB_t * pxTCB ) PRIVILEGED_FUNCTION;
869 static void prvYieldForTask( const TCB_t * pxTCB ) in prvYieldForTask() argument
887 if( pxTCB->uxPriority >= uxTopReadyPriority ) in prvYieldForTask()
890 if( taskTASK_IS_RUNNING( pxTCB ) == pdFALSE ) in prvYieldForTask()
893 xLowestPriorityToPreempt = ( BaseType_t ) pxTCB->uxPriority; in prvYieldForTask()
912 if( taskTASK_IS_RUNNING( pxTCB ) == pdFALSE ) in prvYieldForTask()
918 … if( ( pxTCB->uxCoreAffinityMask & ( ( UBaseType_t ) 1U << ( UBaseType_t ) xCoreID ) ) != 0U ) in prvYieldForTask()
941 ( xCurrentCoreTaskPriority < ( BaseType_t ) pxTCB->uxPriority ) ) in prvYieldForTask()
971 ( pxTCB->uxPriority > pxCurrentTCBs[ portGET_CORE_ID() ]->uxPriority ) ) in prvYieldForTask()
988 TCB_t * pxTCB = NULL; in prvSelectHighestPriorityTask() local
1047 pxTCB = ( TCB_t * ) listGET_LIST_ITEM_OWNER( pxIterator ); in prvSelectHighestPriorityTask()
1056 if( ( pxTCB->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) == 0U ) in prvSelectHighestPriorityTask()
1064 if( pxTCB->xTaskRunState == taskTASK_NOT_RUNNING ) in prvSelectHighestPriorityTask()
1067 … if( ( pxTCB->uxCoreAffinityMask & ( ( UBaseType_t ) 1U << ( UBaseType_t ) xCoreID ) ) != 0U ) in prvSelectHighestPriorityTask()
1075 pxTCB->xTaskRunState = xCoreID; in prvSelectHighestPriorityTask()
1076 pxCurrentTCBs[ xCoreID ] = pxTCB; in prvSelectHighestPriorityTask()
1080 else if( pxTCB == pxCurrentTCBs[ xCoreID ] ) in prvSelectHighestPriorityTask()
1082 …configASSERT( ( pxTCB->xTaskRunState == xCoreID ) || ( pxTCB->xTaskRunState == taskTASK_SCHEDULED_… in prvSelectHighestPriorityTask()
1085 … if( ( pxTCB->uxCoreAffinityMask & ( ( UBaseType_t ) 1U << ( UBaseType_t ) xCoreID ) ) != 0U ) in prvSelectHighestPriorityTask()
1089 pxTCB->xTaskRunState = xCoreID; in prvSelectHighestPriorityTask()
2193 TCB_t * pxTCB; in vTaskDelete() local
2203 pxTCB = prvGetTCBFromHandle( xTaskToDelete ); in vTaskDelete()
2206 if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 ) in vTaskDelete()
2208 taskRESET_READY_PRIORITY( pxTCB->uxPriority ); in vTaskDelete()
2216 if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) != NULL ) in vTaskDelete()
2218 ( void ) uxListRemove( &( pxTCB->xEventListItem ) ); in vTaskDelete()
2234 xTaskIsRunningOrYielding = taskTASK_IS_RUNNING_OR_SCHEDULED_TO_YIELD( pxTCB ); in vTaskDelete()
2247 vListInsertEnd( &xTasksWaitingTermination, &( pxTCB->xStateListItem ) ); in vTaskDelete()
2256 traceTASK_DELETE( pxTCB ); in vTaskDelete()
2267 portPRE_TASK_DELETE_HOOK( pxTCB, &( xYieldPendings[ 0 ] ) ); in vTaskDelete()
2269 portPRE_TASK_DELETE_HOOK( pxTCB, &( xYieldPendings[ pxTCB->xTaskRunState ] ) ); in vTaskDelete()
2281 if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) in vTaskDelete()
2283 if( pxTCB->xTaskRunState == ( BaseType_t ) portGET_CORE_ID() ) in vTaskDelete()
2290 prvYieldCore( pxTCB->xTaskRunState ); in vTaskDelete()
2299 traceTASK_DELETE( pxTCB ); in vTaskDelete()
2313 prvDeleteTCB( pxTCB ); in vTaskDelete()
2322 if( pxTCB == pxCurrentTCB ) in vTaskDelete()
2492 const TCB_t * const pxTCB = xTask; in eTaskGetState() local
2496 configASSERT( pxTCB ); in eTaskGetState()
2499 if( pxTCB == pxCurrentTCB ) in eTaskGetState()
2509 pxStateList = listLIST_ITEM_CONTAINER( &( pxTCB->xStateListItem ) ); in eTaskGetState()
2510 pxEventList = listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ); in eTaskGetState()
2536 if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL ) in eTaskGetState()
2551 if( pxTCB->ucNotifyState[ x ] == taskWAITING_NOTIFICATION ) in eTaskGetState()
2591 if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) in eTaskGetState()
2619 TCB_t const * pxTCB; in uxTaskPriorityGet() local
2628 pxTCB = prvGetTCBFromHandle( xTask ); in uxTaskPriorityGet()
2629 uxReturn = pxTCB->uxPriority; in uxTaskPriorityGet()
2645 TCB_t const * pxTCB; in uxTaskPriorityGetFromISR() local
2676 pxTCB = prvGetTCBFromHandle( xTask ); in uxTaskPriorityGetFromISR()
2677 uxReturn = pxTCB->uxPriority; in uxTaskPriorityGetFromISR()
2693 TCB_t const * pxTCB; in uxTaskBasePriorityGet() local
2702 pxTCB = prvGetTCBFromHandle( xTask ); in uxTaskBasePriorityGet()
2703 uxReturn = pxTCB->uxBasePriority; in uxTaskBasePriorityGet()
2719 TCB_t const * pxTCB; in uxTaskBasePriorityGetFromISR() local
2750 pxTCB = prvGetTCBFromHandle( xTask ); in uxTaskBasePriorityGetFromISR()
2751 uxReturn = pxTCB->uxBasePriority; in uxTaskBasePriorityGetFromISR()
2768 TCB_t * pxTCB; in vTaskPrioritySet() local
2794 pxTCB = prvGetTCBFromHandle( xTask ); in vTaskPrioritySet()
2796 traceTASK_PRIORITY_SET( pxTCB, uxNewPriority ); in vTaskPrioritySet()
2800 uxCurrentBasePriority = pxTCB->uxBasePriority; in vTaskPrioritySet()
2804 uxCurrentBasePriority = pxTCB->uxPriority; in vTaskPrioritySet()
2816 if( pxTCB != pxCurrentTCB ) in vTaskPrioritySet()
2845 else if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) in vTaskPrioritySet()
2851 if( pxTCB->xPreemptionDisable == pdFALSE ) in vTaskPrioritySet()
2867 uxPriorityUsedOnEntry = pxTCB->uxPriority; in vTaskPrioritySet()
2874 … if( ( pxTCB->uxBasePriority == pxTCB->uxPriority ) || ( uxNewPriority > pxTCB->uxPriority ) ) in vTaskPrioritySet()
2876 pxTCB->uxPriority = uxNewPriority; in vTaskPrioritySet()
2884 pxTCB->uxBasePriority = uxNewPriority; in vTaskPrioritySet()
2888 pxTCB->uxPriority = uxNewPriority; in vTaskPrioritySet()
2894 …if( ( listGET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) =… in vTaskPrioritySet()
2896 …listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( ( TickType_t ) configMAX_PRIORITIES - ( Tic… in vTaskPrioritySet()
2907 …tIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ uxPriorityUsedOnEntry ] ), &( pxTCB->xStateListItem ) … in vTaskPrioritySet()
2912 if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 ) in vTaskPrioritySet()
2924 prvAddTaskToReadyList( pxTCB ); in vTaskPrioritySet()
2945 taskYIELD_TASK_CORE_IF_USING_PREEMPTION( pxTCB ); in vTaskPrioritySet()
2955 taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB ); in vTaskPrioritySet()
2981 TCB_t * pxTCB; in vTaskCoreAffinitySet() local
2993 pxTCB = prvGetTCBFromHandle( xTask ); in vTaskCoreAffinitySet()
2995 uxPrevCoreAffinityMask = pxTCB->uxCoreAffinityMask; in vTaskCoreAffinitySet()
2996 pxTCB->uxCoreAffinityMask = uxCoreAffinityMask; in vTaskCoreAffinitySet()
3000 if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) in vTaskCoreAffinitySet()
3002 xCoreID = ( BaseType_t ) pxTCB->xTaskRunState; in vTaskCoreAffinitySet()
3024 prvYieldForTask( pxTCB ); in vTaskCoreAffinitySet()
3045 const TCB_t * pxTCB; in vTaskCoreAffinityGet() local
3052 pxTCB = prvGetTCBFromHandle( xTask ); in vTaskCoreAffinityGet()
3053 uxCoreAffinityMask = pxTCB->uxCoreAffinityMask; in vTaskCoreAffinityGet()
3069 TCB_t * pxTCB; in vTaskPreemptionDisable() local
3075 pxTCB = prvGetTCBFromHandle( xTask ); in vTaskPreemptionDisable()
3077 pxTCB->xPreemptionDisable = pdTRUE; in vTaskPreemptionDisable()
3091 TCB_t * pxTCB; in vTaskPreemptionEnable() local
3098 pxTCB = prvGetTCBFromHandle( xTask ); in vTaskPreemptionEnable()
3100 pxTCB->xPreemptionDisable = pdFALSE; in vTaskPreemptionEnable()
3104 if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) in vTaskPreemptionEnable()
3106 xCoreID = ( BaseType_t ) pxTCB->xTaskRunState; in vTaskPreemptionEnable()
3123 TCB_t * pxTCB; in vTaskSuspend() local
3131 pxTCB = prvGetTCBFromHandle( xTaskToSuspend ); in vTaskSuspend()
3133 traceTASK_SUSPEND( pxTCB ); in vTaskSuspend()
3137 if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 ) in vTaskSuspend()
3139 taskRESET_READY_PRIORITY( pxTCB->uxPriority ); in vTaskSuspend()
3147 if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) != NULL ) in vTaskSuspend()
3149 ( void ) uxListRemove( &( pxTCB->xEventListItem ) ); in vTaskSuspend()
3156 vListInsertEnd( &xSuspendedTaskList, &( pxTCB->xStateListItem ) ); in vTaskSuspend()
3164 if( pxTCB->ucNotifyState[ x ] == taskWAITING_NOTIFICATION ) in vTaskSuspend()
3168 pxTCB->ucNotifyState[ x ] = taskNOT_WAITING_NOTIFICATION; in vTaskSuspend()
3189 if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) in vTaskSuspend()
3191 if( pxTCB->xTaskRunState == ( BaseType_t ) portGET_CORE_ID() ) in vTaskSuspend()
3199 prvYieldCore( pxTCB->xTaskRunState ); in vTaskSuspend()
3235 if( pxTCB == pxCurrentTCB ) in vTaskSuspend()
3286 const TCB_t * const pxTCB = xTask; in prvTaskIsTaskSuspended() local
3295 if( listIS_CONTAINED_WITHIN( &xSuspendedTaskList, &( pxTCB->xStateListItem ) ) != pdFALSE ) in prvTaskIsTaskSuspended()
3298 … if( listIS_CONTAINED_WITHIN( &xPendingReadyList, &( pxTCB->xEventListItem ) ) == pdFALSE ) in prvTaskIsTaskSuspended()
3302 if( listIS_CONTAINED_WITHIN( NULL, &( pxTCB->xEventListItem ) ) != pdFALSE ) in prvTaskIsTaskSuspended()
3317 if( pxTCB->ucNotifyState[ x ] == taskWAITING_NOTIFICATION ) in prvTaskIsTaskSuspended()
3355 TCB_t * const pxTCB = xTaskToResume; in vTaskResume() local
3366 if( ( pxTCB != pxCurrentTCB ) && ( pxTCB != NULL ) ) in vTaskResume()
3374 if( pxTCB != NULL ) in vTaskResume()
3379 if( prvTaskIsTaskSuspended( pxTCB ) != pdFALSE ) in vTaskResume()
3381 traceTASK_RESUME( pxTCB ); in vTaskResume()
3385 ( void ) uxListRemove( &( pxTCB->xStateListItem ) ); in vTaskResume()
3386 prvAddTaskToReadyList( pxTCB ); in vTaskResume()
3391 taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB ); in vTaskResume()
3417 TCB_t * const pxTCB = xTaskToResume; in xTaskResumeFromISR() local
3447 if( prvTaskIsTaskSuspended( pxTCB ) != pdFALSE ) in xTaskResumeFromISR()
3449 traceTASK_RESUME_FROM_ISR( pxTCB ); in xTaskResumeFromISR()
3458 if( pxTCB->uxPriority > pxCurrentTCB->uxPriority ) in xTaskResumeFromISR()
3474 ( void ) uxListRemove( &( pxTCB->xStateListItem ) ); in xTaskResumeFromISR()
3475 prvAddTaskToReadyList( pxTCB ); in xTaskResumeFromISR()
3482 vListInsertEnd( &( xPendingReadyList ), &( pxTCB->xEventListItem ) ); in xTaskResumeFromISR()
3487 prvYieldForTask( pxTCB ); in xTaskResumeFromISR()
3958 TCB_t * pxTCB = NULL; in xTaskResumeAll() local
3995 pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) ); in xTaskResumeAll()
3996 listREMOVE_ITEM( &( pxTCB->xEventListItem ) ); in xTaskResumeAll()
3998 listREMOVE_ITEM( &( pxTCB->xStateListItem ) ); in xTaskResumeAll()
3999 prvAddTaskToReadyList( pxTCB ); in xTaskResumeAll()
4005 if( pxTCB->uxPriority > pxCurrentTCB->uxPriority ) in xTaskResumeAll()
4023 if( pxTCB != NULL ) in xTaskResumeAll()
4174 TCB_t * pxTCB; in pcTaskGetName() local
4180 pxTCB = prvGetTCBFromHandle( xTaskToQuery ); in pcTaskGetName()
4181 configASSERT( pxTCB ); in pcTaskGetName()
4183 traceRETURN_pcTaskGetName( &( pxTCB->pcTaskName[ 0 ] ) ); in pcTaskGetName()
4185 return &( pxTCB->pcTaskName[ 0 ] ); in pcTaskGetName()
4194 TCB_t * pxTCB = NULL; in prvSearchForNameWithinSingleList() local
4210 pxTCB = listGET_LIST_ITEM_OWNER( pxIterator ); in prvSearchForNameWithinSingleList()
4218 cNextChar = pxTCB->pcTaskName[ x ]; in prvSearchForNameWithinSingleList()
4229 pxReturn = pxTCB; in prvSearchForNameWithinSingleList()
4266 TCB_t * pxTCB; in xTaskGetHandle() local
4279 …pxTCB = prvSearchForNameWithinSingleList( ( List_t * ) &( pxReadyTasksLists[ uxQueue ] ), pcNameTo… in xTaskGetHandle()
4281 if( pxTCB != NULL ) in xTaskGetHandle()
4289 if( pxTCB == NULL ) in xTaskGetHandle()
4291 … pxTCB = prvSearchForNameWithinSingleList( ( List_t * ) pxDelayedTaskList, pcNameToQuery ); in xTaskGetHandle()
4294 if( pxTCB == NULL ) in xTaskGetHandle()
4296 … pxTCB = prvSearchForNameWithinSingleList( ( List_t * ) pxOverflowDelayedTaskList, pcNameToQuery ); in xTaskGetHandle()
4301 if( pxTCB == NULL ) in xTaskGetHandle()
4304 pxTCB = prvSearchForNameWithinSingleList( &xSuspendedTaskList, pcNameToQuery ); in xTaskGetHandle()
4311 if( pxTCB == NULL ) in xTaskGetHandle()
4314 … pxTCB = prvSearchForNameWithinSingleList( &xTasksWaitingTermination, pcNameToQuery ); in xTaskGetHandle()
4321 traceRETURN_xTaskGetHandle( pxTCB ); in xTaskGetHandle()
4323 return pxTCB; in xTaskGetHandle()
4336 TCB_t * pxTCB; in xTaskGetStaticBuffers() local
4343 pxTCB = prvGetTCBFromHandle( xTask ); in xTaskGetStaticBuffers()
4347 if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB ) in xTaskGetStaticBuffers()
4349 *ppuxStackBuffer = pxTCB->pxStack; in xTaskGetStaticBuffers()
4353 *ppxTaskBuffer = ( StaticTask_t * ) pxTCB; in xTaskGetStaticBuffers()
4356 else if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_ONLY ) in xTaskGetStaticBuffers()
4358 *ppuxStackBuffer = pxTCB->pxStack; in xTaskGetStaticBuffers()
4369 *ppuxStackBuffer = pxTCB->pxStack; in xTaskGetStaticBuffers()
4370 *ppxTaskBuffer = ( StaticTask_t * ) pxTCB; in xTaskGetStaticBuffers()
4578 TCB_t * pxTCB = xTask; in xTaskAbortDelay() local
4583 configASSERT( pxTCB ); in xTaskAbortDelay()
4596 ( void ) uxListRemove( &( pxTCB->xStateListItem ) ); in xTaskAbortDelay()
4604 if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) != NULL ) in xTaskAbortDelay()
4606 ( void ) uxListRemove( &( pxTCB->xEventListItem ) ); in xTaskAbortDelay()
4611 pxTCB->ucDelayAborted = ( uint8_t ) pdTRUE; in xTaskAbortDelay()
4621 prvAddTaskToReadyList( pxTCB ); in xTaskAbortDelay()
4632 if( pxTCB->uxPriority > pxCurrentTCB->uxPriority ) in xTaskAbortDelay()
4647 prvYieldForTask( pxTCB ); in xTaskAbortDelay()
4672 TCB_t * pxTCB; in xTaskIncrementTick() local
4737 pxTCB = listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList ); in xTaskIncrementTick()
4738 xItemValue = listGET_LIST_ITEM_VALUE( &( pxTCB->xStateListItem ) ); in xTaskIncrementTick()
4756 listREMOVE_ITEM( &( pxTCB->xStateListItem ) ); in xTaskIncrementTick()
4760 if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) != NULL ) in xTaskIncrementTick()
4762 listREMOVE_ITEM( &( pxTCB->xEventListItem ) ); in xTaskIncrementTick()
4771 prvAddTaskToReadyList( pxTCB ); in xTaskIncrementTick()
4787 if( pxTCB->uxPriority > pxCurrentTCB->uxPriority ) in xTaskIncrementTick()
4798 prvYieldForTask( pxTCB ); in xTaskIncrementTick()
4962 TCB_t * pxTCB; in xTaskGetApplicationTaskTag() local
4968 pxTCB = prvGetTCBFromHandle( xTask ); in xTaskGetApplicationTaskTag()
4974 xReturn = pxTCB->pxTaskTag; in xTaskGetApplicationTaskTag()
4990 TCB_t * pxTCB; in xTaskGetApplicationTaskTagFromISR() local
4997 pxTCB = prvGetTCBFromHandle( xTask ); in xTaskGetApplicationTaskTagFromISR()
5006 xReturn = pxTCB->pxTaskTag; in xTaskGetApplicationTaskTagFromISR()
5619 TCB_t const * pxTCB; in uxTaskGetTaskNumber() local
5625 pxTCB = xTask; in uxTaskGetTaskNumber()
5626 uxReturn = pxTCB->uxTaskNumber; in uxTaskGetTaskNumber()
5646 TCB_t * pxTCB; in vTaskSetTaskNumber() local
5652 pxTCB = xTask; in vTaskSetTaskNumber()
5653 pxTCB->uxTaskNumber = uxHandle; in vTaskSetTaskNumber()
5943 TCB_t * pxTCB; in vTaskSetThreadLocalStoragePointer() local
5950 pxTCB = prvGetTCBFromHandle( xTaskToSet ); in vTaskSetThreadLocalStoragePointer()
5951 configASSERT( pxTCB != NULL ); in vTaskSetThreadLocalStoragePointer()
5952 pxTCB->pvThreadLocalStoragePointers[ xIndex ] = pvValue; in vTaskSetThreadLocalStoragePointer()
5967 TCB_t * pxTCB; in pvTaskGetThreadLocalStoragePointer() local
5974 pxTCB = prvGetTCBFromHandle( xTaskToQuery ); in pvTaskGetThreadLocalStoragePointer()
5975 pvReturn = pxTCB->pvThreadLocalStoragePointers[ xIndex ]; in pvTaskGetThreadLocalStoragePointer()
5995 TCB_t * pxTCB; in vTaskAllocateMPURegions() local
6001 pxTCB = prvGetTCBFromHandle( xTaskToModify ); in vTaskAllocateMPURegions()
6003 vPortStoreTaskMPUSettings( &( pxTCB->xMPUSettings ), pxRegions, NULL, 0 ); in vTaskAllocateMPURegions()
6049 TCB_t * pxTCB; in prvCheckTasksWaitingTermination() local
6063 pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) ); in prvCheckTasksWaitingTermination()
6064 ( void ) uxListRemove( &( pxTCB->xStateListItem ) ); in prvCheckTasksWaitingTermination()
6071 prvDeleteTCB( pxTCB ); in prvCheckTasksWaitingTermination()
6075 pxTCB = NULL; in prvCheckTasksWaitingTermination()
6087 pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) ); in prvCheckTasksWaitingTermination()
6089 if( pxTCB->xTaskRunState == taskTASK_NOT_RUNNING ) in prvCheckTasksWaitingTermination()
6091 ( void ) uxListRemove( &( pxTCB->xStateListItem ) ); in prvCheckTasksWaitingTermination()
6107 if( pxTCB != NULL ) in prvCheckTasksWaitingTermination()
6109 prvDeleteTCB( pxTCB ); in prvCheckTasksWaitingTermination()
6126 TCB_t * pxTCB; in vTaskGetInfo() local
6131 pxTCB = prvGetTCBFromHandle( xTask ); in vTaskGetInfo()
6133 pxTaskStatus->xHandle = pxTCB; in vTaskGetInfo()
6134 pxTaskStatus->pcTaskName = ( const char * ) &( pxTCB->pcTaskName[ 0 ] ); in vTaskGetInfo()
6135 pxTaskStatus->uxCurrentPriority = pxTCB->uxPriority; in vTaskGetInfo()
6136 pxTaskStatus->pxStackBase = pxTCB->pxStack; in vTaskGetInfo()
6138 pxTaskStatus->pxTopOfStack = ( StackType_t * ) pxTCB->pxTopOfStack; in vTaskGetInfo()
6139 pxTaskStatus->pxEndOfStack = pxTCB->pxEndOfStack; in vTaskGetInfo()
6141 pxTaskStatus->xTaskNumber = pxTCB->uxTCBNumber; in vTaskGetInfo()
6145 pxTaskStatus->uxCoreAffinityMask = pxTCB->uxCoreAffinityMask; in vTaskGetInfo()
6151 pxTaskStatus->uxBasePriority = pxTCB->uxBasePriority; in vTaskGetInfo()
6161 pxTaskStatus->ulRunTimeCounter = pxTCB->ulRunTimeCounter; in vTaskGetInfo()
6174 if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) in vTaskGetInfo()
6191 if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) != NULL ) in vTaskGetInfo()
6208 if( pxTCB->ucNotifyState[ x ] == taskWAITING_NOTIFICATION ) in vTaskGetInfo()
6228 … if( listIS_CONTAINED_WITHIN( &xPendingReadyList, &( pxTCB->xEventListItem ) ) != pdFALSE ) in vTaskGetInfo()
6238 pxTaskStatus->eCurrentState = eTaskGetState( pxTCB ); in vTaskGetInfo()
6247 …TaskStatus->usStackHighWaterMark = prvTaskCheckFreeStackSpace( ( uint8_t * ) pxTCB->pxEndOfStack ); in vTaskGetInfo()
6251 … pxTaskStatus->usStackHighWaterMark = prvTaskCheckFreeStackSpace( ( uint8_t * ) pxTCB->pxStack ); in vTaskGetInfo()
6275 TCB_t * pxTCB = NULL; in prvListTasksWithinSingleList() local
6288 pxTCB = listGET_LIST_ITEM_OWNER( pxIterator ); in prvListTasksWithinSingleList()
6290 … vTaskGetInfo( ( TaskHandle_t ) pxTCB, &( pxTaskStatusArray[ uxTask ] ), pdTRUE, eState ); in prvListTasksWithinSingleList()
6334 TCB_t * pxTCB; in uxTaskGetStackHighWaterMark2() local
6347 pxTCB = prvGetTCBFromHandle( xTask ); in uxTaskGetStackHighWaterMark2()
6351 pucEndOfStack = ( uint8_t * ) pxTCB->pxStack; in uxTaskGetStackHighWaterMark2()
6355 pucEndOfStack = ( uint8_t * ) pxTCB->pxEndOfStack; in uxTaskGetStackHighWaterMark2()
6373 TCB_t * pxTCB; in uxTaskGetStackHighWaterMark() local
6379 pxTCB = prvGetTCBFromHandle( xTask ); in uxTaskGetStackHighWaterMark()
6383 pucEndOfStack = ( uint8_t * ) pxTCB->pxStack; in uxTaskGetStackHighWaterMark()
6387 pucEndOfStack = ( uint8_t * ) pxTCB->pxEndOfStack; in uxTaskGetStackHighWaterMark()
6403 static void prvDeleteTCB( TCB_t * pxTCB ) in prvDeleteTCB() argument
6408 portCLEAN_UP_TCB( pxTCB ); in prvDeleteTCB()
6413 configDEINIT_TLS_BLOCK( pxTCB->xTLSBlock ); in prvDeleteTCB()
6421 vPortFreeStack( pxTCB->pxStack ); in prvDeleteTCB()
6422 vPortFree( pxTCB ); in prvDeleteTCB()
6429 if( pxTCB->ucStaticallyAllocated == tskDYNAMICALLY_ALLOCATED_STACK_AND_TCB ) in prvDeleteTCB()
6433 vPortFreeStack( pxTCB->pxStack ); in prvDeleteTCB()
6434 vPortFree( pxTCB ); in prvDeleteTCB()
6436 else if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_ONLY ) in prvDeleteTCB()
6440 vPortFree( pxTCB ); in prvDeleteTCB()
6446 … configASSERT( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB ); in prvDeleteTCB()
6685 TCB_t * const pxTCB = pxMutexHolder; in xTaskPriorityDisinherit() local
6696 configASSERT( pxTCB == pxCurrentTCB ); in xTaskPriorityDisinherit()
6697 configASSERT( pxTCB->uxMutexesHeld ); in xTaskPriorityDisinherit()
6698 ( pxTCB->uxMutexesHeld )--; in xTaskPriorityDisinherit()
6702 if( pxTCB->uxPriority != pxTCB->uxBasePriority ) in xTaskPriorityDisinherit()
6705 if( pxTCB->uxMutexesHeld == ( UBaseType_t ) 0 ) in xTaskPriorityDisinherit()
6712 if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 ) in xTaskPriorityDisinherit()
6714 portRESET_READY_PRIORITY( pxTCB->uxPriority, uxTopReadyPriority ); in xTaskPriorityDisinherit()
6723 traceTASK_PRIORITY_DISINHERIT( pxTCB, pxTCB->uxBasePriority ); in xTaskPriorityDisinherit()
6724 pxTCB->uxPriority = pxTCB->uxBasePriority; in xTaskPriorityDisinherit()
6729 …listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickT… in xTaskPriorityDisinherit()
6730 prvAddTaskToReadyList( pxTCB ); in xTaskPriorityDisinherit()
6735 if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) in xTaskPriorityDisinherit()
6737 prvYieldCore( pxTCB->xTaskRunState ); in xTaskPriorityDisinherit()
6780 TCB_t * const pxTCB = pxMutexHolder; in vTaskPriorityDisinheritAfterTimeout() local
6790 configASSERT( pxTCB->uxMutexesHeld ); in vTaskPriorityDisinheritAfterTimeout()
6796 if( pxTCB->uxBasePriority < uxHighestPriorityWaitingTask ) in vTaskPriorityDisinheritAfterTimeout()
6802 uxPriorityToUse = pxTCB->uxBasePriority; in vTaskPriorityDisinheritAfterTimeout()
6806 if( pxTCB->uxPriority != uxPriorityToUse ) in vTaskPriorityDisinheritAfterTimeout()
6812 if( pxTCB->uxMutexesHeld == uxOnlyOneMutexHeld ) in vTaskPriorityDisinheritAfterTimeout()
6817 configASSERT( pxTCB != pxCurrentTCB ); in vTaskPriorityDisinheritAfterTimeout()
6822 traceTASK_PRIORITY_DISINHERIT( pxTCB, uxPriorityToUse ); in vTaskPriorityDisinheritAfterTimeout()
6823 uxPriorityUsedOnEntry = pxTCB->uxPriority; in vTaskPriorityDisinheritAfterTimeout()
6824 pxTCB->uxPriority = uxPriorityToUse; in vTaskPriorityDisinheritAfterTimeout()
6828 …if( ( listGET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) =… in vTaskPriorityDisinheritAfterTimeout()
6830 …listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickT… in vTaskPriorityDisinheritAfterTimeout()
6843 …tIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ uxPriorityUsedOnEntry ] ), &( pxTCB->xStateListItem ) … in vTaskPriorityDisinheritAfterTimeout()
6845 if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 ) in vTaskPriorityDisinheritAfterTimeout()
6850 portRESET_READY_PRIORITY( pxTCB->uxPriority, uxTopReadyPriority ); in vTaskPriorityDisinheritAfterTimeout()
6857 prvAddTaskToReadyList( pxTCB ); in vTaskPriorityDisinheritAfterTimeout()
6862 if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) in vTaskPriorityDisinheritAfterTimeout()
6864 prvYieldCore( pxTCB->xTaskRunState ); in vTaskPriorityDisinheritAfterTimeout()
7591 TCB_t * pxTCB; in pvTaskIncrementMutexHeldCount() local
7595 pxTCB = pxCurrentTCB; in pvTaskIncrementMutexHeldCount()
7599 if( pxTCB != NULL ) in pvTaskIncrementMutexHeldCount()
7601 ( pxTCB->uxMutexesHeld )++; in pvTaskIncrementMutexHeldCount()
7604 traceRETURN_pvTaskIncrementMutexHeldCount( pxTCB ); in pvTaskIncrementMutexHeldCount()
7606 return pxTCB; in pvTaskIncrementMutexHeldCount()
7838 TCB_t * pxTCB; in xTaskGenericNotify() local
7846 pxTCB = xTaskToNotify; in xTaskGenericNotify()
7852 *pulPreviousNotificationValue = pxTCB->ulNotifiedValue[ uxIndexToNotify ]; in xTaskGenericNotify()
7855 ucOriginalNotifyState = pxTCB->ucNotifyState[ uxIndexToNotify ]; in xTaskGenericNotify()
7857 pxTCB->ucNotifyState[ uxIndexToNotify ] = taskNOTIFICATION_RECEIVED; in xTaskGenericNotify()
7862 pxTCB->ulNotifiedValue[ uxIndexToNotify ] |= ulValue; in xTaskGenericNotify()
7866 ( pxTCB->ulNotifiedValue[ uxIndexToNotify ] )++; in xTaskGenericNotify()
7870 pxTCB->ulNotifiedValue[ uxIndexToNotify ] = ulValue; in xTaskGenericNotify()
7877 pxTCB->ulNotifiedValue[ uxIndexToNotify ] = ulValue; in xTaskGenericNotify()
7909 listREMOVE_ITEM( &( pxTCB->xStateListItem ) ); in xTaskGenericNotify()
7910 prvAddTaskToReadyList( pxTCB ); in xTaskGenericNotify()
7913 configASSERT( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL ); in xTaskGenericNotify()
7933 taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB ); in xTaskGenericNotify()
7959 TCB_t * pxTCB; in xTaskGenericNotifyFromISR() local
7987 pxTCB = xTaskToNotify; in xTaskGenericNotifyFromISR()
7996 *pulPreviousNotificationValue = pxTCB->ulNotifiedValue[ uxIndexToNotify ]; in xTaskGenericNotifyFromISR()
7999 ucOriginalNotifyState = pxTCB->ucNotifyState[ uxIndexToNotify ]; in xTaskGenericNotifyFromISR()
8000 pxTCB->ucNotifyState[ uxIndexToNotify ] = taskNOTIFICATION_RECEIVED; in xTaskGenericNotifyFromISR()
8005 pxTCB->ulNotifiedValue[ uxIndexToNotify ] |= ulValue; in xTaskGenericNotifyFromISR()
8009 ( pxTCB->ulNotifiedValue[ uxIndexToNotify ] )++; in xTaskGenericNotifyFromISR()
8013 pxTCB->ulNotifiedValue[ uxIndexToNotify ] = ulValue; in xTaskGenericNotifyFromISR()
8020 pxTCB->ulNotifiedValue[ uxIndexToNotify ] = ulValue; in xTaskGenericNotifyFromISR()
8052 configASSERT( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL ); in xTaskGenericNotifyFromISR()
8056 listREMOVE_ITEM( &( pxTCB->xStateListItem ) ); in xTaskGenericNotifyFromISR()
8057 prvAddTaskToReadyList( pxTCB ); in xTaskGenericNotifyFromISR()
8063 listINSERT_END( &( xPendingReadyList ), &( pxTCB->xEventListItem ) ); in xTaskGenericNotifyFromISR()
8068 if( pxTCB->uxPriority > pxCurrentTCB->uxPriority ) in xTaskGenericNotifyFromISR()
8091 prvYieldForTask( pxTCB ); in xTaskGenericNotifyFromISR()
8122 TCB_t * pxTCB; in vTaskGenericNotifyGiveFromISR() local
8149 pxTCB = xTaskToNotify; in vTaskGenericNotifyGiveFromISR()
8156 ucOriginalNotifyState = pxTCB->ucNotifyState[ uxIndexToNotify ]; in vTaskGenericNotifyGiveFromISR()
8157 pxTCB->ucNotifyState[ uxIndexToNotify ] = taskNOTIFICATION_RECEIVED; in vTaskGenericNotifyGiveFromISR()
8161 ( pxTCB->ulNotifiedValue[ uxIndexToNotify ] )++; in vTaskGenericNotifyGiveFromISR()
8170 configASSERT( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL ); in vTaskGenericNotifyGiveFromISR()
8174 listREMOVE_ITEM( &( pxTCB->xStateListItem ) ); in vTaskGenericNotifyGiveFromISR()
8175 prvAddTaskToReadyList( pxTCB ); in vTaskGenericNotifyGiveFromISR()
8181 listINSERT_END( &( xPendingReadyList ), &( pxTCB->xEventListItem ) ); in vTaskGenericNotifyGiveFromISR()
8186 if( pxTCB->uxPriority > pxCurrentTCB->uxPriority ) in vTaskGenericNotifyGiveFromISR()
8209 prvYieldForTask( pxTCB ); in vTaskGenericNotifyGiveFromISR()
8237 TCB_t * pxTCB; in xTaskGenericNotifyStateClear() local
8246 pxTCB = prvGetTCBFromHandle( xTask ); in xTaskGenericNotifyStateClear()
8250 if( pxTCB->ucNotifyState[ uxIndexToClear ] == taskNOTIFICATION_RECEIVED ) in xTaskGenericNotifyStateClear()
8252 pxTCB->ucNotifyState[ uxIndexToClear ] = taskNOT_WAITING_NOTIFICATION; in xTaskGenericNotifyStateClear()
8276 TCB_t * pxTCB; in ulTaskGenericNotifyValueClear() local
8285 pxTCB = prvGetTCBFromHandle( xTask ); in ulTaskGenericNotifyValueClear()
8291 ulReturn = pxTCB->ulNotifiedValue[ uxIndexToClear ]; in ulTaskGenericNotifyValueClear()
8292 pxTCB->ulNotifiedValue[ uxIndexToClear ] &= ~ulBitsToClear; in ulTaskGenericNotifyValueClear()
8308 TCB_t * pxTCB; in ulTaskGetRunTimeCounter() local
8312 pxTCB = prvGetTCBFromHandle( xTask ); in ulTaskGetRunTimeCounter()
8314 traceRETURN_ulTaskGetRunTimeCounter( pxTCB->ulRunTimeCounter ); in ulTaskGetRunTimeCounter()
8316 return pxTCB->ulRunTimeCounter; in ulTaskGetRunTimeCounter()
8326 TCB_t * pxTCB; in ulTaskGetRunTimePercent() local
8339 pxTCB = prvGetTCBFromHandle( xTask ); in ulTaskGetRunTimePercent()
8340 ulReturn = pxTCB->ulRunTimeCounter / ulTotalTime; in ulTaskGetRunTimePercent()
8538 TCB_t * pxTCB; in xTaskGetMPUSettings() local
8542 pxTCB = prvGetTCBFromHandle( xTask ); in xTaskGetMPUSettings()
8544 traceRETURN_xTaskGetMPUSettings( &( pxTCB->xMPUSettings ) ); in xTaskGetMPUSettings()
8546 return &( pxTCB->xMPUSettings ); in xTaskGetMPUSettings()