summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/core.cpp15
-rw-r--r--src/core/core.h8
-rw-r--r--src/core/hle/service/lm/lm.cpp25
-rw-r--r--src/core/hle/service/lm/lm.h6
-rw-r--r--src/core/hle/service/service.cpp2
6 files changed, 39 insertions, 19 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index a6b56c9c6..be3ffb779 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -324,6 +324,8 @@ add_library(core STATIC
324 hle/service/ldr/ldr.h 324 hle/service/ldr/ldr.h
325 hle/service/lm/lm.cpp 325 hle/service/lm/lm.cpp
326 hle/service/lm/lm.h 326 hle/service/lm/lm.h
327 hle/service/lm/manager.cpp
328 hle/service/lm/manager.h
327 hle/service/mig/mig.cpp 329 hle/service/mig/mig.cpp
328 hle/service/mig/mig.h 330 hle/service/mig/mig.h
329 hle/service/mii/mii.cpp 331 hle/service/mii/mii.cpp
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 92ba42fb9..eb2c2e204 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -35,6 +35,7 @@
35#include "core/hle/service/apm/controller.h" 35#include "core/hle/service/apm/controller.h"
36#include "core/hle/service/filesystem/filesystem.h" 36#include "core/hle/service/filesystem/filesystem.h"
37#include "core/hle/service/glue/manager.h" 37#include "core/hle/service/glue/manager.h"
38#include "core/hle/service/lm/manager.h"
38#include "core/hle/service/service.h" 39#include "core/hle/service/service.h"
39#include "core/hle/service/sm/sm.h" 40#include "core/hle/service/sm/sm.h"
40#include "core/loader/loader.h" 41#include "core/loader/loader.h"
@@ -337,6 +338,7 @@ struct System::Impl {
337 bool is_powered_on = false; 338 bool is_powered_on = false;
338 bool exit_lock = false; 339 bool exit_lock = false;
339 340
341 Reporter reporter;
340 std::unique_ptr<Memory::CheatEngine> cheat_engine; 342 std::unique_ptr<Memory::CheatEngine> cheat_engine;
341 std::unique_ptr<Tools::Freezer> memory_freezer; 343 std::unique_ptr<Tools::Freezer> memory_freezer;
342 344
@@ -346,8 +348,9 @@ struct System::Impl {
346 /// APM (Performance) services 348 /// APM (Performance) services
347 Service::APM::Controller apm_controller{core_timing}; 349 Service::APM::Controller apm_controller{core_timing};
348 350
349 /// Glue services 351 /// Service State
350 Service::Glue::ARPManager arp_manager; 352 Service::Glue::ARPManager arp_manager;
353 Service::LM::Manager lm_manager{reporter};
351 354
352 /// Service manager 355 /// Service manager
353 std::shared_ptr<Service::SM::ServiceManager> service_manager; 356 std::shared_ptr<Service::SM::ServiceManager> service_manager;
@@ -355,8 +358,6 @@ struct System::Impl {
355 /// Telemetry session for this emulation session 358 /// Telemetry session for this emulation session
356 std::unique_ptr<Core::TelemetrySession> telemetry_session; 359 std::unique_ptr<Core::TelemetrySession> telemetry_session;
357 360
358 Reporter reporter;
359
360 ResultStatus status = ResultStatus::Success; 361 ResultStatus status = ResultStatus::Success;
361 std::string status_details = ""; 362 std::string status_details = "";
362 363
@@ -632,6 +633,14 @@ const Service::APM::Controller& System::GetAPMController() const {
632 return impl->apm_controller; 633 return impl->apm_controller;
633} 634}
634 635
636Service::LM::Manager& System::GetLogManager() {
637 return impl->lm_manager;
638}
639
640const Service::LM::Manager& System::GetLogManager() const {
641 return impl->lm_manager;
642}
643
635void System::SetExitLock(bool locked) { 644void System::SetExitLock(bool locked) {
636 impl->exit_lock = locked; 645 impl->exit_lock = locked;
637} 646}
diff --git a/src/core/core.h b/src/core/core.h
index ff10ebe12..0170e0b05 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -58,6 +58,10 @@ namespace Glue {
58class ARPManager; 58class ARPManager;
59} 59}
60 60
61namespace LM {
62class Manager;
63} // namespace LM
64
61namespace SM { 65namespace SM {
62class ServiceManager; 66class ServiceManager;
63} // namespace SM 67} // namespace SM
@@ -326,6 +330,10 @@ public:
326 330
327 const Service::APM::Controller& GetAPMController() const; 331 const Service::APM::Controller& GetAPMController() const;
328 332
333 Service::LM::Manager& GetLogManager();
334
335 const Service::LM::Manager& GetLogManager() const;
336
329 void SetExitLock(bool locked); 337 void SetExitLock(bool locked);
330 338
331 bool GetExitLock() const; 339 bool GetExitLock() const;
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
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 831a427de..c12a746c8 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -226,7 +226,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system) {
226 LBL::InstallInterfaces(*sm); 226 LBL::InstallInterfaces(*sm);
227 LDN::InstallInterfaces(*sm); 227 LDN::InstallInterfaces(*sm);
228 LDR::InstallInterfaces(*sm, system); 228 LDR::InstallInterfaces(*sm, system);
229 LM::InstallInterfaces(*sm); 229 LM::InstallInterfaces(system);
230 Migration::InstallInterfaces(*sm); 230 Migration::InstallInterfaces(*sm);
231 Mii::InstallInterfaces(*sm); 231 Mii::InstallInterfaces(*sm);
232 MM::InstallInterfaces(*sm); 232 MM::InstallInterfaces(*sm);