Iros
 
Loading...
Searching...
No Matches
system_segment_descriptor.h
Go to the documentation of this file.
1#pragma once
2
3#include "di/bit/prelude.h"
4
6using namespace di::bit;
7
8// The format of the 64 bit System Segment Descriptor is described
9// in the AMD64 Programmer's Manual; Volume 2; Figure 4-22, and on
10// the OSDEV wiki at the page:
11// https://wiki.osdev.org/Global_Descriptor_Table#Long_Mode_System_Segment_Descriptor
12struct LimitLow : BitField<0, 16> {};
13struct BaseLow : BitField<16, 16> {};
14struct BaseMidLow : BitField<32, 8> {};
15
16// The only relevant system segment descriptor for the GDT is the TSS.
17struct Type : BitField<40, 4> {
18 constexpr static u8 TSS = 0b1001;
19};
20
21struct DPL : BitField<45, 2> {};
22struct Present : BitFlag<47> {};
23struct LimitHigh : BitField<48, 16> {};
24struct Granular : BitFlag<55> {};
25struct BaseMidHigh : BitField<56, 8> {};
26struct BaseHigh : BitField<64, 32> {};
27
30
31void init_tss();
32}
Definition bit_struct.h:11
Definition bit_proxy_reference.h:5
__UINT8_TYPE__ u8
Definition integers.h:9
Definition system_segment_descriptor.h:5
BitStruct< 16, LimitLow, BaseLow, BaseMidLow, Type, DPL, Present, LimitHigh, BaseMidHigh, Granular, BaseHigh > SystemSegmentDescriptor
Definition system_segment_descriptor.h:28
constexpr BitField(Value value)
Definition bit_field.h:28
constexpr BitFlag(bool value)
Definition bit_flag.h:19
Definition system_segment_descriptor.h:26
Definition system_segment_descriptor.h:13
Definition system_segment_descriptor.h:25
Definition system_segment_descriptor.h:14
Definition system_segment_descriptor.h:21
Definition system_segment_descriptor.h:24
Definition system_segment_descriptor.h:23
Definition system_segment_descriptor.h:12
Definition system_segment_descriptor.h:22
Definition system_segment_descriptor.h:17
static constexpr u8 TSS
Definition system_segment_descriptor.h:18