diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-06-07 06:25:28 +0200 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-06-09 05:59:19 +0200 |
commit | 6f368abe13bbf980b41b0209ddd5ca067761028a (patch) | |
tree | 1323e29c159f50d8a68186c99142d7ed2c0f9237 /src/core/hle/service/sm/sm.cpp | |
parent | Service: Remove a few redundant namespace qualifiers (diff) | |
download | yuzu-6f368abe13bbf980b41b0209ddd5ca067761028a.tar yuzu-6f368abe13bbf980b41b0209ddd5ca067761028a.tar.gz yuzu-6f368abe13bbf980b41b0209ddd5ca067761028a.tar.bz2 yuzu-6f368abe13bbf980b41b0209ddd5ca067761028a.tar.lz yuzu-6f368abe13bbf980b41b0209ddd5ca067761028a.tar.xz yuzu-6f368abe13bbf980b41b0209ddd5ca067761028a.tar.zst yuzu-6f368abe13bbf980b41b0209ddd5ca067761028a.zip |
Diffstat (limited to 'src/core/hle/service/sm/sm.cpp')
-rw-r--r-- | src/core/hle/service/sm/sm.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 361f7a0a9..5e7fc68f9 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -3,11 +3,13 @@ // Refer to the license.txt file included. #include <tuple> +#include "common/assert.h" #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_session.h" #include "core/hle/kernel/server_port.h" #include "core/hle/result.h" #include "core/hle/service/sm/sm.h" +#include "core/hle/service/sm/srv.h" namespace Service { namespace SM { @@ -22,6 +24,14 @@ static ResultCode ValidateServiceName(const std::string& name) { return RESULT_SUCCESS; } +void ServiceManager::InstallInterfaces(std::shared_ptr<ServiceManager> self) { + ASSERT(self->srv_interface.expired()); + + auto srv = std::make_shared<SRV>(self); + srv->InstallAsNamedPort(); + self->srv_interface = srv; +} + ResultVal<Kernel::SharedPtr<Kernel::ServerPort>> ServiceManager::RegisterService( std::string name, unsigned int max_sessions) { @@ -30,7 +40,7 @@ ResultVal<Kernel::SharedPtr<Kernel::ServerPort>> ServiceManager::RegisterService Kernel::SharedPtr<Kernel::ClientPort> client_port; std::tie(server_port, client_port) = Kernel::ServerPort::CreatePortPair(max_sessions, name); - registered_services.emplace(name, std::move(client_port)); + registered_services.emplace(std::move(name), std::move(client_port)); return MakeResult<Kernel::SharedPtr<Kernel::ServerPort>>(std::move(server_port)); } @@ -53,7 +63,7 @@ ResultVal<Kernel::SharedPtr<Kernel::ClientSession>> ServiceManager::ConnectToSer return client_port->Connect(); } -std::unique_ptr<ServiceManager> g_service_manager; +std::shared_ptr<ServiceManager> g_service_manager; } // namespace SM } // namespace Service |