summaryrefslogtreecommitdiffhomepage
path: root/Private/HALKit/AMD64/HalCoreSyscallHandlerAMD64.cpp
blob: cacb66d8c568c40809a9e364435c462587b3fcd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 *	========================================================
 *
 *	HCore
 * 	Copyright Mahrouss Logic, all rights reserved.
 *
 * 	========================================================
 */

#include <ArchKit/ArchKit.hpp>
#include <HALKit/AMD64/Processor.hpp>
#include <KernelKit/PermissionSelector.hxx>

HCore::Array<void (*)(HCore::Int32 id, HCore::HAL::StackFrame *),
             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);
  }
}