kernel: ignore last page at the top of virtual kernel address space for xalloc()
avoding kernel address -BY2PG because of end pointer wrapping to zero.
This commit is contained in:
parent
cb2a55aeb3
commit
1bd4c243ad
1 changed files with 4 additions and 2 deletions
|
@ -71,8 +71,10 @@ xinit(void)
|
|||
/* first give to kernel */
|
||||
if(n > 0){
|
||||
m->kbase = (uintptr)KADDR(m->base);
|
||||
m->klimit = (uintptr)KADDR(m->base+size-1)+1;
|
||||
xhole(m->base, size);
|
||||
m->klimit = (uintptr)m->kbase+size;
|
||||
if(m->klimit == 0)
|
||||
m->klimit = (uintptr)-BY2PG;
|
||||
xhole(m->base, m->klimit - m->kbase);
|
||||
kpages -= n;
|
||||
}
|
||||
/* if anything left over, give to user */
|
||||
|
|
Loading…
Reference in a new issue