#3881 closed enhancement (fixed)

Add API functions to map a task priority to/from a POSIX thread priority

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 5.1
Component: rtems Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

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:

/**
 * @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
);

Change History (4)

comment:1 Changed on Mar 3, 2020 at 6:14:42 AM by Sebastian Huber <sebastian.huber@…>

In 38736c6/rtems:

rtems: Add rtems_scheduler_map_priority_to_posix()

Update #3881.

comment:2 Changed on Mar 3, 2020 at 6:14:46 AM by Sebastian Huber <sebastian.huber@…>

In 18020109/rtems:

rtems: Add rtems_scheduler_map_priority_from_posix()

Update #3881.

comment:3 Changed on Mar 3, 2020 at 6:16:12 AM by Sebastian Huber <sebastian.huber@…>

In e458fed/rtems-docs:

c-user: rtems_scheduler_map_priority_to_posix()

Update #3881.

comment:4 Changed on Mar 3, 2020 at 6:16:14 AM by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In ac61465/rtems-docs:

c-user: rtems_scheduler_map_priority_from_posix()

Close #3881.

Note: See TracTickets for help on using tickets.