summaryrefslogtreecommitdiffhomepage
path: root/src/libSystem
diff options
context:
space:
mode:
Diffstat (limited to 'src/libSystem')
-rw-r--r--src/libSystem/SystemKit/System.h19
-rw-r--r--src/libSystem/libSystem.json2
2 files changed, 19 insertions, 2 deletions
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."
}