aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2025-03-25 12:04:43 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2025-03-25 12:04:43 +0000
commitccb47845d99e098c183f596cd1a3eb1db5c676da (patch)
tree1fabfc2752d015c96beb36e81c0e89cde13ad9f6 /arch
parentb6ee8bec7ed23fd0c544f67f735e96b2bfe67682 (diff)
downloadteachos-ccb47845d99e098c183f596cd1a3eb1db5c676da.tar.xz
teachos-ccb47845d99e098c183f596cd1a3eb1db5c676da.zip
Adjust file structure and fix compilation issues
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/CMakeLists.txt18
-rw-r--r--arch/x86_64/include/arch/context_switching/descriptor_table/gate_descriptor.hpp15
-rw-r--r--arch/x86_64/include/arch/context_switching/descriptor_table/initialization.hpp23
-rw-r--r--arch/x86_64/include/arch/context_switching/descriptor_table/interrupt_descriptor_table.hpp14
-rw-r--r--arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/gate_descriptor.hpp15
-rw-r--r--arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.hpp14
-rw-r--r--arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.hpp (renamed from arch/x86_64/include/arch/context_switching/descriptor_table/interrupt_descriptor_table_pointer.hpp)14
-rw-r--r--arch/x86_64/include/arch/context_switching/main.hpp23
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/access_byte.hpp (renamed from arch/x86_64/include/arch/context_switching/descriptor_table/access_byte.hpp)10
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/gdt_flags.hpp (renamed from arch/x86_64/include/arch/context_switching/descriptor_table/gdt_flags.hpp)12
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/global_descriptor_table.hpp (renamed from arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table.hpp)14
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/global_descriptor_table_pointer.hpp (renamed from arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table_pointer.hpp)12
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor.hpp (renamed from arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor.hpp)16
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor_type.hpp (renamed from arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor_type.hpp)10
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/task_state_segment.hpp (renamed from arch/x86_64/include/arch/context_switching/descriptor_table/task_state_segment.hpp)10
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/gdtr.hpp9
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/idtr.hpp8
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/tr.hpp2
-rw-r--r--arch/x86_64/src/context_switching/descriptor_table/gate_descriptor.cpp5
-rw-r--r--arch/x86_64/src/context_switching/descriptor_table/gdt_flags.cpp18
-rw-r--r--arch/x86_64/src/context_switching/descriptor_table/initialization.cpp38
-rw-r--r--arch/x86_64/src/context_switching/descriptor_table/interrupt_descriptor_table.cpp10
-rw-r--r--arch/x86_64/src/context_switching/interrupt_descriptor_table/gate_descriptor.cpp5
-rw-r--r--arch/x86_64/src/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.cpp10
-rw-r--r--arch/x86_64/src/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.cpp (renamed from arch/x86_64/src/context_switching/descriptor_table/interrupt_descriptor_table_pointer.cpp)6
-rw-r--r--arch/x86_64/src/context_switching/main.cpp36
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/access_byte.cpp (renamed from arch/x86_64/src/context_switching/descriptor_table/access_byte.cpp)6
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/gdt_flags.cpp18
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/global_descriptor_table.cpp (renamed from arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp)10
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/global_descriptor_table_pointer.cpp (renamed from arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table_pointer.cpp)6
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/segment_descriptor.cpp (renamed from arch/x86_64/src/context_switching/descriptor_table/segment_descriptor.cpp)6
-rw-r--r--arch/x86_64/src/kernel/cpu/gdtr.cpp11
-rw-r--r--arch/x86_64/src/kernel/cpu/idtr.cpp9
-rw-r--r--arch/x86_64/src/kernel/main.cpp4
34 files changed, 215 insertions, 222 deletions
diff --git a/arch/x86_64/CMakeLists.txt b/arch/x86_64/CMakeLists.txt
index a435ef9..cf92feb 100644
--- a/arch/x86_64/CMakeLists.txt
+++ b/arch/x86_64/CMakeLists.txt
@@ -92,15 +92,15 @@ target_sources("_exception" PRIVATE
#]============================================================================]
target_sources("_context" PRIVATE
- "src/context_switching/descriptor_table/access_byte.cpp"
- "src/context_switching/descriptor_table/gate_descriptor.cpp"
- "src/context_switching/descriptor_table/gdt_flags.cpp"
- "src/context_switching/descriptor_table/global_descriptor_table.cpp"
- "src/context_switching/descriptor_table/global_descriptor_table_pointer.cpp"
- "src/context_switching/descriptor_table/initialization.cpp"
- "src/context_switching/descriptor_table/interrupt_descriptor_table.cpp"
- "src/context_switching/descriptor_table/interrupt_descriptor_table_pointer.cpp"
- "src/context_switching/descriptor_table/segment_descriptor.cpp"
+ "src/context_switching/segment_descriptor_table/access_byte.cpp"
+ "src/context_switching/segment_descriptor_table/gdt_flags.cpp"
+ "src/context_switching/segment_descriptor_table/global_descriptor_table.cpp"
+ "src/context_switching/segment_descriptor_table/global_descriptor_table_pointer.cpp"
+ "src/context_switching/segment_descriptor_table/segment_descriptor.cpp"
+ "src/context_switching/main.cpp"
+ "src/context_switching/interrupt_descriptor_table/gate_descriptor.cpp"
+ "src/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.cpp"
+ "src/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.cpp"
)
#[============================================================================[
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/gate_descriptor.hpp b/arch/x86_64/include/arch/context_switching/descriptor_table/gate_descriptor.hpp
deleted file mode 100644
index f410219..0000000
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/gate_descriptor.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GATE_DESCRIPTOR_HPP
-#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GATE_DESCRIPTOR_HPP
-
-namespace teachos::arch::context_switching::descriptor_table
-{
- struct [[gnu::packed]] gate_descriptor
- {
- /**
- * @brief Default Constructor.
- */
- gate_descriptor() = default;
- };
-} // namespace teachos::arch::context_switching::descriptor_table
-
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GATE_DESCRIPTOR_HPP
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/initialization.hpp b/arch/x86_64/include/arch/context_switching/descriptor_table/initialization.hpp
deleted file mode 100644
index c587000..0000000
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/initialization.hpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_HPP
-#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_HPP
-
-#include "arch/context_switching/descriptor_table/global_descriptor_table.hpp"
-#include "arch/context_switching/descriptor_table/interrupt_descriptor_table.hpp"
-
-namespace teachos::arch::context_switching::descriptor_table
-{
- /**
- * @brief TODO
- *
- */
- struct descriptor_tables
- {
- global_descriptor_table & gdt; ///< Reference to the global descriptor table.
- interrupt_descriptor_table & idt; ///< Reference to the interrupt descriptor table.
- };
-
- auto initialize_descriptor_tables() -> descriptor_tables;
-
-} // namespace teachos::arch::context_switching::descriptor_table
-
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_HPP
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/interrupt_descriptor_table.hpp b/arch/x86_64/include/arch/context_switching/descriptor_table/interrupt_descriptor_table.hpp
deleted file mode 100644
index c63932d..0000000
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/interrupt_descriptor_table.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_HPP
-#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_HPP
-
-namespace teachos::arch::context_switching::descriptor_table
-{
- struct interrupt_descriptor_table
- {
- };
-
- auto initialize_interrupt_descriptor_table() -> void;
-
-} // namespace teachos::arch::context_switching::descriptor_table
-
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_HPP
diff --git a/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/gate_descriptor.hpp b/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/gate_descriptor.hpp
new file mode 100644
index 0000000..2252b7b
--- /dev/null
+++ b/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/gate_descriptor.hpp
@@ -0,0 +1,15 @@
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_INTERRRUPT_DESCRIPTOR_TABLE_GATE_DESCRIPTOR_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_INTERRRUPT_DESCRIPTOR_TABLE_GATE_DESCRIPTOR_HPP
+
+namespace teachos::arch::context_switching::interrupt_descriptor_table
+{
+ struct [[gnu::packed]] gate_descriptor
+ {
+ /**
+ * @brief Default Constructor.
+ */
+ gate_descriptor() = default;
+ };
+} // namespace teachos::arch::context_switching::interrupt_descriptor_table
+
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_INTERRRUPT_DESCRIPTOR_TABLE_GATE_DESCRIPTOR_HPP
diff --git a/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.hpp b/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.hpp
new file mode 100644
index 0000000..ac52a39
--- /dev/null
+++ b/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.hpp
@@ -0,0 +1,14 @@
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_INTERRRUPT_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_INTERRRUPT_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_HPP
+
+namespace teachos::arch::context_switching::interrupt_descriptor_table
+{
+ struct interrupt_descriptor_table
+ {
+ };
+
+ auto initialize_interrupt_descriptor_table() -> void;
+
+} // namespace teachos::arch::context_switching::interrupt_descriptor_table
+
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_INTERRRUPT_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_HPP
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/interrupt_descriptor_table_pointer.hpp b/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.hpp
index e8935f4..de40f90 100644
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/interrupt_descriptor_table_pointer.hpp
+++ b/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.hpp
@@ -1,12 +1,12 @@
-#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_POINTER_HPP
-#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_POINTER_HPP
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_INTERRRUPT_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_POINTER_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_INTERRRUPT_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_POINTER_HPP
-#include "arch/context_switching/descriptor_table/gate_descriptor.hpp"
+#include "arch/context_switching/interrupt_descriptor_table/gate_descriptor.hpp"
#include "arch/stl/vector.hpp"
#include <cstdint>
-namespace teachos::arch::context_switching::descriptor_table
+namespace teachos::arch::context_switching::interrupt_descriptor_table
{
typedef stl::vector<gate_descriptor> interrupt_descriptor_table;
@@ -34,9 +34,9 @@ namespace teachos::arch::context_switching::descriptor_table
private:
uint16_t table_length = {}; ///< The amount of segment descriptor entries in the global descriptor table - 1.
- interrupt_descriptor_table address = {}; ///< Non-owning pointer to the IDT base address.
+ interrupt_descriptor_table * address = {}; ///< Non-owning pointer to the IDT base address.
};
-} // namespace teachos::arch::context_switching::descriptor_table
+} // namespace teachos::arch::context_switching::interrupt_descriptor_table
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_POINTER_HPP
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_INTERRRUPT_DESCRIPTOR_TABLE_INTERRUPT_DESCRIPTOR_TABLE_POINTER_HPP
diff --git a/arch/x86_64/include/arch/context_switching/main.hpp b/arch/x86_64/include/arch/context_switching/main.hpp
new file mode 100644
index 0000000..ef642d6
--- /dev/null
+++ b/arch/x86_64/include/arch/context_switching/main.hpp
@@ -0,0 +1,23 @@
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_MAIN_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_MAIN_HPP
+
+#include "arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.hpp"
+#include "arch/context_switching/segment_descriptor_table/global_descriptor_table.hpp"
+
+namespace teachos::arch::context_switching
+{
+ /**
+ * @brief TODO
+ *
+ */
+ struct descriptor_tables
+ {
+ segment_descriptor_table::global_descriptor_table & gdt; ///< Reference to the global descriptor table.
+ interrupt_descriptor_table::interrupt_descriptor_table & idt; ///< Reference to the interrupt descriptor table.
+ };
+
+ auto initialize_descriptor_tables() -> descriptor_tables;
+
+} // namespace teachos::arch::context_switching
+
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_MAIN_HPP
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/access_byte.hpp b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/access_byte.hpp
index 646c2ca..bbf3f49 100644
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/access_byte.hpp
+++ b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/access_byte.hpp
@@ -1,11 +1,11 @@
-#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_ACCESS_BYTE_HPP
-#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_ACCESS_BYTE_HPP
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_ACCESS_BYTE_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_ACCESS_BYTE_HPP
#include <bitset>
#include <cstdint>
-namespace teachos::arch::context_switching::descriptor_table
+namespace teachos::arch::context_switching::segment_descriptor_table
{
/**
* @brief Defines helper function for all states that the access byte field of a segment descriptor can
@@ -92,6 +92,6 @@ namespace teachos::arch::context_switching::descriptor_table
private:
uint8_t _flags = {}; ///< Underlying bitset used to read the flags from.
};
-} // namespace teachos::arch::context_switching::descriptor_table
+} // namespace teachos::arch::context_switching::segment_descriptor_table
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_ACCESS_BYTE_HPP \ No newline at end of file
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_ACCESS_BYTE_HPP \ No newline at end of file
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/gdt_flags.hpp b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/gdt_flags.hpp
index de41762..2ce5286 100644
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/gdt_flags.hpp
+++ b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/gdt_flags.hpp
@@ -1,11 +1,11 @@
-#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GDT_FLAGS_HPP
-#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GDT_FLAGS_HPP
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_GDT_FLAGS_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_GDT_FLAGS_HPP
-#include "arch/context_switching/descriptor_table/segment_descriptor_type.hpp"
+#include "arch/context_switching/segment_descriptor_table/segment_descriptor_type.hpp"
#include <bitset>
-namespace teachos::arch::context_switching::descriptor_table
+namespace teachos::arch::context_switching::segment_descriptor_table
{
/**
* @brief Defines helper function for all states that the flags field of a segment descriptor can
@@ -81,6 +81,6 @@ namespace teachos::arch::context_switching::descriptor_table
uint8_t _limit_2 : 4 = {};
uint8_t _flags : 4 = {}; ///< Underlying bitset used to read the flags from.
};
-} // namespace teachos::arch::context_switching::descriptor_table
+} // namespace teachos::arch::context_switching::segment_descriptor_table
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GDT_FLAGS_HPP
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_GDT_FLAGS_HPP
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table.hpp b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/global_descriptor_table.hpp
index 75e1e9d..a111a1f 100644
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table.hpp
+++ b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/global_descriptor_table.hpp
@@ -1,10 +1,10 @@
-#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_HPP
-#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_HPP
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_HPP
-#include "arch/context_switching/descriptor_table/global_descriptor_table_pointer.hpp"
-#include "arch/context_switching/descriptor_table/task_state_segment.hpp"
+#include "arch/context_switching/segment_descriptor_table/global_descriptor_table_pointer.hpp"
+#include "arch/context_switching/segment_descriptor_table/task_state_segment.hpp"
-namespace teachos::arch::context_switching::descriptor_table
+namespace teachos::arch::context_switching::segment_descriptor_table
{
enum class access_level
{
@@ -50,6 +50,6 @@ namespace teachos::arch::context_switching::descriptor_table
*/
auto initialize_global_descriptor_table() -> global_descriptor_table &;
-} // namespace teachos::arch::context_switching::descriptor_table
+} // namespace teachos::arch::context_switching::segment_descriptor_table
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_HPP
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_HPP
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/segment_descriptor_table/global_descriptor_table_pointer.hpp
index ed17be3..b66070b 100644
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/global_descriptor_table_pointer.hpp
+++ b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/global_descriptor_table_pointer.hpp
@@ -1,12 +1,12 @@
-#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
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_POINTER_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_POINTER_HPP
-#include "arch/context_switching/descriptor_table/segment_descriptor.hpp"
+#include "arch/context_switching/segment_descriptor_table/segment_descriptor.hpp"
#include "arch/stl/vector.hpp"
#include <cstdint>
-namespace teachos::arch::context_switching::descriptor_table
+namespace teachos::arch::context_switching::segment_descriptor_table
{
typedef stl::vector<segment_descriptor> global_descriptor_table;
@@ -37,6 +37,6 @@ namespace teachos::arch::context_switching::descriptor_table
uint16_t table_length = {}; ///< The amount of segment descriptor entries in the global descriptor table - 1.
global_descriptor_table * address = {}; ///< Non-owning pointer to the GDT base address.
};
-} // namespace teachos::arch::context_switching::descriptor_table
+} // namespace teachos::arch::context_switching::segment_descriptor_table
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_POINTER_HPP
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_GLOBAL_DESCRIPTOR_TABLE_POINTER_HPP
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor.hpp b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor.hpp
index 8714eb8..7fe4ecb 100644
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor.hpp
+++ b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor.hpp
@@ -1,11 +1,11 @@
-#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_HPP
-#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_HPP
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_HPP
-#include "arch/context_switching/descriptor_table/access_byte.hpp"
-#include "arch/context_switching/descriptor_table/gdt_flags.hpp"
-#include "arch/context_switching/descriptor_table/segment_descriptor_type.hpp"
+#include "arch/context_switching/segment_descriptor_table/access_byte.hpp"
+#include "arch/context_switching/segment_descriptor_table/gdt_flags.hpp"
+#include "arch/context_switching/segment_descriptor_table/segment_descriptor_type.hpp"
-namespace teachos::arch::context_switching::descriptor_table
+namespace teachos::arch::context_switching::segment_descriptor_table
{
__extension__ typedef __int128 int128_t;
__extension__ typedef unsigned __int128 uint128_t;
@@ -66,6 +66,6 @@ namespace teachos::arch::context_switching::descriptor_table
uint64_t _base_2 : 40 = {}; ///< Second part of the base field (56 - 95)
uint32_t : 32; ///< Reserved field used to ensure this struct is 128 bits big (96 - 127)
};
-} // namespace teachos::arch::context_switching::descriptor_table
+} // namespace teachos::arch::context_switching::segment_descriptor_table
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_HPP
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_HPP
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor_type.hpp b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor_type.hpp
index 4815fca..8770b81 100644
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/segment_descriptor_type.hpp
+++ b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor_type.hpp
@@ -1,9 +1,9 @@
-#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_TYPES_HPP
-#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_TYPES_HPP
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_TYPES_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_TYPES_HPP
#include <cstdint>
-namespace teachos::arch::context_switching::descriptor_table
+namespace teachos::arch::context_switching::segment_descriptor_table
{
/**
* @brief Possible overlying types of the segment descriptor. Allowing to discern between the major types, which
@@ -22,6 +22,6 @@ namespace teachos::arch::context_switching::descriptor_table
///< further distinguised to specific data segment types using the the remaining bits in
///< the Type Field in the Access Byte.
};
-} // namespace teachos::arch::context_switching::descriptor_table
+} // namespace teachos::arch::context_switching::segment_descriptor_table
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_TYPES_HPP
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_SEGMENT_DESCRIPTOR_TYPES_HPP
diff --git a/arch/x86_64/include/arch/context_switching/descriptor_table/task_state_segment.hpp b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/task_state_segment.hpp
index 1e306af..d4aa5e8 100644
--- a/arch/x86_64/include/arch/context_switching/descriptor_table/task_state_segment.hpp
+++ b/arch/x86_64/include/arch/context_switching/segment_descriptor_table/task_state_segment.hpp
@@ -1,9 +1,9 @@
-#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_TASK_STATE_SEGMENT_HPP
-#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_TASK_STATE_SEGMENT_HPP
+#ifndef TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_TASK_STATE_SEGMENT_HPP
+#define TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_TASK_STATE_SEGMENT_HPP
#include <cstdint>
-namespace teachos::arch::context_switching::descriptor_table
+namespace teachos::arch::context_switching::segment_descriptor_table
{
/**
* @brief 64-bit task state segment
@@ -27,6 +27,6 @@ namespace teachos::arch::context_switching::descriptor_table
uint16_t : 16;
uint16_t io_map_base_address = {};
};
-} // namespace teachos::arch::context_switching::descriptor_table
+} // namespace teachos::arch::context_switching::segment_descriptor_table
-#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_DESCRIPTOR_TABLE_TASK_STATE_SEGMENT_HPP
+#endif // TEACHOS_ARCH_X86_64_CONTEXT_SWITCHING_SEGMENT_DESCRIPTOR_TABLE_TASK_STATE_SEGMENT_HPP
diff --git a/arch/x86_64/include/arch/kernel/cpu/gdtr.hpp b/arch/x86_64/include/arch/kernel/cpu/gdtr.hpp
index f9220b9..68b950d 100644
--- a/arch/x86_64/include/arch/kernel/cpu/gdtr.hpp
+++ b/arch/x86_64/include/arch/kernel/cpu/gdtr.hpp
@@ -1,7 +1,7 @@
#ifndef TEACHOS_ARCH_X86_64_KERNEL_CPU_GDTR_HPP
#define TEACHOS_ARCH_X86_64_KERNEL_CPU_GDTR_HPP
-#include "arch/context_switching/descriptor_table/global_descriptor_table_pointer.hpp"
+#include "arch/context_switching/segment_descriptor_table/global_descriptor_table_pointer.hpp"
#include <bitset>
#include <cstdint>
@@ -14,14 +14,13 @@ namespace teachos::arch::kernel::cpu
*
* @return Value of GDTR register.
*/
- auto store_global_descriptor_table() -> context_switching::descriptor_table::global_descriptor_table_pointer;
+ auto store_global_descriptor_table() -> context_switching::segment_descriptor_table::global_descriptor_table_pointer;
/**
* @brief Loads the global_descriptor_table_pointer into the global descriptor table register (GDTR).
*/
- auto
- load_global_descriptor_table(context_switching::descriptor_table::global_descriptor_table_pointer const & gdt_pointer)
- -> void;
+ auto load_global_descriptor_table(
+ context_switching::segment_descriptor_table::global_descriptor_table_pointer const & gdt_pointer) -> void;
} // namespace teachos::arch::kernel::cpu
diff --git a/arch/x86_64/include/arch/kernel/cpu/idtr.hpp b/arch/x86_64/include/arch/kernel/cpu/idtr.hpp
index 724fbdf..cb800d0 100644
--- a/arch/x86_64/include/arch/kernel/cpu/idtr.hpp
+++ b/arch/x86_64/include/arch/kernel/cpu/idtr.hpp
@@ -1,26 +1,26 @@
#ifndef TEACHOS_ARCH_X86_64_KERNEL_CPU_IDTR_HPP
#define TEACHOS_ARCH_X86_64_KERNEL_CPU_IDTR_HPP
-#include "arch/context_switching/descriptor_table/global_descriptor_table_pointer.hpp"
+#include "arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.hpp"
#include <bitset>
#include <cstdint>
namespace teachos::arch::kernel::cpu
{
-
/**
* @brief Returns the value in the IDTR register.
*
* @return Value of IDTR register.
*/
- auto store_interrupt_descriptor_table() -> context_switching::descriptor_table::interrupt_descriptor_table_pointer;
+ auto store_interrupt_descriptor_table()
+ -> context_switching::interrupt_descriptor_table::interrupt_descriptor_table_pointer;
/**
* @brief Loads the interrupt_descriptor_table_pointer into the interrupt descriptor table register (IDTR).
*/
auto load_interrupt_descriptor_table(
- context_switching::descriptor_table::interrupt_descriptor_table_pointer const & idt_pointer) -> void;
+ context_switching::interrupt_descriptor_table::interrupt_descriptor_table_pointer const & idt_pointer) -> void;
} // namespace teachos::arch::kernel::cpu
diff --git a/arch/x86_64/include/arch/kernel/cpu/tr.hpp b/arch/x86_64/include/arch/kernel/cpu/tr.hpp
index 562fab7..7c856f1 100644
--- a/arch/x86_64/include/arch/kernel/cpu/tr.hpp
+++ b/arch/x86_64/include/arch/kernel/cpu/tr.hpp
@@ -1,8 +1,6 @@
#ifndef TEACHOS_ARCH_X86_64_KERNEL_CPU_TR_HPP
#define TEACHOS_ARCH_X86_64_KERNEL_CPU_TR_HPP
-#include "arch/context_switching/descriptor_table/task_state_segment.hpp"
-
#include <bitset>