ec/google/chromeec: Optimize battery string readout with caching
[coreboot.git] / src / arch / x86 / timestamp.c
blob0a4c9c4ec9b5150ea5fbededbc2604716d521f4a
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <cpu/x86/tsc.h>
4 #include <stdint.h>
5 #include <timestamp.h>
7 uint64_t timestamp_get(void)
9 return rdtscll();
12 int timestamp_tick_freq_mhz(void)
14 /* Chipsets that have a constant TSC provide this value correctly. */
15 if (tsc_constant_rate())
16 return tsc_freq_mhz();
18 /* Filling tick_freq_mhz = 0 in timestamps-table will trigger
19 * userspace utility to try deduce it from the running system.
21 return 0;