diff options
author | bunnei <bunneidev@gmail.com> | 2022-02-21 21:33:17 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2022-02-21 21:41:31 +0100 |
commit | a74fddc98f5c02b2d0be90c6d87ec3779300ee11 (patch) | |
tree | b801352807790e645bca502bdfb0b9ad1195fef6 /src/core/hle/service/kernel_helpers.cpp | |
parent | core: hle: kernel: KEvent: Pass in owner KProcess on event creation. (diff) | |
download | yuzu-a74fddc98f5c02b2d0be90c6d87ec3779300ee11.tar yuzu-a74fddc98f5c02b2d0be90c6d87ec3779300ee11.tar.gz yuzu-a74fddc98f5c02b2d0be90c6d87ec3779300ee11.tar.bz2 yuzu-a74fddc98f5c02b2d0be90c6d87ec3779300ee11.tar.lz yuzu-a74fddc98f5c02b2d0be90c6d87ec3779300ee11.tar.xz yuzu-a74fddc98f5c02b2d0be90c6d87ec3779300ee11.tar.zst yuzu-a74fddc98f5c02b2d0be90c6d87ec3779300ee11.zip |
Diffstat (limited to 'src/core/hle/service/kernel_helpers.cpp')
-rw-r--r-- | src/core/hle/service/kernel_helpers.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/core/hle/service/kernel_helpers.cpp b/src/core/hle/service/kernel_helpers.cpp index d0c7bc0ce..b8c2c6e51 100644 --- a/src/core/hle/service/kernel_helpers.cpp +++ b/src/core/hle/service/kernel_helpers.cpp @@ -3,7 +3,9 @@ // Refer to the license.txt file included. #include "core/core.h" +#include "core/core_timing.h" #include "core/hle/kernel/k_event.h" +#include "core/hle/kernel/k_memory_manager.h" #include "core/hle/kernel/k_process.h" #include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_resource_limit.h" @@ -15,10 +17,21 @@ namespace Service::KernelHelpers { ServiceContext::ServiceContext(Core::System& system_, std::string name_) : kernel(system_.Kernel()) { + + // Create a resource limit for the process. + const auto physical_memory_size = + kernel.MemoryManager().GetSize(Kernel::KMemoryManager::Pool::System); + auto* resource_limit = Kernel::CreateResourceLimitForProcess(system_, physical_memory_size); + + // Create the process. process = Kernel::KProcess::Create(kernel); ASSERT(Kernel::KProcess::Initialize(process, system_, std::move(name_), - Kernel::KProcess::ProcessType::Userland) + Kernel::KProcess::ProcessType::KernelInternal, + resource_limit) .IsSuccess()); + + // Close reference to our resource limit, as the process opens one. + resource_limit->Close(); } ServiceContext::~ServiceContext() { |