X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=arch%2Fsparc64%2Flib%2Fdelay.c;h=e8808727617a146aea231267d4fafe7beb8e8132;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=fb27e54a03ee11b9db711b9fbfe1b3f3db6894cb;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/arch/sparc64/lib/delay.c b/arch/sparc64/lib/delay.c index fb27e54a0..e88087276 100644 --- a/arch/sparc64/lib/delay.c +++ b/arch/sparc64/lib/delay.c @@ -1,6 +1,6 @@ /* delay.c: Delay loops for sparc64 * - * Copyright (C) 2004, 2006 David S. Miller + * Copyright (C) 2004 David S. Miller * * Based heavily upon x86 variant which is: * Copyright (C) 1993 Linus Torvalds @@ -8,16 +8,19 @@ */ #include -#include void __delay(unsigned long loops) { - unsigned long bclock, now; - - bclock = tick_ops->get_tick(); - do { - now = tick_ops->get_tick(); - } while ((now-bclock) < loops); + __asm__ __volatile__( +" b,pt %%xcc, 1f\n" +" cmp %0, 0\n" +" .align 32\n" +"1:\n" +" bne,pt %%xcc, 1b\n" +" subcc %0, 1, %0\n" + : "=&r" (loops) + : "0" (loops) + : "cc"); } /* We used to multiply by HZ after shifting down by 32 bits