diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-04-13 15:46:43 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-04-13 15:46:43 -0400 |
commit | f4b0e7fba12e1787ec3723cf787905fee22612ed (patch) | |
tree | 1c70a2f1f183dc54e31c6fe5eb5383b245cce884 | |
parent | 175164a7f9d8597b6ade9e4fa02effcad6fc6bbf (diff) |
Export shared_cpu_map
-rw-r--r-- | arch/x86/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index c9786480f0fe..4e60b624d121 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -172,6 +172,8 @@ extern void print_cpu_info(struct cpuinfo_x86 *); | |||
172 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); | 172 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); |
173 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); | 173 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); |
174 | extern unsigned short num_cache_leaves; | 174 | extern unsigned short num_cache_leaves; |
175 | extern void get_shared_cpu_map(cpumask_var_t mask, | ||
176 | unsigned int cpu, int index); | ||
175 | 177 | ||
176 | extern void detect_extended_topology(struct cpuinfo_x86 *c); | 178 | extern void detect_extended_topology(struct cpuinfo_x86 *c); |
177 | extern void detect_ht(struct cpuinfo_x86 *c); | 179 | extern void detect_ht(struct cpuinfo_x86 *c); |
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 804c40e2bc3e..ffdc69c05e4c 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -515,6 +515,16 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c) | |||
515 | static DEFINE_PER_CPU(struct _cpuid4_info *, cpuid4_info); | 515 | static DEFINE_PER_CPU(struct _cpuid4_info *, cpuid4_info); |
516 | #define CPUID4_INFO_IDX(x, y) (&((per_cpu(cpuid4_info, x))[y])) | 516 | #define CPUID4_INFO_IDX(x, y) (&((per_cpu(cpuid4_info, x))[y])) |
517 | 517 | ||
518 | /* returns CPUs that share the index cache with cpu */ | ||
519 | void get_shared_cpu_map(cpumask_var_t mask, unsigned int cpu, int index) | ||
520 | { | ||
521 | struct _cpuid4_info *this_leaf; | ||
522 | |||
523 | this_leaf = CPUID4_INFO_IDX(cpu,index); | ||
524 | cpumask_copy(mask, to_cpumask(this_leaf->shared_cpu_map)); | ||
525 | return; | ||
526 | } | ||
527 | |||
518 | #ifdef CONFIG_SMP | 528 | #ifdef CONFIG_SMP |
519 | static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) | 529 | static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) |
520 | { | 530 | { |