This source file includes following definitions.
- __delay
- udelay
- muldiv
1 #ifndef _M68K_DELAY_H
2 #define _M68K_DELAY_H
3
4
5
6
7
8
9
10 extern __inline__ void __delay(int loops)
11 {
12 __asm__("\n\tmovel %0,%/d0\n1:\tsubql #1,%/d0\n\tbpls 1b\n"
13 :
14 : "g" (loops)
15 : "d0");
16 }
17
18
19
20
21
22
23
24
25 extern __inline__ void udelay(unsigned long usecs)
26 {
27 usecs *= 0x000010c6;
28
29 asm ("mulul %1,%0:%2"
30 : "=d" (usecs)
31 : "d" (usecs),
32 "d" (loops_per_sec));
33 __delay(usecs);
34 }
35
36 extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
37 {
38 __asm__("mulul %1,%/d0:%0\n\tdivul %2,%/d0:%0"
39 :"=d" (a)
40 :"d" (b),
41 "d" (c),
42 "0" (a)
43 :"d0");
44 return a;
45 }
46
47 #endif