Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Kernel Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 9th April 2010, 20:39
vtapas vtapas is offline
Member
 
Join Date: Apr 2010
Posts: 51
Thanks: 1
Thanked 0 Times in 0 Posts
 
Default Delay calculation calibrate.c

Well its a very simple problem I am not clear with some C syntax I am reading C and other books and I hope I shall be able to figure it out any ways but if some one feels I should be clear of some thing let me know I am not clear with the working of calibrate.c

I will quote the important lines of code that I think are confusing me and explain the aspects of them that I think I don't understand.


Code:
loops_per_jiffy = (1 << 12); /* Initial approximation = 4096 */
The choice of number 4096
power of 2 that is 12 why is that choosen.

Secondly
http://lxr.linux.no/#linux+v2.6.33/init/calibrate.c#L54
In comments it is mentioning

So, we do
* 1. pre_start <- When we are sure that jiffy switch hasn't happened
* 2. check jiffy switch
* 3. start <- timer value before or after jiffy switch
* 4. post_start <- When we are sure that jiffy switch has happened
What is all that pre_start and why is it needed to be used over here?

Here is some thing which I am wondering not because of logic in same program
while (ticks == jiffies);/* Wait till the start of next jiffy */

Till the start of next jiffy what is the processor busy with or how is the delay introduced here?Not the mathematical calculation for udelay or ndelay.
May be I am not clear with what I should search for.
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
delay in sending email Hellbound General 4 9th November 2012 10:53
questions related to delay pool help plz imranikram HOWTO-Related Questions 1 25th December 2009 06:30
DNS Propagation Delay remz Server Operation 4 5th September 2009 10:21
Mail delay in PHP Jose Gosalbez Installation/Configuration 1 4th October 2006 17:52
How many delay is normal? benjami Installation/Configuration 5 16th June 2006 17:26


All times are GMT +2. The time now is 15:42.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.