summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc/delay.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-01-07 02:33:00 +0000
committer <ralf@linux-mips.org>1997-01-07 02:33:00 +0000
commitbeb116954b9b7f3bb56412b2494b562f02b864b1 (patch)
tree120e997879884e1b9d93b265221b939d2ef1ade1 /include/asm-sparc/delay.h
parent908d4681a1dc3792ecafbe64265783a86c4cccb6 (diff)
Import of Linux/MIPS 2.1.14
Diffstat (limited to 'include/asm-sparc/delay.h')
-rw-r--r--include/asm-sparc/delay.h42
1 files changed, 15 insertions, 27 deletions
diff --git a/include/asm-sparc/delay.h b/include/asm-sparc/delay.h
index d6c4b360e..71e1154a0 100644
--- a/include/asm-sparc/delay.h
+++ b/include/asm-sparc/delay.h
@@ -1,40 +1,28 @@
+/* $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).
+ */
+
#ifndef __SPARC_DELAY_H
#define __SPARC_DELAY_H
extern unsigned long loops_per_sec;
-/*
- * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu).
- *
- * Delay quick inlined code using 'loops_per_second' which is
- * calculated in calibrate_delay() in main.c (ie. BogoMIPS :-)
- */
-
-extern __inline__ void __delay(unsigned int loops)
+extern __inline__ void __delay(unsigned long loops)
{
- __asm__ __volatile__("\n1:\tcmp %0, 0\n\t"
- "bne,a 1b\n\t"
- "sub %0, 1, %0\n": "=&r" (loops) : "0" (loops));
+ __asm__ __volatile__("cmp %0, 0\n\t"
+ "1: bne 1b\n\t"
+ "subcc %0, 1, %0\n" :
+ "=&r" (loops) :
+ "0" (loops));
}
-/* udelay(usecs) is used for very short delays up to 1 millisecond. */
-
-extern __inline__ void udelay(unsigned int usecs)
-{
- usecs *= 0x000010c6; /* Sparc is 32-bit just like ix86 */
-
- __asm__("sethi %hi(_loops_per_sec), %o1\n\t"
- "ld [%o1 + %lo(_loops_per_sec)], %o1\n\t"
- "call ___delay\n\t"
- "umul %o1, %o0, %o0\n\t");
-}
+/* This is too messy with inline asm on the Sparc. */
+extern void udelay(unsigned long usecs);
/* calibrate_delay() wants this... */
-
-extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
-{
- return ((a*b)/c);
-}
+#define muldiv(a, b, c) (((a)*(b))/(c))
#endif /* defined(__SPARC_DELAY_H) */