• Home
  • Raw
  • Download

Lines Matching +full:clear +full:- +full:bit

1 /* SPDX-License-Identifier: GPL-2.0 */
6 * Copyright (C) 1998-2003 Hewlett-Packard Co
7 * David Mosberger-Tang <davidm@hpl.hp.com>
23 * set_bit - Atomically set a bit in memory
24 * @nr: the bit to set
30 * restricted to acting on a single-word quantity.
34 * operate on hw-defined data-structures, so we can't easily change these
37 * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
42 __u32 bit, old, new; in set_bit() local
47 bit = 1 << (nr & 31); in set_bit()
51 new = old | bit; in set_bit()
56 * __set_bit - Set a bit in memory
57 * @nr: the bit to set
60 * Unlike set_bit(), this function is non-atomic and may be reordered.
71 * clear_bit - Clears a bit in memory
72 * @nr: Bit to clear
97 * clear_bit_unlock - Clears a bit in memory with release
98 * @nr: Bit to clear
121 * __clear_bit_unlock - Non-atomically clears a bit in memory with release
122 * @nr: Bit to clear
138 * __clear_bit - Clears a bit in memory (non-atomic version)
139 * @nr: the bit to clear
142 * Unlike clear_bit(), this function is non-atomic and may be reordered.
153 * change_bit - Toggle a bit in memory
154 * @nr: Bit to toggle
159 * restricted to acting on a single-word quantity.
164 __u32 bit, old, new; in change_bit() local
169 bit = (1 << (nr & 31)); in change_bit()
173 new = old ^ bit; in change_bit()
178 * __change_bit - Toggle a bit in memory
179 * @nr: the bit to toggle
182 * Unlike change_bit(), this function is non-atomic and may be reordered.
193 * test_and_set_bit - Set a bit and return its old value
194 * @nr: Bit to set
203 __u32 bit, old, new; in test_and_set_bit() local
208 bit = 1 << (nr & 31); in test_and_set_bit()
212 new = old | bit; in test_and_set_bit()
214 return (old & bit) != 0; in test_and_set_bit()
218 * test_and_set_bit_lock - Set a bit and return its old value for lock
219 * @nr: Bit to set
227 * __test_and_set_bit - Set a bit and return its old value
228 * @nr: Bit to set
231 * This operation is non-atomic and can be reordered.
247 * test_and_clear_bit - Clear a bit and return its old value
248 * @nr: Bit to clear
272 * __test_and_clear_bit - Clear a bit and return its old value
273 * @nr: Bit to clear
276 * This operation is non-atomic and can be reordered.
292 * test_and_change_bit - Change a bit and return its old value
293 * @nr: Bit to change
302 __u32 bit, old, new; in test_and_change_bit() local
307 bit = (1 << (nr & 31)); in test_and_change_bit()
311 new = old ^ bit; in test_and_change_bit()
313 return (old & bit) != 0; in test_and_change_bit()
317 * __test_and_change_bit - Change a bit and return its old value
318 * @nr: Bit to change
321 * This operation is non-atomic and can be reordered.
326 __u32 old, bit = (1 << (nr & 31)); in __test_and_change_bit() local
330 *m = old ^ bit; in __test_and_change_bit()
331 return (old & bit) != 0; in __test_and_change_bit()
341 * ffz - find the first zero bit in a long word
342 * @x: The long word to find the bit in
344 * Returns the bit-number (0..63) of the first (least significant) zero bit.
352 result = ia64_popcnt(x & (~x - 1)); in ffz()
357 * __ffs - find first bit in word.
360 * Undefined if no bit exists, so code should check against 0 first.
367 result = ia64_popcnt((x-1) & ~x); in __ffs()
374 * Return bit number of last (most-significant) bit set. Undefined
384 return exp - 0xffff; in ia64_fls()
388 * Find the last (most significant) bit set. Returns 0 for x==0 and
406 * Find the last (most significant) bit set. Undefined for x==0.
418 return ia64_popcnt(x) - 1; in __fls()
421 #include <asm-generic/bitops/fls64.h>
423 #include <asm-generic/bitops/builtin-ffs.h>
427 * of bits set) of a N-bit word
440 #include <asm-generic/bitops/const_hweight.h>
444 #include <asm-generic/bitops/find.h>
448 #include <asm-generic/bitops/le.h>
450 #include <asm-generic/bitops/ext2-atomic-setbit.h>
452 #include <asm-generic/bitops/sched.h>