diff options
| author | Amlal EL Mahrouss <amlal@softwarelabs.com> | 2024-06-13 17:41:19 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlal@softwarelabs.com> | 2024-06-13 17:41:19 +0200 |
| commit | 349fe48baf941b2d1b571d3a5d0d796823bae312 (patch) | |
| tree | 6258abfbede227d0a7806530ccbf3cdf3ca3699c /Kernel/HALKit/AXP | |
| parent | 70ae21935c7c68ed8a380611481b553b94cee657 (diff) | |
MHR-31: New systemcall/kernelcall architecture.
Signed-off-by: Amlal EL Mahrouss <amlal@softwarelabs.com>
Diffstat (limited to 'Kernel/HALKit/AXP')
| -rw-r--r-- | Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp b/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp index ea0997ed..3217a660 100644 --- a/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp +++ b/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp @@ -5,16 +5,20 @@ ------------------------------------------- */ #include <ArchKit/ArchKit.hpp> -#include <HALKit/Alpha/Processor.hpp> +#include <HALKit/AXP/Processor.hpp> -NewOS::Array<void (*)(NewOS::Int32 id, NewOS::HAL::StackFrame*), - kKernelMaxSystemCalls> - kSyscalls; - -extern "C" void rt_syscall_handle(NewOS::HAL::StackFrame* stack) +/// @brief Internal call for syscall, to work with C++. +/// @param stack +/// @return nothing. +EXTERN_C void rt_syscall_handle(NewOS::HAL::StackFrame* stack) { - for (NewOS::SizeT index = 0UL; index < kKernelMaxSystemCalls; ++index) + if (stack->Rcx <= (kSyscalls.Count() - 1)) { - (kSyscalls[index].Leak().Leak())(stack->ID, stack); + NewOS::kcout << "newoskrnl: syscall: enter.\r"; + + if (kSyscalls[stack->Rcx].Leak().Leak().fHooked) + (kSyscalls[stack->Rcx].Leak().Leak().fProc)(stack); + + NewOS::kcout << "newoskrnl: syscall: exit.\r"; } } |
