1 #ifndef _BLACKFIN_DELAY_H
2 #define _BLACKFIN_DELAY_H
4 static inline void __delay(unsigned long loops)
7 /* FIXME: Currently the assembler doesn't recognize Loop Register Clobbers,
8 uncomment this as soon those are implemented */
10 __asm__ __volatile__ ( "\t LSETUP (1f,1f) LC0= %0\n\t"
17 __asm__ __volatile__("[--SP] = LC0;\n\t"
20 "LSETUP (1f,1f) LC0 = %0;\n\t"
29 #include <linux/param.h> /* needed for HZ */
32 * Use only for very small delays ( < 1 msec). Should probably use a
33 * lookup table, really, as the multiplications take much too long with
34 * short delays. This is a "reasonable" implementation, though (and the
35 * first constant multiplications gets optimized away if the delay is
38 static inline void udelay(unsigned long usecs)
40 extern unsigned long loops_per_jiffy;
41 __delay(usecs * loops_per_jiffy / (1000000 / HZ));
44 #endif /* defined(_BLACKFIN_DELAY_H) */