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>
46#include <utils/compiler.h>
49#define IDT_SIZE (IDT_LENGTH * sizeof(idt_descriptor))
50#define IDT_BASE_ADDRESS 0x00000000UL
67 COPROCESSOR_SEGMENT_OVERRUN,
71 GENERAL_PROTECTION_FAULT,
76 VIRTUALIZATTION_EXCEPTION,
77 CONTROL_PROTECTION_EXCEPTION,
78 HYPERVISOR_INJECTION_EXCEPTION = 0x1C,
79 VMM_COMMUNICATION_EXCEPTION,
92 INTERRUPT_GATE_32B = 0xE,
128 u32 edi, esi, ebp, esp;
129 u32 ebx, edx, ecx, eax;
153static ALWAYS_INLINE
void arch_interrupts_disable(
void)
158static ALWAYS_INLINE
void arch_interrupts_enable(
void)
163static ALWAYS_INLINE
bool arch_interrupts_test_and_disable(
void)
166 ASM(
"pushf; cli; popl %0" :
"=r"(eflags)::
"memory");
167 return boolean(eflags & 0x200);
u32 offset
Linear address of the IDT
Definition: interrupts.h:104
u32 error
Error code for this exception (pushed by our stub)
Definition: interrupts.h:135
u16 size
Size of the IDT.
Definition: interrupts.h:102
u16 offset_low
16 lower bits of the handler function's address
Definition: interrupts.h:110
u16 offset_high
16 higher bits of the handler function's address
Definition: interrupts.h:117
void idt_log(void)
Print the content of the IDT and IDTR.
Definition: interrupts.c:153
x86_exceptions
List of all x86 CPU exceptions Intel developper manual, Table 6-1.
Definition: interrupts.h:57
u8 access
Acess restriction flags for this interrupt
Definition: interrupts.h:115
segment_selector segment
Selector for the segment inside which we want to run the handler.
Definition: interrupts.h:112
u32 nr
Interrupt number (pushed by our stub)
Definition: interrupts.h:133
idt_gate_type
The different types of interrupt gates Intel developper manual, section 6-11.
Definition: interrupts.h:88
Structure of the page fault's error code https://wiki.osdev.org/Exceptions#Page_Fault.
Definition: mmu.c:587
inside the IDT
Definition: interrupts.h:108
The location of the IDT is kept inside the IDTR (IDT register).
Definition: interrupts.h:100
Default x86 interrupt frame pushed by the cpu Intel developper manual, figure 6-4.
Definition: interrupts.h:141
Dump of the process's registers.
Definition: interrupts.h:127
Frame passed onto the interrupt handlers by our stub handler.
Definition: interrupts.h:121
Identifies a segment inside the GDT or LDT.
Definition: gdt.h:124