diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs')
-rw-r--r-- | Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs b/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs index 36e1078f..263e1c4c 100644 --- a/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs @@ -1,10 +1,10 @@ using LibHac.Tools.FsSystem; using Ryujinx.Common; using Ryujinx.Cpu; -using Ryujinx.HLE.HOS.Kernel.Common; using Ryujinx.HLE.HOS.Kernel.Memory; using Ryujinx.HLE.HOS.Kernel.Process; using Ryujinx.HLE.Loaders.Executables; +using Ryujinx.Horizon.Common; using Ryujinx.Memory; using System; using System.Collections.Generic; @@ -217,7 +217,7 @@ namespace Ryujinx.HLE.HOS.Services.Ro if (info.BssSize > 0) { - KernelResult bssMappingResult = memMgr.MapProcessCodeMemory(nroMappedAddress + info.NroSize, info.BssAddress, info.BssSize); + Result bssMappingResult = memMgr.MapProcessCodeMemory(nroMappedAddress + info.NroSize, info.BssAddress, info.BssSize); if (bssMappingResult == KernelResult.InvalidMemState) { @@ -226,12 +226,12 @@ namespace Ryujinx.HLE.HOS.Services.Ro continue; } - else if (bssMappingResult != KernelResult.Success) + else if (bssMappingResult != Result.Success) { memMgr.UnmapProcessCodeMemory(nroMappedAddress + info.NroSize, info.BssAddress, info.BssSize); memMgr.UnmapProcessCodeMemory(nroMappedAddress, info.NroAddress, info.NroSize); - return (ResultCode)bssMappingResult; + return (ResultCode)bssMappingResult.ErrorCode; } } @@ -286,15 +286,15 @@ namespace Ryujinx.HLE.HOS.Services.Ro } } - KernelResult result = memMgr.MapProcessCodeMemory(targetAddress, baseAddress, size); + Result result = memMgr.MapProcessCodeMemory(targetAddress, baseAddress, size); if (result == KernelResult.InvalidMemState) { continue; } - else if (result != KernelResult.Success) + else if (result != Result.Success) { - return (ResultCode)result; + return (ResultCode)result.ErrorCode; } if (!CanAddGuardRegionsInProcess(process, targetAddress, size)) @@ -313,11 +313,11 @@ namespace Ryujinx.HLE.HOS.Services.Ro return ResultCode.Success; } - private KernelResult SetNroMemoryPermissions(KProcess process, IExecutable relocatableObject, ulong baseAddress) + private Result SetNroMemoryPermissions(KProcess process, IExecutable relocatableObject, ulong baseAddress) { - ulong textStart = baseAddress + (ulong)relocatableObject.TextOffset; - ulong roStart = baseAddress + (ulong)relocatableObject.RoOffset; - ulong dataStart = baseAddress + (ulong)relocatableObject.DataOffset; + ulong textStart = baseAddress + relocatableObject.TextOffset; + ulong roStart = baseAddress + relocatableObject.RoOffset; + ulong dataStart = baseAddress + relocatableObject.DataOffset; ulong bssStart = dataStart + (ulong)relocatableObject.Data.Length; @@ -329,18 +329,18 @@ namespace Ryujinx.HLE.HOS.Services.Ro MemoryHelper.FillWithZeros(process.CpuMemory, bssStart, (int)(bssEnd - bssStart)); - KernelResult result; + Result result; result = process.MemoryManager.SetProcessMemoryPermission(textStart, roStart - textStart, KMemoryPermission.ReadAndExecute); - if (result != KernelResult.Success) + if (result != Result.Success) { return result; } result = process.MemoryManager.SetProcessMemoryPermission(roStart, dataStart - roStart, KMemoryPermission.Read); - if (result != KernelResult.Success) + if (result != Result.Success) { return result; } @@ -385,7 +385,7 @@ namespace Ryujinx.HLE.HOS.Services.Ro ulong dataSize = (ulong)info.Executable.Data.Length; ulong bssSize = (ulong)info.Executable.BssSize; - KernelResult result = KernelResult.Success; + Result result = Result.Success; if (info.Executable.BssSize != 0) { @@ -395,14 +395,14 @@ namespace Ryujinx.HLE.HOS.Services.Ro bssSize); } - if (result == KernelResult.Success) + if (result == Result.Success) { result = _owner.MemoryManager.UnmapProcessCodeMemory( info.NroMappedAddress + textSize + roSize, info.Executable.SourceAddress + textSize + roSize, dataSize); - if (result == KernelResult.Success) + if (result == Result.Success) { result = _owner.MemoryManager.UnmapProcessCodeMemory( info.NroMappedAddress, @@ -411,7 +411,7 @@ namespace Ryujinx.HLE.HOS.Services.Ro } } - return (ResultCode)result; + return (ResultCode)result.ErrorCode; } private ResultCode IsInitialized(ulong pid) @@ -452,7 +452,7 @@ namespace Ryujinx.HLE.HOS.Services.Ro if (result == ResultCode.Success) { - result = (ResultCode)SetNroMemoryPermissions(_owner, info.Executable, nroMappedAddress); + result = (ResultCode)SetNroMemoryPermissions(_owner, info.Executable, nroMappedAddress).ErrorCode; if (result == ResultCode.Success) { |