summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/btm/btm.cpp
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2019-09-21 10:42:50 +0200
committerDavid Marcec <dmarcecguzman@gmail.com>2019-09-22 08:30:24 +0200
commitc33faabb2768b6190ad6f2eb3631bd2ff244433c (patch)
tree7c83481024aedc0bcf66ee89b13a1cec138a6960 /src/core/hle/service/btm/btm.cpp
parentDeglobalize System: Btdrv (diff)
downloadyuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.tar
yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.tar.gz
yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.tar.bz2
yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.tar.lz
yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.tar.xz
yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.tar.zst
yuzu-c33faabb2768b6190ad6f2eb3631bd2ff244433c.zip
Diffstat (limited to 'src/core/hle/service/btm/btm.cpp')
-rw-r--r--src/core/hle/service/btm/btm.cpp14
1 files changed, 8 insertions, 6 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 {
class IBtmUserCore final : public ServiceFramework<IBtmUserCore> {
public:
- explicit IBtmUserCore() : ServiceFramework{"IBtmUserCore"} {
+ explicit IBtmUserCore(Core::System& system) : ServiceFramework{"IBtmUserCore"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, &IBtmUserCore::AcquireBleScanEvent, "AcquireBleScanEvent"},
@@ -56,7 +56,7 @@ public:
// clang-format on
RegisterHandlers(functions);
- auto& kernel = Core::System::GetInstance().Kernel();
+ auto& kernel = system.Kernel();
scan_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic,
"IBtmUserCore:ScanEvent");
connection_event = Kernel::WritableEvent::CreateEventPair(
@@ -108,7 +108,7 @@ private:
class BTM_USR final : public ServiceFramework<BTM_USR> {
public:
- explicit BTM_USR() : ServiceFramework{"btm:u"} {
+ explicit BTM_USR(Core::System& system) : ServiceFramework{"btm:u"}, system(system) {
// clang-format off
static const FunctionInfo functions[] = {
{0, &BTM_USR::GetCore, "GetCore"},
@@ -123,8 +123,10 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<IBtmUserCore>();
+ rb.PushIpcInterface<IBtmUserCore>(system);
}
+
+ Core::System& system;
};
class BTM final : public ServiceFramework<BTM> {
@@ -268,11 +270,11 @@ private:
}
};
-void InstallInterfaces(SM::ServiceManager& sm) {
+void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
std::make_shared<BTM>()->InstallAsService(sm);
std::make_shared<BTM_DBG>()->InstallAsService(sm);
std::make_shared<BTM_SYS>()->InstallAsService(sm);
- std::make_shared<BTM_USR>()->InstallAsService(sm);
+ std::make_shared<BTM_USR>(system)->InstallAsService(sm);
}
} // namespace Service::BTM