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