diff options
author | bunnei <bunneidev@gmail.com> | 2020-09-14 18:17:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-14 18:17:10 +0200 |
commit | 042567e4b21312dc00f1831401d32096364e0226 (patch) | |
tree | d4103f107bb7d4c596db35d13c9f514e877e4d17 /src/core/hle/service | |
parent | Merge pull request #4323 from ReinUsesLisp/no-spin (diff) | |
parent | service: Remove two usages of the global system accessor (diff) | |
download | yuzu-042567e4b21312dc00f1831401d32096364e0226.tar yuzu-042567e4b21312dc00f1831401d32096364e0226.tar.gz yuzu-042567e4b21312dc00f1831401d32096364e0226.tar.bz2 yuzu-042567e4b21312dc00f1831401d32096364e0226.tar.lz yuzu-042567e4b21312dc00f1831401d32096364e0226.tar.xz yuzu-042567e4b21312dc00f1831401d32096364e0226.tar.zst yuzu-042567e4b21312dc00f1831401d32096364e0226.zip |
Diffstat (limited to 'src/core/hle/service')
-rw-r--r-- | src/core/hle/service/service.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/service/service.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/sm/sm.cpp | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 538f28495..94bc5ade7 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -105,10 +105,9 @@ void ServiceFrameworkBase::InstallAsService(SM::ServiceManager& service_manager) port_installed = true; } -void ServiceFrameworkBase::InstallAsNamedPort() { +void ServiceFrameworkBase::InstallAsNamedPort(Kernel::KernelCore& kernel) { ASSERT(!port_installed); - auto& kernel = Core::System::GetInstance().Kernel(); auto [server_port, client_port] = Kernel::ServerPort::CreatePortPair(kernel, max_sessions, service_name); server_port->SetHleHandler(shared_from_this()); @@ -116,10 +115,9 @@ void ServiceFrameworkBase::InstallAsNamedPort() { port_installed = true; } -std::shared_ptr<Kernel::ClientPort> ServiceFrameworkBase::CreatePort() { +std::shared_ptr<Kernel::ClientPort> ServiceFrameworkBase::CreatePort(Kernel::KernelCore& kernel) { ASSERT(!port_installed); - auto& kernel = Core::System::GetInstance().Kernel(); auto [server_port, client_port] = Kernel::ServerPort::CreatePortPair(kernel, max_sessions, service_name); auto port = MakeResult(std::move(server_port)).Unwrap(); diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 022d885b6..a01ef3353 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -63,9 +63,9 @@ public: /// Creates a port pair and registers this service with the given ServiceManager. void InstallAsService(SM::ServiceManager& service_manager); /// Creates a port pair and registers it on the kernel's global port registry. - void InstallAsNamedPort(); + void InstallAsNamedPort(Kernel::KernelCore& kernel); /// Creates and returns an unregistered port for the service. - std::shared_ptr<Kernel::ClientPort> CreatePort(); + std::shared_ptr<Kernel::ClientPort> CreatePort(Kernel::KernelCore& kernel); void InvokeRequest(Kernel::HLERequestContext& ctx); diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index d872de16c..586b3d8eb 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -43,7 +43,7 @@ void ServiceManager::InstallInterfaces(std::shared_ptr<ServiceManager> self, ASSERT(self->sm_interface.expired()); auto sm = std::make_shared<SM>(self, kernel); - sm->InstallAsNamedPort(); + sm->InstallAsNamedPort(kernel); self->sm_interface = sm; self->controller_interface = std::make_unique<Controller>(); } |