|
|
|
@ -22,11 +22,13 @@ static ResultCode ValidateServiceName(const std::string& name) {
|
|
|
|
|
return RESULT_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ServiceManager::ServiceManager(Core::System& system) : system(system) {}
|
|
|
|
|
|
|
|
|
|
void ServiceManager::InstallInterfaces(Core::System& system) {
|
|
|
|
|
ASSERT(system.ServiceManager().srv_interface.expired());
|
|
|
|
|
|
|
|
|
|
auto srv = std::make_shared<SRV>(system);
|
|
|
|
|
srv->InstallAsNamedPort();
|
|
|
|
|
srv->InstallAsNamedPort(system.Kernel());
|
|
|
|
|
system.ServiceManager().srv_interface = srv;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -40,7 +42,7 @@ ResultVal<Kernel::SharedPtr<Kernel::ServerPort>> ServiceManager::RegisterService
|
|
|
|
|
|
|
|
|
|
Kernel::SharedPtr<Kernel::ServerPort> server_port;
|
|
|
|
|
Kernel::SharedPtr<Kernel::ClientPort> client_port;
|
|
|
|
|
std::tie(server_port, client_port) = Kernel::ServerPort::CreatePortPair(max_sessions, name);
|
|
|
|
|
std::tie(server_port, client_port) = system.Kernel().CreatePortPair(max_sessions, name);
|
|
|
|
|
|
|
|
|
|
registered_services.emplace(std::move(name), std::move(client_port));
|
|
|
|
|
return MakeResult<Kernel::SharedPtr<Kernel::ServerPort>>(std::move(server_port));
|
|
|
|
|