summaryrefslogtreecommitdiffhomepage
path: root/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp')
-rw-r--r--Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp b/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp
index 3a3b49b3..24eee910 100644
--- a/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp
+++ b/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp
@@ -16,8 +16,10 @@ typedef HCore::Void (*rt_syscall_proc)(HCore::Int32 id, HCore::HAL::StackFramePt
HCore::Array<rt_syscall_proc, kKernelMaxSystemCalls> kSyscalls;
/// @brief Interrupt system call handler.
-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);
+EXTERN_C void rt_syscall_handle(HCore::HAL::StackFramePtr stack) {
+ if (!stack) return;
+
+ if (stack->Rcx < kKernelMaxSystemCalls && kSyscalls[stack->Rcx] != 0) {
+ (kSyscalls[stack->Rcx].Leak().Leak())(stack->Rcx, stack);
}
}