Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144919
b: refs/heads/master
c: 586411d
h: refs/heads/master
i:
  144917: 92e3732
  144915: 356ec68
  144911: f181663
v: v3
  • Loading branch information
Johannes Weiner authored and Chris Zankel committed May 12, 2009
1 parent 775e49c commit 3ad5319
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 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: 7dbe5c542464a511f0ea6a14e3ff08874d7e21d5
refs/heads/master: 586411dcd1935f91796d5e8a29aa3cfdf01a01f4
16 changes: 14 additions & 2 deletions trunk/arch/xtensa/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,18 @@ void show_regs(struct pt_regs * regs)
regs->syscall);
}

static __always_inline unsigned long *stack_pointer(struct task_struct *task)
{
unsigned long *sp;

if (!task || task == current)
__asm__ __volatile__ ("mov %0, a1\n" : "=a"(sp));
else
sp = (unsigned long *)task->thread.sp;

return sp;
}

void show_trace(struct task_struct *task, unsigned long *sp)
{
unsigned long a0, a1, pc;
Expand All @@ -377,7 +389,7 @@ void show_trace(struct task_struct *task, unsigned long *sp)
if (sp)
a1 = (unsigned long)sp;
else
a1 = task->thread.sp;
a1 = (unsigned long)stack_pointer(task);

sp_start = a1 & ~(THREAD_SIZE-1);
sp_end = sp_start + THREAD_SIZE;
Expand Down Expand Up @@ -420,7 +432,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
unsigned long *stack;

if (!sp)
sp = (unsigned long *)task->thread.sp;
sp = stack_pointer(task);
stack = sp;

printk("\nStack: ");
Expand Down

0 comments on commit 3ad5319

Please sign in to comment.