summaryrefslogtreecommitdiff
path: root/src/core/core.h
diff options
context:
space:
mode:
authorMat M <mathew1800@gmail.com>2018-07-22 12:48:44 -0400
committerGitHub <noreply@github.com>2018-07-22 12:48:44 -0400
commit5fc99553d20d7d747730f7da4d12bdeb0593adb2 (patch)
tree4f3217d3f564c47b8aeecac046e389ba6d3d07ed /src/core/core.h
parent3e2b32a3ee4ee6c212972c544d7844632d202fd9 (diff)
parent0b1c2e5505c6478ef10e65c0b002eeb242e15540 (diff)
Merge pull request #638 from MerryMage/mp
Implement exclusive monitor
Diffstat (limited to 'src/core/core.h')
-rw-r--r--src/core/core.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/core.h b/src/core/core.h
index c6f69f001..c123fe401 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -9,6 +9,7 @@
#include <string>
#include <thread>
#include "common/common_types.h"
+#include "core/arm/exclusive_monitor.h"
#include "core/core_cpu.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/scheduler.h"
@@ -114,6 +115,11 @@ public:
return CurrentCpuCore().ArmInterface();
}
+ /// Gets the index of the currently running CPU core
+ size_t CurrentCoreIndex() {
+ return CurrentCpuCore().CoreIndex();
+ }
+
/// Gets an ARM interface to the CPU core with the specified index
ARM_Interface& ArmInterface(size_t core_index);
@@ -130,6 +136,11 @@ public:
return *CurrentCpuCore().Scheduler();
}
+ /// Gets the exclusive monitor
+ ExclusiveMonitor& Monitor() {
+ return *cpu_exclusive_monitor;
+ }
+
/// Gets the scheduler for the CPU core with the specified index
const std::shared_ptr<Kernel::Scheduler>& Scheduler(size_t core_index);
@@ -186,6 +197,7 @@ private:
std::unique_ptr<Tegra::GPU> gpu_core;
std::shared_ptr<Tegra::DebugContext> debug_context;
Kernel::SharedPtr<Kernel::Process> current_process;
+ std::shared_ptr<ExclusiveMonitor> cpu_exclusive_monitor;
std::shared_ptr<CpuBarrier> cpu_barrier;
std::array<std::shared_ptr<Cpu>, NUM_CPU_CORES> cpu_cores;
std::array<std::unique_ptr<std::thread>, NUM_CPU_CORES - 1> cpu_core_threads;