summaryrefslogtreecommitdiffstats
path: root/include/asm-i386/delay.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-01-07 02:33:00 +0000
committer <ralf@linux-mips.org>1997-01-07 02:33:00 +0000
commitbeb116954b9b7f3bb56412b2494b562f02b864b1 (patch)
tree120e997879884e1b9d93b265221b939d2ef1ade1 /include/asm-i386/delay.h
parent908d4681a1dc3792ecafbe64265783a86c4cccb6 (diff)
Import of Linux/MIPS 2.1.14
Diffstat (limited to 'include/asm-i386/delay.h')
-rw-r--r--include/asm-i386/delay.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/asm-i386/delay.h b/include/asm-i386/delay.h
index e408db01b..e22e8d6b2 100644
--- a/include/asm-i386/delay.h
+++ b/include/asm-i386/delay.h
@@ -6,10 +6,18 @@
*
* Delay routines, using a pre-computed "loops_per_second" value.
*/
+
+#ifdef __SMP__
+#include <asm/smp.h>
+#endif
extern __inline__ void __delay(int loops)
{
- __asm__(".align 2,0x90\n1:\tdecl %0\n\tjns 1b": :"a" (loops):"ax");
+ __asm__ __volatile__(
+ ".align 2,0x90\n1:\tdecl %0\n\tjns 1b"
+ :/* no outputs */
+ :"a" (loops)
+ :"ax");
}
/*
@@ -27,8 +35,13 @@ 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);
}