diff options
Diffstat (limited to 'include/asm-i386/processor.h')
| -rw-r--r-- | include/asm-i386/processor.h | 71 |
1 files changed, 34 insertions, 37 deletions
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 0c83cf12eec9..2277127696d2 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
| @@ -71,8 +71,12 @@ struct cpuinfo_x86 { | |||
| 71 | cpumask_t llc_shared_map; /* cpus sharing the last level cache */ | 71 | cpumask_t llc_shared_map; /* cpus sharing the last level cache */ |
| 72 | #endif | 72 | #endif |
| 73 | unsigned char x86_max_cores; /* cpuid returned max cores value */ | 73 | unsigned char x86_max_cores; /* cpuid returned max cores value */ |
| 74 | unsigned char booted_cores; /* number of cores as seen by OS */ | ||
| 75 | unsigned char apicid; | 74 | unsigned char apicid; |
| 75 | #ifdef CONFIG_SMP | ||
| 76 | unsigned char booted_cores; /* number of cores as seen by OS */ | ||
| 77 | __u8 phys_proc_id; /* Physical processor id. */ | ||
| 78 | __u8 cpu_core_id; /* Core id */ | ||
| 79 | #endif | ||
| 76 | } __attribute__((__aligned__(SMP_CACHE_BYTES))); | 80 | } __attribute__((__aligned__(SMP_CACHE_BYTES))); |
| 77 | 81 | ||
| 78 | #define X86_VENDOR_INTEL 0 | 82 | #define X86_VENDOR_INTEL 0 |
| @@ -104,14 +108,13 @@ extern struct cpuinfo_x86 cpu_data[]; | |||
| 104 | #define current_cpu_data boot_cpu_data | 108 | #define current_cpu_data boot_cpu_data |
| 105 | #endif | 109 | #endif |
| 106 | 110 | ||
| 107 | extern int phys_proc_id[NR_CPUS]; | ||
| 108 | extern int cpu_core_id[NR_CPUS]; | ||
| 109 | extern int cpu_llc_id[NR_CPUS]; | 111 | extern int cpu_llc_id[NR_CPUS]; |
| 110 | extern char ignore_fpu_irq; | 112 | extern char ignore_fpu_irq; |
| 111 | 113 | ||
| 112 | extern void identify_cpu(struct cpuinfo_x86 *); | 114 | extern void identify_cpu(struct cpuinfo_x86 *); |
| 113 | extern void print_cpu_info(struct cpuinfo_x86 *); | 115 | extern void print_cpu_info(struct cpuinfo_x86 *); |
| 114 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); | 116 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); |
| 117 | extern unsigned short num_cache_leaves; | ||
| 115 | 118 | ||
| 116 | #ifdef CONFIG_X86_HT | 119 | #ifdef CONFIG_X86_HT |
| 117 | extern void detect_ht(struct cpuinfo_x86 *c); | 120 | extern void detect_ht(struct cpuinfo_x86 *c); |
| @@ -140,6 +143,18 @@ static inline void detect_ht(struct cpuinfo_x86 *c) {} | |||
| 140 | #define X86_EFLAGS_VIP 0x00100000 /* Virtual Interrupt Pending */ | 143 | #define X86_EFLAGS_VIP 0x00100000 /* Virtual Interrupt Pending */ |
| 141 | #define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */ | 144 | #define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */ |
| 142 | 145 | ||
| 146 | static inline void __cpuid(unsigned int *eax, unsigned int *ebx, | ||
| 147 | unsigned int *ecx, unsigned int *edx) | ||
| 148 | { | ||
| 149 | /* ecx is often an input as well as an output. */ | ||
| 150 | __asm__("cpuid" | ||
| 151 | : "=a" (*eax), | ||
| 152 | "=b" (*ebx), | ||
| 153 | "=c" (*ecx), | ||
| 154 | "=d" (*edx) | ||
| 155 | : "0" (*eax), "2" (*ecx)); | ||
| 156 | } | ||
| 157 | |||
| 143 | /* | 158 | /* |
| 144 | * Generic CPUID function | 159 | * Generic CPUID function |
| 145 | * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx | 160 | * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx |
| @@ -147,24 +162,18 @@ static inline void detect_ht(struct cpuinfo_x86 *c) {} | |||
| 147 | */ | 162 | */ |
| 148 | static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) | 163 | static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) |
| 149 | { | 164 | { |
| 150 | __asm__("cpuid" | 165 | *eax = op; |
| 151 | : "=a" (*eax), | 166 | *ecx = 0; |
| 152 | "=b" (*ebx), | 167 | __cpuid(eax, ebx, ecx, edx); |
| 153 | "=c" (*ecx), | ||
| 154 | "=d" (*edx) | ||
| 155 | : "0" (op), "c"(0)); | ||
| 156 | } | 168 | } |
| 157 | 169 | ||
| 158 | /* Some CPUID calls want 'count' to be placed in ecx */ | 170 | /* Some CPUID calls want 'count' to be placed in ecx */ |
| 159 | static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx, | 171 | static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx, |
| 160 | int *edx) | 172 | int *edx) |
| 161 | { | 173 | { |
| 162 | __asm__("cpuid" | 174 | *eax = op; |
| 163 | : "=a" (*eax), | 175 | *ecx = count; |
| 164 | "=b" (*ebx), | 176 | __cpuid(eax, ebx, ecx, edx); |
| 165 | "=c" (*ecx), | ||
| 166 | "=d" (*edx) | ||
| 167 | : "0" (op), "c" (count)); | ||
| 168 | } | 177 | } |
| 169 | 178 | ||
| 170 | /* | 179 | /* |
| @@ -172,42 +181,30 @@ static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx, | |||
| 172 | */ | 181 | */ |
| 173 | static inline unsigned int cpuid_eax(unsigned int op) | 182 | static inline unsigned int cpuid_eax(unsigned int op) |
| 174 | { | 183 | { |
| 175 | unsigned int eax; | 184 | unsigned int eax, ebx, ecx, edx; |
| 176 | 185 | ||
| 177 | __asm__("cpuid" | 186 | cpuid(op, &eax, &ebx, &ecx, &edx); |
| 178 | : "=a" (eax) | ||
| 179 | : "0" (op) | ||
| 180 | : "bx", "cx", "dx"); | ||
| 181 | return eax; | 187 | return eax; |
| 182 | } | 188 | } |
| 183 | static inline unsigned int cpuid_ebx(unsigned int op) | 189 | static inline unsigned int cpuid_ebx(unsigned int op) |
| 184 | { | 190 | { |
| 185 | unsigned int eax, ebx; | 191 | unsigned int eax, ebx, ecx, edx; |
| 186 | 192 | ||
| 187 | __asm__("cpuid" | 193 | cpuid(op, &eax, &ebx, &ecx, &edx); |
| 188 | : "=a" (eax), "=b" (ebx) | ||
| 189 | : "0" (op) | ||
| 190 | : "cx", "dx" ); | ||
| 191 | return ebx; | 194 | return ebx; |
| 192 | } | 195 | } |
| 193 | static inline unsigned int cpuid_ecx(unsigned int op) | 196 | static inline unsigned int cpuid_ecx(unsigned int op) |
| 194 | { | 197 | { |
| 195 | unsigned int eax, ecx; | 198 | unsigned int eax, ebx, ecx, edx; |
| 196 | 199 | ||
| 197 | __asm__("cpuid" | 200 | cpuid(op, &eax, &ebx, &ecx, &edx); |
| 198 | : "=a" (eax), "=c" (ecx) | ||
| 199 | : "0" (op) | ||
| 200 | : "bx", "dx" ); | ||
| 201 | return ecx; | 201 | return ecx; |
| 202 | } | 202 | } |
| 203 | static inline unsigned int cpuid_edx(unsigned int op) | 203 | static inline unsigned int cpuid_edx(unsigned int op) |
| 204 | { | 204 | { |
| 205 | unsigned int eax, edx; | 205 | unsigned int eax, ebx, ecx, edx; |
| 206 | 206 | ||
| 207 | __asm__("cpuid" | 207 | cpuid(op, &eax, &ebx, &ecx, &edx); |
| 208 | : "=a" (eax), "=d" (edx) | ||
| 209 | : "0" (op) | ||
| 210 | : "bx", "cx"); | ||
| 211 | return edx; | 208 | return edx; |
| 212 | } | 209 | } |
| 213 | 210 | ||
| @@ -554,7 +551,7 @@ extern void prepare_to_copy(struct task_struct *tsk); | |||
| 554 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | 551 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); |
| 555 | 552 | ||
| 556 | extern unsigned long thread_saved_pc(struct task_struct *tsk); | 553 | extern unsigned long thread_saved_pc(struct task_struct *tsk); |
| 557 | void show_trace(struct task_struct *task, unsigned long *stack); | 554 | void show_trace(struct task_struct *task, struct pt_regs *regs, unsigned long *stack); |
| 558 | 555 | ||
| 559 | unsigned long get_wchan(struct task_struct *p); | 556 | unsigned long get_wchan(struct task_struct *p); |
| 560 | 557 | ||
