|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
|
|
|
|
|
#include <gay/kprintf.h>
|
|
|
|
|
|
|
|
|
|
static void print_regs(struct x86_trap_frame *context)
|
|
|
|
|
void x86_print_regs(const struct x86_trap_frame *context)
|
|
|
|
|
{
|
|
|
|
|
u32 esp;
|
|
|
|
|
if (context->hw_frame->cs == X86_USER_CS)
|
|
|
|
@ -24,84 +24,84 @@ static void print_regs(struct x86_trap_frame *context)
|
|
|
|
|
void x86_isr_divide_error(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Divide Error\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_debug_exception(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Debug Exception\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_nmi(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Nonmaskable Interrupt\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_breakpoint(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Breakpoint\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_overflow(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Overflow\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_bound_range_exceeded(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Bound Range Exceeded\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_invalid_opcode(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Invalid Opcode\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_device_not_available(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Device Not Available\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_double_fault(struct x86_trap_frame *frame, u32 error_code)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Double Fault (error = %p)\n", (void *)error_code);
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_invalid_tss(struct x86_trap_frame *frame, u32 error_code)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Invalid TSS (error = %p)\n", (void *)error_code);
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_segment_not_present(struct x86_trap_frame *frame, u32 error_code)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Segment Not Present (error = %p)\n", (void *)error_code);
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_stack_segment_fault(struct x86_trap_frame *frame, u32 error_code)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Stack Segment Fault (error = %p)\n", (void *)error_code);
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -109,56 +109,49 @@ void x86_isr_general_protection(struct x86_trap_frame *frame, u32 error_code)
|
|
|
|
|
{
|
|
|
|
|
kprintf("General Protection Fault (external = %d, table = %d, index = %d)\n",
|
|
|
|
|
error_code & 1, (error_code >> 1) & 3, (error_code >> 3));
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_page_fault(struct x86_trap_frame *frame, u32 error_code)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Page Fault (error = %p)\n", (void *)error_code);
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_x87_fpu_error(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("x87 FPU Error\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_alignment_check(struct x86_trap_frame *frame, u32 error_code)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Alignment Check (error = %p)\n", (void *)error_code);
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_machine_check(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Machine Check\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_simd_floating_point_exception(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("SIMD Floating Point Exception\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_virtualization_exception(struct x86_trap_frame *frame)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Virtualization Exception\n");
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void x86_isr_control_protection_exception(struct x86_trap_frame *frame, u32 error_code)
|
|
|
|
|
{
|
|
|
|
|
kprintf("Control Protection Exception (error = %p)\n", (void *)error_code);
|
|
|
|
|
print_regs(frame);
|
|
|
|
|
x86_print_regs(frame);
|
|
|
|
|
while (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|