#ifndef HAL_GDT_H_
#define HAL_GDT_H_

#define KCODE 0x08
#define KDATA 0x10
#define UCODE 0x18
#define UDATA 0x20
#define TSS   0x28

typedef struct {
  uint32_t resv0;
  uint64_t rsp0;
  uint64_t rsp1;
  uint64_t rsp2;
  uint64_t resv1;
  uint64_t ist[7];
  uint64_t resv2;
  uint16_t resv3;
  uint16_t iopb_off;
} PACKED Tss;

ALIGNED(16) extern Tss tss;

void gdt_init(void);

#endif // HAL_GDT_H_
