Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188492
b: refs/heads/master
c: 6388d14
h: refs/heads/master
v: v3
  • Loading branch information
Barry Song authored and Mike Frysinger committed Mar 9, 2010
1 parent 6c87a3e commit 7469e41
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 60ffdb36547da2397d6cfefe9c752ebad16524f6
refs/heads/master: 6388d14eb2dd3af655cee28ca2a1c56881e63e56
16 changes: 14 additions & 2 deletions trunk/arch/blackfin/include/asm/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7469e41

Please sign in to comment.