summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2018-10-15 09:25:11 -0400
committerGravatar Lioncash2018-10-15 14:15:56 -0400
commit5484742fdaf036db03ac7b8c746df5004f74efad (patch)
tree71f2f25319773fa718ade73b59fccccfbceedb12 /src/core/core.cpp
parentcore: Make the live Cpu instances unique_ptrs instead of shared_ptrs (diff)
downloadyuzu-5484742fdaf036db03ac7b8c746df5004f74efad.tar.gz
yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.tar.xz
yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.zip
core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 52433731a..3c57a62ec 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -355,12 +355,15 @@ std::size_t System::CurrentCoreIndex() {
355} 355}
356 356
357Kernel::Scheduler& System::CurrentScheduler() { 357Kernel::Scheduler& System::CurrentScheduler() {
358 return *CurrentCpuCore().Scheduler(); 358 return CurrentCpuCore().Scheduler();
359} 359}
360 360
361const std::shared_ptr<Kernel::Scheduler>& System::Scheduler(std::size_t core_index) { 361Kernel::Scheduler& System::Scheduler(std::size_t core_index) {
362 ASSERT(core_index < NUM_CPU_CORES); 362 return CpuCore(core_index).Scheduler();
363 return impl->cpu_cores[core_index]->Scheduler(); 363}
364
365const Kernel::Scheduler& System::Scheduler(std::size_t core_index) const {
366 return CpuCore(core_index).Scheduler();
364} 367}
365 368
366Kernel::Process* System::CurrentProcess() { 369Kernel::Process* System::CurrentProcess() {
@@ -381,6 +384,11 @@ Cpu& System::CpuCore(std::size_t core_index) {
381 return *impl->cpu_cores[core_index]; 384 return *impl->cpu_cores[core_index];
382} 385}
383 386
387const Cpu& System::CpuCore(std::size_t core_index) const {
388 ASSERT(core_index < NUM_CPU_CORES);
389 return *impl->cpu_cores[core_index];
390}
391
384ExclusiveMonitor& System::Monitor() { 392ExclusiveMonitor& System::Monitor() {
385 return *impl->cpu_exclusive_monitor; 393 return *impl->cpu_exclusive_monitor;
386} 394}