8#define GDT_LONG_MODE 0x20
10#define GDT_PRESENT 0x80
12#define GDT_RING_0 0x00
13#define GDT_RING_1 0x20
14#define GDT_RING_2 0x40
15#define GDT_RING_3 0x60
17#define GDT_CONFORMING 0x04
22#define GDT_NULL_OFFSET 0x00
32#define GDT_KCODE_LIMIT 0
33#define GDT_KCODE_BASE 0
34#define GDT_KCODE_MISC_LOW GDT_PRESENT + GDT_RING_0
35#define GDT_KCODE_MISC_HIGH GDT_LONG_MODE
42#define GDT_KDATA_LIMIT 0
43#define GDT_KDATA_BASE 0
44#define GDT_KDATA_MISC_LOW GDT_PRESENT
45#define GDT_KDATA_MISC_HIGH 0
48#define GDT_ENTRY_CREATE(lim, base, low, high) { \
51 (base >> 16) & 0xff, \
62 uint8_t present_dpl_and_conform;
63 uint8_t flags_and_limit_high;
65} __attribute__((packed));
68struct cpu_gdt_register {
71} __attribute__((packed));
74void cpu_gdt_bind(
void);
76void cpu_gdt_describe(
char *buf, uint64_t bufsz);