summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/ldr
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-01-09 08:07:07 +0100
committerbunnei <bunneidev@gmail.com>2022-01-12 01:28:11 +0100
commit081669c3349812eb308be03107541377ac2dbc11 (patch)
treeab022caa12d1989872a2f43ebcb45f9fe1081135 /src/core/hle/service/ldr
parentMerge pull request #7684 from bunnei/set-mem-perm-attr (diff)
downloadyuzu-081669c3349812eb308be03107541377ac2dbc11.tar
yuzu-081669c3349812eb308be03107541377ac2dbc11.tar.gz
yuzu-081669c3349812eb308be03107541377ac2dbc11.tar.bz2
yuzu-081669c3349812eb308be03107541377ac2dbc11.tar.lz
yuzu-081669c3349812eb308be03107541377ac2dbc11.tar.xz
yuzu-081669c3349812eb308be03107541377ac2dbc11.tar.zst
yuzu-081669c3349812eb308be03107541377ac2dbc11.zip
Diffstat (limited to 'src/core/hle/service/ldr')
-rw-r--r--src/core/hle/service/ldr/ldr.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp
index 3782703d2..f16dbc595 100644
--- a/src/core/hle/service/ldr/ldr.cpp
+++ b/src/core/hle/service/ldr/ldr.cpp
@@ -325,7 +325,7 @@ public:
for (std::size_t retry = 0; retry < MAXIMUM_MAP_RETRIES; retry++) {
auto& page_table{process->PageTable()};
const VAddr addr{GetRandomMapRegion(page_table, size)};
- const ResultCode result{page_table.MapProcessCodeMemory(addr, baseAddress, size)};
+ const ResultCode result{page_table.MapCodeMemory(addr, baseAddress, size)};
if (result == Kernel::ResultInvalidCurrentMemory) {
continue;
@@ -351,12 +351,12 @@ public:
if (bss_size) {
auto block_guard = detail::ScopeExit([&] {
- page_table.UnmapProcessCodeMemory(addr + nro_size, bss_addr, bss_size);
- page_table.UnmapProcessCodeMemory(addr, nro_addr, nro_size);
+ page_table.UnmapCodeMemory(addr + nro_size, bss_addr, bss_size);
+ page_table.UnmapCodeMemory(addr, nro_addr, nro_size);
});
const ResultCode result{
- page_table.MapProcessCodeMemory(addr + nro_size, bss_addr, bss_size)};
+ page_table.MapCodeMemory(addr + nro_size, bss_addr, bss_size)};
if (result == Kernel::ResultInvalidCurrentMemory) {
continue;
@@ -530,16 +530,15 @@ public:
ResultCode UnmapNro(const NROInfo& info) {
// Each region must be unmapped separately to validate memory state
auto& page_table{system.CurrentProcess()->PageTable()};
- CASCADE_CODE(page_table.UnmapProcessCodeMemory(info.nro_address + info.text_size +
- info.ro_size + info.data_size,
- info.bss_address, info.bss_size));
- CASCADE_CODE(page_table.UnmapProcessCodeMemory(
- info.nro_address + info.text_size + info.ro_size,
- info.src_addr + info.text_size + info.ro_size, info.data_size));
- CASCADE_CODE(page_table.UnmapProcessCodeMemory(
- info.nro_address + info.text_size, info.src_addr + info.text_size, info.ro_size));
- CASCADE_CODE(
- page_table.UnmapProcessCodeMemory(info.nro_address, info.src_addr, info.text_size));
+ CASCADE_CODE(page_table.UnmapCodeMemory(info.nro_address + info.text_size + info.ro_size +
+ info.data_size,
+ info.bss_address, info.bss_size));
+ CASCADE_CODE(page_table.UnmapCodeMemory(info.nro_address + info.text_size + info.ro_size,
+ info.src_addr + info.text_size + info.ro_size,
+ info.data_size));
+ CASCADE_CODE(page_table.UnmapCodeMemory(info.nro_address + info.text_size,
+ info.src_addr + info.text_size, info.ro_size));
+ CASCADE_CODE(page_table.UnmapCodeMemory(info.nro_address, info.src_addr, info.text_size));
return ResultSuccess;
}