File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
arch/blackfin/include/asm Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,15 @@ static inline void __delay(unsigned long loops)
4747#include <linux/param.h> /* needed for HZ */
4848
4949/*
50- * Use only for very small delays ( < 1 msec). Should probably use a
51- * lookup table, really, as the multiplications take much too long with
52- * short delays. This is a "reasonable" implementation, though (and the
53- * first constant multiplications gets optimized away if the delay is
54- * a constant)
50+ * close approximation borrowed from m68knommu to avoid 64-bit math
5551 */
52+
53+ #define HZSCALE (268435456 / (1000000/HZ))
54+
5655static inline void udelay (unsigned long usecs )
5756{
5857 extern unsigned long loops_per_jiffy ;
59- __delay (usecs * loops_per_jiffy / ( 1000000 / HZ ) );
58+ __delay (((( usecs * HZSCALE ) >> 11 ) * ( loops_per_jiffy >> 11 )) >> 6 );
6059}
6160
6261#endif
You can’t perform that action at this time.
0 commit comments