diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2012-10-09 00:20:35 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-11-14 20:59:55 -0500 |
commit | c4de38093ed9fe94fa35c3adb14afc40bf05e1da (patch) | |
tree | 3c54609889d9cf87e5ea00c1374a787f07c7c89c /arch/powerpc/xmon | |
parent | c5c5714d5093e677ec962921210eae14156f7179 (diff) |
powerpc/xmon: Use STACK_FRAME_OVERHEAD in xmon_show_stack()
We use STACK_FRAME_OVERHEAD in the exception vectors to establish
the exception frame, so it should be good enough to use here.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/xmon')
-rw-r--r-- | arch/powerpc/xmon/xmon.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index abf6be446356..d940234b09ec 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -1286,12 +1286,6 @@ static int xmon_depth_to_print = 64; | |||
1286 | #define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long)) | 1286 | #define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long)) |
1287 | #define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long)) | 1287 | #define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long)) |
1288 | 1288 | ||
1289 | #ifdef __powerpc64__ | ||
1290 | #define REGS_OFFSET 0x70 | ||
1291 | #else | ||
1292 | #define REGS_OFFSET 16 | ||
1293 | #endif | ||
1294 | |||
1295 | static void xmon_show_stack(unsigned long sp, unsigned long lr, | 1289 | static void xmon_show_stack(unsigned long sp, unsigned long lr, |
1296 | unsigned long pc) | 1290 | unsigned long pc) |
1297 | { | 1291 | { |
@@ -1355,10 +1349,10 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr, | |||
1355 | an exception frame. */ | 1349 | an exception frame. */ |
1356 | if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long)) | 1350 | if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long)) |
1357 | && marker == STACK_FRAME_REGS_MARKER) { | 1351 | && marker == STACK_FRAME_REGS_MARKER) { |
1358 | if (mread(sp + REGS_OFFSET, ®s, sizeof(regs)) | 1352 | if (mread(sp + STACK_FRAME_OVERHEAD, ®s, sizeof(regs)) |
1359 | != sizeof(regs)) { | 1353 | != sizeof(regs)) { |
1360 | printf("Couldn't read registers at %lx\n", | 1354 | printf("Couldn't read registers at %lx\n", |
1361 | sp + REGS_OFFSET); | 1355 | sp + STACK_FRAME_OVERHEAD); |
1362 | break; | 1356 | break; |
1363 | } | 1357 | } |
1364 | printf("--- Exception: %lx %s at ", regs.trap, | 1358 | printf("--- Exception: %lx %s at ", regs.trap, |