summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/9/pc/apic.c7
-rw-r--r--sys/src/9/pc/i8253.c7
2 files changed, 13 insertions, 1 deletions
diff --git a/sys/src/9/pc/apic.c b/sys/src/9/pc/apic.c
index 30ca0b50a..d061c777c 100644
--- a/sys/src/9/pc/apic.c
+++ b/sys/src/9/pc/apic.c
@@ -141,7 +141,7 @@ lapiconline(void)
}
/*
- * use the i8253 clock to figure out our lapic timer rate.
+ * use the i8253/tsc clock to figure out our lapic timer rate.
*/
static void
lapictimerinit(void)
@@ -150,6 +150,11 @@ lapictimerinit(void)
Apictimer *a;
int s;
+ if(m->machno != 0){
+ lapictimer[m->machno] = lapictimer[0];
+ return;
+ }
+
s = splhi();
a = &lapictimer[m->machno];
a->tdx = 0;
diff --git a/sys/src/9/pc/i8253.c b/sys/src/9/pc/i8253.c
index 1163ace3c..50fad7105 100644
--- a/sys/src/9/pc/i8253.c
+++ b/sys/src/9/pc/i8253.c
@@ -130,6 +130,13 @@ guesscpuhz(int aalcycles)
int loops, x, y;
uvlong a, b, cpufreq;
+ if(m->machno != 0){
+ m->cpuhz = MACHP(0)->cpuhz;
+ m->cpumhz = MACHP(0)->cpumhz;
+ m->loopconst = MACHP(0)->loopconst;
+ return;
+ }
+
ilock(&i8253);
for(loops = 1000;;loops += 1000) {
/*