From 1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 26 Nov 2020 15:19:08 -0500 Subject: 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. --- src/core/hle/service/bpc/bpc.cpp | 10 +++++----- src/core/hle/service/bpc/bpc.h | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/bpc') 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 { class BPC final : public ServiceFramework { public: - explicit BPC() : ServiceFramework{"bpc"} { + explicit BPC(Core::System& system_) : ServiceFramework{system_, "bpc"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "ShutdownSystem"}, @@ -40,7 +40,7 @@ public: class BPC_R final : public ServiceFramework { public: - explicit BPC_R() : ServiceFramework{"bpc:r"} { + explicit BPC_R(Core::System& system_) : ServiceFramework{system_, "bpc:r"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "GetRtcTime"}, @@ -55,9 +55,9 @@ public: } }; -void InstallInterfaces(SM::ServiceManager& sm) { - std::make_shared()->InstallAsService(sm); - std::make_shared()->InstallAsService(sm); +void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { + std::make_shared(system)->InstallAsService(sm); + std::make_shared(system)->InstallAsService(sm); } } // 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 @@ #pragma once +namespace Core { +class System; +} + namespace Service::SM { class ServiceManager; } namespace Service::BPC { -void InstallInterfaces(SM::ServiceManager& sm); +void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); } // namespace Service::BPC -- cgit v1.2.3