]> err.no Git - linux-2.6/blobdiff - include/asm-mips/delay.h
[PATCH] Introduce sg_set_buf
[linux-2.6] / include / asm-mips / delay.h
index d0f68447e5a713ba53fa185e2e44d5c9a009afdf..85435a8d4e52d4287f2328a2cff093437ccbae96 100644 (file)
 
 #include <linux/config.h>
 #include <linux/param.h>
-
+#include <linux/smp.h>
 #include <asm/compiler.h>
 
-extern unsigned long loops_per_jiffy;
-
 static inline void __delay(unsigned long loops)
 {
        if (sizeof(long) == 4)
@@ -57,11 +55,11 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj)
         * The common rates of 1000 and 128 are rounded wrongly by the
         * catchall case for 64-bit.  Excessive precission?  Probably ...
         */
-#if defined(CONFIG_MIPS64) && (HZ == 128)
+#if defined(CONFIG_64BIT) && (HZ == 128)
        usecs *= 0x0008637bd05af6c7UL;          /* 2**64 / (1000000 / HZ) */
-#elif defined(CONFIG_MIPS64) && (HZ == 1000)
+#elif defined(CONFIG_64BIT) && (HZ == 1000)
        usecs *= 0x004189374BC6A7f0UL;          /* 2**64 / (1000000 / HZ) */
-#elif defined(CONFIG_MIPS64)
+#elif defined(CONFIG_64BIT)
        usecs *= (0x8000000000000000UL / (500000 / HZ));
 #else /* 32-bit junk follows here */
        usecs *= (unsigned long) (((0x8000000000000000ULL / (500000 / HZ)) +
@@ -82,11 +80,7 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj)
        __delay(usecs);
 }
 
-#ifdef CONFIG_SMP
 #define __udelay_val cpu_data[smp_processor_id()].udelay_val
-#else
-#define __udelay_val loops_per_jiffy
-#endif
 
 #define udelay(usecs) __udelay((usecs),__udelay_val)