Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97171
b: refs/heads/master
c: 14d2c68
h: refs/heads/master
i:
  97169: 55f37f2
  97167: 3c16b06
v: v3
  • Loading branch information
David S. Miller committed May 22, 2008
1 parent 6900ebd commit af66ff1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a051bc5bb1ac6dc138d529077fa20cbbc6622d95
refs/heads/master: 14d2c68baa659cfd15dc782dd229ea304330c4f6
12 changes: 7 additions & 5 deletions trunk/arch/sparc64/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down
12 changes: 7 additions & 5 deletions trunk/arch/sparc64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2116,23 +2116,25 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
printk("\n");
#endif
do {
struct reg_window *rw;
struct sparc_stackf *sf;
struct pt_regs *regs;
unsigned long pc;

/* Bogus frame pointer? */
if (fp < (thread_base + sizeof(struct thread_info)) ||
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;
}

printk(" [%016lx] ", pc);
Expand Down

0 comments on commit af66ff1

Please sign in to comment.