From 6aa90e13f99ea032754733057f7c13f94fd10aa2 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 5 Mar 2016 22:09:59 -0800 Subject: Memory: Do correct Phys->Virt address translation for non-APP linheap --- src/core/hle/kernel/process.cpp | 6 ++++-- src/core/hle/kernel/process.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core/hle/kernel') 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; -- cgit v1.2.3