1/*
2 * Copyright 2014, General Dynamics C4 Systems
3 *
4 * This software may be distributed and modified according to the terms of
5 * the GNU General Public License version 2. Note that NO WARRANTY is provided.
6 * See "LICENSE_GPLv2.txt" for details.
7 *
8 * @TAG(GD_GPL)
9 */
10
11#ifndef ARMV_BENCHMARK_H
12#define ARMV_BENCHMARK_H
13
14#ifdef CONFIG_ENABLE_BENCHMARKS
15
16#define CCNT "p15, 0, %0, c9, c13, 0"
17
18#ifdef CONFIG_BENCHMARK_TRACK_UTILISATION
19#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT
20extern uint64_t ccnt_num_overflows;
21#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */
22static inline void benchmark_arch_utilisation_reset(void)
23{
24#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT
25    ccnt_num_overflows = 0;
26#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */
27}
28#endif /* CONFIG_BENCHMARK_TRACK_UTILISATION */
29#endif /* CONFIG_ENABLE_BENCHMARKS */
30
31#endif /* ARMV_BENCHMARK_H */
32