diff options
| author | 2020-11-26 15:19:08 -0500 | |
|---|---|---|
| committer | 2020-11-26 20:03:11 -0500 | |
| commit | 1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f (patch) | |
| tree | 3593cd42e0ba676c3919561983f7e9766fcb641c /src/core/hle/service/lm | |
| parent | Merge pull request #4975 from comex/invalid-syncpoint-id (diff) | |
| download | yuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.tar.gz yuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.tar.xz yuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.zip | |
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 { | |||
| 18 | 18 | ||
| 19 | class ILogger final : public ServiceFramework<ILogger> { | 19 | class ILogger final : public ServiceFramework<ILogger> { |
| 20 | public: | 20 | public: |
| 21 | explicit ILogger(Manager& manager_, Core::Memory::Memory& memory_) | 21 | explicit ILogger(Core::System& system_) |
| 22 | : ServiceFramework("ILogger"), manager{manager_}, memory{memory_} { | 22 | : ServiceFramework{system_, "ILogger"}, manager{system_.GetLogManager()}, |
| 23 | memory{system_.Memory()} { | ||
| 23 | static const FunctionInfo functions[] = { | 24 | static const FunctionInfo functions[] = { |
| 24 | {0, &ILogger::Log, "Log"}, | 25 | {0, &ILogger::Log, "Log"}, |
| 25 | {1, &ILogger::SetDestination, "SetDestination"}, | 26 | {1, &ILogger::SetDestination, "SetDestination"}, |
| @@ -81,8 +82,7 @@ private: | |||
| 81 | 82 | ||
| 82 | class LM final : public ServiceFramework<LM> { | 83 | class LM final : public ServiceFramework<LM> { |
| 83 | public: | 84 | public: |
| 84 | explicit LM(Manager& manager_, Core::Memory::Memory& memory_) | 85 | explicit LM(Core::System& system_) : ServiceFramework{system_, "lm"} { |
| 85 | : ServiceFramework{"lm"}, manager{manager_}, memory{memory_} { | ||
| 86 | // clang-format off | 86 | // clang-format off |
| 87 | static const FunctionInfo functions[] = { | 87 | static const FunctionInfo functions[] = { |
| 88 | {0, &LM::OpenLogger, "OpenLogger"}, | 88 | {0, &LM::OpenLogger, "OpenLogger"}, |
| @@ -98,16 +98,12 @@ private: | |||
| 98 | 98 | ||
| 99 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 99 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 100 | rb.Push(RESULT_SUCCESS); | 100 | rb.Push(RESULT_SUCCESS); |
| 101 | rb.PushIpcInterface<ILogger>(manager, memory); | 101 | rb.PushIpcInterface<ILogger>(system); |
| 102 | } | 102 | } |
| 103 | |||
| 104 | Manager& manager; | ||
| 105 | Core::Memory::Memory& memory; | ||
| 106 | }; | 103 | }; |
| 107 | 104 | ||
| 108 | void InstallInterfaces(Core::System& system) { | 105 | void InstallInterfaces(Core::System& system) { |
| 109 | std::make_shared<LM>(system.GetLogManager(), system.Memory()) | 106 | std::make_shared<LM>(system)->InstallAsService(system.ServiceManager()); |
| 110 | ->InstallAsService(system.ServiceManager()); | ||
| 111 | } | 107 | } |
| 112 | 108 | ||
| 113 | } // namespace Service::LM | 109 | } // namespace Service::LM |