Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Dec 2008 17:10:58 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 154648 for review
Message-ID:  <200812141710.mBEHAwcC083543@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=154648

Change 154648 by zec@zec_tca51 on 2008/12/14 17:10:56

	Unbreak options VIMAGE build.

Affected files ...

.. //depot/projects/vimage/src/sys/kern/kern_uuid.c#13 edit
.. //depot/projects/vimage/src/sys/kern/kern_vimage.c#71 edit
.. //depot/projects/vimage/src/sys/net/bpf.c#31 edit
.. //depot/projects/vimage/src/sys/net/if.c#57 edit
.. //depot/projects/vimage/src/sys/net/if_var.h#25 edit
.. //depot/projects/vimage/src/sys/net/raw_cb.h#6 edit
.. //depot/projects/vimage/src/sys/netgraph/ng_base.c#49 edit
.. //depot/projects/vimage/src/sys/netinet/in_pcb.h#25 edit
.. //depot/projects/vimage/src/sys/netinet/in_var.h#15 edit
.. //depot/projects/vimage/src/sys/netinet/ip_fw2.c#60 edit
.. //depot/projects/vimage/src/sys/sys/vimage.h#74 edit

Differences ...

==== //depot/projects/vimage/src/sys/kern/kern_uuid.c#13 (text+ko) ====


==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#71 (text+ko) ====

@@ -28,15 +28,21 @@
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/kern/kern_vimage.c,v 1.1 2008/12/10 23:12:39 zec Exp $");
+
 #include "opt_ddb.h"
 
 #include <sys/param.h>
+#include <sys/types.h>
 #include <sys/kernel.h>
 #include <sys/linker.h>
 #include <sys/lock.h>
 #include <sys/malloc.h>
 #include <sys/priv.h>
 #include <sys/proc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
 #include <sys/refcount.h>
 #include <sys/sched.h>
 #include <sys/sockio.h>
@@ -48,11 +54,13 @@
 #include <ddb/ddb.h>
 #endif
 
-#include <net/vnet.h>
-#include <net/if_types.h>
+#include <net/if.h>
 #include <net/if_dl.h>
 #include <net/if_clone.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
 #include <net/ethernet.h>
+#include <net/vnet.h>
 
 //#define DEBUG_ORDERING
 
@@ -143,7 +151,7 @@
 {
 	struct vnet_modlink *vml, *vml_iter;
 	
-	/* Do not register the same module instance more than once */
+	/* Do not register the same module instance more than once. */
 	TAILQ_FOREACH(vml_iter, &vnet_modlink_head, vml_mod_le)
 		if (vml_iter->vml_modinfo == vmi && vml_iter->vml_iarg == iarg)
 			break;
@@ -605,9 +613,9 @@
 vi_symlookup(struct kld_sym_lookup *lookup, char *symstr)
 {
 	struct vnet_modlink *vml;
+	struct vnet_symmap *mapentry;
 
 	TAILQ_FOREACH(vml, &vnet_modlink_head, vml_mod_le) {
-		struct vnet_symmap *mapentry;
 
 		if (vml->vml_modinfo->vmi_symmap == NULL)
 			continue;
@@ -619,12 +627,11 @@
 				    (u_long) curvnet->mod_data[vml->vml_modinfo->vmi_id];
 				lookup->symvalue += mapentry->offset;
 				lookup->symsize = mapentry->size;
-				return 0;
+				return (0);
 			}
 		}
 	}
-
-	return ENOENT;
+	return (ENOENT);
 }
 
 

==== //depot/projects/vimage/src/sys/net/bpf.c#31 (text+ko) ====


==== //depot/projects/vimage/src/sys/net/if.c#57 (text+ko) ====

@@ -171,7 +171,7 @@
 static struct filterops netdev_filtops =
     { 1, NULL, filt_netdetach, filt_netdev };
 
-#ifdef VIMAGE
+#ifndef VIMAGE_GLOBALS
 static struct vnet_symmap vnet_net_symmap[] = {
 	VNET_SYMMAP(net, ifnet),
 	VNET_SYMMAP(net, rt_tables),
@@ -179,10 +179,10 @@
 	VNET_SYMMAP(net, rttrash),
 	VNET_SYMMAP_END
 };
-#endif
 
 VNET_MOD_DECLARE(NET, net, vnet_net_iattach, vnet_net_idetach,
     NONE, vnet_net_symmap)
+#endif
 
 /*
  * System initialization
@@ -2993,7 +2993,7 @@
 void
 if_deregister_com_alloc(u_char type)
 {
-
+	
 	KASSERT(if_com_alloc[type] != NULL,
 	    ("if_deregister_com_alloc: %d not registered", type));
 	KASSERT(if_com_free[type] != NULL,

==== //depot/projects/vimage/src/sys/net/if_var.h#25 (text+ko) ====


==== //depot/projects/vimage/src/sys/net/raw_cb.h#6 (text+ko) ====

@@ -55,11 +55,9 @@
 #define	RAWRCVQ		8192
 
 #ifdef _KERNEL
-
 #ifdef VIMAGE_GLOBALS
 extern LIST_HEAD(rawcb_list_head, rawcb) rawcb_list;
 #endif
-
 extern struct mtx rawcb_mtx;
 
 /*

==== //depot/projects/vimage/src/sys/netgraph/ng_base.c#49 (text+ko) ====

@@ -3079,7 +3079,6 @@
 	switch (event) {
 	case MOD_LOAD:
 		/* Initialize everything. */
-		V_nextID = 1;
 		NG_WORKLIST_LOCK_INIT();
 		mtx_init(&ng_typelist_mtx, "netgraph types mutex", NULL,
 		    MTX_DEF);

==== //depot/projects/vimage/src/sys/netinet/in_pcb.h#25 (text+ko) ====

@@ -223,7 +223,7 @@
 #define	in6p_ppcb	inp_ppcb  /* for KAME src sync over BSD*'s */
 
 #define	inp_vnet	inp_pcbinfo->ipi_vnet
-};
+
 /*
  * The range of the generation count, as used in this implementation, is 9e19.
  * We would have to create 300 billion connections per second for this number

==== //depot/projects/vimage/src/sys/netinet/in_var.h#15 (text+ko) ====

@@ -84,7 +84,6 @@
 /*
  * Hash table for IP addresses.
  */
-LIST_HEAD(in_ifaddrhashhead, in_ifaddr);
 TAILQ_HEAD(in_ifaddrhead, in_ifaddr);
 LIST_HEAD(in_ifaddrhashhead, in_ifaddr);
 #ifdef VIMAGE_GLOBALS

==== //depot/projects/vimage/src/sys/netinet/ip_fw2.c#60 (text+ko) ====

@@ -136,8 +136,6 @@
 static int verbose_limit;
 #endif
 
-#endif
-
 static uma_zone_t ipfw_dyn_rule_zone;
 
 /*
@@ -156,8 +154,6 @@
 ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr;
 ipfw_nat_cfg_t *ipfw_nat_get_log_ptr;
 
-#ifndef VIMAGE
-
 #ifdef VIMAGE_GLOBALS
 static int fw_debug;
 static int autoinc_step;
@@ -4527,7 +4523,7 @@
 	}
 done:
 	callout_reset(&V_ipfw_timeout, V_dyn_keepalive_period * hz,
-	    ipfw_tick, arg);
+		      ipfw_tick, arg);
 }
 
 static int vnet_ipfw_iattach(const void *unused)

==== //depot/projects/vimage/src/sys/sys/vimage.h#74 (text+ko) ====

@@ -50,10 +50,23 @@
 struct	vprocg;
 struct	vnet;
 struct	vi_req;
+struct	vnet_modinfo;
 struct	kld_sym_lookup; 
 
 struct	ifnet;		/* XXX must go away */
 
+#ifdef VIMAGE_GLOBALS
+#define	VSYM(base, sym) (sym)
+#else
+#ifdef VIMAGE
+#define VSYM(base, sym) ((base)->_##sym)
+#else
+#define	VSYM(base, sym) (base ## _0._ ## sym)
+#endif
+#endif
+
+#ifdef VIMAGE
+
 #define curvnet curthread->td_vnet
 
 #define basevnet thread0.td_ucred->cr_vimage->v_net
@@ -64,8 +77,6 @@
 typedef int vnet_detach_fn(const void *);
 
 
-#ifdef VIMAGE
- 
 #define	V_GLOBAL	0
 #define	V_NET		1
 #define	V_PROCG		2
@@ -173,8 +184,6 @@
 		.vmi_idetach		= m_idetach			\
 };
 
-#define VSYM(base, sym) ((base)->_##sym)
-
 #define VNET_SYMMAP(mod, name)						\
 	{ #name, offsetof(struct vnet_##mod, _##name),			\
 	sizeof(((struct vnet_##mod *) curthread)->_##name) }
@@ -278,7 +287,6 @@
 #define CURVNET_SET_QUIET(arg)
 #define CURVNET_RESTORE()
 #define VNET_ASSERT(condition)
-#define VSYM(base, sym) (sym)
 #define INIT_FROM_VNET(vnet, modindex, modtype, sym)
 #define VNET_ITERATOR_DECL(arg)
 #define VNET_FOREACH(arg)
@@ -304,7 +312,11 @@
 #define VCPU(sym)		VSYM(vcpu, sym)
 
 #define V_hostname		VPROCG(hostname)
+#ifdef VIMAGE
 #define G_hostname		VSYM(basevprocg, hostname) /* global hostname */
+#else
+#define G_hostname		VSYM(vprocg, hostname) /* global hostname */
+#endif
 #define V_domainname		VPROCG(domainname)
 #define V_morphing_symlinks	VPROCG(morphing_symlinks)
 
@@ -312,19 +324,19 @@
 #define V_avg1_fixp		VCPU(avg1_fixp)
 #define V_avg2_fixp		VCPU(avg2_fixp)
 
-#ifdef VIMAGE
+#ifndef VIMAGE_GLOBALS
 void vnet_mod_register(const struct vnet_modinfo *);
 void vnet_mod_deregister(const struct vnet_modinfo *);
 void vnet_mod_register_multi(const struct vnet_modinfo *, void *, char *);
 void vnet_mod_deregister_multi(const struct vnet_modinfo *, void *, char *);
+int	vi_symlookup(struct kld_sym_lookup *, char *);
+#endif
 
-void printcpuinfo(struct vprocg *);
-void	vi_cpu_acct(void *);
+#ifdef VIMAGE
 int	vi_td_ioctl(u_long, struct vi_req *, struct thread *);
 int	vi_if_move(struct vi_req *, struct ifnet *, struct vimage *);
 void	if_reassign_common(struct ifnet *, struct vnet *, const char *);
 
-int	vi_symlookup(struct kld_sym_lookup *, char *);
 struct	vimage *vnet2vimage(struct vnet *);
 struct	vimage *vimage_by_name(struct vimage *, char *);
 char	*vnet_name(struct vnet *);
@@ -377,6 +389,8 @@
 	struct	vnet *v_net;
 };
 
+#endif /* VIMAGE */
+
 struct vprocg {
 	LIST_ENTRY(vprocg) vprocg_le;
 	u_int	vprocg_ref;		/* reference count */
@@ -400,7 +414,11 @@
 	u_int	_avg2_fixp;		/* "slow" avg in 16:16 bit fixedpoint */
 };
 
-#endif /* VIMAGE */
+#ifndef VIMAGE_GLOBALS
+#ifndef VIMAGE
+extern struct vprocg vprocg_0;
+#endif
+#endif
 
 struct vi_req {
 	int	req_action;		/* What to do with this reqest? */
@@ -442,7 +460,4 @@
 #define VI_SET_NAME		0x00100000
 #define VI_SET_CHROOT		0x00200000
 
-int	vi_symlookup(struct kld_sym_lookup *, char *);
-void	vnet_mod_register(const struct vnet_modinfo *);
-
 #endif /* !_SYS_VIMAGE_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812141710.mBEHAwcC083543>