struct
{
- Lock;
char machs[MAXMACH]; /* active CPUs */
int exiting; /* shutdown */
}active;
struct
{
- Lock;
char machs[MAXMACH]; /* active CPUs */
int exiting; /* shutdown */
}active;
struct
{
- Lock;
char machs[MAXMACH];
int exiting;
}active;
struct
{
- Lock;
char machs[MAXMACH]; /* active CPUs */
int exiting; /* shutdown */
}active;
}
/*
- * 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)
Apictimer *a;
int s;
+ if(m->machno != 0){
+ lapictimer[m->machno] = lapictimer[0];
+ return;
+ }
+
s = splhi();
a = &lapictimer[m->machno];
a->tdx = 0;
struct
{
- Lock;
char machs[MAXMACH]; /* active CPUs */
int exiting; /* shutdown */
- int thunderbirdsarego; /* lets the added processors continue to schedinit */
}active;
/*
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) {
/*
pageinit();
swapinit();
userinit();
- active.thunderbirdsarego = 1;
schedinit();
}
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.
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 {
* 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;
}
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();
}
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);
}
struct
{
- Lock;
char machs[MAXMACH]; /* bitmap of active CPUs */
int exiting; /* shutdown */
- int thunderbirdsarego; /* lets the added processors continue to schedinit */
}active;
/*
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)
pageinit();
swapinit();
userinit();
- active.thunderbirdsarego = 1;
schedinit();
}
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();
}
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);
}
{
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);
struct
{
- Lock;
char machs[MAXMACH];
int exiting;
}active;
struct
{
- Lock;
char machs[MAXMACH]; /* active cpus */
short exiting;
}active;
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 */
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)
swapinit();
userinit();
- active.thunderbirdsarego = 1;
schedinit();
}
struct
{
- Lock;
char machs[MAXMACH]; /* active CPUs */
int exiting; /* shutdown */
}active;