summaryrefslogtreecommitdiff
path: root/include/u-boot/unaligned.h
diff options
context:
space:
mode:
authorKevin2014-12-18 21:57:06 +0800
committerKevin2014-12-18 21:57:06 +0800
commite54b8c0ec3056bf37d5cc36f0954e165a88565f7 (patch)
treef4e2c1552f8f22302c4f609795f6e1e6b02ab74d /include/u-boot/unaligned.h
parentd04075478d378d9e15f3e1abfd14b0bd124077d4 (diff)
downloadFOSSEE-netbook-uboot-source-master.tar.gz
FOSSEE-netbook-uboot-source-master.tar.bz2
FOSSEE-netbook-uboot-source-master.zip
add allHEADmaster
Diffstat (limited to 'include/u-boot/unaligned.h')
-rwxr-xr-xinclude/u-boot/unaligned.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/u-boot/unaligned.h b/include/u-boot/unaligned.h
new file mode 100755
index 0000000..fd02550
--- /dev/null
+++ b/include/u-boot/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