Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6] / arch / um / sys-i386 / delay.c
1 #include <linux/module.h>
2 #include <linux/kernel.h>
3 #include <linux/delay.h>
4 #include <asm/param.h>
5
6 void __delay(unsigned long time)
7 {
8         /* Stolen from the i386 __loop_delay */
9         int d0;
10         __asm__ __volatile__(
11                 "\tjmp 1f\n"
12                 ".align 16\n"
13                 "1:\tjmp 2f\n"
14                 ".align 16\n"
15                 "2:\tdecl %0\n\tjns 2b"
16                 :"=&a" (d0)
17                 :"0" (time));
18 }
19
20 void __udelay(unsigned long usecs)
21 {
22         int i, n;
23
24         n = (loops_per_jiffy * HZ * usecs) / MILLION;
25         for(i=0;i<n;i++)
26                 cpu_relax();
27 }
28
29 EXPORT_SYMBOL(__udelay);