aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2006-12-08 01:46:58 -0500
committerPaul Mackerras <paulus@samba.org>2006-12-08 19:39:05 -0500
commit4c198557c6b45956a6f54b958fb97a15b02a6a3b (patch)
tree91db4a694f01f4e4d29bcd7f3bc90c3ef311aebf /arch
parent396a1a5832ae28ce2c4150f98827873cbef554f5 (diff)
[POWERPC] Add DSCR SPR to sysfs
POWER6 adds a new SPR, the data stream control register (DSCR). It can be used to adjust how agressive the prefetch mechanisms are. Its possible we may want to context switch this, but for now just export it to userspace via sysfs so we can adjust it. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/sysfs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 63ed265b7f09..22daba56c865 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -181,6 +181,7 @@ SYSFS_PMCSETUP(pmc6, SPRN_PMC6);
181SYSFS_PMCSETUP(pmc7, SPRN_PMC7); 181SYSFS_PMCSETUP(pmc7, SPRN_PMC7);
182SYSFS_PMCSETUP(pmc8, SPRN_PMC8); 182SYSFS_PMCSETUP(pmc8, SPRN_PMC8);
183SYSFS_PMCSETUP(purr, SPRN_PURR); 183SYSFS_PMCSETUP(purr, SPRN_PURR);
184SYSFS_PMCSETUP(dscr, SPRN_DSCR);
184 185
185static SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0); 186static SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0);
186static SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1); 187static SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1);
@@ -194,6 +195,7 @@ static SYSDEV_ATTR(pmc6, 0600, show_pmc6, store_pmc6);
194static SYSDEV_ATTR(pmc7, 0600, show_pmc7, store_pmc7); 195static SYSDEV_ATTR(pmc7, 0600, show_pmc7, store_pmc7);
195static SYSDEV_ATTR(pmc8, 0600, show_pmc8, store_pmc8); 196static SYSDEV_ATTR(pmc8, 0600, show_pmc8, store_pmc8);
196static SYSDEV_ATTR(purr, 0600, show_purr, NULL); 197static SYSDEV_ATTR(purr, 0600, show_purr, NULL);
198static SYSDEV_ATTR(dscr, 0600, show_dscr, store_dscr);
197 199
198static void register_cpu_online(unsigned int cpu) 200static void register_cpu_online(unsigned int cpu)
199{ 201{
@@ -231,6 +233,9 @@ static void register_cpu_online(unsigned int cpu)
231 233
232 if (cpu_has_feature(CPU_FTR_PURR)) 234 if (cpu_has_feature(CPU_FTR_PURR))
233 sysdev_create_file(s, &attr_purr); 235 sysdev_create_file(s, &attr_purr);
236
237 if (cpu_has_feature(CPU_FTR_DSCR))
238 sysdev_create_file(s, &attr_dscr);
234} 239}
235 240
236#ifdef CONFIG_HOTPLUG_CPU 241#ifdef CONFIG_HOTPLUG_CPU
@@ -272,6 +277,9 @@ static void unregister_cpu_online(unsigned int cpu)
272 277
273 if (cpu_has_feature(CPU_FTR_PURR)) 278 if (cpu_has_feature(CPU_FTR_PURR))
274 sysdev_remove_file(s, &attr_purr); 279 sysdev_remove_file(s, &attr_purr);
280
281 if (cpu_has_feature(CPU_FTR_DSCR))
282 sysdev_remove_file(s, &attr_dscr);
275} 283}
276#endif /* CONFIG_HOTPLUG_CPU */ 284#endif /* CONFIG_HOTPLUG_CPU */
277 285