aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRajesh B Prathipati <rprathip@linux.vnet.ibm.com>2013-12-16 02:58:22 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-12-29 22:02:29 -0500
commite8a00ad5e238421ded856ea39f692b94c2d324eb (patch)
tree684f467c9e0d047c6d251a903862613fe39c2815 /arch
parent90ff5d688e61f49f23545ffab6228bd7e87e6dc7 (diff)
powerpc: Make unaligned accesses endian-safe for powerpc
The generic put_unaligned/get_unaligned macros were made endian-safe by calling the appropriate endian dependent macros based on the endian type of the powerpc processor. Signed-off-by: Rajesh B Prathipati <rprathip@linux.vnet.ibm.com> Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/unaligned.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/unaligned.h b/arch/powerpc/include/asm/unaligned.h
index 5f1b1e3c2137..8296381ae432 100644
--- a/arch/powerpc/include/asm/unaligned.h
+++ b/arch/powerpc/include/asm/unaligned.h
@@ -4,13 +4,18 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6/* 6/*
7 * The PowerPC can do unaligned accesses itself in big endian mode. 7 * The PowerPC can do unaligned accesses itself based on its endian mode.
8 */ 8 */
9#include <linux/unaligned/access_ok.h> 9#include <linux/unaligned/access_ok.h>
10#include <linux/unaligned/generic.h> 10#include <linux/unaligned/generic.h>
11 11
12#ifdef __LITTLE_ENDIAN__
13#define get_unaligned __get_unaligned_le
14#define put_unaligned __put_unaligned_le
15#else
12#define get_unaligned __get_unaligned_be 16#define get_unaligned __get_unaligned_be
13#define put_unaligned __put_unaligned_be 17#define put_unaligned __put_unaligned_be
18#endif
14 19
15#endif /* __KERNEL__ */ 20#endif /* __KERNEL__ */
16#endif /* _ASM_POWERPC_UNALIGNED_H */ 21#endif /* _ASM_POWERPC_UNALIGNED_H */