Yinghai Lu | dcd32b6 | 2008-06-20 08:18:09 +0200 | [diff] [blame] | 1 | #ifndef ARCH_X86_CPU_H |
Yinghai Lu | dcd32b6 | 2008-06-20 08:18:09 +0200 | [diff] [blame] | 2 | #define ARCH_X86_CPU_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | /* attempt to consolidate cpu attributes */ |
| 5 | struct cpu_dev { |
Jaswinder Singh Rajput | f2362e6 | 2009-03-23 02:06:51 +0530 | [diff] [blame] | 6 | const char *c_vendor; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
| 8 | /* some have two possibilities for cpuid string */ |
Jaswinder Singh Rajput | f2362e6 | 2009-03-23 02:06:51 +0530 | [diff] [blame] | 9 | const char *c_ident[2]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | |
Jaswinder Singh Rajput | f2362e6 | 2009-03-23 02:06:51 +0530 | [diff] [blame] | 11 | void (*c_early_init)(struct cpuinfo_x86 *); |
Borislav Petkov | a110b5e | 2011-08-05 20:01:16 +0200 | [diff] [blame] | 12 | void (*c_bsp_init)(struct cpuinfo_x86 *); |
Jaswinder Singh Rajput | f2362e6 | 2009-03-23 02:06:51 +0530 | [diff] [blame] | 13 | void (*c_init)(struct cpuinfo_x86 *); |
| 14 | void (*c_identify)(struct cpuinfo_x86 *); |
Alex Shi | e0ba94f | 2012-06-28 09:02:16 +0800 | [diff] [blame] | 15 | void (*c_detect_tlb)(struct cpuinfo_x86 *); |
Laura Abbott | b51ef52 | 2015-07-20 14:47:58 -0700 | [diff] [blame] | 16 | void (*c_bsp_resume)(struct cpuinfo_x86 *); |
Jaswinder Singh Rajput | f2362e6 | 2009-03-23 02:06:51 +0530 | [diff] [blame] | 17 | int c_x86_vendor; |
Jan Beulich | 09dc68d | 2013-10-21 09:35:20 +0100 | [diff] [blame] | 18 | #ifdef CONFIG_X86_32 |
| 19 | /* Optional vendor specific routine to obtain the cache size. */ |
| 20 | unsigned int (*legacy_cache_size)(struct cpuinfo_x86 *, |
| 21 | unsigned int); |
| 22 | |
| 23 | /* Family/stepping-based lookup table for model names. */ |
| 24 | struct legacy_cpu_model_info { |
| 25 | int family; |
| 26 | const char *model_names[16]; |
| 27 | } legacy_models[5]; |
| 28 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | }; |
| 30 | |
Alex Shi | e0ba94f | 2012-06-28 09:02:16 +0800 | [diff] [blame] | 31 | struct _tlb_table { |
| 32 | unsigned char descriptor; |
| 33 | char tlb_type; |
| 34 | unsigned int entries; |
| 35 | /* unsigned int ways; */ |
| 36 | char info[128]; |
| 37 | }; |
| 38 | |
Yinghai Lu | 10a434f | 2008-09-04 21:09:45 +0200 | [diff] [blame] | 39 | #define cpu_dev_register(cpu_devX) \ |
Jan Beulich | 02dde8b | 2009-03-12 12:08:49 +0000 | [diff] [blame] | 40 | static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \ |
Yinghai Lu | 10a434f | 2008-09-04 21:09:45 +0200 | [diff] [blame] | 41 | __attribute__((__section__(".x86_cpu_dev.init"))) = \ |
| 42 | &cpu_devX; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
Jan Beulich | 02dde8b | 2009-03-12 12:08:49 +0000 | [diff] [blame] | 44 | extern const struct cpu_dev *const __x86_cpu_dev_start[], |
| 45 | *const __x86_cpu_dev_end[]; |
Thomas Petazzoni | 03ae576 | 2008-02-15 12:00:23 +0100 | [diff] [blame] | 46 | |
H. Peter Anvin | c2b9ff2 | 2010-09-20 18:01:46 -0700 | [diff] [blame] | 47 | extern void get_cpu_cap(struct cpuinfo_x86 *c); |
Borislav Petkov | 27c13ec | 2009-11-21 14:01:45 +0100 | [diff] [blame] | 48 | extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); |
Borislav Petkov | d059f24 | 2011-11-29 20:14:43 +0100 | [diff] [blame] | 49 | #endif /* ARCH_X86_CPU_H */ |