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.
This commit is contained in:
Lioncash 2019-03-28 22:59:17 -04:00
parent 2289e895aa
commit 3a846aa80f
3 changed files with 11 additions and 4 deletions

View file

@ -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.");