From 85831944e05980109a1abb05cbbfcb6446aaf449 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Fri, 23 Jun 2017 00:07:23 -0700 Subject: [PATCH] Add svcCreateSessionToPort --- libctru/include/3ds/svc.h | 7 +++++++ libctru/source/svc.s | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/libctru/include/3ds/svc.h b/libctru/include/3ds/svc.h index 2ad49f1..baed48a 100644 --- a/libctru/include/3ds/svc.h +++ b/libctru/include/3ds/svc.h @@ -893,6 +893,13 @@ Result svcArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 v */ Result svcSendSyncRequest(Handle session); +/** + * @brief Connects to a port via a handle. + * @param[out] clientSession Pointer to output the client session handle to. + * @param clientPort Port client endpoint to connect to. + */ +Result svcCreateSessionToPort(Handle* clientSession, Handle clientPort); + /** * @brief Creates a linked pair of session endpoints. * @param[out] serverSession Pointer to output the created server endpoint handle to. diff --git a/libctru/source/svc.s b/libctru/source/svc.s index bfc561a..7932ddd 100644 --- a/libctru/source/svc.s +++ b/libctru/source/svc.s @@ -416,6 +416,14 @@ SVC_BEGIN svcCreatePort bx lr SVC_END +SVC_BEGIN svcCreateSessionToPort + push {r0} + svc 0x48 + pop {r2} + str r1, [r2] + bx lr +SVC_END + SVC_BEGIN svcCreateSession push {r0, r1} svc 0x49