forked from MeloNX/MeloNX
rebase with upstream
This commit is contained in:
parent
038ee1a6dd
commit
e5d54d5374
@ -14,7 +14,7 @@ namespace ARMeilleure.CodeGen.Arm64
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OperatingSystem.IsLinux() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (OperatingSystem.IsLinux())
|
||||||
{
|
{
|
||||||
LinuxFeatureInfoHwCap = (LinuxFeatureFlagsHwCap)getauxval(AT_HWCAP);
|
LinuxFeatureInfoHwCap = (LinuxFeatureFlagsHwCap)getauxval(AT_HWCAP);
|
||||||
LinuxFeatureInfoHwCap2 = (LinuxFeatureFlagsHwCap2)getauxval(AT_HWCAP2);
|
LinuxFeatureInfoHwCap2 = (LinuxFeatureFlagsHwCap2)getauxval(AT_HWCAP2);
|
||||||
|
@ -111,7 +111,7 @@ namespace ARMeilleure.Signal
|
|||||||
return context.BitwiseAnd(err, Const(2ul));
|
return context.BitwiseAnd(err, Const(2ul));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux())
|
||||||
{
|
{
|
||||||
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
|
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
|
||||||
{
|
{
|
||||||
|
@ -413,11 +413,6 @@ namespace ARMeilleure.Translation.PTC
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
ResetCarriersIfNeeded();
|
ResetCarriersIfNeeded();
|
||||||
|
|
||||||
if (!OperatingSystem.IsAndroid())
|
|
||||||
{
|
|
||||||
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_waitEvent.Set();
|
_waitEvent.Set();
|
||||||
@ -793,11 +788,6 @@ namespace ARMeilleure.Translation.PTC
|
|||||||
{
|
{
|
||||||
ResetCarriersIfNeeded();
|
ResetCarriersIfNeeded();
|
||||||
|
|
||||||
if (!OperatingSystem.IsAndroid())
|
|
||||||
{
|
|
||||||
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1010,7 +1000,7 @@ namespace ARMeilleure.Translation.PTC
|
|||||||
osPlatform |= (OperatingSystem.IsLinux() ? 1u : 0u) << 1;
|
osPlatform |= (OperatingSystem.IsLinux() ? 1u : 0u) << 1;
|
||||||
osPlatform |= (OperatingSystem.IsMacOS() ? 1u : 0u) << 2;
|
osPlatform |= (OperatingSystem.IsMacOS() ? 1u : 0u) << 2;
|
||||||
osPlatform |= (OperatingSystem.IsWindows() ? 1u : 0u) << 3;
|
osPlatform |= (OperatingSystem.IsWindows() ? 1u : 0u) << 3;
|
||||||
osPlatform |= (Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid() ? 1u : 0u) << 4;
|
osPlatform |= (Ryujinx.Common.PlatformInfo.IsBionic ? 1u : 0u) << 4;
|
||||||
#pragma warning restore IDE0055
|
#pragma warning restore IDE0055
|
||||||
|
|
||||||
return osPlatform;
|
return osPlatform;
|
||||||
|
@ -7,10 +7,10 @@ using LibRyujinx.Shared.Audio.Oboe;
|
|||||||
using Microsoft.Win32.SafeHandles;
|
using Microsoft.Win32.SafeHandles;
|
||||||
using Rxmxnx.PInvoke;
|
using Rxmxnx.PInvoke;
|
||||||
using Ryujinx.Audio.Backends.OpenAL;
|
using Ryujinx.Audio.Backends.OpenAL;
|
||||||
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Common.Logging.Targets;
|
using Ryujinx.Common.Logging.Targets;
|
||||||
using Ryujinx.Common.SystemInfo;
|
|
||||||
using Ryujinx.HLE.HOS.SystemState;
|
using Ryujinx.HLE.HOS.SystemState;
|
||||||
using Ryujinx.Input;
|
using Ryujinx.Input;
|
||||||
using Silk.NET.Core.Loader;
|
using Silk.NET.Core.Loader;
|
||||||
@ -87,7 +87,7 @@ namespace LibRyujinx
|
|||||||
public static JBoolean JniInitialize(JEnvRef jEnv, JObjectLocalRef jObj, JLong jpathId, JBoolean enableDebugLogs)
|
public static JBoolean JniInitialize(JEnvRef jEnv, JObjectLocalRef jObj, JLong jpathId, JBoolean enableDebugLogs)
|
||||||
{
|
{
|
||||||
Logger.Trace?.Print(LogClass.Application, "Jni Function Call");
|
Logger.Trace?.Print(LogClass.Application, "Jni Function Call");
|
||||||
SystemInfo.IsBionic = true;
|
PlatformInfo.IsBionic = true;
|
||||||
|
|
||||||
Logger.AddTarget(
|
Logger.AddTarget(
|
||||||
new AsyncLogTargetWrapper(
|
new AsyncLogTargetWrapper(
|
||||||
|
@ -9,8 +9,8 @@ namespace LibRyujinx.Jni.Pointers
|
|||||||
{
|
{
|
||||||
public readonly struct JBooleanRef
|
public readonly struct JBooleanRef
|
||||||
{
|
{
|
||||||
private const Int32 JBooleanResultFalse = 0;
|
private static readonly Int32 JBooleanResultFalse = 0;
|
||||||
private const Int32 JBooleanResultTrue = 1;
|
private static readonly Int32 JBooleanResultTrue = 1;
|
||||||
|
|
||||||
#pragma warning disable IDE0052
|
#pragma warning disable IDE0052
|
||||||
private readonly IntPtr _value;
|
private readonly IntPtr _value;
|
||||||
@ -20,6 +20,11 @@ namespace LibRyujinx.Jni.Pointers
|
|||||||
=> this._value = jBoolean.HasValue ? GetJBooleanRef(jBoolean.Value) : IntPtr.Zero;
|
=> this._value = jBoolean.HasValue ? GetJBooleanRef(jBoolean.Value) : IntPtr.Zero;
|
||||||
|
|
||||||
private static IntPtr GetJBooleanRef(Boolean value)
|
private static IntPtr GetJBooleanRef(Boolean value)
|
||||||
=> value ? Unsafe.AsRef(JBooleanResultTrue).GetUnsafeIntPtr() : Unsafe.AsRef(JBooleanResultFalse).GetUnsafeIntPtr();
|
{
|
||||||
|
// Probably gonna break stuff
|
||||||
|
var t = JBooleanResultTrue;
|
||||||
|
var f = JBooleanResultFalse;
|
||||||
|
return value ? Unsafe.AsRef(ref f).GetUnsafeIntPtr() : Unsafe.AsRef(ref t).GetUnsafeIntPtr();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace LibRyujinx.Jni.Values
|
|||||||
|
|
||||||
public Boolean IsDefault => isDefault(this);
|
public Boolean IsDefault => isDefault(this);
|
||||||
|
|
||||||
public static JValue Create(ReadOnlySpan<Byte> source)
|
public static JValue Create(in ReadOnlySpan<Byte> source)
|
||||||
{
|
{
|
||||||
Byte[] result = new Byte[Size];
|
Byte[] result = new Byte[Size];
|
||||||
for (Int32 i = 0; i < source.Length; i++)
|
for (Int32 i = 0; i < source.Length; i++)
|
||||||
@ -38,7 +38,10 @@ namespace LibRyujinx.Jni.Values
|
|||||||
=> (jValue._value1 + jValue._value2 + jValue._value3) == default
|
=> (jValue._value1 + jValue._value2 + jValue._value3) == default
|
||||||
&& jValue._value4 == default;
|
&& jValue._value4 == default;
|
||||||
|
|
||||||
private static Boolean DefaultLong(in JValue jValue) =>
|
private static Boolean DefaultLong(in JValue jValue)
|
||||||
Unsafe.AsRef(jValue).Transform<JValue, Int64>() == default;
|
{
|
||||||
|
var jv = jValue;
|
||||||
|
return Unsafe.AsRef(ref jv).Transform<JValue, Int64>() == default;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ namespace LibRyujinx
|
|||||||
[UnmanagedCallersOnly(EntryPoint = "graphics_initialize")]
|
[UnmanagedCallersOnly(EntryPoint = "graphics_initialize")]
|
||||||
public static bool InitializeGraphicsNative(GraphicsConfiguration graphicsConfiguration)
|
public static bool InitializeGraphicsNative(GraphicsConfiguration graphicsConfiguration)
|
||||||
{
|
{
|
||||||
if(Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if(Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
Silk.NET.Core.Loader.SearchPathContainer.Platform = Silk.NET.Core.Loader.UnderlyingPlatform.Android;
|
Silk.NET.Core.Loader.SearchPathContainer.Platform = Silk.NET.Core.Loader.UnderlyingPlatform.Android;
|
||||||
}
|
}
|
||||||
@ -179,7 +179,7 @@ namespace LibRyujinx
|
|||||||
|
|
||||||
debug_break(1);
|
debug_break(1);
|
||||||
|
|
||||||
if (Ryujinx.Common.SystemInfo.SystemInfo.IsBionic)
|
if (Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
setRenderingThread();
|
setRenderingThread();
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,14 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PublishAot>true</PublishAot>
|
<PublishAot>true</PublishAot>
|
||||||
|
<NativeLib>Shared</NativeLib>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||||
<OptimizationPreference>Speed</OptimizationPreference>
|
<Optimize>true</Optimize>
|
||||||
|
<OptimizationPreference>Speed</OptimizationPreference>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Ryujinx.Audio.Backends.OpenAL\Ryujinx.Audio.Backends.OpenAL.csproj" />
|
<ProjectReference Include="..\Ryujinx.Audio.Backends.OpenAL\Ryujinx.Audio.Backends.OpenAL.csproj" />
|
||||||
|
@ -126,7 +126,7 @@ namespace Ryujinx.Common.Logging
|
|||||||
|
|
||||||
_time = Stopwatch.StartNew();
|
_time = Stopwatch.StartNew();
|
||||||
|
|
||||||
if (!Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (!Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
// Logger should log to console by default
|
// Logger should log to console by default
|
||||||
AddTarget(new AsyncLogTargetWrapper(
|
AddTarget(new AsyncLogTargetWrapper(
|
||||||
|
13
src/Ryujinx.Common/PlatformInfo.cs
Normal file
13
src/Ryujinx.Common/PlatformInfo.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Ryujinx.Common
|
||||||
|
{
|
||||||
|
public static class PlatformInfo
|
||||||
|
{
|
||||||
|
public static bool IsBionic { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -35,7 +35,7 @@ namespace Ryujinx.Common
|
|||||||
return BuildVersion;
|
return BuildVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SystemInfo.SystemInfo.IsBionic)
|
if (PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
return "Android_1.0";
|
return "Android_1.0";
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ namespace Ryujinx.Common
|
|||||||
#else
|
#else
|
||||||
public static string GetBaseApplicationDirectory()
|
public static string GetBaseApplicationDirectory()
|
||||||
{
|
{
|
||||||
if (IsFlatHubBuild() || OperatingSystem.IsMacOS() || SystemInfo.SystemInfo.IsBionic)
|
if (IsFlatHubBuild() || OperatingSystem.IsMacOS() || PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
return AppDataManager.BaseDirPath;
|
return AppDataManager.BaseDirPath;
|
||||||
}
|
}
|
||||||
|
@ -126,11 +126,6 @@ namespace Ryujinx.Cpu.Jit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public void Reprotect(ulong va, ulong size, MemoryPermission permission)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public T Read<T>(ulong va) where T : unmanaged
|
public T Read<T>(ulong va) where T : unmanaged
|
||||||
{
|
{
|
||||||
|
@ -194,11 +194,6 @@ namespace Ryujinx.Cpu.Jit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public void Reprotect(ulong va, ulong size, MemoryPermission permission)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public T Read<T>(ulong va) where T : unmanaged
|
public T Read<T>(ulong va) where T : unmanaged
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,7 @@ namespace Ryujinx.Cpu.Nce
|
|||||||
|
|
||||||
public static IntPtr GetCurrentThreadHandle()
|
public static IntPtr GetCurrentThreadHandle()
|
||||||
{
|
{
|
||||||
if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsBionic)
|
if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
return NceThreadPalUnix.GetCurrentThreadHandle();
|
return NceThreadPalUnix.GetCurrentThreadHandle();
|
||||||
}
|
}
|
||||||
@ -23,7 +23,7 @@ namespace Ryujinx.Cpu.Nce
|
|||||||
|
|
||||||
public static void SuspendThread(IntPtr handle)
|
public static void SuspendThread(IntPtr handle)
|
||||||
{
|
{
|
||||||
if (Ryujinx.Common.SystemInfo.SystemInfo.IsBionic)
|
if (Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
NceThreadPalAndroid.SuspendThread(handle);
|
NceThreadPalAndroid.SuspendThread(handle);
|
||||||
}
|
}
|
||||||
|
@ -88,11 +88,11 @@ namespace Ryujinx.Cpu.Signal
|
|||||||
|
|
||||||
ref SignalHandlerConfig config = ref GetConfigRef();
|
ref SignalHandlerConfig config = ref GetConfigRef();
|
||||||
|
|
||||||
if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
_signalHandlerPtr = MapCode(NativeSignalHandlerGenerator.GenerateUnixSignalHandler(_handlerConfig, rangeStructSize, pageSize));
|
_signalHandlerPtr = MapCode(NativeSignalHandlerGenerator.GenerateUnixSignalHandler(_handlerConfig, rangeStructSize, pageSize));
|
||||||
|
|
||||||
if (Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
config.StructAddressOffset = 16; // si_addr
|
config.StructAddressOffset = 16; // si_addr
|
||||||
config.StructWriteOffset = 8; // si_code
|
config.StructWriteOffset = 8; // si_code
|
||||||
|
@ -68,7 +68,7 @@ namespace Ryujinx.Cpu.Signal
|
|||||||
int result;
|
int result;
|
||||||
SigAction old;
|
SigAction old;
|
||||||
|
|
||||||
if (Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
result = sigaction(SIGSEGV, IntPtr.Zero, out SigActionBionic tmp);
|
result = sigaction(SIGSEGV, IntPtr.Zero, out SigActionBionic tmp);
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ namespace Ryujinx.Cpu.Signal
|
|||||||
int result;
|
int result;
|
||||||
SigAction old;
|
SigAction old;
|
||||||
|
|
||||||
if (Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
SigActionBionic sig = new()
|
SigActionBionic sig = new()
|
||||||
{
|
{
|
||||||
@ -185,7 +185,7 @@ namespace Ryujinx.Cpu.Signal
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
SigActionBionic sig = new()
|
SigActionBionic sig = new()
|
||||||
{
|
{
|
||||||
@ -233,7 +233,7 @@ namespace Ryujinx.Cpu.Signal
|
|||||||
|
|
||||||
public static bool RestoreExceptionHandler(SigAction oldAction)
|
public static bool RestoreExceptionHandler(SigAction oldAction)
|
||||||
{
|
{
|
||||||
if (Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
SigActionBionic tmp = new SigActionBionic
|
SigActionBionic tmp = new SigActionBionic
|
||||||
{
|
{
|
||||||
|
@ -142,7 +142,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
ImageFormat = surfaceFormat.Format,
|
ImageFormat = surfaceFormat.Format,
|
||||||
ImageColorSpace = surfaceFormat.ColorSpace,
|
ImageColorSpace = surfaceFormat.ColorSpace,
|
||||||
ImageExtent = extent,
|
ImageExtent = extent,
|
||||||
ImageUsage = ImageUsageFlags.ColorAttachmentBit | ImageUsageFlags.TransferDstBit | (Ryujinx.Common.SystemInfo.SystemInfo.IsBionic ? 0 : ImageUsageFlags.StorageBit),
|
ImageUsage = ImageUsageFlags.ColorAttachmentBit | ImageUsageFlags.TransferDstBit | (Ryujinx.Common.PlatformInfo.IsBionic ? 0 : ImageUsageFlags.StorageBit),
|
||||||
ImageSharingMode = SharingMode.Exclusive,
|
ImageSharingMode = SharingMode.Exclusive,
|
||||||
ImageArrayLayers = 1,
|
ImageArrayLayers = 1,
|
||||||
PreTransform = capabilities.CurrentTransform,
|
PreTransform = capabilities.CurrentTransform,
|
||||||
|
@ -25,7 +25,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
|
|||||||
IsAnyInternetRequestAccepted = true, // NOTE: Why not accept any internet request?
|
IsAnyInternetRequestAccepted = true, // NOTE: Why not accept any internet request?
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!Ryujinx.Common.SystemInfo.SystemInfo.IsBionic)
|
if (!Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
NetworkChange.NetworkAddressChanged += LocalInterfaceCacheHandler;
|
NetworkChange.NetworkAddressChanged += LocalInterfaceCacheHandler;
|
||||||
}
|
}
|
||||||
@ -199,7 +199,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
|
|||||||
{
|
{
|
||||||
if (isDisposing)
|
if (isDisposing)
|
||||||
{
|
{
|
||||||
if (!Ryujinx.Common.SystemInfo.SystemInfo.IsBionic)
|
if (!Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
NetworkChange.NetworkAddressChanged -= LocalInterfaceCacheHandler;
|
NetworkChange.NetworkAddressChanged -= LocalInterfaceCacheHandler;
|
||||||
}
|
}
|
||||||
|
@ -96,11 +96,6 @@ namespace Ryujinx.Memory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public void Reprotect(ulong va, ulong size, MemoryPermission permission)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public T Read<T>(ulong va) where T : unmanaged
|
public T Read<T>(ulong va) where T : unmanaged
|
||||||
{
|
{
|
||||||
|
@ -44,14 +44,6 @@ namespace Ryujinx.Memory
|
|||||||
/// <param name="size">Size of the range to be unmapped</param>
|
/// <param name="size">Size of the range to be unmapped</param>
|
||||||
void Unmap(ulong va, ulong size);
|
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>
|
/// <summary>
|
||||||
/// Reads data from CPU mapped memory.
|
/// Reads data from CPU mapped memory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -426,7 +426,7 @@ namespace Ryujinx.Memory
|
|||||||
return OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134);
|
return OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134);
|
||||||
}
|
}
|
||||||
|
|
||||||
return OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid();
|
return OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -10,7 +10,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
return MemoryManagementWindows.Allocate((IntPtr)size);
|
return MemoryManagementWindows.Allocate((IntPtr)size);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
return MemoryManagementUnix.Allocate(size, forJit);
|
return MemoryManagementUnix.Allocate(size, forJit);
|
||||||
}
|
}
|
||||||
@ -26,7 +26,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
return MemoryManagementWindows.Reserve((IntPtr)size, viewCompatible);
|
return MemoryManagementWindows.Reserve((IntPtr)size, viewCompatible);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
return MemoryManagementUnix.Reserve(size, forJit);
|
return MemoryManagementUnix.Reserve(size, forJit);
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
MemoryManagementWindows.Commit(address, (IntPtr)size);
|
MemoryManagementWindows.Commit(address, (IntPtr)size);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
MemoryManagementUnix.Commit(address, size, forJit);
|
MemoryManagementUnix.Commit(address, size, forJit);
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
MemoryManagementWindows.Decommit(address, (IntPtr)size);
|
MemoryManagementWindows.Decommit(address, (IntPtr)size);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
MemoryManagementUnix.Decommit(address, size);
|
MemoryManagementUnix.Decommit(address, size);
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
MemoryManagementWindows.MapView(sharedMemory, srcOffset, address, (IntPtr)size, owner);
|
MemoryManagementWindows.MapView(sharedMemory, srcOffset, address, (IntPtr)size, owner);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
MemoryManagementUnix.MapView(sharedMemory, srcOffset, address, size);
|
MemoryManagementUnix.MapView(sharedMemory, srcOffset, address, size);
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
MemoryManagementWindows.UnmapView(sharedMemory, address, (IntPtr)size, owner);
|
MemoryManagementWindows.UnmapView(sharedMemory, address, (IntPtr)size, owner);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
MemoryManagementUnix.UnmapView(address, size);
|
MemoryManagementUnix.UnmapView(address, size);
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
result = MemoryManagementWindows.Reprotect(address, (IntPtr)size, permission, forView);
|
result = MemoryManagementWindows.Reprotect(address, (IntPtr)size, permission, forView);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
result = MemoryManagementUnix.Reprotect(address, size, permission);
|
result = MemoryManagementUnix.Reprotect(address, size, permission);
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
return MemoryManagementWindows.Free(address, (IntPtr)size);
|
return MemoryManagementWindows.Free(address, (IntPtr)size);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
return MemoryManagementUnix.Free(address);
|
return MemoryManagementUnix.Free(address);
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
return MemoryManagementWindows.CreateSharedMemory((IntPtr)size, reserve);
|
return MemoryManagementWindows.CreateSharedMemory((IntPtr)size, reserve);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
return MemoryManagementUnix.CreateSharedMemory(size, reserve);
|
return MemoryManagementUnix.CreateSharedMemory(size, reserve);
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
MemoryManagementWindows.DestroySharedMemory(handle);
|
MemoryManagementWindows.DestroySharedMemory(handle);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
MemoryManagementUnix.DestroySharedMemory(handle);
|
MemoryManagementUnix.DestroySharedMemory(handle);
|
||||||
}
|
}
|
||||||
@ -177,7 +177,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
return MemoryManagementWindows.MapSharedMemory(handle);
|
return MemoryManagementWindows.MapSharedMemory(handle);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
return MemoryManagementUnix.MapSharedMemory(handle, size);
|
return MemoryManagementUnix.MapSharedMemory(handle, size);
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ namespace Ryujinx.Memory
|
|||||||
{
|
{
|
||||||
MemoryManagementWindows.UnmapSharedMemory(address);
|
MemoryManagementWindows.UnmapSharedMemory(address);
|
||||||
}
|
}
|
||||||
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
MemoryManagementUnix.UnmapSharedMemory(address, size);
|
MemoryManagementUnix.UnmapSharedMemory(address, size);
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ namespace Ryujinx.Memory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
else if (Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
byte[] memName = "Ryujinx-XXXXXX"u8.ToArray();
|
byte[] memName = "Ryujinx-XXXXXX"u8.ToArray();
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ namespace Ryujinx.Memory
|
|||||||
|
|
||||||
if (flags.HasFlag(MmapFlags.MAP_ANONYMOUS))
|
if (flags.HasFlag(MmapFlags.MAP_ANONYMOUS))
|
||||||
{
|
{
|
||||||
if (OperatingSystem.IsLinux() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (OperatingSystem.IsLinux() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
result |= MAP_ANONYMOUS_LINUX_GENERIC;
|
result |= MAP_ANONYMOUS_LINUX_GENERIC;
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ namespace Ryujinx.Memory
|
|||||||
|
|
||||||
if (flags.HasFlag(MmapFlags.MAP_NORESERVE))
|
if (flags.HasFlag(MmapFlags.MAP_NORESERVE))
|
||||||
{
|
{
|
||||||
if (OperatingSystem.IsLinux() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (OperatingSystem.IsLinux() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
result |= MAP_NORESERVE_LINUX_GENERIC;
|
result |= MAP_NORESERVE_LINUX_GENERIC;
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ namespace Ryujinx.Memory
|
|||||||
|
|
||||||
if (flags.HasFlag(MmapFlags.MAP_UNLOCKED))
|
if (flags.HasFlag(MmapFlags.MAP_UNLOCKED))
|
||||||
{
|
{
|
||||||
if (OperatingSystem.IsLinux() || Ryujinx.Common.SystemInfo.SystemInfo.IsAndroid())
|
if (OperatingSystem.IsLinux() || Ryujinx.Common.PlatformInfo.IsBionic)
|
||||||
{
|
{
|
||||||
result |= MAP_UNLOCKED_LINUX_GENERIC;
|
result |= MAP_UNLOCKED_LINUX_GENERIC;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ namespace Ryujinx.Ui.Common.SystemInfo
|
|||||||
{
|
{
|
||||||
public class SystemInfo
|
public class SystemInfo
|
||||||
{
|
{
|
||||||
public static bool IsBionic { get; set; }
|
|
||||||
public string OsDescription { get; protected set; }
|
public string OsDescription { get; protected set; }
|
||||||
public string CpuName { get; protected set; }
|
public string CpuName { get; protected set; }
|
||||||
public ulong RamTotal { get; protected set; }
|
public ulong RamTotal { get; protected set; }
|
||||||
@ -76,10 +75,5 @@ namespace Ryujinx.Ui.Common.SystemInfo
|
|||||||
|
|
||||||
return string.IsNullOrEmpty(name) ? null : name;
|
return string.IsNullOrEmpty(name) ? null : name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsAndroid()
|
|
||||||
{
|
|
||||||
return OperatingSystem.IsAndroid() || IsBionic;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user