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.
This commit is contained in:
Lioncash 2020-11-26 15:19:08 -05:00
parent 322349e8cc
commit 1a954b2a59
222 changed files with 1221 additions and 907 deletions

View file

@ -17,7 +17,7 @@ namespace Service::BtDrv {
class Bt final : public ServiceFramework<Bt> {
public:
explicit Bt(Core::System& system) : ServiceFramework{"bt"} {
explicit Bt(Core::System& system_) : ServiceFramework{system_, "bt"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "LeClientReadCharacteristic"},
@ -52,7 +52,7 @@ private:
class BtDrv final : public ServiceFramework<BtDrv> {
public:
explicit BtDrv() : ServiceFramework{"btdrv"} {
explicit BtDrv(Core::System& system_) : ServiceFramework{system_, "btdrv"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "InitializeBluetoothDriver"},
@ -166,7 +166,7 @@ public:
};
void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
std::make_shared<BtDrv>()->InstallAsService(sm);
std::make_shared<BtDrv>(system)->InstallAsService(sm);
std::make_shared<Bt>(system)->InstallAsService(sm);
}