If we avoid to use the page at addr 0, we should adjust the size to reflect it.

This commit is contained in:
Olivier Houchard 2013-10-17 09:57:09 +00:00
parent 7c3547bacd
commit a1739e7e15

View File

@ -1169,11 +1169,15 @@ physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz)
*/
if (availmem_regions[i].mr_start > 0 ||
availmem_regions[i].mr_size > PAGE_SIZE) {
vm_size_t size;
phys_avail[j] = availmem_regions[i].mr_start;
if (phys_avail[j] == 0)
size = availmem_regions[i].mr_size;
if (phys_avail[j] == 0) {
phys_avail[j] += PAGE_SIZE;
phys_avail[j + 1] = availmem_regions[i].mr_start +
availmem_regions[i].mr_size;
size -= PAGE_SIZE;
}
phys_avail[j + 1] = availmem_regions[i].mr_start + size;
} else
j -= 2;
}