summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorMai M <mathew1800@gmail.com>2022-01-14 06:41:17 +0100
committerGitHub <noreply@github.com>2022-01-14 06:41:17 +0100
commit07e477f891c015b76cadb4421feabd78852a715b (patch)
tree35dbd81c5bcce0c85132531e9e21fd874b07e297 /src/core/hle/kernel/svc.cpp
parentMerge pull request #7690 from Morph1984/increase-file-limit-win (diff)
parenthle: kernel: k_page_table: Update SetProcessMemoryPermission. (diff)
downloadyuzu-07e477f891c015b76cadb4421feabd78852a715b.tar
yuzu-07e477f891c015b76cadb4421feabd78852a715b.tar.gz
yuzu-07e477f891c015b76cadb4421feabd78852a715b.tar.bz2
yuzu-07e477f891c015b76cadb4421feabd78852a715b.tar.lz
yuzu-07e477f891c015b76cadb4421feabd78852a715b.tar.xz
yuzu-07e477f891c015b76cadb4421feabd78852a715b.tar.zst
yuzu-07e477f891c015b76cadb4421feabd78852a715b.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/svc.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 4362508a3..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
R_UNLESS(Common::IsAligned(size, PageSize), ResultInvalidSize);
R_UNLESS(size > 0, ResultInvalidSize);
R_UNLESS((address < address + size), ResultInvalidCurrentMemory);
+ R_UNLESS(address == static_cast<uintptr_t>(address), ResultInvalidCurrentMemory);
+ R_UNLESS(size == static_cast<size_t>(size), ResultInvalidCurrentMemory);
// Validate the memory permission.
R_UNLESS(IsValidProcessMemoryPermission(perm), ResultInvalidNewMemoryPermission);
@@ -1323,7 +1325,7 @@ static ResultCode SetProcessMemoryPermission(Core::System& system, Handle proces
R_UNLESS(page_table.Contains(address, size), ResultInvalidCurrentMemory);
// Set the memory permission.
- return page_table.SetProcessMemoryPermission(address, size, ConvertToKMemoryPermission(perm));
+ return page_table.SetProcessMemoryPermission(address, size, perm);
}
static ResultCode MapProcessMemory(Core::System& system, VAddr dst_address, Handle process_handle,
@@ -1626,7 +1628,7 @@ static ResultCode MapProcessCodeMemory(Core::System& system, Handle process_hand
return ResultInvalidMemoryRegion;
}
- return page_table.MapProcessCodeMemory(dst_address, src_address, size);
+ return page_table.MapCodeMemory(dst_address, src_address, size);
}
static ResultCode UnmapProcessCodeMemory(Core::System& system, Handle process_handle,
@@ -1694,7 +1696,7 @@ static ResultCode UnmapProcessCodeMemory(Core::System& system, Handle process_ha
return ResultInvalidMemoryRegion;
}
- return page_table.UnmapProcessCodeMemory(dst_address, src_address, size);
+ return page_table.UnmapCodeMemory(dst_address, src_address, size);
}
/// Exits the current process