Skip to content

Commit

Permalink
powerpc: Fix xmon disassembler for little-endian
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Philippe Bergheaud authored and Benjamin Herrenschmidt committed Mar 7, 2014
1 parent 10862a0 commit 72eceef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/xmon/xmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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') \
Expand Down

0 comments on commit 72eceef

Please sign in to comment.