Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Oct 2019 16:05:20 +0200
From:      Sebastian Huber <sebastian.huber@embedded-brains.de>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>, Warner Losh <imp@bsdimp.com>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, Bruce Evans <brde@optusnet.com.au>, FreeBSD <freebsd-hackers@freebsd.org>
Subject:   Re: Why is tc_get_timecount() called two times in tc_init()?
Message-ID:  <141ee0af-2ff4-50fc-b4e4-6d1fc47e04f3@embedded-brains.de>
In-Reply-To: <47834.1570116246@critter.freebsd.dk>
References:  <0e27fb3e-0f60-68e1-dbba-f17c3d91c332@embedded-brains.de> <20191002140040.GA44691@kib.kiev.ua> <20191003013314.O2151@besplex.bde.org> <20191002163946.GE44691@kib.kiev.ua> <20191003030837.C2787@besplex.bde.org> <20191003084021.GI44691@kib.kiev.ua> <CANCZdfpcOBJiYAKafhiWZS2g4vnLGVvzqhaOXetSSnU2Hj91nw@mail.gmail.com> <47834.1570116246@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03/10/2019 17:24, Poul-Henning Kamp wrote:
> --------
> In message <CANCZdfpcOBJiYAKafhiWZS2g4vnLGVvzqhaOXetSSnU2Hj91nw@mail.gm=
ail.com>
> , Warner Losh writes:
>=20
>> I think this is a good fix. I recall phk saying it was more paranoia f=
or
>> edge cases than really needed in a private email to me, but it's in th=
e
>> 'gap' of email that I lost in a disk crash 12 years ago so I can't fin=
d it
>> for sure.
>=20
> I think the original reason for this was (locked) delta-based
> timecounters, (ie counters which roll over rapidly) in order that
> their first "real" use would not return truly bogus values.

Ok, this explanation makes sense. When I ported the FreeBSD timecounter=20
implementation to RTEMS I was a bit surprised how many chips (even a=20
Cortex-M has nothing out of the box) lack a simple free running counter.=20
Maybe it should be added as a comment to these two tc_get_timecount() cal=
ls?

--=20
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine gesch=C3=A4ftliche Mitteilung im Sinne des EHUG=
.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?141ee0af-2ff4-50fc-b4e4-6d1fc47e04f3>