ref: 339112abc350b0b50ed49a1c92911506025117c7
parent: 30cbaa5c48160411631f2cd6768025a377cd0bec
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Apr 4 12:52:08 EDT 2020
mtx, ppc: use proctab() to index into process table
--- a/sys/src/9/mtx/mmu.c
+++ b/sys/src/9/mtx/mmu.c
@@ -85,10 +85,11 @@
sweepcolor = m->sweepcolor;
x = splhi();
- p = proctab(0);
- for(i = 0; i < conf.nproc; i++, p++)
+ for(i = 0; i < conf.nproc; i++) {
+ p = proctab(i);
if(PIDCOLOR(p->mmupid) == sweepcolor)
p->mmupid = 0;
+ }
splx(x);
ptab = (ulong*)m->ptabbase;
--- a/sys/src/9/ppc/mmu.c
+++ b/sys/src/9/ppc/mmu.c
@@ -89,10 +89,11 @@
sweepcolor = m->sweepcolor;
x = splhi();
- p = proctab(0);
- for(i = 0; i < conf.nproc; i++, p++)
+ for(i = 0; i < conf.nproc; i++){
+ p = proctab(i);
if(PIDCOLOR(p->mmupid) == sweepcolor)
p->mmupid = 0;
+ }
splx(x);
ptab = (ulong*)m->ptabbase;
@@ -125,9 +126,10 @@
m->mmupid = PIDBASE;
x = splhi();
tlbflushall();
- p = proctab(0);
- for(i = 0; i < conf.nproc; i++, p++)
+ for(i = 0; i < conf.nproc; i++){
+ p = proctab(i);
p->mmupid = 0;
+ }
splx(x);
wakeup(&m->sweepr);
}