From 3f17fe71334a27a60bf54adc55eabe2356ed31f5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 6 Sep 2018 20:34:51 -0400 Subject: 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. --- src/core/core.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/core/core.h') diff --git a/src/core/core.h b/src/core/core.h index 5c3c0e2a1..ab3663427 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& Scheduler(size_t core_index); - /// Gets the current process + /// Provides a reference to the current process Kernel::SharedPtr& CurrentProcess(); + /// Provides a constant reference to the current process. + const Kernel::SharedPtr& CurrentProcess() const; + /// Provides a reference to the kernel instance. Kernel::KernelCore& Kernel(); -- cgit v1.2.3