diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2020-11-27 06:41:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-27 06:41:56 +0100 |
commit | ee5e77fbf97da699e5ded623c12cad56dd7ce0da (patch) | |
tree | 66940e6456e66688af258d1e56d846eedd82d5b6 /src/core/hle/service/sm | |
parent | Merge pull request #5016 from comex/xx-push (diff) | |
parent | service: Eliminate usages of the global system instance (diff) | |
download | yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar.gz yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar.bz2 yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar.lz yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar.xz yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar.zst yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.zip |
Diffstat (limited to 'src/core/hle/service/sm')
-rw-r--r-- | src/core/hle/service/sm/controller.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/service/sm/controller.h | 6 | ||||
-rw-r--r-- | src/core/hle/service/sm/sm.cpp | 14 | ||||
-rw-r--r-- | src/core/hle/service/sm/sm.h | 8 |
4 files changed, 19 insertions, 11 deletions
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 972aaa6d9..916177efd 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -48,7 +48,7 @@ void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { } // https://switchbrew.org/wiki/IPC_Marshalling -Controller::Controller() : ServiceFramework("IpcController") { +Controller::Controller(Core::System& system_) : ServiceFramework{system_, "IpcController"} { static const FunctionInfo functions[] = { {0, &Controller::ConvertCurrentObjectToDomain, "ConvertCurrentObjectToDomain"}, {1, nullptr, "CopyFromCurrentDomain"}, diff --git a/src/core/hle/service/sm/controller.h b/src/core/hle/service/sm/controller.h index 180c6da50..7494f898d 100644 --- a/src/core/hle/service/sm/controller.h +++ b/src/core/hle/service/sm/controller.h @@ -6,11 +6,15 @@ #include "core/hle/service/service.h" +namespace Core { +class System; +} + namespace Service::SM { class Controller final : public ServiceFramework<Controller> { public: - Controller(); + explicit Controller(Core::System& system_); ~Controller() override; private: diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 9c1da361b..4da69f503 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -38,14 +38,13 @@ static ResultCode ValidateServiceName(const std::string& name) { return RESULT_SUCCESS; } -void ServiceManager::InstallInterfaces(std::shared_ptr<ServiceManager> self, - Kernel::KernelCore& kernel) { +void ServiceManager::InstallInterfaces(std::shared_ptr<ServiceManager> self, Core::System& system) { ASSERT(self->sm_interface.expired()); - auto sm = std::make_shared<SM>(self, kernel); - sm->InstallAsNamedPort(kernel); + auto sm = std::make_shared<SM>(self, system); + sm->InstallAsNamedPort(system.Kernel()); self->sm_interface = sm; - self->controller_interface = std::make_unique<Controller>(); + self->controller_interface = std::make_unique<Controller>(system); } ResultVal<std::shared_ptr<Kernel::ServerPort>> ServiceManager::RegisterService(std::string name, @@ -190,8 +189,9 @@ void SM::UnregisterService(Kernel::HLERequestContext& ctx) { rb.Push(service_manager->UnregisterService(name)); } -SM::SM(std::shared_ptr<ServiceManager> service_manager, Kernel::KernelCore& kernel) - : ServiceFramework{"sm:", 4}, service_manager{std::move(service_manager)}, kernel{kernel} { +SM::SM(std::shared_ptr<ServiceManager> service_manager_, Core::System& system_) + : ServiceFramework{system_, "sm:", 4}, + service_manager{std::move(service_manager_)}, kernel{system_.Kernel()} { static const FunctionInfo functions[] = { {0x00000000, &SM::Initialize, "Initialize"}, {0x00000001, &SM::GetService, "GetService"}, diff --git a/src/core/hle/service/sm/sm.h b/src/core/hle/service/sm/sm.h index 6790c86f0..3f46ae44f 100644 --- a/src/core/hle/service/sm/sm.h +++ b/src/core/hle/service/sm/sm.h @@ -16,6 +16,10 @@ #include "core/hle/result.h" #include "core/hle/service/service.h" +namespace Core { +class System; +} + namespace Kernel { class ClientPort; class ClientSession; @@ -31,7 +35,7 @@ class Controller; /// Interface to "sm:" service class SM final : public ServiceFramework<SM> { public: - explicit SM(std::shared_ptr<ServiceManager> service_manager, Kernel::KernelCore& kernel); + explicit SM(std::shared_ptr<ServiceManager> service_manager_, Core::System& system_); ~SM() override; private: @@ -46,7 +50,7 @@ private: class ServiceManager { public: - static void InstallInterfaces(std::shared_ptr<ServiceManager> self, Kernel::KernelCore& kernel); + static void InstallInterfaces(std::shared_ptr<ServiceManager> self, Core::System& system); explicit ServiceManager(Kernel::KernelCore& kernel_); ~ServiceManager(); |