- const char *trapname = "Unknown";
- pal_cr_t cr0, cr2, cr3, cr4;
-
- pal_get_control_registers( &cr0, &cr2, &cr3, &cr4 );
-
- /*
- * Issue an I/O port read if one has been requested - this is an
- * event logic analyzers can use as a trigger point.
- */
- panic_io_port_read();
-
- kprintf("panic trap number 0x%x, eip 0x%x\n", regs->trapno, regs->eip);
- kprintf("cr0 0x%08x cr2 0x%08x cr3 0x%08x cr4 0x%08x\n",
- cr0, cr2, cr3, cr4);
-
- if (regs->trapno < TRAP_TYPES)
- trapname = trap_type[regs->trapno];
-#undef panic
- panic("Kernel trap at 0x%08x, type %d=%s, registers:\n"
- "CR0: 0x%08x, CR2: 0x%08x, CR3: 0x%08x, CR4: 0x%08x\n"
- "EAX: 0x%08x, EBX: 0x%08x, ECX: 0x%08x, EDX: 0x%08x\n"
- "CR2: 0x%08x, EBP: 0x%08x, ESI: 0x%08x, EDI: 0x%08x\n"
- "EFL: 0x%08x, EIP: 0x%08x, CS: 0x%08x, DS: 0x%08x\n"
- "Error code: 0x%08x%s\n",
- regs->eip, regs->trapno, trapname, cr0, cr2, cr3, cr4,
- regs->eax,regs->ebx,regs->ecx,regs->edx,
- regs->cr2,regs->ebp,regs->esi,regs->edi,
- regs->efl,regs->eip,regs->cs & 0xFFFF, regs->ds & 0xFFFF, regs->err,
- virtualized ? " VMM" : "");
- /*
- * This next statement is not executed,
- * but it's needed to stop the compiler using tail call optimization
- * for the panic call - which confuses the subsequent backtrace.
- */
- cr0 = 0;
-}
-#else
-
-
-static void
-panic_trap(x86_saved_state64_t *regs)
-{
- const char *trapname = "Unknown";
- pal_cr_t cr0, cr2, cr3, cr4;
- boolean_t potential_smep_fault = FALSE, potential_kernel_NX_fault = FALSE;