diff options
| author | yumekiru <338525349+yumekiru@users.noreply.github.com> | 2026-10-28 21:21:11 -0400 |
|---|---|---|
| committer | yumekiru <338525349+yumekiru@users.noreply.github.com> | 2026-10-28 21:21:11 -0400 |
| commit | 535b6769709eb22333af26269f1b16f37adce4db (patch) | |
| tree | da827ff9c4f2f9a5309ee2804ee689f608c0ac2f /src/core/hle/kernel/svc/svc_thread.cpp | |
| parent | 1af7fe72927af9fc64aa4af117bc9b30043c4dc7 (diff) | |
Import experimental NS2 support and accumulated GPU fixes
Bring the NS2 patch and local follow-up fixes onto Eglantine master.
Includes native graphics services, instruction translation, syncpoint
cancellation acknowledgement, texture handling and diagnostics.
Experimental checkpoint; not ready to merge. The original Eden build
passed, but this rebased branch has not been built or tested.
Assisted-by: OpenAI Codex (implementation, debugging, tests and PR preparation)
Diffstat (limited to 'src/core/hle/kernel/svc/svc_thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc/svc_thread.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc/svc_thread.cpp b/src/core/hle/kernel/svc/svc_thread.cpp index dbca13dd26..b4eb0b5719 100644 --- a/src/core/hle/kernel/svc/svc_thread.cpp +++ b/src/core/hle/kernel/svc/svc_thread.cpp @@ -16,8 +16,11 @@ namespace Kernel::Svc { namespace { -constexpr bool IsValidVirtualCoreId(int32_t core_id) { - return (0 <= core_id && core_id < static_cast<int32_t>(Core::Hardware::NUM_CPU_CORES)); +bool IsValidVirtualCoreId(const KProcess& process, int32_t core_id) { + // Extended processes use the kernel's existing virtual-core mapping. + const auto core_count = process.UsesPAuthReturns() ? Core::Hardware::NumVirtualCores + : Core::Hardware::NUM_CPU_CORES; + return 0 <= core_id && core_id < static_cast<int32_t>(core_count); } } // Anonymous namespace @@ -38,7 +41,7 @@ Result CreateThread(Core::System& system, Handle* out_handle, u64 entry_point, u } // Validate arguments. - R_UNLESS(IsValidVirtualCoreId(core_id), ResultInvalidCoreId); + R_UNLESS(IsValidVirtualCoreId(process, core_id), ResultInvalidCoreId); R_UNLESS(((1ull << core_id) & process.GetCoreMask()) != 0, ResultInvalidCoreId); R_UNLESS(HighestThreadPriority <= priority && priority <= LowestThreadPriority, @@ -262,7 +265,7 @@ Result SetThreadCoreMask(Core::System& system, Handle thread_handle, s32 core_id R_UNLESS(affinity_mask != 0, ResultInvalidCombination); // Validate the core id. - if (IsValidVirtualCoreId(core_id)) { + if (IsValidVirtualCoreId(GetCurrentProcess(system.Kernel()), core_id)) { R_UNLESS(((1ULL << core_id) & affinity_mask) != 0, ResultInvalidCombination); } else { R_UNLESS(core_id == IdealCoreNoUpdate || core_id == IdealCoreDontCare, |
