Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PAE] Initial patches for kvm(3) support



Hi lists,

Following my previous mail for virtual memory macro rework (see
current-users@ about 5 min ago), this one asks for a review regarding a
kvm(3) patch for PAE support (see attached).

This ones is heavier, but is mostly mechanical.

Two private kvm(3) functions, namely _kvm_kvatop() and _kvm_pa2off(),
manipulates virtual and physical addresses as u_long entities. While
this is true in most of the cases, PAE is one exception as paddr_t is 64
bits while u_long is 32. As such, I had to alter the prototypes:

-int     _kvm_kvatop __P((kvm_t *, u_long, u_long *));
-off_t   _kvm_pa2off __P((kvm_t *, u_long));
+int     _kvm_kvatop(kvm_t *, vaddr_t, paddr_t *);
+off_t   _kvm_pa2off(kvm_t *, paddr_t);

Although these are private functions, they affect all architectures
supported by NetBSD. Add to the fact that kvm code mixes pre-ANSI and
ANSIfied declarations (KNF), the patch is bigger than expected (I
deliberatly ANSIfied most of the code -- if not needed, I won't commit
this part). But I suppose __P() can go, nevertheless.

After some quick testing, and code reading, I expect that core files
made before this change will still be usable with the "new" libkvm code.
I do not see how kvatop and pa2off could modify the core's content, and
the metadata extracted at savecore(8) time does not depend on them.

The patch was rapidly tested for i386 and amd64 (anita-like + ps -M
stuff), and only compile tested for all other arches. If no one raises
concerns, I will make further tests and commit it eventually.

Opinions?

PAE support for kvm(3) shall follow. Please note that KNF-type cleanup,
in the case it gets committed, will be separated from the prototype rework.

-- 
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost
Index: lib/libkvm/kvm.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm.c,v
retrieving revision 1.94
diff -u -p -r1.94 kvm.c
--- lib/libkvm/kvm.c    14 Sep 2009 19:29:20 -0000      1.94
+++ lib/libkvm/kvm.c    6 Sep 2010 17:39:18 -0000
@@ -54,6 +54,7 @@ __RCSID("$NetBSD: kvm.c,v 1.94 2009/09/1
 #include <sys/exec.h>
 #include <sys/kcore.h>
 #include <sys/ksyms.h>
+#include <sys/types.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -798,7 +799,7 @@ int
 kvm_dump_inval(kvm_t *kd)
 {
        struct nlist    nl[2];
-       u_long          pa;
+       paddr_t         pa;
        size_t          dsize;
        off_t           doff;
        void            *newbuf;
@@ -814,7 +815,7 @@ kvm_dump_inval(kvm_t *kd)
                _kvm_err(kd, 0, "bad namelist");
                return (-1);
        }
-       if (_kvm_kvatop(kd, (u_long)nl[0].n_value, &pa) == 0)
+       if (_kvm_kvatop(kd, nl[0].n_value, &pa) == 0)
                return (-1);
 
        errno = 0;
@@ -868,7 +869,7 @@ kvm_read(kvm_t *kd, u_long kva, void *bu
                }
                cp = buf;
                while (len > 0) {
-                       u_long  pa;
+                       paddr_t pa;
                        off_t   foff;
 
                        cc = _kvm_kvatop(kd, kva, &pa);
Index: lib/libkvm/kvm_alpha.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_alpha.c,v
retrieving revision 1.23
diff -u -p -r1.23 kvm_alpha.c
--- lib/libkvm/kvm_alpha.c      15 Jan 2008 13:57:41 -0000      1.23
+++ lib/libkvm/kvm_alpha.c      6 Sep 2010 17:39:18 -0000
@@ -34,12 +34,15 @@
 #include <sys/proc.h>
 #include <sys/stat.h>
 #include <sys/kcore.h>
-#include <machine/kcore.h>
+#include <sys/types.h>
+
 #include <unistd.h>
 #include <nlist.h>
 #include <kvm.h>
 
 #include <uvm/uvm_extern.h>
+
+#include <machine/kcore.h>
 #include <machine/pmap.h>
 #include <machine/vmparam.h>
 
@@ -51,25 +54,20 @@
 
 /*ARGSUSED*/
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
        return;
 }
 
 /*ARGSUSED*/
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
        return (0);
 }
 
 int
-_kvm_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        alpha_pt_entry_t pte;
@@ -156,9 +154,7 @@ lose:
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t *kd;
-       u_long pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        phys_ram_seg_t *ramsegs;
@@ -187,8 +183,7 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
 
        kd->usrstack = USRSTACK;
Index: lib/libkvm/kvm_arm.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_arm.c,v
retrieving revision 1.4
diff -u -p -r1.4 kvm_arm.c
--- lib/libkvm/kvm_arm.c        15 Jan 2008 13:57:42 -0000      1.4
+++ lib/libkvm/kvm_arm.c        6 Sep 2010 17:39:18 -0000
@@ -45,6 +45,8 @@ __RCSID("$NetBSD: kvm_arm.c,v 1.4 2008/0
 #include <sys/param.h>
 #include <sys/exec.h>
 #include <sys/kcore.h>
+#include <sys/types.h>
+
 #include <arm/kcore.h>
 #include <arm/arm32/pte.h>
 
@@ -71,12 +73,12 @@ _kvm_initvtop(kvm_t * kd)
 }
 
 int
-_kvm_kvatop(kvm_t * kd, u_long va, u_long * pa)
+_kvm_kvatop(kvm_t * kd, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        pd_entry_t      pde;
        pt_entry_t      pte;
-       uint32_t        pde_pa, pte_pa;
+       paddr_t         pde_pa, pte_pa;
 
        if (ISALIVE(kd)) {
                _kvm_err(kd, 0, "vatop called in live kernel!");
Index: lib/libkvm/kvm_file.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_file.c,v
retrieving revision 1.26
diff -u -p -r1.26 kvm_file.c
--- lib/libkvm/kvm_file.c       12 Mar 2008 05:57:28 -0000      1.26
+++ lib/libkvm/kvm_file.c       6 Sep 2010 17:39:18 -0000
@@ -76,17 +76,14 @@ __RCSID("$NetBSD: kvm_file.c,v 1.26 2008
        (kvm_read(kd, (u_long) addr, obj, sizeof(*obj)) != sizeof(*obj))
 
 static int
-kvm_deadfiles __P((kvm_t *, int, int, long, int));
+kvm_deadfiles(kvm_t *, int, int, long, int);
 
 /*
  * Get file structures.
  */
 /*ARGSUSED*/
 static int
-kvm_deadfiles(kd, op, arg, ofhead, numfiles)
-       kvm_t *kd;
-       int op, arg, numfiles;
-       long ofhead;
+kvm_deadfiles(kvm_t *kd, int op, int arg, long ofhead, int numfiles)
 {
        size_t buflen = kd->argspc_len, n = 0;
        struct file *fp;
@@ -128,10 +125,7 @@ kvm_deadfiles(kd, op, arg, ofhead, numfi
 }
 
 char *
-kvm_getfiles(kd, op, arg, cnt)
-       kvm_t *kd;
-       int op, arg;
-       int *cnt;
+kvm_getfiles(kvm_t *kd, int op, int arg, int *cnt)
 {
        size_t size;
        int mib[2], st;
Index: lib/libkvm/kvm_getloadavg.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_getloadavg.c,v
retrieving revision 1.8
diff -u -p -r1.8 kvm_getloadavg.c
--- lib/libkvm/kvm_getloadavg.c 7 Aug 2003 16:44:37 -0000       1.8
+++ lib/libkvm/kvm_getloadavg.c 6 Sep 2010 17:39:18 -0000
@@ -44,6 +44,8 @@ __RCSID("$NetBSD: kvm_getloadavg.c,v 1.8
 #include <sys/lwp.h>
 #include <sys/proc.h>
 #include <sys/sysctl.h>
+#include <sys/types.h>
+
 #include <uvm/uvm_param.h>
 
 #include <db.h>
@@ -70,10 +72,7 @@ static struct nlist nl[] = {
  * Return number of samples retrieved, or -1 on error.
  */
 int
-kvm_getloadavg(kd, loadavg, nelem)
-       kvm_t *kd;
-       double loadavg[];
-       int nelem;
+kvm_getloadavg(kvm_t *kd, double loadavg[], int nelem)
 {
        struct loadavg loadinfo;
        struct nlist *p;
Index: lib/libkvm/kvm_hppa.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_hppa.c,v
retrieving revision 1.5
diff -u -p -r1.5 kvm_hppa.c
--- lib/libkvm/kvm_hppa.c       24 Jun 2010 20:46:11 -0000      1.5
+++ lib/libkvm/kvm_hppa.c       6 Sep 2010 17:39:18 -0000
@@ -53,7 +53,10 @@ __RCSID("$NetBSD: kvm_hppa.c,v 1.5 2010/
 #include <sys/proc.h>
 #include <sys/stat.h>
 #include <sys/kcore.h>
+#include <sys/types.h>
+
 #include <machine/kcore.h>
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <nlist.h>
@@ -96,7 +99,7 @@ _kvm_initvtop(kvm_t *kd)
  * Translate a kernel virtual address to a physical address.
  */
 int
-_kvm_kvatop(kvm_t *kd, u_long va, u_long *pa)
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
 #if 0
        cpu_kcore_hdr_t *cpu_kh;
@@ -161,7 +164,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, u_long
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_pa2off(kvm_t *kd, u_long pa)
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
 #if 0
        cpu_kcore_hdr_t *cpu_kh;
Index: lib/libkvm/kvm_i386.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_i386.c,v
retrieving revision 1.26
diff -u -p -r1.26 kvm_i386.c
--- lib/libkvm/kvm_i386.c       25 Oct 2008 23:59:06 -0000      1.26
+++ lib/libkvm/kvm_i386.c       6 Sep 2010 17:39:18 -0000
@@ -50,7 +50,10 @@ __RCSID("$NetBSD: kvm_i386.c,v 1.26 2008
 #include <sys/user.h>
 #include <sys/stat.h>
 #include <sys/kcore.h>
+#include <sys/types.h>
+
 #include <i386/kcore.h>
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <nlist.h>
@@ -73,8 +76,7 @@ __RCSID("$NetBSD: kvm_i386.c,v 1.26 2008
 #endif
 
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
 
        /* Not actually used for anything right now, but safe. */
@@ -84,31 +86,27 @@ _kvm_freevtop(kd)
 
 /*ARGSUSED*/
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
 
-       return (0);
+       return 0;
 }
 
 /*
  * Translate a kernel virtual address to a physical address.
  */
 int
-_kvm_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        u_long page_off;
        pd_entry_t pde;
        pt_entry_t pte;
-       u_long pde_pa, pte_pa;
+       paddr_t pde_pa, pte_pa;
 
        if (ISALIVE(kd)) {
                _kvm_err(kd, 0, "vatop called in live kernel!");
-               return (0);
+               return 0;
        }
 
        cpu_kh = kd->cpu_data;
@@ -135,11 +133,11 @@ _kvm_kvatop(kd, va, pa)
                /*
                 * This is a 4MB page.
                 */
-               page_off = va & ~PG_LGFRAME;
-               *pa = (pde & PG_LGFRAME) + page_off;
-               return (int)(NBPD_L2 - page_off);
+               page_off = va & ~I386_PG_LGFRAME;
+               *pa = (pde & I386_PG_LGFRAME) + page_off;
+               return (int)(I386_NBPD_L2 - page_off);
        }
-       pte_pa = (pde & PG_FRAME) + (pl1_pi(va) * sizeof(pt_entry_t));
+       pte_pa = (pde & I386_PG_FRAME) + (pl1_pi(va) * sizeof(pt_entry_t));
        if (_kvm_pread(kd, kd->pmfd, (void *) &pte, sizeof(pte),
            _kvm_pa2off(kd, pte_pa)) != sizeof(pte)) {
                _kvm_syserr(kd, 0, "could not read PTE");
@@ -153,21 +151,19 @@ _kvm_kvatop(kd, va, pa)
                _kvm_err(kd, 0, "invalid translation (invalid PTE)");
                goto lose;
        }
-       *pa = (pte & PG_FRAME) + page_off;
+       *pa = (pte & I386_PG_FRAME) + page_off;
        return (int)(NBPG - page_off);
 
  lose:
        *pa = (u_long)~0L;
-       return (0);
+       return 0;
 }
 
 /*
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t *kd;
-       u_long pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        phys_ram_seg_t *ramsegs;
@@ -196,13 +192,12 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
 
        kd->usrstack = USRSTACK;
        kd->min_uva = VM_MIN_ADDRESS;
        kd->max_uva = VM_MAXUSER_ADDRESS;
 
-       return (0);
+       return 0;
 }
Index: lib/libkvm/kvm_m68k.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_m68k.c,v
retrieving revision 1.16
diff -u -p -r1.16 kvm_m68k.c
--- lib/libkvm/kvm_m68k.c       28 Apr 2008 20:23:01 -0000      1.16
+++ lib/libkvm/kvm_m68k.c       6 Sep 2010 17:39:18 -0000
@@ -42,6 +42,7 @@
 #include <sys/exec.h>
 #include <sys/kcore.h>
 #include <sys/sysctl.h>
+#include <sys/types.h>
 
 #include <stdio.h>
 #include <string.h>
@@ -78,8 +79,7 @@ static struct name_ops optbl[] = {
  * into crash dump files.  This is where we do the dispatch work.
  */
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
        cpu_kcore_hdr_t *h;
        struct name_ops *nop;
@@ -125,26 +125,20 @@ _kvm_initvtop(kd)
 }
 
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
        (kd->vmst->ops->freevtop)(kd);
        free(kd->vmst);
 }
 
 int
-_kvm_kvatop(kd, va, pap)
-       kvm_t *kd;
-       u_long va;
-       u_long *pap;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pap)
 {
        return ((kd->vmst->ops->kvatop)(kd, va, pap));
 }
 
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t   *kd;
-       u_long  pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        return ((kd->vmst->ops->pa2off)(kd, pa));
 }
@@ -155,8 +149,7 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
        u_long max_uva;
        extern struct ps_strings *__ps_strings;
Index: lib/libkvm/kvm_m68k.h
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_m68k.h,v
retrieving revision 1.4
diff -u -p -r1.4 kvm_m68k.h
--- lib/libkvm/kvm_m68k.h       28 Apr 2008 20:23:01 -0000      1.4
+++ lib/libkvm/kvm_m68k.h       6 Sep 2010 17:39:18 -0000
@@ -30,10 +30,10 @@
  */
 
 struct kvm_ops {
-       int   (*initvtop) __P((kvm_t *));
-       void  (*freevtop) __P((kvm_t *));
-       int       (*kvatop)   __P((kvm_t *, u_long, u_long *));
-       off_t (*pa2off)   __P((kvm_t *, u_long));
+       int   (*initvtop)(kvm_t *);
+       void  (*freevtop)(kvm_t *);
+       int   (*kvatop)  (kvm_t *, vaddr_t, paddr_t *);
+       off_t (*pa2off)  (kvm_t *, paddr_t);
 };
 
 struct vmstate {
Index: lib/libkvm/kvm_m68k_cmn.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_m68k_cmn.c,v
retrieving revision 1.13
diff -u -p -r1.13 kvm_m68k_cmn.c
--- lib/libkvm/kvm_m68k_cmn.c   15 Jan 2008 13:57:42 -0000      1.13
+++ lib/libkvm/kvm_m68k_cmn.c   6 Sep 2010 17:39:18 -0000
@@ -100,10 +100,10 @@ __RCSID("$NetBSD: kvm_m68k_cmn.c,v 1.13 
 #include "kvm_private.h"
 #include "kvm_m68k.h"
 
-int   _kvm_cmn_initvtop __P((kvm_t *));
-void  _kvm_cmn_freevtop __P((kvm_t *));
-int      _kvm_cmn_kvatop   __P((kvm_t *, u_long, u_long *));
-off_t _kvm_cmn_pa2off   __P((kvm_t *, u_long));
+int   _kvm_cmn_initvtop(kvm_t *);
+void  _kvm_cmn_freevtop(kvm_t *);
+int   _kvm_cmn_kvatop(kvm_t *, vaddr_t, paddr_t *);
+off_t _kvm_cmn_pa2off(kvm_t *, paddr_t);
 
 struct kvm_ops _kvm_ops_cmn = {
        _kvm_cmn_initvtop,
@@ -111,8 +111,8 @@ struct kvm_ops _kvm_ops_cmn = {
        _kvm_cmn_kvatop,
        _kvm_cmn_pa2off };
 
-static int vatop_030 __P((kvm_t *, u_int32_t, u_long, u_long *));
-static int vatop_040 __P((kvm_t *, u_int32_t, u_long, u_long *));
+static int vatop_030(kvm_t *, u_int32_t, vaddr_t, paddr_t *);
+static int vatop_040(kvm_t *, u_int32_t, vaddr_t, paddr_t *);
 
 #define        _kvm_btop(v, a) (((unsigned)(a)) >> (v)->pgshift)
 
@@ -120,29 +120,24 @@ static int vatop_040 __P((kvm_t *, u_int
        (kvm_read(kd, addr, (char *)(p), sizeof(*(p))) != sizeof(*(p)))
 
 void
-_kvm_cmn_freevtop(kd)
-       kvm_t *kd;
+_kvm_cmn_freevtop(kvm_t *kd)
 {
        /* No private state information to keep. */
 }
 
 int
-_kvm_cmn_initvtop(kd)
-       kvm_t *kd;
+_kvm_cmn_initvtop(kvm_t *kd)
 {
        /* No private state information to keep. */
        return (0);
 }
 
 int
-_kvm_cmn_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_cmn_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *h = kd->cpu_data;
        struct m68k_kcore_hdr *m = &h->un._m68k;
-       int (*vtopf) __P((kvm_t *, u_int32_t, u_long, u_long *));
+       int (*vtopf)(kvm_t *, uint32_t, vaddr_t, paddr_t *);
 
        if (ISALIVE(kd)) {
                _kvm_err(kd, 0, "vatop called in live kernel!");
@@ -165,9 +160,7 @@ _kvm_cmn_kvatop(kd, va, pa)
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_cmn_pa2off(kd, pa)
-       kvm_t   *kd;
-       u_long  pa;
+_kvm_cmn_pa2off(kvm_t *kd, paddr_t pa)
 {
        cpu_kcore_hdr_t *h = kd->cpu_data;
        struct m68k_kcore_hdr *m = &h->un._m68k;
@@ -193,17 +186,13 @@ _kvm_cmn_pa2off(kd, pa)
  */
 
 static int
-vatop_030(kd, stpa, va, pa)
-       kvm_t *kd;
-       u_int32_t stpa;
-       u_long va;
-       u_long *pa;
+vatop_030(kvm_t *kd, uint32_t stpa, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *h = kd->cpu_data;
        struct m68k_kcore_hdr *m = &h->un._m68k;
        struct vmstate *vm = kd->vmst;
-       u_long addr;
-       u_int32_t ste, pte;
+       paddr_t addr;
+       uint32_t ste, pte;
        u_int p, offset;
 
        offset = va & vm->pgofset;
@@ -258,18 +247,14 @@ invalid:
 }
 
 static int
-vatop_040(kd, stpa, va, pa)
-       kvm_t *kd;
-       u_int32_t stpa;
-       u_long va;
-       u_long *pa;
+vatop_040(kvm_t *kd, uint32_t stpa, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *h = kd->cpu_data;
        struct m68k_kcore_hdr *m = &h->un._m68k;
        struct vmstate *vm = kd->vmst;
-       u_long addr;
-       u_int32_t stpa2;
-       u_int32_t ste, pte;
+       paddr_t addr;
+       uint32_t stpa2;
+       uint32_t ste, pte;
        u_int offset;
 
        offset = va & vm->pgofset;
Index: lib/libkvm/kvm_mips.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_mips.c,v
retrieving revision 1.18
diff -u -p -r1.18 kvm_mips.c
--- lib/libkvm/kvm_mips.c       15 Jan 2008 13:57:42 -0000      1.18
+++ lib/libkvm/kvm_mips.c       6 Sep 2010 17:39:18 -0000
@@ -46,7 +46,10 @@ __RCSID("$NetBSD: kvm_mips.c,v 1.18 2008
 #include <sys/proc.h>
 #include <sys/stat.h>
 #include <sys/kcore.h>
+#include <sys/types.h>
+
 #include <machine/kcore.h>
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <nlist.h>
@@ -63,8 +66,7 @@ __RCSID("$NetBSD: kvm_mips.c,v 1.18 2008
 #include <mips/vmparam.h>
 
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
 
        /* Not actually used for anything right now, but safe. */
@@ -73,8 +75,7 @@ _kvm_freevtop(kd)
 }
 
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
 
        return (0);
@@ -84,15 +85,12 @@ _kvm_initvtop(kd)
  * Translate a kernel virtual address to a physical address.
  */
 int
-_kvm_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        int page_off;
        u_int pte;
-       u_long pte_pa;
+       paddr_t pte_pa;
 
        if (ISALIVE(kd)) {
                _kvm_err(kd, 0, "vatop called in live kernel!");
@@ -172,9 +170,7 @@ _kvm_kvatop(kd, va, pa)
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t *kd;
-       u_long pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        phys_ram_seg_t *ramsegs;
@@ -203,8 +199,7 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
 
        kd->usrstack = USRSTACK;
Index: lib/libkvm/kvm_powerpc.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_powerpc.c,v
retrieving revision 1.9
diff -u -p -r1.9 kvm_powerpc.c
--- lib/libkvm/kvm_powerpc.c    25 Feb 2010 23:35:29 -0000      1.9
+++ lib/libkvm/kvm_powerpc.c    6 Sep 2010 17:39:18 -0000
@@ -71,6 +71,7 @@
 
 #include <sys/param.h>
 #include <sys/exec.h>
+#include <sys/types.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -90,15 +91,15 @@
 #include <powerpc/oea/bat.h>
 #include <powerpc/oea/pte.h>
 
-static int     _kvm_match_601bat(kvm_t *kd, u_long va, u_long *pa, int *off);
-static int     _kvm_match_bat(kvm_t *kd, u_long va, u_long *pa, int *off);
-static int     _kvm_match_sr(kvm_t *kd, u_long va, u_long *pa, int *off);
+static int     _kvm_match_601bat(kvm_t *kd, vaddr_t va, paddr_t *pa,
+                   int *off);
+static int     _kvm_match_bat(kvm_t *kd, vaddr_t va, paddr_t *pa, int *off);
+static int     _kvm_match_sr(kvm_t *kd, vaddr_t va, paddr_t *pa, int *off);
 static struct pte *_kvm_scan_pteg(struct pteg *pteg, uint32_t vsid,
                                  uint32_t api, int secondary);
 
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
        if (kd->vmst != 0)
                free(kd->vmst);
@@ -106,8 +107,7 @@ _kvm_freevtop(kd)
 
 /*ARGSUSED*/
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
 
        return 0;
@@ -116,11 +116,7 @@ _kvm_initvtop(kd)
 #define BAT601_SIZE(b)  ((((b) << 17) | ~BAT601_BLPI) + 1)
 
 static int
-_kvm_match_601bat(kd, va, pa, off)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
-       int *off;
+_kvm_match_601bat(kvm_t *kd, vaddr_t va, paddr_t *pa, int *off)
 {
        cpu_kcore_hdr_t *cpu_kh;
        u_long          pgoff;
@@ -148,11 +144,7 @@ _kvm_match_601bat(kd, va, pa, off)
 #define BAT_SIZE(b)     ((((b) << 15) | ~BAT_EPI) + 1)
 
 static int
-_kvm_match_bat(kd, va, pa, off)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
-       int *off;
+_kvm_match_bat(kvm_t *kd, vaddr_t va, paddr_t *pa, int *off)
 {
        cpu_kcore_hdr_t *cpu_kh;
        u_long          pgoff;
@@ -182,11 +174,7 @@ _kvm_match_bat(kd, va, pa, off)
 #define SR_VSID_HASH_MASK      0x0007ffff
 
 static struct pte *
-_kvm_scan_pteg(pteg, vsid, api, secondary)
-       struct pteg *pteg;
-       uint32_t vsid;
-       uint32_t api;
-       int secondary;
+_kvm_scan_pteg(struct pteg *pteg, uint32_t vsid, uint32_t api, int secondary)
 {
        struct pte      *pte;
        u_long          ptehi;
@@ -211,18 +199,14 @@ _kvm_scan_pteg(pteg, vsid, api, secondar
 #define HASH_MASK      0x0007ffff
 
 static int
-_kvm_match_sr(kd, va, pa, off)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
-       int *off;
+_kvm_match_sr(kvm_t *kd, vaddr_t va, paddr_t *pa, int *off)
 {
        cpu_kcore_hdr_t *cpu_kh;
        struct pteg     pteg;
        struct pte      *pte;
        uint32_t        sr, pgoff, vsid, pgidx, api, hash;
        uint32_t        htaborg, htabmask, mhash;
-       u_long          pteg_vaddr;
+       paddr_t         pteg_vaddr;
 
        cpu_kh = kd->cpu_data;
 
@@ -283,10 +267,7 @@ _kvm_match_sr(kd, va, pa, off)
  * Translate a KVA to a PA
  */
 int
-_kvm_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        int             offs;
@@ -346,14 +327,12 @@ _kvm_kvatop(kd, va, pa)
        }
 
        /* No hit -- no translation */
-       *pa = (u_long)~0UL;
+       *pa = (paddr_t)~0UL;
        return 0;
 }
 
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t *kd;
-       u_long pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        phys_ram_seg_t  *ram;
@@ -372,7 +351,7 @@ _kvm_pa2off(kd, pa)
                off += ram->size;
        } while ((void *) ram < e && ram->size);
 
-       _kvm_err(kd, 0, "pa2off failed for pa 0x%08lx\n", pa);
+       _kvm_err(kd, 0, "pa2off failed for pa %#" PRIxPADDR "\n", pa);
        return (off_t) -1;
 }
 
@@ -382,8 +361,7 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
        uintptr_t max_uva;
        extern struct ps_strings *__ps_strings;
Index: lib/libkvm/kvm_powerpc64.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_powerpc64.c,v
retrieving revision 1.2
diff -u -p -r1.2 kvm_powerpc64.c
--- lib/libkvm/kvm_powerpc64.c  5 Jul 2006 18:33:18 -0000       1.2
+++ lib/libkvm/kvm_powerpc64.c  6 Sep 2010 17:39:18 -0000
@@ -71,6 +71,7 @@
 
 #include <sys/param.h>
 #include <sys/exec.h>
+#include <sys/types.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -90,8 +91,7 @@
 #include <powerpc/oea/pte.h>
 
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
        if (kd->vmst != 0)
                free(kd->vmst);
@@ -99,8 +99,7 @@ _kvm_freevtop(kd)
 
 /*ARGSUSED*/
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
 
        return 0;
@@ -114,10 +113,7 @@ _kvm_initvtop(kd)
  * Translate a KVA to a PA
  */
 int
-_kvm_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        uint32_t        pvr;
@@ -138,9 +134,7 @@ _kvm_kvatop(kd, va, pa)
 }
 
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t *kd;
-       u_long pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        phys_ram_seg_t  *ram;
@@ -169,8 +163,7 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
        uintptr_t max_uva;
        extern struct ps_strings *__ps_strings;
Index: lib/libkvm/kvm_private.h
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_private.h,v
retrieving revision 1.16
diff -u -p -r1.16 kvm_private.h
--- lib/libkvm/kvm_private.h    15 Jan 2008 13:57:42 -0000      1.16
+++ lib/libkvm/kvm_private.h    6 Sep 2010 17:39:18 -0000
@@ -104,19 +104,18 @@ struct __kvm {
 /*
  * Functions used internally by kvm, but across kvm modules.
  */
-void    _kvm_err __P((kvm_t *kd, const char *program, const char *fmt, ...))
-       __attribute__((__format__(__printf__, 3, 4)));
-int     _kvm_dump_mkheader __P((kvm_t *kd_live, kvm_t *kd_dump));
-void    _kvm_freeprocs __P((kvm_t *kd));
-void    _kvm_freevtop __P((kvm_t *));
-int     _kvm_mdopen __P((kvm_t *));
-int     _kvm_initvtop __P((kvm_t *));
-int     _kvm_kvatop __P((kvm_t *, u_long, u_long *));
-void   *_kvm_malloc __P((kvm_t *kd, size_t));
-off_t   _kvm_pa2off __P((kvm_t *, u_long));
-void   *_kvm_realloc __P((kvm_t *kd, void *, size_t));
-void    _kvm_syserr
-           __P((kvm_t *kd, const char *program, const char *fmt, ...))
+void    _kvm_err(kvm_t *, const char *, const char *, ...)
+           __attribute__((__format__(__printf__, 3, 4)));
+int     _kvm_dump_mkheader(kvm_t *, kvm_t *);
+void    _kvm_freeprocs(kvm_t *);
+void    _kvm_freevtop(kvm_t *);
+int     _kvm_mdopen(kvm_t *);
+int     _kvm_initvtop(kvm_t *);
+int     _kvm_kvatop(kvm_t *, vaddr_t, paddr_t *);
+void   *_kvm_malloc(kvm_t *, size_t);
+off_t   _kvm_pa2off(kvm_t *, paddr_t);
+void   *_kvm_realloc(kvm_t *, void *, size_t);
+void    _kvm_syserr(kvm_t *, const char *, const char *, ...)
            __attribute__((__format__(__printf__, 3, 4)));
 ssize_t        _kvm_pread(kvm_t *, int, void *, size_t, off_t);
 
Index: lib/libkvm/kvm_proc.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_proc.c,v
retrieving revision 1.84
diff -u -p -r1.84 kvm_proc.c
--- lib/libkvm/kvm_proc.c       21 Oct 2009 21:11:58 -0000      1.84
+++ lib/libkvm/kvm_proc.c       6 Sep 2010 17:39:19 -0000
@@ -89,6 +89,7 @@ __RCSID("$NetBSD: kvm_proc.c,v 1.84 2009
 #include <sys/resourcevar.h>
 #include <sys/mutex.h>
 #include <sys/specificdata.h>
+#include <sys/types.h>
 
 #include <errno.h>
 #include <stdlib.h>
@@ -173,35 +174,29 @@ struct kvm_kauth_cred {
        (kvm_read(kd, addr, (obj), sizeof(*obj)) != sizeof(*obj))
 
 /* XXX: What uses these two functions? */
-char           *_kvm_uread __P((kvm_t *, const struct proc *, u_long,
-                   u_long *));
-ssize_t                kvm_uread __P((kvm_t *, const struct proc *, u_long, 
char *,
-                   size_t));
-
-static char    *_kvm_ureadm __P((kvm_t *, const struct miniproc *, u_long,
-                   u_long *));
-static ssize_t kvm_ureadm __P((kvm_t *, const struct miniproc *, u_long,
-                   char *, size_t));
-
-static char    **kvm_argv __P((kvm_t *, const struct miniproc *, u_long, int,
-                   int));
-static int     kvm_deadprocs __P((kvm_t *, int, int, u_long, u_long, int));
-static char    **kvm_doargv __P((kvm_t *, const struct miniproc *, int,
-                   void (*)(struct ps_strings *, u_long *, int *)));
-static char    **kvm_doargv2 __P((kvm_t *, pid_t, int, int));
-static int     kvm_proclist __P((kvm_t *, int, int, struct proc *,
-                   struct kinfo_proc *, int));
-static int     proc_verify __P((kvm_t *, u_long, const struct miniproc *));
-static void    ps_str_a __P((struct ps_strings *, u_long *, int *));
-static void    ps_str_e __P((struct ps_strings *, u_long *, int *));
+char           *_kvm_uread(kvm_t *, const struct proc *, u_long, u_long *);
+ssize_t                kvm_uread(kvm_t *, const struct proc *, u_long, char *,
+                   size_t);
+
+static char    *_kvm_ureadm(kvm_t *, const struct miniproc *, u_long,
+                   u_long *);
+static ssize_t kvm_ureadm(kvm_t *, const struct miniproc *, u_long,
+                   char *, size_t);
+
+static char    **kvm_argv(kvm_t *, const struct miniproc *, u_long, int, int);
+static int     kvm_deadprocs(kvm_t *, int, int, u_long, u_long, int);
+static char    **kvm_doargv(kvm_t *, const struct miniproc *, int,
+                   void (*)(struct ps_strings *, u_long *, int *));
+static char    **kvm_doargv2(kvm_t *, pid_t, int, int);
+static int     kvm_proclist(kvm_t *, int, int, struct proc *,
+                   struct kinfo_proc *, int);
+static int     proc_verify(kvm_t *, u_long, const struct miniproc *);
+static void    ps_str_a(struct ps_strings *, u_long *, int *);
+static void    ps_str_e(struct ps_strings *, u_long *, int *);
 
 
 static char *
-_kvm_ureadm(kd, p, va, cnt)
-       kvm_t *kd;
-       const struct miniproc *p;
-       u_long va;
-       u_long *cnt;
+_kvm_ureadm(kvm_t *kd, const struct miniproc *p, u_long va, u_long *cnt)
 {
        u_long addr, head;
        u_long offset;
@@ -283,11 +278,7 @@ _kvm_ureadm(kd, p, va, cnt)
 }
 
 char *
-_kvm_uread(kd, p, va, cnt)
-       kvm_t *kd;
-       const struct proc *p;
-       u_long va;
-       u_long *cnt;
+_kvm_uread(kvm_t *kd, const struct proc *p, u_long va, u_long *cnt)
 {
        struct miniproc mp;
 
@@ -334,12 +325,8 @@ _kvm_convertcred(kvm_t *kd, u_long cred,
  * at most maxcnt procs.
  */
 static int
-kvm_proclist(kd, what, arg, p, bp, maxcnt)
-       kvm_t *kd;
-       int what, arg;
-       struct proc *p;
-       struct kinfo_proc *bp;
-       int maxcnt;
+kvm_proclist(kvm_t *kd, int what, int arg, struct proc *p,
+            struct kinfo_proc *bp, int maxcnt)
 {
        int cnt = 0;
        int nlwps;
@@ -472,12 +459,8 @@ kvm_proclist(kd, what, arg, p, bp, maxcn
  * Return number of procs read.  maxcnt is the max we will read.
  */
 static int
-kvm_deadprocs(kd, what, arg, a_allproc, a_zombproc, maxcnt)
-       kvm_t *kd;
-       int what, arg;
-       u_long a_allproc;
-       u_long a_zombproc;
-       int maxcnt;
+kvm_deadprocs(kvm_t *kd, int what, int arg, u_long a_allproc,
+             u_long a_zombproc, int maxcnt)
 {
        struct kinfo_proc *bp = kd->procbase;
        int acnt, zcnt;
@@ -504,11 +487,7 @@ kvm_deadprocs(kd, what, arg, a_allproc, 
 }
 
 struct kinfo_proc2 *
-kvm_getproc2(kd, op, arg, esize, cnt)
-       kvm_t *kd;
-       int op, arg;
-       size_t esize;
-       int *cnt;
+kvm_getproc2(kvm_t *kd, int op, int arg, size_t esize, int *cnt)
 {
        size_t size;
        int mib[6], st, nprocs;
@@ -747,12 +726,7 @@ again:
 }
 
 struct kinfo_lwp *
-kvm_getlwps(kd, pid, paddr, esize, cnt)
-       kvm_t *kd;
-       int pid;
-       u_long paddr;
-       size_t esize;
-       int *cnt;
+kvm_getlwps(kvm_t *kd, int pid, u_long paddr, size_t esize, int *cnt)
 {
        size_t size;
        int mib[5], nlwps;
@@ -852,10 +826,7 @@ again:
 }
 
 struct kinfo_proc *
-kvm_getprocs(kd, op, arg, cnt)
-       kvm_t *kd;
-       int op, arg;
-       int *cnt;
+kvm_getprocs(kvm_t *kd, int op, int arg, int *cnt)
 {
        size_t size;
        int mib[4], st, nprocs;
@@ -920,10 +891,7 @@ kvm_getprocs(kd, op, arg, cnt)
 }
 
 void *
-_kvm_realloc(kd, p, n)
-       kvm_t *kd;
-       void *p;
-       size_t n;
+_kvm_realloc(kvm_t *kd, void *p, size_t n)
 {
        void *np = realloc(p, n);
 
@@ -939,12 +907,8 @@ _kvm_realloc(kd, p, n)
  * environment strings.  Read at most maxcnt characters of strings.
  */
 static char **
-kvm_argv(kd, p, addr, narg, maxcnt)
-       kvm_t *kd;
-       const struct miniproc *p;
-       u_long addr;
-       int narg;
-       int maxcnt;
+kvm_argv(kvm_t *kd, const struct miniproc *p, u_long addr, int narg,
+        int maxcnt)
 {
        char *np, *cp, *ep, *ap;
        u_long oaddr = (u_long)~0L;
@@ -1056,10 +1020,7 @@ kvm_argv(kd, p, addr, narg, maxcnt)
 }
 
 static void
-ps_str_a(p, addr, n)
-       struct ps_strings *p;
-       u_long *addr;
-       int *n;
+ps_str_a(struct ps_strings *p, u_long *addr, int *n)
 {
 
        *addr = (u_long)p->ps_argvstr;
@@ -1067,10 +1028,7 @@ ps_str_a(p, addr, n)
 }
 
 static void
-ps_str_e(p, addr, n)
-       struct ps_strings *p;
-       u_long *addr;
-       int *n;
+ps_str_e(struct ps_strings *p, u_long *addr, int *n)
 {
 
        *addr = (u_long)p->ps_envstr;
@@ -1083,10 +1041,7 @@ ps_str_e(p, addr, n)
  * being wrong are very low.
  */
 static int
-proc_verify(kd, kernp, p)
-       kvm_t *kd;
-       u_long kernp;
-       const struct miniproc *p;
+proc_verify(kvm_t *kd, u_long kernp, const struct miniproc *p)
 {
        struct proc kernproc;
 
@@ -1102,11 +1057,8 @@ proc_verify(kd, kernp, p)
 }
 
 static char **
-kvm_doargv(kd, p, nchr, info)
-       kvm_t *kd;
-       const struct miniproc *p;
-       int nchr;
-       void (*info)(struct ps_strings *, u_long *, int *);
+kvm_doargv(kvm_t *kd, const struct miniproc *p, int nchr,
+          void (*info)(struct ps_strings *, u_long *, int *))
 {
        char **ap;
        u_long addr;
@@ -1140,10 +1092,7 @@ kvm_doargv(kd, p, nchr, info)
  * Get the command args.  This code is now machine independent.
  */
 char **
-kvm_getargv(kd, kp, nchr)
-       kvm_t *kd;
-       const struct kinfo_proc *kp;
-       int nchr;
+kvm_getargv(kvm_t *kd, const struct kinfo_proc *kp, int nchr)
 {
        struct miniproc p;
 
@@ -1152,10 +1101,7 @@ kvm_getargv(kd, kp, nchr)
 }
 
 char **
-kvm_getenvv(kd, kp, nchr)
-       kvm_t *kd;
-       const struct kinfo_proc *kp;
-       int nchr;
+kvm_getenvv(kvm_t *kd, const struct kinfo_proc *kp, int nchr)
 {
        struct miniproc p;
 
@@ -1164,11 +1110,7 @@ kvm_getenvv(kd, kp, nchr)
 }
 
 static char **
-kvm_doargv2(kd, pid, type, nchr)
-       kvm_t *kd;
-       pid_t pid;
-       int type;
-       int nchr;
+kvm_doargv2(kvm_t *kd, pid_t pid, int type, int nchr)
 {
        size_t bufs;
        int narg, mib[4];
@@ -1246,20 +1188,14 @@ kvm_doargv2(kd, pid, type, nchr)
 }
 
 char **
-kvm_getargv2(kd, kp, nchr)
-       kvm_t *kd;
-       const struct kinfo_proc2 *kp;
-       int nchr;
+kvm_getargv2(kvm_t *kd, const struct kinfo_proc2 *kp, int nchr)
 {
 
        return (kvm_doargv2(kd, kp->p_pid, KERN_PROC_ARGV, nchr));
 }
 
 char **
-kvm_getenvv2(kd, kp, nchr)
-       kvm_t *kd;
-       const struct kinfo_proc2 *kp;
-       int nchr;
+kvm_getenvv2(kvm_t *kd, const struct kinfo_proc2 *kp, int nchr)
 {
 
        return (kvm_doargv2(kd, kp->p_pid, KERN_PROC_ENV, nchr));
@@ -1269,12 +1205,8 @@ kvm_getenvv2(kd, kp, nchr)
  * Read from user space.  The user context is given by p.
  */
 static ssize_t
-kvm_ureadm(kd, p, uva, buf, len)
-       kvm_t *kd;
-       const struct miniproc *p;
-       u_long uva;
-       char *buf;
-       size_t len;
+kvm_ureadm(kvm_t *kd, const struct miniproc *p, u_long uva,
+          char *buf, size_t len)
 {
        char *cp;
 
@@ -1299,12 +1231,7 @@ kvm_ureadm(kd, p, uva, buf, len)
 }
 
 ssize_t
-kvm_uread(kd, p, uva, buf, len)
-       kvm_t *kd;
-       const struct proc *p;
-       u_long uva;
-       char *buf;
-       size_t len;
+kvm_uread(kvm_t *kd, const struct proc *p, u_long uva, char *buf, size_t len)
 {
        struct miniproc mp;
 
Index: lib/libkvm/kvm_sh3.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_sh3.c,v
retrieving revision 1.6
diff -u -p -r1.6 kvm_sh3.c
--- lib/libkvm/kvm_sh3.c        7 Aug 2003 16:44:39 -0000       1.6
+++ lib/libkvm/kvm_sh3.c        6 Sep 2010 17:39:19 -0000
@@ -51,6 +51,8 @@ __RCSID("$NetBSD: kvm_sh3.c,v 1.6 2003/0
 #include <sys/proc.h>
 #include <sys/stat.h>
 #include <sys/kcore.h>
+#include <sys/types.h>
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <nlist.h>
@@ -72,8 +74,7 @@ __RCSID("$NetBSD: kvm_sh3.c,v 1.6 2003/0
 #endif
 
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
 
        /* Not actually used for anything right now, but safe. */
@@ -83,8 +84,7 @@ _kvm_freevtop(kd)
 
 /*ARGSUSED*/
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
 
        return (0);
@@ -94,10 +94,7 @@ _kvm_initvtop(kd)
  * Translate a kernel virtual address to a physical address.
  */
 int
-_kvm_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        _kvm_err(kd, 0, "vatop not yet implemented!");
        return 0;
@@ -107,9 +104,7 @@ _kvm_kvatop(kd, va, pa)
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t *kd;
-       u_long pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        _kvm_err(kd, 0, "pa2off not yet implemented!");
        return 0;
@@ -121,8 +116,7 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
 
        kd->usrstack = USRSTACK;
Index: lib/libkvm/kvm_sparc.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_sparc.c,v
retrieving revision 1.30
diff -u -p -r1.30 kvm_sparc.c
--- lib/libkvm/kvm_sparc.c      25 Oct 2008 19:09:10 -0000      1.30
+++ lib/libkvm/kvm_sparc.c      6 Sep 2010 17:39:19 -0000
@@ -54,6 +54,8 @@ __RCSID("$NetBSD: kvm_sparc.c,v 1.30 200
 #include <sys/stat.h>
 #include <sys/core.h>
 #include <sys/kcore.h>
+#include <sys/types.h>
+
 #include <unistd.h>
 #include <nlist.h>
 #include <kvm.h>
@@ -81,9 +83,9 @@ static int nptesg;    /* [sun4/sun4c] only 
 #undef VA_OFF
 #define VA_OFF(va) (va & (kd->nbpg - 1))
 
-int _kvm_kvatop44c __P((kvm_t *, u_long, u_long *));
-int _kvm_kvatop4m __P((kvm_t *, u_long, u_long *));
-int _kvm_kvatop4u __P((kvm_t *, u_long, u_long *));
+int _kvm_kvatop44c(kvm_t *, vaddr_t, paddr_t *);
+int _kvm_kvatop4m (kvm_t *, vaddr_t, paddr_t *);
+int _kvm_kvatop4u (kvm_t *, vaddr_t, paddr_t *);
 
 /*
  * XXX
@@ -108,8 +110,7 @@ typedef struct sparc64_cpu_kcore_hdr {
 } sparc64_cpu_kcore_hdr_t;
 
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
        if (kd->vmst != 0) {
                _kvm_err(kd, kd->program, "_kvm_freevtop: internal error");
@@ -123,8 +124,7 @@ _kvm_freevtop(kd)
  * front of the crash dump by pmap_dumpmmu().
  */
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
        sparc64_cpu_kcore_hdr_t *cpup = kd->cpu_data;
 
@@ -154,10 +154,7 @@ _kvm_initvtop(kd)
  * physical address.  This routine is used only for crash dumps.
  */
 int
-_kvm_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        if (cputyp == -1)
                if (_kvm_initvtop(kd) != 0)
@@ -181,10 +178,7 @@ _kvm_kvatop(kd, va, pa)
  * (note: sun4 3-level MMU not yet supported)
  */
 int
-_kvm_kvatop44c(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop44c(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        int vr, vs, pte;
        sparc64_cpu_kcore_hdr_t *cpup = kd->cpu_data;
@@ -219,7 +213,7 @@ _kvm_kvatop44c(kd, va, pa)
                goto err;
        pte = ptes[sp->sg_pmeg * nptesg + VA_VPG(va)];
        if ((pte & PG_V) != 0) {
-               long p, off = VA_OFF(va);
+               paddr_t p, off = VA_OFF(va);
 
                p = (pte & PG_PFNUM) << pgshift;
                *pa = p + off;
@@ -231,10 +225,7 @@ err:
 }
 
 int
-_kvm_kvatop4m(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop4m(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        sparc64_cpu_kcore_hdr_t *cpup = kd->cpu_data;
        int vr, vs;
@@ -276,7 +267,7 @@ _kvm_kvatop4m(kd, va, pa)
        }
 
        if ((pte & SRMMU_TETYPE) == SRMMU_TEPTE) {
-               long p, off = VA_OFF(va);
+               paddr_t p, off = VA_OFF(va);
 
                p = (pte & SRMMU_PPNMASK) << SRMMU_PPNPASHIFT;
                *pa = p + off;
@@ -291,10 +282,7 @@ err:
  * sparc64 pmap's 32-bit page table format
  */
 int
-_kvm_kvatop4u(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop4u(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        sparc64_cpu_kcore_hdr_t *cpup = kd->cpu_data;
        int64_t **segmaps;
@@ -339,10 +327,9 @@ _kvm_kvatop4u(kd, va, pa)
         *      segmap[cpup->nsegmap];
         */
        segmaps = (int64_t **)((long)kd->cpu_data + cpup->segmapoffset);
-       /* XXX XXX XXX _kvm_pa2off takes u_long and returns off_t..
-          should take off_t also!! */
 
-       ptes = (int64_t *)(int)_kvm_pa2off(kd, 
(u_long)segmaps[sparc64_va_to_seg(va)]);
+       ptes = (int64_t *)(int)_kvm_pa2off(kd,
+           (paddr_t)segmaps[sparc64_va_to_seg(va)]);
        pte = ptes[sparc64_va_to_pte(va)];
        if ((pte & SPARC64_TLB_V) != 0)
                return ((pte & SPARC64_TLB_PA_MASK) | (va & (kd->nbpg - 1)));
@@ -356,9 +343,7 @@ err:
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t   *kd;
-       u_long  pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        sparc64_cpu_kcore_hdr_t *cpup = kd->cpu_data;
        phys_ram_seg_t *mp;
@@ -394,8 +379,7 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
        u_long max_uva;
        extern struct ps_strings *__ps_strings;
Index: lib/libkvm/kvm_sparc64.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_sparc64.c,v
retrieving revision 1.13
diff -u -p -r1.13 kvm_sparc64.c
--- lib/libkvm/kvm_sparc64.c    18 Jan 2008 16:26:09 -0000      1.13
+++ lib/libkvm/kvm_sparc64.c    6 Sep 2010 17:39:19 -0000
@@ -54,6 +54,8 @@ __RCSID("$NetBSD: kvm_sparc64.c,v 1.13 2
 #include <sys/stat.h>
 #include <sys/core.h>
 #include <sys/kcore.h>
+#include <sys/types.h>
+
 #include <unistd.h>
 #include <nlist.h>
 #include <kvm.h>
@@ -69,11 +71,8 @@ __RCSID("$NetBSD: kvm_sparc64.c,v 1.13 2
 
 #include "kvm_private.h"
 
-int _kvm_kvatop __P((kvm_t *, u_long, u_long *));
-
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
        if (kd->vmst != 0) {
                _kvm_err(kd, kd->program, "_kvm_freevtop: internal error");
@@ -89,8 +88,7 @@ _kvm_freevtop(kd)
  * We should read in and cache the ksegs here to speed up operations...
  */
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
        kd->nbpg = 0x2000;
 
@@ -104,10 +102,7 @@ _kvm_initvtop(kd)
  * physical address.  This routine is used only for crash dumps.
  */
 int
-_kvm_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *cpup = kd->cpu_data;
        u_long kernbase = cpup->kernbase;
@@ -236,9 +231,7 @@ lose:
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t   *kd;
-       u_long  pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        cpu_kcore_hdr_t *cpup = kd->cpu_data;
        phys_ram_seg_t *mp;
@@ -274,8 +267,7 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
        u_long max_uva;
        extern struct ps_strings *__ps_strings;
Index: lib/libkvm/kvm_sun2.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_sun2.c,v
retrieving revision 1.3
diff -u -p -r1.3 kvm_sun2.c
--- lib/libkvm/kvm_sun2.c       7 Aug 2003 16:44:40 -0000       1.3
+++ lib/libkvm/kvm_sun2.c       6 Sep 2010 17:39:19 -0000
@@ -63,10 +63,10 @@ __RCSID("$NetBSD: kvm_sun2.c,v 1.3 2003/
 #include "kvm_private.h"
 #include "kvm_m68k.h"
 
-int   _kvm_sun2_initvtop __P((kvm_t *));
-void  _kvm_sun2_freevtop __P((kvm_t *));
-int      _kvm_sun2_kvatop   __P((kvm_t *, u_long, u_long *));
-off_t _kvm_sun2_pa2off   __P((kvm_t *, u_long));
+int   _kvm_sun2_initvtop(kvm_t *);
+void  _kvm_sun2_freevtop(kvm_t *);
+int   _kvm_sun2_kvatop  (kvm_t *, vaddr_t, paddr_t *);
+off_t _kvm_sun2_pa2off  (kvm_t *, paddr_t);
 
 struct kvm_ops _kvm_ops_sun2 = {
        _kvm_sun2_initvtop,
@@ -103,8 +103,7 @@ struct private_vmstate {
  * Note: sun2 MMU specific!
  */
 int
-_kvm_sun2_initvtop(kd)
-       kvm_t *kd;
+_kvm_sun2_initvtop(kvm_t *kd)
 {
        cpu_kcore_hdr_t *h = kd->cpu_data;
        char *p;
@@ -117,8 +116,7 @@ _kvm_sun2_initvtop(kd)
 }
 
 void
-_kvm_sun2_freevtop(kd)
-       kvm_t *kd;
+_kvm_sun2_freevtop(kvm_t *kd)
 {
        /* This was set by pointer arithmetic, not allocation. */
        kd->vmst->private = (void*)0;
@@ -131,10 +129,7 @@ _kvm_sun2_freevtop(kd)
  * physical address.  This routine is used only for crash dumps.
  */
 int
-_kvm_sun2_kvatop(kd, va, pap)
-       kvm_t *kd;
-       u_long va;
-       u_long *pap;
+_kvm_sun2_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pap)
 {
        cpu_kcore_hdr_t *h = kd->cpu_data;
        struct sun2_kcore_hdr *s = &h->un._sun2;
@@ -142,7 +137,7 @@ _kvm_sun2_kvatop(kd, va, pap)
        struct private_vmstate *pv = v->private;
        int pte, offset;
        u_int segnum, sme, ptenum;
-       u_long pa;
+       paddr_t pa;
 
        if (ISALIVE(kd)) {
                _kvm_err(kd, 0, "vatop called in live kernel!");
@@ -180,9 +175,7 @@ _kvm_sun2_kvatop(kd, va, pap)
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_sun2_pa2off(kd, pa)
-       kvm_t   *kd;
-       u_long  pa;
+_kvm_sun2_pa2off(kvm_t *kd, paddr_t pa)
 {
        return(kd->dump_off + pa);
 }
Index: lib/libkvm/kvm_sun3.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_sun3.c,v
retrieving revision 1.12
diff -u -p -r1.12 kvm_sun3.c
--- lib/libkvm/kvm_sun3.c       7 Aug 2003 16:44:40 -0000       1.12
+++ lib/libkvm/kvm_sun3.c       6 Sep 2010 17:39:19 -0000
@@ -63,10 +63,10 @@ __RCSID("$NetBSD: kvm_sun3.c,v 1.12 2003
 #include "kvm_private.h"
 #include "kvm_m68k.h"
 
-int   _kvm_sun3_initvtop __P((kvm_t *));
-void  _kvm_sun3_freevtop __P((kvm_t *));
-int      _kvm_sun3_kvatop   __P((kvm_t *, u_long, u_long *));
-off_t _kvm_sun3_pa2off   __P((kvm_t *, u_long));
+int   _kvm_sun3_initvtop(kvm_t *);
+void  _kvm_sun3_freevtop(kvm_t *);
+int   _kvm_sun3_kvatop  (kvm_t *, vaddr_t, paddr_t *);
+off_t _kvm_sun3_pa2off  (kvm_t *, paddr_t);
 
 struct kvm_ops _kvm_ops_sun3 = {
        _kvm_sun3_initvtop,
@@ -103,8 +103,7 @@ struct private_vmstate {
  * Note: sun3 MMU specific!
  */
 int
-_kvm_sun3_initvtop(kd)
-       kvm_t *kd;
+_kvm_sun3_initvtop(kvm_t *kd)
 {
        cpu_kcore_hdr_t *h = kd->cpu_data;
        char *p;
@@ -117,8 +116,7 @@ _kvm_sun3_initvtop(kd)
 }
 
 void
-_kvm_sun3_freevtop(kd)
-       kvm_t *kd;
+_kvm_sun3_freevtop(kvm_t *kd)
 {
        /* This was set by pointer arithmetic, not allocation. */
        kd->vmst->private = (void*)0;
@@ -131,10 +129,7 @@ _kvm_sun3_freevtop(kd)
  * physical address.  This routine is used only for crash dumps.
  */
 int
-_kvm_sun3_kvatop(kd, va, pap)
-       kvm_t *kd;
-       u_long va;
-       u_long *pap;
+_kvm_sun3_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pap)
 {
        cpu_kcore_hdr_t *h = kd->cpu_data;
        struct sun3_kcore_hdr *s = &h->un._sun3;
@@ -180,9 +175,7 @@ _kvm_sun3_kvatop(kd, va, pap)
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_sun3_pa2off(kd, pa)
-       kvm_t   *kd;
-       u_long  pa;
+_kvm_sun3_pa2off(kvm_t *kd, paddr_t pa)
 {
        return(kd->dump_off + pa);
 }
Index: lib/libkvm/kvm_sun3x.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_sun3x.c,v
retrieving revision 1.9
diff -u -p -r1.9 kvm_sun3x.c
--- lib/libkvm/kvm_sun3x.c      28 Apr 2008 20:23:01 -0000      1.9
+++ lib/libkvm/kvm_sun3x.c      6 Sep 2010 17:39:19 -0000
@@ -59,10 +59,10 @@ __RCSID("$NetBSD: kvm_sun3x.c,v 1.9 2008
 #include "kvm_private.h"
 #include "kvm_m68k.h"
 
-int   _kvm_sun3x_initvtop __P((kvm_t *));
-void  _kvm_sun3x_freevtop __P((kvm_t *));
-int      _kvm_sun3x_kvatop   __P((kvm_t *, u_long, u_long *));
-off_t _kvm_sun3x_pa2off   __P((kvm_t *, u_long));
+int   _kvm_sun3x_initvtop(kvm_t *);
+void  _kvm_sun3x_freevtop(kvm_t *);
+int   _kvm_sun3x_kvatop  (kvm_t *, vaddr_t, paddr_t *);
+off_t _kvm_sun3x_pa2off  (kvm_t *, paddr_t);
 
 struct kvm_ops _kvm_ops_sun3x = {
        _kvm_sun3x_initvtop,
@@ -82,15 +82,13 @@ struct kvm_ops _kvm_ops_sun3x = {
  * into crash dump files.  Nothing to do here.
  */
 int
-_kvm_sun3x_initvtop(kd)
-       kvm_t *kd;
+_kvm_sun3x_initvtop(kvm_t *kd)
 {
-       return (0);
+       return 0;
 }
 
 void
-_kvm_sun3x_freevtop(kd)
-       kvm_t *kd;
+_kvm_sun3x_freevtop(kvm_t *kd)
 {
 }
 
@@ -101,10 +99,7 @@ _kvm_sun3x_freevtop(kd)
  * physical address.  This routine is used only for crash dumps.
  */
 int
-_kvm_sun3x_kvatop(kd, va, pap)
-       kvm_t *kd;
-       u_long va;
-       u_long *pap;
+_kvm_sun3x_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pap)
 {
        cpu_kcore_hdr_t *h = kd->cpu_data;
        struct sun3x_kcore_hdr *s = &h->un._sun3x;
@@ -161,9 +156,7 @@ done:
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_sun3x_pa2off(kd, pa)
-       kvm_t   *kd;
-       u_long  pa;
+_kvm_sun3x_pa2off(kvm_t *kd, paddr_t pa)
 {
        off_t           off;
        phys_ram_seg_t  *rsp;
Index: lib/libkvm/kvm_vax.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_vax.c,v
retrieving revision 1.16
diff -u -p -r1.16 kvm_vax.c
--- lib/libkvm/kvm_vax.c        7 Aug 2003 16:44:40 -0000       1.16
+++ lib/libkvm/kvm_vax.c        6 Sep 2010 17:39:19 -0000
@@ -44,6 +44,8 @@
 #include <sys/user.h>
 #include <sys/proc.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+
 #include <unistd.h>
 #include <nlist.h>
 #include <stdlib.h>
@@ -64,16 +66,14 @@ struct vmstate {
 };
 
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
        if (kd->vmst != 0)
                free(kd->vmst);
 }
 
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
        struct vmstate *vm;
        struct stat st;
@@ -109,10 +109,7 @@ _kvm_initvtop(kd)
  * physical address.  This routine is used only for crash dumps.
  */
 int
-_kvm_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        u_long end;
 
@@ -136,9 +133,7 @@ _kvm_kvatop(kd, va, pa)
  * XXX - crash dump doesn't work anyway.
  */
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t   *kd;
-       u_long  pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        return(kd->dump_off + pa);
 }
@@ -150,8 +145,7 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
 
        kd->usrstack = USRSTACK;
Index: lib/libkvm/kvm_x86_64.c
===================================================================
RCS file: /cvsroot/src/lib/libkvm/kvm_x86_64.c,v
retrieving revision 1.6
diff -u -p -r1.6 kvm_x86_64.c
--- lib/libkvm/kvm_x86_64.c     15 Jan 2008 13:57:42 -0000      1.6
+++ lib/libkvm/kvm_x86_64.c     6 Sep 2010 17:39:19 -0000
@@ -51,6 +51,8 @@ __RCSID("$NetBSD: kvm_x86_64.c,v 1.6 200
 #include <sys/proc.h>
 #include <sys/stat.h>
 #include <sys/kcore.h>
+#include <sys/types.h>
+
 #include <machine/kcore.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -69,8 +71,7 @@ __RCSID("$NetBSD: kvm_x86_64.c,v 1.6 200
 #include <machine/vmparam.h>
 
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
 
        /* Not actually used for anything right now, but safe. */
@@ -80,8 +81,7 @@ _kvm_freevtop(kd)
 
 /*ARGSUSED*/
 int
-_kvm_initvtop(kd)
-       kvm_t *kd;
+_kvm_initvtop(kvm_t *kd)
 {
 
        return (0);
@@ -91,10 +91,7 @@ _kvm_initvtop(kd)
  * Translate a kernel virtual address to a physical address.
  */
 int
-_kvm_kvatop(kd, va, pa)
-       kvm_t *kd;
-       u_long va;
-       u_long *pa;
+_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        u_long page_off;
@@ -185,9 +182,7 @@ _kvm_kvatop(kd, va, pa)
  * Translate a physical address to a file-offset in the crash dump.
  */
 off_t
-_kvm_pa2off(kd, pa)
-       kvm_t *kd;
-       u_long pa;
+_kvm_pa2off(kvm_t *kd, paddr_t pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        phys_ram_seg_t *ramsegs;
@@ -216,8 +211,7 @@ _kvm_pa2off(kd, pa)
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)
-       kvm_t   *kd;
+_kvm_mdopen(kvm_t *kd)
 {
 
        kd->usrstack = USRSTACK;


Home | Main Index | Thread Index | Old Index