1 #ifndef __ASM_SH_BITOPS_H
2 #define __ASM_SH_BITOPS_H
6 #ifndef _LINUX_BITOPS_H
7 #error only <linux/bitops.h> can be included directly
11 #include <asm/byteorder.h>
12 #include <asm/barrier.h>
15 #include <asm/bitops-grb.h>
16 #elif defined(CONFIG_CPU_SH2A)
17 #include <asm-generic/bitops/atomic.h>
18 #include <asm/bitops-op32.h>
19 #elif defined(CONFIG_CPU_SH4A)
20 #include <asm/bitops-llsc.h>
22 #include <asm-generic/bitops/atomic.h>
23 #include <asm-generic/bitops/non-atomic.h>
26 #ifdef CONFIG_SUPERH32
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 static inline unsigned long ffz(unsigned long word
)
63 unsigned long result
, __d2
, __d3
;
65 __asm__("gettr tr0, %2\n\t"
68 "beq %3, r63, tr0\n\t"
71 "shlri.l %1, 1, %1\n\t"
77 : "=r" (result
), "=r" (word
), "=r" (__d2
), "=r" (__d3
)
78 : "0" (0L), "1" (word
));
83 #include <asm-generic/bitops/__ffs.h>
86 #include <asm-generic/bitops/find.h>
87 #include <asm-generic/bitops/ffs.h>
88 #include <asm-generic/bitops/hweight.h>
89 #include <asm-generic/bitops/lock.h>
90 #include <asm-generic/bitops/sched.h>
91 #include <asm-generic/bitops/le.h>
92 #include <asm-generic/bitops/ext2-atomic.h>
93 #include <asm-generic/bitops/fls.h>
94 #include <asm-generic/bitops/__fls.h>
95 #include <asm-generic/bitops/fls64.h>
97 #endif /* __KERNEL__ */
99 #endif /* __ASM_SH_BITOPS_H */