udelay() on alpha

From: Ivan Kokshaysky (ink@jurassic.park.msu.ru)
Date: Thu Mar 02 2000 - 15:29:55 EST


I noticed that udelay() on i386 was changed to use TSC (in Alan's 2.2.15pre).
Why not use the cycle counter on alphas?
Benefits:
- no need to worry about slotting and other black magic on a future alphas
- higher bogomips ;-)

Ivan.

--- 2.3.49-2/include/asm-alpha/delay.h Thu Mar 2 14:40:44 2000
+++ linux/include/asm-alpha/delay.h Thu Mar 2 15:26:44 2000
@@ -16,12 +16,15 @@
 extern __inline__ void
 __delay(unsigned long loops)
 {
+ unsigned int tmp, cc;
         __asm__ __volatile__(
- ".align 4\n"
- "1: subq %0,1,%0\n"
- " bge %0,1b\n"
- " nop"
- : "=r" (loops) : "0"(loops));
+ " rpcc %1\n"
+ "1: rpcc %0\n"
+ " subl %0,%1,%0\n"
+ " zapnot %0,15,%0\n"
+ " cmpult %0,%2,%0\n"
+ " bne %0,1b"
+ : "=&r" (tmp), "=&r" (cc) : "r"(loops));
 }
 
 /*

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:13 EST