Lines Matching +full:flags +full:- +full:mask
1 /* SPDX-License-Identifier: GPL-2.0 */
23 unsigned long mask = BIT_MASK(nr); in set_bit() local
24 unsigned long flags; in set_bit() local
27 _atomic_spin_lock_irqsave(addr, flags); in set_bit()
28 *addr |= mask; in set_bit()
29 _atomic_spin_unlock_irqrestore(addr, flags); in set_bit()
34 unsigned long mask = BIT_MASK(nr); in clear_bit() local
35 unsigned long flags; in clear_bit() local
38 _atomic_spin_lock_irqsave(addr, flags); in clear_bit()
39 *addr &= ~mask; in clear_bit()
40 _atomic_spin_unlock_irqrestore(addr, flags); in clear_bit()
45 unsigned long mask = BIT_MASK(nr); in change_bit() local
46 unsigned long flags; in change_bit() local
49 _atomic_spin_lock_irqsave(addr, flags); in change_bit()
50 *addr ^= mask; in change_bit()
51 _atomic_spin_unlock_irqrestore(addr, flags); in change_bit()
56 unsigned long mask = BIT_MASK(nr); in test_and_set_bit() local
58 unsigned long flags; in test_and_set_bit() local
62 _atomic_spin_lock_irqsave(addr, flags); in test_and_set_bit()
64 set = (old & mask) ? 1 : 0; in test_and_set_bit()
66 *addr = old | mask; in test_and_set_bit()
67 _atomic_spin_unlock_irqrestore(addr, flags); in test_and_set_bit()
74 unsigned long mask = BIT_MASK(nr); in test_and_clear_bit() local
76 unsigned long flags; in test_and_clear_bit() local
80 _atomic_spin_lock_irqsave(addr, flags); in test_and_clear_bit()
82 set = (old & mask) ? 1 : 0; in test_and_clear_bit()
84 *addr = old & ~mask; in test_and_clear_bit()
85 _atomic_spin_unlock_irqrestore(addr, flags); in test_and_clear_bit()
92 unsigned long mask = BIT_MASK(nr); in test_and_change_bit() local
94 unsigned long flags; in test_and_change_bit() local
97 _atomic_spin_lock_irqsave(addr, flags); in test_and_change_bit()
99 *addr = oldbit ^ mask; in test_and_change_bit()
100 _atomic_spin_unlock_irqrestore(addr, flags); in test_and_change_bit()
102 return (oldbit & mask) ? 1 : 0; in test_and_change_bit()
105 #include <asm-generic/bitops/non-atomic.h>
108 * __ffs - find first bit in word. returns 0 to "BITS_PER_LONG-1".
113 * 32-bit fast __ffs by LaMont Jones "lamont At hp com".
114 * 64-bit enhancement by Grant Grundler "grundler At parisc-linux org".
134 " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */ in __ffs()
135 " addi -32,%1,%1\n" in __ffs()
140 " extru,TR %0,15,16,%0\n" /* xxxx0000 -> 0000xxxx */ in __ffs()
141 " addi -16,%1,%1\n" in __ffs()
143 " extru,TR %0,23,8,%0\n" /* 0000xx00 -> 000000xx */ in __ffs()
144 " addi -8,%1,%1\n" in __ffs()
146 " extru,TR %0,27,4,%0\n" /* 000000x0 -> 0000000x */ in __ffs()
147 " addi -4,%1,%1\n" in __ffs()
149 " extru,TR %0,29,2,%0\n" /* 0000000y, 1100b -> 0011b */ in __ffs()
150 " addi -2,%1,%1\n" in __ffs()
152 " addi -1,%1,%1\n" in __ffs()
157 #include <asm-generic/bitops/ffz.h>
201 #include <asm-generic/bitops/__fls.h>
202 #include <asm-generic/bitops/fls64.h>
203 #include <asm-generic/bitops/hweight.h>
204 #include <asm-generic/bitops/lock.h>
205 #include <asm-generic/bitops/sched.h>
206 #include <asm-generic/bitops/le.h>
207 #include <asm-generic/bitops/ext2-atomic-setbit.h>