cpu.h 1009 B

1234567891011121314151617181920212223242526272829303132333435363738
  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_bsp_init)(struct cpuinfo_x86 *);
  16. void (*c_init)(struct cpuinfo_x86 *);
  17. void (*c_identify)(struct cpuinfo_x86 *);
  18. unsigned int (*c_size_cache)(struct cpuinfo_x86 *, unsigned int);
  19. int c_x86_vendor;
  20. };
  21. #define cpu_dev_register(cpu_devX) \
  22. static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \
  23. __attribute__((__section__(".x86_cpu_dev.init"))) = \
  24. &cpu_devX;
  25. extern const struct cpu_dev *const __x86_cpu_dev_start[],
  26. *const __x86_cpu_dev_end[];
  27. extern void get_cpu_cap(struct cpuinfo_x86 *c);
  28. extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
  29. #endif /* ARCH_X86_CPU_H */