summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-06-27 04:37:23 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-06-27 04:37:23 +0000
commit065049d634608a1c190784b54d1d43c090330ddb (patch)
tree189a0226a0eb757b51b6b90eef9da5c5f75414de /sys/arch/powerpc
parent4000944f02afaf5bfd412d051d087ecbfcc41083 (diff)
kill old vm
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r--sys/arch/powerpc/mac/macintr.c7
-rw-r--r--sys/arch/powerpc/mac/openpic.c7
-rw-r--r--sys/arch/powerpc/pci/vgafb.c4
-rw-r--r--sys/arch/powerpc/powerpc/dma.c22
-rw-r--r--sys/arch/powerpc/powerpc/machdep.c67
-rw-r--r--sys/arch/powerpc/powerpc/pmap.c32
-rw-r--r--sys/arch/powerpc/powerpc/trap.c35
-rw-r--r--sys/arch/powerpc/powerpc/vm_machdep.c12
8 files changed, 10 insertions, 176 deletions
diff --git a/sys/arch/powerpc/mac/macintr.c b/sys/arch/powerpc/mac/macintr.c
index 6fb703aee06..28037d52c34 100644
--- a/sys/arch/powerpc/mac/macintr.c
+++ b/sys/arch/powerpc/mac/macintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macintr.c,v 1.11 2001/06/26 18:19:43 drahn Exp $ */
+/* $OpenBSD: macintr.c,v 1.12 2001/06/27 04:37:18 art Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -46,11 +46,9 @@
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/systm.h>
-#ifdef UVM
#include <vm/vm.h>
#include <vm/vm_kern.h>
#include <uvm/uvm.h>
-#endif
#include <machine/autoconf.h>
#include <machine/intr.h>
@@ -536,10 +534,7 @@ printf("calling handler %x\n", ih->ih_fun);
ih = ih->ih_next;
}
-#ifdef UVM
uvmexp.intrs++;
-#else
-#endif
evirq[hwirq[irq]].ev_count++;
}
int_state &= ~r_imen;
diff --git a/sys/arch/powerpc/mac/openpic.c b/sys/arch/powerpc/mac/openpic.c
index fb5523d860d..2fd11d9ef74 100644
--- a/sys/arch/powerpc/mac/openpic.c
+++ b/sys/arch/powerpc/mac/openpic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openpic.c,v 1.13 2001/06/26 18:19:43 drahn Exp $ */
+/* $OpenBSD: openpic.c,v 1.14 2001/06/27 04:37:19 art Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -46,11 +46,9 @@
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/systm.h>
-#ifdef UVM
#include <vm/vm.h>
#include <vm/vm_kern.h>
#include <uvm/uvm.h>
-#endif
#include <machine/autoconf.h>
#include <machine/intr.h>
@@ -641,10 +639,7 @@ ext_intr_openpic()
ih = ih->ih_next;
}
-#ifdef UVM
uvmexp.intrs++;
-#else
-#endif
evirq[realirq].ev_count++;
}
diff --git a/sys/arch/powerpc/pci/vgafb.c b/sys/arch/powerpc/pci/vgafb.c
index 92bd0828bd6..1a200ca1a6e 100644
--- a/sys/arch/powerpc/pci/vgafb.c
+++ b/sys/arch/powerpc/pci/vgafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafb.c,v 1.12 2001/06/25 23:30:00 drahn Exp $ */
+/* $OpenBSD: vgafb.c,v 1.13 2001/06/27 04:37:20 art Exp $ */
/* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */
/*
@@ -565,12 +565,10 @@ vgafb_putcmap(vc, cm)
if (cm->index >= 256 || cm->count > 256 ||
(cm->index + cm->count) > 256)
return EINVAL;
-#ifdef UVM
if (!uvm_useracc(cm->red, cm->count, B_READ) ||
!uvm_useracc(cm->green, cm->count, B_READ) ||
!uvm_useracc(cm->blue, cm->count, B_READ))
return EFAULT;
-#endif
copyin(cm->red, &(vc->vc_cmap_red[index]), count);
copyin(cm->green, &(vc->vc_cmap_green[index]), count);
copyin(cm->blue, &(vc->vc_cmap_blue[index]), count);
diff --git a/sys/arch/powerpc/powerpc/dma.c b/sys/arch/powerpc/powerpc/dma.c
index 1404c3ae9ed..00d491bfe3a 100644
--- a/sys/arch/powerpc/powerpc/dma.c
+++ b/sys/arch/powerpc/powerpc/dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dma.c,v 1.5 2001/06/24 23:29:33 drahn Exp $ */
+/* $OpenBSD: dma.c,v 1.6 2001/06/27 04:37:20 art Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -53,11 +53,8 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
-#ifdef UVM
#include <uvm/uvm.h>
#include <uvm/uvm_page.h>
-#else
-#endif
#include <machine/bus.h>
int _dmamem_alloc_range( bus_dma_tag_t t, bus_size_t size,
@@ -343,11 +340,7 @@ _dmamem_free(t, segs, nsegs)
}
}
-#if defined(UVM)
uvm_pglistfree(&mlist);
-#else
- vm_page_free_memory(&mlist);
-#endif
}
/*
@@ -368,11 +361,7 @@ _dmamem_map(t, segs, nsegs, size, kvap, flags)
int curseg;
size = round_page(size);
-#if defined(UVM)
va = uvm_km_valloc(kmem_map, size);
-#else
- va = kmem_alloc_pageable(kmem_map, size);
-#endif
if (va == 0)
return (ENOMEM);
@@ -410,11 +399,7 @@ _dmamem_unmap(t, kva, size)
#endif
size = round_page(size);
-#if defined(UVM)
uvm_km_free(kmem_map, (vm_offset_t)kva, size);
-#else
- kmem_free(kmem_map, (vm_offset_t)kva, size);
-#endif
}
/*
@@ -483,13 +468,8 @@ _dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs,
* Allocate pages from the VM system.
*/
TAILQ_INIT(&mlist);
-#if defined(UVM)
error = uvm_pglistalloc(size, low, high,
alignment, boundary, &mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
-#else
- error = vm_page_alloc_memory(size, low, high,
- alignment, boundary, &mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
-#endif
if (error)
return (error);
diff --git a/sys/arch/powerpc/powerpc/machdep.c b/sys/arch/powerpc/powerpc/machdep.c
index 13a4af97de0..eb2e1c4ba60 100644
--- a/sys/arch/powerpc/powerpc/machdep.c
+++ b/sys/arch/powerpc/powerpc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.70 2001/06/26 18:19:43 drahn Exp $ */
+/* $OpenBSD: machdep.c,v 1.71 2001/06/27 04:37:21 art Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -113,12 +113,9 @@ int bufpages = 0;
struct bat battable[16];
-#ifdef UVM
-/* ??? */
vm_map_t exec_map = NULL;
vm_map_t mb_map = NULL;
vm_map_t phys_map = NULL;
-#endif
int astpending;
int ppc_malloc_ok = 0;
@@ -312,14 +309,9 @@ where = 3;
syncicache((void *)EXC_RST, EXC_LAST - EXC_RST + 0x100);
-#ifdef UVM
uvmexp.pagesize = 4096;
uvm_setpagesize();
-#else
- vm_set_page_size();
-#endif
-
/*
* Initialize pmap module.
*/
@@ -496,13 +488,8 @@ 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)
panic("startup: no room for tables");
-#else
- if ((v = (caddr_t)kmem_alloc(kernel_map, round_page(sz))) == 0)
- panic("startup: no room for tables");
-#endif
if (allocsys(v) - v != sz)
panic("startup: table size inconsistency");
@@ -511,7 +498,6 @@ cpu_startup()
* in that they usually occupy more virtual memory than physical.
*/
sz = MAXBSIZE * nbuf;
-#ifdef UVM
if (uvm_map(kernel_map, (vaddr_t *) &buffers, round_page(sz),
NULL, UVM_UNKNOWN_OFFSET,
UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE,
@@ -520,13 +506,6 @@ cpu_startup()
/*
addr = (vaddr_t)buffers;
*/
-#else
- buffer_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, sz, TRUE);
- buffers = (char *)minaddr;
- if (vm_map_find(buffer_map, vm_object_allocate(sz), (vm_offset_t)0,
- &minaddr, sz, FALSE) != KERN_SUCCESS)
- panic("startup: cannot allocate buffers");
-#endif
base = bufpages / nbuf;
residual = bufpages % nbuf;
if (base >= MAXBSIZE) {
@@ -541,7 +520,6 @@ cpu_startup()
curbuf = (vm_offset_t)buffers + i * MAXBSIZE;
curbufsize = PAGE_SIZE * (i < residual ? base + 1 : base);
-#ifdef UVM
while (curbufsize) {
pg = uvm_pagealloc(NULL, 0, NULL, 0);
if (pg == NULL)
@@ -552,55 +530,31 @@ cpu_startup()
curbuf += PAGE_SIZE;
curbufsize -= PAGE_SIZE;
}
-#else
- 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,
TRUE, FALSE, NULL);
-#else
- exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, 16 * NCARGS,
- TRUE);
-#endif
/*
* Allocate a submap for physio
*/
-#ifdef UVM
phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
VM_PHYS_SIZE, TRUE, FALSE, NULL);
-#else
- phys_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, VM_PHYS_SIZE,
- TRUE);
-#endif
ppc_malloc_ok = 1;
-#ifdef UVM
mb_map = uvm_km_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE, 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 = %d\n", ptoa(uvmexp.free));
-#else
- printf("avail mem = %d\n", ptoa(cnt.v_free_count));
-#endif
printf("using %d buffers containing %d bytes of memory\n", nbuf,
bufpages * PAGE_SIZE);
@@ -668,9 +622,6 @@ allocsys(v)
if (nswbuf > 256)
nswbuf = 256;
}
-#if !defined(UVM)
- valloc(swbuf, struct buf, nswbuf);
-#endif
valloc(buf, struct buf, nbuf);
return v;
@@ -1187,11 +1138,7 @@ bus_space_unmap(t, bsh, size)
off = bsh - sva;
len = size+off;
-#ifdef UVM
uvm_km_free_wakeup(phys_map, sva, len);
-#else
- kmem_free_wakeup(phys_map, sva, len);
-#endif
#if 0
pmap_extract(pmap_kernel(), sva, &bpa);
if (extent_free(devio_ex, bpa, size, EX_NOWAIT |
@@ -1236,11 +1183,7 @@ bus_mem_add_mapping(bpa, size, cacheable, bshp)
vaddr = VM_MIN_KERNEL_ADDRESS + ppc_kvm_size;
} else {
-#ifdef UVM
vaddr = uvm_km_valloc_wait(phys_map, len);
-#else
- vaddr = kmem_alloc_wait(phys_map, len);
-#endif
}
*bshp = vaddr + off;
#ifdef DEBUG_BUS_MEM_ADD_MAPPING
@@ -1301,11 +1244,7 @@ mapiodev(pa, len)
return (void *)pa;
}
}
-#ifdef UVM
va = vaddr = uvm_km_valloc(phys_map, size);
-#else
- va = vaddr = kmem_alloc(phys_map, size);
-#endif
if (va == 0)
return NULL;
@@ -1334,11 +1273,7 @@ unmapiodev(kva, p_size)
vaddr = trunc_page((vaddr_t)kva);
-#ifdef UVM
uvm_km_free_wakeup(phys_map, vaddr, size);
-#else
- kmem_free_wakeup(phys_map, vaddr, size);
-#endif
for (; size > 0; size -= NBPG) {
#if 0
diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c
index 69d991e066f..3d009ff0c06 100644
--- a/sys/arch/powerpc/powerpc/pmap.c
+++ b/sys/arch/powerpc/powerpc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.32 2001/06/24 23:29:36 drahn Exp $ */
+/* $OpenBSD: pmap.c,v 1.33 2001/06/27 04:37:21 art Exp $ */
/* $NetBSD: pmap.c,v 1.1 1996/09/30 16:34:52 ws Exp $ */
/*
@@ -42,9 +42,7 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
-#ifdef UVM
#include <uvm/uvm.h>
-#endif
#include <machine/pcb.h>
#include <machine/powerpc.h>
@@ -69,10 +67,6 @@ static u_int nextavail;
static struct mem_region *mem, *avail;
-#ifndef UVM
- extern vm_offset_t pager_sva, pager_eva;
-#endif
-
#if 0
void
dump_avail()
@@ -171,13 +165,8 @@ pmap_vp_enter(pmap_t pm, vaddr_t va, paddr_t pa)
if (pm == pmap_kernel()) {
printf(" irk kernel allocating map?");
} else {
-#ifdef UVM
if (!(mem1 = (pmapv_t *)uvm_km_zalloc(kernel_map, NBPG)))
panic("pmap_vp_enter: uvm_km_zalloc() failed");
-#else
- if (!(mem1 = (pmapv_t *)kmem_alloc(kernel_map, NBPG)))
- panic("pmap_vp_enter: kmem_alloc() failed");
-#endif
}
pm->vps[idx] = mem1;
#ifdef DEBUG
@@ -220,11 +209,7 @@ pmap_vp_destroy(pm)
}
}
#endif
-#ifdef UVM
uvm_km_free(kernel_map, (vaddr_t)vp1, NBPG);
-#else
- kmem_free(kernel_map, (vm_offset_t)vp1, NBPG);
-#endif
pm->vps[sr] = 0;
}
}
@@ -654,14 +639,9 @@ avail_end = npgs * NBPG;
#ifdef MACHINE_NEW_NONCONTIG
for (mp = avail; mp->size; mp++) {
-#ifdef UVM
uvm_page_physload(atop(mp->start), atop(mp->start + mp->size),
atop(mp->start), atop(mp->start + mp->size),
VM_FREELIST_DEFAULT);
-#else
- vm_page_physload(atop(mp->start), atop(mp->start + mp->size),
- atop(mp->start), atop(mp->start + mp->size));
-#endif
}
#endif
@@ -730,11 +710,7 @@ pmap_init()
sz = (vm_size_t)((sizeof(struct pv_entry) + 1) * npgs);
sz = round_page(sz);
-#ifdef UVM
addr = uvm_km_zalloc(kernel_map, sz);
-#else
- addr = kmem_alloc(kernel_map, sz);
-#endif
s = splimp();
pv = pv_table = (struct pv_entry *)addr;
for (i = npgs; --i >= 0;)
@@ -1636,15 +1612,9 @@ pmap_page_protect(pa, prot)
while (pv->pv_idx != -1) {
va = pv->pv_va;
pm = pv->pv_pmap;
-#ifdef UVM
if ((va >=uvm.pager_sva) && (va < uvm.pager_eva)) {
continue;
}
-#else
- if (va >= pager_sva && va < pager_eva) {
- continue;
- }
-#endif
pmap_remove(pm, va, va + NBPG);
}
splx(s);
diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c
index 463264c3d91..b9acc4a56e0 100644
--- a/sys/arch/powerpc/powerpc/trap.c
+++ b/sys/arch/powerpc/powerpc/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.26 2001/06/25 23:30:04 drahn Exp $ */
+/* $OpenBSD: trap.c,v 1.27 2001/06/27 04:37:22 art Exp $ */
/* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */
/*
@@ -43,9 +43,7 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
-#ifdef UVM
#include <uvm/uvm_extern.h>
-#endif
#include <machine/cpu.h>
#include <machine/frame.h>
@@ -139,13 +137,8 @@ trap(frame)
ftype = VM_PROT_READ | VM_PROT_WRITE;
else
ftype = VM_PROT_READ;
-#ifdef UVM
if (uvm_fault(map, trunc_page(va), 0, ftype)
== KERN_SUCCESS)
-#else
- if (vm_fault(map, trunc_page(va), ftype, FALSE)
- == KERN_SUCCESS)
-#endif
{
return;
}
@@ -171,16 +164,9 @@ printf("kern dsi on addr %x iar %x\n", frame->dar, frame->srr0);
vftype = VM_PROT_WRITE;
} else
vftype = ftype = VM_PROT_READ;
-#ifdef UVM
if (uvm_fault(&p->p_vmspace->vm_map,
trunc_page(frame->dar), 0, ftype)
- == KERN_SUCCESS)
-#else
- if (vm_fault(&p->p_vmspace->vm_map,
- trunc_page(frame->dar), ftype, FALSE)
- == KERN_SUCCESS)
-#endif
- {
+ == KERN_SUCCESS) {
break;
}
#if 0
@@ -198,16 +184,9 @@ printf("dsi on addr %x iar %x lr %x\n", frame->dar, frame->srr0,frame->lr);
int ftype;
ftype = VM_PROT_READ | VM_PROT_EXECUTE;
-#ifdef UVM
if (uvm_fault(&p->p_vmspace->vm_map,
trunc_page(frame->srr0), 0, ftype)
- == KERN_SUCCESS)
-#else
- if (vm_fault(&p->p_vmspace->vm_map,
- trunc_page(frame->srr0), ftype, FALSE)
- == KERN_SUCCESS)
-#endif
- {
+ == KERN_SUCCESS) {
break;
}
}
@@ -229,11 +208,7 @@ printf("isi iar %x\n", frame->srr0);
int nsys, n;
register_t args[10];
-#ifdef UVM
uvmexp.syscalls++;
-#else
- cnt.v_syscall++;
-#endif
nsys = p->p_emul->e_nsysent;
callp = p->p_emul->e_sysent;
@@ -432,11 +407,7 @@ for (i = 0; i < errnum; i++) {
astpending = 0; /* we are about to do it */
-#ifdef UVM
uvmexp.softs++;
-#else
- cnt.v_soft++;
-#endif
if (p->p_flag & P_OWEUPC) {
p->p_flag &= ~P_OWEUPC;
diff --git a/sys/arch/powerpc/powerpc/vm_machdep.c b/sys/arch/powerpc/powerpc/vm_machdep.c
index 96d798dd0ff..d571340fe39 100644
--- a/sys/arch/powerpc/powerpc/vm_machdep.c
+++ b/sys/arch/powerpc/powerpc/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.17 2001/06/25 23:30:04 drahn Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.18 2001/06/27 04:37:22 art Exp $ */
/* $NetBSD: vm_machdep.c,v 1.1 1996/09/30 16:34:57 ws Exp $ */
/*
@@ -42,9 +42,7 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
-#ifdef UVM
#include <uvm/uvm_extern.h>
-#endif
#include <machine/pcb.h>
@@ -240,11 +238,7 @@ vmapbuf(bp, len)
faddr = trunc_page((vaddr_t)(bp->b_saveaddr = bp->b_data));
off = (vm_offset_t)bp->b_data - faddr;
len = round_page(off + len);
-#ifdef UVM
taddr = uvm_km_valloc_wait(phys_map, len);
-#else
- taddr = kmem_alloc_wait(phys_map, len);
-#endif
bp->b_data = (caddr_t)(taddr + off);
for (; len > 0; len -= NBPG) {
pmap_extract(vm_map_pmap(&bp->b_proc->p_vmspace->vm_map), faddr, &pa);
@@ -272,11 +266,7 @@ vunmapbuf(bp, len)
addr = trunc_page((vaddr_t)bp->b_data);
off = (vm_offset_t)bp->b_data - addr;
len = round_page(off + len);
-#ifdef UVM
uvm_km_free_wakeup(phys_map, addr, len);
-#else
- kmem_free_wakeup(phys_map, addr, len);
-#endif
bp->b_data = bp->b_saveaddr;
bp->b_saveaddr = 0;
}