Commit a6c93afe authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon

ARM: perf: de-const struct arm_pmu

This patch removes const qualifiers from instances of struct arm_pmu,
and functions initialising them, in preparation for generalising
arm_pmu usage to system (AKA uncore) PMUs.

This will allow for dynamically modifiable structures (locks,
struct pmu) to be added as members of struct arm_pmu.
Acked-by: default avatarJamie Iles <jamie@jamieiles.com>
Reviewed-by: default avatarJean Pihet <j-pihet@ti.com>
Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 90e93648
...@@ -90,7 +90,7 @@ struct arm_pmu { ...@@ -90,7 +90,7 @@ struct arm_pmu {
}; };
/* Set at runtime when we know what CPU type we are. */ /* Set at runtime when we know what CPU type we are. */
static const struct arm_pmu *armpmu; static struct arm_pmu *armpmu;
enum arm_perf_pmu_ids enum arm_perf_pmu_ids
armpmu_get_pmu_id(void) armpmu_get_pmu_id(void)
......
...@@ -635,7 +635,7 @@ armv6mpcore_pmu_disable_event(struct hw_perf_event *hwc, ...@@ -635,7 +635,7 @@ armv6mpcore_pmu_disable_event(struct hw_perf_event *hwc,
raw_spin_unlock_irqrestore(&pmu_lock, flags); raw_spin_unlock_irqrestore(&pmu_lock, flags);
} }
static const struct arm_pmu armv6pmu = { static struct arm_pmu armv6pmu = {
.id = ARM_PERF_PMU_ID_V6, .id = ARM_PERF_PMU_ID_V6,
.name = "v6", .name = "v6",
.handle_irq = armv6pmu_handle_irq, .handle_irq = armv6pmu_handle_irq,
...@@ -653,7 +653,7 @@ static const struct arm_pmu armv6pmu = { ...@@ -653,7 +653,7 @@ static const struct arm_pmu armv6pmu = {
.max_period = (1LLU << 32) - 1, .max_period = (1LLU << 32) - 1,
}; };
static const struct arm_pmu *__init armv6pmu_init(void) static struct arm_pmu *__init armv6pmu_init(void)
{ {
return &armv6pmu; return &armv6pmu;
} }
...@@ -665,7 +665,7 @@ static const struct arm_pmu *__init armv6pmu_init(void) ...@@ -665,7 +665,7 @@ static const struct arm_pmu *__init armv6pmu_init(void)
* disable the interrupt reporting and update the event. When unthrottling we * disable the interrupt reporting and update the event. When unthrottling we
* reset the period and enable the interrupt reporting. * reset the period and enable the interrupt reporting.
*/ */
static const struct arm_pmu armv6mpcore_pmu = { static struct arm_pmu armv6mpcore_pmu = {
.id = ARM_PERF_PMU_ID_V6MP, .id = ARM_PERF_PMU_ID_V6MP,
.name = "v6mpcore", .name = "v6mpcore",
.handle_irq = armv6pmu_handle_irq, .handle_irq = armv6pmu_handle_irq,
...@@ -683,17 +683,17 @@ static const struct arm_pmu armv6mpcore_pmu = { ...@@ -683,17 +683,17 @@ static const struct arm_pmu armv6mpcore_pmu = {
.max_period = (1LLU << 32) - 1, .max_period = (1LLU << 32) - 1,
}; };
static const struct arm_pmu *__init armv6mpcore_pmu_init(void) static struct arm_pmu *__init armv6mpcore_pmu_init(void)
{ {
return &armv6mpcore_pmu; return &armv6mpcore_pmu;
} }
#else #else
static const struct arm_pmu *__init armv6pmu_init(void) static struct arm_pmu *__init armv6pmu_init(void)
{ {
return NULL; return NULL;
} }
static const struct arm_pmu *__init armv6mpcore_pmu_init(void) static struct arm_pmu *__init armv6mpcore_pmu_init(void)
{ {
return NULL; return NULL;
} }
......
...@@ -1188,7 +1188,7 @@ static u32 __init armv7_read_num_pmnc_events(void) ...@@ -1188,7 +1188,7 @@ static u32 __init armv7_read_num_pmnc_events(void)
return nb_cnt + 1; return nb_cnt + 1;
} }
static const struct arm_pmu *__init armv7_a8_pmu_init(void) static struct arm_pmu *__init armv7_a8_pmu_init(void)
{ {
armv7pmu.id = ARM_PERF_PMU_ID_CA8; armv7pmu.id = ARM_PERF_PMU_ID_CA8;
armv7pmu.name = "ARMv7 Cortex-A8"; armv7pmu.name = "ARMv7 Cortex-A8";
...@@ -1198,7 +1198,7 @@ static const struct arm_pmu *__init armv7_a8_pmu_init(void) ...@@ -1198,7 +1198,7 @@ static const struct arm_pmu *__init armv7_a8_pmu_init(void)
return &armv7pmu; return &armv7pmu;
} }
static const struct arm_pmu *__init armv7_a9_pmu_init(void) static struct arm_pmu *__init armv7_a9_pmu_init(void)
{ {
armv7pmu.id = ARM_PERF_PMU_ID_CA9; armv7pmu.id = ARM_PERF_PMU_ID_CA9;
armv7pmu.name = "ARMv7 Cortex-A9"; armv7pmu.name = "ARMv7 Cortex-A9";
...@@ -1208,7 +1208,7 @@ static const struct arm_pmu *__init armv7_a9_pmu_init(void) ...@@ -1208,7 +1208,7 @@ static const struct arm_pmu *__init armv7_a9_pmu_init(void)
return &armv7pmu; return &armv7pmu;
} }
static const struct arm_pmu *__init armv7_a5_pmu_init(void) static struct arm_pmu *__init armv7_a5_pmu_init(void)
{ {
armv7pmu.id = ARM_PERF_PMU_ID_CA5; armv7pmu.id = ARM_PERF_PMU_ID_CA5;
armv7pmu.name = "ARMv7 Cortex-A5"; armv7pmu.name = "ARMv7 Cortex-A5";
...@@ -1218,7 +1218,7 @@ static const struct arm_pmu *__init armv7_a5_pmu_init(void) ...@@ -1218,7 +1218,7 @@ static const struct arm_pmu *__init armv7_a5_pmu_init(void)
return &armv7pmu; return &armv7pmu;
} }
static const struct arm_pmu *__init armv7_a15_pmu_init(void) static struct arm_pmu *__init armv7_a15_pmu_init(void)
{ {
armv7pmu.id = ARM_PERF_PMU_ID_CA15; armv7pmu.id = ARM_PERF_PMU_ID_CA15;
armv7pmu.name = "ARMv7 Cortex-A15"; armv7pmu.name = "ARMv7 Cortex-A15";
...@@ -1228,22 +1228,22 @@ static const struct arm_pmu *__init armv7_a15_pmu_init(void) ...@@ -1228,22 +1228,22 @@ static const struct arm_pmu *__init armv7_a15_pmu_init(void)
return &armv7pmu; return &armv7pmu;
} }
#else #else
static const struct arm_pmu *__init armv7_a8_pmu_init(void) static struct arm_pmu *__init armv7_a8_pmu_init(void)
{ {
return NULL; return NULL;
} }
static const struct arm_pmu *__init armv7_a9_pmu_init(void) static struct arm_pmu *__init armv7_a9_pmu_init(void)
{ {
return NULL; return NULL;
} }
static const struct arm_pmu *__init armv7_a5_pmu_init(void) static struct arm_pmu *__init armv7_a5_pmu_init(void)
{ {
return NULL; return NULL;
} }
static const struct arm_pmu *__init armv7_a15_pmu_init(void) static struct arm_pmu *__init armv7_a15_pmu_init(void)
{ {
return NULL; return NULL;
} }
......
...@@ -424,7 +424,7 @@ xscale1pmu_write_counter(int counter, u32 val) ...@@ -424,7 +424,7 @@ xscale1pmu_write_counter(int counter, u32 val)
} }
} }
static const struct arm_pmu xscale1pmu = { static struct arm_pmu xscale1pmu = {
.id = ARM_PERF_PMU_ID_XSCALE1, .id = ARM_PERF_PMU_ID_XSCALE1,
.name = "xscale1", .name = "xscale1",
.handle_irq = xscale1pmu_handle_irq, .handle_irq = xscale1pmu_handle_irq,
...@@ -442,7 +442,7 @@ static const struct arm_pmu xscale1pmu = { ...@@ -442,7 +442,7 @@ static const struct arm_pmu xscale1pmu = {
.max_period = (1LLU << 32) - 1, .max_period = (1LLU << 32) - 1,
}; };
static const struct arm_pmu *__init xscale1pmu_init(void) static struct arm_pmu *__init xscale1pmu_init(void)
{ {
return &xscale1pmu; return &xscale1pmu;
} }
...@@ -786,7 +786,7 @@ xscale2pmu_write_counter(int counter, u32 val) ...@@ -786,7 +786,7 @@ xscale2pmu_write_counter(int counter, u32 val)
} }
} }
static const struct arm_pmu xscale2pmu = { static struct arm_pmu xscale2pmu = {
.id = ARM_PERF_PMU_ID_XSCALE2, .id = ARM_PERF_PMU_ID_XSCALE2,
.name = "xscale2", .name = "xscale2",
.handle_irq = xscale2pmu_handle_irq, .handle_irq = xscale2pmu_handle_irq,
...@@ -804,17 +804,17 @@ static const struct arm_pmu xscale2pmu = { ...@@ -804,17 +804,17 @@ static const struct arm_pmu xscale2pmu = {
.max_period = (1LLU << 32) - 1, .max_period = (1LLU << 32) - 1,
}; };
static const struct arm_pmu *__init xscale2pmu_init(void) static struct arm_pmu *__init xscale2pmu_init(void)
{ {
return &xscale2pmu; return &xscale2pmu;
} }
#else #else
static const struct arm_pmu *__init xscale1pmu_init(void) static struct arm_pmu *__init xscale1pmu_init(void)
{ {
return NULL; return NULL;
} }
static const struct arm_pmu *__init xscale2pmu_init(void) static struct arm_pmu *__init xscale2pmu_init(void)
{ {
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment