summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2022-01-09 02:17:17 -0800
committerGravatar bunnei2022-01-11 16:28:11 -0800
commit49a0e4330ee37bdfa503918f841ab9599ccc1c24 (patch)
treee38e9dc90acbbf4fa8d64ea8c30736a86f32b37b /src/core/hle/kernel/svc.cpp
parenthle: service: ldr: UnmapCodeMemory BSS only when set. (diff)
downloadyuzu-49a0e4330ee37bdfa503918f841ab9599ccc1c24.tar.gz
yuzu-49a0e4330ee37bdfa503918f841ab9599ccc1c24.tar.xz
yuzu-49a0e4330ee37bdfa503918f841ab9599ccc1c24.zip
hle: kernel: k_page_table: Update SetProcessMemoryPermission.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 55ce0236f..c7f5140f4 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -1309,6 +1309,8 @@ static ResultCode SetProcessMemoryPermission(Core::System& system, Handle proces
1309 R_UNLESS(Common::IsAligned(size, PageSize), ResultInvalidSize); 1309 R_UNLESS(Common::IsAligned(size, PageSize), ResultInvalidSize);
1310 R_UNLESS(size > 0, ResultInvalidSize); 1310 R_UNLESS(size > 0, ResultInvalidSize);
1311 R_UNLESS((address < address + size), ResultInvalidCurrentMemory); 1311 R_UNLESS((address < address + size), ResultInvalidCurrentMemory);
1312 R_UNLESS(address == static_cast<uintptr_t>(address), ResultInvalidCurrentMemory);
1313 R_UNLESS(size == static_cast<size_t>(size), ResultInvalidCurrentMemory);
1312 1314
1313 // Validate the memory permission. 1315 // Validate the memory permission.
1314 R_UNLESS(IsValidProcessMemoryPermission(perm), ResultInvalidNewMemoryPermission); 1316 R_UNLESS(IsValidProcessMemoryPermission(perm), ResultInvalidNewMemoryPermission);
@@ -1323,7 +1325,7 @@ static ResultCode SetProcessMemoryPermission(Core::System& system, Handle proces
1323 R_UNLESS(page_table.Contains(address, size), ResultInvalidCurrentMemory); 1325 R_UNLESS(page_table.Contains(address, size), ResultInvalidCurrentMemory);
1324 1326
1325 // Set the memory permission. 1327 // Set the memory permission.
1326 return page_table.SetProcessMemoryPermission(address, size, ConvertToKMemoryPermission(perm)); 1328 return page_table.SetProcessMemoryPermission(address, size, perm);
1327} 1329}
1328 1330
1329static ResultCode MapProcessMemory(Core::System& system, VAddr dst_address, Handle process_handle, 1331static ResultCode MapProcessMemory(Core::System& system, VAddr dst_address, Handle process_handle,