summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/service.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2016-12-05 18:05:00 +0100
committerSubv <subv2112@gmail.com>2016-12-05 18:05:00 +0100
commit00f0c775702af4145a4a81ec5d357c3586a5c6c3 (patch)
tree58f7dbfddba5de2c2f4a7fac420ab5ac8a8a3de1 /src/core/hle/service/service.h
parentKernel: Remove the Redirection handle type. (diff)
downloadyuzu-00f0c775702af4145a4a81ec5d357c3586a5c6c3.tar
yuzu-00f0c775702af4145a4a81ec5d357c3586a5c6c3.tar.gz
yuzu-00f0c775702af4145a4a81ec5d357c3586a5c6c3.tar.bz2
yuzu-00f0c775702af4145a4a81ec5d357c3586a5c6c3.tar.lz
yuzu-00f0c775702af4145a4a81ec5d357c3586a5c6c3.tar.xz
yuzu-00f0c775702af4145a4a81ec5d357c3586a5c6c3.tar.zst
yuzu-00f0c775702af4145a4a81ec5d357c3586a5c6c3.zip
Diffstat (limited to 'src/core/hle/service/service.h')
-rw-r--r--src/core/hle/service/service.h28
1 files changed, 22 insertions, 6 deletions
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<Kernel::ServerSession> server_session) = 0;
+ ResultCode HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> 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<Kernel::ServerSession> 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<Kernel::ServerSession> server_session);
};
/**
@@ -231,9 +247,9 @@ public:
return "[UNKNOWN SERVICE PORT]";
}
- ResultCode HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_session) override;
-
protected:
+ void HandleSyncRequestImpl(Kernel::SharedPtr<Kernel::ServerSession> server_session) override;
+
/**
* Registers the functions in the service
*/