PATCH: ndelay resend

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Tue Feb 18 2003 - 19:35:02 EST


Dunno where it went before. The implementation is not ideal. Thats something
to tidy up.

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.61/arch/i386/kernel/i386_ksyms.c linux-2.5.61-ac2/arch/i386/kernel/i386_ksyms.c
--- linux-2.5.61/arch/i386/kernel/i386_ksyms.c 2003-02-10 18:39:01.000000000 +0000
+++ linux-2.5.61-ac2/arch/i386/kernel/i386_ksyms.c 2003-02-18 14:41:51.000000000 +0000
@@ -104,6 +104,7 @@
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_generic);
 /* Delay loops */
+EXPORT_SYMBOL(__ndelay);
 EXPORT_SYMBOL(__udelay);
 EXPORT_SYMBOL(__delay);
 EXPORT_SYMBOL(__const_udelay);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.61/arch/i386/lib/delay.c linux-2.5.61-ac2/arch/i386/lib/delay.c
--- linux-2.5.61/arch/i386/lib/delay.c 2003-02-10 18:38:53.000000000 +0000
+++ linux-2.5.61-ac2/arch/i386/lib/delay.c 2003-02-18 14:41:35.000000000 +0000
@@ -41,3 +41,8 @@
 {
         __const_udelay(usecs * 0x000010c6); /* 2**32 / 1000000 */
 }
+
+void __ndelay(unsigned long nsecs)
+{
+ __const_udelay(nsecs * 0x00005); /* 2**32 / 1000000000 (rounded up) */
+}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.61/include/asm-i386/delay.h linux-2.5.61-ac2/include/asm-i386/delay.h
--- linux-2.5.61/include/asm-i386/delay.h 2003-02-10 18:37:54.000000000 +0000
+++ linux-2.5.61-ac2/include/asm-i386/delay.h 2003-02-18 14:40:31.000000000 +0000
@@ -8,13 +8,19 @@
  */
  
 extern void __bad_udelay(void);
+extern void __bad_ndelay(void);
 
 extern void __udelay(unsigned long usecs);
+extern void __ndelay(unsigned long nsecs);
 extern void __const_udelay(unsigned long usecs);
 extern void __delay(unsigned long loops);
 
 #define udelay(n) (__builtin_constant_p(n) ? \
         ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
         __udelay(n))
+
+#define ndelay(n) (__builtin_constant_p(n) ? \
+ ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
+ __ndelay(n))
 
 #endif /* defined(_I386_DELAY_H) */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Feb 23 2003 - 22:00:23 EST