diff options
author | ian <ian@FreeBSD.org> | 2015-08-07 23:31:31 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2015-08-07 23:31:31 +0000 |
commit | 33a3844dbf69152b9d47f6fa1ac1c2d5b1d502e4 (patch) | |
tree | 38835d5d0de167020a1f5ed812f4912d12f4de02 | |
parent | cbf6cdcbbb6c0212ee9911bbbe9e87053b54ab9f (diff) | |
download | FreeBSD-src-33a3844dbf69152b9d47f6fa1ac1c2d5b1d502e4.zip FreeBSD-src-33a3844dbf69152b9d47f6fa1ac1c2d5b1d502e4.tar.gz |
Only process the PPS event types currently enabled in pps_params.mode.
This makes the PPS API behave correctly, but isn't ideal -- we still end
up capturing PPS data for non-enabled edges, we just don't process the
data into an event that becomes visible outside of kern_tc. That's because
the event type isn't passed to pps_capture(), so it can't do the filtering.
Any solution for capture filtering is going to require touching every driver.
-rw-r--r-- | sys/kern/kern_tc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 922e9bf..d09f0b6 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -1703,6 +1703,9 @@ pps_event(struct pps_state *pps, int event) #endif KASSERT(pps != NULL, ("NULL pps pointer in pps_event")); + /* Nothing to do if not currently set to capture this event type. */ + if ((event & pps->ppsparam.mode) == 0) + return; /* If the timecounter was wound up underneath us, bail out. */ if (pps->capgen == 0 || pps->capgen != atomic_load_acq_int(&pps->capth->th_generation)) |