kernel: Add resource limit related syscalls (#2773)
* kernel: Add resource limit related syscalls This commit implements all resource limit related syscalls. * Fix register mapping being wrong for SetResourceLimitLimitValue * Address gdkchan's comment
This commit is contained in:
parent
c94d47cc40
commit
dc837c0042
5 changed files with 206 additions and 2 deletions
|
@ -295,6 +295,48 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
|||
return result;
|
||||
}
|
||||
|
||||
public KernelResult GetResourceLimitLimitValue32([R(1)] int handle, [R(2)] LimitableResource resource, [R(1)] out int limitValueLow, [R(2)] out int limitValueHigh)
|
||||
{
|
||||
KernelResult result = _syscall.GetResourceLimitLimitValue(handle, resource, out long limitValue);
|
||||
|
||||
limitValueHigh = (int)(limitValue >> 32);
|
||||
limitValueLow = (int)(limitValue & uint.MaxValue);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public KernelResult GetResourceLimitCurrentValue32([R(1)] int handle, [R(2)] LimitableResource resource, [R(1)] out int limitValueLow, [R(2)] out int limitValueHigh)
|
||||
{
|
||||
KernelResult result = _syscall.GetResourceLimitCurrentValue(handle, resource, out long limitValue);
|
||||
|
||||
limitValueHigh = (int)(limitValue >> 32);
|
||||
limitValueLow = (int)(limitValue & uint.MaxValue);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public KernelResult GetResourceLimitPeakValue32([R(1)] int handle, [R(2)] LimitableResource resource, [R(1)] out int peakLow, [R(2)] out int peakHigh)
|
||||
{
|
||||
KernelResult result = _syscall.GetResourceLimitPeakValue(handle, resource, out long peak);
|
||||
|
||||
peakHigh = (int)(peak >> 32);
|
||||
peakLow = (int)(peak & uint.MaxValue);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public KernelResult CreateResourceLimit32([R(1)] out int handle)
|
||||
{
|
||||
return _syscall.CreateResourceLimit(out handle);
|
||||
}
|
||||
|
||||
public KernelResult SetResourceLimitLimitValue32([R(0)] int handle, [R(1)] LimitableResource resource, [R(2)] uint limitValueLow, [R(3)] uint limitValueHigh)
|
||||
{
|
||||
long limitValue = (long)(limitValueLow | ((ulong)limitValueHigh << 32));
|
||||
|
||||
return _syscall.SetResourceLimitLimitValue(handle, resource, limitValue);
|
||||
}
|
||||
|
||||
public KernelResult FlushProcessDataCache32(
|
||||
[R(0)] uint processHandle,
|
||||
[R(2)] uint addressLow,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue