diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-11-29 13:22:08 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-11-29 13:22:08 +0000 |
commit | fe22668cfd232ad571ce27d1d7a652dfe1af9ce6 (patch) | |
tree | 04a886731b15d5c48cdac240fd77adc9f5ba632b | |
parent | 59b06a7c18f154f103e31ffd019dcee11c631706 (diff) |
Remove MAPPEDCOPY. It does not work and I am not convinced it is worth
fixing.
-rw-r--r-- | sys/arch/m68k/conf/files.m68k | 3 | ||||
-rw-r--r-- | sys/arch/m68k/include/cpu.h | 7 | ||||
-rw-r--r-- | sys/arch/m68k/m68k/copy.s | 10 | ||||
-rw-r--r-- | sys/arch/m68k/m68k/mappedcopy.c | 178 |
4 files changed, 3 insertions, 195 deletions
diff --git a/sys/arch/m68k/conf/files.m68k b/sys/arch/m68k/conf/files.m68k index e5dbb46963c..47d397ff6e0 100644 --- a/sys/arch/m68k/conf/files.m68k +++ b/sys/arch/m68k/conf/files.m68k @@ -1,4 +1,4 @@ -# $OpenBSD: files.m68k,v 1.15 2006/01/04 22:32:43 miod Exp $ +# $OpenBSD: files.m68k,v 1.16 2006/11/29 13:22:05 miod Exp $ # $NetBSD: files.m68k,v 1.18 1997/06/06 23:15:28 veego Exp $ # file arch/m68k/m68k/bcopy.s @@ -12,7 +12,6 @@ file arch/m68k/m68k/in_cksum.c inet file netinet/in4_cksum.c inet file arch/m68k/m68k/kgdb_m68k.c kgdb file arch/m68k/m68k/m68k_machdep.c -file arch/m68k/m68k/mappedcopy.c mappedcopy file arch/m68k/m68k/oc_cksum.s inet file arch/m68k/m68k/process_machdep.c file arch/m68k/m68k/regdump.c diff --git a/sys/arch/m68k/include/cpu.h b/sys/arch/m68k/include/cpu.h index 08494397e2f..47040a8ce39 100644 --- a/sys/arch/m68k/include/cpu.h +++ b/sys/arch/m68k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.13 2006/06/11 20:48:13 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.14 2006/11/29 13:22:07 miod Exp $ */ /* $NetBSD: cpu.h,v 1.3 1997/02/02 06:56:57 thorpej Exp $ */ /* @@ -199,11 +199,6 @@ struct trapframe; void copypage(void *fromaddr, void *toaddr); void zeropage(void *addr); -#ifdef MAPPEDCOPY -int mappedcopyin(void *fromp, void *top, size_t count); -int mappedcopyout(void *fromp, void *top, size_t count); -extern u_int mappedcopysize; -#endif /* MAPPEDCOPY */ /* locore.s */ void TBIS(vaddr_t); diff --git a/sys/arch/m68k/m68k/copy.s b/sys/arch/m68k/m68k/copy.s index 8c15e526cc7..70a49a4870e 100644 --- a/sys/arch/m68k/m68k/copy.s +++ b/sys/arch/m68k/m68k/copy.s @@ -1,4 +1,4 @@ -/* $OpenBSD: copy.s,v 1.17 2006/01/05 21:19:14 martin Exp $ */ +/* $OpenBSD: copy.s,v 1.18 2006/11/29 13:22:07 miod Exp $ */ /* $NetBSD: copy.s,v 1.30 1998/03/04 06:39:14 thorpej Exp $ */ /*- @@ -84,10 +84,6 @@ ENTRY(copyin) CHECK_SFC movl sp@(12),d0 | check count beq Lciret | == 0, don't do anything -#ifdef MAPPEDCOPY - cmpl _C_LABEL(mappedcopysize),d0 | size >= mappedcopysize - bcc _C_LABEL(mappedcopyin) | yes, go do it the new way -#endif movl d2,sp@- | save scratch register movl _C_LABEL(curpcb),a0 | set fault handler movl #Lcifault,a0@(PCB_ONFAULT) @@ -150,10 +146,6 @@ ENTRY(copyout) CHECK_DFC movl sp@(12),d0 | check count beq Lcoret | == 0, don't do anything -#ifdef MAPPEDCOPY - cmpl _C_LABEL(mappedcopysize),d0 | size >= mappedcopysize - bcc _C_LABEL(mappedcopyout) | yes, go do it the new way -#endif movl d2,sp@- | save scratch register movl _C_LABEL(curpcb),a0 | set fault handler movl #Lcofault,a0@(PCB_ONFAULT) diff --git a/sys/arch/m68k/m68k/mappedcopy.c b/sys/arch/m68k/m68k/mappedcopy.c deleted file mode 100644 index 6fa9a966a02..00000000000 --- a/sys/arch/m68k/m68k/mappedcopy.c +++ /dev/null @@ -1,178 +0,0 @@ -/* $OpenBSD: mappedcopy.c,v 1.11 2003/06/02 23:27:48 millert Exp $ */ -/* $NetBSD: mappedcopy.c,v 1.1 1997/02/02 06:54:10 thorpej Exp $ */ - -/* - * XXX This doesn't work yet. Soon. --thorpej@netbsd.org - */ - -/* - * Copyright (c) 1988 University of Utah. - * Copyright (c) 1982, 1986, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * the Systems Programming Group of the University of Utah Computer - * Science Department. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: Utah $Hdr: vm_machdep.c 1.21 91/04/06$ - * - * @(#)vm_machdep.c 8.6 (Berkeley) 1/12/94 - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/proc.h> - -#include <uvm/uvm_extern.h> - -#include <machine/cpu.h> - -#ifdef DEBUG -#define MDB_COPYIN 0x01 -#define MDB_COPYOUT 0x02 -int mappedcopydebug = 0; - -int mappedcopyincount; -int mappedcopyoutcount; -#endif - -/* - * This turns off mappedcopy by default. Ports initialize the - * threshold in initcpu(). - */ -u_int mappedcopysize = -1; - -/* - * N.B. Both of these routines assume PAGE_SIZE == NBPG. - */ - -int -mappedcopyin(fromp, top, count) - register void *fromp, *top; - register size_t count; -{ - register vaddr_t kva; - register paddr_t upa; - register size_t len; - int off, alignable, tmp; - pmap_t upmap; - extern caddr_t CADDR1; - -#ifdef DEBUG - if (mappedcopydebug & MDB_COPYIN) - printf("mappedcopyin(%p, %p, %lu), pid %d\n", - fromp, top, (u_long)count, curproc->p_pid); - mappedcopyincount++; -#endif - - kva = (vaddr_t)CADDR1; - off = (int)((u_long)fromp & PAGE_MASK); - alignable = (off == ((u_long)top & PAGE_MASK)); - upmap = vm_map_pmap(&curproc->p_vmspace->vm_map); - while (count > 0) { - /* - * First access of a page, use copyin to make sure - * page is faulted in and read access allowed. - */ - if (copyin(fromp, &tmp, sizeof(u_char)) != 0) - return (EFAULT); - /* - * Map in the page and bcopy data in from it - */ - if (pmap_extract(upmap, trunc_page((vaddr_t)fromp), &upa) == FALSE) - panic("mappedcopyin: null page frame"); - len = min(count, (PAGE_SIZE - off)); - pmap_enter(pmap_kernel(), kva, upa, VM_PROT_READ, - VM_PROT_READ|PMAP_WIRED); - pmap_update(pmap_kernel()); - if (len == PAGE_SIZE && alignable && off == 0) - copypage((caddr_t)kva, top); - else - bcopy((void *)(kva + off), top, len); - fromp += len; - top += len; - count -= len; - off = 0; - } - pmap_remove(pmap_kernel(), kva, kva + PAGE_SIZE); - pmap_update(pmap_kernel()); - return (0); -} - -int -mappedcopyout(fromp, top, count) - register void *fromp, *top; - register size_t count; -{ - register vaddr_t kva; - register paddr_t upa; - register size_t len; - int off, alignable; - pmap_t upmap; - extern caddr_t CADDR2; - -#ifdef DEBUG - if (mappedcopydebug & MDB_COPYOUT) - printf("mappedcopyout(%p, %p, %lu), pid %d\n", - fromp, top, (u_long)count, curproc->p_pid); - mappedcopyoutcount++; -#endif - - kva = (vaddr_t) CADDR2; - off = (int)((u_long)top & PAGE_MASK); - alignable = (off == ((u_long)fromp & PAGE_MASK)); - upmap = vm_map_pmap(&curproc->p_vmspace->vm_map); - while (count > 0) { - /* - * First access of a page, use copyout to make sure - * page is faulted in and write access allowed. - */ - if (copyout(fromp, top, sizeof(char)) != 0) - return (EFAULT); - /* - * Map in the page and bcopy data out to it - */ - if (pmap_extract(upmap, trunc_page((vaddr_t)top), &upa) == FALSE) - panic("mappedcopyout: null page frame"); - len = min(count, (PAGE_SIZE - off)); - pmap_enter(pmap_kernel(), kva, upa, - VM_PROT_READ|VM_PROT_WRITE, - VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED); - pmap_update(pmap_kernel()); - if (len == PAGE_SIZE && alignable && off == 0) - copypage(fromp, (caddr_t)kva); - else - bcopy(fromp, (void *)(kva + off), len); - fromp += len; - top += len; - count -= len; - off = 0; - } - pmap_remove(pmap_kernel(), kva, kva + PAGE_SIZE); - pmap_update(pmap_kernel()); - return (0); -} |