From 8123cae864579219e5003a67b451ca4cc07d998b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 8 Sep 2016 15:32:22 +0200 Subject: rtems: Add rtems_task_get_priority() Update #2556. Update #2784. --- cpukit/rtems/include/rtems/rtems/tasks.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'cpukit/rtems/include/rtems/rtems/tasks.h') diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h index e690e60557..0eaaeca4a3 100644 --- a/cpukit/rtems/include/rtems/rtems/tasks.h +++ b/cpukit/rtems/include/rtems/rtems/tasks.h @@ -319,6 +319,35 @@ rtems_status_code rtems_task_set_priority( rtems_task_priority *old_priority ); +/** + * @brief Gets the current priority of the specified task with respect to the + * specified scheduler instance. + * + * The current priority reflects temporary priority adjustments due to locking + * protocols, the rate-monotonic period objects on some schedulers and other + * mechanisms. + * + * @param[in] task_id Identifier of the task. Use @ref RTEMS_SELF to select + * the executing task. + * @param[in] scheduler_id Identifier of the scheduler instance. + * @param[out] priority Returns the current priority of the specified task with + * respect to the specified scheduler instance. + * + * @retval RTEMS_SUCCESSFUL Successful operation. + * @retval RTEMS_ILLEGAL_ON_REMOTE_OBJECT Directive is illegal on remote tasks. + * @retval RTEMS_INVALID_ADDRESS The priority parameter is @c NULL. + * @retval RTEMS_INVALID_ID Invalid task or scheduler identifier. + * @retval RTEMS_NOT_DEFINED The task has no priority within the specified + * scheduler instance. This error is only possible on SMP configurations. + * + * @see rtems_scheduler_ident(). + */ +rtems_status_code rtems_task_get_priority( + rtems_id task_id, + rtems_id scheduler_id, + rtems_task_priority *priority +); + /** * @brief RTEMS Start Task * -- cgit v1.2.3