diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-05 16:22:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-05 16:22:48 +0200 |
| commit | 7690c1976b3127e17370708aef47ba3f18f3b8c2 (patch) | |
| tree | b820fe8c7116ade5347f995859393521f2259004 /dev/user | |
| parent | 997be16e5ac9a68d54882ab69529815860d62955 (diff) | |
| parent | 0c54169b6517fc7acbe4281399fa8146219a8e2c (diff) | |
Merge pull request #29 from nekernel-org/dev
NeKernel 0.0.2e1
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 +}
|
