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:
Mary 2021-10-24 01:40:13 +02:00 committed by GitHub
parent c94d47cc40
commit dc837c0042
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 206 additions and 2 deletions

View file

@ -65,10 +65,13 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
{ 0x29, nameof(Syscall64.GetInfo64) },
{ 0x2c, nameof(Syscall64.MapPhysicalMemory64) },
{ 0x2d, nameof(Syscall64.UnmapPhysicalMemory64) },
{ 0x30, nameof(Syscall64.GetResourceLimitLimitValue64) },
{ 0x31, nameof(Syscall64.GetResourceLimitCurrentValue64) },
{ 0x32, nameof(Syscall64.SetThreadActivity64) },
{ 0x33, nameof(Syscall64.GetThreadContext364) },
{ 0x34, nameof(Syscall64.WaitForAddress64) },
{ 0x35, nameof(Syscall64.SignalToAddress64) },
{ 0x37, nameof(Syscall64.GetResourceLimitPeakValue64) },
{ 0x40, nameof(Syscall64.CreateSession64) },
{ 0x41, nameof(Syscall64.AcceptSession64) },
{ 0x43, nameof(Syscall64.ReplyAndReceive64) },
@ -84,7 +87,9 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
{ 0x73, nameof(Syscall64.SetProcessMemoryPermission64) },
{ 0x77, nameof(Syscall64.MapProcessCodeMemory64) },
{ 0x78, nameof(Syscall64.UnmapProcessCodeMemory64) },
{ 0x7B, nameof(Syscall64.TerminateProcess64) }
{ 0x7B, nameof(Syscall64.TerminateProcess64) },
{ 0x7D, nameof(Syscall64.CreateResourceLimit64) },
{ 0x7E, nameof(Syscall64.SetResourceLimitLimitValue64) }
};
foreach (KeyValuePair<int, string> value in svcFuncs64)
@ -134,10 +139,13 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
{ 0x29, nameof(Syscall32.GetInfo32) },
{ 0x2c, nameof(Syscall32.MapPhysicalMemory32) },
{ 0x2d, nameof(Syscall32.UnmapPhysicalMemory32) },
{ 0x30, nameof(Syscall32.GetResourceLimitLimitValue32) },
{ 0x31, nameof(Syscall32.GetResourceLimitCurrentValue32) },
{ 0x32, nameof(Syscall32.SetThreadActivity32) },
{ 0x33, nameof(Syscall32.GetThreadContext332) },
{ 0x34, nameof(Syscall32.WaitForAddress32) },
{ 0x35, nameof(Syscall32.SignalToAddress32) },
{ 0x37, nameof(Syscall32.GetResourceLimitPeakValue32) },
{ 0x40, nameof(Syscall32.CreateSession32) },
{ 0x41, nameof(Syscall32.AcceptSession32) },
{ 0x43, nameof(Syscall32.ReplyAndReceive32) },
@ -153,7 +161,9 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
{ 0x73, nameof(Syscall32.SetProcessMemoryPermission32) },
{ 0x77, nameof(Syscall32.MapProcessCodeMemory32) },
{ 0x78, nameof(Syscall32.UnmapProcessCodeMemory32) },
{ 0x7B, nameof(Syscall32.TerminateProcess32) }
{ 0x7B, nameof(Syscall32.TerminateProcess32) },
{ 0x7D, nameof(Syscall32.CreateResourceLimit32) },
{ 0x7E, nameof(Syscall32.SetResourceLimitLimitValue32) }
};
foreach (KeyValuePair<int, string> value in svcFuncs32)