[16/18] powerpc: Fix endianness issues in alignment handler

Submitted by Ian Munsie on Oct. 1, 2010, 7:06 a.m.


Message ID 1285916771-18033-17-git-send-email-imunsie@au1.ibm.com
State Superseded
Headers show

Commit Message

Ian Munsie Oct. 1, 2010, 7:06 a.m.
From: Ian Munsie <imunsie@au1.ibm.com>

This patch reverses the order of the high and low bits in the alignment
handler on little endian, which should be enough to fix any alignment

Please note that this patch is largely untested.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
 arch/powerpc/kernel/align.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 8184ee9..fc357c6 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -712,12 +712,22 @@  int fix_alignment(struct pt_regs *regs)
 		double dd;
 		unsigned char v[8];
 		struct {
+#ifdef __LITTLE_ENDIAN__
+			int	 low32;
+			unsigned hi32;
 			unsigned hi32;
 			int	 low32;
 		} x32;
 		struct {
+#ifdef __LITTLE_ENDIAN__
+			short	      low16;
+			unsigned char hi48[6];
 			unsigned char hi48[6];
 			short	      low16;
 		} x16;
 	} data;