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/btm | |
| 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/btm')
| -rw-r--r-- | src/core/hle/service/btm/btm.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index c8f8ddbd5..38b55300e 100644 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp | |||
| @@ -18,7 +18,7 @@ namespace Service::BTM { | |||
| 18 | 18 | ||
| 19 | class IBtmUserCore final : public ServiceFramework<IBtmUserCore> { | 19 | class IBtmUserCore final : public ServiceFramework<IBtmUserCore> { |
| 20 | public: | 20 | public: |
| 21 | explicit IBtmUserCore(Core::System& system) : ServiceFramework{"IBtmUserCore"} { | 21 | explicit IBtmUserCore(Core::System& system_) : ServiceFramework{system_, "IBtmUserCore"} { |
| 22 | // clang-format off | 22 | // clang-format off |
| 23 | static const FunctionInfo functions[] = { | 23 | static const FunctionInfo functions[] = { |
| 24 | {0, &IBtmUserCore::AcquireBleScanEvent, "AcquireBleScanEvent"}, | 24 | {0, &IBtmUserCore::AcquireBleScanEvent, "AcquireBleScanEvent"}, |
| @@ -107,7 +107,7 @@ private: | |||
| 107 | 107 | ||
| 108 | class BTM_USR final : public ServiceFramework<BTM_USR> { | 108 | class BTM_USR final : public ServiceFramework<BTM_USR> { |
| 109 | public: | 109 | public: |
| 110 | explicit BTM_USR(Core::System& system) : ServiceFramework{"btm:u"}, system(system) { | 110 | explicit BTM_USR(Core::System& system_) : ServiceFramework{system_, "btm:u"} { |
| 111 | // clang-format off | 111 | // clang-format off |
| 112 | static const FunctionInfo functions[] = { | 112 | static const FunctionInfo functions[] = { |
| 113 | {0, &BTM_USR::GetCore, "GetCore"}, | 113 | {0, &BTM_USR::GetCore, "GetCore"}, |
| @@ -124,13 +124,11 @@ private: | |||
| 124 | rb.Push(RESULT_SUCCESS); | 124 | rb.Push(RESULT_SUCCESS); |
| 125 | rb.PushIpcInterface<IBtmUserCore>(system); | 125 | rb.PushIpcInterface<IBtmUserCore>(system); |
| 126 | } | 126 | } |
| 127 | |||
| 128 | Core::System& system; | ||
| 129 | }; | 127 | }; |
| 130 | 128 | ||
| 131 | class BTM final : public ServiceFramework<BTM> { | 129 | class BTM final : public ServiceFramework<BTM> { |
| 132 | public: | 130 | public: |
| 133 | explicit BTM() : ServiceFramework{"btm"} { | 131 | explicit BTM(Core::System& system_) : ServiceFramework{system_, "btm"} { |
| 134 | // clang-format off | 132 | // clang-format off |
| 135 | static const FunctionInfo functions[] = { | 133 | static const FunctionInfo functions[] = { |
| 136 | {0, nullptr, "GetState"}, | 134 | {0, nullptr, "GetState"}, |
| @@ -207,7 +205,7 @@ public: | |||
| 207 | 205 | ||
| 208 | class BTM_DBG final : public ServiceFramework<BTM_DBG> { | 206 | class BTM_DBG final : public ServiceFramework<BTM_DBG> { |
| 209 | public: | 207 | public: |
| 210 | explicit BTM_DBG() : ServiceFramework{"btm:dbg"} { | 208 | explicit BTM_DBG(Core::System& system_) : ServiceFramework{system_, "btm:dbg"} { |
| 211 | // clang-format off | 209 | // clang-format off |
| 212 | static const FunctionInfo functions[] = { | 210 | static const FunctionInfo functions[] = { |
| 213 | {0, nullptr, "AcquireDiscoveryEvent"}, | 211 | {0, nullptr, "AcquireDiscoveryEvent"}, |
| @@ -232,7 +230,7 @@ public: | |||
| 232 | 230 | ||
| 233 | class IBtmSystemCore final : public ServiceFramework<IBtmSystemCore> { | 231 | class IBtmSystemCore final : public ServiceFramework<IBtmSystemCore> { |
| 234 | public: | 232 | public: |
| 235 | explicit IBtmSystemCore() : ServiceFramework{"IBtmSystemCore"} { | 233 | explicit IBtmSystemCore(Core::System& system_) : ServiceFramework{system_, "IBtmSystemCore"} { |
| 236 | // clang-format off | 234 | // clang-format off |
| 237 | static const FunctionInfo functions[] = { | 235 | static const FunctionInfo functions[] = { |
| 238 | {0, nullptr, "StartGamepadPairing"}, | 236 | {0, nullptr, "StartGamepadPairing"}, |
| @@ -254,7 +252,7 @@ public: | |||
| 254 | 252 | ||
| 255 | class BTM_SYS final : public ServiceFramework<BTM_SYS> { | 253 | class BTM_SYS final : public ServiceFramework<BTM_SYS> { |
| 256 | public: | 254 | public: |
| 257 | explicit BTM_SYS() : ServiceFramework{"btm:sys"} { | 255 | explicit BTM_SYS(Core::System& system_) : ServiceFramework{system_, "btm:sys"} { |
| 258 | // clang-format off | 256 | // clang-format off |
| 259 | static const FunctionInfo functions[] = { | 257 | static const FunctionInfo functions[] = { |
| 260 | {0, &BTM_SYS::GetCore, "GetCore"}, | 258 | {0, &BTM_SYS::GetCore, "GetCore"}, |
| @@ -270,14 +268,14 @@ private: | |||
| 270 | 268 | ||
| 271 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 269 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 272 | rb.Push(RESULT_SUCCESS); | 270 | rb.Push(RESULT_SUCCESS); |
| 273 | rb.PushIpcInterface<IBtmSystemCore>(); | 271 | rb.PushIpcInterface<IBtmSystemCore>(system); |
| 274 | } | 272 | } |
| 275 | }; | 273 | }; |
| 276 | 274 | ||
| 277 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { | 275 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { |
| 278 | std::make_shared<BTM>()->InstallAsService(sm); | 276 | std::make_shared<BTM>(system)->InstallAsService(sm); |
| 279 | std::make_shared<BTM_DBG>()->InstallAsService(sm); | 277 | std::make_shared<BTM_DBG>(system)->InstallAsService(sm); |
| 280 | std::make_shared<BTM_SYS>()->InstallAsService(sm); | 278 | std::make_shared<BTM_SYS>(system)->InstallAsService(sm); |
| 281 | std::make_shared<BTM_USR>(system)->InstallAsService(sm); | 279 | std::make_shared<BTM_USR>(system)->InstallAsService(sm); |
| 282 | } | 280 | } |
| 283 | 281 | ||