Changeset 7103ad34 in rtems


Ignore:
Timestamp:
Jun 8, 2016, 6:18:59 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
b8a84064
Parents:
bf021daf
git-author:
Sebastian Huber <sebastian.huber@…> (06/08/16 06:18:59)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/08/16 13:48:03)
Message:

score: Define _Priority_Bits_index() once

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/prioritybitmapimpl.h

    rbf021daf r7103ad34  
    9494}
    9595
    96 #if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
    97 /**
    98  *  This method returns the bit index position for the specified priority.
    99  *
    100  *  @param[in] _priority is the priority for which we need the index.
    101  *
    102  *  @retval This method returns the array index into the priority bit map.
    103  *
    104  *  @note This may simply be a pass through to a CPU dependent implementation.
    105  */
    106 #define _Priority_Bits_index( _priority ) \
    107   _CPU_Priority_bits_index( _priority )
    108 #endif
    109 
    110 /**
    111  * This function returns the major portion of the_priority.
    112  */
    113 
    114 RTEMS_INLINE_ROUTINE unsigned int _Priority_Major( unsigned int the_priority )
    115 {
    116   return the_priority / 16;
    117 }
    118 
    119 /**
    120  * This function returns the minor portion of the_priority.
    121  */
    122 
    123 RTEMS_INLINE_ROUTINE unsigned int _Priority_Minor( unsigned int the_priority )
    124 {
    125   return the_priority % 16;
    126 }
    127 
    128 #if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE )
    129 
    130 /**
    131  * This function translates the bit numbers returned by the bit scan
    132  * of a priority bit field into something suitable for use as
    133  * a major or minor component of a priority.
    134  */
    135 
     96/**
     97 * @brief Returns the bit index position for the specified major or minor bit
     98 * number.
     99 *
     100 * @param bit_number The bit number for which we need an index.
     101 *
     102 * @return The corresponding array index into the priority bit map.
     103 */
    136104RTEMS_INLINE_ROUTINE unsigned int _Priority_Bits_index(
    137105  unsigned int bit_number
    138106)
    139107{
     108#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
     109  return _CPU_Priority_bits_index( bit_number );
     110#else
    140111  return bit_number;
    141 }
    142 
    143 #endif
     112#endif
     113}
     114
     115/**
     116 * This function returns the major portion of the_priority.
     117 */
     118
     119RTEMS_INLINE_ROUTINE unsigned int _Priority_Major( unsigned int the_priority )
     120{
     121  return the_priority / 16;
     122}
     123
     124/**
     125 * This function returns the minor portion of the_priority.
     126 */
     127
     128RTEMS_INLINE_ROUTINE unsigned int _Priority_Minor( unsigned int the_priority )
     129{
     130  return the_priority % 16;
     131}
    144132
    145133RTEMS_INLINE_ROUTINE void _Priority_bit_map_Initialize(
Note: See TracChangeset for help on using the changeset viewer.