summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2017-10-19 03:34:19 +0200
committerbunnei <bunneidev@gmail.com>2017-10-19 03:34:19 +0200
commit03bf0739a48157397c0f2a60b385466526239777 (patch)
treeb1910c0f285de008e7e3091ff1b9d86adae515be /src/core
parentmemory: Print addresses as 64-bit. (diff)
downloadyuzu-03bf0739a48157397c0f2a60b385466526239777.tar
yuzu-03bf0739a48157397c0f2a60b385466526239777.tar.gz
yuzu-03bf0739a48157397c0f2a60b385466526239777.tar.bz2
yuzu-03bf0739a48157397c0f2a60b385466526239777.tar.lz
yuzu-03bf0739a48157397c0f2a60b385466526239777.tar.xz
yuzu-03bf0739a48157397c0f2a60b385466526239777.tar.zst
yuzu-03bf0739a48157397c0f2a60b385466526239777.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/service.cpp10
-rw-r--r--src/core/hle/service/service.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 93a6d2618..826a775d1 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -74,6 +74,16 @@ void ServiceFrameworkBase::InstallAsNamedPort() {
AddNamedPort(service_name, std::move(client_port));
}
+Kernel::SharedPtr<Kernel::ClientPort> ServiceFrameworkBase::CreatePort() {
+ ASSERT(port == nullptr);
+ Kernel::SharedPtr<Kernel::ServerPort> server_port;
+ Kernel::SharedPtr<Kernel::ClientPort> client_port;
+ std::tie(server_port, client_port) = Kernel::ServerPort::CreatePortPair(max_sessions, service_name);
+ port = MakeResult<Kernel::SharedPtr<Kernel::ServerPort>>(std::move(server_port)).Unwrap();
+ port->SetHleHandler(shared_from_this());
+ return client_port;
+}
+
void ServiceFrameworkBase::RegisterHandlersBase(const FunctionInfoBase* functions, size_t n) {
handlers.reserve(handlers.size() + n);
for (size_t i = 0; i < n; ++i) {
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index 07bc8589a..ff76dd2de 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -58,6 +58,8 @@ public:
void InstallAsService(SM::ServiceManager& service_manager);
/// Creates a port pair and registers it on the kernel's global port registry.
void InstallAsNamedPort();
+ /// Creates and returns an unregistered port for the service.
+ Kernel::SharedPtr<Kernel::ClientPort> CreatePort();
void InvokeRequest(Kernel::HLERequestContext& ctx);