Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2009 15:06:32 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 161386 for review
Message-ID:  <200904301506.n3UF6WmH018260@repoman.freebsd.org>

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

Change 161386 by zec@zec_amdx2 on 2009/04/30 15:05:53

	Unbreak GENERIC & VIMAGE builds.

Affected files ...

.. //depot/projects/vimage-commit2/src/sys/kern/kern_vimage.c#23 edit
.. //depot/projects/vimage-commit2/src/sys/netinet6/mld6.c#18 edit
.. //depot/projects/vimage-commit2/src/sys/sys/vimage.h#47 edit

Differences ...

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

@@ -57,8 +57,6 @@
 static int vnet_mod_destructor(struct vnet_modlink *);
 
 #ifdef VIMAGE
-/* curvnet should be thread-local - this is only a temporary step. */
-struct vnet *curvnet;
 struct vnet_list_head vnet_head;
 #endif
 

==== //depot/projects/vimage-commit2/src/sys/netinet6/mld6.c#18 (text+ko) ====

@@ -2908,7 +2908,7 @@
 	 * indexes to guard against interface detach, they are
 	 * unique to each VIMAGE and must be retrieved.
 	 */
-	CURVNET_SET(m->m_pkthdr.header);
+	CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); /* XXX Marko revisit! */
 	INIT_VNET_NET(curvnet);
 	INIT_VNET_INET6(curvnet);
 	ifindex = mld_restore_context(m);

==== //depot/projects/vimage-commit2/src/sys/sys/vimage.h#47 (text+ko) ====

@@ -162,43 +162,6 @@
 	void		*mod_data[VNET_MOD_MAX];
 	LIST_ENTRY(vnet) vnet_le;	/* all vnets list */
 	u_int		 vnet_magic_n;
-};
-#endif
-
-#ifdef VIMAGE
-extern struct vnet *curvnet;	/* XXX will become thread-local soon */
-#else
-#define	curvnet NULL
-#endif
-
-#ifdef VIMAGE
-#ifdef VNET_DEBUG
-#define	INIT_FROM_VNET(vnet, modindex, modtype, sym)			\
-	if (vnet == NULL || vnet != curvnet)				\
-		panic("in %s:%d %s()\n vnet=%p curvnet=%p",		\
-		    __FILE__, __LINE__, __FUNCTION__,			\
-		    vnet, curvnet);					\
-	modtype *sym = (vnet)->mod_data[modindex];
-#else /* !VNET_DEBUG */
-#define	INIT_FROM_VNET(vnet, modindex, modtype, sym)			\
-	modtype *sym = (vnet)->mod_data[modindex];
-#endif /* !VNET_DEBUG */
-#else /* !VIMAGE */
-#define	INIT_FROM_VNET(vnet, modindex, modtype, sym)
-#endif
-
-#ifdef VIMAGE
-LIST_HEAD(vnet_list_head, vnet);
-extern struct vnet_list_head vnet_head;
-#define	VNET_ITERATOR_DECL(arg) struct vnet *arg;
-#define	VNET_FOREACH(arg) LIST_FOREACH(arg, &vnet_head, vnet_le)
-#else
-#define	VNET_ITERATOR_DECL(arg)
-#define	VNET_FOREACH(arg)
-#endif
-
-#define	TD_TO_VNET(td)	curvnet
-
 	u_int		 ifccnt;
 	u_int		 sockcnt;
 };
@@ -207,7 +170,7 @@
 #ifdef VIMAGE
 #define curvnet curthread->td_vnet
 #else
-#define curvnet NULL
+#define	curvnet NULL
 #endif
 
 #define VNET_MAGIC_N 0x3e0d8f29
@@ -264,14 +227,14 @@
 
 #ifdef VIMAGE
 #ifdef VNET_DEBUG
-#define INIT_FROM_VNET(vnet, modindex, modtype, sym)			\
+#define	INIT_FROM_VNET(vnet, modindex, modtype, sym)			\
 	if (vnet == NULL || vnet != curvnet)				\
 		panic("in %s:%d %s()\n vnet=%p curvnet=%p",		\
 		    __FILE__, __LINE__, __FUNCTION__,			\
 		    vnet, curvnet);					\
 	modtype *sym = (vnet)->mod_data[modindex];
 #else /* !VNET_DEBUG */
-#define INIT_FROM_VNET(vnet, modindex, modtype, sym)			\
+#define	INIT_FROM_VNET(vnet, modindex, modtype, sym)			\
 	modtype *sym = (vnet)->mod_data[modindex];
 #endif /* !VNET_DEBUG */
 #else /* !VIMAGE */
@@ -281,8 +244,8 @@
 #ifdef VIMAGE
 LIST_HEAD(vnet_list_head, vnet);
 extern struct vnet_list_head vnet_head;
-#define VNET_ITERATOR_DECL(arg) struct vnet *arg;
-#define VNET_FOREACH(arg) LIST_FOREACH(arg, &vnet_head, vnet_le)
+#define	VNET_ITERATOR_DECL(arg) struct vnet *arg;
+#define	VNET_FOREACH(arg) LIST_FOREACH(arg, &vnet_head, vnet_le)
 #else
 #define	VNET_ITERATOR_DECL(arg)
 #define	VNET_FOREACH(arg)



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