From d9ebf06192583d13a8f9b61c12451be1e98c3984 Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 23 Sep 2012 02:01:59 +0000 Subject: Update different versions of physmap_init to be identical in preparation for merging them. --- sys/arm/lpc/lpc_machdep.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'sys/arm/lpc') diff --git a/sys/arm/lpc/lpc_machdep.c b/sys/arm/lpc/lpc_machdep.c index 6efc3cf..b286f6d 100644 --- a/sys/arm/lpc/lpc_machdep.c +++ b/sys/arm/lpc/lpc_machdep.c @@ -282,9 +282,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; -- cgit v1.1