diff options
| author | Fabian Imhof <fabian.imhof@ost.ch> | 2025-02-27 13:09:55 +0000 |
|---|---|---|
| committer | Fabian Imhof <fabian.imhof@ost.ch> | 2025-02-27 13:09:55 +0000 |
| commit | 2f7db60472629dbd191c00e6010d120a046f5ab9 (patch) | |
| tree | c3eb3c73d221c1da65669dee44b8ba684eb39d9a /arch/x86_64/include | |
| parent | d8a8efe3e8d90ec83069d1c934ff319626e87a2d (diff) | |
| download | teachos-2f7db60472629dbd191c00e6010d120a046f5ab9.tar.xz teachos-2f7db60472629dbd191c00e6010d120a046f5ab9.zip | |
start segment_descriptor
Diffstat (limited to 'arch/x86_64/include')
| -rw-r--r-- | arch/x86_64/include/arch/context_switching/descriptor_table/access_byte.hpp | 6 | ||||
| -rw-r--r-- | arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor.hpp | 41 |
2 files changed, 44 insertions, 3 deletions
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/access_byte.hpp b/arch/x86_64/include/arch/context_switching/descriptor_table/access_byte.hpp index b3bce11..36b22ce 100644 --- a/arch/x86_64/include/arch/context_switching/descriptor_table/access_byte.hpp +++ b/arch/x86_64/include/arch/context_switching/descriptor_table/access_byte.hpp @@ -1,6 +1,6 @@ -#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_POINTERS_HPP -#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_POINTERS_HPP +#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_ACCESS_BYTE_HPP +#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_ACCESS_BYTE_HPP #include <bitset> #include <cstddef> @@ -84,4 +84,4 @@ namespace teachos::arch::context_switching::descriptor_table }; } // namespace teachos::arch::context_switching::descriptor_table -#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_POINTERS_HPP
\ No newline at end of file +#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_ACCESS_BYTE_HPP
\ No newline at end of file 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 e69de29..ced0d89 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 @@ -0,0 +1,41 @@ +#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_HPP +#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_HPP + +#include "arch/context_switching/descriptor_table/gdt_flags.hpp" + +#include <bitset> +#include <cstddef> +#include <cstdint> + +namespace teachos::arch::context_switching::descriptor_table +{ + struct segment_descriptor + { + /** + * @brief Possible set bits in our underlying std::bitset and the meaning when they are set. + */ + enum bitset : uint64_t + { + BASE = 1U << 0U, + FLAGS = 1U << 8U, + LIMIT = 1U << 12U, + ACCESS_BYTE = 1U << 16U, + BASE = 1U << 32U, + BASE = 1U << 40U, + LIMIT = 1U << 56U + }; + + explicit segment_descriptor(uint64_t flags) + : flags(flags) + { + // Nothing to do + } + + private: + std::uint8_t base1; + gdt_flags flags; + std::bitset<64U> flags; ///< Underlying bitset used to read the flags from + }; +} // namespace teachos::arch::context_switching::descriptor_table + +#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_HPP
\ No newline at end of file |
