/ src / Ryujinx.HLE / HOS / Kernel / Memory / MemoryState.cs
MemoryState.cs
  1  using System;
  2  
  3  namespace Ryujinx.HLE.HOS.Kernel.Memory
  4  {
  5      [Flags]
  6      enum MemoryState : uint
  7      {
  8          Unmapped = 0x0,
  9          Io = Mapped | 0x1,
 10          Normal = Mapped | QueryPhysicalAddressAllowed | 0x2,
 11          CodeStatic = ForceReadWritableByDebugSyscalls |
 12              IpcSendAllowedType0 |
 13              IpcSendAllowedType3 |
 14              IpcSendAllowedType1 |
 15              Mapped |
 16              ProcessPermissionChangeAllowed |
 17              QueryPhysicalAddressAllowed |
 18              MapDeviceAllowed |
 19              MapDeviceAlignedAllowed |
 20              IsPoolAllocated |
 21              MapProcessAllowed |
 22              LinearMapped |
 23              0x3,
 24          CodeMutable = PermissionChangeAllowed |
 25              IpcSendAllowedType0 |
 26              IpcSendAllowedType3 |
 27              IpcSendAllowedType1 |
 28              Mapped |
 29              MapAllowed |
 30              TransferMemoryAllowed |
 31              QueryPhysicalAddressAllowed |
 32              MapDeviceAllowed |
 33              MapDeviceAlignedAllowed |
 34              IpcBufferAllowed |
 35              IsPoolAllocated |
 36              MapProcessAllowed |
 37              AttributeChangeAllowed |
 38              CodeMemoryAllowed |
 39              LinearMapped |
 40              PermissionLockAllowed |
 41              0x4,
 42          Heap = PermissionChangeAllowed |
 43              IpcSendAllowedType0 |
 44              IpcSendAllowedType3 |
 45              IpcSendAllowedType1 |
 46              Mapped |
 47              MapAllowed |
 48              TransferMemoryAllowed |
 49              QueryPhysicalAddressAllowed |
 50              MapDeviceAllowed |
 51              MapDeviceAlignedAllowed |
 52              IpcBufferAllowed |
 53              IsPoolAllocated |
 54              AttributeChangeAllowed |
 55              CodeMemoryAllowed |
 56              LinearMapped |
 57              0x5,
 58          SharedMemory = Mapped | IsPoolAllocated | LinearMapped | 0x6,
 59          ModCodeStatic = ForceReadWritableByDebugSyscalls |
 60              IpcSendAllowedType0 |
 61              IpcSendAllowedType3 |
 62              IpcSendAllowedType1 |
 63              Mapped |
 64              ProcessPermissionChangeAllowed |
 65              UnmapProcessCodeMemoryAllowed |
 66              QueryPhysicalAddressAllowed |
 67              MapDeviceAllowed |
 68              MapDeviceAlignedAllowed |
 69              IsPoolAllocated |
 70              MapProcessAllowed |
 71              LinearMapped |
 72              0x8,
 73          ModCodeMutable = PermissionChangeAllowed |
 74              IpcSendAllowedType0 |
 75              IpcSendAllowedType3 |
 76              IpcSendAllowedType1 |
 77              Mapped |
 78              MapAllowed |
 79              UnmapProcessCodeMemoryAllowed |
 80              TransferMemoryAllowed |
 81              QueryPhysicalAddressAllowed |
 82              MapDeviceAllowed |
 83              MapDeviceAlignedAllowed |
 84              IpcBufferAllowed |
 85              IsPoolAllocated |
 86              MapProcessAllowed |
 87              AttributeChangeAllowed |
 88              CodeMemoryAllowed |
 89              LinearMapped |
 90              PermissionLockAllowed |
 91              0x9,
 92          IpcBuffer0 = IpcSendAllowedType0 |
 93              IpcSendAllowedType3 |
 94              IpcSendAllowedType1 |
 95              Mapped |
 96              QueryPhysicalAddressAllowed |
 97              MapDeviceAllowed |
 98              MapDeviceAlignedAllowed |
 99              IsPoolAllocated |
100              LinearMapped |
101              0xA,
102          Stack = IpcSendAllowedType0 |
103              IpcSendAllowedType3 |
104              IpcSendAllowedType1 |
105              Mapped |
106              QueryPhysicalAddressAllowed |
107              MapDeviceAllowed |
108              MapDeviceAlignedAllowed |
109              IsPoolAllocated |
110              LinearMapped |
111              0xB,
112          ThreadLocal = Mapped | IsPoolAllocated | LinearMapped | 0xC,
113          TransferMemoryIsolated = IpcSendAllowedType0 |
114              IpcSendAllowedType3 |
115              IpcSendAllowedType1 |
116              Mapped |
117              QueryPhysicalAddressAllowed |
118              MapDeviceAllowed |
119              MapDeviceAlignedAllowed |
120              IsPoolAllocated |
121              AttributeChangeAllowed |
122              LinearMapped |
123              0xD,
124          TransferMemory = IpcSendAllowedType3 |
125              IpcSendAllowedType1 |
126              Mapped |
127              QueryPhysicalAddressAllowed |
128              MapDeviceAllowed |
129              MapDeviceAlignedAllowed |
130              IsPoolAllocated |
131              LinearMapped |
132              0xE,
133          ProcessMemory = IpcSendAllowedType3 | IpcSendAllowedType1 | Mapped | IsPoolAllocated | LinearMapped | 0xF,
134          Reserved = 0x10,
135          IpcBuffer1 = IpcSendAllowedType3 |
136              IpcSendAllowedType1 |
137              Mapped |
138              QueryPhysicalAddressAllowed |
139              MapDeviceAllowed |
140              MapDeviceAlignedAllowed |
141              IsPoolAllocated |
142              LinearMapped |
143              0x11,
144          IpcBuffer3 = IpcSendAllowedType3 | Mapped | QueryPhysicalAddressAllowed | MapDeviceAllowed | IsPoolAllocated | LinearMapped | 0x12,
145          KernelStack = Mapped | 0x13,
146          CodeReadOnly = ForceReadWritableByDebugSyscalls | Mapped | IsPoolAllocated | LinearMapped | 0x14,
147          CodeWritable = Mapped | IsPoolAllocated | LinearMapped | 0x15,
148          UserMask = 0xFF,
149          Mask = 0xFFFFFFFF,
150  
151          PermissionChangeAllowed = 1 << 8,
152          ForceReadWritableByDebugSyscalls = 1 << 9,
153          IpcSendAllowedType0 = 1 << 10,
154          IpcSendAllowedType3 = 1 << 11,
155          IpcSendAllowedType1 = 1 << 12,
156          Mapped = 1 << 13,
157          ProcessPermissionChangeAllowed = 1 << 14,
158          MapAllowed = 1 << 15,
159          UnmapProcessCodeMemoryAllowed = 1 << 16,
160          TransferMemoryAllowed = 1 << 17,
161          QueryPhysicalAddressAllowed = 1 << 18,
162          MapDeviceAllowed = 1 << 19,
163          MapDeviceAlignedAllowed = 1 << 20,
164          IpcBufferAllowed = 1 << 21,
165          IsPoolAllocated = 1 << 22,
166          MapProcessAllowed = 1 << 23,
167          AttributeChangeAllowed = 1 << 24,
168          CodeMemoryAllowed = 1 << 25,
169          LinearMapped = 1 << 26,
170          PermissionLockAllowed = 1 << 27,
171      }
172  }