From 9059fb6ff558b03bcb590281a8b60c98cf789322 Mon Sep 17 00:00:00 2001 From: Xorg Date: Sat, 4 Jun 2016 20:31:01 +0200 Subject: [PATCH] Add INFO_BUS_CLOCK in cpu_msrinfo() as a more generic term (same as INFO_BCLK) BCLK is specific to Intel --- libcpuid/libcpuid.h | 8 +++++--- libcpuid/rdmsr.c | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libcpuid/libcpuid.h b/libcpuid/libcpuid.h index 1eb9105..7ac2adf 100644 --- a/libcpuid/libcpuid.h +++ b/libcpuid/libcpuid.h @@ -902,9 +902,11 @@ typedef enum { INFO_THROTTLING, /*!< 1 if the current logical processor is throttling. 0 if it is running normally. */ INFO_VOLTAGE, /*!< The current core voltage in Volt, - multiplied by 100. */ - INFO_BCLK, /*!< The BCLK (base clock) in MHz, - multiplied by 100. */ + multiplied by 100. */ + INFO_BCLK, /*!< See \ref INFO_BUS_CLOCK. */ + INFO_BUS_CLOCK, /*!< The main bus clock in MHz, + e.g., FSB/QPI/DMI/HT base clock, + multiplied by 100. */ } cpu_msrinfo_request_t; /** diff --git a/libcpuid/rdmsr.c b/libcpuid/rdmsr.c index 1794c3d..f2ba34c 100644 --- a/libcpuid/rdmsr.c +++ b/libcpuid/rdmsr.c @@ -700,8 +700,8 @@ static double get_info_voltage(struct msr_driver_t* handle, struct cpu_id_t *id, return CPU_INVALID_VALUE; } -static double get_info_bclk(struct msr_driver_t* handle, struct cpu_id_t *id, - struct internal_id_info_t *internal) +static double get_info_bus_clock(struct msr_driver_t* handle, struct cpu_id_t *id, + struct internal_id_info_t *internal) { int err; static int clock = 0; @@ -789,7 +789,8 @@ int cpu_msrinfo(struct msr_driver_t* handle, cpu_msrinfo_request_t which) case INFO_VOLTAGE: return get_info_voltage(handle, &id, &internal) * 100; case INFO_BCLK: - return get_info_bclk(handle, &id, &internal) * 100; + case INFO_BUS_CLOCK: + return get_info_bus_clock(handle, &id, &internal) * 100; default: return CPU_INVALID_VALUE; }