coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
monotonic_timer.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3
#include <
cpu/x86/msr.h
>
4
#include <
cpu/x86/tsc.h
>
5
#include <timer.h>
6
#include <
timestamp.h
>
7
8
void
timer_monotonic_get
(
struct
mono_time
*mt)
9
{
10
mono_time_set_usecs
(mt,
timestamp_get
());
11
}
12
13
uint64_t
timestamp_get
(
void
)
14
{
15
return
rdtscll
() /
tsc_freq_mhz
();
16
}
timestamp_get
uint64_t timestamp_get(void)
Definition:
monotonic_timer.c:13
timer_monotonic_get
void timer_monotonic_get(struct mono_time *mt)
Definition:
monotonic_timer.c:8
tsc_freq_mhz
unsigned long tsc_freq_mhz(void)
Definition:
fsb.c:118
msr.h
mono_time_set_usecs
static void mono_time_set_usecs(struct mono_time *mt, long us)
Definition:
timer.h:53
uint64_t
unsigned long long uint64_t
Definition:
stdint.h:17
mono_time
Definition:
timer.h:19
timestamp.h
tsc.h
rdtscll
static unsigned long long rdtscll(void)
Definition:
tsc.h:49
src
soc
amd
common
block
cpu
tsc
monotonic_timer.c
Generated by
1.9.1