RTEMS  5.0.0
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Priority Handler

Data Structures

struct  Priority_Node
 The priority node to build up a priority aggregation. More...
 
struct  Priority_Aggregation
 The priority aggregation. More...
 
struct  Priority_Actions
 A list of priority actions. More...
 

Macros

#define PRIORITY_MINIMUM   0
 The highest (most important) thread priority value.
 
#define PRIORITY_PSEUDO_ISR   PRIORITY_MINIMUM
 The priority value of pseudo-ISR threads. More...
 
#define PRIORITY_DEFAULT_MAXIMUM   255
 The default lowest (least important) thread priority value. More...
 

Typedefs

typedef uint64_t Priority_Control
 The thread priority control. More...
 
typedef struct Priority_Aggregation Priority_Aggregation
 

Enumerations

enum  Priority_Action_type { PRIORITY_ACTION_ADD, PRIORITY_ACTION_CHANGE, PRIORITY_ACTION_REMOVE, PRIORITY_ACTION_INVALID }
 The priority action type.
 

Functions

RTEMS_INLINE_ROUTINE unsigned int _Bitfield_Find_first_bit (unsigned int value)
 Returns the bit number of the first bit set in the specified value. More...
 
RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Mask (unsigned int bit_number)
 Returns the priority bit mask for the specified major or minor bit number. More...
 
RTEMS_INLINE_ROUTINE unsigned int _Priority_Bits_index (unsigned int bit_number)
 Returns the bit index position for the specified major or minor bit number. More...
 
RTEMS_INLINE_ROUTINE unsigned int _Priority_Major (unsigned int the_priority)
 
RTEMS_INLINE_ROUTINE unsigned int _Priority_Minor (unsigned int the_priority)
 
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Initialize (Priority_bit_map_Control *bit_map)
 
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add (Priority_bit_map_Control *bit_map, Priority_bit_map_Information *bit_map_info)
 
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove (Priority_bit_map_Control *bit_map, Priority_bit_map_Information *bit_map_info)
 
RTEMS_INLINE_ROUTINE unsigned int _Priority_bit_map_Get_highest (const Priority_bit_map_Control *bit_map)
 
RTEMS_INLINE_ROUTINE bool _Priority_bit_map_Is_empty (const Priority_bit_map_Control *bit_map)
 
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Initialize_information (Priority_bit_map_Control *bit_map, Priority_bit_map_Information *bit_map_info, unsigned int new_priority)
 

Variables

const unsigned char _Bitfield_Leading_zeros [256]
 

Detailed Description

This handler encapsulates functionality which is used to manage thread priorities. The actual priority of a thread is an aggregation of priority nodes. The thread priority aggregation for the home scheduler instance of a thread consists of at least one priority node, which is normally the real priority of the thread. The locking protocols (e.g. priority ceiling and priority inheritance), rate-monotonic period objects and the POSIX sporadic server add, change and remove priority nodes.

Macro Definition Documentation

◆ PRIORITY_DEFAULT_MAXIMUM

#define PRIORITY_DEFAULT_MAXIMUM   255

The default lowest (least important) thread priority value.

This value is CPU port dependent.

◆ PRIORITY_PSEUDO_ISR

#define PRIORITY_PSEUDO_ISR   PRIORITY_MINIMUM

The priority value of pseudo-ISR threads.

Examples are the MPCI and timer server threads.

Typedef Documentation

◆ Priority_Control

typedef uint64_t Priority_Control

The thread priority control.

Lower values represent higher priorities. So, a priority value of zero represents the highest priority thread. This value is reserved for internal threads and the priority ceiling protocol.

The format of the thread priority control depends on the context. A thread priority control may contain a user visible priority for API import/export. It may also contain a scheduler internal priority value. Values are translated via the scheduler map/unmap priority operations. The format of scheduler interal values depend on the particular scheduler implementation. It may for example encode a deadline in case of the EDF scheduler.

The thread priority control value contained in the scheduler node (Scheduler_Node::Priority::value) uses the least-significant bit to indicate if the thread should be appended or prepended to its priority group, see SCHEDULER_PRIORITY_APPEND().

Function Documentation

◆ _Bitfield_Find_first_bit()

RTEMS_INLINE_ROUTINE unsigned int _Bitfield_Find_first_bit ( unsigned int  value)

Returns the bit number of the first bit set in the specified value.

The correspondence between the bit number and actual bit position is CPU architecture dependent. The search for the first bit set may run from most to least significant bit or vice-versa.

Parameters
valueThe value to bit scan.
Returns
The bit number of the first bit set.
See also
_Priority_Bits_index() and _Priority_Mask().

◆ _Priority_bit_map_Add()

RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add ( Priority_bit_map_Control bit_map,
Priority_bit_map_Information bit_map_info 
)

Priority Queue implemented by bit map

◆ _Priority_Bits_index()

RTEMS_INLINE_ROUTINE unsigned int _Priority_Bits_index ( unsigned int  bit_number)

Returns the bit index position for the specified major or minor bit number.

Parameters
bit_numberThe bit number for which we need an index.
Returns
The corresponding array index into the priority bit map.

◆ _Priority_Major()

RTEMS_INLINE_ROUTINE unsigned int _Priority_Major ( unsigned int  the_priority)

This function returns the major portion of the_priority.

◆ _Priority_Mask()

RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Mask ( unsigned int  bit_number)

Returns the priority bit mask for the specified major or minor bit number.

Parameters
bit_numberThe bit number for which we need a mask.
Returns
The priority bit mask.

◆ _Priority_Minor()

RTEMS_INLINE_ROUTINE unsigned int _Priority_Minor ( unsigned int  the_priority)

This function returns the minor portion of the_priority.

Variable Documentation

◆ _Bitfield_Leading_zeros

const unsigned char _Bitfield_Leading_zeros[256]

This table is used by the generic bitfield routines to perform a highly optimized bit scan without the use of special CPU instructions.