Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Nov 2011 21:07:49 +0100
From:      Robert Millan <rmh@freebsd.org>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Kostik Belousov <kostikbel@gmail.com>, Adrian Chadd <adrian@freebsd.org>, freebsd-current@freebsd.org, Bruce Evans <brde@optusnet.com.au>, freebsd-arch@freebsd.org
Subject:   Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers (v2)
Message-ID:  <20111126200749.GA72056@thorin>
In-Reply-To: <FBFD9FCA-1B01-4B66-8350-16F0410DE0F9@bsdimp.com>
References:  <20111123070036.GA29952@thorin> <20111124141821.O932@besplex.bde.org> <CAOfDtXMaHCW4rfEhzfhThGn6kY0=%2B209VhqFSBq9EF03fZLBhw@mail.gmail.com> <20111125150324.G1018@besplex.bde.org> <FBFD9FCA-1B01-4B66-8350-16F0410DE0F9@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--JP+T4n/bALQSJXh8
Content-Type: multipart/mixed; boundary="0OAP2g/MAC+5xKAE"
Content-Disposition: inline


--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 25, 2011 at 11:16:15AM -0700, Warner Losh wrote:
> Hey Bruce,
>=20
> These sound like good suggestions, but I'd hoped to actually go through a=
ll these files with a fine-toothed comb to see which ones were still releva=
nt.  You've found a bunch of good areas to clean up, but I'd like to humbly=
 suggest they be done in a follow-on commit.

Hi,

I'm sending a new patch.  Thanks Bruce for your input.  TTBOMK this corrects
all the problems you spotted that were introduced by my patch.  It doesn't
fix pre-existing problems in the files however, except in cases where I had
to modify that line anyway.

I think it's a good compromise between my initial patch and an exhaustive
cleanup of those headers (which I'm probably not the most indicate for).

--=20
Robert Millan

--0OAP2g/MAC+5xKAE
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="gnu-kfreebsd_headers.diff"
Content-Transfer-Encoding: quoted-printable

Index: sys/cam/scsi/scsi_low.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/cam/scsi/scsi_low.h	(revision 227956)
+++ sys/cam/scsi/scsi_low.h	(working copy)
@@ -53,10 +53,10 @@
 #define	SCSI_LOW_INTERFACE_XS
 #endif	/* __NetBSD__ */
=20
-#ifdef	__FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define	SCSI_LOW_INTERFACE_CAM
 #define	CAM
-#endif	/* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 /******** includes *******************************/
 #ifdef	__NetBSD__
@@ -64,7 +64,7 @@
 #include <dev/isa/ccbque.h>
 #endif	/* __NetBSD__ */
=20
-#ifdef	__FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <sys/device_port.h>
 #include <sys/kdb.h>
 #include <cam/cam.h>
@@ -75,7 +75,7 @@
=20
 #include <cam/scsi/scsi_dvcfg.h>
 #include <i386/isa/ccbque.h>
-#endif	/* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 /******** functions macro ************************/
 #ifdef	__NetBSD__
@@ -85,13 +85,13 @@
 #define	SCSI_LOW_BZERO(pt, size)	memset((pt), 0, (size))
 #endif	/* __NetBSD__ */
=20
-#ifdef	__FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #undef	MSG_IDENTIFY
 #define	SCSI_LOW_DEBUGGER(dev)	kdb_enter(KDB_WHY_CAM, dev)
 #define	SCSI_LOW_DELAY(mu)	DELAY((mu))
 #define	SCSI_LOW_SPLSCSI	splcam
 #define	SCSI_LOW_BZERO(pt, size)	bzero((pt), (size))
-#endif	/* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 /******** os depend interface structures **********/
 #ifdef	__NetBSD__
@@ -111,7 +111,7 @@
 };
 #endif	/* __NetBSD__ */
=20
-#ifdef	__FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 typedef	struct scsi_sense_data scsi_low_osdep_sense_data_t;
=20
 struct scsi_low_osdep_interface {
@@ -134,7 +134,7 @@
=20
 struct scsi_low_osdep_lun_interface {
 };
-#endif	/* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 /******** os depend interface functions *************/
 struct slccb;
Index: sys/cam/scsi/scsi_low_pisa.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/cam/scsi/scsi_low_pisa.h	(revision 227956)
+++ sys/cam/scsi/scsi_low_pisa.h	(working copy)
@@ -40,8 +40,8 @@
 int scsi_low_notify_pisa(pisa_device_handle_t, pisa_event_t);
 #endif	/* __NetBSD__ */
=20
-#ifdef	__FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 int scsi_low_activate_pisa(struct scsi_low_softc *, int);
 int scsi_low_deactivate_pisa(struct scsi_low_softc *);
-#endif	/* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
 #endif	/* !_SCSI_LOW_PISA_H_ */
Index: sys/contrib/altq/altq/altq_var.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/contrib/altq/altq/altq_var.h	(revision 227956)
+++ sys/contrib/altq/altq/altq_var.h	(working copy)
@@ -201,7 +201,7 @@
 #define	CALLOUT_STOP(c)		untimeout((c)->c_func,(c)->c_arg)
 #define	CALLOUT_INITIALIZER	{ NULL, NULL }
 #endif
-#if !defined(__FreeBSD__)
+#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
 typedef void (timeout_t)(void *);
 #endif
=20
Index: sys/contrib/altq/altq/if_altq.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/contrib/altq/altq/if_altq.h	(revision 227956)
+++ sys/contrib/altq/altq/if_altq.h	(working copy)
@@ -29,7 +29,7 @@
 #ifndef _ALTQ_IF_ALTQ_H_
 #define	_ALTQ_IF_ALTQ_H_
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <sys/lock.h>		/* XXX */
 #include <sys/mutex.h>		/* XXX */
 #include <sys/event.h>		/* XXX */
@@ -51,7 +51,7 @@
 	int	ifq_len;
 	int	ifq_maxlen;
 	int	ifq_drops;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 	struct	mtx ifq_mtx;
 #endif
=20
Index: sys/contrib/pf/net/if_pflog.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/contrib/pf/net/if_pflog.h	(revision 227956)
+++ sys/contrib/pf/net/if_pflog.h	(working copy)
@@ -30,7 +30,7 @@
 #define	PFLOGIFS_MAX	16
=20
 struct pflog_softc {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 	struct ifnet		*sc_ifp;	/* the interface pointer */
 #else
 	struct ifnet		sc_if;		/* the interface */
@@ -74,7 +74,7 @@
 #define	OLD_PFLOG_HDRLEN	sizeof(struct old_pfloghdr)
=20
 #ifdef _KERNEL
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 struct pf_rule;
 struct pf_ruleset;
 struct pfi_kif;
Index: sys/contrib/pf/net/if_pflow.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/contrib/pf/net/if_pflow.h	(revision 227956)
+++ sys/contrib/pf/net/if_pflow.h	(working copy)
@@ -66,7 +66,7 @@
 	unsigned int		 sc_maxcount;
 	u_int64_t		 sc_gcounter;
 	struct ip_moptions	 sc_imo;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 	struct callout		 sc_tmo;
 #else
 	struct timeout		 sc_tmo;
Index: sys/contrib/pf/net/if_pfsync.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/contrib/pf/net/if_pfsync.h	(revision 227956)
+++ sys/contrib/pf/net/if_pfsync.h	(working copy)
@@ -268,7 +268,7 @@
 	int		 pfsyncr_authlevel;
 };
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define	SIOCSETPFSYNC   _IOW('i', 247, struct ifreq)
 #define	SIOCGETPFSYNC   _IOWR('i', 248, struct ifreq)
 #endif
@@ -288,7 +288,7 @@
 #define	PFSYNC_S_DEFER	0xfe
 #define	PFSYNC_S_NONE	0xff
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 void			pfsync_input(struct mbuf *, __unused int);
 #else
 void			pfsync_input(struct mbuf *, ...);
@@ -300,7 +300,7 @@
 #define	PFSYNC_SI_CKSUM		0x02
 #define	PFSYNC_SI_ACK		0x04
 int			pfsync_state_import(struct pfsync_state *, u_int8_t);
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
 void			pfsync_state_export(struct pfsync_state *,
 			    struct pf_state *);
 #endif
Index: sys/contrib/pf/net/pfvar.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/contrib/pf/net/pfvar.h	(revision 227956)
+++ sys/contrib/pf/net/pfvar.h	(working copy)
@@ -37,7 +37,7 @@
 #include <sys/types.h>
 #include <sys/queue.h>
 #include <sys/tree.h>
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <sys/lock.h>
 #include <sys/sx.h>
 #else
@@ -46,7 +46,7 @@
=20
 #include <net/radix.h>
 #include <net/route.h>
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <net/if_clone.h>
 #include <net/pf_mtag.h>
 #include <vm/uma.h>
@@ -54,7 +54,7 @@
 #include <netinet/ip_ipsp.h>
 #endif
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <netinet/in.h>
 #endif
=20
@@ -62,7 +62,7 @@
=20
 struct ip;
 struct ip6_hdr;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 struct inpcb;
 #endif
=20
@@ -173,7 +173,7 @@
 		}			 a;
 		char			 ifname[IFNAMSIZ];
 		char			 tblname[PF_TABLE_NAME_SIZE];
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define	RTLABEL_LEN	32
 #endif
 		char			 rtlabelname[RTLABEL_LEN];
@@ -211,7 +211,7 @@
  * Address manipulation macros
  */
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define	splsoftnet()	splnet()
=20
 #define	HTONL(x)	(x) =3D htonl((__uint32_t)(x))
@@ -236,7 +236,7 @@
 	if (var)					\
 		uma_zdestroy(var)
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 extern struct mtx pf_task_mtx;
=20
 #define	PF_LOCK_ASSERT()	mtx_assert(&pf_task_mtx, MA_OWNED)
@@ -255,7 +255,7 @@
 #define	PF_UNLOCK_ASSERT()
 #define	PF_LOCK()
 #define	PF_UNLOCK()
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 #define	PF_COPYIN(uaddr, kaddr, len, r)		do {	\
 	PF_UNLOCK();					\
@@ -279,7 +279,7 @@
 #define	PFSYNC_MINVER	1
 #define	PFSYNC_PREFVER	PFSYNC_MODVER
 #define	PFSYNC_MAXVER	1
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
 #ifdef INET
 #ifndef INET6
 #define	PF_INET_ONLY
@@ -833,7 +833,7 @@
 	u_int64_t		 id;
 	u_int32_t		 creatorid;
 	u_int8_t		 direction;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 	u_int8_t		 pad[2];
 	u_int8_t		 local_flags;
 #define	PFSTATE_EXPIRING 0x01
@@ -923,7 +923,7 @@
 	sa_family_t	 af;
 	u_int8_t	 proto;
 	u_int8_t	 direction;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 	u_int8_t	 local_flags;
 #define	PFSTATE_EXPIRING		0x01
 	u_int8_t	 pad;
@@ -935,7 +935,7 @@
 	u_int8_t	 updates;
 } __packed;
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #ifdef _KERNEL
 /* pfsync */
 typedef int		pfsync_state_import_t(struct pfsync_state *, u_int8_t);
@@ -1215,7 +1215,7 @@
 RB_HEAD(pfi_ifhead, pfi_kif);
=20
 /* state tables */
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #ifdef _KERNEL
 VNET_DECLARE(struct pf_state_tree,	 pf_statetbl);
 #define	V_pf_statetbl			 VNET(pf_statetbl)
@@ -1277,7 +1277,7 @@
 	struct pf_addr	*dst;		/* dst address */
 	u_int16_t *sport;
 	u_int16_t *dport;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 	struct pf_mtag	*pf_mtag;
 #endif
=20
@@ -1403,7 +1403,7 @@
 			*(a) =3D (x); \
 	} while (0)
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define REASON_SET(a, x) \
 	do { \
 		if ((a) !=3D NULL) \
@@ -1488,7 +1488,7 @@
 	u_int32_t		 parent_qid;	/* parent queue id */
 	u_int32_t		 bandwidth;	/* queue bandwidth */
 	u_int8_t		 priority;	/* priority */
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 	u_int8_t		 local_flags;	/* dynamic interface */
 #define	PFALTQ_FLAG_IF_REMOVED		0x01
 #endif
@@ -1768,7 +1768,7 @@
 #define	DIOCSETIFFLAG	_IOWR('D', 89, struct pfioc_iface)
 #define	DIOCCLRIFFLAG	_IOWR('D', 90, struct pfioc_iface)
 #define	DIOCKILLSRCNODES	_IOWR('D', 91, struct pfioc_src_node_kill)
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 struct pf_ifspeed {
 	char			ifname[IFNAMSIZ];
 	u_int32_t		baudrate;
@@ -1779,7 +1779,7 @@
 #ifdef _KERNEL
 RB_HEAD(pf_src_tree, pf_src_node);
 RB_PROTOTYPE(pf_src_tree, pf_src_node, entry, pf_src_compare);
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 VNET_DECLARE(struct pf_src_tree,	 tree_src_tracking);
 #define	V_tree_src_tracking		 VNET(tree_src_tracking)
 #else
@@ -1789,7 +1789,7 @@
 RB_HEAD(pf_state_tree_id, pf_state);
 RB_PROTOTYPE(pf_state_tree_id, pf_state,
     entry_id, pf_state_compare_id);
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 VNET_DECLARE(struct pf_state_tree_id,	 tree_id);
 #define	V_tree_id			 VNET(tree_id)
 VNET_DECLARE(struct pf_state_queue,	 state_list);
@@ -1800,14 +1800,14 @@
 #endif
=20
 TAILQ_HEAD(pf_poolqueue, pf_pool);
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 VNET_DECLARE(struct pf_poolqueue,	 pf_pools[2]);
 #define	V_pf_pools			 VNET(pf_pools)
 #else
 extern struct pf_poolqueue		  pf_pools[2];
 #endif
 TAILQ_HEAD(pf_altqqueue, pf_altq);
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 VNET_DECLARE(struct pf_altqqueue,	 pf_altqs[2]);
 #define	V_pf_altqs			 VNET(pf_altqs)
 VNET_DECLARE(struct pf_palist,		 pf_pabuf);
@@ -1817,7 +1817,7 @@
 extern struct pf_palist			  pf_pabuf;
 #endif
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 VNET_DECLARE(u_int32_t,			 ticket_altqs_active);
 #define	V_ticket_altqs_active		 VNET(ticket_altqs_active)
 VNET_DECLARE(u_int32_t,			 ticket_altqs_inactive);
@@ -1849,7 +1849,7 @@
 extern void			 pf_tbladdr_remove(struct pf_addr_wrap *);
 extern void			 pf_tbladdr_copyout(struct pf_addr_wrap *);
 extern void			 pf_calc_skip_steps(struct pf_rulequeue *);
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #ifdef ALTQ
 extern	void			 pf_altq_ifnet_event(struct ifnet *, int);
 #endif
@@ -1886,7 +1886,7 @@
 extern struct pool		 pf_state_scrub_pl;
 #endif
 extern void			 pf_purge_thread(void *);
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 extern int			 pf_purge_expired_src_nodes(int);
 extern int			 pf_purge_expired_states(u_int32_t , int);
 #else
@@ -1911,7 +1911,7 @@
 extern u_int16_t		 pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t,
 				    u_int8_t);
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 VNET_DECLARE(struct ifnet *,		 sync_ifp);
 #define	V_sync_ifp		 	 VNET(sync_ifp);
 VNET_DECLARE(struct pf_rule,		 pf_default_rule);
@@ -1924,12 +1924,12 @@
 				    u_int8_t);
 void				 pf_rm_rule(struct pf_rulequeue *,
 				    struct pf_rule *);
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
 struct pf_divert		*pf_find_divert(struct mbuf *);
 #endif
=20
 #ifdef INET
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 int	pf_test(int, struct ifnet *, struct mbuf **, struct ether_header *,
     struct inpcb *);
 #else
@@ -1938,7 +1938,7 @@
 #endif /* INET */
=20
 #ifdef INET6
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 int	pf_test6(int, struct ifnet *, struct mbuf **, struct ether_header *,
     struct inpcb *);
 #else
@@ -1949,7 +1949,7 @@
 void	pf_addr_inc(struct pf_addr *, sa_family_t);
 #endif /* INET6 */
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 u_int32_t	pf_new_isn(struct pf_state *);
 #endif
 void   *pf_pull_hdr(struct mbuf *, int, void *, int, u_short *, u_short *,
@@ -1986,7 +1986,7 @@
 void	pf_purge_expired_fragments(void);
 int	pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *);
 int	pf_rtlabel_match(struct pf_addr *, sa_family_t, struct pf_addr_wrap *);
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 int	pf_socket_lookup(int, struct pf_pdesc *,  struct inpcb *);
 #else
 int	pf_socket_lookup(int, struct pf_pdesc *);
@@ -2031,7 +2031,7 @@
 int	pfr_ina_define(struct pfr_table *, struct pfr_addr *, int, int *,
 	    int *, u_int32_t, int);
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 VNET_DECLARE(struct pfi_kif *,		 pfi_all);
 #define	V_pfi_all	 		 VNET(pfi_all)
 #else
@@ -2039,7 +2039,7 @@
 #endif
=20
 void		 pfi_initialize(void);
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 void		 pfi_cleanup(void);
 #endif
 struct pfi_kif	*pfi_kif_get(const char *);
@@ -2061,7 +2061,7 @@
 int		 pfi_set_flags(const char *, int);
 int		 pfi_clear_flags(const char *, int);
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 int		 pf_match_tag(struct mbuf *, struct pf_rule *, int *,
 		    struct pf_mtag *);
 #else
@@ -2071,7 +2071,7 @@
 void		 pf_tag2tagname(u_int16_t, char *);
 void		 pf_tag_ref(u_int16_t);
 void		 pf_tag_unref(u_int16_t);
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 int		 pf_tag_packet(struct mbuf *, int, int, struct pf_mtag *);
 #else
 int		 pf_tag_packet(struct mbuf *, int, int);
@@ -2080,14 +2080,14 @@
 void		 pf_qid2qname(u_int32_t, char *);
 void		 pf_qid_unref(u_int32_t);
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 VNET_DECLARE(struct pf_status,		 pf_status);
 #define	V_pf_status			 VNET(pf_status)
 #else
 extern struct pf_status	pf_status;
 #endif
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 VNET_DECLARE(uma_zone_t,		 pf_frent_pl);
 #define	V_pf_frent_pl			 VNET(pf_frent_pl)
 VNET_DECLARE(uma_zone_t,		 pf_frag_pl);
@@ -2103,14 +2103,14 @@
 	void		*pp;
 	unsigned	 limit;
 };
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 VNET_DECLARE(struct pf_pool_limit,		 pf_pool_limits[PF_LIMIT_MAX]);
 #define	V_pf_pool_limits			 VNET(pf_pool_limits)
 #else
 extern struct pf_pool_limit	pf_pool_limits[PF_LIMIT_MAX];
 #endif
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 struct pf_frent {
 	LIST_ENTRY(pf_frent) fr_next;
 	struct ip *fr_ip;
@@ -2140,11 +2140,11 @@
 		LIST_HEAD(pf_cacheq, pf_frcache) fru_cache;	/* non-buf */
 	} fr_u;
 };
-#endif /* (__FreeBSD__) */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 #endif /* _KERNEL */
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #ifdef _KERNEL
 VNET_DECLARE(struct pf_anchor_global,		 pf_anchors);
 #define	V_pf_anchors				 VNET(pf_anchors)
@@ -2172,7 +2172,7 @@
 struct pf_ruleset	*pf_find_or_create_ruleset(const char *);
 void			 pf_rs_initialize(void);
=20
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
 #ifdef _KERNEL
 int			 pf_anchor_copyout(const struct pf_ruleset *,
 			    const struct pf_rule *, struct pfioc_rule *);
@@ -2193,7 +2193,7 @@
 	    const struct tcphdr *);
 void	pf_osfp_flush(void);
 int	pf_osfp_get(struct pf_osfp_ioctl *);
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 int	pf_osfp_initialize(void);
 void	pf_osfp_cleanup(void);
 #else
Index: sys/dev/firewire/firewirereg.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/dev/firewire/firewirereg.h	(revision 227956)
+++ sys/dev/firewire/firewirereg.h	(working copy)
@@ -75,7 +75,8 @@
 };
=20
 struct firewire_softc {
-#if defined(__FreeBSD__) && __FreeBSD_version >=3D 500000
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \
+    __FreeBSD_version >=3D 500000
 	struct cdev *dev;
 #endif
 	struct firewire_comm *fc;
Index: sys/dev/lmc/if_lmc.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/dev/lmc/if_lmc.h	(revision 227956)
+++ sys/dev/lmc/if_lmc.h	(working copy)
@@ -984,7 +984,8 @@
 #endif
   u_int32_t address1;		/* buffer1 bus address */
   u_int32_t address2;		/* buffer2 bus address */
-#if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__))
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+    defined(__NetBSD__) || defined(__OpenBSD__))
   bus_dmamap_t map;		/* bus dmamap for this descriptor */
 # define TLP_BUS_DSL_VAL	(sizeof(bus_dmamap_t) & TLP_BUS_DSL)
 #else
@@ -1035,7 +1036,8 @@
 #elif BSD
   struct mbuf *head;		/* tail-queue of mbufs */
   struct mbuf *tail;
-# if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__))
+# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+     defined(__NetBSD__) || defined(__OpenBSD__))
   bus_dma_tag_t tag;		/* bus_dma tag for desc array */
   bus_dmamap_t map;		/* bus_dma map for desc array */
   bus_dma_segment_t segs[2];	/* bus_dmamap_load() or bus_dmamem_alloc() */
@@ -1068,7 +1070,8 @@
  */
 #define IOREF_CSR 1  /* access Tulip CSRs with IO cycles if 1 */
=20
-#if (defined(__FreeBSD__) && defined(DEVICE_POLLING))
+#if ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \
+    defined(DEVICE_POLLING))
 # define DEV_POLL 1
 #else
 # define DEV_POLL 0
@@ -1151,7 +1154,7 @@
 # endif
 #endif
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
   struct callout callout;	/* watchdog needs this                  */
   struct device	*dev;		/* base device pointer                     */
   bus_space_tag_t csr_tag;	/* bus_space needs this                    */
@@ -1173,7 +1176,7 @@
   int		top_spl;	/* lock card->watchdog vs core_ioctl       */
   int		bottom_spl;	/* lock for buf queues & descriptor rings  */
 # endif
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 #ifdef __linux__
   struct pci_dev    *pci_dev;	/* READ/WRITE_PCI_CFG macros need this     */
@@ -1210,7 +1213,7 @@
=20
 /* Hide the minor differences between OS versions */
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
   typedef void intr_return_t;
 # define  READ_PCI_CFG(sc, addr)       pci_read_config ((sc)->dev, addr, 4)
 # define WRITE_PCI_CFG(sc, addr, data) pci_write_config((sc)->dev, addr, d=
ata, 4)
@@ -1264,7 +1267,7 @@
 # if (__FreeBSD_version >=3D 600000)
 #  define IFF_RUNNING		IFF_DRV_RUNNING
 # endif
-#endif  /* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 #ifdef __NetBSD__
   typedef int intr_return_t;
@@ -1531,7 +1534,7 @@
 static int  t1_ioctl(softc_t *, struct ioctl *);
=20
 #if IFNET
-# if ((defined(__FreeBSD__) && (__FreeBSD_version < 500000)) ||\
+# if ((defined(__FreeBSD__) && __FreeBSD_version < 500000) ||\
         defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__))
 static void netisr_dispatch(int, struct mbuf *);
 # endif
@@ -1541,7 +1544,7 @@
 #if BSD
 static void mbuf_enqueue(struct desc_ring *, struct mbuf *);
 static struct mbuf* mbuf_dequeue(struct desc_ring *);
-# ifdef __FreeBSD__
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 static void fbsd_dmamap_load(void *, bus_dma_segment_t *, int, int);
 # endif
 static int create_ring(softc_t *, struct desc_ring *, int);
@@ -1570,7 +1573,8 @@
 static void core_interrupt(void *, int);
 static void user_interrupt(softc_t *, int);
 #if BSD
-# if (defined(__FreeBSD__) && defined(DEVICE_POLLING))
+# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \
+     defined(DEVICE_POLLING)
 static int fbsd_poll(struct ifnet *, enum poll_cmd, int);
 # endif
 static intr_return_t bsd_interrupt(void *);
@@ -1638,12 +1642,12 @@
 static int attach_card(softc_t *, const char *);
 static void detach_card(softc_t *);
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 static int fbsd_probe(device_t);
 static int fbsd_detach(device_t);
 static int fbsd_shutdown(device_t);
 static int fbsd_attach(device_t);
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 #ifdef __NetBSD__
 static int nbsd_match(struct device *t, struct cfdata *, void *);
Index: sys/dev/mpt/mpilib/mpi_type.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/dev/mpt/mpilib/mpi_type.h	(revision 227956)
+++ sys/dev/mpt/mpilib/mpi_type.h	(working copy)
@@ -77,7 +77,7 @@
 typedef signed   short  S16;
 typedef unsigned short  U16;
=20
-#ifdef	__FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
=20
 typedef int32_t  S32;
 typedef uint32_t U32;
Index: sys/dev/wi/if_wireg.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/dev/wi/if_wireg.h	(revision 227956)
+++ sys/dev/wi/if_wireg.h	(working copy)
@@ -84,7 +84,7 @@
 #ifdef __NetBSD__
 #define OS_STRING_NAME	"NetBSD"
 #endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define OS_STRING_NAME	"FreeBSD"
 #endif
 #ifdef __OpenBSD__
Index: sys/fs/nfs/nfs_var.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/fs/nfs/nfs_var.h	(revision 227956)
+++ sys/fs/nfs/nfs_var.h	(working copy)
@@ -76,7 +76,7 @@
 struct nfsvattr;
 struct nfs_vattr;
 struct NFSSVCARGS;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 NFS_ACCESS_ARGS;
 NFS_OPEN_ARGS;
 NFS_GETATTR_ARGS;
Index: sys/net/if_atm.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/net/if_atm.h	(revision 227956)
+++ sys/net/if_atm.h	(working copy)
@@ -202,7 +202,7 @@
=20
 #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
 #define	RTALLOC1(A,B)		rtalloc1((A),(B))
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define	RTALLOC1(A,B)		rtalloc1((A),(B),0UL)
 #endif
=20
Index: sys/net/zlib.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/net/zlib.h	(revision 227956)
+++ sys/net/zlib.h	(working copy)
@@ -510,7 +510,7 @@
    done by inflate().
 */
=20
-#if defined(__FreeBSD__) && defined(_KERNEL)
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(_KERN=
EL)
 #define inflate       inflate_ppp     /* FreeBSD already has an inflate :-=
( */
 #endif
=20
Index: sys/net80211/ieee80211_ioctl.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/net80211/ieee80211_ioctl.h	(revision 227956)
+++ sys/net80211/ieee80211_ioctl.h	(working copy)
@@ -569,7 +569,7 @@
 	uint16_t	sv_vlan;
 };
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 /*
  * FreeBSD-style ioctls.
  */
@@ -849,6 +849,6 @@
 #define	IEEE80211_CLONE_WDSLEGACY	0x0004	/* legacy WDS processing */
 #define	IEEE80211_CLONE_MACADDR		0x0008	/* use specified mac addr */
 #define	IEEE80211_CLONE_TDMA		0x0010	/* operate in TDMA mode */
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 #endif /* _NET80211_IEEE80211_IOCTL_H_ */
Index: sys/net80211/ieee80211_var.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/net80211/ieee80211_var.h	(revision 227956)
+++ sys/net80211/ieee80211_var.h	(working copy)
@@ -34,7 +34,7 @@
 /* NB: portability glue must go first */
 #if defined(__NetBSD__)
 #include <net80211/ieee80211_netbsd.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <net80211/ieee80211_freebsd.h>
 #elif defined(__linux__)
 #include <net80211/ieee80211_linux.h>
Index: sys/netinet/sctp_pcb.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/netinet/sctp_pcb.h	(revision 227956)
+++ sys/netinet/sctp_pcb.h	(working copy)
@@ -240,7 +240,8 @@
 	 * All static structures that anchor the system must be here.
 	 */
 	struct sctp_epinfo sctppcbinfo;
-#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \
+    defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
 	struct sctpstat *sctpstat;
 #else
 	struct sctpstat sctpstat;
@@ -633,7 +634,8 @@
     struct sctp_inpcb *,
     uint8_t co_off);
=20
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \
+    defined(SCTP_MCORE_INPUT) && defined(SMP)
 void
      sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use);
=20
Index: sys/netinet/sctp_structs.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/netinet/sctp_structs.h	(revision 227956)
+++ sys/netinet/sctp_structs.h	(working copy)
@@ -108,7 +108,8 @@
 typedef int (*inp_func) (struct sctp_inpcb *, void *ptr, uint32_t val);
 typedef void (*end_func) (void *ptr, uint32_t val);
=20
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \
+    defined(SCTP_MCORE_INPUT) && defined(SMP)
 /* whats on the mcore control struct */
 struct sctp_mcore_queue {
 	TAILQ_ENTRY(sctp_mcore_queue) next;
Index: sys/netinet/sctp_uio.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/netinet/sctp_uio.h	(revision 227956)
+++ sys/netinet/sctp_uio.h	(working copy)
@@ -1062,7 +1062,8 @@
=20
 #define SCTP_STAT_INCR(_x) SCTP_STAT_INCR_BY(_x,1)
 #define SCTP_STAT_DECR(_x) SCTP_STAT_DECR_BY(_x,1)
-#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \
+    defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
 #define SCTP_STAT_INCR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x +=3D=
 _d)
 #define SCTP_STAT_DECR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x -=3D=
 _d)
 #else
Index: sys/sys/device_port.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/sys/device_port.h	(revision 227956)
+++ sys/sys/device_port.h	(working copy)
@@ -29,7 +29,7 @@
=20
 #if defined(__NetBSD__)
 # include <sys/device.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 # include <sys/module.h>
 # include <sys/bus.h>
 #endif
@@ -43,7 +43,7 @@
 # define DEVPORT_DEVNAME(dev)		(dev).dv_xname
 # define DEVPORT_DEVUNIT(dev)		(dev).dv_unit
=20
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 /*
  * FreeBSD (compatibility for struct device)
  */
@@ -67,4 +67,4 @@
 #define DEVPORT_PDEVALLOC_SOFTC(pdev)	device_get_softc(pdev)
 #define DEVPORT_PDEVGET_SOFTC(pdev)	device_get_softc(pdev)
=20
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
Index: sys/sys/timex.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/sys/timex.h	(revision 227956)
+++ sys/sys/timex.h	(working copy)
@@ -218,7 +218,7 @@
 	long	stbcnt;		/* stability limit exceeded (ro) */
 };
=20
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
=20
 #ifdef _KERNEL
 void	ntp_update_second(int64_t *adjustment, time_t *newsec);
@@ -231,6 +231,6 @@
 __END_DECLS
 #endif /* _KERNEL */
=20
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
=20
 #endif /* !_SYS_TIMEX_H_ */

--0OAP2g/MAC+5xKAE--

--JP+T4n/bALQSJXh8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/kFreeBSD)

iQIcBAEBCAAGBQJO0UcUAAoJELd1onhloKnOaKYP/1aZ0B8BEpO31dTN0jxpmRql
8YsoSbsMVtc+fTDo9IpMPigcy12dDL2j+7NEGhEYZlWC+GkQTeT3gaKQZLp87WAD
h8i1pee4BuHmF/0CWsqEexs7eE9vIXi4tsiPpmAtKQnN7bIFlYjQSSIDFhQYSKKD
LLRjPl2f/5yNA6aMokMUGS64MThoFgp7HU5yvTj3a4yOZb+399k7jJ1oN0CXZeSW
vm75rEz/hmS9c0wkcxbyq/KO24gPU3cfx60TGWtHIso1ue8Bymaa9mtML/M5ksAF
NwtE0Guic8AtyEfcvV8umM4Vj4AbxSgR/CkAfvTa6tqjmEjme88GyYnPDwkPgEfU
FoKv45U7t8j+caOeEjNl6UEqHb7Rju8OZ4e65Vt2kc0ahQyhKPt58hvUy2062x6w
2tQBfrLjYRAbt0/Ch1thBHmY4vLpQhCP91x+lpBEkADDqLlykuKG3pCkE4Zd9eyU
y29iQESed4+kc5QQ8SRPqW4qQXPWG8wpUYKvHG3ZCIIqPychjVz9uuUIaVGpzI2A
wOGgPLts+cL0kMrKVc3zITxMJ6jsR5bMtvDa87vs2u/Vf6Nzy/Q6pAHuRJgmFpnh
xCvv6WTtcEkwxhqWhehQkKtaQTjRPp8wqSTtqpe9R+EAPWwYnPA2X1/9mJIIF6er
BV6uVOJXJkA+oD1OTTy0
=uPGO
-----END PGP SIGNATURE-----

--JP+T4n/bALQSJXh8--



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