diff options
author | bunnei <bunneidev@gmail.com> | 2021-12-18 08:08:51 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-12-18 08:08:51 +0100 |
commit | 7feac8ba466c186f5510f709369d11b0f7729fb6 (patch) | |
tree | d1ee09a2e1006e842ad703bb6728f852452ca524 /src/core/loader/kip.cpp | |
parent | Merge pull request #7399 from ameerj/art-refactor (diff) | |
download | yuzu-7feac8ba466c186f5510f709369d11b0f7729fb6.tar yuzu-7feac8ba466c186f5510f709369d11b0f7729fb6.tar.gz yuzu-7feac8ba466c186f5510f709369d11b0f7729fb6.tar.bz2 yuzu-7feac8ba466c186f5510f709369d11b0f7729fb6.tar.lz yuzu-7feac8ba466c186f5510f709369d11b0f7729fb6.tar.xz yuzu-7feac8ba466c186f5510f709369d11b0f7729fb6.tar.zst yuzu-7feac8ba466c186f5510f709369d11b0f7729fb6.zip |
Diffstat (limited to 'src/core/loader/kip.cpp')
-rw-r--r-- | src/core/loader/kip.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/loader/kip.cpp b/src/core/loader/kip.cpp index 3ae9e6e0e..99ed34b00 100644 --- a/src/core/loader/kip.cpp +++ b/src/core/loader/kip.cpp @@ -71,7 +71,6 @@ AppLoader::LoadResult AppLoader_KIP::Load(Kernel::KProcess& process, kip->GetTitleID(), 0xFFFFFFFFFFFFFFFF, 0x1FE00000, kip->GetKernelCapabilities()); - const VAddr base_address = process.PageTable().GetCodeRegionStart(); Kernel::CodeSet codeset; Kernel::PhysicalMemory program_image; @@ -91,7 +90,14 @@ AppLoader::LoadResult AppLoader_KIP::Load(Kernel::KProcess& process, program_image.resize(PageAlignSize(kip->GetBSSOffset()) + kip->GetBSSSize()); codeset.DataSegment().size += kip->GetBSSSize(); + // Setup the process code layout + if (process.LoadFromMetadata(FileSys::ProgramMetadata::GetDefault(), program_image.size()) + .IsError()) { + return {ResultStatus::ErrorNotInitialized, {}}; + } + codeset.memory = std::move(program_image); + const VAddr base_address = process.PageTable().GetCodeRegionStart(); process.LoadModule(std::move(codeset), base_address); LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", kip->GetName(), base_address); |