[RTEMS Project] #3881: Add API functions to map a task priority to/from a POSIX thread priority

RTEMS trac trac at rtems.org
Mon Feb 24 12:44:30 UTC 2020


#3881: Add API functions to map a task priority to/from a POSIX thread priority
------------------------------+-----------------------------
  Reporter:  Sebastian Huber  |      Owner:  Sebastian Huber
      Type:  enhancement      |     Status:  assigned
  Priority:  normal           |  Milestone:  5.1
 Component:  rtems            |    Version:  5
  Severity:  normal           |   Keywords:
Blocked By:                   |   Blocking:
------------------------------+-----------------------------
 Mapping task priorities to/from POSIX thread priorities is probably done
 in many applications. There seems to be no API to help doing this. Add the
 following API functions to map a task priority to/from a POSIX thread
 priority:
 {{{
 #!c
 /**
  * @brief Map a task priority to the corresonding POSIX thread priority.
  *
  * @param scheduler_id Identifier of the scheduler instance.
  * @param priority The task priority to map.
  * @param[out] posix_priority Pointer to a POSIX thread priority value.
  *
  * @retval RTEMS_SUCCESSFUL Successful operation.
  * @retval RTEMS_INVALID_ADDRESS The @a posix_priority parameter is @c
 NULL.
  * @retval RTEMS_INVALID_ID Invalid scheduler instance identifier.
  * @retval RTEMS_INVALID_PRIORITY Invalid task priority.
  */
 rtems_status_code rtems_scheduler_map_to_posix_priority(
   rtems_id             scheduler_id,
   rtems_task_priority  priority,
   int                 *posix_priority
 );

 /**
  * @brief Map a POSIX thread priority to the corresonding task priority.
  *
  * @param scheduler_id Identifier of the scheduler instance.
  * @param posix_priority The POSIX thread priority to map.
  * @param[out] priority Pointer to a task priority value.
  *
  * @retval RTEMS_SUCCESSFUL Successful operation.
  * @retval RTEMS_INVALID_ADDRESS The @a priority parameter is @c NULL.
  * @retval RTEMS_INVALID_ID Invalid scheduler instance identifier.
  * @retval RTEMS_INVALID_PRIORITY Invalid POSIX thread priority.
  */
 rtems_status_code rtems_scheduler_map_from_posix_priority(
   rtems_id             scheduler_id,
   int                  posix_priority,
   rtems_task_priority *priority
 );
 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/3881>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list