summaryrefslogtreecommitdiff
path: root/sys/arch/mac68k
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/mac68k')
-rw-r--r--sys/arch/mac68k/dev/grf.c13
-rw-r--r--sys/arch/mac68k/dev/nubus.c8
-rw-r--r--sys/arch/mac68k/mac68k/bus_space.c12
-rw-r--r--sys/arch/mac68k/mac68k/genassym.cf8
-rw-r--r--sys/arch/mac68k/mac68k/locore.s38
-rw-r--r--sys/arch/mac68k/mac68k/machdep.c73
-rw-r--r--sys/arch/mac68k/mac68k/mem.c10
-rw-r--r--sys/arch/mac68k/mac68k/pmap.c158
-rw-r--r--sys/arch/mac68k/mac68k/trap.c46
-rw-r--r--sys/arch/mac68k/mac68k/vm_machdep.c16
10 files changed, 10 insertions, 372 deletions
diff --git a/sys/arch/mac68k/dev/grf.c b/sys/arch/mac68k/dev/grf.c
index e6972e51139..48c4bbd818d 100644
--- a/sys/arch/mac68k/dev/grf.c
+++ b/sys/arch/mac68k/dev/grf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grf.c,v 1.13 2001/05/17 18:48:35 aaron Exp $ */
+/* $OpenBSD: grf.c,v 1.14 2001/06/27 04:22:37 art Exp $ */
/* $NetBSD: grf.c,v 1.41 1997/02/24 06:20:04 scottr Exp $ */
/*
@@ -72,9 +72,7 @@
#include <vm/vm_page.h>
#include <vm/vm_pager.h>
-#if defined(UVM)
#include <uvm/uvm.h>
-#endif
#include "nubus.h"
#include "itevar.h"
@@ -375,14 +373,9 @@ 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,
p->p_rlimit[RLIMIT_MEMLOCK].rlim_cur);
-#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;
@@ -417,12 +410,8 @@ 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/nubus.c b/sys/arch/mac68k/dev/nubus.c
index f1a931ac2f3..9130a53649a 100644
--- a/sys/arch/mac68k/dev/nubus.c
+++ b/sys/arch/mac68k/dev/nubus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nubus.c,v 1.16 2001/06/08 08:09:00 art Exp $ */
+/* $OpenBSD: nubus.c,v 1.17 2001/06/27 04:22:37 art Exp $ */
/* $NetBSD: nubus.c,v 1.35 1997/04/22 20:20:32 scottr Exp $ */
/*
@@ -41,9 +41,7 @@
#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>
@@ -821,11 +819,7 @@ 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;
diff --git a/sys/arch/mac68k/mac68k/bus_space.c b/sys/arch/mac68k/mac68k/bus_space.c
index c4b4d168134..855d383bee8 100644
--- a/sys/arch/mac68k/mac68k/bus_space.c
+++ b/sys/arch/mac68k/mac68k/bus_space.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_space.c,v 1.7 2001/06/09 20:34:36 beck Exp $ */
+/* $OpenBSD: bus_space.c,v 1.8 2001/06/27 04:22:37 art Exp $ */
/* $NetBSD: bus_space.c,v 1.5 1999/03/26 23:41:30 mycroft Exp $ */
/*-
@@ -52,9 +52,7 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
-#if defined(UVM)
#include <uvm/uvm_extern.h>
-#endif
int bus_mem_add_mapping __P((bus_addr_t, bus_size_t,
int, bus_space_handle_t *));
@@ -171,11 +169,7 @@ bus_mem_add_mapping(bpa, size, flags, bshp)
panic("bus_mem_add_mapping: overflow");
#endif
-#if defined(UVM)
va = uvm_km_valloc(kernel_map, endpa - pa);
-#else
- va = kmem_alloc_pageable(kernel_map, endpa - pa);
-#endif
if (va == 0)
return (ENOMEM);
@@ -218,11 +212,7 @@ bus_space_unmap(t, bsh, size)
/*
* Free the kernel virtual mapping.
*/
-#if defined(UVM)
uvm_km_free(kernel_map, va, endva - va);
-#else
- kmem_free(kernel_map, va, endva - va);
-#endif
if (extent_free(iomem_ex, bpa, size,
EX_NOWAIT | (iomem_malloc_safe ? EX_MALLOCOK : 0))) {
diff --git a/sys/arch/mac68k/mac68k/genassym.cf b/sys/arch/mac68k/mac68k/genassym.cf
index e72d3dbe45b..bb0b0b15b20 100644
--- a/sys/arch/mac68k/mac68k/genassym.cf
+++ b/sys/arch/mac68k/mac68k/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.3 2001/05/08 17:30:40 aaron Exp $
+# $OpenBSD: genassym.cf,v 1.4 2001/06/27 04:22:37 art Exp $
# $NetBSD: genassym.cf,v 1.7 1998/01/06 08:46:16 thorpej Exp $
#
@@ -48,9 +48,7 @@ include <sys/user.h>
include <vm/vm.h>
-ifdef UVM
include <uvm/uvm_extern.h>
-endif
include <machine/cpu.h>
include <machine/trap.h>
@@ -74,11 +72,7 @@ define SSLEEP SSLEEP
define SRUN SRUN
# interrupt/fault metering
-ifdef UVM
define UVMEXP_INTRS offsetof(struct uvmexp, intrs)
-else
-define V_INTR offsetof(struct vmmeter, v_intr)
-endif
define MD_REGS offsetof(struct mdproc, md_regs)
diff --git a/sys/arch/mac68k/mac68k/locore.s b/sys/arch/mac68k/mac68k/locore.s
index b98a37945e1..aada1814624 100644
--- a/sys/arch/mac68k/mac68k/locore.s
+++ b/sys/arch/mac68k/mac68k/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.26 2001/06/08 03:27:36 aaron Exp $ */
+/* $OpenBSD: locore.s,v 1.27 2001/06/27 04:22:37 art Exp $ */
/* $NetBSD: locore.s,v 1.103 1998/07/09 06:02:50 scottr Exp $ */
/*
@@ -296,11 +296,7 @@ Lloaddone:
*/
/* select the software page size now */
lea _ASM_LABEL(tmpstk),sp | temporary stack
-#if defined(UVM)
jbsr _C_LABEL(uvm_setpagesize) | select software page size
-#else
- jbsr _C_LABEL(vm_set_page_size) | select software page size
-#endif
/* set kernel stack, user SP, proc0, and initial pcb */
movl _C_LABEL(proc0paddr),a1 | get proc0 pcb addr
@@ -819,11 +815,7 @@ Lbrkpt3:
ENTRY_NOPROFILE(spurintr)
addql #1,_C_LABEL(intrcnt)+0
-#if defined(UVM)
addql #1,_C_LABEL(uvmexp)+UVMEXP_INTRS
-#else
- addql #1,_C_LABEL(cnt)+V_INTR
-#endif
jra _ASM_LABEL(rei)
ENTRY_NOPROFILE(lev1intr)
@@ -835,11 +827,7 @@ ENTRY_NOPROFILE(lev1intr)
addql #4,sp
moveml sp@+,#0xFFFF
addql #4,sp
-#if defined(UVM)
addql #1,_C_LABEL(uvmexp)+UVMEXP_INTRS
-#else
- addql #1,_C_LABEL(cnt)+V_INTR
-#endif
jra _ASM_LABEL(rei)
ENTRY_NOPROFILE(lev2intr)
@@ -852,11 +840,7 @@ ENTRY_NOPROFILE(lev2intr)
addql #4,sp
moveml sp@+,#0xFFFF
addql #4,sp
-#if defined(UVM)
addql #1,_C_LABEL(uvmexp)+UVMEXP_INTRS
-#else
- addql #1,_C_LABEL(cnt)+V_INTR
-#endif
jra _ASM_LABEL(rei)
ENTRY_NOPROFILE(lev3intr)
@@ -869,11 +853,7 @@ ENTRY_NOPROFILE(lev3intr)
addql #4,sp
moveml sp@+, #0xFFFF
addql #4,sp
-#if defined(UVM)
addql #1,_C_LABEL(uvmexp)+UVMEXP_INTRS
-#else
- addql #1,_C_LABEL(cnt)+V_INTR
-#endif
jra _ASM_LABEL(rei)
ENTRY_NOPROFILE(lev4intr)
@@ -892,11 +872,7 @@ ENTRY_NOPROFILE(lev4intr)
normal_rei:
moveml sp@+, #0xFFFF
addql #4,sp
-#if defined(UVM)
addql #1,_C_LABEL(uvmexp)+UVMEXP_INTRS
-#else
- addql #1,_C_LABEL(cnt)+V_INTR
-#endif
jra _ASM_LABEL(rei)
ENTRY_NOPROFILE(lev5intr)
@@ -909,11 +885,7 @@ ENTRY_NOPROFILE(lev5intr)
addql #4,sp
moveml sp@+, #0xFFFF
addql #4,sp
-#if defined(UVM)
addql #1,_C_LABEL(uvmexp)+UVMEXP_INTRS
-#else
- addql #1,_C_LABEL(cnt)+V_INTR
-#endif
jra _ASM_LABEL(rei)
ENTRY_NOPROFILE(lev6intr)
@@ -926,11 +898,7 @@ ENTRY_NOPROFILE(lev6intr)
addql #4,sp
moveml sp@+, #0xFFFF
addql #4,sp
-#if defined(UVM)
addql #1,_C_LABEL(uvmexp)+UVMEXP_INTRS
-#else
- addql #1,_C_LABEL(cnt)+V_INTR
-#endif
jra _ASM_LABEL(rei)
ENTRY_NOPROFILE(lev7intr)
@@ -964,11 +932,7 @@ ENTRY_NOPROFILE(rtclock_intr)
lea sp@(12),sp | pop params
jbsr _C_LABEL(mrg_VBLQueue) | give programs in the VBLqueue a chance
addql #1,_C_LABEL(intrcnt)+20
-#if defined(UVM)
addql #1,_C_LABEL(uvmexp)+UVMEXP_INTRS
-#else
- addql #1,_C_LABEL(cnt)+V_INTR
-#endif
movw d2,sr | restore SPL
movl sp@+,d2 | restore d2
movl #1,d0 | clock taken care of
diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c
index 051fd5a9dac..6a8322ccadd 100644
--- a/sys/arch/mac68k/mac68k/machdep.c
+++ b/sys/arch/mac68k/mac68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.71 2001/05/17 18:41:48 provos Exp $ */
+/* $OpenBSD: machdep.c,v 1.72 2001/06/27 04:22:37 art Exp $ */
/* $NetBSD: machdep.c,v 1.207 1998/07/08 04:39:34 thorpej Exp $ */
/*
@@ -137,9 +137,7 @@ void netintr __P((void));
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
-#if defined(UVM)
#include <uvm/uvm_extern.h>
-#endif
#include <sys/sysctl.h>
@@ -190,13 +188,9 @@ u_int32_t mac68k_vidlen; /* mem length */
int (*mac68k_bell_callback) __P((void *, int, int, int));
caddr_t mac68k_bell_cookie;
-#if defined(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;
-#endif
/*
* Declare these as initialized data so we can patch them.
@@ -286,7 +280,6 @@ mac68k_init()
* since it's equal to high[numranges-1].
*/
for (i = 0; i < numranges; i++) {
-#if defined(UVM)
if (low[i] <= avail_start && avail_start < high[i])
uvm_page_physload(atop(avail_start), atop(high[i]),
atop(avail_start), atop(high[i]),
@@ -295,14 +288,6 @@ mac68k_init()
uvm_page_physload(atop(low[i]), atop(high[i]),
atop(low[i]), atop(high[i]),
VM_FREELIST_DEFAULT);
-#else
- if (low[i] <= avail_start && avail_start < high[i])
- vm_page_physload(atop(avail_start), atop(high[i]),
- atop(avail_start), atop(high[i]));
- else
- vm_page_physload(atop(low[i]), atop(high[i]),
- atop(low[i]), atop(high[i]));
-#endif /* UVM */
}
/* Initialize the VIAs */
@@ -460,9 +445,6 @@ again:
if (nswbuf > 256)
nswbuf = 256; /* sanity */
}
-#if !defined(UVM)
- valloc(swbuf, struct buf, nswbuf);
-#endif
valloc(buf, struct buf, nbuf);
/*
@@ -470,11 +452,7 @@ again:
*/
if (firstaddr == 0) {
size = (vm_size_t)(v - firstaddr);
-#if defined(UVM)
firstaddr = (caddr_t)uvm_km_alloc(kernel_map, round_page(size));
-#else
- firstaddr = (caddr_t)kmem_alloc(kernel_map, round_page(size));
-#endif /* UVM */
if (firstaddr == 0)
panic("startup: no room for tables");
goto again;
@@ -490,28 +468,14 @@ again:
* in that they usually occupy more virtual memory than physical.
*/
size = MAXBSIZE * nbuf;
-#if defined(UVM)
if (uvm_map(kernel_map, (vm_offset_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 VM for 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");
- if ((bufpages / nbuf) >= btoc(MAXBSIZE)) {
- /* Don't want to alloc more physical mem than needed. */
- bufpages = btoc(MAXBSIZE) * nbuf;
- }
-#endif /* UVM */
base = bufpages / nbuf;
residual = bufpages % nbuf;
for (i = 0; i < nbuf; i++) {
-#if defined(UVM)
vm_size_t curbufsize;
vm_offset_t curbuf;
struct vm_page *pg;
@@ -536,64 +500,29 @@ again:
curbuf += PAGE_SIZE;
curbufsize -= PAGE_SIZE;
}
-#else /* ! UVM */
- vm_size_t curbufsize;
- vm_offset_t curbuf;
-
- /*
- * 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 /* UVM */
}
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
*/
-#if defined(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
*/
-#if defined(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
-#if defined(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();
-#if defined(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);
diff --git a/sys/arch/mac68k/mac68k/mem.c b/sys/arch/mac68k/mac68k/mem.c
index bffcb61257d..d7e8d8d9d27 100644
--- a/sys/arch/mac68k/mac68k/mem.c
+++ b/sys/arch/mac68k/mac68k/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.12 2001/06/08 03:27:36 aaron Exp $ */
+/* $OpenBSD: mem.c,v 1.13 2001/06/27 04:22:37 art Exp $ */
/* $NetBSD: mem.c,v 1.22 1999/03/27 00:30:07 mycroft Exp $ */
/*
@@ -57,9 +57,7 @@
#include <vm/vm.h>
-#if defined(UVM)
#include <uvm/uvm_extern.h>
-#endif
extern u_long maxaddr;
@@ -162,15 +160,9 @@ mmrw(dev, uio, flags)
case 1:
v = uio->uio_offset;
c = min(iov->iov_len, MAXPHYS);
-#if defined(UVM)
if (!uvm_kernacc((caddr_t)v, c,
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
-#else
- if (!kernacc((caddr_t)v, c,
- uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
- return (EFAULT);
-#endif
error = uiomove((caddr_t)v, c, uio);
continue;
diff --git a/sys/arch/mac68k/mac68k/pmap.c b/sys/arch/mac68k/mac68k/pmap.c
index 15bf41730d1..a97f05d39d0 100644
--- a/sys/arch/mac68k/mac68k/pmap.c
+++ b/sys/arch/mac68k/mac68k/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.24 2001/06/27 04:02:05 beck Exp $ */
+/* $OpenBSD: pmap.c,v 1.25 2001/06/27 04:22:38 art Exp $ */
/* $NetBSD: pmap.c,v 1.55 1999/04/22 04:24:53 chs Exp $ */
/*
@@ -107,9 +107,7 @@
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
-#if defined(UVM)
#include <uvm/uvm.h>
-#endif
#include <machine/cpu.h>
@@ -216,9 +214,7 @@ vsize_t Sysptsize = VM_KERNEL_PT_PAGES;
struct pmap kernel_pmap_store;
vm_map_t st_map, pt_map;
-#if defined(UVM)
struct vm_map st_map_store, pt_map_store;
-#endif
paddr_t avail_start; /* PA of first available physical page */
paddr_t avail_end; /* PA of last available physical page */
@@ -343,7 +339,6 @@ pmap_init()
* Now that kernel map has been allocated, we can mark as
* unavailable regions which we have mapped in pmap_bootstrap().
*/
-#if defined(UVM)
addr = (vaddr_t)IOBase;
if (uvm_map(kernel_map, &addr,
m68k_ptob(IIOMAPSIZE + ROMMAPSIZE + VIDMAPSIZE),
@@ -366,26 +361,6 @@ pmap_init()
bogons:
panic("pmap_init: bogons in the VM system!\n");
}
-#else
- addr = (vaddr_t)IOBase;
- (void)vm_map_find(kernel_map, NULL, (vaddr_t)0, &addr,
- m68k_ptob(IIOMAPSIZE + ROMMAPSIZE + VIDMAPSIZE), FALSE);
- if (addr != (vaddr_t)IOBase)
- goto bogons;
-
- addr = (vaddr_t)Sysmap;
- vm_object_reference(kernel_object);
- (void)vm_map_find(kernel_map, kernel_object, addr,
- &addr, MAC_MAX_PTSIZE, FALSE);
- /*
- * If this fails it is probably because the static portion of
- * the kernel page table isn't big enough and we overran the
- * page table map. Need to adjust pmap_size() in mac68k_init.c.
- */
- if (addr != (vaddr_t)Sysmap)
- bogons:
- panic("pmap_init: bogons in the VM system!");
-#endif /* UVM */
PMAP_DPRINTF(PDB_INIT,
("pmap_init: Sysseg %p, Sysmap %p, Sysptmap %p\n",
@@ -404,13 +379,9 @@ pmap_init()
s += page_cnt * sizeof(struct pv_entry); /* pv table */
s += page_cnt * sizeof(char); /* attribute table */
s = round_page(s);
-#if defined(UVM)
addr = uvm_km_zalloc(kernel_map, s);
if (addr == 0)
panic("pmap_init: can't allocate data structures");
-#else
- addr = kmem_alloc(kernel_map, s);
-#endif
Segtabzero = (st_entry_t *)addr;
pmap_extract(pmap_kernel(), addr, (paddr_t *)&Segtabzeropa);
@@ -451,7 +422,6 @@ pmap_init()
* Verify that space will be allocated in region for which
* we already have kernel PT pages.
*/
-#if defined(UVM)
addr = 0;
rv = uvm_map(kernel_map, &addr, s, NULL, UVM_UNKNOWN_OFFSET,
UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE,
@@ -461,25 +431,14 @@ pmap_init()
rv = uvm_unmap(kernel_map, addr, addr + s);
if (rv != KERN_SUCCESS)
panic("pmap_init: uvm_unmap failed");
-#else
- addr = 0;
- rv = vm_map_find(kernel_map, NULL, 0, &addr, s, TRUE);
- if (rv != KERN_SUCCESS || addr + s >= (vaddr_t)Sysmap)
- panic("pmap_init: kernel PT too small");
- vm_map_remove(kernel_map, addr, addr + s);
-#endif
/*
* Now allocate the space and link the pages together to
* form the KPT free list.
*/
-#if defined(UVM)
addr = uvm_km_zalloc(kernel_map, s);
if (addr == 0)
panic("pmap_init: cannot allocate KPT free list");
-#else
- addr = kmem_alloc(kernel_map, s);
-#endif
s = ptoa(npages);
addr2 = addr + s;
kpt_pages = &((struct kpt_page *)addr2)[npages];
@@ -495,7 +454,6 @@ pmap_init()
PMAP_DPRINTF(PDB_INIT, ("pmap_init: KPT: %ld pages from %lx to %lx\n",
atop(s), addr, addr + s));
-#if defined(UVM)
/*
* Allocate the segment table map and the page table map.
*/
@@ -517,45 +475,6 @@ pmap_init()
s = (maxproc * MAC_MAX_PTSIZE);
pt_map = uvm_km_suballoc(kernel_map, &addr, &addr2, s, TRUE,
TRUE, &pt_map_store);
-#else
- /*
- * Allocate the segment table map
- */
- s = maxproc * MAC_STSIZE;
- st_map = kmem_suballoc(kernel_map, &addr, &addr2, s, TRUE);
-
- /*
- * Slightly modified version of kmem_suballoc() to get page table
- * map where we want it.
- */
- addr = MAC_PTBASE;
- if ((MAC_PTMAXSIZE / MAC_MAX_PTSIZE) < maxproc) {
- s = MAC_PTMAXSIZE;
- /*
- * XXX We don't want to hang when we run out of
- * page tables, so we lower maxproc so that fork()
- * will fail instead. Note that root could still raise
- * this value via sysctl(2).
- */
- maxproc = (MAC_PTMAXSIZE / MAC_MAX_PTSIZE);
- } else
- s = (maxproc * MAC_MAX_PTSIZE);
- addr2 = addr + s;
- rv = vm_map_find(kernel_map, NULL, 0, &addr, s, TRUE);
- if (rv != KERN_SUCCESS)
- panic("pmap_init: cannot allocate space for PT map");
- pmap_reference(vm_map_pmap(kernel_map));
- pt_map = vm_map_create(vm_map_pmap(kernel_map), addr, addr2, TRUE);
- if (pt_map == NULL)
- panic("pmap_init: cannot create pt_map");
- rv = vm_map_submap(kernel_map, addr, addr2, pt_map);
- if (rv != KERN_SUCCESS)
- panic("pmap_init: cannot map range to pt_map");
-#ifdef DEBUG
- if (pmapdebug & PDB_INIT)
- printf("pmap_init: pt_map [%lx - %lx)\n", addr, addr2);
-#endif
-#endif /* UVM */
#if defined(M68040)
if (mmutype == MMU_68040) {
@@ -590,15 +509,9 @@ pmap_alloc_pv()
int i;
if (pv_nfree == 0) {
-#if defined(UVM)
pvp = (struct pv_page *)uvm_km_zalloc(kernel_map, NBPG);
if (pvp == 0)
panic("pmap_alloc_pv: uvm_km_zalloc() failed");
-#else
- pvp = (struct pv_page *)kmem_alloc(kernel_map, NBPG);
- if (pvp == 0)
- panic("pmap_alloc_pv: kmem_alloc() failed");
-#endif
pvp->pvp_pgi.pgi_freelist = pv = &pvp->pvp_pv[1];
for (i = NPVPPG - 2; i; i--, pv++)
pv->pv_next = pv + 1;
@@ -645,11 +558,7 @@ pmap_free_pv(pv)
case NPVPPG:
pv_nfree -= NPVPPG - 1;
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
-#if defined(UVM)
uvm_km_free(kernel_map, (vaddr_t)pvp, NBPG);
-#else
- kmem_free(kernel_map, (vaddr_t)pvp, NBPG);
-#endif
break;
}
}
@@ -714,11 +623,7 @@ pmap_collect_pv()
for (pvp = pv_page_collectlist.tqh_first; pvp; pvp = npvp) {
npvp = pvp->pvp_pgi.pgi_list.tqe_next;
-#if defined(UVM)
uvm_km_free(kernel_map, (vaddr_t)pvp, NBPG);
-#else
- kmem_free(kernel_map, (vaddr_t)pvp, NBPG);
-#endif
}
}
@@ -859,21 +764,11 @@ pmap_release(pmap)
#endif
if (pmap->pm_ptab)
-#if defined(UVM)
uvm_km_free_wakeup(pt_map, (vaddr_t)pmap->pm_ptab,
MAC_MAX_PTSIZE);
-#else
- kmem_free_wakeup(pt_map, (vaddr_t)pmap->pm_ptab,
- MAC_MAX_PTSIZE);
-#endif
if (pmap->pm_stab != Segtabzero)
-#if defined(UVM)
uvm_km_free_wakeup(st_map, (vaddr_t)pmap->pm_stab,
MAC_STSIZE);
-#else
- kmem_free_wakeup(st_map, (vaddr_t)pmap->pm_stab,
- MAC_STSIZE);
-#endif
}
/*
@@ -1197,13 +1092,8 @@ pmap_enter(pmap, va, pa, prot, wired, access_type)
* For user mapping, allocate kernel VM resources if necessary.
*/
if (pmap->pm_ptab == NULL)
-#if defined(UVM)
pmap->pm_ptab = (pt_entry_t *)
uvm_km_valloc_wait(pt_map, MAC_MAX_PTSIZE);
-#else
- pmap->pm_ptab = (pt_entry_t *)
- kmem_alloc_wait(pt_map, MAC_MAX_PTSIZE);
-#endif
/*
* Segment table entry not valid, we need a new PT page
@@ -1260,13 +1150,8 @@ pmap_enter(pmap, va, pa, prot, wired, access_type)
* is a valid mapping in the page.
*/
if (pmap != pmap_kernel())
-#if defined(UVM)
(void)uvm_map_pageable(pt_map, trunc_page((vaddr_t)pte),
round_page((vaddr_t)(pte+1)), FALSE, FALSE);
-#else
- (void)vm_map_pageable(pt_map, trunc_page((vaddr_t)pte),
- round_page((vaddr_t)(pte+1)), FALSE);
-#endif
/*
* Enter on the PV list if part of our managed memory
@@ -1923,13 +1808,8 @@ pmap_remove_mapping(pmap, va, pte, flags)
* PT page.
*/
if (pmap != pmap_kernel()) {
-#if defined(UVM)
(void)uvm_map_pageable(pt_map, trunc_page((vaddr_t)pte),
round_page((vaddr_t)(pte+1)), TRUE, FALSE);
-#else
- (void)vm_map_pageable(pt_map, trunc_page((vaddr_t)pte),
- round_page((vaddr_t)(pte+1)), TRUE);
-#endif
#ifdef DEBUG
if (pmapdebug & PDB_WIRING)
pmap_check_wiring("remove", (vaddr_t)trunc_page(pte));
@@ -2018,13 +1898,8 @@ pmap_remove_mapping(pmap, va, pte, flags)
PMAP_DPRINTF(PDB_REMOVE|PDB_SEGTAB,
("remove: free stab %p\n",
ptpmap->pm_stab));
-#if defined(UVM)
uvm_km_free_wakeup(st_map,
(vaddr_t)ptpmap->pm_stab, MAC_STSIZE);
-#else
- kmem_free_wakeup(st_map,
- (vaddr_t)ptpmap->pm_stab, MAC_STSIZE);
-#endif
ptpmap->pm_stab = Segtabzero;
ptpmap->pm_stpa = Segtabzeropa;
#if defined(M68040)
@@ -2162,15 +2037,8 @@ pmap_changebit(pa, set, mask)
* XXX don't write protect pager mappings
*/
if (set == PG_RO) {
-#if defined(UVM)
if (va >= uvm.pager_sva && va < uvm.pager_eva)
continue;
-#else
- extern vaddr_t pager_sva, pager_eva;
-
- if (va >= pager_sva && va < pager_eva)
- continue;
-#endif
}
pte = pmap_pte(pv->pv_pmap, va);
@@ -2227,12 +2095,8 @@ pmap_enter_ptpage(pmap, va)
* reference count drops to zero.
*/
if (pmap->pm_stab == Segtabzero) {
-#if defined(UVM)
pmap->pm_stab = (st_entry_t *)
uvm_km_zalloc(st_map, MAC_STSIZE);
-#else
- pmap->pm_stab = (st_entry_t *)kmem_alloc(st_map, MAC_STSIZE);
-#endif
pmap_extract(pmap_kernel(), (vaddr_t)pmap->pm_stab,
(paddr_t *)&pmap->pm_stpa);
#if defined(M68040)
@@ -2344,26 +2208,13 @@ pmap_enter_ptpage(pmap, va)
pmap->pm_sref++;
PMAP_DPRINTF(PDB_ENTER|PDB_PTPAGE,
("enter: about to fault UPT pg at %lx\n", va));
-#if defined(UVM)
s = uvm_fault(pt_map, va, 0, VM_PROT_READ|VM_PROT_WRITE);
if (s != KERN_SUCCESS) {
printf("uvm_fault(pt_map, 0x%lx, 0, RW) -> %d\n",
va, s);
panic("pmap_enter: uvm_fault failed");
}
-#else
- s = vm_fault(pt_map, va, VM_PROT_READ|VM_PROT_WRITE, FALSE);
- if (s != KERN_SUCCESS) {
- printf("vm_fault(pt_map, %lx, RW, 0) -> %d\n", va, s);
- panic("pmap_enter: vm_fault failed");
- }
-#endif
pmap_extract(pmap_kernel(), va, &ptpa);
-#if !defined (UVM)
-#ifdef DEBUG
- PHYS_TO_VM_PAGE(ptpa)->flags |= PG_PTPAGE;
-#endif
-#endif
}
#if defined(M68040)
/*
@@ -2488,17 +2339,10 @@ pmap_check_wiring(str, va)
!pmap_pte_v(pmap_pte(pmap_kernel(), va)))
return;
-#if defined(UVM)
if (!uvm_map_lookup_entry(pt_map, va, &entry)) {
printf("wired_check: entry for %lx not found\n", va);
return;
}
-#else
- if (!vm_map_lookup_entry(pt_map, va, &entry)) {
- printf("wired_check: entry for %lx not found\n", va);
- return;
- }
-#endif
count = 0;
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c
index 72f70afe808..2cdc6ad3cab 100644
--- a/sys/arch/mac68k/mac68k/trap.c
+++ b/sys/arch/mac68k/mac68k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.23 2001/06/10 01:36:32 beck Exp $ */
+/* $OpenBSD: trap.c,v 1.24 2001/06/27 04:22:38 art Exp $ */
/* $NetBSD: trap.c,v 1.68 1998/12/22 08:47:07 scottr Exp $ */
/*
@@ -74,9 +74,7 @@
#include <vm/vm.h>
#include <vm/pmap.h>
-#if defined(UVM)
#include <uvm/uvm_extern.h>
-#endif
#ifdef COMPAT_SUNOS
#include <compat/sunos/sunos_syscall.h>
@@ -263,11 +261,7 @@ trap(type, code, v, frame)
u_quad_t sticks;
union sigval sv;
-#if defined(UVM)
uvmexp.traps++;
-#else
- cnt.v_trap++;
-#endif
p = curproc;
ucode = 0;
@@ -541,52 +535,32 @@ copyfault:
if (ssir & SIR_SERIAL) {
void zssoft __P((int));
siroff(SIR_SERIAL);
-#if defined(UVM)
uvmexp.softs++;
-#else
- cnt.v_soft++;
-#endif
zssoft(0);
}
if (ssir & SIR_NET) {
void netintr __P((void));
siroff(SIR_NET);
-#if defined(UVM)
uvmexp.softs++;
-#else
- cnt.v_soft++;
-#endif
netintr();
}
if (ssir & SIR_CLOCK) {
void softclock __P((void));
siroff(SIR_CLOCK);
-#if defined(UVM)
uvmexp.softs++;
-#else
- cnt.v_soft++;
-#endif
softclock();
}
if (ssir & SIR_DTMGR) {
void mrg_execute_deferred __P((void));
siroff(SIR_DTMGR);
-#if defined(UVM)
uvmexp.softs++;
-#else
- cnt.v_soft++;
-#endif
mrg_execute_deferred();
}
/*
* If this was not an AST trap, we are all done.
*/
if (type != (T_ASTFLT|T_USER)) {
-#if defined(UVM)
uvmexp.traps--;
-#else
- cnt.v_trap--;
-#endif
return;
}
spl0();
@@ -646,21 +620,12 @@ copyfault:
goto dopanic;
}
#endif
-#if defined(UVM)
rv = uvm_fault(map, va, 0, ftype);
#ifdef DEBUG
if (rv && MDB_ISPID(p->p_pid))
printf("uvm_fault(%p, 0x%lx, 0, 0x%x) -> 0x%x\n",
map, va, ftype, rv);
#endif
-#else /* ! UVM */
- rv = vm_fault(map, va, ftype, FALSE);
-#ifdef DEBUG
- if (rv && MDB_ISPID(p->p_pid))
- printf("vm_fault(%p, %lx, %x, 0) -> %x\n",
- map, va, ftype, rv);
-#endif
-#endif /* UVM */
/*
* If this was a stack access, we keep track of the maximum
* accessed stack size. Also, if vm_fault gets a protection
@@ -692,13 +657,8 @@ copyfault:
if (type == T_MMUFLT) {
if (p->p_addr->u_pcb.pcb_onfault)
goto copyfault;
-#if defined(UVM)
printf("uvm_fault(%p, 0x%lx, 0, 0x%x) -> 0x%x\n",
map, va, ftype, rv);
-#else
- printf("vm_fault(%p, %lx, %x, 0) -> %x\n",
- map, va, ftype, rv);
-#endif
printf(" type %x, code [mmu,,ssw]: %x\n",
type, code);
goto dopanic;
@@ -1043,11 +1003,7 @@ syscall(code, frame)
register_t args[8], rval[2];
u_quad_t sticks;
-#if defined(UVM)
uvmexp.syscalls++;
-#else
- cnt.v_syscall++;
-#endif
if (!USERMODE(frame.f_sr))
panic("syscall");
p = curproc;
diff --git a/sys/arch/mac68k/mac68k/vm_machdep.c b/sys/arch/mac68k/mac68k/vm_machdep.c
index 0fa9ce56a89..bc4ee4ddf53 100644
--- a/sys/arch/mac68k/mac68k/vm_machdep.c
+++ b/sys/arch/mac68k/mac68k/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.20 2001/06/08 08:09:03 art Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.21 2001/06/27 04:22:38 art Exp $ */
/* $NetBSD: vm_machdep.c,v 1.29 1998/07/28 18:34:55 thorpej Exp $ */
/*
@@ -59,9 +59,7 @@
#include <vm/vm_kern.h>
#include <vm/vm_map.h>
-#if defined(UVM)
#include <uvm/uvm_extern.h>
-#endif
#include <machine/cpu.h>
#include <machine/pmap.h>
@@ -160,11 +158,7 @@ cpu_exit(p)
{
(void)splhigh();
-#if defined(UVM)
uvmexp.swtch++;
-#else
- cnt.v_swtch++;
-#endif
switch_exit(p);
for(;;); /* Get rid of a compile warning */
/* NOTREACHED */
@@ -381,11 +375,7 @@ vmapbuf(bp, len)
uva = trunc_page((vaddr_t)(bp->b_saveaddr = bp->b_data));
off = (vm_offset_t)bp->b_data - uva;
len = round_page(off + len);
-#if defined(UVM)
kva = uvm_km_valloc_wait(phys_map, len);
-#else
- kva = kmem_alloc_wait(phys_map, len);
-#endif
bp->b_data = (caddr_t)(kva + off);
upmap = vm_map_pmap(&bp->b_proc->p_vmspace->vm_map);
@@ -422,11 +412,7 @@ vunmapbuf(bp, len)
* pmap_remove() is unnecessary here, as kmem_free_wakeup()
* will do it for us.
*/
-#if defined(UVM)
uvm_km_free_wakeup(phys_map, kva, len);
-#else
- kmem_free_wakeup(phys_map, kva, len);
-#endif
bp->b_data = bp->b_saveaddr;
bp->b_saveaddr = 0;
}