From 35fb9574c5efc426491f7ce55689e0f911890e98 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 16 Mar 2026 05:07:39 +0100 Subject: [CHORE] Improve and fix libDDK and implement libMsg. Signed-off-by: Amlal El Mahrouss --- src/libSystem/SystemKit/System.h | 19 ++++++++++++++++++- src/libSystem/libSystem.json | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'src/libSystem') diff --git a/src/libSystem/SystemKit/System.h b/src/libSystem/SystemKit/System.h index 4e766d9d..69cce9a7 100644 --- a/src/libSystem/SystemKit/System.h +++ b/src/libSystem/SystemKit/System.h @@ -21,6 +21,7 @@ /// @brief Types API. // ------------------------------------------------------------------------------------------ // +/// @brief Reference type, used for all references in the system, such as file descriptors, dylib handles, thread handles, etc. struct REF_TYPE { UInt64 __hash; /// @brief Hash of the syscall VoidPtr __self; /// @brief Syscall self value. @@ -210,12 +211,15 @@ typedef SInt32 (*ThrProcKind)(SInt32 argc, Char** argv); /// @param flags Thread flags. /// @return the thread object. IMPORT_C ThreadRef ThrCreateThread(const Char* thread_name, ThrProcKind procedure, - SInt32 argument_count, SInt32 flags); + SInt32 argument_count, VoidPtr args, SInt32 flags); /// @brief Yields the current thread. /// @param thread the thread to yield. IMPORT_C SInt32 ThrYieldThread(ThreadRef thrd); +/// @brief Get the current thread's ID. +IMPORT_C ThreadRef ThrCurrentThread(Void); + /// @brief Joins a thread. /// @param thread the thread to join. IMPORT_C SInt32 ThrJoinThread(ThreadRef thrd); @@ -389,4 +393,17 @@ IMPORT_C Char* StrFmt(const Char* fmt, ...); IMPORT_C UInt64 StrMathToNumber(const Char* in, const Char** endp, const SInt16 base); +// ------------------------------------------------------------------------------------------ // +// @brief Semaphore API. +// ------------------------------------------------------------------------------------------ // + +/// @brief Create a semaphore. +IMPORT_C _Output SemaphoreRef SemCreate(_Input UInt32 initial_count, _Input UInt32 max_count, _Input const Char* name); + +/// @brief Wait on a semaphore. +IMPORT_C SInt32 SemWait(_Input SemaphoreRef sem); + +/// @brief Close a semaphore. +IMPORT_C SInt32 SemClose(_Input SemaphoreRef sem); + #endif // ifndef SYSTEMKIT_SYSTEM_H diff --git a/src/libSystem/libSystem.json b/src/libSystem/libSystem.json index 16557645..14f4bfc5 100644 --- a/src/libSystem/libSystem.json +++ b/src/libSystem/libSystem.json @@ -17,5 +17,5 @@ "kLibSystemVersionHighest=0x0100", "kLibSystemVersionLowest=0x0100" ], - "description": "The System Call Kit for the NeKernel Stack." + "description": "The System Call Kit for the NeSystem." } -- cgit v1.2.3