[PATCH] M68k ndelay()

From: Geert Uytterhoeven (geert@linux-m68k.org)
Date: Sun Apr 13 2003 - 08:05:14 EST


M68k: add ndelay() implementation (needed for IDE)

--- linux-2.4.21-pre7/include/asm-m68k/delay.h Thu Jan 4 22:00:55 2001
+++ linux-m68k-2.4.21-pre7/include/asm-m68k/delay.h Sun Mar 30 22:22:40 2003
@@ -16,6 +16,7 @@
 }
 
 extern void __bad_udelay(void);
+extern void __bad_ndelay(void);
 
 /*
  * Use only for very small delays ( < 1 msec). Should probably use a
@@ -39,9 +40,18 @@
         __const_udelay(usecs * 4295); /* 2**32 / 1000000 */
 }
 
+static inline void __ndelay(unsigned long nsecs)
+{
+ __const_udelay(nsecs * 5); /* 2**32 / 1000000000 */
+}
+
 #define udelay(n) (__builtin_constant_p(n) ? \
         ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 4295)) : \
         __udelay(n))
+
+#define ndelay(n) (__builtin_constant_p(n) ? \
+ ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5)) : \
+ __ndelay(n))
 
 extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
 {

Gr{oetje,eeting}s,

                                                Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds - 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 : Tue Apr 15 2003 - 22:00:28 EST