diff options
| author | 2019-09-21 18:42:50 +1000 | |
|---|---|---|
| committer | 2019-09-22 16:30:24 +1000 | |
| commit | c33faabb2768b6190ad6f2eb3631bd2ff244433c (patch) | |
| tree | 7c83481024aedc0bcf66ee89b13a1cec138a6960 /src | |
| parent | Deglobalize System: Btdrv (diff) | |
| download | yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.tar.gz yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.tar.xz yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.zip | |
Deglobalize System: Btm
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/btm/btm.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/service/btm/btm.h | 6 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index b439ee7ec..920fc6ff7 100644 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp | |||
| @@ -17,7 +17,7 @@ namespace Service::BTM { | |||
| 17 | 17 | ||
| 18 | class IBtmUserCore final : public ServiceFramework<IBtmUserCore> { | 18 | class IBtmUserCore final : public ServiceFramework<IBtmUserCore> { |
| 19 | public: | 19 | public: |
| 20 | explicit IBtmUserCore() : ServiceFramework{"IBtmUserCore"} { | 20 | explicit IBtmUserCore(Core::System& system) : ServiceFramework{"IBtmUserCore"} { |
| 21 | // clang-format off | 21 | // clang-format off |
| 22 | static const FunctionInfo functions[] = { | 22 | static const FunctionInfo functions[] = { |
| 23 | {0, &IBtmUserCore::AcquireBleScanEvent, "AcquireBleScanEvent"}, | 23 | {0, &IBtmUserCore::AcquireBleScanEvent, "AcquireBleScanEvent"}, |
| @@ -56,7 +56,7 @@ public: | |||
| 56 | // clang-format on | 56 | // clang-format on |
| 57 | RegisterHandlers(functions); | 57 | RegisterHandlers(functions); |
| 58 | 58 | ||
| 59 | auto& kernel = Core::System::GetInstance().Kernel(); | 59 | auto& kernel = system.Kernel(); |
| 60 | scan_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, | 60 | scan_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, |
| 61 | "IBtmUserCore:ScanEvent"); | 61 | "IBtmUserCore:ScanEvent"); |
| 62 | connection_event = Kernel::WritableEvent::CreateEventPair( | 62 | connection_event = Kernel::WritableEvent::CreateEventPair( |
| @@ -108,7 +108,7 @@ private: | |||
| 108 | 108 | ||
| 109 | class BTM_USR final : public ServiceFramework<BTM_USR> { | 109 | class BTM_USR final : public ServiceFramework<BTM_USR> { |
| 110 | public: | 110 | public: |
| 111 | explicit BTM_USR() : ServiceFramework{"btm:u"} { | 111 | explicit BTM_USR(Core::System& system) : ServiceFramework{"btm:u"}, system(system) { |
| 112 | // clang-format off | 112 | // clang-format off |
| 113 | static const FunctionInfo functions[] = { | 113 | static const FunctionInfo functions[] = { |
| 114 | {0, &BTM_USR::GetCore, "GetCore"}, | 114 | {0, &BTM_USR::GetCore, "GetCore"}, |
| @@ -123,8 +123,10 @@ private: | |||
| 123 | 123 | ||
| 124 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 124 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 125 | rb.Push(RESULT_SUCCESS); | 125 | rb.Push(RESULT_SUCCESS); |
| 126 | rb.PushIpcInterface<IBtmUserCore>(); | 126 | rb.PushIpcInterface<IBtmUserCore>(system); |
| 127 | } | 127 | } |
| 128 | |||
| 129 | Core::System& system; | ||
| 128 | }; | 130 | }; |
| 129 | 131 | ||
| 130 | class BTM final : public ServiceFramework<BTM> { | 132 | class BTM final : public ServiceFramework<BTM> { |
| @@ -268,11 +270,11 @@ private: | |||
| 268 | } | 270 | } |
| 269 | }; | 271 | }; |
| 270 | 272 | ||
| 271 | void InstallInterfaces(SM::ServiceManager& sm) { | 273 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { |
| 272 | std::make_shared<BTM>()->InstallAsService(sm); | 274 | std::make_shared<BTM>()->InstallAsService(sm); |
| 273 | std::make_shared<BTM_DBG>()->InstallAsService(sm); | 275 | std::make_shared<BTM_DBG>()->InstallAsService(sm); |
| 274 | std::make_shared<BTM_SYS>()->InstallAsService(sm); | 276 | std::make_shared<BTM_SYS>()->InstallAsService(sm); |
| 275 | std::make_shared<BTM_USR>()->InstallAsService(sm); | 277 | std::make_shared<BTM_USR>(system)->InstallAsService(sm); |
| 276 | } | 278 | } |
| 277 | 279 | ||
| 278 | } // namespace Service::BTM | 280 | } // namespace Service::BTM |
diff --git a/src/core/hle/service/btm/btm.h b/src/core/hle/service/btm/btm.h index e6425a7e3..c6b878043 100644 --- a/src/core/hle/service/btm/btm.h +++ b/src/core/hle/service/btm/btm.h | |||
| @@ -8,8 +8,12 @@ namespace Service::SM { | |||
| 8 | class ServiceManager; | 8 | class ServiceManager; |
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | namespace Core { | ||
| 12 | class System; | ||
| 13 | }; | ||
| 14 | |||
| 11 | namespace Service::BTM { | 15 | namespace Service::BTM { |
| 12 | 16 | ||
| 13 | void InstallInterfaces(SM::ServiceManager& sm); | 17 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); |
| 14 | 18 | ||
| 15 | } // namespace Service::BTM | 19 | } // namespace Service::BTM |