From bd4466fbe026ac25f84d88d0306b9745b9bbbe8b Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 31 Jul 2025 00:55:34 +0100 Subject: feat: IPC: use C-lock pattern to retain IPC transfers. Signed-off-by: Amlal El Mahrouss --- dev/kernel/NetworkKit/IPC.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'dev/kernel/NetworkKit/IPC.h') diff --git a/dev/kernel/NetworkKit/IPC.h b/dev/kernel/NetworkKit/IPC.h index 0dd8a1f1..d14356c0 100644 --- a/dev/kernel/NetworkKit/IPC.h +++ b/dev/kernel/NetworkKit/IPC.h @@ -57,6 +57,12 @@ enum { constexpr inline auto kIPCMsgSize = 6094U; +enum { + kIPCLockInvalid, + kIPCLockFree = 1, + kIPCLockUsed = 2, +}; + /// @brief IPC connection header, message cannot be greater than 6K. typedef struct IPC_MSG final { UInt32 IpcHeaderMagic; // cRemoteHeaderMagic @@ -68,7 +74,7 @@ typedef struct IPC_MSG final { UInt32 IpcMsg; UInt32 IpcMsgSz; UInt8 IpcData[kIPCMsgSize]; - + UInt32 IpcLock; /// @brief Passes the message to target, could be anything, HTTP packet, JSON or whatever. static Bool Pass(IPC_MSG* self, IPC_MSG* target) noexcept; } PACKED IPC_MSG; -- cgit v1.2.3