From 72eceef67abbe596a4e93ee79e08d9e6c35430ae Mon Sep 17 00:00:00 2001 From: Philippe Bergheaud Date: Mon, 2 Dec 2013 10:10:12 +0100 Subject: [PATCH] powerpc: Fix xmon disassembler for little-endian This patch fixes the disassembler of the powerpc kernel debugger xmon, for little-endian. Signed-off-by: Philippe Bergheaud Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/xmon/xmon.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index b07909850f77..08504e75b2c7 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -171,7 +171,11 @@ extern void xmon_leave(void); #define REG "%.8lx" #endif +#ifdef __LITTLE_ENDIAN__ +#define GETWORD(v) (((v)[3] << 24) + ((v)[2] << 16) + ((v)[1] << 8) + (v)[0]) +#else #define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3]) +#endif #define isxdigit(c) (('0' <= (c) && (c) <= '9') \ || ('a' <= (c) && (c) <= 'f') \ -- 2.20.1