From f77a876e0ac2611079ee188933f0f3de222dd08a Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 28 Feb 2024 14:26:58 +0100 Subject: HCoreKrnl\HAL\IDT: Work in progress patch(fix) of HCore interrupt system on x86. Signed-off-by: Amlal El Mahrouss --- Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp') 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 #include -HCore::Array - kSyscalls; +typedef HCore::Void (*rt_syscall_proc)(HCore::Int32 id, HCore::HAL::StackFramePtr); + +HCore::Array 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); } } -- cgit v1.2.3