GPFifoClassState.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. // This file was auto-generated from NVIDIA official Maxwell definitions.
  2. using Ryujinx.Common.Memory;
  3. namespace Ryujinx.Graphics.Gpu.Engine.GPFifo
  4. {
  5. /// <summary>
  6. /// Semaphore operation.
  7. /// </summary>
  8. enum SemaphoredOperation
  9. {
  10. Acquire = 1,
  11. Release = 2,
  12. AcqGeq = 4,
  13. AcqAnd = 8,
  14. Reduction = 16
  15. }
  16. /// <summary>
  17. /// Semaphore acquire switch enable.
  18. /// </summary>
  19. enum SemaphoredAcquireSwitch
  20. {
  21. Disabled = 0,
  22. Enabled = 1
  23. }
  24. /// <summary>
  25. /// Semaphore release interrupt wait enable.
  26. /// </summary>
  27. enum SemaphoredReleaseWfi
  28. {
  29. En = 0,
  30. Dis = 1
  31. }
  32. /// <summary>
  33. /// Semaphore release structure size.
  34. /// </summary>
  35. enum SemaphoredReleaseSize
  36. {
  37. SixteenBytes = 0,
  38. FourBytes = 1
  39. }
  40. /// <summary>
  41. /// Semaphore reduction operation.
  42. /// </summary>
  43. enum SemaphoredReduction
  44. {
  45. Min = 0,
  46. Max = 1,
  47. Xor = 2,
  48. And = 3,
  49. Or = 4,
  50. Add = 5,
  51. Inc = 6,
  52. Dec = 7
  53. }
  54. /// <summary>
  55. /// Semaphore format.
  56. /// </summary>
  57. enum SemaphoredFormat
  58. {
  59. Signed = 0,
  60. Unsigned = 1
  61. }
  62. /// <summary>
  63. /// Memory Translation Lookaside Buffer Page Directory Buffer invalidation.
  64. /// </summary>
  65. enum MemOpCTlbInvalidatePdb
  66. {
  67. One = 0,
  68. All = 1
  69. }
  70. /// <summary>
  71. /// Memory Translation Lookaside Buffer GPC invalidation enable.
  72. /// </summary>
  73. enum MemOpCTlbInvalidateGpc
  74. {
  75. Enable = 0,
  76. Disable = 1
  77. }
  78. /// <summary>
  79. /// Memory Translation Lookaside Buffer invalidation target.
  80. /// </summary>
  81. enum MemOpCTlbInvalidateTarget
  82. {
  83. VidMem = 0,
  84. SysMemCoherent = 2,
  85. SysMemNoncoherent = 3
  86. }
  87. /// <summary>
  88. /// Memory operation.
  89. /// </summary>
  90. enum MemOpDOperation
  91. {
  92. Membar = 5,
  93. MmuTlbInvalidate = 9,
  94. L2PeermemInvalidate = 13,
  95. L2SysmemInvalidate = 14,
  96. L2CleanComptags = 15,
  97. L2FlushDirty = 16
  98. }
  99. /// <summary>
  100. /// Syncpoint operation.
  101. /// </summary>
  102. enum SyncpointbOperation
  103. {
  104. Wait = 0,
  105. Incr = 1
  106. }
  107. /// <summary>
  108. /// Syncpoint wait switch enable.
  109. /// </summary>
  110. enum SyncpointbWaitSwitch
  111. {
  112. Dis = 0,
  113. En = 1
  114. }
  115. /// <summary>
  116. /// Wait for interrupt scope.
  117. /// </summary>
  118. enum WfiScope
  119. {
  120. CurrentScgType = 0,
  121. All = 1
  122. }
  123. /// <summary>
  124. /// Yield operation.
  125. /// </summary>
  126. enum YieldOp
  127. {
  128. Nop = 0,
  129. PbdmaTimeslice = 1,
  130. RunlistTimeslice = 2,
  131. Tsg = 3
  132. }
  133. /// <summary>
  134. /// General Purpose FIFO class state.
  135. /// </summary>
  136. struct GPFifoClassState
  137. {
  138. #pragma warning disable CS0649
  139. public uint SetObject;
  140. public int SetObjectNvclass => (int)((SetObject >> 0) & 0xFFFF);
  141. public int SetObjectEngine => (int)((SetObject >> 16) & 0x1F);
  142. public uint Illegal;
  143. public int IllegalHandle => (int)(Illegal);
  144. public uint Nop;
  145. public int NopHandle => (int)(Nop);
  146. public uint Reserved0C;
  147. public uint Semaphorea;
  148. public int SemaphoreaOffsetUpper => (int)((Semaphorea >> 0) & 0xFF);
  149. public uint Semaphoreb;
  150. public int SemaphorebOffsetLower => (int)((Semaphoreb >> 2) & 0x3FFFFFFF);
  151. public uint Semaphorec;
  152. public int SemaphorecPayload => (int)(Semaphorec);
  153. public uint Semaphored;
  154. public SemaphoredOperation SemaphoredOperation => (SemaphoredOperation)((Semaphored >> 0) & 0x1F);
  155. public SemaphoredAcquireSwitch SemaphoredAcquireSwitch => (SemaphoredAcquireSwitch)((Semaphored >> 12) & 0x1);
  156. public SemaphoredReleaseWfi SemaphoredReleaseWfi => (SemaphoredReleaseWfi)((Semaphored >> 20) & 0x1);
  157. public SemaphoredReleaseSize SemaphoredReleaseSize => (SemaphoredReleaseSize)((Semaphored >> 24) & 0x1);
  158. public SemaphoredReduction SemaphoredReduction => (SemaphoredReduction)((Semaphored >> 27) & 0xF);
  159. public SemaphoredFormat SemaphoredFormat => (SemaphoredFormat)((Semaphored >> 31) & 0x1);
  160. public uint NonStallInterrupt;
  161. public int NonStallInterruptHandle => (int)(NonStallInterrupt);
  162. public uint FbFlush;
  163. public int FbFlushHandle => (int)(FbFlush);
  164. public uint Reserved28;
  165. public uint Reserved2C;
  166. public uint MemOpC;
  167. public int MemOpCOperandLow => (int)((MemOpC >> 2) & 0x3FFFFFFF);
  168. public MemOpCTlbInvalidatePdb MemOpCTlbInvalidatePdb => (MemOpCTlbInvalidatePdb)((MemOpC >> 0) & 0x1);
  169. public MemOpCTlbInvalidateGpc MemOpCTlbInvalidateGpc => (MemOpCTlbInvalidateGpc)((MemOpC >> 1) & 0x1);
  170. public MemOpCTlbInvalidateTarget MemOpCTlbInvalidateTarget => (MemOpCTlbInvalidateTarget)((MemOpC >> 10) & 0x3);
  171. public int MemOpCTlbInvalidateAddrLo => (int)((MemOpC >> 12) & 0xFFFFF);
  172. public uint MemOpD;
  173. public int MemOpDOperandHigh => (int)((MemOpD >> 0) & 0xFF);
  174. public MemOpDOperation MemOpDOperation => (MemOpDOperation)((MemOpD >> 27) & 0x1F);
  175. public int MemOpDTlbInvalidateAddrHi => (int)((MemOpD >> 0) & 0xFF);
  176. public uint Reserved38;
  177. public uint Reserved3C;
  178. public uint Reserved40;
  179. public uint Reserved44;
  180. public uint Reserved48;
  181. public uint Reserved4C;
  182. public uint SetReference;
  183. public int SetReferenceCount => (int)(SetReference);
  184. public uint Reserved54;
  185. public uint Reserved58;
  186. public uint Reserved5C;
  187. public uint Reserved60;
  188. public uint Reserved64;
  189. public uint Reserved68;
  190. public uint Reserved6C;
  191. public uint Syncpointa;
  192. public int SyncpointaPayload => (int)(Syncpointa);
  193. public uint Syncpointb;
  194. public SyncpointbOperation SyncpointbOperation => (SyncpointbOperation)((Syncpointb >> 0) & 0x1);
  195. public SyncpointbWaitSwitch SyncpointbWaitSwitch => (SyncpointbWaitSwitch)((Syncpointb >> 4) & 0x1);
  196. public int SyncpointbSyncptIndex => (int)((Syncpointb >> 8) & 0xFFF);
  197. public uint Wfi;
  198. public WfiScope WfiScope => (WfiScope)((Wfi >> 0) & 0x1);
  199. public uint CrcCheck;
  200. public int CrcCheckValue => (int)(CrcCheck);
  201. public uint Yield;
  202. public YieldOp YieldOp => (YieldOp)((Yield >> 0) & 0x3);
  203. // TODO: Eventually move this to per-engine state.
  204. public Array31<uint> Reserved84;
  205. public uint NoOperation;
  206. public uint SetNotifyA;
  207. public uint SetNotifyB;
  208. public uint Notify;
  209. public uint WaitForIdle;
  210. public uint LoadMmeInstructionRamPointer;
  211. public uint LoadMmeInstructionRam;
  212. public uint LoadMmeStartAddressRamPointer;
  213. public uint LoadMmeStartAddressRam;
  214. public uint SetMmeShadowRamControl;
  215. #pragma warning restore CS0649
  216. }
  217. }