35#ifndef KERNEL_INTERRUPTS_H
36#error <kernel/arch/i686/interrupts.h> must not be used as a standalone header. Please include <kernel/interrupts.h> instead.
39#ifndef KERNEL_ARCH_I686_INTERRUPTS_H
40#define KERNEL_ARCH_I686_INTERRUPTS_H
42#include <kernel/types.h>
44#include <kernel/arch/i686/gdt.h>
45#include <kernel/arch/i686/cpu.h>
47#include <utils/compiler.h>
64 COPROCESSOR_SEGMENT_OVERRUN,
68 GENERAL_PROTECTION_FAULT,
73 VIRTUALIZATTION_EXCEPTION,
74 CONTROL_PROTECTION_EXCEPTION,
75 HYPERVISOR_INJECTION_EXCEPTION = 0x1C,
76 VMM_COMMUNICATION_EXCEPTION,
89 INTERRUPT_GATE_32B = 0xE,
130 struct x86_interrupt_frame frame;
133static ALWAYS_INLINE
void arch_interrupts_disable(
void)
138static ALWAYS_INLINE
void arch_interrupts_enable(
void)
143static ALWAYS_INLINE
bool arch_interrupts_test_and_disable(
void)
146 ASM(
"pushf; cli; popl %0" :
"=r"(eflags)::
"memory");
147 return boolean(eflags & 0x200);
150static ALWAYS_INLINE
bool arch_interrupts_enabled(
void)
153 ASM(
"pushf; popl %0" :
"=r"(eflags)::
"memory");
154 return boolean(eflags & 0x200);
error
All the error types used in ths project.
Definition: error.h:28
u32 offset
Linear address of the IDT
Definition: interrupts.h:101
u16 size
Size of the IDT.
Definition: interrupts.h:99
u16 offset_low
16 lower bits of the handler function's address
Definition: interrupts.h:107
u16 offset_high
16 higher bits of the handler function's address
Definition: interrupts.h:114
struct x86_regs regs
Snapshot of the registers at the time the interrupt happened.
Definition: interrupts.h:121
x86_exceptions
List of all x86 CPU exceptions Intel developper manual, Table 6-1.
Definition: interrupts.h:54
u8 access
Acess restriction flags for this interrupt
Definition: interrupts.h:112
segment_selector segment
Selector for the segment inside which we want to run the handler.
Definition: interrupts.h:109
u32 nr
Error code and interrupt number (pushed by our stub)
Definition: interrupts.h:124
idt_gate_type
The different types of interrupt gates Intel developper manual, section 6-11.
Definition: interrupts.h:85
Structure of the page fault's error code https://wiki.osdev.org/Exceptions#Page_Fault.
Definition: mmu.c:762
inside the IDT
Definition: interrupts.h:105
The location of the IDT is kept inside the IDTR (IDT register).
Definition: interrupts.h:97
Frame passed onto the interrupt handlers by our stub handler.
Definition: interrupts.h:118
Identifies a segment inside the GDT or LDT.
Definition: gdt.h:124