diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 7a2dfc7c..e5d0c4b6 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -842,6 +842,14 @@ Result svcGetDebugThreadContext(u8* out, Handle debug, u64 threadID, u32 flags); */ Result svcGetProcessList(u32 *num_out, u64 *pids_out, u32 max_pids); +/** + * @brief Retrieves a list of all threads for a debug handle (or zero). + * @return Result code. + * @note Syscall number 0x66. + * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available. + */ +Result svcGetThreadList(u32 *num_out, u64 *tids_out, u32 max_tids, Handle debug); + ///@} ///@name Debugging diff --git a/nx/source/kernel/svc.s b/nx/source/kernel/svc.s index 43315560..769c42ad 100644 --- a/nx/source/kernel/svc.s +++ b/nx/source/kernel/svc.s @@ -445,6 +445,14 @@ SVC_BEGIN svcGetProcessList ret SVC_END +SVC_BEGIN svcGetThreadList + str x0, [sp, #-16]! + svc 0x66 + ldr x2, [sp], #16 + str w1, [x2] + ret +SVC_END + SVC_BEGIN svcGetDebugThreadContext svc 0x67 ret