diff --git a/sys/arm64/time.c b/sys/arm64/time.c index 8eec58a..f1f89cb 100644 --- a/sys/arm64/time.c +++ b/sys/arm64/time.c @@ -12,7 +12,17 @@ uint64_t Time_GetTSC() { - return 0; + uint64_t ui; + asm volatile("mrs %0, CNTVCT_EL0" : "=&r" (ui)); + return ui; +} + +uint64_t +Time_GetTSCFreq() +{ + uint64_t ui; + asm volatile("mrs %0, CNTFRQ_EL0" : "=&r" (ui)); + return ui; } static void