summaryrefslogtreecommitdiffstats
path: root/include/asm-sh/delay.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-01-27 01:05:20 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-01-27 01:05:20 +0000
commit546db14ee74118296f425f3b91634fb767d67290 (patch)
tree22b613a3da8d4bf663eec5e155af01b87fdf9094 /include/asm-sh/delay.h
parent1e25e41c4f5474e14452094492dbc169b800e4c8 (diff)
Merge with Linux 2.3.23. The new bootmem stuff has broken various
platforms. At this time I've only verified that IP22 support compiles and IP27 actually works.
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 */