aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/loader/ncch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/loader/ncch.cpp')
-rw-r--r--src/core/loader/ncch.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp
index 3325a6ab..08993c4f 100644
--- a/src/core/loader/ncch.cpp
+++ b/src/core/loader/ncch.cpp
@@ -11,8 +11,9 @@
#include "common/swap.h"
#include "core/hle/kernel/kernel.h"
+#include "core/hle/kernel/resource_limit.h"
#include "core/loader/ncch.h"
-#include "core/mem_map.h"
+#include "core/memory.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Loader namespace
@@ -126,6 +127,10 @@ ResultStatus AppLoader_NCCH::LoadExec() const {
u64 program_id = *reinterpret_cast<u64_le const*>(&ncch_header.program_id[0]);
Kernel::g_current_process = Kernel::Process::Create(process_name, program_id);
+ // Attach a resource limit to the process based on the resource limit category
+ Kernel::g_current_process->resource_limit = Kernel::ResourceLimit::GetForCategory(
+ static_cast<Kernel::ResourceLimitCategory>(exheader_header.arm11_system_local_caps.resource_limit_category));
+
// Copy data while converting endianess
std::array<u32, ARRAY_SIZE(exheader_header.arm11_kernel_caps.descriptors)> kernel_caps;
std::copy_n(exheader_header.arm11_kernel_caps.descriptors, kernel_caps.size(), begin(kernel_caps));