ref: 8d54dec9d0f820450067231c79de78fb774d0b06
parent: d123ce95efc406926df5031e830a7588de6c5295
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Mar 11 11:24:56 EST 2017
pc kernel: avoid AP's spinning in syncclock(), don't wait for thunderbirdsargo
--- a/sys/src/9/pc/squidboy.c
+++ b/sys/src/9/pc/squidboy.c
@@ -12,30 +12,17 @@
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 @@
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);
}
--- a/sys/src/9/pc64/squidboy.c
+++ b/sys/src/9/pc64/squidboy.c
@@ -15,21 +15,12 @@
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 @@
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);
}
--
⑨