Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRTOS/FreeRTOS-Kernel.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudeep Mohanty <91244425+sudeep-mohanty@users.noreply.github.com>2022-10-12 19:32:19 +0300
committerGitHub <noreply@github.com>2022-10-12 19:32:19 +0300
commit8128208bdee1f997f83cae631b861f36aeea9b1f (patch)
tree9025027ec8d12bb4b7948b78a6f2d73771337807
parent13f034eb7480f11c9fc43e7b51a1e55656985bf4 (diff)
Add support for retrieving a task's uxCoreAffinityMask with the vTaskGetInfo() API (#574)
* Add support for retrieving a task's uxCoreAffinityMask with the vTaskGetInfo() API This commit adds support for retrieving the task's core affinity mask when SMP is used for more than 1 cores and configUSE_CORE_AFFINITY is enabled. Signed-off-by: Sudeep Mohanty <sudp.mohanty@gmail.com> * Apply suggestions from code review Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> Signed-off-by: Sudeep Mohanty <sudp.mohanty@gmail.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
-rw-r--r--include/task.h3
-rw-r--r--tasks.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/include/task.h b/include/task.h
index 65cd86e8d..ba82f9f0d 100644
--- a/include/task.h
+++ b/include/task.h
@@ -153,6 +153,9 @@ typedef struct xTASK_STATUS
uint32_t 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. */
StackType_t * pxStackBase; /* Points to the lowest address of the task's stack area. */
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. */
+#if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUM_CORES > 1 ) )
+ UBaseType_t uxCoreAffinityMask; /* The core affinity mask for the task */
+#endif
} TaskStatus_t;
/* Possible return values for eTaskConfirmSleepModeStatus(). */
diff --git a/tasks.c b/tasks.c
index 046aed9aa..842ef224e 100644
--- a/tasks.c
+++ b/tasks.c
@@ -4708,6 +4708,12 @@ static void prvCheckTasksWaitingTermination( void )
pxTaskStatus->pxStackBase = pxTCB->pxStack;
pxTaskStatus->xTaskNumber = pxTCB->uxTCBNumber;
+ #if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUM_CORES > 1 ) )
+ {
+ pxTaskStatus->uxCoreAffinityMask = pxTCB->uxCoreAffinityMask;
+ }
+ #endif
+
#if ( configUSE_MUTEXES == 1 )
{
pxTaskStatus->uxBasePriority = pxTCB->uxBasePriority;