Commit e8a00ad5 authored by Rajesh B Prathipati's avatar Rajesh B Prathipati Committed by Benjamin Herrenschmidt

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: default avatarRajesh B Prathipati <rprathip@linux.vnet.ibm.com>
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 90ff5d68
...@@ -4,13 +4,18 @@ ...@@ -4,13 +4,18 @@
#ifdef __KERNEL__ #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/access_ok.h>
#include <linux/unaligned/generic.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 get_unaligned __get_unaligned_be
#define put_unaligned __put_unaligned_be #define put_unaligned __put_unaligned_be
#endif
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_UNALIGNED_H */ #endif /* _ASM_POWERPC_UNALIGNED_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment