byteorder.h 830 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef _ASM_IA64_BYTEORDER_H
  2. #define _ASM_IA64_BYTEORDER_H
  3. /*
  4. * Modified 1998, 1999
  5. * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
  6. */
  7. #include <asm/types.h>
  8. #include <asm/intrinsics.h>
  9. #include <linux/compiler.h>
  10. static __inline__ __attribute_const__ __u64
  11. __ia64_swab64 (__u64 x)
  12. {
  13. __u64 result;
  14. result = ia64_mux1(x, ia64_mux1_rev);
  15. return result;
  16. }
  17. static __inline__ __attribute_const__ __u32
  18. __ia64_swab32 (__u32 x)
  19. {
  20. return __ia64_swab64(x) >> 32;
  21. }
  22. static __inline__ __attribute_const__ __u16
  23. __ia64_swab16(__u16 x)
  24. {
  25. return __ia64_swab64(x) >> 48;
  26. }
  27. #define __arch__swab64(x) __ia64_swab64(x)
  28. #define __arch__swab32(x) __ia64_swab32(x)
  29. #define __arch__swab16(x) __ia64_swab16(x)
  30. #define __BYTEORDER_HAS_U64__
  31. #include <linux/byteorder/little_endian.h>
  32. #endif /* _ASM_IA64_BYTEORDER_H */