/* Get initial counter invariant */
ct0 = read_c0_count();
/* Latch and spin until top byte of counter2 is zero */ do {
writeb(SGINT_TCWORD_CNT2 | SGINT_TCWORD_CLAT, &sgint->tcword);
(void) readb(&sgint->tcnt2);
msb = readb(&sgint->tcnt2);
ct1 = read_c0_count();
} while (msb);
/* *Figureoutther4koffset,thealgorithmisverysimpleandworksin *_all_casesaslongasthe8254counterregisteritselfworksok(as *aninterruptdrivingtimeritdoesnotbecauseofbug,thisiswhy *weareusingtheonchipr4kcounter/compareregistertoservethis *purpose,butforr4k_offsetcalculationitwillworkokforus). *Thereareotherverycomplicatedwaysofperformingthiscalculation *butthisoneworksjustfinesoIamnotgoingtofutzaround.;-)
*/
printk(KERN_INFO "Calibrating system timer... ");
dosample(); /* Prime cache. */
dosample(); /* Prime cache. */ /* Zero is NOT an option. */ do {
r4k_ticks[0] = dosample();
} while (!r4k_ticks[0]); do {
r4k_ticks[1] = dosample();
} while (!r4k_ticks[1]);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.