summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-06-29 23:45:47 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-06-29 23:45:47 +0200
commit0558e8040c0d9628858ddd85ce573b9c80941a1f (patch)
tree669baee6c44685771afce381d8d6ab4ac38ffce2 /Kernel/HALKit
parent1d9d0ba0f529e4b90875e459a841889495e45369 (diff)
Implement ipc_sanitize_packet as syscall.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/HALKit')
-rw-r--r--Kernel/HALKit/AMD64/HalKernelMain.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Kernel/HALKit/AMD64/HalKernelMain.cxx b/Kernel/HALKit/AMD64/HalKernelMain.cxx
index 7d641153..d8c60e25 100644
--- a/Kernel/HALKit/AMD64/HalKernelMain.cxx
+++ b/Kernel/HALKit/AMD64/HalKernelMain.cxx
@@ -17,6 +17,7 @@
#include <Modules/CoreCG/Accessibility.hxx>
#include <KernelKit/CodeManager.hpp>
#include <Modules/ACPI/ACPIFactoryInterface.hxx>
+#include <NetworkKit/IPCEP.hxx>
#define KERNEL_INIT(X) X; \
NewOS::ke_stop(RUNTIME_CHECK_BOOTSTRAP);
@@ -103,7 +104,7 @@ EXTERN_C void hal_init_platform(
CONST NewOS::HAL::IDTLoader cIDT;
cIDT.Load(idtBase);
- // register the basic NAPI syscalls.
+ // Register the basic SCI functions.
constexpr auto cSerialAlertInterrupt = 0x10;
constexpr auto cTlsInterrupt = 0x11;
@@ -123,6 +124,7 @@ EXTERN_C void hal_init_platform(
constexpr auto cLPCSendMsg = 0x25;
constexpr auto cLPCOpenMsg = 0x26;
constexpr auto cLPCCloseMsg = 0x27;
+ constexpr auto cLPCSanitizeMsg = 0x28;
kSyscalls[cSerialAlertInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void {
const char* msg = (const char*)rdx;
@@ -133,6 +135,10 @@ EXTERN_C void hal_init_platform(
tls_check_syscall_impl(rdx);
};
+ kSyscalls[cLPCSanitizeMsg].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void {
+ NewOS::ipc_sanitize_packet(reinterpret_cast<NewOS::IPCEPMessageHeader*>(rdx));
+ };
+
kSyscalls[cNewInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void {
// get HAC struct.
HeapAllocInfo* rdxInf = reinterpret_cast<HeapAllocInfo*>(rdx);
@@ -198,6 +204,7 @@ EXTERN_C void hal_init_platform(
kSyscalls[cLastExitInterrupt].Leak().Leak()->fHooked = true;
kSyscalls[cShutdownInterrupt].Leak().Leak()->fHooked = true;
kSyscalls[cRebootInterrupt].Leak().Leak()->fHooked = true;
+ kSyscalls[cLPCSanitizeMsg].Leak().Leak()->fHooked = true;
NewOS::HAL::hal_system_get_cores(kHandoverHeader->f_HardwareTables.f_RsdPtr);