swab.h 781 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _ASM_IA64_SWAB_H
  3. #define _ASM_IA64_SWAB_H
  4. /*
  5. * Modified 1998, 1999
  6. * David Mosberger-Tang <[email protected]>, Hewlett-Packard Co.
  7. */
  8. #include <linux/types.h>
  9. #include <asm/intrinsics.h>
  10. #include <linux/compiler.h>
  11. static __inline__ __attribute_const__ __u64 __arch_swab64(__u64 x)
  12. {
  13. __u64 result;
  14. result = ia64_mux1(x, ia64_mux1_rev);
  15. return result;
  16. }
  17. #define __arch_swab64 __arch_swab64
  18. static __inline__ __attribute_const__ __u32 __arch_swab32(__u32 x)
  19. {
  20. return __arch_swab64(x) >> 32;
  21. }
  22. #define __arch_swab32 __arch_swab32
  23. static __inline__ __attribute_const__ __u16 __arch_swab16(__u16 x)
  24. {
  25. return __arch_swab64(x) >> 48;
  26. }
  27. #define __arch_swab16 __arch_swab16
  28. #endif /* _ASM_IA64_SWAB_H */