Update Ryujinx.HLE
This commit is contained in:
parent
4069fa8e33
commit
c533716e5d
36 changed files with 210 additions and 188 deletions
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,6 @@ namespace Ryujinx.HLE.Exceptions
|
||||||
|
|
||||||
public UndefinedInstructionException() : base() { }
|
public UndefinedInstructionException() : base() { }
|
||||||
|
|
||||||
public UndefinedInstructionException(long position, int opCode) : base(string.Format(ExMsg, position, opCode)) { }
|
public UndefinedInstructionException(ulong address, int opCode) : base(string.Format(ExMsg, address, opCode)) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS
|
namespace Ryujinx.HLE.HOS
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Ipc;
|
using Ryujinx.HLE.HOS.Kernel.Ipc;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Kernel.Common
|
namespace Ryujinx.HLE.HOS.Kernel.Common
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using ChocolArm64.State;
|
|
||||||
using Ryujinx.HLE.HOS.Diagnostics.Demangler;
|
using Ryujinx.HLE.HOS.Diagnostics.Demangler;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Memory;
|
using Ryujinx.HLE.HOS.Kernel.Memory;
|
||||||
using Ryujinx.HLE.Loaders.Elf;
|
using Ryujinx.HLE.Loaders.Elf;
|
||||||
|
@ -40,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
_images = new List<Image>();
|
_images = new List<Image>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetGuestStackTrace(CpuThreadState threadState)
|
public string GetGuestStackTrace(ARMeilleure.State.ExecutionContext context)
|
||||||
{
|
{
|
||||||
EnsureLoaded();
|
EnsureLoaded();
|
||||||
|
|
||||||
|
@ -74,7 +73,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: ARM32.
|
// TODO: ARM32.
|
||||||
long framePointer = (long)threadState.X29;
|
long framePointer = (long)context.GetX(29);
|
||||||
|
|
||||||
trace.AppendLine($"Process: {_owner.Name}, PID: {_owner.Pid}");
|
trace.AppendLine($"Process: {_owner.Name}, PID: {_owner.Pid}");
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
using ChocolArm64;
|
using ARMeilleure.Memory;
|
||||||
using ChocolArm64.Events;
|
using ARMeilleure.State;
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Translation;
|
||||||
using ChocolArm64.Translation;
|
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
|
||||||
using Ryujinx.HLE.Exceptions;
|
using Ryujinx.HLE.Exceptions;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Memory;
|
using Ryujinx.HLE.HOS.Kernel.Memory;
|
||||||
|
@ -793,11 +791,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SubscribeThreadEventHandlers(CpuThread context)
|
public void SubscribeThreadEventHandlers(ARMeilleure.State.ExecutionContext context)
|
||||||
{
|
{
|
||||||
context.ThreadState.Interrupt += InterruptHandler;
|
context.Interrupt += InterruptHandler;
|
||||||
context.ThreadState.SvcCall += _svcHandler.SvcCall;
|
context.SupervisorCall += _svcHandler.SvcCall;
|
||||||
context.ThreadState.Undefined += UndefinedInstructionHandler;
|
context.Undefined += UndefinedInstructionHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InterruptHandler(object sender, EventArgs e)
|
private void InterruptHandler(object sender, EventArgs e)
|
||||||
|
@ -1001,9 +999,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
{
|
{
|
||||||
foreach (KThread thread in _threads)
|
foreach (KThread thread in _threads)
|
||||||
{
|
{
|
||||||
thread.Context.StopExecution();
|
thread.Context.Running = false;
|
||||||
|
|
||||||
System.Scheduler.CoreManager.Set(thread.Context.Work);
|
System.Scheduler.CoreManager.Set(thread.HostThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1029,8 +1027,6 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
MemoryManager = new KMemoryManager(_system, CpuMemory);
|
MemoryManager = new KMemoryManager(_system, CpuMemory);
|
||||||
|
|
||||||
Translator = new Translator(CpuMemory);
|
Translator = new Translator(CpuMemory);
|
||||||
|
|
||||||
Translator.CpuTrace += CpuTraceHandler;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PrintCurrentThreadStackTrace()
|
public void PrintCurrentThreadStackTrace()
|
||||||
|
@ -1038,14 +1034,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
System.Scheduler.GetCurrentThread().PrintGuestStackTrace();
|
System.Scheduler.GetCurrentThread().PrintGuestStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CpuTraceHandler(object sender, CpuTraceEventArgs e)
|
|
||||||
{
|
|
||||||
Logger.PrintInfo(LogClass.Cpu, $"Executing at 0x{e.Position:X16}.");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UndefinedInstructionHandler(object sender, InstUndefinedEventArgs e)
|
private void UndefinedInstructionHandler(object sender, InstUndefinedEventArgs e)
|
||||||
{
|
{
|
||||||
throw new UndefinedInstructionException(e.Position, e.RawOpCode);
|
throw new UndefinedInstructionException(e.Address, e.OpCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,4 @@
|
||||||
using ChocolArm64.Events;
|
using ARMeilleure.State;
|
||||||
using ChocolArm64.State;
|
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
@ -20,16 +19,16 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
|
|
||||||
public void SvcCall(object sender, InstExceptionEventArgs e)
|
public void SvcCall(object sender, InstExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
Action<SvcHandler, CpuThreadState> svcFunc = SvcTable.GetSvcFunc(e.Id);
|
Action<SvcHandler, ExecutionContext> svcFunc = SvcTable.GetSvcFunc(e.Id);
|
||||||
|
|
||||||
if (svcFunc == null)
|
if (svcFunc == null)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException($"SVC 0x{e.Id:X4} is not implemented.");
|
throw new NotImplementedException($"SVC 0x{e.Id:X4} is not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
CpuThreadState threadState = (CpuThreadState)sender;
|
ExecutionContext context = (ExecutionContext)sender;
|
||||||
|
|
||||||
svcFunc(this, threadState);
|
svcFunc(this, context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -83,7 +83,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
|
|
||||||
public KernelResult SendSyncRequest64(int handle)
|
public KernelResult SendSyncRequest64(int handle)
|
||||||
{
|
{
|
||||||
return SendSyncRequest((ulong)_system.Scheduler.GetCurrentThread().Context.ThreadState.Tpidr, 0x100, handle);
|
return SendSyncRequest((ulong)_system.Scheduler.GetCurrentThread().Context.Tpidr, 0x100, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KernelResult SendSyncRequestWithUserBuffer64(ulong messagePtr, ulong size, int handle)
|
public KernelResult SendSyncRequestWithUserBuffer64(ulong messagePtr, ulong size, int handle)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.Exceptions;
|
using Ryujinx.HLE.Exceptions;
|
||||||
|
@ -138,7 +138,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
|
|
||||||
public ulong GetSystemTick64()
|
public ulong GetSystemTick64()
|
||||||
{
|
{
|
||||||
return _system.Scheduler.GetCurrentThread().Context.ThreadState.CntpctEl0;
|
return _system.Scheduler.GetCurrentThread().Context.CntpctEl0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public KernelResult GetProcessId64(int handle, out long pid)
|
public KernelResult GetProcessId64(int handle, out long pid)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.State;
|
using ARMeilleure.State;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
using System;
|
using System;
|
||||||
|
@ -14,7 +14,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
|
|
||||||
private static Dictionary<int, string> _svcFuncs64;
|
private static Dictionary<int, string> _svcFuncs64;
|
||||||
|
|
||||||
private static Action<SvcHandler, CpuThreadState>[] _svcTable64;
|
private static Action<SvcHandler, ExecutionContext>[] _svcTable64;
|
||||||
|
|
||||||
static SvcTable()
|
static SvcTable()
|
||||||
{
|
{
|
||||||
|
@ -77,10 +77,10 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
{ 0x78, nameof(SvcHandler.UnmapProcessCodeMemory64) }
|
{ 0x78, nameof(SvcHandler.UnmapProcessCodeMemory64) }
|
||||||
};
|
};
|
||||||
|
|
||||||
_svcTable64 = new Action<SvcHandler, CpuThreadState>[0x80];
|
_svcTable64 = new Action<SvcHandler, ExecutionContext>[0x80];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Action<SvcHandler, CpuThreadState> GetSvcFunc(int svcId)
|
public static Action<SvcHandler, ExecutionContext> GetSvcFunc(int svcId)
|
||||||
{
|
{
|
||||||
if (_svcTable64[svcId] != null)
|
if (_svcTable64[svcId] != null)
|
||||||
{
|
{
|
||||||
|
@ -95,9 +95,9 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Action<SvcHandler, CpuThreadState> GenerateMethod(string svcName)
|
private static Action<SvcHandler, ExecutionContext> GenerateMethod(string svcName)
|
||||||
{
|
{
|
||||||
Type[] argTypes = new Type[] { typeof(SvcHandler), typeof(CpuThreadState) };
|
Type[] argTypes = new Type[] { typeof(SvcHandler), typeof(ExecutionContext) };
|
||||||
|
|
||||||
DynamicMethod method = new DynamicMethod(svcName, null, argTypes);
|
DynamicMethod method = new DynamicMethod(svcName, null, argTypes);
|
||||||
|
|
||||||
|
@ -183,7 +183,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
generator.Emit(OpCodes.Conv_I);
|
generator.Emit(OpCodes.Conv_I);
|
||||||
|
|
||||||
generator.Emit(OpCodes.Ldarg_1);
|
generator.Emit(OpCodes.Ldarg_1);
|
||||||
generator.Emit(OpCodes.Ldfld, GetStateFieldX(byRefArgsCount + index));
|
generator.Emit(OpCodes.Ldc_I4, byRefArgsCount + index);
|
||||||
|
|
||||||
|
MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.GetX));
|
||||||
|
|
||||||
|
generator.Emit(OpCodes.Call, info);
|
||||||
|
|
||||||
generator.Emit(OpCodes.Box, typeof(ulong));
|
generator.Emit(OpCodes.Box, typeof(ulong));
|
||||||
|
|
||||||
|
@ -227,7 +231,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
generator.Emit(OpCodes.Ldarg_1);
|
generator.Emit(OpCodes.Ldarg_1);
|
||||||
generator.Emit(OpCodes.Ldfld, GetStateFieldX(byRefArgsCount + index));
|
generator.Emit(OpCodes.Ldc_I4, byRefArgsCount + index);
|
||||||
|
|
||||||
|
MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.GetX));
|
||||||
|
|
||||||
|
generator.Emit(OpCodes.Call, info);
|
||||||
|
|
||||||
ConvertToArgType(argType);
|
ConvertToArgType(argType);
|
||||||
}
|
}
|
||||||
|
@ -258,51 +266,44 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
|
|
||||||
generator.Emit(OpCodes.Stloc, tempLocal);
|
generator.Emit(OpCodes.Stloc, tempLocal);
|
||||||
generator.Emit(OpCodes.Ldarg_1);
|
generator.Emit(OpCodes.Ldarg_1);
|
||||||
|
generator.Emit(OpCodes.Ldc_I4, outRegIndex++);
|
||||||
generator.Emit(OpCodes.Ldloc, tempLocal);
|
generator.Emit(OpCodes.Ldloc, tempLocal);
|
||||||
|
|
||||||
ConvertToFieldType(retType);
|
ConvertToFieldType(retType);
|
||||||
|
|
||||||
generator.Emit(OpCodes.Stfld, GetStateFieldX(outRegIndex++));
|
MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.SetX));
|
||||||
|
|
||||||
|
generator.Emit(OpCodes.Call, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int index = 0; index < locals.Count; index++)
|
for (int index = 0; index < locals.Count; index++)
|
||||||
{
|
{
|
||||||
generator.Emit(OpCodes.Ldarg_1);
|
generator.Emit(OpCodes.Ldarg_1);
|
||||||
|
generator.Emit(OpCodes.Ldc_I4, outRegIndex++);
|
||||||
generator.Emit(OpCodes.Ldloc, locals[index]);
|
generator.Emit(OpCodes.Ldloc, locals[index]);
|
||||||
|
|
||||||
ConvertToFieldType(locals[index].LocalType);
|
ConvertToFieldType(locals[index].LocalType);
|
||||||
|
|
||||||
generator.Emit(OpCodes.Stfld, GetStateFieldX(outRegIndex++));
|
MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.SetX));
|
||||||
|
|
||||||
|
generator.Emit(OpCodes.Call, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zero out the remaining unused registers.
|
// Zero out the remaining unused registers.
|
||||||
while (outRegIndex < SvcFuncMaxArguments)
|
while (outRegIndex < SvcFuncMaxArguments)
|
||||||
{
|
{
|
||||||
generator.Emit(OpCodes.Ldarg_1);
|
generator.Emit(OpCodes.Ldarg_1);
|
||||||
|
generator.Emit(OpCodes.Ldc_I4, outRegIndex++);
|
||||||
generator.Emit(OpCodes.Ldc_I8, 0L);
|
generator.Emit(OpCodes.Ldc_I8, 0L);
|
||||||
generator.Emit(OpCodes.Stfld, GetStateFieldX(outRegIndex++));
|
|
||||||
|
MethodInfo info = typeof(ExecutionContext).GetMethod(nameof(ExecutionContext.SetX));
|
||||||
|
|
||||||
|
generator.Emit(OpCodes.Call, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
generator.Emit(OpCodes.Ret);
|
generator.Emit(OpCodes.Ret);
|
||||||
|
|
||||||
return (Action<SvcHandler, CpuThreadState>)method.CreateDelegate(typeof(Action<SvcHandler, CpuThreadState>));
|
return (Action<SvcHandler, ExecutionContext>)method.CreateDelegate(typeof(Action<SvcHandler, ExecutionContext>));
|
||||||
}
|
|
||||||
|
|
||||||
private static FieldInfo GetStateFieldX(int index)
|
|
||||||
{
|
|
||||||
switch (index)
|
|
||||||
{
|
|
||||||
case 0: return typeof(CpuThreadState).GetField(nameof(CpuThreadState.X0));
|
|
||||||
case 1: return typeof(CpuThreadState).GetField(nameof(CpuThreadState.X1));
|
|
||||||
case 2: return typeof(CpuThreadState).GetField(nameof(CpuThreadState.X2));
|
|
||||||
case 3: return typeof(CpuThreadState).GetField(nameof(CpuThreadState.X3));
|
|
||||||
case 4: return typeof(CpuThreadState).GetField(nameof(CpuThreadState.X4));
|
|
||||||
case 5: return typeof(CpuThreadState).GetField(nameof(CpuThreadState.X5));
|
|
||||||
case 6: return typeof(CpuThreadState).GetField(nameof(CpuThreadState.X6));
|
|
||||||
case 7: return typeof(CpuThreadState).GetField(nameof(CpuThreadState.X7));
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(index));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CheckIfTypeIsSupported(Type type, string svcName)
|
private static void CheckIfTypeIsSupported(Type type, string svcName)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
|
using ARMeilleure.State;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||||
|
@ -349,81 +350,89 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
|
|
||||||
MemoryManager memory = currentProcess.CpuMemory;
|
MemoryManager memory = currentProcess.CpuMemory;
|
||||||
|
|
||||||
memory.WriteUInt64((long)address + 0x0, thread.Context.ThreadState.X0);
|
memory.WriteUInt64((long)address + 0x0, thread.Context.GetX(0));
|
||||||
memory.WriteUInt64((long)address + 0x8, thread.Context.ThreadState.X1);
|
memory.WriteUInt64((long)address + 0x8, thread.Context.GetX(1));
|
||||||
memory.WriteUInt64((long)address + 0x10, thread.Context.ThreadState.X2);
|
memory.WriteUInt64((long)address + 0x10, thread.Context.GetX(2));
|
||||||
memory.WriteUInt64((long)address + 0x18, thread.Context.ThreadState.X3);
|
memory.WriteUInt64((long)address + 0x18, thread.Context.GetX(3));
|
||||||
memory.WriteUInt64((long)address + 0x20, thread.Context.ThreadState.X4);
|
memory.WriteUInt64((long)address + 0x20, thread.Context.GetX(4));
|
||||||
memory.WriteUInt64((long)address + 0x28, thread.Context.ThreadState.X5);
|
memory.WriteUInt64((long)address + 0x28, thread.Context.GetX(5));
|
||||||
memory.WriteUInt64((long)address + 0x30, thread.Context.ThreadState.X6);
|
memory.WriteUInt64((long)address + 0x30, thread.Context.GetX(6));
|
||||||
memory.WriteUInt64((long)address + 0x38, thread.Context.ThreadState.X7);
|
memory.WriteUInt64((long)address + 0x38, thread.Context.GetX(7));
|
||||||
memory.WriteUInt64((long)address + 0x40, thread.Context.ThreadState.X8);
|
memory.WriteUInt64((long)address + 0x40, thread.Context.GetX(8));
|
||||||
memory.WriteUInt64((long)address + 0x48, thread.Context.ThreadState.X9);
|
memory.WriteUInt64((long)address + 0x48, thread.Context.GetX(9));
|
||||||
memory.WriteUInt64((long)address + 0x50, thread.Context.ThreadState.X10);
|
memory.WriteUInt64((long)address + 0x50, thread.Context.GetX(10));
|
||||||
memory.WriteUInt64((long)address + 0x58, thread.Context.ThreadState.X11);
|
memory.WriteUInt64((long)address + 0x58, thread.Context.GetX(11));
|
||||||
memory.WriteUInt64((long)address + 0x60, thread.Context.ThreadState.X12);
|
memory.WriteUInt64((long)address + 0x60, thread.Context.GetX(12));
|
||||||
memory.WriteUInt64((long)address + 0x68, thread.Context.ThreadState.X13);
|
memory.WriteUInt64((long)address + 0x68, thread.Context.GetX(13));
|
||||||
memory.WriteUInt64((long)address + 0x70, thread.Context.ThreadState.X14);
|
memory.WriteUInt64((long)address + 0x70, thread.Context.GetX(14));
|
||||||
memory.WriteUInt64((long)address + 0x78, thread.Context.ThreadState.X15);
|
memory.WriteUInt64((long)address + 0x78, thread.Context.GetX(15));
|
||||||
memory.WriteUInt64((long)address + 0x80, thread.Context.ThreadState.X16);
|
memory.WriteUInt64((long)address + 0x80, thread.Context.GetX(16));
|
||||||
memory.WriteUInt64((long)address + 0x88, thread.Context.ThreadState.X17);
|
memory.WriteUInt64((long)address + 0x88, thread.Context.GetX(17));
|
||||||
memory.WriteUInt64((long)address + 0x90, thread.Context.ThreadState.X18);
|
memory.WriteUInt64((long)address + 0x90, thread.Context.GetX(18));
|
||||||
memory.WriteUInt64((long)address + 0x98, thread.Context.ThreadState.X19);
|
memory.WriteUInt64((long)address + 0x98, thread.Context.GetX(19));
|
||||||
memory.WriteUInt64((long)address + 0xa0, thread.Context.ThreadState.X20);
|
memory.WriteUInt64((long)address + 0xa0, thread.Context.GetX(20));
|
||||||
memory.WriteUInt64((long)address + 0xa8, thread.Context.ThreadState.X21);
|
memory.WriteUInt64((long)address + 0xa8, thread.Context.GetX(21));
|
||||||
memory.WriteUInt64((long)address + 0xb0, thread.Context.ThreadState.X22);
|
memory.WriteUInt64((long)address + 0xb0, thread.Context.GetX(22));
|
||||||
memory.WriteUInt64((long)address + 0xb8, thread.Context.ThreadState.X23);
|
memory.WriteUInt64((long)address + 0xb8, thread.Context.GetX(23));
|
||||||
memory.WriteUInt64((long)address + 0xc0, thread.Context.ThreadState.X24);
|
memory.WriteUInt64((long)address + 0xc0, thread.Context.GetX(24));
|
||||||
memory.WriteUInt64((long)address + 0xc8, thread.Context.ThreadState.X25);
|
memory.WriteUInt64((long)address + 0xc8, thread.Context.GetX(25));
|
||||||
memory.WriteUInt64((long)address + 0xd0, thread.Context.ThreadState.X26);
|
memory.WriteUInt64((long)address + 0xd0, thread.Context.GetX(26));
|
||||||
memory.WriteUInt64((long)address + 0xd8, thread.Context.ThreadState.X27);
|
memory.WriteUInt64((long)address + 0xd8, thread.Context.GetX(27));
|
||||||
memory.WriteUInt64((long)address + 0xe0, thread.Context.ThreadState.X28);
|
memory.WriteUInt64((long)address + 0xe0, thread.Context.GetX(28));
|
||||||
memory.WriteUInt64((long)address + 0xe8, thread.Context.ThreadState.X29);
|
memory.WriteUInt64((long)address + 0xe8, thread.Context.GetX(29));
|
||||||
memory.WriteUInt64((long)address + 0xf0, thread.Context.ThreadState.X30);
|
memory.WriteUInt64((long)address + 0xf0, thread.Context.GetX(30));
|
||||||
memory.WriteUInt64((long)address + 0xf8, thread.Context.ThreadState.X31);
|
memory.WriteUInt64((long)address + 0xf8, thread.Context.GetX(31));
|
||||||
|
|
||||||
memory.WriteInt64((long)address + 0x100, thread.LastPc);
|
memory.WriteInt64((long)address + 0x100, thread.LastPc);
|
||||||
|
|
||||||
memory.WriteUInt64((long)address + 0x108, (ulong)thread.Context.ThreadState.Psr);
|
memory.WriteUInt64((long)address + 0x108, (ulong)GetPsr(thread.Context));
|
||||||
|
|
||||||
memory.WriteVector128((long)address + 0x110, thread.Context.ThreadState.V0);
|
memory.WriteVector128((long)address + 0x110, thread.Context.GetV(0));
|
||||||
memory.WriteVector128((long)address + 0x120, thread.Context.ThreadState.V1);
|
memory.WriteVector128((long)address + 0x120, thread.Context.GetV(1));
|
||||||
memory.WriteVector128((long)address + 0x130, thread.Context.ThreadState.V2);
|
memory.WriteVector128((long)address + 0x130, thread.Context.GetV(2));
|
||||||
memory.WriteVector128((long)address + 0x140, thread.Context.ThreadState.V3);
|
memory.WriteVector128((long)address + 0x140, thread.Context.GetV(3));
|
||||||
memory.WriteVector128((long)address + 0x150, thread.Context.ThreadState.V4);
|
memory.WriteVector128((long)address + 0x150, thread.Context.GetV(4));
|
||||||
memory.WriteVector128((long)address + 0x160, thread.Context.ThreadState.V5);
|
memory.WriteVector128((long)address + 0x160, thread.Context.GetV(5));
|
||||||
memory.WriteVector128((long)address + 0x170, thread.Context.ThreadState.V6);
|
memory.WriteVector128((long)address + 0x170, thread.Context.GetV(6));
|
||||||
memory.WriteVector128((long)address + 0x180, thread.Context.ThreadState.V7);
|
memory.WriteVector128((long)address + 0x180, thread.Context.GetV(7));
|
||||||
memory.WriteVector128((long)address + 0x190, thread.Context.ThreadState.V8);
|
memory.WriteVector128((long)address + 0x190, thread.Context.GetV(8));
|
||||||
memory.WriteVector128((long)address + 0x1a0, thread.Context.ThreadState.V9);
|
memory.WriteVector128((long)address + 0x1a0, thread.Context.GetV(9));
|
||||||
memory.WriteVector128((long)address + 0x1b0, thread.Context.ThreadState.V10);
|
memory.WriteVector128((long)address + 0x1b0, thread.Context.GetV(10));
|
||||||
memory.WriteVector128((long)address + 0x1c0, thread.Context.ThreadState.V11);
|
memory.WriteVector128((long)address + 0x1c0, thread.Context.GetV(11));
|
||||||
memory.WriteVector128((long)address + 0x1d0, thread.Context.ThreadState.V12);
|
memory.WriteVector128((long)address + 0x1d0, thread.Context.GetV(12));
|
||||||
memory.WriteVector128((long)address + 0x1e0, thread.Context.ThreadState.V13);
|
memory.WriteVector128((long)address + 0x1e0, thread.Context.GetV(13));
|
||||||
memory.WriteVector128((long)address + 0x1f0, thread.Context.ThreadState.V14);
|
memory.WriteVector128((long)address + 0x1f0, thread.Context.GetV(14));
|
||||||
memory.WriteVector128((long)address + 0x200, thread.Context.ThreadState.V15);
|
memory.WriteVector128((long)address + 0x200, thread.Context.GetV(15));
|
||||||
memory.WriteVector128((long)address + 0x210, thread.Context.ThreadState.V16);
|
memory.WriteVector128((long)address + 0x210, thread.Context.GetV(16));
|
||||||
memory.WriteVector128((long)address + 0x220, thread.Context.ThreadState.V17);
|
memory.WriteVector128((long)address + 0x220, thread.Context.GetV(17));
|
||||||
memory.WriteVector128((long)address + 0x230, thread.Context.ThreadState.V18);
|
memory.WriteVector128((long)address + 0x230, thread.Context.GetV(18));
|
||||||
memory.WriteVector128((long)address + 0x240, thread.Context.ThreadState.V19);
|
memory.WriteVector128((long)address + 0x240, thread.Context.GetV(19));
|
||||||
memory.WriteVector128((long)address + 0x250, thread.Context.ThreadState.V20);
|
memory.WriteVector128((long)address + 0x250, thread.Context.GetV(20));
|
||||||
memory.WriteVector128((long)address + 0x260, thread.Context.ThreadState.V21);
|
memory.WriteVector128((long)address + 0x260, thread.Context.GetV(21));
|
||||||
memory.WriteVector128((long)address + 0x270, thread.Context.ThreadState.V22);
|
memory.WriteVector128((long)address + 0x270, thread.Context.GetV(22));
|
||||||
memory.WriteVector128((long)address + 0x280, thread.Context.ThreadState.V23);
|
memory.WriteVector128((long)address + 0x280, thread.Context.GetV(23));
|
||||||
memory.WriteVector128((long)address + 0x290, thread.Context.ThreadState.V24);
|
memory.WriteVector128((long)address + 0x290, thread.Context.GetV(24));
|
||||||
memory.WriteVector128((long)address + 0x2a0, thread.Context.ThreadState.V25);
|
memory.WriteVector128((long)address + 0x2a0, thread.Context.GetV(25));
|
||||||
memory.WriteVector128((long)address + 0x2b0, thread.Context.ThreadState.V26);
|
memory.WriteVector128((long)address + 0x2b0, thread.Context.GetV(26));
|
||||||
memory.WriteVector128((long)address + 0x2c0, thread.Context.ThreadState.V27);
|
memory.WriteVector128((long)address + 0x2c0, thread.Context.GetV(27));
|
||||||
memory.WriteVector128((long)address + 0x2d0, thread.Context.ThreadState.V28);
|
memory.WriteVector128((long)address + 0x2d0, thread.Context.GetV(28));
|
||||||
memory.WriteVector128((long)address + 0x2e0, thread.Context.ThreadState.V29);
|
memory.WriteVector128((long)address + 0x2e0, thread.Context.GetV(29));
|
||||||
memory.WriteVector128((long)address + 0x2f0, thread.Context.ThreadState.V30);
|
memory.WriteVector128((long)address + 0x2f0, thread.Context.GetV(30));
|
||||||
memory.WriteVector128((long)address + 0x300, thread.Context.ThreadState.V31);
|
memory.WriteVector128((long)address + 0x300, thread.Context.GetV(31));
|
||||||
|
|
||||||
memory.WriteInt32((long)address + 0x310, thread.Context.ThreadState.Fpcr);
|
memory.WriteInt32((long)address + 0x310, (int)thread.Context.Fpcr);
|
||||||
memory.WriteInt32((long)address + 0x314, thread.Context.ThreadState.Fpsr);
|
memory.WriteInt32((long)address + 0x314, (int)thread.Context.Fpsr);
|
||||||
memory.WriteInt64((long)address + 0x318, thread.Context.ThreadState.Tpidr);
|
memory.WriteInt64((long)address + 0x318, thread.Context.Tpidr);
|
||||||
|
|
||||||
return KernelResult.Success;
|
return KernelResult.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int GetPsr(ExecutionContext context)
|
||||||
|
{
|
||||||
|
return (context.GetPstateFlag(PState.NFlag) ? (1 << 31) : 0) |
|
||||||
|
(context.GetPstateFlag(PState.ZFlag) ? (1 << 30) : 0) |
|
||||||
|
(context.GetPstateFlag(PState.CFlag) ? (1 << 29) : 0) |
|
||||||
|
(context.GetPstateFlag(PState.VFlag) ? (1 << 28) : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -36,12 +36,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
{
|
{
|
||||||
KCoreContext coreContext = CoreContexts[core];
|
KCoreContext coreContext = CoreContexts[core];
|
||||||
|
|
||||||
if (coreContext.ContextSwitchNeeded && (coreContext.CurrentThread?.Context.IsCurrentThread() ?? false))
|
if (coreContext.ContextSwitchNeeded && (coreContext.CurrentThread?.IsCurrentHostThread() ?? false))
|
||||||
{
|
{
|
||||||
coreContext.ContextSwitch();
|
coreContext.ContextSwitch();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coreContext.CurrentThread?.Context.IsCurrentThread() ?? false)
|
if (coreContext.CurrentThread?.IsCurrentHostThread() ?? false)
|
||||||
{
|
{
|
||||||
selectedCount++;
|
selectedCount++;
|
||||||
}
|
}
|
||||||
|
@ -70,14 +70,14 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
{
|
{
|
||||||
// If this is not the thread that is currently executing, we need
|
// If this is not the thread that is currently executing, we need
|
||||||
// to request an interrupt to allow safely starting another thread.
|
// to request an interrupt to allow safely starting another thread.
|
||||||
if (!currentThread.Context.IsCurrentThread())
|
if (!currentThread.IsCurrentHostThread())
|
||||||
{
|
{
|
||||||
currentThread.Context.RequestInterrupt();
|
currentThread.Context.RequestInterrupt();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CoreManager.Reset(currentThread.Context.Work);
|
CoreManager.Reset(currentThread.HostThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Advance current core and try picking a thread,
|
// Advance current core and try picking a thread,
|
||||||
|
@ -92,9 +92,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
|
|
||||||
if (coreContext.CurrentThread != null)
|
if (coreContext.CurrentThread != null)
|
||||||
{
|
{
|
||||||
CoreManager.Set(coreContext.CurrentThread.Context.Work);
|
CoreManager.Set(coreContext.CurrentThread.HostThread);
|
||||||
|
|
||||||
coreContext.CurrentThread.Context.Execute();
|
coreContext.CurrentThread.Execute();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -134,14 +134,14 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
|
|
||||||
public void ExitThread(KThread thread)
|
public void ExitThread(KThread thread)
|
||||||
{
|
{
|
||||||
thread.Context.StopExecution();
|
thread.Context.Running = false;
|
||||||
|
|
||||||
CoreManager.Exit(thread.Context.Work);
|
CoreManager.Exit(thread.HostThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveThread(KThread thread)
|
public void RemoveThread(KThread thread)
|
||||||
{
|
{
|
||||||
CoreManager.RemoveThread(thread.Context.Work);
|
CoreManager.RemoveThread(thread.HostThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
|
|
||||||
if (CurrentThread != null)
|
if (CurrentThread != null)
|
||||||
{
|
{
|
||||||
_coreManager.Reset(CurrentThread.Context.Work);
|
_coreManager.Reset(CurrentThread.HostThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentThread = SelectedThread;
|
CurrentThread = SelectedThread;
|
||||||
|
@ -70,9 +70,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
CurrentThread.TotalTimeRunning += currentTime - CurrentThread.LastScheduledTime;
|
CurrentThread.TotalTimeRunning += currentTime - CurrentThread.LastScheduledTime;
|
||||||
CurrentThread.LastScheduledTime = currentTime;
|
CurrentThread.LastScheduledTime = currentTime;
|
||||||
|
|
||||||
_coreManager.Set(CurrentThread.Context.Work);
|
_coreManager.Set(CurrentThread.HostThread);
|
||||||
|
|
||||||
CurrentThread.Context.Execute();
|
CurrentThread.Execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64;
|
using ARMeilleure;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Kernel.Threading
|
namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
|
@ -53,14 +53,14 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
|
|
||||||
if (coreContext.ContextSwitchNeeded)
|
if (coreContext.ContextSwitchNeeded)
|
||||||
{
|
{
|
||||||
CpuThread currentHleThread = coreContext.CurrentThread?.Context;
|
KThread currentThread = coreContext.CurrentThread;
|
||||||
|
|
||||||
if (currentHleThread == null)
|
if (currentThread == null)
|
||||||
{
|
{
|
||||||
// Nothing is running, we can perform the context switch immediately.
|
// Nothing is running, we can perform the context switch immediately.
|
||||||
coreContext.ContextSwitch();
|
coreContext.ContextSwitch();
|
||||||
}
|
}
|
||||||
else if (currentHleThread.IsCurrentThread())
|
else if (currentThread.IsCurrentHostThread())
|
||||||
{
|
{
|
||||||
// Thread running on the current core, context switch will block.
|
// Thread running on the current core, context switch will block.
|
||||||
doContextSwitch = true;
|
doContextSwitch = true;
|
||||||
|
@ -68,7 +68,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Thread running on another core, request a interrupt.
|
// Thread running on another core, request a interrupt.
|
||||||
currentHleThread.RequestInterrupt();
|
currentThread.Context.RequestInterrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
{
|
{
|
||||||
for (int core = 0; core < CpuCoresCount; core++)
|
for (int core = 0; core < CpuCoresCount; core++)
|
||||||
{
|
{
|
||||||
if (CoreContexts[core].CurrentThread?.Context.IsCurrentThread() ?? false)
|
if (CoreContexts[core].CurrentThread?.IsCurrentHostThread() ?? false)
|
||||||
{
|
{
|
||||||
return CoreContexts[core].CurrentThread;
|
return CoreContexts[core].CurrentThread;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using ChocolArm64;
|
using ARMeilleure.Memory;
|
||||||
using ChocolArm64.Memory;
|
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
|
@ -7,12 +6,17 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Kernel.Threading
|
namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
{
|
{
|
||||||
class KThread : KSynchronizationObject, IKFutureSchedulerObject
|
class KThread : KSynchronizationObject, IKFutureSchedulerObject
|
||||||
{
|
{
|
||||||
public CpuThread Context { get; private set; }
|
private int _hostThreadRunning;
|
||||||
|
|
||||||
|
public Thread HostThread { get; private set; }
|
||||||
|
|
||||||
|
public ARMeilleure.State.ExecutionContext Context { get; private set; }
|
||||||
|
|
||||||
public long AffinityMask { get; set; }
|
public long AffinityMask { get; set; }
|
||||||
|
|
||||||
|
@ -152,30 +156,28 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
is64Bits = true;
|
is64Bits = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Context = new CpuThread(owner.Translator, owner.CpuMemory, (long)entrypoint);
|
HostThread = new Thread(() => ThreadStart(entrypoint));
|
||||||
|
|
||||||
|
Context = new ARMeilleure.State.ExecutionContext();
|
||||||
|
|
||||||
bool isAarch32 = (Owner.MmuFlags & 1) == 0;
|
bool isAarch32 = (Owner.MmuFlags & 1) == 0;
|
||||||
|
|
||||||
Context.ThreadState.Aarch32 = isAarch32;
|
Context.SetX(0, argsPtr);
|
||||||
|
|
||||||
Context.ThreadState.X0 = argsPtr;
|
|
||||||
|
|
||||||
if (isAarch32)
|
if (isAarch32)
|
||||||
{
|
{
|
||||||
Context.ThreadState.X13 = (uint)stackTop;
|
Context.SetX(13, (uint)stackTop);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Context.ThreadState.X31 = stackTop;
|
Context.SetX(31, stackTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
Context.ThreadState.CntfrqEl0 = 19200000;
|
Context.CntfrqEl0 = 19200000;
|
||||||
Context.ThreadState.Tpidr = (long)_tlsAddress;
|
Context.Tpidr = (long)_tlsAddress;
|
||||||
|
|
||||||
owner.SubscribeThreadEventHandlers(Context);
|
owner.SubscribeThreadEventHandlers(Context);
|
||||||
|
|
||||||
Context.WorkFinished += ThreadFinishedHandler;
|
|
||||||
|
|
||||||
ThreadUid = System.GetThreadUid();
|
ThreadUid = System.GetThreadUid();
|
||||||
|
|
||||||
_hasBeenInitialized = true;
|
_hasBeenInitialized = true;
|
||||||
|
@ -1002,8 +1004,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
|
|
||||||
public void SetEntryArguments(long argsPtr, int threadHandle)
|
public void SetEntryArguments(long argsPtr, int threadHandle)
|
||||||
{
|
{
|
||||||
Context.ThreadState.X0 = (ulong)argsPtr;
|
Context.SetX(0, (ulong)argsPtr);
|
||||||
Context.ThreadState.X1 = (ulong)threadHandle;
|
Context.SetX(1, (ulong)threadHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TimeUp()
|
public void TimeUp()
|
||||||
|
@ -1013,7 +1015,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
|
|
||||||
public string GetGuestStackTrace()
|
public string GetGuestStackTrace()
|
||||||
{
|
{
|
||||||
return Owner.Debugger.GetGuestStackTrace(Context.ThreadState);
|
return Owner.Debugger.GetGuestStackTrace(Context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PrintGuestStackTrace()
|
public void PrintGuestStackTrace()
|
||||||
|
@ -1026,12 +1028,32 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
Logger.PrintInfo(LogClass.Cpu, trace.ToString());
|
Logger.PrintInfo(LogClass.Cpu, trace.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ThreadFinishedHandler(object sender, EventArgs e)
|
public void Execute()
|
||||||
|
{
|
||||||
|
if (Interlocked.CompareExchange(ref _hostThreadRunning, 1, 0) == 0)
|
||||||
|
{
|
||||||
|
HostThread.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ThreadStart(ulong entrypoint)
|
||||||
|
{
|
||||||
|
Owner.Translator.Execute(Context, entrypoint);
|
||||||
|
|
||||||
|
ThreadExit();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ThreadExit()
|
||||||
{
|
{
|
||||||
System.Scheduler.ExitThread(this);
|
System.Scheduler.ExitThread(this);
|
||||||
System.Scheduler.RemoveThread(this);
|
System.Scheduler.RemoveThread(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsCurrentHostThread()
|
||||||
|
{
|
||||||
|
return Thread.CurrentThread == HostThread;
|
||||||
|
}
|
||||||
|
|
||||||
public override bool IsSignaled()
|
public override bool IsSignaled()
|
||||||
{
|
{
|
||||||
return _hasExited;
|
return _hasExited;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.HLE.HOS.Ipc;
|
using Ryujinx.HLE.HOS.Ipc;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Ipc;
|
using Ryujinx.HLE.HOS.Kernel.Ipc;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.SystemState;
|
using Ryujinx.HLE.HOS.SystemState;
|
||||||
using Ryujinx.HLE.Utilities;
|
using Ryujinx.HLE.Utilities;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Audio;
|
using Ryujinx.Audio;
|
||||||
using Ryujinx.HLE.HOS.Ipc;
|
using Ryujinx.HLE.HOS.Ipc;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Audio;
|
using Ryujinx.Audio;
|
||||||
using Ryujinx.Audio.Adpcm;
|
using Ryujinx.Audio.Adpcm;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Audio.Adpcm;
|
using Ryujinx.Audio.Adpcm;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Audio;
|
using Ryujinx.Audio;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.HLE.HOS.Ipc;
|
using Ryujinx.HLE.HOS.Ipc;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.Ipc;
|
using Ryujinx.HLE.HOS.Ipc;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Graphics.Memory;
|
using Ryujinx.Graphics.Memory;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Graphics.Memory;
|
using Ryujinx.Graphics.Memory;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
using System;
|
using System;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Graphics.Memory;
|
using Ryujinx.Graphics.Memory;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using Ryujinx.HLE.HOS.Ipc;
|
using Ryujinx.HLE.HOS.Ipc;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
using System;
|
using System;
|
||||||
|
|
|
@ -38,16 +38,17 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\ChocolArm64\ChocolArm64.csproj" />
|
|
||||||
<ProjectReference Include="..\Ryujinx.Audio\Ryujinx.Audio.csproj" />
|
<ProjectReference Include="..\Ryujinx.Audio\Ryujinx.Audio.csproj" />
|
||||||
<ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />
|
<ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />
|
||||||
<ProjectReference Include="..\Ryujinx.Graphics\Ryujinx.Graphics.csproj" />
|
<ProjectReference Include="..\Ryujinx.Graphics\Ryujinx.Graphics.csproj" />
|
||||||
<ProjectReference Include="..\Ryujinx.Profiler\Ryujinx.Profiler.csproj" />
|
<ProjectReference Include="..\Ryujinx.Profiler\Ryujinx.Profiler.csproj" />
|
||||||
|
<ProjectReference Include="..\ARMeilleure\ARMeilleure.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Concentus" Version="1.1.7" />
|
<PackageReference Include="Concentus" Version="1.1.7" />
|
||||||
<PackageReference Include="LibHac" Version="0.5.0" />
|
<PackageReference Include="LibHac" Version="0.5.0" />
|
||||||
|
<PackageReference Include="System.Runtime.Intrinsics.Experimental" Version="4.5.0-rc1" />
|
||||||
<PackageReference Include="TimeZoneConverter.Posix" Version="2.1.0" />
|
<PackageReference Include="TimeZoneConverter.Posix" Version="2.1.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.Utilities
|
namespace Ryujinx.HLE.Utilities
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using ChocolArm64.Memory;
|
using ARMeilleure.Memory;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.Utilities
|
namespace Ryujinx.HLE.Utilities
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue