From d9d42bcfeb444652ae198a6bd3481ce316549e55 Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Sat, 29 Jun 2024 13:15:29 +0200 Subject: kernel: Use local error codes for kernel calls. So that we know which process caused the error, and it's not global as well. Signed-off-by: Amlal EL Mahrouss --- Kernel/Sources/ProcessScheduler.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Kernel/Sources/ProcessScheduler.cxx') diff --git a/Kernel/Sources/ProcessScheduler.cxx b/Kernel/Sources/ProcessScheduler.cxx index ca9a3435..ddeff7f2 100644 --- a/Kernel/Sources/ProcessScheduler.cxx +++ b/Kernel/Sources/ProcessScheduler.cxx @@ -55,6 +55,8 @@ namespace NewOS this->Exit(kErrorProcessFault); } + Int32& ProcessHeader::GetLocalCode() noexcept { return fLocalCode; } + void ProcessHeader::Wake(const bool should_wakeup) { this->Status = @@ -69,7 +71,7 @@ namespace NewOS { if (this->FreeMemory < 1) { - DbgLastError() = kErrorHeapOutOfMemory; + ErrLocal() = kErrorHeapOutOfMemory; /* we're going out of memory */ this->Crash(); @@ -134,19 +136,19 @@ namespace NewOS } /// @brief process name getter. - const Char* ProcessHeader::GetName() + const Char* ProcessHeader::GetName() noexcept { return this->Name; } /// @brief process selector getter. - const ProcessSelector& ProcessHeader::GetSelector() + const ProcessSelector& ProcessHeader::GetSelector() noexcept { return this->Selector; } /// @brief process status getter. - const ProcessStatus& ProcessHeader::GetStatus() + const ProcessStatus& ProcessHeader::GetStatus() noexcept { return this->Status; } @@ -156,7 +158,7 @@ namespace NewOS /** @brief Affinity is the time slot allowed for the process. */ - const AffinityKind& ProcessHeader::GetAffinity() + const AffinityKind& ProcessHeader::GetAffinity() noexcept { return this->Affinity; } -- cgit v1.2.3