aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/context_switching/syscall_handler.cpp
diff options
context:
space:
mode:
authorFabian Imhof <fabian.imhof@ost.ch>2025-04-27 11:20:02 +0000
committerFabian Imhof <fabian.imhof@ost.ch>2025-04-27 11:20:02 +0000
commit7261c64bb236a313ed8846a9c9dbded6890a9e98 (patch)
tree3f43ab7d1e87025dd622bbc9cd56aad5d37a2f78 /arch/x86_64/src/context_switching/syscall_handler.cpp
parentc865eff02ae1978b4f665432d853374d1ffacecf (diff)
downloadkernel-7261c64bb236a313ed8846a9c9dbded6890a9e98.tar.xz
kernel-7261c64bb236a313ed8846a9c9dbded6890a9e98.zip
wip implement syscall in cpp
Diffstat (limited to 'arch/x86_64/src/context_switching/syscall_handler.cpp')
-rw-r--r--arch/x86_64/src/context_switching/syscall_handler.cpp20
1 files changed, 20 insertions, 0 deletions
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 <cstdint>
+
+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