mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] Add unaligned.h to sandbox arch
@ 2012-02-27 17:14 Lars Poeschel
  2012-02-27 18:56 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Lars Poeschel @ 2012-02-27 17:14 UTC (permalink / raw)
  To: barebox; +Cc: Lars Poeschel

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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] Add unaligned.h to sandbox arch
  2012-02-27 17:14 [PATCH] Add unaligned.h to sandbox arch Lars Poeschel
@ 2012-02-27 18:56 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2012-02-27 18:56 UTC (permalink / raw)
  To: Lars Poeschel; +Cc: barebox

On Mon, Feb 27, 2012 at 06:14:28PM +0100, Lars Poeschel wrote:
> 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@kiwigrid.com>

Applied, thanks

  Sascha

> ---
>  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
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-02-27 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27 17:14 [PATCH] Add unaligned.h to sandbox arch Lars Poeschel
2012-02-27 18:56 ` Sascha Hauer

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