1/*
2 * Performance counters software interface.
3 *
4 * Copyright 2007, Broadcom Corporation
5 * All Rights Reserved.
6 *
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.
11 *
12 * $Id: bcmperf.h,v 1.1.1.1 2008/10/15 03:25:54 james26_jang Exp $
13 */
14/* essai */
15#ifndef _BCMPERF_H_
16#define _BCMPERF_H_
17/* get cache hits and misses */
18#if defined(mips) && defined(BCMPERFSTATS)
19#include <hndmips.h>
20#define BCMPERF_ENABLE_INSTRCOUNT() hndmips_perf_instrcount_enable()
21#define BCMPERF_ENABLE_ICACHE_MISS() hndmips_perf_icache_miss_enable()
22#define BCMPERF_ENABLE_ICACHE_HIT() hndmips_perf_icache_hit_enable()
23#define	BCMPERF_GETICACHE_MISS(x)	((x) = hndmips_perf_read_cache_miss())
24#define	BCMPERF_GETICACHE_HIT(x)	((x) = hndmips_perf_read_cache_hit())
25#define	BCMPERF_GETINSTRCOUNT(x)	((x) = hndmips_perf_read_instrcount())
26#else
27#define BCMPERF_ENABLE_INSTRCOUNT()
28#define BCMPERF_ENABLE_ICACHE_MISS()
29#define BCMPERF_ENABLE_ICACHE_HIT()
30#define	BCMPERF_GETICACHE_MISS(x)	((x) = 0)
31#define	BCMPERF_GETICACHE_HIT(x)	((x) = 0)
32#define	BCMPERF_GETINSTRCOUNT(x)	((x) = 0)
33#endif /* defined(mips) */
34#endif /* _BCMPERF_H_ */
35