diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-18 05:42:57 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-18 05:42:57 +0100 |
| commit | 30bfed60419707e94a0128f20199f98d008a1473 (patch) | |
| tree | 66a9ace8516d4fcff1a34d7dd34291266216d7bd /src/libSystem | |
| parent | c55c139dd4ee553bac64c903973a6298a50017f2 (diff) | |
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/libSystem')
| -rw-r--r-- | src/libSystem/SystemKit/Macros.h | 2 | ||||
| -rw-r--r-- | src/libSystem/SystemKit/System.h | 6 | ||||
| -rw-r--r-- | src/libSystem/src/JailCalls.cpp | 5 | ||||
| -rw-r--r-- | src/libSystem/src/SystemCalls.cpp | 12 |
4 files changed, 15 insertions, 10 deletions
diff --git a/src/libSystem/SystemKit/Macros.h b/src/libSystem/SystemKit/Macros.h index 14918c41..1673d427 100644 --- a/src/libSystem/SystemKit/Macros.h +++ b/src/libSystem/SystemKit/Macros.h @@ -94,7 +94,7 @@ typedef nullPtr NullPtr; #endif #ifndef kib_cast -#define kib_cast(X) (UInt64)((X) *1024) +#define kib_cast(X) (UInt64)((X) * 1024) #endif #ifndef MIB diff --git a/src/libSystem/SystemKit/System.h b/src/libSystem/SystemKit/System.h index 69cce9a7..324aae5c 100644 --- a/src/libSystem/SystemKit/System.h +++ b/src/libSystem/SystemKit/System.h @@ -21,7 +21,8 @@ /// @brief Types API. // ------------------------------------------------------------------------------------------ // -/// @brief Reference type, used for all references in the system, such as file descriptors, dylib handles, thread handles, etc. +/// @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. @@ -398,7 +399,8 @@ IMPORT_C UInt64 StrMathToNumber(const Char* in, const Char** endp, const SInt16 // ------------------------------------------------------------------------------------------ // /// @brief Create a semaphore. -IMPORT_C _Output SemaphoreRef SemCreate(_Input UInt32 initial_count, _Input UInt32 max_count, _Input const Char* name); +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); diff --git a/src/libSystem/src/JailCalls.cpp b/src/libSystem/src/JailCalls.cpp index 674e916a..e5e11a43 100644 --- a/src/libSystem/src/JailCalls.cpp +++ b/src/libSystem/src/JailCalls.cpp @@ -11,5 +11,6 @@ using namespace LibSystem; -IMPORT_C struct JAIL* JailGetCurrent(Void) { return (struct JAIL*) libsys_syscall_arg_1(SYSCALL_HASH("JailGetCurrent")); } - +IMPORT_C struct JAIL* JailGetCurrent(Void) { + return (struct JAIL*) libsys_syscall_arg_1(SYSCALL_HASH("JailGetCurrent")); +} diff --git a/src/libSystem/src/SystemCalls.cpp b/src/libSystem/src/SystemCalls.cpp index 470bc237..c5497f91 100644 --- a/src/libSystem/src/SystemCalls.cpp +++ b/src/libSystem/src/SystemCalls.cpp @@ -3,7 +3,6 @@ // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/ne-foss-org/nekernel - #include <libSystem/SystemKit/Err.h> #include <libSystem/SystemKit/Syscall.h> #include <libSystem/SystemKit/System.h> @@ -126,7 +125,9 @@ IMPORT_C Ref IoOpenFile(_Input const Char* path, _Input const Char* drv_letter) Verify::sys_safe_cast<Char, Void>(drv_letter))); } -IMPORT_C Void IoCloseFile(_Input Ref desc) { libsys_syscall_arg_2(SYSCALL_HASH("IoCloseFile"), static_cast<VoidPtr>(desc)); } +IMPORT_C Void IoCloseFile(_Input Ref desc) { + libsys_syscall_arg_2(SYSCALL_HASH("IoCloseFile"), static_cast<VoidPtr>(desc)); +} IMPORT_C UInt64 IoSeekFile(_Input Ref desc, _Input UInt64 off) { auto ret_ptr = libsys_syscall_arg_3(SYSCALL_HASH("IoSeekFile"), static_cast<VoidPtr>(desc), @@ -134,7 +135,7 @@ IMPORT_C UInt64 IoSeekFile(_Input Ref desc, _Input UInt64 off) { if (!ret_ptr) return ~0UL; - auto ret = static_cast<volatile UInt64*>(ret_ptr); + auto ret = static_cast<volatile UInt64*>(ret_ptr); UInt64 result = *ret; MUST_PASS(result != ~0UL); @@ -160,7 +161,9 @@ IMPORT_C SInt32 PrintRelease(_Input IORef buf) { return static_cast<SInt32>(*ret); } -IMPORT_C IORef PrintCreate(Void) { return static_cast<IORef>(libsys_syscall_arg_1(SYSCALL_HASH("PrintCreate"))); } +IMPORT_C IORef PrintCreate(Void) { + return static_cast<IORef>(libsys_syscall_arg_1(SYSCALL_HASH("PrintCreate"))); +} IMPORT_C VoidPtr MmCreateHeap(UInt64 initial_size, UInt32 max_size) { return static_cast<VoidPtr>(libsys_syscall_arg_3(SYSCALL_HASH("MmCreateHeap"), @@ -223,4 +226,3 @@ IMPORT_C SInt32 PrintOut(_Input IORef desc, const Char* fmt, ...) { IMPORT_C UInt64 PrintSize(IORef ref) { return *static_cast<UInt64*>(libsys_syscall_arg_2(SYSCALL_HASH("PrintSize"), ref)); } - |
