Port-amiga archive

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

Re: Timer issues?



On Thu, 13 Aug 2009, Frank Wille 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.

But I would not dare to revert the code, because Michael wrote that he fixed
a bug with negative values. There may be a problem somewhere else. Maybe
Michael could comment on that.

Someone could try reverting my change and see how it performs. 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; the reason I changed the vax ICR counter mask was because I was seeing multiple messages about the monotonic clock running backwards].

--
Michael L. Hitch                        mhitch%montana.edu@localhost
Computer Consultant
Information Technology Center
Montana State University        Bozeman, MT     USA


Home | Main Index | Thread Index | Old Index