cpu.c 562 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include <linux/types.h>
  2. #include <linux/export.h>
  3. unsigned int x86_family(unsigned int sig)
  4. {
  5. unsigned int x86;
  6. x86 = (sig >> 8) & 0xf;
  7. if (x86 == 0xf)
  8. x86 += (sig >> 20) & 0xff;
  9. return x86;
  10. }
  11. EXPORT_SYMBOL_GPL(x86_family);
  12. unsigned int x86_model(unsigned int sig)
  13. {
  14. unsigned int fam, model;
  15. fam = x86_family(sig);
  16. model = (sig >> 4) & 0xf;
  17. if (fam >= 0x6)
  18. model += ((sig >> 16) & 0xf) << 4;
  19. return model;
  20. }
  21. EXPORT_SYMBOL_GPL(x86_model);
  22. unsigned int x86_stepping(unsigned int sig)
  23. {
  24. return sig & 0xf;
  25. }
  26. EXPORT_SYMBOL_GPL(x86_stepping);