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
10 #include <asm/system.h>
12 #include <asm/byteorder.h>
15 #include <asm/bitops-grb.h>
16 #elif defined(CONFIG_CPU_SH4A)
17 #include <asm/bitops-llsc.h>
19 #include <asm/bitops-irq.h>
24 * clear_bit() doesn't provide any barrier for the compiler.
26 #define smp_mb__before_clear_bit() barrier()
27 #define smp_mb__after_clear_bit() barrier()
29 #include <asm-generic/bitops/non-atomic.h>
31 #ifdef CONFIG_SUPERH32
32 static inline unsigned long ffz(unsigned long word)
40 : "=r" (result), "=r" (word)
41 : "0" (~0L), "1" (word)
47 * __ffs - find first bit in word.
48 * @word: The word to search
50 * Undefined if no bit exists, so code should check against 0 first.
52 static inline unsigned long __ffs(unsigned long word)
60 : "=r" (result), "=r" (word)
61 : "0" (~0L), "1" (word)
66 static inline unsigned long ffz(unsigned long word)
68 unsigned long result, __d2, __d3;
70 __asm__("gettr tr0, %2\n\t"
73 "beq %3, r63, tr0\n\t"
76 "shlri.l %1, 1, %1\n\t"
82 : "=r" (result), "=r" (word), "=r" (__d2), "=r" (__d3)
83 : "0" (0L), "1" (word));
88 #include <asm-generic/bitops/__ffs.h>
91 #include <asm-generic/bitops/find.h>
92 #include <asm-generic/bitops/ffs.h>
93 #include <asm-generic/bitops/hweight.h>
94 #include <asm-generic/bitops/lock.h>
95 #include <asm-generic/bitops/sched.h>
96 #include <asm-generic/bitops/ext2-non-atomic.h>
97 #include <asm-generic/bitops/ext2-atomic.h>
98 #include <asm-generic/bitops/minix.h>
99 #include <asm-generic/bitops/fls.h>
100 #include <asm-generic/bitops/__fls.h>
101 #include <asm-generic/bitops/fls64.h>
103 #endif /* __KERNEL__ */
105 #endif /* __ASM_SH_BITOPS_H */