[PATCH] Add unaligned.h to sandbox arch
Lars Poeschel
lars at kiwigrid.com
Mon Feb 27 12:14:28 EST 2012
To be able to use the sandbox with fat filesystem support unaligned.h is needed.
It tries to be general in selecting little endian or big endian on a gcc macro.
Signed-off-by: Lars Poeschel <lars at kiwigrid.com>
---
arch/sandbox/include/asm/unaligned.h | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
create mode 100644 arch/sandbox/include/asm/unaligned.h
diff --git a/arch/sandbox/include/asm/unaligned.h b/arch/sandbox/include/asm/unaligned.h
new file mode 100644
index 0000000..07c1ae4
--- /dev/null
+++ b/arch/sandbox/include/asm/unaligned.h
@@ -0,0 +1,19 @@
+#ifndef _ASM_SANDBOX_UNALIGNED_H
+#define _ASM_SANDBOX_UNALIGNED_H
+
+/*
+ * The architecture sandbox is compiled on can do unaligned accesses itself.
+ */
+
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define get_unaligned __get_unaligned_le
+#define put_unaligned __put_unaligned_le
+#else
+#define get_unaligned __get_unaligned_be
+#define put_unaligned __put_unaligned_be
+#endif
+
+#endif /* _ASM_SANDBOX_UNALIGNED_H */
--
1.7.5.4
More information about the barebox
mailing list