diff options
author | Lioncash <mathew1800@gmail.com> | 2018-10-15 15:25:11 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-10-15 20:15:56 +0200 |
commit | 5484742fdaf036db03ac7b8c746df5004f74efad (patch) | |
tree | 71f2f25319773fa718ade73b59fccccfbceedb12 /src/core/core.cpp | |
parent | core: Make the live Cpu instances unique_ptrs instead of shared_ptrs (diff) | |
download | yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.tar yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.tar.gz yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.tar.bz2 yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.tar.lz yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.tar.xz yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.tar.zst yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/core.cpp | 16 |
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() { } Kernel::Scheduler& System::CurrentScheduler() { - return *CurrentCpuCore().Scheduler(); + return CurrentCpuCore().Scheduler(); } -const std::shared_ptr<Kernel::Scheduler>& System::Scheduler(std::size_t core_index) { - ASSERT(core_index < NUM_CPU_CORES); - return impl->cpu_cores[core_index]->Scheduler(); +Kernel::Scheduler& System::Scheduler(std::size_t core_index) { + return CpuCore(core_index).Scheduler(); +} + +const Kernel::Scheduler& System::Scheduler(std::size_t core_index) const { + return CpuCore(core_index).Scheduler(); } Kernel::Process* System::CurrentProcess() { @@ -381,6 +384,11 @@ Cpu& System::CpuCore(std::size_t core_index) { return *impl->cpu_cores[core_index]; } +const Cpu& System::CpuCore(std::size_t core_index) const { + ASSERT(core_index < NUM_CPU_CORES); + return *impl->cpu_cores[core_index]; +} + ExclusiveMonitor& System::Monitor() { return *impl->cpu_exclusive_monitor; } |