summaryrefslogtreecommitdiff
path: root/src/core/hle/service/lm
diff options
context:
space:
mode:
authorGravatar Zach Hilman2019-06-29 17:17:35 -0400
committerGravatar Zach Hilman2019-09-22 12:34:55 -0400
commit4153bd8d171ffe7cd11c467b338f843859565d51 (patch)
tree024f3a856b4aab1398f836c243382a3962f6e666 /src/core/hle/service/lm
parentreporter: Add log output for packaged lm log data (diff)
downloadyuzu-4153bd8d171ffe7cd11c467b338f843859565d51.tar.gz
yuzu-4153bd8d171ffe7cd11c467b338f843859565d51.tar.xz
yuzu-4153bd8d171ffe7cd11c467b338f843859565d51.zip
core: Add LM::Manager to system
Allows centralized control over logging mechanisms.
Diffstat (limited to 'src/core/hle/service/lm')
-rw-r--r--src/core/hle/service/lm/lm.cpp25
-rw-r--r--src/core/hle/service/lm/lm.h6
2 files changed, 16 insertions, 15 deletions
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index 2a61593e2..efba18fe7 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -6,8 +6,10 @@
6#include <string> 6#include <string>
7 7
8#include "common/logging/log.h" 8#include "common/logging/log.h"
9#include "common/scope_exit.h"
9#include "core/hle/ipc_helpers.h" 10#include "core/hle/ipc_helpers.h"
10#include "core/hle/service/lm/lm.h" 11#include "core/hle/service/lm/lm.h"
12#include "core/hle/service/lm/manager.h"
11#include "core/hle/service/service.h" 13#include "core/hle/service/service.h"
12#include "core/memory.h" 14#include "core/memory.h"
13 15
@@ -194,31 +196,30 @@ private:
194 196
195class LM final : public ServiceFramework<LM> { 197class LM final : public ServiceFramework<LM> {
196public: 198public:
197 explicit LM() : ServiceFramework{"lm"} { 199 explicit LM(Manager& manager) : ServiceFramework{"lm"}, manager(manager) {
200 // clang-format off
198 static const FunctionInfo functions[] = { 201 static const FunctionInfo functions[] = {
199 {0x00000000, &LM::OpenLogger, "OpenLogger"}, 202 {0, &LM::OpenLogger, "OpenLogger"},
200 }; 203 };
204 // clang-format on
205
201 RegisterHandlers(functions); 206 RegisterHandlers(functions);
202 } 207 }
203 208
204 /** 209private:
205 * LM::OpenLogger service function
206 * Inputs:
207 * 0: 0x00000000
208 * Outputs:
209 * 0: ResultCode
210 */
211 void OpenLogger(Kernel::HLERequestContext& ctx) { 210 void OpenLogger(Kernel::HLERequestContext& ctx) {
212 LOG_DEBUG(Service_LM, "called"); 211 LOG_DEBUG(Service_LM, "called");
213 212
214 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 213 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
215 rb.Push(RESULT_SUCCESS); 214 rb.Push(RESULT_SUCCESS);
216 rb.PushIpcInterface<ILogger>(); 215 rb.PushIpcInterface<ILogger>(manager);
217 } 216 }
217
218 Manager& manager;
218}; 219};
219 220
220void InstallInterfaces(SM::ServiceManager& service_manager) { 221void InstallInterfaces(Core::System& system) {
221 std::make_shared<LM>()->InstallAsService(service_manager); 222 std::make_shared<LM>(system.GetLogManager())->InstallAsService(system.ServiceManager());
222} 223}
223 224
224} // namespace Service::LM 225} // namespace Service::LM
diff --git a/src/core/hle/service/lm/lm.h b/src/core/hle/service/lm/lm.h
index 7806ae27b..d40410b5c 100644
--- a/src/core/hle/service/lm/lm.h
+++ b/src/core/hle/service/lm/lm.h
@@ -4,13 +4,13 @@
4 4
5#pragma once 5#pragma once
6 6
7namespace Service::SM { 7namespace Core {
8class ServiceManager; 8class System;
9} 9}
10 10
11namespace Service::LM { 11namespace Service::LM {
12 12
13/// Registers all LM services with the specified service manager. 13/// Registers all LM services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& service_manager); 14void InstallInterfaces(Core::System& system);
15 15
16} // namespace Service::LM 16} // namespace Service::LM