1 | /** |
---|
2 | * @file rtems/posix/priority.h |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * COPYRIGHT (c) 1989-2007. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in the file LICENSE in this distribution or at |
---|
11 | * http://www.rtems.com/license/LICENSE. |
---|
12 | * |
---|
13 | * $Id$ |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef _RTEMS_POSIX_PRIORITY_H |
---|
17 | #define _RTEMS_POSIX_PRIORITY_H |
---|
18 | |
---|
19 | #include <rtems/score/priority.h> |
---|
20 | |
---|
21 | /* |
---|
22 | * 1003.1b-1993,2.2.2.80 definition of priority, p. 19 |
---|
23 | * |
---|
24 | * "Numerically higher values represent higher priorities." |
---|
25 | * |
---|
26 | * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API. |
---|
27 | * |
---|
28 | * There are only 254 posix priority levels since a task at priority level |
---|
29 | * 255 would never run because of the RTEMS idle task. This is necessary |
---|
30 | * because GNAT maps the lowest Ada task priority to the lowest thread |
---|
31 | * priority. The lowest priority Ada task should get to run, so there is |
---|
32 | * a fundamental conflict with having 255 priorities. |
---|
33 | * |
---|
34 | * But since RTEMS can be configured with fewer than 256 priorities, |
---|
35 | * we use the internal constant. |
---|
36 | */ |
---|
37 | |
---|
38 | #define POSIX_SCHEDULER_MAXIMUM_PRIORITY (PRIORITY_MAXIMUM - 1) |
---|
39 | |
---|
40 | #define POSIX_SCHEDULER_MINIMUM_PRIORITY (1) |
---|
41 | |
---|
42 | RTEMS_INLINE_ROUTINE bool _POSIX_Priority_Is_valid( |
---|
43 | int priority |
---|
44 | ); |
---|
45 | |
---|
46 | RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( |
---|
47 | int priority |
---|
48 | ); |
---|
49 | |
---|
50 | RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core( |
---|
51 | Priority_Control priority |
---|
52 | ); |
---|
53 | |
---|
54 | #include <rtems/posix/priority.inl> |
---|
55 | |
---|
56 | #endif |
---|