Lines Matching +full:a +full:- +full:bit

6  * Copyright (c) 1994-1997, 99, 2000, 06, 07 Ralf Baechle (ralf@linux-mips.org)
16 * __mips_set_bit - Atomically set a bit in memory. This is called by
17 * set_bit() if it cannot find a faster solution.
18 * @nr: the bit to set
23 volatile unsigned long *a = &addr[BIT_WORD(nr)]; in __mips_set_bit() local
24 unsigned int bit = nr % BITS_PER_LONG; in __mips_set_bit() local
28 mask = 1UL << bit; in __mips_set_bit()
30 *a |= mask; in __mips_set_bit()
37 * __mips_clear_bit - Clears a bit in memory. This is called by clear_bit() if
38 * it cannot find a faster solution.
39 * @nr: Bit to clear
44 volatile unsigned long *a = &addr[BIT_WORD(nr)]; in __mips_clear_bit() local
45 unsigned int bit = nr % BITS_PER_LONG; in __mips_clear_bit() local
49 mask = 1UL << bit; in __mips_clear_bit()
51 *a &= ~mask; in __mips_clear_bit()
58 * __mips_change_bit - Toggle a bit in memory. This is called by change_bit()
59 * if it cannot find a faster solution.
60 * @nr: Bit to change
65 volatile unsigned long *a = &addr[BIT_WORD(nr)]; in __mips_change_bit() local
66 unsigned int bit = nr % BITS_PER_LONG; in __mips_change_bit() local
70 mask = 1UL << bit; in __mips_change_bit()
72 *a ^= mask; in __mips_change_bit()
79 * __mips_test_and_set_bit_lock - Set a bit and return its old value. This is
80 * called by test_and_set_bit_lock() if it cannot find a faster solution.
81 * @nr: Bit to set
87 volatile unsigned long *a = &addr[BIT_WORD(nr)]; in __mips_test_and_set_bit_lock() local
88 unsigned int bit = nr % BITS_PER_LONG; in __mips_test_and_set_bit_lock() local
93 mask = 1UL << bit; in __mips_test_and_set_bit_lock()
95 res = (mask & *a) != 0; in __mips_test_and_set_bit_lock()
96 *a |= mask; in __mips_test_and_set_bit_lock()
104 * __mips_test_and_clear_bit - Clear a bit and return its old value. This is
105 * called by test_and_clear_bit() if it cannot find a faster solution.
106 * @nr: Bit to clear
111 volatile unsigned long *a = &addr[BIT_WORD(nr)]; in __mips_test_and_clear_bit() local
112 unsigned int bit = nr % BITS_PER_LONG; in __mips_test_and_clear_bit() local
117 mask = 1UL << bit; in __mips_test_and_clear_bit()
119 res = (mask & *a) != 0; in __mips_test_and_clear_bit()
120 *a &= ~mask; in __mips_test_and_clear_bit()
128 * __mips_test_and_change_bit - Change a bit and return its old value. This is
129 * called by test_and_change_bit() if it cannot find a faster solution.
130 * @nr: Bit to change
135 volatile unsigned long *a = &addr[BIT_WORD(nr)]; in __mips_test_and_change_bit() local
136 unsigned int bit = nr % BITS_PER_LONG; in __mips_test_and_change_bit() local
141 mask = 1UL << bit; in __mips_test_and_change_bit()
143 res = (mask & *a) != 0; in __mips_test_and_change_bit()
144 *a ^= mask; in __mips_test_and_change_bit()
161 return (data & BIT(7)) != 0; in __mips_xor_is_negative_byte()