Core/ResourceLimits: Implemented the basic structure of ResourceLimits.
Implemented svcs GetResourceLimit, GetResourceLimitCurrentValues and GetResourceLimitLimitValues. Note that the resource limits do not currently keep track of used objects, since we have no way to distinguish between an object created by the application, and an object created by some HLE module once we're inside Kernel::T::Create.
This commit is contained in:
parent
bb68933894
commit
d3634d4bf4
12 changed files with 341 additions and 14 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "common/swap.h"
|
||||
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/resource_limit.h"
|
||||
#include "core/loader/ncch.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue