From ce23a139f4eeee455aecd407af24d8a6ce3525de Mon Sep 17 00:00:00 2001 From: fincs Date: Fri, 24 Aug 2018 16:28:59 +0200 Subject: [PATCH] arm/counter.h: add armGetSystemTickFreq --- nx/include/switch/arm/counter.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nx/include/switch/arm/counter.h b/nx/include/switch/arm/counter.h index b54e092a..cdcf3186 100644 --- a/nx/include/switch/arm/counter.h +++ b/nx/include/switch/arm/counter.h @@ -16,3 +16,13 @@ static inline u64 armGetSystemTick(void) { __asm__ __volatile__ ("mrs %x[data], cntpct_el0" : [data] "=r" (ret)); return ret; } + +/** + * @brief Gets the system counter-timer frequency + * @return The system counter-timer frequency, in Hz. + */ +static inline u64 armGetSystemTickFreq(void) { + u64 ret; + __asm__ ("mrs %x[data], cntfrq_el0" : [data] "=r" (ret)); + return ret; +}