diff options
| author | Liam <byteslice@airmail.cc> | 2023-10-04 22:15:10 -0400 |
|---|---|---|
| committer | Liam <byteslice@airmail.cc> | 2023-10-04 22:32:27 -0400 |
| commit | e797a917a927ee5f5a2400cf9e3742c8bc3ec800 (patch) | |
| tree | 3a9d0a52f42f31a51ae95077324687a2a030404d /src/core/hle/kernel/k_page_table.cpp | |
| parent | 7a0da729b45ae2794e84af6808c50cb714d17fc5 (diff) | |
kernel: implement transfer memory
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, |
