diff options
author | bunnei <bunneidev@gmail.com> | 2021-07-01 03:06:47 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-07-21 03:54:55 +0200 |
commit | 7bd020e0307c6a870707440f99bf6bb8b513306f (patch) | |
tree | f862958e6f47b0f8b737ddc16bdcfdf5be53e345 /src/core/hle/service/sm/sm.h | |
parent | hle: kernel: k_process: Close the handle table on shutdown. (diff) | |
download | yuzu-7bd020e0307c6a870707440f99bf6bb8b513306f.tar yuzu-7bd020e0307c6a870707440f99bf6bb8b513306f.tar.gz yuzu-7bd020e0307c6a870707440f99bf6bb8b513306f.tar.bz2 yuzu-7bd020e0307c6a870707440f99bf6bb8b513306f.tar.lz yuzu-7bd020e0307c6a870707440f99bf6bb8b513306f.tar.xz yuzu-7bd020e0307c6a870707440f99bf6bb8b513306f.tar.zst yuzu-7bd020e0307c6a870707440f99bf6bb8b513306f.zip |
Diffstat (limited to 'src/core/hle/service/sm/sm.h')
-rw-r--r-- | src/core/hle/service/sm/sm.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/core/hle/service/sm/sm.h b/src/core/hle/service/sm/sm.h index ea37f11d4..068c78588 100644 --- a/src/core/hle/service/sm/sm.h +++ b/src/core/hle/service/sm/sm.h @@ -49,6 +49,7 @@ private: ServiceManager& service_manager; bool is_initialized{}; Kernel::KernelCore& kernel; + std::vector<Kernel::KServerPort*> server_ports; }; class ServiceManager { @@ -58,7 +59,8 @@ public: explicit ServiceManager(Kernel::KernelCore& kernel_); ~ServiceManager(); - ResultVal<Kernel::KServerPort*> RegisterService(std::string name, u32 max_sessions); + ResultCode RegisterService(std::string name, u32 max_sessions, + Kernel::SessionRequestHandlerPtr handler); ResultCode UnregisterService(const std::string& name); ResultVal<Kernel::KPort*> GetServicePort(const std::string& name); @@ -69,21 +71,17 @@ public: LOG_DEBUG(Service, "Can't find service: {}", service_name); return nullptr; } - auto* port = service->second; - if (port == nullptr) { - return nullptr; - } - return std::static_pointer_cast<T>(port->GetServerPort().GetSessionRequestHandler()); + return std::static_pointer_cast<T>(service->second); } void InvokeControlRequest(Kernel::HLERequestContext& context); private: - std::weak_ptr<SM> sm_interface; + std::shared_ptr<SM> sm_interface; std::unique_ptr<Controller> controller_interface; /// Map of registered services, retrieved using GetServicePort. - std::unordered_map<std::string, Kernel::KPort*> registered_services; + std::unordered_map<std::string, Kernel::SessionRequestHandlerPtr> registered_services; /// Kernel context Kernel::KernelCore& kernel; |