From 28719ee3b4884d182126bddf639e1711b0744b22 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 20 Mar 2019 18:53:48 -0400 Subject: kernel/svc: Implement svcGetThreadList Similarly like svcGetProcessList, this retrieves the list of threads from the current process. In the kernel itself, a process instance maintains a list of threads, which are used within this function. Threads are registered to a process' thread list at thread initialization, and unregistered from the list upon thread destruction (if said thread has a non-null owning process). We assert on the debug event case, as we currently don't implement kernel debug objects. --- src/core/hle/kernel/process.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/hle/kernel/process.cpp') diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 955769503..52f253d1e 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -80,6 +80,14 @@ u64 Process::GetTotalPhysicalMemoryUsed() const { return vm_manager.GetCurrentHeapSize() + main_thread_stack_size + code_memory_size; } +void Process::RegisterThread(const Thread* thread) { + thread_list.push_back(thread); +} + +void Process::UnregisterThread(const Thread* thread) { + thread_list.remove(thread); +} + ResultCode Process::ClearSignalState() { if (status == ProcessStatus::Exited) { LOG_ERROR(Kernel, "called on a terminated process instance."); -- cgit v1.2.3