patch-2.2.18 linux/include/asm-alpha/delay.h

Next file: linux/include/asm-alpha/page.h
Previous file: linux/include/asm-alpha/core_irongate.h
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/include/asm-alpha/delay.h linux/include/asm-alpha/delay.h
@@ -1,6 +1,7 @@
 #ifndef __ALPHA_DELAY_H
 #define __ALPHA_DELAY_H
 
+#include <asm/param.h>
 #include <asm/smp.h>
 
 /*
@@ -40,7 +41,7 @@
 extern __inline__ void
 __udelay(unsigned long usecs, unsigned long lps)
 {
-	/* compute (usecs * 2**64 / 10**6) * loops_per_sec / 2**64 */
+	/* compute (usecs * 2**64 / 10**6) * loops_per_jiffy * HZ / 2**64 */
 
 	usecs *= 0x000010c6f7a0b5edUL;		/* 2**64 / 1000000 */
 	__asm__("umulh %1,%2,%0" :"=r" (usecs) :"r" (usecs),"r" (lps));
@@ -50,7 +51,7 @@
 extern __inline__ void
 __small_const_udelay(unsigned long usecs, unsigned long lps)
 {
-	/* compute (usecs * 2**32 / 10**6) * loops_per_sec / 2**32 */
+	/* compute (usecs * 2**32 / 10**6) * loops_per_jiffy * HZ / 2**32 */
 
         usecs *= 0x10c6;                /* 2^32 / 10^6 */
 	usecs *= lps;
@@ -62,15 +63,16 @@
 #define udelay(usecs)						\
 	(__builtin_constant_p(usecs) && usecs < 0x100000000UL	\
 	 ? __small_const_udelay(usecs,				\
-		cpu_data[smp_processor_id()].loops_per_sec)	\
+		cpu_data[smp_processor_id()].loops_per_jiffy*HZ)	\
 	 : __udelay(usecs,					\
-		cpu_data[smp_processor_id()].loops_per_sec))
+		cpu_data[smp_processor_id()].loops_per_jiffy*HZ))
 #else
 #define udelay(usecs)						\
 	(__builtin_constant_p(usecs) && usecs < 0x100000000UL	\
-	 ? __small_const_udelay(usecs, loops_per_sec)		\
-	 : __udelay(usecs, loops_per_sec))
+	 ? __small_const_udelay(usecs, loops_per_jiffy*HZ)		\
+	 : __udelay(usecs, loops_per_jiffy*HZ))
 #endif
 
 
 #endif /* defined(__ALPHA_DELAY_H) */
+

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