coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
tsc_freq.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <cpu/x86/msr.h>
4 #include <cpu/x86/tsc.h>
5 
6 #include <soc/cpu.h>
7 #include <soc/msr.h>
8 
9 unsigned long tsc_freq_mhz(void)
10 {
11  msr_t platform_info;
12 
13  platform_info = rdmsr(MSR_PLATFORM_INFO);
14  return CPU_BCLK * ((platform_info.lo >> 8) & 0xff);
15 }
unsigned long tsc_freq_mhz(void)
Definition: tsc_freq.c:14
#define CPU_BCLK
Definition: haswell.h:35
#define MSR_PLATFORM_INFO
Definition: fsb.c:16
static __always_inline msr_t rdmsr(unsigned int index)
Definition: msr.h:146
unsigned int lo
Definition: msr.h:111