[rtems commit] score: Define _Priority_Mask() once

Sebastian Huber sebh at rtems.org
Thu Jun 9 08:49:38 UTC 2016


Module:    rtems
Branch:    master
Commit:    bf021daf7cc7921b87596ee9d6a5be8b3347be93
Changeset: http://git.rtems.org/rtems/commit/?id=bf021daf7cc7921b87596ee9d6a5be8b3347be93

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jun  8 08:14:58 2016 +0200

score: Define _Priority_Mask() once

---

 .../score/include/rtems/score/prioritybitmapimpl.h | 34 +++++++++-------------
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/cpukit/score/include/rtems/score/prioritybitmapimpl.h b/cpukit/score/include/rtems/score/prioritybitmapimpl.h
index 119e837..fa37189 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.



More information about the vc mailing list