diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-03-11 16:18:01 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-03-11 16:18:01 +0100 |
commit | 812383473cea9b53cf3c8ff138489a3d10d65f44 (patch) | |
tree | 60aca631ac52f3d200b952cd58b3273ff8f2f12a | |
parent | 3e0e77a8521331412c96b6371622aa2f76d7aefc (diff) | |
download | plan9front-812383473cea9b53cf3c8ff138489a3d10d65f44.tar.xz |
pc kernel: assume tsc and lapic clock rate on application processors is the same as on bootrap processor
-rw-r--r-- | sys/src/9/pc/apic.c | 7 | ||||
-rw-r--r-- | sys/src/9/pc/i8253.c | 7 |
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) { /* |