aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Mitchell <ehem+freebsd@m5p.com>2024-05-09 23:04:34 +0000
committerWarner Losh <imp@FreeBSD.org>2024-05-09 23:14:29 +0000
commite64318e76ed90e8ef2666a9c5628e036d2cc8817 (patch)
tree03cad5ae74ce24e981fe47557a9b24d162e29c89
parent24d5cc14dd60b49553ff3ee7830305621f782ff1 (diff)
downloadsrc-e64318e76ed90e8ef2666a9c5628e036d2cc8817.tar.gz
src-e64318e76ed90e8ef2666a9c5628e036d2cc8817.zip
arm/pmu: remove passing trap frame as argument
While otherwise a handy potential approach, getting the trap frame via the argument isn't documented and isn't supposed to be used. Adjust pmu_intr() to instead use curthread->td_intr_frame, which is the proper way. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1126
-rw-r--r--sys/arm/arm/pmu.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/arm/arm/pmu.c b/sys/arm/arm/pmu.c
index 98d8cdcf2df8..050121934447 100644
--- a/sys/arm/arm/pmu.c
+++ b/sys/arm/arm/pmu.c
@@ -46,6 +46,7 @@
#include <sys/timetc.h>
#include <sys/pmc.h>
#include <sys/pmckern.h>
+#include <sys/proc.h>
#include <machine/bus.h>
#include <machine/cpu.h>
@@ -65,9 +66,6 @@ uint32_t ccnt_hi[MAXCPU];
static int
pmu_intr(void *arg)
{
-#ifdef HWPMC_HOOKS
- struct trapframe *tf;
-#endif
uint32_t r;
#if defined(__arm__) && (__ARM_ARCH > 6)
u_int cpu;
@@ -87,10 +85,8 @@ pmu_intr(void *arg)
#ifdef HWPMC_HOOKS
/* Only call into the HWPMC framework if we know there is work. */
- if (r != 0 && pmc_intr) {
- tf = arg;
- (*pmc_intr)(tf);
- }
+ if (r != 0 && pmc_intr)
+ (*pmc_intr)(curthread->td_intr_frame);
#endif
return (FILTER_HANDLED);