@@ -1,9 +1,7 @@
#ifndef __ASM_ARM_BYTEORDER_H__
#define __ASM_ARM_BYTEORDER_H__
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
#endif /* __ASM_ARM_BYTEORDER_H__ */
/*
@@ -1,12 +1,6 @@
#ifndef _ASM_PPC_BYTEORDER_H
#define _ASM_PPC_BYTEORDER_H
-#define __arch__swab16 __builtin_bswap16
-#define __arch__swab32 __builtin_bswap32
-#define __arch__swab64 __builtin_bswap64
-
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
#endif /* _ASM_PPC_BYTEORDER_H */
@@ -1,9 +1,7 @@
#ifndef ASM__RISCV__BYTEORDER_H
#define ASM__RISCV__BYTEORDER_H
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
#endif /* ASM__RISCV__BYTEORDER_H */
/*
@@ -1,29 +1,6 @@
#ifndef __ASM_X86_BYTEORDER_H__
#define __ASM_X86_BYTEORDER_H__
-#include <xen/types.h>
-#include <xen/compiler.h>
-
-static inline attr_const uint32_t ___arch__swab32(uint32_t x)
-{
- asm("bswap %0" : "=r" (x) : "0" (x));
- return x;
-}
-
-static inline attr_const uint64_t ___arch__swab64(uint64_t x)
-{
- asm ( "bswap %0" : "+r" (x) );
- return x;
-}
-
-/* Do not define swab16. Gcc is smart enough to recognize "C" version and
- convert it into rotation or exhange. */
-
-#define __arch__swab64(x) ___arch__swab64(x)
-#define __arch__swab32(x) ___arch__swab32(x)
-
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
#endif /* __ASM_X86_BYTEORDER_H__ */
@@ -31,9 +31,9 @@
printk(fmt, ## args )
#define strtoull(str, end, base) simple_strtoull(str, end, base)
-#define bswap_16(x) swab16(x)
-#define bswap_32(x) swab32(x)
-#define bswap_64(x) swab64(x)
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
#else /* !__XEN__ */