diff options
Diffstat (limited to 'arch/arm/include/asm/pmu.h')
-rw-r--r-- | arch/arm/include/asm/pmu.h | 32 |
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 | 15 | enum arm_pmu_type { |
16 | 16 | ARM_PMU_DEVICE_CPU = 0, | |
17 | struct 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 | */ |
29 | extern const struct pmu_irqs * | 29 | extern struct platform_device * |
30 | reserve_pmu(void); | 30 | reserve_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 | */ |
40 | extern int | 40 | extern int |
41 | release_pmu(const struct pmu_irqs *irqs); | 41 | release_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 | */ |
50 | extern int | 50 | extern int |
51 | init_pmu(void); | 51 | init_pmu(enum arm_pmu_type device); |
52 | 52 | ||
53 | #else /* CONFIG_CPU_HAS_PMU */ | 53 | #else /* CONFIG_CPU_HAS_PMU */ |
54 | 54 | ||
55 | static inline const struct pmu_irqs * | 55 | #include <linux/err.h> |
56 | reserve_pmu(void) | 56 | |
57 | static inline struct platform_device * | ||
58 | reserve_pmu(enum arm_pmu_type device) | ||
57 | { | 59 | { |
58 | return ERR_PTR(-ENODEV); | 60 | return ERR_PTR(-ENODEV); |
59 | } | 61 | } |
60 | 62 | ||
61 | static inline int | 63 | static inline int |
62 | release_pmu(const struct pmu_irqs *irqs) | 64 | release_pmu(struct platform_device *pdev) |
63 | { | 65 | { |
64 | return -ENODEV; | 66 | return -ENODEV; |
65 | } | 67 | } |
66 | 68 | ||
67 | static inline int | 69 | static inline int |
68 | init_pmu(void) | 70 | init_pmu(enum arm_pmu_type device) |
69 | { | 71 | { |
70 | return -ENODEV; | 72 | return -ENODEV; |
71 | } | 73 | } |