summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-12-18 21:50:25 +0100
committerGitHub <noreply@github.com>2021-12-18 21:50:25 +0100
commit6fb212784eb8eef5f4d1e1c2e9e14b884e1a5889 (patch)
tree7e68de69128a1391a04033c71cb81794d75d265d /src
parentMerge pull request #7587 from liushuyu/fix-linux-decoding (diff)
parentcore: loader: kip: Minimal changes to fix KIP loading. (diff)
downloadyuzu-6fb212784eb8eef5f4d1e1c2e9e14b884e1a5889.tar
yuzu-6fb212784eb8eef5f4d1e1c2e9e14b884e1a5889.tar.gz
yuzu-6fb212784eb8eef5f4d1e1c2e9e14b884e1a5889.tar.bz2
yuzu-6fb212784eb8eef5f4d1e1c2e9e14b884e1a5889.tar.lz
yuzu-6fb212784eb8eef5f4d1e1c2e9e14b884e1a5889.tar.xz
yuzu-6fb212784eb8eef5f4d1e1c2e9e14b884e1a5889.tar.zst
yuzu-6fb212784eb8eef5f4d1e1c2e9e14b884e1a5889.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/loader/kip.cpp8
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);