diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-09-24 20:01:45 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-09-24 22:16:03 -0400 |
| commit | 83377113bfe7791483a1b67e06dd0f51620c04ec (patch) | |
| tree | d766a2d2f20d247e8663c1a76d5c41fcf7f643d4 /src/core/loader/deconstructed_rom_directory.cpp | |
| parent | 6c6f95d071b25f2743fcb6652f4389c9e25a7506 (diff) | |
memory: Dehardcode the use of fixed memory range constants
The locations of these can actually vary depending on the address space
layout, so we shouldn't be using these when determining where to map
memory or be using them as offsets for calculations. This keeps all the
memory ranges flexible and malleable based off of the virtual memory
manager instance state.
Diffstat (limited to 'src/core/loader/deconstructed_rom_directory.cpp')
| -rw-r--r-- | src/core/loader/deconstructed_rom_directory.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index 44d62ab7f..7e8035d0f 100644 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp @@ -17,7 +17,6 @@ #include "core/hle/service/filesystem/filesystem.h" #include "core/loader/deconstructed_rom_directory.h" #include "core/loader/nso.h" -#include "core/memory.h" namespace Loader { @@ -134,7 +133,8 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load( process->LoadFromMetadata(metadata); // Load NSO modules - VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR}; + const VAddr base_address = process->vm_manager.GetCodeRegionBaseAddress(); + VAddr next_load_addr = base_address; for (const auto& module : {"rtld", "main", "subsdk0", "subsdk1", "subsdk2", "subsdk3", "subsdk4", "subsdk5", "subsdk6", "subsdk7", "sdk"}) { const FileSys::VirtualFile module_file = dir->GetFile(module); @@ -147,8 +147,7 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load( } } - process->Run(Memory::PROCESS_IMAGE_VADDR, metadata.GetMainThreadPriority(), - metadata.GetMainThreadStackSize()); + process->Run(base_address, metadata.GetMainThreadPriority(), metadata.GetMainThreadStackSize()); // Find the RomFS by searching for a ".romfs" file in this directory const auto& files = dir->GetFiles(); |
