This source file includes following definitions.
- __delay
- udelay
- muldiv
1 #ifndef _I386_DELAY_H
2 #define _I386_DELAY_H
3
4
5
6
7
8
9
10 #ifdef __SMP__
11 #include <asm/smp.h>
12 #endif
13
14 extern __inline__ void __delay(int loops)
15 {
16 __asm__ __volatile__(
17 ".align 2,0x90\n1:\tdecl %0\n\tjns 1b"
18 :
19 :"a" (loops)
20 :"ax");
21 }
22
23
24
25
26
27
28
29
30
31
32
33 extern __inline__ void udelay(unsigned long usecs)
34 {
35 usecs *= 0x000010c6;
36 __asm__("mull %0"
37 :"=d" (usecs)
38 #ifdef __SMP__
39 :"a" (usecs),"0" (cpu_data[smp_processor_id()].udelay_val)
40 #else
41 :"a" (usecs),"0" (loops_per_sec)
42 #endif
43 :"ax");
44
45 __delay(usecs);
46 }
47
48 extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
49 {
50 __asm__("mull %1 ; divl %2"
51 :"=a" (a)
52 :"d" (b),
53 "r" (c),
54 "0" (a)
55 :"dx");
56 return a;
57 }
58
59 #endif