提交 6388d14e 编写于 作者: B Barry Song 提交者: Mike Frysinger

Blackfin: implement ndelay()

Signed-off-by: NBarry Song <barry.song@analog.com>
Signed-off-by: NMike Frysinger <vapier@gentoo.org>
上级 60ffdb36
......@@ -30,10 +30,22 @@ __asm__ __volatile__ (
#define HZSCALE (268435456 / (1000000/HZ))
static inline void udelay(unsigned long usecs)
static inline unsigned long __to_delay(unsigned long scale)
{
extern unsigned long loops_per_jiffy;
__delay((((usecs * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6);
return (((scale * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6;
}
static inline void udelay(unsigned long usecs)
{
__delay(__to_delay(usecs));
}
static inline void ndelay(unsigned long nsecs)
{
__delay(__to_delay(1) * nsecs / 1000);
}
#define ndelay ndelay
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册