2018-08-16 19:47:36 -04:00
|
|
|
namespace Ryujinx.HLE.HOS.Kernel
|
2018-08-15 14:59:51 -04:00
|
|
|
{
|
|
|
|
class KMemoryBlock
|
|
|
|
{
|
2018-11-28 17:18:09 -05:00
|
|
|
public ulong BaseAddress { get; set; }
|
|
|
|
public ulong PagesCount { get; set; }
|
2018-08-15 14:59:51 -04: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-06 06:16:24 -05:00
|
|
|
ulong baseAddress,
|
|
|
|
ulong pagesCount,
|
|
|
|
MemoryState state,
|
|
|
|
MemoryPermission permission,
|
|
|
|
MemoryAttribute attribute)
|
2018-08-15 14:59:51 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
BaseAddress = baseAddress;
|
|
|
|
PagesCount = pagesCount;
|
|
|
|
State = state;
|
|
|
|
Attribute = attribute;
|
|
|
|
Permission = permission;
|
2018-08-15 14:59:51 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public KMemoryInfo GetInfo()
|
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
ulong size = PagesCount * KMemoryManager.PageSize;
|
2018-08-15 14:59:51 -04:00
|
|
|
|
|
|
|
return new KMemoryInfo(
|
2018-11-28 17:18:09 -05:00
|
|
|
BaseAddress,
|
2018-12-06 06:16:24 -05:00
|
|
|
size,
|
2018-08-15 14:59:51 -04:00
|
|
|
State,
|
|
|
|
Permission,
|
|
|
|
Attribute,
|
|
|
|
IpcRefCount,
|
|
|
|
DeviceRefCount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|