diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-02-27 21:49:09 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2023-02-27 22:10:55 +0000 |
commit | 0448501f2b1a2c89be4042817939645ec6fddfd8 (patch) | |
tree | 84457d1f18eeb1ab48abf91f9633b6415a59bc22 | |
parent | fd88f4e190bc0a56f8d30179900553ce12d1c0d7 (diff) | |
download | src-0448501f2b1a2c89be4042817939645ec6fddfd8.tar.gz src-0448501f2b1a2c89be4042817939645ec6fddfd8.zip |
pps: Move pcount assignment in pps_event()
Move the pseq increment. This makes it possible to reuse registers earlier.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
-rw-r--r-- | sys/kern/kern_tc.c | 8 |
1 files 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 } + *pcount = 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 != captc)) { pps->ppstc = captc; - *pcount = pps->capcount; pps->ppscount[2] = pps->capcount; return; } + (*pseq)++; + /* Convert the count to a timespec. */ tcount = pps->capcount - tcount; tcount &= captc->tc_counter_mask; bintime_addx(&bt, capth_scale * tcount); bintime2timespec(&bt, &ts); - - *pcount = pps->capcount; - (*pseq)++; *tsp = ts; if (foff) { |