Skip to content

Commit

Permalink
powerpc: Make unaligned accesses endian-safe for powerpc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rajesh B Prathipati authored and Benjamin Herrenschmidt committed Dec 30, 2013
1 parent 90ff5d6 commit e8a00ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/powerpc/include/asm/unaligned.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit e8a00ad

Please sign in to comment.