summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 45e86a677..04926a291 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -845,6 +845,14 @@ const Kernel::PhysicalCore& KernelCore::PhysicalCore(std::size_t id) const {
845 return impl->cores[id]; 845 return impl->cores[id];
846} 846}
847 847
848size_t KernelCore::CurrentPhysicalCoreIndex() const {
849 const u32 core_id = impl->GetCurrentHostThreadID();
850 if (core_id >= Core::Hardware::NUM_CPU_CORES) {
851 return Core::Hardware::NUM_CPU_CORES - 1;
852 }
853 return core_id;
854}
855
848Kernel::PhysicalCore& KernelCore::CurrentPhysicalCore() { 856Kernel::PhysicalCore& KernelCore::CurrentPhysicalCore() {
849 u32 core_id = impl->GetCurrentHostThreadID(); 857 u32 core_id = impl->GetCurrentHostThreadID();
850 ASSERT(core_id < Core::Hardware::NUM_CPU_CORES); 858 ASSERT(core_id < Core::Hardware::NUM_CPU_CORES);