diff options
author | Lioncash <mathew1800@gmail.com> | 2018-09-06 20:34:51 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-09-06 20:52:58 -0400 |
commit | 3f17fe71334a27a60bf54adc55eabe2356ed31f5 (patch) | |
tree | 11fd2e48608908feb95c9024e3bd8e1267ec538a /src/core/core.h | |
parent | a164b413fa479ec1ab0322044ca5ce6c16708e3a (diff) |
core: Migrate current_process pointer to the kernel
Given we now have the kernel as a class, it doesn't make sense to keep
the current process pointer within the System class, as processes are
related to the kernel.
This also gets rid of a subtle case where memory wouldn't be freed on
core shutdown, as the current_process pointer would never be reset,
causing the pointed to contents to continue to live.
Diffstat (limited to 'src/core/core.h')
-rw-r--r-- | src/core/core.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/core.h b/src/core/core.h index 5c3c0e2a17..ab36634274 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -174,9 +174,12 @@ public: /// Gets the scheduler for the CPU core with the specified index const std::shared_ptr<Kernel::Scheduler>& Scheduler(size_t core_index); - /// Gets the current process + /// Provides a reference to the current process Kernel::SharedPtr<Kernel::Process>& CurrentProcess(); + /// Provides a constant reference to the current process. + const Kernel::SharedPtr<Kernel::Process>& CurrentProcess() const; + /// Provides a reference to the kernel instance. Kernel::KernelCore& Kernel(); |