diff options
author | Lioncash <mathew1800@gmail.com> | 2018-12-12 17:34:01 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-12-12 21:07:30 +0100 |
commit | a8cc03502b41b44150af71535d2b662a7ee3390c (patch) | |
tree | 71084e1b71b5fd705143bbceb44c46e49f63cac2 /src/core/hle/kernel/vm_manager.cpp | |
parent | vm_manager: Migrate MemoryInfo and PageInfo to vm_manager.h (diff) | |
download | yuzu-a8cc03502b41b44150af71535d2b662a7ee3390c.tar yuzu-a8cc03502b41b44150af71535d2b662a7ee3390c.tar.gz yuzu-a8cc03502b41b44150af71535d2b662a7ee3390c.tar.bz2 yuzu-a8cc03502b41b44150af71535d2b662a7ee3390c.tar.lz yuzu-a8cc03502b41b44150af71535d2b662a7ee3390c.tar.xz yuzu-a8cc03502b41b44150af71535d2b662a7ee3390c.tar.zst yuzu-a8cc03502b41b44150af71535d2b662a7ee3390c.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 e0f204b0b..21bcee192 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -302,6 +302,25 @@ ResultCode VMManager::HeapFree(VAddr target, u64 size) { return RESULT_SUCCESS; } +MemoryInfo VMManager::QueryMemory(VAddr address) const { + const auto vma = FindVMA(address); + MemoryInfo memory_info{}; + + if (IsValidHandle(vma)) { + memory_info.base_address = vma->second.base; + memory_info.permission = static_cast<u32>(vma->second.permissions); + memory_info.size = vma->second.size; + memory_info.state = ToSvcMemoryState(vma->second.meminfo_state); + } else { + memory_info.base_address = 0; + memory_info.permission = static_cast<u32>(VMAPermission::None); + memory_info.size = 0; + memory_info.state = static_cast<u32>(MemoryState::Unmapped); + } + + return memory_info; +} + ResultCode VMManager::MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size, MemoryState state) { const auto vma = FindVMA(src_addr); |