MFi386: preserve dcons buffer passed by loader.

This commit is contained in:
simokawa 2004-10-28 12:16:03 +00:00
parent cc85f14100
commit 78a92eba7b

View File

@ -823,6 +823,7 @@ getmemsize(caddr_t kmdp, u_int64_t first)
char *cp;
struct bios_smap *smapbase, *smap, *smapend;
u_int32_t smapsize;
quad_t dcons_addr, dcons_size;
bzero(physmap, sizeof(physmap));
basemem = 0;
@ -967,6 +968,13 @@ getmemsize(caddr_t kmdp, u_int64_t first)
phys_avail[pa_indx] = physmap[0];
pte = CMAP1;
/*
* Get dcons buffer address
*/
if (getenv_quad("dcons.addr", &dcons_addr) == 0 ||
getenv_quad("dcons.size", &dcons_size) == 0)
dcons_addr = 0;
/*
* physmap is in bytes, so when converting to page boundaries,
* round up the start address and round down the end address.
@ -987,6 +995,14 @@ getmemsize(caddr_t kmdp, u_int64_t first)
if (pa >= 0x100000 && pa < first)
continue;
/*
* block out dcons buffer
*/
if (dcons_addr > 0
&& pa >= trunc_page(dcons_addr)
&& pa < dcons_addr + dcons_size)
continue;
page_bad = FALSE;
/*