aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/kernel/cpu
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2025-03-27 09:40:32 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2025-03-27 09:40:32 +0000
commita6c5f6a273d0c5c4161f600fca6d4fe49858c23c (patch)
treebf02711f9d3e0424dccef4dc1299b5a70c9f839a /arch/x86_64/src/kernel/cpu
parentdb555089dea369d9dd3010d1853077e7a4118b90 (diff)
downloadteachos-a6c5f6a273d0c5c4161f600fca6d4fe49858c23c.tar.xz
teachos-a6c5f6a273d0c5c4161f600fca6d4fe49858c23c.zip
Attempt to fix crash in far jump. WIP does not return from call to assembler method
Diffstat (limited to 'arch/x86_64/src/kernel/cpu')
-rw-r--r--arch/x86_64/src/kernel/cpu/if.cpp2
-rw-r--r--arch/x86_64/src/kernel/cpu/jmp.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86_64/src/kernel/cpu/if.cpp b/arch/x86_64/src/kernel/cpu/if.cpp
index 2a25df5..60a90a3 100644
--- a/arch/x86_64/src/kernel/cpu/if.cpp
+++ b/arch/x86_64/src/kernel/cpu/if.cpp
@@ -2,4 +2,6 @@ namespace teachos::arch::kernel::cpu
{
auto set_interrupt_flag() -> void { asm volatile("sti"); }
+ auto clear_interrupt_flag() -> void { asm volatile("cli"); }
+
} // 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
index 009981b..205c4a9 100644
--- a/arch/x86_64/src/kernel/cpu/jmp.cpp
+++ b/arch/x86_64/src/kernel/cpu/jmp.cpp
@@ -7,10 +7,8 @@ namespace teachos::arch::kernel::cpu
asm volatile("jmp *%[input]" : /* no output from call */ : [input] "r"(address));
}
- auto jmp(uint64_t segment, uint64_t offset) -> void
+ auto jmp(far_pointer pointer) -> void
{
- far_pointer far_pointer = {offset, static_cast<uint16_t>(segment)};
- asm volatile("jmp *%0" : : "m"(far_pointer));
+ asm volatile("jmp *%[input]" : /* no output from call */ : [input] "m"(pointer));
}
-
} // namespace teachos::arch::kernel::cpu