diff options
Diffstat (limited to 'arch/x86_64/include')
3 files changed, 14 insertions, 15 deletions
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table.hpp b/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table.hpp index 45f2d31..c4d0e30 100644 --- a/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table.hpp +++ b/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table.hpp @@ -2,13 +2,9 @@ #define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_HPP #include "arch/context_switching/descriptor_table/global_descriptor_table_pointer.hpp" -#include "arch/context_switching/descriptor_table/segment_descriptor.hpp" -#include "arch/stl/vector.hpp" namespace teachos::arch::context_switching::descriptor_table { - typedef stl::vector<segment_descriptor> global_descriptor_table; - auto create_global_descriptor_table() -> global_descriptor_table; auto initialize_global_descriptor_table() -> global_descriptor_table; diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table_pointer.hpp b/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table_pointer.hpp index 0305bff..d4febe1 100644 --- a/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table_pointer.hpp +++ b/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table_pointer.hpp @@ -1,10 +1,15 @@ #ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_POINTER_HPP #define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_POINTER_HPP +#include "arch/context_switching/descriptor_table/segment_descriptor.hpp" +#include "arch/stl/vector.hpp" + #include <cstdint> namespace teachos::arch::context_switching::descriptor_table { + typedef stl::vector<segment_descriptor> global_descriptor_table; + /** * @brief Represents a pointer to the Global Descriptor Table (GDT). * @@ -13,10 +18,8 @@ namespace teachos::arch::context_switching::descriptor_table */ struct global_descriptor_table_pointer { - std::size_t table_length; ///< The size of the GDT in bytes. - - // TODO: Would rather use global_descriptor_table *, but circular dependency - uint64_t address; ///< Pointer to the GDT base address. + std::size_t table_length; ///< The size of the GDT in bytes. + global_descriptor_table * address; ///< Pointer to the GDT base address. }; } // namespace teachos::arch::context_switching::descriptor_table diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor.hpp b/arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor.hpp index 06e2e8a..86b6c75 100644 --- a/arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor.hpp +++ b/arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor.hpp @@ -52,13 +52,13 @@ namespace teachos::arch::context_switching::descriptor_table private: // The order in private variables starts for the first variable being the rightmost bit. - std::bitset<16U> _limit_1 = {}; ///< First part of the limit field (0 - 15) - std::bitset<24U> _base_1 = {}; ///< First part of the base field (16 - 39) - access_byte _access = {}; ///< Access byte field (40 - 47) - std::bitset<4U> _limit_2 = {}; ///< Second part of the limit field (48 - 51) - gdt_flags _flag = {}; ///< Flags field (52 - 55) - std::bitset<40U> _base_2 = {}; ///< Second part of the base field (56 - 95) - uint32_t _reserved = {}; ///< Reserved field used to ensure this struct is 128 bits big (96 - 127) + uint16_t _limit_1 = {}; ///< First part of the limit field (0 - 15) + std::bitset<24U> _base_1 = {}; ///< First part of the base field (16 - 39) + access_byte _access = {}; ///< Access byte field (40 - 47) + std::bitset<4U> _limit_2 = {}; ///< Second part of the limit field (48 - 51) + gdt_flags _flag = {}; ///< Flags field (52 - 55) + std::bitset<40U> _base_2 = {}; ///< Second part of the base field (56 - 95) + uint32_t _reserved = {}; ///< Reserved field used to ensure this struct is 128 bits big (96 - 127) }; } // namespace teachos::arch::context_switching::descriptor_table |
