From 3a846aa80f5d533a5061fcbef2736aaef8c38a66 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 28 Mar 2019 22:59:17 -0400 Subject: kernel/process: Report total physical memory used to svcGetInfo Reports the (mostly) correct size through svcGetInfo now for queries to total used physical memory. This still doesn't correctly handle memory allocated via svcMapPhysicalMemory, however, we don't currently handle that case anyways. --- src/core/hle/kernel/process.cpp | 4 ++++ 1 file changed, 4 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 819d2cb0b..b0b7af76b 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -76,6 +76,10 @@ SharedPtr Process::GetResourceLimit() const { return resource_limit; } +u64 Process::GetTotalPhysicalMemoryUsed() const { + return vm_manager.GetCurrentHeapSize() + main_thread_stack_size + code_memory_size; +} + ResultCode Process::ClearSignalState() { if (status == ProcessStatus::Exited) { LOG_ERROR(Kernel, "called on a terminated process instance."); -- cgit v1.2.3