From d7112cd6909640afd7609b3a142bc6ecf921ee25 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 30 Jan 2024 08:46:09 +0100 Subject: Kernel: Breaking changes, see source code. Signed-off-by: Amlal El Mahrouss --- Private/Source/Array.cxx | 2 +- Private/Source/ArrayList.cxx | 2 +- Private/Source/Atom.cxx | 2 +- Private/Source/CodeManager.cxx | 185 +++++++++++++------------------ Private/Source/Crc32.cxx | 6 +- Private/Source/CxxAbi.cxx | 12 +- Private/Source/CxxKitRT.cxx | 4 +- Private/Source/Defines.cxx | 2 +- Private/Source/Device.cxx | 2 +- Private/Source/DriveManager.cxx | 6 +- Private/Source/ErrorOr.cxx | 2 +- Private/Source/FileManager.cxx | 8 +- Private/Source/Framebuffer.cxx | 10 +- Private/Source/GUIDWizard.cxx | 6 +- Private/Source/GUIDWrapper.cxx | 4 +- Private/Source/IndexableProperty.cxx | 10 +- Private/Source/Json.cxx | 6 +- Private/Source/KernelHeap.cxx | 6 +- Private/Source/LockDelegate.cxx | 2 +- Private/Source/MeBus/Database.cxx | 2 +- Private/Source/MutableArray.cxx | 2 +- Private/Source/Network/IP.cpp | 12 +- Private/Source/Network/NetworkDevice.cpp | 6 +- Private/Source/New+Delete.cxx | 12 +- Private/Source/NewFS-IO.cxx | 2 +- Private/Source/NewFS-Journal.cxx | 6 +- Private/Source/NewFS.cxx | 6 +- Private/Source/OSErr.cxx | 2 +- Private/Source/OwnPtr.cxx | 2 +- Private/Source/PRDT.cxx | 6 +- Private/Source/PageAllocator.cxx | 8 +- Private/Source/PageManager.cxx | 8 +- Private/Source/Panic.cxx | 49 -------- Private/Source/PermissionSelector.cxx | 8 +- Private/Source/Pmm.cxx | 6 +- Private/Source/ProcessManager.cxx | 12 +- Private/Source/Property.cxx | 6 +- Private/Source/Ref.cxx | 2 +- Private/Source/RuntimeCheck.cxx | 81 ++++++++++++++ Private/Source/RuntimeMain.cxx | 14 +-- Private/Source/SMPManager.cxx | 8 +- Private/Source/Semaphore.cxx | 6 +- Private/Source/SharedObjectEntry.cxx | 4 +- Private/Source/Storage/ATA.cxx | 6 +- Private/Source/Storage/NVME.cxx | 6 +- Private/Source/Storage/Storage.cxx | 2 +- Private/Source/Stream.cxx | 2 +- Private/Source/String.cxx | 6 +- Private/Source/ThreadLocalStorage.cxx | 6 +- Private/Source/Timer.cxx | 4 +- Private/Source/URL.cxx | 6 +- Private/Source/UserHeap.cxx | 6 +- Private/Source/Utils.cxx | 10 +- Private/Source/Variant.cxx | 6 +- 54 files changed, 307 insertions(+), 300 deletions(-) delete mode 100644 Private/Source/Panic.cxx create mode 100644 Private/Source/RuntimeCheck.cxx (limited to 'Private/Source') diff --git a/Private/Source/Array.cxx b/Private/Source/Array.cxx index 86ef7310..3f4f8cfa 100644 --- a/Private/Source/Array.cxx +++ b/Private/Source/Array.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/ArrayList.cxx b/Private/Source/ArrayList.cxx index cc89dc2e..05ee7472 100644 --- a/Private/Source/ArrayList.cxx +++ b/Private/Source/ArrayList.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/Atom.cxx b/Private/Source/Atom.cxx index 018790b0..15c557a7 100644 --- a/Private/Source/Atom.cxx +++ b/Private/Source/Atom.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/CodeManager.cxx b/Private/Source/CodeManager.cxx index ced403cc..364a94f6 100644 --- a/Private/Source/CodeManager.cxx +++ b/Private/Source/CodeManager.cxx @@ -1,162 +1,137 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== */ -#include "NewKit/Defines.hpp" -#include "NewKit/Panic.hpp" #include #include #include #include +#include #include #include #include +#include #include -namespace hCore -{ -namespace Detail -{ -UInt32 rt_get_pef_platform(void) noexcept -{ +namespace HCore { +namespace Detail { +UInt32 rt_get_pef_platform(void) noexcept { #ifdef __32x0__ - return kPefArch32x0; + return kPefArch32x0; #elif defined(__64x0__) - return kPefArch64x0; + return kPefArch64x0; #elif defined(__x86_64__) - return kPefArchAMD64; + return kPefArchAMD64; #else - return kPefArchInvalid; -#endif // __POWER || __x86_64__ + return kPefArchInvalid; +#endif // __POWER || __x86_64__ } -} // namespace Detail +} // namespace Detail -PEFLoader::PEFLoader(const VoidPtr blob) : fCachedBlob(nullptr) -{ - fCachedBlob = blob; - fBad = false; +PEFLoader::PEFLoader(const VoidPtr blob) : fCachedBlob(nullptr) { + fCachedBlob = blob; + fBad = false; - MUST_PASS(fCachedBlob); + MUST_PASS(fCachedBlob); } -PEFLoader::PEFLoader(const char *path) : fCachedBlob(nullptr), fBad(false) -{ - OwnPtr> file; +PEFLoader::PEFLoader(const char *path) : fCachedBlob(nullptr), fBad(false) { + OwnPtr> file; - file.New(const_cast(path)); + file.New(const_cast(path)); - if (StringBuilder::Equals(file->MIME(), this->MIME())) - { - fPath = StringBuilder::Construct(path).Leak(); + if (StringBuilder::Equals(file->MIME(), this->MIME())) { + fPath = StringBuilder::Construct(path).Leak(); - fCachedBlob = file->ReadAll(); + fCachedBlob = file->ReadAll(); - PEFContainer *container = reinterpret_cast(fCachedBlob); - - auto fFree = [&]() -> void { - kcout << "CodeManager: Warning: Bad executable, program will not be started!\n"; - fBad = true; - - kernel_delete_ptr(fCachedBlob); - - fCachedBlob = nullptr; - }; - - if (container->Cpu == Detail::rt_get_pef_platform() && container->Magic[0] == kPefMagic[0] && - container->Magic[1] == kPefMagic[1] && container->Magic[2] == kPefMagic[2] && container->Abi == kPefAbi) - { - if (container->Kind != kPefKindObject && container->Kind != kPefKindDebug) - { - kcout << "CodeManager: Info: Good executable. can proceed.\n"; - return; - } - } + PEFContainer *container = reinterpret_cast(fCachedBlob); - fFree(); + auto fFree = [&]() -> void { + kcout << "CodeManager: Warning: Bad executable, program will not be " + "started!\n"; + fBad = true; + + kernel_delete_ptr(fCachedBlob); + + fCachedBlob = nullptr; + }; + + if (container->Cpu == Detail::rt_get_pef_platform() && + container->Magic[0] == kPefMagic[0] && + container->Magic[1] == kPefMagic[1] && + container->Magic[2] == kPefMagic[2] && container->Abi == kPefAbi) { + if (container->Kind != kPefKindObject && + container->Kind != kPefKindDebug) { + kcout << "CodeManager: Info: Good executable. can proceed.\n"; + return; + } } + + fFree(); + } } -PEFLoader::~PEFLoader() -{ - if (fCachedBlob) - kernel_delete_ptr(fCachedBlob); +PEFLoader::~PEFLoader() { + if (fCachedBlob) kernel_delete_ptr(fCachedBlob); } -VoidPtr PEFLoader::FindSymbol(const char *name, Int32 kind) -{ - if (!fCachedBlob || fBad) - return nullptr; +VoidPtr PEFLoader::FindSymbol(const char *name, Int32 kind) { + if (!fCachedBlob || fBad) return nullptr; - PEFContainer *container = reinterpret_cast(fCachedBlob); + PEFContainer *container = reinterpret_cast(fCachedBlob); - PEFCommandHeader *container_header = - reinterpret_cast((UIntPtr)fCachedBlob + sizeof(PEFContainer)); + PEFCommandHeader *container_header = reinterpret_cast( + (UIntPtr)fCachedBlob + sizeof(PEFContainer)); - for (SizeT index = 0; index < container->Count; ++index) - { - kcout << "Iterating over container at index: " << StringBuilder::FromInt("%", index) - << ", name: " << container_header->Name << "\n"; + for (SizeT index = 0; index < container->Count; ++index) { + kcout << "Iterating over container at index: " + << StringBuilder::FromInt("%", index) + << ", name: " << container_header->Name << "\n"; - if (StringBuilder::Equals(container_header->Name, name)) - { - kcout << "Found potential container, checking for validity.\n"; + if (StringBuilder::Equals(container_header->Name, name)) { + kcout << "Found potential container, checking for validity.\n"; - if (container_header->Kind == kind) - return static_cast(fCachedBlob) + container_header->Offset; + if (container_header->Kind == kind) + return static_cast(fCachedBlob) + container_header->Offset; - continue; - } + continue; } + } - return nullptr; + return nullptr; } -ErrorOr PEFLoader::LoadStart() -{ - if (auto sym = this->FindSymbol("__start", kPefCode); sym) - return ErrorOr(sym); +ErrorOr PEFLoader::LoadStart() { + if (auto sym = this->FindSymbol("__start", kPefCode); sym) + return ErrorOr(sym); - return ErrorOr(H_EXEC_ERROR); + return ErrorOr(H_EXEC_ERROR); } -bool PEFLoader::IsLoaded() noexcept -{ - return !fBad && fCachedBlob; -} +bool PEFLoader::IsLoaded() noexcept { return !fBad && fCachedBlob; } -namespace Utils -{ -bool execute_from_image(PEFLoader &exec) noexcept -{ - auto errOrStart = exec.LoadStart(); +namespace Utils { +bool execute_from_image(PEFLoader &exec) noexcept { + auto errOrStart = exec.LoadStart(); - if (errOrStart.Error() != 0) - return false; + if (errOrStart.Error() != 0) return false; - Process proc(errOrStart.Leak().Leak()); - Ref refProc = proc; + Process proc(errOrStart.Leak().Leak()); + Ref refProc = proc; - return ProcessManager::Shared().Leak().Add(refProc); + return ProcessManager::Shared().Leak().Add(refProc); } -} // namespace Utils +} // namespace Utils -const char *PEFLoader::Path() -{ - return fPath.Leak().CData(); -} +const char *PEFLoader::Path() { return fPath.Leak().CData(); } -const char *PEFLoader::Format() -{ - return "PEF"; -} +const char *PEFLoader::Format() { return "PEF"; } -const char *PEFLoader::MIME() -{ - return "application/x-exec"; -} -} // namespace hCore +const char *PEFLoader::MIME() { return "application/x-exec"; } +} // namespace HCore diff --git a/Private/Source/Crc32.cxx b/Private/Source/Crc32.cxx index 233d9847..7d17ae99 100644 --- a/Private/Source/Crc32.cxx +++ b/Private/Source/Crc32.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -12,7 +12,7 @@ // @file CRC32.cpp // @brief Checksum implementation. -namespace hCore { +namespace HCore { UInt kCrcTbl[kCrcCnt] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, @@ -67,4 +67,4 @@ Int ke_calculate_crc32(const Char *p, Int len) noexcept { // return (~crc); also works return (crc ^ 0xffffffff); } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/CxxAbi.cxx b/Private/Source/CxxAbi.cxx index 49b5834a..11120a26 100644 --- a/Private/Source/CxxAbi.cxx +++ b/Private/Source/CxxAbi.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -9,7 +9,7 @@ #include #include -#include +#include #ifdef __GNUC__ @@ -18,13 +18,11 @@ void *__dso_handle; atexit_func_entry_t __atexit_funcs[DSO_MAX_OBJECTS]; uarch_t __atexit_func_count; -extern "C" void __cxa_pure_virtual() { - hCore::kcout << "[__cxa_pure_virtual] Placeholder\n"; -} +extern "C" void __cxa_pure_virtual() { HCore::kcout << "[C++] Placeholder\n"; } extern "C" void __stack_chk_fail() { - hCore::kcout << "[__stack_chk_fail] Buffer overflow detected\n"; - hCore::panic(RUNTIME_CHECK_POINTER); + HCore::kcout << "[HCoreKrnl] Buffer overflow detected\n"; + HCore::ke_stop(RUNTIME_CHECK_POINTER); } extern "C" int __cxa_atexit(void (*f)(void *), void *arg, void *dso) { diff --git a/Private/Source/CxxKitRT.cxx b/Private/Source/CxxKitRT.cxx index e608ab3c..efe4d9f2 100644 --- a/Private/Source/CxxKitRT.cxx +++ b/Private/Source/CxxKitRT.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -11,7 +11,7 @@ #include #include -using namespace hCore; +using namespace HCore; // unimplemented _HintTell void _HintTell(_HintMessage* ppMsg, _HintId* pId) { diff --git a/Private/Source/Defines.cxx b/Private/Source/Defines.cxx index 3e0bd946..db16111d 100644 --- a/Private/Source/Defines.cxx +++ b/Private/Source/Defines.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/Device.cxx b/Private/Source/Device.cxx index 484c20a3..df256b3b 100644 --- a/Private/Source/Device.cxx +++ b/Private/Source/Device.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/DriveManager.cxx b/Private/Source/DriveManager.cxx index ee279ed1..9611575d 100644 --- a/Private/Source/DriveManager.cxx +++ b/Private/Source/DriveManager.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -10,7 +10,7 @@ #include #include -namespace hCore { +namespace HCore { DriveSelector::DriveSelector() : fDrive(nullptr) {} DriveSelector::~DriveSelector() { @@ -49,4 +49,4 @@ DriveTraits *DriveSelector::Unmount() { return drivePointer; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/ErrorOr.cxx b/Private/Source/ErrorOr.cxx index aff86ed0..ab8a5701 100644 --- a/Private/Source/ErrorOr.cxx +++ b/Private/Source/ErrorOr.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/FileManager.cxx b/Private/Source/FileManager.cxx index 9bf26c29..a0482f03 100644 --- a/Private/Source/FileManager.cxx +++ b/Private/Source/FileManager.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -11,9 +11,9 @@ #include #include -//! @brief File manager for hCore. +//! @brief File manager for HCore. -namespace hCore { +namespace HCore { static IFilesystemManager* kMounted = nullptr; /// @brief FilesystemManager getter. @@ -39,4 +39,4 @@ bool IFilesystemManager::Mount(IFilesystemManager* pMount) { return false; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Framebuffer.cxx b/Private/Source/Framebuffer.cxx index 1a73e449..9164e913 100644 --- a/Private/Source/Framebuffer.cxx +++ b/Private/Source/Framebuffer.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -9,15 +9,15 @@ #include -namespace hCore { -Framebuffer::Framebuffer(hCore::Ref& addr) +namespace HCore { +Framebuffer::Framebuffer(HCore::Ref& addr) : m_FrameBufferAddr(addr), m_Colour(FramebufferColorKind::RGB32) {} Framebuffer::~Framebuffer() = default; volatile UIntPtr* Framebuffer::operator[](const UIntPtr& width_and_height) { if (m_FrameBufferAddr) - return reinterpret_cast( + return reinterpret_cast( m_FrameBufferAddr->m_Base + width_and_height); return nullptr; @@ -33,4 +33,4 @@ const FramebufferColorKind& Framebuffer::Color( return m_Colour; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/GUIDWizard.cxx b/Private/Source/GUIDWizard.cxx index d3b11b0a..57915f64 100644 --- a/Private/Source/GUIDWizard.cxx +++ b/Private/Source/GUIDWizard.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -16,7 +16,7 @@ // @brief Size of UUID. #define kUUIDSize 32 -namespace hCore::XRN::Version1 { +namespace HCore::XRN::Version1 { auto make_sequence(const ArrayList& uuidSeq) -> Ref { GUIDSequence* seq = new GUIDSequence(); MUST_PASS(seq); @@ -54,4 +54,4 @@ auto try_guid_to_string(Ref& seq) -> ErrorOr> { return ErrorOr>{-1}; } -} // namespace hCore::XRN::Version1 +} // namespace HCore::XRN::Version1 diff --git a/Private/Source/GUIDWrapper.cxx b/Private/Source/GUIDWrapper.cxx index fa9a52a6..5626a592 100644 --- a/Private/Source/GUIDWrapper.cxx +++ b/Private/Source/GUIDWrapper.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -9,4 +9,4 @@ #include -namespace hCore::XRN {} +namespace HCore::XRN {} diff --git a/Private/Source/IndexableProperty.cxx b/Private/Source/IndexableProperty.cxx index 2dac5a09..7c322e11 100644 --- a/Private/Source/IndexableProperty.cxx +++ b/Private/Source/IndexableProperty.cxx @@ -1,26 +1,26 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== */ -//! @brief hCore NewFS Indexer. +//! @brief HCore NewFS Indexer. -#include +#include #include #include #include #define kMaxLenIndexer 256 -namespace hCore { +namespace HCore { namespace Indexer { IndexProperty& IndexableProperty::LeakProperty() noexcept { return fIndex; } void IndexableProperty::AddFlag(Int16 flag) { fFlags |= flag; } void IndexableProperty::RemoveFlag(Int16 flag) { fFlags &= flag; } } // namespace Indexer -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Json.cxx b/Private/Source/Json.cxx index adfd571d..835c1fda 100644 --- a/Private/Source/Json.cxx +++ b/Private/Source/Json.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -9,7 +9,7 @@ #include -using namespace hCore; +using namespace HCore; /// @brief Undefined object, is null in length. -INIT(hCore::JsonType::kUndefined, hCore::JsonType); +INIT(HCore::JsonType::kUndefined, HCore::JsonType); diff --git a/Private/Source/KernelHeap.cxx b/Private/Source/KernelHeap.cxx index 02688a2f..94e9156c 100644 --- a/Private/Source/KernelHeap.cxx +++ b/Private/Source/KernelHeap.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -14,7 +14,7 @@ #define kMaxWrappers (4096 * 8) -namespace hCore { +namespace HCore { static Ref kWrapperList[kMaxWrappers]; static SizeT kWrapperCount = 0UL; static Ref kLastWrapper; @@ -106,4 +106,4 @@ Boolean kernel_valid_ptr(voidPtr ptr) { return false; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/LockDelegate.cxx b/Private/Source/LockDelegate.cxx index d6608e60..1b3144a0 100644 --- a/Private/Source/LockDelegate.cxx +++ b/Private/Source/LockDelegate.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/MeBus/Database.cxx b/Private/Source/MeBus/Database.cxx index 3c7594d5..387466c9 100644 --- a/Private/Source/MeBus/Database.cxx +++ b/Private/Source/MeBus/Database.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/MutableArray.cxx b/Private/Source/MutableArray.cxx index b10a0785..e9faebe7 100644 --- a/Private/Source/MutableArray.cxx +++ b/Private/Source/MutableArray.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/Network/IP.cpp b/Private/Source/Network/IP.cpp index 4e8f602a..f58e59b6 100644 --- a/Private/Source/Network/IP.cpp +++ b/Private/Source/Network/IP.cpp @@ -1,7 +1,7 @@ /* * ======================================================== * - * NewKit + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -10,7 +10,7 @@ #include #include -namespace hCore { +namespace HCore { char* RawIPAddress::Address() { return m_Addr; } RawIPAddress::RawIPAddress(char bytes[4]) { rt_copy_memory(bytes, m_Addr, 4); } @@ -34,7 +34,8 @@ bool RawIPAddress::operator!=(const RawIPAddress& ipv4) { char& RawIPAddress::operator[](const Size& index) { kcout << "[RawIPAddress::operator[]] Fetching Index...\r\n"; - if (index > 4) panic(RUNTIME_CHECK_EXPRESSION); + static char IP_PLACEHOLDER = '0'; + if (index > 4) return IP_PLACEHOLDER; return m_Addr[index]; } @@ -46,7 +47,8 @@ RawIPAddress6::RawIPAddress6(char bytes[8]) { char& RawIPAddress6::operator[](const Size& index) { kcout << "[RawIPAddress6::operator[]] Fetching Index...\r\n"; - if (index > 8) panic(RUNTIME_CHECK_EXPRESSION); + static char IP_PLACEHOLDER = '0'; + if (index > 8) return IP_PLACEHOLDER; return m_Addr[index]; } @@ -92,4 +94,4 @@ bool IPFactory::IpCheckVersion4(const char* ip) { return true; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Network/NetworkDevice.cpp b/Private/Source/Network/NetworkDevice.cpp index bd75d7ed..4f07a5eb 100644 --- a/Private/Source/Network/NetworkDevice.cpp +++ b/Private/Source/Network/NetworkDevice.cpp @@ -1,7 +1,7 @@ /* * ======================================================== * - * NewKit + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -12,7 +12,7 @@ // network devices implementation. // PPPNetworkService, TCPNetworkDevice, UDPNetworkService -namespace hCore { +namespace HCore { NetworkDevice::NetworkDevice(void (*out)(NetworkDeviceCommand), void (*in)(NetworkDeviceCommand), void (*on_cleanup)(void)) @@ -29,4 +29,4 @@ NetworkDevice::~NetworkDevice() { if (fCleanup) fCleanup(); } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/New+Delete.cxx b/Private/Source/New+Delete.cxx index 0e247e0c..e4dba396 100644 --- a/Private/Source/New+Delete.cxx +++ b/Private/Source/New+Delete.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -15,7 +15,7 @@ void* operator new[](size_t sz) if (sz == 0) ++sz; - return hCore::kernel_new_ptr(sz, true, false); + return HCore::kernel_new_ptr(sz, true, false); } void* operator new(size_t sz) @@ -23,7 +23,7 @@ void* operator new(size_t sz) if (sz == 0) ++sz; - return hCore::kernel_new_ptr(sz, true, false); + return HCore::kernel_new_ptr(sz, true, false); } void operator delete[](void* ptr) @@ -31,7 +31,7 @@ void operator delete[](void* ptr) if (ptr == nullptr) return; - hCore::kernel_delete_ptr(ptr); + HCore::kernel_delete_ptr(ptr); } void operator delete(void* ptr) @@ -39,7 +39,7 @@ void operator delete(void* ptr) if (ptr == nullptr) return; - hCore::kernel_delete_ptr(ptr); + HCore::kernel_delete_ptr(ptr); } void operator delete(void* ptr, size_t sz) @@ -49,6 +49,6 @@ void operator delete(void* ptr, size_t sz) (void)sz; - hCore::kernel_delete_ptr(ptr); + HCore::kernel_delete_ptr(ptr); } diff --git a/Private/Source/NewFS-IO.cxx b/Private/Source/NewFS-IO.cxx index b9ecfd52..f5d550e0 100644 --- a/Private/Source/NewFS-IO.cxx +++ b/Private/Source/NewFS-IO.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/NewFS-Journal.cxx b/Private/Source/NewFS-Journal.cxx index 14ba417f..8b79abbf 100644 --- a/Private/Source/NewFS-Journal.cxx +++ b/Private/Source/NewFS-Journal.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -14,7 +14,7 @@ #define kOpCache (4) -namespace hCore { +namespace HCore { typedef Boolean (*NewFSRunner)(VoidPtr delegate); class NewFSJournalRunner final { @@ -56,4 +56,4 @@ class NewFSJournalRunner final { return false; } }; -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/NewFS.cxx b/Private/Source/NewFS.cxx index 2283e779..09f11b87 100644 --- a/Private/Source/NewFS.cxx +++ b/Private/Source/NewFS.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -10,7 +10,7 @@ #include #include -namespace hCore { +namespace HCore { NewFilesystemManager::NewFilesystemManager() = default; NewFilesystemManager::~NewFilesystemManager() = default; @@ -40,4 +40,4 @@ NodePtr NewFilesystemManager::CreateDirectory(const char* path) { NodePtr NewFilesystemManager::CreateAlias(const char* path) { return node_cast(fIO->CreateCatalog(path, 0, kCatalogKindAlias)); } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/OSErr.cxx b/Private/Source/OSErr.cxx index 6c37c40d..791127b4 100644 --- a/Private/Source/OSErr.cxx +++ b/Private/Source/OSErr.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/OwnPtr.cxx b/Private/Source/OwnPtr.cxx index f7f9d31f..42ce6244 100644 --- a/Private/Source/OwnPtr.cxx +++ b/Private/Source/OwnPtr.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/PRDT.cxx b/Private/Source/PRDT.cxx index 8ea2ee70..4749dcda 100644 --- a/Private/Source/PRDT.cxx +++ b/Private/Source/PRDT.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -11,7 +11,7 @@ #include #include -namespace hCore { +namespace HCore { PRDT::PRDT(const UIntPtr& physAddr) : m_PrdtAddr(physAddr) { MUST_PASS(physAddr); kcout << "PRDT::PRDT() {}\r\n"; @@ -32,4 +32,4 @@ PRDT& PRDT::operator=(const UIntPtr& prdtAddress) { m_PrdtAddr = prdtAddress; return *this; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/PageAllocator.cxx b/Private/Source/PageAllocator.cxx index 59ad6b28..3e630aa1 100644 --- a/Private/Source/PageAllocator.cxx +++ b/Private/Source/PageAllocator.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -12,13 +12,13 @@ #include // empty for now. -namespace hCore::Detail { +namespace HCore::Detail { UIntPtr create_page_wrapper(Boolean rw, Boolean user) { auto addr = HAL::hal_create_page(rw, user); if (addr == kBadAddress) { kcout << "[create_page_wrapper] kBadAddress returned\n"; - panic(RUNTIME_CHECK_POINTER); + ke_stop(RUNTIME_CHECK_POINTER); } return addr; @@ -47,4 +47,4 @@ bool page_disable(UIntPtr VirtualAddr) { return false; } -} // namespace hCore::Detail +} // namespace HCore::Detail diff --git a/Private/Source/PageManager.cxx b/Private/Source/PageManager.cxx index 32c1f22a..95300bd9 100644 --- a/Private/Source/PageManager.cxx +++ b/Private/Source/PageManager.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -10,7 +10,7 @@ #include #include -namespace hCore { +namespace HCore { PTEWrapper::PTEWrapper(Boolean Rw, Boolean User, Boolean ExecDisable, UIntPtr VirtAddr) : m_Rw(Rw), @@ -62,7 +62,7 @@ bool PTEWrapper::Reclaim() { PTEWrapper *PageManager::Request(Boolean Rw, Boolean User, Boolean ExecDisable) { PTEWrapper *PageTableEntry = reinterpret_cast( - hCore::HAL::hal_alloc_page(sizeof(PTEWrapper), Rw, User)); + HCore::HAL::hal_alloc_page(sizeof(PTEWrapper), Rw, User)); if (PageTableEntry == nullptr) { kcout << "PTEWrapper : Page table is nullptr!, kernel_new_ptr failed!"; @@ -120,4 +120,4 @@ bool PTEWrapper::Access() { return m_Accessed; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Panic.cxx b/Private/Source/Panic.cxx deleted file mode 100644 index 9e3dddfb..00000000 --- a/Private/Source/Panic.cxx +++ /dev/null @@ -1,49 +0,0 @@ -/* - * ======================================================== - * - * hCore - * Copyright 2024 Mahrouss Logic, all rights reserved. - * - * ======================================================== - */ - -#include -#include -#include -#include - -extern "C" [[noreturn]] void wait_for_debugger() { - while (true) { - hCore::HAL::rt_cli(); - hCore::HAL::rt_halt(); - } -} - -/* Each error code is attributed with an ID, which will prompt a string onto the - * screen. Wait for debugger... */ - -namespace hCore { -void panic(const hCore::Int &id) { -#ifdef __DEBUG__ - kcout << "hCore: Kernel Panic! \r\n"; - kcout << StringBuilder::FromInt("kError : %\n", id); - - DumpManager::Dump(); -#endif // __DEBUG__ - - wait_for_debugger(); -} - -void runtime_check(bool expr, const char *file, const char *line) { - if (!expr) { -#ifdef __DEBUG__ - kcout << "[KERNEL] Check Failed!\n"; - kcout << "[KERNEL] File: " << file << "\n"; - kcout << "[KERNEL] Where: " << line << "\n"; - -#endif // __DEBUG__ - - hCore::panic(RUNTIME_CHECK_FAILED); // Runtime Check failed - } -} -} // namespace hCore diff --git a/Private/Source/PermissionSelector.cxx b/Private/Source/PermissionSelector.cxx index 69bb949b..299a35a6 100644 --- a/Private/Source/PermissionSelector.cxx +++ b/Private/Source/PermissionSelector.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * File: PermissionSelector.cpp @@ -11,9 +11,9 @@ */ #include -#include +#include -namespace hCore { +namespace HCore { PermissionSelector::PermissionSelector(const Int32 &sel) : fRing((RingKind)sel) { MUST_PASS(sel > 0); @@ -33,4 +33,4 @@ bool PermissionSelector::operator!=(const PermissionSelector &lhs) { } const RingKind &PermissionSelector::Ring() noexcept { return this->fRing; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Pmm.cxx b/Private/Source/Pmm.cxx index b87e450b..3f335d45 100644 --- a/Private/Source/Pmm.cxx +++ b/Private/Source/Pmm.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -10,7 +10,7 @@ #include #include -namespace hCore { +namespace HCore { Pmm::Pmm() = default; Pmm::Pmm(Ref &pm) : m_PageManager(pm) { @@ -75,4 +75,4 @@ Boolean Pmm::ToggleShare(Ref PageRef, Boolean Enable) { return true; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/ProcessManager.cxx b/Private/Source/ProcessManager.cxx index ce20cad4..9d1792a2 100644 --- a/Private/Source/ProcessManager.cxx +++ b/Private/Source/ProcessManager.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -17,7 +17,7 @@ #include #include -#include "NewKit/Panic.hpp" +#include "NewKit/RuntimeCheck.hpp" ///! bugs = 0 @@ -27,7 +27,7 @@ * For MT see SMPManager. */ /***********************************************************************************/ -namespace hCore { +namespace HCore { /***********************************************************************************/ /// Exit Code stuff /***********************************************************************************/ @@ -122,11 +122,11 @@ const AffinityKind &Process::GetAffinity() { return this->Affinity; } void Process::Exit(Int32 exit_code) { if (this->ProcessId != ProcessManager::Shared().Leak().GetCurrent().Leak().ProcessId) - panic(RUNTIME_CHECK_PROCESS); + ke_stop(RUNTIME_CHECK_PROCESS); if (this->Ring == (Int32)ProcessSelector::kRingKernel && ProcessManager::Shared().Leak().GetCurrent().Leak().Ring > 0) - panic(RUNTIME_CHECK_PROCESS); + ke_stop(RUNTIME_CHECK_PROCESS); kExitCode = exit_code; @@ -283,4 +283,4 @@ bool ProcessHelper::Switch(HAL::StackFrame *the_stack, const PID &new_pid) { return false; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Property.cxx b/Private/Source/Property.cxx index f3633598..8128e241 100644 --- a/Private/Source/Property.cxx +++ b/Private/Source/Property.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -9,10 +9,10 @@ #include -namespace hCore { +namespace HCore { bool Property::StringEquals(StringView& name) { return m_sName && this->m_sName == name; } const PropertyId& Property::GetPropertyById() { return m_Action; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Ref.cxx b/Private/Source/Ref.cxx index 28064552..9f2d4b58 100644 --- a/Private/Source/Ref.cxx +++ b/Private/Source/Ref.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/RuntimeCheck.cxx b/Private/Source/RuntimeCheck.cxx new file mode 100644 index 00000000..09440a20 --- /dev/null +++ b/Private/Source/RuntimeCheck.cxx @@ -0,0 +1,81 @@ +/* + * ======================================================== + * + * HCore + * Copyright 2024 Mahrouss Logic, all rights reserved. + * + * ======================================================== + */ + +#include +#include +#include +#include + +extern "C" [[noreturn]] void wait_for_debugger() { + while (true) { + HCore::HAL::rt_cli(); + HCore::HAL::rt_halt(); + } +} + +/* Each error code is attributed with an ID, which will prompt a string onto the + * screen. Wait for debugger... */ + +namespace HCore { +void ke_stop(const HCore::Int &id) { + kcout << "*** STOP *** \r\n"; + kcout << "*** HCoreKrnl.exe has trigerred a runtime breakpoint. *** \r\n"; + + switch (id) { + case RUNTIME_CHECK_PROCESS: { + kcout << "*** CAUSE: RUNTIME_CHECK_PROCESS *** \r\n"; + break; + } + case RUNTIME_CHECK_ACPI: { + kcout << "*** CAUSE: RUNTIME_CHECK_ACPI *** \r\n"; + break; + } + case RUNTIME_CHECK_POINTER: { + kcout << "*** CAUSE: RUNTIME_CHECK_POINTER *** \r\n"; + break; + } + case RUNTIME_CHECK_BAD_BEHAVIOR: { + kcout << "*** CAUSE: RUNTIME_CHECK_BAD_BEHAVIOR *** \r\n"; + break; + } + case RUNTIME_CHECK_BOOTSTRAP: { + kcout << "*** CAUSE: RUNTIME_CHECK_BOOTSTRAP *** \r\n"; + break; + } + case RUNTIME_CHECK_HANDSHAKE: { + kcout << "*** CAUSE: RUNTIME_CHECK_HANDSHAKE *** \r\n"; + break; + } + case RUNTIME_CHECK_LD: { + kcout << "*** CAUSE: RUNTIME_CHECK_LD *** \r\n"; + break; + } + case RUNTIME_CHECK_INVALID_PRIVILEGE: { + kcout << "*** CAUSE: RUNTIME_CHECK_INVALID_PRIVILEGE *** \r\n"; + break; + } + }; + + DumpManager::Dump(); + wait_for_debugger(); +} + +void runtime_check(bool expr, const char *file, const char *line) { + if (!expr) { +#ifdef __DEBUG__ + kcout << "[KERNEL] Check Failed!\n"; + kcout << "[KERNEL] File: " << file << "\n"; + kcout << "[KERNEL] Where: " << line << "\n"; + +#endif // __DEBUG__ + + HCore::ke_stop(RUNTIME_CHECK_FAILED); // Runtime Check failed + } +} +} // namespace HCore diff --git a/Private/Source/RuntimeMain.cxx b/Private/Source/RuntimeMain.cxx index a2b777d8..6ae257bc 100644 --- a/Private/Source/RuntimeMain.cxx +++ b/Private/Source/RuntimeMain.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -17,17 +17,17 @@ extern "C" void (*__SYSTEM_FINI)(); extern "C" void (**__SYSTEM_INIT)(); extern "C" void RuntimeMain() { - for (hCore::SizeT index_init = 0UL; + for (HCore::SizeT index_init = 0UL; __SYSTEM_INIT[index_init] != __SYSTEM_FINI; ++index_init) { __SYSTEM_INIT[index_init](); } - MUST_PASS(hCore::init_hal()); + MUST_PASS(HCore::init_hal()); - hCore::IFilesystemManager::Mount(new hCore::NewFilesystemManager()); - hCore::PEFLoader img("/System/Seeker.cm"); + HCore::IFilesystemManager::Mount(new HCore::NewFilesystemManager()); + HCore::PEFLoader img("/System/Seeker.cm"); - if (!hCore::Utils::execute_from_image(img)) { - hCore::panic(RUNTIME_CHECK_BOOTSTRAP); + if (!HCore::Utils::execute_from_image(img)) { + HCore::ke_stop(RUNTIME_CHECK_BOOTSTRAP); } } diff --git a/Private/Source/SMPManager.cxx b/Private/Source/SMPManager.cxx index c261e6b8..9dd38d33 100644 --- a/Private/Source/SMPManager.cxx +++ b/Private/Source/SMPManager.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -13,10 +13,10 @@ /// BUGS: 0 -//! This file handles multi processing in hCore. +//! This file handles multi processing in HCore. //! Multi processing is needed for File I/O, networking and scheduling. -namespace hCore { +namespace HCore { // A ProcessorCore class takes care of it's owned hardware thread. // It has a stack for it's core. @@ -140,4 +140,4 @@ SMPManager::operator bool() noexcept { return !m_ThreadList.Empty(); } * @return */ bool SMPManager::operator!() noexcept { return m_ThreadList.Empty(); } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Semaphore.cxx b/Private/Source/Semaphore.cxx index 5702b9fb..49ce2f40 100644 --- a/Private/Source/Semaphore.cxx +++ b/Private/Source/Semaphore.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -11,7 +11,7 @@ #include #include -namespace hCore { +namespace HCore { bool Semaphore::Unlock() noexcept { if (fLockingProcess) fLockingProcess = nullptr; @@ -41,4 +41,4 @@ void Semaphore::Sync() noexcept { while (fLockingProcess) { } } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/SharedObjectEntry.cxx b/Private/Source/SharedObjectEntry.cxx index 9fe14b39..c4d69be9 100644 --- a/Private/Source/SharedObjectEntry.cxx +++ b/Private/Source/SharedObjectEntry.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -14,7 +14,7 @@ #include #include -using namespace hCore; +using namespace HCore; /***********************************************************************************/ /// @file SharedObjectEntry.cxx diff --git a/Private/Source/Storage/ATA.cxx b/Private/Source/Storage/ATA.cxx index ed62df4f..18559526 100644 --- a/Private/Source/Storage/ATA.cxx +++ b/Private/Source/Storage/ATA.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -19,7 +19,7 @@ #define kATAError 2 -namespace hCore { +namespace HCore { Ref kPrdt = nullptr; bool set_prdt_struct(Ref& refCtrl) { @@ -95,4 +95,4 @@ Int32 ata_write_28(ULong lba, const char* text) { return packet[1] == 2 ? kATAError : 0; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Storage/NVME.cxx b/Private/Source/Storage/NVME.cxx index 9501b8fa..637162e9 100644 --- a/Private/Source/Storage/NVME.cxx +++ b/Private/Source/Storage/NVME.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -9,6 +9,6 @@ #include -namespace hCore { +namespace HCore { const char *NVMEDevice::Name() const { return ("NVMEDevice"); } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Storage/Storage.cxx b/Private/Source/Storage/Storage.cxx index 2340763a..e39b13d8 100644 --- a/Private/Source/Storage/Storage.cxx +++ b/Private/Source/Storage/Storage.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/Stream.cxx b/Private/Source/Stream.cxx index 598ad086..ba0b0145 100644 --- a/Private/Source/Stream.cxx +++ b/Private/Source/Stream.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== diff --git a/Private/Source/String.cxx b/Private/Source/String.cxx index b4f95f6c..da1e2e84 100644 --- a/Private/Source/String.cxx +++ b/Private/Source/String.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -10,7 +10,7 @@ #include #include -namespace hCore { +namespace HCore { Char *StringView::Data() { return m_Data; } const Char *StringView::CData() { return m_Data; } @@ -191,4 +191,4 @@ StringView &StringView::operator+=(const StringView &rhs) { return *this; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/ThreadLocalStorage.cxx b/Private/Source/ThreadLocalStorage.cxx index 4e322e81..eee4f820 100644 --- a/Private/Source/ThreadLocalStorage.cxx +++ b/Private/Source/ThreadLocalStorage.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -15,7 +15,7 @@ /// @brief TLS implementation in kernel. /***********************************************************************************/ -using namespace hCore; +using namespace HCore; /** * Check for cookie inside TIB. @@ -34,7 +34,7 @@ Boolean hcore_tls_check(VoidPtr ptr) { } /** - * System call implementation in hCore + * System call implementation in HCore * @param ptr * @return */ diff --git a/Private/Source/Timer.cxx b/Private/Source/Timer.cxx index 137a5545..fdcf570d 100644 --- a/Private/Source/Timer.cxx +++ b/Private/Source/Timer.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -11,7 +11,7 @@ // bugs = 0 -using namespace hCore; +using namespace HCore; Int32 HardwareTimerInterface::Wait() noexcept { return H_UNIMPLEMENTED; } diff --git a/Private/Source/URL.cxx b/Private/Source/URL.cxx index 02a3ec77..cd676c30 100644 --- a/Private/Source/URL.cxx +++ b/Private/Source/URL.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -13,7 +13,7 @@ // Bugs = 0 -namespace hCore { +namespace HCore { Url::Url(StringView &strUrl) : m_urlView(strUrl, false) {} Url::~Url() = default; @@ -84,4 +84,4 @@ Ref> Url::Protocol() noexcept { return Ref>(loc); } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/UserHeap.cxx b/Private/Source/UserHeap.cxx index e748e315..9df475e7 100644 --- a/Private/Source/UserHeap.cxx +++ b/Private/Source/UserHeap.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -15,7 +15,7 @@ /// @note if you want to look at kernel allocs, please look for KHeap.cxx /// bugs: 0 -namespace hCore { +namespace HCore { class HeapManager final { public: static SizeT& GetCount() { return s_NumPools; } @@ -185,4 +185,4 @@ Boolean pool_ptr_exists(UIntPtr thePool, UIntPtr thePtr, SizeT theLimit) { return ((thePool) < (thePtr) < (theLimit)); } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Utils.cxx b/Private/Source/Utils.cxx index 6569258b..3a3ba2a0 100644 --- a/Private/Source/Utils.cxx +++ b/Private/Source/Utils.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -9,7 +9,7 @@ #include -namespace hCore { +namespace HCore { Int string_compare(const Char *src, const Char *cmp, Size size) { Int32 counter = 0; @@ -163,12 +163,12 @@ char *string_from_char(char *str, const char chr) { return str; } -} // namespace hCore +} // namespace HCore extern "C" void memset(void *dst, char src, size_t len) { - hCore::rt_set_memory(dst, src, len); + HCore::rt_set_memory(dst, src, len); } extern "C" void memcpy(void *dst, void *src, size_t len) { - hCore::rt_copy_memory(src, dst, len); + HCore::rt_copy_memory(src, dst, len); } diff --git a/Private/Source/Variant.cxx b/Private/Source/Variant.cxx index cb1a9a01..a09c847c 100644 --- a/Private/Source/Variant.cxx +++ b/Private/Source/Variant.cxx @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -9,7 +9,7 @@ #include -namespace hCore { +namespace HCore { const Char* Variant::ToString() { if (m_Ptr == nullptr) { return ("Memory:{Nullptr}"); @@ -25,4 +25,4 @@ const Char* Variant::ToString() { } } -} // namespace hCore +} // namespace HCore -- cgit v1.2.3