diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-12-11 16:55:38 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2019-12-11 16:55:38 +0100 |
commit | 22c6b9fab2393a822209e16af5058eee0efe18ea (patch) | |
tree | a0261553fde8d9c12c0dfaf3dff93bd0d0f522ea /src/core/hle/kernel/address_arbiter.h | |
parent | Merge pull request #3201 from lioncash/dump (diff) | |
download | yuzu-22c6b9fab2393a822209e16af5058eee0efe18ea.tar yuzu-22c6b9fab2393a822209e16af5058eee0efe18ea.tar.gz yuzu-22c6b9fab2393a822209e16af5058eee0efe18ea.tar.bz2 yuzu-22c6b9fab2393a822209e16af5058eee0efe18ea.tar.lz yuzu-22c6b9fab2393a822209e16af5058eee0efe18ea.tar.xz yuzu-22c6b9fab2393a822209e16af5058eee0efe18ea.tar.zst yuzu-22c6b9fab2393a822209e16af5058eee0efe18ea.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/address_arbiter.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/core/hle/kernel/address_arbiter.h b/src/core/hle/kernel/address_arbiter.h index 1e1f00e60..386983e54 100644 --- a/src/core/hle/kernel/address_arbiter.h +++ b/src/core/hle/kernel/address_arbiter.h @@ -4,7 +4,9 @@ #pragma once +#include <list> #include <memory> +#include <unordered_map> #include <vector> #include "common/common_types.h" @@ -48,6 +50,9 @@ public: /// Waits on an address with a particular arbitration type. ResultCode WaitForAddress(VAddr address, ArbitrationType type, s32 value, s64 timeout_ns); + /// Removes a thread from the container and resets its address arbiter adress to 0 + void HandleWakeupThread(std::shared_ptr<Thread> thread); + private: /// Signals an address being waited on. ResultCode SignalToAddressOnly(VAddr address, s32 num_to_wake); @@ -71,8 +76,20 @@ private: // Waits on the given address with a timeout in nanoseconds ResultCode WaitForAddressImpl(VAddr address, s64 timeout); + /// Wake up num_to_wake (or all) threads in a vector. + void WakeThreads(const std::vector<std::shared_ptr<Thread>>& waiting_threads, s32 num_to_wake); + + /// Insert a thread into the address arbiter container + void InsertThread(std::shared_ptr<Thread> thread); + + /// Removes a thread from the address arbiter container + void RemoveThread(std::shared_ptr<Thread> thread); + // Gets the threads waiting on an address. - std::vector<std::shared_ptr<Thread>> GetThreadsWaitingOnAddress(VAddr address) const; + std::vector<std::shared_ptr<Thread>> GetThreadsWaitingOnAddress(VAddr address); + + /// List of threads waiting for a address arbiter + std::unordered_map<VAddr, std::list<std::shared_ptr<Thread>>> arb_threads; Core::System& system; }; |