#include <linux/io.h>
#include <linux/module.h>
#include <linux/topology.h>
#include "arm_cspmu.h"
#define PMAUXR0 …
#define PMAUXR1 …
#define PMAUXR2 …
#define PMAUXR3 …
#define to_ampere_cspmu_ctx(cspmu) …
struct ampere_cspmu_ctx { … };
static DEFINE_IDA(mcu_pmu_ida);
#define SOC_PMU_EVENT_ATTR_EXTRACTOR(_name, _config, _start, _end) … \
SOC_PMU_EVENT_ATTR_EXTRACTOR(event, config, 0, 8);
SOC_PMU_EVENT_ATTR_EXTRACTOR(threshold, config1, 0, 7);
SOC_PMU_EVENT_ATTR_EXTRACTOR(rank, config1, 8, 23);
SOC_PMU_EVENT_ATTR_EXTRACTOR(bank, config1, 24, 55);
static struct attribute *ampereone_mcu_pmu_event_attrs[] = …;
static struct attribute *ampereone_mcu_format_attrs[] = …;
static struct attribute **
ampere_cspmu_get_event_attrs(const struct arm_cspmu *cspmu)
{ … }
static struct attribute **
ampere_cspmu_get_format_attrs(const struct arm_cspmu *cspmu)
{ … }
static const char *
ampere_cspmu_get_name(const struct arm_cspmu *cspmu)
{ … }
static u32 ampere_cspmu_event_filter(const struct perf_event *event)
{ … }
static void ampere_cspmu_set_ev_filter(struct arm_cspmu *cspmu,
struct hw_perf_event *hwc,
u32 filter)
{ … }
static int ampere_cspmu_validate_configs(struct perf_event *event,
struct perf_event *event2)
{ … }
static int ampere_cspmu_validate_event(struct arm_cspmu *cspmu,
struct perf_event *new)
{ … }
static char *ampere_cspmu_format_name(const struct arm_cspmu *cspmu,
const char *name_pattern)
{ … }
static int ampere_cspmu_init_ops(struct arm_cspmu *cspmu)
{ … }
static const struct arm_cspmu_impl_match ampere_cspmu_param = …;
static int __init ampere_cspmu_init(void)
{ … }
static void __exit ampere_cspmu_exit(void)
{ … }
module_init(…) …;
module_exit(ampere_cspmu_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;