patch-1.3.71 linux/include/asm-sparc/delay.h

Next file: linux/include/asm-sparc/dma.h
Previous file: linux/include/asm-sparc/cypress.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.70/linux/include/asm-sparc/delay.h linux/include/asm-sparc/delay.h
@@ -1,4 +1,4 @@
-/* $Id: delay.h,v 1.7 1995/11/25 02:31:32 davem Exp $
+/* $Id: delay.h,v 1.8 1996/01/28 02:09:21 davem Exp $
  * delay.h: Linux delay routines on the Sparc.
  *
  * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu).
@@ -7,6 +7,8 @@
 #ifndef __SPARC_DELAY_H
 #define __SPARC_DELAY_H
 
+extern unsigned long loops_per_sec;
+
 extern __inline__ void __delay(unsigned long loops)
 {
 	__asm__ __volatile__("cmp %0, 0\n\t"
@@ -16,23 +18,8 @@
 			     "0" (loops));
 }
 
-/* udelay(usecs) is used for very short delays up to 1 millisecond. On
- * the Sparc (both sun4c and sun4m) we have a free running usec counter
- * available to us already.
- */
-extern volatile unsigned int *master_l10_counter;
-
-extern __inline__ void udelay(unsigned int usecs)
-{
-	unsigned int ccnt;
-
-	if(!master_l10_counter)
-		return;
-	ccnt=*master_l10_counter;
-	for(usecs+=1; usecs; usecs--, ccnt=*master_l10_counter)
-		while(*master_l10_counter == ccnt)
-			__asm__("": : :"memory");
-}
+/* This is too messy with inline asm on the Sparc. */
+extern void udelay(unsigned long usecs);
 
 /* calibrate_delay() wants this... */
 #define muldiv(a, b, c)    (((a)*(b))/(c))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this