diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-01-26 19:07:22 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-01-26 19:07:22 +0100 |
commit | e4a1ead897575ee9222b4fc1021aaa9cc58f12c8 (patch) | |
tree | ef544a51ba2480400df62d40706f68fa3ae62693 /src/core/cpu_manager.cpp | |
parent | ArmInterface: Delegate Exclusive monitor factory to exclusive monitor interfasce. (diff) | |
download | yuzu-e4a1ead897575ee9222b4fc1021aaa9cc58f12c8.tar yuzu-e4a1ead897575ee9222b4fc1021aaa9cc58f12c8.tar.gz yuzu-e4a1ead897575ee9222b4fc1021aaa9cc58f12c8.tar.bz2 yuzu-e4a1ead897575ee9222b4fc1021aaa9cc58f12c8.tar.lz yuzu-e4a1ead897575ee9222b4fc1021aaa9cc58f12c8.tar.xz yuzu-e4a1ead897575ee9222b4fc1021aaa9cc58f12c8.tar.zst yuzu-e4a1ead897575ee9222b4fc1021aaa9cc58f12c8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/cpu_manager.cpp (renamed from src/core/cpu_core_manager.cpp) | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/src/core/cpu_core_manager.cpp b/src/core/cpu_manager.cpp index ab03e8fdf..abc8aad9e 100644 --- a/src/core/cpu_core_manager.cpp +++ b/src/core/cpu_manager.cpp @@ -5,56 +5,49 @@ #include "common/assert.h" #include "core/arm/exclusive_monitor.h" #include "core/core.h" -#include "core/core_cpu.h" +#include "core/core_manager.h" #include "core/core_timing.h" -#include "core/cpu_core_manager.h" +#include "core/cpu_manager.h" #include "core/gdbstub/gdbstub.h" #include "core/settings.h" namespace Core { -namespace { -void RunCpuCore(const System& system, Cpu& cpu_state) { - while (system.IsPoweredOn()) { - cpu_state.RunLoop(true); - } -} -} // Anonymous namespace -CpuCoreManager::CpuCoreManager(System& system) : system{system} {} -CpuCoreManager::~CpuCoreManager() = default; +CpuManager::CpuManager(System& system) : system{system} {} +CpuManager::~CpuManager() = default; -void CpuCoreManager::Initialize() { +void CpuManager::Initialize() { - for (std::size_t index = 0; index < cores.size(); ++index) { - cores[index] = std::make_unique<Cpu>(system, index); + for (std::size_t index = 0; index < core_managers.size(); ++index) { + core_managers[index] = std::make_unique<CoreManager>(system, index); } } -void CpuCoreManager::Shutdown() { - for (auto& cpu_core : cores) { +void CpuManager::Shutdown() { + for (auto& cpu_core : core_managers) { cpu_core.reset(); } } -Cpu& CpuCoreManager::GetCore(std::size_t index) { - return *cores.at(index); +CoreManager& CpuManager::GetCoreManager(std::size_t index) { + return *core_managers.at(index); } -const Cpu& CpuCoreManager::GetCore(std::size_t index) const { - return *cores.at(index); +const CoreManager& CpuManager::GetCoreManager(std::size_t index) const { + return *core_managers.at(index); } -Cpu& CpuCoreManager::GetCurrentCore() { +CoreManager& CpuManager::GetCurrentCoreManager() { // Otherwise, use single-threaded mode active_core variable - return *cores[active_core]; + return *core_managers[active_core]; } -const Cpu& CpuCoreManager::GetCurrentCore() const { +const CoreManager& CpuManager::GetCurrentCoreManager() const { // Otherwise, use single-threaded mode active_core variable - return *cores[active_core]; + return *core_managers[active_core]; } -void CpuCoreManager::RunLoop(bool tight_loop) { +void CpuManager::RunLoop(bool tight_loop) { if (GDBStub::IsServerEnabled()) { GDBStub::HandlePacket(); @@ -77,7 +70,7 @@ void CpuCoreManager::RunLoop(bool tight_loop) { for (active_core = 0; active_core < NUM_CPU_CORES; ++active_core) { core_timing.SwitchContext(active_core); if (core_timing.CanCurrentContextRun()) { - cores[active_core]->RunLoop(tight_loop); + core_managers[active_core]->RunLoop(tight_loop); } keep_running |= core_timing.CanCurrentContextRun(); } |