summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2019-06-09 18:20:20 -0400
committerGravatar Lioncash2019-06-09 18:22:30 -0400
commit3f87664d8fac06b024b0a59adfdfe570ab6195e5 (patch)
tree59b7c0e6fa849694b5e4c34f573310589e342496 /src/core/hle/kernel/process.cpp
parentkernel/svc: Amend naming for TotalMemoryUsage in svcGetInfo() (diff)
downloadyuzu-3f87664d8fac06b024b0a59adfdfe570ab6195e5.tar.gz
yuzu-3f87664d8fac06b024b0a59adfdfe570ab6195e5.tar.xz
yuzu-3f87664d8fac06b024b0a59adfdfe570ab6195e5.zip
kernel/svc: Implement TotalMemoryUsedWithoutMmHeap/TotalMemoryAvailableWithoutMmHeap
Given we don't currently implement the personal heap yet, the existing memory querying functions are essentially doing what the memory querying types introduced in 6.0.0 do. So, we can build the necessary machinery over the top of those and just use them as part of info types.
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
-rw-r--r--src/core/hle/kernel/process.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index 0775a89fb..63a3707b2 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -72,10 +72,26 @@ SharedPtr<ResourceLimit> Process::GetResourceLimit() const {
72 return resource_limit; 72 return resource_limit;
73} 73}
74 74
75u64 Process::GetTotalPhysicalMemoryAvailable() const {
76 return vm_manager.GetTotalPhysicalMemoryAvailable();
77}
78
79u64 Process::GetTotalPhysicalMemoryAvailableWithoutMmHeap() const {
80 // TODO: Subtract the personal heap size from this when the
81 // personal heap is implemented.
82 return GetTotalPhysicalMemoryAvailable();
83}
84
75u64 Process::GetTotalPhysicalMemoryUsed() const { 85u64 Process::GetTotalPhysicalMemoryUsed() const {
76 return vm_manager.GetCurrentHeapSize() + main_thread_stack_size + code_memory_size; 86 return vm_manager.GetCurrentHeapSize() + main_thread_stack_size + code_memory_size;
77} 87}
78 88
89u64 Process::GetTotalPhysicalMemoryUsedWithoutMmHeap() const {
90 // TODO: Subtract the personal heap size from this when the
91 // personal heap is implemented.
92 return GetTotalPhysicalMemoryUsed();
93}
94
79void Process::RegisterThread(const Thread* thread) { 95void Process::RegisterThread(const Thread* thread) {
80 thread_list.push_back(thread); 96 thread_list.push_back(thread);
81} 97}