rulimine/stage23/sys/gdt.h
2021-07-20 13:35:43 +02:00

28 lines
454 B
C

#ifndef __SYS__GDT_H__
#define __SYS__GDT_H__
#include <stdint.h>
struct gdtr {
uint16_t limit;
#if defined (__x86_64__)
uint64_t ptr;
#elif defined (__i386__)
uint32_t ptr;
uint32_t pad;
#endif
} __attribute__((packed));
struct gdt_desc {
uint16_t limit;
uint16_t base_low;
uint8_t base_mid;
uint8_t access;
uint8_t granularity;
uint8_t base_hi;
} __attribute__((packed));
extern struct gdtr gdt;
#endif