summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-08-07 07:45:18 +0200
committerbunnei <bunneidev@gmail.com>2021-12-07 01:39:16 +0100
commit669a2d2c67bd9a3267286bc0c2e6e3c1dc98c154 (patch)
treec2c3228add0d937de938081d000f62b3d6e4d2d2 /src/core/hle/kernel/kernel.cpp
parentMerge pull request #7529 from german77/sdl2.0.18 (diff)
downloadyuzu-669a2d2c67bd9a3267286bc0c2e6e3c1dc98c154.tar
yuzu-669a2d2c67bd9a3267286bc0c2e6e3c1dc98c154.tar.gz
yuzu-669a2d2c67bd9a3267286bc0c2e6e3c1dc98c154.tar.bz2
yuzu-669a2d2c67bd9a3267286bc0c2e6e3c1dc98c154.tar.lz
yuzu-669a2d2c67bd9a3267286bc0c2e6e3c1dc98c154.tar.xz
yuzu-669a2d2c67bd9a3267286bc0c2e6e3c1dc98c154.tar.zst
yuzu-669a2d2c67bd9a3267286bc0c2e6e3c1dc98c154.zip
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 {
return impl->cores[id];
}
+size_t KernelCore::CurrentPhysicalCoreIndex() const {
+ const u32 core_id = impl->GetCurrentHostThreadID();
+ if (core_id >= Core::Hardware::NUM_CPU_CORES) {
+ return Core::Hardware::NUM_CPU_CORES - 1;
+ }
+ return core_id;
+}
+
Kernel::PhysicalCore& KernelCore::CurrentPhysicalCore() {
u32 core_id = impl->GetCurrentHostThreadID();
ASSERT(core_id < Core::Hardware::NUM_CPU_CORES);