This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Microsecond delay fix


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]