svn commit: r216443 - in head/sys: amd64/amd64 dev/acpica i386/i386

Jung-uk Kim jkim at
Tue Dec 14 20:30:49 UTC 2010

On Tuesday 14 December 2010 03:07 pm, Jung-uk Kim wrote:
> Author: jkim
> Date: Tue Dec 14 20:07:51 2010
> New Revision: 216443
> URL:
> Log:
>   Stop lying about supporting cpu_est_clockrate() when TSC is
> invariant.  This function always returned the nominal frequency
> instead of current frequency because we use RDTSC instruction to
> calculate difference in CPU ticks, which is supposedly constant for
> the case.  Now we support cpu_get_nominal_mhz() for the case,
> instead.  Note it should be just enough for most usage cases
> because cpu_est_clockrate() is often times abused to find maximum
> frequency of the processor.

Actually, I wanted to support cpu_est_clockrate() as well and the 
following was my naive attempt:

Unfortunately, it only worked for AMD64 Family 0Fh and below where we 
don't need this hack at all.  I tried everything I could (e.g., 
fooling around with branch prediction) but it constantly gave me 
better MHz for under-clocked cases. :-/

Jung-uk Kim

More information about the svn-src-all mailing list