summaryrefslogtreecommitdiff
path: root/src/core/core_cpu.cpp
diff options
context:
space:
mode:
authorGravatar James Rowe2019-02-15 19:52:11 -0700
committerGravatar GitHub2019-02-15 19:52:11 -0700
commit99da6362c43a24c608a2790f668f10a62e3b80a6 (patch)
tree6257ac07283ebb4ea5ac622784cc7a041d48f8b1 /src/core/core_cpu.cpp
parentMerge pull request #2112 from lioncash/shadowing (diff)
parentcore_timing: Convert core timing into a class (diff)
downloadyuzu-99da6362c43a24c608a2790f668f10a62e3b80a6.tar.gz
yuzu-99da6362c43a24c608a2790f668f10a62e3b80a6.tar.xz
yuzu-99da6362c43a24c608a2790f668f10a62e3b80a6.zip
Merge pull request #2123 from lioncash/coretiming-global
core_timing: De-globalize core_timing facilities
Diffstat (limited to 'src/core/core_cpu.cpp')
-rw-r--r--src/core/core_cpu.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/core_cpu.cpp b/src/core/core_cpu.cpp
index 452366250..54aa21a3a 100644
--- a/src/core/core_cpu.cpp
+++ b/src/core/core_cpu.cpp
@@ -49,17 +49,18 @@ bool CpuBarrier::Rendezvous() {
49 return false; 49 return false;
50} 50}
51 51
52Cpu::Cpu(ExclusiveMonitor& exclusive_monitor, CpuBarrier& cpu_barrier, std::size_t core_index) 52Cpu::Cpu(Timing::CoreTiming& core_timing, ExclusiveMonitor& exclusive_monitor,
53 : cpu_barrier{cpu_barrier}, core_index{core_index} { 53 CpuBarrier& cpu_barrier, std::size_t core_index)
54 : cpu_barrier{cpu_barrier}, core_timing{core_timing}, core_index{core_index} {
54 if (Settings::values.use_cpu_jit) { 55 if (Settings::values.use_cpu_jit) {
55#ifdef ARCHITECTURE_x86_64 56#ifdef ARCHITECTURE_x86_64
56 arm_interface = std::make_unique<ARM_Dynarmic>(exclusive_monitor, core_index); 57 arm_interface = std::make_unique<ARM_Dynarmic>(core_timing, exclusive_monitor, core_index);
57#else 58#else
58 arm_interface = std::make_unique<ARM_Unicorn>(); 59 arm_interface = std::make_unique<ARM_Unicorn>();
59 LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); 60 LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available");
60#endif 61#endif
61 } else { 62 } else {
62 arm_interface = std::make_unique<ARM_Unicorn>(); 63 arm_interface = std::make_unique<ARM_Unicorn>(core_timing);
63 } 64 }
64 65
65 scheduler = std::make_unique<Kernel::Scheduler>(*arm_interface); 66 scheduler = std::make_unique<Kernel::Scheduler>(*arm_interface);
@@ -93,14 +94,14 @@ void Cpu::RunLoop(bool tight_loop) {
93 94
94 if (IsMainCore()) { 95 if (IsMainCore()) {
95 // TODO(Subv): Only let CoreTiming idle if all 4 cores are idling. 96 // TODO(Subv): Only let CoreTiming idle if all 4 cores are idling.
96 Timing::Idle(); 97 core_timing.Idle();
97 Timing::Advance(); 98 core_timing.Advance();
98 } 99 }
99 100
100 PrepareReschedule(); 101 PrepareReschedule();
101 } else { 102 } else {
102 if (IsMainCore()) { 103 if (IsMainCore()) {
103 Timing::Advance(); 104 core_timing.Advance();
104 } 105 }
105 106
106 if (tight_loop) { 107 if (tight_loop) {