diff options
| author | 2020-01-26 10:28:23 -0400 | |
|---|---|---|
| committer | 2020-01-26 10:28:23 -0400 | |
| commit | 450341b397766caa32138882acb52790f4120963 (patch) | |
| tree | 141d9ddddd6f585c1df8fc2a1465f473bebc354b /src/core/hle/kernel/kernel.cpp | |
| parent | Core: Refactor CPU Management. (diff) | |
| download | yuzu-450341b397766caa32138882acb52790f4120963.tar.gz yuzu-450341b397766caa32138882acb52790f4120963.tar.xz yuzu-450341b397766caa32138882acb52790f4120963.zip | |
ArmInterface: Delegate Exclusive monitor factory to exclusive monitor interfasce.
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index b7fd480d1..1986cf65c 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <atomic> | 5 | #include <atomic> |
| 6 | #include <functional> | ||
| 6 | #include <memory> | 7 | #include <memory> |
| 7 | #include <mutex> | 8 | #include <mutex> |
| 8 | #include <utility> | 9 | #include <utility> |
| @@ -10,9 +11,6 @@ | |||
| 10 | #include "common/assert.h" | 11 | #include "common/assert.h" |
| 11 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 12 | #include "core/arm/arm_interface.h" | 13 | #include "core/arm/arm_interface.h" |
| 13 | #ifdef ARCHITECTURE_x86_64 | ||
| 14 | #include "core/arm/dynarmic/arm_dynarmic.h" | ||
| 15 | #endif | ||
| 16 | #include "core/arm/exclusive_monitor.h" | 14 | #include "core/arm/exclusive_monitor.h" |
| 17 | #include "core/core.h" | 15 | #include "core/core.h" |
| 18 | #include "core/core_timing.h" | 16 | #include "core/core_timing.h" |
| @@ -137,7 +135,7 @@ struct KernelCore::Impl { | |||
| 137 | } | 135 | } |
| 138 | 136 | ||
| 139 | void InitializePhysicalCores(KernelCore& kernel) { | 137 | void InitializePhysicalCores(KernelCore& kernel) { |
| 140 | exclusive_monitor = MakeExclusiveMonitor(); | 138 | exclusive_monitor = Core::MakeExclusiveMonitor(system.Memory(), global_scheduler.CpuCoresCount()); |
| 141 | for (std::size_t i = 0; i < global_scheduler.CpuCoresCount(); i++) { | 139 | for (std::size_t i = 0; i < global_scheduler.CpuCoresCount(); i++) { |
| 142 | cores.emplace_back(system, kernel, i, *exclusive_monitor); | 140 | cores.emplace_back(system, kernel, i, *exclusive_monitor); |
| 143 | } | 141 | } |
| @@ -156,7 +154,6 @@ struct KernelCore::Impl { | |||
| 156 | ASSERT(system_resource_limit->SetLimitValue(ResourceType::Sessions, 900).IsSuccess()); | 154 | ASSERT(system_resource_limit->SetLimitValue(ResourceType::Sessions, 900).IsSuccess()); |
| 157 | } | 155 | } |
| 158 | 156 | ||
| 159 | |||
| 160 | void InitializeThreads() { | 157 | void InitializeThreads() { |
| 161 | thread_wakeup_event_type = | 158 | thread_wakeup_event_type = |
| 162 | Core::Timing::CreateEvent("ThreadWakeupCallback", ThreadWakeupCallback); | 159 | Core::Timing::CreateEvent("ThreadWakeupCallback", ThreadWakeupCallback); |
| @@ -184,16 +181,6 @@ struct KernelCore::Impl { | |||
| 184 | system.Memory().SetCurrentPageTable(*process); | 181 | system.Memory().SetCurrentPageTable(*process); |
| 185 | } | 182 | } |
| 186 | 183 | ||
| 187 | std::unique_ptr<Core::ExclusiveMonitor> MakeExclusiveMonitor() { | ||
| 188 | #ifdef ARCHITECTURE_x86_64 | ||
| 189 | return std::make_unique<Core::DynarmicExclusiveMonitor>(system.Memory(), | ||
| 190 | global_scheduler.CpuCoresCount()); | ||
| 191 | #else | ||
| 192 | // TODO(merry): Passthrough exclusive monitor | ||
| 193 | return nullptr; | ||
| 194 | #endif | ||
| 195 | } | ||
| 196 | |||
| 197 | std::atomic<u32> next_object_id{0}; | 184 | std::atomic<u32> next_object_id{0}; |
| 198 | std::atomic<u64> next_kernel_process_id{Process::InitialKIPIDMin}; | 185 | std::atomic<u64> next_kernel_process_id{Process::InitialKIPIDMin}; |
| 199 | std::atomic<u64> next_user_process_id{Process::ProcessIDMin}; | 186 | std::atomic<u64> next_user_process_id{Process::ProcessIDMin}; |