diff --git a/nx/include/switch/svc.h b/nx/include/switch/svc.h index 40883af7..5c110975 100644 --- a/nx/include/switch/svc.h +++ b/nx/include/switch/svc.h @@ -18,8 +18,11 @@ static inline void* armGetTls(void) { return ret; } +Result svcCloseHandle(Handle handle); +Result svcWaitSynchronization(s32* index, const Handle* handles, s32 handleCount, u64 timeout); Result svcConnectToNamedPort(Handle* session, const char* name); Result svcBreak(u32 BreakReason, u64 inval1, u64 inval2); +Result svcAcceptSession(Handle *session_handle, Handle port_handle); Result svcReplyAndReceive(s32* index, const Handle* handles, s32 handleCount, Handle replyTarget, u64 timeout); Result svcManageNamedPort(Handle* portServer, const char* name, s32 maxSessions); diff --git a/nx/source/svc.s b/nx/source/svc.s index 510e277e..784953bf 100644 --- a/nx/source/svc.s +++ b/nx/source/svc.s @@ -11,6 +11,19 @@ .cfi_endproc .endm +SVC_BEGIN svcCloseHandle + svc 0x16 + ret +SVC_END + +SVC_BEGIN svcWaitSynchronization + str x0, [sp, #-16]! + svc 0x18 + ldr x2, [sp], #16 + str w1, [x2] + ret +SVC_END + SVC_BEGIN svcConnectToNamedPort str x0, [sp, #-16]! svc 0x1f @@ -24,6 +37,14 @@ SVC_BEGIN svcBreak ret SVC_END +SVC_BEGIN svcAcceptSession + str x0, [sp, #-16]! + svc 0x41 + ldr x2, [sp], #16 + str w1, [x2] + ret +SVC_END + SVC_BEGIN svcReplyAndReceive str x0, [sp, #-16]! svc 0x43