kernel: ignore memory pages with singular kernel addresses
addresses va's of 0 and -BY2PG cause trouble with some memmove()/memset() implementations and possibly other code because of the nil pointer and end pointers wrapping to zero.
This commit is contained in:
parent
fd8597ac31
commit
0dab8869ad
1 changed files with 2 additions and 0 deletions
|
@ -36,6 +36,8 @@ pageinit(void)
|
||||||
for(j=0; j<pm->npage; j++){
|
for(j=0; j<pm->npage; j++){
|
||||||
memset(p, 0, sizeof *p);
|
memset(p, 0, sizeof *p);
|
||||||
p->pa = pm->base+j*BY2PG;
|
p->pa = pm->base+j*BY2PG;
|
||||||
|
if(cankaddr(p->pa) && (KADDR(p->pa) == nil || KADDR(p->pa) == (void*)-BY2PG))
|
||||||
|
continue;
|
||||||
p->color = color;
|
p->color = color;
|
||||||
color = (color+1)%NCOLOR;
|
color = (color+1)%NCOLOR;
|
||||||
pagechainhead(p);
|
pagechainhead(p);
|
||||||
|
|
Loading…
Reference in a new issue