Re: Very Short Delays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 02, 2001 at 11:47:58PM +0100, Marc Brekoo wrote:

> 
> > On Fri, Nov 02, 2001 at 12:26:18PM -0800, Christine Ames wrote:
> >
> > > Greetings,
> > >
> > > I'm looking for a way to "busy wait" <= 400 nanoseconds.
> > >
> > > In _Linux_Device_Drivers_ I've found udelay(for micro
> > > seconds) and mdelay(for milli seconds), but they state (2nd
> > > edition, page 189) that "Currently, support for delays longer
> > > than a few microseconds and shorter than a timer tick is very
> > > inefficient."  I found no further discussion.
> > >
> > > "Inefficient" or not, I need a cross-platform/cross-kernel
> > > way to stall <= 400ns while my hardware gets back to me.  Am
> > > I stuck, or is there a way?
> >
> > There's no way currently to do that, the best you can do is udelay(1),
> which is
> > 1ns. Any more, and you'll need to write your own function, based on
> udelay, it's
> > not *that* difficult, divide the magic constant by 2 to get roughly 550ns,
> I'd
> > think...
> 
> I thing you mean 1ms, not 1ns... or else it would just be udelay(400),
> wouldn't it? ;)

Ohh, umm:

delay(1) -> 1 millisecond (10^-3 seconds)
udelay(1) -> 1 microsecond (10^-6 seconds)

1 nanosecond is 10^-9 seconds, 400 nanoseconds is roughly half a microsecond, as
provided by udelay().

-- 

Mark Zealey (aka JALH on irc.openprojects.net: #zealos and many more)
mark@zealos.org
mark@itsolve.co.uk

UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a16! C++++>$ P++++>+++++$ L+++>+++++$
!E---? W+++>$ N- !o? !w--- O? !M? !V? !PS !PE--@ PGP+? r++ !t---?@ !X---?
!R- b+ !tv b+ DI+ D+? G+++ e>+++++ !h++* r!-- y--

(www.geekcode.com)
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux