From 1eee09f36458bbb98212e05cb549cc43a995f03b Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Mon, 5 Jun 2017 22:18:19 -0700 Subject: Service: Move SRV interface to a new sm/ subdirectory This will contain the implementation of the sm (Service Manager) system module. --- src/core/hle/service/service.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/hle/service/service.cpp') diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 8f7c97d54..3a821871f 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -38,8 +38,8 @@ #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/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" @@ -126,7 +126,7 @@ void AddService(Interface* interface_) { /// Initialize ServiceManager void Init() { - AddNamedPort(new SRV::SRV); + AddNamedPort(new SM::SRV); AddNamedPort(new ERR::ERR_F); FS::ArchiveInit(); -- cgit v1.2.3 From 23ec6b3d8f33e2e0d76e646049f1fc1d36e70cf3 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Mon, 5 Jun 2017 23:31:59 -0700 Subject: Service: Make service registration part of the sm implementation Also enhances the GetServiceHandle implementation to be more accurate. --- src/core/hle/service/service.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/core/hle/service/service.cpp') diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 3a821871f..1b64ee77d 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -38,6 +38,7 @@ #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/ssl_c.h" @@ -46,7 +47,6 @@ namespace Service { std::unordered_map> g_kernel_named_ports; -std::unordered_map> g_srv_services; /** * Creates a function string for logging, complete with the name (or header code, depending @@ -115,17 +115,16 @@ static void AddNamedPort(Interface* interface_) { } void AddService(Interface* interface_) { - Kernel::SharedPtr server_port; - Kernel::SharedPtr 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_)); - g_srv_services.emplace(interface_->GetPortName(), std::move(client_port)); } /// Initialize ServiceManager void Init() { + SM::g_service_manager = std::make_unique(); AddNamedPort(new SM::SRV); AddNamedPort(new ERR::ERR_F); @@ -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"); } -- cgit v1.2.3