aboutsummaryrefslogtreecommitdiff
path: root/kernel/include/gdt.h
blob: e93c92aabdf5ce300b5c8dd79ddacb3ec862778f (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 gdt_entry {
    uint16_t limit_low;
    uint16_t base_low;
    uint8_t base_middle;
    uint8_t access;
    uint8_t granularity;
    uint8_t base_high;
} __attribute__((packed));

struct gdt_ptr {
    uint8_t limit;
    uint32_t base;
} __attribute__((packed));

struct gdt_entry gdt[3];
struct gdt_ptr gp;

/* assembly */
extern void gdt_flush(struct gdt_ptr*);

void gdt_init(void);