diff options
Diffstat (limited to 'arch/i386/kernel/cpu/intel.c')
-rw-r--r-- | arch/i386/kernel/cpu/intel.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/i386/kernel/cpu/intel.c b/arch/i386/kernel/cpu/intel.c index b8d847b850dc..121aa2176e69 100644 --- a/arch/i386/kernel/cpu/intel.c +++ b/arch/i386/kernel/cpu/intel.c | |||
@@ -77,6 +77,27 @@ static void __init Intel_errata_workarounds(struct cpuinfo_x86 *c) | |||
77 | } | 77 | } |
78 | 78 | ||
79 | 79 | ||
80 | /* | ||
81 | * find out the number of processor cores on the die | ||
82 | */ | ||
83 | static int __init num_cpu_cores(struct cpuinfo_x86 *c) | ||
84 | { | ||
85 | unsigned int eax; | ||
86 | |||
87 | if (c->cpuid_level < 4) | ||
88 | return 1; | ||
89 | |||
90 | __asm__("cpuid" | ||
91 | : "=a" (eax) | ||
92 | : "0" (4), "c" (0) | ||
93 | : "bx", "dx"); | ||
94 | |||
95 | if (eax & 0x1f) | ||
96 | return ((eax >> 26) + 1); | ||
97 | else | ||
98 | return 1; | ||
99 | } | ||
100 | |||
80 | static void __init init_intel(struct cpuinfo_x86 *c) | 101 | static void __init init_intel(struct cpuinfo_x86 *c) |
81 | { | 102 | { |
82 | unsigned int l2 = 0; | 103 | unsigned int l2 = 0; |
@@ -139,6 +160,8 @@ static void __init init_intel(struct cpuinfo_x86 *c) | |||
139 | if ( p ) | 160 | if ( p ) |
140 | strcpy(c->x86_model_id, p); | 161 | strcpy(c->x86_model_id, p); |
141 | 162 | ||
163 | c->x86_num_cores = num_cpu_cores(c); | ||
164 | |||
142 | detect_ht(c); | 165 | detect_ht(c); |
143 | 166 | ||
144 | /* Work around errata */ | 167 | /* Work around errata */ |