diff options
author | Alexander Lobakin <alexandr.lobakin@intel.com> | 2022-06-24 15:13:09 +0300 |
---|---|---|
committer | Yury Norov <yury.norov@gmail.com> | 2022-07-01 05:52:41 +0300 |
commit | e69eb9c460f128b71c6b995d75a05244e4b6cc3e (patch) | |
tree | 0561deb82729c1c617ed1d8f302b6179aea14062 /tools/include/linux | |
parent | bb7379bfa680bd48b468e856475778db2ad866c1 (diff) | |
download | linux-e69eb9c460f128b71c6b995d75a05244e4b6cc3e.tar.xz |
bitops: wrap non-atomic bitops with a transparent macro
In preparation for altering the non-atomic bitops with a macro, wrap
them in a transparent definition. This requires prepending one more
'_' to their names in order to be able to do that seamlessly. It is
a simple change, given that all the non-prefixed definitions are now
in asm-generic.
sparc32 already has several triple-underscored functions, so I had
to rename them ('___' -> 'sp32_').
Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Reviewed-by: Marco Elver <elver@google.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
Diffstat (limited to 'tools/include/linux')
-rw-r--r-- | tools/include/linux/bitops.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/include/linux/bitops.h b/tools/include/linux/bitops.h index 5fca38fe1ba8..f18683b95ea6 100644 --- a/tools/include/linux/bitops.h +++ b/tools/include/linux/bitops.h @@ -26,6 +26,22 @@ extern unsigned int __sw_hweight32(unsigned int w); extern unsigned long __sw_hweight64(__u64 w); /* + * Defined here because those may be needed by architecture-specific static + * inlines. + */ + +#define bitop(op, nr, addr) \ + op(nr, addr) + +#define __set_bit(nr, addr) bitop(___set_bit, nr, addr) +#define __clear_bit(nr, addr) bitop(___clear_bit, nr, addr) +#define __change_bit(nr, addr) bitop(___change_bit, nr, addr) +#define __test_and_set_bit(nr, addr) bitop(___test_and_set_bit, nr, addr) +#define __test_and_clear_bit(nr, addr) bitop(___test_and_clear_bit, nr, addr) +#define __test_and_change_bit(nr, addr) bitop(___test_and_change_bit, nr, addr) +#define test_bit(nr, addr) bitop(_test_bit, nr, addr) + +/* * Include this here because some architectures need generic_ffs/fls in * scope * |