summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsimokawa <simokawa@FreeBSD.org>2004-10-28 12:16:03 +0000
committersimokawa <simokawa@FreeBSD.org>2004-10-28 12:16:03 +0000
commit59e7ed6ecd2c8b5f4220994a045ee1f4fcbe0e7f (patch)
treef5f495bd90f2b485a29b1cea503a287e451ce3aa /sys
parent0a0f72fa43fe6abc05b6d49800d6d5d669dd3424 (diff)
downloadFreeBSD-src-59e7ed6ecd2c8b5f4220994a045ee1f4fcbe0e7f.zip
FreeBSD-src-59e7ed6ecd2c8b5f4220994a045ee1f4fcbe0e7f.tar.gz
MFi386: preserve dcons buffer passed by loader.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/machdep.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index cd7af28..2bf532f 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -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;
@@ -968,6 +969,13 @@ next_run:
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 @@ next_run:
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;
/*
OpenPOWER on IntegriCloud