summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorGravatar Subv2016-12-09 12:52:12 -0500
committerGravatar Subv2016-12-09 12:52:12 -0500
commitebbb55ec8f827096f1c743cc4b7f4a2aa05a3ed3 (patch)
treebea70b5f82c2777939b69e4774bae5a320e33669 /src/core/hle/kernel
parentKernel/IPC: Small codestyle cleanup (diff)
downloadyuzu-ebbb55ec8f827096f1c743cc4b7f4a2aa05a3ed3.tar.gz
yuzu-ebbb55ec8f827096f1c743cc4b7f4a2aa05a3ed3.tar.xz
yuzu-ebbb55ec8f827096f1c743cc4b7f4a2aa05a3ed3.zip
Moved the HLE command buffer translation task to ServerSession instead of the HLE handler superclass.
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/server_session.cpp15
-rw-r--r--src/core/hle/kernel/server_session.h10
2 files changed, 23 insertions, 2 deletions
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp
index 3fac6b934..1e54c3a2e 100644
--- a/src/core/hle/kernel/server_session.cpp
+++ b/src/core/hle/kernel/server_session.cpp
@@ -41,8 +41,14 @@ ResultCode ServerSession::HandleSyncRequest() {
41 // from its ClientSession, so wake up any threads that may be waiting on a svcReplyAndReceive or similar. 41 // from its ClientSession, so wake up any threads that may be waiting on a svcReplyAndReceive or similar.
42 42
43 // If this ServerSession has an associated HLE handler, forward the request to it. 43 // If this ServerSession has an associated HLE handler, forward the request to it.
44 if (hle_handler != nullptr) 44 if (hle_handler != nullptr) {
45 return hle_handler->HandleSyncRequest(SharedPtr<ServerSession>(this)); 45 // Attempt to translate the incoming request's command buffer.
46 ResultCode result = TranslateHLERequest(this);
47 if (result.IsError())
48 return result;
49 hle_handler->HandleSyncRequest(SharedPtr<ServerSession>(this));
50 // TODO(Subv): Translate the response command buffer.
51 }
46 52
47 // If this ServerSession does not have an HLE implementation, just wake up the threads waiting on it. 53 // If this ServerSession does not have an HLE implementation, just wake up the threads waiting on it.
48 signaled = true; 54 signaled = true;
@@ -60,4 +66,9 @@ ServerSession::SessionPair ServerSession::CreateSessionPair(const std::string& n
60 return std::make_tuple(std::move(server_session), std::move(client_session)); 66 return std::make_tuple(std::move(server_session), std::move(client_session));
61} 67}
62 68
69ResultCode TranslateHLERequest(ServerSession* server_session) {
70 // TODO(Subv): Implement this function once multiple concurrent processes are supported.
71 return RESULT_SUCCESS;
72}
73
63} 74}
diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h
index 7f00db07b..7abc09011 100644
--- a/src/core/hle/kernel/server_session.h
+++ b/src/core/hle/kernel/server_session.h
@@ -76,4 +76,14 @@ private:
76 */ 76 */
77 static ResultVal<SharedPtr<ServerSession>> Create(std::string name = "Unknown", std::shared_ptr<Service::SessionRequestHandler> hle_handler = nullptr); 77 static ResultVal<SharedPtr<ServerSession>> Create(std::string name = "Unknown", std::shared_ptr<Service::SessionRequestHandler> hle_handler = nullptr);
78}; 78};
79
80/**
81 * Performs command buffer translation for an HLE IPC request.
82 * The command buffer from the ServerSession thread's TLS is copied into a
83 * buffer and all descriptors in the buffer are processed.
84 * TODO(Subv): Implement this function, currently we do not support multiple processes running at once,
85 * but once that is implemented we'll need to properly translate all descriptors in the command buffer.
86 */
87ResultCode TranslateHLERequest(ServerSession* server_session);
88
79} 89}