Module Name: src Committed By: christos Date: Sat Dec 25 23:36:59 UTC 2010
Modified Files: src/usr.bin/vmstat: vmstat.c Log Message: can't play games with structure names since cpu_data refers to cpu_info, so provide our own copy for everything. To generate a diff of this commit: cvs rdiff -u -r1.174 -r1.175 src/usr.bin/vmstat/vmstat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/vmstat/vmstat.c diff -u src/usr.bin/vmstat/vmstat.c:1.174 src/usr.bin/vmstat/vmstat.c:1.175 --- src/usr.bin/vmstat/vmstat.c:1.174 Sat Dec 25 15:50:36 2010 +++ src/usr.bin/vmstat/vmstat.c Sat Dec 25 18:36:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vmstat.c,v 1.174 2010/12/25 20:50:36 christos Exp $ */ +/* $NetBSD: vmstat.c,v 1.175 2010/12/25 23:36:59 christos Exp $ */ /*- * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95"; #else -__RCSID("$NetBSD: vmstat.c,v 1.174 2010/12/25 20:50:36 christos Exp $"); +__RCSID("$NetBSD: vmstat.c,v 1.175 2010/12/25 23:36:59 christos Exp $"); #endif #endif /* not lint */ @@ -95,7 +95,6 @@ #include <sys/time.h> #include <sys/user.h> #include <sys/queue.h> -#include <sys/cpu.h> #include <uvm/uvm_extern.h> #include <uvm/uvm_stat.h> @@ -134,13 +133,19 @@ * All this mess will go away once everything is converted. */ #ifdef __HAVE_CPU_DATA_FIRST -#include <sys/cpu_data.h> -struct xcpu_info { + +# include <sys/cpu_data.h> +struct cpu_info { struct cpu_data ci_data; }; -# define CPU_INFO xcpu_info +CIRCLEQ_HEAD(cpuqueue, cpu_info); +struct cpuqueue cpu_queue; + #else -# define CPU_INFO cpu_info + +# include <sys/cpu.h> +struct cpuqueue cpu_queue; + #endif /* * General namelist @@ -253,7 +258,6 @@ } cpucounter, ocpucounter; struct uvmexp uvmexp, ouvmexp; -struct cpuqueue cpu_queue; int ndrives; int winlines = 20; @@ -989,10 +993,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)",