diff options
author | David S. Miller <davem@davemloft.net> | 2008-05-21 21:15:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-21 21:15:53 -0400 |
commit | 14d2c68baa659cfd15dc782dd229ea304330c4f6 (patch) | |
tree | 73e9b2e3a5496333d41bf85894b0b0cfa779ad34 /arch/sparc64/kernel/traps.c | |
parent | a051bc5bb1ac6dc138d529077fa20cbbc6622d95 (diff) |
sparc64: Fix stack tracing through trap frames.
The offset to the pt_regs area was wrong, so we weren't
looking at the right location for the magic cookie.
A trap frame is composed of a "struct sparc_stackf" then
a "struct pt_regs", the code was using "struct reg_window"
instead of "struct sparc_stackf".
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/traps.c')
-rw-r--r-- | arch/sparc64/kernel/traps.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index d9b8d46707d1..369749262653 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -2116,7 +2116,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2116 | printk("\n"); | 2116 | printk("\n"); |
2117 | #endif | 2117 | #endif |
2118 | do { | 2118 | do { |
2119 | struct reg_window *rw; | 2119 | struct sparc_stackf *sf; |
2120 | struct pt_regs *regs; | 2120 | struct pt_regs *regs; |
2121 | unsigned long pc; | 2121 | unsigned long pc; |
2122 | 2122 | ||
@@ -2124,15 +2124,17 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2124 | if (fp < (thread_base + sizeof(struct thread_info)) || | 2124 | if (fp < (thread_base + sizeof(struct thread_info)) || |
2125 | fp >= (thread_base + THREAD_SIZE)) | 2125 | fp >= (thread_base + THREAD_SIZE)) |
2126 | break; | 2126 | break; |
2127 | rw = (struct reg_window *)fp; | 2127 | sf = (struct sparc_stackf *) fp; |
2128 | regs = (struct pt_regs *) (rw + 1); | 2128 | regs = (struct pt_regs *) (sf + 1); |
2129 | 2129 | ||
2130 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { | 2130 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { |
2131 | if (!(regs->tstate & TSTATE_PRIV)) | ||
2132 | break; | ||
2131 | pc = regs->tpc; | 2133 | pc = regs->tpc; |
2132 | fp = regs->u_regs[UREG_I6] + STACK_BIAS; | 2134 | fp = regs->u_regs[UREG_I6] + STACK_BIAS; |
2133 | } else { | 2135 | } else { |
2134 | pc = rw->ins[7]; | 2136 | pc = sf->callers_pc; |
2135 | fp = rw->ins[6] + STACK_BIAS; | 2137 | fp = (unsigned long)sf->fp + STACK_BIAS; |
2136 | } | 2138 | } |
2137 | 2139 | ||
2138 | printk(" [%016lx] ", pc); | 2140 | printk(" [%016lx] ", pc); |