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/pcv | |
| 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/pcv')
| -rw-r--r-- | src/core/hle/service/pcv/pcv.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/service/pcv/pcv.h | 6 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/core/hle/service/pcv/pcv.cpp b/src/core/hle/service/pcv/pcv.cpp index 8bfc0276e..68b2c4178 100644 --- a/src/core/hle/service/pcv/pcv.cpp +++ b/src/core/hle/service/pcv/pcv.cpp | |||
| @@ -12,7 +12,7 @@ namespace Service::PCV { | |||
| 12 | 12 | ||
| 13 | class PCV final : public ServiceFramework<PCV> { | 13 | class PCV final : public ServiceFramework<PCV> { |
| 14 | public: | 14 | public: |
| 15 | explicit PCV() : ServiceFramework{"pcv"} { | 15 | explicit PCV(Core::System& system_) : ServiceFramework{system_, "pcv"} { |
| 16 | // clang-format off | 16 | // clang-format off |
| 17 | static const FunctionInfo functions[] = { | 17 | static const FunctionInfo functions[] = { |
| 18 | {0, nullptr, "SetPowerEnabled"}, | 18 | {0, nullptr, "SetPowerEnabled"}, |
| @@ -54,7 +54,7 @@ public: | |||
| 54 | 54 | ||
| 55 | class PCV_ARB final : public ServiceFramework<PCV_ARB> { | 55 | class PCV_ARB final : public ServiceFramework<PCV_ARB> { |
| 56 | public: | 56 | public: |
| 57 | explicit PCV_ARB() : ServiceFramework{"pcv:arb"} { | 57 | explicit PCV_ARB(Core::System& system_) : ServiceFramework{system_, "pcv:arb"} { |
| 58 | // clang-format off | 58 | // clang-format off |
| 59 | static const FunctionInfo functions[] = { | 59 | static const FunctionInfo functions[] = { |
| 60 | {0, nullptr, "ReleaseControl"}, | 60 | {0, nullptr, "ReleaseControl"}, |
| @@ -67,7 +67,7 @@ public: | |||
| 67 | 67 | ||
| 68 | class PCV_IMM final : public ServiceFramework<PCV_IMM> { | 68 | class PCV_IMM final : public ServiceFramework<PCV_IMM> { |
| 69 | public: | 69 | public: |
| 70 | explicit PCV_IMM() : ServiceFramework{"pcv:imm"} { | 70 | explicit PCV_IMM(Core::System& system_) : ServiceFramework{system_, "pcv:imm"} { |
| 71 | // clang-format off | 71 | // clang-format off |
| 72 | static const FunctionInfo functions[] = { | 72 | static const FunctionInfo functions[] = { |
| 73 | {0, nullptr, "SetClockRate"}, | 73 | {0, nullptr, "SetClockRate"}, |
| @@ -78,10 +78,10 @@ public: | |||
| 78 | } | 78 | } |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | void InstallInterfaces(SM::ServiceManager& sm) { | 81 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { |
| 82 | std::make_shared<PCV>()->InstallAsService(sm); | 82 | std::make_shared<PCV>(system)->InstallAsService(sm); |
| 83 | std::make_shared<PCV_ARB>()->InstallAsService(sm); | 83 | std::make_shared<PCV_ARB>(system)->InstallAsService(sm); |
| 84 | std::make_shared<PCV_IMM>()->InstallAsService(sm); | 84 | std::make_shared<PCV_IMM>(system)->InstallAsService(sm); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | } // namespace Service::PCV | 87 | } // namespace Service::PCV |
diff --git a/src/core/hle/service/pcv/pcv.h b/src/core/hle/service/pcv/pcv.h index 219a893c3..c61a0b591 100644 --- a/src/core/hle/service/pcv/pcv.h +++ b/src/core/hle/service/pcv/pcv.h | |||
| @@ -4,12 +4,16 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | namespace Core { | ||
| 8 | class System; | ||
| 9 | } | ||
| 10 | |||
| 7 | namespace Service::SM { | 11 | namespace Service::SM { |
| 8 | class ServiceManager; | 12 | class ServiceManager; |
| 9 | } | 13 | } |
| 10 | 14 | ||
| 11 | namespace Service::PCV { | 15 | namespace Service::PCV { |
| 12 | 16 | ||
| 13 | void InstallInterfaces(SM::ServiceManager& sm); | 17 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); |
| 14 | 18 | ||
| 15 | } // namespace Service::PCV | 19 | } // namespace Service::PCV |