From 8b57aa3092f3f7f278edb44af96ed717db4b6172 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sun, 22 Apr 2018 00:09:05 -0600 Subject: [PATCH] Implement svcConnectToPort --- nx/include/switch/kernel/svc.h | 8 ++++++++ nx/source/kernel/svc.s | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 16ea9097..625537f9 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -690,6 +690,14 @@ Result svcCreatePort(Handle* portServer, Handle *portClient, s32 max_sessions, b */ Result svcManageNamedPort(Handle* portServer, const char* name, s32 maxSessions); +/** + * @brief Manages a named port. + * @return Result code. + * @note Syscall number 0x72. + * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available. + */ +Result svcConnectToPort(Handle* session, Handle port); + ///@} ///@name Memory management diff --git a/nx/source/kernel/svc.s b/nx/source/kernel/svc.s index 3622e867..d338a5ba 100644 --- a/nx/source/kernel/svc.s +++ b/nx/source/kernel/svc.s @@ -364,6 +364,14 @@ SVC_BEGIN svcManageNamedPort ret SVC_END +SVC_BEGIN svcConnectToPort + str x0, [sp, #-16]! + svc 0x72 + ldr x2, [sp], #16 + str w1, [x2] + ret +SVC_END + SVC_BEGIN svcSetProcessMemoryPermission svc 0x73 ret