diff options
author | bunnei <bunneidev@gmail.com> | 2020-12-31 11:13:02 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-01-29 06:42:25 +0100 |
commit | 47829850131f04075950b733cb93a3688e8afb5b (patch) | |
tree | 26f0cf0a7f9b01c0266b2b3752fb600953875129 /src/core/hle/kernel/kernel.cpp | |
parent | hle: kernel: KThread: Remove thread types that do not exist. (diff) | |
download | yuzu-47829850131f04075950b733cb93a3688e8afb5b.tar yuzu-47829850131f04075950b733cb93a3688e8afb5b.tar.gz yuzu-47829850131f04075950b733cb93a3688e8afb5b.tar.bz2 yuzu-47829850131f04075950b733cb93a3688e8afb5b.tar.lz yuzu-47829850131f04075950b733cb93a3688e8afb5b.tar.xz yuzu-47829850131f04075950b733cb93a3688e8afb5b.tar.zst yuzu-47829850131f04075950b733cb93a3688e8afb5b.zip |
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 6ae0bdeed..80a78e643 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -62,6 +62,7 @@ struct KernelCore::Impl { global_scheduler_context = std::make_unique<Kernel::GlobalSchedulerContext>(kernel); service_thread_manager = std::make_unique<Common::ThreadWorker>(1, "yuzu:ServiceThreadManager"); + is_phantom_mode_for_singlecore = false; InitializePhysicalCores(); InitializeSystemResourceLimit(kernel); @@ -227,6 +228,15 @@ struct KernelCore::Impl { return this_id; } + bool IsPhantomModeForSingleCore() const { + return is_phantom_mode_for_singlecore; + } + + void SetIsPhantomModeForSingleCore(bool value) { + ASSERT(!is_multicore); + is_phantom_mode_for_singlecore = value; + } + [[nodiscard]] Core::EmuThreadHandle GetCurrentEmuThreadID() { Core::EmuThreadHandle result = Core::EmuThreadHandle::InvalidHandle(); result.host_handle = GetCurrentHostThreadID(); @@ -235,7 +245,7 @@ struct KernelCore::Impl { } const Kernel::KScheduler& sched = cores[result.host_handle].Scheduler(); const Kernel::KThread* current = sched.GetCurrentThread(); - if (current != nullptr && !current->IsPhantomMode()) { + if (current != nullptr && !IsPhantomModeForSingleCore()) { result.guest_handle = current->GetGlobalHandle(); } else { result.guest_handle = InvalidHandle; @@ -345,6 +355,7 @@ struct KernelCore::Impl { std::array<std::unique_ptr<Kernel::KScheduler>, Core::Hardware::NUM_CPU_CORES> schedulers{}; bool is_multicore{}; + bool is_phantom_mode_for_singlecore{}; u32 single_core_thread_id{}; std::array<u64, Core::Hardware::NUM_CPU_CORES> svc_ticks{}; @@ -643,4 +654,12 @@ void KernelCore::ReleaseServiceThread(std::weak_ptr<Kernel::ServiceThread> servi }); } +bool KernelCore::IsPhantomModeForSingleCore() const { + return impl->IsPhantomModeForSingleCore(); +} + +void KernelCore::SetIsPhantomModeForSingleCore(bool value) { + impl->SetIsPhantomModeForSingleCore(value); +} + } // namespace Kernel |