diff options
| author | Ruslan Ermilov <ru@FreeBSD.org> | 2005-12-05 11:58:35 +0000 |
|---|---|---|
| committer | Ruslan Ermilov <ru@FreeBSD.org> | 2005-12-05 11:58:35 +0000 |
| commit | 342ed5d94898694d5ff3b5648cdc247d07dfad16 (patch) | |
| tree | 10fbb6249e1553ff873a2885f2937b146e545698 /sys/dev | |
| parent | 52cf88e2ef809b7b640e5dc0f8a4a92cee7461ec (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/aic7xxx/aic7xxx_osm.h | 2 | ||||
| -rw-r--r-- | sys/dev/dcons/dcons_os.c | 6 | ||||
| -rw-r--r-- | sys/dev/gem/if_gem.c | 2 | ||||
| -rw-r--r-- | sys/dev/hwpmc/hwpmc_amd.c | 20 | ||||
| -rw-r--r-- | sys/dev/hwpmc/hwpmc_logging.c | 2 | ||||
| -rw-r--r-- | sys/dev/hwpmc/hwpmc_mod.c | 28 | ||||
| -rw-r--r-- | sys/dev/hwpmc/hwpmc_piv.c | 4 | ||||
| -rw-r--r-- | sys/dev/ie/if_ie_isa.c | 4 | ||||
| -rw-r--r-- | sys/dev/lmc/if_lmc.c | 14 | ||||
| -rw-r--r-- | sys/dev/lmc/if_lmc.h | 64 |
10 files changed, 73 insertions, 73 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx_osm.h b/sys/dev/aic7xxx/aic7xxx_osm.h index 159f9f9c31ba..f83ff5db677e 100644 --- a/sys/dev/aic7xxx/aic7xxx_osm.h +++ b/sys/dev/aic7xxx/aic7xxx_osm.h @@ -157,7 +157,7 @@ struct scb_platform_data { }; /***************************** Core Includes **********************************/ -#if AHC_REG_PRETTY_PRINT +#ifdef AHC_REG_PRETTY_PRINT #define AIC_DEBUG_REGISTERS 1 #else #define AIC_DEBUG_REGISTERS 0 diff --git a/sys/dev/dcons/dcons_os.c b/sys/dev/dcons/dcons_os.c index 7a51e1cf38b3..40273a39fdba 100644 --- a/sys/dev/dcons/dcons_os.c +++ b/sys/dev/dcons/dcons_os.c @@ -192,7 +192,7 @@ GDB_DBGPORT(dcons, dcons_dbg_probe, dcons_dbg_init, dcons_dbg_term, extern struct gdb_dbgport *gdb_cur; #endif -#if (KDB || DDB) && ALT_BREAK_TO_DEBUGGER +#if (defined(KDB) || defined(DDB)) && defined(ALT_BREAK_TO_DEBUGGER) static int dcons_check_break(struct dcons_softc *dc, int c) { @@ -549,7 +549,7 @@ ok: dcons_buf = dg.buf; #if __FreeBSD_version < 502122 -#if DDB && DCONS_FORCE_GDB +#if defined(DDB) && DCONS_FORCE_GDB #if CONS_NODEV gdbconsdev.cn_arg = (void *)&sc[DCONS_GDB]; #if __FreeBSD_version >= 501109 @@ -678,7 +678,7 @@ dcons_modevent(module_t mode, int type, void *data) printf("dcons: unload\n"); callout_stop(&dcons_callout); #if __FreeBSD_version < 502122 -#if DDB && DCONS_FORCE_GDB +#if defined(DDB) && DCONS_FORCE_GDB #if CONS_NODEV gdb_arg = NULL; #else diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c index 5f9bae43e7b6..4ffd71eec3bb 100644 --- a/sys/dev/gem/if_gem.c +++ b/sys/dev/gem/if_gem.c @@ -321,7 +321,7 @@ gem_attach(sc) /* Attach the interface. */ ether_ifattach(ifp, sc->sc_enaddr); -#if notyet +#ifdef notyet /* * Add a suspend hook to make sure we come back up after a * resume. diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c index 3d9282986390..b7cdee808ceb 100644 --- a/sys/dev/hwpmc/hwpmc_amd.c +++ b/sys/dev/hwpmc/hwpmc_amd.c @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include <machine/pmc_mdep.h> #include <machine/specialreg.h> -#if DEBUG +#ifdef DEBUG enum pmc_class amd_pmc_class; #endif @@ -291,7 +291,7 @@ amd_read_pmc(int cpu, int ri, pmc_value_t *v) return 0; } -#if DEBUG +#ifdef DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, ("[amd,%d] unknown PMC class (%d)", __LINE__, pd->pm_descr.pd_class)); @@ -338,7 +338,7 @@ amd_write_pmc(int cpu, int ri, pmc_value_t v) if (pd->pm_descr.pd_class == PMC_CLASS_TSC) return 0; -#if DEBUG +#ifdef DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, ("[amd,%d] unknown PMC class (%d)", __LINE__, pd->pm_descr.pd_class)); @@ -474,7 +474,7 @@ amd_allocate_pmc(int cpu, int ri, struct pmc *pm, return 0; } -#if DEBUG +#ifdef DEBUG KASSERT(pd->pd_class == amd_pmc_class, ("[amd,%d] Unknown PMC class (%d)", __LINE__, pd->pd_class)); #endif @@ -536,7 +536,7 @@ amd_allocate_pmc(int cpu, int ri, struct pmc *pm, static int amd_release_pmc(int cpu, int ri, struct pmc *pmc) { -#if DEBUG +#ifdef DEBUG const struct amd_descr *pd; #endif struct pmc_hw *phw; @@ -553,7 +553,7 @@ amd_release_pmc(int cpu, int ri, struct pmc *pmc) KASSERT(phw->phw_pmc == NULL, ("[amd,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); -#if DEBUG +#ifdef DEBUG pd = &amd_pmcdesc[ri]; if (pd->pm_descr.pd_class == amd_pmc_class) KASSERT(AMD_PMC_IS_STOPPED(pd->pm_evsel), @@ -593,7 +593,7 @@ amd_start_pmc(int cpu, int ri) if (pd->pm_descr.pd_class == PMC_CLASS_TSC) return 0; /* TSCs are always running */ -#if DEBUG +#ifdef DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, ("[amd,%d] unknown PMC class (%d)", __LINE__, pd->pm_descr.pd_class)); @@ -641,7 +641,7 @@ amd_stop_pmc(int cpu, int ri) if (pd->pm_descr.pd_class == PMC_CLASS_TSC) return 0; -#if DEBUG +#ifdef DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, ("[amd,%d] unknown PMC class (%d)", __LINE__, pd->pm_descr.pd_class)); @@ -890,7 +890,7 @@ amd_cleanup(int cpu) if ((pcs = pmc_pcpu[cpu]) == NULL) return 0; -#if DEBUG +#ifdef DEBUG /* check the TSC */ KASSERT(pcs->pc_hwpmcs[0]->phw_pmc == NULL, ("[amd,%d] CPU%d,PMC0 still in use", __LINE__, cpu)); @@ -948,7 +948,7 @@ pmc_amd_initialize(void) return NULL; } -#if DEBUG +#ifdef DEBUG amd_pmc_class = class; #endif diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index 8b6f376b2f02..ff6298e6f04d 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -203,7 +203,7 @@ pmclog_get_buffer(struct pmc_owner *po) PMCDBG(LOG,GTB,1, "po=%p plb=%p", po, plb); -#if DEBUG +#ifdef DEBUG if (plb) KASSERT(plb->plb_ptr == plb->plb_base && plb->plb_base < plb->plb_fence, diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index ecd83d2a4e08..85b5fa0dfded 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -150,7 +150,7 @@ static LIST_HEAD(, pmc_owner) pmc_ss_owners; * Prototypes */ -#if DEBUG +#ifdef DEBUG static int pmc_debugflags_sysctl_handler(SYSCTL_HANDLER_ARGS); static int pmc_debugflags_parse(char *newstr, char *fence); #endif @@ -202,7 +202,7 @@ static void pmc_unlink_target_process(struct pmc *pmc, SYSCTL_NODE(_kern, OID_AUTO, hwpmc, CTLFLAG_RW, 0, "HWPMC parameters"); -#if DEBUG +#ifdef DEBUG struct pmc_debugflags pmc_debugflags = PMC_DEBUG_DEFAULT_FLAGS; char pmc_debugstr[PMC_DEBUG_STRSIZE]; TUNABLE_STR(PMC_SYSCTL_NAME_PREFIX "debugflags", pmc_debugstr, @@ -301,7 +301,7 @@ static moduledata_t pmc_mod = { DECLARE_MODULE(pmc, pmc_mod, SI_SUB_SMP, SI_ORDER_ANY); MODULE_VERSION(pmc, PMC_VERSION); -#if DEBUG +#ifdef DEBUG enum pmc_dbgparse_state { PMCDS_WS, /* in whitespace */ PMCDS_MAJOR, /* seen a major keyword */ @@ -757,7 +757,7 @@ pmc_link_target_process(struct pmc *pm, struct pmc_process *pp) PMCDBG(PRC,TLK,1, "link-target pmc=%p ri=%d pmc-process=%p", pm, ri, pp); -#if DEBUG +#ifdef DEBUG LIST_FOREACH(pt, &pm->pm_targets, pt_next) if (pt->pt_process == pp) KASSERT(0, ("[pmc,%d] pp %p already in pmc %p targets", @@ -1415,7 +1415,7 @@ pmc_process_csw_out(struct thread *td) */ -#if DEBUG +#ifdef DEBUG const char *pmc_hooknames[] = { "", "EXIT", @@ -1584,7 +1584,7 @@ pmc_hook_handler(struct thread *td, int function, void *arg) break; default: -#if DEBUG +#ifdef DEBUG KASSERT(0, ("[pmc,%d] unknown hook %d\n", __LINE__, function)); #endif break; @@ -1766,7 +1766,7 @@ pmc_destroy_pmc_descriptor(struct pmc *pm) { (void) pm; -#if DEBUG +#ifdef DEBUG KASSERT(pm->pm_state == PMC_STATE_DELETED || pm->pm_state == PMC_STATE_FREE, ("[pmc,%d] destroying non-deleted PMC", __LINE__)); @@ -1783,7 +1783,7 @@ pmc_destroy_pmc_descriptor(struct pmc *pm) static void pmc_wait_for_pmc_idle(struct pmc *pm) { -#if DEBUG +#ifdef DEBUG volatile int maxloop; maxloop = 100 * mp_ncpus; @@ -1794,7 +1794,7 @@ pmc_wait_for_pmc_idle(struct pmc *pm) * comes down to zero. */ while (atomic_load_acq_32(&pm->pm_runcount) > 0) { -#if DEBUG +#ifdef DEBUG maxloop--; KASSERT(maxloop > 0, ("[pmc,%d] (ri%d, rc%d) waiting too long for " @@ -2344,7 +2344,7 @@ pmc_stop(struct pmc *pm) } -#if DEBUG +#ifdef DEBUG static const char *pmc_op_to_name[] = { #undef __PMC_OP #define __PMC_OP(N, D) #N , @@ -3282,7 +3282,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args) pprw = (struct pmc_op_pmcrw *) arg; -#if DEBUG +#ifdef DEBUG if (prw.pm_flags & PMC_F_NEWVALUE) PMCDBG(PMC,OPS,2, "rw id=%d new %jx -> old %jx", ri, prw.pm_value, oldvalue); @@ -3921,7 +3921,7 @@ pmc_initialize(void) md = NULL; error = 0; -#if DEBUG +#ifdef DEBUG /* parse debug flags first */ if (TUNABLE_STR_FETCH(PMC_SYSCTL_NAME_PREFIX "debugflags", pmc_debugstr, sizeof(pmc_debugstr))) @@ -4071,7 +4071,7 @@ pmc_cleanup(void) struct pmc_ownerhash *ph; struct pmc_owner *po, *tmp; struct pmc_binding pb; -#if DEBUG +#ifdef DEBUG struct pmc_processhash *prh; #endif @@ -4121,7 +4121,7 @@ pmc_cleanup(void) mtx_destroy(&pmc_processhash_mtx); if (pmc_processhash) { -#if DEBUG +#ifdef DEBUG struct pmc_process *pp; PMCDBG(MOD,INI,3, "%s", "destroy process hash"); diff --git a/sys/dev/hwpmc/hwpmc_piv.c b/sys/dev/hwpmc/hwpmc_piv.c index 586fecdbcd83..d0c1af84504a 100644 --- a/sys/dev/hwpmc/hwpmc_piv.c +++ b/sys/dev/hwpmc/hwpmc_piv.c @@ -757,7 +757,7 @@ p4_read_pmc(int cpu, int ri, pmc_value_t *v) if (ri == 0) { /* TSC */ -#if DEBUG +#ifdef DEBUG pc = (struct p4_cpu *) pmc_pcpu[cpu]; phw = pc->pc_hwpmcs[ri]; pm = phw->phw_pmc; @@ -840,7 +840,7 @@ p4_write_pmc(int cpu, int ri, pmc_value_t v) * timekeeping and other system functions. */ if (ri == 0) { -#if DEBUG +#ifdef DEBUG pc = (struct p4_cpu *) pmc_pcpu[cpu]; phw = pc->pc_hwpmcs[ri]; pm = phw->phw_pmc; diff --git a/sys/dev/ie/if_ie_isa.c b/sys/dev/ie/if_ie_isa.c index 564176f17df6..120a0936be0c 100644 --- a/sys/dev/ie/if_ie_isa.c +++ b/sys/dev/ie/if_ie_isa.c @@ -123,7 +123,7 @@ ie_isa_3C507_identify (driver_t *driver, device_t parent) port += IE_3C507_IOSIZE) { if (ie_3C507_port_check(port)) { -#if DEBUG +#ifdef DEBUG if (bootverbose) { device_printf(parent, "(if_ie) (3C507) not found at port %#x\n", @@ -339,7 +339,7 @@ ie_isa_ee16_identify (driver_t *driver, device_t parent) port = ports[i]; if (ie_ee16_port_check(port)) { -#if DEBUG +#ifdef DEBUG if (bootverbose) { device_printf(parent, "if_ie: (EE16) not found at port %#x\n", diff --git a/sys/dev/lmc/if_lmc.c b/sys/dev/lmc/if_lmc.c index e4dfdfe712c0..965792040564 100644 --- a/sys/dev/lmc/if_lmc.c +++ b/sys/dev/lmc/if_lmc.c @@ -2807,7 +2807,7 @@ rxintr_cleanup(softc_t *sc) struct mbuf *new_mbuf; int pkt_len, desc_len; -#if (defined(__FreeBSD__) && DEVICE_POLLING) +#if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) /* Input packet flow control (livelock prevention): */ /* Give pkts to higher levels only if quota is > 0. */ if (sc->quota <= 0) return 0; @@ -2923,7 +2923,7 @@ rxintr_cleanup(softc_t *sc) sc->ifp->if_ipackets++; LMC_BPF_MTAP(first_mbuf); #endif -#if (defined(__FreeBSD__) && DEVICE_POLLING) +#if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) sc->quota--; #endif @@ -3947,7 +3947,7 @@ user_interrupt(softc_t *sc, int check_status) #if BSD -# if (defined(__FreeBSD__) && DEVICE_POLLING) +# if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) /* Service the card from the kernel idle loop without interrupts. */ static void @@ -3986,7 +3986,7 @@ bsd_interrupt(void *arg) if ((READ_CSR(TLP_STATUS) & TLP_INT_TXRX) == 0) return IRQ_NONE; -# if (defined(__FreeBSD__) && DEVICE_POLLING) +# if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) if (sc->ifp->if_capenable & IFCAP_POLLING) return IRQ_NONE; @@ -4464,7 +4464,7 @@ raw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { -# if (defined(__FreeBSD__) && DEVICE_POLLING) /* XXX necessary? */ +# if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) /* XXX necessary? */ case SIOCSIFCAP: # endif case SIOCSIFDSTADDR: @@ -4815,7 +4815,7 @@ setup_ifnet(struct ifnet *ifp) ifp->if_mtu = MAX_DESC_LEN; /* sppp & p2p change this */ ifp->if_type = IFT_PTPSERIAL; /* p2p changes this */ -# if (defined(__FreeBSD__) && DEVICE_POLLING) +# if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) ifp->if_capabilities |= IFCAP_POLLING; # if (__FreeBSD_version < 500000) ifp->if_capenable |= IFCAP_POLLING; @@ -4916,7 +4916,7 @@ ifnet_detach(softc_t *sc) ifmedia_delete_instance(&sc->ifm, IFM_INST_ANY); # endif -# if (defined(__FreeBSD__) && DEVICE_POLLING) +# if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) if (sc->ifp->if_capenable & IFCAP_POLLING) ether_poll_deregister(sc->ifp); # endif diff --git a/sys/dev/lmc/if_lmc.h b/sys/dev/lmc/if_lmc.h index 2d024bd264e3..734b768c02f8 100644 --- a/sys/dev/lmc/if_lmc.h +++ b/sys/dev/lmc/if_lmc.h @@ -620,7 +620,7 @@ # define LMCIOCREAD _IOWR('i', 243, struct ioctl) # define LMCIOCWRITE _IOW('i', 244, struct ioctl) # define LMCIOCTL _IOWR('i', 245, struct ioctl) -#elif __linux__ /* sigh */ +#elif defined(__linux__) /* sigh */ # define LMCIOCGSTAT SIOCDEVPRIVATE+0 # define LMCIOCGCFG SIOCDEVPRIVATE+1 # define LMCIOCSCFG SIOCDEVPRIVATE+2 @@ -984,7 +984,7 @@ struct dma_desc #endif u_int32_t address1; /* buffer1 bus address */ u_int32_t address2; /* buffer2 bus address */ -#if (__FreeBSD__ || __NetBSD__ || __OpenBSD__) +#if (defined(__FreeBSD__) || 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 @@ -1029,13 +1029,13 @@ struct desc_ring u_int32_t dma_addr; /* bus address for desc array */ int size_descs; /* bus_dmamap_sync needs this */ int num_descs; /* used to set rx quota */ -#if __linux__ +#ifdef __linux__ struct sk_buff *head; /* tail-queue of skbuffs */ struct sk_buff *tail; #elif BSD struct mbuf *head; /* tail-queue of mbufs */ struct mbuf *tail; -# if (__FreeBSD__ || __NetBSD__ || __OpenBSD__) +# if (defined(__FreeBSD__) || 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,13 +1068,13 @@ struct card */ #define IOREF_CSR 1 /* access Tulip CSRs with IO cycles if 1 */ -#if (__FreeBSD__ && DEVICE_POLLING) +#if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) # define DEV_POLL 1 #else # define DEV_POLL 0 #endif -#if (ALTQ != 0) +#if defined(ALTQ) && ALTQ # define ALTQ_PRESENT 1 #else # define ALTQ_PRESENT 0 @@ -1085,7 +1085,7 @@ struct card /* FreeBSD wants struct ifnet first in the softc. */ struct softc { -#if (__NetBSD__ || __OpenBSD__) +#if (defined(__NetBSD__) || defined(__OpenBSD__)) struct device dev; /* base device -- must be first in softc */ pcitag_t pa_tag; /* pci_conf_read/write need this */ pci_chipset_tag_t pa_pc; /* pci_conf_read/write need this */ @@ -1100,7 +1100,7 @@ struct softc struct mbuf *tx_mbuf; /* hang mbuf here while building dma descs */ #endif /* __NetBSD__ || __OpenBSD__ */ -#if __bsdi__ +#ifdef __bsdi__ struct device dev; /* base device -- must be first in softc */ struct isadev id; /* bus resource */ struct intrhand ih; /* interrupt vectoring */ @@ -1130,7 +1130,7 @@ struct softc # endif #endif -#if __linux__ +#ifdef __linux__ # if GEN_HDLC hdlc_device *hdlc_dev; /* state for HDLC code */ sync_serial_settings hdlc_settings; /* state set by sethdlc program */ @@ -1152,7 +1152,7 @@ struct softc # endif #endif -#if __FreeBSD__ +#ifdef __FreeBSD__ struct device *dev; /* base device pointer */ bus_space_tag_t csr_tag; /* bus_space needs this */ bus_space_handle_t csr_handle;/* bus_space_needs this */ @@ -1163,7 +1163,7 @@ struct softc int csr_res_id; /* bus_release resource needs this */ int csr_res_type; /* bus_release resource needs this */ struct mbuf *tx_mbuf; /* hang mbuf here while building dma descs */ -# if DEVICE_POLLING +# ifdef DEVICE_POLLING int quota; /* used for incoming packet flow control */ # endif # if (__FreeBSD_version >= 500000) @@ -1175,7 +1175,7 @@ struct softc # endif #endif /* __FreeBSD__ */ -#if __linux__ +#ifdef __linux__ struct pci_dev *pci_dev; /* READ/WRITE_PCI_CFG macros need this */ struct net_device *net_dev; /* NAME_UNIT macro needs this */ struct timer_list wd_timer; /* timer calls watchdog() once a second */ @@ -1210,7 +1210,7 @@ struct softc /* Hide the minor differences between OS versions */ -#if __FreeBSD__ +#ifdef __FreeBSD__ 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) @@ -1262,7 +1262,7 @@ struct softc # endif #endif /* __FreeBSD__ */ -#if __NetBSD__ +#ifdef __NetBSD__ typedef int intr_return_t; # define READ_PCI_CFG(sc, addr) pci_conf_read ((sc)->pa_pc, (sc)->pa_tag, addr) # define WRITE_PCI_CFG(sc, addr, data) pci_conf_write((sc)->pa_pc, (sc)->pa_tag, addr, data) @@ -1291,7 +1291,7 @@ struct softc # endif #endif /* __NetBSD__ */ -#if __OpenBSD__ +#ifdef __OpenBSD__ typedef int intr_return_t; # define READ_PCI_CFG(sc, addr) pci_conf_read ((sc)->pa_pc, (sc)->pa_tag, addr) # define WRITE_PCI_CFG(sc, addr, data) pci_conf_write((sc)->pa_pc, (sc)->pa_tag, addr, data) @@ -1320,7 +1320,7 @@ struct softc # endif #endif /* __OpenBSD__ */ -#if __bsdi__ +#ifdef __bsdi__ typedef int intr_return_t; # define READ_PCI_CFG(sc, addr) pci_inl(&(sc)->cfgbase, addr) # define WRITE_PCI_CFG(sc, addr, data) pci_outl(&(sc)->cfgbase, addr, data) @@ -1368,7 +1368,7 @@ struct softc # endif #endif /* __bsdi__ */ -#if __linux__ +#ifdef __linux__ static u_int32_t /* inline? so rare it doesn't matter */ READ_PCI_CFG(softc_t *sc, u_int32_t addr) { @@ -1423,10 +1423,10 @@ READ_PCI_CFG(softc_t *sc, u_int32_t addr) # define LMC_BPF_DETACH /* nothing */ #endif -#if (__bsdi__ || /* unconditionally */ \ - (__FreeBSD__ && (__FreeBSD_version < 503000)) || \ - (__NetBSD__ && (__NetBSD_Version__ < 106000000)) || \ - (__OpenBSD__ && ( OpenBSD < 200111))) +#if (defined(__bsdi__) || /* unconditionally */ \ + (defined(__FreeBSD__) && (__FreeBSD_version < 503000)) || \ + (defined(__NetBSD__) && (__NetBSD_Version__ < 106000000)) || \ + (defined(__OpenBSD__) && ( OpenBSD < 200111))) # define IFQ_ENQUEUE(ifq, m, pa, err) \ do { \ if (pa==0); /* suppress warning */ \ @@ -1527,8 +1527,8 @@ static void t1_send_bop(softc_t *, int); static int t1_ioctl(softc_t *, struct ioctl *); #if IFNET -# if ((__FreeBSD__ && (__FreeBSD_version < 500000)) ||\ - __NetBSD__ || __OpenBSD__ || __bsdi__) +# if ((defined(__FreeBSD__) && (__FreeBSD_version < 500000)) ||\ + defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)) static void netisr_dispatch(int, struct mbuf *); # endif static void raw_input(struct ifnet *, struct mbuf *); @@ -1537,7 +1537,7 @@ static void raw_input(struct ifnet *, struct mbuf *); #if BSD static void mbuf_enqueue(struct desc_ring *, struct mbuf *); static struct mbuf* mbuf_dequeue(struct desc_ring *); -# if __FreeBSD__ +# ifdef __FreeBSD__ static void fbsd_dmamap_load(void *, bus_dma_segment_t *, int, int); # endif static int create_ring(softc_t *, struct desc_ring *, int); @@ -1549,7 +1549,7 @@ static int txintr_setup_mbuf(softc_t *, struct mbuf *); static int txintr_setup(softc_t *); #endif /* BSD */ -#if __linux__ +#ifdef __linux__ static void skbuff_enqueue(struct desc_ring *, struct sk_buff *); static struct sk_buff* skbuff_dequeue(struct desc_ring *); static int create_ring(softc_t *, struct desc_ring *, int); @@ -1566,7 +1566,7 @@ static void check_intr_status(softc_t *); static void core_interrupt(void *, int); static void user_interrupt(softc_t *, int); #if BSD -# if (__FreeBSD__ && DEVICE_POLLING) +# if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) static void fbsd_poll(struct ifnet *, enum poll_cmd, int); # endif static intr_return_t bsd_interrupt(void *); @@ -1593,7 +1593,7 @@ static void ifnet_start(struct ifnet *); static int raw_output(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); static void ifnet_watchdog(struct ifnet *); -# if __OpenBSD__ +# ifdef __OpenBSD__ static int ifmedia_change(struct ifnet *); static void ifmedia_status(struct ifnet *, struct ifmediareq *); # endif /* __OpenBSD__ */ @@ -1635,14 +1635,14 @@ static void shutdown_card(void *); static int attach_card(softc_t *, const char *); static void detach_card(softc_t *); -#if __FreeBSD__ +#ifdef __FreeBSD__ static int fbsd_probe(device_t); static int fbsd_detach(device_t); static void fbsd_shutdown(device_t); static int fbsd_attach(device_t); #endif /* __FreeBSD__ */ -#if __NetBSD__ +#ifdef __NetBSD__ static int nbsd_match(struct device *t, struct cfdata *, void *); static int nbsd_detach(struct device *, int); static void nbsd_attach(struct device *, struct device *, void *); @@ -1650,20 +1650,20 @@ static int lkm_nbsd_match(struct pci_attach_args *); int if_lmc_lkmentry(struct lkm_table *, int, int); #endif /* __NetBSD__ */ -#if __OpenBSD__ +#ifdef __OpenBSD__ static int obsd_match(struct device *, void *, void *); static int obsd_detach(struct device *, int); static void obsd_attach(struct device *, struct device *, void *); int if_lmc_lkmentry(struct lkm_table *, int, int); #endif /* __OpenBSD__ */ -#if __bsdi__ +#ifdef __bsdi__ static int bsdi_match(pci_devaddr_t *); static int bsdi_probe(struct device *, struct cfdata *, void *); static void bsdi_attach(struct device *, struct device *, void *); #endif /* __bsdi__ */ -#if __linux__ +#ifdef __linux__ static irqreturn_t linux_interrupt(int, void *, struct pt_regs *); static int linux_poll(struct net_device *, int *); static int linux_start(struct sk_buff *, struct net_device *); |
