| plan 9 kernel history: overview | file list | diff list |
2002/0404/pc/i8253.c (diff list | history)
| 2002/0314/sys/src/9/pc/i8253.c:118,136 – 2002/0404/sys/src/9/pc/i8253.c:118,135 (short | long | prev | next) | ||
| 1997/0327 | * prefetch buffer. * */ | |
| 1999/0131 | if(havecycleclock) | |
| 2001/1130 | rdtsc(&a); | |
| 2002/0404 | outb(Tmode, Latch0); | |
| 1997/0327 | x = inb(T0cntr); x |= inb(T0cntr)<<8; aamloop(loops); | |
| 1999/0131 | if(havecycleclock) | |
| 2001/1130 | rdtsc(&b); | |
| 1997/0327 | y = inb(T0cntr); y |= inb(T0cntr)<<8; x -= y; | |
| 2002/0404 | ||
| 1997/0327 | if(x < 0) x += Freq/HZ; | |
| 2002/0314/sys/src/9/pc/i8253.c:137,143 – 2002/0404/sys/src/9/pc/i8253.c:136,141 | ||
| 1997/0327 | if(x > Freq/(3*HZ)) break; } | |
| 1999/0131 | * n.b. counter goes up by 2*Freq | |
| 2002/0314/sys/src/9/pc/i8253.c:144,150 – 2002/0404/sys/src/9/pc/i8253.c:142,147 | ||
| 1997/0327 | */ | |
| 1999/0131 | cpufreq = loops*((aalcycles*2*Freq)/x); | |
| 1997/0327 | m->loopconst = (cpufreq/1000)/aalcycles; /* AAM+LOOP's for 1 ms */ | |
| 1999/0131 | if(havecycleclock){ /* counter goes up by 2*Freq */ | |