merge
This commit is contained in:
commit
94fb78a65e
|
@ -519,5 +519,7 @@ identify(void)
|
||||||
return 1;
|
return 1;
|
||||||
if((cp = getconf("*nomp")) != nil && strcmp(cp, "0") != 0)
|
if((cp = getconf("*nomp")) != nil && strcmp(cp, "0") != 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
if(m->havetsc)
|
||||||
|
archacpi.fastclock = tscticks;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -395,5 +395,8 @@ identify(void)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(m->havetsc)
|
||||||
|
archmp.fastclock = tscticks;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,10 +145,12 @@ guesscpuhz(int aalcycles)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
outb(Tmode, Latch2);
|
outb(Tmode, Latch2);
|
||||||
|
cycles(&a);
|
||||||
x = inb(T2cntr);
|
x = inb(T2cntr);
|
||||||
x |= inb(T2cntr)<<8;
|
x |= inb(T2cntr)<<8;
|
||||||
aamloop(loops);
|
aamloop(loops);
|
||||||
outb(Tmode, Latch2);
|
outb(Tmode, Latch2);
|
||||||
|
cycles(&b);
|
||||||
y = inb(T2cntr);
|
y = inb(T2cntr);
|
||||||
y |= inb(T2cntr)<<8;
|
y |= inb(T2cntr)<<8;
|
||||||
|
|
||||||
|
@ -172,25 +174,13 @@ guesscpuhz(int aalcycles)
|
||||||
cpufreq = (vlong)loops*((aalcycles*2*Freq)/x);
|
cpufreq = (vlong)loops*((aalcycles*2*Freq)/x);
|
||||||
m->loopconst = (cpufreq/1000)/aalcycles; /* AAM+LOOP's for 1 ms */
|
m->loopconst = (cpufreq/1000)/aalcycles; /* AAM+LOOP's for 1 ms */
|
||||||
|
|
||||||
if(m->havetsc){
|
/* a == b means virtualbox has confused us */
|
||||||
aamloop(loops); /* warm up */
|
if(m->havetsc && b > a){
|
||||||
cycles(&a);
|
b -= a;
|
||||||
aamloop(loops);
|
b *= 2*Freq;
|
||||||
cycles(&b);
|
b /= x;
|
||||||
|
m->cyclefreq = b;
|
||||||
aamloop(loops);
|
cpufreq = b;
|
||||||
cycles(&a);
|
|
||||||
aamloop(loops);
|
|
||||||
cycles(&b);
|
|
||||||
|
|
||||||
/* a == b means virtualbox has confused us */
|
|
||||||
if(b > a){
|
|
||||||
b -= a;
|
|
||||||
b *= 2*Freq;
|
|
||||||
b /= x;
|
|
||||||
m->cyclefreq = b;
|
|
||||||
cpufreq = b;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
m->cpuhz = cpufreq;
|
m->cpuhz = cpufreq;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue