summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsimokawa <simokawa@FreeBSD.org>2004-10-24 12:41:04 +0000
committersimokawa <simokawa@FreeBSD.org>2004-10-24 12:41:04 +0000
commitfeac68dce960ac497df4a185a6967f4a8b37ae7e (patch)
treefa7fc034c51307548849c0597bae89d6aae12ea1 /sys
parent5c26c7535f18d820b47a9dd84deae70c2410f3d8 (diff)
downloadFreeBSD-src-feac68dce960ac497df4a185a6967f4a8b37ae7e.zip
FreeBSD-src-feac68dce960ac497df4a185a6967f4a8b37ae7e.tar.gz
- Use quad_t for dcons buffer address and size.
- Allow read/write access to dcons buffer passed by loader(8).
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/dcons/dcons_os.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/dcons/dcons_os.c b/sys/dev/dcons/dcons_os.c
index 5a5f0aa..498bf98 100644
--- a/sys/dev/dcons/dcons_os.c
+++ b/sys/dev/dcons/dcons_os.c
@@ -489,7 +489,7 @@ static int
dcons_drv_init(int stage)
{
#ifdef __i386__
- int addr, size;
+ quad_t addr, size;
#endif
if (drv_init)
@@ -504,10 +504,17 @@ dcons_drv_init(int stage)
dg.size = DCONS_BUF_SIZE;
#ifdef __i386__
- if (getenv_int("dcons.addr", &addr) > 0 &&
- getenv_int("dcons.size", &size) > 0) {
+ if (getenv_quad("dcons.addr", &addr) > 0 &&
+ getenv_quad("dcons.size", &size) > 0) {
+ vm_paddr_t pa;
+ /*
+ * Allow read/write access to dcons buffer.
+ */
+ for (pa = trunc_page(addr); pa < addr + size; pa += PAGE_SIZE)
+ *vtopte(KERNBASE + pa) |= PG_RW;
+ invltlb();
/* XXX P to V */
- dg.buf = (struct dcons_buf *)(KERNBASE + addr);
+ dg.buf = (struct dcons_buf *)(vm_offset_t)(KERNBASE + addr);
dg.size = size;
if (dcons_load_buffer(dg.buf, dg.size, sc) < 0)
dg.buf = NULL;
OpenPOWER on IntegriCloud