diff options
Diffstat (limited to 'include/asm-x86/processor.h')
-rw-r--r-- | include/asm-x86/processor.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index 8b56c23f043d..2b896b0aa3fa 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h | |||
@@ -10,6 +10,9 @@ struct mm_struct; | |||
10 | #include <asm/page.h> | 10 | #include <asm/page.h> |
11 | #include <asm/percpu.h> | 11 | #include <asm/percpu.h> |
12 | #include <asm/system.h> | 12 | #include <asm/system.h> |
13 | #include <asm/percpu.h> | ||
14 | #include <linux/cpumask.h> | ||
15 | #include <linux/cache.h> | ||
13 | 16 | ||
14 | /* | 17 | /* |
15 | * Default implementation of macro that returns current | 18 | * Default implementation of macro that returns current |
@@ -30,6 +33,85 @@ static inline void *current_text_addr(void) | |||
30 | #define ARCH_MIN_MMSTRUCT_ALIGN 0 | 33 | #define ARCH_MIN_MMSTRUCT_ALIGN 0 |
31 | #endif | 34 | #endif |
32 | 35 | ||
36 | /* | ||
37 | * CPU type and hardware bug flags. Kept separately for each CPU. | ||
38 | * Members of this structure are referenced in head.S, so think twice | ||
39 | * before touching them. [mj] | ||
40 | */ | ||
41 | |||
42 | struct cpuinfo_x86 { | ||
43 | __u8 x86; /* CPU family */ | ||
44 | __u8 x86_vendor; /* CPU vendor */ | ||
45 | __u8 x86_model; | ||
46 | __u8 x86_mask; | ||
47 | #ifdef CONFIG_X86_32 | ||
48 | char wp_works_ok; /* It doesn't on 386's */ | ||
49 | char hlt_works_ok; /* Problems on some 486Dx4's and old 386's */ | ||
50 | char hard_math; | ||
51 | char rfu; | ||
52 | char fdiv_bug; | ||
53 | char f00f_bug; | ||
54 | char coma_bug; | ||
55 | char pad0; | ||
56 | #else | ||
57 | /* number of 4K pages in DTLB/ITLB combined(in pages)*/ | ||
58 | int x86_tlbsize; | ||
59 | __u8 x86_virt_bits, x86_phys_bits; | ||
60 | /* cpuid returned core id bits */ | ||
61 | __u8 x86_coreid_bits; | ||
62 | /* Max extended CPUID function supported */ | ||
63 | __u32 extended_cpuid_level; | ||
64 | #endif | ||
65 | int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */ | ||
66 | __u32 x86_capability[NCAPINTS]; | ||
67 | char x86_vendor_id[16]; | ||
68 | char x86_model_id[64]; | ||
69 | int x86_cache_size; /* in KB - valid for CPUS which support this | ||
70 | call */ | ||
71 | int x86_cache_alignment; /* In bytes */ | ||
72 | int x86_power; | ||
73 | unsigned long loops_per_jiffy; | ||
74 | #ifdef CONFIG_SMP | ||
75 | cpumask_t llc_shared_map; /* cpus sharing the last level cache */ | ||
76 | #endif | ||
77 | unsigned char x86_max_cores; /* cpuid returned max cores value */ | ||
78 | unsigned char apicid; | ||
79 | unsigned short x86_clflush_size; | ||
80 | #ifdef CONFIG_SMP | ||
81 | unsigned char booted_cores; /* number of cores as seen by OS */ | ||
82 | __u8 phys_proc_id; /* Physical processor id. */ | ||
83 | __u8 cpu_core_id; /* Core id */ | ||
84 | __u8 cpu_index; /* index into per_cpu list */ | ||
85 | #endif | ||
86 | } __attribute__((__aligned__(SMP_CACHE_BYTES))); | ||
87 | |||
88 | #define X86_VENDOR_INTEL 0 | ||
89 | #define X86_VENDOR_CYRIX 1 | ||
90 | #define X86_VENDOR_AMD 2 | ||
91 | #define X86_VENDOR_UMC 3 | ||
92 | #define X86_VENDOR_NEXGEN 4 | ||
93 | #define X86_VENDOR_CENTAUR 5 | ||
94 | #define X86_VENDOR_TRANSMETA 7 | ||
95 | #define X86_VENDOR_NSC 8 | ||
96 | #define X86_VENDOR_NUM 9 | ||
97 | #define X86_VENDOR_UNKNOWN 0xff | ||
98 | |||
99 | extern struct cpuinfo_x86 boot_cpu_data; | ||
100 | |||
101 | #ifdef CONFIG_SMP | ||
102 | DECLARE_PER_CPU(struct cpuinfo_x86, cpu_info); | ||
103 | #define cpu_data(cpu) per_cpu(cpu_info, cpu) | ||
104 | #define current_cpu_data cpu_data(smp_processor_id()) | ||
105 | #else | ||
106 | #define cpu_data(cpu) boot_cpu_data | ||
107 | #define current_cpu_data boot_cpu_data | ||
108 | #endif | ||
109 | |||
110 | extern void print_cpu_info(struct cpuinfo_x86 *); | ||
111 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); | ||
112 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); | ||
113 | extern unsigned short num_cache_leaves; | ||
114 | |||
33 | static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, | 115 | static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, |
34 | unsigned int *ecx, unsigned int *edx) | 116 | unsigned int *ecx, unsigned int *edx) |
35 | { | 117 | { |