Allocate NCE patch region dynamically to avoid not having enough space

This commit is contained in:
Gabriel A 2023-07-09 21:28:09 -03:00 committed by Emmanuel Hansen
parent 517277a11f
commit 375691b0e0
13 changed files with 150 additions and 163 deletions

View file

@ -44,6 +44,16 @@ namespace Ryujinx.HLE.HOS
_codeSize = codeSize;
}
public static NceCpuCodePatch CreateCodePatchForNce(KernelContext context, bool for64Bit, ReadOnlySpan<byte> textSection)
{
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64 && for64Bit && context.Device.Configuration.UseHypervisor && !OperatingSystem.IsMacOS())
{
return NcePatcher.CreatePatch(textSection);
}
return null;
}
public IProcessContext Create(KernelContext context, ulong pid, ulong addressSpaceSize, InvalidAccessHandler invalidAccessHandler, bool for64Bit)
{
IArmProcessContext processContext;