bitops.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* asm/bitops.h for Linux/CRIS
  2. *
  3. * TODO: asm versions if speed is needed
  4. *
  5. * All bit operations return 0 if the bit was cleared before the
  6. * operation and != 0 if it was not.
  7. *
  8. * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
  9. */
  10. #ifndef _CRIS_BITOPS_H
  11. #define _CRIS_BITOPS_H
  12. /* Currently this is unsuitable for consumption outside the kernel. */
  13. #ifdef __KERNEL__
  14. #ifndef _LINUX_BITOPS_H
  15. #error only <linux/bitops.h> can be included directly
  16. #endif
  17. #include <arch/bitops.h>
  18. #include <linux/compiler.h>
  19. #include <asm/barrier.h>
  20. #include <asm-generic/bitops/atomic.h>
  21. #include <asm-generic/bitops/non-atomic.h>
  22. /*
  23. * Since we define it "external", it collides with the built-in
  24. * definition, which doesn't have the same semantics. We don't want to
  25. * use -fno-builtin, so just hide the name ffs.
  26. */
  27. #define ffs(x) kernel_ffs(x)
  28. #include <asm-generic/bitops/fls.h>
  29. #include <asm-generic/bitops/__fls.h>
  30. #include <asm-generic/bitops/fls64.h>
  31. #include <asm-generic/bitops/hweight.h>
  32. #include <asm-generic/bitops/find.h>
  33. #include <asm-generic/bitops/lock.h>
  34. #include <asm-generic/bitops/le.h>
  35. #include <asm-generic/bitops/ext2-atomic-setbit.h>
  36. #include <asm-generic/bitops/sched.h>
  37. #endif /* __KERNEL__ */
  38. #endif /* _CRIS_BITOPS_H */