From 420a38dd4b0bd9eb10d86c3e5367fcae6482aad1 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Thu, 18 Jan 2007 13:33:36 +0000 Subject: [PATCH] Wrap the EISA-specific parts of the dpt(4) and si(4) back-ends in the newly added DEV_EISA. This is done so that these back-ends can be compiled on platforms not providing in{b,w,l}()/out{b,w,l}() and friends (but may wish to use them together with bus front-ends other than the EISA one). --- sys/conf/options | 2 ++ sys/dev/dpt/dpt.h | 2 ++ sys/dev/dpt/dpt_eisa.c | 2 ++ sys/dev/dpt/dpt_scsi.c | 8 ++++++++ sys/dev/si/si.c | 9 +++++++++ 5 files changed, 23 insertions(+) diff --git a/sys/conf/options b/sys/conf/options index d7a2c030418..0687223e523 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -662,6 +662,8 @@ DEV_MCA opt_mca.h DEV_CARP opt_carp.h DEV_SPLASH opt_splash.h +# EISA support +DEV_EISA opt_eisa.h EISA_SLOTS opt_eisa.h # ed driver diff --git a/sys/dev/dpt/dpt.h b/sys/dev/dpt/dpt.h index 39171950f41..bf87be16eda 100644 --- a/sys/dev/dpt/dpt.h +++ b/sys/dev/dpt/dpt.h @@ -1292,7 +1292,9 @@ int dpt_init(struct dpt_softc *dpt); int dpt_attach(dpt_softc_t * dpt); void dpt_intr(void *arg); +#ifdef DEV_EISA dpt_conf_t * dpt_pio_get_conf(u_int32_t); +#endif #if 0 extern void hex_dump(u_char * data, int length, diff --git a/sys/dev/dpt/dpt_eisa.c b/sys/dev/dpt/dpt_eisa.c index ea84fb0abc9..742f9fac256 100644 --- a/sys/dev/dpt/dpt_eisa.c +++ b/sys/dev/dpt/dpt_eisa.c @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_eisa.h" + #include #include #include diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c index b533a7c77bd..9238292cea8 100644 --- a/sys/dev/dpt/dpt_scsi.c +++ b/sys/dev/dpt/dpt_scsi.c @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #define _DPT_C_ #include "opt_dpt.h" +#include "opt_eisa.h" + #include #include #include @@ -106,7 +108,9 @@ devclass_t dpt_devclass; /* ================= Private Inline Function declarations ===================*/ static __inline int dpt_just_reset(dpt_softc_t * dpt); static __inline int dpt_raid_busy(dpt_softc_t * dpt); +#ifdef DEV_EISA static __inline int dpt_pio_wait (u_int32_t, u_int, u_int, u_int); +#endif static __inline int dpt_wait(dpt_softc_t *dpt, u_int bits, u_int state); static __inline struct dpt_ccb* dptgetccb(struct dpt_softc *dpt); @@ -181,6 +185,7 @@ dpt_raid_busy(dpt_softc_t * dpt) return (0); } +#ifdef DEV_EISA static __inline int dpt_pio_wait (u_int32_t base, u_int reg, u_int bits, u_int state) { @@ -196,6 +201,7 @@ dpt_pio_wait (u_int32_t base, u_int reg, u_int bits, u_int state) } return (-1); } +#endif static __inline int dpt_wait(dpt_softc_t *dpt, u_int bits, u_int state) @@ -386,6 +392,7 @@ dptallocccbs(dpt_softc_t *dpt) return (i); } +#ifdef DEV_EISA dpt_conf_t * dpt_pio_get_conf (u_int32_t base) { @@ -478,6 +485,7 @@ dpt_pio_get_conf (u_int32_t base) } return (NULL); } +#endif /* * Read a configuration page into the supplied dpt_cont_t buffer. diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index 584e851ac60..967a4fcdb10 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/si.c @@ -43,6 +43,7 @@ static const char si_copyright1[] = "@(#) Copyright (C) Specialix International #include "opt_compat.h" #include "opt_debug_si.h" +#include "opt_eisa.h" #include "opt_tty.h" #include @@ -277,8 +278,10 @@ siattach(device_t dev) /* Stop the CPU first so it won't stomp around while we load */ switch (sc->sc_type) { +#ifdef DEV_EISA case SIEISA: outb(sc->sc_iobase + 2, sc->sc_irq << 4); +#endif break; case SIPCI: *(maddr+SIPCIRESET) = 0; @@ -321,12 +324,14 @@ siattach(device_t dev) /* Now start the CPU */ switch (sc->sc_type) { +#ifdef DEV_EISA case SIEISA: /* modify the download code to tell it that it's on an EISA */ *(maddr + 0x42) = 1; outb(sc->sc_iobase + 2, (sc->sc_irq << 4) | 4); (void)inb(sc->sc_iobase + 3); /* reset interrupt */ break; +#endif case SIPCI: /* modify the download code to tell it that it's on a PCI */ *(maddr+0x42) = 1; @@ -1132,11 +1137,13 @@ si_intr(void *arg) ((volatile struct si_reg *)maddr)->int_pending = 0; *(maddr+SIJETINTCL) = 0x0; break; +#ifdef DEV_EISA case SIEISA: maddr = sc->sc_maddr; ((volatile struct si_reg *)maddr)->int_pending = 0; (void)inb(sc->sc_iobase + 3); break; +#endif case SIEMPTY: default: continue; @@ -1622,7 +1629,9 @@ si_modulename(int host_type, int uart_type) { switch (host_type) { /* Z280 based cards */ +#ifdef DEV_EISA case SIEISA: +#endif case SIHOST2: case SIHOST: case SIPCI: