summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-08 11:14:27 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-15 08:37:12 +0200
commit0712d172d0bce40f3a9190af511249256ddac5f1 (patch)
treeedfe262b0e46134e3704641cac50ff9d147e9e2a /cpukit/rtems
parentscore: Simplify thread control initialization (diff)
downloadrtems-0712d172d0bce40f3a9190af511249256ddac5f1.tar.bz2
score: Task get/set affinity
Make rtems_task_get_affinity() and rtems_task_set_affinity() available on non-SMP configurations. Allow larger CPU sets.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/Makefile.am9
-rw-r--r--cpukit/rtems/include/rtems/rtems/tasks.h50
2 files changed, 28 insertions, 31 deletions
diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am
index a279ed7ac2..b6a19c4f14 100644
--- a/cpukit/rtems/Makefile.am
+++ b/cpukit/rtems/Makefile.am
@@ -92,6 +92,7 @@ librtems_a_SOURCES += src/rtemsobjectgetclassicname.c
librtems_a_SOURCES += src/tasks.c
librtems_a_SOURCES += src/taskcreate.c
librtems_a_SOURCES += src/taskdelete.c
+librtems_a_SOURCES += src/taskgetaffinity.c
librtems_a_SOURCES += src/taskgetnote.c
librtems_a_SOURCES += src/taskident.c
librtems_a_SOURCES += src/taskinitusers.c
@@ -100,6 +101,7 @@ librtems_a_SOURCES += src/taskmode.c
librtems_a_SOURCES += src/taskrestart.c
librtems_a_SOURCES += src/taskresume.c
librtems_a_SOURCES += src/taskself.c
+librtems_a_SOURCES += src/tasksetaffinity.c
librtems_a_SOURCES += src/tasksetnote.c
librtems_a_SOURCES += src/tasksetpriority.c
librtems_a_SOURCES += src/taskstart.c
@@ -274,12 +276,5 @@ librtems_a_SOURCES += src/signalmp.c
librtems_a_SOURCES += src/taskmp.c
endif
-## SMP Files
-if HAS_SMP
-librtems_a_SOURCES += src/tasksetaffinity.c
-librtems_a_SOURCES += src/taskgetaffinity.c
-endif
-
-
include $(srcdir)/preinstall.am
include $(top_srcdir)/automake/local.am
diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h
index 56dd12d7f0..87128be5f5 100644
--- a/cpukit/rtems/include/rtems/rtems/tasks.h
+++ b/cpukit/rtems/include/rtems/rtems/tasks.h
@@ -494,22 +494,23 @@ rtems_status_code rtems_task_variable_delete(
);
#endif
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP)
+#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
/**
- * @brief RTEMS Get Task Affinity
+ * @brief Gets the processor affinity set of a task.
*
- * 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 Identifier of the task. Use @ref RTEMS_SELF to select the
+ * executing task.
+ * @param[in] cpusetsize Size of the specified affinity set buffer in
+ * bytes. This value must be positive.
+ * @param[out] cpuset The current processor affinity set of the task. A set
+ * bit in the affinity set means that the task can execute on this processor
+ * and a cleared bit means the opposite.
*
- * @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
+ * @retval RTEMS_SUCCESSFUL Successful operation.
+ * @retval RTEMS_INVALID_ADDRESS The @a cpuset parameter is @c NULL.
+ * @retval RTEMS_INVALID_ID Invalid task identifier.
+ * @retval RTEMS_INVALID_NUMBER The affinity set buffer is too small for the
+ * current processor affinity set of the task.
*/
rtems_status_code rtems_task_get_affinity(
rtems_id id,
@@ -518,19 +519,20 @@ rtems_status_code rtems_task_get_affinity(
);
/**
- * @brief RTEMS Set Task Affinity
+ * @brief Sets the processor affinity set of a task.
*
- * This directive sets the given tasks
- * affinity cpuset.
+ * @param[in] id Identifier of the task. Use @ref RTEMS_SELF to select the
+ * executing task.
+ * @param[in] cpusetsize Size of the specified affinity set buffer in
+ * bytes. This value must be positive.
+ * @param[in] cpuset The new processor affinity set for the task. A set bit in
+ * the affinity set means that the task can execute on this processor and a
+ * cleared bit means the opposite.
*
- * @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
+ * @retval RTEMS_SUCCESSFUL Successful operation.
+ * @retval RTEMS_INVALID_ADDRESS The @a cpuset parameter is @c NULL.
+ * @retval RTEMS_INVALID_ID Invalid task identifier.
+ * @retval RTEMS_INVALID_NUMBER Invalid processor affinity set.
*/
rtems_status_code rtems_task_set_affinity(
rtems_id id,