bitops_64.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * bitops.h: Bit string operations on the V9.
  3. *
  4. * Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
  5. */
  6. #ifndef _SPARC64_BITOPS_H
  7. #define _SPARC64_BITOPS_H
  8. #ifndef _LINUX_BITOPS_H
  9. #error only <linux/bitops.h> can be included directly
  10. #endif
  11. #include <linux/compiler.h>
  12. #include <asm/byteorder.h>
  13. #include <asm/barrier.h>
  14. int test_and_set_bit(unsigned long nr, volatile unsigned long *addr);
  15. int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr);
  16. int test_and_change_bit(unsigned long nr, volatile unsigned long *addr);
  17. void set_bit(unsigned long nr, volatile unsigned long *addr);
  18. void clear_bit(unsigned long nr, volatile unsigned long *addr);
  19. void change_bit(unsigned long nr, volatile unsigned long *addr);
  20. #include <asm-generic/bitops/non-atomic.h>
  21. #include <asm-generic/bitops/fls.h>
  22. #include <asm-generic/bitops/__fls.h>
  23. #include <asm-generic/bitops/fls64.h>
  24. #ifdef __KERNEL__
  25. int ffs(int x);
  26. unsigned long __ffs(unsigned long);
  27. #include <asm-generic/bitops/ffz.h>
  28. #include <asm-generic/bitops/sched.h>
  29. /*
  30. * hweightN: returns the hamming weight (i.e. the number
  31. * of bits set) of a N-bit word
  32. */
  33. unsigned long __arch_hweight64(__u64 w);
  34. unsigned int __arch_hweight32(unsigned int w);
  35. unsigned int __arch_hweight16(unsigned int w);
  36. unsigned int __arch_hweight8(unsigned int w);
  37. #include <asm-generic/bitops/const_hweight.h>
  38. #include <asm-generic/bitops/lock.h>
  39. #endif /* __KERNEL__ */
  40. #include <asm-generic/bitops/find.h>
  41. #ifdef __KERNEL__
  42. #include <asm-generic/bitops/le.h>
  43. #include <asm-generic/bitops/ext2-atomic-setbit.h>
  44. #endif /* __KERNEL__ */
  45. #endif /* defined(_SPARC64_BITOPS_H) */