Make sure we do not provide the page 0 to the VM. It can't handle it properly,

because pmap_extract() returns 0 when there's no mapping.

PR:		arm/154227
MFC after:	1 week
This commit is contained in:
cognet 2012-02-29 12:44:34 +00:00
parent 295d98ee07
commit 410dc4af7f
2 changed files with 15 additions and 5 deletions

View File

@ -287,9 +287,19 @@ physmap_init(void)
availmem_regions[i].mr_start + availmem_regions[i].mr_size,
availmem_regions[i].mr_size);
phys_avail[j] = availmem_regions[i].mr_start;
phys_avail[j + 1] = availmem_regions[i].mr_start +
availmem_regions[i].mr_size;
/*
* We should not map the page at PA 0x0000000, the VM can't
* handle it, as pmap_extract() == 0 means failure.
*/
if (availmem_regions[i].mr_start > 0 ||
availmem_regions[i].mr_size > PAGE_SIZE) {
phys_avail[j] = availmem_regions[i].mr_start;
if (phys_avail[j] == 0)
phys_avail[j] += PAGE_SIZE;
phys_avail[j + 1] = availmem_regions[i].mr_start +
availmem_regions[i].mr_size;
} else
j -= 2;
}
phys_avail[j] = 0;
phys_avail[j + 1] = 0;

View File

@ -381,8 +381,8 @@ initarm(void *arg, void *arg2)
i = 0;
#ifdef ARM_USE_SMALL_ALLOC
phys_avail[i++] = 0x00000000;
phys_avail[i++] = 0x00001000; /*
phys_avail[i++] = 0x00001000;
phys_avail[i++] = 0x00002000; /*
*XXX: Gross hack to get our
* pages in the vm_page_array
. */