diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-06-06 08:31:59 +0200 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-06-06 11:57:04 +0200 |
commit | 23ec6b3d8f33e2e0d76e646049f1fc1d36e70cf3 (patch) | |
tree | b6672a86793b53fdf3e07340515d731e45253677 /src/core/hle/service/service.cpp | |
parent | Service/sm: Use an actual semaphore for the notification semaphore (diff) | |
download | yuzu-23ec6b3d8f33e2e0d76e646049f1fc1d36e70cf3.tar yuzu-23ec6b3d8f33e2e0d76e646049f1fc1d36e70cf3.tar.gz yuzu-23ec6b3d8f33e2e0d76e646049f1fc1d36e70cf3.tar.bz2 yuzu-23ec6b3d8f33e2e0d76e646049f1fc1d36e70cf3.tar.lz yuzu-23ec6b3d8f33e2e0d76e646049f1fc1d36e70cf3.tar.xz yuzu-23ec6b3d8f33e2e0d76e646049f1fc1d36e70cf3.tar.zst yuzu-23ec6b3d8f33e2e0d76e646049f1fc1d36e70cf3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/service.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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<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,17 +115,16 @@ 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() { + SM::g_service_manager = std::make_unique<SM::ServiceManager>(); 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"); } |