1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SH_BITOPS_H
3 #define __ASM_SH_BITOPS_H
5 #ifndef _LINUX_BITOPS_H
6 #error only <linux/bitops.h> can be included directly
10 #include <asm/byteorder.h>
11 #include <asm/barrier.h>
14 #include <asm/bitops-grb.h>
15 #elif defined(CONFIG_CPU_SH2A)
16 #include <asm-generic/bitops/atomic.h>
17 #include <asm/bitops-op32.h>
18 #elif defined(CONFIG_CPU_SH4A)
19 #include <asm/bitops-llsc.h>
20 #elif defined(CONFIG_CPU_J2) && defined(CONFIG_SMP)
21 #include <asm/bitops-cas.h>
23 #include <asm-generic/bitops/atomic.h>
24 #include <asm-generic/bitops/non-atomic.h>
27 static inline unsigned long ffz(unsigned long word
)
35 : "=r" (result
), "=r" (word
)
36 : "0" (~0L), "1" (word
)
42 * __ffs - find first bit in word.
43 * @word: The word to search
45 * Undefined if no bit exists, so code should check against 0 first.
47 static inline unsigned long __ffs(unsigned long word
)
55 : "=r" (result
), "=r" (word
)
56 : "0" (~0L), "1" (word
)
61 #include <asm-generic/bitops/ffs.h>
62 #include <asm-generic/bitops/hweight.h>
63 #include <asm-generic/bitops/lock.h>
64 #include <asm-generic/bitops/sched.h>
65 #include <asm-generic/bitops/ext2-atomic.h>
66 #include <asm-generic/bitops/fls.h>
67 #include <asm-generic/bitops/__fls.h>
68 #include <asm-generic/bitops/fls64.h>
70 #include <asm-generic/bitops/le.h>
72 #endif /* __ASM_SH_BITOPS_H */