Date: Thu, 7 Jul 2022 17:25:03 +0200 From: Sebastian Huber <sebastian.huber@embedded-brains.de> To: freebsd-hackers@freebsd.org Subject: [PATCH 3/6] pps: Move pcount assignment in pps_event() Message-ID: <20220707152506.55626-4-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
Move the pseq increment. This makes it possible to reuse registers earli= er. --- sys/kern/kern_tc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index b466fd4399e4..b625726123af 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -1842,25 +1842,25 @@ pps_event(struct pps_state *pps, int event) #endif } =20 + *pcount =3D pps->capcount; + /* * If the timecounter changed, we cannot compare the count values, so * we have to drop the rest of the PPS-stuff until the next event. */ if (__predict_false(pps->ppstc !=3D captc)) { pps->ppstc =3D captc; - *pcount =3D pps->capcount; pps->ppscount[2] =3D pps->capcount; return; } =20 + (*pseq)++; + /* Convert the count to a timespec. */ tcount =3D pps->capcount - tcount; tcount &=3D captc->tc_counter_mask; bintime_addx(&bt, capth_scale * tcount); bintime2timespec(&bt, &ts); - - *pcount =3D pps->capcount; - (*pseq)++; *tsp =3D ts; =20 if (foff) { --=20 2.35.3
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20220707152506.55626-4-sebastian.huber>