diff options
author | Christopher Kenna <cjk@cs.unc.edu> | 2012-03-26 23:40:04 -0400 |
---|---|---|
committer | Christopher Kenna <cjk@cs.unc.edu> | 2012-03-26 23:40:04 -0400 |
commit | 65f96c53bc0db7733ae7908470ddb3f17dc369b4 (patch) | |
tree | 6ab5198c9513885dc1e6fddd8461001510fddb7c /arch | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
First commit.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 0bf12644aa73..482e068a236a 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -1215,6 +1215,23 @@ static struct notifier_block __cpuinitdata cacheinfo_cpu_notifier = { | |||
1215 | .notifier_call = cacheinfo_cpu_callback, | 1215 | .notifier_call = cacheinfo_cpu_callback, |
1216 | }; | 1216 | }; |
1217 | 1217 | ||
1218 | #include <litmus/color.h> | ||
1219 | |||
1220 | extern struct color_cache_info color_cache_info; | ||
1221 | |||
1222 | static void set_color_vars(void) | ||
1223 | { | ||
1224 | struct _cpuid4_info *leaf = CPUID4_INFO_IDX( | ||
1225 | smp_processor_id(), num_cache_leaves - 1); | ||
1226 | color_cache_info.size = leaf->size; | ||
1227 | color_cache_info.line_size = | ||
1228 | (unsigned long)leaf->ebx.split.coherency_line_size + 1; | ||
1229 | color_cache_info.ways = | ||
1230 | (unsigned long)leaf->ebx.split.ways_of_associativity + 1; | ||
1231 | color_cache_info.sets = | ||
1232 | (unsigned long)leaf->ecx.split.number_of_sets + 1; | ||
1233 | } | ||
1234 | |||
1218 | static int __cpuinit cache_sysfs_init(void) | 1235 | static int __cpuinit cache_sysfs_init(void) |
1219 | { | 1236 | { |
1220 | int i; | 1237 | int i; |
@@ -1231,6 +1248,7 @@ static int __cpuinit cache_sysfs_init(void) | |||
1231 | return err; | 1248 | return err; |
1232 | } | 1249 | } |
1233 | register_hotcpu_notifier(&cacheinfo_cpu_notifier); | 1250 | register_hotcpu_notifier(&cacheinfo_cpu_notifier); |
1251 | set_color_vars(); | ||
1234 | return 0; | 1252 | return 0; |
1235 | } | 1253 | } |
1236 | 1254 | ||