From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 15:21:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8D831065670; Sun, 19 Jul 2009 15:21:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6C2C8FC08; Sun, 19 Jul 2009 15:21:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JFLgUW045971; Sun, 19 Jul 2009 15:21:42 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JFLgrn045969; Sun, 19 Jul 2009 15:21:42 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907191521.n6JFLgrn045969@svn.freebsd.org> From: Robert Watson Date: Sun, 19 Jul 2009 15:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195761 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 15:21:43 -0000 Author: rwatson Date: Sun Jul 19 15:21:42 2009 New Revision: 195761 URL: http://svn.freebsd.org/changeset/base/195761 Log: Expose the definitions of 'struct vnet' and 'VNET_MAGIC_N' to userspace if _WANT_VNET is defined. This is required so that libkvm can locate virtual network stack instances in order to reach their global variables for monitoring and crashdump analysis. Reviewed by: bz Approved by: re (kib) Modified: head/sys/sys/vimage.h Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Sun Jul 19 14:20:53 2009 (r195760) +++ head/sys/sys/vimage.h Sun Jul 19 15:21:42 2009 (r195761) @@ -33,13 +33,31 @@ #ifndef _SYS_VIMAGE_H_ #define _SYS_VIMAGE_H_ -#include +/* + * struct vnet describes a virtualized network stack, and is primarily a + * pointer to storage for virtualized global variables. Expose to userspace + * as required for libkvm. + */ +#if defined(_KERNEL) || defined(_WANT_VNET) #include +struct vnet { + LIST_ENTRY(vnet) vnet_le; /* all vnets list */ + u_int vnet_magic_n; + u_int ifcnt; + u_int sockcnt; + void *vnet_data_mem; + uintptr_t vnet_data_base; +}; + +#define VNET_MAGIC_N 0x3e0d8f29 +#endif + #ifdef _KERNEL #include #include +#include #ifdef INVARIANTS #define VNET_DEBUG @@ -115,19 +133,8 @@ void vnet_foreach(void (*vnet_foreach_fn #endif /* VIMAGE */ -struct vnet { - LIST_ENTRY(vnet) vnet_le; /* all vnets list */ - u_int vnet_magic_n; - u_int ifcnt; - u_int sockcnt; - void *vnet_data_mem; - uintptr_t vnet_data_base; -}; - #define curvnet curthread->td_vnet -#define VNET_MAGIC_N 0x3e0d8f29 - #ifdef VIMAGE #ifdef VNET_DEBUG #define VNET_ASSERT(condition) \