From 00f0c775702af4145a4a81ec5d357c3586a5c6c3 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 5 Dec 2016 12:05:00 -0500 Subject: Split SessionRequestHandler::HandleSyncRequest into HandleSyncRequest, TranslateRequest and HandleSyncRequestImpl. HandleSyncRequest now takes care of calling the command buffer translate function before actually invoking the command handler for HLE services. --- src/core/hle/service/service.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/service.h') diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index e85882713..7b7db8499 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -187,11 +187,27 @@ public: * Dispatches and handles a sync request from the emulated application. * @param server_session The ServerSession that was triggered for this sync request, * it should be used to differentiate which client (As in ClientSession) we're answering to. - * TODO(Subv): Make a HandleSyncRequestParent function that is called from the outside and does { ReturnIfError(Translate()); HandleSyncRequest(); } - * The Translate() function would copy the command buffer from the ServerSession thread's TLS into a temporary buffer, and pass it to HandleSyncRequest. - * TODO(Subv): HandleSyncRequest's return type should be void. + * @returns ResultCode the result code of the translate operation. */ - virtual ResultCode HandleSyncRequest(Kernel::SharedPtr server_session) = 0; + ResultCode HandleSyncRequest(Kernel::SharedPtr server_session); + +protected: + /** + * Handles a sync request from the emulated application and writes the response to the command buffer. + * TODO(Subv): Use a wrapper structure to hold all the information relevant to + * this request (ServerSession, Originator thread, Translated command buffer, etc). + */ + virtual void HandleSyncRequestImpl(Kernel::SharedPtr server_session) = 0; + +private: + /** + * Performs command buffer translation for this request. + * The command buffer from the ServerSession thread's TLS is copied into a + * buffer and all descriptors in the buffer are processed. + * TODO(Subv): Implement this function, currently we do not support multiple processes running at once, + * but once that is implemented we'll need to properly translate all descriptors in the command buffer. + */ + ResultCode TranslateRequest(Kernel::SharedPtr server_session); }; /** @@ -231,9 +247,9 @@ public: return "[UNKNOWN SERVICE PORT]"; } - ResultCode HandleSyncRequest(Kernel::SharedPtr server_session) override; - protected: + void HandleSyncRequestImpl(Kernel::SharedPtr server_session) override; + /** * Registers the functions in the service */ -- cgit v1.2.3