summaryrefslogtreecommitdiff
path: root/include/asm-generic/unaligned.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-01-21 05:01:14 -0500
committerWolfgang Denk <wd@denx.de>2010-03-14 00:10:09 +0100
commit3adc1fda38a6aacd4aaf3c2c9cc62a1e69e6de17 (patch)
tree8e62fbaf21b73fcf094beadcc65f9ef9edbca5cb /include/asm-generic/unaligned.h
parent93910edb595a88d394da3eb2cf5148096155dfe9 (diff)
downloadu-boot-imx-3adc1fda38a6aacd4aaf3c2c9cc62a1e69e6de17.zip
u-boot-imx-3adc1fda38a6aacd4aaf3c2c9cc62a1e69e6de17.tar.gz
u-boot-imx-3adc1fda38a6aacd4aaf3c2c9cc62a1e69e6de17.tar.bz2
asm-generic/unaligned.h: dynamic default unaligned accesses
This is based on the asm-arm/unaligned.h, but made generic so all arches that cannot do unaligned accesses can utilize it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'include/asm-generic/unaligned.h')
-rw-r--r--include/asm-generic/unaligned.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h
new file mode 100644
index 0000000..fd02550
--- /dev/null
+++ b/include/asm-generic/unaligned.h
@@ -0,0 +1,23 @@
+#ifndef _GENERIC_UNALIGNED_H
+#define _GENERIC_UNALIGNED_H
+
+#include <asm/byteorder.h>
+
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+/*
+ * Select endianness
+ */
+#if defined(__LITTLE_ENDIAN)
+#define get_unaligned __get_unaligned_le
+#define put_unaligned __put_unaligned_le
+#elif defined(__BIG_ENDIAN)
+#define get_unaligned __get_unaligned_be
+#define put_unaligned __put_unaligned_be
+#else
+#error invalid endian
+#endif
+
+#endif