diff options
| author | 2016-11-30 22:50:13 -0500 | |
|---|---|---|
| committer | 2016-11-30 23:12:35 -0500 | |
| commit | 009b15b3aa9858930f461d825f7dd030fc963801 (patch) | |
| tree | 060b6a82ad6c093b1832cd9e96a4fdacf29448b5 /src/core/hle/service/srv.cpp | |
| parent | IPC/HLE: Associate the ClientSessions with their parent port's HLE interface ... (diff) | |
| download | yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.gz yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.xz yuzu-009b15b3aa9858930f461d825f7dd030fc963801.zip | |
A bit of a redesign.
Sessions and Ports are now detached from each other.
HLE services are handled by means of a SessionRequestHandler class, Interface now inherits from this class.
The File and Directory classes are no longer kernel objects, but SessionRequestHandlers instead, bound to a ServerSession when requested.
File::OpenLinkFile now creates a new session pair and binds the File instance to it.
Diffstat (limited to 'src/core/hle/service/srv.cpp')
| -rw-r--r-- | src/core/hle/service/srv.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index eb2e06041..6731afc22 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include "core/hle/kernel/client_session.h" | 10 | #include "core/hle/kernel/client_session.h" |
| 11 | #include "core/hle/kernel/event.h" | 11 | #include "core/hle/kernel/event.h" |
| 12 | #include "core/hle/service/srv.h" | 12 | #include "core/hle/service/srv.h" |
| 13 | #include "core/hle/kernel/server_session.h" | ||
| 13 | 14 | ||
| 14 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 15 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 15 | // Namespace SRV | 16 | // Namespace SRV |
| @@ -85,13 +86,18 @@ static void GetServiceHandle(Service::Interface* self) { | |||
| 85 | auto it = Service::g_srv_services.find(port_name); | 86 | auto it = Service::g_srv_services.find(port_name); |
| 86 | 87 | ||
| 87 | if (it != Service::g_srv_services.end()) { | 88 | if (it != Service::g_srv_services.end()) { |
| 88 | auto client_port = it->second; | 89 | auto client_port = std::get<Kernel::SharedPtr<Kernel::ClientPort>>(it->second); |
| 90 | // The hle_handler will be nullptr if this port was registered by the emulated | ||
| 91 | // application by means of srv:RegisterService. | ||
| 92 | auto hle_handler = std::get<std::shared_ptr<Service::Interface>>(it->second); | ||
| 89 | 93 | ||
| 90 | // Create a new session pair | 94 | // Create a new session pair |
| 91 | auto sessions = Kernel::ServerSession::CreateSessionPair(client_port, port_name); | 95 | auto sessions = Kernel::ServerSession::CreateSessionPair(port_name, hle_handler); |
| 92 | auto client_session = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions); | 96 | auto client_session = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions); |
| 93 | auto server_session = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions); | 97 | auto server_session = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions); |
| 94 | 98 | ||
| 99 | // TODO(Subv): Wait the current thread until the ServerPort calls AcceptSession. | ||
| 100 | |||
| 95 | // Add the server session to the port's queue | 101 | // Add the server session to the port's queue |
| 96 | client_port->AddWaitingSession(server_session); | 102 | client_port->AddWaitingSession(server_session); |
| 97 | 103 | ||