RTEMS CPU Kit with SuperCore  4.11.3
Files | Macros | Functions
POSIX Priority Support

Interface to the POSIX Priority Implementation. More...

Collaboration diagram for POSIX Priority Support:

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...
 

Detailed Description

Interface to the POSIX Priority Implementation.

Macro Definition Documentation

◆ POSIX_SCHEDULER_MAXIMUM_PRIORITY

#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().

Function Documentation

◆ _POSIX_Priority_From_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.

Parameters
[in]priorityis the POSIX API priority.
Returns
This method returns the corresponding POSIX priority.

References POSIX_SCHEDULER_MAXIMUM_PRIORITY.

◆ _POSIX_Priority_Is_valid()

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.

Parameters
[in]priorityis the priority to test
Return values
TRUEThe priority is valid.
FALSEThe priority is invalid.

References POSIX_SCHEDULER_MAXIMUM_PRIORITY, and POSIX_SCHEDULER_MINIMUM_PRIORITY.

Referenced by _POSIX_Thread_Translate_sched_param().

◆ _POSIX_Priority_To_core()

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.

Parameters
[in]priorityis the POSIX API priority.
Returns
This method returns the corresponding SuperCore priority.

References POSIX_SCHEDULER_MAXIMUM_PRIORITY.

Referenced by _POSIX_Threads_Sporadic_budget_callout(), and _POSIX_Threads_Sporadic_budget_TSR().