summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-04-14 02:48:37 +0200
committerbunnei <bunneidev@gmail.com>2021-05-06 01:40:51 +0200
commit7444963bbb300cff269e410948de7fa577f5ff16 (patch)
tree6e0000cb345dc02c8f2ca38958b7c90383f45b03 /src/core/hle/service
parenthle: kernel: svc: Migrate GetThreadContext, GetThreadCoreMask. (diff)
downloadyuzu-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 'src/core/hle/service')
-rw-r--r--src/core/hle/service/am/applets/applets.cpp1
-rw-r--r--src/core/hle/service/hid/hid.cpp1
-rw-r--r--src/core/hle/service/mm/mm_u.cpp1
-rw-r--r--src/core/hle/service/service.h5
-rw-r--r--src/core/hle/service/sm/controller.cpp8
-rw-r--r--src/core/hle/service/sm/sm.cpp22
-rw-r--r--src/core/hle/service/sm/sm.h5
-rw-r--r--src/core/hle/service/time/time.cpp1
8 files changed, 16 insertions, 28 deletions
diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp
index cf8ad7598..ae995df6b 100644
--- a/src/core/hle/service/am/applets/applets.cpp
+++ b/src/core/hle/service/am/applets/applets.cpp
@@ -14,7 +14,6 @@
#include "core/frontend/applets/web_browser.h"
#include "core/hle/kernel/k_readable_event.h"
#include "core/hle/kernel/k_writable_event.h"
-#include "core/hle/kernel/server_session.h"
#include "core/hle/service/am/am.h"
#include "core/hle/service/am/applet_ae.h"
#include "core/hle/service/am/applet_oe.h"
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 49c1db42a..6b3ebeb8f 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -14,7 +14,6 @@
#include "core/hardware_properties.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_readable_event.h"
#include "core/hle/kernel/k_shared_memory.h"
#include "core/hle/kernel/k_writable_event.h"
diff --git a/src/core/hle/service/mm/mm_u.cpp b/src/core/hle/service/mm/mm_u.cpp
index b0cb07d24..c8519e2db 100644
--- a/src/core/hle/service/mm/mm_u.cpp
+++ b/src/core/hle/service/mm/mm_u.cpp
@@ -4,7 +4,6 @@
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
-#include "core/hle/kernel/client_session.h"
#include "core/hle/service/mm/mm_u.h"
#include "core/hle/service/sm/sm.h"
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index 916445517..076f50b0b 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -21,11 +21,8 @@ class System;
}
namespace Kernel {
-class ClientPort;
-class ServerPort;
-class ServerSession;
class HLERequestContext;
-} // namespace Kernel
+}
namespace Service {
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
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index 30283f239..413a00ae0 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -9,7 +9,6 @@
#include "core/hardware_properties.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_scheduler.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/time/interface.h"