summaryrefslogtreecommitdiffhomepage
path: root/Kernel/KernelKit/ProcessScheduler.hxx
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-06-29 13:15:29 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-06-29 13:15:29 +0200
commitd9d42bcfeb444652ae198a6bd3481ce316549e55 (patch)
tree238e88d868855c4ab6e1c6671bfc18a9930048fe /Kernel/KernelKit/ProcessScheduler.hxx
parentf562fbf39333925689d6fb704af15efe5f99ed28 (diff)
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 <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/KernelKit/ProcessScheduler.hxx')
-rw-r--r--Kernel/KernelKit/ProcessScheduler.hxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/Kernel/KernelKit/ProcessScheduler.hxx b/Kernel/KernelKit/ProcessScheduler.hxx
index 11555b1d..51a1563f 100644
--- a/Kernel/KernelKit/ProcessScheduler.hxx
+++ b/Kernel/KernelKit/ProcessScheduler.hxx
@@ -8,7 +8,6 @@
#define _INC_PROCESS_SCHEDULER_HXX_
#include <ArchKit/ArchKit.hpp>
-#include <KernelKit/FileManager.hpp>
#include <KernelKit/LockDelegate.hpp>
#include <KernelKit/PermissionSelector.hxx>
#include <KernelKit/UserHeap.hpp>
@@ -197,14 +196,19 @@ namespace NewOS
// ProcessHeader getters.
public:
//! @brief ProcessHeader name getter, example: "C RunTime"
- const Char* GetName();
+ const Char* GetName() noexcept;
- const ProcessSelector& GetSelector();
- const ProcessStatus& GetStatus();
- const AffinityKind& GetAffinity();
+ //! @brief return local error code of process.
+ //! @return Int32 local error code.
+ Int32& GetLocalCode() noexcept;
+
+ const ProcessSelector& GetSelector() noexcept;
+ const ProcessStatus& GetStatus() noexcept;
+ const AffinityKind& GetAffinity() noexcept;
private:
Int32 fLastExitCode{0};
+ Int32 fLocalCode{0};
friend ProcessScheduler;
friend ProcessHelper;
@@ -222,10 +226,12 @@ namespace NewOS
MutableArray<Ref<ProcessHeader>>& AsArray();
Ref<ProcessHeader>& AsRef();
+ UInt64& Id() noexcept;
public:
MutableArray<Ref<ProcessHeader>> mProcessList;
Ref<ProcessHeader> mCurrentProcess;
+ UInt64 mTeamId{0};
};
using ProcessHeaderRef = ProcessHeader*;