summaryrefslogtreecommitdiffstats
path: root/include/asm-sh/delay.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh/delay.h')
-rw-r--r--include/asm-sh/delay.h25
1 files changed, 10 insertions, 15 deletions
diff --git a/include/asm-sh/delay.h b/include/asm-sh/delay.h
index 9eb03f65d..222561a3e 100644
--- a/include/asm-sh/delay.h
+++ b/include/asm-sh/delay.h
@@ -2,26 +2,26 @@
#define __ASM_SH_DELAY_H
/*
- * Copyright (C) 1999 Niibe Yutaka
+ * Copyright (C) 1999 Kaz Kojima
*/
extern __inline__ void __delay(unsigned long loops)
{
- unsigned long __dummy;
__asm__ __volatile__(
- "1:\t"
- "dt %0\n\t"
- "bf 1b"
- :"=r" (__dummy)
- :"0" (loops));
+ "tst %0,%0\n\t"
+ "1:\t"
+ "bf/s 1b\n\t"
+ " dt %0"
+ : "=r" (loops)
+ : "0" (loops));
}
extern __inline__ void __udelay(unsigned long usecs, unsigned long lps)
{
usecs *= 0x000010c6; /* 2**32 / 1000000 */
- __asm__("mul.l %0,%2\n\t"
- "sts macl,%0"
- : "=&r" (usecs)
+ __asm__("dmulu.l %0,%2\n\t"
+ "sts mach,%0"
+ : "=r" (usecs)
: "0" (usecs), "r" (lps)
: "macl", "mach");
__delay(usecs);
@@ -36,9 +36,4 @@ extern __inline__ void __udelay(unsigned long usecs, unsigned long lps)
#define udelay(usecs) __udelay((usecs),__udelay_val)
-extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
-{
- return (a*b)/c;
-}
-
#endif /* __ASM_SH_DELAY_H */