diff options
| author | Amlal <amlal@nekernel.org> | 2025-05-04 22:44:34 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-05-04 22:44:34 +0200 |
| commit | 74230b2cbf7f922c79d8106e021584488011a381 (patch) | |
| tree | 5355ff1ddd2e0255b43e3d7f52e50bdc55c6fb80 /dev/user | |
| parent | 0eca281ac5125de1183416187d70d9dff4ea9261 (diff) | |
feat(cleanup): cleanup codebase.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'dev/user')
| -rw-r--r-- | dev/user/src/SystemCalls.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/dev/user/src/SystemCalls.cc b/dev/user/src/SystemCalls.cc index d8366d42..f8b6d597 100644 --- a/dev/user/src/SystemCalls.cc +++ b/dev/user/src/SystemCalls.cc @@ -8,9 +8,8 @@ #include <user/SystemCalls.h>
/// @file SystemCalls.cc
-/// @brief Source file for the memory functions of the user.sys.
+/// @brief Source file for the memory functions/syscalls for user.sys
-/// @brief Copy memory region.
IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len) {
if (!len || !dest || !src) {
return nullptr;
@@ -23,7 +22,6 @@ IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input Si return dest;
}
-/// @brief Get string length.
IMPORT_C SInt64 MmStrLen(const Char* in) {
if (!in) return 0;
@@ -36,7 +34,6 @@ IMPORT_C SInt64 MmStrLen(const Char* in) { return len;
}
-/// @brief Fill memory region **dest** with **value**.
IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value) {
if (!len || !dest) {
return nullptr;
@@ -49,6 +46,13 @@ IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt return dest;
}
+//-----------------------------------------------------------------------------------------------------------//
+/// @brief Systems Calls implementation.
+/// @internal
+//-----------------------------------------------------------------------------------------------------------//
+
+constexpr auto kInvalidSyscall = 0UL;
+
IMPORT_C Ref IoOpenFile(_Input const Char* path, _Input const Char* drv_letter) {
return sci_syscall_arg_3(1, reinterpret_cast<VoidPtr>(const_cast<Char*>(path)),
reinterpret_cast<VoidPtr>(const_cast<Char*>(drv_letter)));
@@ -71,8 +75,6 @@ IMPORT_C UInt64 IoTellFile(_Input Ref desc) { return *ret;
}
-/// @brief Print to the file descriptor.
-/// @param desc the file descriptor.
IMPORT_C SInt32 PrintOut(_Input IORef desc, const char* fmt, ...) {
va_list args;
@@ -86,10 +88,9 @@ IMPORT_C SInt32 PrintOut(_Input IORef desc, const char* fmt, ...) { return *ret;
}
-/// @internal
IMPORT_C Void _rtl_assert(Bool expr, const Char* origin) {
if (!expr) {
PrintOut(nullptr, "Assertion failed: %s\r", origin);
PrintOut(nullptr, "Origin: %s\r", origin);
}
-}
\ No newline at end of file +}
|
