void idt_init(void)
Initialize the IDT structure in memory.
idt_attributes_t
IDT gate attributes.
void idt_cpu_load(void)
Load the IDT on the current CPU.
@ IDT_ATTR_PRESENT
Must be set for the entry to be valid.
@ IDT_ATTR_RING3
Can be invoked from ring 3 or lower.
@ IDT_ATTR_RING1
Can be invoked from ring 1 or lower.
@ IDT_ATTR_RING0
Can be invoked from ring 0 or hardware only.
@ IDT_ATTR_INTERRUPT
Interrupt gate, will disable interrupts when invoked.
@ IDT_ATTR_TRAP
Trap gate, will NOT disable interrupts when invoked.
@ IDT_ATTR_RING2
Can be invoked from ring 2 or lower.
#define PACKED
GCC packed attribute.
IDT descriptor structure.
uint16_t size
Size of the IDT in bytes - 1.
uint64_t offset
Address of the IDT.
uint8_t attributes
Type and attributes, see idt_attributes_t.
uint8_t ist
Interrupt Stack Table offset, 0 = dont use IST, see tss_t.
uint16_t offsetLow
Lower 16 bits of handler function address.
uint32_t offsetHigh
Upper 32 bits of handler function address.
uint16_t codeSegment
Code segment selector in the GDT.
uint16_t offsetMid
Middle 16 bits of handler function address.