swab.h 718 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _ASM_IA64_SWAB_H
  2. #define _ASM_IA64_SWAB_H
  3. /*
  4. * Modified 1998, 1999
  5. * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
  6. */
  7. #include <linux/types.h>
  8. #include <asm/intrinsics.h>
  9. #include <linux/compiler.h>
  10. static __inline__ __attribute_const__ __u64 __arch_swab64(__u64 x)
  11. {
  12. __u64 result;
  13. result = ia64_mux1(x, ia64_mux1_rev);
  14. return result;
  15. }
  16. #define __arch_swab64 __arch_swab64
  17. static __inline__ __attribute_const__ __u32 __arch_swab32(__u32 x)
  18. {
  19. return __arch_swab64(x) >> 32;
  20. }
  21. #define __arch_swab32 __arch_swab32
  22. static __inline__ __attribute_const__ __u16 __arch_swab16(__u16 x)
  23. {
  24. return __arch_swab64(x) >> 48;
  25. }
  26. #define __arch_swab16 __arch_swab16
  27. #endif /* _ASM_IA64_SWAB_H */