aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso/monotonic_timer.c
blob: 941532cca6231a3758e4c341ed8e83909a76d343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* SPDX-License-Identifier: GPL-2.0-or-later */

#include <cpu/x86/msr.h>
#include <cpu/x86/tsc.h>
#include <timer.h>
#include <timestamp.h>

void timer_monotonic_get(struct mono_time *mt)
{
	mono_time_set_usecs(mt, timestamp_get());
}

uint64_t timestamp_get(void)
{
	return rdtscll() / tsc_freq_mhz();
}