projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move endianness check to OS parts
[fio.git]
/
os
/
os-linux.h
diff --git
a/os/os-linux.h
b/os/os-linux.h
index a36552ba68ba93caf6ca58e5fc9761fc53c0b88d..8d3b97ea1f04015af100c990aba4d50914f99df9 100644
(file)
--- a/
os/os-linux.h
+++ b/
os/os-linux.h
@@
-12,6
+12,7
@@
#include <linux/unistd.h>
#include <linux/raw.h>
#include <linux/major.h>
#include <linux/unistd.h>
#include <linux/raw.h>
#include <linux/major.h>
+#include <endian.h>
#include "indirect.h"
#include "binject.h"
#include "indirect.h"
#include "binject.h"
@@
-286,6
+287,14
@@
static inline int fio_lookup_raw(dev_t dev, int *majdev, int *mindev)
#define FIO_MADV_FREE MADV_REMOVE
#endif
#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 CACHE_LINE_FILE \
"/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size"
#define CACHE_LINE_FILE \
"/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size"