Why is tc_get_timecount() called two times in tc_init()?

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Oct 4 14:05:29 UTC 2019


On 03/10/2019 17:24, Poul-Henning Kamp wrote:
> --------
> In message <CANCZdfpcOBJiYAKafhiWZS2g4vnLGVvzqhaOXetSSnU2Hj91nw at mail.gmail.com>
> , Warner Losh writes:
> 
>> I think this is a good fix. I recall phk saying it was more paranoia for
>> edge cases than really needed in a private email to me, but it's in the
>> 'gap' of email that I lost in a disk crash 12 years ago so I can't find it
>> for sure.
> 
> 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 
implementation to RTEMS I was a bit surprised how many chips (even a 
Cortex-M has nothing out of the box) lack a simple free running counter. 
Maybe it should be added as a comment to these two tc_get_timecount() calls?

-- 
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 at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


More information about the freebsd-hackers mailing list