aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/pmu.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/include/asm/pmu.h')
-rw-r--r--arch/arm/include/asm/pmu.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index 2829b9f981a1..8ccea012722c 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -12,33 +12,33 @@
12#ifndef __ARM_PMU_H__ 12#ifndef __ARM_PMU_H__
13#define __ARM_PMU_H__ 13#define __ARM_PMU_H__
14 14
15#ifdef CONFIG_CPU_HAS_PMU 15enum arm_pmu_type {
16 16 ARM_PMU_DEVICE_CPU = 0,
17struct pmu_irqs { 17 ARM_NUM_PMU_DEVICES,
18 const int *irqs;
19 int num_irqs;
20}; 18};
21 19
20#ifdef CONFIG_CPU_HAS_PMU
21
22/** 22/**
23 * reserve_pmu() - reserve the hardware performance counters 23 * reserve_pmu() - reserve the hardware performance counters
24 * 24 *
25 * Reserve the hardware performance counters in the system for exclusive use. 25 * Reserve the hardware performance counters in the system for exclusive use.
26 * The 'struct pmu_irqs' for the system is returned on success, ERR_PTR() 26 * The platform_device for the system is returned on success, ERR_PTR()
27 * encoded error on failure. 27 * encoded error on failure.
28 */ 28 */
29extern const struct pmu_irqs * 29extern struct platform_device *
30reserve_pmu(void); 30reserve_pmu(enum arm_pmu_type device);
31 31
32/** 32/**
33 * release_pmu() - Relinquish control of the performance counters 33 * release_pmu() - Relinquish control of the performance counters
34 * 34 *
35 * Release the performance counters and allow someone else to use them. 35 * Release the performance counters and allow someone else to use them.
36 * Callers must have disabled the counters and released IRQs before calling 36 * Callers must have disabled the counters and released IRQs before calling
37 * this. The 'struct pmu_irqs' returned from reserve_pmu() must be passed as 37 * this. The platform_device returned from reserve_pmu() must be passed as
38 * a cookie. 38 * a cookie.
39 */ 39 */
40extern int 40extern int
41release_pmu(const struct pmu_irqs *irqs); 41release_pmu(struct platform_device *pdev);
42 42
43/** 43/**
44 * init_pmu() - Initialise the PMU. 44 * init_pmu() - Initialise the PMU.
@@ -48,24 +48,26 @@ release_pmu(const struct pmu_irqs *irqs);
48 * the actual hardware initialisation. 48 * the actual hardware initialisation.
49 */ 49 */
50extern int 50extern int
51init_pmu(void); 51init_pmu(enum arm_pmu_type device);
52 52
53#else /* CONFIG_CPU_HAS_PMU */ 53#else /* CONFIG_CPU_HAS_PMU */
54 54
55static inline const struct pmu_irqs * 55#include <linux/err.h>
56reserve_pmu(void) 56
57static inline struct platform_device *
58reserve_pmu(enum arm_pmu_type device)
57{ 59{
58 return ERR_PTR(-ENODEV); 60 return ERR_PTR(-ENODEV);
59} 61}
60 62
61static inline int 63static inline int
62release_pmu(const struct pmu_irqs *irqs) 64release_pmu(struct platform_device *pdev)
63{ 65{
64 return -ENODEV; 66 return -ENODEV;
65} 67}
66 68
67static inline int 69static inline int
68init_pmu(void) 70init_pmu(enum arm_pmu_type device)
69{ 71{
70 return -ENODEV; 72 return -ENODEV;
71} 73}