diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 75cefc55..16ea9097 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -673,6 +673,14 @@ Result svcWriteDebugProcessMemory(Handle debug, void* buffer, u64 addr, u64 size ///@name Inter-process communication (IPC) ///@{ + +/** + * @brief Creates a port. + * @return Result code. + * @note Syscall number 0x70. + * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available. + */ +Result svcCreatePort(Handle* portServer, Handle *portClient, s32 max_sessions, bool is_light, const char* name); /** * @brief Manages a named port. diff --git a/nx/source/kernel/svc.s b/nx/source/kernel/svc.s index 5c398b9a..fa5063a0 100644 --- a/nx/source/kernel/svc.s +++ b/nx/source/kernel/svc.s @@ -345,6 +345,17 @@ SVC_BEGIN svcWriteDebugProcessMemory ret SVC_END +SVC_BEGIN svcCreatePort + stp x0, x1, [sp, #-16]! + svc 0x70 + ldr x3, [sp] + str w1, [x3] + ldr x3, [sp, #8] + str w2, [x3] + add sp, sp, #16 + ret +SVC_END + SVC_BEGIN svcManageNamedPort str x0, [sp, #-16]! svc 0x71