ref: 94fb78a65e4bea9a1f19b7879150852335bf9215
parent: f99007281d0080f9369ae502421304b37f0625a9
parent: 19bf2bbfeb9905728ae259680793fc9fb65d69cf
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Thu Jun 20 22:48:25 EDT 2013
merge
--- a/sys/src/9/pc/archacpi.c
+++ b/sys/src/9/pc/archacpi.c
@@ -519,5 +519,7 @@
return 1;
if((cp = getconf("*nomp")) != nil && strcmp(cp, "0") != 0)return 1;
+ if(m->havetsc)
+ archacpi.fastclock = tscticks;
return 0;
}
--- a/sys/src/9/pc/archmp.c
+++ b/sys/src/9/pc/archmp.c
@@ -395,5 +395,8 @@
return 1;
}
+ if(m->havetsc)
+ archmp.fastclock = tscticks;
+
return 0;
}
--- a/sys/src/9/pc/i8253.c
+++ b/sys/src/9/pc/i8253.c
@@ -145,10 +145,12 @@
*
*/
outb(Tmode, Latch2);
+ cycles(&a);
x = inb(T2cntr);
x |= inb(T2cntr)<<8;
aamloop(loops);
outb(Tmode, Latch2);
+ cycles(&b);
y = inb(T2cntr);
y |= inb(T2cntr)<<8;
@@ -172,25 +174,13 @@
cpufreq = (vlong)loops*((aalcycles*2*Freq)/x);
m->loopconst = (cpufreq/1000)/aalcycles; /* AAM+LOOP's for 1 ms */
- if(m->havetsc){- aamloop(loops); /* warm up */
- cycles(&a);
- aamloop(loops);
- cycles(&b);
-
- aamloop(loops);
- 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;
- }
+ /* a == b means virtualbox has confused us */
+ if(m->havetsc && b > a){+ b -= a;
+ b *= 2*Freq;
+ b /= x;
+ m->cyclefreq = b;
+ cpufreq = b;
}
m->cpuhz = cpufreq;
--
⑨