- /* clear bit N of bitstring name (atomic) */
-#define bitstr_clear_atomic(name, bit) \
- atomic_bitclear_8(&((name)[_bitstr_byte(bit)]), _bitstr_mask(bit))
-
- /* clear bits start ... stop in bitstring */
-#define bitstr_nclear(name, start, stop) do { \
- bitstr_t *_name = (name); \
- int _start = (start), _stop = (stop); \
- int _startbyte = _bitstr_byte(_start); \
- int _stopbyte = _bitstr_byte(_stop); \
- if (_startbyte == _stopbyte) { \
- _name[_startbyte] &= ((0xff >> (8 - (_start & 0x7))) | \
- (0xff << ((_stop & 0x7) + 1))); \
- } else { \
- _name[_startbyte] &= 0xff >> (8 - (_start & 0x7)); \
- while (++_startbyte < _stopbyte) \
- _name[_startbyte] = 0; \
- _name[_stopbyte] &= 0xff << ((_stop & 0x7) + 1); \
- } \
+/* clear bit N of bitstring name (atomic) */
+#define bitstr_clear_atomic(name, bit) \
+ (void)os_atomic_andnot(&((name)[_bitstr_byte(bit)]), _bitstr_mask(bit), relaxed)
+
+/* clear bits start ... stop in bitstring */
+#define bitstr_nclear(name, start, stop) do { \
+ bitstr_t *_name = (name); \
+ int _start = (start), _stop = (stop); \
+ int _startbyte = _bitstr_byte(_start); \
+ int _stopbyte = _bitstr_byte(_stop); \
+ if (_startbyte == _stopbyte) { \
+ _name[_startbyte] &= ((0xff >> (8 - (_start & 0x7))) | \
+ (0xff << ((_stop & 0x7) + 1))); \
+ } else { \
+ _name[_startbyte] &= 0xff >> (8 - (_start & 0x7)); \
+ while (++_startbyte < _stopbyte) \
+ _name[_startbyte] = 0; \
+ _name[_stopbyte] &= 0xff << ((_stop & 0x7) + 1); \
+ } \