Source-Changes-HG archive

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

[src/trunk]: src/lib/libkvm Ansify and KNF all functions within kvm(3). No ob...



details:   https://anonhg.NetBSD.org/src/rev/57481939f8e5
branches:  trunk
changeset: 757719:57481939f8e5
user:      jym <jym%NetBSD.org@localhost>
date:      Sun Sep 19 02:07:00 2010 +0000

description:
Ansify and KNF all functions within kvm(3). No objection on current-users@.

Used as ground for u_long => vaddr_t/paddr_t replacements in kvm(3)
private functions.

Compile tested for all arches. See also:

http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html

diffstat:

 lib/libkvm/kvm_alpha.c      |   20 +---
 lib/libkvm/kvm_arm.c        |    6 +-
 lib/libkvm/kvm_file.c       |   16 +--
 lib/libkvm/kvm_getloadavg.c |    9 +-
 lib/libkvm/kvm_i386.c       |   26 ++----
 lib/libkvm/kvm_m68k.c       |   20 +---
 lib/libkvm/kvm_m68k.h       |   10 +-
 lib/libkvm/kvm_m68k_cmn.c   |   51 ++++--------
 lib/libkvm/kvm_mips.c       |   22 +----
 lib/libkvm/kvm_powerpc.c    |   44 ++---------
 lib/libkvm/kvm_powerpc64.c  |   20 +---
 lib/libkvm/kvm_private.h    |   27 +++---
 lib/libkvm/kvm_proc.c       |  162 +++++++++++--------------------------------
 lib/libkvm/kvm_sh3.c        |   22 +----
 lib/libkvm/kvm_sparc.c      |   43 +++--------
 lib/libkvm/kvm_sparc64.c    |   24 +----
 lib/libkvm/kvm_sun2.c       |   27 ++----
 lib/libkvm/kvm_sun3.c       |   27 ++----
 lib/libkvm/kvm_sun3x.c      |   29 ++----
 lib/libkvm/kvm_vax.c        |   20 +---
 lib/libkvm/kvm_x86_64.c     |   22 +----
 21 files changed, 206 insertions(+), 441 deletions(-)

diffs (truncated from 1692 to 300 lines):

diff -r cb66d209d476 -r 57481939f8e5 lib/libkvm/kvm_alpha.c
--- a/lib/libkvm/kvm_alpha.c    Sun Sep 19 01:39:48 2010 +0000
+++ b/lib/libkvm/kvm_alpha.c    Sun Sep 19 02:07:00 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kvm_alpha.c,v 1.23 2008/01/15 13:57:41 ad Exp $ */
+/* $NetBSD: kvm_alpha.c,v 1.24 2010/09/19 02:07:00 jym Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -51,25 +51,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, u_long va, u_long *pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        alpha_pt_entry_t pte;
@@ -156,9 +151,7 @@
  * 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, u_long pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        phys_ram_seg_t *ramsegs;
@@ -187,8 +180,7 @@
  * 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;
diff -r cb66d209d476 -r 57481939f8e5 lib/libkvm/kvm_arm.c
--- a/lib/libkvm/kvm_arm.c      Sun Sep 19 01:39:48 2010 +0000
+++ b/lib/libkvm/kvm_arm.c      Sun Sep 19 02:07:00 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kvm_arm.c,v 1.4 2008/01/15 13:57:42 ad Exp $        */
+/* $NetBSD: kvm_arm.c,v 1.5 2010/09/19 02:07:00 jym Exp $       */
 
 /*-
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: kvm_arm.c,v 1.4 2008/01/15 13:57:42 ad Exp $");
+__RCSID("$NetBSD: kvm_arm.c,v 1.5 2010/09/19 02:07:00 jym Exp $");
 #endif                         /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
@@ -71,7 +71,7 @@
 }
 
 int
-_kvm_kvatop(kvm_t * kd, u_long va, u_long * pa)
+_kvm_kvatop(kvm_t * kd, u_long va, u_long *pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        pd_entry_t      pde;
diff -r cb66d209d476 -r 57481939f8e5 lib/libkvm/kvm_file.c
--- a/lib/libkvm/kvm_file.c     Sun Sep 19 01:39:48 2010 +0000
+++ b/lib/libkvm/kvm_file.c     Sun Sep 19 02:07:00 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kvm_file.c,v 1.26 2008/03/12 05:57:28 mrg Exp $        */
+/*     $NetBSD: kvm_file.c,v 1.27 2010/09/19 02:07:00 jym Exp $        */
 
 /*-
  * Copyright (c) 1989, 1992, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm_file.c 8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: kvm_file.c,v 1.26 2008/03/12 05:57:28 mrg Exp $");
+__RCSID("$NetBSD: kvm_file.c,v 1.27 2010/09/19 02:07:00 jym Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -76,17 +76,14 @@
        (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 @@
 }
 
 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;
diff -r cb66d209d476 -r 57481939f8e5 lib/libkvm/kvm_getloadavg.c
--- a/lib/libkvm/kvm_getloadavg.c       Sun Sep 19 01:39:48 2010 +0000
+++ b/lib/libkvm/kvm_getloadavg.c       Sun Sep 19 02:07:00 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kvm_getloadavg.c,v 1.8 2003/08/07 16:44:37 agc Exp $   */
+/*     $NetBSD: kvm_getloadavg.c,v 1.9 2010/09/19 02:07:00 jym Exp $   */
 
 /*-
  * Copyright (c) 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm_getloadavg.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: kvm_getloadavg.c,v 1.8 2003/08/07 16:44:37 agc Exp $");
+__RCSID("$NetBSD: kvm_getloadavg.c,v 1.9 2010/09/19 02:07:00 jym Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -70,10 +70,7 @@
  * 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;
diff -r cb66d209d476 -r 57481939f8e5 lib/libkvm/kvm_i386.c
--- a/lib/libkvm/kvm_i386.c     Sun Sep 19 01:39:48 2010 +0000
+++ b/lib/libkvm/kvm_i386.c     Sun Sep 19 02:07:00 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kvm_i386.c,v 1.26 2008/10/25 23:59:06 mrg Exp $        */
+/*     $NetBSD: kvm_i386.c,v 1.27 2010/09/19 02:07:00 jym Exp $        */
 
 /*-
  * Copyright (c) 1989, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm_hp300.c        8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: kvm_i386.c,v 1.26 2008/10/25 23:59:06 mrg Exp $");
+__RCSID("$NetBSD: kvm_i386.c,v 1.27 2010/09/19 02:07:00 jym Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -73,8 +73,7 @@
 #endif
 
 void
-_kvm_freevtop(kd)
-       kvm_t *kd;
+_kvm_freevtop(kvm_t *kd)
 {
 
        /* Not actually used for anything right now, but safe. */
@@ -84,21 +83,17 @@
 
 /*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, u_long va, u_long *pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        u_long page_off;
@@ -165,9 +160,7 @@
  * 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, u_long pa)
 {
        cpu_kcore_hdr_t *cpu_kh;
        phys_ram_seg_t *ramsegs;
@@ -196,13 +189,12 @@
  * 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;
 }
diff -r cb66d209d476 -r 57481939f8e5 lib/libkvm/kvm_m68k.c
--- a/lib/libkvm/kvm_m68k.c     Sun Sep 19 01:39:48 2010 +0000
+++ b/lib/libkvm/kvm_m68k.c     Sun Sep 19 02:07:00 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kvm_m68k.c,v 1.16 2008/04/28 20:23:01 martin Exp $     */
+/*     $NetBSD: kvm_m68k.c,v 1.17 2010/09/19 02:07:00 jym Exp $        */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -78,8 +78,7 @@
  * 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 +124,20 @@
 }
 
 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, u_long va, u_long *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, u_long pa)
 {
        return ((kd->vmst->ops->pa2off)(kd, pa));
 }
@@ -155,8 +148,7 @@
  * have to deal with these NOT being constants!  (i.e. m68k)
  */
 int
-_kvm_mdopen(kd)



Home | Main Index | Thread Index | Old Index