pc, pc64: warn when running out of conf.mem[] entries in meminit()

This commit is contained in:
cinap_lenrek 2021-02-06 13:33:27 +01:00
parent 01ab07ef72
commit e9af397dc7

View file

@ -568,13 +568,16 @@ meminit(void)
size = memmapsize(base, BY2PG) & ~(BY2PG-1);
if(size == 0)
continue;
if(cm >= &conf.mem[nelem(conf.mem)]){
print("meminit: out of entries, loosing: %#p (%llud)\n", base, (uvlong)size);
continue;
}
cm->base = memmapalloc(base, size, BY2PG, MemRAM);
if(cm->base == -1)
continue;
base = cm->base;
cm->npage = size/BY2PG;
if(++cm >= &conf.mem[nelem(conf.mem)])
break;
cm++;
}
if(0) memmapdump();