BogoMips confusion ?

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

 



Hi, 
	I am going through the code for calculating BogoMips on i386 platform. The 
code is there in "init/main.c". The main function for this is "calibrate_delay()". If you 
go through the code for calibrate_delay(), you can see that it sets loops_per_jiffies 
to 4096 at the starting of the first while loop. Based on the processor's speed, it 
goes on incrementing [making it double] its value by (loops_per_delay <<= 1)... It 
comes out of the first while loop, once there is a difference between new jiffies and 
old jiffies. Now the problem starts after this... 
 
At the second while loop you can see that  
 
while ( lps_precision-- && (loopbit >>= 1) ) {... 
 
the aboce condition will fail always, as the starting value for lps_precision is 
LPS_PREC which has been defined to 8. 
Why is this loop there, if it will never execute ? because loopbit value will never be 
< 4096... 
 
TIA. 
 
Sumit Sharma 
IBM, Bangalore. 
 

[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