patch-1.3.31 linux/include/asm-i386/delay.h

Next file: linux/include/asm-i386/io.h
Previous file: linux/include/asm-i386/checksum.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.30/linux/include/asm-i386/delay.h linux/include/asm-i386/delay.h
@@ -6,6 +6,10 @@
  *
  * Delay routines, using a pre-computed "loops_per_second" value.
  */
+ 
+#ifdef CONFIG_SMP
+#include <asm/smp.h>
+#endif 
 
 extern __inline__ void __delay(int loops)
 {
@@ -27,8 +31,13 @@
 	usecs *= 0x000010c6;		/* 2**32 / 1000000 */
 	__asm__("mull %0"
 		:"=d" (usecs)
+#ifdef CONFIG_SMP
+		:"a" (usecs),"0" (cpu_data[smp_processor_id()].udelay_val)
+#else
 		:"a" (usecs),"0" (loops_per_sec)
+#endif
 		:"ax");
+		
 	__delay(usecs);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this