Kangheui Won | 9f7df5c1 | 2020-10-04 21:12:06 +1100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
2 | |||||
Kangheui Won | 9f7df5c1 | 2020-10-04 21:12:06 +1100 | [diff] [blame] | 3 | #include <cpu/x86/tsc.h> |
4 | #include <timer.h> | ||||
5 | #include <timestamp.h> | ||||
6 | |||||
7 | void timer_monotonic_get(struct mono_time *mt) | ||||
8 | { | ||||
9 | mono_time_set_usecs(mt, timestamp_get()); | ||||
10 | } | ||||
11 | |||||
12 | uint64_t timestamp_get(void) | ||||
13 | { | ||||
14 | return rdtscll() / tsc_freq_mhz(); | ||||
15 | } |