blob: 4041c24ae7db96bce1095be8d94a7814e70108dd [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
4struct cpu_model_info {
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +05305 int vendor;
6 int family;
7 const char *model_names[16];
Linus Torvalds1da177e2005-04-16 15:20:36 -07008};
9
10/* attempt to consolidate cpu attributes */
11struct cpu_dev {
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +053012 const char *c_vendor;
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
14 /* some have two possibilities for cpuid string */
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +053015 const char *c_ident[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
17 struct cpu_model_info c_models[4];
18
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +053019 void (*c_early_init)(struct cpuinfo_x86 *);
Borislav Petkova110b5e2011-08-05 20:01:16 +020020 void (*c_bsp_init)(struct cpuinfo_x86 *);
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +053021 void (*c_init)(struct cpuinfo_x86 *);
22 void (*c_identify)(struct cpuinfo_x86 *);
Alex Shie0ba94f2012-06-28 09:02:16 +080023 void (*c_detect_tlb)(struct cpuinfo_x86 *);
Jaswinder Singh Rajputf2362e62009-03-23 02:06:51 +053024 unsigned int (*c_size_cache)(struct cpuinfo_x86 *, unsigned int);
25 int c_x86_vendor;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026};
27
Alex Shie0ba94f2012-06-28 09:02:16 +080028struct _tlb_table {
29 unsigned char descriptor;
30 char tlb_type;
31 unsigned int entries;
32 /* unsigned int ways; */
33 char info[128];
34};
35
Yinghai Lu10a434f2008-09-04 21:09:45 +020036#define cpu_dev_register(cpu_devX) \
Jan Beulich02dde8b2009-03-12 12:08:49 +000037 static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \
Yinghai Lu10a434f2008-09-04 21:09:45 +020038 __attribute__((__section__(".x86_cpu_dev.init"))) = \
39 &cpu_devX;
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
Jan Beulich02dde8b2009-03-12 12:08:49 +000041extern const struct cpu_dev *const __x86_cpu_dev_start[],
42 *const __x86_cpu_dev_end[];
Thomas Petazzoni03ae5762008-02-15 12:00:23 +010043
H. Peter Anvinc2b9ff22010-09-20 18:01:46 -070044extern void get_cpu_cap(struct cpuinfo_x86 *c);
Borislav Petkov27c13ec2009-11-21 14:01:45 +010045extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
Borislav Petkovd059f242011-11-29 20:14:43 +010046#endif /* ARCH_X86_CPU_H */