Port-amiga archive

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

Re: Keyboard lockup with NetBSD5



Ignatios Souvatzis wrote:

On 14.11.09 09:40:41 you wrote:

> DraCo Rev 4. has no guaranteed CIA, - for the clock interupt, it has a 
> freerunning counter instead - so the easiest and cleanest solution was
> to copy the Sun3 method for DELAY, which was a calibrated counter at a
> cache-aligned position, (initialized to the value for the fastest CPU
> of each type, and calibrated by the clock device at early
> initialization.) This way, it was independent of additional hardware.

Ok. I had a look at the 4.0 source. I'm not sure if it had the same
precision (it probably has), but it definitely had less overhead.


> I did not look closely at the timecounter implementation - I've always
> meant to, but didn't find the time - but I never suspected it would 
> replace the DELAY routine.

It doesn't have to. But did you try it on a DraCo? Both, the timecounter and
delay(), are calling clk_gettick(), which also seems to be prepared for the
DraCo Rev.4 timer.

The following patch makes delay() work (for keyboard and floppy disk):

RCS file: /cvsroot/src/sys/arch/amiga/dev/clock.c,v
retrieving revision 1.50
diff -r1.50 clock.c
697c697
<                       remaining -= amiga_clk_interval - (cur_tick -
initial_tick);
---
>                       remaining -= cur_tick - initial_tick;
699c699
<                       remaining -= initial_tick - cur_tick;
---
>                       remaining -= amiga_clk_interval - (initial_tick -
cur_tick);


> There might be definite reasons why the
> loop method is bad for timecounters, but in that case, somebody should
> document them.

A timecounter has to return the current value of a counter with a fixed
frequency. How can you do that with a calibrated loop?

-- 
    _  Frank Wille (frank%phoenix.owl.de@localhost)
 _ //  http://sun.hasenbraten.de/~frank/
 \X/   Phx @ #AmigaGer



Home | Main Index | Thread Index | Old Index