aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc/svc_thread.cpp
diff options
context:
space:
mode:
authormaufeat <sahyno1996@gmail.com>2026-05-05 01:29:46 +0200
committercrueter <crueter@eden-emu.dev>2026-05-05 01:29:46 +0200
commitfee603f0b97d2d8a6ecb793326e844e066d2f4cf (patch)
tree4f3e246f426c2a8282856dafcd2d6851f5b46529 /src/core/hle/kernel/svc/svc_thread.cpp
parentfc5fa7f1b2dc4a67f5cdff43e499991956692a56 (diff)
[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 <pavelbarabanov94@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3761 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Diffstat (limited to 'src/core/hle/kernel/svc/svc_thread.cpp')
-rw-r--r--src/core/hle/kernel/svc/svc_thread.cpp9
1 files changed, 7 insertions, 2 deletions
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