source: rtems/cpukit/posix/include/rtems/posix/priorityimpl.h @ 77ff5599

5
Last change on this file since 77ff5599 was 77ff5599, checked in by Sebastian Huber <sebastian.huber@…>, on 06/10/16 at 06:48:54

score: Introduce map priority scheduler operation

Introduce map/unmap priority scheduler operations to map thread priority
values from/to the user domain to/from the scheduler domain. Use the
map priority operation to validate the thread priority. The EDF
schedulers use this new operation to distinguish between normal
priorities and priorities obtain through a job release.

Update #2173.
Update #2556.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/**
2 * @file
3 *
4 * @brief POSIX Priority Support
5 *
6 * This include file defines the interface to the POSIX priority
7 * implementation.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2011.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_POSIX_PRIORITYIMPL_H
20#define _RTEMS_POSIX_PRIORITYIMPL_H
21
22#include <rtems/score/scheduler.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/**
29 * @defgroup POSIX_PRIORITY POSIX Priority Support
30 *
31 * @ingroup POSIXAPI
32 *
33 * @brief Interface to the POSIX Priority Implementation.
34 *
35 * @{
36 */
37
38/**
39 *  This is the numerically least important POSIX priority.
40 */
41#define POSIX_SCHEDULER_MINIMUM_PRIORITY (1)
42
43/**
44 * @brief Gets the maximum POSIX API priority for this scheduler instance.
45 *
46 * Such a priority is valid.  A scheduler instance may support priority values
47 * that are not representable as an integer.
48 *
49 * @return The maximum POSIX API priority for this scheduler instance.
50 */
51int _POSIX_Priority_Get_maximum( const Scheduler_Control *scheduler );
52
53/**
54 * @brief Converts the POSIX API priority to the corresponding SuperCore
55 * priority and validates it.
56 *
57 * According to POSIX, numerically higher values represent higher priorities.
58 * Thus, SuperCore has priorities run in the opposite sense of the POSIX API.
59 *
60 * Let N be the maximum priority of this scheduler instance.   The SuperCore
61 * priority zero is system reserved (PRIORITY_PSEUDO_ISR).  There are only
62 * N - 1 POSIX API priority levels since a thread at SuperCore priority N would
63 * never run because of the idle threads.  This is necessary because GNAT maps
64 * the lowest Ada task priority to the lowest thread priority.  The lowest
65 * priority Ada task should get to run, so there is a fundamental conflict with
66 * having N priorities.
67 *
68 * @param[in] scheduler The scheduler instance.
69 * @param[in] priority The POSIX API priority to convert and validate.
70 * @param[out] valid Indicates if the POSIX API priority is valid and a
71 *   corresponding SuperCore priority in the specified scheduler instance
72 *   exists.
73 *
74 * @return The corresponding SuperCore priority.
75 */
76Priority_Control _POSIX_Priority_To_core(
77  const Scheduler_Control *scheduler,
78  int                      priority,
79  bool                    *valid
80);
81
82/**
83 * @brief Converts the SuperCore priority to the corresponding POSIX API
84 * priority.
85 *
86 * @param[in] scheduler The scheduler instance.
87 * @param[in] priority The SuperCore priority to convert.
88 *
89 * @return The corresponding POSIX API priority.
90 */
91int _POSIX_Priority_From_core(
92  const Scheduler_Control *scheduler,
93  Priority_Control         priority
94);
95
96/** @} */
97
98#ifdef __cplusplus
99}
100#endif
101
102#endif
Note: See TracBrowser for help on using the repository browser.