diff options
author | Mitchell Horne <mhorne@FreeBSD.org> | 2023-05-05 22:00:02 +0000 |
---|---|---|
committer | Mitchell Horne <mhorne@FreeBSD.org> | 2023-06-09 19:47:33 +0000 |
commit | 1b7d148ed773259d1e247c326ff8d500f92f289a (patch) | |
tree | 1bd9a6946c78ddf3b40305f116bd1632c3ac6c09 /sys/sys | |
parent | e6b3aaa3e68db10ef4ef7ae25cefb04b3d61b5d2 (diff) | |
download | src-1b7d148ed773259d1e247c326ff8d500f92f289a.tar.gz src-1b7d148ed773259d1e247c326ff8d500f92f289a.zip |
hwpmc: pass pmc pointer to more class methods
In many cases this avoids an extra lookup, since the callers always have
pm at hand. We can also eliminate several assertions, mostly for pm !=
NULL. The class methods are an internal interface, and the callers
already handle such a scenario. No functional change intended.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39915
(cherry picked from commit 39f92a76a99a2ceb747250da4f2d627b9c317f8c)
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/pmc.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h index 8f817658fe55..b771dac81e93 100644 --- a/sys/sys/pmc.h +++ b/sys/sys/pmc.h @@ -62,7 +62,7 @@ * The patch version is incremented for every bug fix. */ #define PMC_VERSION_MAJOR 0x09 -#define PMC_VERSION_MINOR 0x03 +#define PMC_VERSION_MINOR 0x04 #define PMC_VERSION_PATCH 0x0000 #define PMC_VERSION (PMC_VERSION_MAJOR << 24 | \ @@ -1005,8 +1005,10 @@ struct pmc_classdep { /* configuring/reading/writing the hardware PMCs */ int (*pcd_config_pmc)(int _cpu, int _ri, struct pmc *_pm); int (*pcd_get_config)(int _cpu, int _ri, struct pmc **_ppm); - int (*pcd_read_pmc)(int _cpu, int _ri, pmc_value_t *_value); - int (*pcd_write_pmc)(int _cpu, int _ri, pmc_value_t _value); + int (*pcd_read_pmc)(int _cpu, int _ri, struct pmc *_pm, + pmc_value_t *_value); + int (*pcd_write_pmc)(int _cpu, int _ri, struct pmc *_pm, + pmc_value_t _value); /* pmc allocation/release */ int (*pcd_allocate_pmc)(int _cpu, int _ri, struct pmc *_t, @@ -1014,8 +1016,8 @@ struct pmc_classdep { int (*pcd_release_pmc)(int _cpu, int _ri, struct pmc *_pm); /* starting and stopping PMCs */ - int (*pcd_start_pmc)(int _cpu, int _ri); - int (*pcd_stop_pmc)(int _cpu, int _ri); + int (*pcd_start_pmc)(int _cpu, int _ri, struct pmc *_pm); + int (*pcd_stop_pmc)(int _cpu, int _ri, struct pmc *_pm); /* description */ int (*pcd_describe)(int _cpu, int _ri, struct pmc_info *_pi, |