diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-28 13:05:28 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-28 13:05:28 +0100 |
| commit | 84cc6ff6f43b48383248282743efc514946db641 (patch) | |
| tree | fa7f9099b87e235ba122d17b6a3b39234cd39883 /Private/NewKit | |
| parent | 3d798c5fc738768493df925d1f5d72256f2dec4e (diff) | |
Kernel: :boom: breaking changes, Update API and the HCORE based
macros, rename HCore to NewOS.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/NewKit')
| -rw-r--r-- | Private/NewKit/Array.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/ArrayList.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/Atom.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/Crc32.hpp | 6 | ||||
| -rw-r--r-- | Private/NewKit/Defines.hpp | 12 | ||||
| -rw-r--r-- | Private/NewKit/ErrorOr.hpp | 6 | ||||
| -rw-r--r-- | Private/NewKit/Function.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/Json.hpp | 6 | ||||
| -rw-r--r-- | Private/NewKit/KernelCheck.hpp | 8 | ||||
| -rw-r--r-- | Private/NewKit/Macros.hpp | 8 | ||||
| -rw-r--r-- | Private/NewKit/MutableArray.hpp | 8 | ||||
| -rw-r--r-- | Private/NewKit/OwnPtr.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/PageAllocator.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/PageManager.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/Pair.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/Pmm.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/Ref.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/Stream.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/String.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/Utils.hpp | 4 | ||||
| -rw-r--r-- | Private/NewKit/Variant.hpp | 4 |
21 files changed, 55 insertions, 55 deletions
diff --git a/Private/NewKit/Array.hpp b/Private/NewKit/Array.hpp index c6153421..a892f1a7 100644 --- a/Private/NewKit/Array.hpp +++ b/Private/NewKit/Array.hpp @@ -9,7 +9,7 @@ #include <NewKit/ErrorOr.hpp> #include <NewKit/Defines.hpp> -namespace HCore +namespace NewOS { template <typename T, Size N> class Array final @@ -67,4 +67,4 @@ private: T m_Array[N]; }; -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/ArrayList.hpp b/Private/NewKit/ArrayList.hpp index 9a1c7e9c..ef6889ea 100644 --- a/Private/NewKit/ArrayList.hpp +++ b/Private/NewKit/ArrayList.hpp @@ -8,7 +8,7 @@ #include <NewKit/Defines.hpp> -namespace HCore +namespace NewOS { template <typename T> class ArrayList final @@ -54,4 +54,4 @@ namespace HCore { return ArrayList<ValueType>{val}; } -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/Atom.hpp b/Private/NewKit/Atom.hpp index 8ace1b80..34cbea51 100644 --- a/Private/NewKit/Atom.hpp +++ b/Private/NewKit/Atom.hpp @@ -7,7 +7,7 @@ #include <NewKit/Defines.hpp> -namespace HCore +namespace NewOS { template <typename T> class Atom final { @@ -42,4 +42,4 @@ template <typename T> class Atom final private: T m_ArrayOfAtoms; }; -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/Crc32.hpp b/Private/NewKit/Crc32.hpp index 7e9ce2af..0dccd4d8 100644 --- a/Private/NewKit/Crc32.hpp +++ b/Private/NewKit/Crc32.hpp @@ -1,7 +1,7 @@ /* * ======================================================== * - * HCore Date Added: 13/02/2023 + * NewOS Date Added: 13/02/2023 * Copyright Mahrouss Logic, all rights reserved. * * ======================================================== @@ -14,8 +14,8 @@ #define kCrcCnt (256) -namespace HCore { +namespace NewOS { UInt ke_calculate_crc32(const Char* crc, UInt len) noexcept; -} // namespace HCore +} // namespace NewOS #endif // !__CRC32_H__ diff --git a/Private/NewKit/Defines.hpp b/Private/NewKit/Defines.hpp index af87e377..e2951174 100644 --- a/Private/NewKit/Defines.hpp +++ b/Private/NewKit/Defines.hpp @@ -22,7 +22,7 @@ #endif #endif -namespace HCore { +namespace NewOS { using voidPtr = void *; using VoidPtr = void *; using nullPtr = decltype(nullptr); @@ -119,17 +119,17 @@ public: } }; -} // namespace HCore +} // namespace NewOS #define DEDUCE_ENDIAN(address, value) \ - (((reinterpret_cast<HCore::Char *>(address)[0]) == (value)) \ - ? (HCore::Endian::kEndianBig) \ - : (HCore::Endian::kEndianLittle)) + (((reinterpret_cast<NewOS::Char *>(address)[0]) == (value)) \ + ? (NewOS::Endian::kEndianBig) \ + : (NewOS::Endian::kEndianLittle)) #define Yes (true) #define No (false) -#define VoidStar HCore::voidPtr +#define VoidStar NewOS::voidPtr #ifdef INIT #undef INIT diff --git a/Private/NewKit/ErrorOr.hpp b/Private/NewKit/ErrorOr.hpp index 8847c1e6..6d85a943 100644 --- a/Private/NewKit/ErrorOr.hpp +++ b/Private/NewKit/ErrorOr.hpp @@ -1,7 +1,7 @@ /* * ======================================================== * -* HCore +* NewOS * Copyright Mahrouss Logic, all rights reserved. * * ======================================================== @@ -12,7 +12,7 @@ #include <NewKit/Defines.hpp> #include <NewKit/Ref.hpp> -namespace HCore +namespace NewOS { using ErrorT = UInt; @@ -65,4 +65,4 @@ template <typename T> class ErrorOr final using ErrorOrAny = ErrorOr<voidPtr>; -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/Function.hpp b/Private/NewKit/Function.hpp index 20d63f80..63bc31dc 100644 --- a/Private/NewKit/Function.hpp +++ b/Private/NewKit/Function.hpp @@ -3,7 +3,7 @@ #include <NewKit/Defines.hpp> -namespace HCore { +namespace NewOS { template <typename T, typename... Args> class Function final { public: @@ -34,6 +34,6 @@ class Function final { private: T (*m_Fn)(Args... args); }; -} // namespace HCore +} // namespace NewOS #endif // !_INC_FUNCTION_HPP__ diff --git a/Private/NewKit/Json.hpp b/Private/NewKit/Json.hpp index 373b0772..6be7430d 100644 --- a/Private/NewKit/Json.hpp +++ b/Private/NewKit/Json.hpp @@ -15,11 +15,11 @@ #include <NewKit/String.hpp> #include <NewKit/Utils.hpp> -namespace HCore { +namespace NewOS { /// @brief Json value class class JsonType final { public: - explicit JsonType() : HCore::JsonType(1, 1) {} + explicit JsonType() : NewOS::JsonType(1, 1) {} explicit JsonType(SizeT lhsLen, SizeT rhsLen) : fKey(lhsLen), fValue(rhsLen) {} @@ -89,4 +89,4 @@ struct JsonStreamTrait final { }; using JsonStream = Stream<JsonStreamTrait, JsonType>; -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/KernelCheck.hpp b/Private/NewKit/KernelCheck.hpp index 77dc558a..c65390ad 100644 --- a/Private/NewKit/KernelCheck.hpp +++ b/Private/NewKit/KernelCheck.hpp @@ -9,13 +9,13 @@ #include <NewKit/Defines.hpp> -namespace HCore { +namespace NewOS { void ke_runtime_check(bool bExpression, const char *file, const char *line); } #define MUST_PASS_COMPILER(EXPR, MSG) static_assert(EXPR, MSG) #define __MUST_PASS(EXPR, FILE, LINE) \ - HCore::ke_runtime_check(EXPR, FILE, STRINGIFY(LINE)) + NewOS::ke_runtime_check(EXPR, FILE, STRINGIFY(LINE)) #define MUST_PASS(EXPR) __MUST_PASS(EXPR, __FILE__, __LINE__) #define assert(EXPR) MUST_PASS(EXPR, RUNTIME_CHECK_EXPRESSION) @@ -36,7 +36,7 @@ enum RUNTIME_CHECK { RUNTIME_CHECK_COUNT, }; -namespace HCore { +namespace NewOS { class DumpManager final { public: static void Dump(void) { @@ -45,7 +45,7 @@ class DumpManager final { }; void ke_stop(const Int &id); -} // namespace HCore +} // namespace NewOS #ifdef TRY #undef TRY diff --git a/Private/NewKit/Macros.hpp b/Private/NewKit/Macros.hpp index c6c4f530..62780068 100644 --- a/Private/NewKit/Macros.hpp +++ b/Private/NewKit/Macros.hpp @@ -25,7 +25,7 @@ #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) \ (((sizeof(a) / sizeof(*(a))) / \ - (static_cast<HCore::Size>(!(sizeof(a) % sizeof(*(a))))))) + (static_cast<NewOS::Size>(!(sizeof(a) % sizeof(*(a))))))) #endif #ifndef ALIGN @@ -36,9 +36,9 @@ #define ATTRIBUTE(X) __attribute__((X)) #endif // #ifndef ATTRIBUTE -#ifndef __HCORE__ -#define __HCORE__ (202401) -#endif // !__HCORE__ +#ifndef __MAHROUSS__ +#define __MAHROUSS__ (202401) +#endif // !__MAHROUSS__ #ifndef EXTERN_C #define EXTERN_C extern "C" diff --git a/Private/NewKit/MutableArray.hpp b/Private/NewKit/MutableArray.hpp index 24bb06d4..1be94548 100644 --- a/Private/NewKit/MutableArray.hpp +++ b/Private/NewKit/MutableArray.hpp @@ -44,7 +44,7 @@ // FIXME: this is a shitty algorithm, which is consumer hungry. // Remove and occurences of that, and remove that class. -namespace HCore +namespace NewOS { template <typename T> class MutableArray; @@ -142,7 +142,7 @@ template <typename T, T _PlaceHolderValue> class NullableMutableArray MutableLinkedList<T> *m_FirstNode{nullptr}; /* Number of nodes inside of this dynamic array. */ - HCore::SizeT m_NodeCount{0}; + NewOS::SizeT m_NodeCount{0}; private: // don't remove that @@ -217,6 +217,6 @@ class MutableArray : public NullableMutableArray<voidPtr, nullptr> MutableLinkedList<T> *m_FirstNode{nullptr}; /* Number of nodes inside of this dynamic array. */ - HCore::SizeT m_NodeCount{0}; + NewOS::SizeT m_NodeCount{0}; }; -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/OwnPtr.hpp b/Private/NewKit/OwnPtr.hpp index 4c1f295b..e6d006ed 100644 --- a/Private/NewKit/OwnPtr.hpp +++ b/Private/NewKit/OwnPtr.hpp @@ -11,7 +11,7 @@ #include <NewKit/KernelCheck.hpp> #include <NewKit/Ref.hpp> -namespace HCore { +namespace NewOS { template <typename T> class OwnPtr; @@ -64,4 +64,4 @@ OwnPtr<T> make_ptr(Args... args) { return ret; } -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/PageAllocator.hpp b/Private/NewKit/PageAllocator.hpp index 2b761844..0b691a64 100644 --- a/Private/NewKit/PageAllocator.hpp +++ b/Private/NewKit/PageAllocator.hpp @@ -10,7 +10,7 @@ #include <NewKit/Defines.hpp> #include <NewKit/PageManager.hpp> -namespace HCore { +namespace NewOS { namespace Detail { VoidPtr create_page_wrapper(Boolean rw, Boolean user); void exec_disable(UIntPtr addr); @@ -18,4 +18,4 @@ bool page_disable(UIntPtr addr); } // namespace Detail // TODO: SwapVirtualMemoryDevice class! -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/PageManager.hpp b/Private/NewKit/PageManager.hpp index a167c0f9..9aba5a6c 100644 --- a/Private/NewKit/PageManager.hpp +++ b/Private/NewKit/PageManager.hpp @@ -17,7 +17,7 @@ #define kBadAddress (0) #endif // #ifndef kBadAddress -namespace HCore { +namespace NewOS { class PageManager; class PTEWrapper final { @@ -76,4 +76,4 @@ struct PageManager final { friend PTEWrapper; friend class Pmm; }; -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/Pair.hpp b/Private/NewKit/Pair.hpp index 6c87da3d..1522caf3 100644 --- a/Private/NewKit/Pair.hpp +++ b/Private/NewKit/Pair.hpp @@ -8,7 +8,7 @@ #include <NewKit/Defines.hpp> -namespace HCore +namespace NewOS { -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/Pmm.hpp b/Private/NewKit/Pmm.hpp index e8b4f05f..ed43a03c 100644 --- a/Private/NewKit/Pmm.hpp +++ b/Private/NewKit/Pmm.hpp @@ -10,7 +10,7 @@ #include <NewKit/PageManager.hpp> #include <NewKit/Ref.hpp> -namespace HCore { +namespace NewOS { class Pmm; class PTEWrapper; @@ -36,4 +36,4 @@ class Pmm final { private: Ref<PageManager> m_PageManager; }; -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/Ref.hpp b/Private/NewKit/Ref.hpp index 5ae7ea80..4327081b 100644 --- a/Private/NewKit/Ref.hpp +++ b/Private/NewKit/Ref.hpp @@ -10,7 +10,7 @@ #include <NewKit/Defines.hpp> #include <NewKit/KernelCheck.hpp> -namespace HCore { +namespace NewOS { template <typename T> class Ref final { public: @@ -60,4 +60,4 @@ class NonNullRef final { private: Ref<T> m_Ref{nullptr}; }; -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/Stream.hpp b/Private/NewKit/Stream.hpp index c344808f..30e60939 100644 --- a/Private/NewKit/Stream.hpp +++ b/Private/NewKit/Stream.hpp @@ -10,7 +10,7 @@ #include <NewKit/Defines.hpp> #include <NewKit/Ref.hpp> -namespace HCore +namespace NewOS { template <typename StreamTrait, typename Kind> class Stream final @@ -55,4 +55,4 @@ namespace HCore Ref<Kind> m_Kind; }; -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/String.hpp b/Private/NewKit/String.hpp index 3694f16c..1806c32a 100644 --- a/Private/NewKit/String.hpp +++ b/Private/NewKit/String.hpp @@ -10,7 +10,7 @@ #include <NewKit/ErrorOr.hpp> #include <NewKit/KernelCheck.hpp> -namespace HCore { +namespace NewOS { class StringView final { public: explicit StringView() = default; @@ -60,4 +60,4 @@ struct StringBuilder final { static const char *Format(const char *fmt, const char *from); static bool Equals(const char *lhs, const char *rhs); }; -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/Utils.hpp b/Private/NewKit/Utils.hpp index 5ef26157..67ecaf22 100644 --- a/Private/NewKit/Utils.hpp +++ b/Private/NewKit/Utils.hpp @@ -9,7 +9,7 @@ #include <NewKit/Defines.hpp> -namespace HCore { +namespace NewOS { Int rt_copy_memory(const voidPtr src, voidPtr dst, Size len); Int rt_move_memory(const voidPtr src, voidPtr dst, Size len); voidPtr rt_set_memory(voidPtr dst, Char val, Size len); @@ -25,4 +25,4 @@ Int rt_to_uppercase(Int c); Int rt_to_lower(Int c); voidPtr rt_string_in_string(const char *in, const char *needle); char *rt_string_from_char(char *str, const char chr); -} // namespace HCore +} // namespace NewOS diff --git a/Private/NewKit/Variant.hpp b/Private/NewKit/Variant.hpp index 77c9726f..109acbbe 100644 --- a/Private/NewKit/Variant.hpp +++ b/Private/NewKit/Variant.hpp @@ -9,7 +9,7 @@ #include <NewKit/Defines.hpp> #include <NewKit/String.hpp> -namespace HCore { +namespace NewOS { class Variant final { public: enum class VariantKind { kString, kPointer, kUndefined }; @@ -36,4 +36,4 @@ class Variant final { voidPtr m_Ptr{nullptr}; VariantKind m_Kind{VariantKind::kUndefined}; }; -} // namespace HCore +} // namespace NewOS |
