7#define IDT_PRESENT 0x80
10#define IDT_RING_2 0x40
11#define IDT_RING_3 0x60
12#define IDT_INT_GATE 0x0E
13#define IDT_TRAP_GATE 0x0F
15#define IDT_KTRAP_GATE (IDT_PRESENT + IDT_RING_0 + IDT_TRAP_GATE)
16#define IDT_KINT_GATE (IDT_PRESENT + IDT_RING_0 + IDT_INT_GATE)
18#define IDT_ENTRY_CREATE(addr, selector, ist, flags) { \
20 (selector) & 0xffff, \
23 (addr) >> 16 & 0xffff, \
35 uint32_t address_high;
37} __attribute__((packed));
40struct cpu_idt_register {
43} __attribute__((packed));
47struct cpu_idt_iframe {
56struct cpu_idt_interrupt_state {
73 struct cpu_idt_iframe iframe;
78void cpu_idt_bind(
void);
80void cpu_idt_describe(
char *buf, uint64_t bufsz);
82static inline void enable_interrupts() {
86static inline void disable_interrupts() {