libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / include / bcmperf.h
blob94bb038995c79aa4251ae2f12bacf30f07252d3c
1 /*
2 * Performance counters software interface.
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.
12 * $Id$
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_ */