[PATCH 5/8] score: Define _Priority_Mask() once

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jun 8 13:58:01 UTC 2016


---
 .../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.
-- 
1.8.4.5




More information about the devel mailing list