Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src completely remove Mach VM support. all that is left is the ...
details: https://anonhg.NetBSD.org/src/rev/a0fae0ac4a21
branches: trunk
changeset: 467393:a0fae0ac4a21
user: mrg <mrg%NetBSD.org@localhost>
date: Wed Mar 24 05:50:49 1999 +0000
description:
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
diffstat:
bin/ps/Makefile | 5 +-
lib/libkvm/Makefile | 5 +-
lib/libkvm/kvm_proc.c | 201 +-
libexec/rpc.rstatd/Makefile | 5 +-
libexec/rpc.rstatd/rstat_proc.c | 30 +-
sys/arch/alpha/alpha/interrupt.c | 16 +-
sys/arch/alpha/alpha/locore.s | 7 +-
sys/arch/alpha/alpha/machdep.c | 81 +-
sys/arch/alpha/alpha/mem.c | 15 +-
sys/arch/alpha/alpha/pmap.c | 24 +-
sys/arch/alpha/alpha/trap.c | 30 +-
sys/arch/alpha/alpha/vm_machdep.c | 17 +-
sys/arch/alpha/common/bus_dma.c | 25 +-
sys/arch/alpha/isa/fd.c | 6 +-
sys/arch/amiga/amiga/locore.s | 31 +-
sys/arch/amiga/amiga/machdep.c | 72 +-
sys/arch/amiga/amiga/mem.c | 13 +-
sys/arch/amiga/amiga/pmap.c | 152 +-
sys/arch/amiga/amiga/trap.c | 34 +-
sys/arch/amiga/amiga/vm_machdep.c | 18 +-
sys/arch/amiga/dev/grf_cc.c | 7 +-
sys/arch/arm32/arm32/ast.c | 12 +-
sys/arch/arm32/arm32/bcopyinout.S | 6 +-
sys/arch/arm32/arm32/bus_dma.c | 22 +-
sys/arch/arm32/arm32/db_machdep.c | 40 +-
sys/arch/arm32/arm32/fault.c | 17 +-
sys/arch/arm32/arm32/intr.c | 9 +-
sys/arch/arm32/arm32/machdep.c | 62 +-
sys/arch/arm32/arm32/mem.c | 12 +-
sys/arch/arm32/arm32/pmap.c | 91 +-
sys/arch/arm32/arm32/syscall.c | 9 +-
sys/arch/arm32/arm32/undefined.c | 10 +-
sys/arch/arm32/arm32/vm_machdep.c | 17 +-
sys/arch/arm32/dev/md_hooks.c | 9 +-
sys/arch/arm32/footbridge/footbridge_irq.S | 9 +-
sys/arch/arm32/footbridge/footbridge_machdep.c | 8 +-
sys/arch/arm32/iomd/iomd_irq.S | 7 +-
sys/arch/arm32/isa/isa_irq.S | 7 +-
sys/arch/arm32/ofw/ofw.c | 9 +-
sys/arch/arm32/ofw/ofw_irq.S | 7 +-
sys/arch/arm32/podulebus/esc.c | 12 +-
sys/arch/arm32/podulebus/sfas.c | 13 +-
sys/arch/arm32/vidc/beep.c | 10 +-
sys/arch/arm32/vidc/console/vidcconsole.c | 10 +-
sys/arch/arm32/vidc/lmcaudio.c | 10 +-
sys/arch/arm32/vidc/vidcaudio.c | 10 +-
sys/arch/atari/atari/bus.c | 29 +-
sys/arch/atari/atari/intr.c | 10 +-
sys/arch/atari/atari/locore.s | 38 +-
sys/arch/atari/atari/machdep.c | 85 +-
sys/arch/atari/atari/mem.c | 13 +-
sys/arch/atari/atari/pmap.c | 134 +-
sys/arch/atari/atari/trap.c | 34 +-
sys/arch/atari/atari/vm_machdep.c | 19 +-
sys/arch/atari/dev/hdfd_intr.s | 11 +-
sys/arch/bebox/bebox/bus_dma.c | 23 +-
sys/arch/bebox/bebox/machdep.c | 71 +-
sys/arch/hp300/dev/grf.c | 17 +-
sys/arch/hp300/hp300/hpux_machdep.c | 6 +-
sys/arch/hp300/hp300/intr.c | 10 +-
sys/arch/hp300/hp300/locore.s | 19 +-
sys/arch/hp300/hp300/machdep.c | 79 +-
sys/arch/hp300/hp300/mem.c | 13 +-
sys/arch/hp300/hp300/pmap.c | 158 +-
sys/arch/hp300/hp300/trap.c | 43 +-
sys/arch/hp300/hp300/vm_machdep.c | 18 +-
sys/arch/i386/i386/gdt.c | 22 +-
sys/arch/i386/i386/locore.s | 18 +-
sys/arch/i386/i386/machdep.c | 89 +-
sys/arch/i386/i386/mem.c | 17 +-
sys/arch/i386/i386/pmap.c | 50 +-
sys/arch/i386/i386/sys_machdep.c | 20 +-
sys/arch/i386/i386/trap.c | 41 +-
sys/arch/i386/i386/vm_machdep.c | 31 +-
sys/arch/i386/isa/fd.c | 6 +-
sys/arch/i386/isa/npx.c | 11 +-
sys/arch/i386/isa/vector.s | 7 +-
sys/arch/m68k/m68k/copy.s | 6 +-
sys/arch/mac68k/dev/grf.c | 18 +-
sys/arch/mac68k/mac68k/bus_space.c | 14 +-
sys/arch/mac68k/mac68k/intr.c | 10 +-
sys/arch/mac68k/mac68k/locore.s | 23 +-
sys/arch/mac68k/mac68k/machdep.c | 74 +-
sys/arch/mac68k/mac68k/mem.c | 13 +-
sys/arch/mac68k/mac68k/pmap.c | 160 +-
sys/arch/mac68k/mac68k/trap.c | 51 +-
sys/arch/mac68k/mac68k/vm_machdep.c | 18 +-
sys/arch/macppc/dev/ofb.c | 9 +-
sys/arch/macppc/macppc/bus_dma.c | 23 +-
sys/arch/macppc/macppc/clock.c | 7 +-
sys/arch/macppc/macppc/extintr.c | 4 +-
sys/arch/macppc/macppc/machdep.c | 62 +-
sys/arch/mips/mips/locore.S | 13 +-
sys/arch/mips/mips/mem.c | 11 +-
sys/arch/mips/mips/mips_machdep.c | 10 +-
sys/arch/mips/mips/pmap.c | 58 +-
sys/arch/mips/mips/trap.c | 65 +-
sys/arch/mips/mips/vm_machdep.c | 20 +-
sys/arch/mvme68k/mvme68k/isr.c | 14 +-
sys/arch/mvme68k/mvme68k/locore.s | 12 +-
sys/arch/mvme68k/mvme68k/machdep.c | 82 +-
sys/arch/mvme68k/mvme68k/mem.c | 13 +-
sys/arch/mvme68k/mvme68k/pmap.c | 159 +-
sys/arch/mvme68k/mvme68k/trap.c | 39 +-
sys/arch/mvme68k/mvme68k/vm_machdep.c | 25 +-
sys/arch/newsmips/newsmips/machdep.c | 64 +-
sys/arch/next68k/dev/bus_dma.c | 24 +-
sys/arch/next68k/next68k/isr.c | 14 +-
sys/arch/next68k/next68k/locore.s | 12 +-
sys/arch/next68k/next68k/machdep.c | 82 +-
sys/arch/next68k/next68k/mem.c | 13 +-
sys/arch/next68k/next68k/pmap.c | 164 +-
sys/arch/next68k/next68k/trap.c | 39 +-
sys/arch/next68k/next68k/vm_machdep.c | 25 +-
sys/arch/ofppc/ofppc/machdep.c | 56 +-
sys/arch/pc532/pc532/intr.c | 11 +-
sys/arch/pc532/pc532/locore.s | 9 +-
sys/arch/pc532/pc532/machdep.c | 72 +-
sys/arch/pc532/pc532/mem.c | 17 +-
sys/arch/pc532/pc532/pmap.c | 51 +-
sys/arch/pc532/pc532/trap.c | 35 +-
sys/arch/pc532/pc532/vm_machdep.c | 23 +-
sys/arch/pmax/dev/qvss_compat.c | 14 +-
sys/arch/pmax/pmax/bus_dma.c | 23 +-
sys/arch/pmax/pmax/machdep.c | 71 +-
sys/arch/powerpc/powerpc/pmap.c | 32 +-
sys/arch/powerpc/powerpc/trap.c | 36 +-
sys/arch/powerpc/powerpc/vm_machdep.c | 14 +-
sys/arch/sparc/dev/bt_subr.c | 20 +-
sys/arch/sparc/dev/cgfourteen.c | 24 +-
sys/arch/sparc/dev/cgsix.c | 10 +-
sys/arch/sparc/dev/fd.c | 6 +-
sys/arch/sparc/sparc/amd7930intr.s | 11 +-
sys/arch/sparc/sparc/bsd_fdintr.s | 11 +-
sys/arch/sparc/sparc/cpu.c | 10 +-
sys/arch/sparc/sparc/iommu.c | 9 +-
sys/arch/sparc/sparc/locore.s | 39 +-
sys/arch/sparc/sparc/machdep.c | 86 +-
sys/arch/sparc/sparc/mem.c | 10 +-
sys/arch/sparc/sparc/pmap.c | 63 +-
sys/arch/sparc/sparc/trap.c | 48 +-
sys/arch/sparc/sparc/vm_machdep.c | 12 +-
sys/arch/sparc64/dev/bt_subr.c | 11 +-
sys/arch/sparc64/dev/cgsix.c | 10 +-
sys/arch/sparc64/sparc64/genassym.c | 9 +-
sys/arch/sparc64/sparc64/locore.s | 21 +-
sys/arch/sparc64/sparc64/machdep.c | 108 +-
sys/arch/sparc64/sparc64/mem.c | 10 +-
sys/arch/sparc64/sparc64/pmap.c | 137 +-
sys/arch/sparc64/sparc64/trap.c | 68 +-
sys/arch/sparc64/sparc64/vm_machdep.c | 12 +-
sys/arch/sun3/sun3/bus_subr.c | 13 +-
sys/arch/sun3/sun3/dvma.c | 21 +-
sys/arch/sun3/sun3/intreg.c | 11 +-
sys/arch/sun3/sun3/isr.c | 14 +-
sys/arch/sun3/sun3/locore.s | 3 +-
sys/arch/sun3/sun3/machdep.c | 69 +-
sys/arch/sun3/sun3/mem.c | 12 +-
sys/arch/sun3/sun3/pmap.c | 33 +-
sys/arch/sun3/sun3/trap.c | 18 +-
sys/arch/sun3/sun3/vm_machdep.c | 17 +-
sys/arch/sun3/sun3x/bus_subr.c | 13 +-
sys/arch/sun3/sun3x/dvma.c | 13 +-
sys/arch/sun3/sun3x/locore.s | 3 +-
sys/arch/sun3/sun3x/machdep.c | 69 +-
sys/arch/sun3/sun3x/mem.c | 12 +-
sys/arch/sun3/sun3x/pmap.c | 20 +-
sys/arch/vax/bi/kdb.c | 8 +-
sys/arch/vax/include/pmap.h | 6 +-
sys/arch/vax/vax/bus_mem.c | 10 +-
sys/arch/vax/vax/disksubr.c | 8 +-
sys/arch/vax/vax/machdep.c | 48 +-
sys/arch/vax/vax/mem.c | 6 +-
sys/arch/vax/vax/pmap.c | 38 +-
sys/arch/vax/vax/trap.c | 19 +-
sys/arch/vax/vax/vm_machdep.c | 15 +-
sys/arch/x68k/dev/fd.c | 6 +-
sys/arch/x68k/dev/grf.c | 17 +-
sys/arch/x68k/x68k/bus.c | 24 +-
sys/arch/x68k/x68k/locore.s | 47 +-
sys/arch/x68k/x68k/machdep.c | 68 +-
sys/arch/x68k/x68k/mem.c | 13 +-
sys/arch/x68k/x68k/pmap.c | 159 +-
sys/arch/x68k/x68k/trap.c | 51 +-
sys/arch/x68k/x68k/vm_machdep.c | 18 +-
sys/compat/common/kern_info_43.c | 15 +-
sys/compat/linux/arch/alpha/linux_machdep.c | 6 +-
sys/compat/netbsd32/netbsd32_netbsd.c | 18 +-
sys/compat/sparc32/sparc32_netbsd.c | 18 +-
sys/compat/svr4/svr4_misc.c | 23 +-
sys/compat/vax1k/vax1k_subr.c | 18 +-
sys/ddb/db_command.c | 17 +-
sys/dev/ic/pdqvar.h | 11 +-
sys/dev/ic/rrunner.c | 41 +-
sys/dev/md.c | 7 +-
sys/dev/pci/tga.c | 9 +-
sys/dev/pci/tga_bt463.c | 18 +-
sys/dev/pci/tga_bt485.c | 24 +-
sys/dev/tc/cfb.c | 30 +-
sys/dev/tc/mfb.c | 12 +-
sys/dev/tc/sfb.c | 30 +-
sys/dev/tc/tfb.c | 30 +-
sys/dev/tc/xcfb.c | 30 +-
sys/kern/exec_subr.c | 42 +-
sys/kern/init_main.c | 42 +-
sys/kern/kern_descrip.c | 9 +-
sys/kern/kern_exec.c | 30 +-
sys/kern/kern_exit.c | 15 +-
sys/kern/kern_fork.c | 21 +-
sys/kern/kern_fthread.c | 28 +-
sys/kern/kern_lkm.c | 25 +-
sys/kern/kern_malloc.c | 40 +-
sys/kern/kern_physio.c | 22 +-
sys/kern/kern_resource.c | 11 +-
sys/kern/kern_sig.c | 11 +-
sys/kern/kern_subr.c | 10 +-
sys/kern/kern_synch.c | 13 +-
sys/kern/kern_sysctl.c | 29 +-
sys/kern/subr_pool.c | 23 +-
sys/kern/sys_process.c | 6 +-
sys/kern/sysv_shm.c | 68 +-
sys/kern/uipc_mbuf.c | 14 +-
sys/kern/vfs_subr.c | 12 +-
sys/kern/vfs_syscalls.c | 20 +-
sys/kern/vfs_vnops.c | 10 +-
sys/miscfs/kernfs/kernfs_vnops.c | 13 +-
sys/miscfs/procfs/procfs.h | 10 +-
sys/miscfs/procfs/procfs_cmdline.c | 29 +-
sys/miscfs/procfs/procfs_map.c | 25 +-
sys/miscfs/procfs/procfs_mem.c | 156 +-
sys/miscfs/union/union_subr.c | 15 +-
sys/msdosfs/msdosfs_denode.c | 16 +-
sys/msdosfs/msdosfs_vnops.c | 16 +-
sys/nfs/nfs_bio.c | 14 +-
sys/nfs/nfs_serv.c | 19 +-
sys/nfs/nfs_subs.c | 13 +-
sys/nfs/nfs_vnops.c | 30 +-
sys/sys/buf.h | 12 +-
sys/sys/lock.h | 7 +-
sys/sys/proc.h | 17 +-
sys/sys/swap.h | 12 +-
sys/sys/systm.h | 12 +-
sys/sys/vmmeter.h | 68 +-
sys/sys/vnode.h | 16 +-
sys/ufs/ext2fs/ext2fs_inode.c | 23 +-
sys/ufs/ext2fs/ext2fs_readwrite.c | 17 +-
sys/ufs/ext2fs/ext2fs_vnops.c | 13 +-
sys/ufs/ffs/ffs_alloc.c | 9 +-
sys/ufs/ffs/ffs_balloc.c | 9 +-
sys/ufs/ffs/ffs_inode.c | 18 +-
sys/ufs/ffs/ffs_vnops.c | 8 +-
sys/ufs/lfs/lfs_alloc.c | 8 +-
sys/ufs/lfs/lfs_balloc.c | 10 +-
sys/ufs/lfs/lfs_inode.c | 10 +-
sys/ufs/ufs/ufs_readwrite.c | 14 +-
sys/ufs/ufs/ufs_vnops.c | 9 +-
sys/vm/TODO | 119 -
sys/vm/device_pager.c | 377 ---
sys/vm/swap_pager.c | 1273 ----------
sys/vm/vm.h | 17 +-
sys/vm/vm_extern.h | 80 +-
sys/vm/vm_fault.c | 1046 --------
sys/vm/vm_glue.c | 519 ----
sys/vm/vm_init.c | 108 -
sys/vm/vm_kern.c | 535 ----
sys/vm/vm_kern.h | 15 +-
sys/vm/vm_map.c | 2816 ------------------------
sys/vm/vm_map.h | 64 +-
sys/vm/vm_meter.c | 237 --
sys/vm/vm_mmap.c | 1031 --------
sys/vm/vm_object.c | 1854 ---------------
sys/vm/vm_page.c | 1471 ------------
sys/vm/vm_page.h | 60 +-
sys/vm/vm_pageout.c | 607 -----
sys/vm/vm_pageout.h | 35 +-
sys/vm/vm_pager.c | 436 ---
sys/vm/vm_param.h | 30 +-
sys/vm/vm_swap.c | 1252 ----------
sys/vm/vm_unix.c | 247 --
sys/vm/vm_user.c | 339 --
sys/vm/vnode_pager.c | 721 ------
usr.bin/fstat/Makefile | 5 +-
usr.bin/systat/Makefile | 5 +-
usr.bin/systat/vmstat.c | 115 +-
usr.bin/top/Makefile | 4 +-
usr.bin/vmstat/Makefile | 5 +-
usr.bin/vmstat/vmstat.c | 120 +-
usr.bin/w/Makefile | 5 +-
288 files changed, 518 insertions(+), 22461 deletions(-)
diffs (truncated from 37732 to 300 lines):
diff -r 43f63e11a8f0 -r a0fae0ac4a21 bin/ps/Makefile
--- a/bin/ps/Makefile Wed Mar 24 05:32:23 1999 +0000
+++ b/bin/ps/Makefile Wed Mar 24 05:50:49 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 1998/08/25 15:13:16 tv Exp $
+# $NetBSD: Makefile,v 1.24 1999/03/24 05:50:49 mrg Exp $
# @(#)Makefile 8.1 (Berkeley) 6/2/93
PROG= ps
@@ -13,9 +13,6 @@
.include <bsd.prog.mk>
# XXX
-.if defined(UVM)
-CPPFLAGS+= -DUVM
-.endif
.if defined(PMAP_NEW)
CPPFLAGS+= -DPMAP_NEW
.endif
diff -r 43f63e11a8f0 -r a0fae0ac4a21 lib/libkvm/Makefile
--- a/lib/libkvm/Makefile Wed Mar 24 05:32:23 1999 +0000
+++ b/lib/libkvm/Makefile Wed Mar 24 05:50:49 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 1999/02/24 15:10:16 drochner Exp $
+# $NetBSD: Makefile,v 1.29 1999/03/24 05:50:50 mrg Exp $
# from: @(#)Makefile 8.1 (Berkeley) 6/4/93
LIB= kvm
@@ -34,9 +34,6 @@
.include <bsd.lib.mk>
# XXX
-.if defined(UVM)
-CPPFLAGS+= -DUVM
-.endif
.if defined(PMAP_NEW)
CPPFLAGS+= -DPMAP_NEW
.endif
diff -r 43f63e11a8f0 -r a0fae0ac4a21 lib/libkvm/kvm_proc.c
--- a/lib/libkvm/kvm_proc.c Wed Mar 24 05:32:23 1999 +0000
+++ b/lib/libkvm/kvm_proc.c Wed Mar 24 05:50:49 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kvm_proc.c,v 1.29 1999/01/25 03:38:57 mrg Exp $ */
+/* $NetBSD: kvm_proc.c,v 1.30 1999/03/24 05:50:50 mrg Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
#if 0
static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
#else
-__RCSID("$NetBSD: kvm_proc.c,v 1.29 1999/01/25 03:38:57 mrg Exp $");
+__RCSID("$NetBSD: kvm_proc.c,v 1.30 1999/03/24 05:50:50 mrg Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -104,12 +104,9 @@
#include <vm/vm.h>
#include <vm/vm_param.h>
-#include <vm/swap_pager.h>
-#if defined(UVM)
#include <uvm/uvm_extern.h>
#include <uvm/uvm_amap.h>
-#endif
#include <sys/sysctl.h>
@@ -123,11 +120,6 @@
(kvm_read(kd, addr, (void *)(obj), sizeof(*obj)) != sizeof(*obj))
char *_kvm_uread __P((kvm_t *, const struct proc *, u_long, u_long *));
-#if !defined(UVM)
-int _kvm_coreinit __P((kvm_t *));
-int _kvm_readfromcore __P((kvm_t *, u_long, u_long));
-int _kvm_readfrompager __P((kvm_t *, struct vm_object *, u_long));
-#endif
ssize_t kvm_uread __P((kvm_t *, const struct proc *, u_long, char *,
size_t));
@@ -154,15 +146,10 @@
u_long addr, head;
u_long offset;
struct vm_map_entry vme;
-#if defined(UVM)
struct vm_amap amap;
struct vm_anon *anonp, anon;
struct vm_page pg;
u_long slot;
-#else
- struct vm_object vmo;
- int rv;
-#endif
if (kd->swapspc == 0) {
kd->swapspc = (char *)_kvm_malloc(kd, (size_t)kd->nbpg);
@@ -181,23 +168,15 @@
if (KREAD(kd, addr, &vme))
return (0);
-#if defined(UVM)
if (va >= vme.start && va < vme.end &&
vme.aref.ar_amap != NULL)
break;
-#else
- if (va >= vme.start && va < vme.end &&
- vme.object.vm_object != 0)
- break;
-#endif
-
addr = (u_long)vme.next;
if (addr == head)
return (0);
}
-#if defined(UVM)
/*
* we found the map entry, now to find the object...
@@ -237,36 +216,6 @@
(off_t)(anon.an_swslot * kd->nbpg)) != kd->nbpg)
return NULL;
}
-#else
- /*
- * We found the right object -- follow shadow links.
- */
- offset = va - vme.start + vme.offset;
- addr = (u_long)vme.object.vm_object;
-
- while (1) {
- /* Try reading the page from core first. */
- if ((rv = _kvm_readfromcore(kd, addr, offset)))
- break;
-
- if (KREAD(kd, addr, &vmo))
- return (0);
-
- /* If there is a pager here, see if it has the page. */
- if (vmo.pager != 0 &&
- (rv = _kvm_readfrompager(kd, &vmo, offset)))
- break;
-
- /* Move down the shadow chain. */
- addr = (u_long)vmo.shadow;
- if (addr == 0)
- return (0);
- offset += vmo.shadow_offset;
- }
-
- if (rv == -1)
- return (0);
-#endif
/* Found the page. */
offset %= kd->nbpg;
@@ -274,152 +223,6 @@
return (&kd->swapspc[(size_t)offset]);
}
-#if !defined(UVM)
-
-#define vm_page_hash(kd, object, offset) \
- (((u_long)object + (u_long)(offset / kd->nbpg)) & kd->vm_page_hash_mask)
-
-int
-_kvm_coreinit(kd)
- kvm_t *kd;
-{
- struct nlist nlist[3];
-
- nlist[0].n_name = "_vm_page_buckets";
- nlist[1].n_name = "_vm_page_hash_mask";
- nlist[2].n_name = 0;
- if (kvm_nlist(kd, nlist) != 0)
- return (-1);
-
- if (KREAD(kd, nlist[0].n_value, &kd->vm_page_buckets) ||
- KREAD(kd, nlist[1].n_value, &kd->vm_page_hash_mask))
- return (-1);
-
- return (0);
-}
-
-int
-_kvm_readfromcore(kd, object, offset)
- kvm_t *kd;
- u_long object, offset;
-{
- u_long addr;
- struct pglist bucket;
- struct vm_page mem;
- off_t seekpoint;
-
- if (kd->vm_page_buckets == 0 &&
- _kvm_coreinit(kd))
- return (-1);
-
- addr = (u_long)&kd->vm_page_buckets[vm_page_hash(kd, object, offset)];
- if (KREAD(kd, addr, &bucket))
- return (-1);
-
- addr = (u_long)bucket.tqh_first;
- offset &= ~(kd->nbpg -1);
- while (1) {
- if (addr == 0)
- return (0);
-
- if (KREAD(kd, addr, &mem))
- return (-1);
-
- if ((u_long)mem.object == object &&
- (u_long)mem.offset == offset)
- break;
-
- addr = (u_long)mem.hashq.tqe_next;
- }
-
- seekpoint = mem.phys_addr;
-
- if (pread(kd->pmfd, kd->swapspc, kd->nbpg, seekpoint) != kd->nbpg)
- return (-1);
-
- return (1);
-}
-
-int
-_kvm_readfrompager(kd, vmop, offset)
- kvm_t *kd;
- struct vm_object *vmop;
- u_long offset;
-{
- u_long addr;
- struct pager_struct pager;
- struct swpager swap;
- int ix;
- struct swblock swb;
- off_t seekpoint;
-
- /* Read in the pager info and make sure it's a swap device. */
- addr = (u_long)vmop->pager;
- if (KREAD(kd, addr, &pager) || pager.pg_type != PG_SWAP)
- return (-1);
-
- /* Read in the swap_pager private data. */
- addr = (u_long)pager.pg_data;
- if (KREAD(kd, addr, &swap))
- return (-1);
-
- /*
- * Calculate the paging offset, and make sure it's within the
- * bounds of the pager.
- */
- offset += vmop->paging_offset;
- ix = offset / dbtob(swap.sw_bsize);
-#if 0
- if (swap.sw_blocks == 0 || ix >= swap.sw_nblocks)
- return (-1);
-#else
- if (swap.sw_blocks == 0 || ix >= swap.sw_nblocks) {
- int i;
- printf("BUG BUG BUG BUG:\n");
- printf("object %p offset %lx pgoffset %lx ",
- vmop, offset - vmop->paging_offset,
- (u_long)vmop->paging_offset);
- printf("pager %p swpager %p\n",
- vmop->pager, pager.pg_data);
- printf("osize %lx bsize %x blocks %p nblocks %x\n",
- (u_long)swap.sw_osize, swap.sw_bsize, swap.sw_blocks,
- swap.sw_nblocks);
- for (i = 0; i < swap.sw_nblocks; i++) {
- addr = (u_long)&swap.sw_blocks[i];
- if (KREAD(kd, addr, &swb))
- return (0);
- printf("sw_blocks[%d]: block %x mask %x\n", i,
- swb.swb_block, swb.swb_mask);
- }
- return (-1);
- }
-#endif
-
- /* Read in the swap records. */
- addr = (u_long)&swap.sw_blocks[ix];
- if (KREAD(kd, addr, &swb))
- return (-1);
-
- /* Calculate offset within pager. */
- offset %= dbtob(swap.sw_bsize);
-
- /* Check that the page is actually present. */
- if ((swb.swb_mask & (1 << (offset / kd->nbpg))) == 0)
- return (0);
-
- if (!ISALIVE(kd))
- return (-1);
-
- /* Calculate the physical address and read the page. */
- seekpoint = dbtob(swb.swb_block) + (offset & ~(kd->nbpg -1));
Home |
Main Index |
Thread Index |
Old Index