Yinghai Lu | dcd32b6 | 2008-06-20 08:18:09 +0200 | [diff] [blame] | 1 | #ifndef ARCH_X86_CPU_H |
| 2 | |
| 3 | #define ARCH_X86_CPU_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
| 5 | struct cpu_model_info { |
Jaswinder Singh Rajput | f2362e6 | 2009-03-23 02:06:51 +0530 | [diff] [blame] | 6 | int vendor; |
| 7 | int family; |
| 8 | const char *model_names[16]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | }; |
| 10 | |
| 11 | /* attempt to consolidate cpu attributes */ |
| 12 | struct cpu_dev { |
Jaswinder Singh Rajput | f2362e6 | 2009-03-23 02:06:51 +0530 | [diff] [blame] | 13 | const char *c_vendor; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
| 15 | /* some have two possibilities for cpuid string */ |
Jaswinder Singh Rajput | f2362e6 | 2009-03-23 02:06:51 +0530 | [diff] [blame] | 16 | const char *c_ident[2]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
| 18 | struct cpu_model_info c_models[4]; |
| 19 | |
Jaswinder Singh Rajput | f2362e6 | 2009-03-23 02:06:51 +0530 | [diff] [blame] | 20 | void (*c_early_init)(struct cpuinfo_x86 *); |
| 21 | void (*c_init)(struct cpuinfo_x86 *); |
| 22 | void (*c_identify)(struct cpuinfo_x86 *); |
| 23 | unsigned int (*c_size_cache)(struct cpuinfo_x86 *, unsigned int); |
| 24 | int c_x86_vendor; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | }; |
| 26 | |
Yinghai Lu | 10a434f | 2008-09-04 21:09:45 +0200 | [diff] [blame] | 27 | #define cpu_dev_register(cpu_devX) \ |
Jan Beulich | 02dde8b | 2009-03-12 12:08:49 +0000 | [diff] [blame] | 28 | static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \ |
Yinghai Lu | 10a434f | 2008-09-04 21:09:45 +0200 | [diff] [blame] | 29 | __attribute__((__section__(".x86_cpu_dev.init"))) = \ |
| 30 | &cpu_devX; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | |
Jan Beulich | 02dde8b | 2009-03-12 12:08:49 +0000 | [diff] [blame] | 32 | extern const struct cpu_dev *const __x86_cpu_dev_start[], |
| 33 | *const __x86_cpu_dev_end[]; |
Thomas Petazzoni | 03ae576 | 2008-02-15 12:00:23 +0100 | [diff] [blame] | 34 | |
Borislav Petkov | 27c13ec | 2009-11-21 14:01:45 +0100 | [diff] [blame] | 35 | extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); |
Robert Richter | 9e26d84 | 2008-06-06 12:01:13 +0200 | [diff] [blame] | 36 | |
Yinghai Lu | dcd32b6 | 2008-06-20 08:18:09 +0200 | [diff] [blame] | 37 | #endif |