patch-2.4.21 linux-2.4.21/arch/alpha/lib/udelay.c
Next file: linux-2.4.21/arch/alpha/mm/Makefile
Previous file: linux-2.4.21/arch/alpha/lib/stxncpy.S
Back to the patch index
Back to the overall index
- Lines: 43
- Date:
2003-06-13 07:51:29.000000000 -0700
- Orig file:
linux-2.4.20/arch/alpha/lib/udelay.c
- Orig date:
2001-06-20 11:10:27.000000000 -0700
diff -urN linux-2.4.20/arch/alpha/lib/udelay.c linux-2.4.21/arch/alpha/lib/udelay.c
@@ -18,7 +18,8 @@
* a 1GHz box, that's about 2 seconds.
*/
-void __delay(int loops)
+void
+__delay(int loops)
{
int tmp;
__asm__ __volatile__(
@@ -30,18 +31,22 @@
: "=&r" (tmp), "=r" (loops) : "1"(loops));
}
-void __udelay(unsigned long usecs, unsigned long lpj)
-{
- usecs *= (((unsigned long)HZ << 32) / 1000000) * lpj;
- __delay((long)usecs >> 32);
-}
-
-void udelay(unsigned long usecs)
-{
#ifdef CONFIG_SMP
- __udelay(usecs, cpu_data[smp_processor_id()].loops_per_jiffy);
+#define LPJ cpu_data[smp_processor_id()].loops_per_jiffy
#else
- __udelay(usecs, loops_per_jiffy);
+#define LPJ loops_per_jiffy
#endif
+
+void
+ndelay(unsigned long nsecs)
+{
+ nsecs *= (((unsigned long)HZ << 32) / 1000000000) * LPJ;
+ __delay((long)nsecs >> 32);
}
+void
+udelay(unsigned long usecs)
+{
+ usecs *= (((unsigned long)HZ << 32) / 1000000) * LPJ;
+ __delay((long)usecs >> 32);
+}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)