summaryrefslogtreecommitdiffstats
path: root/src/core/core_cpu.cpp
diff options
context:
space:
mode:
authorMerryMage <MerryMage@users.noreply.github.com>2018-07-03 15:28:46 +0200
committerMerryMage <MerryMage@users.noreply.github.com>2018-07-22 16:55:17 +0200
commit0b1c2e5505c6478ef10e65c0b002eeb242e15540 (patch)
tree187eeabceb451d3cd89b3f0fd47412a7a9e57015 /src/core/core_cpu.cpp
parentMerge pull request #765 from lioncash/file (diff)
downloadyuzu-0b1c2e5505c6478ef10e65c0b002eeb242e15540.tar
yuzu-0b1c2e5505c6478ef10e65c0b002eeb242e15540.tar.gz
yuzu-0b1c2e5505c6478ef10e65c0b002eeb242e15540.tar.bz2
yuzu-0b1c2e5505c6478ef10e65c0b002eeb242e15540.tar.lz
yuzu-0b1c2e5505c6478ef10e65c0b002eeb242e15540.tar.xz
yuzu-0b1c2e5505c6478ef10e65c0b002eeb242e15540.tar.zst
yuzu-0b1c2e5505c6478ef10e65c0b002eeb242e15540.zip
Diffstat (limited to '')
-rw-r--r--src/core/core_cpu.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/core/core_cpu.cpp b/src/core/core_cpu.cpp
index f22d6a9d0..54e15a701 100644
--- a/src/core/core_cpu.cpp
+++ b/src/core/core_cpu.cpp
@@ -48,14 +48,15 @@ bool CpuBarrier::Rendezvous() {
return false;
}
-Cpu::Cpu(std::shared_ptr<CpuBarrier> cpu_barrier, size_t core_index)
+Cpu::Cpu(std::shared_ptr<ExclusiveMonitor> exclusive_monitor,
+ std::shared_ptr<CpuBarrier> cpu_barrier, size_t core_index)
: cpu_barrier{std::move(cpu_barrier)}, core_index{core_index} {
if (Settings::values.use_cpu_jit) {
#ifdef ARCHITECTURE_x86_64
- arm_interface = std::make_shared<ARM_Dynarmic>();
+ arm_interface = std::make_shared<ARM_Dynarmic>(exclusive_monitor, core_index);
#else
- cpu_core = std::make_shared<ARM_Unicorn>();
+ arm_interface = std::make_shared<ARM_Unicorn>();
LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available");
#endif
} else {
@@ -65,6 +66,18 @@ Cpu::Cpu(std::shared_ptr<CpuBarrier> cpu_barrier, size_t core_index)
scheduler = std::make_shared<Kernel::Scheduler>(arm_interface.get());
}
+std::shared_ptr<ExclusiveMonitor> Cpu::MakeExclusiveMonitor(size_t num_cores) {
+ if (Settings::values.use_cpu_jit) {
+#ifdef ARCHITECTURE_x86_64
+ return std::make_shared<DynarmicExclusiveMonitor>(num_cores);
+#else
+ return nullptr; // TODO(merry): Passthrough exclusive monitor
+#endif
+ } else {
+ return nullptr; // TODO(merry): Passthrough exclusive monitor
+ }
+}
+
void Cpu::RunLoop(bool tight_loop) {
// Wait for all other CPU cores to complete the previous slice, such that they run in lock-step
if (!cpu_barrier->Rendezvous()) {