diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-08 11:14:27 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-15 08:37:12 +0200 |
commit | 0712d172d0bce40f3a9190af511249256ddac5f1 (patch) | |
tree | edfe262b0e46134e3704641cac50ff9d147e9e2a /cpukit/rtems/include/rtems/rtems/tasks.h | |
parent | score: Simplify thread control initialization (diff) | |
download | rtems-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 '')
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/tasks.h | 50 |
1 files changed, 26 insertions, 24 deletions
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, |