CommandArg.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Ryujinx.Horizon.Sdk.Sf.Hipc;
  2. namespace Ryujinx.Horizon.Sdk.Sf
  3. {
  4. enum CommandArgType : byte
  5. {
  6. Invalid,
  7. Buffer,
  8. InArgument,
  9. InCopyHandle,
  10. InMoveHandle,
  11. InObject,
  12. OutArgument,
  13. OutCopyHandle,
  14. OutMoveHandle,
  15. OutObject,
  16. ProcessId
  17. }
  18. struct CommandArg
  19. {
  20. public CommandArgType Type { get; }
  21. public HipcBufferFlags BufferFlags { get; }
  22. public ushort BufferFixedSize { get; }
  23. public int ArgSize { get; }
  24. public int ArgAlignment { get; }
  25. public CommandArg(CommandArgType type)
  26. {
  27. Type = type;
  28. BufferFlags = default;
  29. BufferFixedSize = 0;
  30. ArgSize = 0;
  31. ArgAlignment = 0;
  32. }
  33. public CommandArg(CommandArgType type, int argSize, int argAlignment)
  34. {
  35. Type = type;
  36. BufferFlags = default;
  37. BufferFixedSize = 0;
  38. ArgSize = argSize;
  39. ArgAlignment = argAlignment;
  40. }
  41. public CommandArg(HipcBufferFlags flags, ushort fixedSize = 0)
  42. {
  43. Type = CommandArgType.Buffer;
  44. BufferFlags = flags;
  45. BufferFixedSize = fixedSize;
  46. ArgSize = 0;
  47. ArgAlignment = 0;
  48. }
  49. }
  50. }