]> git.lizzy.rs Git - plan9front.git/commitdiff
merge
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sat, 11 Mar 2017 19:42:25 +0000 (20:42 +0100)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sat, 11 Mar 2017 19:42:25 +0000 (20:42 +0100)
20 files changed:
sys/src/9/bcm/dat.h
sys/src/9/kw/dat.h
sys/src/9/mtx/dat.h
sys/src/9/omap/dat.h
sys/src/9/pc/apic.c
sys/src/9/pc/dat.h
sys/src/9/pc/i8253.c
sys/src/9/pc/main.c
sys/src/9/pc/mmu.c
sys/src/9/pc/squidboy.c
sys/src/9/pc64/dat.h
sys/src/9/pc64/main.c
sys/src/9/pc64/squidboy.c
sys/src/9/port/devcons.c
sys/src/9/ppc/dat.h
sys/src/9/sgi/dat.h
sys/src/9/teg2/dat.h
sys/src/9/teg2/mmu.c
sys/src/9/xen/main.c
sys/src/9/zynq/dat.h

index 56a5383ec915643488147e0533fc430a7d41cd48..6f41f4563f5a7865f299464b7c5a6d0b3823d57a 100644 (file)
@@ -222,7 +222,6 @@ typedef void                KMap;
 
 struct
 {
-       Lock;
        char    machs[MAXMACH];         /* active CPUs */
        int     exiting;                /* shutdown */
 }active;
index 95804e32974b5b8b8de086d2811dc22ff8785185..ed0f15bcc7480787ba3fbd0005683e1c856cff82 100644 (file)
@@ -193,7 +193,6 @@ typedef void                KMap;
 
 struct
 {
-       Lock;
        char    machs[MAXMACH];         /* active CPUs */
        int     exiting;                /* shutdown */
 }active;
index 3db9d22909d5a870b411ae5ed1a0c6ba1f54fedb..76bb8c85606aa3321a4ce1a9d7cfa9ec15811305 100644 (file)
@@ -180,7 +180,6 @@ struct Mach
 
 struct
 {
-       Lock;
        char    machs[MAXMACH];
        int     exiting;
 }active;
index 0f0c5d6a4edf60257cac112a46b9fcf17330de9e..466838cf66cac6994845a329d5190b08abf328fe 100644 (file)
@@ -215,7 +215,6 @@ typedef void                KMap;
 
 struct
 {
-       Lock;
        char    machs[MAXMACH];         /* active CPUs */
        int     exiting;                /* shutdown */
 }active;
index 30ca0b50a289b71cc58f88fe4e7e2602039562a5..d061c777c6a6ff81d1964b78e0f1d0d0849a14c3 100644 (file)
@@ -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;
index f0157652d69d932ac8740090adbeae5043ac6717..6369f73de90c0f410a635ef637ef7814d1c046e7 100644 (file)
@@ -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;
 
 /*
index 1163ace3cd5badb2ca24d8ad5b9f053567d7b5c4..50fad7105ba48984dabb97a6686e78a831ff17ae 100644 (file)
@@ -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) {
                /*
index e972c28541fdcdbc6cbb099f781033e39e91fbd1..2479bc0713908217d0e6ffde0baeba0805752ead 100644 (file)
@@ -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 {
index c0f7b7718c6fb6de8201d546582607b7f59eb96d..2e77aaee718cda83e138732306fb1167ec28c047 100644 (file)
@@ -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;
        }
index 85c3992d106dbb5db64cd6b4794818792daac999..7a3501221d49c112637e6abbf75afc88dbc43bbd 100644 (file)
@@ -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);
 }
index e3554a1bee3ecbeb8084cd37f362e606d40c2d63..4da598ff1d35cca55375b85053ad9d9ee135c3d5 100644 (file)
@@ -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;
 
 /*
index 040a018314ebb5f7f551d2c45926d539a2a065a7..e1534e9b7a4318f8a5b7b7de114cccfb37b6c9c1 100644 (file)
@@ -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();
 }
 
index 218f4971a306e6f54fd1eb9752ab0969bef515ea..4f923ca579aa11f5a62437130f1e84dfbdf4c97f 100644 (file)
@@ -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);
 }
index 76be5ec466fa8daae0ce9aebdd6e46f37e0f4616..67e28a83a85ad288ab9d1bb6a05df61b60f10dfd 100644 (file)
@@ -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);
index b0436279454b33b2a045419a18c838cfbead3ba5..6589beb4468c8f0c8d914b6b4c0f97b43ed16115 100644 (file)
@@ -188,7 +188,6 @@ struct Mach
 
 struct
 {
-       Lock;
        char    machs[MAXMACH];
        int     exiting;
 }active;
index 2a2ab273cf13f8208a54d17bd603df6974c9332e..800ed7182ab98959ac307a0b0f5617721e16f296 100644 (file)
@@ -203,7 +203,6 @@ struct Softtlb
 
 struct
 {
-       Lock;
        char    machs[MAXMACH];         /* active cpus */
        short   exiting;
 }active;
index 0152c76b3272ab565d72201c592446aba54672ed..0aa54a7d05e2e9f22541856bf301f6c9269b3a71 100644 (file)
@@ -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 */
index fc7760eab672c3bb55f0244f2ab63453eaba9059..1522c1f236b65efe44ba078e0db92530916b10bd 100644 (file)
@@ -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)
index ab62720817e2b79a14e9613f8f524d3eada5a788..f58f4628e0956f0b465cf87476dc6a20411aacdb 100644 (file)
@@ -106,7 +106,6 @@ main(void)
 
        swapinit();
        userinit();
-       active.thunderbirdsarego = 1;
        schedinit();
 }
 
index a1d50b40b91d9fb4b49e288c892a11a17d7b478a..7431ed80319095b1190da335f7a86071cf36d260 100644 (file)
@@ -174,7 +174,6 @@ struct ISAConf
 
 struct
 {
-       Lock;
        char    machs[MAXMACH];         /* active CPUs */
        int     exiting;                /* shutdown */
 }active;