From: Philipp R. <pr...@pa...> - 2000-11-07 00:49:38
|
I just submitted a patch to sourceforge that changes our clock calibration mechanism to calibrate the timer clock rather than the CPU clock; this means it is more portable now (no assembly, and no CPU-specific constant); it's also much faster (1/128 - 1/64 second rather than 1 - 2 seconds), while not losing a lot of accuracy. The original version also included a version of gettimeoffset, but the one SUGIOKA Toshinobu has written at the same time as I is nicer. There is also a very slight bugfix which I would like to paste here: /* Start TMU0 */ + ctrl_outb(0, TMU_TSTR); ctrl_outb(TMU_TOCR_INIT, TMU_TOCR); ctrl_outw(TMU0_TCR_INIT, TMU0_TCR); ctrl_outl(interval, TMU0_TCOR); Without this, the kernel wouldn't boot correctly if TMU0 was already started. Since head.S says: * Hardware (including on-chip modules) may or may not be initialized. this sounds like the right thing to do to me. The updated version of the patch (against current CVS) is attached. |