You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
3.7 KiB
C

/* See the end of this file for copyright and license terms. */
#include <arch/cpufunc.h>
#include <arch/trap.h>
#include <gay/kprintf.h>
#include <gay/systm.h>
void x86_isr_divide_error(trap_frame_t *frame)
{
kprintf("Divide Error\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_debug_exception(trap_frame_t *frame)
{
kprintf("Debug Exception\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_nmi(trap_frame_t *frame)
{
kprintf("Nonmaskable Interrupt\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_breakpoint(trap_frame_t *frame)
{
kprintf("Breakpoint\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_overflow(trap_frame_t *frame)
{
kprintf("Overflow\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_bound_range_exceeded(trap_frame_t *frame)
{
kprintf("Bound Range Exceeded\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_invalid_opcode(trap_frame_t *frame)
{
kprintf("Invalid Opcode\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_device_not_available(trap_frame_t *frame)
{
kprintf("Device Not Available\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_double_fault(trap_frame_t *frame, u32 error_code)
{
disable_intr();
print_regs(frame);
panic("Double Fault (error_code = %#08x)", error_code);
}
void x86_isr_invalid_tss(trap_frame_t *frame, u32 error_code)
{
kprintf("Invalid TSS (error = %p)\n", (void *)error_code);
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_segment_not_present(trap_frame_t *frame, u32 error_code)
{
kprintf("Segment Not Present (error = %p)\n", (void *)error_code);
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_stack_segment_fault(trap_frame_t *frame, u32 error_code)
{
kprintf("Stack Segment Fault (error = %p)\n", (void *)error_code);
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_general_protection(trap_frame_t *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);
panic("Unexpected interrupt");
}
void x86_isr_x87_fpu_error(trap_frame_t *frame)
{
kprintf("x87 FPU Error\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_alignment_check(trap_frame_t *frame, u32 error_code)
{
kprintf("Alignment Check (error_code = %#08x)\n", error_code);
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_machine_check(trap_frame_t *frame)
{
kprintf("Machine Check\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_simd_floating_point_exception(trap_frame_t *frame)
{
kprintf("SIMD Floating Point Exception\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_virtualization_exception(trap_frame_t *frame)
{
kprintf("Virtualization Exception\n");
print_regs(frame);
panic("Unexpected interrupt");
}
void x86_isr_control_protection_exception(trap_frame_t *frame, u32 error_code)
{
kprintf("Control Protection Exception (error_code = %#08x)\n", error_code);
print_regs(frame);
panic("Unexpected interrupt");
}
/*
* This file is part of GayBSD.
* Copyright (c) 2021 fef <owo@fef.moe>.
*
* GayBSD is nonviolent software: you may only use, redistribute, and/or
* modify it under the terms of the Cooperative Nonviolent Public License
* (CNPL) as found in the LICENSE file in the source code root directory
* or at <https://git.pixie.town/thufie/npl-builder>; either version 7
* of the license, or (at your option) any later version.
*
* GayBSD comes with ABSOLUTELY NO WARRANTY, to the extent
* permitted by applicable law. See the CNPL for details.
*/