On 18.06.2012 15:20, Dave Mielke wrote: > [quoted lines by Vladimir 'φ-coder/phcoder' Serbinenko on 2012/06/18 at 14:39 > +0200] > >> Previously it was discussed how to make an equivalent of gettimeofday to >> work on GRUB. > > Yes. You may wish to check timing:getCurrentTime() to see if we got it right > for grub. >
I'll look into it. >> Now, I've realized that the current code using gettimeofday is wrong since >> the >> date gives no guaranty of being monotonic, and especially it isn't if >> someone >> runs "date" or "ntpdate" which is common operation, especially on systems >> where the RTC battery is failing. > > And during daylight saving time switches. :-) > Unless you use UTC. >> brltty should use time/gettimeofday only for timestamping logs and >> CLOCK_MONOTONIC (probably with some wrapper to make other monotonic clock >> sources easy to add) for all timing and timeout purposes. > > Yes, thanks, for timeouts that's an excellent point. I doubt CLOCK_MONOTONIC > existed way back whenever, but, yes, we really should fix this. We can always > code the current method as a fallback for builds on old systems. > > What should we be using within the Grub environment for this? grub_get_time_ms. On modern X86 it's based on TSC. > -- Regards Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature
_______________________________________________ This message was sent via the BRLTTY mailing list. To post a message, send an e-mail to: [email protected] For general information, go to: http://mielke.cc/mailman/listinfo/brltty
