pc: replace duplicated and broken mmu flush code in vunmap()
comparing m with MACHP() is wrong as m is a constant on 386. add procflushothers(), which flushes all processes except up using common procflushmmu() routine.
This commit is contained in:
parent
28836f3ff5
commit
13785bbbef
3 changed files with 13 additions and 21 deletions
|
@ -643,10 +643,7 @@ vmapalloc(ulong size)
|
||||||
void
|
void
|
||||||
vunmap(void *v, int size)
|
vunmap(void *v, int size)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
ulong va, o;
|
ulong va, o;
|
||||||
Mach *nm;
|
|
||||||
Proc *p;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* might not be aligned
|
* might not be aligned
|
||||||
|
@ -675,25 +672,8 @@ vunmap(void *v, int size)
|
||||||
putcr3(PADDR(MACHP(0)->pdb));
|
putcr3(PADDR(MACHP(0)->pdb));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for(i=0; i<conf.nproc; i++){
|
procflushothers();
|
||||||
p = proctab(i);
|
|
||||||
if(p->state == Dead)
|
|
||||||
continue;
|
|
||||||
if(p != up)
|
|
||||||
p->newtlb = 1;
|
|
||||||
}
|
|
||||||
for(i=0; i<conf.nmach; i++){
|
|
||||||
nm = MACHP(i);
|
|
||||||
if(nm != m)
|
|
||||||
nm->flushmmu = 1;
|
|
||||||
}
|
|
||||||
flushmmu();
|
flushmmu();
|
||||||
for(i=0; i<conf.nmach; i++){
|
|
||||||
nm = MACHP(i);
|
|
||||||
if(nm != m)
|
|
||||||
while(active.machs[nm->machno] && nm->flushmmu)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -229,6 +229,7 @@ void procdump(void);
|
||||||
int procfdprint(Chan*, int, char*, int);
|
int procfdprint(Chan*, int, char*, int);
|
||||||
void procflushseg(Segment*);
|
void procflushseg(Segment*);
|
||||||
void procflushpseg(Physseg*);
|
void procflushpseg(Physseg*);
|
||||||
|
void procflushothers(void);
|
||||||
int procindex(ulong);
|
int procindex(ulong);
|
||||||
void procinit0(void);
|
void procinit0(void);
|
||||||
ulong procpagecount(Proc*);
|
ulong procpagecount(Proc*);
|
||||||
|
|
|
@ -1412,6 +1412,17 @@ procflushpseg(Physseg *ps)
|
||||||
procflushmmu(matchpseg, ps);
|
procflushmmu(matchpseg, ps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
matchother(Proc *p, void *a)
|
||||||
|
{
|
||||||
|
return p != a;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
procflushothers(void)
|
||||||
|
{
|
||||||
|
procflushmmu(matchother, up);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
scheddump(void)
|
scheddump(void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue