KMemoryBlock.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. namespace Ryujinx.HLE.HOS.Kernel.Memory
  2. {
  3. class KMemoryBlock
  4. {
  5. public ulong BaseAddress { get; set; }
  6. public ulong PagesCount { get; set; }
  7. public MemoryState State { get; set; }
  8. public MemoryPermission Permission { get; set; }
  9. public MemoryAttribute Attribute { get; set; }
  10. public int IpcRefCount { get; set; }
  11. public int DeviceRefCount { get; set; }
  12. public KMemoryBlock(
  13. ulong baseAddress,
  14. ulong pagesCount,
  15. MemoryState state,
  16. MemoryPermission permission,
  17. MemoryAttribute attribute)
  18. {
  19. BaseAddress = baseAddress;
  20. PagesCount = pagesCount;
  21. State = state;
  22. Attribute = attribute;
  23. Permission = permission;
  24. }
  25. public KMemoryInfo GetInfo()
  26. {
  27. ulong size = PagesCount * KMemoryManager.PageSize;
  28. return new KMemoryInfo(
  29. BaseAddress,
  30. size,
  31. State,
  32. Permission,
  33. Attribute,
  34. IpcRefCount,
  35. DeviceRefCount);
  36. }
  37. }
  38. }