summaryrefslogtreecommitdiff
path: root/src/core/hle/service/service.cpp
diff options
context:
space:
mode:
authorGravatar Subv2016-11-30 22:50:13 -0500
committerGravatar Subv2016-11-30 23:12:35 -0500
commit009b15b3aa9858930f461d825f7dd030fc963801 (patch)
tree060b6a82ad6c093b1832cd9e96a4fdacf29448b5 /src/core/hle/service/service.cpp
parentIPC/HLE: Associate the ClientSessions with their parent port's HLE interface ... (diff)
downloadyuzu-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/service.cpp')
-rw-r--r--src/core/hle/service/service.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 56e4f8734..c90802455 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -4,6 +4,9 @@
4 4
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "common/string_util.h" 6#include "common/string_util.h"
7
8#include "core/hle/kernel/server_port.h"
9#include "core/hle/service/service.h"
7#include "core/hle/service/ac_u.h" 10#include "core/hle/service/ac_u.h"
8#include "core/hle/service/act_a.h" 11#include "core/hle/service/act_a.h"
9#include "core/hle/service/act_u.h" 12#include "core/hle/service/act_u.h"
@@ -41,8 +44,8 @@
41 44
42namespace Service { 45namespace Service {
43 46
44std::unordered_map<std::string, Kernel::SharedPtr<Kernel::ClientPort>> g_kernel_named_ports; 47std::unordered_map<std::string, std::tuple<Kernel::SharedPtr<Kernel::ClientPort>, std::shared_ptr<Interface>>> g_kernel_named_ports;
45std::unordered_map<std::string, Kernel::SharedPtr<Kernel::ClientPort>> g_srv_services; 48std::unordered_map<std::string, std::tuple<Kernel::SharedPtr<Kernel::ClientPort>, std::shared_ptr<Interface>>> g_srv_services;
46 49
47/** 50/**
48 * 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
@@ -99,13 +102,15 @@ void Interface::Register(const FunctionInfo* functions, size_t n) {
99// Module interface 102// Module interface
100 103
101static void AddNamedPort(Interface* interface_) { 104static void AddNamedPort(Interface* interface_) {
102 auto client_port = Kernel::ClientPort::CreateForHLE(interface_->GetMaxSessions(), std::shared_ptr<Interface>(interface_)); 105 auto ports = Kernel::ServerPort::CreatePortPair(interface_->GetMaxSessions(), interface_->GetPortName());
103 g_kernel_named_ports.emplace(interface_->GetPortName(), client_port); 106 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_)));
104} 108}
105 109
106void AddService(Interface* interface_) { 110void AddService(Interface* interface_) {
107 auto client_port = Kernel::ClientPort::CreateForHLE(interface_->GetMaxSessions(), std::shared_ptr<Interface>(interface_)); 111 auto ports = Kernel::ServerPort::CreatePortPair(interface_->GetMaxSessions(), interface_->GetPortName());
108 g_srv_services.emplace(interface_->GetPortName(), client_port); 112 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_)));
109} 114}
110 115
111/// Initialize ServiceManager 116/// Initialize ServiceManager