summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-01-22 23:35:40 +0100
committerSubv <subv2112@gmail.com>2018-01-22 23:35:40 +0100
commit1a9c96e4de6699722ad0fbe511c9868e89d29eee (patch)
treece917b78eef601f6348bf91b786f3d54edab476a /src/core/hle
parentIPC: Don't create an unnecessary port when using PushIpcInterface outside of a domain. (diff)
downloadyuzu-1a9c96e4de6699722ad0fbe511c9868e89d29eee.tar
yuzu-1a9c96e4de6699722ad0fbe511c9868e89d29eee.tar.gz
yuzu-1a9c96e4de6699722ad0fbe511c9868e89d29eee.tar.bz2
yuzu-1a9c96e4de6699722ad0fbe511c9868e89d29eee.tar.lz
yuzu-1a9c96e4de6699722ad0fbe511c9868e89d29eee.tar.xz
yuzu-1a9c96e4de6699722ad0fbe511c9868e89d29eee.tar.zst
yuzu-1a9c96e4de6699722ad0fbe511c9868e89d29eee.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/lm/lm.cpp22
-rw-r--r--src/core/hle/service/lm/lm.h3
2 files changed, 10 insertions, 15 deletions
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index 13c9ee3d3..dd0f75ce1 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -146,18 +146,16 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
* 0: ResultCode
*/
void LM::Initialize(Kernel::HLERequestContext& ctx) {
- auto client_port = std::make_shared<Logger>()->CreatePort();
- auto session = client_port->Connect();
- if (session.Succeeded()) {
- LOG_DEBUG(Service_SM, "called, initialized logger -> session=%u",
- (*session)->GetObjectId());
- IPC::RequestBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushMoveObjects(std::move(session).Unwrap());
- registered_loggers.emplace_back(std::move(client_port));
- } else {
- UNIMPLEMENTED();
- }
+ auto logger = std::make_shared<Logger>();
+ auto sessions = Kernel::ServerSession::CreateSessionPair(logger->GetServiceName());
+ auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
+ auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
+ logger->ClientConnected(server);
+
+ LOG_DEBUG(Service_SM, "called, initialized logger -> session=%u", client->GetObjectId());
+ IPC::RequestBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushMoveObjects(std::move(client));
LOG_INFO(Service_SM, "called");
}
diff --git a/src/core/hle/service/lm/lm.h b/src/core/hle/service/lm/lm.h
index 4b954bdb2..371135057 100644
--- a/src/core/hle/service/lm/lm.h
+++ b/src/core/hle/service/lm/lm.h
@@ -5,7 +5,6 @@
#pragma once
#include <vector>
-#include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/service.h"
@@ -19,8 +18,6 @@ public:
private:
void Initialize(Kernel::HLERequestContext& ctx);
-
- std::vector<Kernel::SharedPtr<Kernel::ClientPort>> registered_loggers;
};
/// Registers all LM services with the specified service manager.