Index: sys/cam/scsi/scsi_low.h =================================================================== --- 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__ */ -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define SCSI_LOW_INTERFACE_CAM #define CAM -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ /******** includes *******************************/ #ifdef __NetBSD__ @@ -64,7 +64,7 @@ #include #endif /* __NetBSD__ */ -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #include #include @@ -75,7 +75,7 @@ #include #include -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ /******** functions macro ************************/ #ifdef __NetBSD__ @@ -85,13 +85,13 @@ #define SCSI_LOW_BZERO(pt, size) memset((pt), 0, (size)) #endif /* __NetBSD__ */ -#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__ */ /******** os depend interface structures **********/ #ifdef __NetBSD__ @@ -111,7 +111,7 @@ }; #endif /* __NetBSD__ */ -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) typedef struct scsi_sense_data scsi_low_osdep_sense_data_t; struct scsi_low_osdep_interface { @@ -134,7 +134,7 @@ struct scsi_low_osdep_lun_interface { }; -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ /******** os depend interface functions *************/ struct slccb; Index: sys/cam/scsi/scsi_low_pisa.h =================================================================== --- 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__ */ -#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 =================================================================== --- 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 Index: sys/contrib/altq/altq/if_altq.h =================================================================== --- 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_ -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include /* XXX */ #include /* XXX */ #include /* 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 Index: sys/contrib/pf/net/if_pflog.h =================================================================== --- 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 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) #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 =================================================================== --- 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 =================================================================== --- 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; }; -#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 -#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 =================================================================== --- sys/contrib/pf/net/pfvar.h (revision 227956) +++ sys/contrib/pf/net/pfvar.h (working copy) @@ -37,7 +37,7 @@ #include #include #include -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #include #else @@ -46,7 +46,7 @@ #include #include -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #include #include @@ -54,7 +54,7 @@ #include #endif -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #endif @@ -62,7 +62,7 @@ struct ip; struct ip6_hdr; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct inpcb; #endif @@ -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 */ -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define splsoftnet() splnet() #define HTONL(x) (x) = htonl((__uint32_t)(x)) @@ -236,7 +236,7 @@ if (var) \ uma_zdestroy(var) -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) extern struct mtx pf_task_mtx; #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__ */ #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; -#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); /* 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 @@ -1403,7 +1403,7 @@ *(a) = (x); \ } while (0) -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define REASON_SET(a, x) \ do { \ if ((a) != 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 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 -#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); -#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 #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 */ #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 */ -#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); -#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 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); -#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); -#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 -#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 -#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__ */ #endif /* _KERNEL */ -#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); -#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 =================================================================== --- sys/dev/firewire/firewirereg.h (revision 227956) +++ sys/dev/firewire/firewirereg.h (working copy) @@ -75,7 +75,8 @@ }; struct firewire_softc { -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \ + __FreeBSD_version >= 500000 struct cdev *dev; #endif struct firewire_comm *fc; Index: sys/dev/lmc/if_lmc.h =================================================================== --- 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 */ -#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 -#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__ */ #ifdef __linux__ struct pci_dev *pci_dev; /* READ/WRITE_PCI_CFG macros need this */ @@ -1210,7 +1213,7 @@ /* Hide the minor differences between OS versions */ -#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, data, 4) @@ -1264,7 +1267,7 @@ # if (__FreeBSD_version >= 600000) # define IFF_RUNNING IFF_DRV_RUNNING # endif -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ #ifdef __NetBSD__ typedef int intr_return_t; @@ -1531,7 +1534,7 @@ static int t1_ioctl(softc_t *, struct ioctl *); #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 *); -#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__ */ #ifdef __NetBSD__ static int nbsd_match(struct device *t, struct cfdata *, void *); Index: sys/dev/mpt/mpilib/mpi_type.h =================================================================== --- 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; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) typedef int32_t S32; typedef uint32_t U32; Index: sys/dev/wi/if_wireg.h =================================================================== --- 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 =================================================================== --- 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 =================================================================== --- sys/net/if_atm.h (revision 227956) +++ sys/net/if_atm.h (working copy) @@ -202,7 +202,7 @@ #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 Index: sys/net/zlib.h =================================================================== --- sys/net/zlib.h (revision 227956) +++ sys/net/zlib.h (working copy) @@ -510,7 +510,7 @@ done by inflate(). */ -#if defined(__FreeBSD__) && defined(_KERNEL) +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(_KERNEL) #define inflate inflate_ppp /* FreeBSD already has an inflate :-( */ #endif Index: sys/net80211/ieee80211_ioctl.h =================================================================== --- sys/net80211/ieee80211_ioctl.h (revision 227956) +++ sys/net80211/ieee80211_ioctl.h (working copy) @@ -569,7 +569,7 @@ uint16_t sv_vlan; }; -#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__ */ #endif /* _NET80211_IEEE80211_IOCTL_H_ */ Index: sys/net80211/ieee80211_var.h =================================================================== --- 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 -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #elif defined(__linux__) #include Index: sys/netinet/sctp_pcb.h =================================================================== --- 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); -#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); Index: sys/netinet/sctp_structs.h =================================================================== --- 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); -#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 =================================================================== --- sys/netinet/sctp_uio.h (revision 227956) +++ sys/netinet/sctp_uio.h (working copy) @@ -1062,7 +1062,8 @@ #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 += _d) #define SCTP_STAT_DECR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x -= _d) #else Index: sys/sys/device_port.h =================================================================== --- sys/sys/device_port.h (revision 227956) +++ sys/sys/device_port.h (working copy) @@ -29,7 +29,7 @@ #if defined(__NetBSD__) # include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # include # include #endif @@ -43,7 +43,7 @@ # define DEVPORT_DEVNAME(dev) (dev).dv_xname # define DEVPORT_DEVUNIT(dev) (dev).dv_unit -#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) -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ Index: sys/sys/timex.h =================================================================== --- sys/sys/timex.h (revision 227956) +++ sys/sys/timex.h (working copy) @@ -218,7 +218,7 @@ long stbcnt; /* stability limit exceeded (ro) */ }; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #ifdef _KERNEL void ntp_update_second(int64_t *adjustment, time_t *newsec); @@ -231,6 +231,6 @@ __END_DECLS #endif /* _KERNEL */ -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ #endif /* !_SYS_TIMEX_H_ */