LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-20-2009, 06:00 AM   #1
ananth86coolguy
LQ Newbie
 
Registered: Mar 2009
Posts: 28

Rep: Reputation: 15
Max. Value that could be passed to an udelay() function


Hi
Is there any limit in the value that we pass as argument to an udelay() function???i.e can we specify something like this:udelay(2000)??

With Regds
Ananth
 
Old 04-20-2009, 08:38 AM   #2
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
It's at least the unsigned long max value, 2000 would be OK, more over, depending on your kernel, this value could be rounded (up or down, don't remember) to the closest jiffy value.
 
Old 04-20-2009, 08:44 AM   #3
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
Oh sorry, I was thinking about usleep... So in fact that's true, you must use the good delay function, depending on the time you want to sleep: ndelay for ns, udelay for us and mdealy for ms scale, so use "mdelay (2)" instead. BUT it's a busy waiting, that means that noting else can be done during this time, you'd better use (if possible) one of the "sleep" family functions. look here: http://lwn.net/Kernel/LDD3/ chapter 7
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parenthesis and other odd characters passed to bash function jakeo25 Programming 2 04-03-2008 10:27 AM
Using C API; first query passed passed by program to MySQL is successful, second quer weibullguy Programming 2 06-12-2007 10:45 PM
Array structs - passed to function cdog Programming 4 02-02-2006 03:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration