aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/src')
-rw-r--r--arch/x86_64/src/context_switching/descriptor_table/segment_descriptor.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/x86_64/src/context_switching/descriptor_table/segment_descriptor.cpp b/arch/x86_64/src/context_switching/descriptor_table/segment_descriptor.cpp
index ab8eaba..a743ad2 100644
--- a/arch/x86_64/src/context_switching/descriptor_table/segment_descriptor.cpp
+++ b/arch/x86_64/src/context_switching/descriptor_table/segment_descriptor.cpp
@@ -3,22 +3,26 @@
namespace teachos::arch::context_switching::descriptor_table
{
segment_descriptor::segment_descriptor(uint128_t flags)
- : _reserved(flags >> 96U)
+ : _limit_1(flags << 112U)
+ , _base_1((flags >> 16U) << 88U)
, _access((flags >> 44U) << 80U, (flags >> 40U) << 84U)
+ , _limit_2((flags >> 48U) << 72U)
, _flag((flags >> 52U) << 72U)
- , _base(((flags >> 64U) << 32U) << 32U | ((flags >> 56U) << 64U) << 24U | (flags >> 16U) << 88U)
- , _limit(((flags >> 48U) << 72U) << 16U | flags << 112U)
+ , _base_2((flags >> 56U) << 32U)
+ , _reserved(flags >> 96U)
{
// Nothing to do.
}
segment_descriptor::segment_descriptor(access_byte access_byte, gdt_flags flags, uint64_t base,
std::bitset<20U> limit)
- : _reserved(0U)
+ : _limit_1((limit.to_ulong() << 4U) >> 16U)
+ , _base_1((base << 40U) >> 40U)
, _access(access_byte)
+ , _limit_2(limit.to_ulong() >> 16U)
, _flag(flags)
- , _base(base)
- , _limit(limit)
+ , _base_2(base >> 24U)
+ , _reserved(0U)
{
// Nothing to do
}