aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/perf.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/perf.c')
-rw-r--r--arch/parisc/kernel/perf.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index a46bc62b643e..89d6d5ad44b5 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -171,7 +171,7 @@ static const uint64_t perf_bitmasks[] = {
171 171
172/* 172/*
173 * Write control bitmasks for Pa-8700 processor given 173 * Write control bitmasks for Pa-8700 processor given
174 * somethings have changed slightly. 174 * some things have changed slightly.
175 */ 175 */
176static const uint64_t perf_bitmasks_piranha[] = { 176static const uint64_t perf_bitmasks_piranha[] = {
177 0x0000000000000000ul, /* first dbl word must be zero */ 177 0x0000000000000000ul, /* first dbl word must be zero */
@@ -511,10 +511,12 @@ static int __init perf_init(void)
511 } else if (boot_cpu_data.cpu_type == pcxw || 511 } else if (boot_cpu_data.cpu_type == pcxw ||
512 boot_cpu_data.cpu_type == pcxw_ || 512 boot_cpu_data.cpu_type == pcxw_ ||
513 boot_cpu_data.cpu_type == pcxw2 || 513 boot_cpu_data.cpu_type == pcxw2 ||
514 boot_cpu_data.cpu_type == mako) { 514 boot_cpu_data.cpu_type == mako ||
515 boot_cpu_data.cpu_type == mako2) {
515 perf_processor_interface = CUDA_INTF; 516 perf_processor_interface = CUDA_INTF;
516 if (boot_cpu_data.cpu_type == pcxw2 || 517 if (boot_cpu_data.cpu_type == pcxw2 ||
517 boot_cpu_data.cpu_type == mako) 518 boot_cpu_data.cpu_type == mako ||
519 boot_cpu_data.cpu_type == mako2)
518 bitmask_array = perf_bitmasks_piranha; 520 bitmask_array = perf_bitmasks_piranha;
519 } else { 521 } else {
520 perf_processor_interface = UNKNOWN_INTF; 522 perf_processor_interface = UNKNOWN_INTF;
@@ -574,27 +576,27 @@ static int perf_stop_counters(uint32_t *raddr)
574 if (!perf_rdr_read_ubuf(16, userbuf)) 576 if (!perf_rdr_read_ubuf(16, userbuf))
575 return -13; 577 return -13;
576 578
577 /* Counter0 is bits 1398 thru 1429 */ 579 /* Counter0 is bits 1398 to 1429 */
578 tmp64 = (userbuf[21] << 22) & 0x00000000ffc00000; 580 tmp64 = (userbuf[21] << 22) & 0x00000000ffc00000;
579 tmp64 |= (userbuf[22] >> 42) & 0x00000000003fffff; 581 tmp64 |= (userbuf[22] >> 42) & 0x00000000003fffff;
580 /* OR sticky0 (bit 1430) to counter0 bit 32 */ 582 /* OR sticky0 (bit 1430) to counter0 bit 32 */
581 tmp64 |= (userbuf[22] >> 10) & 0x0000000080000000; 583 tmp64 |= (userbuf[22] >> 10) & 0x0000000080000000;
582 raddr[0] = (uint32_t)tmp64; 584 raddr[0] = (uint32_t)tmp64;
583 585
584 /* Counter1 is bits 1431 thru 1462 */ 586 /* Counter1 is bits 1431 to 1462 */
585 tmp64 = (userbuf[22] >> 9) & 0x00000000ffffffff; 587 tmp64 = (userbuf[22] >> 9) & 0x00000000ffffffff;
586 /* OR sticky1 (bit 1463) to counter1 bit 32 */ 588 /* OR sticky1 (bit 1463) to counter1 bit 32 */
587 tmp64 |= (userbuf[22] << 23) & 0x0000000080000000; 589 tmp64 |= (userbuf[22] << 23) & 0x0000000080000000;
588 raddr[1] = (uint32_t)tmp64; 590 raddr[1] = (uint32_t)tmp64;
589 591
590 /* Counter2 is bits 1464 thru 1495 */ 592 /* Counter2 is bits 1464 to 1495 */
591 tmp64 = (userbuf[22] << 24) & 0x00000000ff000000; 593 tmp64 = (userbuf[22] << 24) & 0x00000000ff000000;
592 tmp64 |= (userbuf[23] >> 40) & 0x0000000000ffffff; 594 tmp64 |= (userbuf[23] >> 40) & 0x0000000000ffffff;
593 /* OR sticky2 (bit 1496) to counter2 bit 32 */ 595 /* OR sticky2 (bit 1496) to counter2 bit 32 */
594 tmp64 |= (userbuf[23] >> 8) & 0x0000000080000000; 596 tmp64 |= (userbuf[23] >> 8) & 0x0000000080000000;
595 raddr[2] = (uint32_t)tmp64; 597 raddr[2] = (uint32_t)tmp64;
596 598
597 /* Counter3 is bits 1497 thru 1528 */ 599 /* Counter3 is bits 1497 to 1528 */
598 tmp64 = (userbuf[23] >> 7) & 0x00000000ffffffff; 600 tmp64 = (userbuf[23] >> 7) & 0x00000000ffffffff;
599 /* OR sticky3 (bit 1529) to counter3 bit 32 */ 601 /* OR sticky3 (bit 1529) to counter3 bit 32 */
600 tmp64 |= (userbuf[23] << 25) & 0x0000000080000000; 602 tmp64 |= (userbuf[23] << 25) & 0x0000000080000000;
@@ -616,7 +618,7 @@ static int perf_stop_counters(uint32_t *raddr)
616 userbuf[23] = 0; 618 userbuf[23] = 0;
617 619
618 /* 620 /*
619 * Write back the zero'ed bytes + the image given 621 * Write back the zeroed bytes + the image given
620 * the read was destructive. 622 * the read was destructive.
621 */ 623 */
622 perf_rdr_write(16, userbuf); 624 perf_rdr_write(16, userbuf);