From b888683df8ee2c962e29de4ab94283983c26e4fa Mon Sep 17 00:00:00 2001 From: Veselin Georgiev Date: Tue, 18 Nov 2008 13:18:04 +0000 Subject: [PATCH] Fixed a semantic bug - reported number of logical cpus were per-core, not total. Fixed git-svn-id: https://svn.code.sf.net/p/libcpuid/code/HEAD/libcpuid@13 3b4be424-7ac5-41d7-8526-f4ddcb85d872 --- libcpuid/recog_amd.c | 2 +- libcpuid/recog_intel.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libcpuid/recog_amd.c b/libcpuid/recog_amd.c index 917aa84..3ada1f9 100644 --- a/libcpuid/recog_amd.c +++ b/libcpuid/recog_amd.c @@ -226,7 +226,7 @@ static void decode_amd_number_of_cores(struct cpu_raw_data_t* raw, struct cpu_id if (data->flags[CPU_FEATURE_HT]) { if (num_cores > 1) { data->num_cores = num_cores; - data->num_logical_cpus = logical_cpus / num_cores; + data->num_logical_cpus = logical_cpus; } else { data->num_cores = 1; data->num_logical_cpus = (logical_cpus >= 2 ? logical_cpus : 2); diff --git a/libcpuid/recog_intel.c b/libcpuid/recog_intel.c index c803c3a..8a27f4c 100644 --- a/libcpuid/recog_intel.c +++ b/libcpuid/recog_intel.c @@ -399,7 +399,7 @@ static void decode_intel_number_of_cores(struct cpu_raw_data_t* raw, if (data->flags[CPU_FEATURE_HT]) { if (num_cores > 1) { data->num_cores = num_cores; - data->num_logical_cpus = logical_cpus / num_cores; + data->num_logical_cpus = logical_cpus; } else { data->num_cores = 1; data->num_logical_cpus = (logical_cpus >= 2 ? logical_cpus : 2);