diff options
Diffstat (limited to 'Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp')
| -rw-r--r-- | Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp | 12 |
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); } } |
