This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: Microsecond delay fix
- From: Motoya Kurotsu <kurotsu at allied-telesis dot co dot jp>
- To: ecos-patches at sources dot redhat dot com
- Date: Tue, 1 Apr 2003 17:20:54 +0900
- Subject: Re: Microsecond delay fix
- References: <m3brzrcudc.fsf@miso.calivar.com>
On Mon, Mar 31, 2003 at 05:34:55PM +0000, Nick Garnett wrote:
>
> This fixes problems with timers that have large values for
> CYGNUM_KERNEL_COUNTERS_RTC_PERIOD.
>
> Before I check this in I would like some others to look it over and
> check that the logic is right.
>
Hi, Nick;
Hmm.. I suspect that your algorithm may result in infinate loop.
Assume the case in the following;
usecs = 1
CYGNUM_KERNEL_COUNTERS_RTC_PERIOD = n * usec_per_period + m
(n > 0, 0 < m < usec_pre_period, n,m: integer)
then,
slice = n
After do loop, at worst,
elased = n
then,
elapsed_usec = (n * usec_per_period) / (n * usec_per_period + m) = 0
then, still,
usecs = 1
4/1/03
Motoya Kurotsu
Allied Telesis K.K.