summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/NetworkKit/IPC.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-07-31 00:55:34 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-07-31 00:55:34 +0100
commitbd4466fbe026ac25f84d88d0306b9745b9bbbe8b (patch)
treeda67bf337c9c1c3d519f142b96bead55b5cf2147 /dev/kernel/NetworkKit/IPC.h
parentd546e35937521c868150a0807f30a2e2b1f69bb8 (diff)
feat: IPC: use C-lock pattern to retain IPC transfers.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/NetworkKit/IPC.h')
-rw-r--r--dev/kernel/NetworkKit/IPC.h8
1 files changed, 7 insertions, 1 deletions
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;