[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201106192143.08208.arnd@arndb.de>
Date: Sun, 19 Jun 2011 21:43:08 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Jonas Bonn <jonas@...thpole.se>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH 16/19] OpenRISC: Headers
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists