This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: MS_TICKS() revisited
- To: Grant Edwards <grante at visi dot com>
- Subject: Re: [ECOS] MS_TICKS() revisited
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Fri, 09 Feb 2001 19:50:04 +0000
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat UK Ltd.
- References: <20010209131835.A4738@visi.com>
Grant Edwards wrote:
>
> I've modified my ms_ticks stuff so that there are two routines.
> Both return the current system time, but one delays for a
> millisecond and the other doesn't.
>
> do_ms_tick() // delays for 1ms, returns system time
> get_ms_ticks() // returns system time
>
> #define MS_TICKS() get_ms_ticks()
> #define MS_TICKS_DELAY() -> do_ms_tick()
>
> This saves a few milliseconds of overhead here and there
> (nothing worth worrying about), but mostly it makes it clear
> whether the caller wants to delay for a millisecond or just to
> read the system time.
>
> Attached is a patch against CVS sources for anybody who wants it.
>
> I've only done limited testing, so it's possible I'm missing a
> delay where I need one. IOW, there may be an MS_TICKS() that
> should be MS_TICKS_DELAY() -- but I don't think so.
Thanks for the patch. One query before I apply it:
+#if !defined(CYGPKG_REDBOOT_NETWORKING)
+#define MS_TICKS_DELAY() hal_delay_us(1000)
+#endif
+
Any reason this isn't do_ms_tick() ?
> NB: this patch also includes a fix to net_io_getc_nonblock() so
> that it always sets its return value properly. AFAICT, the
> old version worked OK because whatever happened to be left
> in R0 when the function fell off the bottom always had a
> non-zero.
I've already fixed this in the repository, so Gary, if you get there before
I do, be warned :-).
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine