mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 16:29:05 +00:00
[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>
This commit is contained in:
parent
dc07845d0c
commit
d362979aa2
@ -198,25 +198,16 @@ void show_stack(struct task_struct *tsk, unsigned long *sp)
|
|||||||
barrier();
|
barrier();
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_SPINLOCK(die_lock);
|
static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs)
|
||||||
|
|
||||||
/*
|
|
||||||
* This function is protected against re-entrancy.
|
|
||||||
*/
|
|
||||||
NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
|
|
||||||
{
|
{
|
||||||
struct task_struct *tsk = current;
|
struct task_struct *tsk = thread->task;
|
||||||
static int die_counter;
|
static int die_counter;
|
||||||
|
|
||||||
console_verbose();
|
|
||||||
spin_lock_irq(&die_lock);
|
|
||||||
bust_spinlocks(1);
|
|
||||||
|
|
||||||
printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter);
|
printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter);
|
||||||
print_modules();
|
print_modules();
|
||||||
__show_regs(regs);
|
__show_regs(regs);
|
||||||
printk("Process %s (pid: %d, stack limit = 0x%p)\n",
|
printk("Process %s (pid: %d, stack limit = 0x%p)\n",
|
||||||
tsk->comm, tsk->pid, tsk->thread_info + 1);
|
tsk->comm, tsk->pid, thread + 1);
|
||||||
|
|
||||||
if (!user_mode(regs) || in_interrupt()) {
|
if (!user_mode(regs) || in_interrupt()) {
|
||||||
dump_mem("Stack: ", regs->ARM_sp,
|
dump_mem("Stack: ", regs->ARM_sp,
|
||||||
@ -224,7 +215,21 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
|
|||||||
dump_backtrace(regs, tsk);
|
dump_backtrace(regs, tsk);
|
||||||
dump_instr(regs);
|
dump_instr(regs);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_SPINLOCK(die_lock);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This function is protected against re-entrancy.
|
||||||
|
*/
|
||||||
|
NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
|
||||||
|
{
|
||||||
|
struct thread_info *thread = current_thread_info();
|
||||||
|
|
||||||
|
console_verbose();
|
||||||
|
spin_lock_irq(&die_lock);
|
||||||
|
bust_spinlocks(1);
|
||||||
|
__die(str, err, thread, regs);
|
||||||
bust_spinlocks(0);
|
bust_spinlocks(0);
|
||||||
spin_unlock_irq(&die_lock);
|
spin_unlock_irq(&die_lock);
|
||||||
do_exit(SIGSEGV);
|
do_exit(SIGSEGV);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user