From 4d6a86b03fe6ae0d98838a21613b66d5196150af Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sat, 25 Jan 2020 18:55:32 -0400 Subject: Core: Refactor CPU Management. This commit moves ARM Interface and Scheduler handling into the kernel. --- src/core/hle/kernel/physical_core.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/core/hle/kernel/physical_core.h') diff --git a/src/core/hle/kernel/physical_core.h b/src/core/hle/kernel/physical_core.h index 225b31d3e..a7848e030 100644 --- a/src/core/hle/kernel/physical_core.h +++ b/src/core/hle/kernel/physical_core.h @@ -8,14 +8,17 @@ namespace Kernel { class Scheduler; } // namespace Kernel +namespace Core { class ARM_Interface; class ExclusiveMonitor; +class System; +} // namespace Core namespace Kernel { class PhysicalCore { public: - PhysicalCore(KernelCore& kernel, std::size_t id, ExclusiveMonitor& exclusive_monitor); + PhysicalCore(Core::System& system, KernelCore& kernel, std::size_t id, Core::ExclusiveMonitor& exclusive_monitor); /// Execute current jit state void Run(); @@ -24,11 +27,14 @@ public: /// Stop JIT execution/exit void Stop(); - ARM_Interface& ArmInterface() { + // Shutdown this physical core. + void Shutdown(); + + Core::ARM_Interface& ArmInterface() { return *arm_interface; } - const ARM_Interface& ArmInterface() const { + const Core::ARM_Interface& ArmInterface() const { return *arm_interface; } @@ -44,19 +50,19 @@ public: return core_index; } - Scheduler& Scheduler() { + Kernel::Scheduler& Scheduler() { return *scheduler; } - const Scheduler& Scheduler() const { + const Kernel::Scheduler& Scheduler() const { return *scheduler; } private: std::size_t core_index; - std::unique_ptr arm_interface; - std::unique_ptr scheduler; KernelCore& kernel; -} + std::unique_ptr arm_interface; + std::unique_ptr scheduler; +}; } // namespace Kernel -- cgit v1.2.3