linux/drivers/perf/arm_cspmu/arm_cspmu.h

/* SPDX-License-Identifier: GPL-2.0
 *
 * ARM CoreSight Architecture PMU driver.
 * Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 *
 */

#ifndef __ARM_CSPMU_H__
#define __ARM_CSPMU_H__

#include <linux/bitfield.h>
#include <linux/cpumask.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/perf_event.h>
#include <linux/platform_device.h>
#include <linux/types.h>

#define to_arm_cspmu(p)

#define ARM_CSPMU_EXT_ATTR(_name, _func, _config)

#define ARM_CSPMU_FORMAT_ATTR(_name, _config)

#define ARM_CSPMU_EVENT_ATTR(_name, _config)


/* Default event id mask */
#define ARM_CSPMU_EVENT_MASK

/* Default filter value mask */
#define ARM_CSPMU_FILTER_MASK

/* Default event format */
#define ARM_CSPMU_FORMAT_EVENT_ATTR

/* Default filter format */
#define ARM_CSPMU_FORMAT_FILTER_ATTR

/*
 * This is the default event number for cycle count, if supported, since the
 * ARM Coresight PMU specification does not define a standard event code
 * for cycle count.
 */
#define ARM_CSPMU_EVT_CYCLES_DEFAULT

/*
 * The ARM Coresight PMU supports up to 256 event counters.
 * If the counters are larger-than 32-bits, then the PMU includes at
 * most 128 counters.
 */
#define ARM_CSPMU_MAX_HW_CNTRS

/* The cycle counter, if implemented, is located at counter[31]. */
#define ARM_CSPMU_CYCLE_CNTR_IDX

/* PMIIDR register field */
#define ARM_CSPMU_PMIIDR_IMPLEMENTER
#define ARM_CSPMU_PMIIDR_PRODUCTID

/* JEDEC-assigned JEP106 identification code */
#define ARM_CSPMU_IMPL_ID_NVIDIA
#define ARM_CSPMU_IMPL_ID_AMPERE

struct arm_cspmu;

/* This tracks the events assigned to each counter in the PMU. */
struct arm_cspmu_hw_events {};

/* Contains ops to query vendor/implementer specific attribute. */
struct arm_cspmu_impl_ops {};

/* Vendor/implementer registration parameter. */
struct arm_cspmu_impl_match {};

/* Vendor/implementer descriptor. */
struct arm_cspmu_impl {};

/* Coresight PMU descriptor. */
struct arm_cspmu {};

/* Default function to show event attribute in sysfs. */
ssize_t arm_cspmu_sysfs_event_show(struct device *dev,
				   struct device_attribute *attr,
				   char *buf);

/* Register vendor backend. */
int arm_cspmu_impl_register(const struct arm_cspmu_impl_match *impl_match);

/* Unregister vendor backend. */
void arm_cspmu_impl_unregister(const struct arm_cspmu_impl_match *impl_match);

#endif /* __ARM_CSPMU_H__ */