From a9369726147c7499e0016e183d5d56a7b44efe4b Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 18 Feb 2023 16:26:48 -0500 Subject: service: refactor server architecture Converts services to have their own processes --- src/core/hle/service/nifm/nifm.cpp | 15 +++++++++++---- src/core/hle/service/nifm/nifm.h | 7 +------ 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src/core/hle/service/nifm') diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 5d32adf64..3d176b3c2 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -6,6 +6,7 @@ #include "core/hle/kernel/k_event.h" #include "core/hle/service/kernel_helpers.h" #include "core/hle/service/nifm/nifm.h" +#include "core/hle/service/server_manager.h" namespace { @@ -626,10 +627,16 @@ private: } }; -void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { - std::make_shared("nifm:a", system)->InstallAsService(service_manager); - std::make_shared("nifm:s", system)->InstallAsService(service_manager); - std::make_shared("nifm:u", system)->InstallAsService(service_manager); +void LoopProcess(Core::System& system) { + auto server_manager = std::make_unique(system); + + server_manager->RegisterNamedService("nifm:a", + std::make_shared("nifm:a", system)); + server_manager->RegisterNamedService("nifm:s", + std::make_shared("nifm:s", system)); + server_manager->RegisterNamedService("nifm:u", + std::make_shared("nifm:u", system)); + ServerManager::RunServer(std::move(server_manager)); } } // namespace Service::NIFM diff --git a/src/core/hle/service/nifm/nifm.h b/src/core/hle/service/nifm/nifm.h index 48161be28..b5da7ae12 100644 --- a/src/core/hle/service/nifm/nifm.h +++ b/src/core/hle/service/nifm/nifm.h @@ -12,14 +12,9 @@ namespace Core { class System; } -namespace Service::SM { -class ServiceManager; -} - namespace Service::NIFM { -/// Registers all NIFM services with the specified service manager. -void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system); +void LoopProcess(Core::System& system); class IGeneralService final : public ServiceFramework { public: -- cgit v1.2.3