diff options
| author | 2020-07-04 00:59:40 -0400 | |
|---|---|---|
| committer | 2020-07-04 00:59:40 -0400 | |
| commit | f829932ed191ad469df01342191bf2725e8a20bb (patch) | |
| tree | 0ae185ce3ef43ef9b085aae7b9ad5abb04e3d239 /src/core/core_manager.cpp | |
| parent | Fix for always firing triggers on some controllers, trigger threshold more un... (diff) | |
| parent | Merge pull request #4218 from ogniK5377/opus-external (diff) | |
| download | yuzu-f829932ed191ad469df01342191bf2725e8a20bb.tar.gz yuzu-f829932ed191ad469df01342191bf2725e8a20bb.tar.xz yuzu-f829932ed191ad469df01342191bf2725e8a20bb.zip | |
Fix merge conflicts?
Diffstat (limited to 'src/core/core_manager.cpp')
| -rw-r--r-- | src/core/core_manager.cpp | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/core/core_manager.cpp b/src/core/core_manager.cpp deleted file mode 100644 index b6b797c80..000000000 --- a/src/core/core_manager.cpp +++ /dev/null | |||
| @@ -1,67 +0,0 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <condition_variable> | ||
| 6 | #include <mutex> | ||
| 7 | |||
| 8 | #include "common/logging/log.h" | ||
| 9 | #include "core/arm/exclusive_monitor.h" | ||
| 10 | #include "core/arm/unicorn/arm_unicorn.h" | ||
| 11 | #include "core/core.h" | ||
| 12 | #include "core/core_manager.h" | ||
| 13 | #include "core/core_timing.h" | ||
| 14 | #include "core/hle/kernel/kernel.h" | ||
| 15 | #include "core/hle/kernel/physical_core.h" | ||
| 16 | #include "core/hle/kernel/scheduler.h" | ||
| 17 | #include "core/hle/kernel/thread.h" | ||
| 18 | #include "core/hle/lock.h" | ||
| 19 | #include "core/settings.h" | ||
| 20 | |||
| 21 | namespace Core { | ||
| 22 | |||
| 23 | CoreManager::CoreManager(System& system, std::size_t core_index) | ||
| 24 | : global_scheduler{system.GlobalScheduler()}, physical_core{system.Kernel().PhysicalCore( | ||
| 25 | core_index)}, | ||
| 26 | core_timing{system.CoreTiming()}, core_index{core_index} {} | ||
| 27 | |||
| 28 | CoreManager::~CoreManager() = default; | ||
| 29 | |||
| 30 | void CoreManager::RunLoop(bool tight_loop) { | ||
| 31 | Reschedule(); | ||
| 32 | |||
| 33 | // If we don't have a currently active thread then don't execute instructions, | ||
| 34 | // instead advance to the next event and try to yield to the next thread | ||
| 35 | if (Kernel::GetCurrentThread() == nullptr) { | ||
| 36 | LOG_TRACE(Core, "Core-{} idling", core_index); | ||
| 37 | core_timing.Idle(); | ||
| 38 | } else { | ||
| 39 | if (tight_loop) { | ||
| 40 | physical_core.Run(); | ||
| 41 | } else { | ||
| 42 | physical_core.Step(); | ||
| 43 | } | ||
| 44 | } | ||
| 45 | core_timing.Advance(); | ||
| 46 | |||
| 47 | Reschedule(); | ||
| 48 | } | ||
| 49 | |||
| 50 | void CoreManager::SingleStep() { | ||
| 51 | return RunLoop(false); | ||
| 52 | } | ||
| 53 | |||
| 54 | void CoreManager::PrepareReschedule() { | ||
| 55 | physical_core.Stop(); | ||
| 56 | } | ||
| 57 | |||
| 58 | void CoreManager::Reschedule() { | ||
| 59 | // Lock the global kernel mutex when we manipulate the HLE state | ||
| 60 | std::lock_guard lock(HLE::g_hle_lock); | ||
| 61 | |||
| 62 | global_scheduler.SelectThread(core_index); | ||
| 63 | |||
| 64 | physical_core.Scheduler().TryDoContextSwitch(); | ||
| 65 | } | ||
| 66 | |||
| 67 | } // namespace Core | ||