Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/vmstat use a local definition of cpu_info if we have...



details:   https://anonhg.NetBSD.org/src/rev/63aa42d8f6b1
branches:  trunk
changeset: 760076:63aa42d8f6b1
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Dec 25 20:50:36 2010 +0000

description:
use a local definition of cpu_info if we have __HAVE_CPU_DATA_FIRST

diffstat:

 usr.bin/vmstat/vmstat.c |  22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diffs (65 lines):

diff -r 2072a3f8c245 -r 63aa42d8f6b1 usr.bin/vmstat/vmstat.c
--- a/usr.bin/vmstat/vmstat.c   Sat Dec 25 20:46:18 2010 +0000
+++ b/usr.bin/vmstat/vmstat.c   Sat Dec 25 20:50:36 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.173 2010/12/25 14:18:37 christos Exp $ */
+/* $NetBSD: vmstat.c,v 1.174 2010/12/25 20:50:36 christos Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,13 +70,14 @@
 #if 0
 static char sccsid[] = "@(#)vmstat.c   8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.173 2010/12/25 14:18:37 christos Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.174 2010/12/25 20:50:36 christos Exp $");
 #endif
 #endif /* not lint */
 
 #define        __POOL_EXPOSE
 
 #include <sys/param.h>
+#include <sys/types.h>
 #include <sys/mount.h>
 #include <sys/uio.h>
 
@@ -130,6 +131,18 @@
 #include "drvstats.h"
 
 /*
+ * All this mess will go away once everything is converted.
+ */
+#ifdef __HAVE_CPU_DATA_FIRST
+#include <sys/cpu_data.h>
+struct xcpu_info {
+       struct cpu_data ci_data;
+};
+# define CPU_INFO      xcpu_info
+#else
+# define CPU_INFO      cpu_info
+#endif
+/*
  * General namelist
  */
 struct nlist namelist[] =
@@ -247,6 +260,7 @@
 
 kvm_t *kd;
 
+
 #define        FORKSTAT        1<<0
 #define        INTRSTAT        1<<1
 #define        MEMSTAT         1<<2
@@ -975,10 +989,10 @@
 void
 cpucounters(struct cpu_counter *cc)
 {
-       struct cpu_info *ci;
+       struct CPU_INFO *ci;
        (void)memset(cc, 0, sizeof(*cc));
        CIRCLEQ_FOREACH(ci, &cpu_queue, ci_data.cpu_qchain) {
-               struct cpu_info tci;
+               struct CPU_INFO tci;
                if ((size_t)kvm_read(kd, (u_long)ci, &tci, sizeof(tci))
                    != sizeof(tci)) {
                    warnx("Can't read cpu info from %p (%s)",



Home | Main Index | Thread Index | Old Index