coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
voltage.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 <smbios.h>
5 
6 /* This is not an architectural MSR. */
7 #define MSR_PERF_STATUS 0x198
8 
9 unsigned int smbios_cpu_get_voltage(void)
10 {
11  return (rdmsr(MSR_PERF_STATUS).hi & 0xffff) * 10 / 8192;
12 }
static __always_inline msr_t rdmsr(unsigned int index)
Definition: msr.h:146
#define MSR_PERF_STATUS
Definition: voltage.c:7
unsigned int smbios_cpu_get_voltage(void)
Definition: voltage.c:9