Lines Matching refs:bit

79 #define ATOMIC_MASK(bit) (1U << ((uint32_t)(bit) & (ATOMIC_BITS - 1U)))  argument
80 #define ATOMIC_ELEM(addr, bit) ((addr) + ((bit) / ATOMIC_BITS)) argument
127 static inline bool atomic_test_bit(const atomic_t *target, int bit) in atomic_test_bit() argument
129 atomic_val_t val = atomic_get(ATOMIC_ELEM(target, bit)); in atomic_test_bit()
131 return (1 & (val >> (bit & (ATOMIC_BITS - 1)))) != 0; in atomic_test_bit()
145 static inline bool atomic_test_and_clear_bit(atomic_t *target, int bit) in atomic_test_and_clear_bit() argument
147 atomic_val_t mask = ATOMIC_MASK(bit); in atomic_test_and_clear_bit()
150 old = atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_test_and_clear_bit()
166 static inline bool atomic_test_and_set_bit(atomic_t *target, int bit) in atomic_test_and_set_bit() argument
168 atomic_val_t mask = ATOMIC_MASK(bit); in atomic_test_and_set_bit()
171 old = atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_test_and_set_bit()
187 static inline void atomic_clear_bit(atomic_t *target, int bit) in atomic_clear_bit() argument
189 atomic_val_t mask = ATOMIC_MASK(bit); in atomic_clear_bit()
191 (void)atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_clear_bit()
205 static inline void atomic_set_bit(atomic_t *target, int bit) in atomic_set_bit() argument
207 atomic_val_t mask = ATOMIC_MASK(bit); in atomic_set_bit()
209 (void)atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_set_bit()
224 static inline void atomic_set_bit_to(atomic_t *target, int bit, bool val) in atomic_set_bit_to() argument
226 atomic_val_t mask = ATOMIC_MASK(bit); in atomic_set_bit_to()
229 (void)atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_set_bit_to()
231 (void)atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_set_bit_to()