Lines Matching +full:bit +full:- +full:mask
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
18 * @nr: the bit to set
24 unsigned int bit = nr % BITS_PER_LONG; in __mips_set_bit() local
25 unsigned long mask; 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
39 * @nr: Bit to clear
45 unsigned int bit = nr % BITS_PER_LONG; in __mips_clear_bit() local
46 unsigned long mask; 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()
60 * @nr: Bit to change
66 unsigned int bit = nr % BITS_PER_LONG; in __mips_change_bit() local
67 unsigned long mask; 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
81 * @nr: Bit to set
88 unsigned int bit = nr % BITS_PER_LONG; in __mips_test_and_set_bit_lock() local
89 unsigned long mask; 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
106 * @nr: Bit to clear
112 unsigned int bit = nr % BITS_PER_LONG; in __mips_test_and_clear_bit() local
113 unsigned long mask; 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
130 * @nr: Bit to change
136 unsigned int bit = nr % BITS_PER_LONG; in __mips_test_and_change_bit() local
137 unsigned long mask; 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()
150 bool __mips_xor_is_negative_byte(unsigned long mask, in __mips_xor_is_negative_byte() argument
158 *addr = data ^ mask; in __mips_xor_is_negative_byte()
161 return (data & BIT(7)) != 0; in __mips_xor_is_negative_byte()