diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-07-30 03:17:12 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-30 03:27:38 -0400 |
commit | c1f193a7aed1b468617bb26075777c0c2f4f597a (patch) | |
tree | 3668a8fe9105cfcc0d52a47dd57068ab753a433e /arch | |
parent | f623f388e4f83c01ac23f228247a6a4b9cc71111 (diff) |
[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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc64/kernel/traps.c | 18 | ||||
-rw-r--r-- | arch/sparc64/mm/fault.c | 5 |
2 files changed, 12 insertions, 11 deletions
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index 6ef2d299fb10..6ef42b8e53d8 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -2134,12 +2134,20 @@ static void user_instruction_dump (unsigned int __user *pc) | |||
2134 | void show_stack(struct task_struct *tsk, unsigned long *_ksp) | 2134 | void show_stack(struct task_struct *tsk, unsigned long *_ksp) |
2135 | { | 2135 | { |
2136 | unsigned long pc, fp, thread_base, ksp; | 2136 | unsigned long pc, fp, thread_base, ksp; |
2137 | void *tp = task_stack_page(tsk); | 2137 | struct thread_info *tp; |
2138 | struct reg_window *rw; | 2138 | struct reg_window *rw; |
2139 | int count = 0; | 2139 | int count = 0; |
2140 | 2140 | ||
2141 | ksp = (unsigned long) _ksp; | 2141 | ksp = (unsigned long) _ksp; |
2142 | 2142 | if (!tsk) | |
2143 | tsk = current; | ||
2144 | tp = task_thread_info(tsk); | ||
2145 | if (ksp == 0UL) { | ||
2146 | if (tsk == current) | ||
2147 | asm("mov %%fp, %0" : "=r" (ksp)); | ||
2148 | else | ||
2149 | ksp = tp->ksp; | ||
2150 | } | ||
2143 | if (tp == current_thread_info()) | 2151 | if (tp == current_thread_info()) |
2144 | flushw_all(); | 2152 | flushw_all(); |
2145 | 2153 | ||
@@ -2168,11 +2176,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2168 | 2176 | ||
2169 | void dump_stack(void) | 2177 | void dump_stack(void) |
2170 | { | 2178 | { |
2171 | unsigned long *ksp; | 2179 | show_stack(current, NULL); |
2172 | |||
2173 | __asm__ __volatile__("mov %%fp, %0" | ||
2174 | : "=r" (ksp)); | ||
2175 | show_stack(current, ksp); | ||
2176 | } | 2180 | } |
2177 | 2181 | ||
2178 | EXPORT_SYMBOL(dump_stack); | 2182 | EXPORT_SYMBOL(dump_stack); |
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c index 17123e9ecf78..9f7740eee8d2 100644 --- a/arch/sparc64/mm/fault.c +++ b/arch/sparc64/mm/fault.c | |||
@@ -112,15 +112,12 @@ static void __kprobes unhandled_fault(unsigned long address, | |||
112 | 112 | ||
113 | static void bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr) | 113 | static void bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr) |
114 | { | 114 | { |
115 | unsigned long *ksp; | ||
116 | |||
117 | printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n", | 115 | printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n", |
118 | regs->tpc); | 116 | regs->tpc); |
119 | printk(KERN_CRIT "OOPS: RPC [%016lx]\n", regs->u_regs[15]); | 117 | printk(KERN_CRIT "OOPS: RPC [%016lx]\n", regs->u_regs[15]); |
120 | print_symbol("RPC: <%s>\n", regs->u_regs[15]); | 118 | print_symbol("RPC: <%s>\n", regs->u_regs[15]); |
121 | printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr); | 119 | printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr); |
122 | __asm__("mov %%sp, %0" : "=r" (ksp)); | 120 | dump_stack(); |
123 | show_stack(current, ksp); | ||
124 | unhandled_fault(regs->tpc, current, regs); | 121 | unhandled_fault(regs->tpc, current, regs); |
125 | } | 122 | } |
126 | 123 | ||