diff options
author | bunnei <bunneidev@gmail.com> | 2018-04-21 03:26:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-21 03:26:27 +0200 |
commit | 2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1 (patch) | |
tree | eb3a8d9007462f1864174ea4ffe9e5a80d56c9d5 /src/core/hle/service/service.cpp | |
parent | Merge pull request #340 from mailwl/vi-update (diff) | |
parent | core: Relocate g_service_manager to the System class (diff) | |
download | yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar.gz yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar.bz2 yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar.lz yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar.xz yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar.zst yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.zip |
Diffstat (limited to 'src/core/hle/service/service.cpp')
-rw-r--r-- | src/core/hle/service/service.cpp | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index c5490c1ae..08ce29677 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -145,7 +145,7 @@ ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& co return ResultCode(ErrorModule::HIPC, ErrorDescription::RemoteProcessDead); } case IPC::CommandType::Control: { - SM::g_service_manager->InvokeControlRequest(context); + Core::System::GetInstance().ServiceManager().InvokeControlRequest(context); break; } case IPC::CommandType::Request: { @@ -170,42 +170,40 @@ void AddNamedPort(std::string name, SharedPtr<ClientPort> port) { } /// Initialize ServiceManager -void Init() { +void Init(std::shared_ptr<SM::ServiceManager>& sm) { // NVFlinger needs to be accessed by several services like Vi and AppletOE so we instantiate it // here and pass it into the respective InstallInterfaces functions. auto nv_flinger = std::make_shared<NVFlinger::NVFlinger>(); - SM::g_service_manager = std::make_shared<SM::ServiceManager>(); - SM::ServiceManager::InstallInterfaces(SM::g_service_manager); - - Account::InstallInterfaces(*SM::g_service_manager); - AM::InstallInterfaces(*SM::g_service_manager, nv_flinger); - AOC::InstallInterfaces(*SM::g_service_manager); - APM::InstallInterfaces(*SM::g_service_manager); - Audio::InstallInterfaces(*SM::g_service_manager); - Fatal::InstallInterfaces(*SM::g_service_manager); - FileSystem::InstallInterfaces(*SM::g_service_manager); - Friend::InstallInterfaces(*SM::g_service_manager); - HID::InstallInterfaces(*SM::g_service_manager); - LM::InstallInterfaces(*SM::g_service_manager); - NFP::InstallInterfaces(*SM::g_service_manager); - NIFM::InstallInterfaces(*SM::g_service_manager); - NS::InstallInterfaces(*SM::g_service_manager); - Nvidia::InstallInterfaces(*SM::g_service_manager); - PCTL::InstallInterfaces(*SM::g_service_manager); - Sockets::InstallInterfaces(*SM::g_service_manager); - SPL::InstallInterfaces(*SM::g_service_manager); - SSL::InstallInterfaces(*SM::g_service_manager); - Time::InstallInterfaces(*SM::g_service_manager); - VI::InstallInterfaces(*SM::g_service_manager, nv_flinger); - Set::InstallInterfaces(*SM::g_service_manager); + SM::ServiceManager::InstallInterfaces(sm); + + Account::InstallInterfaces(*sm); + AM::InstallInterfaces(*sm, nv_flinger); + AOC::InstallInterfaces(*sm); + APM::InstallInterfaces(*sm); + Audio::InstallInterfaces(*sm); + Fatal::InstallInterfaces(*sm); + FileSystem::InstallInterfaces(*sm); + Friend::InstallInterfaces(*sm); + HID::InstallInterfaces(*sm); + LM::InstallInterfaces(*sm); + NFP::InstallInterfaces(*sm); + NIFM::InstallInterfaces(*sm); + NS::InstallInterfaces(*sm); + Nvidia::InstallInterfaces(*sm); + PCTL::InstallInterfaces(*sm); + Sockets::InstallInterfaces(*sm); + SPL::InstallInterfaces(*sm); + SSL::InstallInterfaces(*sm); + Time::InstallInterfaces(*sm); + VI::InstallInterfaces(*sm, nv_flinger); + Set::InstallInterfaces(*sm); LOG_DEBUG(Service, "initialized OK"); } /// Shutdown ServiceManager void Shutdown() { - SM::g_service_manager = nullptr; g_kernel_named_ports.clear(); LOG_DEBUG(Service, "shutdown OK"); } |