From 5ee7c6c8d5d1a720e24cfaa3be6b5caf5f33405d Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 25 Dec 2010 20:50:36 +0000 Subject: [PATCH] use a local definition of cpu_info if we have __HAVE_CPU_DATA_FIRST --- usr.bin/vmstat/vmstat.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index eb80826a4849..332d435b4612 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1991, 1993\ #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 +#include #include #include @@ -129,6 +130,18 @@ __RCSID("$NetBSD: vmstat.c,v 1.173 2010/12/25 14:18:37 christos Exp $"); #include "drvstats.h" +/* + * All this mess will go away once everything is converted. + */ +#ifdef __HAVE_CPU_DATA_FIRST +#include +struct xcpu_info { + struct cpu_data ci_data; +}; +# define CPU_INFO xcpu_info +#else +# define CPU_INFO cpu_info +#endif /* * General namelist */ @@ -247,6 +260,7 @@ int winlines = 20; kvm_t *kd; + #define FORKSTAT 1<<0 #define INTRSTAT 1<<1 #define MEMSTAT 1<<2 @@ -975,10 +989,10 @@ drvstats(int *ovflwp) 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)",