KMemoryBlock.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. namespace Ryujinx.HLE.HOS.Kernel
  2. {
  3. class KMemoryBlock
  4. {
  5. public long BasePosition { get; set; }
  6. public long 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. long BasePosition,
  14. long PagesCount,
  15. MemoryState State,
  16. MemoryPermission Permission,
  17. MemoryAttribute Attribute)
  18. {
  19. this.BasePosition = BasePosition;
  20. this.PagesCount = PagesCount;
  21. this.State = State;
  22. this.Attribute = Attribute;
  23. this.Permission = Permission;
  24. }
  25. public KMemoryInfo GetInfo()
  26. {
  27. long Size = PagesCount * KMemoryManager.PageSize;
  28. return new KMemoryInfo(
  29. BasePosition,
  30. Size,
  31. State,
  32. Permission,
  33. Attribute,
  34. IpcRefCount,
  35. DeviceRefCount);
  36. }
  37. }
  38. }