mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-23 16:56:02 +00:00
svc: Implement ref
parameters (#798)
Allows passing data into and out of the same registers when calling via the Kernel ABI. This allows implementing specific supervisor calls like "CallSecureMonitor", that expect their args and results in the same registers.
This commit is contained in:
parent
1772128ce0
commit
86b42f176a
1 changed files with 10 additions and 1 deletions
|
@ -231,7 +231,16 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
|
|
||||||
if (!methodArgs[index].IsOut)
|
if (!methodArgs[index].IsOut)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException($"Method \"{svcName}\" has a invalid ref type \"{argType.Name}\".");
|
generator.Emit(OpCodes.Ldarg_1);
|
||||||
|
generator.Emit(OpCodes.Ldc_I4, index);
|
||||||
|
|
||||||
|
MethodInfo info = typeof(IExecutionContext).GetMethod(nameof(IExecutionContext.GetX));
|
||||||
|
|
||||||
|
generator.Emit(OpCodes.Call, info);
|
||||||
|
|
||||||
|
ConvertToArgType(argType);
|
||||||
|
|
||||||
|
generator.Emit(OpCodes.Stloc, local);
|
||||||
}
|
}
|
||||||
|
|
||||||
generator.Emit(OpCodes.Ldloca, local);
|
generator.Emit(OpCodes.Ldloca, local);
|
||||||
|
|
Loading…
Reference in a new issue