aboutsummaryrefslogtreecommitdiff
path: root/kernel/include/idt.h
blob: 8041025c9b662485765488f8b22a486b3c57fdd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdint.h>

struct idt_entry {
    uint16_t base_lo;
    uint16_t sel;
    uint8_t zero;
    uint8_t flags;
    uint16_t base_hi;
} __attribute__((packed));

struct idt_ptr {
    uint16_t limit;
    uint32_t base;
};

struct idt_entry idt[0x100];
struct idt_ptr idt_pt;

void idt_init(void);

extern void idt_flush(uint32_t);

void idt_set_gate(uint8_t idx, uint32_t base, uint16_t sel, uint8_t flags);