summaryrefslogtreecommitdiffhomepage
path: root/dev/user/src/SystemCalls.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-03-27 17:24:21 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-03-27 17:24:21 +0100
commitb8f7ef086d1d1b1cd686fff04d0a587f8fd39d81 (patch)
treeb6c2eb3ca2c51dc87ddd81b6170d5f63eabb9090 /dev/user/src/SystemCalls.cc
parenteb86df50ec5afb392998e2e171de54e1f26d8e7a (diff)
add: new driver device kit API. (DDK)
refactor: rename SCIKit -> user (then libuser.dylib) boot/modules/netboot: fixed compilation for amd64. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/user/src/SystemCalls.cc')
-rw-r--r--dev/user/src/SystemCalls.cc45
1 files changed, 45 insertions, 0 deletions
diff --git a/dev/user/src/SystemCalls.cc b/dev/user/src/SystemCalls.cc
new file mode 100644
index 00000000..eadb07ce
--- /dev/null
+++ b/dev/user/src/SystemCalls.cc
@@ -0,0 +1,45 @@
+/* -------------------------------------------
+
+ Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
+
+------------------------------------------- */
+
+#include <user/SystemCalls.h>
+
+/// @file libsci.cc
+/// @brief Source file for the memory functions of the libsci.
+
+/// @brief Copy memory region.
+IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len)
+{
+ if (!len ||
+ !dest ||
+ !src)
+ {
+ return nullptr;
+ }
+
+ for (SizeT i = 0; i < len; i++)
+ {
+ ((Char*)dest)[i] = ((Char*)src)[i];
+ }
+
+ return dest;
+}
+
+/// @brief Fill memory region with **value**.
+IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value)
+{
+ if (!len ||
+ !dest)
+ {
+ return nullptr;
+ }
+
+ for (SizeT i = 0; i < len; i++)
+ {
+ ((Char*)dest)[i] = value;
+ }
+
+ return dest;
+}