x86 segment descriptor infrastructure.
More...
Go to the source code of this file.
|
#define | SEG_ATTR_G 0x8000 |
| Granularity of limit (0 = 1, 1 = 4K) More...
|
|
#define | SEG_ATTR_AVL 0x1000 |
| Available for software use. More...
|
|
#define | SEG_ATTR_P 0x0080 |
| Present? More...
|
|
#define | SEG_ATTR_S 0x0010 |
| !System desc (0 = system, 1 = user) More...
|
|
#define | SEG_ATTR_A 0x0001 |
| Accessed? (set by hardware) More...
|
|
#define | SEG_ATTR_COMMON 0x8091 |
| Commonly set bits (G P S A) More...
|
|
#define | SEG_ATTR_DPL0 0x0000 |
| Descriptor privilege level 0. More...
|
|
#define | SEG_ATTR_DPL1 0x0020 |
| Descriptor privilege level 1. More...
|
|
#define | SEG_ATTR_DPL2 0x0040 |
| Descriptor privilege level 2. More...
|
|
#define | SEG_ATTR_DPL3 0x0060 |
| Descriptor privilege level 3. More...
|
|
#define | SEG_ATTR_CODE 0x0008 |
| Type (0 = data, 1 = code)
More...
|
|
#define | SEG_ATTR_DATA 0x0000 |
| Type (0 = data, 1 = code)
More...
|
|
#define | SEG_ATTR_D 0x4000 |
| Default operand size (0 = 16bit, 1 = 32bit) More...
|
|
#define | SEG_ATTR_L 0x2000 |
| Long segment? (1 = 64bit) More...
|
|
#define | SEG_ATTR_C 0x0004 |
| Conforming? (0 = non, 1 = conforming) More...
|
|
#define | SEG_ATTR_R 0x0002 |
| Readable? (0 = XO seg, 1 = RX seg) More...
|
|
#define | SEG_ATTR_B 0x4000 |
| 'Big' flag. More...
|
|
#define | SEG_ATTR_E 0x0004 |
| Expand-down? (0 = normal, 1 = expand-down) More...
|
|
#define | SEG_ATTR_W 0x0002 |
| Writable? (0 = RO seg, 1 = RW seg) More...
|
|
#define | INIT_GDTE(base, limit, attr) |
| Initialiser for an LDT/GDT entry using a raw attribute number. More...
|
|
#define | GDTE(base, limit, attr) ((user_desc)INIT_GDTE(base, limit, attr)) |
| As INIT_GDTE(), but creates a user_desc object. More...
|
|
x86 segment descriptor infrastructure.
Definition in file desc.h.
◆ SEG_ATTR_G
#define SEG_ATTR_G 0x8000 |
Granularity of limit (0 = 1, 1 = 4K)
Definition at line 65 of file desc.h.
◆ SEG_ATTR_AVL
#define SEG_ATTR_AVL 0x1000 |
Available for software use.
Definition at line 66 of file desc.h.
◆ SEG_ATTR_P
#define SEG_ATTR_P 0x0080 |
Present?
Definition at line 67 of file desc.h.
◆ SEG_ATTR_S
#define SEG_ATTR_S 0x0010 |
!System desc (0 = system, 1 = user)
Definition at line 68 of file desc.h.
◆ SEG_ATTR_A
#define SEG_ATTR_A 0x0001 |
Accessed? (set by hardware)
Definition at line 69 of file desc.h.
◆ SEG_ATTR_COMMON
#define SEG_ATTR_COMMON 0x8091 |
Commonly set bits (G P S A)
Definition at line 71 of file desc.h.
◆ SEG_ATTR_DPL0
#define SEG_ATTR_DPL0 0x0000 |
Descriptor privilege level 0.
Definition at line 73 of file desc.h.
◆ SEG_ATTR_DPL1
#define SEG_ATTR_DPL1 0x0020 |
Descriptor privilege level 1.
Definition at line 74 of file desc.h.
◆ SEG_ATTR_DPL2
#define SEG_ATTR_DPL2 0x0040 |
Descriptor privilege level 2.
Definition at line 75 of file desc.h.
◆ SEG_ATTR_DPL3
#define SEG_ATTR_DPL3 0x0060 |
Descriptor privilege level 3.
Definition at line 76 of file desc.h.
◆ SEG_ATTR_CODE
#define SEG_ATTR_CODE 0x0008 |
Type (0 = data, 1 = code)
Definition at line 77 of file desc.h.
◆ SEG_ATTR_DATA
#define SEG_ATTR_DATA 0x0000 |
Type (0 = data, 1 = code)
Definition at line 78 of file desc.h.
◆ SEG_ATTR_D
#define SEG_ATTR_D 0x4000 |
Default operand size (0 = 16bit, 1 = 32bit)
Definition at line 81 of file desc.h.
◆ SEG_ATTR_L
#define SEG_ATTR_L 0x2000 |
Long segment? (1 = 64bit)
Definition at line 82 of file desc.h.
◆ SEG_ATTR_C
#define SEG_ATTR_C 0x0004 |
Conforming? (0 = non, 1 = conforming)
Definition at line 83 of file desc.h.
◆ SEG_ATTR_R
#define SEG_ATTR_R 0x0002 |
Readable? (0 = XO seg, 1 = RX seg)
Definition at line 84 of file desc.h.
◆ SEG_ATTR_B
#define SEG_ATTR_B 0x4000 |
'Big' flag.
- For ss, default operand size.
- For expand-down segment, sets upper bound.
Definition at line 89 of file desc.h.
◆ SEG_ATTR_E
#define SEG_ATTR_E 0x0004 |
Expand-down? (0 = normal, 1 = expand-down)
Definition at line 90 of file desc.h.
◆ SEG_ATTR_W
#define SEG_ATTR_W 0x0002 |
Writable? (0 = RO seg, 1 = RW seg)
Definition at line 91 of file desc.h.
◆ INIT_GDTE
#define INIT_GDTE |
( |
|
base, |
|
|
|
limit, |
|
|
|
attr |
|
) |
| |
Value: { { { \
.lo = (((base) & 0xffff) << 16) | ((limit) & 0xffff), \
.hi = ((base) & 0xff000000) | ((limit) & 0xf0000) | \
(((attr) & 0xf0ff) << 8) | (((base) & 0xff0000) >> 16) \
} } }
Initialiser for an LDT/GDT entry using a raw attribute number.
- Parameters
-
base | Segment base. |
limit | Segment limit. |
attr | Segment attributes. |
Definition at line 100 of file desc.h.
◆ GDTE
#define GDTE |
( |
|
base, |
|
|
|
limit, |
|
|
|
attr |
|
) |
| ((user_desc)INIT_GDTE(base, limit, attr)) |
◆ user_desc_base()
static unsigned long user_desc_base |
( |
const user_desc * |
d | ) |
|
|
inlinestatic |
◆ user_desc_limit()
static unsigned int user_desc_limit |
( |
const user_desc * |
d | ) |
|
|
inlinestatic |
◆ pack_tss_desc()
static void pack_tss_desc |
( |
user_desc * |
d, |
|
|
const env_tss * |
t |
|
) |
| |
|
inlinestatic |
◆ pack_ldt_desc()
static void pack_ldt_desc |
( |
user_desc * |
d, |
|
|
const user_desc * |
ldt, |
|
|
unsigned int |
limit |
|
) |
| |
|
inlinestatic |
◆ gdt
◆ gdt_ptr