cpu.h 1008 B

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