From feac68dce960ac497df4a185a6967f4a8b37ae7e Mon Sep 17 00:00:00 2001 From: simokawa Date: Sun, 24 Oct 2004 12:41:04 +0000 Subject: - Use quad_t for dcons buffer address and size. - Allow read/write access to dcons buffer passed by loader(8). --- sys/dev/dcons/dcons_os.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'sys') 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; -- cgit v1.1