Commit 8dd588a8 authored by David S. Miller's avatar David S. Miller

[SPARC]: Update for show_stack() changes.

parent 9641920a
......@@ -287,17 +287,14 @@ void show_regs(struct pt_regs *r)
rw->ins[4], rw->ins[5], rw->ins[6], rw->ins[7]);
}
void show_trace_task(struct task_struct *tsk)
void show_stack(struct task_struct *tsk, unsigned long *_ksp)
{
unsigned long pc, fp;
unsigned long task_base = (unsigned long) tsk;
struct reg_window *rw;
int count = 0;
if (!tsk)
return;
fp = tsk->thread_info->ksp;
fp = (unsigned long) _ksp;
do {
/* Bogus frame pointer? */
if (fp < (task_base + sizeof(struct task_struct)) ||
......@@ -311,6 +308,13 @@ void show_trace_task(struct task_struct *tsk)
printk("\n");
}
void show_trace_task(struct task_struct *tsk)
{
if (tsk)
show_stack(tsk,
(unsigned long *) tsk->thread_info->ksp);
}
/*
* Note: sparc64 has a pretty intricated thread_saved_pc, check it out.
*/
......
......@@ -1569,12 +1569,15 @@ void user_instruction_dump (unsigned int *pc)
printk("\n");
}
void show_trace_raw(struct thread_info *tp, unsigned long ksp)
void show_stack(struct task_struct *tsk, unsigned long *_ksp)
{
unsigned long pc, fp, thread_base;
unsigned long pc, fp, thread_base, ksp;
struct thread_info *tp = tsk->thread_info;
struct reg_window *rw;
int count = 0;
ksp = (unsigned long) _ksp;
if (tp == current_thread_info())
flushw_all();
......@@ -1596,17 +1599,17 @@ void show_trace_raw(struct thread_info *tp, unsigned long ksp)
void show_trace_task(struct task_struct *tsk)
{
if (tsk)
show_trace_raw(tsk->thread_info,
tsk->thread_info->ksp);
show_stack(tsk,
(unsigned long *) tsk->thread_info->ksp);
}
void dump_stack(void)
{
unsigned long ksp;
unsigned long *ksp;
__asm__ __volatile__("mov %%fp, %0"
: "=r" (ksp));
show_trace_raw(current_thread_info(), ksp);
show_stack(current, ksp);
}
void die_if_kernel(char *str, struct pt_regs *regs)
......
......@@ -149,16 +149,14 @@ static void unhandled_fault(unsigned long address, struct task_struct *tsk,
die_if_kernel("Oops", regs);
}
extern void show_trace_raw(struct thread_info *, unsigned long);
static void bad_kernel_pc(struct pt_regs *regs)
{
unsigned long ksp;
unsigned long *ksp;
printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
regs->tpc);
__asm__("mov %%sp, %0" : "=r" (ksp));
show_trace_raw(current_thread_info(), ksp);
show_stack(current, ksp);
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