summaryrefslogtreecommitdiffhomepage
path: root/dev/Boot/Sources/HEL/AMD64/BootString.cxx
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-15 18:35:34 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-15 18:35:34 +0200
commitf3d931aa7cfaf96baef8383b59a8938779541ee7 (patch)
treefdb9fc51badb3dbd03e46ab0766a49d9522e13e2 /dev/Boot/Sources/HEL/AMD64/BootString.cxx
parent86640816e8b1d3595365f1fcc8a2a9e61fb40ff1 (diff)
[IMP] Moved source code into dev/ folder.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/Boot/Sources/HEL/AMD64/BootString.cxx')
-rw-r--r--dev/Boot/Sources/HEL/AMD64/BootString.cxx92
1 files changed, 92 insertions, 0 deletions
diff --git a/dev/Boot/Sources/HEL/AMD64/BootString.cxx b/dev/Boot/Sources/HEL/AMD64/BootString.cxx
new file mode 100644
index 00000000..ad87bce2
--- /dev/null
+++ b/dev/Boot/Sources/HEL/AMD64/BootString.cxx
@@ -0,0 +1,92 @@
+/* -------------------------------------------
+
+ Copyright ZKA Technologies.
+
+ File: String.cxx
+ Purpose: NewBoot string library
+
+ Revision History:
+
+
+
+------------------------------------------- */
+
+#include <BootKit/Platform.hxx>
+#include <BootKit/Protocol.hxx>
+#include <BootKit/BootKit.hxx>
+
+/// bugs 0
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+Kernel::SizeT BCopyMem(CharacterTypeUTF16* dest, CharacterTypeUTF16* src, const Kernel::SizeT len)
+{
+ if (!dest || !src)
+ return 0;
+
+ SizeT index = 0UL;
+ for (; index < len; ++index)
+ {
+ dest[index] = src[index];
+ }
+
+ return index;
+}
+
+Kernel::SizeT BStrLen(const CharacterTypeUTF16* ptr)
+{
+ if (!ptr)
+ return 0;
+
+ Kernel::SizeT cnt = 0;
+
+ while (*ptr != (CharacterTypeUTF16)0)
+ {
+ ++ptr;
+ ++cnt;
+ }
+
+ return cnt;
+}
+
+Kernel::SizeT BSetMem(CharacterTypeUTF16* src, const CharacterTypeUTF16 byte, const Kernel::SizeT len)
+{
+ if (!src)
+ return 0;
+
+ Kernel::SizeT cnt = 0UL;
+
+ while (*src != 0)
+ {
+ if (cnt > len)
+ break;
+
+ *src = byte;
+ ++src;
+
+ ++cnt;
+ }
+
+ return cnt;
+}
+
+Kernel::SizeT BSetMem(CharacterTypeUTF8* src, const CharacterTypeUTF8 byte, const Kernel::SizeT len)
+{
+ if (!src)
+ return 0;
+
+ Kernel::SizeT cnt = 0UL;
+
+ while (*src != 0)
+ {
+ if (cnt > len)
+ break;
+
+ *src = byte;
+ ++src;
+
+ ++cnt;
+ }
+
+ return cnt;
+}