diff options
author | bunnei <bunneidev@gmail.com> | 2022-02-19 09:14:27 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2022-02-19 09:14:27 +0100 |
commit | 92b2e92620a04af6d1ce2d35f55905b3a8b805fc (patch) | |
tree | c152795267b26a09564860d3369beaa857c9ca1c /src/core/hle | |
parent | core: hle: kernel: KPageTable: Improve Un/MapPhysicalMemory. (diff) | |
download | yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar.gz yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar.bz2 yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar.lz yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar.xz yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar.zst yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/kernel/k_page_table.cpp | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp index 28cea9ab3..cbb0fedde 100644 --- a/src/core/hle/kernel/k_page_table.cpp +++ b/src/core/hle/kernel/k_page_table.cpp @@ -41,24 +41,6 @@ constexpr std::size_t GetAddressSpaceWidthFromType(FileSys::ProgramAddressSpaceT } } -constexpr u64 GetAddressInRange(const KMemoryInfo& info, VAddr addr) { - if (info.GetAddress() < addr) { - return addr; - } - return info.GetAddress(); -} - -constexpr std::size_t GetSizeInRange(const KMemoryInfo& info, VAddr start, VAddr end) { - std::size_t size{info.GetSize()}; - if (info.GetAddress() < start) { - size -= start - info.GetAddress(); - } - if (info.GetEndAddress() > end) { - size -= info.GetEndAddress() - end; - } - return size; -} - } // namespace KPageTable::KPageTable(Core::System& system_) @@ -724,8 +706,7 @@ ResultCode KPageTable::UnmapPhysicalMemory(VAddr address, std::size_t size) { size_t tot_size = 0; cur_address = address; - next_valid = - impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), cur_address); + next_valid = impl.BeginTraversal(next_entry, context, cur_address); next_entry.block_size = (next_entry.block_size - (next_entry.phys_addr & (next_entry.block_size - 1))); @@ -751,8 +732,7 @@ ResultCode KPageTable::UnmapPhysicalMemory(VAddr address, std::size_t size) { break; } - next_valid = - impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); + next_valid = impl.ContinueTraversal(next_entry, context); } // Add the last block. |