summaryrefslogtreecommitdiff
path: root/src/core/hle/service/btm
diff options
context:
space:
mode:
authorGravatar David Marcec2019-09-21 18:42:50 +1000
committerGravatar David Marcec2019-09-22 16:30:24 +1000
commitc33faabb2768b6190ad6f2eb3631bd2ff244433c (patch)
tree7c83481024aedc0bcf66ee89b13a1cec138a6960 /src/core/hle/service/btm
parentDeglobalize System: Btdrv (diff)
downloadyuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.tar.gz
yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.tar.xz
yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.zip
Deglobalize System: Btm
Diffstat (limited to 'src/core/hle/service/btm')
-rw-r--r--src/core/hle/service/btm/btm.cpp14
-rw-r--r--src/core/hle/service/btm/btm.h6
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
18class IBtmUserCore final : public ServiceFramework<IBtmUserCore> { 18class IBtmUserCore final : public ServiceFramework<IBtmUserCore> {
19public: 19public:
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
109class BTM_USR final : public ServiceFramework<BTM_USR> { 109class BTM_USR final : public ServiceFramework<BTM_USR> {
110public: 110public:
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
130class BTM final : public ServiceFramework<BTM> { 132class BTM final : public ServiceFramework<BTM> {
@@ -268,11 +270,11 @@ private:
268 } 270 }
269}; 271};
270 272
271void InstallInterfaces(SM::ServiceManager& sm) { 273void 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 {
8class ServiceManager; 8class ServiceManager;
9} 9}
10 10
11namespace Core {
12class System;
13};
14
11namespace Service::BTM { 15namespace Service::BTM {
12 16
13void InstallInterfaces(SM::ServiceManager& sm); 17void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);
14 18
15} // namespace Service::BTM 19} // namespace Service::BTM