summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/service.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2016-12-01 04:50:13 +0100
committerSubv <subv2112@gmail.com>2016-12-01 05:12:35 +0100
commit009b15b3aa9858930f461d825f7dd030fc963801 (patch)
tree060b6a82ad6c093b1832cd9e96a4fdacf29448b5 /src/core/hle/service/service.cpp
parentIPC/HLE: Associate the ClientSessions with their parent port's HLE interface if it exists. (diff)
downloadyuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.gz
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.bz2
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.lz
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.xz
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.zst
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.zip
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 @@
#include "common/logging/log.h"
#include "common/string_util.h"
+
+#include "core/hle/kernel/server_port.h"
+#include "core/hle/service/service.h"
#include "core/hle/service/ac_u.h"
#include "core/hle/service/act_a.h"
#include "core/hle/service/act_u.h"
@@ -41,8 +44,8 @@
namespace Service {
-std::unordered_map<std::string, Kernel::SharedPtr<Kernel::ClientPort>> g_kernel_named_ports;
-std::unordered_map<std::string, Kernel::SharedPtr<Kernel::ClientPort>> g_srv_services;
+std::unordered_map<std::string, std::tuple<Kernel::SharedPtr<Kernel::ClientPort>, std::shared_ptr<Interface>>> g_kernel_named_ports;
+std::unordered_map<std::string, std::tuple<Kernel::SharedPtr<Kernel::ClientPort>, std::shared_ptr<Interface>>> g_srv_services;
/**
* 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) {
// Module interface
static void AddNamedPort(Interface* interface_) {
- auto client_port = Kernel::ClientPort::CreateForHLE(interface_->GetMaxSessions(), std::shared_ptr<Interface>(interface_));
- g_kernel_named_ports.emplace(interface_->GetPortName(), client_port);
+ auto ports = Kernel::ServerPort::CreatePortPair(interface_->GetMaxSessions(), interface_->GetPortName());
+ auto client_port = std::get<Kernel::SharedPtr<Kernel::ClientPort>>(ports);
+ g_kernel_named_ports.emplace(interface_->GetPortName(), std::make_tuple(client_port, std::shared_ptr<Interface>(interface_)));
}
void AddService(Interface* interface_) {
- auto client_port = Kernel::ClientPort::CreateForHLE(interface_->GetMaxSessions(), std::shared_ptr<Interface>(interface_));
- g_srv_services.emplace(interface_->GetPortName(), client_port);
+ auto ports = Kernel::ServerPort::CreatePortPair(interface_->GetMaxSessions(), interface_->GetPortName());
+ auto client_port = std::get<Kernel::SharedPtr<Kernel::ClientPort>>(ports);
+ g_srv_services.emplace(interface_->GetPortName(), std::make_tuple(client_port, std::shared_ptr<Interface>(interface_)));
}
/// Initialize ServiceManager