public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] asm-generic/unaligned.h: dynamic default unaligned accesses
@ 2010-01-21 10:01 Mike Frysinger
  2010-01-21 10:01 ` [U-Boot] [PATCH 2/3] asm-blackfin/unaligned.h: add for zlib code Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mike Frysinger @ 2010-01-21 10:01 UTC (permalink / raw)
  To: u-boot

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>
---
 include/asm-generic/unaligned.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-generic/unaligned.h

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
-- 
1.6.6

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-03-13 23:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-21 10:01 [U-Boot] [PATCH 1/3] asm-generic/unaligned.h: dynamic default unaligned accesses Mike Frysinger
2010-01-21 10:01 ` [U-Boot] [PATCH 2/3] asm-blackfin/unaligned.h: add for zlib code Mike Frysinger
2010-03-13 23:11   ` Wolfgang Denk
2010-01-21 10:01 ` [U-Boot] [PATCH 3/3] asm-arm/unaligned.h: switch to asm-generic/unaligned.h Mike Frysinger
2010-01-24  1:18   ` Tom
2010-01-24  1:42     ` Mike Frysinger
2010-01-24 16:07       ` Tom
2010-01-24 18:23         ` Mike Frysinger
2010-03-13 23:10 ` [U-Boot] [PATCH 1/3] asm-generic/unaligned.h: dynamic default unaligned accesses Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox