2023-01-04 17:15:45 -05:00
|
|
|
|
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.Horizon.Sdk.Sf
|
|
|
|
|
{
|
|
|
|
|
enum CommandArgType : byte
|
|
|
|
|
{
|
|
|
|
|
Invalid,
|
|
|
|
|
|
|
|
|
|
Buffer,
|
|
|
|
|
InArgument,
|
|
|
|
|
InCopyHandle,
|
|
|
|
|
InMoveHandle,
|
|
|
|
|
InObject,
|
|
|
|
|
OutArgument,
|
|
|
|
|
OutCopyHandle,
|
|
|
|
|
OutMoveHandle,
|
|
|
|
|
OutObject,
|
|
|
|
|
ProcessId
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CommandArg
|
|
|
|
|
{
|
2023-01-08 07:13:39 -05:00
|
|
|
|
public CommandArgType Type { get; }
|
|
|
|
|
public HipcBufferFlags BufferFlags { get; }
|
|
|
|
|
public ushort BufferFixedSize { get; }
|
|
|
|
|
public int ArgSize { get; }
|
|
|
|
|
public int ArgAlignment { get; }
|
2023-01-04 17:15:45 -05:00
|
|
|
|
|
|
|
|
|
public CommandArg(CommandArgType type)
|
|
|
|
|
{
|
2023-01-08 07:13:39 -05:00
|
|
|
|
Type = type;
|
|
|
|
|
BufferFlags = default;
|
2023-01-04 17:15:45 -05:00
|
|
|
|
BufferFixedSize = 0;
|
2023-01-08 07:13:39 -05:00
|
|
|
|
ArgSize = 0;
|
|
|
|
|
ArgAlignment = 0;
|
2023-01-04 17:15:45 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CommandArg(CommandArgType type, int argSize, int argAlignment)
|
|
|
|
|
{
|
2023-01-08 07:13:39 -05:00
|
|
|
|
Type = type;
|
|
|
|
|
BufferFlags = default;
|
2023-01-04 17:15:45 -05:00
|
|
|
|
BufferFixedSize = 0;
|
2023-01-08 07:13:39 -05:00
|
|
|
|
ArgSize = argSize;
|
|
|
|
|
ArgAlignment = argAlignment;
|
2023-01-04 17:15:45 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CommandArg(HipcBufferFlags flags, ushort fixedSize = 0)
|
|
|
|
|
{
|
2023-01-08 07:13:39 -05:00
|
|
|
|
Type = CommandArgType.Buffer;
|
|
|
|
|
BufferFlags = flags;
|
2023-01-04 17:15:45 -05:00
|
|
|
|
BufferFixedSize = fixedSize;
|
2023-01-08 07:13:39 -05:00
|
|
|
|
ArgSize = 0;
|
|
|
|
|
ArgAlignment = 0;
|
2023-01-04 17:15:45 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-01-08 07:13:39 -05:00
|
|
|
|
}
|