Implement privileged resource limit SVCs

This commit is contained in:
TuxSH 2017-07-07 14:08:53 +02:00 committed by Dave Murphy
parent 4d8c2ea9f5
commit 49f99a0650
2 changed files with 40 additions and 0 deletions

View File

@ -776,6 +776,28 @@ Result svcGetResourceLimitLimitValues(s64* values, Handle resourceLimit, u32* na
*/
Result svcGetResourceLimitCurrentValues(s64* values, Handle resourceLimit, u32* names, s32 nameCount);
/**
* @brief Sets the resource limit set of a process.
* @param process Process to set the resource limit set to.
* @param resourceLimit Resource limit set handle.
*/
Result svcSetProcessResourceLimits(Handle process, Handle resourceLimit);
/**
* @brief Creates a resource limit set.
* @param[out] resourceLimit Pointer to output the resource limit set handle to.
*/
Result svcCreateResourceLimit(Handle* resourceLimit);
/**
* @brief Sets the value limits of a resource limit set.
* @param resourceLimit Resource limit set to use.
* @param names Resource limit names to set the limits of.
* @param values Value limits to set.
* @param nameCount Number of resource limit names.
*/
Result svcSetResourceLimitValues(Handle resourceLimit, const u32* names, const s64* values, s32 nameCount);
/**
* @brief Gets the process ID of a thread.
* @param[out] out Pointer to output the process ID of the thread @p handle to.

View File

@ -647,6 +647,24 @@ SVC_BEGIN svcTerminateProcess
bx lr
SVC_END
SVC_BEGIN svcSetProcessResourceLimits
svc 0x77
bx lr
SVC_END
SVC_BEGIN svcCreateResourceLimits
push {r0}
svc 0x78
pop {r2}
str r1, [r2]
bx lr
SVC_END
SVC_BEGIN svcSetResourceLimitValues
svc 0x79
bx lr
SVC_END
SVC_BEGIN svcBackdoor
svc 0x7B
bx lr