diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-10 05:15:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-10 05:15:00 +0200 |
commit | ec50a9b5b9882940a2e107889d3d909b57603626 (patch) | |
tree | 884bc2b18f440ec3058ac546718d315bf1970ad3 /src/core/hle/kernel/k_memory_block_manager.cpp | |
parent | Merge pull request #6294 from german77/kernelCleanup (diff) | |
parent | kernel: Eliminate variable shadowing (diff) | |
download | yuzu-ec50a9b5b9882940a2e107889d3d909b57603626.tar yuzu-ec50a9b5b9882940a2e107889d3d909b57603626.tar.gz yuzu-ec50a9b5b9882940a2e107889d3d909b57603626.tar.bz2 yuzu-ec50a9b5b9882940a2e107889d3d909b57603626.tar.lz yuzu-ec50a9b5b9882940a2e107889d3d909b57603626.tar.xz yuzu-ec50a9b5b9882940a2e107889d3d909b57603626.tar.zst yuzu-ec50a9b5b9882940a2e107889d3d909b57603626.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_memory_block_manager.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/core/hle/kernel/k_memory_block_manager.cpp b/src/core/hle/kernel/k_memory_block_manager.cpp index 4a2d88008..44bfeb0d5 100644 --- a/src/core/hle/kernel/k_memory_block_manager.cpp +++ b/src/core/hle/kernel/k_memory_block_manager.cpp @@ -17,8 +17,8 @@ KMemoryBlockManager::KMemoryBlockManager(VAddr start_addr, VAddr end_addr) KMemoryBlockManager::iterator KMemoryBlockManager::FindIterator(VAddr addr) { auto node{memory_block_tree.begin()}; while (node != end()) { - const VAddr end_addr{node->GetNumPages() * PageSize + node->GetAddress()}; - if (node->GetAddress() <= addr && end_addr - 1 >= addr) { + const VAddr node_end_addr{node->GetNumPages() * PageSize + node->GetAddress()}; + if (node->GetAddress() <= addr && node_end_addr - 1 >= addr) { return node; } node = std::next(node); @@ -67,7 +67,7 @@ void KMemoryBlockManager::Update(VAddr addr, std::size_t num_pages, KMemoryState KMemoryPermission prev_perm, KMemoryAttribute prev_attribute, KMemoryState state, KMemoryPermission perm, KMemoryAttribute attribute) { - const VAddr end_addr{addr + num_pages * PageSize}; + const VAddr update_end_addr{addr + num_pages * PageSize}; iterator node{memory_block_tree.begin()}; prev_attribute |= KMemoryAttribute::IpcAndDeviceMapped; @@ -78,7 +78,7 @@ void KMemoryBlockManager::Update(VAddr addr, std::size_t num_pages, KMemoryState const VAddr cur_addr{block->GetAddress()}; const VAddr cur_end_addr{block->GetNumPages() * PageSize + cur_addr}; - if (addr < cur_end_addr && cur_addr < end_addr) { + if (addr < cur_end_addr && cur_addr < update_end_addr) { if (!block->HasProperties(prev_state, prev_perm, prev_attribute)) { node = next_node; continue; @@ -89,8 +89,8 @@ void KMemoryBlockManager::Update(VAddr addr, std::size_t num_pages, KMemoryState memory_block_tree.insert(node, block->Split(addr)); } - if (end_addr < cur_end_addr) { - new_node = memory_block_tree.insert(node, block->Split(end_addr)); + if (update_end_addr < cur_end_addr) { + new_node = memory_block_tree.insert(node, block->Split(update_end_addr)); } new_node->Update(state, perm, attribute); @@ -98,7 +98,7 @@ void KMemoryBlockManager::Update(VAddr addr, std::size_t num_pages, KMemoryState MergeAdjacent(new_node, next_node); } - if (cur_end_addr - 1 >= end_addr - 1) { + if (cur_end_addr - 1 >= update_end_addr - 1) { break; } @@ -108,7 +108,7 @@ void KMemoryBlockManager::Update(VAddr addr, std::size_t num_pages, KMemoryState void KMemoryBlockManager::Update(VAddr addr, std::size_t num_pages, KMemoryState state, KMemoryPermission perm, KMemoryAttribute attribute) { - const VAddr end_addr{addr + num_pages * PageSize}; + const VAddr update_end_addr{addr + num_pages * PageSize}; iterator node{memory_block_tree.begin()}; while (node != memory_block_tree.end()) { @@ -117,15 +117,15 @@ void KMemoryBlockManager::Update(VAddr addr, std::size_t num_pages, KMemoryState const VAddr cur_addr{block->GetAddress()}; const VAddr cur_end_addr{block->GetNumPages() * PageSize + cur_addr}; - if (addr < cur_end_addr && cur_addr < end_addr) { + if (addr < cur_end_addr && cur_addr < update_end_addr) { iterator new_node{node}; if (addr > cur_addr) { memory_block_tree.insert(node, block->Split(addr)); } - if (end_addr < cur_end_addr) { - new_node = memory_block_tree.insert(node, block->Split(end_addr)); + if (update_end_addr < cur_end_addr) { + new_node = memory_block_tree.insert(node, block->Split(update_end_addr)); } new_node->Update(state, perm, attribute); @@ -133,7 +133,7 @@ void KMemoryBlockManager::Update(VAddr addr, std::size_t num_pages, KMemoryState MergeAdjacent(new_node, next_node); } - if (cur_end_addr - 1 >= end_addr - 1) { + if (cur_end_addr - 1 >= update_end_addr - 1) { break; } @@ -143,7 +143,7 @@ void KMemoryBlockManager::Update(VAddr addr, std::size_t num_pages, KMemoryState void KMemoryBlockManager::UpdateLock(VAddr addr, std::size_t num_pages, LockFunc&& lock_func, KMemoryPermission perm) { - const VAddr end_addr{addr + num_pages * PageSize}; + const VAddr update_end_addr{addr + num_pages * PageSize}; iterator node{memory_block_tree.begin()}; while (node != memory_block_tree.end()) { @@ -152,15 +152,15 @@ void KMemoryBlockManager::UpdateLock(VAddr addr, std::size_t num_pages, LockFunc const VAddr cur_addr{block->GetAddress()}; const VAddr cur_end_addr{block->GetNumPages() * PageSize + cur_addr}; - if (addr < cur_end_addr && cur_addr < end_addr) { + if (addr < cur_end_addr && cur_addr < update_end_addr) { iterator new_node{node}; if (addr > cur_addr) { memory_block_tree.insert(node, block->Split(addr)); } - if (end_addr < cur_end_addr) { - new_node = memory_block_tree.insert(node, block->Split(end_addr)); + if (update_end_addr < cur_end_addr) { + new_node = memory_block_tree.insert(node, block->Split(update_end_addr)); } lock_func(new_node, perm); @@ -168,7 +168,7 @@ void KMemoryBlockManager::UpdateLock(VAddr addr, std::size_t num_pages, LockFunc MergeAdjacent(new_node, next_node); } - if (cur_end_addr - 1 >= end_addr - 1) { + if (cur_end_addr - 1 >= update_end_addr - 1) { break; } |