git: cb2a028b152b - main - pps: Load timecounter once in pps_capture()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 27 Feb 2023 22:12:18 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=cb2a028b152b09c1dc49d40d8031d27ce34b1585
commit cb2a028b152b09c1dc49d40d8031d27ce34b1585
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
AuthorDate: 2023-02-27 21:49:09 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-02-27 22:10:54 +0000
pps: Load timecounter once in pps_capture()
This ensures that the timecounter and the tc_get_timecount handler belong
together.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
---
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;
KASSERT(pps != NULL, ("NULL pps pointer in pps_capture"));
th = timehands;
@@ -1769,7 +1770,8 @@ pps_capture(struct pps_state *pps)
#ifdef FFCLOCK
pps->capffth = fftimehands;
#endif
- pps->capcount = th->th_counter->tc_get_timecount(th->th_counter);
+ tc = th->th_counter;
+ pps->capcount = tc->tc_get_timecount(tc);
atomic_thread_fence_acq();
if (pps->capgen != th->th_generation)
pps->capgen = 0;