Port-amigappc archive

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

Re: amigappc test kernel for CSPPC and BPPC



Radoslaw Kujawa wrote:

>> Or maybe we need to implement measuring it like the
>> comment suggests.
>
> Yes, that's the way to go. I have a vague idea how should it be
> implemented using CIA timer, but it needs working time measurement
> functions. The problem is that we set up timebase using bus clock. How
> can I measure time flow _before_ timebase is set up? Will functions
> like getmicrotime() work in amigappc_identify() ?

No, as the timecounters are not yet set up.

You will use the on-chip timebase or decrementer register to measure the
amount of buscycles passed during a defined amount of time. Example:

- reset CIA timer
- reset timebase
- start CIA timer, running for 1 second
after 1 second (or a shorter value, to reduce the delay during configure()):
- read timebase

The timebase * 4 now represents the number of bus clock cycles during this
time. To load the right value into the CIA timer you can use eclockfreq,
which is passed by the bootloader (or just assume as 709kHz when not set).

-- 
Frank Wille



Home | Main Index | Thread Index | Old Index