diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-13 17:07:28 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-13 17:07:28 -0700 |
commit | 45d447406a19cbfd42720f066f156f4eb9d68801 (patch) | |
tree | 57a2224dea60dfcc6ff58130230f2ffa48bbe01a /arch/xtensa/kernel/traps.c | |
parent | 210af919c949a7d6bd330916ef376cec2907d81e (diff) | |
parent | 78f3cdfa2ac0aa2b72b3ee7e4b3c3e550230179f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/czankel/xtensa-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/czankel/xtensa-2.6:
xtensa: Fix linker script to include .literal sections
xtensa: update s6105_defconfig for ccount calibration
xtensa: implement ccount calibration for s6000
xtensa: fix wrong extern declaration renamed in code using it
xtensa: register gpio chip before use
xtensa: always use correct stack pointer for stack traces
xtensa: Fix checksum header file
xtensa: Fix architecture specific Kconfig
Diffstat (limited to 'arch/xtensa/kernel/traps.c')
-rw-r--r-- | arch/xtensa/kernel/traps.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index 9f0b71189e9..ba9ab934978 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c @@ -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; @@ -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; @@ -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: "); |