From c64f8bcc600a60da47f1d0999b8b5c132881e602 Mon Sep 17 00:00:00 2001 From: Xorg Date: Thu, 16 Jun 2016 12:22:04 +0200 Subject: [PATCH 1/3] Ignore more files in repo --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 5f12445..4ac28b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*~ *.lo *.la *.o @@ -26,5 +27,6 @@ install-sh libcpuid.pc libcpuid/docs libcpuid/Doxyfile +libcpuid/doxyfile.stamp ar-lib compile From bc84f0c71d5778b86295d0be1d2eab4629c45368 Mon Sep 17 00:00:00 2001 From: Xorg Date: Thu, 16 Jun 2016 12:40:41 +0200 Subject: [PATCH 2/3] cpu_msrinfo(): Fix value of CPU_INVALID_VALUE in 'double' subfunctions It returns 0x7FFFFFFF instead of 0x3FFFFFFF 0x3FFFFFFF is a 29-bit value, but become a 36-bit value when multiplied by 100, causing a value out-of-range --- libcpuid/rdmsr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libcpuid/rdmsr.c b/libcpuid/rdmsr.c index 788bb10..e2dc8a2 100644 --- a/libcpuid/rdmsr.c +++ b/libcpuid/rdmsr.c @@ -616,7 +616,7 @@ static double get_info_min_multiplier(struct msr_driver_t* handle, struct cpu_id if (!err) return reg; } - return CPU_INVALID_VALUE; + return (double) CPU_INVALID_VALUE / 100; } static double get_info_cur_multiplier(struct msr_driver_t* handle, struct cpu_id_t *id, @@ -645,7 +645,7 @@ static double get_info_cur_multiplier(struct msr_driver_t* handle, struct cpu_id if (!err) return reg; } - return CPU_INVALID_VALUE; + return (double) CPU_INVALID_VALUE / 100; } static double get_info_max_multiplier(struct msr_driver_t* handle, struct cpu_id_t *id, @@ -685,7 +685,7 @@ static double get_info_max_multiplier(struct msr_driver_t* handle, struct cpu_id if (!err) return reg; } - return CPU_INVALID_VALUE; + return (double) CPU_INVALID_VALUE / 100; } static int get_info_temperature(struct msr_driver_t* handle, struct cpu_id_t *id, @@ -740,7 +740,7 @@ static double get_info_voltage(struct msr_driver_t* handle, struct cpu_id_t *id, if (!err && MSR_PSTATE_0 + reg <= MSR_PSTATE_7) return 1.550 - 0.0125 * CpuVid; } - return CPU_INVALID_VALUE; + return (double) CPU_INVALID_VALUE / 100; } static double get_info_bus_clock(struct msr_driver_t* handle, struct cpu_id_t *id, @@ -775,7 +775,7 @@ static double get_info_bus_clock(struct msr_driver_t* handle, struct cpu_id_t *i if (!err) return (double) clock / reg; } - return CPU_INVALID_VALUE; + return (double) CPU_INVALID_VALUE / 100; } int cpu_rdmsr_range(struct msr_driver_t* handle, uint32_t msr_index, uint8_t highbit, From 298539b4b04b2de43ff9628e1969b6afdd49b884 Mon Sep 17 00:00:00 2001 From: Xorg Date: Thu, 16 Jun 2016 12:58:42 +0200 Subject: [PATCH 3/3] Add Athlon 64 FX X2 (Toledo) in database --- libcpuid/recog_amd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libcpuid/recog_amd.c b/libcpuid/recog_amd.c index 058d0a4..2e6c8a9 100644 --- a/libcpuid/recog_amd.c +++ b/libcpuid/recog_amd.c @@ -115,6 +115,7 @@ const struct match_entry_t cpudb_amd[] = { { 15, -1, -1, 15, -1, 1, 1024, -1, ATHLON_64 , 0, "Athlon 64 (1024K)" }, { 15, -1, -1, 15, -1, 1, -1, -1, ATHLON_FX , 0, "Athlon FX" }, { 15, -1, -1, 15, -1, 1, -1, -1, ATHLON_64_FX , 0, "Athlon 64 FX" }, + { 15, 3, -1, 15, 35, 2, -1, -1, ATHLON_64_FX , 0, "Athlon 64 FX X2 (Toledo)" }, { 15, -1, -1, 15, -1, 2, 512, -1, ATHLON_64_X2 , 0, "Athlon 64 X2 (512K)" }, { 15, -1, -1, 15, -1, 2, 1024, -1, ATHLON_64_X2 , 0, "Athlon 64 X2 (1024K)" }, { 15, -1, -1, 15, -1, 1, 512, -1, TURION_64 , 0, "Turion 64 (512K)" },