diff options
author | Lioncash <mathew1800@gmail.com> | 2019-03-04 22:40:17 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-03-04 23:08:55 +0100 |
commit | 6c42a23550de8d6181562e969a142004f91c7daf (patch) | |
tree | 54bb08184bd0645dc30dc1a11a51785bf86a2af5 /src/core/hle/kernel/vm_manager.cpp | |
parent | svc: Migrate address range checking functions to VMManager (diff) | |
download | yuzu-6c42a23550de8d6181562e969a142004f91c7daf.tar yuzu-6c42a23550de8d6181562e969a142004f91c7daf.tar.gz yuzu-6c42a23550de8d6181562e969a142004f91c7daf.tar.bz2 yuzu-6c42a23550de8d6181562e969a142004f91c7daf.tar.lz yuzu-6c42a23550de8d6181562e969a142004f91c7daf.tar.xz yuzu-6c42a23550de8d6181562e969a142004f91c7daf.tar.zst yuzu-6c42a23550de8d6181562e969a142004f91c7daf.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/vm_manager.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 56f3d1f79..e81856bdc 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -763,6 +763,11 @@ u64 VMManager::GetCodeRegionSize() const { return code_region_end - code_region_base; } +bool VMManager::IsWithinCodeRegion(VAddr address, u64 size) const { + return IsInsideAddressRange(address, size, GetCodeRegionBaseAddress(), + GetCodeRegionEndAddress()); +} + VAddr VMManager::GetHeapRegionBaseAddress() const { return heap_region_base; } @@ -775,6 +780,11 @@ u64 VMManager::GetHeapRegionSize() const { return heap_region_end - heap_region_base; } +bool VMManager::IsWithinHeapRegion(VAddr address, u64 size) const { + return IsInsideAddressRange(address, size, GetHeapRegionBaseAddress(), + GetHeapRegionEndAddress()); +} + VAddr VMManager::GetMapRegionBaseAddress() const { return map_region_base; } @@ -787,6 +797,10 @@ u64 VMManager::GetMapRegionSize() const { return map_region_end - map_region_base; } +bool VMManager::IsWithinMapRegion(VAddr address, u64 size) const { + return IsInsideAddressRange(address, size, GetMapRegionBaseAddress(), GetMapRegionEndAddress()); +} + VAddr VMManager::GetNewMapRegionBaseAddress() const { return new_map_region_base; } @@ -816,4 +830,9 @@ u64 VMManager::GetTLSIORegionSize() const { return tls_io_region_end - tls_io_region_base; } +bool VMManager::IsWithinTLSIORegion(VAddr address, u64 size) const { + return IsInsideAddressRange(address, size, GetTLSIORegionBaseAddress(), + GetTLSIORegionEndAddress()); +} + } // namespace Kernel |