From cfe87868f496cef91b169790e1bbddc960c1a9ad Mon Sep 17 00:00:00 2001 From: yellows8 Date: Sat, 9 Sep 2017 22:10:53 -0400 Subject: [PATCH] Added svcQueryMemory. --- nx/include/switch/svc.h | 1 + nx/source/svc.s | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/nx/include/switch/svc.h b/nx/include/switch/svc.h index 8900f2e0..e9f3bcc7 100644 --- a/nx/include/switch/svc.h +++ b/nx/include/switch/svc.h @@ -18,6 +18,7 @@ static inline void* armGetTls(void) { return ret; } +Result svcQueryMemory(u32 *meminfo_ptr, u32 *pageinfo, u64 addr); Result svcCloseHandle(Handle handle); Result svcWaitSynchronization(s32* index, const Handle* handles, s32 handleCount, u64 timeout); Result svcConnectToNamedPort(Handle* session, const char* name); diff --git a/nx/source/svc.s b/nx/source/svc.s index 75cc03f0..cbb27e63 100644 --- a/nx/source/svc.s +++ b/nx/source/svc.s @@ -11,6 +11,14 @@ .cfi_endproc .endm +SVC_BEGIN svcQueryMemory + str x1, [sp, #-16]! + svc 0x6 + ldr x2, [sp], #16 + str w1, [x2] + ret +SVC_END + SVC_BEGIN svcCloseHandle svc 0x16 ret