diff options
author | Richard Braun <rbraun@sceen.net> | 2017-03-14 19:55:16 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-03-14 19:55:16 +0100 |
commit | 7fc48fff768f992dd6d7b6cf8549b5777bf1cf0e (patch) | |
tree | 7ae7cda15ef0188384d213bad58f9b169a4f321f | |
parent | 77058e37bf93d77ab3b9790428c1cad2b4a5cc49 (diff) |
x86/trap: print interrupted thread on double fault
-rw-r--r-- | arch/x86/machine/trap.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/x86/machine/trap.c b/arch/x86/machine/trap.c index ad253d52..cc0504eb 100644 --- a/arch/x86/machine/trap.c +++ b/arch/x86/machine/trap.c @@ -107,6 +107,15 @@ trap_install(unsigned int vector, int flags, trap_isr_fn_t isr, } static void +trap_show_thread(void) +{ + struct thread *thread; + + thread = thread_self(); + printk("trap: interrupted thread: %p (%s)\n", thread, thread->name); +} + +static void trap_double_fault(struct trap_frame *frame) { cpu_halt_broadcast(); @@ -143,6 +152,7 @@ trap_double_fault(struct trap_frame *frame) #endif /* __LP64__ */ printk("trap: double fault (cpu%u):\n", cpu_id()); + trap_show_thread(); trap_frame_show(frame); trap_stack_show(frame); cpu_halt(); @@ -159,12 +169,9 @@ trap_install_double_fault(void) static void trap_default(struct trap_frame *frame) { - struct thread *thread; - cpu_halt_broadcast(); - thread = thread_self(); printk("trap: unhandled interrupt or exception (cpu%u):\n", cpu_id()); - printk("trap: interrupted thread: %p (%s)\n", thread, thread->name); + trap_show_thread(); trap_frame_show(frame); trap_stack_show(frame); cpu_halt(); |