Rework SVC handling (#883)

* Rework SVC handling

Prepare for 32 bits support.

* QueryMemory64 x1 is an output

* Pregenerate all SVC handler

Also clean up + 32 bits code path

* Address gdk's comments

* Simplify local setter loop

* Address jd's comments
This commit is contained in:
Thog 2020-01-13 03:04:28 +01:00 committed by jduncanator
parent 5facc0c07f
commit 892df335e6
8 changed files with 167 additions and 119 deletions

View file

@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
}
public KernelResult ConnectToNamedPort64(ulong namePtr, out int handle)
public KernelResult ConnectToNamedPort64([R(1)] ulong namePtr, [R(1)] out int handle)
{
return ConnectToNamedPort(namePtr, out handle);
}
@ -81,12 +81,12 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return result;
}
public KernelResult SendSyncRequest64(int handle)
public KernelResult SendSyncRequest64([R(0)] int handle)
{
return SendSyncRequest((ulong)_system.Scheduler.GetCurrentThread().Context.Tpidr, 0x100, handle);
}
public KernelResult SendSyncRequestWithUserBuffer64(ulong messagePtr, ulong size, int handle)
public KernelResult SendSyncRequestWithUserBuffer64([R(0)] ulong messagePtr, [R(1)] ulong size, [R(2)] int handle)
{
return SendSyncRequest(messagePtr, size, handle);
}
@ -168,10 +168,10 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
public KernelResult CreateSession64(
bool isLight,
ulong namePtr,
out int serverSessionHandle,
out int clientSessionHandle)
[R(2)] bool isLight,
[R(3)] ulong namePtr,
[R(1)] out int serverSessionHandle,
[R(2)] out int clientSessionHandle)
{
return CreateSession(isLight, namePtr, out serverSessionHandle, out clientSessionHandle);
}
@ -242,7 +242,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return result;
}
public KernelResult AcceptSession64(int portHandle, out int sessionHandle)
public KernelResult AcceptSession64([R(1)] int portHandle, [R(1)] out int sessionHandle)
{
return AcceptSession(portHandle, out sessionHandle);
}
@ -299,11 +299,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
public KernelResult ReplyAndReceive64(
ulong handlesPtr,
int handlesCount,
int replyTargetHandle,
long timeout,
out int handleIndex)
[R(1)] ulong handlesPtr,
[R(2)] int handlesCount,
[R(3)] int replyTargetHandle,
[R(4)] long timeout,
[R(1)] out int handleIndex)
{
handleIndex = 0;
@ -385,11 +385,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
public KernelResult CreatePort64(
int maxSessions,
bool isLight,
ulong namePtr,
out int serverPortHandle,
out int clientPortHandle)
[R(2)] int maxSessions,
[R(3)] bool isLight,
[R(4)] ulong namePtr,
[R(1)] out int serverPortHandle,
[R(2)] out int clientPortHandle)
{
return CreatePort(maxSessions, isLight, namePtr, out serverPortHandle, out clientPortHandle);
}
@ -429,7 +429,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return result;
}
public KernelResult ManageNamedPort64(ulong namePtr, int maxSessions, out int handle)
public KernelResult ManageNamedPort64([R(1)] ulong namePtr, [R(2)] int maxSessions, [R(1)] out int handle)
{
return ManageNamedPort(namePtr, maxSessions, out handle);
}
@ -474,7 +474,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return result;
}
public KernelResult ConnectToPort64(int clientPortHandle, out int clientSessionHandle)
public KernelResult ConnectToPort64([R(1)] int clientPortHandle, [R(1)] out int clientSessionHandle)
{
return ConnectToPort(clientPortHandle, out clientSessionHandle);
}