Author: mmacy
Date: Mon May 21 01:53:23 2018
New Revision: 333957
URL: https://svnweb.freebsd.org/changeset/base/333957

Log:
  ck: simplify interface with libkvm consumers by defining ck_queue types
  as their queue.h equivalents if !_KERNEL

Added:
  head/sys/sys/ck.h   (contents, props changed)
Modified:
  head/sys/net/if_var.h

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h       Mon May 21 01:39:26 2018        (r333956)
+++ head/sys/net/if_var.h       Mon May 21 01:53:23 2018        (r333957)
@@ -76,10 +76,10 @@ struct      netdump_methods;
 #include <sys/mbuf.h>          /* ifqueue only? */
 #include <sys/buf_ring.h>
 #include <net/vnet.h>
-#include <ck_queue.h>
-#include <sys/epoch.h>
 #endif /* _KERNEL */
+#include <sys/ck.h>
 #include <sys/counter.h>
+#include <sys/epoch.h>
 #include <sys/lock.h>          /* XXX */
 #include <sys/mutex.h>         /* struct ifqueue */
 #include <sys/rwlock.h>                /* XXX */
@@ -90,13 +90,8 @@ struct       netdump_methods;
 #include <net/altq/if_altq.h>
 
 TAILQ_HEAD(ifnethead, ifnet);  /* we use TAILQs so that the order of */
-#ifdef _KERNEL
 CK_STAILQ_HEAD(ifaddrhead, ifaddr);    /* instantiation is preserved in the 
list */
 CK_STAILQ_HEAD(ifmultihead, ifmultiaddr);
-#else
-STAILQ_HEAD(ifaddrhead, ifaddr);       /* instantiation is preserved in the 
list */
-STAILQ_HEAD(ifmultihead, ifmultiaddr);
-#endif
 TAILQ_HEAD(ifgrouphead, ifg_group);
 
 #ifdef _KERNEL
@@ -522,7 +517,7 @@ struct ifaddr {
        struct  sockaddr *ifa_netmask;  /* used to determine subnet */
        struct  ifnet *ifa_ifp;         /* back-pointer to interface */
        struct  carp_softc *ifa_carp;   /* pointer to CARP data */
-       STAILQ_ENTRY(ifaddr) ifa_link;  /* queue macro glue */
+       CK_STAILQ_ENTRY(ifaddr) ifa_link;       /* queue macro glue */
        void    (*ifa_rtrequest)        /* check or clean routes (+ or -)'d */
                (int, struct rtentry *, struct rt_addrinfo *);
        u_short ifa_flags;              /* mostly rt_flags for cloning */
@@ -546,7 +541,7 @@ void        ifa_ref(struct ifaddr *ifa);
  * structure except that it keeps track of multicast addresses.
  */
 struct ifmultiaddr {
-       STAILQ_ENTRY(ifmultiaddr) ifma_link; /* queue macro glue */
+       CK_STAILQ_ENTRY(ifmultiaddr) ifma_link; /* queue macro glue */
        struct  sockaddr *ifma_addr;    /* address this membership is for */
        struct  sockaddr *ifma_lladdr;  /* link-layer translation, if any */
        struct  ifnet *ifma_ifp;        /* back-pointer to interface */

Added: head/sys/sys/ck.h
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/sys/ck.h   Mon May 21 01:53:23 2018        (r333957)
@@ -0,0 +1,13 @@
+/*
+ * $FreeBSD$
+ */
+#ifdef _KERNEL
+#include <ck_queue.h>
+#include <ck_epoch.h>
+#else
+#include <sys/queue.h>
+#define CK_STAILQ_HEAD STAILQ_HEAD
+#define CK_STAILQ_ENTRY STAILQ_ENTRY
+#define CK_LIST_HEAD LIST_HEAD
+#define CK_LIST_ENTRY LIST_ENTRY
+#endif
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to