kernel/inc/platform/exceptions.h

45 lines
1.5 KiB
C

// This file is part of noxos and licensed under the MIT open source license
#ifndef NOX_EXCEPTIONS_H
#define NOX_EXCEPTIONS_H
#include "platform/cpu.h"
#include "utils/string.h"
typedef enum {
EXCEPTION_DIVISION = 0x00,
EXCEPTION_DEBUG = 0x01,
EXCEPTION_NON_MASKABLE_INTERRUPT = 0x02,
EXCEPTION_BREAKPOINT = 0x03,
EXCEPTION_OVERFLOW = 0x04,
EXCEPTION_BOUND_RANGE_EXCEEDED = 0x05,
EXCEPTION_INVALID_OPCODE = 0x06,
EXCEPTION_DEVICE_NOT_AVAILABLE = 0x07,
EXCEPTION_DOUBLE_FAULT = 0x08,
EXCEPTION_INVALID_TSS = 0x0A,
EXCEPTION_SEGMENT_NOT_PRESENT = 0x0B,
EXCEPTION_STACK_SEGMENT_FAULT = 0x0C,
EXCEPTION_GENERAL_PROTECTION_FAULT = 0x0D,
EXCEPTION_PAGE_FAULT = 0x0E,
EXCEPTION_X87_FLOATING_POINT = 0x10,
EXCEPTION_ALIGNMENT_CHECK = 0x11,
EXCEPTION_MACHINE_CHECK = 0x12,
EXCEPTION_SIMD_FLOATING_POINT = 0x13,
EXCEPTION_VIRTUALIZATION = 0x14,
EXCEPTION_CONTROL_PROTECTION = 0x15,
EXCEPTION_HYPERVISOR_INJECTION = 0x1C,
EXCEPTION_VMM_COMMUNICATION = 0x1D,
EXCEPTION_SECURITY_EXCEPTION = 0x1E,
EXCEPTIONS_ENUM_END = 0x1F // not an exception code
} exception_type_E;
extern string_t g_exception_type_strings[EXCEPTIONS_ENUM_END];
cpu_state_T* exception_handle(cpu_state_T* state);
#endif //NOX_EXCEPTIONS_H