RTEMS CPU Kit with SuperCore  4.11.3
Macros | Typedefs | Functions | Variables
Priority Handler

This handler encapsulates functionality which is used to manage thread priorities. More...

Collaboration diagram for Priority Handler:

Macros

#define PRIORITY_MINIMUM   0
 This defines the highest (most important) thread priority. More...
 
#define PRIORITY_PSEUDO_ISR   PRIORITY_MINIMUM
 This defines the priority of pseudo-ISR threads. More...
 
#define PRIORITY_DEFAULT_MAXIMUM   255
 This defines the default lowest (least important) thread priority. More...
 
#define PRIORITY_MAXIMUM   rtems_maximum_priority
 This defines the lowest (least important) thread priority. More...
 
#define _Bitfield_Find_first_bit(_value, _bit_number)   _CPU_Bitfield_Find_first_bit( _value, _bit_number )
 Gets the _bit_number of the first bit set in the specified value. More...
 
#define _Priority_Mask(_bit_number)   _CPU_Priority_Mask( _bit_number )
 This method returns the priority bit mask for the specified major or minor bit number. More...
 
#define _Priority_Bits_index(_priority)   _CPU_Priority_bits_index( _priority )
 This method returns the bit index position for the specified priority. More...
 

Typedefs

typedef uint32_t Priority_Control
 The following type defines the control block used to manage thread priorities. More...
 

Functions

RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Major (Priority_Control the_priority)
 This function returns the major portion of the_priority.
 
RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Minor (Priority_Control the_priority)
 This function returns the minor portion of the_priority.
 
RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Mask (uint32_t bit_number)
 This function returns the mask associated with the major or minor number passed to it.
 
RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Mask_invert (uint32_t mask)
 This function returns the mask bit inverted.
 
RTEMS_INLINE_ROUTINE uint32_t _Priority_Bits_index (uint32_t bit_number)
 This function translates the bit numbers returned by the bit scan of a priority bit field into something suitable for use as a major or minor component of a 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)
 Priority Queue implemented by bit map.
 
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove (Priority_bit_map_Control *bit_map, Priority_bit_map_Information *bit_map_info)
 
RTEMS_INLINE_ROUTINE Priority_Control _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, Priority_Control new_priority)
 

Variables

uint8_t rtems_maximum_priority
 This variable contains the configured number of priorities.
 
const unsigned char __log2table [256]
 This table is used by the generic bitfield routines to perform a highly optimized bit scan without the use of special CPU instructions.
 

Detailed Description

This handler encapsulates functionality which is used to manage thread priorities.

At the SuperCore level 256 priority levels are supported with lower numbers representing logically more important threads. The priority level 0 is reserved for internal RTEMS use. Typically it is assigned to threads which defer internal RTEMS actions from an interrupt to thread level to improve interrupt response. Priority level 255 is assigned to the IDLE thread and really should not be used by application threads. The default IDLE thread implementation is an infinite "branch to self" loop which never yields to other threads at the same priority.

Macro Definition Documentation

◆ _Bitfield_Find_first_bit

#define _Bitfield_Find_first_bit (   _value,
  _bit_number 
)    _CPU_Bitfield_Find_first_bit( _value, _bit_number )

Gets the _bit_number of the first bit set in the specified value.

This routine returns the _bit_number of the first bit set in the specified value. The correspondence between _bit_number and actual bit position is processor dependent. The search for the first bit set may run from most to least significant bit or vice-versa.

Parameters
[in]_valueis the value to bit scan.
[in]_bit_numberis the position of the first bit set.
Note
This routine is used when the executing thread is removed from the ready state and, as a result, its performance has a significant impact on the performance of the executive as a whole.
This routine must be a macro because if a CPU specific version is used it will most likely use inline assembly.

◆ _Priority_Bits_index

#define _Priority_Bits_index (   _priority)    _CPU_Priority_bits_index( _priority )

This method returns the bit index position for the specified priority.

Parameters
[in]_priorityis the priority for which we need the index.
Return values
Thismethod returns the array index into the priority bit map.
Note
This may simply be a pass through to a CPU dependent implementation.

◆ _Priority_Mask

#define _Priority_Mask (   _bit_number)    _CPU_Priority_Mask( _bit_number )

This method returns the priority bit mask for the specified major or minor bit number.

Parameters
[in]_bit_numberis the bit number for which we need a mask
Return values
thepriority bit mask
Note
This may simply be a pass through to a CPU dependent implementation.

◆ PRIORITY_DEFAULT_MAXIMUM

#define PRIORITY_DEFAULT_MAXIMUM   255

This defines the default lowest (least important) thread priority.

◆ PRIORITY_MAXIMUM

#define PRIORITY_MAXIMUM   rtems_maximum_priority

This defines the lowest (least important) thread priority.

◆ PRIORITY_MINIMUM

#define PRIORITY_MINIMUM   0

This defines the highest (most important) thread priority.

Referenced by rtems_semaphore_create().

◆ PRIORITY_PSEUDO_ISR

#define PRIORITY_PSEUDO_ISR   PRIORITY_MINIMUM

This defines the priority of pseudo-ISR threads.

Examples are the MPCI and timer server threads.

Typedef Documentation

◆ Priority_Control

typedef uint32_t Priority_Control

The following type defines the control block used to manage thread priorities.

Note
Priority 0 is reserved for internal threads only.