From 3adc1fda38a6aacd4aaf3c2c9cc62a1e69e6de17 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 21 Jan 2010 05:01:14 -0500 Subject: [PATCH] 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 --- include/asm-generic/unaligned.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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 0000000000..fd0255099a --- /dev/null +++ b/include/asm-generic/unaligned.h @@ -0,0 +1,23 @@ +#ifndef _GENERIC_UNALIGNED_H +#define _GENERIC_UNALIGNED_H + +#include + +#include +#include +#include + +/* + * 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 -- 2.39.5