From: Mike Frysinger Date: Tue, 29 Nov 2011 10:06:20 -0500 Subject: [U-Boot] [PATCH] sandbox: Add timer simulation In-Reply-To: <4ED4A74A.1000501@googlemail.com> References: <1322516429-8471-1-git-send-email-weisserm@arcor.de> <201111281757.22701.vapier@gentoo.org> <4ED4A74A.1000501@googlemail.com> Message-ID: <201111291006.21685.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday 29 November 2011 04:35:06 Matthias Wei?er wrote: > Am 28.11.2011 23:57, schrieb Mike Frysinger: > > On Monday 28 November 2011 16:40:29 Matthias Weisser wrote: > >> Making sleep command work > > > > i like the idea, but using clock_xxx funcs makes me sad (generally > > requires a "newerish" glibc and -lrt). my only alternative proposal is > > to use usec's with gettimeofday ... maybe that's good enough ? although > > we'll probably need to add nsec support eventually anyways for the newer > > timer code ... > > I would like to stay with clock_gettime(CLOCK_MONOTONIC, ...) as the > value isn't subjected to change when wall time is changed. Still there > are chances to get wrong (non monotonic) values when NTP adjusts > frequencies. Maybe some ifdef magic can be used to even use > CLOCK_MONOTONIC_RAW if it is available and fall back to gettimeofday in > case of older systems. The only thing would be then -lrt on the linker > command line which has to be sorted out somehow. i think atm, we're focusing on sandbox working on Linux/glibc hosts. we're not *too* worried about portability atm. we can worry about that once sandbox is more than just a PoC toy :). -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: