lkml.org 
[lkml]   [2011]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 16/19] OpenRISC: Headers
    Date
    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


    \
     
     \ /
      Last update: 2011-06-19 21:45    [W:0.021 / U:150.676 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site