diff options
author | bunnei <bunneidev@gmail.com> | 2018-03-19 01:22:46 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-03-19 01:56:34 +0100 |
commit | c86af6939c9777d78fbc48b81eb090553762d3d4 (patch) | |
tree | 957898b7a38e667490df2bbe5efff5259a48168a /src/core/hle/kernel/hle_ipc.h | |
parent | hle_ipc: Use shared_ptr instead of unique_ptr to allow copies. (diff) | |
download | yuzu-c86af6939c9777d78fbc48b81eb090553762d3d4.tar yuzu-c86af6939c9777d78fbc48b81eb090553762d3d4.tar.gz yuzu-c86af6939c9777d78fbc48b81eb090553762d3d4.tar.bz2 yuzu-c86af6939c9777d78fbc48b81eb090553762d3d4.tar.lz yuzu-c86af6939c9777d78fbc48b81eb090553762d3d4.tar.xz yuzu-c86af6939c9777d78fbc48b81eb090553762d3d4.tar.zst yuzu-c86af6939c9777d78fbc48b81eb090553762d3d4.zip |
Diffstat (limited to 'src/core/hle/kernel/hle_ipc.h')
-rw-r--r-- | src/core/hle/kernel/hle_ipc.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index b5cc0d0af..8b35da4c9 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -6,6 +6,7 @@ #include <array> #include <memory> +#include <string> #include <vector> #include <boost/container/small_vector.hpp> #include "common/common_types.h" @@ -25,6 +26,7 @@ class Domain; class HandleTable; class HLERequestContext; class Process; +class Event; /** * Interface implemented by HLE Session handlers. @@ -103,6 +105,24 @@ public: return server_session; } + using WakeupCallback = std::function<void(SharedPtr<Thread> thread, HLERequestContext& context, + ThreadWakeupReason reason)>; + + /** + * Puts the specified guest thread to sleep until the returned event is signaled or until the + * specified timeout expires. + * @param thread Thread to be put to sleep. + * @param reason Reason for pausing the thread, to be used for debugging purposes. + * @param timeout Timeout in nanoseconds after which the thread will be awoken and the callback + * invoked with a Timeout reason. + * @param callback Callback to be invoked when the thread is resumed. This callback must write + * the entire command response once again, regardless of the state of it before this function + * was called. + * @returns Event that when signaled will resume the thread and call the callback function. + */ + SharedPtr<Event> SleepClientThread(SharedPtr<Thread> thread, const std::string& reason, + u64 timeout, WakeupCallback&& callback); + void ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming); /// Populates this context with data from the requesting process/thread. |