aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2025-03-14 14:20:24 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2025-03-14 14:20:24 +0000
commitf2b9ac8f0f22354241e9b78e47aa7cb94e5ef511 (patch)
tree637d8b3432c2c2f9c7086af73cdf8408d487ac6e /arch/x86_64/src
parent11db9338dac611ea32e202add5ce5055b54ebb58 (diff)
downloadteachos-f2b9ac8f0f22354241e9b78e47aa7cb94e5ef511.tar.xz
teachos-f2b9ac8f0f22354241e9b78e47aa7cb94e5ef511.zip
Fix header recursion problem
Diffstat (limited to 'arch/x86_64/src')
-rw-r--r--arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp7
-rw-r--r--arch/x86_64/src/kernel/cpu/lgdt.cpp11
2 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp b/arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp
index ca3d7ff..f4ea61b 100644
--- a/arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp
+++ b/arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp
@@ -45,12 +45,9 @@ namespace teachos::arch::context_switching::descriptor_table
auto initialize_global_descriptor_table() -> global_descriptor_table
{
- global_descriptor_table gdt{create_global_descriptor_table()};
-
- // TODO: Second argument does not work yet (because pointer hpp)
+ decltype(auto) gdt = create_global_descriptor_table();
global_descriptor_table_pointer gdt_pointer{gdt.size() - 1, &gdt};
kernel::cpu::load_global_descriptor_table(gdt_pointer);
-
return gdt;
}
-} // namespace teachos::arch::context_switching::descriptor_table \ No newline at end of file
+} // namespace teachos::arch::context_switching::descriptor_table
diff --git a/arch/x86_64/src/kernel/cpu/lgdt.cpp b/arch/x86_64/src/kernel/cpu/lgdt.cpp
index cb13aa8..70a48dd 100644
--- a/arch/x86_64/src/kernel/cpu/lgdt.cpp
+++ b/arch/x86_64/src/kernel/cpu/lgdt.cpp
@@ -4,11 +4,14 @@
namespace teachos::arch::kernel::cpu
{
- auto load_global_descriptor_table(context_switching::descriptor_table::global_descriptor_table_pointer gdt_pointer)
+ auto
+ load_global_descriptor_table(context_switching::descriptor_table::global_descriptor_table_pointer const & gdt_pointer)
-> void
{
// TODO: build lgdt argument from global_descriptor_table_pointer (don't know how yet)
- asm volatile("lgdt (%0)" : : "r"(gdt_pointer));
+ // asm volatile("lgdt (%0)" : : "r"(gdt_pointer));
+ if (gdt_pointer.table_length)
+ {
+ }
}
-
-} // namespace teachos::arch::kernel::cpu \ No newline at end of file
+} // namespace teachos::arch::kernel::cpu