summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-10-30 01:40:29 +0200
committerbunnei <bunneidev@gmail.com>2022-11-04 05:17:08 +0100
commit119315af08872f9413fa159abdd42c44b5950ccb (patch)
tree1a32361e105aad263369b22a4a2245405cdfe909 /src/core/hle
parentcore: hle: kernel: k_page_table: Implement IPC memory methods. (diff)
downloadyuzu-119315af08872f9413fa159abdd42c44b5950ccb.tar
yuzu-119315af08872f9413fa159abdd42c44b5950ccb.tar.gz
yuzu-119315af08872f9413fa159abdd42c44b5950ccb.tar.bz2
yuzu-119315af08872f9413fa159abdd42c44b5950ccb.tar.lz
yuzu-119315af08872f9413fa159abdd42c44b5950ccb.tar.xz
yuzu-119315af08872f9413fa159abdd42c44b5950ccb.tar.zst
yuzu-119315af08872f9413fa159abdd42c44b5950ccb.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/kernel/k_page_table.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp
index 2635d8148..73d96de42 100644
--- a/src/core/hle/kernel/k_page_table.cpp
+++ b/src/core/hle/kernel/k_page_table.cpp
@@ -947,6 +947,9 @@ Result KPageTable::SetupForIpcServer(VAddr* out_addr, size_t size, VAddr src_add
ON_RESULT_FAILURE {
if (cur_mapped_addr != dst_addr) {
+ // HACK: Manually close the pages.
+ HACK_ClosePages(dst_addr, (cur_mapped_addr - dst_addr) / PageSize);
+
ASSERT(Operate(dst_addr, (cur_mapped_addr - dst_addr) / PageSize,
KMemoryPermission::None, OperationType::Unmap)
.IsSuccess());
@@ -1022,6 +1025,9 @@ Result KPageTable::SetupForIpcServer(VAddr* out_addr, size_t size, VAddr src_add
// Map the page.
R_TRY(Operate(cur_mapped_addr, 1, test_perm, OperationType::Map, start_partial_page));
+ // HACK: Manually open the pages.
+ HACK_OpenPages(start_partial_page, 1);
+
// Update tracking extents.
cur_mapped_addr += PageSize;
cur_block_addr += PageSize;
@@ -1050,6 +1056,9 @@ Result KPageTable::SetupForIpcServer(VAddr* out_addr, size_t size, VAddr src_add
R_TRY(Operate(cur_mapped_addr, cur_block_size / PageSize, test_perm, OperationType::Map,
cur_block_addr));
+ // HACK: Manually open the pages.
+ HACK_OpenPages(cur_block_addr, cur_block_size / PageSize);
+
// Update tracking extents.
cur_mapped_addr += cur_block_size;
cur_block_addr = next_entry.phys_addr;
@@ -1069,6 +1078,9 @@ Result KPageTable::SetupForIpcServer(VAddr* out_addr, size_t size, VAddr src_add
R_TRY(Operate(cur_mapped_addr, last_block_size / PageSize, test_perm, OperationType::Map,
cur_block_addr));
+ // HACK: Manually open the pages.
+ HACK_OpenPages(cur_block_addr, last_block_size / PageSize);
+
// Update tracking extents.
cur_mapped_addr += last_block_size;
cur_block_addr += last_block_size;
@@ -1100,6 +1112,9 @@ Result KPageTable::SetupForIpcServer(VAddr* out_addr, size_t size, VAddr src_add
// Map the page.
R_TRY(Operate(cur_mapped_addr, 1, test_perm, OperationType::Map, end_partial_page));
+
+ // HACK: Manually open the pages.
+ HACK_OpenPages(end_partial_page, 1);
}
// Update memory blocks to reflect our changes
@@ -1202,6 +1217,9 @@ Result KPageTable::CleanupForIpcServer(VAddr address, size_t size, KMemoryState
const size_t aligned_size = aligned_end - aligned_start;
const size_t aligned_num_pages = aligned_size / PageSize;
+ // HACK: Manually close the pages.
+ HACK_ClosePages(aligned_start, aligned_num_pages);
+
// Unmap the pages.
R_TRY(Operate(aligned_start, aligned_num_pages, KMemoryPermission::None, OperationType::Unmap));