From 74b295827f076a57765b3f5978e5cd86521c2c05 Mon Sep 17 00:00:00 2001 From: fincs Date: Tue, 1 Dec 2020 13:49:15 +0100 Subject: [PATCH] Add svcGetResourceLimitPeakValue [11.0.0+] --- nx/include/switch/kernel/svc.h | 13 +++++++++++++ nx/source/kernel/svc.s | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 046345d0..a2deb302 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -815,6 +815,19 @@ void svcSynchronizePreemptionState(void); ///@} +///@name Resource Limit Management +///@{ + +/** + * @brief Gets the peak value a LimitableResource has had, for a Resource Limit handle. [11.0.0+] + * @return Result code. + * @note Syscall number 0x37. + * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available. + */ +Result svcGetResourceLimitPeakValue(s64 *out, Handle reslimit_h, LimitableResource which); + +///@} + ///@name Debugging ///@{ /** diff --git a/nx/source/kernel/svc.s b/nx/source/kernel/svc.s index 20003405..e7e2f045 100644 --- a/nx/source/kernel/svc.s +++ b/nx/source/kernel/svc.s @@ -337,6 +337,14 @@ SVC_BEGIN svcSynchronizePreemptionState ret SVC_END +SVC_BEGIN svcGetResourceLimitPeakValue + str x0, [sp, #-16]! + svc 0x37 + ldr x2, [sp], #16 + str x1, [x2] + ret +SVC_END + SVC_BEGIN svcDumpInfo svc 0x3C ret