diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-03-06 07:16:27 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-03-06 07:16:27 +0100 |
commit | 2d40891b4526b4559f20efaaea320f004fccc063 (patch) | |
tree | 33a2235a50da38de52ace3b28ef4ae0a6dd28d97 | |
parent | Merge pull request #1455 from yuriks/ResultVal-union (diff) | |
parent | Memory: Do correct Phys->Virt address translation for non-APP linheap (diff) | |
download | yuzu-2d40891b4526b4559f20efaaea320f004fccc063.tar yuzu-2d40891b4526b4559f20efaaea320f004fccc063.tar.gz yuzu-2d40891b4526b4559f20efaaea320f004fccc063.tar.bz2 yuzu-2d40891b4526b4559f20efaaea320f004fccc063.tar.lz yuzu-2d40891b4526b4559f20efaaea320f004fccc063.tar.xz yuzu-2d40891b4526b4559f20efaaea320f004fccc063.tar.zst yuzu-2d40891b4526b4559f20efaaea320f004fccc063.zip |
-rw-r--r-- | src/core/hle/kernel/process.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/kernel/process.h | 1 | ||||
-rw-r--r-- | src/core/memory.cpp | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 16eb972fb..24b266eae 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -130,9 +130,11 @@ void Process::Run(s32 main_thread_priority, u32 stack_size) { Kernel::SetupMainThread(codeset->entrypoint, main_thread_priority); } +VAddr Process::GetLinearHeapAreaAddress() const { + return kernel_version < 0x22C ? Memory::LINEAR_HEAP_VADDR : Memory::NEW_LINEAR_HEAP_VADDR; +} VAddr Process::GetLinearHeapBase() const { - return (kernel_version < 0x22C ? Memory::LINEAR_HEAP_VADDR : Memory::NEW_LINEAR_HEAP_VADDR) - + memory_region->base; + return GetLinearHeapAreaAddress() + memory_region->base; } VAddr Process::GetLinearHeapLimit() const { diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 60e17f251..6d2ca96a2 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -143,6 +143,7 @@ public: /// Bitmask of the used TLS slots std::bitset<300> used_tls_slots; + VAddr GetLinearHeapAreaAddress() const; VAddr GetLinearHeapBase() const; VAddr GetLinearHeapLimit() const; diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 4753c63a7..7de5bd15d 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -291,7 +291,7 @@ VAddr PhysicalToVirtualAddress(const PAddr addr) { } else if (addr >= VRAM_PADDR && addr < VRAM_PADDR_END) { return addr - VRAM_PADDR + VRAM_VADDR; } else if (addr >= FCRAM_PADDR && addr < FCRAM_PADDR_END) { - return addr - FCRAM_PADDR + Kernel::g_current_process->GetLinearHeapBase(); + return addr - FCRAM_PADDR + Kernel::g_current_process->GetLinearHeapAreaAddress(); } else if (addr >= DSP_RAM_PADDR && addr < DSP_RAM_PADDR_END) { return addr - DSP_RAM_PADDR + DSP_RAM_VADDR; } else if (addr >= IO_AREA_PADDR && addr < IO_AREA_PADDR_END) { |