aboutsummaryrefslogtreecommitdiff
path: root/src/include/idt.h
blob: b8413b89ef9dec441cc1783d0aa1c890cfe1a891 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once
#include <stdint.h>

typedef struct Gate_Descriptor {
    uint16_t offset_low;
    uint16_t segment_selector;
    uint8_t reserved;
    uint8_t attrs;
    uint16_t offset_high;
} __attribute__((packed)) Gate_Descriptor_t;

typedef Gate_Descriptor_t *IDT_t;

Gate_Descriptor_t make_gate(uint32_t offset, uint8_t segment_selector,
                            uint8_t attrs);

void get_idtr();