diff options
author | bunnei <bunneidev@gmail.com> | 2018-08-30 10:02:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-30 10:02:50 -0400 |
commit | 5094dfa081c7275e35496374a42996b11f0f6005 (patch) | |
tree | 8cdfb8c270c6299a1b172fb9c14856684bedf084 /src/core/loader/elf.cpp | |
parent | 42ef40884f222bfd0dfa08cd56e01e89b0e2ab0f (diff) | |
parent | 0cbcd6ec9aeeafc298fe2e6e4ac10d68bb7267c5 (diff) |
Merge pull request #1198 from lioncash/kernel
kernel: Eliminate kernel global state
Diffstat (limited to 'src/core/loader/elf.cpp')
-rw-r--r-- | src/core/loader/elf.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 6420a7f110..3702a84781 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -9,6 +9,7 @@ #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" +#include "core/core.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" #include "core/loader/elf.h" @@ -300,7 +301,8 @@ 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(""); + auto& kernel = Core::System::GetInstance().Kernel(); + SharedPtr<CodeSet> codeset = CodeSet::Create(kernel, ""); for (unsigned int i = 0; i < header->e_phnum; ++i) { Elf32_Phdr* p = &segments[i]; @@ -400,8 +402,9 @@ ResultStatus AppLoader_ELF::Load(Kernel::SharedPtr<Kernel::Process>& process) { process->svc_access_mask.set(); // Attach the default resource limit (APPLICATION) to the process + auto& kernel = Core::System::GetInstance().Kernel(); process->resource_limit = - Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION); + kernel.ResourceLimitForCategory(Kernel::ResourceLimitCategory::APPLICATION); process->Run(codeset->entrypoint, 48, Memory::DEFAULT_STACK_SIZE); |