diff options
author | Michael Scire <SciresM@gmail.com> | 2019-07-07 21:55:30 +0200 |
---|---|---|
committer | Michael Scire <SciresM@gmail.com> | 2019-07-07 21:55:30 +0200 |
commit | ce64a9fab9e6f015a4d2b332abcb7043914549d4 (patch) | |
tree | 75b34665635af88a0cababae1f889d5bed4a9440 /src/core/hle/kernel/vm_manager.h | |
parent | clang-format fixes (diff) | |
download | yuzu-ce64a9fab9e6f015a4d2b332abcb7043914549d4.tar yuzu-ce64a9fab9e6f015a4d2b332abcb7043914549d4.tar.gz yuzu-ce64a9fab9e6f015a4d2b332abcb7043914549d4.tar.bz2 yuzu-ce64a9fab9e6f015a4d2b332abcb7043914549d4.tar.lz yuzu-ce64a9fab9e6f015a4d2b332abcb7043914549d4.tar.xz yuzu-ce64a9fab9e6f015a4d2b332abcb7043914549d4.tar.zst yuzu-ce64a9fab9e6f015a4d2b332abcb7043914549d4.zip |
Diffstat (limited to 'src/core/hle/kernel/vm_manager.h')
-rw-r--r-- | src/core/hle/kernel/vm_manager.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h index 8be03a6e4..5b27548aa 100644 --- a/src/core/hle/kernel/vm_manager.h +++ b/src/core/hle/kernel/vm_manager.h @@ -303,6 +303,15 @@ struct VirtualMemoryArea { PAddr paddr = 0; Common::MemoryHookPointer mmio_handler = nullptr; + /// If the address lies within this VMA, returns the size left before the + /// end of this VMA. If the given address doesn't lie within the VMA, then + /// an empty optional value is returned. + /// + /// For example, given a VMA 100 bytes long. If '10' was given as the + /// start address, then this would return 90. + /// + std::optional<u64> SizeRemainingFromAddress(VAddr address) const; + /// Tests if this area can be merged to the right with `next`. bool CanBeMergedWith(const VirtualMemoryArea& next) const; }; @@ -735,6 +744,13 @@ private: MemoryAttribute attribute_mask, MemoryAttribute attribute, MemoryAttribute ignore_mask) const; + /// Gets the amount of memory currently mapped (state != Unmapped) in a range. + ResultVal<std::size_t> SizeOfAllocatedVMAsInRange(VAddr address, std::size_t size) const; + + /// Gets the amount of memory unmappable by UnmapPhysicalMemory in a range. + ResultVal<std::size_t> SizeOfUnmappablePhysicalMemoryInRange(VAddr address, + std::size_t size) const; + /** * A map covering the entirety of the managed address space, keyed by the `base` field of each * VMA. It must always be modified by splitting or merging VMAs, so that the invariant |