[PATCH 07/12] kern_tc.c: Remove verification of th_generation for pps functions

Gabriel Moyano gabriel.moyano at dlr.de
Thu Apr 7 08:36:02 UTC 2022


---
 cpukit/score/src/kern_tc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c
index a5c7b4b841..a8ba268ea3 100644
--- a/cpukit/score/src/kern_tc.c
+++ b/cpukit/score/src/kern_tc.c
@@ -2109,9 +2109,11 @@ pps_capture(struct pps_state *pps)
 	pps->capffth = fftimehands;
 #endif
 	pps->capcount = th->th_counter->tc_get_timecount(th->th_counter);
+#ifndef __rtems__
 	atomic_thread_fence_acq();
 	if (pps->capgen != th->th_generation)
 		pps->capgen = 0;
+#endif /* __rtems__ */
 }
 
 void
@@ -2135,10 +2137,12 @@ pps_event(struct pps_state *pps, int event)
 	/* Nothing to do if not currently set to capture this event type. */
 	if ((event & pps->ppsparam.mode) == 0)
 		return;
+#ifndef __rtems__
 	/* If the timecounter was wound up underneath us, bail out. */
 	if (pps->capgen == 0 || pps->capgen !=
 	    atomic_load_acq_int(&pps->capth->th_generation))
 		return;
+#endif /* __rtems__ */
 
 	/* Things would be easier with arrays. */
 	if (event == PPS_CAPTUREASSERT) {
@@ -2189,10 +2193,12 @@ pps_event(struct pps_state *pps, int event)
 	bintime_addx(&bt, pps->capth->th_scale * tcount);
 	bintime2timespec(&bt, &ts);
 
+#ifndef __rtems__
 	/* If the timecounter was wound up underneath us, bail out. */
 	atomic_thread_fence_acq();
 	if (pps->capgen != pps->capth->th_generation)
 		return;
+#endif /* __rtems__ */
 
 	*pcount = pps->capcount;
 	(*pseq)++;
-- 
2.25.1



More information about the devel mailing list