6 static void handle_double_fault (Trap_state *) asm ("thread_handle_double_fault");
9 static bool may_enter_jdb;
13 IMPLEMENTATION[amd64]:
17 #include "kernel_console.h"
18 #include "processor.h"
20 #include "trap_state.h"
25 bool Thread::may_enter_jdb = false;
29 Thread::handle_double_fault (Trap_state *ts)
34 printf ("\n\033[1;31mDOUBLE FAULT!\033[m\n"
35 "RAX=%016lx RSI=%016lx\n"
36 "RBX=%016lx RDI=%016lx\n"
37 "RCX=%016lx RBP=%016lx\n"
38 "RDX=%016lx RSP=%016lx\n"
39 "R8= %016lx R9= %016lx\n"
40 "R10=%016lx R11=%016lx\n"
41 "R12=%016lx R13=%016lx\n"
42 "R14=%016lx R15=%016lx\n"
43 "RIP %016lx RFLAGS %016lx\n"
44 "CS %04lx SS %04lx\n\n",
53 ts->ip(), ts->flags(),
54 ts->cs() & 0xffff, ts->ss() & 0xffff);
57 puts ("Return reboots, \"k\" tries to enter the L4 kernel debugger...");
59 while ((c=Kconsole::console()->getchar(false)) == -1)
62 if (c == 'k' || c == 'K')
64 nested_trap_handler(ts,0); // XXX: 0 is possibly the wrong CPU
69 puts ("Return reboots");
70 while ((Kconsole::console()->getchar(false)) == -1)
74 puts ("\033[1mRebooting...\033[0m");