summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/lm/lm.cpp53
-rw-r--r--src/core/hle/service/lm/lm.h15
2 files changed, 31 insertions, 37 deletions
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index af4573acf..b497376d7 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -4,10 +4,12 @@
4 4
5#include <sstream> 5#include <sstream>
6#include <string> 6#include <string>
7
7#include "common/logging/log.h" 8#include "common/logging/log.h"
8#include "core/hle/ipc_helpers.h" 9#include "core/hle/ipc_helpers.h"
9#include "core/hle/kernel/client_session.h"
10#include "core/hle/service/lm/lm.h" 10#include "core/hle/service/lm/lm.h"
11#include "core/hle/service/service.h"
12#include "core/memory.h"
11 13
12namespace Service::LM { 14namespace Service::LM {
13 15
@@ -21,8 +23,6 @@ public:
21 RegisterHandlers(functions); 23 RegisterHandlers(functions);
22 } 24 }
23 25
24 ~Logger() = default;
25
26private: 26private:
27 struct MessageHeader { 27 struct MessageHeader {
28 enum Flags : u32_le { 28 enum Flags : u32_le {
@@ -163,30 +163,33 @@ private:
163 std::ostringstream log_stream; 163 std::ostringstream log_stream;
164}; 164};
165 165
166void InstallInterfaces(SM::ServiceManager& service_manager) { 166class LM final : public ServiceFramework<LM> {
167 std::make_shared<LM>()->InstallAsService(service_manager); 167public:
168} 168 explicit LM() : ServiceFramework{"lm"} {
169 static const FunctionInfo functions[] = {
170 {0x00000000, &LM::OpenLogger, "OpenLogger"},
171 };
172 RegisterHandlers(functions);
173 }
169 174
170/** 175 /**
171 * LM::OpenLogger service function 176 * LM::OpenLogger service function
172 * Inputs: 177 * Inputs:
173 * 0: 0x00000000 178 * 0: 0x00000000
174 * Outputs: 179 * Outputs:
175 * 0: ResultCode 180 * 0: ResultCode
176 */ 181 */
177void LM::OpenLogger(Kernel::HLERequestContext& ctx) { 182 void OpenLogger(Kernel::HLERequestContext& ctx) {
178 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 183 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
179 rb.Push(RESULT_SUCCESS); 184 rb.Push(RESULT_SUCCESS);
180 rb.PushIpcInterface<Logger>(); 185 rb.PushIpcInterface<Logger>();
181
182 LOG_DEBUG(Service_LM, "called");
183}
184 186
185LM::LM() : ServiceFramework("lm") { 187 LOG_DEBUG(Service_LM, "called");
186 static const FunctionInfo functions[] = { 188 }
187 {0x00000000, &LM::OpenLogger, "OpenLogger"}, 189};
188 }; 190
189 RegisterHandlers(functions); 191void InstallInterfaces(SM::ServiceManager& service_manager) {
192 std::make_shared<LM>()->InstallAsService(service_manager);
190} 193}
191 194
192} // namespace Service::LM 195} // namespace Service::LM
diff --git a/src/core/hle/service/lm/lm.h b/src/core/hle/service/lm/lm.h
index 9c15c2e5f..7806ae27b 100644
--- a/src/core/hle/service/lm/lm.h
+++ b/src/core/hle/service/lm/lm.h
@@ -4,21 +4,12 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <vector> 7namespace Service::SM {
8#include "core/hle/kernel/kernel.h" 8class ServiceManager;
9#include "core/hle/service/service.h" 9}
10 10
11namespace Service::LM { 11namespace Service::LM {
12 12
13class LM final : public ServiceFramework<LM> {
14public:
15 LM();
16 ~LM() = default;
17
18private:
19 void OpenLogger(Kernel::HLERequestContext& ctx);
20};
21
22/// Registers all LM services with the specified service manager. 13/// Registers all LM services with the specified service manager.
23void InstallInterfaces(SM::ServiceManager& service_manager); 14void InstallInterfaces(SM::ServiceManager& service_manager);
24 15