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 extern __inline__ void __delay(int loops)
11 {
12 __asm__(".align 2,0x90\n1:\tdecl %0\n\tjns 1b": :"a" (loops):"ax");
13 }
14
15
16
17
18
19
20
21
22
23
24
25 extern __inline__ void udelay(unsigned long usecs)
26 {
27 usecs *= 0x000010c6;
28 __asm__("mull %0"
29 :"=d" (usecs)
30 :"a" (usecs),"0" (loops_per_sec)
31 :"ax");
32 __delay(usecs);
33 }
34
35 extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
36 {
37 __asm__("mull %1 ; divl %2"
38 :"=a" (a)
39 :"d" (b),
40 "r" (c),
41 "0" (a)
42 :"dx");
43 return a;
44 }
45
46 #endif