diff options
| author | Lioncash <mathew1800@gmail.com> | 2020-11-26 15:19:08 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2020-11-26 20:03:11 -0500 |
| commit | 1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f (patch) | |
| tree | 3593cd42e0ba676c3919561983f7e9766fcb641c /src/core/hle/service/lm | |
| parent | 322349e8cc948d069f62a85a0c09a689c3e31796 (diff) | |
service: Eliminate usages of the global system instance
Completely removes all usages of the global system instance within the
services code by passing in the using system instance to the services.
Diffstat (limited to 'src/core/hle/service/lm')
| -rw-r--r-- | src/core/hle/service/lm/lm.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index 49a42a9c9..f884b2735 100644 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp @@ -18,8 +18,9 @@ namespace Service::LM { class ILogger final : public ServiceFramework<ILogger> { public: - explicit ILogger(Manager& manager_, Core::Memory::Memory& memory_) - : ServiceFramework("ILogger"), manager{manager_}, memory{memory_} { + explicit ILogger(Core::System& system_) + : ServiceFramework{system_, "ILogger"}, manager{system_.GetLogManager()}, + memory{system_.Memory()} { static const FunctionInfo functions[] = { {0, &ILogger::Log, "Log"}, {1, &ILogger::SetDestination, "SetDestination"}, @@ -81,8 +82,7 @@ private: class LM final : public ServiceFramework<LM> { public: - explicit LM(Manager& manager_, Core::Memory::Memory& memory_) - : ServiceFramework{"lm"}, manager{manager_}, memory{memory_} { + explicit LM(Core::System& system_) : ServiceFramework{system_, "lm"} { // clang-format off static const FunctionInfo functions[] = { {0, &LM::OpenLogger, "OpenLogger"}, @@ -98,16 +98,12 @@ private: IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface<ILogger>(manager, memory); + rb.PushIpcInterface<ILogger>(system); } - - Manager& manager; - Core::Memory::Memory& memory; }; void InstallInterfaces(Core::System& system) { - std::make_shared<LM>(system.GetLogManager(), system.Memory()) - ->InstallAsService(system.ServiceManager()); + std::make_shared<LM>(system)->InstallAsService(system.ServiceManager()); } } // namespace Service::LM |
