25 "Divide-By-Zero Error",
27 "Non-Maskable Interrupt",
30 "Bound Range Exceeded",
32 "Device Not Available",
34 "Coprocessor Segment Overrun",
36 "Segment Not Present",
37 "Stack Segment Fault",
38 "General Protection Fault",
41 "x87 Floating-Point Error",
44 "SIMD Floating-Point Exception",
45 "Virtualization Exception",
46 "Control Protection Exception",
53 "Hypervisor Injection Exception",
54 "VMM Communication Exception",
66 static const char *
const scp1_names[] = {
"Alternate Hot Reset",
"Alternate A20 Gate",
"[RESERVED]",
"Security Lock",
67 "Watchdog Timer",
"[RESERVED]",
"HDD 2 Activity",
"HDD 1 Activity" };
69 static const char *
const scp2_names[] = {
"Timer 2 Tied to Speaker",
"Speaker Data Enable",
"Parity Check Enable",
"Channel Check Enable",
70 "Refresh Request",
"Timer 2 Output",
"Channel Check",
"Parity Check" };
72 for (
int bit = 0; bit < 8; bit++)
73 if (scp1 & (1 << bit))
74 pr_emph(
" %s", scp1_names[bit]);
76 for (
int bit = 0; bit < 8; bit++)
77 if (scp2 & (1 << bit))
78 pr_emph(
" %s", scp2_names[bit]);
89 const char *intr_type =
"";
104 __asm__
volatile(
"mov %%dr0, %0\n"
110 :
"=r"(drx[0]),
"=r"(drx[1]),
"=r"(drx[2]),
"=r"(drx[3]),
"=r"(drx[4]),
"=r"(drx[5]));
125 mos_panic(
"Invalid opcode in kernel mode");
153 mos_warn(
"Breakpoint not handled.");
159 intr_type =
"page fault";
217 reg_t syscall_ret = 0, syscall_nr = 0;
should_inline u8 lapic_get_id(void)
#define MOS_UNREACHABLE()
#define mos_warn(fmt,...)
void signal_exit_to_user_prepare_syscall(platform_regs_t *regs, reg_t syscall_nr, reg_t syscall_ret)
Prepare to exit to userspace after a syscall.
long signal_send_to_thread(thread_t *target, signal_t signal)
Send a signal to a thread.
void signal_exit_to_user_prepare(platform_regs_t *regs)
Prepare to exit to userspace.
void mm_handle_fault(ptr_t fault_addr, pagefault_t *info)
Handle a page fault.
void interrupt_entry(u32 irq)
ipi_type_t
The type of IPI to send.
void ipi_do_handle(ipi_type_t type)
reg_t ksyscall_enter(reg_t number, reg_t arg1, reg_t arg2, reg_t arg3, reg_t arg4, reg_t arg5, reg_t arg6)
#define MOS_IN_RANGE(addr, start, end)
#define mos_panic(fmt,...)
u32 const char void try_handle_kernel_panics(ptr_t ip)
should_inline u8 port_inb(u16 port)
#define pr_emerg(fmt,...)
#define profile_leave(p,...)
#define x86_cpu_get_cr2()
static void x86_handle_exception(platform_regs_t *regs)
static void x86_handle_irq(platform_regs_t *frame)
void x86_interrupt_entry(ptr_t rsp)
static const char *const x86_exception_names[EXCEPTION_COUNT]
static void x86_handle_nmi(platform_regs_t *regs)
@ EXCEPTION_SECURITY_EXCEPTION
@ EXCEPTION_INVALID_OPCODE
@ EXCEPTION_STACK_SEGMENT_FAULT
@ EXCEPTION_VIRTUALIZATION_EXCEPTION
@ EXCEPTION_DEVICE_NOT_AVAILABLE
@ EXCEPTION_MACHINE_CHECK
@ EXCEPTION_SEGMENT_NOT_PRESENT
@ EXCEPTION_VMM_COMMUNICATION_EXCEPTION
@ EXCEPTION_GENERAL_PROTECTION_FAULT
@ EXCEPTION_COPROCESSOR_SEGMENT_OVERRUN
@ EXCEPTION_ALIGNMENT_CHECK
@ EXCEPTION_HYPERVISOR_EXCEPTION
@ EXCEPTION_CONTROL_PROTECTION_EXCEPTION
@ EXCEPTION_BOUND_RANGE_EXCEEDED
void x86_interrupt_return_impl(const platform_regs_t *regs)