kern: fix/add InfoType_(Total/Used)(NonSystem/)MemorySize

This commit is contained in:
Michael Scire 2020-07-13 12:17:28 -07:00
parent 35c1959131
commit 57867d6ced
5 changed files with 38 additions and 3 deletions

View file

@ -328,7 +328,7 @@ namespace ams::kern {
/* Lock the table. */
KScopedLightLock lk(this->general_lock);
return this->GetHeapRegionSize() + this->mapped_physical_memory_size;
return (this->current_heap_end - this->heap_region_start) + this->mapped_physical_memory_size;
}
public:
static ALWAYS_INLINE KVirtualAddress GetLinearMappedVirtualAddress(KPhysicalAddress addr) {

View file

@ -176,6 +176,8 @@ namespace ams::kern {
constexpr KHandleTable &GetHandleTable() { return this->handle_table; }
constexpr const KHandleTable &GetHandleTable() const { return this->handle_table; }
size_t GetUsedUserPhysicalMemorySize() const;
size_t GetTotalUserPhysicalMemorySize() const;
size_t GetUsedNonSystemUserPhysicalMemorySize() const;
size_t GetTotalNonSystemUserPhysicalMemorySize() const;