summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-07-22 17:17:36 +0200
committerGitHub <noreply@github.com>2023-07-22 17:17:36 +0200
commitb1aed2c5b79dc8c3ba858e21308312a5dc10dd2f (patch)
tree14f41563aac7e5513bad341805afb164f1bf2f4f /src/core/hle/service
parentMerge pull request #11098 from GPUCode/texel-buffers (diff)
parentkernel: reduce page table region checking (diff)
downloadyuzu-b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f.tar
yuzu-b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f.tar.gz
yuzu-b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f.tar.bz2
yuzu-b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f.tar.lz
yuzu-b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f.tar.xz
yuzu-b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f.tar.zst
yuzu-b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/ldr/ldr.cpp20
-rw-r--r--src/core/hle/service/nvdrv/devices/nvmap.cpp4
2 files changed, 12 insertions, 12 deletions
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp
index c42489ff9..055c0a2db 100644
--- a/src/core/hle/service/ldr/ldr.cpp
+++ b/src/core/hle/service/ldr/ldr.cpp
@@ -318,15 +318,15 @@ public:
return false;
}
- if (!page_table.IsInsideAddressSpace(out_addr, size)) {
+ if (!page_table.Contains(out_addr, size)) {
return false;
}
- if (page_table.IsInsideHeapRegion(out_addr, size)) {
+ if (page_table.IsInHeapRegion(out_addr, size)) {
return false;
}
- if (page_table.IsInsideAliasRegion(out_addr, size)) {
+ if (page_table.IsInAliasRegion(out_addr, size)) {
return false;
}
@@ -358,7 +358,7 @@ public:
}
ResultVal<VAddr> MapProcessCodeMemory(Kernel::KProcess* process, VAddr base_addr, u64 size) {
- auto& page_table{process->PageTable()};
+ auto& page_table{process->GetPageTable()};
VAddr addr{};
for (std::size_t retry = 0; retry < MAXIMUM_MAP_RETRIES; retry++) {
@@ -382,7 +382,7 @@ public:
ResultVal<VAddr> MapNro(Kernel::KProcess* process, VAddr nro_addr, std::size_t nro_size,
VAddr bss_addr, std::size_t bss_size, std::size_t size) {
for (std::size_t retry = 0; retry < MAXIMUM_MAP_RETRIES; retry++) {
- auto& page_table{process->PageTable()};
+ auto& page_table{process->GetPageTable()};
VAddr addr{};
CASCADE_RESULT(addr, MapProcessCodeMemory(process, nro_addr, nro_size));
@@ -437,12 +437,12 @@ public:
CopyCode(nro_addr + nro_header.segment_headers[DATA_INDEX].memory_offset, data_start,
nro_header.segment_headers[DATA_INDEX].memory_size);
- CASCADE_CODE(process->PageTable().SetProcessMemoryPermission(
+ CASCADE_CODE(process->GetPageTable().SetProcessMemoryPermission(
text_start, ro_start - text_start, Kernel::Svc::MemoryPermission::ReadExecute));
- CASCADE_CODE(process->PageTable().SetProcessMemoryPermission(
+ CASCADE_CODE(process->GetPageTable().SetProcessMemoryPermission(
ro_start, data_start - ro_start, Kernel::Svc::MemoryPermission::Read));
- return process->PageTable().SetProcessMemoryPermission(
+ return process->GetPageTable().SetProcessMemoryPermission(
data_start, bss_end_addr - data_start, Kernel::Svc::MemoryPermission::ReadWrite);
}
@@ -571,7 +571,7 @@ public:
Result UnmapNro(const NROInfo& info) {
// Each region must be unmapped separately to validate memory state
- auto& page_table{system.ApplicationProcess()->PageTable()};
+ auto& page_table{system.ApplicationProcess()->GetPageTable()};
if (info.bss_size != 0) {
CASCADE_CODE(page_table.UnmapCodeMemory(
@@ -643,7 +643,7 @@ public:
initialized = true;
current_map_addr =
- GetInteger(system.ApplicationProcess()->PageTable().GetAliasCodeRegionStart());
+ GetInteger(system.ApplicationProcess()->GetPageTable().GetAliasCodeRegionStart());
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
diff --git a/src/core/hle/service/nvdrv/devices/nvmap.cpp b/src/core/hle/service/nvdrv/devices/nvmap.cpp
index e7f7e273b..968eaa175 100644
--- a/src/core/hle/service/nvdrv/devices/nvmap.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvmap.cpp
@@ -128,7 +128,7 @@ NvResult nvmap::IocAlloc(std::span<const u8> input, std::span<u8> output) {
}
bool is_out_io{};
ASSERT(system.ApplicationProcess()
- ->PageTable()
+ ->GetPageTable()
.LockForMapDeviceAddressSpace(&is_out_io, handle_description->address,
handle_description->size,
Kernel::KMemoryPermission::None, true, false)
@@ -255,7 +255,7 @@ NvResult nvmap::IocFree(std::span<const u8> input, std::span<u8> output) {
if (auto freeInfo{file.FreeHandle(params.handle, false)}) {
if (freeInfo->can_unlock) {
ASSERT(system.ApplicationProcess()
- ->PageTable()
+ ->GetPageTable()
.UnlockForDeviceAddressSpace(freeInfo->address, freeInfo->size)
.IsSuccess());
}