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/pm | |
| 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/pm')
| -rw-r--r-- | src/core/hle/service/pm/pm.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp index a771a51b4..68736c40c 100644 --- a/src/core/hle/service/pm/pm.cpp +++ b/src/core/hle/service/pm/pm.cpp | |||
| @@ -44,7 +44,7 @@ void GetApplicationPidGeneric(Kernel::HLERequestContext& ctx, | |||
| 44 | 44 | ||
| 45 | class BootMode final : public ServiceFramework<BootMode> { | 45 | class BootMode final : public ServiceFramework<BootMode> { |
| 46 | public: | 46 | public: |
| 47 | explicit BootMode() : ServiceFramework{"pm:bm"} { | 47 | explicit BootMode(Core::System& system_) : ServiceFramework{system_, "pm:bm"} { |
| 48 | static const FunctionInfo functions[] = { | 48 | static const FunctionInfo functions[] = { |
| 49 | {0, &BootMode::GetBootMode, "GetBootMode"}, | 49 | {0, &BootMode::GetBootMode, "GetBootMode"}, |
| 50 | {1, &BootMode::SetMaintenanceBoot, "SetMaintenanceBoot"}, | 50 | {1, &BootMode::SetMaintenanceBoot, "SetMaintenanceBoot"}, |
| @@ -75,8 +75,8 @@ private: | |||
| 75 | 75 | ||
| 76 | class DebugMonitor final : public ServiceFramework<DebugMonitor> { | 76 | class DebugMonitor final : public ServiceFramework<DebugMonitor> { |
| 77 | public: | 77 | public: |
| 78 | explicit DebugMonitor(const Kernel::KernelCore& kernel) | 78 | explicit DebugMonitor(Core::System& system_) |
| 79 | : ServiceFramework{"pm:dmnt"}, kernel(kernel) { | 79 | : ServiceFramework{system_, "pm:dmnt"}, kernel{system_.Kernel()} { |
| 80 | // clang-format off | 80 | // clang-format off |
| 81 | static const FunctionInfo functions[] = { | 81 | static const FunctionInfo functions[] = { |
| 82 | {0, nullptr, "GetJitDebugProcessIdList"}, | 82 | {0, nullptr, "GetJitDebugProcessIdList"}, |
| @@ -125,8 +125,9 @@ private: | |||
| 125 | 125 | ||
| 126 | class Info final : public ServiceFramework<Info> { | 126 | class Info final : public ServiceFramework<Info> { |
| 127 | public: | 127 | public: |
| 128 | explicit Info(const std::vector<std::shared_ptr<Kernel::Process>>& process_list) | 128 | explicit Info(Core::System& system_, |
| 129 | : ServiceFramework{"pm:info"}, process_list(process_list) { | 129 | const std::vector<std::shared_ptr<Kernel::Process>>& process_list_) |
| 130 | : ServiceFramework{system_, "pm:info"}, process_list{process_list_} { | ||
| 130 | static const FunctionInfo functions[] = { | 131 | static const FunctionInfo functions[] = { |
| 131 | {0, &Info::GetTitleId, "GetTitleId"}, | 132 | {0, &Info::GetTitleId, "GetTitleId"}, |
| 132 | }; | 133 | }; |
| @@ -160,8 +161,8 @@ private: | |||
| 160 | 161 | ||
| 161 | class Shell final : public ServiceFramework<Shell> { | 162 | class Shell final : public ServiceFramework<Shell> { |
| 162 | public: | 163 | public: |
| 163 | explicit Shell(const Kernel::KernelCore& kernel) | 164 | explicit Shell(Core::System& system_) |
| 164 | : ServiceFramework{"pm:shell"}, kernel(kernel) { | 165 | : ServiceFramework{system_, "pm:shell"}, kernel{system_.Kernel()} { |
| 165 | // clang-format off | 166 | // clang-format off |
| 166 | static const FunctionInfo functions[] = { | 167 | static const FunctionInfo functions[] = { |
| 167 | {0, nullptr, "LaunchProgram"}, | 168 | {0, nullptr, "LaunchProgram"}, |
| @@ -190,11 +191,11 @@ private: | |||
| 190 | }; | 191 | }; |
| 191 | 192 | ||
| 192 | void InstallInterfaces(Core::System& system) { | 193 | void InstallInterfaces(Core::System& system) { |
| 193 | std::make_shared<BootMode>()->InstallAsService(system.ServiceManager()); | 194 | std::make_shared<BootMode>(system)->InstallAsService(system.ServiceManager()); |
| 194 | std::make_shared<DebugMonitor>(system.Kernel())->InstallAsService(system.ServiceManager()); | 195 | std::make_shared<DebugMonitor>(system)->InstallAsService(system.ServiceManager()); |
| 195 | std::make_shared<Info>(system.Kernel().GetProcessList()) | 196 | std::make_shared<Info>(system, system.Kernel().GetProcessList()) |
| 196 | ->InstallAsService(system.ServiceManager()); | 197 | ->InstallAsService(system.ServiceManager()); |
| 197 | std::make_shared<Shell>(system.Kernel())->InstallAsService(system.ServiceManager()); | 198 | std::make_shared<Shell>(system)->InstallAsService(system.ServiceManager()); |
| 198 | } | 199 | } |
| 199 | 200 | ||
| 200 | } // namespace Service::PM | 201 | } // namespace Service::PM |