aboutsummaryrefslogtreecommitdiff
path: root/arch/score/include/asm/delay.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/score/include/asm/delay.h')
-rw-r--r--arch/score/include/asm/delay.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/score/include/asm/delay.h b/arch/score/include/asm/delay.h
index ad716f6d922..6726ec199dc 100644
--- a/arch/score/include/asm/delay.h
+++ b/arch/score/include/asm/delay.h
@@ -3,17 +3,22 @@
static inline void __delay(unsigned long loops)
{
+ /* 3 cycles per loop. */
__asm__ __volatile__ (
- "1:\tsubi\t%0,1\n\t"
+ "1:\tsubi\t%0, 3\n\t"
"cmpz.c\t%0\n\t"
- "bne\t1b\n\t"
+ "ble\t1b\n\t"
: "=r" (loops)
: "0" (loops));
}
static inline void __udelay(unsigned long usecs)
{
- __delay(usecs);
+ unsigned long loops_per_usec;
+
+ loops_per_usec = (loops_per_jiffy * HZ) / 1000000;
+
+ __delay(usecs * loops_per_usec);
}
#define udelay(usecs) __udelay(usecs)