diff options
author | Liam <byteslice@airmail.cc> | 2023-10-05 04:15:10 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-10-05 04:32:27 +0200 |
commit | e797a917a927ee5f5a2400cf9e3742c8bc3ec800 (patch) | |
tree | 3a9d0a52f42f31a51ae95077324687a2a030404d /src/core/hle/kernel/k_page_table.cpp | |
parent | Merge pull request #11657 from liamwhite/new-codespell (diff) | |
download | yuzu-e797a917a927ee5f5a2400cf9e3742c8bc3ec800.tar yuzu-e797a917a927ee5f5a2400cf9e3742c8bc3ec800.tar.gz yuzu-e797a917a927ee5f5a2400cf9e3742c8bc3ec800.tar.bz2 yuzu-e797a917a927ee5f5a2400cf9e3742c8bc3ec800.tar.lz yuzu-e797a917a927ee5f5a2400cf9e3742c8bc3ec800.tar.xz yuzu-e797a917a927ee5f5a2400cf9e3742c8bc3ec800.tar.zst yuzu-e797a917a927ee5f5a2400cf9e3742c8bc3ec800.zip |
Diffstat (limited to 'src/core/hle/kernel/k_page_table.cpp')
-rw-r--r-- | src/core/hle/kernel/k_page_table.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp index 5b51edf30..1fbfbf31f 100644 --- a/src/core/hle/kernel/k_page_table.cpp +++ b/src/core/hle/kernel/k_page_table.cpp @@ -2949,6 +2949,23 @@ Result KPageTable::UnlockForIpcUserBuffer(KProcessAddress address, size_t size) KMemoryAttribute::Locked, nullptr)); } +Result KPageTable::LockForTransferMemory(KPageGroup* out, KProcessAddress address, size_t size, + KMemoryPermission perm) { + R_RETURN(this->LockMemoryAndOpen(out, nullptr, address, size, KMemoryState::FlagCanTransfer, + KMemoryState::FlagCanTransfer, KMemoryPermission::All, + KMemoryPermission::UserReadWrite, KMemoryAttribute::All, + KMemoryAttribute::None, perm, KMemoryAttribute::Locked)); +} + +Result KPageTable::UnlockForTransferMemory(KProcessAddress address, size_t size, + const KPageGroup& pg) { + R_RETURN(this->UnlockMemory(address, size, KMemoryState::FlagCanTransfer, + KMemoryState::FlagCanTransfer, KMemoryPermission::None, + KMemoryPermission::None, KMemoryAttribute::All, + KMemoryAttribute::Locked, KMemoryPermission::UserReadWrite, + KMemoryAttribute::Locked, std::addressof(pg))); +} + Result KPageTable::LockForCodeMemory(KPageGroup* out, KProcessAddress addr, size_t size) { R_RETURN(this->LockMemoryAndOpen( out, nullptr, addr, size, KMemoryState::FlagCanCodeMemory, KMemoryState::FlagCanCodeMemory, |