Lines Matching +full:non +full:- +full:volatile
1 /* SPDX-License-Identifier: GPL-2.0-only */
19 #include <asm-generic/bitops/__ffs.h>
20 #include <asm-generic/bitops/__fls.h>
21 #include <asm-generic/bitops/ffs.h>
22 #include <asm-generic/bitops/fls.h>
25 #include <asm/alternative-macros.h>
46 asm volatile (".option push\n" in variable__ffs()
84 * __ffs - find first set bit in a long word
102 asm volatile (".option push\n" in variable__fls()
108 return BITS_PER_LONG - 1 - word; in variable__fls()
111 num = BITS_PER_LONG - 1; in variable__fls()
114 num -= 32; in variable__fls()
118 if (!(word & (~0ul << (BITS_PER_LONG - 16)))) { in variable__fls()
119 num -= 16; in variable__fls()
122 if (!(word & (~0ul << (BITS_PER_LONG - 8)))) { in variable__fls()
123 num -= 8; in variable__fls()
126 if (!(word & (~0ul << (BITS_PER_LONG - 4)))) { in variable__fls()
127 num -= 4; in variable__fls()
130 if (!(word & (~0ul << (BITS_PER_LONG - 2)))) { in variable__fls()
131 num -= 2; in variable__fls()
134 if (!(word & (~0ul << (BITS_PER_LONG - 1)))) in variable__fls()
135 num -= 1; in variable__fls()
140 * __fls - find last set bit in a long word
147 (unsigned long)(BITS_PER_LONG - 1 - __builtin_clzl(word)) : \
161 asm volatile (".option push\n" in variable_ffs()
195 * ffs - find first set bit in a word
216 asm volatile (".option push\n" in variable_fls()
222 return 32 - r; in variable_fls()
228 r -= 16; in variable_fls()
232 r -= 8; in variable_fls()
236 r -= 4; in variable_fls()
240 r -= 2; in variable_fls()
244 r -= 1; in variable_fls()
250 * fls - find last set bit in a word
263 (int)((x_ != 0) ? (32 - __builtin_clz(x_)) : 0) \
270 #include <asm-generic/bitops/ffz.h>
271 #include <asm-generic/bitops/fls64.h>
272 #include <asm-generic/bitops/sched.h>
276 #include <asm-generic/bitops/const_hweight.h>
315 * test_and_set_bit - Set a bit and return its old value
321 static inline int test_and_set_bit(int nr, volatile unsigned long *addr) in test_and_set_bit()
327 * test_and_clear_bit - Clear a bit and return its old value
333 static inline int test_and_clear_bit(int nr, volatile unsigned long *addr) in test_and_clear_bit()
339 * test_and_change_bit - Change a bit and return its old value
346 static inline int test_and_change_bit(int nr, volatile unsigned long *addr) in test_and_change_bit()
352 * set_bit - Atomically set a bit in memory
357 * on non x86 architectures, so if you are writing portable code,
361 * restricted to acting on a single-word quantity.
363 static inline void set_bit(int nr, volatile unsigned long *addr) in set_bit()
369 * clear_bit - Clears a bit in memory
374 * on non x86 architectures, so if you are writing portable code,
377 static inline void clear_bit(int nr, volatile unsigned long *addr) in clear_bit()
383 * change_bit - Toggle a bit in memory
389 * restricted to acting on a single-word quantity.
391 static inline void change_bit(int nr, volatile unsigned long *addr) in change_bit()
397 * test_and_set_bit_lock - Set a bit and return its old value, for lock
405 unsigned long nr, volatile unsigned long *addr) in test_and_set_bit_lock()
411 * clear_bit_unlock - Clear a bit in memory, for unlock
418 unsigned long nr, volatile unsigned long *addr) in clear_bit_unlock()
424 * __clear_bit_unlock - Clear a bit in memory, for unlock
434 * On RISC-V systems there seems to be no benefit to taking advantage of the
435 * non-atomic property here: it's a lot more instructions and we still have to
439 unsigned long nr, volatile unsigned long *addr) in __clear_bit_unlock()
445 volatile unsigned long *addr) in xor_unlock_is_negative_byte()
462 #include <asm-generic/bitops/non-atomic.h>
463 #include <asm-generic/bitops/le.h>
464 #include <asm-generic/bitops/ext2-atomic.h>