cpu.h 1009 字节
Newer Older
1 2
#ifndef ARCH_X86_CPU_H
#define ARCH_X86_CPU_H
L
Linus Torvalds 已提交
3 4

struct cpu_model_info {
J
Jaswinder Singh Rajput 已提交
5 6 7
	int		vendor;
	int		family;
	const char	*model_names[16];
L
Linus Torvalds 已提交
8 9 10 11
};

/* attempt to consolidate cpu attributes */
struct cpu_dev {
J
Jaswinder Singh Rajput 已提交
12
	const char	*c_vendor;
L
Linus Torvalds 已提交
13 14

	/* some have two possibilities for cpuid string */
J
Jaswinder Singh Rajput 已提交
15
	const char	*c_ident[2];
L
Linus Torvalds 已提交
16 17 18

	struct		cpu_model_info c_models[4];

J
Jaswinder Singh Rajput 已提交
19
	void            (*c_early_init)(struct cpuinfo_x86 *);
B
Borislav Petkov 已提交
20
	void		(*c_bsp_init)(struct cpuinfo_x86 *);
J
Jaswinder Singh Rajput 已提交
21 22 23 24
	void		(*c_init)(struct cpuinfo_x86 *);
	void		(*c_identify)(struct cpuinfo_x86 *);
	unsigned int	(*c_size_cache)(struct cpuinfo_x86 *, unsigned int);
	int		c_x86_vendor;
L
Linus Torvalds 已提交
25 26
};

Y
Yinghai Lu 已提交
27
#define cpu_dev_register(cpu_devX) \
28
	static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \
Y
Yinghai Lu 已提交
29 30
	__attribute__((__section__(".x86_cpu_dev.init"))) = \
	&cpu_devX;
L
Linus Torvalds 已提交
31

32 33
extern const struct cpu_dev *const __x86_cpu_dev_start[],
			    *const __x86_cpu_dev_end[];
34

35
extern void get_cpu_cap(struct cpuinfo_x86 *c);
36
extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
37
#endif /* ARCH_X86_CPU_H */