-/* $OpenBSD: locore.s,v 1.10 1997/02/05 17:30:23 downsj Exp $ */
+/* $OpenBSD: locore.s,v 1.11 1997/02/10 11:13:28 downsj Exp $ */
/* $NetBSD: locore.s,v 1.63 1997/02/02 07:55:52 thorpej Exp $ */
/*
#include <machine/asm.h>
-/*
- * copypage(fromaddr, toaddr)
- *
- * Optimized version of bcopy for a single page-aligned NBPG byte copy.
- */
-ENTRY(copypage)
- movl sp@(4),a0 | source address
- movl sp@(8),a1 | destination address
- movl #NBPG/32,d0 | number of 32 byte chunks
-#if defined(M68040)
- cmpl #MMU_68040,_mmutype | 68040?
- jne Lmlloop | no, use movl
-Lm16loop:
- .long 0xf6209000 | move16 a0@+,a1@+
- .long 0xf6209000 | move16 a0@+,a1@+
- subql #1,d0
- jne Lm16loop
- rts
-#endif
-Lmlloop:
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- subql #1,d0
- jne Lmlloop
- rts
-
/*
* non-local gotos
*/
-/* $OpenBSD: machdep.c,v 1.17 1997/02/05 17:33:00 downsj Exp $ */
-/* $NetBSD: machdep.c,v 1.77 1996/12/11 16:49:23 thorpej Exp $ */
+/* $OpenBSD: machdep.c,v 1.18 1997/02/10 11:13:30 downsj Exp $ */
+/* $NetBSD: machdep.c,v 1.80 1997/02/02 07:58:49 thorpej Exp $ */
/*
* Copyright (c) 1997 Theo de Raadt
void
initcpu()
{
-#ifdef MAPPEDCOPY
- extern u_int mappedcopysize;
+#ifdef MAPPEDCOPY
/*
* Initialize lower bound for doing copyin/copyout using
* page mapping (if not already set). We don't do this on
* VAC machines as it loses big time.
*/
- if (mappedcopysize == 0) {
- if (ectype == EC_VIRT)
- mappedcopysize = (u_int) -1;
- else
- mappedcopysize = NBPG;
- }
+ if (ectype == EC_VIRT)
+ mappedcopysize = -1; /* in case it was patched */
+ else
+ mappedcopysize = NBPG;
#endif
parityenable();
#ifdef USELEDS
-/* $OpenBSD: mem.c,v 1.2 1997/01/12 15:13:24 downsj Exp $ */
-/* $NetBSD: mem.c,v 1.13 1995/04/10 13:10:51 mycroft Exp $ */
+/* $OpenBSD: mem.c,v 1.3 1997/02/10 11:13:31 downsj Exp $ */
+/* $NetBSD: mem.c,v 1.14 1997/02/02 07:59:41 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
#include <vm/vm.h>
extern u_int lowram;
-caddr_t zeropage;
+static caddr_t devzeropage;
/*ARGSUSED*/
int
* XXX on the hp300 we already know where there
* is a global zeroed page, the null segment table.
*/
- if (zeropage == NULL) {
+ if (devzeropage == NULL) {
#if CLBYTES == NBPG
extern caddr_t Segtabzero;
- zeropage = Segtabzero;
+ devzeropage = Segtabzero;
#else
- zeropage = (caddr_t)
+ devzeropage = (caddr_t)
malloc(CLBYTES, M_TEMP, M_WAITOK);
- bzero(zeropage, CLBYTES);
+ bzero(devzeropage, CLBYTES);
#endif
}
c = min(iov->iov_len, CLBYTES);
- error = uiomove(zeropage, c, uio);
+ error = uiomove(devzeropage, c, uio);
continue;
default:
-/* $OpenBSD: pmap.c,v 1.3 1997/01/12 15:13:25 downsj Exp $ */
-/* $NetBSD: pmap.c,v 1.27 1996/10/13 03:14:32 christos Exp $ */
+/* $OpenBSD: pmap.c,v 1.4 1997/02/10 11:13:32 downsj Exp $ */
+/* $NetBSD: pmap.c,v 1.28 1997/02/02 08:01:32 thorpej Exp $ */
/*
* Copyright (c) 1991, 1993
#endif
kva = (vm_offset_t) CADDR1;
pmap_enter(pmap_kernel(), kva, phys, VM_PROT_READ|VM_PROT_WRITE, TRUE);
- bzero((caddr_t)kva, NBPG);
+ zeropage((caddr_t)kva);
pmap_remove_mapping(pmap_kernel(), kva, PT_ENTRY_NULL,
PRM_TFLUSH|PRM_CFLUSH);
}
pmap_enter(pmap_kernel(), dkva, dst, VM_PROT_READ|VM_PROT_WRITE, TRUE);
copypage((caddr_t)skva, (caddr_t)dkva);
/* CADDR1 and CADDR2 are virtually contiguous */
- pmap_remove(pmap_kernel(), skva, skva+2*NBPG);
+ pmap_remove(pmap_kernel(), skva, skva + (2 * NBPG));
}
/*
-/* $OpenBSD: vm_machdep.c,v 1.6 1997/01/12 15:13:29 downsj Exp $ */
-/* $NetBSD: vm_machdep.c,v 1.30 1996/05/09 21:26:08 scottr Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.7 1997/02/10 11:13:34 downsj Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.31 1997/02/02 08:03:06 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
bp->b_data = bp->b_saveaddr;
bp->b_saveaddr = NULL;
}
-
-#ifdef MAPPEDCOPY
-u_int mappedcopysize = 4096;
-
-mappedcopyin(fromp, top, count)
- register char *fromp, *top;
- register int count;
-{
- register vm_offset_t kva, upa;
- register int off, len;
- int alignable;
- pmap_t upmap;
- extern caddr_t CADDR1;
-
- kva = (vm_offset_t) CADDR1;
- off = (vm_offset_t)fromp & PAGE_MASK;
- alignable = (off == ((vm_offset_t)top & PAGE_MASK));
- upmap = vm_map_pmap(&curproc->p_vmspace->vm_map);
- while (count > 0) {
- /*
- * First access of a page, use fubyte to make sure
- * page is faulted in and read access allowed.
- */
- if (fubyte(fromp) == -1)
- return (EFAULT);
- /*
- * Map in the page and bcopy data in from it
- */
- upa = pmap_extract(upmap, trunc_page(fromp));
- if (upa == 0)
- panic("mappedcopyin");
- len = min(count, PAGE_SIZE-off);
- pmap_enter(pmap_kernel(), kva, upa, VM_PROT_READ, TRUE);
- if (len == PAGE_SIZE && alignable && off == 0)
- copypage(kva, top);
- else
- bcopy((caddr_t)(kva+off), top, len);
- fromp += len;
- top += len;
- count -= len;
- off = 0;
- }
- pmap_remove(pmap_kernel(), kva, kva+PAGE_SIZE);
- return (0);
-}
-
-mappedcopyout(fromp, top, count)
- register char *fromp, *top;
- register int count;
-{
- register vm_offset_t kva, upa;
- register int off, len;
- int alignable;
- pmap_t upmap;
- extern caddr_t CADDR2;
-
- kva = (vm_offset_t) CADDR2;
- off = (vm_offset_t)top & PAGE_MASK;
- alignable = (off == ((vm_offset_t)fromp & PAGE_MASK));
- upmap = vm_map_pmap(&curproc->p_vmspace->vm_map);
- while (count > 0) {
- /*
- * First access of a page, use subyte to make sure
- * page is faulted in and write access allowed.
- */
- if (subyte(top, *fromp) == -1)
- return (EFAULT);
- /*
- * Map in the page and bcopy data out to it
- */
- upa = pmap_extract(upmap, trunc_page(top));
- if (upa == 0)
- panic("mappedcopyout");
- len = min(count, PAGE_SIZE-off);
- pmap_enter(pmap_kernel(), kva, upa,
- VM_PROT_READ|VM_PROT_WRITE, TRUE);
- if (len == PAGE_SIZE && alignable && off == 0)
- copypage(fromp, kva);
- else
- bcopy(fromp, (caddr_t)(kva+off), len);
- fromp += len;
- top += len;
- count -= len;
- off = 0;
- }
- pmap_remove(pmap_kernel(), kva, kva+PAGE_SIZE);
- return (0);
-}
-#endif