[PATCH 6/8] score: Define _Priority_Bits_index() once

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


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

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




More information about the devel mailing list