summaryrefslogtreecommitdiff
path: root/src/core/hle/service/bpc
diff options
context:
space:
mode:
authorGravatar Lioncash2020-11-26 15:19:08 -0500
committerGravatar Lioncash2020-11-26 20:03:11 -0500
commit1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f (patch)
tree3593cd42e0ba676c3919561983f7e9766fcb641c /src/core/hle/service/bpc
parentMerge pull request #4975 from comex/invalid-syncpoint-id (diff)
downloadyuzu-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/bpc')
-rw-r--r--src/core/hle/service/bpc/bpc.cpp10
-rw-r--r--src/core/hle/service/bpc/bpc.h6
2 files changed, 10 insertions, 6 deletions
diff --git a/src/core/hle/service/bpc/bpc.cpp b/src/core/hle/service/bpc/bpc.cpp
index fac6b2f9c..e4630320e 100644
--- a/src/core/hle/service/bpc/bpc.cpp
+++ b/src/core/hle/service/bpc/bpc.cpp
@@ -12,7 +12,7 @@ namespace Service::BPC {
12 12
13class BPC final : public ServiceFramework<BPC> { 13class BPC final : public ServiceFramework<BPC> {
14public: 14public:
15 explicit BPC() : ServiceFramework{"bpc"} { 15 explicit BPC(Core::System& system_) : ServiceFramework{system_, "bpc"} {
16 // clang-format off 16 // clang-format off
17 static const FunctionInfo functions[] = { 17 static const FunctionInfo functions[] = {
18 {0, nullptr, "ShutdownSystem"}, 18 {0, nullptr, "ShutdownSystem"},
@@ -40,7 +40,7 @@ public:
40 40
41class BPC_R final : public ServiceFramework<BPC_R> { 41class BPC_R final : public ServiceFramework<BPC_R> {
42public: 42public:
43 explicit BPC_R() : ServiceFramework{"bpc:r"} { 43 explicit BPC_R(Core::System& system_) : ServiceFramework{system_, "bpc:r"} {
44 // clang-format off 44 // clang-format off
45 static const FunctionInfo functions[] = { 45 static const FunctionInfo functions[] = {
46 {0, nullptr, "GetRtcTime"}, 46 {0, nullptr, "GetRtcTime"},
@@ -55,9 +55,9 @@ public:
55 } 55 }
56}; 56};
57 57
58void InstallInterfaces(SM::ServiceManager& sm) { 58void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
59 std::make_shared<BPC>()->InstallAsService(sm); 59 std::make_shared<BPC>(system)->InstallAsService(sm);
60 std::make_shared<BPC_R>()->InstallAsService(sm); 60 std::make_shared<BPC_R>(system)->InstallAsService(sm);
61} 61}
62 62
63} // namespace Service::BPC 63} // namespace Service::BPC
diff --git a/src/core/hle/service/bpc/bpc.h b/src/core/hle/service/bpc/bpc.h
index eaa37be8d..6ec25aa9b 100644
--- a/src/core/hle/service/bpc/bpc.h
+++ b/src/core/hle/service/bpc/bpc.h
@@ -4,12 +4,16 @@
4 4
5#pragma once 5#pragma once
6 6
7namespace Core {
8class System;
9}
10
7namespace Service::SM { 11namespace Service::SM {
8class ServiceManager; 12class ServiceManager;
9} 13}
10 14
11namespace Service::BPC { 15namespace Service::BPC {
12 16
13void InstallInterfaces(SM::ServiceManager& sm); 17void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);
14 18
15} // namespace Service::BPC 19} // namespace Service::BPC