Add NCE code

This commit is contained in:
gdk 2023-07-03 19:28:05 -03:00 committed by Emmanuel Hansen
parent a1e34041fa
commit 0970972f0d
40 changed files with 2702 additions and 40 deletions

View file

@ -96,6 +96,11 @@ namespace Ryujinx.Memory
}
}
/// <inheritdoc/>
public void Reprotect(ulong va, ulong size, MemoryPermission permission)
{
}
/// <inheritdoc/>
public T Read<T>(ulong va) where T : unmanaged
{

View file

@ -44,6 +44,14 @@ namespace Ryujinx.Memory
/// <param name="size">Size of the range to be unmapped</param>
void Unmap(ulong va, ulong size);
/// <summary>
/// Reprotects a previously mapped range of virtual memory.
/// </summary>
/// <param name="va">Virtual address of the range to be reprotected</param>
/// <param name="size">Size of the range to be reprotected</param>
/// <param name="permission">New protection of the memory range</param>
void Reprotect(ulong va, ulong size, MemoryPermission permission);
/// <summary>
/// Reads data from CPU mapped memory.
/// </summary>

View file

@ -16,15 +16,15 @@ namespace Ryujinx.Memory
public static IntPtr Allocate(ulong size, bool forJit)
{
return AllocateInternal(size, MmapProts.PROT_READ | MmapProts.PROT_WRITE, forJit);
return AllocateInternal(size, MmapProts.PROT_READ | MmapProts.PROT_WRITE, forJit, false);
}
public static IntPtr Reserve(ulong size, bool forJit)
{
return AllocateInternal(size, MmapProts.PROT_NONE, forJit);
return AllocateInternal(size, MmapProts.PROT_NONE, forJit, false);
}
private static IntPtr AllocateInternal(ulong size, MmapProts prot, bool forJit, bool shared = false)
private static IntPtr AllocateInternal(ulong size, MmapProts prot, bool forJit, bool shared)
{
MmapFlags flags = MmapFlags.MAP_ANONYMOUS;