aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/sysfs.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2006-12-08 01:51:13 -0500
committerPaul Mackerras <paulus@samba.org>2006-12-08 19:39:06 -0500
commitf050982a9b7c4edc414f0d5543c3cb24504223c6 (patch)
tree250bc2206aacc6cdabfcd4e0ada3c8ae30ca39c2 /arch/powerpc/kernel/sysfs.c
parent4c198557c6b45956a6f54b958fb97a15b02a6a3b (diff)
[POWERPC] Add SPURR SPR to sysfs
Now we have a SPURR cpu feature bit, we can export it to userspace in sysfs. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/sysfs.c')
-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 22daba56c865..400ab2b946e7 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(spurr, SPRN_SPURR);
184SYSFS_PMCSETUP(dscr, SPRN_DSCR); 185SYSFS_PMCSETUP(dscr, SPRN_DSCR);
185 186
186static SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0); 187static SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0);
@@ -195,6 +196,7 @@ static SYSDEV_ATTR(pmc6, 0600, show_pmc6, store_pmc6);
195static SYSDEV_ATTR(pmc7, 0600, show_pmc7, store_pmc7); 196static SYSDEV_ATTR(pmc7, 0600, show_pmc7, store_pmc7);
196static SYSDEV_ATTR(pmc8, 0600, show_pmc8, store_pmc8); 197static SYSDEV_ATTR(pmc8, 0600, show_pmc8, store_pmc8);
197static SYSDEV_ATTR(purr, 0600, show_purr, NULL); 198static SYSDEV_ATTR(purr, 0600, show_purr, NULL);
199static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL);
198static SYSDEV_ATTR(dscr, 0600, show_dscr, store_dscr); 200static SYSDEV_ATTR(dscr, 0600, show_dscr, store_dscr);
199 201
200static void register_cpu_online(unsigned int cpu) 202static void register_cpu_online(unsigned int cpu)
@@ -234,6 +236,9 @@ static void register_cpu_online(unsigned int cpu)
234 if (cpu_has_feature(CPU_FTR_PURR)) 236 if (cpu_has_feature(CPU_FTR_PURR))
235 sysdev_create_file(s, &attr_purr); 237 sysdev_create_file(s, &attr_purr);
236 238
239 if (cpu_has_feature(CPU_FTR_SPURR))
240 sysdev_create_file(s, &attr_spurr);
241
237 if (cpu_has_feature(CPU_FTR_DSCR)) 242 if (cpu_has_feature(CPU_FTR_DSCR))
238 sysdev_create_file(s, &attr_dscr); 243 sysdev_create_file(s, &attr_dscr);
239} 244}
@@ -278,6 +283,9 @@ static void unregister_cpu_online(unsigned int cpu)
278 if (cpu_has_feature(CPU_FTR_PURR)) 283 if (cpu_has_feature(CPU_FTR_PURR))
279 sysdev_remove_file(s, &attr_purr); 284 sysdev_remove_file(s, &attr_purr);
280 285
286 if (cpu_has_feature(CPU_FTR_SPURR))
287 sysdev_remove_file(s, &attr_spurr);
288
281 if (cpu_has_feature(CPU_FTR_DSCR)) 289 if (cpu_has_feature(CPU_FTR_DSCR))
282 sysdev_remove_file(s, &attr_dscr); 290 sysdev_remove_file(s, &attr_dscr);
283} 291}