diff options
author | Lioncash <mathew1800@gmail.com> | 2018-12-15 02:59:08 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-12-16 01:43:36 +0100 |
commit | 4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc (patch) | |
tree | 896c81154482e0745191c55c5a3856926043fa75 /src/core/hle/kernel | |
parent | vm_manager: Add backing functionality for memory attributes (diff) | |
download | yuzu-4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc.tar yuzu-4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc.tar.gz yuzu-4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc.tar.bz2 yuzu-4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc.tar.lz yuzu-4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc.tar.xz yuzu-4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc.tar.zst yuzu-4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/vm_manager.cpp | 16 | ||||
-rw-r--r-- | src/core/hle/kernel/vm_manager.h | 3 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index ea3f59935..252f92df2 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -37,8 +37,8 @@ static const char* GetMemoryStateName(MemoryState state) { bool VirtualMemoryArea::CanBeMergedWith(const VirtualMemoryArea& next) const { ASSERT(base + size == next.base); - if (permissions != next.permissions || meminfo_state != next.meminfo_state || - attribute != next.attribute || type != next.type) { + if (permissions != next.permissions || state != next.state || attribute != next.attribute || + type != next.type) { return false; } if (type == VMAType::AllocatedMemoryBlock && @@ -115,7 +115,7 @@ ResultVal<VMManager::VMAHandle> VMManager::MapMemoryBlock(VAddr target, final_vma.type = VMAType::AllocatedMemoryBlock; final_vma.permissions = VMAPermission::ReadWrite; - final_vma.meminfo_state = state; + final_vma.state = state; final_vma.backing_block = std::move(block); final_vma.offset = offset; UpdatePageTableForVMA(final_vma); @@ -140,7 +140,7 @@ ResultVal<VMManager::VMAHandle> VMManager::MapBackingMemory(VAddr target, u8* me final_vma.type = VMAType::BackingMemory; final_vma.permissions = VMAPermission::ReadWrite; - final_vma.meminfo_state = state; + final_vma.state = state; final_vma.backing_memory = memory; UpdatePageTableForVMA(final_vma); @@ -177,7 +177,7 @@ ResultVal<VMManager::VMAHandle> VMManager::MapMMIO(VAddr target, PAddr paddr, u6 final_vma.type = VMAType::MMIO; final_vma.permissions = VMAPermission::ReadWrite; - final_vma.meminfo_state = state; + final_vma.state = state; final_vma.paddr = paddr; final_vma.mmio_handler = std::move(mmio_handler); UpdatePageTableForVMA(final_vma); @@ -189,7 +189,7 @@ VMManager::VMAIter VMManager::Unmap(VMAIter vma_handle) { VirtualMemoryArea& vma = vma_handle->second; vma.type = VMAType::Free; vma.permissions = VMAPermission::None; - vma.meminfo_state = MemoryState::Unmapped; + vma.state = MemoryState::Unmapped; vma.backing_block = nullptr; vma.offset = 0; @@ -311,7 +311,7 @@ MemoryInfo VMManager::QueryMemory(VAddr address) const { memory_info.attributes = ToSvcMemoryAttribute(vma->second.attribute); memory_info.permission = static_cast<u32>(vma->second.permissions); memory_info.size = vma->second.size; - memory_info.state = ToSvcMemoryState(vma->second.meminfo_state); + memory_info.state = ToSvcMemoryState(vma->second.state); } else { memory_info.base_address = address_space_end; memory_info.permission = static_cast<u32>(VMAPermission::None); @@ -365,7 +365,7 @@ void VMManager::LogLayout() const { (u8)vma.permissions & (u8)VMAPermission::Read ? 'R' : '-', (u8)vma.permissions & (u8)VMAPermission::Write ? 'W' : '-', (u8)vma.permissions & (u8)VMAPermission::Execute ? 'X' : '-', - GetMemoryStateName(vma.meminfo_state)); + GetMemoryStateName(vma.state)); } } diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h index 99eeeffaa..e2614cd4c 100644 --- a/src/core/hle/kernel/vm_manager.h +++ b/src/core/hle/kernel/vm_manager.h @@ -263,8 +263,7 @@ struct VirtualMemoryArea { VMAType type = VMAType::Free; VMAPermission permissions = VMAPermission::None; - /// Tag returned by svcQueryMemory. Not otherwise used. - MemoryState meminfo_state = MemoryState::Unmapped; + MemoryState state = MemoryState::Unmapped; MemoryAttribute attribute = MemoryAttribute::None; // Settings for type = AllocatedMemoryBlock |