summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_client_session.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-04-14 02:48:37 +0200
committerbunnei <bunneidev@gmail.com>2021-05-06 01:40:51 +0200
commit7444963bbb300cff269e410948de7fa577f5ff16 (patch)
tree6e0000cb345dc02c8f2ca38958b7c90383f45b03 /src/core/hle/kernel/k_client_session.h
parenthle: kernel: svc: Migrate GetThreadContext, GetThreadCoreMask. (diff)
downloadyuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar
yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar.gz
yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar.bz2
yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar.lz
yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar.xz
yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar.zst
yuzu-7444963bbb300cff269e410948de7fa577f5ff16.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/k_client_session.h (renamed from src/core/hle/kernel/client_session.h)54
1 files changed, 33 insertions, 21 deletions
diff --git a/src/core/hle/kernel/client_session.h b/src/core/hle/kernel/k_client_session.h
index 7a1d15d0c..c4b193773 100644
--- a/src/core/hle/kernel/client_session.h
+++ b/src/core/hle/kernel/k_client_session.h
@@ -1,4 +1,4 @@
-// Copyright 2019 yuzu emulator team
+// Copyright 2021 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
@@ -7,7 +7,9 @@
#include <memory>
#include <string>
+#include "core/hle/kernel/k_auto_object.h"
#include "core/hle/kernel/k_synchronization_object.h"
+#include "core/hle/kernel/slab_helpers.h"
#include "core/hle/result.h"
union ResultCode;
@@ -23,43 +25,53 @@ class CoreTiming;
namespace Kernel {
class KernelCore;
-class Session;
+class KSession;
class KThread;
-class ClientSession final : public KSynchronizationObject {
-public:
- explicit ClientSession(KernelCore& kernel);
- ~ClientSession() override;
+class KClientSession final
+ : public KAutoObjectWithSlabHeapAndContainer<KClientSession, KAutoObjectWithList> {
+ KERNEL_AUTOOBJECT_TRAITS(KClientSession, KAutoObject);
- friend class Session;
+public:
+ explicit KClientSession(KernelCore& kernel);
+ virtual ~KClientSession();
- std::string GetTypeName() const override {
- return "ClientSession";
+ void Initialize(KSession* parent_, std::string&& name_) {
+ // Set member variables.
+ parent = parent_;
+ name = std::move(name_);
}
- std::string GetName() const override {
- return name;
+ virtual void Destroy() override;
+ static void PostDestroy([[maybe_unused]] uintptr_t arg) {}
+
+ constexpr KSession* GetParent() const {
+ return parent;
}
+ ResultCode SendSyncRequest(KThread* thread, Core::Memory::Memory& memory,
+ Core::Timing::CoreTiming& core_timing);
+
+ void OnServerClosed();
+
+ // DEPRECATED
+
static constexpr HandleType HANDLE_TYPE = HandleType::ClientSession;
HandleType GetHandleType() const override {
return HANDLE_TYPE;
}
- ResultCode SendSyncRequest(KThread* thread, Core::Memory::Memory& memory,
- Core::Timing::CoreTiming& core_timing);
-
- bool IsSignaled() const override;
+ std::string GetTypeName() const override {
+ return "ClientSession";
+ }
- void Finalize() override {}
+ std::string GetName() const override {
+ return name;
+ }
private:
- static ResultVal<std::shared_ptr<ClientSession>> Create(KernelCore& kernel,
- std::shared_ptr<Session> parent,
- std::string name = "Unknown");
-
/// The parent session, which links to the server endpoint.
- std::shared_ptr<Session> parent;
+ KSession* parent{};
/// Name of the client session (optional)
std::string name;