From 41383ad0120630edd42c5c897a287e2f9d9161b4 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 5 Jan 2016 05:32:40 +0100 Subject: kernel: change active.machs from bitmap to char array to support up to 64 cpus on pc64 --- sys/src/9/pc64/dat.h | 2 +- sys/src/9/pc64/main.c | 2 +- sys/src/9/pc64/mem.h | 2 +- sys/src/9/pc64/squidboy.c | 2 +- sys/src/9/pc64/trap.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sys/src/9/pc64') diff --git a/sys/src/9/pc64/dat.h b/sys/src/9/pc64/dat.h index 5558f331a..b6333c5ff 100644 --- a/sys/src/9/pc64/dat.h +++ b/sys/src/9/pc64/dat.h @@ -233,7 +233,7 @@ typedef void KMap; struct { Lock; - int machs; /* bitmap of active CPUs */ + char machs[MAXMACH]; /* bitmap of active CPUs */ int exiting; /* shutdown */ int thunderbirdsarego; /* lets the added processors continue to schedinit */ }active; diff --git a/sys/src/9/pc64/main.c b/sys/src/9/pc64/main.c index 4805bcc9e..040a01831 100644 --- a/sys/src/9/pc64/main.c +++ b/sys/src/9/pc64/main.c @@ -326,7 +326,7 @@ mach0init(void) machinit(); - active.machs = 1; + active.machs[0] = 1; active.exiting = 0; } diff --git a/sys/src/9/pc64/mem.h b/sys/src/9/pc64/mem.h index 0a82a378d..fa0a03a10 100644 --- a/sys/src/9/pc64/mem.h +++ b/sys/src/9/pc64/mem.h @@ -28,7 +28,7 @@ #define BLOCKALIGN 8 #define FPalign 16 -#define MAXMACH 32 /* max # cpus system can run */ +#define MAXMACH 64 /* max # cpus system can run */ #define KSTACK (16*KiB) /* Size of Proc kernel stack */ diff --git a/sys/src/9/pc64/squidboy.c b/sys/src/9/pc64/squidboy.c index 653802955..218f4971a 100644 --- a/sys/src/9/pc64/squidboy.c +++ b/sys/src/9/pc64/squidboy.c @@ -24,7 +24,7 @@ squidboy(Apic* apic) timersinit(); lock(&active); - active.machs |= 1<machno; + active.machs[m->machno] = 1; unlock(&active); while(!active.thunderbirdsarego) diff --git a/sys/src/9/pc64/trap.c b/sys/src/9/pc64/trap.c index 6dae1b283..e84b199a3 100644 --- a/sys/src/9/pc64/trap.c +++ b/sys/src/9/pc64/trap.c @@ -394,8 +394,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<machno == mach->machno) -- cgit v1.2.3