diff options
author | Liam <byteslice@airmail.cc> | 2023-10-02 05:38:56 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-10-02 05:38:56 +0200 |
commit | 8fb13372c2b22876e9f8dca1a3c72e8584a471dd (patch) | |
tree | dcb14e4cdbb0ef76bdeb469d35bc88c2bcc8104e /src/core | |
parent | Merge pull request #11642 from zhaobot/tx-update-20231001021119 (diff) | |
download | yuzu-8fb13372c2b22876e9f8dca1a3c72e8584a471dd.tar yuzu-8fb13372c2b22876e9f8dca1a3c72e8584a471dd.tar.gz yuzu-8fb13372c2b22876e9f8dca1a3c72e8584a471dd.tar.bz2 yuzu-8fb13372c2b22876e9f8dca1a3c72e8584a471dd.tar.lz yuzu-8fb13372c2b22876e9f8dca1a3c72e8584a471dd.tar.xz yuzu-8fb13372c2b22876e9f8dca1a3c72e8584a471dd.tar.zst yuzu-8fb13372c2b22876e9f8dca1a3c72e8584a471dd.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/kernel/k_page_table.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp index 9bfc85b34..5b51edf30 100644 --- a/src/core/hle/kernel/k_page_table.cpp +++ b/src/core/hle/kernel/k_page_table.cpp @@ -5,6 +5,7 @@ #include "common/assert.h" #include "common/literals.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "core/core.h" #include "core/hle/kernel/k_address_space_info.h" #include "core/hle/kernel/k_memory_block.h" @@ -337,11 +338,14 @@ Result KPageTable::InitializeForProcess(FileSys::ProgramAddressSpaceType as_type } void KPageTable::Finalize() { + auto HostUnmapCallback = [&](KProcessAddress addr, u64 size) { + if (Settings::IsFastmemEnabled()) { + m_system.DeviceMemory().buffer.Unmap(GetInteger(addr), size); + } + }; + // Finalize memory blocks. - m_memory_block_manager.Finalize(m_memory_block_slab_manager, - [&](KProcessAddress addr, u64 size) { - m_memory->UnmapRegion(*m_page_table_impl, addr, size); - }); + m_memory_block_manager.Finalize(m_memory_block_slab_manager, std::move(HostUnmapCallback)); // Release any insecure mapped memory. if (m_mapped_insecure_memory) { |