diff options
author | Liam <byteslice@airmail.cc> | 2023-12-07 01:54:52 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-12-07 15:13:43 +0100 |
commit | 9268f265a1207f0cddb97a908a1cc349f9b6410b (patch) | |
tree | 5da6aea714523b3504b78362c5d8abd53689d72f /src/core/hle/kernel/k_light_server_session.h | |
parent | Merge pull request #12236 from liamwhite/cpu-refactor (diff) | |
download | yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar.gz yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar.bz2 yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar.lz yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar.xz yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar.zst yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_light_server_session.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_light_server_session.h b/src/core/hle/kernel/k_light_server_session.h new file mode 100644 index 000000000..8eca3eab6 --- /dev/null +++ b/src/core/hle/kernel/k_light_server_session.h @@ -0,0 +1,49 @@ +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/kernel/k_auto_object.h" +#include "core/hle/kernel/k_thread.h" +#include "core/hle/result.h" + +namespace Kernel { + +class KLightSession; + +class KLightServerSession final : public KAutoObject, + public Common::IntrusiveListBaseNode<KLightServerSession> { + KERNEL_AUTOOBJECT_TRAITS(KLightServerSession, KAutoObject); + +private: + KLightSession* m_parent{}; + KThread::WaiterList m_request_list{}; + KThread* m_current_request{}; + u64 m_server_thread_id{std::numeric_limits<u64>::max()}; + KThread* m_server_thread{}; + +public: + explicit KLightServerSession(KernelCore& kernel); + ~KLightServerSession(); + + void Initialize(KLightSession* parent) { + // Set member variables. */ + m_parent = parent; + } + + virtual void Destroy() override; + + constexpr const KLightSession* GetParent() const { + return m_parent; + } + + Result OnRequest(KThread* request_thread); + Result ReplyAndReceive(u32* data); + + void OnClientClosed(); + +private: + void CleanupRequests(); +}; + +} // namespace Kernel |