namespace Ryujinx.Cpu
{
///
/// CPU context interface.
///
public interface ICpuContext
{
///
/// Creates a new execution context that will store thread CPU register state when executing guest code.
///
/// Optional functions to be called when the CPU receives an interrupt
/// Execution context
IExecutionContext CreateExecutionContext(ExceptionCallbacks exceptionCallbacks);
///
/// Starts executing code at a specified entry point address.
///
///
/// This function only returns when the execution is stopped, by calling .
///
/// Execution context to be used for this run
/// Entry point address
void Execute(IExecutionContext context, ulong address);
///
/// Invalidates the instruction cache for a given memory region.
///
///
/// This should be called if code is modified to make the CPU emulator aware of the modifications,
/// otherwise it might run stale code which will lead to errors and crashes.
/// Calling this function is not necessary if the code memory was modified by guest code,
/// as the expectation is that it will do it on its own using the appropriate cache invalidation instructions,
/// except on Arm32 where those instructions can't be used in unprivileged mode.
///
/// Address of the region to be invalidated
/// Size of the region to be invalidated
void InvalidateCacheRegion(ulong address, ulong size);
}
}