From 9770f4bb18d4694cbef05e3979e61e59f79100f2 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 25 Jun 2018 03:59:03 -0600 Subject: [PATCH] Implement svcGetThreadList --- nx/include/switch/kernel/svc.h | 8 ++++++++ nx/source/kernel/svc.s | 8 ++++++++ 2 files changed, 16 insertions(+) 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