From 073653e858abf377fd1ebbdb071809c8830ce99d Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 14 Jun 2016 18:03:30 -0500 Subject: Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication. All handles obtained via srv::GetServiceHandle or svcConnectToPort are references to ClientSessions. Service modules will wait on the counterpart of those ClientSessions (Called ServerSessions) using svcReplyAndReceive or svcWaitSynchronization[1|N], and will be awoken when a SyncRequest is performed. HLE Interfaces are now ClientPorts which override the HandleSyncRequest virtual member function to perform command handling immediately. --- src/core/hle/kernel/client_port.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/core/hle/kernel/client_port.h') diff --git a/src/core/hle/kernel/client_port.h b/src/core/hle/kernel/client_port.h index d28147718..eb0882870 100644 --- a/src/core/hle/kernel/client_port.h +++ b/src/core/hle/kernel/client_port.h @@ -11,16 +11,27 @@ namespace Kernel { class ServerPort; +class ServerSession; class ClientPort : public Object { public: friend class ServerPort; - std::string GetTypeName() const override { - return "ClientPort"; - } - std::string GetName() const override { - return name; - } + + /** + * Adds the specified server session to the queue of pending sessions of the associated ServerPort + * @param server_session Server session to add to the queue + */ + virtual void AddWaitingSession(SharedPtr server_session); + + /** + * Handle a sync request from the emulated application. + * Only HLE services should override this function. + * @returns ResultCode from the operation. + */ + virtual ResultCode HandleSyncRequest() { return RESULT_SUCCESS; } + + std::string GetTypeName() const override { return "ClientPort"; } + std::string GetName() const override { return name; } static const HandleType HANDLE_TYPE = HandleType::ClientPort; HandleType GetHandleType() const override { -- cgit v1.2.3