summaryrefslogtreecommitdiff
path: root/Intel
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2011-02-22 18:45:38 -0500
committerDave Jones <davej@redhat.com>2011-02-22 18:45:38 -0500
commit5d82ff4e572c5b8573f8848668feca5555e0e120 (patch)
tree010de136320611510116dbf5d35f2657b334e4a4 /Intel
parentbe19cd5f12fcc827c1c2533bc50902dd2111ff64 (diff)
Fix topology parsing
Diffstat (limited to 'Intel')
-rw-r--r--Intel/info.c2
-rw-r--r--Intel/topology.c19
2 files changed, 12 insertions, 9 deletions
diff --git a/Intel/info.c b/Intel/info.c
index 3a9746f..53f391b 100644
--- a/Intel/info.c
+++ b/Intel/info.c
@@ -139,6 +139,4 @@ void display_Intel_info(struct cpudata *cpu)
if (show_microcode)
decode_microcode(cpu);
-
- show_intel_topology(cpu);
}
diff --git a/Intel/topology.c b/Intel/topology.c
index 8aeb4b2..c6f5eb0 100644
--- a/Intel/topology.c
+++ b/Intel/topology.c
@@ -79,7 +79,7 @@ static int phys_pkg_id(int cpuid_apic, int index_msb)
return cpuid_apic >> index_msb;
}
-void show_intel_topology(struct cpudata *cpu)
+void get_intel_topology(struct cpudata *cpu)
{
unsigned int eax, ebx, ecx, edx;
unsigned int index_msb, core_bits;
@@ -99,7 +99,8 @@ void show_intel_topology(struct cpudata *cpu)
cpu->num_siblings = (ebx & 0xff0000) >> 16;
if (cpu->num_siblings == 1) {
- printf("Hyper-Threading is disabled\n");
+ if (debug)
+ printf("Hyper-Threading is disabled\n");
goto out;
}
@@ -120,10 +121,14 @@ void show_intel_topology(struct cpudata *cpu)
cpu->cpu_core_id = phys_pkg_id(cpu->apicid, index_msb) &
((1 << core_bits) - 1);
-out:
- if ((cpu->x86_max_cores * cpu->num_siblings) > 1) {
- printf("Siblings: %d\n", cpu->num_siblings);
- printf("Physical Processor ID: %d\n", cpu->phys_proc_id);
- printf("Processor Core ID: %d\n", cpu->cpu_core_id);
+ if (debug == 1) {
+ if ((cpu->x86_max_cores * cpu->num_siblings) > 1) {
+ printf("%s:\n", __func__);
+ printf("Siblings: %d\n", cpu->num_siblings);
+ printf("Physical Processor ID: %d\n", cpu->phys_proc_id);
+ printf("Processor Core ID: %d\n", cpu->cpu_core_id);
+ }
}
+out:
+ return;
}