diff options
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r-- | src/core/hle/kernel/server_session.cpp | 15 | ||||
-rw-r--r-- | src/core/hle/kernel/server_session.h | 10 |
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() { // from its ClientSession, so wake up any threads that may be waiting on a svcReplyAndReceive or similar. // If this ServerSession has an associated HLE handler, forward the request to it. - if (hle_handler != nullptr) - return hle_handler->HandleSyncRequest(SharedPtr<ServerSession>(this)); + if (hle_handler != nullptr) { + // Attempt to translate the incoming request's command buffer. + ResultCode result = TranslateHLERequest(this); + if (result.IsError()) + return result; + hle_handler->HandleSyncRequest(SharedPtr<ServerSession>(this)); + // TODO(Subv): Translate the response command buffer. + } // If this ServerSession does not have an HLE implementation, just wake up the threads waiting on it. signaled = true; @@ -60,4 +66,9 @@ ServerSession::SessionPair ServerSession::CreateSessionPair(const std::string& n return std::make_tuple(std::move(server_session), std::move(client_session)); } +ResultCode TranslateHLERequest(ServerSession* server_session) { + // TODO(Subv): Implement this function once multiple concurrent processes are supported. + return RESULT_SUCCESS; +} + } 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: */ static ResultVal<SharedPtr<ServerSession>> Create(std::string name = "Unknown", std::shared_ptr<Service::SessionRequestHandler> hle_handler = nullptr); }; + +/** + * Performs command buffer translation for an HLE IPC 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 TranslateHLERequest(ServerSession* server_session); + } |