aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-28 22:59:17 -0400
committerLioncash <mathew1800@gmail.com>2019-03-28 22:59:20 -0400
commit3a846aa80f5d533a5061fcbef2736aaef8c38a66 (patch)
treea3dd29dfc5f35a4fed9d9c9855af4dbab902774f /src/core/hle/kernel/process.cpp
parent2289e895aa63cdb391795c573b96b1880c31f097 (diff)
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.
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
-rw-r--r--src/core/hle/kernel/process.cpp4
1 files changed, 4 insertions, 0 deletions
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<ResourceLimit> 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.");