summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/sm
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-02-19 20:42:12 +0100
committerLiam <byteslice@airmail.cc>2023-03-01 16:39:49 +0100
commit65be230fdda302b25447f2f09b06e3238bd09e79 (patch)
tree68250d7bc8151041b236dcd79483df98938952cd /src/core/hle/service/sm
parentsm:: remove unused member (diff)
downloadyuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar
yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.gz
yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.bz2
yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.lz
yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.xz
yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.zst
yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.zip
Diffstat (limited to 'src/core/hle/service/sm')
-rw-r--r--src/core/hle/service/sm/sm.cpp18
-rw-r--r--src/core/hle/service/sm/sm.h21
-rw-r--r--src/core/hle/service/sm/sm_controller.cpp10
-rw-r--r--src/core/hle/service/sm/sm_controller.h8
4 files changed, 28 insertions, 29 deletions
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index 53c877836..a46f47d3e 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -5,13 +5,13 @@
#include "common/assert.h"
#include "common/scope_exit.h"
#include "core/core.h"
-#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/k_client_port.h"
#include "core/hle/kernel/k_client_session.h"
#include "core/hle/kernel/k_port.h"
#include "core/hle/kernel/k_scoped_resource_reservation.h"
#include "core/hle/kernel/k_server_port.h"
#include "core/hle/result.h"
+#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/server_manager.h"
#include "core/hle/service/sm/sm.h"
#include "core/hle/service/sm/sm_controller.h"
@@ -38,7 +38,7 @@ ServiceManager::~ServiceManager() {
}
}
-void ServiceManager::InvokeControlRequest(Kernel::HLERequestContext& context) {
+void ServiceManager::InvokeControlRequest(HLERequestContext& context) {
controller_interface->InvokeRequest(context);
}
@@ -51,7 +51,7 @@ static Result ValidateServiceName(const std::string& name) {
}
Result ServiceManager::RegisterService(std::string name, u32 max_sessions,
- Kernel::SessionRequestHandlerPtr handler) {
+ SessionRequestHandlerPtr handler) {
CASCADE_CODE(ValidateServiceName(name));
@@ -109,7 +109,7 @@ ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name
* Outputs:
* 0: Result
*/
-void SM::Initialize(Kernel::HLERequestContext& ctx) {
+void SM::Initialize(HLERequestContext& ctx) {
LOG_DEBUG(Service_SM, "called");
ctx.GetManager()->SetIsInitializedForSm();
@@ -118,7 +118,7 @@ void SM::Initialize(Kernel::HLERequestContext& ctx) {
rb.Push(ResultSuccess);
}
-void SM::GetService(Kernel::HLERequestContext& ctx) {
+void SM::GetService(HLERequestContext& ctx) {
auto result = GetServiceImpl(ctx);
if (ctx.GetIsDeferred()) {
// Don't overwrite the command buffer.
@@ -135,7 +135,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
}
}
-void SM::GetServiceTipc(Kernel::HLERequestContext& ctx) {
+void SM::GetServiceTipc(HLERequestContext& ctx) {
auto result = GetServiceImpl(ctx);
if (ctx.GetIsDeferred()) {
// Don't overwrite the command buffer.
@@ -158,7 +158,7 @@ static std::string PopServiceName(IPC::RequestParser& rp) {
return result;
}
-ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext& ctx) {
+ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(HLERequestContext& ctx) {
if (!ctx.GetManager()->GetIsInitializedForSm()) {
return ERR_NOT_INITIALIZED;
}
@@ -192,7 +192,7 @@ ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext&
return session;
}
-void SM::RegisterService(Kernel::HLERequestContext& ctx) {
+void SM::RegisterService(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
std::string name(PopServiceName(rp));
@@ -219,7 +219,7 @@ void SM::RegisterService(Kernel::HLERequestContext& ctx) {
rb.PushMoveObjects(port->GetServerPort());
}
-void SM::UnregisterService(Kernel::HLERequestContext& ctx) {
+void SM::UnregisterService(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
std::string name(PopServiceName(rp));
diff --git a/src/core/hle/service/sm/sm.h b/src/core/hle/service/sm/sm.h
index 8dbf2c767..6697f4007 100644
--- a/src/core/hle/service/sm/sm.h
+++ b/src/core/hle/service/sm/sm.h
@@ -36,13 +36,13 @@ public:
~SM() override;
private:
- void Initialize(Kernel::HLERequestContext& ctx);
- void GetService(Kernel::HLERequestContext& ctx);
- void GetServiceTipc(Kernel::HLERequestContext& ctx);
- void RegisterService(Kernel::HLERequestContext& ctx);
- void UnregisterService(Kernel::HLERequestContext& ctx);
+ void Initialize(HLERequestContext& ctx);
+ void GetService(HLERequestContext& ctx);
+ void GetServiceTipc(HLERequestContext& ctx);
+ void RegisterService(HLERequestContext& ctx);
+ void UnregisterService(HLERequestContext& ctx);
- ResultVal<Kernel::KClientSession*> GetServiceImpl(Kernel::HLERequestContext& ctx);
+ ResultVal<Kernel::KClientSession*> GetServiceImpl(HLERequestContext& ctx);
ServiceManager& service_manager;
Kernel::KernelCore& kernel;
@@ -53,12 +53,11 @@ public:
explicit ServiceManager(Kernel::KernelCore& kernel_);
~ServiceManager();
- Result RegisterService(std::string name, u32 max_sessions,
- Kernel::SessionRequestHandlerPtr handler);
+ Result RegisterService(std::string name, u32 max_sessions, SessionRequestHandlerPtr handler);
Result UnregisterService(const std::string& name);
ResultVal<Kernel::KPort*> GetServicePort(const std::string& name);
- template <Common::DerivedFrom<Kernel::SessionRequestHandler> T>
+ template <Common::DerivedFrom<SessionRequestHandler> T>
std::shared_ptr<T> GetService(const std::string& service_name) const {
auto service = registered_services.find(service_name);
if (service == registered_services.end()) {
@@ -68,7 +67,7 @@ public:
return std::static_pointer_cast<T>(service->second);
}
- void InvokeControlRequest(Kernel::HLERequestContext& context);
+ void InvokeControlRequest(HLERequestContext& context);
void SetDeferralEvent(Kernel::KEvent* deferral_event_) {
deferral_event = deferral_event_;
@@ -80,7 +79,7 @@ private:
/// Map of registered services, retrieved using GetServicePort.
std::mutex lock;
- std::unordered_map<std::string, Kernel::SessionRequestHandlerPtr> registered_services;
+ std::unordered_map<std::string, SessionRequestHandlerPtr> registered_services;
std::unordered_map<std::string, Kernel::KPort*> service_ports;
/// Kernel context
diff --git a/src/core/hle/service/sm/sm_controller.cpp b/src/core/hle/service/sm/sm_controller.cpp
index f52522d1d..0111c8d7f 100644
--- a/src/core/hle/service/sm/sm_controller.cpp
+++ b/src/core/hle/service/sm/sm_controller.cpp
@@ -4,18 +4,18 @@
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/core.h"
-#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/k_client_port.h"
#include "core/hle/kernel/k_port.h"
#include "core/hle/kernel/k_scoped_resource_reservation.h"
#include "core/hle/kernel/k_server_session.h"
#include "core/hle/kernel/k_session.h"
+#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/server_manager.h"
#include "core/hle/service/sm/sm_controller.h"
namespace Service::SM {
-void Controller::ConvertCurrentObjectToDomain(Kernel::HLERequestContext& ctx) {
+void Controller::ConvertCurrentObjectToDomain(HLERequestContext& ctx) {
ASSERT_MSG(!ctx.GetManager()->IsDomain(), "Session is already a domain");
LOG_DEBUG(Service, "called, server_session={}", ctx.Session()->GetId());
ctx.GetManager()->ConvertToDomainOnRequestEnd();
@@ -25,7 +25,7 @@ void Controller::ConvertCurrentObjectToDomain(Kernel::HLERequestContext& ctx) {
rb.Push<u32>(1); // Converted sessions start with 1 request handler
}
-void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) {
+void Controller::CloneCurrentObject(HLERequestContext& ctx) {
LOG_DEBUG(Service, "called");
auto& process = *ctx.GetThread().GetOwnerProcess();
@@ -59,13 +59,13 @@ void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) {
rb.PushMoveObjects(session->GetClientSession());
}
-void Controller::CloneCurrentObjectEx(Kernel::HLERequestContext& ctx) {
+void Controller::CloneCurrentObjectEx(HLERequestContext& ctx) {
LOG_DEBUG(Service, "called");
CloneCurrentObject(ctx);
}
-void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) {
+void Controller::QueryPointerBufferSize(HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 3};
diff --git a/src/core/hle/service/sm/sm_controller.h b/src/core/hle/service/sm/sm_controller.h
index ed386f660..4e748b36d 100644
--- a/src/core/hle/service/sm/sm_controller.h
+++ b/src/core/hle/service/sm/sm_controller.h
@@ -17,10 +17,10 @@ public:
~Controller() override;
private:
- void ConvertCurrentObjectToDomain(Kernel::HLERequestContext& ctx);
- void CloneCurrentObject(Kernel::HLERequestContext& ctx);
- void CloneCurrentObjectEx(Kernel::HLERequestContext& ctx);
- void QueryPointerBufferSize(Kernel::HLERequestContext& ctx);
+ void ConvertCurrentObjectToDomain(HLERequestContext& ctx);
+ void CloneCurrentObject(HLERequestContext& ctx);
+ void CloneCurrentObjectEx(HLERequestContext& ctx);
+ void QueryPointerBufferSize(HLERequestContext& ctx);
};
} // namespace Service::SM