diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-05-10 10:34:51 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-05-10 10:34:51 +0000 |
commit | 9b16af7f254ad018fb7ff8872ae57f62714ece01 (patch) | |
tree | 0a08183ee4de4579e55f3777a643809d57070294 /sys/arch/sparc | |
parent | cf6163b5efce518222d83d21db6e88f58bfb1ca4 (diff) |
UVM is no longer optional on sparc.
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/conf/GENERIC | 4 | ||||
-rw-r--r-- | sys/arch/sparc/conf/GENERIC_SCSI3 | 4 | ||||
-rw-r--r-- | sys/arch/sparc/conf/RAMDISK | 4 | ||||
-rw-r--r-- | sys/arch/sparc/conf/SUN4 | 4 | ||||
-rw-r--r-- | sys/arch/sparc/conf/SUN4C | 4 | ||||
-rw-r--r-- | sys/arch/sparc/conf/SUN4M | 4 | ||||
-rw-r--r-- | sys/arch/sparc/dev/bt_subr.c | 16 | ||||
-rw-r--r-- | sys/arch/sparc/dev/cgfourteen.c | 22 | ||||
-rw-r--r-- | sys/arch/sparc/dev/cgsix.c | 8 | ||||
-rw-r--r-- | sys/arch/sparc/dev/if_ie.c | 13 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/amd7930intr.s | 9 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/bsd_fdintr.s | 9 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/genassym.cf | 10 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/iommu.c | 16 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/locore.s | 38 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/machdep.c | 85 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/mem.c | 13 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/pmap.c | 67 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/trap.c | 36 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/vm_machdep.c | 10 |
20 files changed, 28 insertions, 348 deletions
diff --git a/sys/arch/sparc/conf/GENERIC b/sys/arch/sparc/conf/GENERIC index c6cb3a04b01..fdf16908b49 100644 --- a/sys/arch/sparc/conf/GENERIC +++ b/sys/arch/sparc/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.49 2001/04/17 05:31:00 deraadt Exp $ +# $OpenBSD: GENERIC,v 1.50 2001/05/10 10:34:40 art Exp $ # $NetBSD: GENERIC,v 1.48 1997/08/23 19:19:01 mjacob Exp $ # Machine architecture; required by config(8) @@ -19,7 +19,7 @@ option SUN4M # sun4m - SS10, SS20, Classic, etc. #option KGDBDEV=0xc01 # kgdb device number (dev_t) #option KGDBRATE=38400 # baud rate -option UVM # use the UVM virtual memory system +option UVM # use the UVM virtual memory system ; required # Options for SPARCstation hardware option RASTERCONSOLE # fast rasterop console diff --git a/sys/arch/sparc/conf/GENERIC_SCSI3 b/sys/arch/sparc/conf/GENERIC_SCSI3 index 991c914067a..ca018e2f36d 100644 --- a/sys/arch/sparc/conf/GENERIC_SCSI3 +++ b/sys/arch/sparc/conf/GENERIC_SCSI3 @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC_SCSI3,v 1.34 2001/04/17 12:50:12 brad Exp $ +# $OpenBSD: GENERIC_SCSI3,v 1.35 2001/05/10 10:34:40 art Exp $ # $NetBSD: GENERIC,v 1.48 1997/08/23 19:19:01 mjacob Exp $ # Machine architecture; required by config(8) @@ -19,7 +19,7 @@ option SUN4M # sun4m - SS10, SS20, Classic, etc. #option KGDBDEV=0xc01 # kgdb device number (dev_t) #option KGDBRATE=38400 # baud rate -option UVM # use the UVM virtual memory system +option UVM # use the UVM virtual memory system ; required # Options for SPARCstation hardware option RASTERCONSOLE # fast rasterop console diff --git a/sys/arch/sparc/conf/RAMDISK b/sys/arch/sparc/conf/RAMDISK index ab956856f1b..312c56e976f 100644 --- a/sys/arch/sparc/conf/RAMDISK +++ b/sys/arch/sparc/conf/RAMDISK @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK,v 1.23 1999/10/29 14:14:27 art Exp $ +# $OpenBSD: RAMDISK,v 1.24 2001/05/10 10:34:41 art Exp $ # $NetBSD: GENERIC,v 1.28.2.1 1996/07/02 23:55:22 jtc Exp $ # Machine architecture; required by config(8) @@ -18,7 +18,7 @@ option MINIROOTSIZE=4352 option TIMEZONE=0 # time zone to adjust RTC time by option DST=0 # daylight savings time used by RTC -option UVM # UVM virtual memory system +option UVM # UVM virtual memory system ; required option DIAGNOSTIC # internal consistency checks option FFS # UFS option NFSCLIENT # Network File System client diff --git a/sys/arch/sparc/conf/SUN4 b/sys/arch/sparc/conf/SUN4 index 644fdb2506e..7f30d015e31 100644 --- a/sys/arch/sparc/conf/SUN4 +++ b/sys/arch/sparc/conf/SUN4 @@ -1,4 +1,4 @@ -# $OpenBSD: SUN4,v 1.22 1999/10/29 14:14:28 art Exp $ +# $OpenBSD: SUN4,v 1.23 2001/05/10 10:34:41 art Exp $ # $NetBSD: GENERIC,v 1.28.2.1 1996/07/02 23:55:22 jtc Exp $ # Machine architecture; required by config(8) @@ -17,7 +17,7 @@ option RASTERCONSOLE # fast rasterop console option COMPAT_SUNOS # compatibility with SunOS binaries option COMPAT_SVR4 # compatibility with SVR4 binaries -option UVM # use the UVM virtual memory system +option UVM # use the UVM virtual memory system ; required maxusers 16 # estimated number of users diff --git a/sys/arch/sparc/conf/SUN4C b/sys/arch/sparc/conf/SUN4C index 9bb118a4570..a67267d77b3 100644 --- a/sys/arch/sparc/conf/SUN4C +++ b/sys/arch/sparc/conf/SUN4C @@ -1,4 +1,4 @@ -# $OpenBSD: SUN4C,v 1.28 1999/10/29 14:14:28 art Exp $ +# $OpenBSD: SUN4C,v 1.29 2001/05/10 10:34:41 art Exp $ # $NetBSD: GENERIC,v 1.19 1995/10/08 11:45:39 pk Exp $ machine sparc @@ -18,7 +18,7 @@ option RASTERCONSOLE # fast rasterop console option SYSVMSG,SYSVSEM,SYSVSHM option COMPAT_09, COMPAT_10 -option UVM # use the UVM virtual memory system +option UVM # use the UVM virtual memory system ; required # Filesystem options option FFS diff --git a/sys/arch/sparc/conf/SUN4M b/sys/arch/sparc/conf/SUN4M index 15b47f5b5d6..79b77a225d8 100644 --- a/sys/arch/sparc/conf/SUN4M +++ b/sys/arch/sparc/conf/SUN4M @@ -1,4 +1,4 @@ -# $OpenBSD: SUN4M,v 1.37 2001/03/08 03:37:19 itojun Exp $ +# $OpenBSD: SUN4M,v 1.38 2001/05/10 10:34:41 art Exp $ # $NetBSD: GENERIC,v 1.28.2.1 1996/07/02 23:55:22 jtc Exp $ # Machine architecture; required by config(8) @@ -15,7 +15,7 @@ option SUN4M # sun4m - SS10, SS20, Classic, etc. #option KGDBDEV=0xc01 # kgdb device number (dev_t) #option KGDBRATE=38400 # baud rate -option UVM # use the UVM virtual memory system +option UVM # use the UVM virtual memory system; required # Options for SPARCstation hardware option RASTERCONSOLE # fast rasterop console diff --git a/sys/arch/sparc/dev/bt_subr.c b/sys/arch/sparc/dev/bt_subr.c index 5e96da0b624..1f102fff824 100644 --- a/sys/arch/sparc/dev/bt_subr.c +++ b/sys/arch/sparc/dev/bt_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_subr.c,v 1.4 1999/04/22 16:52:46 art Exp $ */ +/* $OpenBSD: bt_subr.c,v 1.5 2001/05/10 10:34:42 art Exp $ */ /* $NetBSD: bt_subr.c,v 1.5 1996/03/14 19:44:32 christos Exp $ */ /* @@ -79,17 +79,10 @@ bt_getcmap(p, cm, cmsize) count = p->count; if (start >= cmsize || start + count > cmsize) return (EINVAL); -#if defined(UVM) if (!uvm_useracc(p->red, count, B_WRITE) || !uvm_useracc(p->green, count, B_WRITE) || !uvm_useracc(p->blue, count, B_WRITE)) return (EFAULT); -#else - if (!useracc(p->red, count, B_WRITE) || - !useracc(p->green, count, B_WRITE) || - !useracc(p->blue, count, B_WRITE)) - return (EFAULT); -#endif for (cp = &cm->cm_map[start][0], i = 0; i < count; cp += 3, i++) { p->red[i] = cp[0]; p->green[i] = cp[1]; @@ -114,17 +107,10 @@ bt_putcmap(p, cm, cmsize) count = p->count; if (start >= cmsize || start + count > cmsize) return (EINVAL); -#if defined(UVM) if (!uvm_useracc(p->red, count, B_READ) || !uvm_useracc(p->green, count, B_READ) || !uvm_useracc(p->blue, count, B_READ)) return (EFAULT); -#else - if (!useracc(p->red, count, B_READ) || - !useracc(p->green, count, B_READ) || - !useracc(p->blue, count, B_READ)) - return (EFAULT); -#endif for (cp = &cm->cm_map[start][0], i = 0; i < count; cp += 3, i++) { cp[0] = p->red[i]; cp[1] = p->green[i]; diff --git a/sys/arch/sparc/dev/cgfourteen.c b/sys/arch/sparc/dev/cgfourteen.c index d44dacf89ae..79ae62f5b40 100644 --- a/sys/arch/sparc/dev/cgfourteen.c +++ b/sys/arch/sparc/dev/cgfourteen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgfourteen.c,v 1.4 1999/09/10 23:32:01 art Exp $ */ +/* $OpenBSD: cgfourteen.c,v 1.5 2001/05/10 10:34:43 art Exp $ */ /* $NetBSD: cgfourteen.c,v 1.7 1997/05/24 20:16:08 pk Exp $ */ /* @@ -483,15 +483,9 @@ cgfourteenioctl(dev, cmd, data, flags, p) if ((u_int)p->size.x > 32 || (u_int)p->size.y > 32) return (EINVAL); count = p->size.y * 32 / NBBY; -#if defined(UVM) if (!uvm_useracc(p->image, count, B_READ) || !uvm_useracc(p->mask, count, B_READ)) return (EFAULT); -#else - if (!useracc(p->image, count, B_READ) || - !useracc(p->mask, count, B_READ)) - return (EFAULT); -#endif } /* parameters are OK; do it */ @@ -767,17 +761,10 @@ cg14_get_cmap(p, cm, cmsize) } #endif -#if defined(UVM) if (!uvm_useracc(p->red, count, B_WRITE) || !uvm_useracc(p->green, count, B_WRITE) || !uvm_useracc(p->blue, count, B_WRITE)) return (EFAULT); -#else - if (!useracc(p->red, count, B_WRITE) || - !useracc(p->green, count, B_WRITE) || - !useracc(p->blue, count, B_WRITE)) - return (EFAULT); -#endif for (cp = &cm->cm_map[start][0], i = 0; i < count; cp += 4, i++) { p->red[i] = cp[3]; p->green[i] = cp[2]; @@ -809,17 +796,10 @@ cg14_put_cmap(p, cm, cmsize) } #endif -#if defined(UVM) if (!uvm_useracc(p->red, count, B_READ) || !uvm_useracc(p->green, count, B_READ) || !uvm_useracc(p->blue, count, B_READ)) return (EFAULT); -#else - if (!useracc(p->red, count, B_READ) || - !useracc(p->green, count, B_READ) || - !useracc(p->blue, count, B_READ)) - return (EFAULT); -#endif for (cp = &cm->cm_map[start][0], i = 0; i < count; cp += 4, i++) { cp[3] = p->red[i]; cp[2] = p->green[i]; diff --git a/sys/arch/sparc/dev/cgsix.c b/sys/arch/sparc/dev/cgsix.c index a0f3194672b..d6f9a6c4e0b 100644 --- a/sys/arch/sparc/dev/cgsix.c +++ b/sys/arch/sparc/dev/cgsix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgsix.c,v 1.13 2000/05/18 13:31:12 jason Exp $ */ +/* $OpenBSD: cgsix.c,v 1.14 2001/05/10 10:34:43 art Exp $ */ /* $NetBSD: cgsix.c,v 1.33 1997/08/07 19:12:30 pk Exp $ */ /* @@ -494,15 +494,9 @@ cgsixioctl(dev, cmd, data, flags, p) if ((u_int)p->size.x > 32 || (u_int)p->size.y > 32) return (EINVAL); count = p->size.y * 32 / NBBY; -#if defined(UVM) if (!uvm_useracc(p->image, count, B_READ) || !uvm_useracc(p->mask, count, B_READ)) return (EFAULT); -#else - if (!useracc(p->image, count, B_READ) || - !useracc(p->mask, count, B_READ)) - return (EFAULT); -#endif } /* parameters are OK; do it */ diff --git a/sys/arch/sparc/dev/if_ie.c b/sys/arch/sparc/dev/if_ie.c index 8cb358ef6ae..d83ec7f417f 100644 --- a/sys/arch/sparc/dev/if_ie.c +++ b/sys/arch/sparc/dev/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.14 2001/03/24 10:07:18 ho Exp $ */ +/* $OpenBSD: if_ie.c,v 1.15 2001/05/10 10:34:44 art Exp $ */ /* $NetBSD: if_ie.c,v 1.33 1997/07/29 17:55:38 fair Exp $ */ /*- @@ -137,9 +137,7 @@ Mode of operation: #include <vm/vm.h> -#if defined(UVM) #include <uvm/uvm_map.h> -#endif /* * ugly byte-order hack for SUNs @@ -542,19 +540,10 @@ ieattach(parent, self, aux) * XXX */ -#if defined(UVM) ie_map = uvm_map_create(pmap_kernel(), (vaddr_t)IEOB_ADBASE, (vaddr_t)IEOB_ADBASE + sc->sc_msize, 1); -#else - ie_map = vm_map_create(pmap_kernel(), (vaddr_t)IEOB_ADBASE, - (vaddr_t)IEOB_ADBASE + sc->sc_msize, 1); -#endif if (ie_map == NULL) panic("ie_map"); -#if defined(UVM) sc->sc_maddr = (caddr_t) uvm_km_alloc(ie_map, sc->sc_msize); -#else - sc->sc_maddr = (caddr_t) kmem_alloc(ie_map, sc->sc_msize); -#endif if (sc->sc_maddr == NULL) panic("ie kmem_alloc"); kvm_uncache(sc->sc_maddr, sc->sc_msize >> PGSHIFT); if (((u_long)sc->sc_maddr & ~(NBPG-1)) != (u_long)sc->sc_maddr) diff --git a/sys/arch/sparc/sparc/amd7930intr.s b/sys/arch/sparc/sparc/amd7930intr.s index 69a121fbd26..1ed9a15b0f1 100644 --- a/sys/arch/sparc/sparc/amd7930intr.s +++ b/sys/arch/sparc/sparc/amd7930intr.s @@ -1,4 +1,4 @@ -/* $OpenBSD: amd7930intr.s,v 1.4 1999/04/22 18:43:50 art Exp $ */ +/* $OpenBSD: amd7930intr.s,v 1.5 2001/05/10 10:34:44 art Exp $ */ /* $NetBSD: amd7930intr.s,v 1.10 1997/03/11 01:03:07 pk Exp $ */ /* * Copyright (c) 1995 Rolf Grossmann. @@ -100,17 +100,10 @@ _amd7930_trap: st %l2, [%l7 + %lo(savepc)] ! tally interrupt -#if defined(UVM) sethi %hi(_uvmexp+V_INTR), %l7 ld [%l7 + %lo(_uvmexp+V_INTR)], %l6 inc %l6 st %l6, [%l7 + %lo(_uvmexp+V_INTR)] -#else - sethi %hi(_cnt+V_INTR), %l7 - ld [%l7 + %lo(_cnt+V_INTR)], %l6 - inc %l6 - st %l6, [%l7 + %lo(_cnt+V_INTR)] -#endif sethi %hi(_auiop), %l7 ld [%l7 + %lo(_auiop)], %l7 diff --git a/sys/arch/sparc/sparc/bsd_fdintr.s b/sys/arch/sparc/sparc/bsd_fdintr.s index c99cd3f6acd..9b4c63c728c 100644 --- a/sys/arch/sparc/sparc/bsd_fdintr.s +++ b/sys/arch/sparc/sparc/bsd_fdintr.s @@ -1,4 +1,4 @@ -/* $OpenBSD: bsd_fdintr.s,v 1.5 1999/04/22 18:43:51 art Exp $ */ +/* $OpenBSD: bsd_fdintr.s,v 1.6 2001/05/10 10:34:45 art Exp $ */ /* $NetBSD: bsd_fdintr.s,v 1.11 1997/04/07 21:00:36 pk Exp $ */ /* @@ -168,17 +168,10 @@ _fdchwintr: st %l2, [%l7 + 8] ! tally interrupt -#if defined(UVM) sethi %hi(_uvmexp+V_INTR), %l7 ld [%l7 + %lo(_uvmexp+V_INTR)], %l6 inc %l6 st %l6, [%l7 + %lo(_uvmexp+V_INTR)] -#else - sethi %hi(_cnt+V_INTR), %l7 - ld [%l7 + %lo(_cnt+V_INTR)], %l6 - inc %l6 - st %l6, [%l7 + %lo(_cnt+V_INTR)] -#endif ! load fdc, if it's NULL there's nothing to do: schedule soft interrupt sethi %hi(_fdciop), %l7 diff --git a/sys/arch/sparc/sparc/genassym.cf b/sys/arch/sparc/sparc/genassym.cf index 89bb88ab246..5dd203edeea 100644 --- a/sys/arch/sparc/sparc/genassym.cf +++ b/sys/arch/sparc/sparc/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.6 2000/02/21 17:08:36 art Exp $ +# $OpenBSD: genassym.cf,v 1.7 2001/05/10 10:34:45 art Exp $ # $NetBSD: genassym.cf,v 1.2 1997/06/28 19:59:04 pk Exp $ # @@ -59,9 +59,7 @@ include <sys/device.h> include <sys/disklabel.h> include <sys/disk.h> -ifdef UVM include <uvm/uvm_extern.h> -endif include <machine/pmap.h> include <machine/cpu.h> @@ -101,15 +99,9 @@ define PMAP_CTX offsetof(struct pmap, pm_ctx) define PMAP_CTXNUM offsetof(struct pmap, pm_ctxnum) # interrupt/fault metering -ifdef UVM define V_SWTCH offsetof(struct uvmexp, swtch) define V_INTR offsetof(struct uvmexp, intrs) define V_FAULTS offsetof(struct uvmexp, faults) -else -define V_SWTCH offsetof(struct vmmeter, v_swtch) -define V_INTR offsetof(struct vmmeter, v_intr) -define V_FAULTS offsetof(struct vmmeter, v_faults) -endif # CPU info structure define CPUINFO_GETSYNCFLT offsetof(struct cpu_softc, get_syncflt) diff --git a/sys/arch/sparc/sparc/iommu.c b/sys/arch/sparc/sparc/iommu.c index 1cf8a9f8dd9..687a683807e 100644 --- a/sys/arch/sparc/sparc/iommu.c +++ b/sys/arch/sparc/sparc/iommu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iommu.c,v 1.6 2000/01/01 19:41:00 deraadt Exp $ */ +/* $OpenBSD: iommu.c,v 1.7 2001/05/10 10:34:46 art Exp $ */ /* $NetBSD: iommu.c,v 1.13 1997/07/29 09:42:04 fair Exp $ */ /* @@ -42,9 +42,7 @@ #include <sys/device.h> #include <vm/vm.h> #include <vm/vm_kern.h> -#if defined(UVM) #include <uvm/uvm.h> -#endif #include <machine/pmap.h> @@ -187,28 +185,18 @@ iommu_attach(parent, self, aux) */ TAILQ_INIT(&mlist); #define DVMA_PTESIZE ((0 - DVMA4M_BASE) / 1024) -#if defined(UVM) if (uvm_pglistalloc(DVMA_PTESIZE, 0, 0xffffffff, DVMA_PTESIZE, 0, &mlist, 1, 0) || (iopte_va = uvm_km_valloc(kernel_map, DVMA_PTESIZE)) == 0) panic("iommu_attach: can't allocate memory for pagetables"); -#else - if (vm_page_alloc_memory(DVMA_PTESIZE, 0, 0xffffffff, DVMA_PTESIZE, - 0, &mlist, 1, 0) || - (iopte_va = kmem_alloc_pageable(kernel_map, DVMA_PTESIZE)) == 0) - panic("iommu_attach: can't allocate memory for pagetables"); -#endif #undef DVMA_PTESIZE m = TAILQ_FIRST(&mlist); iopte_pa = VM_PAGE_TO_PHYS(m); sc->sc_ptes = (iopte_t *) iopte_va; while (m) { -#if defined(UVM) + /* XXX - art, pagewire breaks the tailq */ uvm_pagewire(m); -#else - vm_page_wire(m); -#endif pmap_enter(pmap_kernel(), iopte_va, VM_PAGE_TO_PHYS(m), VM_PROT_READ|VM_PROT_WRITE, 1, VM_PROT_READ|VM_PROT_WRITE); diff --git a/sys/arch/sparc/sparc/locore.s b/sys/arch/sparc/sparc/locore.s index 5ec4e4dfaa6..70db0e7c762 100644 --- a/sys/arch/sparc/sparc/locore.s +++ b/sys/arch/sparc/sparc/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.39 2000/06/07 15:43:24 art Exp $ */ +/* $OpenBSD: locore.s,v 1.40 2001/05/10 10:34:46 art Exp $ */ /* $NetBSD: locore.s,v 1.73 1997/09/13 20:36:48 pk Exp $ */ /* @@ -1707,11 +1707,7 @@ ctw_invalid: #if defined(SUN4) memfault_sun4: TRAP_SETUP(-CCFSZ-80) -#if defined(UVM) INCR(_uvmexp+V_FAULTS) -#else - INCR(_cnt+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) -#endif st %g1, [%sp + CCFSZ + 20] ! save g1 rd %y, %l4 ! save y @@ -1776,11 +1772,7 @@ memfault_sun4: memfault_sun4c: #if defined(SUN4C) TRAP_SETUP(-CCFSZ-80) -#if defined(UVM) INCR(_uvmexp+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) -#else - INCR(_cnt+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) -#endif st %g1, [%sp + CCFSZ + 20] ! save g1 rd %y, %l4 ! save y @@ -1886,11 +1878,7 @@ BARF jmpl %l5, %l7 or %l4, %lo(CPUINFO_SYNCFLTDUMP), %l4 TRAP_SETUP(-CCFSZ-80) -#if defined(UVM) INCR(_uvmexp+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) -#else - INCR(_cnt+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) -#endif st %g1, [%sp + CCFSZ + 20] ! save g1 rd %y, %l4 ! save y @@ -2338,11 +2326,7 @@ softintr_sun44c: softintr_common: INTR_SETUP(-CCFSZ-80) std %g2, [%sp + CCFSZ + 24] ! save registers -#if defined(UVM) INCR(_uvmexp+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) -#else - INCR(_cnt+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) -#endif mov %g1, %l7 rd %y, %l6 std %g4, [%sp + CCFSZ + 32] @@ -2410,11 +2394,7 @@ _sparc_interrupt44c: _sparc_interrupt_common: INTR_SETUP(-CCFSZ-80) std %g2, [%sp + CCFSZ + 24] ! save registers -#if defined(UVM) INCR(_uvmexp+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) -#else - INCR(_cnt+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) -#endif mov %g1, %l7 rd %y, %l6 std %g4, [%sp + CCFSZ + 32] @@ -2506,11 +2486,7 @@ zshard: #if defined(SUN4) nmi_sun4: INTR_SETUP(-CCFSZ-80) -#if defined(UVM) INCR(_uvmexp+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) -#else - INCR(_cnt+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) -#endif /* * Level 15 interrupts are nonmaskable, so with traps off, * disable all interrupts to prevent recursion. @@ -2536,11 +2512,7 @@ nmi_sun4: #if defined(SUN4C) nmi_sun4c: INTR_SETUP(-CCFSZ-80) -#if defined(UVM) INCR(_uvmexp+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) -#else - INCR(_cnt+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) -#endif /* * Level 15 interrupts are nonmaskable, so with traps off, * disable all interrupts to prevent recursion. @@ -2595,11 +2567,7 @@ nmi_common: #if defined(SUN4M) nmi_sun4m: INTR_SETUP(-CCFSZ-80) -#if defined(UVM) INCR(_uvmexp+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) -#else - INCR(_cnt+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) -#endif /* * XXX - we don't handle soft nmi, yet. */ @@ -4359,11 +4327,7 @@ ENTRY(switchexit) */ INCR(_nswitchexit) ! nswitchexit++; -#if defined(UVM) INCR(_uvmexp+V_SWTCH) ! cnt.v_switch++; -#else - INCR(_cnt+V_SWTCH) ! cnt.v_switch++; -#endif mov PSR_S|PSR_ET, %g1 ! oldpsr = PSR_S | PSR_ET; sethi %hi(_whichqs), %g2 diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 3fe606b197c..9d53b3ab259 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.56 2001/05/05 22:34:19 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.57 2001/05/10 10:34:47 art Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -93,9 +93,7 @@ #include <sparc/sparc/vaddrs.h> #include <sparc/sparc/cpuvar.h> -#if defined(UVM) #include <uvm/uvm.h> -#endif #ifdef SUN4M #include <sparc/dev/power.h> @@ -114,13 +112,9 @@ #include "led.h" #endif -#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. @@ -204,17 +198,12 @@ cpu_startup() */ sz = (int)allocsys((caddr_t)0); -#if defined(UVM) if ((v = (caddr_t)uvm_km_alloc(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"); -#if defined(UVM) /* * allocate virtual and physical memory for the buffers. */ @@ -261,52 +250,12 @@ cpu_startup() curbufsize -= PAGE_SIZE; } } -#else - /* - * Now allocate buffers proper. They are different than the above - * in that they usually occupy more virtual memory than physical. - */ - size = MAXBSIZE * nbuf; - - buffer_map = kmem_suballoc(kernel_map, (vaddr_t *)&buffers, - &maxaddr, size, TRUE); - - minaddr = (vaddr_t)buffers; - if (vm_map_find(buffer_map, vm_object_allocate(size), (vaddr_t)0, - &minaddr, size, FALSE) != KERN_SUCCESS) - panic("startup: cannot allocate buffers"); - - base = bufpages / nbuf; - residual = bufpages % nbuf; - - for (i = 0; i < nbuf; i++) { - vsize_t curbufsize; - vaddr_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 = (vaddr_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. */ -#if defined(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 /* * Allocate a map for physio. Others use a submap of the kernel @@ -315,11 +264,7 @@ cpu_startup() */ dvma_base = CPU_ISSUN4M ? DVMA4M_BASE : DVMA_BASE; dvma_end = CPU_ISSUN4M ? DVMA4M_END : DVMA_END; -#if defined(UVM) phys_map = uvm_map_create(pmap_kernel(), dvma_base, dvma_end, 1); -#else - phys_map = vm_map_create(pmap_kernel(), dvma_base, dvma_end, 1); -#endif if (phys_map == NULL) panic("unable to create DVMA map"); /* @@ -327,13 +272,8 @@ cpu_startup() * resource map for double mappings which is usable from * interrupt contexts. */ -#if defined(UVM) if (uvm_km_valloc_wait(phys_map, (dvma_end-dvma_base)) != dvma_base) panic("unable to allocate from DVMA map"); -#else - if (kmem_alloc_wait(phys_map, (dvma_end-dvma_base)) != dvma_base) - panic("unable to allocate from DVMA map"); -#endif dvmamap_extent = extent_create("dvmamap", dvma_base, dvma_end, M_DEVBUF, NULL, 0, EX_NOWAIT); if (dvmamap_extent == 0) @@ -346,13 +286,8 @@ cpu_startup() mclrefcnt = (char *)malloc(NMBCLUSTERS+PAGE_SIZE/MCLBYTES, M_MBUF, M_NOWAIT); bzero(mclrefcnt, NMBCLUSTERS+PAGE_SIZE/MCLBYTES); -#if defined(UVM) mb_map = uvm_km_suballoc(kernel_map, (vaddr_t *)&mbutl, &maxaddr, VM_MBUF_SIZE, VM_MAP_INTRSAFE, FALSE, NULL); -#else - mb_map = kmem_suballoc(kernel_map, (vaddr_t *)&mbutl, &maxaddr, - VM_MBUF_SIZE, FALSE); -#endif /* * Initialize timeouts */ @@ -361,11 +296,7 @@ cpu_startup() #ifdef DEBUG pmapdebug = opmapdebug; #endif -#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); @@ -440,9 +371,6 @@ allocsys(v) if (nswbuf > 256) nswbuf = 256; /* sanity */ } -#if !defined(UVM) - valloc(swbuf, struct buf, nswbuf); -#endif valloc(buf, struct buf, nbuf); return (v); } @@ -736,13 +664,8 @@ sys_sigreturn(p, v, retval) p->p_comm, p->p_pid, SCARG(uap, sigcntxp)); #endif scp = SCARG(uap, sigcntxp); -#if defined(UVM) if ((int)scp & 3 || uvm_useracc((caddr_t)scp, sizeof *scp, B_WRITE) == 0) return (EINVAL); -#else - if ((int)scp & 3 || useracc((caddr_t)scp, sizeof *scp, B_WRITE) == 0) - return (EINVAL); -#endif tf = p->p_md.md_tf; /* * Only the icc bits in the psr are used, so it need not be @@ -1101,15 +1024,9 @@ oldmon_w_trace(va) printf("curproc = %p, pid %d\n", curproc, curproc->p_pid); else printf("no curproc\n"); -#if defined(UVM) printf("uvm: swtch %d, trap %d, sys %d, intr %d, soft %d, faults %d\n", uvmexp.swtch, uvmexp.traps, uvmexp.syscalls, uvmexp.intrs, uvmexp.softs, uvmexp.faults); -#else - printf("cnt: swtch %d, trap %d, sys %d, intr %d, soft %d, faults %d\n", - cnt.v_swtch, cnt.v_trap, cnt.v_syscall, cnt.v_intr, cnt.v_soft, - cnt.v_faults); -#endif write_user_windows(); printf("\nstack trace with sp = 0x%lx\n", va); diff --git a/sys/arch/sparc/sparc/mem.c b/sys/arch/sparc/sparc/mem.c index 3dba040dc06..4890ef6d6a9 100644 --- a/sys/arch/sparc/sparc/mem.c +++ b/sys/arch/sparc/sparc/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.14 2001/05/05 20:56:53 art Exp $ */ +/* $OpenBSD: mem.c,v 1.15 2001/05/10 10:34:48 art Exp $ */ /* $NetBSD: mem.c,v 1.13 1996/03/30 21:12:16 christos Exp $ */ /* @@ -121,13 +121,8 @@ mmrw(dev, uio, flags) return (error); } physlock = 1; -#if defined(UVM) if (mem_page == 0) mem_page = uvm_km_valloc_wait(kernel_map, NBPG); -#else - if (mem_page == 0) - mem_page = kmem_alloc_pageable(kernel_map, NBPG); -#endif if (mem_page == 0) panic("mmrw: out of space in kernel_map"); } @@ -169,15 +164,9 @@ mmrw(dev, uio, flags) c = min(iov->iov_len, prom_vend - prom_vstart); } else { c = min(iov->iov_len, MAXPHYS); -#if defined(UVM) if (!uvm_kernacc((caddr_t)va, c, uio->uio_rw == UIO_READ ? B_READ : B_WRITE)) return (EFAULT); -#else - if (!kernacc((caddr_t)va, c, - uio->uio_rw == UIO_READ ? B_READ : B_WRITE)) - return (EFAULT); -#endif } error = uiomove((caddr_t)va, c, uio); continue; diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c index 4aa9ed63bc8..3ddc704cba4 100644 --- a/sys/arch/sparc/sparc/pmap.c +++ b/sys/arch/sparc/sparc/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.82 2001/05/10 08:43:56 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.83 2001/05/10 10:34:48 art Exp $ */ /* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */ /* @@ -73,10 +73,8 @@ #include <vm/vm_prot.h> #include <vm/vm_page.h> -#if defined(UVM) #include <uvm/uvm.h> #include <sys/pool.h> -#endif #include <machine/autoconf.h> #include <machine/bsd_openprom.h> @@ -217,7 +215,6 @@ pvfree(pv) } #if defined(SUN4M) -#if defined(UVM) /* We can only use pool with uvm */ /* * Memory pools and back-end supplier for SRMMU page tables. * Share a pool between the level 2 and level 3 page tables, @@ -295,36 +292,6 @@ pt23_free(pt) { pool_put(&L23_pool, pt); } - -#else - -static __inline int * -pt1_alloc() -{ - return malloc(SRMMU_L1SIZE * sizeof(int), M_VMPMAP, M_WAITOK); -} - -static __inline void -pt1_free(pt) - int *pt; -{ - free(pt, M_VMPMAP); -} - -static __inline int * -pt23_alloc() -{ - return malloc(SRMMU_L2SIZE * sizeof(int), M_VMPMAP, M_WAITOK); -} - -static __inline void -pt23_free(pt) - int *pt; -{ - free(pt, M_VMPMAP); -} - -#endif /* !UVM */ #endif /* SUN4M */ /* @@ -885,13 +852,8 @@ pmap_page_upload(first_pa) if (start >= end) continue; -#if defined(UVM) uvm_page_physload(atop(start), atop(end), atop(start), atop(end), VM_FREELIST_DEFAULT); -#else - vm_page_physload(atop(start), atop(end), - atop(start), atop(end)); -#endif } } @@ -2007,17 +1969,9 @@ pv_changepte4_4c(pv0, bis, bic) * Bizarreness: we never clear PG_W on * pager pages, nor PG_NC on DVMA pages. */ -#if defined(UVM) if (bic == PG_W && va >= uvm.pager_sva && va < uvm.pager_eva) continue; -#else - extern vaddr_t pager_sva, pager_eva; - - if (bic == PG_W && - va >= pager_sva && va < pager_eva) - continue; -#endif if (bic == PG_NC && va >= DVMA_BASE && va < DVMA_END) continue; @@ -2327,17 +2281,9 @@ pv_changepte4m(pv0, bis, bic) * Bizarreness: we never clear PG_W on * pager pages, nor set PG_C on DVMA pages. */ -#if defined(UVM) if ((bic & PPROT_WRITE) && va >= uvm.pager_sva && va < uvm.pager_eva) continue; -#else - extern vaddr_t pager_sva, pager_eva; - - if ((bic & PPROT_WRITE) && - va >= pager_sva && va < pager_eva) - continue; -#endif if ((bis & SRMMU_PG_C) && va >= DVMA_BASE && va < DVMA_END) continue; @@ -2682,13 +2628,8 @@ pmap_bootstrap(nctx, nregion, nsegment) int nsegment, nctx, nregion; { -#if defined(UVM) uvmexp.pagesize = NBPG; uvm_setpagesize(); -#else - cnt.v_page_size = NBPG; - vm_set_page_size(); -#endif #if defined(SUN4) && (defined(SUN4C) || defined(SUN4M)) /* In this case NPTESG is not a #define */ @@ -3462,11 +3403,7 @@ pmap_init() size = npages * sizeof(struct pvlist); size = round_page(size); -#if defined(UVM) addr = uvm_km_zalloc(kernel_map, size); -#else - addr = kmem_alloc(kernel_map, size); -#endif if (addr == 0) panic("pmap_init: no memory for pv_list"); @@ -3482,7 +3419,7 @@ pmap_init() */ pmap_initialized = 1; -#if defined(SUN4M) && defined(UVM) +#if defined(SUN4M) if (CPU_ISSUN4M) { /* * The SRMMU only ever needs chunks in one of two sizes: diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c index 8ddbafa01e9..157d578dbc8 100644 --- a/sys/arch/sparc/sparc/trap.c +++ b/sys/arch/sparc/sparc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.28 2001/05/05 20:56:53 art Exp $ */ +/* $OpenBSD: trap.c,v 1.29 2001/05/10 10:34:49 art Exp $ */ /* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */ /* @@ -290,11 +290,7 @@ trap(type, psr, pc, tf) /* This steps the PC over the trap. */ #define ADVANCE (n = tf->tf_npc, tf->tf_pc = n, tf->tf_npc = n + 4) -#if defined(UVM) uvmexp.traps++; -#else - cnt.v_trap++; -#endif /* * Generally, kernel traps cause a panic. Any exceptions are * handled early here. @@ -667,11 +663,7 @@ mem_access_fault(type, ser, v, pc, psr, tf) u_quad_t sticks; union sigval sv; -#if defined(UVM) uvmexp.traps++; -#else - cnt.v_trap++; -#endif if ((p = curproc) == NULL) /* safety check */ p = &proc0; sticks = p->p_sticks; @@ -715,13 +707,8 @@ mem_access_fault(type, ser, v, pc, psr, tf) if (cold) goto kfault; if (va >= KERNBASE) { -#if defined(UVM) if (uvm_fault(kernel_map, va, 0, ftype) == KERN_SUCCESS) return; -#else - if (vm_fault(kernel_map, va, ftype, 0) == KERN_SUCCESS) - return; -#endif goto kfault; } } else @@ -741,11 +728,7 @@ mem_access_fault(type, ser, v, pc, psr, tf) goto out; /* alas! must call the horrible vm code */ -#if defined(UVM) rv = uvm_fault(&vm->vm_map, (vaddr_t)va, 0, ftype); -#else - rv = vm_fault(&vm->vm_map, (vaddr_t)va, ftype, FALSE); -#endif /* * If this was a stack access we keep track of the maximum @@ -830,11 +813,7 @@ mem_access_fault4m(type, sfsr, sfva, tf) u_quad_t sticks; union sigval sv; -#if defined(UVM) uvmexp.traps++; -#else - cnt.v_trap++; -#endif if ((p = curproc) == NULL) /* safety check */ p = &proc0; sticks = p->p_sticks; @@ -968,13 +947,8 @@ mem_access_fault4m(type, sfsr, sfva, tf) if (cold) goto kfault; if (va >= KERNBASE) { -#if defined(UVM) if (uvm_fault(kernel_map, va, 0, ftype) == KERN_SUCCESS) return; -#else - if (vm_fault(kernel_map, va, ftype, 0) == KERN_SUCCESS) - return; -#endif goto kfault; } } else @@ -983,11 +957,7 @@ mem_access_fault4m(type, sfsr, sfva, tf) vm = p->p_vmspace; /* alas! must call the horrible vm code */ -#if defined(UVM) rv = uvm_fault(&vm->vm_map, (vaddr_t)va, 0, ftype); -#else - rv = vm_fault(&vm->vm_map, (vaddr_t)va, ftype, FALSE); -#endif /* * If this was a stack access we keep track of the maximum * accessed stack size. Also, if vm_fault gets a protection @@ -1064,11 +1034,7 @@ syscall(code, tf, pc) extern struct pcb *cpcb; #endif -#if defined(UVM) uvmexp.syscalls++; -#else - cnt.v_syscall++; -#endif p = curproc; #ifdef DIAGNOSTIC if (tf->tf_psr & PSR_PS) diff --git a/sys/arch/sparc/sparc/vm_machdep.c b/sys/arch/sparc/sparc/vm_machdep.c index 19c508e4e47..10acb8d53b7 100644 --- a/sys/arch/sparc/sparc/vm_machdep.c +++ b/sys/arch/sparc/sparc/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.23 2001/05/05 20:56:53 art Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.24 2001/05/10 10:34:50 art Exp $ */ /* $NetBSD: vm_machdep.c,v 1.30 1997/03/10 23:55:40 pk Exp $ */ /* @@ -312,7 +312,6 @@ vmapbuf(bp, sz) uva = trunc_page((vaddr_t)bp->b_data); off = (vaddr_t)bp->b_data - uva; size = round_page(off + sz); -#if defined(UVM) /* * Note that this is an expanded version of: * kva = uvm_km_valloc_wait(kernel_map, size); @@ -327,9 +326,6 @@ vmapbuf(bp, sz) break; tsleep(kernel_map, PVM, "vallocwait", 0); } -#else - kva = kmem_alloc_wait(kernel_map, size); -#endif bp->b_data = (caddr_t)(kva + off); while (size > 0) { @@ -378,11 +374,7 @@ vunmapbuf(bp, sz) off = (vaddr_t)bp->b_data - kva; size = round_page(sz + off); -#if defined(UVM) uvm_km_free_wakeup(kernel_map, kva, size); -#else - kmem_free_wakeup(kernel_map, kva, size); -#endif bp->b_data = bp->b_saveaddr; bp->b_saveaddr = NULL; if (CACHEINFO.c_vactype != VAC_NONE) |