prepare fileserver main.c for mp kernels Reference: /n/atom/patch/applied2013/fsmainmprdy Date: Mon Aug 26 03:52:45 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/fs/port/portdat.h Mon Aug 26 03:52:20 2013 +++ /sys/src/fs/port/portdat.h Mon Aug 26 03:52:21 2013 @@ -620,7 +620,6 @@ struct Mach { int machno; /* physical id of processor */ - int mmask; /* 1<machno */ Timet ticks; /* of the clock since boot time */ int lights; /* light lights, this processor */ Filter idle; --- /sys/src/fs/port/main.c Mon Aug 26 03:52:22 2013 +++ /sys/src/fs/port/main.c Mon Aug 26 03:52:23 2013 @@ -13,7 +13,6 @@ n = m->machno; memset(m, 0, sizeof(Mach)); m->machno = n; - m->mmask = 1<machno; m->lights = 0; dofilter(&m->idle); @@ -24,7 +23,8 @@ static void confinit(void) { - conf.nmach = 1; + if(conf.nmach <= 0) + conf.nmach = 1; conf.nproc = 80; conf.mem = meminit(); @@ -60,6 +60,7 @@ echo = 1; predawn = 1; + lockinit(); formatinit(); machinit(); cpuidentify(); @@ -67,7 +68,6 @@ confinit(); if(conf.uartonly) uartspecial(0, kbdchar, conschar, conf.uartonly); - lockinit(); printinit(); procinit(); clockinit(); @@ -108,9 +108,9 @@ userinit(touser, 0, "ini"); predawn = 0; - wakeup(&dawnrend); - launchinit(); - schedinit(); + wakeup(&dawnrend); + launchinit(); + schedinit(); } /* @@ -300,6 +300,8 @@ spllo(); print("cpu %d exiting\n", m->machno); while(active.machs) + delay(1); + while(m->machno != 0) delay(1); print("halted at %T.\npress a key to reboot sooner than %d mins.\n",