2018-08-17 01:47:36 +02:00
|
|
|
namespace Ryujinx.HLE.HOS.Kernel
|
2018-08-15 20:59:51 +02:00
|
|
|
{
|
|
|
|
class KMemoryBlock
|
|
|
|
{
|
2018-11-28 23:18:09 +01:00
|
|
|
public ulong BaseAddress { get; set; }
|
|
|
|
public ulong PagesCount { get; set; }
|
2018-08-15 20:59:51 +02:00
|
|
|
|
|
|
|
public MemoryState State { get; set; }
|
|
|
|
public MemoryPermission Permission { get; set; }
|
|
|
|
public MemoryAttribute Attribute { get; set; }
|
|
|
|
|
|
|
|
public int IpcRefCount { get; set; }
|
|
|
|
public int DeviceRefCount { get; set; }
|
|
|
|
|
|
|
|
public KMemoryBlock(
|
2018-12-05 01:52:39 +01:00
|
|
|
ulong BaseAddress,
|
|
|
|
ulong PagesCount,
|
|
|
|
MemoryState State,
|
|
|
|
MemoryPermission Permission,
|
|
|
|
MemoryAttribute Attribute)
|
2018-08-15 20:59:51 +02:00
|
|
|
{
|
2018-12-05 01:52:39 +01:00
|
|
|
this.BaseAddress = BaseAddress;
|
|
|
|
this.PagesCount = PagesCount;
|
|
|
|
this.State = State;
|
|
|
|
this.Attribute = Attribute;
|
|
|
|
this.Permission = Permission;
|
2018-08-15 20:59:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public KMemoryInfo GetInfo()
|
|
|
|
{
|
2018-12-05 01:52:39 +01:00
|
|
|
ulong Size = PagesCount * KMemoryManager.PageSize;
|
2018-08-15 20:59:51 +02:00
|
|
|
|
|
|
|
return new KMemoryInfo(
|
2018-11-28 23:18:09 +01:00
|
|
|
BaseAddress,
|
2018-12-05 01:52:39 +01:00
|
|
|
Size,
|
2018-08-15 20:59:51 +02:00
|
|
|
State,
|
|
|
|
Permission,
|
|
|
|
Attribute,
|
|
|
|
IpcRefCount,
|
|
|
|
DeviceRefCount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|