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