summaryrefslogtreecommitdiffhomepage
path: root/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-28 14:26:58 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-28 14:26:58 +0100
commitf77a876e0ac2611079ee188933f0f3de222dd08a (patch)
treec8230499b03f8ad2cbdddbb6e06607163a176149 /Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp
parent2cf9f370d40a5c6512530c600292c5fac0410e11 (diff)
HCoreKrnl\HAL\IDT: Work in progress patch(fix) of HCore interrupt system
on x86. Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp')
-rw-r--r--Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp b/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp
index cacb66d8..3a3b49b3 100644
--- a/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp
+++ b/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp
@@ -11,13 +11,13 @@
#include <HALKit/AMD64/Processor.hpp>
#include <KernelKit/PermissionSelector.hxx>
-HCore::Array<void (*)(HCore::Int32 id, HCore::HAL::StackFrame *),
- kKernelMaxSystemCalls>
- kSyscalls;
+typedef HCore::Void (*rt_syscall_proc)(HCore::Int32 id, HCore::HAL::StackFramePtr);
+
+HCore::Array<rt_syscall_proc, kKernelMaxSystemCalls> kSyscalls;
/// @brief Interrupt system call handler.
-extern "C" void rt_syscall_handle(HCore::HAL::StackFrame *stack) {
- for (HCore::SizeT index = 0UL; index < kKernelMaxSystemCalls; ++index) {
- if (kSyscalls[index]) (kSyscalls[index].Leak().Leak())(stack->R15, stack);
+extern "C" void rt_syscall_handle(HCore::HAL::StackFramePtr stack) {
+ if (stack->R15 < kKernelMaxSystemCalls && kSyscalls[stack->R15] != 0) {
+ (kSyscalls[stack->R15].Leak().Leak())(stack->R15, stack);
}
}