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>
This commit is contained in:
parent
c5c5714d50
commit
c4de38093e
1 changed files with 2 additions and 8 deletions
|
@ -1286,12 +1286,6 @@ static int xmon_depth_to_print = 64;
|
||||||
#define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long))
|
#define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long))
|
||||||
#define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long))
|
#define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long))
|
||||||
|
|
||||||
#ifdef __powerpc64__
|
|
||||||
#define REGS_OFFSET 0x70
|
|
||||||
#else
|
|
||||||
#define REGS_OFFSET 16
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void xmon_show_stack(unsigned long sp, unsigned long lr,
|
static void xmon_show_stack(unsigned long sp, unsigned long lr,
|
||||||
unsigned long pc)
|
unsigned long pc)
|
||||||
{
|
{
|
||||||
|
@ -1355,10 +1349,10 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
|
||||||
an exception frame. */
|
an exception frame. */
|
||||||
if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long))
|
if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long))
|
||||||
&& marker == STACK_FRAME_REGS_MARKER) {
|
&& marker == STACK_FRAME_REGS_MARKER) {
|
||||||
if (mread(sp + REGS_OFFSET, ®s, sizeof(regs))
|
if (mread(sp + STACK_FRAME_OVERHEAD, ®s, sizeof(regs))
|
||||||
!= sizeof(regs)) {
|
!= sizeof(regs)) {
|
||||||
printf("Couldn't read registers at %lx\n",
|
printf("Couldn't read registers at %lx\n",
|
||||||
sp + REGS_OFFSET);
|
sp + STACK_FRAME_OVERHEAD);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
printf("--- Exception: %lx %s at ", regs.trap,
|
printf("--- Exception: %lx %s at ", regs.trap,
|
||||||
|
|
Loading…
Reference in a new issue