Commit a52dfa53 authored by David S. Miller's avatar David S. Miller Committed by Adrian Bunk

[SPARC64]: Fix show_stack() when stack argument is NULL.

It didn't handle that case at all, and now dump_stack()
can be implemented directly as show_stack(current, NULL)
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
parent 4c94bf7f
......@@ -1808,12 +1808,20 @@ static void user_instruction_dump (unsigned int __user *pc)
void show_stack(struct task_struct *tsk, unsigned long *_ksp)
{
unsigned long pc, fp, thread_base, ksp;
void *tp = task_stack_page(tsk);
struct thread_info *tp;
struct reg_window *rw;
int count = 0;
ksp = (unsigned long) _ksp;
if (!tsk)
tsk = current;
tp = task_thread_info(tsk);
if (ksp == 0UL) {
if (tsk == current)
asm("mov %%fp, %0" : "=r" (ksp));
else
ksp = tp->ksp;
}
if (tp == current_thread_info())
flushw_all();
......@@ -1842,11 +1850,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
void dump_stack(void)
{
unsigned long *ksp;
__asm__ __volatile__("mov %%fp, %0"
: "=r" (ksp));
show_stack(current, ksp);
show_stack(current, NULL);
}
EXPORT_SYMBOL(dump_stack);
......
......@@ -93,12 +93,9 @@ static void __kprobes unhandled_fault(unsigned long address,
static void bad_kernel_pc(struct pt_regs *regs)
{
unsigned long *ksp;
printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
regs->tpc);
__asm__("mov %%sp, %0" : "=r" (ksp));
show_stack(current, ksp);
dump_stack();
unhandled_fault(regs->tpc, current, regs);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment