loader: elf/kip/nro: Updates for new VMM.

merge-requests/60/head
bunnei 2020-04-09 14:01:34 +07:00
parent 37b79ebe85
commit 83761d5316
3 changed files with 7 additions and 5 deletions

@ -10,8 +10,8 @@
#include "common/file_util.h" #include "common/file_util.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/hle/kernel/code_set.h" #include "core/hle/kernel/code_set.h"
#include "core/hle/kernel/memory/page_table.h"
#include "core/hle/kernel/process.h" #include "core/hle/kernel/process.h"
#include "core/hle/kernel/vm_manager.h"
#include "core/loader/elf.h" #include "core/loader/elf.h"
#include "core/memory.h" #include "core/memory.h"
@ -393,7 +393,7 @@ AppLoader_ELF::LoadResult AppLoader_ELF::Load(Kernel::Process& process) {
return {ResultStatus::ErrorIncorrectELFFileSize, {}}; return {ResultStatus::ErrorIncorrectELFFileSize, {}};
} }
const VAddr base_address = process.VMManager().GetCodeRegionBaseAddress(); const VAddr base_address = process.PageTable().GetCodeRegionStart();
ElfReader elf_reader(&buffer[0]); ElfReader elf_reader(&buffer[0]);
Kernel::CodeSet codeset = elf_reader.LoadInto(base_address); Kernel::CodeSet codeset = elf_reader.LoadInto(base_address);
const VAddr entry_point = codeset.entrypoint; const VAddr entry_point = codeset.entrypoint;

@ -7,8 +7,10 @@
#include "core/file_sys/program_metadata.h" #include "core/file_sys/program_metadata.h"
#include "core/gdbstub/gdbstub.h" #include "core/gdbstub/gdbstub.h"
#include "core/hle/kernel/code_set.h" #include "core/hle/kernel/code_set.h"
#include "core/hle/kernel/memory/page_table.h"
#include "core/hle/kernel/process.h" #include "core/hle/kernel/process.h"
#include "core/loader/kip.h" #include "core/loader/kip.h"
#include "core/memory.h"
namespace Loader { namespace Loader {
@ -68,7 +70,7 @@ AppLoader::LoadResult AppLoader_KIP::Load(Kernel::Process& process) {
kip->GetMainThreadCpuCore(), kip->GetMainThreadStackSize(), kip->GetMainThreadCpuCore(), kip->GetMainThreadStackSize(),
kip->GetTitleID(), 0xFFFFFFFFFFFFFFFF, kip->GetKernelCapabilities()); kip->GetTitleID(), 0xFFFFFFFFFFFFFFFF, kip->GetKernelCapabilities());
const VAddr base_address = process.VMManager().GetCodeRegionBaseAddress(); const VAddr base_address = process.PageTable().GetCodeRegionStart();
Kernel::CodeSet codeset; Kernel::CodeSet codeset;
Kernel::PhysicalMemory program_image; Kernel::PhysicalMemory program_image;

@ -16,8 +16,8 @@
#include "core/file_sys/vfs_offset.h" #include "core/file_sys/vfs_offset.h"
#include "core/gdbstub/gdbstub.h" #include "core/gdbstub/gdbstub.h"
#include "core/hle/kernel/code_set.h" #include "core/hle/kernel/code_set.h"
#include "core/hle/kernel/memory/page_table.h"
#include "core/hle/kernel/process.h" #include "core/hle/kernel/process.h"
#include "core/hle/kernel/vm_manager.h"
#include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/filesystem/filesystem.h"
#include "core/loader/nro.h" #include "core/loader/nro.h"
#include "core/loader/nso.h" #include "core/loader/nso.h"
@ -208,7 +208,7 @@ AppLoader_NRO::LoadResult AppLoader_NRO::Load(Kernel::Process& process) {
} }
// Load NRO // Load NRO
const VAddr base_address = process.VMManager().GetCodeRegionBaseAddress(); const VAddr base_address = process.PageTable().GetCodeRegionStart();
if (!LoadNro(process, *file, base_address)) { if (!LoadNro(process, *file, base_address)) {
return {ResultStatus::ErrorLoadingNRO, {}}; return {ResultStatus::ErrorLoadingNRO, {}};