Update 32 bits syscalls to match 64 bits implementation (#892)
* Implement 32 bits syscalls Co-authored-by: riperiperi <rhy3756547@hotmail.com> Implement all 32 bits counterparts of the 64 bits syscalls we currently have. * Add FlushProcessDataCache32 * Address jd's comments
This commit is contained in:
parent
81cca88bcd
commit
d0f15cb0b1
6 changed files with 481 additions and 1 deletions
|
@ -90,7 +90,63 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
|||
|
||||
Dictionary<int, string> svcFuncs32 = new Dictionary<int, string>
|
||||
{
|
||||
// TODO
|
||||
{ 0x01, nameof(SvcHandler.SetHeapSize32) },
|
||||
{ 0x03, nameof(SvcHandler.SetMemoryAttribute32) },
|
||||
{ 0x04, nameof(SvcHandler.MapMemory32) },
|
||||
{ 0x05, nameof(SvcHandler.UnmapMemory32) },
|
||||
{ 0x06, nameof(SvcHandler.QueryMemory32) },
|
||||
{ 0x07, nameof(SvcHandler.ExitProcess32) },
|
||||
{ 0x08, nameof(SvcHandler.CreateThread32) },
|
||||
{ 0x09, nameof(SvcHandler.StartThread32) },
|
||||
{ 0x0a, nameof(SvcHandler.ExitThread32) },
|
||||
{ 0x0b, nameof(SvcHandler.SleepThread32) },
|
||||
{ 0x0c, nameof(SvcHandler.GetThreadPriority32) },
|
||||
{ 0x0d, nameof(SvcHandler.SetThreadPriority32) },
|
||||
{ 0x0e, nameof(SvcHandler.GetThreadCoreMask32) },
|
||||
{ 0x0f, nameof(SvcHandler.SetThreadCoreMask32) },
|
||||
{ 0x10, nameof(SvcHandler.GetCurrentProcessorNumber32) },
|
||||
{ 0x11, nameof(SvcHandler.SignalEvent32) },
|
||||
{ 0x12, nameof(SvcHandler.ClearEvent32) },
|
||||
{ 0x13, nameof(SvcHandler.MapSharedMemory32) },
|
||||
{ 0x14, nameof(SvcHandler.UnmapSharedMemory32) },
|
||||
{ 0x15, nameof(SvcHandler.CreateTransferMemory32) },
|
||||
{ 0x16, nameof(SvcHandler.CloseHandle32) },
|
||||
{ 0x17, nameof(SvcHandler.ResetSignal32) },
|
||||
{ 0x18, nameof(SvcHandler.WaitSynchronization32) },
|
||||
{ 0x19, nameof(SvcHandler.CancelSynchronization32) },
|
||||
{ 0x1a, nameof(SvcHandler.ArbitrateLock32) },
|
||||
{ 0x1b, nameof(SvcHandler.ArbitrateUnlock32) },
|
||||
{ 0x1c, nameof(SvcHandler.WaitProcessWideKeyAtomic32) },
|
||||
{ 0x1d, nameof(SvcHandler.SignalProcessWideKey32) },
|
||||
{ 0x1e, nameof(SvcHandler.GetSystemTick32) },
|
||||
{ 0x1f, nameof(SvcHandler.ConnectToNamedPort32) },
|
||||
{ 0x21, nameof(SvcHandler.SendSyncRequest32) },
|
||||
{ 0x22, nameof(SvcHandler.SendSyncRequestWithUserBuffer32) },
|
||||
{ 0x24, nameof(SvcHandler.GetProcessId32) },
|
||||
{ 0x25, nameof(SvcHandler.GetThreadId32) },
|
||||
{ 0x26, nameof(SvcHandler.Break32) },
|
||||
{ 0x27, nameof(SvcHandler.OutputDebugString32) },
|
||||
{ 0x29, nameof(SvcHandler.GetInfo32) },
|
||||
{ 0x2c, nameof(SvcHandler.MapPhysicalMemory32) },
|
||||
{ 0x2d, nameof(SvcHandler.UnmapPhysicalMemory32) },
|
||||
{ 0x32, nameof(SvcHandler.SetThreadActivity32) },
|
||||
{ 0x33, nameof(SvcHandler.GetThreadContext332) },
|
||||
{ 0x34, nameof(SvcHandler.WaitForAddress32) },
|
||||
{ 0x35, nameof(SvcHandler.SignalToAddress32) },
|
||||
{ 0x40, nameof(SvcHandler.CreateSession32) },
|
||||
{ 0x41, nameof(SvcHandler.AcceptSession32) },
|
||||
{ 0x43, nameof(SvcHandler.ReplyAndReceive32) },
|
||||
{ 0x45, nameof(SvcHandler.CreateEvent32) },
|
||||
{ 0x5F, nameof(SvcHandler.FlushProcessDataCache32) },
|
||||
{ 0x65, nameof(SvcHandler.GetProcessList32) },
|
||||
{ 0x6f, nameof(SvcHandler.GetSystemInfo32) },
|
||||
{ 0x70, nameof(SvcHandler.CreatePort32) },
|
||||
{ 0x71, nameof(SvcHandler.ManageNamedPort32) },
|
||||
{ 0x72, nameof(SvcHandler.ConnectToPort32) },
|
||||
{ 0x73, nameof(SvcHandler.SetProcessMemoryPermission32) },
|
||||
{ 0x77, nameof(SvcHandler.MapProcessCodeMemory32) },
|
||||
{ 0x78, nameof(SvcHandler.UnmapProcessCodeMemory32) },
|
||||
{ 0x7B, nameof(SvcHandler.TerminateProcess32) }
|
||||
};
|
||||
|
||||
foreach (KeyValuePair<int, string> value in svcFuncs32)
|
||||
|
@ -320,6 +376,12 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
|||
for (int index = 0; index < locals.Count; index++)
|
||||
{
|
||||
(LocalBuilder local, RAttribute attribute) = locals[index];
|
||||
|
||||
if ((registerInUse & (1u << attribute.Index)) != 0)
|
||||
{
|
||||
throw new InvalidSvcException($"Method \"{svcName}\" has conflicting output values at register index \"{attribute.Index}\".");
|
||||
}
|
||||
|
||||
generator.Emit(OpCodes.Ldarg_1);
|
||||
generator.Emit(OpCodes.Ldc_I4, attribute.Index);
|
||||
generator.Emit(OpCodes.Ldloc, local);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue