diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-01-05 05:32:40 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-01-05 05:32:40 +0100 |
commit | 41383ad0120630edd42c5c897a287e2f9d9161b4 (patch) | |
tree | 8be5d54a18256d149febb8a8bbf432bacb5e28e8 /sys/src/9/pc | |
parent | dd8908cff003135095996d2b0b5ea250c615a0e2 (diff) |
kernel: change active.machs from bitmap to char array to support up to 64 cpus on pc64
Diffstat (limited to 'sys/src/9/pc')
-rw-r--r-- | sys/src/9/pc/dat.h | 2 | ||||
-rw-r--r-- | sys/src/9/pc/main.c | 2 | ||||
-rw-r--r-- | sys/src/9/pc/mmu.c | 2 | ||||
-rw-r--r-- | sys/src/9/pc/mp.c | 4 | ||||
-rw-r--r-- | sys/src/9/pc/squidboy.c | 2 | ||||
-rw-r--r-- | sys/src/9/pc/trap.c | 4 |
6 files changed, 9 insertions, 7 deletions
diff --git a/sys/src/9/pc/dat.h b/sys/src/9/pc/dat.h index 19b7dfae2..581bdf73e 100644 --- a/sys/src/9/pc/dat.h +++ b/sys/src/9/pc/dat.h @@ -270,7 +270,7 @@ void kunmap(KMap*); struct { Lock; - int machs; /* bitmap of active CPUs */ + 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/main.c b/sys/src/9/pc/main.c index 6d8341997..02ca17d81 100644 --- a/sys/src/9/pc/main.c +++ b/sys/src/9/pc/main.c @@ -181,7 +181,7 @@ mach0init(void) machinit(); - active.machs = 1; + active.machs[0] = 1; active.exiting = 0; } diff --git a/sys/src/9/pc/mmu.c b/sys/src/9/pc/mmu.c index cfcdf8793..b48155084 100644 --- a/sys/src/9/pc/mmu.c +++ b/sys/src/9/pc/mmu.c @@ -685,7 +685,7 @@ vunmap(void *v, int size) for(i=0; i<conf.nmach; i++){ nm = MACHP(i); if(nm != m) - while((active.machs&(1<<nm->machno)) && nm->flushmmu) + while(active.machs[nm->machno] && nm->flushmmu) ; } } diff --git a/sys/src/9/pc/mp.c b/sys/src/9/pc/mp.c index 8bfc52204..ee3fdd363 100644 --- a/sys/src/9/pc/mp.c +++ b/sys/src/9/pc/mp.c @@ -198,6 +198,8 @@ mpinit(void) for(i=0; i<nelem(mpapic); i++){ if((apic = mpapic[i]) == nil) continue; + if(apic->machno >= MAXMACH) + continue; if(ncpu <= 1) break; if((apic->flags & (PcmpBP|PcmpEN)) == PcmpEN){ @@ -574,7 +576,7 @@ mpshutdown(void) for(;;) idle(); } - print("mpshutdown: active = %#8.8ux\n", active.machs); + print("mpshutdown\n"); delay(1000); splhi(); diff --git a/sys/src/9/pc/squidboy.c b/sys/src/9/pc/squidboy.c index 593016595..85c3992d1 100644 --- a/sys/src/9/pc/squidboy.c +++ b/sys/src/9/pc/squidboy.c @@ -30,7 +30,7 @@ squidboy(Apic* apic) fpoff(); lock(&active); - active.machs |= 1<<m->machno; + active.machs[m->machno] = 1; unlock(&active); while(!active.thunderbirdsarego) diff --git a/sys/src/9/pc/trap.c b/sys/src/9/pc/trap.c index 071278d03..3fa728975 100644 --- a/sys/src/9/pc/trap.c +++ b/sys/src/9/pc/trap.c @@ -400,8 +400,8 @@ trap(Ureg* ureg) if(0)print("cpu%d: spurious interrupt %d, last %d\n", m->machno, vno, m->lastintr); if(0)if(conf.nmach > 1){ - for(i = 0; i < 32; i++){ - if(!(active.machs & (1<<i))) + for(i = 0; i < MAXMACH; i++){ + if(active.machs[i] == 0) continue; mach = MACHP(i); if(m->machno == mach->machno) |