summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/stacktrace.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-21 18:15:53 -0700
committerDavid S. Miller <davem@davemloft.net>2008-05-21 18:15:53 -0700
commit14d2c68baa659cfd15dc782dd229ea304330c4f6 (patch)
tree73e9b2e3a5496333d41bf85894b0b0cfa779ad34 /arch/sparc64/kernel/stacktrace.c
parenta051bc5bb1ac6dc138d529077fa20cbbc6622d95 (diff)
downloadblackbird-op-linux-14d2c68baa659cfd15dc782dd229ea304330c4f6.tar.gz
blackbird-op-linux-14d2c68baa659cfd15dc782dd229ea304330c4f6.zip
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/stacktrace.c')
-rw-r--r--arch/sparc64/kernel/stacktrace.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/stacktrace.c b/arch/sparc64/kernel/stacktrace.c
index 01b52f561af4..c73ce3f4197e 100644
--- a/arch/sparc64/kernel/stacktrace.c
+++ b/arch/sparc64/kernel/stacktrace.c
@@ -19,7 +19,7 @@ void save_stack_trace(struct stack_trace *trace)
fp = ksp + STACK_BIAS;
thread_base = (unsigned long) tp;
do {
- struct reg_window *rw;
+ struct sparc_stackf *sf;
struct pt_regs *regs;
unsigned long pc;
@@ -28,15 +28,17 @@ void save_stack_trace(struct stack_trace *trace)
fp >= (thread_base + THREAD_SIZE))
break;
- rw = (struct reg_window *) fp;
- regs = (struct pt_regs *) (rw + 1);
+ sf = (struct sparc_stackf *) fp;
+ regs = (struct pt_regs *) (sf + 1);
if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) {
+ if (!(regs->tstate & TSTATE_PRIV))
+ break;
pc = regs->tpc;
fp = regs->u_regs[UREG_I6] + STACK_BIAS;
} else {
- pc = rw->ins[7];
- fp = rw->ins[6] + STACK_BIAS;
+ pc = sf->callers_pc;
+ fp = (unsigned long)sf->fp + STACK_BIAS;
}
if (trace->skip > 0)
OpenPOWER on IntegriCloud