aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2025-04-07 15:42:38 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2025-04-07 15:42:38 +0000
commit8a23a47425162894141f4eac488fb1f1bb3f7dae (patch)
tree0ae77c31c4a404ead867f62f1b8072f082d65ec4 /arch/x86_64/src
parent3a95e601bbcb64fd80d9d5d9bd6e1f6d3c31a89b (diff)
downloadteachos-8a23a47425162894141f4eac488fb1f1bb3f7dae.tar.xz
teachos-8a23a47425162894141f4eac488fb1f1bb3f7dae.zip
Fix naming from jmp to call for Far Call
Diffstat (limited to 'arch/x86_64/src')
-rw-r--r--arch/x86_64/src/context_switching/main.cpp4
-rw-r--r--arch/x86_64/src/kernel/cpu/call.cpp9
-rw-r--r--arch/x86_64/src/kernel/cpu/jmp.cpp14
-rw-r--r--arch/x86_64/src/kernel/main.cpp1
4 files changed, 11 insertions, 17 deletions
diff --git a/arch/x86_64/src/context_switching/main.cpp b/arch/x86_64/src/context_switching/main.cpp
index 124df93..762445f 100644
--- a/arch/x86_64/src/context_switching/main.cpp
+++ b/arch/x86_64/src/context_switching/main.cpp
@@ -1,8 +1,8 @@
#include "arch/context_switching/main.hpp"
#include "arch/exception_handling/assert.hpp"
+#include "arch/kernel/cpu/call.hpp"
#include "arch/kernel/cpu/if.hpp"
-#include "arch/kernel/cpu/jmp.hpp"
#include "arch/kernel/cpu/segment_register.hpp"
#include "arch/kernel/cpu/tr.hpp"
@@ -18,7 +18,7 @@ namespace teachos::arch::context_switching
interrupt_descriptor_table::segment_selector segment_selector{
1U, interrupt_descriptor_table::segment_selector::REQUEST_LEVEL_KERNEL};
kernel::cpu::far_pointer pointer{&kernel::cpu::reload_segment_registers, segment_selector};
- kernel::cpu::jmp(pointer);
+ kernel::cpu::call(pointer);
segment_descriptor_table::update_task_state_segment_register();
diff --git a/arch/x86_64/src/kernel/cpu/call.cpp b/arch/x86_64/src/kernel/cpu/call.cpp
new file mode 100644
index 0000000..98fa248
--- /dev/null
+++ b/arch/x86_64/src/kernel/cpu/call.cpp
@@ -0,0 +1,9 @@
+#include "arch/kernel/cpu/call.hpp"
+
+namespace teachos::arch::kernel::cpu
+{
+ auto call(far_pointer pointer) -> void
+ {
+ asm volatile("rex64 lcall *%[input]" : /* no output from call */ : [input] "m"(pointer));
+ }
+} // namespace teachos::arch::kernel::cpu
diff --git a/arch/x86_64/src/kernel/cpu/jmp.cpp b/arch/x86_64/src/kernel/cpu/jmp.cpp
deleted file mode 100644
index 2833219..0000000
--- a/arch/x86_64/src/kernel/cpu/jmp.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "arch/kernel/cpu/jmp.hpp"
-
-namespace teachos::arch::kernel::cpu
-{
- auto jmp(std::size_t address) -> void
- {
- asm volatile("jmp *%[input]" : /* no output from call */ : [input] "r"(address));
- }
-
- auto jmp(far_pointer pointer) -> void
- {
- asm volatile("rex64 lcall *%[input]" : /* no output from call */ : [input] "m"(pointer));
- }
-} // namespace teachos::arch::kernel::cpu
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp
index 52799f0..7787f30 100644
--- a/arch/x86_64/src/kernel/main.cpp
+++ b/arch/x86_64/src/kernel/main.cpp
@@ -4,7 +4,6 @@
#include "arch/context_switching/interrupt_descriptor_table/segment_selector.hpp"
#include "arch/context_switching/main.hpp"
#include "arch/kernel/cpu/if.hpp"
-#include "arch/kernel/cpu/jmp.hpp"
#include "arch/kernel/cpu/segment_register.hpp"
#include "arch/memory/heap/bump_allocator.hpp"
#include "arch/memory/heap/global_heap_allocator.hpp"