LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-09-2010, 01:41 PM   #1
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
Not clear with pre_start in 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



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
How to Calibrate TV under Linux (NVIDIA) VertX Linux - Desktop 2 02-08-2008 10:50 AM
How to calibrate joystick? Winter Knight Linux - Hardware 1 12-11-2007 02:50 AM
calibrate sleep stz Programming 6 11-08-2007 10:41 PM
Calibrate your mouse HERE. /bin/bash General 26 11-06-2006 05:48 AM
How to clear a std::string buff.clear()? lucky6969b Programming 3 03-17-2006 07:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:04 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