From cee712105850ac3385cd0091a923438167433f9f Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 8 Apr 2023 01:22:00 +0200 Subject: Move solution and projects to src --- src/Ryujinx.Cpu/IExecutionContext.cs | 112 +++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 src/Ryujinx.Cpu/IExecutionContext.cs (limited to 'src/Ryujinx.Cpu/IExecutionContext.cs') diff --git a/src/Ryujinx.Cpu/IExecutionContext.cs b/src/Ryujinx.Cpu/IExecutionContext.cs new file mode 100644 index 00000000..c3821080 --- /dev/null +++ b/src/Ryujinx.Cpu/IExecutionContext.cs @@ -0,0 +1,112 @@ +using ARMeilleure.State; +using System; + +namespace Ryujinx.Cpu +{ + /// + /// CPU register state interface. + /// + public interface IExecutionContext : IDisposable + { + /// + /// Current Program Counter. + /// + /// + /// In some implementations, this value might not be accurate and might not point to the last instruction executed. + /// + ulong Pc { get; } + + /// + /// Thread ID Register (EL0). + /// + long TpidrEl0 { get; set; } + + /// + /// Thread ID Register (read-only) (EL0). + /// + long TpidrroEl0 { get; set; } + + /// + /// Processor State Register. + /// + uint Pstate { get; set; } + + /// + /// Floating-point Control Register. + /// + uint Fpcr { get; set; } + + /// + /// Floating-point Status Register. + /// + uint Fpsr { get; set; } + + /// + /// Indicates whenever the CPU is running 64-bit (AArch64 mode) or 32-bit (AArch32 mode) code. + /// + bool IsAarch32 { get; set; } + + /// + /// Indicates whenever the CPU is still running code. + /// + /// + /// Even if this is false, the guest code might be still exiting. + /// One must not assume that the code is no longer running from this property alone. + /// + bool Running { get; } + + /// + /// Gets the value of a general purpose register. + /// + /// + /// The special of 31 can be used to access the SP (Stack Pointer) register. + /// + /// Index of the register, in the range 0-31 (inclusive) + /// The register value + ulong GetX(int index); + + /// + /// Sets the value of a general purpose register. + /// + /// + /// The special of 31 can be used to access the SP (Stack Pointer) register. + /// + /// Index of the register, in the range 0-31 (inclusive) + /// Value to be set + void SetX(int index, ulong value); + + /// + /// Gets the value of a FP/SIMD register. + /// + /// Index of the register, in the range 0-31 (inclusive) + /// The register value + V128 GetV(int index); + + /// + /// Sets the value of a FP/SIMD register. + /// + /// Index of the register, in the range 0-31 (inclusive) + /// Value to be set + void SetV(int index, V128 value); + + /// + /// Requests the thread to stop running temporarily and call . + /// + /// + /// The thread might not pause immediately. + /// One must not assume that guest code is no longer being executed by the thread after calling this function. + /// + void RequestInterrupt(); + + /// + /// Requests the thread to stop running guest code and return as soon as possible. + /// + /// + /// The thread might not stop immediately. + /// One must not assume that guest code is no longer being executed by the thread after calling this function. + /// After a thread has been stopped, it can't be restarted with the same . + /// If you only need to pause the thread temporarily, use instead. + /// + void StopRunning(); + } +} -- cgit v1.2.3