diff options
| author | 2023-07-14 21:43:15 -0400 | |
|---|---|---|
| committer | 2023-07-14 21:43:15 -0400 | |
| commit | a85ce8ea563dfdd0ea61b22a80ffcf7ff66861cb (patch) | |
| tree | 40f818c29a9e19dbc2c7aeb352d7892c59d7e858 /src/core/hle/service | |
| parent | file_sys/content_archive: Detect compressed NCAs (#11047) (diff) | |
| download | yuzu-a85ce8ea563dfdd0ea61b22a80ffcf7ff66861cb.tar.gz yuzu-a85ce8ea563dfdd0ea61b22a80ffcf7ff66861cb.tar.xz yuzu-a85ce8ea563dfdd0ea61b22a80ffcf7ff66861cb.zip | |
k_process: PageTable -> GetPageTable
Diffstat (limited to 'src/core/hle/service')
| -rw-r--r-- | src/core/hle/service/ldr/ldr.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvmap.cpp | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index c42489ff9..3d34917e8 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp | |||
| @@ -358,7 +358,7 @@ public: | |||
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | ResultVal<VAddr> MapProcessCodeMemory(Kernel::KProcess* process, VAddr base_addr, u64 size) { | 360 | ResultVal<VAddr> MapProcessCodeMemory(Kernel::KProcess* process, VAddr base_addr, u64 size) { |
| 361 | auto& page_table{process->PageTable()}; | 361 | auto& page_table{process->GetPageTable()}; |
| 362 | VAddr addr{}; | 362 | VAddr addr{}; |
| 363 | 363 | ||
| 364 | for (std::size_t retry = 0; retry < MAXIMUM_MAP_RETRIES; retry++) { | 364 | for (std::size_t retry = 0; retry < MAXIMUM_MAP_RETRIES; retry++) { |
| @@ -382,7 +382,7 @@ public: | |||
| 382 | ResultVal<VAddr> MapNro(Kernel::KProcess* process, VAddr nro_addr, std::size_t nro_size, | 382 | ResultVal<VAddr> MapNro(Kernel::KProcess* process, VAddr nro_addr, std::size_t nro_size, |
| 383 | VAddr bss_addr, std::size_t bss_size, std::size_t size) { | 383 | VAddr bss_addr, std::size_t bss_size, std::size_t size) { |
| 384 | for (std::size_t retry = 0; retry < MAXIMUM_MAP_RETRIES; retry++) { | 384 | for (std::size_t retry = 0; retry < MAXIMUM_MAP_RETRIES; retry++) { |
| 385 | auto& page_table{process->PageTable()}; | 385 | auto& page_table{process->GetPageTable()}; |
| 386 | VAddr addr{}; | 386 | VAddr addr{}; |
| 387 | 387 | ||
| 388 | CASCADE_RESULT(addr, MapProcessCodeMemory(process, nro_addr, nro_size)); | 388 | CASCADE_RESULT(addr, MapProcessCodeMemory(process, nro_addr, nro_size)); |
| @@ -437,12 +437,12 @@ public: | |||
| 437 | CopyCode(nro_addr + nro_header.segment_headers[DATA_INDEX].memory_offset, data_start, | 437 | CopyCode(nro_addr + nro_header.segment_headers[DATA_INDEX].memory_offset, data_start, |
| 438 | nro_header.segment_headers[DATA_INDEX].memory_size); | 438 | nro_header.segment_headers[DATA_INDEX].memory_size); |
| 439 | 439 | ||
| 440 | CASCADE_CODE(process->PageTable().SetProcessMemoryPermission( | 440 | CASCADE_CODE(process->GetPageTable().SetProcessMemoryPermission( |
| 441 | text_start, ro_start - text_start, Kernel::Svc::MemoryPermission::ReadExecute)); | 441 | text_start, ro_start - text_start, Kernel::Svc::MemoryPermission::ReadExecute)); |
| 442 | CASCADE_CODE(process->PageTable().SetProcessMemoryPermission( | 442 | CASCADE_CODE(process->GetPageTable().SetProcessMemoryPermission( |
| 443 | ro_start, data_start - ro_start, Kernel::Svc::MemoryPermission::Read)); | 443 | ro_start, data_start - ro_start, Kernel::Svc::MemoryPermission::Read)); |
| 444 | 444 | ||
| 445 | return process->PageTable().SetProcessMemoryPermission( | 445 | return process->GetPageTable().SetProcessMemoryPermission( |
| 446 | data_start, bss_end_addr - data_start, Kernel::Svc::MemoryPermission::ReadWrite); | 446 | data_start, bss_end_addr - data_start, Kernel::Svc::MemoryPermission::ReadWrite); |
| 447 | } | 447 | } |
| 448 | 448 | ||
| @@ -571,7 +571,7 @@ public: | |||
| 571 | 571 | ||
| 572 | Result UnmapNro(const NROInfo& info) { | 572 | Result UnmapNro(const NROInfo& info) { |
| 573 | // Each region must be unmapped separately to validate memory state | 573 | // Each region must be unmapped separately to validate memory state |
| 574 | auto& page_table{system.ApplicationProcess()->PageTable()}; | 574 | auto& page_table{system.ApplicationProcess()->GetPageTable()}; |
| 575 | 575 | ||
| 576 | if (info.bss_size != 0) { | 576 | if (info.bss_size != 0) { |
| 577 | CASCADE_CODE(page_table.UnmapCodeMemory( | 577 | CASCADE_CODE(page_table.UnmapCodeMemory( |
| @@ -643,7 +643,7 @@ public: | |||
| 643 | 643 | ||
| 644 | initialized = true; | 644 | initialized = true; |
| 645 | current_map_addr = | 645 | current_map_addr = |
| 646 | GetInteger(system.ApplicationProcess()->PageTable().GetAliasCodeRegionStart()); | 646 | GetInteger(system.ApplicationProcess()->GetPageTable().GetAliasCodeRegionStart()); |
| 647 | 647 | ||
| 648 | IPC::ResponseBuilder rb{ctx, 2}; | 648 | IPC::ResponseBuilder rb{ctx, 2}; |
| 649 | rb.Push(ResultSuccess); | 649 | 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) { | |||
| 128 | } | 128 | } |
| 129 | bool is_out_io{}; | 129 | bool is_out_io{}; |
| 130 | ASSERT(system.ApplicationProcess() | 130 | ASSERT(system.ApplicationProcess() |
| 131 | ->PageTable() | 131 | ->GetPageTable() |
| 132 | .LockForMapDeviceAddressSpace(&is_out_io, handle_description->address, | 132 | .LockForMapDeviceAddressSpace(&is_out_io, handle_description->address, |
| 133 | handle_description->size, | 133 | handle_description->size, |
| 134 | Kernel::KMemoryPermission::None, true, false) | 134 | Kernel::KMemoryPermission::None, true, false) |
| @@ -255,7 +255,7 @@ NvResult nvmap::IocFree(std::span<const u8> input, std::span<u8> output) { | |||
| 255 | if (auto freeInfo{file.FreeHandle(params.handle, false)}) { | 255 | if (auto freeInfo{file.FreeHandle(params.handle, false)}) { |
| 256 | if (freeInfo->can_unlock) { | 256 | if (freeInfo->can_unlock) { |
| 257 | ASSERT(system.ApplicationProcess() | 257 | ASSERT(system.ApplicationProcess() |
| 258 | ->PageTable() | 258 | ->GetPageTable() |
| 259 | .UnlockForDeviceAddressSpace(freeInfo->address, freeInfo->size) | 259 | .UnlockForDeviceAddressSpace(freeInfo->address, freeInfo->size) |
| 260 | .IsSuccess()); | 260 | .IsSuccess()); |
| 261 | } | 261 | } |