diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-08 08:18:59 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-08 15:48:03 +0200 |
commit | 7103ad34b0025f2b584b3b8ab93e990e831b25d8 (patch) | |
tree | 13881911c64afb995f33b2af011be386d517f116 | |
parent | score: Define _Priority_Mask() once (diff) | |
download | rtems-7103ad34b0025f2b584b3b8ab93e990e831b25d8.tar.bz2 |
score: Define _Priority_Bits_index() once
-rw-r--r-- | cpukit/score/include/rtems/score/prioritybitmapimpl.h | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/cpukit/score/include/rtems/score/prioritybitmapimpl.h b/cpukit/score/include/rtems/score/prioritybitmapimpl.h index fa37189d97..ac4c275ea6 100644 --- a/cpukit/score/include/rtems/score/prioritybitmapimpl.h +++ b/cpukit/score/include/rtems/score/prioritybitmapimpl.h @@ -93,19 +93,24 @@ RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Mask( #endif } -#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) /** - * This method returns the bit index position for the specified priority. - * - * @param[in] _priority is the priority for which we need the index. + * @brief Returns the bit index position for the specified major or minor bit + * number. * - * @retval This method returns the array index into the priority bit map. + * @param bit_number The bit number for which we need an index. * - * @note This may simply be a pass through to a CPU dependent implementation. + * @return The corresponding array index into the priority bit map. */ -#define _Priority_Bits_index( _priority ) \ - _CPU_Priority_bits_index( _priority ) +RTEMS_INLINE_ROUTINE unsigned int _Priority_Bits_index( + unsigned int bit_number +) +{ +#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) + return _CPU_Priority_bits_index( bit_number ); +#else + return bit_number; #endif +} /** * This function returns the major portion of the_priority. @@ -125,23 +130,6 @@ RTEMS_INLINE_ROUTINE unsigned int _Priority_Minor( unsigned int the_priority ) return the_priority % 16; } -#if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE ) - -/** - * 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 unsigned int _Priority_Bits_index( - unsigned int bit_number -) -{ - return bit_number; -} - -#endif - RTEMS_INLINE_ROUTINE void _Priority_bit_map_Initialize( Priority_bit_map_Control *bit_map ) |