summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_page_table.cpp
diff options
context:
space:
mode:
authorFernando S <fsahmkow27@gmail.com>2023-10-10 11:45:56 +0200
committerGitHub <noreply@github.com>2023-10-10 11:45:56 +0200
commit8ac8d703b9af7ebe858cb8957d42eb42c5ffdf75 (patch)
tree55fbc13601b432c459ed07ae60eb308f284d94cc /src/core/hle/kernel/k_page_table.cpp
parentMerge pull request #11716 from Squall-Leonhart/Z327444 (diff)
parentkernel: implement transfer memory (diff)
downloadyuzu-8ac8d703b9af7ebe858cb8957d42eb42c5ffdf75.tar
yuzu-8ac8d703b9af7ebe858cb8957d42eb42c5ffdf75.tar.gz
yuzu-8ac8d703b9af7ebe858cb8957d42eb42c5ffdf75.tar.bz2
yuzu-8ac8d703b9af7ebe858cb8957d42eb42c5ffdf75.tar.lz
yuzu-8ac8d703b9af7ebe858cb8957d42eb42c5ffdf75.tar.xz
yuzu-8ac8d703b9af7ebe858cb8957d42eb42c5ffdf75.tar.zst
yuzu-8ac8d703b9af7ebe858cb8957d42eb42c5ffdf75.zip
Diffstat (limited to 'src/core/hle/kernel/k_page_table.cpp')
-rw-r--r--src/core/hle/kernel/k_page_table.cpp17
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,