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/teg2 | |
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/teg2')
-rw-r--r-- | sys/src/9/teg2/archtegra.c | 2 | ||||
-rw-r--r-- | sys/src/9/teg2/dat.h | 2 | ||||
-rw-r--r-- | sys/src/9/teg2/main.c | 14 |
3 files changed, 6 insertions, 12 deletions
diff --git a/sys/src/9/teg2/archtegra.c b/sys/src/9/teg2/archtegra.c index 8f1ad6831..0a486bad3 100644 --- a/sys/src/9/teg2/archtegra.c +++ b/sys/src/9/teg2/archtegra.c @@ -676,7 +676,7 @@ cpustart(void) Power *pwr; up = nil; - if (active.machs & (1<<m->machno)) { + if (active.machs[m->machno]) { serialputc('?'); serialputc('r'); panic("cpu%d: resetting after start", m->machno); diff --git a/sys/src/9/teg2/dat.h b/sys/src/9/teg2/dat.h index 80068975c..0152c76b3 100644 --- a/sys/src/9/teg2/dat.h +++ b/sys/src/9/teg2/dat.h @@ -246,7 +246,7 @@ typedef void KMap; struct { Lock; - int machs; /* bitmap of active CPUs */ + char machs[MAXMACH]; /* active CPUs */ int wfi; /* bitmap of CPUs in WFI state */ int stopped; /* bitmap of CPUs stopped */ int exiting; /* shutdown */ diff --git a/sys/src/9/teg2/main.c b/sys/src/9/teg2/main.c index 6847f3a91..e26d8bd87 100644 --- a/sys/src/9/teg2/main.c +++ b/sys/src/9/teg2/main.c @@ -208,13 +208,10 @@ getenv(char* name, char* buf, int n) void machon(uint cpu) { - ulong cpubit; - - cpubit = 1 << cpu; lock(&active); - if ((active.machs & cpubit) == 0) { /* currently off? */ + if (active.machs[cpu] == 0) { /* currently off? */ + active.machs[cpu] = 1; conf.nmach++; - active.machs |= cpubit; } unlock(&active); } @@ -223,13 +220,10 @@ machon(uint cpu) void machoff(uint cpu) { - ulong cpubit; - - cpubit = 1 << cpu; lock(&active); - if (active.machs & cpubit) { /* currently on? */ + if (active.machs[cpu]) { /* currently on? */ + active.machs[cpu] = 0; conf.nmach--; - active.machs &= ~cpubit; } unlock(&active); } |