Re: [PATCH 16/19] OpenRISC: Headers

From: Arnd Bergmann
Date: Sun Jun 19 2011 - 15:43:34 EST


On Sunday 19 June 2011 21:39:45 Arnd Bergmann wrote:
> > +
> > +extern inline void __delay(int loops)
> > +{
> > + __asm__ __volatile__ (
> > + "l.srli %0,%0,1;"
> > + "1: l.sfeqi %0,0;"
> > + "l.bnf 1b;"
> > + "l.addi %0,%0,-1;"
> > + : "=r" (loops): "0" (loops));
> > +}
> > +
>
> If you have an accurate high-resolution time source, better make this compare
> the current time in a loop than do a handcoded delay.

Hmm, I just saw that you actually have a better version of this, but
since this is marked "extern inline", code probably always gets this
version. Better never use extern inline, except when you have a good
reason and document it.

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