Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] Re-organise die()

Provide __die() which can be called from various contexts to provide
an oops report.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Russell King and committed by
Russell King
d362979a dc07845d

+17 -12
+17 -12
arch/arm/kernel/traps.c
··· 198 198 barrier(); 199 199 } 200 200 201 - DEFINE_SPINLOCK(die_lock); 202 - 203 - /* 204 - * This function is protected against re-entrancy. 205 - */ 206 - NORET_TYPE void die(const char *str, struct pt_regs *regs, int err) 201 + static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs) 207 202 { 208 - struct task_struct *tsk = current; 203 + struct task_struct *tsk = thread->task; 209 204 static int die_counter; 210 - 211 - console_verbose(); 212 - spin_lock_irq(&die_lock); 213 - bust_spinlocks(1); 214 205 215 206 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter); 216 207 print_modules(); 217 208 __show_regs(regs); 218 209 printk("Process %s (pid: %d, stack limit = 0x%p)\n", 219 - tsk->comm, tsk->pid, tsk->thread_info + 1); 210 + tsk->comm, tsk->pid, thread + 1); 220 211 221 212 if (!user_mode(regs) || in_interrupt()) { 222 213 dump_mem("Stack: ", regs->ARM_sp, ··· 215 224 dump_backtrace(regs, tsk); 216 225 dump_instr(regs); 217 226 } 227 + } 218 228 229 + DEFINE_SPINLOCK(die_lock); 230 + 231 + /* 232 + * This function is protected against re-entrancy. 233 + */ 234 + NORET_TYPE void die(const char *str, struct pt_regs *regs, int err) 235 + { 236 + struct thread_info *thread = current_thread_info(); 237 + 238 + console_verbose(); 239 + spin_lock_irq(&die_lock); 240 + bust_spinlocks(1); 241 + __die(str, err, thread, regs); 219 242 bust_spinlocks(0); 220 243 spin_unlock_irq(&die_lock); 221 244 do_exit(SIGSEGV);