centaur_64.c 739 B

12345678910111213141516171819202122232425262728293031
  1. #include <linux/init.h>
  2. #include <linux/smp.h>
  3. #include <asm/cpufeature.h>
  4. #include <asm/processor.h>
  5. void __cpuinit early_init_centaur(struct cpuinfo_x86 *c)
  6. {
  7. if (c->x86 == 0x6 && c->x86_model >= 0xf)
  8. set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
  9. }
  10. void __cpuinit init_centaur(struct cpuinfo_x86 *c)
  11. {
  12. /* Cache sizes */
  13. unsigned n;
  14. n = c->extended_cpuid_level;
  15. if (n >= 0x80000008) {
  16. unsigned eax = cpuid_eax(0x80000008);
  17. c->x86_virt_bits = (eax >> 8) & 0xff;
  18. c->x86_phys_bits = eax & 0xff;
  19. }
  20. if (c->x86 == 0x6 && c->x86_model >= 0xf) {
  21. c->x86_cache_alignment = c->x86_clflush_size * 2;
  22. set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
  23. set_cpu_cap(c, X86_FEATURE_REP_GOOD);
  24. }
  25. set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
  26. }