diff options
| author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-09-22 09:38:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-22 09:38:13 -0400 |
| commit | 4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b (patch) | |
| tree | cbf3e722bf583a48f851744c8276a2caf0b2e8ef /src/core/hle/service/nim/nim.cpp | |
| parent | 9d69206cd00982e02f90845c98d7d6c9887645c3 (diff) | |
| parent | 9513abbb0a0fcc9a1bf52eb320e015ba81856bf1 (diff) | |
Merge pull request #2884 from ogniK5377/deglobal-sys-services
Remove usage of System::CurrentInterface() from most services
Diffstat (limited to 'src/core/hle/service/nim/nim.cpp')
| -rw-r--r-- | src/core/hle/service/nim/nim.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index f319a3ca1..75d414952 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp @@ -126,7 +126,7 @@ public: class IEnsureNetworkClockAvailabilityService final : public ServiceFramework<IEnsureNetworkClockAvailabilityService> { public: - IEnsureNetworkClockAvailabilityService() + explicit IEnsureNetworkClockAvailabilityService(Core::System& system) : ServiceFramework("IEnsureNetworkClockAvailabilityService") { static const FunctionInfo functions[] = { {0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"}, @@ -139,7 +139,7 @@ public: }; RegisterHandlers(functions); - auto& kernel = Core::System::GetInstance().Kernel(); + auto& kernel = system.Kernel(); finished_event = Kernel::WritableEvent::CreateEventPair( kernel, Kernel::ResetType::Automatic, "IEnsureNetworkClockAvailabilityService:FinishEvent"); @@ -200,7 +200,7 @@ private: class NTC final : public ServiceFramework<NTC> { public: - explicit NTC() : ServiceFramework{"ntc"} { + explicit NTC(Core::System& system) : ServiceFramework{"ntc"}, system(system) { // clang-format off static const FunctionInfo functions[] = { {0, &NTC::OpenEnsureNetworkClockAvailabilityService, "OpenEnsureNetworkClockAvailabilityService"}, @@ -218,7 +218,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface<IEnsureNetworkClockAvailabilityService>(); + rb.PushIpcInterface<IEnsureNetworkClockAvailabilityService>(system); } // TODO(ogniK): Do we need these? @@ -235,13 +235,14 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } + Core::System& system; }; -void InstallInterfaces(SM::ServiceManager& sm) { +void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { std::make_shared<NIM>()->InstallAsService(sm); std::make_shared<NIM_ECA>()->InstallAsService(sm); std::make_shared<NIM_SHP>()->InstallAsService(sm); - std::make_shared<NTC>()->InstallAsService(sm); + std::make_shared<NTC>(system)->InstallAsService(sm); } } // namespace Service::NIM |
