Changeset View
Changeset View
Standalone View
Standalone View
head/sys/amd64/amd64/trap.c
Show First 20 Lines • Show All 755 Lines • ▼ Show 20 Lines | |||||
trap_fatal(frame, eva) | trap_fatal(frame, eva) | ||||
struct trapframe *frame; | struct trapframe *frame; | ||||
vm_offset_t eva; | vm_offset_t eva; | ||||
{ | { | ||||
int code, ss; | int code, ss; | ||||
u_int type; | u_int type; | ||||
struct soft_segment_descriptor softseg; | struct soft_segment_descriptor softseg; | ||||
char *msg; | char *msg; | ||||
#ifdef KDB | |||||
bool handled; | |||||
#endif | |||||
code = frame->tf_err; | code = frame->tf_err; | ||||
type = frame->tf_trapno; | type = frame->tf_trapno; | ||||
sdtossd(&gdt[NGDT * PCPU_GET(cpuid) + IDXSEL(frame->tf_cs & 0xffff)], | sdtossd(&gdt[NGDT * PCPU_GET(cpuid) + IDXSEL(frame->tf_cs & 0xffff)], | ||||
&softseg); | &softseg); | ||||
if (type <= MAX_TRAP_MSG) | if (type <= MAX_TRAP_MSG) | ||||
msg = trap_msg[type]; | msg = trap_msg[type]; | ||||
Show All 34 Lines | if (frame->tf_rflags & PSL_NT) | ||||
printf("nested task, "); | printf("nested task, "); | ||||
if (frame->tf_rflags & PSL_RF) | if (frame->tf_rflags & PSL_RF) | ||||
printf("resume, "); | printf("resume, "); | ||||
printf("IOPL = %ld\n", (frame->tf_rflags & PSL_IOPL) >> 12); | printf("IOPL = %ld\n", (frame->tf_rflags & PSL_IOPL) >> 12); | ||||
printf("current process = %d (%s)\n", | printf("current process = %d (%s)\n", | ||||
curproc->p_pid, curthread->td_name); | curproc->p_pid, curthread->td_name); | ||||
#ifdef KDB | #ifdef KDB | ||||
if (debugger_on_panic) | if (debugger_on_panic) { | ||||
if (kdb_trap(type, 0, frame)) | kdb_why = KDB_WHY_TRAP; | ||||
handled = kdb_trap(type, 0, frame); | |||||
kdb_why = KDB_WHY_UNSET; | |||||
if (handled) | |||||
return; | return; | ||||
} | |||||
#endif | #endif | ||||
printf("trap number = %d\n", type); | printf("trap number = %d\n", type); | ||||
if (type <= MAX_TRAP_MSG) | if (type <= MAX_TRAP_MSG) | ||||
panic("%s", trap_msg[type]); | panic("%s", trap_msg[type]); | ||||
else | else | ||||
panic("unknown/reserved trap"); | panic("unknown/reserved trap"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |