diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-14 02:48:37 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-06 01:40:51 +0200 |
commit | 7444963bbb300cff269e410948de7fa577f5ff16 (patch) | |
tree | 6e0000cb345dc02c8f2ca38958b7c90383f45b03 /src/core/hle/service/sm | |
parent | hle: kernel: svc: Migrate GetThreadContext, GetThreadCoreMask. (diff) | |
download | yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar.gz yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar.bz2 yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar.lz yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar.xz yuzu-7444963bbb300cff269e410948de7fa577f5ff16.tar.zst yuzu-7444963bbb300cff269e410948de7fa577f5ff16.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/sm/controller.cpp | 8 | ||||
-rw-r--r-- | src/core/hle/service/sm/sm.cpp | 22 | ||||
-rw-r--r-- | src/core/hle/service/sm/sm.h | 5 |
3 files changed, 15 insertions, 20 deletions
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index b34fe4bc2..cb397fcc7 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -5,9 +5,9 @@ #include "common/assert.h" #include "common/logging/log.h" #include "core/hle/ipc_helpers.h" -#include "core/hle/kernel/client_session.h" -#include "core/hle/kernel/server_session.h" -#include "core/hle/kernel/session.h" +#include "core/hle/kernel/k_client_session.h" +#include "core/hle/kernel/k_server_session.h" +#include "core/hle/kernel/k_session.h" #include "core/hle/service/sm/controller.h" namespace Service::SM { @@ -30,7 +30,7 @@ void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; rb.Push(RESULT_SUCCESS); - rb.PushMoveObjects(ctx.Session()->GetParent()->Client().get()); + rb.PushMoveObjects(ctx.Session()->GetParent()->GetClientSession()); } void Controller::CloneCurrentObjectEx(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 62f7a5358..66e41277f 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -7,7 +7,9 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/client_port.h" -#include "core/hle/kernel/client_session.h" +#include "core/hle/kernel/k_client_session.h" +#include "core/hle/kernel/k_server_session.h" +#include "core/hle/kernel/k_session.h" #include "core/hle/kernel/server_port.h" #include "core/hle/result.h" #include "core/hle/service/sm/controller.h" @@ -89,13 +91,6 @@ ResultVal<std::shared_ptr<Kernel::ClientPort>> ServiceManager::GetServicePort( return MakeResult(it->second); } -ResultVal<std::shared_ptr<Kernel::ClientSession>> ServiceManager::ConnectToService( - const std::string& name) { - - CASCADE_RESULT(auto client_port, GetServicePort(name)); - return client_port->Connect(); -} - SM::~SM() = default; /** @@ -130,19 +125,20 @@ void SM::GetService(Kernel::HLERequestContext& ctx) { return; } - auto [client, server] = Kernel::Session::Create(kernel, name); + auto* session = Kernel::KSession::Create(kernel); + session->Initialize(std::move(name)); const auto& server_port = client_port.Unwrap()->GetServerPort(); if (server_port->GetHLEHandler()) { - server_port->GetHLEHandler()->ClientConnected(client, server); + server_port->GetHLEHandler()->ClientConnected(session); } else { - server_port->AppendPendingSession(server); + server_port->AppendPendingSession(&session->GetServerSession()); } - LOG_DEBUG(Service_SM, "called service={} -> session={}", name, client->GetObjectId()); + LOG_DEBUG(Service_SM, "called service={} -> session={}", name, session->GetObjectId()); IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; rb.Push(RESULT_SUCCESS); - rb.PushMoveObjects(client.get()); + rb.PushMoveObjects(session->GetClientSession()); } void SM::RegisterService(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/sm/sm.h b/src/core/hle/service/sm/sm.h index 3f46ae44f..8f6862fa9 100644 --- a/src/core/hle/service/sm/sm.h +++ b/src/core/hle/service/sm/sm.h @@ -22,7 +22,7 @@ class System; namespace Kernel { class ClientPort; -class ClientSession; +class KClientSession; class KernelCore; class ServerPort; class SessionRequestHandler; @@ -59,7 +59,6 @@ public: u32 max_sessions); ResultCode UnregisterService(const std::string& name); ResultVal<std::shared_ptr<Kernel::ClientPort>> GetServicePort(const std::string& name); - ResultVal<std::shared_ptr<Kernel::ClientSession>> ConnectToService(const std::string& name); template <Common::DerivedFrom<Kernel::SessionRequestHandler> T> std::shared_ptr<T> GetService(const std::string& service_name) const { @@ -81,7 +80,7 @@ private: std::weak_ptr<SM> sm_interface; std::unique_ptr<Controller> controller_interface; - /// Map of registered services, retrieved using GetServicePort or ConnectToService. + /// Map of registered services, retrieved using GetServicePort. std::unordered_map<std::string, std::shared_ptr<Kernel::ClientPort>> registered_services; /// Kernel context |