patch-2.4.8 linux/include/asm-cris/delay.h

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

diff -u --recursive --new-file v2.4.7/linux/include/asm-cris/delay.h linux/include/asm-cris/delay.h
@@ -1,10 +1,10 @@
-/* $Id: delay.h,v 1.4 2001/05/31 06:40:53 markusl Exp $ */
+/* $Id: delay.h,v 1.5 2001/06/28 04:59:25 hp Exp $ */
 
 #ifndef _CRIS_DELAY_H
 #define _CRIS_DELAY_H
 
 /*
- * Copyright (C) 1998, 1999, 2000 Axis Communications AB
+ * Copyright (C) 1998, 1999, 2000, 2001 Axis Communications AB
  *
  * Delay routines, using a pre-computed "loops_per_second" value.
  */
@@ -21,26 +21,18 @@
 extern __inline__ void __delay(int loops)
 {
 	__asm__ __volatile__ (
-			      "move.d %0,r0\n\t"
-			      "1:\n\t"
-			      "cmpq 0,r0\n\t"
+			      "move.d %0,r9\n\t"
 			      "beq 2f\n\t"
-			      "nop\n\t"
-			      "subq 1,r0\n\t"
-			      "ba 1b\n\t"
-			      "nop\n\t"
-			      "2:\n\t"
-			      : : "r" (loops) : "r0");
+			      "subq 1,r9\n\t"
+			      "1:\n\t"
+			      "bne 1b\n\t"
+			      "subq 1,r9\n"
+			      "2:"
+			      : : "g" (loops) : "r9");
 }
 
 
-/*
- * Use only for very small delays ( < 1 msec).  Should probably use a
- * lookup table, really, as the multiplications take much too long with
- * short delays.  This is a "reasonable" implementation, though (and the
- * first constant multiplications gets optimized away if the delay is
- * a constant)
- */
+/* Use only for very small delays ( < 1 msec).  */
 
 extern unsigned long loops_per_usec; /* arch/cris/mm/init.c */
 

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