Lines Matching refs:bit

77 #define ATOMIC_MASK(bit) BIT((unsigned long)(bit) & (ATOMIC_BITS - 1U))  argument
78 #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()
147 static inline bool atomic_test_and_clear_bit(atomic_t *target, int bit) in atomic_test_and_clear_bit() argument
149 atomic_val_t mask = ATOMIC_MASK(bit); in atomic_test_and_clear_bit()
152 old = atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_test_and_clear_bit()
170 static inline bool atomic_test_and_set_bit(atomic_t *target, int bit) in atomic_test_and_set_bit() argument
172 atomic_val_t mask = ATOMIC_MASK(bit); in atomic_test_and_set_bit()
175 old = atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_test_and_set_bit()
191 static inline void atomic_clear_bit(atomic_t *target, int bit) in atomic_clear_bit() argument
193 atomic_val_t mask = ATOMIC_MASK(bit); in atomic_clear_bit()
195 (void)atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_clear_bit()
209 static inline void atomic_set_bit(atomic_t *target, int bit) in atomic_set_bit() argument
211 atomic_val_t mask = ATOMIC_MASK(bit); in atomic_set_bit()
213 (void)atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_set_bit()
228 static inline void atomic_set_bit_to(atomic_t *target, int bit, bool val) in atomic_set_bit_to() argument
230 atomic_val_t mask = ATOMIC_MASK(bit); in atomic_set_bit_to()
233 (void)atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_set_bit_to()
235 (void)atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_set_bit_to()