2 * Broadcom BCM47xx Performance Counter /proc/cpuinfo support
4 * Copyright 2004, Broadcom Corporation
7 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
15 #include <asm/mipsregs.h>
18 * BCM4710 performance counter register select values
19 * No even-odd control-counter mapping, just counters
21 #define PERF_DCACHE_HIT 0
22 #define PERF_DCACHE_MISS 1
23 #define PERF_ICACHE_HIT 2
24 #define PERF_ICACHE_MISS 3
28 * Move from Coprocessor 0 Register 25 Select n
32 #define read_bcm4710_perf_cntr(n) \
34 __asm__ __volatile__( \
35 ".set\tnoreorder\n\t" \
37 ".word\t"STR(0x4001c800|(n))"\n\t" \
44 asmlinkage
unsigned int read_perf_cntr(unsigned int counter
)
47 case PERF_DCACHE_HIT
: return read_bcm4710_perf_cntr(PERF_DCACHE_HIT
);
48 case PERF_DCACHE_MISS
: return read_bcm4710_perf_cntr(PERF_DCACHE_MISS
);
49 case PERF_ICACHE_HIT
: return read_bcm4710_perf_cntr(PERF_ICACHE_HIT
);
50 case PERF_ICACHE_MISS
: return read_bcm4710_perf_cntr(PERF_ICACHE_MISS
);
51 case PERF_ICOUNT
: return read_bcm4710_perf_cntr(PERF_ICOUNT
);
56 asmlinkage
void write_perf_cntr(unsigned int counter
, unsigned int val
)
60 asmlinkage
unsigned int read_perf_cntl(unsigned int counter
)
65 asmlinkage
void write_perf_cntl(unsigned int counter
, unsigned int val
)
This page took 0.052923 seconds and 5 git commands to generate.