blob: 3b19d82f7932c0e28716b5bdb23e2a93eeaafb11 [file] [log] [blame]
Yinghai Ludcd32b62008-06-20 08:18:09 +02001#ifndef ARCH_X86_CPU_H
Yinghai Ludcd32b62008-06-20 08:18:09 +02002#define ARCH_X86_CPU_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
Linus Torvalds1da177e2005-04-16 15:20:36 -07004/* attempt to consolidate cpu attributes */
5struct cpu_dev {
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +05306 const char *c_vendor;
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
8 /* some have two possibilities for cpuid string */
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +05309 const char *c_ident[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +053011 void (*c_early_init)(struct cpuinfo_x86 *);
Borislav Petkova110b5e2011-08-05 20:01:16 +020012 void (*c_bsp_init)(struct cpuinfo_x86 *);
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +053013 void (*c_init)(struct cpuinfo_x86 *);
14 void (*c_identify)(struct cpuinfo_x86 *);
Alex Shie0ba94f2012-06-28 09:02:16 +080015 void (*c_detect_tlb)(struct cpuinfo_x86 *);
Laura Abbottb51ef522015-07-20 14:47:58 -070016 void (*c_bsp_resume)(struct cpuinfo_x86 *);
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +053017 int c_x86_vendor;
Jan Beulich09dc68d2013-10-21 09:35:20 +010018#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 Torvalds1da177e2005-04-16 15:20:36 -070029};
30
Alex Shie0ba94f2012-06-28 09:02:16 +080031struct _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 Lu10a434f2008-09-04 21:09:45 +020039#define cpu_dev_register(cpu_devX) \
Jan Beulich02dde8b2009-03-12 12:08:49 +000040 static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \
Yinghai Lu10a434f2008-09-04 21:09:45 +020041 __attribute__((__section__(".x86_cpu_dev.init"))) = \
42 &cpu_devX;
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
Jan Beulich02dde8b2009-03-12 12:08:49 +000044extern const struct cpu_dev *const __x86_cpu_dev_start[],
45 *const __x86_cpu_dev_end[];
Thomas Petazzoni03ae5762008-02-15 12:00:23 +010046
H. Peter Anvinc2b9ff22010-09-20 18:01:46 -070047extern void get_cpu_cap(struct cpuinfo_x86 *c);
Borislav Petkov27c13ec2009-11-21 14:01:45 +010048extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
Konrad Rzeszutek Wilk19e3a2b2018-04-25 22:04:22 -040049
50extern void x86_spec_ctrl_setup_ap(void);
51
Borislav Petkovd059f242011-11-29 20:14:43 +010052#endif /* ARCH_X86_CPU_H */