pc64: fix for unsigned comparsion of (top - base) >= size
the rounding of base can make it above top, so have to use signed comparsion.
This commit is contained in:
parent
fb97665a14
commit
1427ba3126
1 changed files with 1 additions and 1 deletions
|
@ -278,7 +278,7 @@ preallocpages(void)
|
|||
pm = &palloc.mem[i];
|
||||
base = ROUND(pm->base, PGLSZ(1));
|
||||
top = pm->base + (uvlong)pm->npage * BY2PG;
|
||||
if((base + size) <= VMAPSIZE && (top - base) >= size){
|
||||
if((base + size) <= VMAPSIZE && (vlong)(top - base) >= size){
|
||||
va = base + VMAP;
|
||||
pmap(m->pml4, base | PTEGLOBAL|PTEWRITE|PTEVALID, va, size);
|
||||
palloc.pages = (Page*)va;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue