summaryrefslogtreecommitdiff
path: root/api/bits/x86_64/descriptor.h
blob: c55a493bc106fe43b9b459c6b33b7c0a47df1d2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once

#include <stdint.h>

struct descriptor_table_register_long
{
	uint16_t limit;
	uint64_t base;
} __attribute__((packed, aligned(8)));

struct segment_descriptor
{
	uint16_t limit0;
	uint16_t base0;
	uint8_t base16;
	uint8_t access;
	uint8_t flags_limit16;
	uint8_t base24;
} __attribute__((packed, aligned(8)));

struct system_segment_descrptor_long
{
	struct segment_descriptor segment;
	uint32_t base32;
	uint32_t r0;
} __attribute__((packed, aligned(8)));

struct gate_descriptor
{
    uint16_t offset0;
    uint16_t selector;
    uint8_t ist;
    uint8_t access;
    uint16_t offset16;
    uint64_t offset32;
} __attribute__((packed, aligned(8)));

struct task_state_segment_long
{
	uint32_t r0;
	uint64_t rsp[3];
	uint64_t r1;
	uint64_t ist[7];
	uint64_t r2;
	uint16_t r3;
	uint16_t iomap_base;
} __attribute__((packed, aligned(8)));