diff options
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 92fbc5532..b0b130719 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -824,6 +824,14 @@ const Kernel::PhysicalCore& KernelCore::PhysicalCore(std::size_t id) const { | |||
| 824 | return impl->cores[id]; | 824 | return impl->cores[id]; |
| 825 | } | 825 | } |
| 826 | 826 | ||
| 827 | size_t KernelCore::CurrentPhysicalCoreIndex() const { | ||
| 828 | const u32 core_id = impl->GetCurrentHostThreadID(); | ||
| 829 | if (core_id >= Core::Hardware::NUM_CPU_CORES) { | ||
| 830 | return Core::Hardware::NUM_CPU_CORES - 1; | ||
| 831 | } | ||
| 832 | return core_id; | ||
| 833 | } | ||
| 834 | |||
| 827 | Kernel::PhysicalCore& KernelCore::CurrentPhysicalCore() { | 835 | Kernel::PhysicalCore& KernelCore::CurrentPhysicalCore() { |
| 828 | u32 core_id = impl->GetCurrentHostThreadID(); | 836 | u32 core_id = impl->GetCurrentHostThreadID(); |
| 829 | ASSERT(core_id < Core::Hardware::NUM_CPU_CORES); | 837 | ASSERT(core_id < Core::Hardware::NUM_CPU_CORES); |