summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-07-19 15:21:42 +0000
committerrwatson <rwatson@FreeBSD.org>2009-07-19 15:21:42 +0000
commit5113862d47a88010ff3040edeae45c0997c084ff (patch)
treef462bf2bc46606da1a29d8f591d226e4e73c41f6
parent69550679325e630b5720649bc0f8787e31161476 (diff)
downloadFreeBSD-src-5113862d47a88010ff3040edeae45c0997c084ff.zip
FreeBSD-src-5113862d47a88010ff3040edeae45c0997c084ff.tar.gz
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)
-rw-r--r--sys/sys/vimage.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/sys/sys/vimage.h b/sys/sys/vimage.h
index 69ab3d6..eeed269 100644
--- a/sys/sys/vimage.h
+++ b/sys/sys/vimage.h
@@ -33,13 +33,31 @@
#ifndef _SYS_VIMAGE_H_
#define _SYS_VIMAGE_H_
-#include <sys/proc.h>
+/*
+ * 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 <sys/queue.h>
+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 <sys/lock.h>
#include <sys/sx.h>
+#include <sys/proc.h>
#ifdef INVARIANTS
#define VNET_DEBUG
@@ -115,19 +133,8 @@ void vnet_foreach(void (*vnet_foreach_fn)(struct vnet *, void *),
#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) \
OpenPOWER on IntegriCloud