From fee603f0b97d2d8a6ecb793326e844e066d2f4cf Mon Sep 17 00:00:00 2001 From: maufeat Date: Tue, 5 May 2026 01:29:46 +0200 Subject: [kernel, hle] Initial 22.0.0 kernel changes and cmd stubs (#3761) - KProcess::Run() and CreateThread() SVC now write the current thread handle to TLS+0x110 - KPageTableBase::LockForMapDeviceAddressSpace now checks for a new KPageTableBase boolean, m_allowed_exec_device_mapping - Stub `am` + `acc` + `settings` cmd module that needs to work for qlaunch Thanks to: @alula and @yellows8 Source for changes: https://github.com/Atmosphere-NX/Atmosphere/pull/2744, https://switchbrew.org/, https://yls8.mtheall.com/ Co-authored-by: PavelBARABANOV Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3761 Reviewed-by: CamilleLaVey --- src/core/hle/kernel/svc/svc_thread.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/core/hle/kernel/svc/svc_thread.cpp') diff --git a/src/core/hle/kernel/svc/svc_thread.cpp b/src/core/hle/kernel/svc/svc_thread.cpp index ca5ce6fe07..1aa6f87c04 100644 --- a/src/core/hle/kernel/svc/svc_thread.cpp +++ b/src/core/hle/kernel/svc/svc_thread.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project @@ -75,7 +75,12 @@ Result CreateThread(Core::System& system, Handle* out_handle, u64 entry_point, u KThread::Register(kernel, thread); // Add the thread to the handle table. - R_RETURN(process.GetHandleTable().Add(out_handle, thread)); + R_TRY(process.GetHandleTable().Add(out_handle, thread)); + + // Pass the thread handle to the thread local region. + process.GetMemory().Write32(GetInteger(thread->GetTlsAddress()) + 0x110, *out_handle); + + R_SUCCEED(); } /// Starts the thread for the provided handle -- cgit v1.2.3