cpu.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef ARCH_X86_CPU_H
  2. #define ARCH_X86_CPU_H
  3. struct cpu_model_info {
  4. int vendor;
  5. int family;
  6. char *model_names[16];
  7. };
  8. /* attempt to consolidate cpu attributes */
  9. struct cpu_dev {
  10. char * c_vendor;
  11. /* some have two possibilities for cpuid string */
  12. char * c_ident[2];
  13. struct cpu_model_info c_models[4];
  14. void (*c_early_init)(struct cpuinfo_x86 *c);
  15. void (*c_init)(struct cpuinfo_x86 * c);
  16. void (*c_identify)(struct cpuinfo_x86 * c);
  17. unsigned int (*c_size_cache)(struct cpuinfo_x86 * c, unsigned int size);
  18. };
  19. extern struct cpu_dev * cpu_devs [X86_VENDOR_NUM];
  20. struct cpu_vendor_dev {
  21. int vendor;
  22. struct cpu_dev *cpu_dev;
  23. };
  24. #define cpu_vendor_dev_register(cpu_vendor_id, cpu_dev) \
  25. static struct cpu_vendor_dev __cpu_vendor_dev_##cpu_vendor_id __used \
  26. __attribute__((__section__(".x86cpuvendor.init"))) = \
  27. { cpu_vendor_id, cpu_dev }
  28. extern struct cpu_vendor_dev __x86cpuvendor_start[], __x86cpuvendor_end[];
  29. extern int get_model_name(struct cpuinfo_x86 *c);
  30. extern void display_cacheinfo(struct cpuinfo_x86 *c);
  31. #endif