diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-03-11 20:42:25 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-03-11 20:42:25 +0100 |
commit | 5b7a62e5e699baa64086199ada29bf10e3a09314 (patch) | |
tree | 5a8b9605c09d64e109f8382ea7338a9d69a0ef44 | |
parent | 2c6c64c47487dbe8af6a6dc450b33931ec937601 (diff) | |
parent | 8177d20fb2709ba9290dfd41308b8e5bee4e00f8 (diff) | |
download | plan9front-5b7a62e5e699baa64086199ada29bf10e3a09314.tar.xz |
merge
-rw-r--r-- | sys/src/9/bcm/dat.h | 1 | ||||
-rw-r--r-- | sys/src/9/kw/dat.h | 1 | ||||
-rw-r--r-- | sys/src/9/mtx/dat.h | 1 | ||||
-rw-r--r-- | sys/src/9/omap/dat.h | 1 | ||||
-rw-r--r-- | sys/src/9/pc/apic.c | 7 | ||||
-rw-r--r-- | sys/src/9/pc/dat.h | 2 | ||||
-rw-r--r-- | sys/src/9/pc/i8253.c | 7 | ||||
-rw-r--r-- | sys/src/9/pc/main.c | 3 | ||||
-rw-r--r-- | sys/src/9/pc/mmu.c | 2 | ||||
-rw-r--r-- | sys/src/9/pc/squidboy.c | 23 | ||||
-rw-r--r-- | sys/src/9/pc64/dat.h | 2 | ||||
-rw-r--r-- | sys/src/9/pc64/main.c | 2 | ||||
-rw-r--r-- | sys/src/9/pc64/squidboy.c | 19 | ||||
-rw-r--r-- | sys/src/9/port/devcons.c | 2 | ||||
-rw-r--r-- | sys/src/9/ppc/dat.h | 1 | ||||
-rw-r--r-- | sys/src/9/sgi/dat.h | 1 | ||||
-rw-r--r-- | sys/src/9/teg2/dat.h | 1 | ||||
-rw-r--r-- | sys/src/9/teg2/mmu.c | 2 | ||||
-rw-r--r-- | sys/src/9/xen/main.c | 1 | ||||
-rw-r--r-- | sys/src/9/zynq/dat.h | 1 |
20 files changed, 29 insertions, 51 deletions
diff --git a/sys/src/9/bcm/dat.h b/sys/src/9/bcm/dat.h index 56a5383ec..6f41f4563 100644 --- a/sys/src/9/bcm/dat.h +++ b/sys/src/9/bcm/dat.h @@ -222,7 +222,6 @@ typedef void KMap; struct { - Lock; char machs[MAXMACH]; /* active CPUs */ int exiting; /* shutdown */ }active; diff --git a/sys/src/9/kw/dat.h b/sys/src/9/kw/dat.h index 95804e329..ed0f15bcc 100644 --- a/sys/src/9/kw/dat.h +++ b/sys/src/9/kw/dat.h @@ -193,7 +193,6 @@ typedef void KMap; struct { - Lock; char machs[MAXMACH]; /* active CPUs */ int exiting; /* shutdown */ }active; diff --git a/sys/src/9/mtx/dat.h b/sys/src/9/mtx/dat.h index 3db9d2290..76bb8c856 100644 --- a/sys/src/9/mtx/dat.h +++ b/sys/src/9/mtx/dat.h @@ -180,7 +180,6 @@ struct Mach struct { - Lock; char machs[MAXMACH]; int exiting; }active; diff --git a/sys/src/9/omap/dat.h b/sys/src/9/omap/dat.h index 0f0c5d6a4..466838cf6 100644 --- a/sys/src/9/omap/dat.h +++ b/sys/src/9/omap/dat.h @@ -215,7 +215,6 @@ typedef void KMap; struct { - Lock; char machs[MAXMACH]; /* active CPUs */ int exiting; /* shutdown */ }active; 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/dat.h b/sys/src/9/pc/dat.h index f0157652d..6369f73de 100644 --- a/sys/src/9/pc/dat.h +++ b/sys/src/9/pc/dat.h @@ -269,10 +269,8 @@ void kunmap(KMap*); struct { - Lock; char machs[MAXMACH]; /* active CPUs */ int exiting; /* shutdown */ - int thunderbirdsarego; /* lets the added processors continue to schedinit */ }active; /* 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) { /* diff --git a/sys/src/9/pc/main.c b/sys/src/9/pc/main.c index e972c2854..2479bc071 100644 --- a/sys/src/9/pc/main.c +++ b/sys/src/9/pc/main.c @@ -167,7 +167,6 @@ main(void) pageinit(); swapinit(); userinit(); - active.thunderbirdsarego = 1; schedinit(); } @@ -426,6 +425,7 @@ confinit(void) if(userpcnt < 10) userpcnt = 70; kpages = conf.npage - (conf.npage*userpcnt)/100; + conf.nimage = conf.nproc; /* * Hack for the big boys. Only good while physmem < 4GB. @@ -438,7 +438,6 @@ confinit(void) if(getconf("*imagemaxmb") == 0) if(kpages > (64*MB + conf.npage*sizeof(Page))/BY2PG){ kpages = (64*MB + conf.npage*sizeof(Page))/BY2PG; - conf.nimage = 2000; kpages += (conf.nproc*KSTACK)/BY2PG; } } else { diff --git a/sys/src/9/pc/mmu.c b/sys/src/9/pc/mmu.c index c0f7b7718..2e77aaee7 100644 --- a/sys/src/9/pc/mmu.c +++ b/sys/src/9/pc/mmu.c @@ -679,7 +679,7 @@ vunmap(void *v, int size) * boot. In that case it suffices to flush the MACH(0) TLB * and return. */ - if(!active.thunderbirdsarego){ + if(up == nil){ putcr3(PADDR(MACHP(0)->pdb)); return; } diff --git a/sys/src/9/pc/squidboy.c b/sys/src/9/pc/squidboy.c index 85c3992d1..7a3501221 100644 --- a/sys/src/9/pc/squidboy.c +++ b/sys/src/9/pc/squidboy.c @@ -12,30 +12,17 @@ static void squidboy(Apic* apic) { // iprint("Hello Squidboy\n"); - machinit(); mmuinit(); - cpuidentify(); cpuidprint(); - + syncclock(); + active.machs[m->machno] = 1; apic->online = 1; - coherence(); - lapicinit(apic); lapiconline(); - syncclock(); timersinit(); - fpoff(); - - lock(&active); - active.machs[m->machno] = 1; - unlock(&active); - - while(!active.thunderbirdsarego) - microdelay(100); - schedinit(); } @@ -107,10 +94,12 @@ mpstartap(Apic* apic) nvramwrite(0x0F, 0x0A); /* shutdown code: warm reset upon init ipi */ lapicstartap(apic, PADDR(APBOOTSTRAP)); - for(i = 0; i < 1000; i++){ + for(i = 0; i < 100000; i++){ + if(arch->fastclock == tscticks) + cycles(&m->tscticks); /* for ap's syncclock(); */ if(apic->online) break; - delay(10); + delay(1); } nvramwrite(0x0F, 0x00); } diff --git a/sys/src/9/pc64/dat.h b/sys/src/9/pc64/dat.h index e3554a1be..4da598ff1 100644 --- a/sys/src/9/pc64/dat.h +++ b/sys/src/9/pc64/dat.h @@ -232,10 +232,8 @@ typedef void KMap; struct { - Lock; char machs[MAXMACH]; /* bitmap of active CPUs */ int exiting; /* shutdown */ - int thunderbirdsarego; /* lets the added processors continue to schedinit */ }active; /* diff --git a/sys/src/9/pc64/main.c b/sys/src/9/pc64/main.c index 040a01831..e1534e9b7 100644 --- a/sys/src/9/pc64/main.c +++ b/sys/src/9/pc64/main.c @@ -200,6 +200,7 @@ confinit(void) if(userpcnt < 10) userpcnt = 70; kpages = conf.npage - (conf.npage*userpcnt)/100; + conf.nimage = conf.nproc; } else { if(userpcnt < 10) { if(conf.npage*BY2PG < 16*MB) @@ -517,7 +518,6 @@ main() pageinit(); swapinit(); userinit(); - active.thunderbirdsarego = 1; schedinit(); } diff --git a/sys/src/9/pc64/squidboy.c b/sys/src/9/pc64/squidboy.c index 218f4971a..4f923ca57 100644 --- a/sys/src/9/pc64/squidboy.c +++ b/sys/src/9/pc64/squidboy.c @@ -15,21 +15,12 @@ squidboy(Apic* apic) mmuinit(); cpuidentify(); cpuidprint(); + syncclock(); + active.machs[m->machno] = 1; apic->online = 1; - coherence(); - lapicinit(apic); lapiconline(); - syncclock(); timersinit(); - - lock(&active); - active.machs[m->machno] = 1; - unlock(&active); - - while(!active.thunderbirdsarego) - microdelay(100); - schedinit(); } @@ -102,10 +93,12 @@ mpstartap(Apic* apic) nvramwrite(0x0F, 0x0A); /* shutdown code: warm reset upon init ipi */ lapicstartap(apic, PADDR(APBOOTSTRAP)); - for(i = 0; i < 1000; i++){ + for(i = 0; i < 100000; i++){ + if(arch->fastclock == tscticks) + cycles(&m->tscticks); /* for ap's syncclock(); */ if(apic->online) break; - delay(10); + delay(1); } nvramwrite(0x0F, 0x00); } diff --git a/sys/src/9/port/devcons.c b/sys/src/9/port/devcons.c index 76be5ec46..67e28a83a 100644 --- a/sys/src/9/port/devcons.c +++ b/sys/src/9/port/devcons.c @@ -1008,11 +1008,9 @@ cpushutdown(void) { int ms, once; - lock(&active); once = active.machs[m->machno]; active.machs[m->machno] = 0; active.exiting = 1; - unlock(&active); if(once) iprint("cpu%d: exiting\n", m->machno); diff --git a/sys/src/9/ppc/dat.h b/sys/src/9/ppc/dat.h index b04362794..6589beb44 100644 --- a/sys/src/9/ppc/dat.h +++ b/sys/src/9/ppc/dat.h @@ -188,7 +188,6 @@ struct Mach struct { - Lock; char machs[MAXMACH]; int exiting; }active; diff --git a/sys/src/9/sgi/dat.h b/sys/src/9/sgi/dat.h index 2a2ab273c..800ed7182 100644 --- a/sys/src/9/sgi/dat.h +++ b/sys/src/9/sgi/dat.h @@ -203,7 +203,6 @@ struct Softtlb struct { - Lock; char machs[MAXMACH]; /* active cpus */ short exiting; }active; diff --git a/sys/src/9/teg2/dat.h b/sys/src/9/teg2/dat.h index 0152c76b3..0aa54a7d0 100644 --- a/sys/src/9/teg2/dat.h +++ b/sys/src/9/teg2/dat.h @@ -250,7 +250,6 @@ struct int wfi; /* bitmap of CPUs in WFI state */ int stopped; /* bitmap of CPUs stopped */ int exiting; /* shutdown */ - int thunderbirdsarego; /* lets the added processors continue to schedinit */ }active; extern register Mach* m; /* R10 */ diff --git a/sys/src/9/teg2/mmu.c b/sys/src/9/teg2/mmu.c index fc7760eab..1522c1f23 100644 --- a/sys/src/9/teg2/mmu.c +++ b/sys/src/9/teg2/mmu.c @@ -484,7 +484,7 @@ mmurelease(Proc* proc) for(page = proc->mmul2cache; page != nil; page = next){ next = page->next; if(--page->ref) - panic("mmurelease: page->ref %d", page->ref); + panic("mmurelease: page->ref %ld", page->ref); pagechainhead(page); } if(proc->mmul2cache != nil) diff --git a/sys/src/9/xen/main.c b/sys/src/9/xen/main.c index ab6272081..f58f4628e 100644 --- a/sys/src/9/xen/main.c +++ b/sys/src/9/xen/main.c @@ -106,7 +106,6 @@ main(void) swapinit(); userinit(); - active.thunderbirdsarego = 1; schedinit(); } diff --git a/sys/src/9/zynq/dat.h b/sys/src/9/zynq/dat.h index a1d50b40b..7431ed803 100644 --- a/sys/src/9/zynq/dat.h +++ b/sys/src/9/zynq/dat.h @@ -174,7 +174,6 @@ struct ISAConf struct { - Lock; char machs[MAXMACH]; /* active CPUs */ int exiting; /* shutdown */ }active; |