 |
Xyris
0.5
|
|
enum | Exception {
EXCEPTION_DIVIDE_BY_ZERO = 0x00,
EXCEPTION_DEBUG = 0x01,
EXCEPTION_NON_MASK_INT = 0x02,
EXCEPTION_BREAKPOINT = 0x03,
EXCEPTION_OVERFLOW = 0x04,
EXCEPTION_BOUND_RANGE = 0x05,
EXCEPTION_INVALID_OPCODE = 0x06,
EXCEPTION_DEVICE_UNAVAIL = 0x07,
EXCEPTION_DOUBLE_FAULT = 0x08,
EXCEPTION_COPROCESSOR_SEG = 0x09,
EXCEPTION_INVALID_TSS = 0x0A,
EXCEPTION_SEGMENT_MISSING = 0x0B,
EXCEPTION_STACK_SEG_FAULT = 0x0C,
EXCEPTION_PROTECT_FAULT = 0x0D,
EXCEPTION_PAGE_FAULT = 0x0E,
EXCEPTION_FPU_EXCEPTION = 0x10,
EXCEPTION_ALIGNMENT_CHECK = 0x11,
EXCEPTION_MACHINE_CHECK = 0x12,
EXCEPTION_SIMD_FLOATPOINT = 0x13,
EXCEPTION_VIRTUALIZATION = 0x14,
EXCEPTION_SECURITY = 0x1E
} |
|
enum | Interrupt {
INTERRUPT_0 = 0x20,
INTERRUPT_1 = 0x21,
INTERRUPT_2 = 0x22,
INTERRUPT_3 = 0x23,
INTERRUPT_4 = 0x24,
INTERRUPT_5 = 0x35,
INTERRUPT_6 = 0x26,
INTERRUPT_7 = 0x27,
INTERRUPT_8 = 0x28,
INTERRUPT_9 = 0x29,
INTERRUPT_10 = 0x2A,
INTERRUPT_11 = 0x2B,
INTERRUPT_12 = 0x2C,
INTERRUPT_13 = 0x2D,
INTERRUPT_14 = 0x2E,
INTERRUPT_15 = 0x2F
} |
|
◆ InterruptHandler_t
typedef void(* Interrupts::InterruptHandler_t) (struct registers *) |
◆ Exception
Enumerator for mapping hardware exceptions to their purpose.
Enumerator |
---|
EXCEPTION_DIVIDE_BY_ZERO | |
EXCEPTION_DEBUG | |
EXCEPTION_NON_MASK_INT | |
EXCEPTION_BREAKPOINT | |
EXCEPTION_OVERFLOW | |
EXCEPTION_BOUND_RANGE | |
EXCEPTION_INVALID_OPCODE | |
EXCEPTION_DEVICE_UNAVAIL | |
EXCEPTION_DOUBLE_FAULT | |
EXCEPTION_COPROCESSOR_SEG | |
EXCEPTION_INVALID_TSS | |
EXCEPTION_SEGMENT_MISSING | |
EXCEPTION_STACK_SEG_FAULT | |
EXCEPTION_PROTECT_FAULT | |
EXCEPTION_PAGE_FAULT | |
EXCEPTION_FPU_EXCEPTION | |
EXCEPTION_ALIGNMENT_CHECK | |
EXCEPTION_MACHINE_CHECK | |
EXCEPTION_SIMD_FLOATPOINT | |
EXCEPTION_VIRTUALIZATION | |
EXCEPTION_SECURITY | |
Definition at line 25 of file isr.hpp.
◆ Interrupt
Enumerator for mapping hardware interrupt values to zero-indexed interrupts for programming ease. Unlike the exceptions, which are defined by the CPU manufacturer, interrupts can have multiple purposes, so it would be counter-productive to name them here.
Enumerator |
---|
INTERRUPT_0 | |
INTERRUPT_1 | |
INTERRUPT_2 | |
INTERRUPT_3 | |
INTERRUPT_4 | |
INTERRUPT_5 | |
INTERRUPT_6 | |
INTERRUPT_7 | |
INTERRUPT_8 | |
INTERRUPT_9 | |
INTERRUPT_10 | |
INTERRUPT_11 | |
INTERRUPT_12 | |
INTERRUPT_13 | |
INTERRUPT_14 | |
INTERRUPT_15 | |
Definition at line 59 of file isr.hpp.
◆ exception0()
void Interrupts::exception0 |
( |
| ) |
|
◆ exception1()
void Interrupts::exception1 |
( |
| ) |
|
◆ exception10()
void Interrupts::exception10 |
( |
| ) |
|
◆ exception11()
void Interrupts::exception11 |
( |
| ) |
|
◆ exception12()
void Interrupts::exception12 |
( |
| ) |
|
◆ exception13()
void Interrupts::exception13 |
( |
| ) |
|
◆ exception14()
void Interrupts::exception14 |
( |
| ) |
|
◆ exception15()
void Interrupts::exception15 |
( |
| ) |
|
◆ exception16()
void Interrupts::exception16 |
( |
| ) |
|
◆ exception17()
void Interrupts::exception17 |
( |
| ) |
|
◆ exception18()
void Interrupts::exception18 |
( |
| ) |
|
◆ exception19()
void Interrupts::exception19 |
( |
| ) |
|
◆ exception2()
void Interrupts::exception2 |
( |
| ) |
|
◆ exception20()
void Interrupts::exception20 |
( |
| ) |
|
◆ exception21()
void Interrupts::exception21 |
( |
| ) |
|
◆ exception22()
void Interrupts::exception22 |
( |
| ) |
|
◆ exception23()
void Interrupts::exception23 |
( |
| ) |
|
◆ exception24()
void Interrupts::exception24 |
( |
| ) |
|
◆ exception25()
void Interrupts::exception25 |
( |
| ) |
|
◆ exception26()
void Interrupts::exception26 |
( |
| ) |
|
◆ exception27()
void Interrupts::exception27 |
( |
| ) |
|
◆ exception28()
void Interrupts::exception28 |
( |
| ) |
|
◆ exception29()
void Interrupts::exception29 |
( |
| ) |
|
◆ exception3()
void Interrupts::exception3 |
( |
| ) |
|
◆ exception30()
void Interrupts::exception30 |
( |
| ) |
|
◆ exception31()
void Interrupts::exception31 |
( |
| ) |
|
◆ exception4()
void Interrupts::exception4 |
( |
| ) |
|
◆ exception5()
void Interrupts::exception5 |
( |
| ) |
|
◆ exception6()
void Interrupts::exception6 |
( |
| ) |
|
◆ exception7()
void Interrupts::exception7 |
( |
| ) |
|
◆ exception8()
void Interrupts::exception8 |
( |
| ) |
|
◆ exception9()
void Interrupts::exception9 |
( |
| ) |
|
◆ exceptionHandler()
void Interrupts::exceptionHandler |
( |
struct registers * |
regs | ) |
|
CPU exception handler. Must be available for each exception stub to be able to call.
Hardware exception handler. Called by each exception handler stub.
- Parameters
-
regs | CPU registers structure |
regs | CPU registers structure. Includes interrupt number. |
Definition at line 29 of file isr.cpp.
◆ init()
void Interrupts::init |
( |
| ) |
|
Definition at line 70 of file isr.cpp.
73 for (
int exception = 0; exception < 32; exception++) {
◆ interrupt0()
void Interrupts::interrupt0 |
( |
| ) |
|
◆ interrupt1()
void Interrupts::interrupt1 |
( |
| ) |
|
◆ interrupt10()
void Interrupts::interrupt10 |
( |
| ) |
|
◆ interrupt11()
void Interrupts::interrupt11 |
( |
| ) |
|
◆ interrupt12()
void Interrupts::interrupt12 |
( |
| ) |
|
◆ interrupt13()
void Interrupts::interrupt13 |
( |
| ) |
|
◆ interrupt14()
void Interrupts::interrupt14 |
( |
| ) |
|
◆ interrupt15()
void Interrupts::interrupt15 |
( |
| ) |
|
◆ interrupt2()
void Interrupts::interrupt2 |
( |
| ) |
|
◆ interrupt3()
void Interrupts::interrupt3 |
( |
| ) |
|
◆ interrupt4()
void Interrupts::interrupt4 |
( |
| ) |
|
◆ interrupt5()
void Interrupts::interrupt5 |
( |
| ) |
|
◆ interrupt6()
void Interrupts::interrupt6 |
( |
| ) |
|
◆ interrupt7()
void Interrupts::interrupt7 |
( |
| ) |
|
◆ interrupt8()
void Interrupts::interrupt8 |
( |
| ) |
|
◆ interrupt9()
void Interrupts::interrupt9 |
( |
| ) |
|
◆ interruptHandler()
void Interrupts::interruptHandler |
( |
struct registers * |
regs | ) |
|
CPU interrupt handler. Must be available for each interrupt stub to be able to call.
Hardware interrupt handler. Called by each interrupt handler stub.
- Parameters
-
regs | CPU registers structure |
regs | CPU registers structure. Includes interrupt number. |
Definition at line 39 of file isr.cpp.
◆ registerHandler()
- Parameters
-
Definition at line 98 of file isr.cpp.
◆ exceptionHandlerStubs
Initial value:
Definition at line 58 of file isr.cpp.
◆ interruptHandlers
◆ interruptHandlerStubs
Initial value:
Definition at line 65 of file isr.cpp.
@ EXCEPTION_PROTECT_FAULT
@ EXCEPTION_VIRTUALIZATION
void(* InterruptHandler_t)(struct registers *)
@ EXCEPTION_MACHINE_CHECK
@ EXCEPTION_ALIGNMENT_CHECK
@ EXCEPTION_INVALID_OPCODE
@ EXCEPTION_DIVIDE_BY_ZERO
void init()
Calls the lidt instruction and installs the IDT onto the CPU.
@ EXCEPTION_FPU_EXCEPTION
void(* interruptHandlerStubs[ARCH_INTERRUPT_NUM])(void)
#define ARCH_INTERRUPT_NUM
@ EXCEPTION_STACK_SEG_FAULT
@ EXCEPTION_COPROCESSOR_SEG
@ EXCEPTION_SEGMENT_MISSING
void setGate(int n, uint32_t handler_addr)
Sets the handler function (via address) for a specific IDT.
void writeByte(uint16_t port, uint8_t data)
Writes a byte (8 bits) to the CPU bus at a given port address.
void panic(const char *msg)
Halt the system and print the provided message on the panic screen.
@ EXCEPTION_DEVICE_UNAVAIL
void(* exceptionHandlerStubs[ARCH_EXCEPTION_NUM])(void)
@ EXCEPTION_SIMD_FLOATPOINT
InterruptHandler_t interruptHandlers[256]