aboutsummaryrefslogtreecommitdiffstats
path: root/roms/u-boot/include/asm-generic/unaligned.h
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/include/asm-generic/unaligned.h
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/include/asm-generic/unaligned.h')
-rw-r--r--roms/u-boot/include/asm-generic/unaligned.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/roms/u-boot/include/asm-generic/unaligned.h b/roms/u-boot/include/asm-generic/unaligned.h
new file mode 100644
index 000000000..3d33a5a06
--- /dev/null
+++ b/roms/u-boot/include/asm-generic/unaligned.h
@@ -0,0 +1,26 @@
+#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
+
+/* Allow unaligned memory access */
+void allow_unaligned(void);
+
+#endif