diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-08 08:14:58 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-08 15:48:03 +0200 |
commit | bf021daf7cc7921b87596ee9d6a5be8b3347be93 (patch) | |
tree | f254805daf6cbed57d658a699a9eecf5f80ff418 | |
parent | score: Simplify priority bit map implementation (diff) | |
download | rtems-bf021daf7cc7921b87596ee9d6a5be8b3347be93.tar.bz2 |
score: Define _Priority_Mask() once
-rw-r--r-- | cpukit/score/include/rtems/score/prioritybitmapimpl.h | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/cpukit/score/include/rtems/score/prioritybitmapimpl.h b/cpukit/score/include/rtems/score/prioritybitmapimpl.h index 119e8376a1..fa37189d97 100644 --- a/cpukit/score/include/rtems/score/prioritybitmapimpl.h +++ b/cpukit/score/include/rtems/score/prioritybitmapimpl.h @@ -74,20 +74,24 @@ extern const unsigned char _Bitfield_Leading_zeros[256]; } #endif -#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) /** - * This method returns the priority bit mask for the specified major - * or minor bit number. - * - * @param[in] _bit_number is the bit number for which we need a mask + * @brief Returns the priority bit mask for the specified major or minor bit + * number. * - * @retval the priority bit mask + * @param bit_number The bit number for which we need a mask. * - * @note This may simply be a pass through to a CPU dependent implementation. + * @return The priority bit mask. */ -#define _Priority_Mask( _bit_number ) \ - _CPU_Priority_Mask( _bit_number ) +RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Mask( + unsigned int bit_number +) +{ +#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) + return _CPU_Priority_Mask( bit_number ); +#else + return (Priority_bit_map_Word) ( 0x8000u >> bit_number ); #endif +} #if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) /** @@ -124,18 +128,6 @@ RTEMS_INLINE_ROUTINE unsigned int _Priority_Minor( unsigned int the_priority ) #if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE ) /** - * This function returns the mask associated with the major or minor - * number passed to it. - */ - -RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Mask ( - unsigned int bit_number -) -{ - return (Priority_bit_map_Word)(0x8000u >> 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. |