summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/include/rtems/rtems/tasks.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/rtems/include/rtems/rtems/tasks.h')
-rw-r--r--cpukit/rtems/include/rtems/rtems/tasks.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h
index 2030632380..f17d51b7e5 100644
--- a/cpukit/rtems/include/rtems/rtems/tasks.h
+++ b/cpukit/rtems/include/rtems/rtems/tasks.h
@@ -490,6 +490,51 @@ rtems_status_code rtems_task_variable_delete(
void **ptr
);
+#if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP)
+/**
+ * @brief RTEMS Get Task Affinity
+ *
+ * This directive returns the cpuset for the
+ * given task. The cpuset size must be the
+ * same size as the task affinity set size.
+ *
+ * @param[in] id is the thread to extract
+ * @param[in] cpusetsize is the size of the cpuset
+ * @param[out] cpuset is the tasks affinity cpuset
+ *
+ * @retval RTEMS_SUCCESSFUL if successful or error code if unsuccessful
+ * @retval RTEMS_INVALID_ADDRESS if cpuset is NULL
+ * @retval RTEMS_INVALID_NUMBER if cpusetsize is incorrect
+ * @retval RTEMS_INVALID_ID if id not valid
+ */
+rtems_status_code rtems_task_get_affinity(
+ rtems_id id,
+ size_t cpusetsize,
+ cpu_set_t *cpuset
+);
+
+/**
+ * @brief RTEMS Set Task Affinity
+ *
+ * This directive sets the given tasks
+ * affinity cpuset.
+ *
+ * @param[in] id is the thread to extract
+ * @param[in] cpusetsize is the size of the cpuset
+ * @param[in] cpuset is affinity set to assign to the task
+ *
+ * @retval RTEMS_SUCCESSFUL if successful or error code if unsuccessful
+ * @retval RTEMS_INVALID_ADDRESS if cpuset is NULL
+ * @retval RTEMS_INVALID_NUMBER if cpuset or cpusetsize is incorrect
+ * @retval RTEMS_INVALID_ID if id not valid
+ */
+rtems_status_code rtems_task_set_affinity(
+ rtems_id id,
+ size_t cpusetsize,
+ cpu_set_t *cpuset
+);
+#endif
+
/**
* @brief RTEMS Get Self Task Id
*