diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/loader/deconstructed_rom_directory.cpp | 6 | ||||
-rw-r--r-- | src/core/loader/elf.cpp | 4 | ||||
-rw-r--r-- | src/core/loader/nro.cpp | 4 | ||||
-rw-r--r-- | src/core/loader/nso.cpp | 8 | ||||
-rw-r--r-- | src/core/loader/nso.h | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index 864cf25cd..459d127c2 100644 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp @@ -110,8 +110,6 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load( return ResultStatus::Error; } - process = Kernel::Process::Create("main"); - const std::string directory = filepath.substr(0, filepath.find_last_of("/\\")) + DIR_SEP; const std::string npdm_path = directory + DIR_SEP + "main.npdm"; @@ -121,13 +119,15 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load( } metadata.Print(); + process = Kernel::Process::Create("main", metadata.GetTitleID()); + // Load NSO modules VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR}; for (const auto& module : {"rtld", "main", "subsdk0", "subsdk1", "subsdk2", "subsdk3", "subsdk4", "subsdk5", "subsdk6", "subsdk7", "sdk"}) { const std::string path = directory + DIR_SEP + module; const VAddr load_addr = next_load_addr; - next_load_addr = AppLoader_NSO::LoadModule(path, load_addr, metadata.GetTitleID()); + next_load_addr = AppLoader_NSO::LoadModule(path, load_addr); if (next_load_addr) { LOG_DEBUG(Loader, "loaded module %s @ 0x%" PRIx64, module, load_addr); } else { diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index b87320656..cdd41f237 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -300,7 +300,7 @@ SharedPtr<CodeSet> ElfReader::LoadInto(u32 vaddr) { std::vector<u8> program_image(total_image_size); size_t current_image_position = 0; - SharedPtr<CodeSet> codeset = CodeSet::Create("", 0); + SharedPtr<CodeSet> codeset = CodeSet::Create(""); for (unsigned int i = 0; i < header->e_phnum; ++i) { Elf32_Phdr* p = &segments[i]; @@ -406,7 +406,7 @@ ResultStatus AppLoader_ELF::Load(Kernel::SharedPtr<Kernel::Process>& process) { SharedPtr<CodeSet> codeset = elf_reader.LoadInto(Memory::PROCESS_IMAGE_VADDR); codeset->name = filename; - process = Kernel::Process::Create("main"); + process = Kernel::Process::Create("main", 0); process->LoadModule(codeset, codeset->entrypoint); process->svc_access_mask.set(); process->address_mappings = default_address_mappings; diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp index 6f8a2f21e..c557b66dc 100644 --- a/src/core/loader/nro.cpp +++ b/src/core/loader/nro.cpp @@ -83,7 +83,7 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) { } // Build program image - Kernel::SharedPtr<Kernel::CodeSet> codeset = Kernel::CodeSet::Create("", 0); + Kernel::SharedPtr<Kernel::CodeSet> codeset = Kernel::CodeSet::Create(""); std::vector<u8> program_image; program_image.resize(PageAlignSize(nro_header.file_size)); file.Seek(0, SEEK_SET); @@ -125,7 +125,7 @@ ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) { return ResultStatus::Error; } - process = Kernel::Process::Create("main"); + process = Kernel::Process::Create("main", 0); // Load NRO static constexpr VAddr base_addr{Memory::PROCESS_IMAGE_VADDR}; diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 7f8d24dd6..00b5d1d49 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -92,7 +92,7 @@ static constexpr u32 PageAlignSize(u32 size) { return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK; } -VAddr AppLoader_NSO::LoadModule(const std::string& path, VAddr load_base, u64 tid) { +VAddr AppLoader_NSO::LoadModule(const std::string& path, VAddr load_base) { FileUtil::IOFile file(path, "rb"); if (!file.IsOpen()) { return {}; @@ -109,7 +109,7 @@ VAddr AppLoader_NSO::LoadModule(const std::string& path, VAddr load_base, u64 ti } // Build program image - Kernel::SharedPtr<Kernel::CodeSet> codeset = Kernel::CodeSet::Create("", tid); + Kernel::SharedPtr<Kernel::CodeSet> codeset = Kernel::CodeSet::Create(""); std::vector<u8> program_image; for (int i = 0; i < nso_header.segments.size(); ++i) { std::vector<u8> data = @@ -155,10 +155,10 @@ ResultStatus AppLoader_NSO::Load(Kernel::SharedPtr<Kernel::Process>& process) { return ResultStatus::Error; } - process = Kernel::Process::Create("main"); + process = Kernel::Process::Create("main", 0); // Load module - LoadModule(filepath, Memory::PROCESS_IMAGE_VADDR, 0); + LoadModule(filepath, Memory::PROCESS_IMAGE_VADDR); LOG_DEBUG(Loader, "loaded module %s @ 0x%" PRIx64, filepath.c_str(), Memory::PROCESS_IMAGE_VADDR); diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h index 14eb1d87e..1ae30a824 100644 --- a/src/core/loader/nso.h +++ b/src/core/loader/nso.h @@ -29,7 +29,7 @@ public: return IdentifyType(file, filepath); } - static VAddr LoadModule(const std::string& path, VAddr load_base, u64 tid); + static VAddr LoadModule(const std::string& path, VAddr load_base); ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override; |