1/*
2 * Copyright 2016, 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_IRQ_H
12#define ARMV_BENCHMARK_IRQ_H
13
14#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT
15
16static inline void armv_handleOverflowIRQ(void)
17{
18    uint32_t val;
19    /* Clear the overflow flag */
20    val = BIT(31);
21    asm volatile ("mcr p15, 0, %0, c9, c12, 3;" : : "r" (val));
22}
23#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */
24#endif /* ARMV_BENCHMARK_IRQ_H */
25