00001 #ifndef _LINUX_DELAY_H
00002 #define _LINUX_DELAY_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 extern unsigned long loops_per_sec;
00015
00016 extern __inline__ void __delay(int loops)
00017 {
00018 __asm__(".align 2,0x90\n1:\tdecl %0\n\tjns 1b": :"a" (loops):"ax");
00019 }
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 extern __inline__ void udelay(unsigned long usecs)
00036 {
00037 usecs *= 0x000010c6;
00038 __asm__("mull %0"
00039 :"=d" (usecs)
00040 :"a" (usecs),"0" (loops_per_sec)
00041 :"ax");
00042 __delay(usecs);
00043 }
00044
00045 #endif