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 | 97d79bf8a63bfd5d892d997d40b145e5202d5a7f (patch) | |
| tree | 3a9d0a52f42f31a51ae95077324687a2a030404d /src/core/hle/kernel/k_page_table.cpp | |
| parent | 226b461d767609787e1113e2ba65170aee12d28e (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 5b51edf30b..1fbfbf31f3 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, |
