aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/monotonic_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/stoneyridge/monotonic_timer.c')
-rw-r--r--src/soc/amd/stoneyridge/monotonic_timer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/soc/amd/stoneyridge/monotonic_timer.c b/src/soc/amd/stoneyridge/monotonic_timer.c
index 170a640233..7ea571f635 100644
--- a/src/soc/amd/stoneyridge/monotonic_timer.c
+++ b/src/soc/amd/stoneyridge/monotonic_timer.c
@@ -15,12 +15,18 @@
#include <cpu/x86/msr.h>
#include <timer.h>
+#include <timestamp.h>
#define CU_PTSC_MSR 0xc0010280
#define PTSC_FREQ_MHZ 100
void timer_monotonic_get(struct mono_time *mt)
{
+ mono_time_set_usecs(mt, timestamp_get());
+}
+
+uint64_t timestamp_get(void)
+{
unsigned long long val;
msr_t msr;
@@ -28,5 +34,5 @@ void timer_monotonic_get(struct mono_time *mt)
val = ((unsigned long long)msr.hi << 32) | msr.lo;
- mono_time_set_usecs(mt, val / PTSC_FREQ_MHZ);
+ return val / PTSC_FREQ_MHZ;
}