summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-06-27 04:44:05 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-06-27 04:44:05 +0000
commit5735641be7d63cc0eda40d031cada993a637808e (patch)
tree1eccb99836fcc970b291d1a803b6761aa3e4cda6
parenta8bf55f0d5bd47f9d9603b854cca69f834ea95c3 (diff)
Zap old vm.
-rw-r--r--sys/arch/sun3/sun3/autoconf.c8
-rw-r--r--sys/arch/sun3/sun3/dvma.c21
-rw-r--r--sys/arch/sun3/sun3/genassym.cf4
-rw-r--r--sys/arch/sun3/sun3/intreg.c8
-rw-r--r--sys/arch/sun3/sun3/isr.c12
-rw-r--r--sys/arch/sun3/sun3/machdep.c64
-rw-r--r--sys/arch/sun3/sun3/mem.c10
-rw-r--r--sys/arch/sun3/sun3/pmap.c25
-rw-r--r--sys/arch/sun3/sun3/trap.c14
-rw-r--r--sys/arch/sun3/sun3/vm_machdep.c16
10 files changed, 11 insertions, 171 deletions
diff --git a/sys/arch/sun3/sun3/autoconf.c b/sys/arch/sun3/sun3/autoconf.c
index c0b6f3051b3..0a89947c437 100644
--- a/sys/arch/sun3/sun3/autoconf.c
+++ b/sys/arch/sun3/sun3/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.12 2001/06/11 01:30:13 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.13 2001/06/27 04:44:02 art Exp $ */
/* $NetBSD: autoconf.c,v 1.37 1996/11/20 18:57:22 gwr Exp $ */
/*-
@@ -63,9 +63,7 @@
#include <vm/vm_kern.h>
#include <vm/vm_map.h>
-#ifdef UVM
#include <uvm/uvm_extern.h>
-#endif
#include <machine/autoconf.h>
#include <machine/control.h>
@@ -281,11 +279,7 @@ bus_mapin(bustype, paddr, sz)
pmt |= PMAP_NC; /* non-cached */
/* Get some kernel virtual address space. */
-#ifdef 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;
diff --git a/sys/arch/sun3/sun3/dvma.c b/sys/arch/sun3/sun3/dvma.c
index b67cc92a228..7cc5d4466de 100644
--- a/sys/arch/sun3/sun3/dvma.c
+++ b/sys/arch/sun3/sun3/dvma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvma.c,v 1.10 2001/06/11 01:30:13 miod Exp $ */
+/* $OpenBSD: dvma.c,v 1.11 2001/06/27 04:44:02 art Exp $ */
/* $NetBSD: dvma.c,v 1.5 1996/11/20 18:57:29 gwr Exp $ */
/*-
@@ -53,9 +53,7 @@
#include <vm/vm_kern.h>
#include <vm/vm_map.h>
-#ifdef UVM
#include <uvm/uvm.h>
-#endif
#include <machine/autoconf.h>
#include <machine/cpu.h>
@@ -87,13 +85,8 @@ dvma_init()
* then allocate the segment pool from that. The
* remainder will be used as the DVMA page pool.
*/
-#ifdef UVM
phys_map = uvm_map_create(pmap_kernel(),
DVMA_SPACE_START, DVMA_SPACE_END, 1);
-#else
- phys_map = vm_map_create(pmap_kernel(),
- DVMA_SPACE_START, DVMA_SPACE_END, 1);
-#endif
if (phys_map == NULL)
panic("unable to create DVMA map");
@@ -102,11 +95,7 @@ dvma_init()
* The remainder of phys_map is used for DVMA scratch
* memory pages (i.e. driver control blocks, etc.)
*/
-#ifdef UVM
segmap_addr = uvm_km_valloc_wait(phys_map, dvma_segmap_size);
-#else
- segmap_addr = kmem_alloc_wait(phys_map, dvma_segmap_size);
-#endif
if (segmap_addr != DVMA_SPACE_START)
panic("dvma_init: unable to allocate DVMA segments");
@@ -132,11 +121,7 @@ dvma_malloc(bytes)
if (!bytes)
return NULL;
new_size = round_page(bytes);
-#ifdef UVM
new_mem = (caddr_t) uvm_km_alloc(phys_map, new_size);
-#else
- new_mem = (caddr_t) kmem_alloc(phys_map, new_size);
-#endif
if (!new_mem)
panic("dvma_malloc: no space in phys_map");
/* The pmap code always makes DVMA pages non-cached. */
@@ -153,11 +138,7 @@ dvma_free(addr, size)
{
vm_size_t sz = round_page(size);
-#ifdef UVM
uvm_km_free(phys_map, (vm_offset_t)addr, sz);
-#else
- kmem_free(phys_map, (vm_offset_t)addr, sz);
-#endif
}
/*
diff --git a/sys/arch/sun3/sun3/genassym.cf b/sys/arch/sun3/sun3/genassym.cf
index ca8c5d913bc..34957579202 100644
--- a/sys/arch/sun3/sun3/genassym.cf
+++ b/sys/arch/sun3/sun3/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.2 2001/05/30 20:40:03 miod Exp $
+# $OpenBSD: genassym.cf,v 1.3 2001/06/27 04:44:02 art Exp $
# $NetBSD: genassym.c,v 1.32 1996/10/23 16:39:27 gwr Exp $
#
@@ -47,9 +47,7 @@ include <sys/proc.h>
include <sys/syscall.h>
include <vm/vm.h>
-ifdef UVM
include <uvm/uvm_extern.h>
-endif
include <machine/control.h>
include <machine/cpu.h>
diff --git a/sys/arch/sun3/sun3/intreg.c b/sys/arch/sun3/sun3/intreg.c
index e44ecfa42fa..ceca7dd8b7f 100644
--- a/sys/arch/sun3/sun3/intreg.c
+++ b/sys/arch/sun3/sun3/intreg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intreg.c,v 1.7 2001/05/30 20:40:03 miod Exp $ */
+/* $OpenBSD: intreg.c,v 1.8 2001/06/27 04:44:02 art Exp $ */
/* $NetBSD: intreg.c,v 1.5 1996/11/20 18:57:32 gwr Exp $ */
/*-
@@ -57,9 +57,7 @@
#include <vm/vm.h>
-#ifdef UVM
#include <uvm/uvm_extern.h>
-#endif
#include "interreg.h"
@@ -152,11 +150,7 @@ soft1intr(arg)
splx(s);
if (sir.sir_any) {
-#ifdef UVM
uvmexp.softs++;
-#else
- cnt.v_soft++;
-#endif
if (sir.sir_which[SIR_NET]) {
s = splhigh();
n = netisr;
diff --git a/sys/arch/sun3/sun3/isr.c b/sys/arch/sun3/sun3/isr.c
index 29b4e2f5f74..5d37466af9b 100644
--- a/sys/arch/sun3/sun3/isr.c
+++ b/sys/arch/sun3/sun3/isr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isr.c,v 1.13 2001/05/30 20:40:03 miod Exp $ */
+/* $OpenBSD: isr.c,v 1.14 2001/06/27 04:44:02 art Exp $ */
/* $NetBSD: isr.c,v 1.25 1996/11/20 18:57:32 gwr Exp $ */
/*-
@@ -56,9 +56,7 @@
#include <vm/vm.h>
-#ifdef UVM
#include <uvm/uvm_extern.h>
-#endif
#include "vector.h"
@@ -107,11 +105,7 @@ isr_autovec(evec)
n = intrcnt[ipl];
intrcnt[ipl] = n+1;
-#ifdef UVM
uvmexp.intrs++;
-#else
- cnt.v_intr++;
-#endif
isr = isr_autovec_list[ipl];
if (isr == NULL) {
@@ -178,11 +172,7 @@ isr_vectored(evec)
ipl = (ipl >> 8) & 7;
intrcnt[ipl]++;
-#ifdef UVM
uvmexp.intrs++;
-#else
- cnt.v_intr++;
-#endif
if (vec < 64 || vec >= 256) {
printf("isr_vectored: vector=0x%x (invalid)\n", vec);
diff --git a/sys/arch/sun3/sun3/machdep.c b/sys/arch/sun3/sun3/machdep.c
index 77ff45b02d7..bff3ba05a4a 100644
--- a/sys/arch/sun3/sun3/machdep.c
+++ b/sys/arch/sun3/sun3/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.32 2001/05/30 20:40:04 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.33 2001/06/27 04:44:03 art Exp $ */
/* $NetBSD: machdep.c,v 1.77 1996/10/13 03:47:51 christos Exp $ */
/*
@@ -84,9 +84,7 @@
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
-#ifdef UVM
#include <uvm/uvm_extern.h>
-#endif
#include <dev/cons.h>
@@ -109,13 +107,9 @@ int fputype;
label_t *nofault;
vm_offset_t vmmap;
-#ifdef UVM
vm_map_t exec_map = NULL;
vm_map_t mb_map = NULL;
vm_map_t phys_map = NULL;
-#else
-vm_map_t buffer_map = NULL;
-#endif
/*
* safepri is a safe priority for sleep to set for a spin-wait
@@ -126,9 +120,6 @@ int safepri = PSL_LOWIPL;
/*
* Declare these as initialized data so we can patch them.
*/
-#ifndef UVM
-int nswbuf = 0;
-#endif
#ifdef NBUF
int nbuf = NBUF;
#else
@@ -248,14 +239,6 @@ allocsys(v)
/* More buffer pages than fits into the buffers is senseless. */
if (bufpages > nbuf * MAXBSIZE / PAGE_SIZE)
bufpages = nbuf * MAXBSIZE / PAGE_SIZE;
-#ifndef UVM
- if (nswbuf == 0) {
- nswbuf = (nbuf / 2) &~ 1; /* force even */
- if (nswbuf > 256)
- nswbuf = 256; /* sanity */
- }
- valloc(swbuf, struct buf, nswbuf);
-#endif
valloc(buf, struct buf, nbuf);
return v;
}
@@ -297,11 +280,7 @@ cpu_startup()
* and then give everything true virtual addresses.
*/
sz = (int)allocsys((caddr_t)0);
-#ifdef UVM
if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0)
-#else
- if ((v = (caddr_t)kmem_alloc(kernel_map, round_page(sz))) == 0)
-#endif
panic("startup: no room for tables");
if (allocsys(v) - v != sz)
panic("startup: table size inconsistency");
@@ -311,21 +290,12 @@ cpu_startup()
* in that they usually occupy more virtual memory than physical.
*/
size = MAXBSIZE * nbuf;
-#ifdef UVM
if (uvm_map(kernel_map, (vaddr_t *) &buffers, round_page(size),
NULL, UVM_UNKNOWN_OFFSET,
UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE,
UVM_ADV_NORMAL, 0)) != KERN_SUCCESS)
panic("startup: cannot allocate buffers");
minaddr = (vm_offset_t)buffers;
-#else
- buffer_map = kmem_suballoc(kernel_map, (vm_offset_t *)&buffers,
- &maxaddr, size, TRUE);
- minaddr = (vm_offset_t)buffers;
- if (vm_map_find(buffer_map, vm_object_allocate(size), (vm_offset_t)0,
- &minaddr, size, FALSE) != KERN_SUCCESS)
- panic("startup: cannot allocate buffers");
-#endif
if ((bufpages / nbuf) >= btoc(MAXBSIZE)) {
/* don't want to alloc more physical mem than needed */
bufpages = btoc(MAXBSIZE) * nbuf;
@@ -335,7 +305,6 @@ cpu_startup()
for (i = 0; i < nbuf; i++) {
vsize_t curbufsize;
vaddr_t curbuf;
-#ifdef UVM
struct vm_page *pg;
/*
@@ -358,32 +327,14 @@ cpu_startup()
curbuf += PAGE_SIZE;
curbufsize -= PAGE_SIZE;
}
-#else
- /*
- * First <residual> buffers get (base+1) physical pages
- * allocated for them. The rest get (base) physical pages.
- *
- * The rest of each buffer occupies virtual space,
- * but has no physical memory allocated for it.
- */
- curbuf = (vm_offset_t)buffers + i * MAXBSIZE;
- curbufsize = PAGE_SIZE * (i < residual ? base+1 : base);
- vm_map_pageable(buffer_map, curbuf, curbuf+curbufsize, FALSE);
- vm_map_simplify(buffer_map, curbuf);
-#endif
}
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
*/
-#ifdef UVM
exec_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
16*NCARGS, VM_MAP_PAGEABLE, FALSE, NULL);
-#else
- exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr,
- 16*NCARGS, TRUE);
-#endif
/*
* We don't use a submap for physio, and use a separate map
@@ -392,24 +343,15 @@ cpu_startup()
* device drivers clone the kernel mappings into DVMA space.
*/
-#ifdef UVM
mb_map = uvm_km_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, VM_MAP_INTRSAFE, FALSE, NULL);
-#else
- mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
- VM_MBUF_SIZE, FALSE);
-#endif
/*
* Initialize timeouts
*/
timeout_init();
-#ifdef UVM
printf("avail mem = %ld\n", ptoa(uvmexp.free));
-#else
- printf("avail mem = %ld\n", ptoa(cnt.v_free_count));
-#endif
printf("using %d buffers containing %d bytes of memory\n",
nbuf, bufpages * PAGE_SIZE);
@@ -418,11 +360,7 @@ cpu_startup()
* This page is handed to pmap_enter() therefore
* it has to be in the normal kernel VA range.
*/
-#ifdef UVM
vmmap = uvm_km_valloc_wait(kernel_map, NBPG);
-#else
- vmmap = kmem_alloc_wait(kernel_map, NBPG);
-#endif
/*
* Create the DVMA maps.
diff --git a/sys/arch/sun3/sun3/mem.c b/sys/arch/sun3/sun3/mem.c
index 58e5081e55b..38dd94e5bd8 100644
--- a/sys/arch/sun3/sun3/mem.c
+++ b/sys/arch/sun3/sun3/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.11 2001/05/30 20:40:04 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.12 2001/06/27 04:44:03 art Exp $ */
/* $NetBSD: mem.c,v 1.19 1995/08/08 21:09:01 gwr Exp $ */
/*
@@ -196,14 +196,8 @@ mmrw(dev, uio, flags)
*/
o = v & PGOFSET;
c = min(uio->uio_resid, (int)(NBPG - o));
-#ifdef UVM
if (!uvm_kernacc((caddr_t)v, c,
- uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
-#else
- if (!kernacc((caddr_t)v, c,
- uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
-#endif
- {
+ uio->uio_rw == UIO_READ ? B_READ : B_WRITE)) {
error = EFAULT;
goto unlock;
}
diff --git a/sys/arch/sun3/sun3/pmap.c b/sys/arch/sun3/sun3/pmap.c
index 6385b6b1ed3..fd4b9f7a218 100644
--- a/sys/arch/sun3/sun3/pmap.c
+++ b/sys/arch/sun3/sun3/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.25 2001/06/11 01:30:13 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.26 2001/06/27 04:44:03 art Exp $ */
/* $NetBSD: pmap.c,v 1.64 1996/11/20 18:57:35 gwr Exp $ */
/*-
@@ -82,9 +82,7 @@
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
-#ifdef UVM
#include <uvm/uvm.h>
-#endif
#include <machine/pte.h>
#include <machine/control.h>
@@ -1475,13 +1473,8 @@ pmap_bootstrap()
/* Initialization for pmap_next_page() */
avail_next = avail_start;
-#ifdef UVM
uvmexp.pagesize = PAGE_SIZE;
uvm_setpagesize();
-#else
- cnt.v_page_size = PAGE_SIZE;
- vm_set_page_size();
-#endif
sun3_protection_init();
@@ -1608,11 +1601,7 @@ pmap_init()
sz = PA_PGNUM(avail_end);
sz *= sizeof(struct pv_entry);
-#ifdef UVM
pv_head_table = (pv_entry_t) uvm_km_zalloc(kernel_map, sz);
-#else
- pv_head_table = (pv_entry_t) kmem_alloc(kernel_map, sz);
-#endif
if (!pv_head_table)
mon_panic("pmap: kmem_alloc() of pv table failed");
bzero((caddr_t) pv_head_table, sz);
@@ -1666,26 +1655,14 @@ pmap_page_upload()
*/
a = atop(avail_start);
b = atop(hole_start);
-#ifdef UVM
uvm_page_physload(a, b, a, b, VM_FREELIST_DEFAULT);
-#else
- vm_page_physload(a, b, a, b);
-#endif
c = atop(hole_start + hole_size);
d = atop(avail_end);
-#ifdef UVM
uvm_page_physload(b, d, c, d, VM_FREELIST_DEFAULT);
-#else
- vm_page_physload(b, d, c, d);
-#endif
} else {
a = atop(avail_start);
d = atop(avail_end);
-#ifdef UVM
uvm_page_physload(a, d, a, d, VM_FREELIST_DEFAULT);
-#else
- vm_page_physload(a, d, a, d);
-#endif
}
}
diff --git a/sys/arch/sun3/sun3/trap.c b/sys/arch/sun3/sun3/trap.c
index b17fd21edaf..11baefa5b25 100644
--- a/sys/arch/sun3/sun3/trap.c
+++ b/sys/arch/sun3/sun3/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.24 2001/05/30 20:40:04 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.25 2001/06/27 04:44:04 art Exp $ */
/* $NetBSD: trap.c,v 1.63-1.65ish 1997/01/16 15:41:40 gwr Exp $ */
/*
@@ -209,11 +209,7 @@ trap(type, code, v, frame)
u_quad_t sticks;
int si_type;
-#ifdef UVM
uvmexp.traps++;
-#else
- cnt.v_trap++;
-#endif
p = curproc;
ucode = 0;
sig = 0;
@@ -531,11 +527,7 @@ trap(type, code, v, frame)
}
/* OK, let the VM code handle the fault. */
-#ifdef UVM
rv = uvm_fault(map, va, 0, ftype);
-#else
- rv = vm_fault(map, va, ftype, FALSE);
-#endif
#ifdef DEBUG
if (rv && MDB_ISPID(p->p_pid)) {
printf("vm_fault(%x, %x, %x, 0) -> %x\n",
@@ -626,11 +618,7 @@ syscall(code, frame)
register_t args[8], rval[2];
u_quad_t sticks;
-#ifdef UVM
uvmexp.syscalls++;
-#else
- cnt.v_syscall++;
-#endif
if (!USERMODE(frame.f_sr))
panic("syscall");
p = curproc;
diff --git a/sys/arch/sun3/sun3/vm_machdep.c b/sys/arch/sun3/sun3/vm_machdep.c
index a1180c3dbe4..ba4b7ce1f55 100644
--- a/sys/arch/sun3/sun3/vm_machdep.c
+++ b/sys/arch/sun3/sun3/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.16 2001/06/08 08:09:30 art Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.17 2001/06/27 04:44:04 art Exp $ */
/* $NetBSD: vm_machdep.c,v 1.35 1996/04/26 18:38:06 gwr Exp $ */
/*
@@ -60,9 +60,7 @@
#include <vm/vm_kern.h>
/* #include <vm/vm_map.h> */
-#ifdef UVM
#include <uvm/uvm_extern.h>
-#endif
#include <machine/cpu.h>
#include <machine/machdep.h>
@@ -204,11 +202,7 @@ cpu_exit(p)
{
(void) splimp();
-#ifdef UVM
uvmexp.swtch++;
-#else
- cnt.v_swtch++;
-#endif
switch_exit(p);
/* NOTREACHED */
}
@@ -366,11 +360,7 @@ vmapbuf(bp, sz)
off = addr & PGOFSET;
addr = trunc_page(addr);
size = round_page(bp->b_bcount + off);
-#ifdef UVM
kva = uvm_km_valloc_wait(kernel_map, size);
-#else
- kva = kmem_alloc_wait(kernel_map, size);
-#endif
bp->b_data = (caddr_t)(kva + off);
npf = btoc(size);
@@ -425,11 +415,7 @@ vunmapbuf(bp, sz)
* pmap_remove but that will do nothing since we
* already removed the actual mappings.
*/
-#ifdef UVM
uvm_km_free_wakeup(kernel_map, pgva, size);
-#else
- kmem_free_wakeup(kernel_map, pgva, size);
-#endif
bp->b_data = bp->b_saveaddr;
bp->b_saveaddr = NULL;
}