30 lines
450 B
C
30 lines
450 B
C
#ifndef CPU_GDT_H_
|
|
#define CPU_GDT_H_
|
|
|
|
#include <stdint.h>
|
|
#include "compiler/attr.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 // CPU_GDT_H_
|