21 #ifndef _RTEMS_SCORE_PRIORITYBITMAPIMPL_H 22 #define _RTEMS_SCORE_PRIORITYBITMAPIMPL_H 62 unsigned int bit_number;
64 #if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) 65 _CPU_Bitfield_Find_first_bit( value, bit_number );
66 #elif defined(__GNUC__) 67 bit_number = (
unsigned int) __builtin_clz( value )
68 - __SIZEOF_INT__ * __CHAR_BIT__ + 16;
70 if ( value < 0x100 ) {
89 unsigned int bit_number
92 #if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) 93 return _CPU_Priority_Mask( bit_number );
95 return (Priority_bit_map_Word) ( 0x8000u >> bit_number );
108 unsigned int bit_number
111 #if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) 112 return _CPU_Priority_bits_index( bit_number );
127 return the_priority / 16;
139 return the_priority % 16;
151 memset( bit_map, 0,
sizeof( *bit_map ) );
185 if ( *bit_map_info->
minor == 0 )
237 unsigned int new_priority
242 Priority_bit_map_Word mask;
251 bit_map_info->
block_major = (Priority_bit_map_Word) ~mask;
255 bit_map_info->
block_minor = (Priority_bit_map_Word) ~mask;
RTEMS_INLINE_ROUTINE unsigned int _Priority_Major(unsigned int the_priority)
Returns the major portion of the_priority.
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add(Priority_bit_map_Control *bit_map, Priority_bit_map_Information *bit_map_info)
Adds Priority queue bit map information.
Priority_bit_map_Word bit_map[16]
Each bit in the bit map indicates whether or not there are threads ready at a particular priority...
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove(Priority_bit_map_Control *bit_map, Priority_bit_map_Information *bit_map_info)
Removes Priority queue bit map information.
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Initialize(Priority_bit_map_Control *bit_map)
Initializes a bit map.
RTEMS_INLINE_ROUTINE unsigned int _Priority_Minor(unsigned int the_priority)
Returns the minor portion of the_priority.
RTEMS_INLINE_ROUTINE unsigned int _Priority_bit_map_Get_highest(const Priority_bit_map_Control *bit_map)
Gets highest portion of Priority queue bit map.
Priority_bit_map_Word major_bit_map
Each sixteen bit entry in this word is associated with one of the sixteen entries in the bit map...
Manipulation Routines for the Bitmap Priority Queue Implementation.
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.
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)
Initializes the bit map information.
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
const unsigned char _Bitfield_Leading_zeros[256]
RTEMS_INLINE_ROUTINE bool _Priority_bit_map_Is_empty(const Priority_bit_map_Control *bit_map)
Checks if the Priority queue bit map is empty.
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.
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.