Merge branches 'x86/numa-fixes', 'x86/apic', 'x86/apm', 'x86/bitops', 'x86/build...
[linux-2.6-block.git] / arch / x86 / kernel / cpu / centaur_64.c
1 #include <linux/init.h>
2 #include <linux/smp.h>
3
4 #include <asm/cpufeature.h>
5 #include <asm/processor.h>
6
7 #include "cpu.h"
8
9 static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c)
10 {
11         if (c->x86 == 0x6 && c->x86_model >= 0xf)
12                 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
13 }
14
15 static void __cpuinit init_centaur(struct cpuinfo_x86 *c)
16 {
17         /* Cache sizes */
18         unsigned n;
19
20         n = c->extended_cpuid_level;
21         if (n >= 0x80000008) {
22                 unsigned eax = cpuid_eax(0x80000008);
23                 c->x86_virt_bits = (eax >> 8) & 0xff;
24                 c->x86_phys_bits = eax & 0xff;
25         }
26
27         if (c->x86 == 0x6 && c->x86_model >= 0xf) {
28                 c->x86_cache_alignment = c->x86_clflush_size * 2;
29                 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
30                 set_cpu_cap(c, X86_FEATURE_REP_GOOD);
31         }
32         set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
33 }
34
35 static struct cpu_dev centaur_cpu_dev __cpuinitdata = {
36         .c_vendor       = "Centaur",
37         .c_ident        = { "CentaurHauls" },
38         .c_early_init   = early_init_centaur,
39         .c_init         = init_centaur,
40 };
41
42 cpu_vendor_dev_register(X86_VENDOR_CENTAUR, &centaur_cpu_dev);
43