summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-21 22:27:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-21 22:27:58 +0000
commit83da6a9e5a8ac85f7f65661f4c2b7abdd92e4dd8 (patch)
treeed31830e32d863b7e6bd46b9574811c7a54d583f /sys/dev
parent4209c6e4b597ecaeeec78b546c6234e31154f98c (diff)
check for __OpenBSD__, prep for tossing __NetBSD__?
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/eisa/ahc_eisa.c18
-rw-r--r--sys/dev/eisa/if_fea.c8
-rw-r--r--sys/dev/ic/aic7xxx.c58
-rw-r--r--sys/dev/ic/aic7xxxvar.h12
-rw-r--r--sys/dev/ic/pdq.c6
-rw-r--r--sys/dev/ic/pdq_ifsubr.c6
-rw-r--r--sys/dev/ic/pdqvar.h12
-rw-r--r--sys/dev/ic/smc93cx6.c6
-rw-r--r--sys/dev/ic/smc93cx6var.h10
-rw-r--r--sys/dev/pci/ahc_pci.c28
-rw-r--r--sys/dev/pci/if_de.c41
-rw-r--r--sys/dev/pci/ncr.c80
12 files changed, 143 insertions, 142 deletions
diff --git a/sys/dev/eisa/ahc_eisa.c b/sys/dev/eisa/ahc_eisa.c
index 994ed19cf28..3bbbfe714a7 100644
--- a/sys/dev/eisa/ahc_eisa.c
+++ b/sys/dev/eisa/ahc_eisa.c
@@ -29,13 +29,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ahc_eisa.c,v 1.2 1996/06/27 21:15:44 shawn Exp $
+ * $Id: ahc_eisa.c,v 1.3 1996/08/21 22:27:24 deraadt Exp $
*/
#if defined(__FreeBSD__)
#include <eisa.h>
#endif
-#if NEISA > 0 || defined(__NetBSD__)
+#if NEISA > 0 || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/systm.h>
@@ -44,7 +44,7 @@
#endif
#include <sys/kernel.h>
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#include <machine/bus.h>
#include <machine/intr.h>
@@ -66,7 +66,7 @@
#define EISA_DEVICE_ID_ADAPTEC_284xB 0x04907756 /* BIOS enabled */
#define EISA_DEVICE_ID_ADAPTEC_284x 0x04907757 /* BIOS disabled*/
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include <dev/eisa/eisareg.h>
#include <dev/eisa/eisavar.h>
@@ -185,7 +185,7 @@ aic7770probe(void)
return count;
}
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#define bootverbose 1
@@ -266,7 +266,7 @@ ahc_eisa_match(parent, match, aux)
static int
aic7770_attach(e_dev)
struct eisa_device *e_dev;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
void
ahc_eisa_attach(parent, self, aux)
struct device *parent, *self;
@@ -323,7 +323,7 @@ ahc_eisa_attach(parent, self, aux)
}
eisa_reg_end(e_dev);
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
struct ahc_data *ahc = (void *)self;
struct eisa_attach_args *ea = aux;
@@ -467,7 +467,7 @@ ahc_eisa_attach(parent, self, aux)
*/
eisa_release_intr(e_dev, irq, ahc_intr);
return -1;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc_free(ahc);
return;
#endif
@@ -489,7 +489,7 @@ ahc_eisa_attach(parent, self, aux)
}
e_dev->kdc->kdc_state = DC_BUSY; /* host adapters always busy */
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
intrstr = eisa_intr_string(ec, ih);
/*
* The IRQMS bit enables level sensitive interrupts only allow
diff --git a/sys/dev/eisa/if_fea.c b/sys/dev/eisa/if_fea.c
index a02845a939f..68d4852d4fd 100644
--- a/sys/dev/eisa/if_fea.c
+++ b/sys/dev/eisa/if_fea.c
@@ -43,7 +43,7 @@
#include <sys/malloc.h>
#if defined(__FreeBSD__)
#include <sys/devconf.h>
-#elif defined(__bsdi__) || defined(__NetBSD__)
+#elif defined(__bsdi__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#endif
@@ -89,7 +89,7 @@
#include <i386/eisa/eisa.h>
#include <i386/eisa/pdqvar.h>
#include <i386/eisa/pdqreg.h>
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include <machine/cpu.h>
#include <machine/bus.h>
@@ -118,7 +118,7 @@ extern struct cfdriver feacd;
#define DEFEA_INTRENABLE 0x28 /* edge interrupt */
static const int pdq_eisa_irqs[4] = { IRQ9, IRQ10, IRQ11, IRQ15 };
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#define DEFEA_INTRENABLE 0x8 /* level interrupt */
#define pdq_eisa_ifwatchdog NULL
static const int pdq_eisa_irqs[4] = { 9, 10, 11, 15 };
@@ -436,7 +436,7 @@ struct cfdriver feacd = {
};
#endif /* __bsdi__ */
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
static int
pdq_eisa_match(
struct device *parent,
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c
index 6e866ac6e89..d8a77c6052c 100644
--- a/sys/dev/ic/aic7xxx.c
+++ b/sys/dev/ic/aic7xxx.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.c,v 1.8 1996/07/02 20:18:51 deraadt Exp $
+ * $Id: aic7xxx.c,v 1.9 1996/08/21 22:27:32 deraadt Exp $
*/
/*
* TODO:
@@ -115,7 +115,7 @@
#include <sys/param.h>
#include <sys/systm.h>
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#include <machine/bus.h>
#include <machine/intr.h>
@@ -126,7 +126,7 @@
#include <sys/proc.h>
#include <scsi/scsi_all.h>
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <scsi/scsi_debug.h>
#endif
#include <scsi/scsiconf.h>
@@ -145,7 +145,7 @@
#include <dev/aic7xxx/aic7xxx_reg.h>
#endif /* defined(__FreeBSD__) */
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <dev/ic/aic7xxxreg.h>
#include <dev/ic/aic7xxxvar.h>
@@ -242,7 +242,7 @@ static struct scsi_device ahc_dev =
\
UNPAUSE_SEQUENCER(ahc);
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
/*
* Is device which is pointed by sc_link connected on second scsi bus ?
*/
@@ -291,7 +291,7 @@ static void ahc_scsirate __P((struct ahc_data* ahc, u_char *scsirate,
#if defined(__FreeBSD__)
static timeout_t
ahc_timeout;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
static void ahc_timeout __P((void *));
#endif
static void ahc_busy_target __P((struct ahc_data *ahc,
@@ -310,7 +310,7 @@ char *ahc_name(ahc)
return (name);
}
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
struct cfdriver ahc_cd = {
NULL, "ahc", DV_DULL
};
@@ -389,7 +389,7 @@ struct ahc_data *
ahc_alloc(unit, iobase, type, flags)
int unit;
u_long iobase;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
void
ahc_construct(ahc, bc, ioh, type, flags)
struct ahc_data *ahc;
@@ -427,7 +427,7 @@ ahc_construct(ahc, bc, ioh, type, flags)
#endif
#if defined(__FreeBSD__)
ahc->baseport = iobase;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc->sc_bc = bc;
ahc->sc_ioh = ioh;
#endif
@@ -455,7 +455,7 @@ void
#if defined(__FreeBSD__)
ahc_reset(iobase)
u_long iobase;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc_reset(devname, bc, ioh)
char *devname;
bus_chipset_tag_t bc;
@@ -470,7 +470,7 @@ ahc_reset(devname, bc, ioh)
hcntrl = (inb(HCNTRL + iobase) & IRQMS) | INTEN;
outb(HCNTRL + iobase, CHIPRST | PAUSE);
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
hcntrl = (bus_io_read_1(bc, ioh, HCNTRL) & IRQMS) | INTEN;
bus_io_write_1(bc, ioh, HCNTRL, CHIPRST | PAUSE);
@@ -481,7 +481,7 @@ ahc_reset(devname, bc, ioh)
wait = 1000;
#if defined(__FreeBSD__)
while (--wait && !(inb(HCNTRL + iobase) & CHIPRSTACK))
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
while (--wait && !(bus_io_read_1(bc, ioh, HCNTRL) & CHIPRSTACK))
#endif
DELAY(1000);
@@ -489,14 +489,14 @@ ahc_reset(devname, bc, ioh)
#if defined(__FreeBSD__)
printf("ahc at 0x%lx: WARNING - Failed chip reset! "
"Trying to initialize anyway.\n", iobase);
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
printf("%s: WARNING - Failed chip reset! "
"Trying to initialize anyway.\n", devname);
#endif
}
#if defined(__FreeBSD__)
outb(HCNTRL + iobase, hcntrl | PAUSE);
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
bus_io_write_1(bc, ioh, HCNTRL, hcntrl | PAUSE);
#endif
}
@@ -575,7 +575,7 @@ ahc_scsirate(ahc, scsirate, period, offset, channel, target )
}
}
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
int
ahcprint(aux, name)
void *aux;
@@ -608,7 +608,7 @@ ahc_attach(ahc)
ahc->sc_link.adapter_unit = ahc->unit;
ahc->sc_link.adapter_targ = ahc->our_id;
ahc->sc_link.fordriver = 0;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc->sc_link.adapter_target = ahc->our_id;
#endif
ahc->sc_link.adapter_softc = ahc;
@@ -624,7 +624,7 @@ ahc_attach(ahc)
ahc->sc_link_b.adapter_targ = ahc->our_id_b;
ahc->sc_link_b.adapter_bus = 1;
ahc->sc_link_b.fordriver = (void *)SELBUSB;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc->sc_link_b.adapter_target = ahc->our_id_b;
#endif
}
@@ -666,7 +666,7 @@ ahc_attach(ahc)
scsi_attachdevs(scbus);
scbus = NULL; /* Upper-level SCSI code owns this now */
}
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
/*
* XXX - Update MI SCSI code
*
@@ -912,7 +912,7 @@ void ahc_add_waiting_scb(ahc, scb)
*/
#if defined(__FreeBSD__)
void
-#elif defined (__NetBSD__)
+#elif defined (__NetBSD__) || defined(__OpenBSD__)
int
#endif
ahc_intr(arg)
@@ -932,7 +932,7 @@ ahc_intr(arg)
if (!(intstat & INT_PEND))
#if defined(__FreeBSD__)
return;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
return 0;
#endif
@@ -1443,7 +1443,7 @@ pagein_done:
#endif
#if defined(__FreeBSD__)
sc->op_code = REQUEST_SENSE;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
sc->opcode = REQUEST_SENSE;
#endif
sc->byte2 = xs->sc_link->lun << 5;
@@ -1558,7 +1558,7 @@ pagein_done:
#if defined(__FreeBSD__)
xs->flags |= SCSI_RESID_VALID;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
/* XXX - Update to do this right */
#endif
#ifdef AHC_DEBUG
@@ -1804,7 +1804,7 @@ clear:
ahc_unbusy_target(ahc, xs->sc_link->target,
#if defined(__FreeBSD__)
((long)xs->sc_link->fordriver & SELBUSB)
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
IS_SCSIBUS_B(ahc, xs->sc_link)
#endif
? 'B' : 'A');
@@ -1862,7 +1862,7 @@ clear:
ahc_run_waiting_queues(ahc);
}
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
return 1;
#endif
}
@@ -1884,7 +1884,7 @@ ahc_done(ahc, scb)
* Put the results of the operation
* into the xfer and call whoever started it
*/
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
if (xs->error != XS_NOERROR) {
/* Don't override the error value. */
} else if (scb->flags & SCB_ABORTED) {
@@ -1900,7 +1900,7 @@ ahc_done(ahc, scb)
/* All went correctly OR errors expected */
xs->error = XS_NOERROR;
}
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
/*
* Since NetBSD doesn't have error ignoring operation mode
* (SCSI_ERR_OK in FreeBSD), we don't have to care this case.
@@ -2275,7 +2275,7 @@ ahcminphys(bp)
if (bp->b_bcount > ((AHC_NSEG - 1) * PAGE_SIZE)) {
bp->b_bcount = ((AHC_NSEG - 1) * PAGE_SIZE);
}
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
minphys(bp);
#endif
}
@@ -2303,7 +2303,7 @@ ahc_scsi_cmd(xs)
mask = (0x01 << (xs->sc_link->target
#if defined(__FreeBSD__)
| ((u_long)xs->sc_link->fordriver & 0x08)));
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
| (IS_SCSIBUS_B(ahc, xs->sc_link) ? SELBUSB : 0) ));
#endif
SC_DEBUG(xs->sc_link, SDEV_DB2, ("ahc_scsi_cmd\n"));
@@ -2356,7 +2356,7 @@ ahc_scsi_cmd(xs)
scb->tcl = ((xs->sc_link->target << 4) & 0xF0) |
#if defined(__FreeBSD__)
((u_long)xs->sc_link->fordriver & 0x08) |
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
(IS_SCSIBUS_B(ahc,xs->sc_link)? SELBUSB : 0)|
#endif
(xs->sc_link->lun & 0x07);
diff --git a/sys/dev/ic/aic7xxxvar.h b/sys/dev/ic/aic7xxxvar.h
index 60ee73ad7c8..d3be3ce189c 100644
--- a/sys/dev/ic/aic7xxxvar.h
+++ b/sys/dev/ic/aic7xxxvar.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxxvar.h,v 1.6 1996/06/27 21:15:49 shawn Exp $
+ * $Id: aic7xxxvar.h,v 1.7 1996/08/21 22:27:36 deraadt Exp $
*/
#ifndef _AIC7XXX_H_
@@ -40,7 +40,7 @@
#include "ahc.h" /* for NAHC from config */
#endif
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
/*
* convert FreeBSD's <sys/queue.h> symbols to NetBSD's
*/
@@ -66,7 +66,7 @@
outsb((ahc)->baseport+(port), valp, size)
#define AHC_OUTSL(ahc, port, valp, size) \
outsl((ahc)->baseport+(port), valp, size)
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#define AHC_INB(ahc, port) \
bus_io_read_1((ahc)->sc_bc, (ahc)->sc_ioh, port)
#define AHC_INSB(ahc, port, valp, size) \
@@ -203,7 +203,7 @@ struct scb {
struct ahc_data {
#if defined(__FreeBSD__)
int unit;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
struct device sc_dev;
void *sc_ih;
bus_chipset_tag_t sc_bc;
@@ -281,7 +281,7 @@ char *ahc_name __P((struct ahc_data *ahc));
void ahc_reset __P((u_long iobase));
struct ahc_data *ahc_alloc __P((int unit, u_long io_base, ahc_type type, ahc_flag flags));
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#define ahc_name(ahc) (ahc)->sc_dev.dv_xname
@@ -293,7 +293,7 @@ int ahc_init __P((struct ahc_data *));
int ahc_attach __P((struct ahc_data *));
#if defined(__FreeBSD__)
void ahc_intr __P((void *arg));
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
int ahc_intr __P((void *arg));
#endif
diff --git a/sys/dev/ic/pdq.c b/sys/dev/ic/pdq.c
index ccdb5b526a0..71793542bf8 100644
--- a/sys/dev/ic/pdq.c
+++ b/sys/dev/ic/pdq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdq.c,v 1.4 1996/06/18 10:22:28 deraadt Exp $ */
+/* $OpenBSD: pdq.c,v 1.5 1996/08/21 22:27:39 deraadt Exp $ */
/* $NetBSD: pdq.c,v 1.5.4.1 1996/06/08 00:17:44 cgd Exp $ */
/*-
@@ -170,13 +170,13 @@ pdq_print_fddi_chars(
const char hexchars[] = "0123456789abcdef";
printf(
-#if !defined(__bsdi__) && !defined(__NetBSD__)
+#if !defined(__bsdi__) && !(defined(__NetBSD__) || defined(__OpenBSD__))
PDQ_OS_PREFIX
#else
": "
#endif
"DEC %s FDDI %s Controller\n",
-#if !defined(__bsdi__) && !defined(__NetBSD__)
+#if !defined(__bsdi__) && !(defined(__NetBSD__) || defined(__OpenBSD__))
PDQ_OS_PREFIX_ARGS,
#endif
pdq_descriptions[pdq->pdq_type],
diff --git a/sys/dev/ic/pdq_ifsubr.c b/sys/dev/ic/pdq_ifsubr.c
index 9435e716c18..df191ed37a8 100644
--- a/sys/dev/ic/pdq_ifsubr.c
+++ b/sys/dev/ic/pdq_ifsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdq_ifsubr.c,v 1.3 1996/05/26 00:27:03 deraadt Exp $ */
+/* $OpenBSD: pdq_ifsubr.c,v 1.4 1996/08/21 22:27:41 deraadt Exp $ */
/* $NetBSD: pdq_ifsubr.c,v 1.5 1996/05/20 00:26:21 thorpej Exp $ */
/*-
@@ -46,7 +46,7 @@
#include <sys/malloc.h>
#if defined(__FreeBSD__)
#include <sys/devconf.h>
-#elif defined(__bsdi__) || defined(__NetBSD__)
+#elif defined(__bsdi__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#endif
@@ -364,7 +364,7 @@ pdq_ifattach(
ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_NOTRAILERS|IFF_MULTICAST;
-#if (defined(__FreeBSD__) && BSD >= 199506) || defined(__NetBSD__)
+#if (defined(__FreeBSD__) && BSD >= 199506) || defined(__NetBSD__) || defined(__OpenBSD__)
ifp->if_watchdog = pdq_ifwatchdog;
#else
ifp->if_watchdog = ifwatchdog;
diff --git a/sys/dev/ic/pdqvar.h b/sys/dev/ic/pdqvar.h
index aa476e8818e..cbde2877bc1 100644
--- a/sys/dev/ic/pdqvar.h
+++ b/sys/dev/ic/pdqvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdqvar.h,v 1.5 1996/06/18 10:22:29 deraadt Exp $ */
+/* $OpenBSD: pdqvar.h,v 1.6 1996/08/21 22:27:42 deraadt Exp $ */
/* $NetBSD: pdqvar.h,v 1.6.4.1 1996/06/08 00:17:49 cgd Exp $ */
/*-
@@ -61,7 +61,7 @@ enum _pdq_type_t {
#if defined(PDQTEST)
#include <pdq_os_test.h>
-#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__NetBSD__)
+#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/systm.h>
@@ -73,7 +73,7 @@ enum _pdq_type_t {
#include <vm/vm_kern.h>
#define PDQ_USE_MBUFS
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#define PDQ_OS_PREFIX "%s: "
#define PDQ_OS_PREFIX_ARGS pdq->pdq_os_name
#else
@@ -83,7 +83,7 @@ enum _pdq_type_t {
#define PDQ_OS_PAGESIZE NBPG
#define PDQ_OS_USEC_DELAY(n) DELAY(n)
#define PDQ_OS_MEMZERO(p, n) bzero((caddr_t)(p), (n))
-#if defined(__NetBSD__) && defined(__alpha__)
+#if (defined(__NetBSD__) || defined(__OpenBSD__)) && defined(__alpha__)
#define PDQ_OS_VA_TO_PA(pdq, p) (vtophys(p) | (pdq->pdq_type == PDQ_DEFTA ? 0 : 0x40000000))
#else
#define PDQ_OS_VA_TO_PA(pdq, p) vtophys(p)
@@ -125,7 +125,7 @@ typedef volatile pdq_uint32_t *pdq_bus_memaddr_t;
typedef pdq_bus_memaddr_t pdq_bus_memoffset_t;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include <machine/bus.h>
#include <machine/intr.h>
#define PDQ_OS_PTR_FMT "%p"
@@ -195,7 +195,7 @@ typedef struct {
struct isadev sc_id; /* ISA device */
struct intrhand sc_ih; /* interrupt vectoring */
struct atshutdown sc_ats; /* shutdown routine */
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
struct device sc_dev; /* base device */
void *sc_ih; /* interrupt vectoring */
void *sc_ats; /* shutdown hook */
diff --git a/sys/dev/ic/smc93cx6.c b/sys/dev/ic/smc93cx6.c
index 6b5ac52ec21..3a6fb005188 100644
--- a/sys/dev/ic/smc93cx6.c
+++ b/sys/dev/ic/smc93cx6.c
@@ -18,7 +18,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: smc93cx6.c,v 1.2 1996/06/27 21:15:50 shawn Exp $
+ * $Id: smc93cx6.c,v 1.3 1996/08/21 22:27:43 deraadt Exp $
*/
/*
@@ -58,7 +58,7 @@
#if defined(__FreeBSD__)
#include <machine/clock.h>
#include <i386/scsi/93cx6.h>
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include <machine/bus.h>
#include <dev/ic/smc93cx6var.h>
#endif
@@ -91,7 +91,7 @@ read_seeprom(sd, buf, start_addr, count)
#if defined(__FreeBSD__)
u_int start_addr;
int count;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
bus_io_size_t start_addr;
bus_io_size_t count;
#endif
diff --git a/sys/dev/ic/smc93cx6var.h b/sys/dev/ic/smc93cx6var.h
index 017d6aee071..cfd805b8ea4 100644
--- a/sys/dev/ic/smc93cx6var.h
+++ b/sys/dev/ic/smc93cx6var.h
@@ -20,18 +20,18 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: smc93cx6var.h,v 1.2 1996/06/27 21:15:50 shawn Exp $
+ * $Id: smc93cx6var.h,v 1.3 1996/08/21 22:27:45 deraadt Exp $
*/
#include <sys/param.h>
-#if !defined(__NetBSD__)
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
#include <sys/systm.h>
#endif
struct seeprom_descriptor {
#if defined(__FreeBSD__)
u_long sd_iobase;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
bus_chipset_tag_t sd_bc;
bus_io_handle_t sd_ioh;
bus_io_size_t sd_offset;
@@ -63,7 +63,7 @@ struct seeprom_descriptor {
#if defined(__FreeBSD__)
#define SEEPROM_INB(sd) inb(sd->sd_iobase)
#define SEEPROM_OUTB(sd, value) outb(sd->sd_iobase, value)
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#define SEEPROM_INB(sd) \
bus_io_read_1(sd->sd_bc, sd->sd_ioh, sd->sd_offset)
#define SEEPROM_OUTB(sd, value) \
@@ -73,7 +73,7 @@ struct seeprom_descriptor {
#if defined(__FreeBSD__)
int read_seeprom __P((struct seeprom_descriptor *sd,
u_int16_t *buf, u_int start_addr, int count));
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
int read_seeprom __P((struct seeprom_descriptor *sd,
u_int16_t *buf, bus_io_size_t start_addr, bus_io_size_t count));
#endif
diff --git a/sys/dev/pci/ahc_pci.c b/sys/dev/pci/ahc_pci.c
index 1e92b37c7cf..903df7a1e60 100644
--- a/sys/dev/pci/ahc_pci.c
+++ b/sys/dev/pci/ahc_pci.c
@@ -29,19 +29,19 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ahc_pci.c,v 1.2 1996/06/27 21:15:55 shawn Exp $
+ * $Id: ahc_pci.c,v 1.3 1996/08/21 22:27:49 deraadt Exp $
*/
#if defined(__FreeBSD__)
#include <pci.h>
#endif
-#if NPCI > 0 || defined(__NetBSD__)
+#if NPCI > 0 || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/queue.h>
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#include <machine/bus.h>
#include <machine/intr.h>
@@ -64,7 +64,7 @@
#define PCI_BASEADR0 PCI_MAP_REG_START
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
@@ -238,7 +238,7 @@ aic7870_probe (pcici_t tag, pcidi_t type)
}
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
int ahc_pci_probe __P((struct device *, void *, void *));
void ahc_pci_attach __P((struct device *, struct device *, void *));
@@ -277,7 +277,7 @@ static void
aic7870_attach(config_id, unit)
pcici_t config_id;
int unit;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
void
ahc_pci_attach(parent, self, aux)
struct device *parent, *self;
@@ -286,7 +286,7 @@ ahc_pci_attach(parent, self, aux)
{
#if defined(__FreeBSD__)
u_long io_port;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
struct pci_attach_args *pa = aux;
struct ahc_data *ahc = (void *)self;
int unit = ahc->sc_dev.dv_unit;
@@ -314,7 +314,7 @@ ahc_pci_attach(parent, self, aux)
* set hence we mask it off.
*/
io_port &= 0xfffffffe;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
if (pci_io_find(pa->pa_pc, pa->pa_tag, PCI_BASEADR0, &iobase, &iosize))
return;
if (bus_io_map(pa->pa_bc, iobase, iosize, &ioh))
@@ -323,7 +323,7 @@ ahc_pci_attach(parent, self, aux)
#if defined(__FreeBSD__)
switch ((id = pci_conf_read(config_id, PCI_ID_REG))) {
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
switch (id = pa->pa_id) {
#endif
case PCI_DEVICE_ID_ADAPTEC_3940U:
@@ -378,7 +378,7 @@ ahc_pci_attach(parent, self, aux)
#if defined(__FreeBSD__)
ahc_reset(io_port);
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
printf("\n");
ahc_reset(ahc->sc_dev.dv_xname, pa->pa_bc, ioh);
#endif
@@ -386,7 +386,7 @@ ahc_pci_attach(parent, self, aux)
if(ahc_t & AHC_AIC7870){
#if defined(__FreeBSD__)
u_long devconfig = pci_conf_read(config_id, DEVCONFIG);
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
u_long devconfig =
pci_conf_read(pa->pa_pc, pa->pa_tag, DEVCONFIG);
#endif
@@ -414,7 +414,7 @@ ahc_pci_attach(parent, self, aux)
devconfig &= ~(RAMPSM|SCBRAMSEL);
#if defined(__FreeBSD__)
pci_conf_write(config_id, DEVCONFIG, devconfig);
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
pci_conf_write(pa->pa_pc, pa->pa_tag,
DEVCONFIG, devconfig);
#endif
@@ -429,7 +429,7 @@ ahc_pci_attach(parent, self, aux)
ahc_free(ahc);
return;
}
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc_construct(ahc, pa->pa_bc, ioh, ahc_t, ahc_f);
if (pci_intr_map(pa->pa_pc, pa->pa_intrtag, pa->pa_intrpin,
@@ -602,7 +602,7 @@ load_seeprom(ahc)
#if defined(__FreeBSD__)
sd.sd_iobase = ahc->baseport + SEECTL;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
sd.sd_bc = ahc->sc_bc;
sd.sd_ioh = ahc->sc_ioh;
sd.sd_offset = SEECTL;
diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c
index 78e9d19ff82..96533241529 100644
--- a/sys/dev/pci/if_de.c
+++ b/sys/dev/pci/if_de.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_de.c,v 1.11 1996/06/10 07:34:41 deraadt Exp $ */
+/* $OpenBSD: if_de.c,v 1.12 1996/08/21 22:27:52 deraadt Exp $ */
/* $NetBSD: if_de.c,v 1.22.4.1 1996/06/03 20:32:07 cgd Exp $ */
/*-
@@ -53,7 +53,7 @@
#if defined(__FreeBSD__)
#include <sys/devconf.h>
#include <machine/clock.h>
-#elif defined(__bsdi__) || defined(__NetBSD__)
+#elif defined(__bsdi__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#endif
@@ -102,7 +102,7 @@
#endif
#endif /* __bsdi__ */
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <machine/bus.h>
#include <machine/intr.h>
@@ -139,7 +139,7 @@ typedef struct {
#define TULIP_EISA_CSRSIZE 16
#define TULIP_PCI_CSRSIZE 8
-#ifndef __NetBSD__
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
typedef tulip_uint16_t tulip_csrptr_t;
#define TULIP_READ_CSR(sc, csr) (inl((sc)->tulip_csrs.csr))
@@ -165,7 +165,7 @@ typedef bus_io_size_t tulip_csrptr_t;
#define TULIP_PCI_CSRSIZE 8
-#ifndef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
typedef volatile tulip_uint32_t *tulip_csrptr_t;
/*
@@ -304,7 +304,7 @@ struct _tulip_softc_t {
struct intrhand tulip_ih; /* intrrupt vectoring */
struct atshutdown tulip_ats; /* shutdown hook */
#endif
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
struct device tulip_dev; /* base device */
void *tulip_ih; /* intrrupt vectoring */
void *tulip_ats; /* shutdown hook */
@@ -377,7 +377,7 @@ extern struct cfdriver decd;
#define TULIP_IFP_TO_SOFTC(ifp) (TULIP_UNIT_TO_SOFTC((ifp)->if_unit))
#define TULIP_BURSTSIZE(unit) log2_burst_size
#endif
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
typedef void ifnet_ret_t;
typedef u_long ioctl_cmd_t;
extern struct cfattach de_ca;
@@ -391,7 +391,7 @@ extern struct cfdriver de_cd;
#endif
#define tulip_if tulip_ac.ac_if
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#define tulip_unit tulip_dev.dv_unit
#define tulip_name tulip_dev.dv_cfdata->cf_driver->cd_name
#else
@@ -418,7 +418,7 @@ static ifnet_ret_t tulip_start(struct ifnet *ifp);
static void tulip_rx_intr(tulip_softc_t *sc);
static void tulip_addr_filter(tulip_softc_t *sc);
-#if defined(__NetBSD__) && defined(__alpha__)
+#if (defined(__NetBSD__) || defined(__OpenBSD__)) && defined(__alpha__)
/* XXX XXX NEED REAL DMA MAPPING SUPPORT XXX XXX */
#define vtophys(va) __alpha_bus_XXX_dmamap(sc->tulip_bc, (void *)(va))
@@ -2048,7 +2048,7 @@ tulip_attach(
#elif defined(__bsdi__)
printf("\n%s", sc->tulip_xname);
#endif
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
printf(": %s%s pass %d.%d\n%s: Ethernet address %s\n",
#else
printf(": %s%s pass %d.%d Ethernet address %s\n",
@@ -2057,7 +2057,7 @@ tulip_attach(
tulip_chipdescs[sc->tulip_chipid],
(sc->tulip_revinfo & 0xF0) >> 4,
sc->tulip_revinfo & 0x0F,
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
sc->tulip_dev.dv_xname,
#endif
ether_sprintf(sc->tulip_hwaddr));
@@ -2071,7 +2071,7 @@ tulip_attach(
tulip_reset(sc);
if_attach(ifp);
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
ether_ifattach(ifp);
#endif
@@ -2357,7 +2357,7 @@ struct cfdriver decd = {
#endif /* __bsdi__ */
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#define TULIP_PCI_ATTACH_ARGS struct device * const parent, struct device * const self, void * const aux
static void
@@ -2414,7 +2414,7 @@ tulip_pci_attach(
pci_devaddr_t *pa = (pci_devaddr_t *) ia->ia_aux;
int unit = sc->tulip_dev.dv_unit;
#endif
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
tulip_softc_t * const sc = (tulip_softc_t *) self;
struct pci_attach_args * const pa = (struct pci_attach_args *) aux;
bus_chipset_tag_t bc = pa->pa_bc;
@@ -2432,7 +2432,8 @@ tulip_pci_attach(
const char *intrstr = NULL;
#endif
int retval, idx, revinfo, id;
-#if !defined(TULIP_IOMAPPED) && !defined(__bsdi__) && !defined(__NetBSD__)
+#if !defined(TULIP_IOMAPPED) && !defined(__bsdi__) && \
+ !(defined(__NetBSD__) || defined(__OpenBSD__))
vm_offset_t pa_csrs;
#endif
unsigned csrsize = TULIP_PCI_CSRSIZE;
@@ -2464,7 +2465,7 @@ tulip_pci_attach(
#endif
}
#endif
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
revinfo = pci_conf_read(pc, pa->pa_tag, PCI_CFRV) & 0xFF;
id = pa->pa_id;
#endif
@@ -2520,7 +2521,7 @@ tulip_pci_attach(
}
sc->tulip_chipid = chipid;
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
bcopy(self->dv_xname, sc->tulip_if.if_xname, IFNAMSIZ);
sc->tulip_if.if_softc = sc;
#else
@@ -2556,7 +2557,7 @@ tulip_pci_attach(
#endif
#endif /* __bsdi__ */
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
sc->tulip_bc = bc;
sc->tulip_pc = pc;
#if defined(TULIP_IOMAPPED)
@@ -2602,7 +2603,7 @@ tulip_pci_attach(
DELAY(10); /* Wait 10 microseconds (actually 50 PCI cycles but at
33MHz that comes to two microseconds but wait a
bit longer anyways) */
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
if (sc->tulip_boardsw->bd_type != TULIP_DC21040_ZX314_SLAVE) {
pci_intr_handle_t intrhandle;
@@ -2650,7 +2651,7 @@ tulip_pci_attach(
#endif
tulip_reset(sc);
tulip_attach(sc);
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
if (intrstr != NULL)
printf("%s: interrupting at %s\n", self->dv_xname, intrstr);
#endif
diff --git a/sys/dev/pci/ncr.c b/sys/dev/pci/ncr.c
index 5374a996ec9..6b95986406e 100644
--- a/sys/dev/pci/ncr.c
+++ b/sys/dev/pci/ncr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncr.c,v 1.10 1996/06/10 07:34:47 deraadt Exp $ */
+/* $OpenBSD: ncr.c,v 1.11 1996/08/21 22:27:57 deraadt Exp $ */
/* $NetBSD: ncr.c,v 1.35.4.1 1996/06/03 20:32:17 cgd Exp $ */
/**************************************************************************
@@ -158,7 +158,7 @@
**==========================================================
*/
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#ifdef _KERNEL
#define KERNEL
#endif
@@ -175,7 +175,7 @@
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sys/kernel.h>
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
#include <machine/clock.h>
#include <machine/cpu.h> /* bootverbose */
#else
@@ -186,7 +186,7 @@
#endif /* KERNEL */
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
#include <sys/devconf.h>
#include <pci/pcivar.h>
#include <pci/pcireg.h>
@@ -206,11 +206,11 @@ extern PRINT_ADDR();
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
#include <machine/clock.h>
#endif /* __NetBSD__ */
-#if defined(__NetBSD__) && defined(__alpha__)
+#if (defined(__NetBSD__) || defined(__OpenBSD__)) && defined(__alpha__)
/* XXX XXX NEED REAL DMA MAPPING SUPPORT XXX XXX */
#define vtophys(va) __alpha_bus_XXX_dmamap(np->sc_bc, (void *)(va))
#endif
@@ -277,7 +277,7 @@ extern PRINT_ADDR();
**==========================================================
*/
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#ifdef NCR_IOMAPPED
@@ -994,7 +994,7 @@ struct ccb {
*/
struct ncb {
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
struct device sc_dev;
void *sc_ih;
bus_chipset_tag_t sc_bc;
@@ -1029,14 +1029,14 @@ struct ncb {
** virtual and physical addresses
** of the 53c810 chip.
*/
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
vm_offset_t vaddr;
vm_offset_t paddr;
#else
bus_mem_addr_t paddr;
#endif
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
/*
** pointer to the chip's registers.
*/
@@ -1158,7 +1158,7 @@ struct ncb {
*/
u_char disc;
-#if defined(NCR_IOMAPPED) && !defined(__NetBSD__)
+#if defined(NCR_IOMAPPED) && !(defined(__NetBSD__) || defined(__OpenBSD__))
/*
** address of the ncr control registers in io space
*/
@@ -1272,7 +1272,7 @@ static void ncr_free_ccb (ncb_p np, ccb_p cp, int flags);
static void ncr_getclock (ncb_p np);
static ccb_p ncr_get_ccb (ncb_p np, u_long flags, u_long t,u_long l);
static void ncr_init (ncb_p np, char * msg, u_long code);
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
static int ncr_intr (void *);
#else /* !__NetBSD__ */
static int ncr_intr (ncb_p np);
@@ -1284,7 +1284,7 @@ static void ncr_int_sto (ncb_p np);
#ifndef NEW_SCSICONF
static u_long ncr_lookup (char* id);
#endif /* NEW_SCSICONF */
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
static void ncr_min_phys (struct buf *bp);
#else
static void ncr_minphys (struct buf *bp);
@@ -1308,7 +1308,7 @@ static void ncr_timeout (ncb_p np);
static void ncr_usercmd (ncb_p np);
static void ncr_wakeup (ncb_p np, u_long code);
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
static int ncr_probe (struct device *, void *, void *);
static void ncr_attach (struct device *, struct device *, void *);
#else /* !__NetBSD */
@@ -1341,7 +1341,7 @@ u_long ncr_version = NCR_VERSION * 11
#ifdef KERNEL
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
u_long nncr=MAX_UNITS;
ncb_p ncrp [MAX_UNITS];
#endif /* !__NetBSD__ */
@@ -1366,7 +1366,7 @@ int ncr_cache; /* to be aligned _NOT_ static */
#define NCR_860_ID (0x00061000ul)
#define NCR_875_ID (0x000f1000ul)
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
struct cfattach ncr_ca = {
sizeof(struct ncb), ncr_probe, ncr_attach
@@ -1395,14 +1395,14 @@ DATA_SET (pcidevice_set, ncr_device);
struct scsi_adapter ncr_switch =
{
ncr_start,
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
ncr_min_phys,
#else
ncr_minphys,
#endif
0,
0,
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
ncr_info,
"ncr",
#endif /* !__NetBSD__ */
@@ -1414,12 +1414,12 @@ struct scsi_device ncr_dev =
NULL, /* have a queue, served by this */
NULL, /* have no async handler */
NULL, /* Use default 'done' routine */
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
"ncr",
#endif /* !__NetBSD__ */
};
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#define ncr_name(np) (np->sc_dev.dv_xname)
@@ -3081,7 +3081,7 @@ static void ncr_script_copy_and_bind (struct script *script, ncb_p np)
ncrcmd *src, *dst, *start, *end;
int relocs;
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
np->script = (struct script*) vm_page_alloc_contig
(round_page(sizeof (struct script)), 0x100000, 0xffffffff, PAGE_SIZE);
#else /* !__NetBSD___ */
@@ -3237,7 +3237,7 @@ static void ncr_script_copy_and_bind (struct script *script, ncb_p np)
**----------------------------------------------------------
*/
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
void ncr_min_phys (struct buf *bp)
{
if ((unsigned long)bp->b_bcount > MAX_SIZE) bp->b_bcount = MAX_SIZE;
@@ -3258,7 +3258,7 @@ void ncr_minphys (struct buf *bp)
**----------------------------------------------------------
*/
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
U_INT32 ncr_info (int unit)
{
return (1); /* may be changed later */
@@ -3272,7 +3272,7 @@ U_INT32 ncr_info (int unit)
**----------------------------------------------------------
*/
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
int
ncr_probe(parent, match, aux)
@@ -3340,7 +3340,7 @@ static char* ncr_probe (pcici_t tag, pcidi_t type)
#define MIN_ASYNC_PD 40
#define MIN_SYNC_PD 20
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
int ncr_print __P((void *, char *));
@@ -3489,7 +3489,7 @@ static void ncr_attach (pcici_t config_id, int unit)
** Do chip dependent initialization.
*/
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
switch (pa->pa_id) {
#else /* !__NetBSD__ */
switch (pci_conf_read (config_id, PCI_ID_REG)) {
@@ -3518,7 +3518,7 @@ static void ncr_attach (pcici_t config_id, int unit)
np->jump_tcb.l_cmd = SCR_JUMP;
np->jump_tcb.l_paddr = NCB_SCRIPT_PHYS (np, abort);
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
/*
** Make the controller's registers available.
** Now the INB INW INL OUTB OUTW OUTL macros
@@ -3556,7 +3556,7 @@ static void ncr_attach (pcici_t config_id, int unit)
*/
{
int reg;
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
u_long config_id = pa->pa_tag;
#endif /* __NetBSD__ */
for (reg=0; reg<256; reg+=4) {
@@ -3585,7 +3585,7 @@ static void ncr_attach (pcici_t config_id, int unit)
return;
};
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
/*
** Install the interrupt handler.
*/
@@ -3616,7 +3616,7 @@ static void ncr_attach (pcici_t config_id, int unit)
** look for the SCSI devices on the bus ..
*/
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
np->sc_link.adapter_softc = np;
np->sc_link.adapter_target = np->myaddr;
np->sc_link.openings = 1;
@@ -3629,7 +3629,7 @@ static void ncr_attach (pcici_t config_id, int unit)
np->sc_link.device = &ncr_dev;
np->sc_link.flags = 0;
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
config_found(self, &np->sc_link, ncr_print);
#else /* !__NetBSD__ */
#if (__FreeBSD__ >= 2)
@@ -3686,7 +3686,7 @@ static void ncr_attach (pcici_t config_id, int unit)
**==========================================================
*/
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
int
ncr_intr(arg)
void *arg;
@@ -3733,7 +3733,7 @@ ncr_intr(np)
static INT32 ncr_start (struct scsi_xfer * xp)
{
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
ncb_p np = xp->sc_link->adapter_softc;
#else /*__NetBSD__*/
ncb_p np = ncrp[xp->sc_link->adapter_unit];
@@ -4191,7 +4191,7 @@ static INT32 ncr_start (struct scsi_xfer * xp)
** Command is successfully queued.
*/
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
if (!(flags & SCSI_POLL)) {
#else /* !__NetBSD__ */
if (!(flags & SCSI_NOMASK)) {
@@ -4244,7 +4244,7 @@ static INT32 ncr_start (struct scsi_xfer * xp)
printf ("%s: result: %x %x.\n",
ncr_name (np), cp->host_status, cp->scsi_status);
};
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
if (!(flags & SCSI_POLL))
#else /* !__NetBSD__ */
if (!(flags & SCSI_NOMASK))
@@ -4343,7 +4343,7 @@ void ncr_complete (ncb_p np, ccb_p cp)
/*
** Check the status.
*/
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
if (xp->error != XS_NOERROR) {
/*
@@ -4410,7 +4410,7 @@ void ncr_complete (ncb_p np, ccb_p cp)
tp->bytes += xp->datalen;
tp->transfers ++;
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
} else if (xp->flags & SCSI_ERR_OK) {
/*
@@ -4606,7 +4606,7 @@ void ncr_init (ncb_p np, char * msg, u_long code)
** Init chip.
*/
-#ifndef __NetBSD__
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
if (pci_max_burst_len < 4) {
static u_char tbl[4]={0,0,0x40,0x80};
burstlen = tbl[pci_max_burst_len];
@@ -6549,7 +6549,7 @@ static void ncr_opennings (ncb_p np, lcb_p lp, struct scsi_xfer * xp)
if (!diff) return;
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
if (diff > xp->sc_link->openings)
diff = xp->sc_link->openings;
@@ -6573,7 +6573,7 @@ static void ncr_opennings (ncb_p np, lcb_p lp, struct scsi_xfer * xp)
if (lp->reqlink > lp->actlink) {
u_char diff = lp->reqlink - lp->actlink;
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
xp->sc_link->openings += diff;
#else /* !__NetBSD__ */
xp->sc_link->opennings += diff;