kernel: Make the address arbiter instance per-process

Now that we have the address arbiter extracted to its own class, we can
fix an innaccuracy with the kernel. Said inaccuracy being that there
isn't only one address arbiter. Each process instance contains its own
AddressArbiter instance in the actual kernel.

This fixes that and gets rid of another long-standing issue that could
arise when attempting to create more than one process.
This commit is contained in:
Lioncash 2019-03-07 18:48:14 -05:00
parent b7f331afa3
commit 8e510d5afa
8 changed files with 35 additions and 28 deletions

View file

@ -1480,7 +1480,8 @@ static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout
}
const auto arbitration_type = static_cast<AddressArbiter::ArbitrationType>(type);
auto& address_arbiter = Core::System::GetInstance().Kernel().AddressArbiter();
auto& address_arbiter =
Core::System::GetInstance().Kernel().CurrentProcess()->GetAddressArbiter();
return address_arbiter.WaitForAddress(address, arbitration_type, value, timeout);
}
@ -1500,7 +1501,8 @@ static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to
}
const auto signal_type = static_cast<AddressArbiter::SignalType>(type);
auto& address_arbiter = Core::System::GetInstance().Kernel().AddressArbiter();
auto& address_arbiter =
Core::System::GetInstance().Kernel().CurrentProcess()->GetAddressArbiter();
return address_arbiter.SignalToAddress(address, signal_type, value, num_to_wake);
}