From a0f82d57976648c5bfcf165b2e304d2a4c8fb0c7 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 19 Mar 2024 22:50:16 +0100 Subject: Kernel:Secret: Fix String class. Improve kernel APIs. --- Private/NewBoot/Source/BootString.cxx | 61 ------------------------- Private/NewBoot/Source/HEL/AMD64/BootString.cxx | 61 +++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 61 deletions(-) delete mode 100644 Private/NewBoot/Source/BootString.cxx create mode 100644 Private/NewBoot/Source/HEL/AMD64/BootString.cxx (limited to 'Private/NewBoot/Source') diff --git a/Private/NewBoot/Source/BootString.cxx b/Private/NewBoot/Source/BootString.cxx deleted file mode 100644 index 9fbe1a11..00000000 --- a/Private/NewBoot/Source/BootString.cxx +++ /dev/null @@ -1,61 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - - File: String.cxx - Purpose: NewBoot string library - - Revision History: - - - -------------------------------------------- */ - -#include - -/// bugs 0 - -///////////////////////////////////////////////////////////////////////////////////////////////////////// - -HCore::SizeT BCopyMem(CharacterType *dest, CharacterType *src, - const HCore::SizeT len) { - if (!dest || !src) return 0; - - SizeT index = 0UL; - for (; index < len; ++index) { - dest[index] = src[index]; - } - - return index; -} - -HCore::SizeT BStrLen(const CharacterType *ptr) { - if (!ptr) return 0; - - HCore::SizeT cnt = 0; - - while (*ptr != (CharacterType)0) { - ++ptr; - ++cnt; - } - - return cnt; -} - -HCore::SizeT BSetMem(CharacterType *src, const CharacterType byte, - const HCore::SizeT len) { - if (!src) return 0; - - HCore::SizeT cnt = 0UL; - - while (*src != 0) { - if (cnt > len) break; - - *src = byte; - ++src; - - ++cnt; - } - - return cnt; -} diff --git a/Private/NewBoot/Source/HEL/AMD64/BootString.cxx b/Private/NewBoot/Source/HEL/AMD64/BootString.cxx new file mode 100644 index 00000000..9fbe1a11 --- /dev/null +++ b/Private/NewBoot/Source/HEL/AMD64/BootString.cxx @@ -0,0 +1,61 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: String.cxx + Purpose: NewBoot string library + + Revision History: + + + +------------------------------------------- */ + +#include + +/// bugs 0 + +///////////////////////////////////////////////////////////////////////////////////////////////////////// + +HCore::SizeT BCopyMem(CharacterType *dest, CharacterType *src, + const HCore::SizeT len) { + if (!dest || !src) return 0; + + SizeT index = 0UL; + for (; index < len; ++index) { + dest[index] = src[index]; + } + + return index; +} + +HCore::SizeT BStrLen(const CharacterType *ptr) { + if (!ptr) return 0; + + HCore::SizeT cnt = 0; + + while (*ptr != (CharacterType)0) { + ++ptr; + ++cnt; + } + + return cnt; +} + +HCore::SizeT BSetMem(CharacterType *src, const CharacterType byte, + const HCore::SizeT len) { + if (!src) return 0; + + HCore::SizeT cnt = 0UL; + + while (*src != 0) { + if (cnt > len) break; + + *src = byte; + ++src; + + ++cnt; + } + + return cnt; +} -- cgit v1.2.3