diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2001-05-08 17:30:43 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2001-05-08 17:30:43 +0000 |
commit | ee2d0a04b9d0af0f039a3a12ac1381b4ead67eca (patch) | |
tree | d0cbb03c93dda3dfd66028e3fa56afbd2ad6cc5d /sys/arch/mac68k/dev | |
parent | 4c53597cab495f2e4dc31027f7cd3b099bab9090 (diff) |
Substantial update from NetBSD, most notably gives us UVM support; deraadt@ ok
Diffstat (limited to 'sys/arch/mac68k/dev')
-rw-r--r-- | sys/arch/mac68k/dev/grf.c | 16 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/mac68k5380.c | 8 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/nubus.c | 10 |
3 files changed, 28 insertions, 6 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); } diff --git a/sys/arch/mac68k/dev/mac68k5380.c b/sys/arch/mac68k/dev/mac68k5380.c index d6bf498bef4..858754f8121 100644 --- a/sys/arch/mac68k/dev/mac68k5380.c +++ b/sys/arch/mac68k/dev/mac68k5380.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mac68k5380.c,v 1.13 1999/01/11 05:11:34 millert Exp $ */ +/* $OpenBSD: mac68k5380.c,v 1.14 2001/05/08 17:30:40 aaron Exp $ */ /* $NetBSD: mac68k5380.c,v 1.29 1997/02/28 15:50:50 scottr Exp $ */ /* @@ -355,7 +355,7 @@ do_ncr5380_drq_intr(p) void *p; { #if USE_PDMA -extern int *nofault, mac68k_buserr_addr; +extern int *nofault, m68k_fault_addr; label_t faultbuf; register int count; volatile u_int32_t *long_drq; @@ -381,7 +381,7 @@ extern int *nofault, mac68k_buserr_addr; if (setjmp((label_t *) nofault)) { PID("drq berr"); nofault = (int *) 0; - count = ( (u_long) mac68k_buserr_addr + count = ( (u_long) m68k_fault_addr - (u_long) ncr_5380_with_drq); if ((count < 0) || (count > pending_5380_count)) { printf("pdma %s: cnt = %d (0x%x) (pending cnt %ld)\n", @@ -393,7 +393,7 @@ extern int *nofault, mac68k_buserr_addr; pending_5380_data += count; pending_5380_count -= count; - mac68k_buserr_addr = 0; + m68k_fault_addr = 0; PID("end drq early"); diff --git a/sys/arch/mac68k/dev/nubus.c b/sys/arch/mac68k/dev/nubus.c index e1cdf36c6ec..afad4676933 100644 --- a/sys/arch/mac68k/dev/nubus.c +++ b/sys/arch/mac68k/dev/nubus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nubus.c,v 1.14 1999/09/03 18:01:09 art Exp $ */ +/* $OpenBSD: nubus.c,v 1.15 2001/05/08 17:30:40 aaron Exp $ */ /* $NetBSD: nubus.c,v 1.35 1997/04/22 20:20:32 scottr Exp $ */ /* @@ -41,6 +41,10 @@ #include <vm/vm_kern.h> #include <vm/vm_map.h> +#if defined(UVM) +#include <uvm/uvm_extern.h> +#endif + #include <machine/autoconf.h> #include <machine/bus.h> #include <machine/vmparam.h> @@ -817,7 +821,11 @@ nubus_mapin(paddr, sz) sz = m68k_round_page(sz); /* Get some kernel virtual address space. */ +#if defined(UVM) + va = uvm_km_valloc_wait(kernel_map, sz); +#else va = kmem_alloc_wait(kernel_map, sz); +#endif if (va == 0) panic("bus_mapin"); retval = va + off; |