arm/counter.h: add armGetSystemTickFreq

This commit is contained in:
fincs 2018-08-24 16:28:59 +02:00
parent 68a77ac950
commit ce23a139f4

View File

@ -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;
}