diff options
| author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-28 10:49:09 -0400 |
|---|---|---|
| committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-29 17:41:06 -0400 |
| commit | 425a6b5043bcc2142804107c853f978ac2fe3040 (patch) | |
| tree | 2125fedf8529d0991132e9d42913d2b42185a697 /arch/x86/kernel | |
| parent | f85625ccf28d1bffd4dac916babb76b910ebef31 (diff) | |
Export shared_cpu_map
The cpumap of CPUs that share the same cache level is not normally
available outside intel_cacheinfo.c. This commit allows to export such
map.
Diffstat (limited to 'arch/x86/kernel')
| -rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 804c40e2bc3e..3167c3d72596 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
| @@ -515,6 +515,23 @@ 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 | int get_shared_cpu_map(cpumask_var_t mask, unsigned int cpu, int index) | ||
| 520 | { | ||
| 521 | int ret = 0; | ||
| 522 | struct _cpuid4_info *this_leaf; | ||
| 523 | |||
| 524 | if (index >= num_cache_leaves) { | ||
| 525 | index = num_cache_leaves - 1; | ||
| 526 | ret = index; | ||
| 527 | } | ||
| 528 | |||
| 529 | this_leaf = CPUID4_INFO_IDX(cpu,index); | ||
| 530 | cpumask_copy(mask, to_cpumask(this_leaf->shared_cpu_map)); | ||
| 531 | |||
| 532 | return ret; | ||
| 533 | } | ||
| 534 | |||
| 518 | #ifdef CONFIG_SMP | 535 | #ifdef CONFIG_SMP |
| 519 | static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) | 536 | static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) |
| 520 | { | 537 | { |
