Lines Matching +full:bit +full:- +full:mask
1 /* SPDX-License-Identifier: GPL-2.0 */
8 * ___set_bit - Set a bit in memory
9 * @nr: the bit to set
12 * Unlike set_bit(), this function is non-atomic and may be reordered.
19 unsigned long mask = BIT_MASK(nr); in ___set_bit() local
22 *p |= mask; in ___set_bit()
28 unsigned long mask = BIT_MASK(nr); in ___clear_bit() local
31 *p &= ~mask; in ___clear_bit()
35 * ___change_bit - Toggle a bit in memory
36 * @nr: the bit to change
39 * Unlike change_bit(), this function is non-atomic and may be reordered.
46 unsigned long mask = BIT_MASK(nr); in ___change_bit() local
49 *p ^= mask; in ___change_bit()
53 * ___test_and_set_bit - Set a bit and return its old value
54 * @nr: Bit to set
57 * This operation is non-atomic and can be reordered.
64 unsigned long mask = BIT_MASK(nr); in ___test_and_set_bit() local
68 *p = old | mask; in ___test_and_set_bit()
69 return (old & mask) != 0; in ___test_and_set_bit()
73 * ___test_and_clear_bit - Clear a bit and return its old value
74 * @nr: Bit to clear
77 * This operation is non-atomic and can be reordered.
84 unsigned long mask = BIT_MASK(nr); in ___test_and_clear_bit() local
88 *p = old & ~mask; in ___test_and_clear_bit()
89 return (old & mask) != 0; in ___test_and_clear_bit()
96 unsigned long mask = BIT_MASK(nr); in ___test_and_change_bit() local
100 *p = old ^ mask; in ___test_and_change_bit()
101 return (old & mask) != 0; in ___test_and_change_bit()
105 * _test_bit - Determine whether a bit is set
106 * @nr: bit number to test
112 return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1))); in _test_bit()