Commit 2b7d890c authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Jens Axboe

[PATCH] M68k show_stack() portability and cleanup patch

M68k: show_stack() portability and cleanup patch:
  - Add a task pointer argument to show_stack() and pass NULL as the first
    argument where needed
  - Remove show_trace_task()
parent 6776481a
...@@ -852,11 +852,6 @@ void show_trace(unsigned long *stack) ...@@ -852,11 +852,6 @@ void show_trace(unsigned long *stack)
printk("\n"); printk("\n");
} }
void show_trace_task(struct task_struct *tsk)
{
show_trace((unsigned long *)tsk->thread.esp0);
}
void show_registers(struct pt_regs *regs) void show_registers(struct pt_regs *regs)
{ {
struct frame *fp = (struct frame *)regs; struct frame *fp = (struct frame *)regs;
...@@ -915,7 +910,7 @@ void show_registers(struct pt_regs *regs) ...@@ -915,7 +910,7 @@ void show_registers(struct pt_regs *regs)
default: default:
printk("\n"); printk("\n");
} }
show_stack((unsigned long *)addr); show_stack(NULL, (unsigned long *)addr);
printk("Code: "); printk("Code: ");
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
...@@ -923,13 +918,17 @@ void show_registers(struct pt_regs *regs) ...@@ -923,13 +918,17 @@ void show_registers(struct pt_regs *regs)
printk ("\n"); printk ("\n");
} }
extern void show_stack(unsigned long *stack) extern void show_stack(struct task_struct *task, unsigned long *stack)
{ {
unsigned long *endstack; unsigned long *endstack;
int i; int i;
if (!stack) if (!stack) {
stack = (unsigned long *)&stack; if (task)
stack = (unsigned long *)task->thread.esp0;
else
stack = (unsigned long *)&stack;
}
endstack = (unsigned long *)(((unsigned long)stack + THREAD_SIZE - 1) & -THREAD_SIZE); endstack = (unsigned long *)(((unsigned long)stack + THREAD_SIZE - 1) & -THREAD_SIZE);
printk("Stack from %08lx:", (unsigned long)stack); printk("Stack from %08lx:", (unsigned long)stack);
...@@ -1124,7 +1123,7 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr) ...@@ -1124,7 +1123,7 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr)
printk("Process %s (pid: %d, stackpage=%08lx)\n", printk("Process %s (pid: %d, stackpage=%08lx)\n",
current->comm, current->pid, PAGE_SIZE+(unsigned long)current); current->comm, current->pid, PAGE_SIZE+(unsigned long)current);
show_stack((unsigned long *)fp); show_stack(NULL, (unsigned long *)fp);
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
......
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