summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2018-12-14 20:59:08 -0500
committerGravatar Lioncash2018-12-15 19:43:36 -0500
commit4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc (patch)
tree896c81154482e0745191c55c5a3856926043fa75 /src
parentvm_manager: Add backing functionality for memory attributes (diff)
downloadyuzu-4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc.tar.gz
yuzu-4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc.tar.xz
yuzu-4dc8a7da3f8ee53ba8a812141c03bec7b27b67bc.zip
vm_manager: Rename meminfo_state to state
This is shorter and more concise. This also removes the now-innaccurate comment, as it's not returned wholesale to svcQueryMemory anymore.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/vm_manager.cpp16
-rw-r--r--src/core/hle/kernel/vm_manager.h3
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) {
37 37
38bool VirtualMemoryArea::CanBeMergedWith(const VirtualMemoryArea& next) const { 38bool VirtualMemoryArea::CanBeMergedWith(const VirtualMemoryArea& next) const {
39 ASSERT(base + size == next.base); 39 ASSERT(base + size == next.base);
40 if (permissions != next.permissions || meminfo_state != next.meminfo_state || 40 if (permissions != next.permissions || state != next.state || attribute != next.attribute ||
41 attribute != next.attribute || type != next.type) { 41 type != next.type) {
42 return false; 42 return false;
43 } 43 }
44 if (type == VMAType::AllocatedMemoryBlock && 44 if (type == VMAType::AllocatedMemoryBlock &&
@@ -115,7 +115,7 @@ ResultVal<VMManager::VMAHandle> VMManager::MapMemoryBlock(VAddr target,
115 115
116 final_vma.type = VMAType::AllocatedMemoryBlock; 116 final_vma.type = VMAType::AllocatedMemoryBlock;
117 final_vma.permissions = VMAPermission::ReadWrite; 117 final_vma.permissions = VMAPermission::ReadWrite;
118 final_vma.meminfo_state = state; 118 final_vma.state = state;
119 final_vma.backing_block = std::move(block); 119 final_vma.backing_block = std::move(block);
120 final_vma.offset = offset; 120 final_vma.offset = offset;
121 UpdatePageTableForVMA(final_vma); 121 UpdatePageTableForVMA(final_vma);
@@ -140,7 +140,7 @@ ResultVal<VMManager::VMAHandle> VMManager::MapBackingMemory(VAddr target, u8* me
140 140
141 final_vma.type = VMAType::BackingMemory; 141 final_vma.type = VMAType::BackingMemory;
142 final_vma.permissions = VMAPermission::ReadWrite; 142 final_vma.permissions = VMAPermission::ReadWrite;
143 final_vma.meminfo_state = state; 143 final_vma.state = state;
144 final_vma.backing_memory = memory; 144 final_vma.backing_memory = memory;
145 UpdatePageTableForVMA(final_vma); 145 UpdatePageTableForVMA(final_vma);
146 146
@@ -177,7 +177,7 @@ ResultVal<VMManager::VMAHandle> VMManager::MapMMIO(VAddr target, PAddr paddr, u6
177 177
178 final_vma.type = VMAType::MMIO; 178 final_vma.type = VMAType::MMIO;
179 final_vma.permissions = VMAPermission::ReadWrite; 179 final_vma.permissions = VMAPermission::ReadWrite;
180 final_vma.meminfo_state = state; 180 final_vma.state = state;
181 final_vma.paddr = paddr; 181 final_vma.paddr = paddr;
182 final_vma.mmio_handler = std::move(mmio_handler); 182 final_vma.mmio_handler = std::move(mmio_handler);
183 UpdatePageTableForVMA(final_vma); 183 UpdatePageTableForVMA(final_vma);
@@ -189,7 +189,7 @@ VMManager::VMAIter VMManager::Unmap(VMAIter vma_handle) {
189 VirtualMemoryArea& vma = vma_handle->second; 189 VirtualMemoryArea& vma = vma_handle->second;
190 vma.type = VMAType::Free; 190 vma.type = VMAType::Free;
191 vma.permissions = VMAPermission::None; 191 vma.permissions = VMAPermission::None;
192 vma.meminfo_state = MemoryState::Unmapped; 192 vma.state = MemoryState::Unmapped;
193 193
194 vma.backing_block = nullptr; 194 vma.backing_block = nullptr;
195 vma.offset = 0; 195 vma.offset = 0;
@@ -311,7 +311,7 @@ MemoryInfo VMManager::QueryMemory(VAddr address) const {
311 memory_info.attributes = ToSvcMemoryAttribute(vma->second.attribute); 311 memory_info.attributes = ToSvcMemoryAttribute(vma->second.attribute);
312 memory_info.permission = static_cast<u32>(vma->second.permissions); 312 memory_info.permission = static_cast<u32>(vma->second.permissions);
313 memory_info.size = vma->second.size; 313 memory_info.size = vma->second.size;
314 memory_info.state = ToSvcMemoryState(vma->second.meminfo_state); 314 memory_info.state = ToSvcMemoryState(vma->second.state);
315 } else { 315 } else {
316 memory_info.base_address = address_space_end; 316 memory_info.base_address = address_space_end;
317 memory_info.permission = static_cast<u32>(VMAPermission::None); 317 memory_info.permission = static_cast<u32>(VMAPermission::None);
@@ -365,7 +365,7 @@ void VMManager::LogLayout() const {
365 (u8)vma.permissions & (u8)VMAPermission::Read ? 'R' : '-', 365 (u8)vma.permissions & (u8)VMAPermission::Read ? 'R' : '-',
366 (u8)vma.permissions & (u8)VMAPermission::Write ? 'W' : '-', 366 (u8)vma.permissions & (u8)VMAPermission::Write ? 'W' : '-',
367 (u8)vma.permissions & (u8)VMAPermission::Execute ? 'X' : '-', 367 (u8)vma.permissions & (u8)VMAPermission::Execute ? 'X' : '-',
368 GetMemoryStateName(vma.meminfo_state)); 368 GetMemoryStateName(vma.state));
369 } 369 }
370} 370}
371 371
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 {
263 263
264 VMAType type = VMAType::Free; 264 VMAType type = VMAType::Free;
265 VMAPermission permissions = VMAPermission::None; 265 VMAPermission permissions = VMAPermission::None;
266 /// Tag returned by svcQueryMemory. Not otherwise used. 266 MemoryState state = MemoryState::Unmapped;
267 MemoryState meminfo_state = MemoryState::Unmapped;
268 MemoryAttribute attribute = MemoryAttribute::None; 267 MemoryAttribute attribute = MemoryAttribute::None;
269 268
270 // Settings for type = AllocatedMemoryBlock 269 // Settings for type = AllocatedMemoryBlock