diff options
Diffstat (limited to 'sys/arch/mac68k/dev/grf.c')
-rw-r--r-- | sys/arch/mac68k/dev/grf.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/arch/mac68k/dev/grf.c b/sys/arch/mac68k/dev/grf.c index 8ed4a43d03e..cfc63247957 100644 --- a/sys/arch/mac68k/dev/grf.c +++ b/sys/arch/mac68k/dev/grf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf.c,v 1.9 1999/04/24 06:39:40 downsj Exp $ */ +/* $OpenBSD: grf.c,v 1.10 2001/05/08 17:30:39 aaron Exp $ */ /* $NetBSD: grf.c,v 1.41 1997/02/24 06:20:04 scottr Exp $ */ /* @@ -71,6 +71,10 @@ #include <vm/vm_page.h> #include <vm/vm_pager.h> +#if defined(UVM) +#include <uvm/uvm.h> +#endif + #include "nubus.h" #include "itevar.h" #include "grfvar.h" @@ -370,8 +374,13 @@ grfmap(dev, addrp, p) vn.v_specinfo = &si; /* XXX */ vn.v_rdev = dev; /* XXX */ +#if defined(UVM) + error = uvm_mmap(&p->p_vmspace->vm_map, (vm_offset_t *)addrp, + (vm_size_t)len, VM_PROT_ALL, VM_PROT_ALL, flags, (caddr_t)&vn, 0); +#else error = vm_mmap(&p->p_vmspace->vm_map, (vm_offset_t *) addrp, (vm_size_t) len, VM_PROT_ALL, VM_PROT_ALL, flags, (caddr_t) &vn, 0); +#endif /* Offset into page: */ *addrp += (unsigned long) gp->sc_grfmode->fboff & 0xfff; @@ -406,7 +415,12 @@ grfunmap(dev, addr, p) size = round_page(gp->sc_grfmode->fbsize); +#if defined(UVM) + rv = uvm_unmap(&p->p_vmspace->vm_map, (vm_offset_t)addr, + (vm_offset_t)addr + size); +#else rv = vm_deallocate(&p->p_vmspace->vm_map, (vm_offset_t) addr, size); +#endif return (rv == KERN_SUCCESS ? 0 : EINVAL); } |