cpu.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. void (*c_bsp_resume)(struct cpuinfo_x86 *);
  14. int c_x86_vendor;
  15. #ifdef CONFIG_X86_32
  16. /* Optional vendor specific routine to obtain the cache size. */
  17. unsigned int (*legacy_cache_size)(struct cpuinfo_x86 *,
  18. unsigned int);
  19. /* Family/stepping-based lookup table for model names. */
  20. struct legacy_cpu_model_info {
  21. int family;
  22. const char *model_names[16];
  23. } legacy_models[5];
  24. #endif
  25. };
  26. struct _tlb_table {
  27. unsigned char descriptor;
  28. char tlb_type;
  29. unsigned int entries;
  30. /* unsigned int ways; */
  31. char info[128];
  32. };
  33. #define cpu_dev_register(cpu_devX) \
  34. static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \
  35. __attribute__((__section__(".x86_cpu_dev.init"))) = \
  36. &cpu_devX;
  37. extern const struct cpu_dev *const __x86_cpu_dev_start[],
  38. *const __x86_cpu_dev_end[];
  39. extern void get_cpu_cap(struct cpuinfo_x86 *c);
  40. extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
  41. extern void x86_spec_ctrl_setup_ap(void);
  42. #endif /* ARCH_X86_CPU_H */