cpu.h 893 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef ARCH_X86_CPU_H
  2. #define ARCH_X86_CPU_H
  3. struct cpu_model_info {
  4. int vendor;
  5. int family;
  6. const char *model_names[16];
  7. };
  8. /* attempt to consolidate cpu attributes */
  9. struct cpu_dev {
  10. const char *c_vendor;
  11. /* some have two possibilities for cpuid string */
  12. const char *c_ident[2];
  13. struct cpu_model_info c_models[4];
  14. void (*c_early_init)(struct cpuinfo_x86 *);
  15. void (*c_init)(struct cpuinfo_x86 *);
  16. void (*c_identify)(struct cpuinfo_x86 *);
  17. unsigned int (*c_size_cache)(struct cpuinfo_x86 *, unsigned int);
  18. int c_x86_vendor;
  19. };
  20. #define cpu_dev_register(cpu_devX) \
  21. static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \
  22. __attribute__((__section__(".x86_cpu_dev.init"))) = \
  23. &cpu_devX;
  24. extern const struct cpu_dev *const __x86_cpu_dev_start[],
  25. *const __x86_cpu_dev_end[];
  26. extern void display_cacheinfo(struct cpuinfo_x86 *c);
  27. #endif