summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/service.cpp
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2017-06-06 23:04:11 +0200
committerGitHub <noreply@github.com>2017-06-06 23:04:11 +0200
commitb242f1c5dd72f70d32f3a2d25d67974cdac5d9b1 (patch)
treeb6672a86793b53fdf3e07340515d731e45253677 /src/core/hle/service/service.cpp
parentMerge pull request #2753 from yuriks/set-hle-handler (diff)
parentService: Make service registration part of the sm implementation (diff)
downloadyuzu-b242f1c5dd72f70d32f3a2d25d67974cdac5d9b1.tar
yuzu-b242f1c5dd72f70d32f3a2d25d67974cdac5d9b1.tar.gz
yuzu-b242f1c5dd72f70d32f3a2d25d67974cdac5d9b1.tar.bz2
yuzu-b242f1c5dd72f70d32f3a2d25d67974cdac5d9b1.tar.lz
yuzu-b242f1c5dd72f70d32f3a2d25d67974cdac5d9b1.tar.xz
yuzu-b242f1c5dd72f70d32f3a2d25d67974cdac5d9b1.tar.zst
yuzu-b242f1c5dd72f70d32f3a2d25d67974cdac5d9b1.zip
Diffstat (limited to 'src/core/hle/service/service.cpp')
-rw-r--r--src/core/hle/service/service.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 8f7c97d54..1b64ee77d 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -38,15 +38,15 @@
#include "core/hle/service/ptm/ptm.h"
#include "core/hle/service/qtm/qtm.h"
#include "core/hle/service/service.h"
+#include "core/hle/service/sm/sm.h"
+#include "core/hle/service/sm/srv.h"
#include "core/hle/service/soc_u.h"
-#include "core/hle/service/srv.h"
#include "core/hle/service/ssl_c.h"
#include "core/hle/service/y2r_u.h"
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;
/**
* Creates a function string for logging, complete with the name (or header code, depending
@@ -115,18 +115,17 @@ static void AddNamedPort(Interface* interface_) {
}
void AddService(Interface* interface_) {
- Kernel::SharedPtr<Kernel::ServerPort> server_port;
- Kernel::SharedPtr<Kernel::ClientPort> client_port;
- std::tie(server_port, client_port) =
- Kernel::ServerPort::CreatePortPair(interface_->GetMaxSessions(), interface_->GetPortName());
-
+ auto server_port =
+ SM::g_service_manager
+ ->RegisterService(interface_->GetPortName(), interface_->GetMaxSessions())
+ .MoveFrom();
server_port->SetHleHandler(std::shared_ptr<Interface>(interface_));
- g_srv_services.emplace(interface_->GetPortName(), std::move(client_port));
}
/// Initialize ServiceManager
void Init() {
- AddNamedPort(new SRV::SRV);
+ SM::g_service_manager = std::make_unique<SM::ServiceManager>();
+ AddNamedPort(new SM::SRV);
AddNamedPort(new ERR::ERR_F);
FS::ArchiveInit();
@@ -187,7 +186,7 @@ void Shutdown() {
AC::Shutdown();
FS::ArchiveShutdown();
- g_srv_services.clear();
+ SM::g_service_manager = nullptr;
g_kernel_named_ports.clear();
LOG_DEBUG(Service, "shutdown OK");
}