Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Nov 2011 08:00:36 +0100
From:      Robert Millan <rmh@freebsd.org>
To:        freebsd-current@freebsd.org, freebsd-arch@freebsd.org
Cc:        Kostik Belousov <kostikbel@gmail.com>, Adrian Chadd <adrian@freebsd.org>
Subject:   [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers (v2)
Message-ID:  <20111123070036.GA29952@thorin>

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

--8GpibOaaTibBMecb
Content-Type: multipart/mixed; boundary="nFreZHaLTZJo0R7j"
Content-Disposition: inline


--nFreZHaLTZJo0R7j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


Here we go again :-)

Out of the kernel headers that are installed in /usr/include/ hierracy, the=
re
are some which include support multiple operating systems (usually FreeBSD =
and
other *BSD flavours).

This patch adds support to detect GNU/kFreeBSD as well.  In all cases, we
match the same declarations as FreeBSD does (which is to be expected in ker=
nel
headers, since both systems share the same kernel).

--=20
Robert Millan

--nFreZHaLTZJo0R7j
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 227831)
+++ sys/cam/scsi/scsi_low.h	(working copy)
@@ -44,6 +44,8 @@
 #ifndef	_SCSI_LOW_H_
 #define	_SCSI_LOW_H_
=20
+#include <sys/param.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
  * Scsi low OSDEP=20
  * (All os depend structures should be here!)
@@ -53,10 +55,10 @@
 #define	SCSI_LOW_INTERFACE_XS
 #endif	/* __NetBSD__ */
=20
-#ifdef	__FreeBSD__
+#ifdef	__FreeBSD_kernel__
 #define	SCSI_LOW_INTERFACE_CAM
 #define	CAM
-#endif	/* __FreeBSD__ */
+#endif	/* __FreeBSD_kernel__ */
=20
 /******** includes *******************************/
 #ifdef	__NetBSD__
@@ -64,7 +66,7 @@
 #include <dev/isa/ccbque.h>
 #endif	/* __NetBSD__ */
=20
-#ifdef	__FreeBSD__
+#ifdef	__FreeBSD_kernel__
 #include <sys/device_port.h>
 #include <sys/kdb.h>
 #include <cam/cam.h>
@@ -75,7 +77,7 @@
=20
 #include <cam/scsi/scsi_dvcfg.h>
 #include <i386/isa/ccbque.h>
-#endif	/* __FreeBSD__ */
+#endif	/* __FreeBSD_kernel__ */
=20
 /******** functions macro ************************/
 #ifdef	__NetBSD__
@@ -85,13 +87,13 @@
 #define	SCSI_LOW_BZERO(pt, size)	memset((pt), 0, (size))
 #endif	/* __NetBSD__ */
=20
-#ifdef	__FreeBSD__
+#ifdef	__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_kernel__ */
=20
 /******** os depend interface structures **********/
 #ifdef	__NetBSD__
@@ -111,7 +113,7 @@
 };
 #endif	/* __NetBSD__ */
=20
-#ifdef	__FreeBSD__
+#ifdef	__FreeBSD_kernel__
 typedef	struct scsi_sense_data scsi_low_osdep_sense_data_t;
=20
 struct scsi_low_osdep_interface {
@@ -134,7 +136,7 @@
=20
 struct scsi_low_osdep_lun_interface {
 };
-#endif	/* __FreeBSD__ */
+#endif	/* __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 227831)
+++ sys/cam/scsi/scsi_low_pisa.h	(working copy)
@@ -34,14 +34,16 @@
 #ifndef	_SCSI_LOW_PISA_H_
 #define	_SCSI_LOW_PISA_H_
=20
+#include <sys/param.h>
+
 #ifdef	__NetBSD__
 int scsi_low_activate_pisa(pisa_device_handle_t);
 int scsi_low_deactivate_pisa(pisa_device_handle_t);
 int scsi_low_notify_pisa(pisa_device_handle_t, pisa_event_t);
 #endif	/* __NetBSD__ */
=20
-#ifdef	__FreeBSD__
+#ifdef	__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_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 227831)
+++ 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_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 227831)
+++ sys/contrib/altq/altq/if_altq.h	(working copy)
@@ -29,7 +29,9 @@
 #ifndef _ALTQ_IF_ALTQ_H_
 #define	_ALTQ_IF_ALTQ_H_
=20
-#ifdef __FreeBSD__
+#include <sys/param.h>
+
+#ifdef __FreeBSD_kernel__
 #include <sys/lock.h>		/* XXX */
 #include <sys/mutex.h>		/* XXX */
 #include <sys/event.h>		/* XXX */
@@ -51,7 +53,7 @@
 	int	ifq_len;
 	int	ifq_maxlen;
 	int	ifq_drops;
-#ifdef __FreeBSD__
+#ifdef __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 227831)
+++ sys/contrib/pf/net/if_pflog.h	(working copy)
@@ -27,10 +27,12 @@
 #ifndef _NET_IF_PFLOG_H_
 #define	_NET_IF_PFLOG_H_
=20
+#include <sys/param.h>
+
 #define	PFLOGIFS_MAX	16
=20
 struct pflog_softc {
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 	struct ifnet		*sc_ifp;	/* the interface pointer */
 #else
 	struct ifnet		sc_if;		/* the interface */
@@ -74,7 +76,7 @@
 #define	OLD_PFLOG_HDRLEN	sizeof(struct old_pfloghdr)
=20
 #ifdef _KERNEL
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 struct pf_rule;
 struct pf_ruleset;
 struct pfi_kif;
@@ -90,7 +92,7 @@
 	if (pflog_packet_ptr !=3D NULL)			\
 		pflog_packet_ptr(i,a,b,c,d,e,f,g,h);    \
 } while (0)
-#else /* ! __FreeBSD__ */
+#else /* ! __FreeBSD_kernel__ */
 #if NPFLOG > 0
 #define	PFLOG_PACKET(i,x,a,b,c,d,e,f,g,h) pflog_packet(i,a,b,c,d,e,f,g,h)
 #else
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 227831)
+++ sys/contrib/pf/net/if_pflow.h	(working copy)
@@ -22,6 +22,8 @@
 #ifndef _NET_IF_PFLOW_H_
 #define	_NET_IF_PFLOW_H_
=20
+#include <sys/param.h>
+
 #define	PFLOW_ID_LEN	sizeof(u_int64_t)
=20
 #define	PFLOW_MAXFLOWS 30
@@ -66,7 +68,7 @@
 	unsigned int		 sc_maxcount;
 	u_int64_t		 sc_gcounter;
 	struct ip_moptions	 sc_imo;
-#ifdef __FreeBSD__
+#ifdef __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 227831)
+++ sys/contrib/pf/net/if_pfsync.h	(working copy)
@@ -45,6 +45,8 @@
 #ifndef _NET_IF_PFSYNC_H_
 #define	_NET_IF_PFSYNC_H_
=20
+#include <sys/param.h>
+
 #define	PFSYNC_VERSION		5
 #define	PFSYNC_DFLTTL		255
=20
@@ -268,7 +270,7 @@
 	int		 pfsyncr_authlevel;
 };
=20
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 #define	SIOCSETPFSYNC   _IOW('i', 247, struct ifreq)
 #define	SIOCGETPFSYNC   _IOWR('i', 248, struct ifreq)
 #endif
@@ -288,7 +290,7 @@
 #define	PFSYNC_S_DEFER	0xfe
 #define	PFSYNC_S_NONE	0xff
=20
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 void			pfsync_input(struct mbuf *, __unused int);
 #else
 void			pfsync_input(struct mbuf *, ...);
@@ -300,7 +302,7 @@
 #define	PFSYNC_SI_CKSUM		0x02
 #define	PFSYNC_SI_ACK		0x04
 int			pfsync_state_import(struct pfsync_state *, u_int8_t);
-#ifndef __FreeBSD__
+#ifndef __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 227831)
+++ 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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __FreeBSD_kernel__
 #include <netinet/in.h>
 #endif
=20
@@ -62,7 +62,7 @@
=20
 struct ip;
 struct ip6_hdr;
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 struct inpcb;
 #endif
=20
@@ -173,7 +173,7 @@
 		}			 a;
 		char			 ifname[IFNAMSIZ];
 		char			 tblname[PF_TABLE_NAME_SIZE];
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 #define	RTLABEL_LEN	32
 #endif
 		char			 rtlabelname[RTLABEL_LEN];
@@ -211,7 +211,7 @@
  * Address manipulation macros
  */
=20
-#ifdef __FreeBSD__
+#ifdef __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__
+#ifdef __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_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_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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __FreeBSD_kernel__
 	struct pf_mtag	*pf_mtag;
 #endif
=20
@@ -1403,7 +1403,7 @@
 			*(a) =3D (x); \
 	} while (0)
=20
-#ifdef __FreeBSD__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifndef __FreeBSD_kernel__
 struct pf_divert		*pf_find_divert(struct mbuf *);
 #endif
=20
 #ifdef INET
-#ifdef __FreeBSD__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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__
+#ifdef __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_kernel__) */
=20
 #endif /* _KERNEL */
=20
-#ifdef __FreeBSD__
+#ifdef __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__
+#ifndef __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__
+#ifdef __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 227831)
+++ sys/dev/firewire/firewirereg.h	(working copy)
@@ -35,6 +35,8 @@
  *
  */
=20
+#include <sys/param.h>
+
 #ifdef __DragonFly__
 typedef	d_thread_t fw_proc;
 #include <sys/select.h>
@@ -75,7 +77,7 @@
 };
=20
 struct firewire_softc {
-#if defined(__FreeBSD__) && __FreeBSD_version >=3D 500000
+#if 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 227831)
+++ sys/dev/lmc/if_lmc.h	(working copy)
@@ -47,6 +47,8 @@
 #ifndef IF_LMC_H
 #define IF_LMC_H
=20
+#include <sys/param.h>
+
 #define DEVICE_NAME		"lmc"
=20
 /* Linux RPM-style version information */
@@ -984,7 +986,7 @@
 #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_kernel__) || defined(__NetBSD__) || defined(__OpenB=
SD__))
   bus_dmamap_t map;		/* bus dmamap for this descriptor */
 # define TLP_BUS_DSL_VAL	(sizeof(bus_dmamap_t) & TLP_BUS_DSL)
 #else
@@ -1035,7 +1037,7 @@
 #elif BSD
   struct mbuf *head;		/* tail-queue of mbufs */
   struct mbuf *tail;
-# if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__))
+# if (defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__Open=
BSD__))
   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,7 @@
  */
 #define IOREF_CSR 1  /* access Tulip CSRs with IO cycles if 1 */
=20
-#if (defined(__FreeBSD__) && defined(DEVICE_POLLING))
+#if (defined(__FreeBSD_kernel__) && defined(DEVICE_POLLING))
 # define DEV_POLL 1
 #else
 # define DEV_POLL 0
@@ -1151,7 +1153,7 @@
 # endif
 #endif
=20
-#ifdef __FreeBSD__
+#ifdef __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 +1175,7 @@
   int		top_spl;	/* lock card->watchdog vs core_ioctl       */
   int		bottom_spl;	/* lock for buf queues & descriptor rings  */
 # endif
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD_kernel__ */
=20
 #ifdef __linux__
   struct pci_dev    *pci_dev;	/* READ/WRITE_PCI_CFG macros need this     */
@@ -1210,7 +1212,7 @@
=20
 /* Hide the minor differences between OS versions */
=20
-#ifdef __FreeBSD__
+#ifdef __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 +1266,7 @@
 # if (__FreeBSD_version >=3D 600000)
 #  define IFF_RUNNING		IFF_DRV_RUNNING
 # endif
-#endif  /* __FreeBSD__ */
+#endif  /* __FreeBSD_kernel__ */
=20
 #ifdef __NetBSD__
   typedef int intr_return_t;
@@ -1428,7 +1430,7 @@
 #endif
=20
 #if (defined(__bsdi__) || /* unconditionally */ \
-    (defined(__FreeBSD__) && (__FreeBSD_version < 503000)) || \
+    (defined(__FreeBSD_kernel__) && (__FreeBSD_version < 503000)) || \
     (defined(__NetBSD__)  && (__NetBSD_Version__ < 106000000)) || \
     (defined(__OpenBSD__) && (  OpenBSD < 200111)))
 # define IFQ_ENQUEUE(ifq, m, pa, err)   \
@@ -1531,7 +1533,7 @@
 static int  t1_ioctl(softc_t *, struct ioctl *);
=20
 #if IFNET
-# if ((defined(__FreeBSD__) && (__FreeBSD_version < 500000)) ||\
+# if ((defined(__FreeBSD_kernel__) && (__FreeBSD_version < 500000)) ||\
         defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__))
 static void netisr_dispatch(int, struct mbuf *);
 # endif
@@ -1541,7 +1543,7 @@
 #if BSD
 static void mbuf_enqueue(struct desc_ring *, struct mbuf *);
 static struct mbuf* mbuf_dequeue(struct desc_ring *);
-# ifdef __FreeBSD__
+# ifdef __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 +1572,7 @@
 static void core_interrupt(void *, int);
 static void user_interrupt(softc_t *, int);
 #if BSD
-# if (defined(__FreeBSD__) && defined(DEVICE_POLLING))
+# if (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 +1640,12 @@
 static int attach_card(softc_t *, const char *);
 static void detach_card(softc_t *);
=20
-#ifdef __FreeBSD__
+#ifdef __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_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 227831)
+++ sys/dev/mpt/mpilib/mpi_type.h	(working copy)
@@ -55,7 +55,9 @@
 #ifndef MPI_TYPE_H
 #define MPI_TYPE_H
=20
+#include <sys/param.h>
=20
+
 /*************************************************************************=
******
  * Define MPI_POINTER if it hasn't already been defined. By default MPI_PO=
INTER
  * is defined to be a near pointer. MPI_POINTER can be defined as a far po=
inter
@@ -77,7 +79,7 @@
 typedef signed   short  S16;
 typedef unsigned short  U16;
=20
-#ifdef	__FreeBSD__
+#ifdef	__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 227831)
+++ sys/dev/wi/if_wireg.h	(working copy)
@@ -32,6 +32,8 @@
  * $FreeBSD$
  */
=20
+#include <sys/param.h>
+
 #define WI_DELAY	5
 #define WI_TIMEOUT	(500000/WI_DELAY)	/* 500 ms */
=20
@@ -84,7 +86,7 @@
 #ifdef __NetBSD__
 #define OS_STRING_NAME	"NetBSD"
 #endif
-#ifdef __FreeBSD__
+#ifdef __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 227831)
+++ sys/fs/nfs/nfs_var.h	(working copy)
@@ -32,6 +32,8 @@
  * $FreeBSD$
  */
=20
+#include <sys/param.h>
+
 /*
  * XXX needs <nfs/rpcv2.h> and <nfs/nfs.h> because of typedefs
  */
@@ -76,7 +78,7 @@
 struct nfsvattr;
 struct nfs_vattr;
 struct NFSSVCARGS;
-#ifdef __FreeBSD__
+#ifdef __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 227831)
+++ sys/net/if_atm.h	(working copy)
@@ -37,6 +37,8 @@
  * net/if_atm.h
  */
=20
+#include <sys/param.h>
+
 /*
  * Classification of ATM cards.
  */
@@ -202,7 +204,7 @@
=20
 #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
 #define	RTALLOC1(A,B)		rtalloc1((A),(B))
-#elif defined(__FreeBSD__)
+#elif 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 227831)
+++ sys/net/zlib.h	(working copy)
@@ -50,6 +50,8 @@
 #ifndef _ZLIB_H
 #define _ZLIB_H
=20
+#include <sys/param.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -510,7 +512,7 @@
    done by inflate().
 */
=20
-#if defined(__FreeBSD__) && defined(_KERNEL)
+#if defined(__FreeBSD_kernel__) && defined(_KERNEL)
 #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 227831)
+++ sys/net80211/ieee80211_ioctl.h	(working copy)
@@ -28,6 +28,8 @@
 #ifndef _NET80211_IEEE80211_IOCTL_H_
 #define _NET80211_IEEE80211_IOCTL_H_
=20
+#include <sys/param.h>
+
 /*
  * IEEE 802.11 ioctls.
  */
@@ -569,7 +571,7 @@
 	uint16_t	sv_vlan;
 };
=20
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 /*
  * FreeBSD-style ioctls.
  */
@@ -849,6 +851,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_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 227831)
+++ sys/net80211/ieee80211_var.h	(working copy)
@@ -28,13 +28,15 @@
 #ifndef _NET80211_IEEE80211_VAR_H_
 #define _NET80211_IEEE80211_VAR_H_
=20
+#include <sys/param.h>
+
 /*
  * Definitions for IEEE 802.11 drivers.
  */
 /* NB: portability glue must go first */
 #if defined(__NetBSD__)
 #include <net80211/ieee80211_netbsd.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD_kernel__)
 #include <net80211/ieee80211_freebsd.h>
 #elif defined(__linux__)
 #include <net80211/ieee80211_linux.h>
Index: sys/netinet/sctp_constants.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_constants.h	(revision 227831)
+++ sys/netinet/sctp_constants.h	(working copy)
@@ -38,6 +38,8 @@
 #ifndef __sctp_constants_h__
 #define __sctp_constants_h__
=20
+#include <sys/param.h>
+
 /* IANA assigned port number for SCTP over UDP encapsulation */
 /* For freebsd we cannot bind the port at
  * startup. Otherwise what will happen is
@@ -1020,7 +1022,7 @@
 #define SCTP_GETTIME_TIMEVAL(x)	(getmicrouptime(x))
 #define SCTP_GETPTIME_TIMEVAL(x)	(microuptime(x))
 #endif
-/*#if defined(__FreeBSD__) || defined(__APPLE__)*/
+/*#if defined(__FreeBSD_kernel__) || defined(__APPLE__)*/
 /*#define SCTP_GETTIME_TIMEVAL(x) { \*/
 /*	(x)->tv_sec =3D ticks / 1000; \*/
 /*	(x)->tv_usec =3D (ticks % 1000) * 1000; \*/
@@ -1028,7 +1030,7 @@
=20
 /*#else*/
 /*#define SCTP_GETTIME_TIMEVAL(x)	(microtime(x))*/
-/*#endif				 __FreeBSD__ */
+/*#endif				 __FreeBSD_kernel__ */
=20
 #if defined(_KERNEL) || defined(__Userspace__)
 #define sctp_sowwakeup(inp, so) \
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 227831)
+++ sys/netinet/sctp_pcb.h	(working copy)
@@ -37,6 +37,8 @@
 #ifndef __sctp_pcb_h__
 #define __sctp_pcb_h__
=20
+#include <sys/param.h>
+
 #include <netinet/sctp_os.h>
 #include <netinet/sctp.h>
 #include <netinet/sctp_constants.h>
@@ -240,7 +242,7 @@
 	 * 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_kernel__) && defined(SMP) && defined(SCTP_USE_PERCPU=
_STAT)
 	struct sctpstat *sctpstat;
 #else
 	struct sctpstat sctpstat;
@@ -633,7 +635,7 @@
     struct sctp_inpcb *,
     uint8_t co_off);
=20
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if defined(__FreeBSD_kernel__) && defined(SCTP_MCORE_INPUT) && defined(SM=
P)
 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 227831)
+++ sys/netinet/sctp_structs.h	(working copy)
@@ -38,6 +38,8 @@
 #ifndef __sctp_structs_h__
 #define __sctp_structs_h__
=20
+#include <sys/param.h>
+
 #include <netinet/sctp_os.h>
 #include <netinet/sctp_header.h>
 #include <netinet/sctp_auth.h>
@@ -108,7 +110,7 @@
 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_kernel__) && defined(SCTP_MCORE_INPUT) && defined(SM=
P)
 /* 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 227831)
+++ sys/netinet/sctp_uio.h	(working copy)
@@ -37,6 +37,7 @@
 #ifndef __sctp_uio_h__
 #define __sctp_uio_h__
=20
+#include <sys/param.h>
=20
 #if ! defined(_KERNEL)
 #include <stdint.h>
@@ -1062,7 +1063,7 @@
=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_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 227831)
+++ sys/sys/device_port.h	(working copy)
@@ -27,9 +27,11 @@
  * $FreeBSD$
  */
=20
+#include <sys/param.h>
+
 #if defined(__NetBSD__)
 # include <sys/device.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD_kernel__)
 # include <sys/module.h>
 # include <sys/bus.h>
 #endif
@@ -43,7 +45,7 @@
 # define DEVPORT_DEVNAME(dev)		(dev).dv_xname
 # define DEVPORT_DEVUNIT(dev)		(dev).dv_unit
=20
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD_kernel__)
 /*
  * FreeBSD (compatibility for struct device)
  */
@@ -67,4 +69,4 @@
 #define DEVPORT_PDEVALLOC_SOFTC(pdev)	device_get_softc(pdev)
 #define DEVPORT_PDEVGET_SOFTC(pdev)	device_get_softc(pdev)
=20
-#endif /* __FreeBSD__ */
+#endif /* __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 227831)
+++ sys/sys/timex.h	(working copy)
@@ -95,6 +95,9 @@
  */
 #ifndef _SYS_TIMEX_H_
 #define _SYS_TIMEX_H_ 1
+
+#include <sys/param.h>
+
 #define NTP_API		4	/* NTP API version */
=20
 #ifndef MSDOS			/* Microsoft specific */
@@ -218,7 +221,7 @@
 	long	stbcnt;		/* stability limit exceeded (ro) */
 };
=20
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
=20
 #ifdef _KERNEL
 void	ntp_update_second(int64_t *adjustment, time_t *newsec);
@@ -231,6 +234,6 @@
 __END_DECLS
 #endif /* _KERNEL */
=20
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD_kernel__ */
=20
 #endif /* !_SYS_TIMEX_H_ */

--nFreZHaLTZJo0R7j--

--8GpibOaaTibBMecb
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)

iQIcBAEBCAAGBQJOzJoSAAoJELd1onhloKnOSSoP/14VCu82RmybijW2Jb2aWLjK
z1XZVo5oPa6RM/rFGMIphfwRJv73ep4iieRDlbaxJm/Mky8VEY18VIMWVLlVeSFk
W1RlzDaQEQVFx3mdhtVY22zEKRIDi+TAx8c5Fh/aOMacP2krrrbKFKNIjUCb1mGZ
5NNp42gnRCQkkdciZ0iDGP3jL2sG04vmNrzpC/2nVOyulzH+JLSvRAFbKg23XUe/
Xm4vaojiCPDRJk7FT7lznLW4g1i284ojYwGbxOm4GZl9T0XeUgw3ZCFpXHQ4zzjw
RkesuQudqWbn3rJ5KD6xbhMF8NK3cxBVl33RRvXIVAD44abw97sAMshcW+JC50Pk
dJ+F3lHxPi/RdGSZRpU0OYxnaTGc0ZByGyZrbo5589FcQx9UA2fhrhh0DQLCfSd1
bIHfZBrZnRf9DLlidnWn2FuQ2961gcMY/ehpqUXXTgY9CU8FvRRSdat8RJadlYI3
4epiiXzR9RZXlFxhhcN/s4uvKGuIZNbLSxBUZ98Nn3kaLpYQ9Ex+fGxO4ErWITEH
3mkj0a0hYUF9TSegXW6aIf//cyqT+P6FvY+o9ft4WUAXW+oyC7hpT7eExwmcBFTW
RYs2MlbnVtuzwaXpkx0Vwv1JWII1+XRZRxrGywY/seXS8i+IvdbLS/P3iiiu4A57
cT9klxq+J6ViBv8ZFvF8
=qRMr
-----END PGP SIGNATURE-----

--8GpibOaaTibBMecb--



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