aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hwpmc/hwpmc_mod.c
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2023-05-05 21:59:41 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2023-06-09 19:48:06 +0000
commit406f97fa59d73cd8242100fcfa79f35e5b494c1d (patch)
tree05125e2bff7be126b6d74ae77a6b1fdb99712e46 /sys/dev/hwpmc/hwpmc_mod.c
parent927a2f62980b69f2bf95c9e3c0424458d06f3886 (diff)
hwpmc: remove stub pmd_switch_{in,out} methods
Most platforms (non-x86) don't require these methods and implement stub versions. If we initialize the pmc_mdep structure to always point to the generic versions, then we can purge the duplicate stubs. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39913 (cherry picked from commit fa88954fd8f16ef60084a73d446a23e791ed22e5)
Diffstat (limited to 'sys/dev/hwpmc/hwpmc_mod.c')
-rw-r--r--sys/dev/hwpmc/hwpmc_mod.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
index 1ff427a1e965..571b403538ed 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -5455,6 +5455,10 @@ pmc_mdep_alloc(int nclasses)
sizeof(struct pmc_classdep), M_PMC, M_WAITOK|M_ZERO);
md->pmd_nclass = n;
+ /* Default methods */
+ md->pmd_switch_in = generic_switch_in;
+ md->pmd_switch_out = generic_switch_out;
+
/* Add base class. */
pmc_soft_initialize(md);
return md;
@@ -5492,9 +5496,6 @@ pmc_generic_cpu_initialize(void)
md->pmd_cputype = PMC_CPU_GENERIC;
- md->pmd_switch_in = generic_switch_in;
- md->pmd_switch_out = generic_switch_out;
-
return (md);
}