diff options
author | Lioncash <mathew1800@gmail.com> | 2019-03-08 00:42:44 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-03-08 05:27:47 +0100 |
commit | b7f331afa3db235db39eca041fef720873f3091a (patch) | |
tree | cf2a5f7a3744fb7ed2104bf166aa65433377f1c1 /src/core/hle/kernel/address_arbiter.cpp | |
parent | kernel/svc: Move address arbiter waiting behind a unified API function (diff) | |
download | yuzu-b7f331afa3db235db39eca041fef720873f3091a.tar yuzu-b7f331afa3db235db39eca041fef720873f3091a.tar.gz yuzu-b7f331afa3db235db39eca041fef720873f3091a.tar.bz2 yuzu-b7f331afa3db235db39eca041fef720873f3091a.tar.lz yuzu-b7f331afa3db235db39eca041fef720873f3091a.tar.xz yuzu-b7f331afa3db235db39eca041fef720873f3091a.tar.zst yuzu-b7f331afa3db235db39eca041fef720873f3091a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/address_arbiter.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index b6269c708..352190da8 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -42,7 +42,21 @@ void WakeThreads(const std::vector<SharedPtr<Thread>>& waiting_threads, s32 num_ AddressArbiter::AddressArbiter(Core::System& system) : system{system} {} AddressArbiter::~AddressArbiter() = default; -ResultCode AddressArbiter::SignalToAddress(VAddr address, s32 num_to_wake) { +ResultCode AddressArbiter::SignalToAddress(VAddr address, SignalType type, s32 value, + s32 num_to_wake) { + switch (type) { + case SignalType::Signal: + return SignalToAddressOnly(address, num_to_wake); + case SignalType::IncrementAndSignalIfEqual: + return IncrementAndSignalToAddressIfEqual(address, value, num_to_wake); + case SignalType::ModifyByWaitingCountAndSignalIfEqual: + return ModifyByWaitingCountAndSignalToAddressIfEqual(address, value, num_to_wake); + default: + return ERR_INVALID_ENUM_VALUE; + } +} + +ResultCode AddressArbiter::SignalToAddressOnly(VAddr address, s32 num_to_wake) { const std::vector<SharedPtr<Thread>> waiting_threads = GetThreadsWaitingOnAddress(address); WakeThreads(waiting_threads, num_to_wake); return RESULT_SUCCESS; @@ -60,7 +74,7 @@ ResultCode AddressArbiter::IncrementAndSignalToAddressIfEqual(VAddr address, s32 } Memory::Write32(address, static_cast<u32>(value + 1)); - return SignalToAddress(address, num_to_wake); + return SignalToAddressOnly(address, num_to_wake); } ResultCode AddressArbiter::ModifyByWaitingCountAndSignalToAddressIfEqual(VAddr address, s32 value, |