Print this page
5042 stop using deprecated atomic functions

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/bitmap.h
          +++ new/usr/src/uts/common/sys/bitmap.h
↓ open down ↓ 163 lines elided ↑ open up ↑
 164  164   */
 165  165  extern int      odd_parity(ulong_t);
 166  166  
 167  167  /*
 168  168   * Atomically set/clear bits
 169  169   * Atomic exclusive operations will set "result" to "-1"
 170  170   * if the bit is already set/cleared. "result" will be set
 171  171   * to 0 otherwise.
 172  172   */
 173  173  #define BT_ATOMIC_SET(bitmap, bitindex) \
 174      -        { atomic_or_long(&(BT_WIM(bitmap, bitindex)), BT_BIW(bitindex)); }
      174 +        { atomic_or_ulong(&(BT_WIM(bitmap, bitindex)), BT_BIW(bitindex)); }
 175  175  #define BT_ATOMIC_CLEAR(bitmap, bitindex) \
 176      -        { atomic_and_long(&(BT_WIM(bitmap, bitindex)), ~BT_BIW(bitindex)); }
      176 +        { atomic_and_ulong(&(BT_WIM(bitmap, bitindex)), ~BT_BIW(bitindex)); }
 177  177  
 178  178  #define BT_ATOMIC_SET_EXCL(bitmap, bitindex, result) \
 179  179          { result = atomic_set_long_excl(&(BT_WIM(bitmap, bitindex)),    \
 180  180              (bitindex) % BT_NBIPUL); }
 181  181  #define BT_ATOMIC_CLEAR_EXCL(bitmap, bitindex, result) \
 182  182          { result = atomic_clear_long_excl(&(BT_WIM(bitmap, bitindex)),  \
 183  183              (bitindex) % BT_NBIPUL); }
 184  184  
 185  185  /*
 186  186   * Extracts bits between index h (high, inclusive) and l (low, exclusive) from
↓ open down ↓ 11 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX