diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-17 12:21:23 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-17 12:21:23 -0400 |
commit | fda0e18c8a7a3e02747c2b045b4fcd2c920410b9 (patch) | |
tree | 6dac80c846592901cbfdcff029525d7994465282 /arch/arm/include/asm | |
parent | 98830bc9967b18d6f9a614a1f354f5580196ef85 (diff) | |
parent | d1e86d64bc48dedd0d68d182d0ce6951d8b4fd0d (diff) |
Merge branch 'devel-pmu' into devel
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r-- | arch/arm/include/asm/perf_event.h | 17 | ||||
-rw-r--r-- | arch/arm/include/asm/pmu.h | 27 |
2 files changed, 29 insertions, 15 deletions
diff --git a/arch/arm/include/asm/perf_event.h b/arch/arm/include/asm/perf_event.h index 49e3049aba32..48837e6d8887 100644 --- a/arch/arm/include/asm/perf_event.h +++ b/arch/arm/include/asm/perf_event.h | |||
@@ -28,4 +28,21 @@ set_perf_event_pending(void) | |||
28 | * same indexes here for consistency. */ | 28 | * same indexes here for consistency. */ |
29 | #define PERF_EVENT_INDEX_OFFSET 1 | 29 | #define PERF_EVENT_INDEX_OFFSET 1 |
30 | 30 | ||
31 | /* ARM perf PMU IDs for use by internal perf clients. */ | ||
32 | enum arm_perf_pmu_ids { | ||
33 | ARM_PERF_PMU_ID_XSCALE1 = 0, | ||
34 | ARM_PERF_PMU_ID_XSCALE2, | ||
35 | ARM_PERF_PMU_ID_V6, | ||
36 | ARM_PERF_PMU_ID_V6MP, | ||
37 | ARM_PERF_PMU_ID_CA8, | ||
38 | ARM_PERF_PMU_ID_CA9, | ||
39 | ARM_NUM_PMU_IDS, | ||
40 | }; | ||
41 | |||
42 | extern enum arm_perf_pmu_ids | ||
43 | armpmu_get_pmu_id(void); | ||
44 | |||
45 | extern int | ||
46 | armpmu_get_max_events(void); | ||
47 | |||
31 | #endif /* __ARM_PERF_EVENT_H__ */ | 48 | #endif /* __ARM_PERF_EVENT_H__ */ |
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h index 44bec1f02cb0..8ccea012722c 100644 --- a/arch/arm/include/asm/pmu.h +++ b/arch/arm/include/asm/pmu.h | |||
@@ -19,31 +19,26 @@ enum arm_pmu_type { | |||
19 | 19 | ||
20 | #ifdef CONFIG_CPU_HAS_PMU | 20 | #ifdef CONFIG_CPU_HAS_PMU |
21 | 21 | ||
22 | struct pmu_irqs { | ||
23 | const int *irqs; | ||
24 | int num_irqs; | ||
25 | }; | ||
26 | |||
27 | /** | 22 | /** |
28 | * reserve_pmu() - reserve the hardware performance counters | 23 | * reserve_pmu() - reserve the hardware performance counters |
29 | * | 24 | * |
30 | * Reserve the hardware performance counters in the system for exclusive use. | 25 | * Reserve the hardware performance counters in the system for exclusive use. |
31 | * 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() |
32 | * encoded error on failure. | 27 | * encoded error on failure. |
33 | */ | 28 | */ |
34 | extern const struct pmu_irqs * | 29 | extern struct platform_device * |
35 | reserve_pmu(void); | 30 | reserve_pmu(enum arm_pmu_type device); |
36 | 31 | ||
37 | /** | 32 | /** |
38 | * release_pmu() - Relinquish control of the performance counters | 33 | * release_pmu() - Relinquish control of the performance counters |
39 | * | 34 | * |
40 | * Release the performance counters and allow someone else to use them. | 35 | * Release the performance counters and allow someone else to use them. |
41 | * Callers must have disabled the counters and released IRQs before calling | 36 | * Callers must have disabled the counters and released IRQs before calling |
42 | * 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 |
43 | * a cookie. | 38 | * a cookie. |
44 | */ | 39 | */ |
45 | extern int | 40 | extern int |
46 | release_pmu(const struct pmu_irqs *irqs); | 41 | release_pmu(struct platform_device *pdev); |
47 | 42 | ||
48 | /** | 43 | /** |
49 | * init_pmu() - Initialise the PMU. | 44 | * init_pmu() - Initialise the PMU. |
@@ -53,24 +48,26 @@ release_pmu(const struct pmu_irqs *irqs); | |||
53 | * the actual hardware initialisation. | 48 | * the actual hardware initialisation. |
54 | */ | 49 | */ |
55 | extern int | 50 | extern int |
56 | init_pmu(void); | 51 | init_pmu(enum arm_pmu_type device); |
57 | 52 | ||
58 | #else /* CONFIG_CPU_HAS_PMU */ | 53 | #else /* CONFIG_CPU_HAS_PMU */ |
59 | 54 | ||
60 | static inline const struct pmu_irqs * | 55 | #include <linux/err.h> |
61 | reserve_pmu(void) | 56 | |
57 | static inline struct platform_device * | ||
58 | reserve_pmu(enum arm_pmu_type device) | ||
62 | { | 59 | { |
63 | return ERR_PTR(-ENODEV); | 60 | return ERR_PTR(-ENODEV); |
64 | } | 61 | } |
65 | 62 | ||
66 | static inline int | 63 | static inline int |
67 | release_pmu(const struct pmu_irqs *irqs) | 64 | release_pmu(struct platform_device *pdev) |
68 | { | 65 | { |
69 | return -ENODEV; | 66 | return -ENODEV; |
70 | } | 67 | } |
71 | 68 | ||
72 | static inline int | 69 | static inline int |
73 | init_pmu(void) | 70 | init_pmu(enum arm_pmu_type device) |
74 | { | 71 | { |
75 | return -ENODEV; | 72 | return -ENODEV; |
76 | } | 73 | } |