Skip site navigation (1)Skip section navigation (2)
Date:      Thu,  7 Jul 2022 17:25:01 +0200
From:      Sebastian Huber <sebastian.huber@embedded-brains.de>
To:        freebsd-hackers@freebsd.org
Subject:   [PATCH 1/6] pps: Load timecounter once in pps_capture()
Message-ID:  <20220707152506.55626-2-sebastian.huber@embedded-brains.de>
In-Reply-To: <20220707152506.55626-1-sebastian.huber@embedded-brains.de>
References:  <20220707152506.55626-1-sebastian.huber@embedded-brains.de>

next in thread | previous in thread | raw e-mail | index | archive | help
This ensures that the timecounter and the tc_get_timecount handler belong
together.
---
 sys/kern/kern_tc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index 37287df4d1fd..20520adc0aba 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -1761,6 +1761,7 @@ void
 pps_capture(struct pps_state *pps)
 {
 	struct timehands *th;
+	struct timecounter *tc;
=20
 	KASSERT(pps !=3D NULL, ("NULL pps pointer in pps_capture"));
 	th =3D timehands;
@@ -1769,7 +1770,8 @@ pps_capture(struct pps_state *pps)
 #ifdef FFCLOCK
 	pps->capffth =3D fftimehands;
 #endif
-	pps->capcount =3D th->th_counter->tc_get_timecount(th->th_counter);
+	tc =3D th->th_counter;
+	pps->capcount =3D tc->tc_get_timecount(tc);
 	atomic_thread_fence_acq();
 	if (pps->capgen !=3D th->th_generation)
 		pps->capgen =3D 0;
--=20
2.35.3




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20220707152506.55626-2-sebastian.huber>