patch-2.3.23 linux/include/asm-sh/delay.h

Next file: linux/include/asm-sh/elf.h
Previous file: linux/include/asm-sh/checksum.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.22/linux/include/asm-sh/delay.h linux/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);
@@ -35,10 +35,5 @@
 #endif
 
 #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 */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)