mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-03-14 22:40:18 +00:00
Call InvalidateCacheRegion
This commit is contained in:
parent
877f81e44a
commit
d0afc6605f
8 changed files with 52 additions and 29 deletions
|
@ -46,9 +46,10 @@ namespace Ryujinx.HLE.Debugger
|
||||||
|
|
||||||
private ARMeilleure.State.ExecutionContext GetThread(long threadUid) =>
|
private ARMeilleure.State.ExecutionContext GetThread(long threadUid) =>
|
||||||
Device.System.DebugGetApplicationProcess().DebugGetThreadContext(threadUid);
|
Device.System.DebugGetApplicationProcess().DebugGetThreadContext(threadUid);
|
||||||
|
|
||||||
private ARMeilleure.State.ExecutionContext[] GetThreads() => GetThreadIds().Select(GetThread).ToArray();
|
private ARMeilleure.State.ExecutionContext[] GetThreads() => GetThreadIds().Select(GetThread).ToArray();
|
||||||
private IVirtualMemoryManager GetMemory() => Device.System.DebugGetApplicationProcess().CpuMemory;
|
private IVirtualMemoryManager GetMemory() => Device.System.DebugGetApplicationProcess().CpuMemory;
|
||||||
|
private void InvalidateCacheRegion(ulong address, ulong size) =>
|
||||||
|
Device.System.DebugGetApplicationProcess().InvalidateCacheRegion(address, size);
|
||||||
|
|
||||||
const int GdbRegisterCount = 68;
|
const int GdbRegisterCount = 68;
|
||||||
|
|
||||||
|
@ -438,6 +439,7 @@ namespace Ryujinx.HLE.Debugger
|
||||||
}
|
}
|
||||||
|
|
||||||
GetMemory().Write(addr, data);
|
GetMemory().Write(addr, data);
|
||||||
|
InvalidateCacheRegion(addr, len);
|
||||||
ReplyOK();
|
ReplyOK();
|
||||||
}
|
}
|
||||||
catch (InvalidMemoryRegionException)
|
catch (InvalidMemoryRegionException)
|
||||||
|
|
|
@ -4,9 +4,10 @@ namespace Ryujinx.HLE.Debugger
|
||||||
{
|
{
|
||||||
public interface IDebuggableProcess
|
public interface IDebuggableProcess
|
||||||
{
|
{
|
||||||
public void DebugStopAllThreads();
|
void DebugStopAllThreads();
|
||||||
public long[] DebugGetThreadUids();
|
long[] DebugGetThreadUids();
|
||||||
public ARMeilleure.State.ExecutionContext DebugGetThreadContext(long threadUid);
|
ARMeilleure.State.ExecutionContext DebugGetThreadContext(long threadUid);
|
||||||
public IVirtualMemoryManager CpuMemory { get; }
|
IVirtualMemoryManager CpuMemory { get; }
|
||||||
|
void InvalidateCacheRegion(ulong address, ulong size);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -10,6 +10,7 @@ using Ryujinx.Audio.Integration;
|
||||||
using Ryujinx.Audio.Output;
|
using Ryujinx.Audio.Output;
|
||||||
using Ryujinx.Audio.Renderer.Device;
|
using Ryujinx.Audio.Renderer.Device;
|
||||||
using Ryujinx.Audio.Renderer.Server;
|
using Ryujinx.Audio.Renderer.Server;
|
||||||
|
using Ryujinx.HLE.Debugger;
|
||||||
using Ryujinx.HLE.FileSystem;
|
using Ryujinx.HLE.FileSystem;
|
||||||
using Ryujinx.HLE.HOS.Kernel;
|
using Ryujinx.HLE.HOS.Kernel;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Memory;
|
using Ryujinx.HLE.HOS.Kernel.Memory;
|
||||||
|
@ -500,11 +501,11 @@ namespace Ryujinx.HLE.HOS
|
||||||
IsPaused = pause;
|
IsPaused = pause;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Debugger.IDebuggableProcess DebugGetApplicationProcess()
|
public IDebuggableProcess DebugGetApplicationProcess()
|
||||||
{
|
{
|
||||||
lock (KernelContext.Processes)
|
lock (KernelContext.Processes)
|
||||||
{
|
{
|
||||||
return KernelContext.Processes.Values.Where(x => x.IsApplication).First();
|
return KernelContext.Processes.Values.First(x => x.IsApplication).GdbStubInterface;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ using ARMeilleure.State;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Cpu;
|
using Ryujinx.Cpu;
|
||||||
|
using Ryujinx.HLE.Debugger;
|
||||||
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;
|
||||||
|
@ -14,7 +15,7 @@ using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Kernel.Process
|
namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
{
|
{
|
||||||
class KProcess : KSynchronizationObject, Debugger.IDebuggableProcess
|
class KProcess : KSynchronizationObject
|
||||||
{
|
{
|
||||||
public const int KernelVersionMajor = 10;
|
public const int KernelVersionMajor = 10;
|
||||||
public const int KernelVersionMinor = 4;
|
public const int KernelVersionMinor = 4;
|
||||||
|
@ -89,6 +90,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
public IVirtualMemoryManager CpuMemory => Context.AddressSpace;
|
public IVirtualMemoryManager CpuMemory => Context.AddressSpace;
|
||||||
|
|
||||||
public HleProcessDebugger Debugger { get; private set; }
|
public HleProcessDebugger Debugger { get; private set; }
|
||||||
|
public IDebuggableProcess GdbStubInterface { get { return new DebuggerInterface(this); } }
|
||||||
|
|
||||||
public KProcess(KernelContext context) : base(context)
|
public KProcess(KernelContext context) : base(context)
|
||||||
{
|
{
|
||||||
|
@ -1191,11 +1193,20 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class DebuggerInterface : IDebuggableProcess
|
||||||
|
{
|
||||||
|
private readonly KProcess _parent;
|
||||||
|
|
||||||
|
public DebuggerInterface(KProcess p)
|
||||||
|
{
|
||||||
|
_parent = p;
|
||||||
|
}
|
||||||
|
|
||||||
public void DebugStopAllThreads()
|
public void DebugStopAllThreads()
|
||||||
{
|
{
|
||||||
lock (_threadingLock)
|
lock (_parent._threadingLock)
|
||||||
{
|
{
|
||||||
foreach (KThread thread in _threads)
|
foreach (KThread thread in _parent._threads)
|
||||||
{
|
{
|
||||||
thread.Context.DebugStop();
|
thread.Context.DebugStop();
|
||||||
}
|
}
|
||||||
|
@ -1204,17 +1215,25 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
|
|
||||||
public long[] DebugGetThreadUids()
|
public long[] DebugGetThreadUids()
|
||||||
{
|
{
|
||||||
lock (_threadingLock)
|
lock (_parent._threadingLock)
|
||||||
{
|
{
|
||||||
return _threads.Select(x => x.ThreadUid).ToArray();
|
return _parent._threads.Select(x => x.ThreadUid).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ARMeilleure.State.ExecutionContext DebugGetThreadContext(long threadUid)
|
public ARMeilleure.State.ExecutionContext DebugGetThreadContext(long threadUid)
|
||||||
{
|
{
|
||||||
lock (_threadingLock)
|
lock (_parent._threadingLock)
|
||||||
{
|
{
|
||||||
return _threads.Where(x => x.ThreadUid == threadUid).FirstOrDefault()?.Context;
|
return _parent._threads.FirstOrDefault(x => x.ThreadUid == threadUid)?.Context;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public IVirtualMemoryManager CpuMemory { get { return _parent.CpuMemory; } }
|
||||||
|
|
||||||
|
public void InvalidateCacheRegion(ulong address, ulong size)
|
||||||
|
{
|
||||||
|
_parent.Context.InvalidateCacheRegion(address, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue