cpu.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef ARCH_X86_CPU_H
  2. #define ARCH_X86_CPU_H
  3. /* attempt to consolidate cpu attributes */
  4. struct cpu_dev {
  5. const char *c_vendor;
  6. /* some have two possibilities for cpuid string */
  7. const char *c_ident[2];
  8. void (*c_early_init)(struct cpuinfo_x86 *);
  9. void (*c_bsp_init)(struct cpuinfo_x86 *);
  10. void (*c_init)(struct cpuinfo_x86 *);
  11. void (*c_identify)(struct cpuinfo_x86 *);
  12. void (*c_detect_tlb)(struct cpuinfo_x86 *);
  13. int c_x86_vendor;
  14. #ifdef CONFIG_X86_32
  15. /* Optional vendor specific routine to obtain the cache size. */
  16. unsigned int (*legacy_cache_size)(struct cpuinfo_x86 *,
  17. unsigned int);
  18. /* Family/stepping-based lookup table for model names. */
  19. struct legacy_cpu_model_info {
  20. int family;
  21. const char *model_names[16];
  22. } legacy_models[5];
  23. #endif
  24. };
  25. struct _tlb_table {
  26. unsigned char descriptor;
  27. char tlb_type;
  28. unsigned int entries;
  29. /* unsigned int ways; */
  30. char info[128];
  31. };
  32. #define cpu_dev_register(cpu_devX) \
  33. static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \
  34. __attribute__((__section__(".x86_cpu_dev.init"))) = \
  35. &cpu_devX;
  36. extern const struct cpu_dev *const __x86_cpu_dev_start[],
  37. *const __x86_cpu_dev_end[];
  38. extern void get_cpu_cap(struct cpuinfo_x86 *c);
  39. extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
  40. #endif /* ARCH_X86_CPU_H */