From a434fdcb102e96ddf564dc0973d7073d49bf19fc Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 2 May 2018 22:36:51 -0400 Subject: core: Implement multicore support. --- src/core/core.h | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src/core/core.h') diff --git a/src/core/core.h b/src/core/core.h index 21a0b074b..3e0a7e6a7 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -108,20 +108,26 @@ public: PerfStats::Results GetAndResetPerfStats(); - /** - * Gets a reference to the emulated CPU. - * @returns A reference to the emulated CPU. - */ - ARM_Interface& CPU() { - return CurrentCpuCore().CPU(); + ARM_Interface& CurrentArmInterface() { + return CurrentCpuCore().ArmInterface(); + } + + ARM_Interface& ArmInterface(size_t core_index) { + ASSERT(core_index < NUM_CPU_CORES); + return cpu_cores[core_index]->ArmInterface(); } Tegra::GPU& GPU() { return *gpu_core; } - Kernel::Scheduler& Scheduler() { - return CurrentCpuCore().Scheduler(); + Kernel::Scheduler& CurrentScheduler() { + return *CurrentCpuCore().Scheduler(); + } + + const std::shared_ptr& Scheduler(size_t core_index) { + ASSERT(core_index < NUM_CPU_CORES); + return cpu_cores[core_index]->Scheduler(); } Kernel::SharedPtr& CurrentProcess() { @@ -198,8 +204,8 @@ private: std::map> thread_to_cpu; }; -inline ARM_Interface& CPU() { - return System::GetInstance().CPU(); +inline ARM_Interface& CurrentArmInterface() { + return System::GetInstance().CurrentArmInterface(); } inline TelemetrySession& Telemetry() { -- cgit v1.2.3