diff options
author | Olof Johansson <olof@lixom.net> | 2007-09-04 22:09:06 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-09-13 11:33:21 -0400 |
commit | 2e1957fd47b9d4b7bf35be2ec3d4b5e3eefe5cc0 (patch) | |
tree | 7ed199444a5e6dec86afbb91a8f2031c272221d8 | |
parent | 4d442331e57b7bbc28b5a20f7d069bc12e9c503e (diff) |
[POWERPC] pasemi: Export more SPRs to sysfs when CONFIG_DEBUG_KERNEL=y
Export some of the implementation-specific registers via sysfs.
Useful when debugging, etc.
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/sysfs.c | 60 | ||||
-rw-r--r-- | include/asm-powerpc/reg.h | 48 |
2 files changed, 97 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 55d29ed4b7a0..d7835ba9fb8c 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c | |||
@@ -197,6 +197,36 @@ SYSFS_PMCSETUP(pa6t_pmc3, SPRN_PA6T_PMC3); | |||
197 | SYSFS_PMCSETUP(pa6t_pmc4, SPRN_PA6T_PMC4); | 197 | SYSFS_PMCSETUP(pa6t_pmc4, SPRN_PA6T_PMC4); |
198 | SYSFS_PMCSETUP(pa6t_pmc5, SPRN_PA6T_PMC5); | 198 | SYSFS_PMCSETUP(pa6t_pmc5, SPRN_PA6T_PMC5); |
199 | 199 | ||
200 | #ifdef CONFIG_DEBUG_KERNEL | ||
201 | SYSFS_PMCSETUP(hid0, SPRN_HID0); | ||
202 | SYSFS_PMCSETUP(hid1, SPRN_HID1); | ||
203 | SYSFS_PMCSETUP(hid4, SPRN_HID4); | ||
204 | SYSFS_PMCSETUP(hid5, SPRN_HID5); | ||
205 | SYSFS_PMCSETUP(ima0, SPRN_PA6T_IMA0); | ||
206 | SYSFS_PMCSETUP(ima1, SPRN_PA6T_IMA1); | ||
207 | SYSFS_PMCSETUP(ima2, SPRN_PA6T_IMA2); | ||
208 | SYSFS_PMCSETUP(ima3, SPRN_PA6T_IMA3); | ||
209 | SYSFS_PMCSETUP(ima4, SPRN_PA6T_IMA4); | ||
210 | SYSFS_PMCSETUP(ima5, SPRN_PA6T_IMA5); | ||
211 | SYSFS_PMCSETUP(ima6, SPRN_PA6T_IMA6); | ||
212 | SYSFS_PMCSETUP(ima7, SPRN_PA6T_IMA7); | ||
213 | SYSFS_PMCSETUP(ima8, SPRN_PA6T_IMA8); | ||
214 | SYSFS_PMCSETUP(ima9, SPRN_PA6T_IMA9); | ||
215 | SYSFS_PMCSETUP(imaat, SPRN_PA6T_IMAAT); | ||
216 | SYSFS_PMCSETUP(btcr, SPRN_PA6T_BTCR); | ||
217 | SYSFS_PMCSETUP(pccr, SPRN_PA6T_PCCR); | ||
218 | SYSFS_PMCSETUP(rpccr, SPRN_PA6T_RPCCR); | ||
219 | SYSFS_PMCSETUP(der, SPRN_PA6T_DER); | ||
220 | SYSFS_PMCSETUP(mer, SPRN_PA6T_MER); | ||
221 | SYSFS_PMCSETUP(ber, SPRN_PA6T_BER); | ||
222 | SYSFS_PMCSETUP(ier, SPRN_PA6T_IER); | ||
223 | SYSFS_PMCSETUP(sier, SPRN_PA6T_SIER); | ||
224 | SYSFS_PMCSETUP(siar, SPRN_PA6T_SIAR); | ||
225 | SYSFS_PMCSETUP(tsr0, SPRN_PA6T_TSR0); | ||
226 | SYSFS_PMCSETUP(tsr1, SPRN_PA6T_TSR1); | ||
227 | SYSFS_PMCSETUP(tsr2, SPRN_PA6T_TSR2); | ||
228 | SYSFS_PMCSETUP(tsr3, SPRN_PA6T_TSR3); | ||
229 | #endif /* CONFIG_DEBUG_KERNEL */ | ||
200 | 230 | ||
201 | static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra); | 231 | static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra); |
202 | static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL); | 232 | static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL); |
@@ -228,6 +258,36 @@ static struct sysdev_attribute pa6t_attrs[] = { | |||
228 | _SYSDEV_ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3), | 258 | _SYSDEV_ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3), |
229 | _SYSDEV_ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4), | 259 | _SYSDEV_ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4), |
230 | _SYSDEV_ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5), | 260 | _SYSDEV_ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5), |
261 | #ifdef CONFIG_DEBUG_KERNEL | ||
262 | _SYSDEV_ATTR(hid0, 0600, show_hid0, store_hid0), | ||
263 | _SYSDEV_ATTR(hid1, 0600, show_hid1, store_hid1), | ||
264 | _SYSDEV_ATTR(hid4, 0600, show_hid4, store_hid4), | ||
265 | _SYSDEV_ATTR(hid5, 0600, show_hid5, store_hid5), | ||
266 | _SYSDEV_ATTR(ima0, 0600, show_ima0, store_ima0), | ||
267 | _SYSDEV_ATTR(ima1, 0600, show_ima1, store_ima1), | ||
268 | _SYSDEV_ATTR(ima2, 0600, show_ima2, store_ima2), | ||
269 | _SYSDEV_ATTR(ima3, 0600, show_ima3, store_ima3), | ||
270 | _SYSDEV_ATTR(ima4, 0600, show_ima4, store_ima4), | ||
271 | _SYSDEV_ATTR(ima5, 0600, show_ima5, store_ima5), | ||
272 | _SYSDEV_ATTR(ima6, 0600, show_ima6, store_ima6), | ||
273 | _SYSDEV_ATTR(ima7, 0600, show_ima7, store_ima7), | ||
274 | _SYSDEV_ATTR(ima8, 0600, show_ima8, store_ima8), | ||
275 | _SYSDEV_ATTR(ima9, 0600, show_ima9, store_ima9), | ||
276 | _SYSDEV_ATTR(imaat, 0600, show_imaat, store_imaat), | ||
277 | _SYSDEV_ATTR(btcr, 0600, show_btcr, store_btcr), | ||
278 | _SYSDEV_ATTR(pccr, 0600, show_pccr, store_pccr), | ||
279 | _SYSDEV_ATTR(rpccr, 0600, show_rpccr, store_rpccr), | ||
280 | _SYSDEV_ATTR(der, 0600, show_der, store_der), | ||
281 | _SYSDEV_ATTR(mer, 0600, show_mer, store_mer), | ||
282 | _SYSDEV_ATTR(ber, 0600, show_ber, store_ber), | ||
283 | _SYSDEV_ATTR(ier, 0600, show_ier, store_ier), | ||
284 | _SYSDEV_ATTR(sier, 0600, show_sier, store_sier), | ||
285 | _SYSDEV_ATTR(siar, 0600, show_siar, store_siar), | ||
286 | _SYSDEV_ATTR(tsr0, 0600, show_tsr0, store_tsr0), | ||
287 | _SYSDEV_ATTR(tsr1, 0600, show_tsr1, store_tsr1), | ||
288 | _SYSDEV_ATTR(tsr2, 0600, show_tsr2, store_tsr2), | ||
289 | _SYSDEV_ATTR(tsr3, 0600, show_tsr3, store_tsr3), | ||
290 | #endif /* CONFIG_DEBUG_KERNEL */ | ||
231 | }; | 291 | }; |
232 | 292 | ||
233 | 293 | ||
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h index 281011e953ec..347de53e49af 100644 --- a/include/asm-powerpc/reg.h +++ b/include/asm-powerpc/reg.h | |||
@@ -518,21 +518,47 @@ | |||
518 | #define PA6T_MMCR1_ES4 0x0000000000ff0000UL | 518 | #define PA6T_MMCR1_ES4 0x0000000000ff0000UL |
519 | #define PA6T_MMCR1_ES5 0x00000000ff000000UL | 519 | #define PA6T_MMCR1_ES5 0x00000000ff000000UL |
520 | 520 | ||
521 | #define SPRN_PA6T_SIAR 780 | 521 | #define SPRN_PA6T_UPMC0 771 /* User PerfMon Counter 0 */ |
522 | #define SPRN_PA6T_UPMC0 771 | 522 | #define SPRN_PA6T_UPMC1 772 /* ... */ |
523 | #define SPRN_PA6T_UPMC1 772 | ||
524 | #define SPRN_PA6T_UPMC2 773 | 523 | #define SPRN_PA6T_UPMC2 773 |
525 | #define SPRN_PA6T_UPMC3 774 | 524 | #define SPRN_PA6T_UPMC3 774 |
526 | #define SPRN_PA6T_UPMC4 775 | 525 | #define SPRN_PA6T_UPMC4 775 |
527 | #define SPRN_PA6T_UPMC5 776 | 526 | #define SPRN_PA6T_UPMC5 776 |
528 | #define SPRN_PA6T_UMMCR0 779 | 527 | #define SPRN_PA6T_UMMCR0 779 /* User Monitor Mode Control Register 0 */ |
529 | #define SPRN_PA6T_UMMCR1 782 | 528 | #define SPRN_PA6T_SIAR 780 /* Sampled Instruction Address */ |
530 | #define SPRN_PA6T_PMC0 787 | 529 | #define SPRN_PA6T_UMMCR1 782 /* User Monitor Mode Control Register 1 */ |
531 | #define SPRN_PA6T_PMC1 788 | 530 | #define SPRN_PA6T_SIER 785 /* Sampled Instruction Event Register */ |
532 | #define SPRN_PA6T_PMC2 789 | 531 | #define SPRN_PA6T_PMC0 787 |
533 | #define SPRN_PA6T_PMC3 790 | 532 | #define SPRN_PA6T_PMC1 788 |
534 | #define SPRN_PA6T_PMC4 791 | 533 | #define SPRN_PA6T_PMC2 789 |
535 | #define SPRN_PA6T_PMC5 792 | 534 | #define SPRN_PA6T_PMC3 790 |
535 | #define SPRN_PA6T_PMC4 791 | ||
536 | #define SPRN_PA6T_PMC5 792 | ||
537 | #define SPRN_PA6T_TSR0 793 /* Timestamp Register 0 */ | ||
538 | #define SPRN_PA6T_TSR1 794 /* Timestamp Register 1 */ | ||
539 | #define SPRN_PA6T_TSR2 799 /* Timestamp Register 2 */ | ||
540 | #define SPRN_PA6T_TSR3 784 /* Timestamp Register 3 */ | ||
541 | |||
542 | #define SPRN_PA6T_IER 981 /* Icache Error Register */ | ||
543 | #define SPRN_PA6T_DER 982 /* Dcache Error Register */ | ||
544 | #define SPRN_PA6T_BER 862 /* BIU Error Address Register */ | ||
545 | #define SPRN_PA6T_MER 849 /* MMU Error Register */ | ||
546 | |||
547 | #define SPRN_PA6T_IMA0 880 /* Instruction Match Array 0 */ | ||
548 | #define SPRN_PA6T_IMA1 881 /* ... */ | ||
549 | #define SPRN_PA6T_IMA2 882 | ||
550 | #define SPRN_PA6T_IMA3 883 | ||
551 | #define SPRN_PA6T_IMA4 884 | ||
552 | #define SPRN_PA6T_IMA5 885 | ||
553 | #define SPRN_PA6T_IMA6 886 | ||
554 | #define SPRN_PA6T_IMA7 887 | ||
555 | #define SPRN_PA6T_IMA8 888 | ||
556 | #define SPRN_PA6T_IMA9 889 | ||
557 | #define SPRN_PA6T_BTCR 978 /* Breakpoint and Tagging Control Register */ | ||
558 | #define SPRN_PA6T_IMAAT 979 /* Instruction Match Array Action Table */ | ||
559 | #define SPRN_PA6T_PCCR 1019 /* Power Counter Control Register */ | ||
560 | #define SPRN_PA6T_RPCCR 1021 /* Retire PC Trace Control Register */ | ||
561 | |||
536 | 562 | ||
537 | #else /* 32-bit */ | 563 | #else /* 32-bit */ |
538 | #define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */ | 564 | #define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */ |