diff options
author | bunnei <bunneidev@gmail.com> | 2019-11-26 00:28:48 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2019-11-28 18:01:53 +0100 |
commit | c3d3b173d39b7c12fa9b3d5d34040e9377f2888e (patch) | |
tree | 61ff05239fe2b3d08bcf775f1528263cffc9aff4 /src/core/hle/kernel/server_session.h | |
parent | Merge pull request #3169 from lioncash/memory (diff) | |
download | yuzu-c3d3b173d39b7c12fa9b3d5d34040e9377f2888e.tar yuzu-c3d3b173d39b7c12fa9b3d5d34040e9377f2888e.tar.gz yuzu-c3d3b173d39b7c12fa9b3d5d34040e9377f2888e.tar.bz2 yuzu-c3d3b173d39b7c12fa9b3d5d34040e9377f2888e.tar.lz yuzu-c3d3b173d39b7c12fa9b3d5d34040e9377f2888e.tar.xz yuzu-c3d3b173d39b7c12fa9b3d5d34040e9377f2888e.tar.zst yuzu-c3d3b173d39b7c12fa9b3d5d34040e9377f2888e.zip |
Diffstat (limited to 'src/core/hle/kernel/server_session.h')
-rw-r--r-- | src/core/hle/kernel/server_session.h | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h index 641709a45..d6e48109e 100644 --- a/src/core/hle/kernel/server_session.h +++ b/src/core/hle/kernel/server_session.h @@ -1,4 +1,4 @@ -// Copyright 2014 Citra Emulator Project +// Copyright 2019 yuzu emulator team // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -9,7 +9,7 @@ #include <utility> #include <vector> -#include "core/hle/kernel/object.h" +#include "common/threadsafe_queue.h" #include "core/hle/kernel/wait_object.h" #include "core/hle/result.h" @@ -17,13 +17,14 @@ namespace Memory { class Memory; } +namespace Core::Timing { +struct EventType; +} + namespace Kernel { -class ClientPort; -class ClientSession; class HLERequestContext; class KernelCore; -class ServerSession; class Session; class SessionRequestHandler; class Thread; @@ -45,6 +46,12 @@ public: explicit ServerSession(KernelCore& kernel); ~ServerSession() override; + friend class Session; + + static ResultVal<std::shared_ptr<ServerSession>> Create(KernelCore& kernel, + std::shared_ptr<Session> parent, + std::string name = "Unknown"); + std::string GetTypeName() const override { return "ServerSession"; } @@ -66,18 +73,6 @@ public: return parent.get(); } - using SessionPair = std::pair<std::shared_ptr<ServerSession>, std::shared_ptr<ClientSession>>; - - /** - * Creates a pair of ServerSession and an associated ClientSession. - * @param kernel The kernal instance to create the session pair under. - * @param name Optional name of the ports. - * @param client_port Optional The ClientPort that spawned this session. - * @return The created session tuple - */ - static SessionPair CreateSessionPair(KernelCore& kernel, const std::string& name = "Unknown", - std::shared_ptr<ClientPort> client_port = nullptr); - /** * Sets the HLE handler for the session. This handler will be called to service IPC requests * instead of the regular IPC machinery. (The regular IPC machinery is currently not @@ -128,15 +123,11 @@ public: } private: - /** - * Creates a server session. The server session can have an optional HLE handler, - * which will be invoked to handle the IPC requests that this session receives. - * @param kernel The kernel instance to create this server session under. - * @param name Optional name of the server session. - * @return The created server session - */ - static ResultVal<std::shared_ptr<ServerSession>> Create(KernelCore& kernel, - std::string name = "Unknown"); + /// Queues a sync request from the emulated application. + ResultCode QueueSyncRequest(std::shared_ptr<Thread> thread, Memory::Memory& memory); + + /// Completes a sync request from the emulated application. + ResultCode CompleteSyncRequest(); /// Handles a SyncRequest to a domain, forwarding the request to the proper object or closing an /// object handle. @@ -166,6 +157,12 @@ private: /// The name of this session (optional) std::string name; + + /// Core timing event used to schedule the service request at some point in the future + std::shared_ptr<Core::Timing::EventType> request_event; + + /// Queue of scheduled service requests + Common::MPSCQueue<std::shared_ptr<Kernel::HLERequestContext>> request_queue; }; } // namespace Kernel |