xref: /freebsd/sys/dev/hwpmc/hwpmc_perf.h (revision c4fde87a3236b500246d4fce76dbca2a3d64f73a)
1 /*
2  * Copyright (c) 2026 Advanced Micro Devices, Inc.
3  *
4  * SPDX-License-Identifier: BSD-2-Clause
5  *
6  * AMD/Intel MPERF/APERF MSR counters, and the AMD-only IRPERF counter,
7  * exposed as an hwpmc(4) PMC class.
8  */
9 
10 #ifdef  _KERNEL
11 
12 /*
13  * A row per MSR: MPERF, APERF and IRPERF.
14  */
15 
16 #define PERF_NPMCS_TOTAL	3
17 
18 extern	int	tsc_perf_stat;
19 extern	u_int	cpu_power_ecx;
20 extern	u_int	amd_extended_feature_extensions;
21 
22 /*
23  * Prototypes.
24  */
25 
26 int     pmc_perf_initialize(struct pmc_mdep *_md, int maxcpu, int classindex);
27 void    pmc_perf_finalize(struct pmc_mdep *_md);
28 #endif  /* _KERNEL */
29