123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- #ifndef _ASM_C6X_BITOPS_H
- #define _ASM_C6X_BITOPS_H
- #ifdef __KERNEL__
- #include <linux/bitops.h>
- #include <asm/byteorder.h>
- #include <asm/barrier.h>
- static inline unsigned long __ffs(unsigned long x)
- {
- asm (" bitr .M1 %0,%0\n"
- " nop\n"
- " lmbd .L1 1,%0,%0\n"
- : "+a"(x));
- return x;
- }
- #define ffz(x) __ffs(~(x))
- static inline int fls(int x)
- {
- if (!x)
- return 0;
- asm (" lmbd .L1 1,%0,%0\n" : "+a"(x));
- return 32 - x;
- }
- static inline int ffs(int x)
- {
- if (!x)
- return 0;
- return __ffs(x) + 1;
- }
- #include <asm-generic/bitops/__fls.h>
- #include <asm-generic/bitops/fls64.h>
- #include <asm-generic/bitops/find.h>
- #include <asm-generic/bitops/sched.h>
- #include <asm-generic/bitops/hweight.h>
- #include <asm-generic/bitops/lock.h>
- #include <asm-generic/bitops/atomic.h>
- #include <asm-generic/bitops/non-atomic.h>
- #include <asm-generic/bitops/le.h>
- #include <asm-generic/bitops/ext2-atomic.h>
- #endif
- #endif
|