diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2001-05-04 22:49:01 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2001-05-04 22:49:01 +0000 |
commit | d6d564f51caacab97017094537d688abc31499d8 (patch) | |
tree | d59de91e21348bc2cf289acc8f4258892edf19fa /sys/arch/hp300/dev/grf.c | |
parent | 41df92ce9fb0927c1c6a83cc9285bffc5d22695b (diff) |
Substantial update from NetBSD, most notably gives us UVM support; millert@ ok
Diffstat (limited to 'sys/arch/hp300/dev/grf.c')
-rw-r--r-- | sys/arch/hp300/dev/grf.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/sys/arch/hp300/dev/grf.c b/sys/arch/hp300/dev/grf.c index 81559ec8aff..1d0445c18c7 100644 --- a/sys/arch/hp300/dev/grf.c +++ b/sys/arch/hp300/dev/grf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf.c,v 1.8 2001/01/31 22:39:41 jason Exp $ */ -/* $NetBSD: grf.c,v 1.25 1997/04/02 22:37:30 scottr Exp $ */ +/* $OpenBSD: grf.c,v 1.9 2001/05/04 22:48:58 aaron Exp $ */ +/* $NetBSD: grf.c,v 1.30 1998/08/20 08:33:41 kleink Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -77,6 +77,10 @@ extern struct emul emul_hpux; #include <vm/vm_page.h> #include <vm/vm_pager.h> +#if defined(UVM) +#include <uvm/uvm.h> +#endif + #include <miscfs/specfs/specdev.h> #include "ite.h" @@ -493,7 +497,6 @@ grflock(gp, block) { struct proc *p = curproc; /* XXX */ int error; - extern char devioc[]; #ifdef DEBUG if (grfdebug & GDB_LOCK) @@ -638,9 +641,15 @@ grfmap(dev, addrp, p) vn.v_type = VCHR; /* XXX */ vn.v_specinfo = &si; /* XXX */ vn.v_rdev = dev; /* XXX */ - error = vm_mmap(&p->p_vmspace->vm_map, (vm_offset_t *)addrp, - (vm_size_t)len, VM_PROT_ALL, VM_PROT_ALL, +#if defined(UVM) + error = uvm_mmap(&p->p_vmspace->vm_map, (vaddr_t *)addrp, + (vsize_t)len, VM_PROT_ALL, VM_PROT_ALL, + flags, (caddr_t)&vn, 0); +#else + error = vm_mmap(&p->p_vmspace->vm_map, (vaddr_t *)addrp, + (vsize_t)len, VM_PROT_ALL, VM_PROT_ALL, flags, (caddr_t)&vn, 0); +#endif if (error == 0) (void) (*gp->g_sw->gd_mode)(gp, GM_MAP, *addrp); return(error); @@ -654,7 +663,7 @@ grfunmap(dev, addr, p) { struct grf_softc *sc = grf_cd.cd_devs[GRFUNIT(dev)]; struct grf_data *gp = sc->sc_data; - vm_size_t size; + vsize_t size; int rv; #ifdef DEBUG @@ -665,7 +674,12 @@ grfunmap(dev, addr, p) return(EINVAL); /* XXX: how do we deal with this? */ (void) (*gp->g_sw->gd_mode)(gp, GM_UNMAP, 0); size = round_page(gp->g_display.gd_regsize + gp->g_display.gd_fbsize); - rv = vm_deallocate(&p->p_vmspace->vm_map, (vm_offset_t)addr, size); +#if defined(UVM) + rv = uvm_unmap(&p->p_vmspace->vm_map, (vaddr_t)addr, + (vaddr_t)addr + size); +#else + rv = vm_deallocate(&p->p_vmspace->vm_map, (vaddr_t)addr, size); +#endif return(rv == KERN_SUCCESS ? 0 : EINVAL); } |