x86/CPU: Move x86_cpuinfo::x86_max_cores assignment to detect_num_cpu_cores()
[linux-2.6-block.git] / arch / x86 / kernel / cpu / cpu.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
dcd32b6a 2#ifndef ARCH_X86_CPU_H
dcd32b6a 3#define ARCH_X86_CPU_H
1da177e4 4
1da177e4
LT
5/* attempt to consolidate cpu attributes */
6struct cpu_dev {
f2362e6f 7 const char *c_vendor;
1da177e4
LT
8
9 /* some have two possibilities for cpuid string */
f2362e6f 10 const char *c_ident[2];
1da177e4 11
f2362e6f 12 void (*c_early_init)(struct cpuinfo_x86 *);
a110b5ec 13 void (*c_bsp_init)(struct cpuinfo_x86 *);
f2362e6f
JSR
14 void (*c_init)(struct cpuinfo_x86 *);
15 void (*c_identify)(struct cpuinfo_x86 *);
e0ba94f1 16 void (*c_detect_tlb)(struct cpuinfo_x86 *);
b51ef52d 17 void (*c_bsp_resume)(struct cpuinfo_x86 *);
f2362e6f 18 int c_x86_vendor;
09dc68d9
JB
19#ifdef CONFIG_X86_32
20 /* Optional vendor specific routine to obtain the cache size. */
21 unsigned int (*legacy_cache_size)(struct cpuinfo_x86 *,
22 unsigned int);
23
24 /* Family/stepping-based lookup table for model names. */
25 struct legacy_cpu_model_info {
26 int family;
27 const char *model_names[16];
28 } legacy_models[5];
29#endif
1da177e4
LT
30};
31
e0ba94f1
AS
32struct _tlb_table {
33 unsigned char descriptor;
34 char tlb_type;
35 unsigned int entries;
36 /* unsigned int ways; */
37 char info[128];
38};
39
10a434fc 40#define cpu_dev_register(cpu_devX) \
02dde8b4 41 static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \
10a434fc
YL
42 __attribute__((__section__(".x86_cpu_dev.init"))) = \
43 &cpu_devX;
1da177e4 44
02dde8b4
JB
45extern const struct cpu_dev *const __x86_cpu_dev_start[],
46 *const __x86_cpu_dev_end[];
03ae5768 47
c2b9ff24 48extern void get_cpu_cap(struct cpuinfo_x86 *c);
27c13ece 49extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
b5cf8707
TG
50extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
51extern u32 get_scattered_cpuid_leaf(unsigned int level,
52 unsigned int sub_leaf,
53 enum cpuid_regs_idx reg);
807e9bc8 54extern void init_intel_cacheinfo(struct cpuinfo_x86 *c);
b5cf8707
TG
55extern void init_amd_cacheinfo(struct cpuinfo_x86 *c);
56
9305bd6c 57extern void detect_num_cpu_cores(struct cpuinfo_x86 *c);
b5cf8707
TG
58extern int detect_extended_topology(struct cpuinfo_x86 *c);
59extern void detect_ht(struct cpuinfo_x86 *c);
7d5905dc
RW
60
61unsigned int aperfmperf_get_khz(int cpu);
62
d059f24a 63#endif /* ARCH_X86_CPU_H */