patch-2.4.21 linux-2.4.21/include/asm-ppc64/delay.h

Next file: linux-2.4.21/include/asm-ppc64/eeh.h
Previous file: linux-2.4.21/include/asm-ppc64/bitops.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/include/asm-ppc64/delay.h linux-2.4.21/include/asm-ppc64/delay.h
@@ -19,6 +19,7 @@
 /* define these here to prevent circular dependencies */ 
 #define __HMT_low()	asm volatile("or 1,1,1")
 #define __HMT_medium()	asm volatile("or 2,2,2")
+#define __barrier()	asm volatile("":::"memory")
 
 static inline unsigned long __get_tb(void)
 {
@@ -34,6 +35,8 @@
 
 	while((__get_tb()-start) < loops)
 		__HMT_low();
+	__HMT_medium();
+	__barrier();
 }
 
 static inline void udelay(unsigned long usecs)
@@ -41,7 +44,13 @@
 	unsigned long loops = tb_ticks_per_usec * usecs;
 
 	__delay(loops);
-	__HMT_medium();
+}
+
+static inline void ndelay(unsigned long nsecs)
+{
+	unsigned long loops = (tb_ticks_per_usec * nsecs) / 1000;
+
+	__delay(loops);
 }
 #endif /* !__ASSEMBLY__ */
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)