diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-07-22 17:17:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-22 17:17:36 +0200 |
commit | b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f (patch) | |
tree | 14f41563aac7e5513bad341805afb164f1bf2f4f /src/core/hle/kernel/svc/svc_physical_memory.cpp | |
parent | Merge pull request #11098 from GPUCode/texel-buffers (diff) | |
parent | kernel: reduce page table region checking (diff) | |
download | yuzu-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/kernel/svc/svc_physical_memory.cpp')
-rw-r--r-- | src/core/hle/kernel/svc/svc_physical_memory.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/hle/kernel/svc/svc_physical_memory.cpp b/src/core/hle/kernel/svc/svc_physical_memory.cpp index c2fbfb59a..d3545f232 100644 --- a/src/core/hle/kernel/svc/svc_physical_memory.cpp +++ b/src/core/hle/kernel/svc/svc_physical_memory.cpp @@ -16,7 +16,7 @@ Result SetHeapSize(Core::System& system, u64* out_address, u64 size) { R_UNLESS(size < MainMemorySizeMax, ResultInvalidSize); // Set the heap size. - R_RETURN(GetCurrentProcess(system.Kernel()).PageTable().SetHeapSize(out_address, size)); + R_RETURN(GetCurrentProcess(system.Kernel()).GetPageTable().SetHeapSize(out_address, size)); } /// Maps memory at a desired address @@ -44,21 +44,21 @@ Result MapPhysicalMemory(Core::System& system, u64 addr, u64 size) { } KProcess* const current_process{GetCurrentProcessPointer(system.Kernel())}; - auto& page_table{current_process->PageTable()}; + auto& page_table{current_process->GetPageTable()}; if (current_process->GetSystemResourceSize() == 0) { LOG_ERROR(Kernel_SVC, "System Resource Size is zero"); R_THROW(ResultInvalidState); } - if (!page_table.IsInsideAddressSpace(addr, size)) { + if (!page_table.Contains(addr, size)) { LOG_ERROR(Kernel_SVC, "Address is not within the address space, addr=0x{:016X}, size=0x{:016X}", addr, size); R_THROW(ResultInvalidMemoryRegion); } - if (page_table.IsOutsideAliasRegion(addr, size)) { + if (!page_table.IsInAliasRegion(addr, size)) { LOG_ERROR(Kernel_SVC, "Address is not within the alias region, addr=0x{:016X}, size=0x{:016X}", addr, size); @@ -93,21 +93,21 @@ Result UnmapPhysicalMemory(Core::System& system, u64 addr, u64 size) { } KProcess* const current_process{GetCurrentProcessPointer(system.Kernel())}; - auto& page_table{current_process->PageTable()}; + auto& page_table{current_process->GetPageTable()}; if (current_process->GetSystemResourceSize() == 0) { LOG_ERROR(Kernel_SVC, "System Resource Size is zero"); R_THROW(ResultInvalidState); } - if (!page_table.IsInsideAddressSpace(addr, size)) { + if (!page_table.Contains(addr, size)) { LOG_ERROR(Kernel_SVC, "Address is not within the address space, addr=0x{:016X}, size=0x{:016X}", addr, size); R_THROW(ResultInvalidMemoryRegion); } - if (page_table.IsOutsideAliasRegion(addr, size)) { + if (!page_table.IsInAliasRegion(addr, size)) { LOG_ERROR(Kernel_SVC, "Address is not within the alias region, addr=0x{:016X}, size=0x{:016X}", addr, size); |