diff options
Diffstat (limited to 'include/asm-i386/delay.h')
-rw-r--r-- | include/asm-i386/delay.h | 15 |
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); } |