This source file includes following definitions.
- __delay
- udelay
- muldiv
1 #ifndef __SPARC_DELAY_H
2 #define __SPARC_DELAY_H
3
4 extern unsigned long loops_per_sec;
5
6
7
8
9
10
11
12
13 extern __inline__ void __delay(unsigned int loops)
14 {
15 __asm__ __volatile__("\n1:\tcmp %0, 0\n\t"
16 "bne,a 1b\n\t"
17 "sub %0, 1, %0\n": "=&r" (loops) : "0" (loops));
18 }
19
20
21
22 extern __inline__ void udelay(unsigned int usecs)
23 {
24 usecs *= 0x000010c6;
25
26 __delay(loops_per_sec*usecs);
27
28 }
29
30
31
32 extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
33 {
34 return ((a*b)/c);
35 }
36
37 #endif
38