diff options
author | bunnei <bunneidev@gmail.com> | 2017-09-29 20:58:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-29 20:58:42 +0200 |
commit | b07af7dda822898e9c8f231c5ddcd1741d93dbef (patch) | |
tree | d41c9221d6065b8cf9e6a2405565b675a9c83c51 /src/core/loader/elf.cpp | |
parent | Merge pull request #2907 from Subv/warnings3 (diff) | |
parent | Loaders: Don't automatically set the current process every time we load an application. (diff) | |
download | yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar.gz yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar.bz2 yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar.lz yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar.xz yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar.zst yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/loader/elf.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 2de1f4e81..e36e42120 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -13,8 +13,8 @@ #include "core/loader/elf.h" #include "core/memory.h" -using Kernel::SharedPtr; using Kernel::CodeSet; +using Kernel::SharedPtr; //////////////////////////////////////////////////////////////////////////////////////////////////// // ELF Header Constants @@ -375,7 +375,7 @@ FileType AppLoader_ELF::IdentifyType(FileUtil::IOFile& file) { return FileType::Error; } -ResultStatus AppLoader_ELF::Load() { +ResultStatus AppLoader_ELF::Load(Kernel::SharedPtr<Kernel::Process>& process) { if (is_loaded) return ResultStatus::ErrorAlreadyLoaded; @@ -394,16 +394,15 @@ ResultStatus AppLoader_ELF::Load() { SharedPtr<CodeSet> codeset = elf_reader.LoadInto(Memory::PROCESS_IMAGE_VADDR); codeset->name = filename; - Kernel::g_current_process = Kernel::Process::Create(std::move(codeset)); - Kernel::g_current_process->svc_access_mask.set(); - Kernel::g_current_process->address_mappings = default_address_mappings; - Memory::SetCurrentPageTable(&Kernel::g_current_process->vm_manager.page_table); + process = Kernel::Process::Create(std::move(codeset)); + process->svc_access_mask.set(); + process->address_mappings = default_address_mappings; // Attach the default resource limit (APPLICATION) to the process - Kernel::g_current_process->resource_limit = + process->resource_limit = Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION); - Kernel::g_current_process->Run(48, Kernel::DEFAULT_STACK_SIZE); + process->Run(48, Kernel::DEFAULT_STACK_SIZE); is_loaded = true; return ResultStatus::Success; |