summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajesh B Prathipati <rprathip@linux.vnet.ibm.com>2013-12-16 18:58:22 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-12-30 14:02:29 +1100
commite8a00ad5e238421ded856ea39f692b94c2d324eb (patch)
tree684f467c9e0d047c6d251a903862613fe39c2815
parent90ff5d688e61f49f23545ffab6228bd7e87e6dc7 (diff)
downloadlwn-e8a00ad5e238421ded856ea39f692b94c2d324eb.tar.gz
lwn-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>
-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 */