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:
cinap_lenrek 2015-06-18 12:15:33 +02:00
parent fd8597ac31
commit 0dab8869ad

View file

@ -36,6 +36,8 @@ pageinit(void)
for(j=0; j<pm->npage; j++){
memset(p, 0, sizeof *p);
p->pa = pm->base+j*BY2PG;
if(cankaddr(p->pa) && (KADDR(p->pa) == nil || KADDR(p->pa) == (void*)-BY2PG))
continue;
p->color = color;
color = (color+1)%NCOLOR;
pagechainhead(p);