diff options
Diffstat (limited to 'src/core/core_cpu.cpp')
| -rw-r--r-- | src/core/core_cpu.cpp | 15 |
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 | ||
| 52 | Cpu::Cpu(ExclusiveMonitor& exclusive_monitor, CpuBarrier& cpu_barrier, std::size_t core_index) | 52 | Cpu::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) { |