summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-02-11 17:36:39 -0400
committerGravatar FernandoS272020-02-11 18:47:31 -0400
commitd23d504d776007c1244a85ac1b7bb67c407067b2 (patch)
treed6e992004bf752819084d648ca8b81fd1fc1db18 /src/core/hle/kernel/kernel.cpp
parentKernel: Change WaitObject to Synchronization object. In order to better refle... (diff)
downloadyuzu-d23d504d776007c1244a85ac1b7bb67c407067b2.tar.gz
yuzu-d23d504d776007c1244a85ac1b7bb67c407067b2.tar.xz
yuzu-d23d504d776007c1244a85ac1b7bb67c407067b2.zip
Kernel: Refactor synchronization to better match RE
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 26799f6b5..4eb1d8703 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -23,6 +23,7 @@
23#include "core/hle/kernel/process.h" 23#include "core/hle/kernel/process.h"
24#include "core/hle/kernel/resource_limit.h" 24#include "core/hle/kernel/resource_limit.h"
25#include "core/hle/kernel/scheduler.h" 25#include "core/hle/kernel/scheduler.h"
26#include "core/hle/kernel/synchronization.h"
26#include "core/hle/kernel/thread.h" 27#include "core/hle/kernel/thread.h"
27#include "core/hle/lock.h" 28#include "core/hle/lock.h"
28#include "core/hle/result.h" 29#include "core/hle/result.h"
@@ -96,7 +97,8 @@ static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] s64 cycles_
96} 97}
97 98
98struct KernelCore::Impl { 99struct KernelCore::Impl {
99 explicit Impl(Core::System& system) : system{system}, global_scheduler{system} {} 100 explicit Impl(Core::System& system)
101 : system{system}, global_scheduler{system}, synchronization{system} {}
100 102
101 void Initialize(KernelCore& kernel) { 103 void Initialize(KernelCore& kernel) {
102 Shutdown(); 104 Shutdown();
@@ -191,6 +193,7 @@ struct KernelCore::Impl {
191 std::vector<std::shared_ptr<Process>> process_list; 193 std::vector<std::shared_ptr<Process>> process_list;
192 Process* current_process = nullptr; 194 Process* current_process = nullptr;
193 Kernel::GlobalScheduler global_scheduler; 195 Kernel::GlobalScheduler global_scheduler;
196 Kernel::Synchronization synchronization;
194 197
195 std::shared_ptr<ResourceLimit> system_resource_limit; 198 std::shared_ptr<ResourceLimit> system_resource_limit;
196 199
@@ -270,6 +273,14 @@ const Kernel::PhysicalCore& KernelCore::PhysicalCore(std::size_t id) const {
270 return impl->cores[id]; 273 return impl->cores[id];
271} 274}
272 275
276Kernel::Synchronization& KernelCore::Synchronization() {
277 return impl->synchronization;
278}
279
280const Kernel::Synchronization& KernelCore::Synchronization() const {
281 return impl->synchronization;
282}
283
273Core::ExclusiveMonitor& KernelCore::GetExclusiveMonitor() { 284Core::ExclusiveMonitor& KernelCore::GetExclusiveMonitor() {
274 return *impl->exclusive_monitor; 285 return *impl->exclusive_monitor;
275} 286}