summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Subv2016-12-05 11:02:08 -0500
committerGravatar Subv2016-12-05 11:02:08 -0500
commitdd8887c8cfbb6d3010dde240278a3d4018c5dd85 (patch)
tree9990a463d5daccdab41ae9c90a5c698aed0d4795 /src
parentDeclare empty ServerSession and ClientSession constructors as default. (diff)
downloadyuzu-dd8887c8cfbb6d3010dde240278a3d4018c5dd85.tar.gz
yuzu-dd8887c8cfbb6d3010dde240278a3d4018c5dd85.tar.xz
yuzu-dd8887c8cfbb6d3010dde240278a3d4018c5dd85.zip
KServerPorts now have an HLE handler "template", which is inherited by all ServerSessions created from it.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/client_port.cpp10
-rw-r--r--src/core/hle/kernel/client_port.h10
-rw-r--r--src/core/hle/kernel/client_session.cpp2
-rw-r--r--src/core/hle/kernel/client_session.h21
-rw-r--r--src/core/hle/kernel/server_port.cpp3
-rw-r--r--src/core/hle/kernel/server_port.h13
-rw-r--r--src/core/hle/kernel/server_session.cpp6
-rw-r--r--src/core/hle/kernel/server_session.h30
-rw-r--r--src/core/hle/service/service.cpp14
-rw-r--r--src/core/hle/service/service.h14
-rw-r--r--src/core/hle/service/srv.cpp14
-rw-r--r--src/core/hle/svc.cpp18
12 files changed, 86 insertions, 69 deletions
diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp
index 5ee7679eb..f25cb48dd 100644
--- a/src/core/hle/kernel/client_port.cpp
+++ b/src/core/hle/kernel/client_port.cpp
@@ -13,10 +13,18 @@ namespace Kernel {
13ClientPort::ClientPort() {} 13ClientPort::ClientPort() {}
14ClientPort::~ClientPort() {} 14ClientPort::~ClientPort() {}
15 15
16void ClientPort::AddWaitingSession(SharedPtr<ServerSession> server_session) { 16SharedPtr<ClientSession> ClientPort::Connect() {
17 // Create a new session pair, let the created sessions inherit the parent port's HLE handler.
18 auto sessions = ServerSession::CreateSessionPair(server_port->GetName(), server_port->hle_handler);
19 auto client_session = std::get<SharedPtr<ClientSession>>(sessions);
20 auto server_session = std::get<SharedPtr<ServerSession>>(sessions);
21
17 server_port->pending_sessions.push_back(server_session); 22 server_port->pending_sessions.push_back(server_session);
23
18 // Wake the threads waiting on the ServerPort 24 // Wake the threads waiting on the ServerPort
19 server_port->WakeupAllWaitingThreads(); 25 server_port->WakeupAllWaitingThreads();
26
27 return std::move(client_session);
20} 28}
21 29
22} // namespace 30} // namespace
diff --git a/src/core/hle/kernel/client_port.h b/src/core/hle/kernel/client_port.h
index 4848cb4c4..d217c6649 100644
--- a/src/core/hle/kernel/client_port.h
+++ b/src/core/hle/kernel/client_port.h
@@ -11,7 +11,7 @@
11namespace Kernel { 11namespace Kernel {
12 12
13class ServerPort; 13class ServerPort;
14class ServerSession; 14class ClientSession;
15 15
16class ClientPort final : public Object { 16class ClientPort final : public Object {
17public: 17public:
@@ -29,15 +29,17 @@ public:
29 } 29 }
30 30
31 /** 31 /**
32 * Adds the specified server session to the queue of pending sessions of the associated ServerPort 32 * Creates a new Session pair, adds the created ServerSession to the associated ServerPort's list of pending sessions,
33 * @param server_session Server session to add to the queue 33 * and signals the ServerPort, causing any threads waiting on it to awake.
34 * @returns ClientSession The client endpoint of the created Session pair.
34 */ 35 */
35 void AddWaitingSession(SharedPtr<ServerSession> server_session); 36 SharedPtr<ClientSession> Connect();
36 37
37 SharedPtr<ServerPort> server_port; ///< ServerPort associated with this client port. 38 SharedPtr<ServerPort> server_port; ///< ServerPort associated with this client port.
38 u32 max_sessions; ///< Maximum number of simultaneous sessions the port can have 39 u32 max_sessions; ///< Maximum number of simultaneous sessions the port can have
39 u32 active_sessions; ///< Number of currently open sessions to this port 40 u32 active_sessions; ///< Number of currently open sessions to this port
40 std::string name; ///< Name of client port (optional) 41 std::string name; ///< Name of client port (optional)
42
41private: 43private:
42 ClientPort(); 44 ClientPort();
43 ~ClientPort() override; 45 ~ClientPort() override;
diff --git a/src/core/hle/kernel/client_session.cpp b/src/core/hle/kernel/client_session.cpp
index c90fbc69d..6c577610d 100644
--- a/src/core/hle/kernel/client_session.cpp
+++ b/src/core/hle/kernel/client_session.cpp
@@ -20,7 +20,7 @@ ResultVal<SharedPtr<ClientSession>> ClientSession::Create(SharedPtr<ServerSessio
20 return MakeResult<SharedPtr<ClientSession>>(std::move(client_session)); 20 return MakeResult<SharedPtr<ClientSession>>(std::move(client_session));
21} 21}
22 22
23ResultCode ClientSession::HandleSyncRequest() { 23ResultCode ClientSession::SendSyncRequest() {
24 // Signal the server session that new data is available 24 // Signal the server session that new data is available
25 return server_session->HandleSyncRequest(); 25 return server_session->HandleSyncRequest();
26} 26}
diff --git a/src/core/hle/kernel/client_session.h b/src/core/hle/kernel/client_session.h
index e34528301..45f479901 100644
--- a/src/core/hle/kernel/client_session.h
+++ b/src/core/hle/kernel/client_session.h
@@ -17,17 +17,12 @@ class ServerSession;
17 17
18class ClientSession final : public Object { 18class ClientSession final : public Object {
19public: 19public:
20 /** 20 friend class ServerSession;
21 * Creates a client session.
22 * @param server_session The server session associated with this client session
23 * @param name Optional name of client session
24 * @return The created client session
25 */
26 static ResultVal<SharedPtr<ClientSession>> Create(SharedPtr<ServerSession> server_session, std::string name = "Unknown");
27 21
28 std::string GetTypeName() const override { 22 std::string GetTypeName() const override {
29 return "ClientSession"; 23 return "ClientSession";
30 } 24 }
25
31 std::string GetName() const override { 26 std::string GetName() const override {
32 return name; 27 return name;
33 } 28 }
@@ -38,10 +33,10 @@ public:
38 } 33 }
39 34
40 /** 35 /**
41 * Handle a SyncRequest from the emulated application. 36 * Sends an SyncRequest from the current emulated thread.
42 * @return ResultCode of the operation. 37 * @return ResultCode of the operation.
43 */ 38 */
44 ResultCode HandleSyncRequest(); 39 ResultCode SendSyncRequest();
45 40
46 std::string name; ///< Name of client port (optional) 41 std::string name; ///< Name of client port (optional)
47 SharedPtr<ServerSession> server_session; ///< The server session associated with this client session. 42 SharedPtr<ServerSession> server_session; ///< The server session associated with this client session.
@@ -49,6 +44,14 @@ public:
49private: 44private:
50 ClientSession(); 45 ClientSession();
51 ~ClientSession() override; 46 ~ClientSession() override;
47
48 /**
49 * Creates a client session.
50 * @param server_session The server session associated with this client session
51 * @param name Optional name of client session
52 * @return The created client session
53 */
54 static ResultVal<SharedPtr<ClientSession>> Create(SharedPtr<ServerSession> server_session, std::string name = "Unknown");
52}; 55};
53 56
54} // namespace 57} // namespace
diff --git a/src/core/hle/kernel/server_port.cpp b/src/core/hle/kernel/server_port.cpp
index 8e3ec8a14..f90fe76d5 100644
--- a/src/core/hle/kernel/server_port.cpp
+++ b/src/core/hle/kernel/server_port.cpp
@@ -24,12 +24,13 @@ void ServerPort::Acquire() {
24} 24}
25 25
26std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> ServerPort::CreatePortPair( 26std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> ServerPort::CreatePortPair(
27 u32 max_sessions, std::string name) { 27 u32 max_sessions, std::string name, std::shared_ptr<Service::SessionRequestHandler> hle_handler) {
28 28
29 SharedPtr<ServerPort> server_port(new ServerPort); 29 SharedPtr<ServerPort> server_port(new ServerPort);
30 SharedPtr<ClientPort> client_port(new ClientPort); 30 SharedPtr<ClientPort> client_port(new ClientPort);
31 31
32 server_port->name = name + "_Server"; 32 server_port->name = name + "_Server";
33 server_port->hle_handler = hle_handler;
33 client_port->name = name + "_Client"; 34 client_port->name = name + "_Client";
34 client_port->server_port = server_port; 35 client_port->server_port = server_port;
35 client_port->max_sessions = max_sessions; 36 client_port->max_sessions = max_sessions;
diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h
index fa9448ca0..dee0b1a9a 100644
--- a/src/core/hle/kernel/server_port.h
+++ b/src/core/hle/kernel/server_port.h
@@ -9,6 +9,10 @@
9#include "common/common_types.h" 9#include "common/common_types.h"
10#include "core/hle/kernel/kernel.h" 10#include "core/hle/kernel/kernel.h"
11 11
12namespace Service {
13class SessionRequestHandler;
14}
15
12namespace Kernel { 16namespace Kernel {
13 17
14class ClientPort; 18class ClientPort;
@@ -19,10 +23,13 @@ public:
19 * Creates a pair of ServerPort and an associated ClientPort. 23 * Creates a pair of ServerPort and an associated ClientPort.
20 * @param max_sessions Maximum number of sessions to the port 24 * @param max_sessions Maximum number of sessions to the port
21 * @param name Optional name of the ports 25 * @param name Optional name of the ports
26 * @param hle_handler Optional HLE handler template for the port,
27 * ServerSessions crated from this port will inherit a reference to this handler.
22 * @return The created port tuple 28 * @return The created port tuple
23 */ 29 */
24 static std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> CreatePortPair( 30 static std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> CreatePortPair(
25 u32 max_sessions, std::string name = "UnknownPort"); 31 u32 max_sessions, std::string name = "UnknownPort",
32 std::shared_ptr<Service::SessionRequestHandler> hle_handler = nullptr);
26 33
27 std::string GetTypeName() const override { 34 std::string GetTypeName() const override {
28 return "ServerPort"; 35 return "ServerPort";
@@ -41,6 +48,10 @@ public:
41 std::vector<SharedPtr<WaitObject>> 48 std::vector<SharedPtr<WaitObject>>
42 pending_sessions; ///< ServerSessions waiting to be accepted by the port 49 pending_sessions; ///< ServerSessions waiting to be accepted by the port
43 50
51 /// This session's HLE request handler template (optional)
52 /// ServerSessions created from this port inherit a reference to this handler.
53 std::shared_ptr<Service::SessionRequestHandler> hle_handler;
54
44 bool ShouldWait() override; 55 bool ShouldWait() override;
45 void Acquire() override; 56 void Acquire() override;
46 57
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp
index be334efd7..3782cb493 100644
--- a/src/core/hle/kernel/server_session.cpp
+++ b/src/core/hle/kernel/server_session.cpp
@@ -47,10 +47,10 @@ ResultCode ServerSession::HandleSyncRequest() {
47} 47}
48 48
49std::tuple<SharedPtr<ServerSession>, SharedPtr<ClientSession>> ServerSession::CreateSessionPair(const std::string& name, std::shared_ptr<Service::SessionRequestHandler> hle_handler) { 49std::tuple<SharedPtr<ServerSession>, SharedPtr<ClientSession>> ServerSession::CreateSessionPair(const std::string& name, std::shared_ptr<Service::SessionRequestHandler> hle_handler) {
50 auto server_session = ServerSession::Create(name + "Server", hle_handler).MoveFrom(); 50 auto server_session = ServerSession::Create(name + "_Server", hle_handler).MoveFrom();
51 auto client_session = ClientSession::Create(server_session, name + "Client").MoveFrom(); 51 auto client_session = ClientSession::Create(server_session, name + "_Client").MoveFrom();
52 52
53 return std::make_tuple(server_session, client_session); 53 return std::make_tuple(std::move(server_session), std::move(client_session));
54} 54}
55 55
56} 56}
diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h
index 70661e9af..c73ccee73 100644
--- a/src/core/hle/kernel/server_session.h
+++ b/src/core/hle/kernel/server_session.h
@@ -29,20 +29,8 @@ class ClientSession;
29 * the request, the response is marshalled back to the caller's TLS buffer and control is 29 * the request, the response is marshalled back to the caller's TLS buffer and control is
30 * transferred back to it. 30 * transferred back to it.
31 */ 31 */
32class ServerSession : public WaitObject { 32class ServerSession final : public WaitObject {
33public: 33public:
34 ServerSession();
35 ~ServerSession() override;
36
37 /**
38 * Creates a server session. The server session can have an optional HLE handler,
39 * which will be invoked to handle the IPC requests that this session receives.
40 * @param name Optional name of the server session.
41 * @param hle_handler Optional HLE handler for this server session.
42 * @return The created server session
43 */
44 static ResultVal<SharedPtr<ServerSession>> Create(std::string name = "Unknown", std::shared_ptr<Service::SessionRequestHandler> hle_handler = nullptr);
45
46 std::string GetTypeName() const override { 34 std::string GetTypeName() const override {
47 return "ServerSession"; 35 return "ServerSession";
48 } 36 }
@@ -61,10 +49,9 @@ public:
61 49
62 /** 50 /**
63 * Handle a sync request from the emulated application. 51 * Handle a sync request from the emulated application.
64 * Only HLE services should override this function.
65 * @returns ResultCode from the operation. 52 * @returns ResultCode from the operation.
66 */ 53 */
67 virtual ResultCode HandleSyncRequest(); 54 ResultCode HandleSyncRequest();
68 55
69 bool ShouldWait() override; 56 bool ShouldWait() override;
70 57
@@ -73,5 +60,18 @@ public:
73 std::string name; ///< The name of this session (optional) 60 std::string name; ///< The name of this session (optional)
74 bool signaled; ///< Whether there's new data available to this ServerSession 61 bool signaled; ///< Whether there's new data available to this ServerSession
75 std::shared_ptr<Service::SessionRequestHandler> hle_handler; ///< This session's HLE request handler (optional) 62 std::shared_ptr<Service::SessionRequestHandler> hle_handler; ///< This session's HLE request handler (optional)
63
64private:
65 ServerSession();
66 ~ServerSession() override;
67
68 /**
69 * Creates a server session. The server session can have an optional HLE handler,
70 * which will be invoked to handle the IPC requests that this session receives.
71 * @param name Optional name of the server session.
72 * @param hle_handler Optional HLE handler for this server session.
73 * @return The created server session
74 */
75 static ResultVal<SharedPtr<ServerSession>> Create(std::string name = "Unknown", std::shared_ptr<Service::SessionRequestHandler> hle_handler = nullptr);
76}; 76};
77} 77}
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index c90802455..3462af8ce 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -44,8 +44,8 @@
44 44
45namespace Service { 45namespace Service {
46 46
47std::unordered_map<std::string, std::tuple<Kernel::SharedPtr<Kernel::ClientPort>, std::shared_ptr<Interface>>> g_kernel_named_ports; 47std::unordered_map<std::string, Kernel::SharedPtr<Kernel::ClientPort>> g_kernel_named_ports;
48std::unordered_map<std::string, std::tuple<Kernel::SharedPtr<Kernel::ClientPort>, std::shared_ptr<Interface>>> g_srv_services; 48std::unordered_map<std::string, Kernel::SharedPtr<Kernel::ClientPort>> g_srv_services;
49 49
50/** 50/**
51 * Creates a function string for logging, complete with the name (or header code, depending 51 * Creates a function string for logging, complete with the name (or header code, depending
@@ -102,15 +102,17 @@ void Interface::Register(const FunctionInfo* functions, size_t n) {
102// Module interface 102// Module interface
103 103
104static void AddNamedPort(Interface* interface_) { 104static void AddNamedPort(Interface* interface_) {
105 auto ports = Kernel::ServerPort::CreatePortPair(interface_->GetMaxSessions(), interface_->GetPortName()); 105 auto ports = Kernel::ServerPort::CreatePortPair(interface_->GetMaxSessions(), interface_->GetPortName(),
106 std::shared_ptr<Interface>(interface_));
106 auto client_port = std::get<Kernel::SharedPtr<Kernel::ClientPort>>(ports); 107 auto client_port = std::get<Kernel::SharedPtr<Kernel::ClientPort>>(ports);
107 g_kernel_named_ports.emplace(interface_->GetPortName(), std::make_tuple(client_port, std::shared_ptr<Interface>(interface_))); 108 g_kernel_named_ports.emplace(interface_->GetPortName(), client_port);
108} 109}
109 110
110void AddService(Interface* interface_) { 111void AddService(Interface* interface_) {
111 auto ports = Kernel::ServerPort::CreatePortPair(interface_->GetMaxSessions(), interface_->GetPortName()); 112 auto ports = Kernel::ServerPort::CreatePortPair(interface_->GetMaxSessions(), interface_->GetPortName(),
113 std::shared_ptr<Interface>(interface_));
112 auto client_port = std::get<Kernel::SharedPtr<Kernel::ClientPort>>(ports); 114 auto client_port = std::get<Kernel::SharedPtr<Kernel::ClientPort>>(ports);
113 g_srv_services.emplace(interface_->GetPortName(), std::make_tuple(client_port, std::shared_ptr<Interface>(interface_))); 115 g_srv_services.emplace(interface_->GetPortName(), client_port);
114} 116}
115 117
116/// Initialize ServiceManager 118/// Initialize ServiceManager
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index 931512339..e85882713 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -176,7 +176,11 @@ namespace Service {
176static const int kMaxPortSize = 8; ///< Maximum size of a port name (8 characters) 176static const int kMaxPortSize = 8; ///< Maximum size of a port name (8 characters)
177static const u32 DefaultMaxSessions = 10; ///< Arbitrary default number of maximum connections to an HLE port 177static const u32 DefaultMaxSessions = 10; ///< Arbitrary default number of maximum connections to an HLE port
178 178
179/// TODO(Subv): Write documentation for this class 179/**
180 * Interface implemented by HLE Session handlers.
181 * This can be provided to a ServerSession in order to hook into several relevant events (such as a new connection or a SyncRequest)
182 * so they can be implemented in the emulator.
183 */
180class SessionRequestHandler { 184class SessionRequestHandler {
181public: 185public:
182 /** 186 /**
@@ -190,7 +194,9 @@ public:
190 virtual ResultCode HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_session) = 0; 194 virtual ResultCode HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_session) = 0;
191}; 195};
192 196
193/// Interface to a CTROS service 197/**
198 * Framework for implementing HLE service handlers which dispatch incoming SyncRequests based on a table mapping header ids to handler functions.
199 */
194class Interface : public SessionRequestHandler { 200class Interface : public SessionRequestHandler {
195public: 201public:
196 std::string GetName() const { 202 std::string GetName() const {
@@ -257,9 +263,9 @@ void Init();
257void Shutdown(); 263void Shutdown();
258 264
259/// Map of named ports managed by the kernel, which can be retrieved using the ConnectToPort SVC. 265/// Map of named ports managed by the kernel, which can be retrieved using the ConnectToPort SVC.
260extern std::unordered_map<std::string, std::tuple<Kernel::SharedPtr<Kernel::ClientPort>, std::shared_ptr<Interface>>> g_kernel_named_ports; 266extern std::unordered_map<std::string, Kernel::SharedPtr<Kernel::ClientPort>> g_kernel_named_ports;
261/// Map of services registered with the "srv:" service, retrieved using GetServiceHandle. 267/// Map of services registered with the "srv:" service, retrieved using GetServiceHandle.
262extern std::unordered_map<std::string, std::tuple<Kernel::SharedPtr<Kernel::ClientPort>, std::shared_ptr<Interface>>> g_srv_services; 268extern std::unordered_map<std::string, Kernel::SharedPtr<Kernel::ClientPort>> g_srv_services;
263 269
264/// Adds a service to the services table 270/// Adds a service to the services table
265void AddService(Interface* interface_); 271void AddService(Interface* interface_);
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp
index c0abfd711..bb2c8fcc4 100644
--- a/src/core/hle/service/srv.cpp
+++ b/src/core/hle/service/srv.cpp
@@ -85,21 +85,13 @@ static void GetServiceHandle(Service::Interface* self) {
85 auto it = Service::g_srv_services.find(port_name); 85 auto it = Service::g_srv_services.find(port_name);
86 86
87 if (it != Service::g_srv_services.end()) { 87 if (it != Service::g_srv_services.end()) {
88 auto client_port = std::get<Kernel::SharedPtr<Kernel::ClientPort>>(it->second); 88 auto client_port = it->second;
89 // The hle_handler will be nullptr if this port was registered by the emulated
90 // application by means of srv:RegisterService.
91 auto hle_handler = std::get<std::shared_ptr<Service::Interface>>(it->second);
92
93 // Create a new session pair
94 auto sessions = Kernel::ServerSession::CreateSessionPair(port_name, hle_handler);
95 auto client_session = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
96 auto server_session = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
97 89
98 // Note: Threads do not wait for the server endpoint to call 90 // Note: Threads do not wait for the server endpoint to call
99 // AcceptSession before returning from this call. 91 // AcceptSession before returning from this call.
100 92
101 // Add the server session to the port's queue 93 // Connect to the port and retrieve the client endpoint of the connection Session.
102 client_port->AddWaitingSession(server_session); 94 auto client_session = client_port->Connect();
103 95
104 // Return the client session 96 // Return the client session
105 cmd_buff[3] = Kernel::g_handle_table.Create(client_session).MoveFrom(); 97 cmd_buff[3] = Kernel::g_handle_table.Create(client_session).MoveFrom();
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index ab0eb9d86..4189d75ac 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -224,18 +224,10 @@ static ResultCode ConnectToPort(Handle* out_handle, const char* port_name) {
224 return ERR_NOT_FOUND; 224 return ERR_NOT_FOUND;
225 } 225 }
226 226
227 auto client_port = std::get<Kernel::SharedPtr<Kernel::ClientPort>>(it->second); 227 auto client_port = it->second;
228 // The hle_handler will be nullptr if this port was registered by the emulated
229 // application by means of svcCreatePort with a defined name.
230 auto hle_handler = std::get<std::shared_ptr<Service::Interface>>(it->second);
231 228
232 // Create a new session pair 229 // Connect to the port and retrieve the client endpoint of the connection Session.
233 auto sessions = Kernel::ServerSession::CreateSessionPair(port_name, hle_handler); 230 auto client_session = client_port->Connect();
234 auto client_session = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
235 auto server_session = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
236
237 // Add the server session to the port's queue
238 client_port->AddWaitingSession(server_session);
239 231
240 // Note: Threads do not wait for the server endpoint to call 232 // Note: Threads do not wait for the server endpoint to call
241 // AcceptSession before returning from this call. 233 // AcceptSession before returning from this call.
@@ -254,8 +246,8 @@ static ResultCode SendSyncRequest(Handle handle) {
254 246
255 LOG_TRACE(Kernel_SVC, "called handle=0x%08X(%s)", handle, session->GetName().c_str()); 247 LOG_TRACE(Kernel_SVC, "called handle=0x%08X(%s)", handle, session->GetName().c_str());
256 248
257 // TODO(Subv): Wait the current thread and reschedule if this request is not going to be handled by HLE code. 249 // TODO(Subv): svcSendSyncRequest should put the caller thread to sleep while the server responds and cause a reschedule.
258 return session->HandleSyncRequest(); 250 return session->SendSyncRequest();
259} 251}
260 252
261/// Close a handle 253/// Close a handle