summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorPhilippe Bergheaud <felix@linux.vnet.ibm.com>2013-12-02 09:10:12 (GMT)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-03-07 04:50:12 (GMT)
commit72eceef67abbe596a4e93ee79e08d9e6c35430ae (patch)
treef497634349a62dbf23228edfd67afdc9876dc868 /arch/powerpc
parent10862a0c71bff5c7b88812d6a9a9c0be56bc659a (diff)
downloadlinux-72eceef67abbe596a4e93ee79e08d9e6c35430ae.tar.xz
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 <felix@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/xmon/xmon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index b079098..08504e7 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') \