[rtems commit] timecounter: Merge FreeBSD change r324528

Sebastian Huber sebh at rtems.org
Thu Oct 12 05:10:13 UTC 2017


Module:    rtems
Branch:    master
Commit:    bcbbe76396c4fcada2d7d4273078bbe9d7a61843
Changeset: http://git.rtems.org/rtems/commit/?id=bcbbe76396c4fcada2d7d4273078bbe9d7a61843

Author:    Konstantin Belousov <kib at FreeBSD.org>
Date:      Wed Oct 11 11:03:11 2017 +0000

timecounter: Merge FreeBSD change r324528

The th_bintime, th_microtime and th_nanotime members of the timehand all cache the last system time (uptime + boottime). Only the format differs. Do not re-calculate the bintime and simply use the value used to calculate the microtime and nanotime.

Group all the updates under the relevant comment.  Remove obsoleted
XXX part.

Submitted by:	Sebastian Huber <sebastian.huber at embedded-brains.de>
MFC after:	1 week

Update #3175.

---

 cpukit/score/src/kern_tc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c
index fa53fcd..306db0e 100644
--- a/cpukit/score/src/kern_tc.c
+++ b/cpukit/score/src/kern_tc.c
@@ -1596,10 +1596,8 @@ _Timecounter_Windup(struct bintime *new_boottimebin,
 		if (bt.sec != t)
 			th->th_boottime.sec += bt.sec - t;
 	}
-	th->th_bintime = th->th_offset;
-	bintime_add(&th->th_bintime, &th->th_boottime);
 	/* Update the UTC timestamps used by the get*() functions. */
-	/* XXX shouldn't do this here.  Should force non-`get' versions. */
+	th->th_bintime = bt;
 	bintime2timeval(&bt, &th->th_microtime);
 	bintime2timespec(&bt, &th->th_nanotime);
 



More information about the vc mailing list