Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Brovan/Core/Emulation/Backends/IEmulationBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ bool ReadRegisterBatch(int[] registers, ulong[] values, int count)
/// </summary>
bool SupportsThreadResidency => false;

int ProcessorLimit => 1;

bool TryBindThread(uint threadId) => false;

void UnbindThread(uint threadId)
Expand All @@ -205,6 +207,23 @@ void SelectThread(uint threadId)
/// </summary>
bool TryLimitSlice(int microseconds) => false;

/// <summary>
/// The lock the caller holds around <see cref="Emulate"/>. A backend releases it only for the time
/// the guest runs.
/// </summary>
void UseRunLock(object runLock)
{
}

/// <summary>Ends the slice of the thread's processor, not the thread.</summary>
void StopThread(uint threadId)
{
}

void StopAllProcessors()
{
}

/// <summary>
/// Answers RDTSC inside the backend from the emulator's clock. False when the backend has no such path.
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions Brovan/Core/Emulation/Backends/Kvm/KvmBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,15 @@ public bool WriteXmmRegisters(ulong[] values)
=> Inner.TransferXmmRegisters(values, true);

public bool SupportsThreadResidency => Inner.SupportsThreadResidency;
public int ProcessorLimit => Inner.ProcessorLimit;
public bool TryBindThread(uint threadId) => Inner.TryBindThread(threadId);
public void UnbindThread(uint threadId) => Inner.UnbindThread(threadId);
public bool IsThreadResident(uint threadId) => Inner.IsThreadResident(threadId);
public void SelectThread(uint threadId) => Inner.SelectThread(threadId);
public bool TryLimitSlice(int microseconds) => Inner.TryLimitSlice(microseconds);
public void UseRunLock(object runLock) => Inner.UseRunLock(runLock);
public void StopThread(uint threadId) => Inner.StopThread(threadId);
public void StopAllProcessors() => Inner.StopAllProcessors();
public uint ReadRegister32(Registers register)
=> Inner.ReadRegister32(register);
public uint ReadRegister32(int register)
Expand Down
4 changes: 4 additions & 0 deletions Brovan/Core/Emulation/Backends/Whp/WhpBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,15 @@ public bool WriteXmmRegisters(ulong[] values)
=> Inner.TransferXmmRegisters(values, true);

public bool SupportsThreadResidency => Inner.SupportsThreadResidency;
public int ProcessorLimit => Inner.ProcessorLimit;
public bool TryBindThread(uint threadId) => Inner.TryBindThread(threadId);
public void UnbindThread(uint threadId) => Inner.UnbindThread(threadId);
public bool IsThreadResident(uint threadId) => Inner.IsThreadResident(threadId);
public void SelectThread(uint threadId) => Inner.SelectThread(threadId);
public bool TryLimitSlice(int microseconds) => Inner.TryLimitSlice(microseconds);
public void UseRunLock(object runLock) => Inner.UseRunLock(runLock);
public void StopThread(uint threadId) => Inner.StopThread(threadId);
public void StopAllProcessors() => Inner.StopAllProcessors();

public IntPtr AddCodeHook(ulong begin, ulong end, CodeHookCallback callback)
=> Inner.AddCodeHook(begin, end, callback);
Expand Down
Loading
Loading