#include <linux/unistd.h>
#include <linux/raw.h>
#include <linux/major.h>
+#include <endian.h>
#include "indirect.h"
#include "binject.h"
#define FIO_MADV_FREE MADV_REMOVE
#endif
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define FIO_LITTLE_ENDIAN
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define FIO_BIG_ENDIAN
+#else
+#error "Unknown endianness"
+#endif
+
+#define fio_swap16(x) __bswap_16(x)
+#define fio_swap32(x) __bswap_32(x)
+#define fio_swap64(x) __bswap_64(x)
+
#define CACHE_LINE_FILE \
"/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size"