summaryrefslogtreecommitdiff
path: root/linux/src/include/asm-i386/delay.h
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2000-07-23 00:34:12 +0000
committerMarcus Brinkmann <marcus@gnu.org>2000-07-23 00:34:12 +0000
commit91933a41184cd816cb8ce4d96cf8764ebd7dde8c (patch)
tree18d263f9e1f1a851a1cd13851a2acba48b2e1fe6 /linux/src/include/asm-i386/delay.h
parent92976e1b4ab184ff6cf70d7bd9944ae5050c4fc3 (diff)
2000-07-04 Marcus Brinkmann <marcus@gnu.org>
* debian/changelog: Add entry for new Debian upload. * linux/dev/drivers/scsi/seagate.c (WRITE_CONTROL, WRITE_DATA): Added from linux 2.2.15. (__asm__ constructs): Replace with equivalent C code from linux 2.2.15 to support gcc-2.95. * linux/src/drivers/scsi/in2000.h: Update asm code to linux 2.2.15. * linux/src/drivers/scsi/ppa.c: Replace asm code with equivalent C code from linux 2.2.15. 2000-02-06 Stefan Weil <stefan.weil@de.heidelberg.com> * device/subrs.c: Fixed compiler warning. * ddb/db_output.c, kern/bootstrap.c, kern/debug.c, kern/printf.c: Replaced varargs.h by stdarg.h. Fixed prototypes (const char *fmt). * ddb/db_output.h: Use prototype for db_printf. * i386/Files: removed varargs.h. * i386/i386/pit.h: Fixed compiler warning. * i386/i386at/model_dep.c: Tried to fix compiler warning. * i386/include/mach/sa/sys/varargs.h: Removed. * i386/linux/Makefile.in: Removed delay.S, added delay.c. * linux/dev/include/asm-i386/segment.h: Support gcc-2.95. * linux/dev/include/asm-i386/string.h, linux/src/include/asm-i386/string.h: Update from linux-2.2.14. * linux/dev/lib/vsprintf.c: Fixed compiler warning. * linux/src/include/asm-i386/delay.h: Update from linux-2.2.14. * linux/src/arch/i386/lib/delay.c: Copy from linux-2.2.14. * linux/src/include/asm-i386/string.h: Update from linux-2.2.14.
Diffstat (limited to 'linux/src/include/asm-i386/delay.h')
-rw-r--r--linux/src/include/asm-i386/delay.h63
1 files changed, 9 insertions, 54 deletions
diff --git a/linux/src/include/asm-i386/delay.h b/linux/src/include/asm-i386/delay.h
index 2f4a41b..2166c4c 100644
--- a/linux/src/include/asm-i386/delay.h
+++ b/linux/src/include/asm-i386/delay.h
@@ -4,60 +4,15 @@
/*
* Copyright (C) 1993 Linus Torvalds
*
- * Delay routines, using a pre-computed "loops_per_second" value.
+ * Delay routines calling functions in arch/i386/lib/delay.c
*/
-
-#include <linux/linkage.h>
-
-#ifdef __SMP__
-#include <asm/smp.h>
-#endif
-
-extern void __do_delay(void); /* Special register call calling convention */
-
-extern __inline__ void __delay(int loops)
-{
- __asm__ __volatile__(
- "call " SYMBOL_NAME_STR(__do_delay)
- :/* no outputs */
- :"a" (loops)
- :"ax");
-}
-
-/*
- * division by multiplication: you don't have to worry about
- * loss of precision.
- *
- * Use only for very small delays ( < 1 msec). Should probably use a
- * lookup table, really, as the multiplications take much too long with
- * short delays. This is a "reasonable" implementation, though (and the
- * first constant multiplications gets optimized away if the delay is
- * a constant)
- */
-extern __inline__ void udelay(unsigned long usecs)
-{
- usecs *= 0x000010c6; /* 2**32 / 1000000 */
- __asm__("mull %0"
- :"=d" (usecs)
-#ifdef __SMP__
- :"a" (usecs),"0" (cpu_data[smp_processor_id()].udelay_val)
-#else
- :"a" (usecs),"0" (loops_per_sec)
-#endif
- :"ax");
-
- __delay(usecs);
-}
-
-extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
-{
- __asm__("mull %1 ; divl %2"
- :"=a" (a)
- :"d" (b),
- "r" (c),
- "0" (a)
- :"dx");
- return a;
-}
+
+extern void __udelay(unsigned long usecs);
+extern void __const_udelay(unsigned long usecs);
+extern void __delay(unsigned long loops);
+
+#define udelay(n) (__builtin_constant_p(n) ? \
+ __const_udelay((n) * 0x10c6ul) : \
+ __udelay(n))
#endif /* defined(_I386_DELAY_H) */