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/core_cpu.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 'src/core/core_cpu.cpp')
-rw-r--r-- | src/core/core_cpu.cpp | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/src/core/core_cpu.cpp b/src/core/core_cpu.cpp deleted file mode 100644 index bcfdf0198..000000000 --- a/src/core/core_cpu.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include <condition_variable> -#include <mutex> - -#include "common/logging/log.h" -#ifdef ARCHITECTURE_x86_64 -#include "core/arm/dynarmic/arm_dynarmic.h" -#endif -#include "core/arm/exclusive_monitor.h" -#include "core/arm/unicorn/arm_unicorn.h" -#include "core/core.h" -#include "core/core_cpu.h" -#include "core/core_timing.h" -#include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/physical_core.h" -#include "core/hle/kernel/scheduler.h" -#include "core/hle/kernel/thread.h" -#include "core/hle/lock.h" -#include "core/settings.h" - -namespace Core { - -Cpu::Cpu(System& system, std::size_t core_index) - : global_scheduler{system.GlobalScheduler()}, - physical_core{system.Kernel().PhysicalCore(core_index)}, core_timing{system.CoreTiming()}, - core_index{core_index} { -} - -Cpu::~Cpu() = default; - -void Cpu::RunLoop(bool tight_loop) { - Reschedule(); - - // If we don't have a currently active thread then don't execute instructions, - // instead advance to the next event and try to yield to the next thread - if (Kernel::GetCurrentThread() == nullptr) { - LOG_TRACE(Core, "Core-{} idling", core_index); - core_timing.Idle(); - } else { - if (tight_loop) { - physical_core.Run(); - } else { - physical_core.Step(); - } - } - core_timing.Advance(); - - Reschedule(); -} - -void Cpu::SingleStep() { - return RunLoop(false); -} - -void Cpu::PrepareReschedule() { - physical_core.Stop(); -} - -void Cpu::Reschedule() { - // Lock the global kernel mutex when we manipulate the HLE state - std::lock_guard lock(HLE::g_hle_lock); - - global_scheduler.SelectThread(core_index); - - physical_core.Scheduler().TryDoContextSwitch(); -} - -} // namespace Core |