From 7261c64bb236a313ed8846a9c9dbded6890a9e98 Mon Sep 17 00:00:00 2001 From: Fabian Imhof Date: Sun, 27 Apr 2025 11:20:02 +0000 Subject: wip implement syscall in cpp --- .../x86_64/src/context_switching/syscall_handler.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 arch/x86_64/src/context_switching/syscall_handler.cpp (limited to 'arch/x86_64/src/context_switching/syscall_handler.cpp') diff --git a/arch/x86_64/src/context_switching/syscall_handler.cpp b/arch/x86_64/src/context_switching/syscall_handler.cpp new file mode 100644 index 0000000..1bc4ef9 --- /dev/null +++ b/arch/x86_64/src/context_switching/syscall_handler.cpp @@ -0,0 +1,20 @@ +#include "arch/context_switching/syscall_handler.hpp" + +#include + +namespace teachos::arch::context_switching +{ + [[gnu::naked]] + auto syscall_handler() -> void + { + uint64_t dummy{}; + switch (dummy) + { + case 0: + break; + default: + break; + } + asm volatile("SYSRET"); + } +} // namespace teachos::arch::context_switching \ No newline at end of file -- cgit v1.2.3