diff options
Diffstat (limited to 'src/core/loader/ncch.cpp')
| -rw-r--r-- | src/core/loader/ncch.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index 36e341fd4..08993c4fa 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include "common/swap.h" | 11 | #include "common/swap.h" |
| 12 | 12 | ||
| 13 | #include "core/hle/kernel/kernel.h" | 13 | #include "core/hle/kernel/kernel.h" |
| 14 | #include "core/hle/kernel/resource_limit.h" | ||
| 14 | #include "core/loader/ncch.h" | 15 | #include "core/loader/ncch.h" |
| 15 | #include "core/memory.h" | 16 | #include "core/memory.h" |
| 16 | 17 | ||
| @@ -126,6 +127,10 @@ ResultStatus AppLoader_NCCH::LoadExec() const { | |||
| 126 | u64 program_id = *reinterpret_cast<u64_le const*>(&ncch_header.program_id[0]); | 127 | u64 program_id = *reinterpret_cast<u64_le const*>(&ncch_header.program_id[0]); |
| 127 | Kernel::g_current_process = Kernel::Process::Create(process_name, program_id); | 128 | Kernel::g_current_process = Kernel::Process::Create(process_name, program_id); |
| 128 | 129 | ||
| 130 | // Attach a resource limit to the process based on the resource limit category | ||
| 131 | Kernel::g_current_process->resource_limit = Kernel::ResourceLimit::GetForCategory( | ||
| 132 | static_cast<Kernel::ResourceLimitCategory>(exheader_header.arm11_system_local_caps.resource_limit_category)); | ||
| 133 | |||
| 129 | // Copy data while converting endianess | 134 | // Copy data while converting endianess |
| 130 | std::array<u32, ARRAY_SIZE(exheader_header.arm11_kernel_caps.descriptors)> kernel_caps; | 135 | std::array<u32, ARRAY_SIZE(exheader_header.arm11_kernel_caps.descriptors)> kernel_caps; |
| 131 | std::copy_n(exheader_header.arm11_kernel_caps.descriptors, kernel_caps.size(), begin(kernel_caps)); | 136 | std::copy_n(exheader_header.arm11_kernel_caps.descriptors, kernel_caps.size(), begin(kernel_caps)); |