Port-amiga archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Timer issues?



Michael Hitch wrote:

>> IMHO it is wrong when applying a mask of 0xfff to the result of the
>> tc_get_timecount() function, which, in the amiga/dev/clock.c case,
>> returns the hardclock_ticks * amiga_clk_interval + clock_tick (read
>> directly from CIA timer). A mask of ~0 should work better.
> 
>   Hmm, looking at this again make me think the smaller mask shouldn't be 
> needed.  the 'hardclock_ticks * amiga_clk_interval + clock_tick' should be
> emulating a free-running 32 bit counter running at eclockfreq.

Yes! That's what I was trying to say. :)


>   Someone could try reverting my change and see how it performs.

Just tried it, and it works fine. The CIA-B timecounter is used again and
/sbin/ping reports more precise round-trip times.


> There
> was a check for a negative runtime added to sched_pstats() after my change
> that may fire [that check was also changed to only print once - when
> testing, the test for the first message could be disabled;

Unfortunately the "negative runtime" warning appears, after reverting clock.c.
And when I allow it to print more than once, it will appear exactly every
second. :|

I don't understand where the negative runtime comes from. We have a
monotonic 32-bit timer, don't we?


-- 
Frank Wille



Home | Main Index | Thread Index | Old Index