It has been tested on a 40MHz i386, 66MHz i486, 90MHz pentium, 160MHz
Pentium II, and a 300Mhz Pentium MMX. The numbers remain stable regardless
of the forced alignment. It just forces two consecutive jumps to aligned
code before the delay-loop, but after EAX is loaded with the count. This
should get you off the trailing edge of a cache-line.
If you testers like it, I will send it to Alan or Linus. If it doesn't
fix a bobbling BogoMips count, let me know. Note +/- 1 count is normal.
--- linux/arch/i386/lib/delay.c.orig Wed Jun 24 10:22:50 1998
+++ linux/arch/i386/lib/delay.c Wed Jun 24 10:18:52 1998
@@ -18,7 +18,11 @@
void __delay(unsigned long loops)
{
__asm__ __volatile__(
- "1:\tdecl %0\n\tjns 1b"
+ "jmp 1f\n"
+ ".align 16\n"
+ "1:\tjmp 2f\n"
+ ".align 16\n"
+ "2:\tdecl %0\n\tjns 2b"
:/* no outputs */
:"a" (loops)
:"ax");
Cheers,
Dick Johnson
***** FILE SYSTEM MODIFIED *****
Penguin : Linux version 2.1.105 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu