summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRajesh B Prathipati <rprathip@linux.vnet.ibm.com>2013-12-16 08:58:22 +0100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-12-30 04:02:29 +0100
commite8a00ad5e238421ded856ea39f692b94c2d324eb (patch)
tree684f467c9e0d047c6d251a903862613fe39c2815 /arch
parentpowerpc: Fix bad stack check in exception entry (diff)
downloadlinux-e8a00ad5e238421ded856ea39f692b94c2d324eb.tar.xz
linux-e8a00ad5e238421ded856ea39f692b94c2d324eb.zip
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 @@
#ifdef __KERNEL__
/*
- * The PowerPC can do unaligned accesses itself in big endian mode.
+ * The PowerPC can do unaligned accesses itself based on its endian mode.
*/
#include <linux/unaligned/access_ok.h>
#include <linux/unaligned/generic.h>
+#ifdef __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 /* __KERNEL__ */
#endif /* _ASM_POWERPC_UNALIGNED_H */