Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35990
b: refs/heads/master
c: e889d78
h: refs/heads/master
v: v3
  • Loading branch information
Atsushi Nemoto authored and Ralf Baechle committed Sep 27, 2006
1 parent 3f4ca55 commit 0c6a019
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 29 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: e7dee3cea4dcd54744cf68864784c1336a42144f
refs/heads/master: e889d78fd5775d0b466f570928f5b0f0c9f05355
51 changes: 23 additions & 28 deletions trunk/arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,25 @@ void (*board_bind_eic_interrupt)(int irq, int regset);
*/
#define MODULE_RANGE (8*1024*1024)

static void show_trace(unsigned long *stack)
{
const int field = 2 * sizeof(unsigned long);
unsigned long addr;

printk("Call Trace:");
#ifdef CONFIG_KALLSYMS
printk("\n");
#endif
while (!kstack_end(stack)) {
addr = *stack++;
if (__kernel_text_address(addr)) {
printk(" [<%0*lx>] ", field, addr);
print_symbol("%s\n", addr);
}
}
printk("\n");
}

/*
* This routine abuses get_user()/put_user() to reference pointers
* with at least a bit of error checking ...
Expand All @@ -88,13 +107,15 @@ void show_stack(struct task_struct *task, unsigned long *sp)
const int field = 2 * sizeof(unsigned long);
long stackdata;
int i;
unsigned long *stack;

if (!sp) {
if (task && task != current)
sp = (unsigned long *) task->thread.reg29;
else
sp = (unsigned long *) &sp;
}
stack = sp;

printk("Stack :");
i = 0;
Expand All @@ -115,32 +136,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
i++;
}
printk("\n");
}

void show_trace(struct task_struct *task, unsigned long *stack)
{
const int field = 2 * sizeof(unsigned long);
unsigned long addr;

if (!stack) {
if (task && task != current)
stack = (unsigned long *) task->thread.reg29;
else
stack = (unsigned long *) &stack;
}

printk("Call Trace:");
#ifdef CONFIG_KALLSYMS
printk("\n");
#endif
while (!kstack_end(stack)) {
addr = *stack++;
if (__kernel_text_address(addr)) {
printk(" [<%0*lx>] ", field, addr);
print_symbol("%s\n", addr);
}
}
printk("\n");
show_trace(stack);
}

/*
Expand All @@ -150,7 +146,7 @@ void dump_stack(void)
{
unsigned long stack;

show_trace(current, &stack);
show_trace(&stack);
}

EXPORT_SYMBOL(dump_stack);
Expand Down Expand Up @@ -270,7 +266,6 @@ void show_registers(struct pt_regs *regs)
printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
current->comm, current->pid, current_thread_info(), current);
show_stack(current, (long *) regs->regs[29]);
show_trace(current, (long *) regs->regs[29]);
show_code((unsigned int *) regs->cp0_epc);
printk("\n");
}
Expand Down

0 comments on commit 0c6a019

Please sign in to comment.