222 std::copy_n(m_gdt_reg.
base, m_gdt_reg.
limit >> 3, std::back_inserter(m_gdt));
241 m_gdt_reg.
base = m_gdt.data();
271 {
return m_gdt_reg.
limit; }
300 sd1 = m_gdt.at(index);
301 sd1 = (sd1 & 0x00FFFF000000FFFF);
327 if ((sd1 & 0x100000000000) == 0)
329 sd2 = m_gdt.at(index + 1U);
330 sd2 = (sd2 & 0xFFFFFFFF00000000);
332 m_gdt.at(index + 0U) = sd1 | base_31_24 | base_23_16 | base_15_00;
333 m_gdt.at(index + 1U) = sd2 | base_63_32;
337 m_gdt.at(index + 0U) = sd1 | base_31_24 | base_23_16 | base_15_00;
386 sd1 = m_gdt.at(index);
387 base_type base_15_00 = ((sd1 & 0x00000000FFFF0000) >> 16);
388 base_type base_23_16 = ((sd1 & 0x000000FF00000000) >> 16);
389 base_type base_31_24 = ((sd1 & 0xFF00000000000000) >> 32);
391 if ((sd1 & 0x100000000000) == 0)
393 sd2 = m_gdt.at(index + 1U);
394 base_type base_63_32 = ((sd2 & 0x00000000FFFFFFFF) << 32);
396 return base_63_32 | base_31_24 | base_23_16 | base_15_00;
399 return base_31_24 | base_23_16 | base_15_00;
431 if ((sd1 & 0x80000000000000) != 0)
432 limit = (limit >> 12);
437 m_gdt.at(index) = sd1 | limit_19_16 | limit_15_00;
466 if ((sd1 & 0x80000000000000) != 0)
469 limit_type limit_19_16 = gsl::narrow_cast<limit_type>((sd1 & 0x000F000000000000) >> 32);
471 return ((limit_19_16 | limit_15_00) << 12) | 0x0000000000000FFF;
475 limit_type limit_19_16 = gsl::narrow_cast<limit_type>((sd1 & 0x000F000000000000) >> 32);
477 return limit_19_16 | limit_15_00;
520 m_gdt.at(index) = sd1 | access_rights_15_12 | access_rights_07_00;
553 return access_rights_15_12 | access_rights_07_00;
561 std::vector<segment_descriptor_type> m_gdt;
uint64_t segment_descriptor_type
gdt_x64(size_type size) noexcept
access_rights_type access_rights(index_type index) const
void __write_gdt(gdt_reg_x64_t *gdt_reg) noexcept
void set_base(index_type index, base_type base)
void set_access_rights(index_type index, access_rights_type access_rights)
void set_limit(index_type index, limit_type limit)
~gdt_x64() noexcept=default
constexpr const auto size
void uint64_t uint64_t uint64_t *rdx noexcept
auto index(const T virt, const F from)
gdt_reg_x64_t(base_type b, limit_type l) noexcept
limit_type limit(index_type index) const
uint32_t access_rights_type
void __read_gdt(gdt_reg_x64_t *gdt_reg) noexcept
E guard_exceptions(E error_code, T func)
uintptr_t integer_pointer
base_type base(index_type index) const