Kernel/Arbiters: When doing ArbitrateAddress(Signal), always pick the highest priority thread, using the first one that was put to sleep if more than one thread with the same highest priority exists.

This is consistent with hardware behavior as shown by this test https://gist.github.com/ds84182/40e46129bd38b46a5100f15f96ba5eaf
This commit is contained in:
Subv 2017-11-08 18:07:22 -05:00
parent 7d12aaaa20
commit c68adb787b
4 changed files with 82 additions and 64 deletions

View file

@ -629,7 +629,8 @@ static ResultCode ArbitrateAddress(Kernel::Handle handle, u32 address, u32 type,
if (arbiter == nullptr)
return ERR_INVALID_HANDLE;
auto res = arbiter->ArbitrateAddress(static_cast<Kernel::ArbitrationType>(type), address, value,
auto res = arbiter->ArbitrateAddress(Kernel::GetCurrentThread(),
static_cast<Kernel::ArbitrationType>(type), address, value,
nanoseconds);
// TODO(Subv): Identify in which specific cases this call should cause a reschedule.