RTEMS CPU Kit with SuperCore
4.11.3
|
Interface to the POSIX Priority Implementation. More...
![]() |
Files | |
file | psxpriorityisvalid.c |
POSIX Is Priority Valid. | |
Macros | |
#define | POSIX_SCHEDULER_MAXIMUM_PRIORITY (PRIORITY_MAXIMUM - 1) |
1003.1b-1993,2.2.2.80 definition of priority, p. More... | |
#define | POSIX_SCHEDULER_MINIMUM_PRIORITY (1) |
This is the numerically least important POSIX priority. | |
Functions | |
bool | _POSIX_Priority_Is_valid (int priority) |
Check if POSIX priority is valid. More... | |
RTEMS_INLINE_ROUTINE Priority_Control | _POSIX_Priority_To_core (int priority) |
Convert POSIX priority to SuperCore priority. More... | |
RTEMS_INLINE_ROUTINE int | _POSIX_Priority_From_core (Priority_Control priority) |
Convert SuperCore priority To POSIX priority. More... | |
Interface to the POSIX Priority Implementation.
#define POSIX_SCHEDULER_MAXIMUM_PRIORITY (PRIORITY_MAXIMUM - 1) |
1003.1b-1993,2.2.2.80 definition of priority, p.
19
"Numerically higher values represent higher priorities."
Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
There are only 254 posix priority levels since a task at priority level 255 would never run because of the RTEMS idle task. This is necessary because GNAT maps the lowest Ada task priority to the lowest thread priority. The lowest priority Ada task should get to run, so there is a fundamental conflict with having 255 priorities.
But since RTEMS can be configured with fewer than 256 priorities, we use the internal constant.
Referenced by _POSIX_Mutex_Manager_initialization(), _POSIX_Priority_From_core(), _POSIX_Priority_Is_valid(), and _POSIX_Priority_To_core().
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core | ( | Priority_Control | priority | ) |
Convert SuperCore priority To POSIX priority.
This method converts a SuperCore priority into onto the corresponding POSIX API value.
[in] | priority | is the POSIX API priority. |
References POSIX_SCHEDULER_MAXIMUM_PRIORITY.
bool _POSIX_Priority_Is_valid | ( | int | priority | ) |
Check if POSIX priority is valid.
1003.1b-1993,2.2.2.80 definition of priority, p. 19
"Numerically higher values represent higher priorities."
Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
[in] | priority | is the priority to test |
TRUE | The priority is valid. |
FALSE | The priority is invalid. |
References POSIX_SCHEDULER_MAXIMUM_PRIORITY, and POSIX_SCHEDULER_MINIMUM_PRIORITY.
Referenced by _POSIX_Thread_Translate_sched_param().
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core | ( | int | priority | ) |
Convert POSIX priority to SuperCore priority.
This method converts a POSIX API priority into onto the corresponding SuperCore value.
[in] | priority | is the POSIX API priority. |
References POSIX_SCHEDULER_MAXIMUM_PRIORITY.
Referenced by _POSIX_Threads_Sporadic_budget_callout(), and _POSIX_Threads_Sporadic_budget_TSR().