diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-10-31 13:08:33 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-10 09:22:09 +0100 |
commit | 05ca53ddf6bc8333c2f3ad861c5415467c3262d2 (patch) | |
tree | 9b011af47a8304527c77ba8992418e473f540ecf /cpukit/rtems/include/rtems/rtems/tasks.h | |
parent | score: Add and use Thread_Control::is_idle (diff) | |
download | rtems-05ca53ddf6bc8333c2f3ad861c5415467c3262d2.tar.bz2 |
rtems: Add scheduler processor add/remove
Update #2797.
Diffstat (limited to '')
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/tasks.h | 57 |
1 files changed, 53 insertions, 4 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h index 3a94e348ed..6baefa0a8b 100644 --- a/cpukit/rtems/include/rtems/rtems/tasks.h +++ b/cpukit/rtems/include/rtems/rtems/tasks.h @@ -465,7 +465,7 @@ rtems_status_code rtems_task_set_affinity( * * @param[in] task_id Identifier of the task. Use @ref RTEMS_SELF to select * the executing task. - * @param[out] scheduler_id Identifier of the scheduler. + * @param[out] scheduler_id Identifier of the scheduler instance. * * @retval RTEMS_SUCCESSFUL Successful operation. * @retval RTEMS_INVALID_ADDRESS The @a scheduler_id parameter is @c NULL. @@ -563,9 +563,9 @@ rtems_status_code rtems_scheduler_ident( #if defined(__RTEMS_HAVE_SYS_CPUSET_H__) /** - * @brief Gets the set of processors owned by the scheduler. + * @brief Gets the set of processors owned by the specified scheduler instance. * - * @param[in] scheduler_id Identifier of the scheduler. + * @param[in] scheduler_id Identifier of the scheduler instance. * @param[in] cpusetsize Size of the specified processor set buffer in * bytes. This value must be positive. * @param[out] cpuset The processor set owned by the scheduler. A set bit in @@ -574,7 +574,7 @@ rtems_status_code rtems_scheduler_ident( * * @retval RTEMS_SUCCESSFUL Successful operation. * @retval RTEMS_INVALID_ADDRESS The @a cpuset parameter is @c NULL. - * @retval RTEMS_INVALID_ID Invalid scheduler identifier. + * @retval RTEMS_INVALID_ID Invalid scheduler instance identifier. * @retval RTEMS_INVALID_NUMBER The processor set buffer is too small for the * set of processors owned by the scheduler. */ @@ -585,6 +585,55 @@ rtems_status_code rtems_scheduler_get_processor_set( ); #endif +/** + * @brief Adds a processor to the set of processors owned by the specified + * scheduler instance. + * + * Must be called from task context. This operation obtains and releases the + * objects allocator lock. + * + * @param[in] scheduler_id Identifier of the scheduler instance. + * @param[in] cpu_index Index of the processor to add. + * + * @retval RTEMS_SUCCESSFUL Successful operation. + * @retval RTEMS_INVALID_ID Invalid scheduler instance identifier. + * @retval RTEMS_NOT_CONFIGURED The processor is not configured to be used by + * the application. + * @retval RTEMS_INCORRECT_STATE The processor is configured to be used by + * the application, however, it is not online. + * @retval RTEMS_RESOURCE_IN_USE The processor is already assigned to a + * scheduler instance. + */ +rtems_status_code rtems_scheduler_add_processor( + rtems_id scheduler_id, + uint32_t cpu_index +); + +/** + * @brief Removes a processor from set of processors owned by the specified + * scheduler instance. + * + * Must be called from task context. This operation obtains and releases the + * objects allocator lock. Removing a processor from a scheduler is a complex + * operation that involves all tasks of the system. + * + * @param[in] scheduler_id Identifier of the scheduler instance. + * @param[in] cpu_index Index of the processor to add. + * + * @retval RTEMS_SUCCESSFUL Successful operation. + * @retval RTEMS_INVALID_ID Invalid scheduler instance identifier. + * @retval RTEMS_INVALID_NUMBER The processor is not owned by the specified + * scheduler instance. + * @retval RTEMS_RESOURCE_IN_USE The set of processors owned by the specified + * scheduler instance would be empty after the processor removal and there + * exists a non-idle task that uses this scheduler instance as its home + * scheduler instance. + */ +rtems_status_code rtems_scheduler_remove_processor( + rtems_id scheduler_id, + uint32_t cpu_index +); + /**@}*/ /** |