From 0511c53e648e5f253cd9e83c9e211aa6600db377 Mon Sep 17 00:00:00 2001 From: Amlal Date: Mon, 28 Oct 2024 19:29:04 +0100 Subject: META: Bumping source code. Signed-off-by: Amlal --- dev/ZKAKit/src/ACPIFactoryInterface.cc | 2 +- dev/ZKAKit/src/FS/NeFS.cc | 2 +- dev/ZKAKit/src/GUIDWizard.cc | 6 +- dev/ZKAKit/src/KString.cc | 217 +++++++++++++++++++++++++++++++++ dev/ZKAKit/src/Network/IP.cc | 4 +- dev/ZKAKit/src/Network/IPC.cc | 8 +- dev/ZKAKit/src/PEFCodeMgr.cc | 4 +- dev/ZKAKit/src/PRDT.cc | 2 +- dev/ZKAKit/src/Property.cc | 4 +- dev/ZKAKit/src/Stop.cc | 2 +- dev/ZKAKit/src/String.cc | 217 --------------------------------- dev/ZKAKit/src/ThreadLocalStorage.cc | 2 +- dev/ZKAKit/src/UserProcessScheduler.cc | 86 +++++++------ 13 files changed, 286 insertions(+), 270 deletions(-) create mode 100644 dev/ZKAKit/src/KString.cc delete mode 100644 dev/ZKAKit/src/String.cc (limited to 'dev/ZKAKit/src') diff --git a/dev/ZKAKit/src/ACPIFactoryInterface.cc b/dev/ZKAKit/src/ACPIFactoryInterface.cc index 5c57d119..f90859da 100644 --- a/dev/ZKAKit/src/ACPIFactoryInterface.cc +++ b/dev/ZKAKit/src/ACPIFactoryInterface.cc @@ -5,7 +5,7 @@ ------------------------------------------- */ #include -#include +#include #include #include diff --git a/dev/ZKAKit/src/FS/NeFS.cc b/dev/ZKAKit/src/FS/NeFS.cc index 6f8ffa14..1bbafae7 100644 --- a/dev/ZKAKit/src/FS/NeFS.cc +++ b/dev/ZKAKit/src/FS/NeFS.cc @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/dev/ZKAKit/src/GUIDWizard.cc b/dev/ZKAKit/src/GUIDWizard.cc index cb4fc50b..c05af119 100644 --- a/dev/ZKAKit/src/GUIDWizard.cc +++ b/dev/ZKAKit/src/GUIDWizard.cc @@ -43,7 +43,7 @@ namespace CFKit::XRN::Version1 // @brief Tries to make a guid out of a string. // This function is not complete for now - auto cf_try_guid_to_string(Ref& seq) -> ErrorOr> + auto cf_try_guid_to_string(Ref& seq) -> ErrorOr> { Char buf[kUUIDSize]; @@ -65,8 +65,8 @@ namespace CFKit::XRN::Version1 auto view = StringBuilder::Construct(buf); if (view) - return ErrorOr>{view.Leak()}; + return ErrorOr>{view.Leak()}; - return ErrorOr>{-1}; + return ErrorOr>{-1}; } } // namespace CFKit::XRN::Version1 diff --git a/dev/ZKAKit/src/KString.cc b/dev/ZKAKit/src/KString.cc new file mode 100644 index 00000000..4f1ab7ba --- /dev/null +++ b/dev/ZKAKit/src/KString.cc @@ -0,0 +1,217 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#include +#include + +/// @file KString.cc +/// @brief Kernel String manipulation file. + +namespace Kernel +{ + Char* KString::Data() + { + return fData; + } + + const Char* KString::CData() const + { + return fData; + } + + Size KString::Length() const + { + return fDataSz; + } + + bool KString::operator==(const KString& rhs) const + { + if (rhs.Length() != this->Length()) + return false; + + for (Size index = 0; index < this->Length(); ++index) + { + if (rhs.fData[index] != fData[index]) + return false; + } + + return true; + } + + bool KString::operator==(const Char* rhs) const + { + if (rt_string_len(rhs) != this->Length()) + return false; + + for (Size index = 0; index < rt_string_len(rhs); ++index) + { + if (rhs[index] != fData[index]) + return false; + } + + return true; + } + + bool KString::operator!=(const KString& rhs) const + { + if (rhs.Length() != this->Length()) + return false; + + for (Size index = 0; index < rhs.Length(); ++index) + { + if (rhs.fData[index] == fData[index]) + return false; + } + + return true; + } + + bool KString::operator!=(const Char* rhs) const + { + if (rt_string_len(rhs) != this->Length()) + return false; + + for (Size index = 0; index < rt_string_len(rhs); ++index) + { + if (rhs[index] == fData[index]) + return false; + } + + return true; + } + + ErrorOr StringBuilder::Construct(const Char* data) + { + if (!data || *data == 0) + return {}; + + KString* view = new KString(rt_string_len(data)); + (*view) += data; + + return ErrorOr(*view); + } + + const Char* StringBuilder::FromBool(const Char* fmt, bool i) + { + if (!fmt) + return ("?"); + + const Char* boolean_expr = i ? "YES" : "NO"; + char* ret = (char*)cAlloca((sizeof(char) * i) ? 4 : 5 + rt_string_len(fmt)); + + if (!ret) + return ("?"); + + const auto fmt_len = rt_string_len(fmt); + const auto res_len = rt_string_len(boolean_expr); + + for (Size idx = 0; idx < fmt_len; ++idx) + { + if (fmt[idx] == '%') + { + SizeT result_cnt = idx; + + for (auto y_idx = idx; y_idx < res_len; ++y_idx) + { + ret[result_cnt] = boolean_expr[y_idx]; + ++result_cnt; + } + + break; + } + + ret[idx] = fmt[idx]; + } + + return ret; + } + + bool StringBuilder::Equals(const Char* lhs, const Char* rhs) + { + if (rt_string_len(rhs) != rt_string_len(lhs)) + return false; + + for (Size index = 0; index < rt_string_len(rhs); ++index) + { + if (rhs[index] != lhs[index]) + return false; + } + + return true; + } + + bool StringBuilder::Equals(const WideChar* lhs, const WideChar* rhs) + { + for (Size index = 0; rhs[index] != 0; ++index) + { + if (rhs[index] != lhs[index]) + return false; + } + + return true; + } + + const Char* StringBuilder::Format(const Char* fmt, const Char* fmt2) + { + if (!fmt || !fmt2) + return ("?"); + + char* ret = + (char*)cAlloca(sizeof(char) * rt_string_len(fmt2) + rt_string_len(fmt)); + + if (!ret) + return ("?"); + + for (Size idx = 0; idx < rt_string_len(fmt); ++idx) + { + if (fmt[idx] == '%') + { + Size result_cnt = idx; + for (Size y_idx = 0; y_idx < rt_string_len(fmt2); ++y_idx) + { + ret[result_cnt] = fmt2[y_idx]; + ++result_cnt; + } + + break; + } + + ret[idx] = fmt[idx]; + } + + return ret; + } + + STATIC void rt_string_append(Char* lhs, const Char* rhs, Int32 cur) + { + SizeT sz_rhs = rt_string_len(rhs); + SizeT rhs_i = 0; + + for (; rhs_i < sz_rhs; ++rhs_i) + { + lhs[rhs_i + cur] = rhs[rhs_i]; + } + } + + KString& KString::operator+=(const Char* rhs) + { + rt_string_append(this->fData, rhs, this->fCur); + this->fCur += rt_string_len(rhs); + + return *this; + } + + KString& KString::operator+=(const KString& rhs) + { + if (rt_string_len(rhs.fData) > this->Length()) + return *this; + + rt_string_append(this->fData, const_cast(rhs.fData), this->fCur); + this->fCur += rt_string_len(const_cast(rhs.fData)); + + return *this; + } +} // namespace Kernel diff --git a/dev/ZKAKit/src/Network/IP.cc b/dev/ZKAKit/src/Network/IP.cc index b78009dc..0ebe19b6 100644 --- a/dev/ZKAKit/src/Network/IP.cc +++ b/dev/ZKAKit/src/Network/IP.cc @@ -90,13 +90,13 @@ namespace Kernel return true; } - ErrorOr IPFactory::ToStringView(Ref& ipv6) + ErrorOr IPFactory::ToKString(Ref& ipv6) { auto str = StringBuilder::Construct(ipv6.Leak().Address()); return str; } - ErrorOr IPFactory::ToStringView(Ref& ipv4) + ErrorOr IPFactory::ToKString(Ref& ipv4) { auto str = StringBuilder::Construct(ipv4.Leak().Address()); return str; diff --git a/dev/ZKAKit/src/Network/IPC.cc b/dev/ZKAKit/src/Network/IPC.cc index 3f69bc3c..5dd4da0b 100644 --- a/dev/ZKAKit/src/Network/IPC.cc +++ b/dev/ZKAKit/src/Network/IPC.cc @@ -63,7 +63,7 @@ namespace Kernel if (!pckt || !ipc_int_sanitize_packet(pckt)) { - UserProcessScheduler::The().CurrentProcess().Leak().Crash(); + UserProcessScheduler::The().GetCurrentProcess().Leak().Crash(); return false; } @@ -82,7 +82,7 @@ namespace Kernel // crash process if the packet pointer of pointer is NULL. if (!pckt_in) { - UserProcessScheduler::The().CurrentProcess().Leak().Crash(); + UserProcessScheduler::The().GetCurrentProcess().Leak().Crash(); return false; } @@ -102,13 +102,13 @@ namespace Kernel (*pckt_in)->IpcTo.UserProcessID = 0; (*pckt_in)->IpcTo.UserProcessTeam = 0; - (*pckt_in)->IpcFrom.UserProcessID = Kernel::UserProcessScheduler::The().CurrentProcess().Leak().ProcessId; + (*pckt_in)->IpcFrom.UserProcessID = Kernel::UserProcessScheduler::The().GetCurrentProcess().Leak().ProcessId; (*pckt_in)->IpcFrom.UserProcessTeam = Kernel::UserProcessScheduler::The().CurrentTeam().mTeamId; return true; } - UserProcessScheduler::The().CurrentProcess().Leak().Crash(); + UserProcessScheduler::The().GetCurrentProcess().Leak().Crash(); return false; } } // namespace Kernel diff --git a/dev/ZKAKit/src/PEFCodeMgr.cc b/dev/ZKAKit/src/PEFCodeMgr.cc index 21c9dc46..45a5e46c 100644 --- a/dev/ZKAKit/src/PEFCodeMgr.cc +++ b/dev/ZKAKit/src/PEFCodeMgr.cc @@ -11,7 +11,7 @@ #include #include #include -#include +#include /// @brief PEF stack size symbol. #define cPefStackSizeSymbol "SizeOfReserveStack" @@ -117,7 +117,7 @@ namespace Kernel constexpr auto cMangleCharacter = '$'; const Char* cContainerKinds[] = {".code64", ".data64", ".zero64", nullptr}; - ErrorOr error_or_symbol; + ErrorOr error_or_symbol; switch (kind) { diff --git a/dev/ZKAKit/src/PRDT.cc b/dev/ZKAKit/src/PRDT.cc index 741e932b..38077ea5 100644 --- a/dev/ZKAKit/src/PRDT.cc +++ b/dev/ZKAKit/src/PRDT.cc @@ -5,7 +5,7 @@ ------------------------------------------- */ #include -#include +#include #include namespace Kernel diff --git a/dev/ZKAKit/src/Property.cc b/dev/ZKAKit/src/Property.cc index 9ee17b74..cf29b6d8 100644 --- a/dev/ZKAKit/src/Property.cc +++ b/dev/ZKAKit/src/Property.cc @@ -10,12 +10,12 @@ namespace CFKit { Property::~Property() = default; - Bool Property::StringEquals(StringView& name) + Bool Property::StringEquals(KString& name) { return this->fName && this->fName == name; } - StringView& Property::GetKey() + KString& Property::GetKey() { return this->fName; } diff --git a/dev/ZKAKit/src/Stop.cc b/dev/ZKAKit/src/Stop.cc index 51e71b72..21163278 100644 --- a/dev/ZKAKit/src/Stop.cc +++ b/dev/ZKAKit/src/Stop.cc @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/dev/ZKAKit/src/String.cc b/dev/ZKAKit/src/String.cc deleted file mode 100644 index 9ff7e9a0..00000000 --- a/dev/ZKAKit/src/String.cc +++ /dev/null @@ -1,217 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - -------------------------------------------- */ - -#include -#include - -/// @file String.cc -/// @brief String manipulation file. - -namespace Kernel -{ - Char* StringView::Data() - { - return fData; - } - - const Char* StringView::CData() const - { - return fData; - } - - Size StringView::Length() const - { - return fDataSz; - } - - bool StringView::operator==(const StringView& rhs) const - { - if (rhs.Length() != this->Length()) - return false; - - for (Size index = 0; index < this->Length(); ++index) - { - if (rhs.fData[index] != fData[index]) - return false; - } - - return true; - } - - bool StringView::operator==(const Char* rhs) const - { - if (rt_string_len(rhs) != this->Length()) - return false; - - for (Size index = 0; index < rt_string_len(rhs); ++index) - { - if (rhs[index] != fData[index]) - return false; - } - - return true; - } - - bool StringView::operator!=(const StringView& rhs) const - { - if (rhs.Length() != this->Length()) - return false; - - for (Size index = 0; index < rhs.Length(); ++index) - { - if (rhs.fData[index] == fData[index]) - return false; - } - - return true; - } - - bool StringView::operator!=(const Char* rhs) const - { - if (rt_string_len(rhs) != this->Length()) - return false; - - for (Size index = 0; index < rt_string_len(rhs); ++index) - { - if (rhs[index] == fData[index]) - return false; - } - - return true; - } - - ErrorOr StringBuilder::Construct(const Char* data) - { - if (!data || *data == 0) - return {}; - - StringView* view = new StringView(rt_string_len(data)); - (*view) += data; - - return ErrorOr(*view); - } - - const Char* StringBuilder::FromBool(const Char* fmt, bool i) - { - if (!fmt) - return ("?"); - - const Char* boolean_expr = i ? "YES" : "NO"; - char* ret = (char*)cAlloca((sizeof(char) * i) ? 4 : 5 + rt_string_len(fmt)); - - if (!ret) - return ("?"); - - const auto fmt_len = rt_string_len(fmt); - const auto res_len = rt_string_len(boolean_expr); - - for (Size idx = 0; idx < fmt_len; ++idx) - { - if (fmt[idx] == '%') - { - SizeT result_cnt = idx; - - for (auto y_idx = idx; y_idx < res_len; ++y_idx) - { - ret[result_cnt] = boolean_expr[y_idx]; - ++result_cnt; - } - - break; - } - - ret[idx] = fmt[idx]; - } - - return ret; - } - - bool StringBuilder::Equals(const Char* lhs, const Char* rhs) - { - if (rt_string_len(rhs) != rt_string_len(lhs)) - return false; - - for (Size index = 0; index < rt_string_len(rhs); ++index) - { - if (rhs[index] != lhs[index]) - return false; - } - - return true; - } - - bool StringBuilder::Equals(const WideChar* lhs, const WideChar* rhs) - { - for (Size index = 0; rhs[index] != 0; ++index) - { - if (rhs[index] != lhs[index]) - return false; - } - - return true; - } - - const Char* StringBuilder::Format(const Char* fmt, const Char* fmt2) - { - if (!fmt || !fmt2) - return ("?"); - - char* ret = - (char*)cAlloca(sizeof(char) * rt_string_len(fmt2) + rt_string_len(fmt)); - - if (!ret) - return ("?"); - - for (Size idx = 0; idx < rt_string_len(fmt); ++idx) - { - if (fmt[idx] == '%') - { - Size result_cnt = idx; - for (Size y_idx = 0; y_idx < rt_string_len(fmt2); ++y_idx) - { - ret[result_cnt] = fmt2[y_idx]; - ++result_cnt; - } - - break; - } - - ret[idx] = fmt[idx]; - } - - return ret; - } - - STATIC void rt_string_append(Char* lhs, const Char* rhs, Int32 cur) - { - SizeT sz_rhs = rt_string_len(rhs); - SizeT rhs_i = 0; - - for (; rhs_i < sz_rhs; ++rhs_i) - { - lhs[rhs_i + cur] = rhs[rhs_i]; - } - } - - StringView& StringView::operator+=(const Char* rhs) - { - rt_string_append(this->fData, rhs, this->fCur); - this->fCur += rt_string_len(rhs); - - return *this; - } - - StringView& StringView::operator+=(const StringView& rhs) - { - if (rt_string_len(rhs.fData) > this->Length()) - return *this; - - rt_string_append(this->fData, const_cast(rhs.fData), this->fCur); - this->fCur += rt_string_len(const_cast(rhs.fData)); - - return *this; - } -} // namespace Kernel diff --git a/dev/ZKAKit/src/ThreadLocalStorage.cc b/dev/ZKAKit/src/ThreadLocalStorage.cc index 8c75d522..83883a6c 100644 --- a/dev/ZKAKit/src/ThreadLocalStorage.cc +++ b/dev/ZKAKit/src/ThreadLocalStorage.cc @@ -7,7 +7,7 @@ * ======================================================== */ -#include +#include #include #include #include diff --git a/dev/ZKAKit/src/UserProcessScheduler.cc b/dev/ZKAKit/src/UserProcessScheduler.cc index 090faf32..249033a2 100644 --- a/dev/ZKAKit/src/UserProcessScheduler.cc +++ b/dev/ZKAKit/src/UserProcessScheduler.cc @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include ///! BUGS: 0 @@ -32,7 +32,7 @@ namespace Kernel /// @brief Exit Code global variable. /***********************************************************************************/ - STATIC UInt32 cLastExitCode = 0U; + STATIC UInt32 kLastExitCode = 0U; /***********************************************************************************/ /// @brief User Process scheduler global and external reference of thread scheduler. @@ -41,12 +41,16 @@ namespace Kernel UserProcessScheduler* kProcessScheduler = nullptr; EXTERN HardwareThreadScheduler* kHardwareThreadScheduler; + UserProcess::UserProcess(VoidPtr start_image) : Image(start_image) {} + + UserProcess::~UserProcess() = default; + /// @brief Gets the last exit code. /// @note Not thread-safe. /// @return Int32 the last exit code. const UInt32& sched_get_exit_code(void) noexcept { - return cLastExitCode; + return kLastExitCode; } /***********************************************************************************/ @@ -99,7 +103,7 @@ namespace Kernel /// @brief Wake process. /***********************************************************************************/ - void UserProcess::Wake(const bool should_wakeup) + Void UserProcess::Wake(const bool should_wakeup) { this->Status = should_wakeup ? ProcessStatusKind::kRunning : ProcessStatusKind::kFrozen; @@ -109,33 +113,37 @@ namespace Kernel /** @brief Add pointer to entry. */ /***********************************************************************************/ - VoidPtr UserProcess::New(const SizeT& sz) + ErrorOr UserProcess::New(const SizeT& sz, const SizeT& pad_amount) { #ifdef __ZKA_AMD64__ - auto pd = hal_read_cr3(); + auto vm_register = hal_read_cr3(); hal_write_cr3(reinterpret_cast(this->VMRegister)); - auto ptr = mm_new_heap(sz, Yes, Yes); + auto ptr = mm_new_heap(sz + pad_amount, Yes, Yes); - hal_write_cr3(reinterpret_cast(pd)); + hal_write_cr3(reinterpret_cast(vm_register)); #else - auto ptr = mm_new_heap(sz, Yes, Yes); + auto ptr = mm_new_heap(sz + pad_amount, Yes, Yes); #endif - if (!this->MemoryEntryList) + if (!this->MemoryHeap) { - this->MemoryEntryList = new UserProcess::PROCESS_MEMORY_ENTRY(); - this->MemoryEntryList->MemoryEntry = ptr; + this->MemoryHeap = new UserProcess::USER_PROCESS_HEAP(); + + this->MemoryHeap->MemoryEntryPad = pad_amount; + this->MemoryHeap->MemoryEntrySize = sz; - this->MemoryEntryList->MemoryPrev = nullptr; - this->MemoryEntryList->MemoryNext = nullptr; + this->MemoryHeap->MemoryEntry = ptr; - return ptr; + this->MemoryHeap->MemoryPrev = nullptr; + this->MemoryHeap->MemoryNext = nullptr; + + return ErrorOr(ptr); } else { - PROCESS_MEMORY_ENTRY* entry = this->MemoryEntryList; - PROCESS_MEMORY_ENTRY* prev_entry = nullptr; + USER_PROCESS_HEAP* entry = this->MemoryHeap; + USER_PROCESS_HEAP* prev_entry = nullptr; while (!entry) { @@ -146,31 +154,31 @@ namespace Kernel entry = entry->MemoryNext; } - entry->MemoryNext = new PROCESS_MEMORY_ENTRY(); + entry->MemoryNext = new USER_PROCESS_HEAP(); entry->MemoryNext->MemoryEntry = ptr; entry->MemoryNext->MemoryPrev = entry; entry->MemoryNext->MemoryNext = nullptr; } - return nullptr; + return ErrorOr(nullptr); } /***********************************************************************************/ /** @brief Free pointer from usage. */ /***********************************************************************************/ - Boolean UserProcess::Delete(VoidPtr ptr, const SizeT& sz) + Boolean UserProcess::Delete(ErrorOr ptr, const SizeT& sz) { if (!ptr || sz == 0) return No; - PROCESS_MEMORY_ENTRY* entry = this->MemoryEntryList; + USER_PROCESS_HEAP* entry = this->MemoryHeap; while (entry != nullptr) { - if (entry->MemoryEntry == ptr) + if (entry->MemoryEntry == ptr.Leak().Leak()) { #ifdef __ZKA_AMD64__ auto pd = hal_read_cr3(); @@ -197,7 +205,7 @@ namespace Kernel /// @brief Gets the name of the current process. /***********************************************************************************/ - const Char* UserProcess::GetProcessName() noexcept + const Char* UserProcess::GetName() noexcept { return this->Name; } @@ -239,9 +247,9 @@ namespace Kernel this->Status = ProcessStatusKind::kDead; fLastExitCode = exit_code; - cLastExitCode = exit_code; + kLastExitCode = exit_code; - auto memory_list = this->MemoryEntryList; + auto memory_list = this->MemoryHeap; // Deleting memory lists. Make sure to free all of them. while (memory_list) @@ -302,7 +310,7 @@ namespace Kernel } /***********************************************************************************/ - /// @brief Add process to list. + /// @brief Add process to team. /// @param process the process *Ref* class. /// @return the process index inside the team. /***********************************************************************************/ @@ -316,7 +324,7 @@ namespace Kernel process.VMRegister = reinterpret_cast(HAL::mm_alloc_bitmap(Yes, Yes, sizeof(PDE), Yes)); #endif // __ZKA_AMD64__ - process.StackFrame = (HAL::StackFramePtr)mm_new_heap(sizeof(HAL::StackFrame), Yes, Yes); + process.StackFrame = reinterpret_cast(mm_new_heap(sizeof(HAL::StackFrame), Yes, Yes)); if (!process.StackFrame) { @@ -339,9 +347,9 @@ namespace Kernel } } - // get preferred stack size by app. + // Get preferred stack size by app. const auto cMaxStackSize = process.StackSize; - process.StackReserve = (UInt8*)mm_new_heap(sizeof(UInt8) * cMaxStackSize, Yes, Yes); + process.StackReserve = reinterpret_cast(mm_new_heap(sizeof(UInt8) * cMaxStackSize, Yes, Yes)); if (!process.StackReserve) { @@ -369,6 +377,14 @@ namespace Kernel return *kProcessScheduler; } + ErrorOr UserProcessScheduler::TheSafe() + { + if (!kProcessScheduler) + return ErrorOr(nullptr); + + return ErrorOr(kProcessScheduler); + } + /***********************************************************************************/ /// @brief Remove process from list. @@ -413,7 +429,7 @@ namespace Kernel /***********************************************************************************/ - SizeT UserProcessScheduler::Run() noexcept + const SizeT UserProcessScheduler::Run() noexcept { SizeT process_index = 0; //! we store this guy to tell the scheduler how many //! things we have scheduled. @@ -433,13 +449,13 @@ namespace Kernel { process.PTime = static_cast(process.Affinity); - UserProcessScheduler::The().CurrentProcess().Leak().Status = ProcessStatusKind::kFrozen; - UserProcessScheduler::The().CurrentProcess() = process; + UserProcessScheduler::The().GetCurrentProcess().Leak().Status = ProcessStatusKind::kFrozen; + UserProcessScheduler::The().GetCurrentProcess() = process; kcout << "Switch to '" << process.Name << "'.\r"; // Set current process header. - this->CurrentProcess() = process; + this->GetCurrentProcess() = process; // tell helper to find a core to schedule on. if (!UserProcessHelper::Switch(process.Image, &process.StackReserve[process.StackSize], process.StackFrame, @@ -471,7 +487,7 @@ namespace Kernel /// @brief Gets current running process. /// @return - Ref& UserProcessScheduler::CurrentProcess() + Ref& UserProcessScheduler::GetCurrentProcess() { return mTeam.AsRef(); } @@ -481,7 +497,7 @@ namespace Kernel PID& UserProcessHelper::TheCurrentPID() { kcout << "UserProcessHelper::TheCurrentPID: Leaking ProcessId...\r"; - return kProcessScheduler->CurrentProcess().Leak().ProcessId; + return kProcessScheduler->GetCurrentProcess().Leak().ProcessId; } /// @brief Check if process can be schedulded. -- cgit v1.2.3