Thread scheduler rewrite (#393)
* Started to rewrite the thread scheduler * Add a single core-like scheduling mode, enabled by default * Clear exclusive monitor on context switch * Add SetThreadActivity, misc fixes * Implement WaitForAddress and SignalToAddress svcs, misc fixes * Misc fixes (on SetActivity and Arbiter), other tweaks * Rebased * Add missing null check * Rename multicore key on config, fix UpdatePriorityInheritance * Make scheduling data MLQs private * nit: Ordering
This commit is contained in:
@ -41,6 +41,9 @@ namespace ChocolArm64.State
|
||||
public bool Negative;
|
||||
|
||||
public bool Running { get; set; }
|
||||
public int Core { get; set; }
|
||||
|
||||
private bool Interrupted;
|
||||
|
||||
public long TpidrEl0 { get; set; }
|
||||
public long Tpidr { get; set; }
|
||||
@ -73,6 +76,7 @@ namespace ChocolArm64.State
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler<EventArgs> Interrupt;
|
||||
public event EventHandler<AInstExceptionEventArgs> Break;
|
||||
public event EventHandler<AInstExceptionEventArgs> SvcCall;
|
||||
public event EventHandler<AInstUndefinedEventArgs> Undefined;
|
||||
@ -99,9 +103,26 @@ namespace ChocolArm64.State
|
||||
|
||||
internal bool Synchronize()
|
||||
{
|
||||
if (Interrupted)
|
||||
{
|
||||
Interrupted = false;
|
||||
|
||||
OnInterrupt();
|
||||
}
|
||||
|
||||
return Running;
|
||||
}
|
||||
|
||||
internal void RequestInterrupt()
|
||||
{
|
||||
Interrupted = true;
|
||||
}
|
||||
|
||||
private void OnInterrupt()
|
||||
{
|
||||
Interrupt?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
internal void OnBreak(long Position, int Imm)
|
||||
{
|
||||
Break?.Invoke(this, new AInstExceptionEventArgs(Position, Imm));
|
||||
|
Reference in New Issue
Block a user