diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-02 13:49:50 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-02 13:49:50 +0100 |
| commit | e559cf01834340d0a4dfcb45f7bdf081e8994032 (patch) | |
| tree | b7d1aa03111f83c0b7b058dca2786a6bd234a7e3 /Private/Source | |
| parent | 05eca8d3061b60eac0a652a4b1e39269a9af79e8 (diff) | |
Kernel: Port toolchain to mingw (PE/COFF)
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/Source')
| -rw-r--r-- | Private/Source/CxxAbi.cxx | 7 | ||||
| -rw-r--r-- | Private/Source/KernelHeap.cxx | 2 | ||||
| -rw-r--r-- | Private/Source/PEFCodeManager.cxx | 3 | ||||
| -rw-r--r-- | Private/Source/PEFSharedObjectRT.cxx | 2 | ||||
| -rw-r--r-- | Private/Source/ProcessManager.cxx | 2 | ||||
| -rw-r--r-- | Private/Source/RuntimeMain.cxx | 10 | ||||
| -rw-r--r-- | Private/Source/SMPManager.cxx | 6 | ||||
| -rw-r--r-- | Private/Source/Storage/ATA.cxx | 2 |
8 files changed, 7 insertions, 27 deletions
diff --git a/Private/Source/CxxAbi.cxx b/Private/Source/CxxAbi.cxx index ea200708..c062219b 100644 --- a/Private/Source/CxxAbi.cxx +++ b/Private/Source/CxxAbi.cxx @@ -20,12 +20,9 @@ uarch_t __atexit_func_count; extern "C" void __cxa_pure_virtual() { HCore::kcout << "[C++] Placeholder\n"; } -extern "C" void __stack_chk_fail() { - HCore::kcout << "[HCoreKrnl] Buffer overflow detected\n"; - HCore::ke_stop(RUNTIME_CHECK_POINTER); -} +extern "C" void ___chkstk_ms() {} -extern "C" int __cxa_atexit(void (*f)(void *), void *arg, void *dso) { +extern "C" int atexit(void (*f)(void *), void *arg, void *dso) { if (__atexit_func_count >= DSO_MAX_OBJECTS) return -1; __atexit_funcs[__atexit_func_count].destructor_func = f; diff --git a/Private/Source/KernelHeap.cxx b/Private/Source/KernelHeap.cxx index 603b91b3..3c3cb9ce 100644 --- a/Private/Source/KernelHeap.cxx +++ b/Private/Source/KernelHeap.cxx @@ -9,8 +9,6 @@ #include <NewKit/KernelHeap.hpp> -#include "NewKit/PageManager.hpp" - //! @file KernelHeap.cpp //! @brief Kernel allocator. diff --git a/Private/Source/PEFCodeManager.cxx b/Private/Source/PEFCodeManager.cxx index 63e8659f..efebef48 100644 --- a/Private/Source/PEFCodeManager.cxx +++ b/Private/Source/PEFCodeManager.cxx @@ -53,8 +53,7 @@ PEFLoader::PEFLoader(const char *path) : fCachedBlob(nullptr), fBad(false) { PEFContainer *container = reinterpret_cast<PEFContainer *>(fCachedBlob); auto fFree = [&]() -> void { - kcout << "CodeManager: Warning: Bad executable, program will not be " - "started!\n"; + kcout << "CodeManager: Warning: Executable format error!\n"; fBad = true; ke_delete_ke_heap(fCachedBlob); diff --git a/Private/Source/PEFSharedObjectRT.cxx b/Private/Source/PEFSharedObjectRT.cxx index 018b618e..035b068f 100644 --- a/Private/Source/PEFSharedObjectRT.cxx +++ b/Private/Source/PEFSharedObjectRT.cxx @@ -14,8 +14,6 @@ #include <KernelKit/ThreadLocalStorage.hxx> #include <NewKit/Defines.hpp> -#include "NewKit/RuntimeCheck.hpp" - /* ------------------------------------------- Revision History: diff --git a/Private/Source/ProcessManager.cxx b/Private/Source/ProcessManager.cxx index a8a03b52..1bba7f7e 100644 --- a/Private/Source/ProcessManager.cxx +++ b/Private/Source/ProcessManager.cxx @@ -17,8 +17,6 @@ #include <NewKit/KernelHeap.hpp> #include <NewKit/String.hpp> -#include "NewKit/RuntimeCheck.hpp" - ///! bugs = 0 /***********************************************************************************/ diff --git a/Private/Source/RuntimeMain.cxx b/Private/Source/RuntimeMain.cxx index f103e98c..8c18c0a3 100644 --- a/Private/Source/RuntimeMain.cxx +++ b/Private/Source/RuntimeMain.cxx @@ -15,18 +15,8 @@ #include <NewKit/KernelHeap.hpp> #include <NewKit/UserHeap.hpp> -/// PRIVATE SYMBOLS EXPORTED BY C++ COMPILER. -extern "C" void (*__SYSTEM_FINI)(); -extern "C" void (**__SYSTEM_INIT)(); - extern "C" void RuntimeMain( HCore::HEL::HandoverInformationHeader* HandoverHeader) { - /// Init C++ globals - for (HCore::SizeT index_init = 0UL; - __SYSTEM_INIT[index_init] != __SYSTEM_FINI; ++index_init) { - __SYSTEM_INIT[index_init](); - } - HCore::ke_init_heap(); HCore::ke_init_ke_heap(); diff --git a/Private/Source/SMPManager.cxx b/Private/Source/SMPManager.cxx index 27bf5892..37c2e592 100644 --- a/Private/Source/SMPManager.cxx +++ b/Private/Source/SMPManager.cxx @@ -63,7 +63,9 @@ void HardwareThread::Wake(const bool wakeup) noexcept { bool HardwareThread::Switch(HAL::StackFrame* stack) { if (stack == nullptr) return false; - return rt_do_context_switch(m_Stack, stack) == 0; + m_Stack = stack; + + return rt_do_context_switch(m_Stack) == 0; } ///! @brief Tells if processor is waked up. @@ -110,7 +112,7 @@ bool SMPManager::Switch(HAL::StackFrame* stack) { m_ThreadList[idx].Leak().Leak().Busy(true); - Boolean ret = (rt_do_context_switch(rt_get_current_context(), stack) == 0); + Boolean ret = (rt_do_context_switch(stack) == 0); m_ThreadList[idx].Leak().Leak().Busy(false); diff --git a/Private/Source/Storage/ATA.cxx b/Private/Source/Storage/ATA.cxx index 65a4457e..184bb043 100644 --- a/Private/Source/Storage/ATA.cxx +++ b/Private/Source/Storage/ATA.cxx @@ -10,8 +10,6 @@ #include <ArchKit/Arch.hpp> #include <StorageKit/ATA.hpp> -#include "NewKit/Utils.hpp" - //! @brief ATA DMA Driver //! mapped by UEFI. |
