summaryrefslogtreecommitdiffhomepage
path: root/HALKit/AMD64/CoreSyscallHandlerAMD64.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'HALKit/AMD64/CoreSyscallHandlerAMD64.cpp')
-rw-r--r--HALKit/AMD64/CoreSyscallHandlerAMD64.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/HALKit/AMD64/CoreSyscallHandlerAMD64.cpp b/HALKit/AMD64/CoreSyscallHandlerAMD64.cpp
new file mode 100644
index 00000000..e93bf2c8
--- /dev/null
+++ b/HALKit/AMD64/CoreSyscallHandlerAMD64.cpp
@@ -0,0 +1,25 @@
+/*
+ * ========================================================
+ *
+ * hCore
+ * Copyright Mahrouss Logic, all rights reserved.
+ *
+ * ========================================================
+ */
+
+#include <KernelKit/PermissionSelector.hxx>
+#include <HALKit/AMD64/Processor.hpp>
+
+#include <ArchKit/Arch.hpp>
+
+hCore::Array<void (*)(hCore::Int32 id, hCore::HAL::StackFrame *), kMaxSyscalls> kSyscalls;
+
+// IDT System Call Handler.
+// NOTE: don't trust the user.
+extern "C" void rt_syscall_handle(hCore::HAL::StackFrame *stack)
+{
+ for (hCore::SizeT index = 0UL; index < kMaxSyscalls; ++index)
+ {
+ (kSyscalls[index].Leak().Leak())(stack->SID, stack);
+ }
+}