diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-01-24 19:58:34 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-01-24 19:58:34 +0000 |
commit | 0ef244d8476654749f2eaf9441dc06b2fd4d4f7b (patch) | |
tree | 270851bce850e6dddd96484e78fa648cb8bec296 /sys/arch/alpha/tc | |
parent | a77b8c21d70779c5365903c1f86d3c3126549212 (diff) |
Sync with NetBSD 961207
Diffstat (limited to 'sys/arch/alpha/tc')
-rw-r--r-- | sys/arch/alpha/tc/cfb.c | 43 | ||||
-rw-r--r-- | sys/arch/alpha/tc/esp.c | 59 | ||||
-rw-r--r-- | sys/arch/alpha/tc/espvar.h | 6 | ||||
-rw-r--r-- | sys/arch/alpha/tc/ioasic.c | 12 | ||||
-rw-r--r-- | sys/arch/alpha/tc/mcclock_ioasic.c | 15 | ||||
-rw-r--r-- | sys/arch/alpha/tc/scc.c | 84 | ||||
-rw-r--r-- | sys/arch/alpha/tc/sccvar.h | 8 | ||||
-rw-r--r-- | sys/arch/alpha/tc/sfb.c | 43 | ||||
-rw-r--r-- | sys/arch/alpha/tc/tc_3000_500.c | 17 | ||||
-rw-r--r-- | sys/arch/alpha/tc/tc_bus_mem.c | 186 | ||||
-rw-r--r-- | sys/arch/alpha/tc/tc_conf.h | 10 | ||||
-rw-r--r-- | sys/arch/alpha/tc/tcasic.c | 21 | ||||
-rw-r--r-- | sys/arch/alpha/tc/tcds.c | 12 | ||||
-rw-r--r-- | sys/arch/alpha/tc/tcds_dma.c | 20 | ||||
-rw-r--r-- | sys/arch/alpha/tc/tcdsvar.h | 5 |
15 files changed, 373 insertions, 168 deletions
diff --git a/sys/arch/alpha/tc/cfb.c b/sys/arch/alpha/tc/cfb.c index 134259df4f6..7a1176f5bba 100644 --- a/sys/arch/alpha/tc/cfb.c +++ b/sys/arch/alpha/tc/cfb.c @@ -1,5 +1,5 @@ -/* $OpenBSD: cfb.c,v 1.6 1996/12/08 00:20:55 niklas Exp $ */ -/* $NetBSD: cfb.c,v 1.5 1996/10/13 03:00:27 christos Exp $ */ +/* $OpenBSD: cfb.c,v 1.7 1997/01/24 19:58:08 niklas Exp $ */ +/* $NetBSD: cfb.c,v 1.7 1996/12/05 01:39:39 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -55,7 +55,11 @@ #include <machine/autoconf.h> #include <machine/pte.h> +#ifdef __BROKEN_INDIRECT_CONFIG int cfbmatch __P((struct device *, void *, void *)); +#else +int cfbmatch __P((struct device *, struct cfdata *, void *)); +#endif void cfbattach __P((struct device *, struct device *, void *)); int cfbprint __P((void *, const char *)); @@ -79,15 +83,20 @@ struct wscons_emulfuncs cfb_emulfuncs = { rcons_eraserows, }; -int cfbioctl __P((struct device *, u_long, caddr_t, int, struct proc *)); -int cfbmmap __P((struct device *, off_t, int)); +int cfbioctl __P((void *, u_long, caddr_t, int, struct proc *)); +int cfbmmap __P((void *, off_t, int)); int cfbintr __P((void *)); int cfbmatch(parent, match, aux) struct device *parent; - void *match, *aux; +#ifdef __BROKEN_INDIRECT_CONFIG + void *match; +#else + struct cfdata *match; +#endif + void *aux; { struct tc_attach_args *ta = aux; @@ -191,14 +200,18 @@ cfbattach(parent, self, aux) /* initialize the raster */ waa.waa_isconsole = console; wo = &waa.waa_odev_spec; - wo->wo_ef = &cfb_emulfuncs; - wo->wo_efa = &sc->sc_dc->dc_rcons; + + wo->wo_emulfuncs = &cfb_emulfuncs; + wo->wo_emulfuncs_cookie = &sc->sc_dc->dc_rcons; + + wo->wo_ioctl = cfbioctl; + wo->wo_mmap = cfbmmap; + wo->wo_miscfuncs_cookie = sc; + wo->wo_nrows = sc->sc_dc->dc_rcons.rc_maxrow; wo->wo_ncols = sc->sc_dc->dc_rcons.rc_maxcol; wo->wo_crow = 0; wo->wo_ccol = 0; - wo->wo_ioctl = cfbioctl; - wo->wo_mmap = cfbmmap; config_found(self, &waa, cfbprint); } @@ -215,14 +228,14 @@ cfbprint(aux, pnp) } int -cfbioctl(dev, cmd, data, flag, p) - struct device *dev; +cfbioctl(v, cmd, data, flag, p) + void *v; u_long cmd; caddr_t data; int flag; struct proc *p; { - struct cfb_softc *sc = (struct cfb_softc *)dev; + struct cfb_softc *sc = v; struct cfb_devconfig *dc = sc->sc_dc; switch (cmd) { @@ -282,12 +295,12 @@ cfbioctl(dev, cmd, data, flag, p) } int -cfbmmap(dev, offset, prot) - struct device *dev; +cfbmmap(v, offset, prot) + void *v; off_t offset; int prot; { - struct cfb_softc *sc = (struct cfb_softc *)dev; + struct cfb_softc *sc = v; if (offset > CFB_SIZE) return -1; diff --git a/sys/arch/alpha/tc/esp.c b/sys/arch/alpha/tc/esp.c index 8ef09391a31..e6d7aece4d1 100644 --- a/sys/arch/alpha/tc/esp.c +++ b/sys/arch/alpha/tc/esp.c @@ -1,5 +1,5 @@ -/* $OpenBSD: esp.c,v 1.7 1996/11/23 21:44:59 kstailey Exp $ */ -/* $NetBSD: esp.c,v 1.22 1996/10/15 21:30:19 mycroft Exp $ */ +/* $OpenBSD: esp.c,v 1.8 1997/01/24 19:58:10 niklas Exp $ */ +/* $NetBSD: esp.c,v 1.26 1996/12/05 01:39:40 cgd Exp $ */ #ifdef __sparc__ #define SPARC_DRIVER @@ -108,9 +108,15 @@ int esp_debug = 0; /*ESP_SHOWPHASE|ESP_SHOWMISC|ESP_SHOWTRAC|ESP_SHOWCMDS;*/ -/*static*/ void espattach __P((struct device *, struct device *, void *)); +/*static*/ void espattach __P((struct device *, struct device *, + void *)); /*static*/ int espprint __P((void *, const char *)); +#ifdef __BROKEN_INDIRECT_CONFIG /*static*/ int espmatch __P((struct device *, void *, void *)); +#else +/*static*/ int espmatch __P((struct device *, struct cfdata *, + void *)); +#endif /*static*/ u_int esp_adapter_info __P((struct esp_softc *)); /*static*/ void espreadregs __P((struct esp_softc *)); /*static*/ void esp_select __P((struct esp_softc *, struct esp_ecb *)); @@ -119,7 +125,8 @@ int esp_debug = 0; /*ESP_SHOWPHASE|ESP_SHOWMISC|ESP_SHOWTRAC|ESP_SHOWCMDS;*/ /*static*/ void esp_reset __P((struct esp_softc *)); /*static*/ void esp_init __P((struct esp_softc *, int)); /*static*/ int esp_scsi_cmd __P((struct scsi_xfer *)); -/*static*/ int esp_poll __P((struct esp_softc *, struct scsi_xfer *, int)); +/*static*/ int esp_poll __P((struct esp_softc *, struct scsi_xfer *, + int)); /*static*/ void esp_sched __P((struct esp_softc *)); /*static*/ void esp_done __P((struct esp_softc *, struct esp_ecb *)); /*static*/ void esp_msgin __P((struct esp_softc *)); @@ -172,12 +179,23 @@ espprint(aux, name) } int +#ifdef __BROKEN_INDIRECT_CONFIG espmatch(parent, vcf, aux) +#else +espmatch(parent, cf, aux) +#endif struct device *parent; - void *vcf, *aux; +#ifdef __BROKEN_INDIRECT_CONFIG + void *vcf; +#else + struct cfdata *cf; +#endif + void *aux; { #ifdef SPARC_DRIVER +#ifdef __BROKEN_INDIRECT_CONFIG struct cfdata *cf = vcf; +#endif register struct confargs *ca = aux; register struct romaux *ra = &ca->ca_ra; @@ -243,7 +261,7 @@ espattach(parent, self, aux) sc->sc_cookie = tcdsdev->tcdsda_cookie; sc->sc_dma = tcdsdev->tcdsda_sc; - printf(": address %x", sc->sc_reg); + printf(": address %p", sc->sc_reg); tcds_intr_establish(parent, sc->sc_cookie, TC_IPL_BIO, (int (*)(void *))espintr, sc); #endif @@ -1134,7 +1152,7 @@ esp_msgin(sc) { register int v; - ESP_TRACE(("[esp_msgin(curmsglen:%d)] ", sc->sc_imlen)); + ESP_TRACE(("[esp_msgin(curmsglen:%ld)] ", (long)sc->sc_imlen)); if ((ESP_READ_REG(sc, ESP_FFLAG) & ESPFIFO_FF) == 0) { printf("%s: msgin: no msg byte available\n", @@ -1214,7 +1232,6 @@ gotit: */ switch (sc->sc_state) { struct esp_ecb *ecb; - struct scsi_link *sc_link; struct esp_tinfo *ti; case ESP_CONNECTED: @@ -1225,9 +1242,9 @@ gotit: case MSG_CMDCOMPLETE: ESP_MSGS(("cmdcomplete ")); if (sc->sc_dleft < 0) { - sc_link = ecb->xs->sc_link; - printf("%s: %d extra bytes from %d:%d\n", - sc->sc_dev.dv_xname, -sc->sc_dleft, + struct scsi_link *sc_link = ecb->xs->sc_link; + printf("%s: %ld extra bytes from %d:%d\n", + sc->sc_dev.dv_xname, -(long)sc->sc_dleft, sc_link->target, sc_link->lun); sc->sc_dleft = 0; } @@ -1626,7 +1643,12 @@ espintr(sc) * change is expected. */ if (DMA_ISACTIVE(sc->sc_dma)) { - DMA_INTR(sc->sc_dma); + int r = DMA_INTR(sc->sc_dma); + if (r == -1) { + printf("%s: DMA error; resetting\n", + sc->sc_dev.dv_xname); + esp_init(sc, 1); + } /* If DMA active here, then go back to work... */ if (DMA_ISACTIVE(sc->sc_dma)) return 1; @@ -2011,7 +2033,7 @@ if (sc->sc_flags & ESP_ICCS) printf("[[esp: BUMMER]]"); } break; case DATA_OUT_PHASE: - ESP_PHASE(("DATA_OUT_PHASE [%d] ", sc->sc_dleft)); + ESP_PHASE(("DATA_OUT_PHASE [%ld] ",(long)sc->sc_dleft)); ESPCMD(sc, ESPCMD_FLUSH); size = min(sc->sc_dleft, sc->sc_maxxfer); DMA_SETUP(sc->sc_dma, &sc->sc_dp, &sc->sc_dleft, @@ -2098,6 +2120,13 @@ esp_abort(sc, ecb) */ if (sc->sc_state == ESP_CONNECTED) esp_sched_msgout(SEND_ABORT); + + /* + * Reschedule timeout. First, cancel a queued timeout (if any) + * in case someone decides to call esp_abort() from elsewhere. + */ + untimeout(esp_timeout, ecb); + timeout(esp_timeout, ecb, (ecb->timeout * hz) / 1000); } else { esp_dequeue(sc, ecb); TAILQ_INSERT_HEAD(&sc->ready_list, ecb, chain); @@ -2118,11 +2147,11 @@ esp_timeout(arg) sc_print_addr(sc_link); printf("%s: timed out [ecb %p (flags 0x%x, dleft %x, stat %x)], " - "<state %d, nexus %p, phase(c %x, p %x), resid %x, msg(q %x,o %x) %s>", + "<state %d, nexus %p, phase(c %x, p %x), resid %lx, msg(q %x,o %x) %s>", sc->sc_dev.dv_xname, ecb, ecb->flags, ecb->dleft, ecb->stat, sc->sc_state, sc->sc_nexus, sc->sc_phase, sc->sc_prevphase, - sc->sc_dleft, sc->sc_msgpriq, sc->sc_msgout, + (long)sc->sc_dleft, sc->sc_msgpriq, sc->sc_msgout, DMA_ISACTIVE(sc->sc_dma) ? "DMA active" : ""); #if ESP_DEBUG > 0 printf("TRACE: %s.", ecb->trace); diff --git a/sys/arch/alpha/tc/espvar.h b/sys/arch/alpha/tc/espvar.h index c21eb0d92c9..70c0ddf9879 100644 --- a/sys/arch/alpha/tc/espvar.h +++ b/sys/arch/alpha/tc/espvar.h @@ -1,5 +1,5 @@ -/* $OpenBSD: espvar.h,v 1.5 1996/10/30 22:41:07 niklas Exp $ */ -/* $NetBSD: espvar.h,v 1.10 1996/10/15 21:31:37 mycroft Exp $ */ +/* $OpenBSD: espvar.h,v 1.6 1997/01/24 19:58:12 niklas Exp $ */ +/* $NetBSD: espvar.h,v 1.12 1996/11/24 04:21:30 cgd Exp $ */ #if defined(__sparc__) && !defined(SPARC_DRIVER) #define SPARC_DRIVER @@ -184,7 +184,7 @@ struct esp_softc { nexus_list; struct esp_ecb *sc_nexus; /* current command */ - struct esp_ecb sc_ecb[16]; /* one per target */ + struct esp_ecb sc_ecb[3*8]; /* three per target */ struct esp_tinfo sc_tinfo[8]; /* Data about the current nexus (updated for every cmd switch) */ diff --git a/sys/arch/alpha/tc/ioasic.c b/sys/arch/alpha/tc/ioasic.c index d7a6aae03f2..96e49ffb553 100644 --- a/sys/arch/alpha/tc/ioasic.c +++ b/sys/arch/alpha/tc/ioasic.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ioasic.c,v 1.5 1996/11/23 21:45:00 kstailey Exp $ */ -/* $NetBSD: ioasic.c,v 1.9 1996/10/13 03:00:32 christos Exp $ */ +/* $OpenBSD: ioasic.c,v 1.6 1997/01/24 19:58:13 niklas Exp $ */ +/* $NetBSD: ioasic.c,v 1.10 1996/12/05 01:39:41 cgd Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -52,7 +52,11 @@ struct ioasic_softc { }; /* Definition of the driver for autoconfig. */ +#ifdef __BROKEN_INDIRECT_CONFIG int ioasicmatch __P((struct device *, void *, void *)); +#else +int ioasicmatch __P((struct device *, struct cfdata *, void *)); +#endif void ioasicattach __P((struct device *, struct device *, void *)); int ioasicprint(void *, const char *); @@ -108,7 +112,11 @@ extern int cputype; int ioasicmatch(parent, cfdata, aux) struct device *parent; +#ifdef __BROKEN_INDIRECT_CONFIG void *cfdata; +#else + struct cfdata *cfdata; +#endif void *aux; { struct tc_attach_args *ta = aux; diff --git a/sys/arch/alpha/tc/mcclock_ioasic.c b/sys/arch/alpha/tc/mcclock_ioasic.c index 235fff4e901..2a5582895fb 100644 --- a/sys/arch/alpha/tc/mcclock_ioasic.c +++ b/sys/arch/alpha/tc/mcclock_ioasic.c @@ -1,5 +1,5 @@ -/* $OpenBSD: mcclock_ioasic.c,v 1.3 1996/10/30 22:41:10 niklas Exp $ */ -/* $NetBSD: mcclock_ioasic.c,v 1.2 1996/04/17 22:22:58 cgd Exp $ */ +/* $OpenBSD: mcclock_ioasic.c,v 1.4 1997/01/24 19:58:14 niklas Exp $ */ +/* $NetBSD: mcclock_ioasic.c,v 1.3 1996/12/05 01:39:42 cgd Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -51,7 +51,11 @@ struct mcclock_ioasic_softc { struct mcclock_ioasic_clockdatum *sc_dp; }; +#ifdef __BROKEN_INDIRECT_CONFIG int mcclock_ioasic_match __P((struct device *, void *, void *)); +#else +int mcclock_ioasic_match __P((struct device *, struct cfdata *, void *)); +#endif void mcclock_ioasic_attach __P((struct device *, struct device *, void *)); struct cfattach mcclock_ioasic_ca = { @@ -69,7 +73,12 @@ const struct mcclock_busfns mcclock_ioasic_busfns = { int mcclock_ioasic_match(parent, match, aux) struct device *parent; - void *match, *aux; +#ifdef __BROKEN_INDIRECT_CONFIG + void *match; +#else + struct cfdata *match; +#endif + void *aux; { struct ioasicdev_attach_args *d = aux; diff --git a/sys/arch/alpha/tc/scc.c b/sys/arch/alpha/tc/scc.c index bfa713ad8d0..c3058f6911a 100644 --- a/sys/arch/alpha/tc/scc.c +++ b/sys/arch/alpha/tc/scc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: scc.c,v 1.6 1996/10/30 22:41:11 niklas Exp $ */ -/* $NetBSD: scc.c,v 1.26 1996/10/16 05:07:57 jonathan Exp $ */ +/* $OpenBSD: scc.c,v 1.7 1997/01/24 19:58:15 niklas Exp $ */ +/* $NetBSD: scc.c,v 1.28 1996/12/05 01:39:43 cgd Exp $ */ /* * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University @@ -108,8 +108,6 @@ #include <alpha/tc/ioasicreg.h> #include <dev/tc/ioasicvar.h> -extern void ttrstrt __P((void *)); - #undef SCCDEV #define SCCDEV 15 /* XXX */ @@ -197,10 +195,13 @@ struct speedtab sccspeedtab[] = { #endif /* Definition of the driver for autoconfig. */ -static int sccmatch __P((struct device * parent, void *cfdata, - void *aux)); -static void sccattach __P((struct device *parent, struct device *self, - void *aux)); +#ifdef __BROKEN_INDIRECT_CONFIG +int sccmatch __P((struct device *, void *, void *)); +#else +int sccmatch __P((struct device *, struct cfdata *, void *)); +#endif +void sccattach __P((struct device *, struct device *, void *)); + struct cfattach scc_ca = { sizeof (struct scc_softc), sccmatch, sccattach, }; @@ -209,31 +210,23 @@ struct cfdriver scc_cd = { NULL, "scc", DV_TTY, }; -int sccopen __P((dev_t, int, int, struct proc *)); -int sccclose __P((dev_t, int, int, struct proc *)); -int sccread __P((dev_t, struct uio *, int)); -int sccwrite __P((dev_t, struct uio *, int)); -struct tty *scctty __P((dev_t)); -int sccioctl __P((dev_t, u_long, caddr_t, int, struct proc *)); -void sccstop __P((struct tty *, int)); -int sccGetc __P((dev_t)); -void sccPutc __P((dev_t, int)); -void sccPollc __P((dev_t, int)); -int sccparam __P((struct tty *, struct termios *)); -void sccstart __P((struct tty *)); -int sccmctl __P((dev_t, int, int)); -static int cold_sccparam __P((struct tty *, struct termios *, - struct scc_softc *sc)); - -#ifdef SCC_DEBUG -static void rr __P((char *, scc_regmap_t *)); -#endif -static void scc_modem_intr __P((dev_t)); -static void sccreset __P((struct scc_softc *)); +cdev_decl(scc); +int cold_sccparam __P((struct tty *, struct termios *, + struct scc_softc *sc)); +int sccGetc __P((dev_t)); +void sccPollc __P((dev_t, int)); +void sccPutc __P((dev_t, int)); int sccintr __P((void *)); +int sccmctl __P((dev_t, int, int)); +int sccparam __P((struct tty *, struct termios *)); +void sccreset __P((struct scc_softc *)); +void sccstart __P((struct tty *)); void scc_alphaintr __P((int)); - +void scc_modem_intr __P((dev_t)); +#ifdef SCC_DEBUG +void scc_rr __P((char *, scc_regmap_t *)); +#endif /* * console variables, for using serial console while still cold and @@ -245,8 +238,8 @@ static struct scc_softc coldcons_softc; static struct consdev scccons = { NULL, NULL, sccGetc, sccPutc, sccPollc, NODEV, 0 }; -void scc_consinit __P((dev_t dev, scc_regmap_t *sccaddr)); -void scc_oconsinit __P((struct scc_softc *, dev_t)); +void scc_consinit __P((dev_t dev, scc_regmap_t *sccaddr)); +void scc_oconsinit __P((struct scc_softc *, dev_t)); /* @@ -300,6 +293,7 @@ scc_consinit(dev, sccaddr) splx(s); } +#ifndef alpha void scc_oconsinit(sc, dev) struct scc_softc *sc; @@ -321,18 +315,29 @@ scc_oconsinit(sc, dev) DELAY(1000); splx(s); } +#endif /* * Test to see if device is present. * Return true if found. */ int +#ifdef __BROKEN_INDIRECT_CONFIG sccmatch(parent, cfdata, aux) +#else +sccmatch(parent, cf, aux) +#endif struct device *parent; +#ifdef __BROKEN_INDIRECT_CONFIG void *cfdata; +#else + struct cfdata *cf; +#endif void *aux; { +#ifdef __BROKEN_INDIRECT_CONFIG struct cfdata *cf = cfdata; +#endif struct ioasicdev_attach_args *d = aux; void *sccaddr; @@ -526,7 +531,7 @@ sccattach(parent, self, aux) /* * Reset the chip. */ -static void +void sccreset(sc) register struct scc_softc *sc; { @@ -805,7 +810,7 @@ sccparam(tp, t) /* * Do what sccparam() (t_param entry point) does, but callable when cold. */ -static int +int cold_sccparam(tp, t, sc) register struct tty *tp; register struct termios *t; @@ -993,7 +998,7 @@ sccintr(xxxsc) if (rr2 == 6) { /* strange, distinguished value */ SCC_READ_REG(regs, SCC_CHANNEL_A, ZSRR_IPEND, rr3); if (rr3 == 0) - return 0; /* XXX */ + return 1; } SCC_WRITE_REG(regs, SCC_CHANNEL_A, SCC_RR0, ZSWR0_CLR_INTR); @@ -1191,7 +1196,7 @@ out: * Stop output on a line. */ /*ARGSUSED*/ -void +int sccstop(tp, flag) register struct tty *tp; int flag; @@ -1209,6 +1214,7 @@ sccstop(tp, flag) tp->t_state |= TS_FLUSH; } splx(s); + return 0; } int @@ -1275,7 +1281,7 @@ sccmctl(dev, bits, how) /* * Check for carrier transition. */ -static void +void scc_modem_intr(dev) dev_t dev; { @@ -1425,8 +1431,8 @@ sccPollc(dev, on) } #ifdef SCC_DEBUG -static void -rr(msg, regs) +void +scc_rr(msg, regs) char *msg; scc_regmap_t *regs; { diff --git a/sys/arch/alpha/tc/sccvar.h b/sys/arch/alpha/tc/sccvar.h index c0c8285fb35..b1fae134466 100644 --- a/sys/arch/alpha/tc/sccvar.h +++ b/sys/arch/alpha/tc/sccvar.h @@ -1,5 +1,5 @@ -/* $OpenBSD: sccvar.h,v 1.3 1996/10/30 22:41:13 niklas Exp $ */ -/* $NetBSD: sccvar.h,v 1.3 1996/07/09 00:55:21 cgd Exp $ */ +/* $OpenBSD: sccvar.h,v 1.4 1997/01/24 19:58:16 niklas Exp $ */ +/* $NetBSD: sccvar.h,v 1.4 1996/11/16 00:40:14 cgd Exp $ */ /* * Copyright (c) 1991,1990,1989,1994,1995 Carnegie Mellon University @@ -96,9 +96,9 @@ typedef struct { } scc_regmap_t; #define scc_get_datum(d, v) \ - do { (v) = ((d) >> 8) & 0xff; } while (0) + do { (v) = ((d) >> 8) & 0xff; alpha_mb(); DELAY(5); } while (0) #define scc_set_datum(d, v) \ - do { (d) = (volatile unsigned int)(v) << 8; alpha_mb(); } while (0) + do { (d) = (volatile unsigned int)(v) << 8; alpha_mb(); DELAY(5); } while (0) /* * Minor device numbers for scc. Weird because B channel comes first and diff --git a/sys/arch/alpha/tc/sfb.c b/sys/arch/alpha/tc/sfb.c index 0dd93e9a981..0bbff844adf 100644 --- a/sys/arch/alpha/tc/sfb.c +++ b/sys/arch/alpha/tc/sfb.c @@ -1,5 +1,5 @@ -/* $OpenBSD: sfb.c,v 1.6 1996/12/08 00:20:56 niklas Exp $ */ -/* $NetBSD: sfb.c,v 1.5 1996/10/13 03:00:35 christos Exp $ */ +/* $OpenBSD: sfb.c,v 1.7 1997/01/24 19:58:17 niklas Exp $ */ +/* $NetBSD: sfb.c,v 1.7 1996/12/05 01:39:44 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -55,7 +55,11 @@ #include <machine/autoconf.h> #include <machine/pte.h> +#ifdef __BROKEN_INDIRECT_CONFIG int sfbmatch __P((struct device *, void *, void *)); +#else +int sfbmatch __P((struct device *, struct cfdata *, void *)); +#endif void sfbattach __P((struct device *, struct device *, void *)); int sfbprint __P((void *, const char *)); @@ -79,8 +83,8 @@ struct wscons_emulfuncs sfb_emulfuncs = { rcons_eraserows, }; -int sfbioctl __P((struct device *, u_long, caddr_t, int, struct proc *)); -int sfbmmap __P((struct device *, off_t, int)); +int sfbioctl __P((void *, u_long, caddr_t, int, struct proc *)); +int sfbmmap __P((void *, off_t, int)); #if 0 void sfb_blank __P((struct sfb_devconfig *)); @@ -90,7 +94,12 @@ void sfb_unblank __P((struct sfb_devconfig *)); int sfbmatch(parent, match, aux) struct device *parent; - void *match, *aux; +#ifdef __BROKEN_INDIRECT_CONFIG + void *match; +#else + struct cfdata *match; +#endif + void *aux; { struct tc_attach_args *ta = aux; @@ -236,14 +245,18 @@ sfbattach(parent, self, aux) waa.waa_isconsole = console; wo = &waa.waa_odev_spec; - wo->wo_ef = &sfb_emulfuncs; - wo->wo_efa = &sc->sc_dc->dc_rcons; + + wo->wo_emulfuncs = &sfb_emulfuncs; + wo->wo_emulfuncs_cookie = &sc->sc_dc->dc_rcons; + + wo->wo_ioctl = sfbioctl; + wo->wo_mmap = sfbmmap; + wo->wo_miscfuncs_cookie = sc; + wo->wo_nrows = sc->sc_dc->dc_rcons.rc_maxrow; wo->wo_ncols = sc->sc_dc->dc_rcons.rc_maxcol; wo->wo_crow = 0; wo->wo_ccol = 0; - wo->wo_ioctl = sfbioctl; - wo->wo_mmap = sfbmmap; config_found(self, &waa, sfbprint); } @@ -260,14 +273,14 @@ sfbprint(aux, pnp) } int -sfbioctl(dev, cmd, data, flag, p) - struct device *dev; +sfbioctl(v, cmd, data, flag, p) + void *v; u_long cmd; caddr_t data; int flag; struct proc *p; { - struct sfb_softc *sc = (struct sfb_softc *)dev; + struct sfb_softc *sc = v; struct sfb_devconfig *dc = sc->sc_dc; switch (cmd) { @@ -327,12 +340,12 @@ sfbioctl(dev, cmd, data, flag, p) } int -sfbmmap(dev, offset, prot) - struct device *dev; +sfbmmap(v, offset, prot) + void *v; off_t offset; int prot; { - struct sfb_softc *sc = (struct sfb_softc *)dev; + struct sfb_softc *sc = v; if (offset > SFB_SIZE) return -1; diff --git a/sys/arch/alpha/tc/tc_3000_500.c b/sys/arch/alpha/tc/tc_3000_500.c index 9e8133619b2..61cfdc95128 100644 --- a/sys/arch/alpha/tc/tc_3000_500.c +++ b/sys/arch/alpha/tc/tc_3000_500.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tc_3000_500.c,v 1.5 1996/10/30 22:41:18 niklas Exp $ */ -/* $NetBSD: tc_3000_500.c,v 1.11 1996/10/13 03:00:38 christos Exp $ */ +/* $OpenBSD: tc_3000_500.c,v 1.6 1997/01/24 19:58:18 niklas Exp $ */ +/* $NetBSD: tc_3000_500.c,v 1.12 1996/11/15 23:59:00 cgd Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -66,13 +66,20 @@ struct tc_slotdesc tc_3000_500_slots[] = { int tc_3000_500_nslots = sizeof(tc_3000_500_slots) / sizeof(tc_3000_500_slots[0]); -struct tc_builtin tc_3000_500_builtins[] = { +struct tc_builtin tc_3000_500_graphics_builtins[] = { { "FLAMG-IO", 7, 0x00000000, C(TC_3000_500_DEV_IOASIC), }, { "PMAGB-BA", 7, 0x02000000, C(TC_3000_500_DEV_CXTURBO), }, { "PMAZ-DS ", 6, 0x00000000, C(TC_3000_500_DEV_TCDS), }, }; -int tc_3000_500_nbuiltins = - sizeof(tc_3000_500_builtins) / sizeof(tc_3000_500_builtins[0]); +int tc_3000_500_graphics_nbuiltins = sizeof(tc_3000_500_graphics_builtins) / + sizeof(tc_3000_500_graphics_builtins[0]); + +struct tc_builtin tc_3000_500_nographics_builtins[] = { + { "FLAMG-IO", 7, 0x00000000, C(TC_3000_500_DEV_IOASIC), }, + { "PMAZ-DS ", 6, 0x00000000, C(TC_3000_500_DEV_TCDS), }, +}; +int tc_3000_500_nographics_nbuiltins = sizeof(tc_3000_500_nographics_builtins) / + sizeof(tc_3000_500_nographics_builtins[0]); u_int32_t tc_3000_500_intrbits[TC_3000_500_NCOOKIES] = { TC_3000_500_IR_OPT0, diff --git a/sys/arch/alpha/tc/tc_bus_mem.c b/sys/arch/alpha/tc/tc_bus_mem.c index 5c44ec56efd..4d901513410 100644 --- a/sys/arch/alpha/tc/tc_bus_mem.c +++ b/sys/arch/alpha/tc/tc_bus_mem.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tc_bus_mem.c,v 1.5 1996/12/08 00:20:58 niklas Exp $ */ -/* $NetBSD: tc_bus_mem.c,v 1.9 1996/10/23 04:12:37 cgd Exp $ */ +/* $OpenBSD: tc_bus_mem.c,v 1.6 1997/01/24 19:58:19 niklas Exp $ */ +/* $NetBSD: tc_bus_mem.c,v 1.13 1996/12/02 22:19:34 cgd Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -55,11 +55,15 @@ int tc_mem_alloc __P((void *, bus_addr_t, bus_addr_t, bus_size_t, bus_space_handle_t *)); void tc_mem_free __P((void *, bus_space_handle_t, bus_size_t)); +/* barrier */ +inline void tc_mem_barrier __P((void *, bus_space_handle_t, + bus_size_t, bus_size_t, int)); + /* read (single) */ -u_int8_t tc_mem_read_1 __P((void *, bus_space_handle_t, bus_size_t)); -u_int16_t tc_mem_read_2 __P((void *, bus_space_handle_t, bus_size_t)); -u_int32_t tc_mem_read_4 __P((void *, bus_space_handle_t, bus_size_t)); -u_int64_t tc_mem_read_8 __P((void *, bus_space_handle_t, bus_size_t)); +inline u_int8_t tc_mem_read_1 __P((void *, bus_space_handle_t, bus_size_t)); +inline u_int16_t tc_mem_read_2 __P((void *, bus_space_handle_t, bus_size_t)); +inline u_int32_t tc_mem_read_4 __P((void *, bus_space_handle_t, bus_size_t)); +inline u_int64_t tc_mem_read_8 __P((void *, bus_space_handle_t, bus_size_t)); /* read multiple */ void tc_mem_read_multi_1 __P((void *, bus_space_handle_t, @@ -82,13 +86,13 @@ void tc_mem_read_region_8 __P((void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t)); /* write (single) */ -void tc_mem_write_1 __P((void *, bus_space_handle_t, bus_size_t, +inline void tc_mem_write_1 __P((void *, bus_space_handle_t, bus_size_t, u_int8_t)); -void tc_mem_write_2 __P((void *, bus_space_handle_t, bus_size_t, +inline void tc_mem_write_2 __P((void *, bus_space_handle_t, bus_size_t, u_int16_t)); -void tc_mem_write_4 __P((void *, bus_space_handle_t, bus_size_t, +inline void tc_mem_write_4 __P((void *, bus_space_handle_t, bus_size_t, u_int32_t)); -void tc_mem_write_8 __P((void *, bus_space_handle_t, bus_size_t, +inline void tc_mem_write_8 __P((void *, bus_space_handle_t, bus_size_t, u_int64_t)); /* write multiple */ @@ -111,10 +115,35 @@ void tc_mem_write_region_4 __P((void *, bus_space_handle_t, void tc_mem_write_region_8 __P((void *, bus_space_handle_t, bus_size_t, const u_int64_t *, bus_size_t)); -/* barrier */ -void tc_mem_barrier __P((void *, bus_space_handle_t, - bus_size_t, bus_size_t, int)); - +/* set multiple */ +void tc_mem_set_multi_1 __P((void *, bus_space_handle_t, + bus_size_t, u_int8_t, bus_size_t)); +void tc_mem_set_multi_2 __P((void *, bus_space_handle_t, + bus_size_t, u_int16_t, bus_size_t)); +void tc_mem_set_multi_4 __P((void *, bus_space_handle_t, + bus_size_t, u_int32_t, bus_size_t)); +void tc_mem_set_multi_8 __P((void *, bus_space_handle_t, + bus_size_t, u_int64_t, bus_size_t)); + +/* set region */ +void tc_mem_set_region_1 __P((void *, bus_space_handle_t, + bus_size_t, u_int8_t, bus_size_t)); +void tc_mem_set_region_2 __P((void *, bus_space_handle_t, + bus_size_t, u_int16_t, bus_size_t)); +void tc_mem_set_region_4 __P((void *, bus_space_handle_t, + bus_size_t, u_int32_t, bus_size_t)); +void tc_mem_set_region_8 __P((void *, bus_space_handle_t, + bus_size_t, u_int64_t, bus_size_t)); + +/* copy */ +void tc_mem_copy_1 __P((void *, bus_space_handle_t, + bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t)); +void tc_mem_copy_2 __P((void *, bus_space_handle_t, + bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t)); +void tc_mem_copy_4 __P((void *, bus_space_handle_t, + bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t)); +void tc_mem_copy_8 __P((void *, bus_space_handle_t, + bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t)); static struct alpha_bus_space tc_mem_space = { /* cookie */ @@ -129,13 +158,16 @@ static struct alpha_bus_space tc_mem_space = { tc_mem_alloc, tc_mem_free, + /* barrier */ + tc_mem_barrier, + /* read (single) */ tc_mem_read_1, tc_mem_read_2, tc_mem_read_4, tc_mem_read_8, - /* read multi */ + /* read multiple */ tc_mem_read_multi_1, tc_mem_read_multi_2, tc_mem_read_multi_4, @@ -153,7 +185,7 @@ static struct alpha_bus_space tc_mem_space = { tc_mem_write_4, tc_mem_write_8, - /* write multi */ + /* write multiple */ tc_mem_write_multi_1, tc_mem_write_multi_2, tc_mem_write_multi_4, @@ -165,17 +197,23 @@ static struct alpha_bus_space tc_mem_space = { tc_mem_write_region_4, tc_mem_write_region_8, - /* set multi */ - /* XXX IMPLEMENT */ + /* set multiple */ + tc_mem_set_multi_1, + tc_mem_set_multi_2, + tc_mem_set_multi_4, + tc_mem_set_multi_8, /* set region */ - /* XXX IMPLEMENT */ + tc_mem_set_region_1, + tc_mem_set_region_2, + tc_mem_set_region_4, + tc_mem_set_region_8, /* copy */ - /* XXX IMPLEMENT */ - - /* barrier */ - tc_mem_barrier, + tc_mem_copy_1, + tc_mem_copy_2, + tc_mem_copy_4, + tc_mem_copy_8, }; bus_space_tag_t @@ -259,7 +297,21 @@ tc_mem_free(v, bsh, size) panic("tc_mem_free unimplemented"); } -u_int8_t +inline void +tc_mem_barrier(v, h, o, l, f) + void *v; + bus_space_handle_t h; + bus_size_t o, l; + int f; +{ + + if ((f & BUS_BARRIER_READ) != 0) + alpha_mb(); + else if ((f & BUS_BARRIER_WRITE) != 0) + alpha_wmb(); +} + +inline u_int8_t tc_mem_read_1(v, memh, off) void *v; bus_space_handle_t memh; @@ -276,7 +328,7 @@ tc_mem_read_1(v, memh, off) return (*p); } -u_int16_t +inline u_int16_t tc_mem_read_2(v, memh, off) void *v; bus_space_handle_t memh; @@ -293,7 +345,7 @@ tc_mem_read_2(v, memh, off) return (*p); } -u_int32_t +inline u_int32_t tc_mem_read_4(v, memh, off) void *v; bus_space_handle_t memh; @@ -311,7 +363,7 @@ tc_mem_read_4(v, memh, off) return (*p); } -u_int64_t +inline u_int64_t tc_mem_read_8(v, memh, off) void *v; bus_space_handle_t memh; @@ -328,7 +380,6 @@ tc_mem_read_8(v, memh, off) return (*p); } - #define tc_mem_read_multi_N(BYTES,TYPE) \ void \ __abs_c(tc_mem_read_multi_,BYTES)(v, h, o, a, c) \ @@ -367,7 +418,7 @@ tc_mem_read_region_N(2,u_int16_t) tc_mem_read_region_N(4,u_int32_t) tc_mem_read_region_N(8,u_int64_t) -void +inline void tc_mem_write_1(v, memh, off, val) void *v; bus_space_handle_t memh; @@ -397,7 +448,7 @@ tc_mem_write_1(v, memh, off, val) alpha_mb(); /* XXX XXX XXX */ } -void +inline void tc_mem_write_2(v, memh, off, val) void *v; bus_space_handle_t memh; @@ -427,7 +478,7 @@ tc_mem_write_2(v, memh, off, val) alpha_mb(); /* XXX XXX XXX */ } -void +inline void tc_mem_write_4(v, memh, off, val) void *v; bus_space_handle_t memh; @@ -445,7 +496,7 @@ tc_mem_write_4(v, memh, off, val) alpha_mb(); /* XXX XXX XXX */ } -void +inline void tc_mem_write_8(v, memh, off, val) void *v; bus_space_handle_t memh; @@ -461,6 +512,7 @@ tc_mem_write_8(v, memh, off, val) *p = val; alpha_mb(); /* XXX XXX XXX */ } + #define tc_mem_write_multi_N(BYTES,TYPE) \ void \ __abs_c(tc_mem_write_multi_,BYTES)(v, h, o, a, c) \ @@ -499,16 +551,64 @@ tc_mem_write_region_N(2,u_int16_t) tc_mem_write_region_N(4,u_int32_t) tc_mem_write_region_N(8,u_int64_t) -void -tc_mem_barrier(v, h, o, l, f) - void *v; - bus_space_handle_t h; - bus_size_t o, l; - int f; -{ +#define tc_mem_set_multi_N(BYTES,TYPE) \ +void \ +__abs_c(tc_mem_set_multi_,BYTES)(v, h, o, val, c) \ + void *v; \ + bus_space_handle_t h; \ + bus_size_t o, c; \ + TYPE val; \ +{ \ + \ + while (c-- > 0) { \ + __abs_c(tc_mem_write_,BYTES)(v, h, o, val); \ + tc_mem_barrier(v, h, o, sizeof val, BUS_BARRIER_WRITE); \ + } \ +} +tc_mem_set_multi_N(1,u_int8_t) +tc_mem_set_multi_N(2,u_int16_t) +tc_mem_set_multi_N(4,u_int32_t) +tc_mem_set_multi_N(8,u_int64_t) - if ((f & BUS_BARRIER_READ) != 0) - alpha_mb(); - else if ((f & BUS_BARRIER_WRITE) != 0) - alpha_wmb(); +#define tc_mem_set_region_N(BYTES,TYPE) \ +void \ +__abs_c(tc_mem_set_region_,BYTES)(v, h, o, val, c) \ + void *v; \ + bus_space_handle_t h; \ + bus_size_t o, c; \ + TYPE val; \ +{ \ + \ + while (c-- > 0) { \ + __abs_c(tc_mem_write_,BYTES)(v, h, o, val); \ + o += sizeof val; \ + } \ +} +tc_mem_set_region_N(1,u_int8_t) +tc_mem_set_region_N(2,u_int16_t) +tc_mem_set_region_N(4,u_int32_t) +tc_mem_set_region_N(8,u_int64_t) + +#define tc_mem_copy_N(BYTES) \ +void \ +__abs_c(tc_mem_copy_,BYTES)(v, h1, o1, h2, o2, c) \ + void *v; \ + bus_space_handle_t h1, h2; \ + bus_size_t o1, o2, c; \ +{ \ + bus_size_t i, o; \ + \ + if ((h1 & TC_SPACE_SPARSE) != 0 && \ + (h2 & TC_SPACE_SPARSE) != 0) { \ + bcopy((void *)(h1 + o1), (void *)(h2 + o2), c * BYTES); \ + return; \ + } \ + \ + for (i = 0, o = 0; i < c; i++, o += BYTES) \ + __abs_c(tc_mem_write_,BYTES)(v, h2, o2 + o, \ + __abs_c(tc_mem_read_,BYTES)(v, h1, o1 + o)); \ } +tc_mem_copy_N(1) +tc_mem_copy_N(2) +tc_mem_copy_N(4) +tc_mem_copy_N(8) diff --git a/sys/arch/alpha/tc/tc_conf.h b/sys/arch/alpha/tc/tc_conf.h index 479cea7eb6b..28f7a11c045 100644 --- a/sys/arch/alpha/tc/tc_conf.h +++ b/sys/arch/alpha/tc/tc_conf.h @@ -1,5 +1,5 @@ -/* $OpenBSD: tc_conf.h,v 1.3 1996/10/30 22:41:22 niklas Exp $ */ -/* $NetBSD: tc_conf.h,v 1.2 1996/07/14 04:06:30 cgd Exp $ */ +/* $OpenBSD: tc_conf.h,v 1.4 1997/01/24 19:58:20 niklas Exp $ */ +/* $NetBSD: tc_conf.h,v 1.3 1996/11/15 23:59:01 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -42,8 +42,10 @@ extern void tc_3000_500_intr_disestablish __P((struct device *, void *)); extern int tc_3000_500_nslots; extern struct tc_slotdesc tc_3000_500_slots[]; -extern int tc_3000_500_nbuiltins; -extern struct tc_builtin tc_3000_500_builtins[]; +extern int tc_3000_500_graphics_nbuiltins; +extern struct tc_builtin tc_3000_500_graphics_builtins[]; +extern int tc_3000_500_nographics_nbuiltins; +extern struct tc_builtin tc_3000_500_nographics_builtins[]; #endif /* DEC_3000_500 */ #ifdef DEC_3000_300 diff --git a/sys/arch/alpha/tc/tcasic.c b/sys/arch/alpha/tc/tcasic.c index a8b31851edf..e917edbcca3 100644 --- a/sys/arch/alpha/tc/tcasic.c +++ b/sys/arch/alpha/tc/tcasic.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tcasic.c,v 1.6 1996/12/08 00:21:00 niklas Exp $ */ -/* $NetBSD: tcasic.c,v 1.12 1996/10/23 04:12:38 cgd Exp $ */ +/* $OpenBSD: tcasic.c,v 1.7 1997/01/24 19:58:21 niklas Exp $ */ +/* $NetBSD: tcasic.c,v 1.14 1996/12/05 01:39:45 cgd Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -39,7 +39,11 @@ #include <alpha/tc/tc_conf.h> /* Definition of the driver for autoconfig. */ +#ifdef __BROKEN_INDIRECT_CONFIG int tcasicmatch(struct device *, void *, void *); +#else +int tcasicmatch(struct device *, struct cfdata *, void *); +#endif void tcasicattach(struct device *, struct device *, void *); struct cfattach tcasic_ca = { @@ -60,7 +64,11 @@ int tcasicfound; int tcasicmatch(parent, cfdata, aux) struct device *parent; +#ifdef __BROKEN_INDIRECT_CONFIG void *cfdata; +#else + struct cfdata *cfdata; +#endif void *aux; { struct confargs *ca = aux; @@ -103,8 +111,13 @@ tcasicattach(parent, self, aux) tba.tba_speed = TC_SPEED_25_MHZ; tba.tba_nslots = tc_3000_500_nslots; tba.tba_slots = tc_3000_500_slots; - tba.tba_nbuiltins = tc_3000_500_nbuiltins; - tba.tba_builtins = tc_3000_500_builtins; + if (hwrpb->rpb_variation & SV_GRAPHICS) { + tba.tba_nbuiltins = tc_3000_500_graphics_nbuiltins; + tba.tba_builtins = tc_3000_500_graphics_builtins; + } else { + tba.tba_nbuiltins = tc_3000_500_nographics_nbuiltins; + tba.tba_builtins = tc_3000_500_nographics_builtins; + } tba.tba_intr_establish = tc_3000_500_intr_establish; tba.tba_intr_disestablish = tc_3000_500_intr_disestablish; break; diff --git a/sys/arch/alpha/tc/tcds.c b/sys/arch/alpha/tc/tcds.c index da676fed240..1ff43839c7c 100644 --- a/sys/arch/alpha/tc/tcds.c +++ b/sys/arch/alpha/tc/tcds.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tcds.c,v 1.6 1996/11/23 21:45:02 kstailey Exp $ */ -/* $NetBSD: tcds.c,v 1.15 1996/10/13 03:00:41 christos Exp $ */ +/* $OpenBSD: tcds.c,v 1.7 1997/01/24 19:58:22 niklas Exp $ */ +/* $NetBSD: tcds.c,v 1.16 1996/12/05 01:39:45 cgd Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -56,7 +56,11 @@ struct tcds_softc { }; /* Definition of the driver for autoconfig. */ +#ifdef __BROKEN_INDIRECT_CONFIG int tcdsmatch __P((struct device *, void *, void *)); +#else +int tcdsmatch __P((struct device *, struct cfdata *, void *)); +#endif void tcdsattach __P((struct device *, struct device *, void *)); int tcdsprint __P((void *, const char *)); @@ -74,7 +78,11 @@ struct cfdriver tcds_cd = { int tcdsmatch(parent, cfdata, aux) struct device *parent; +#ifdef __BROKEN_INDIRECT_CONFIG void *cfdata; +#else + struct cfdata *cfdata; +#endif void *aux; { struct tc_attach_args *ta = aux; diff --git a/sys/arch/alpha/tc/tcds_dma.c b/sys/arch/alpha/tc/tcds_dma.c index b7173fdc931..00e9a22db79 100644 --- a/sys/arch/alpha/tc/tcds_dma.c +++ b/sys/arch/alpha/tc/tcds_dma.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tcds_dma.c,v 1.4 1996/10/30 22:41:28 niklas Exp $ */ -/* $NetBSD: tcds_dma.c,v 1.13 1996/10/13 03:00:43 christos Exp $ */ +/* $OpenBSD: tcds_dma.c,v 1.5 1997/01/24 19:58:23 niklas Exp $ */ +/* $NetBSD: tcds_dma.c,v 1.15 1996/12/04 22:35:08 mycroft Exp $ */ /* * Copyright (c) 1994 Peter Galbavy. All rights reserved. @@ -67,10 +67,7 @@ tcds_dma_isintr(sc) { int x; - x = tcds_scsi_isintr(sc, 0); - - /* Clear the TCDS interrupt bit. */ - (void)tcds_scsi_isintr(sc, 1); + x = tcds_scsi_isintr(sc, 1); /* XXX */ return x; @@ -116,7 +113,6 @@ tcds_dma_intr(sc) if (!sc->sc_iswrite && (resid = (ESP_READ_REG(sc->sc_esp, ESP_FFLAG) & ESPFIFO_FF)) != 0) { - printf("empty FIFO of %d ", resid); ESPCMD(sc->sc_esp, ESPCMD_FLUSH); DELAY(1); } @@ -134,7 +130,7 @@ tcds_dma_intr(sc) trans = sc->sc_dmasize - resid; if (trans < 0) { /* transferred < 0 ? */ - printf("tcds_dma %d: xfer (%d) > req (%d)\n", + printf("tcds_dma %d: xfer (%d) > req (%ld)\n", sc->sc_slot, trans, sc->sc_dmasize); trans = sc->sc_dmasize; } @@ -162,7 +158,7 @@ tcds_dma_intr(sc) if (dud & TCDS_DUD0_VALID11) dudmask |= TCDS_DUD_BYTE11; #endif - ESP_DMA(("dud0 at 0x%lx dudmask 0x%x\n", + ESP_DMA(("dud0 at 0x%p dudmask 0x%x\n", addr, dudmask)); addr = (u_int32_t *)ALPHA_PHYS_TO_K0SEG((vm_offset_t)addr); *addr = (*addr & ~dudmask) | (dud & dudmask); @@ -183,7 +179,7 @@ tcds_dma_intr(sc) if (dud & TCDS_DUD1_VALID11) panic("tcds_dma: dud1 byte 3 valid"); #endif - ESP_DMA(("dud1 at 0x%lx dudmask 0x%x\n", + ESP_DMA(("dud1 at 0x%p dudmask 0x%x\n", addr, dudmask)); addr = (u_int32_t *)ALPHA_PHYS_TO_K0SEG((vm_offset_t)addr); *addr = (*addr & ~dudmask) | (dud & dudmask); @@ -225,7 +221,7 @@ tcds_dma_setup(sc, addr, len, datain, dmasize) sc->sc_dmalen = len; sc->sc_iswrite = datain; - ESP_DMA(("tcds_dma %d: start %d@0x%lx,%d\n", sc->sc_slot, *sc->sc_dmalen, *sc->sc_dmaaddr, sc->sc_iswrite)); + ESP_DMA(("tcds_dma %d: start %ld@%p,%d\n", sc->sc_slot, *sc->sc_dmalen, *sc->sc_dmaaddr, sc->sc_iswrite)); /* * the rules say we cannot transfer more than the limit @@ -235,7 +231,7 @@ tcds_dma_setup(sc, addr, len, datain, dmasize) size = min(*dmasize, DMAMAX((size_t) *sc->sc_dmaaddr)); *dmasize = sc->sc_dmasize = size; - ESP_DMA(("dma_start: dmasize = %d\n", sc->sc_dmasize)); + ESP_DMA(("dma_start: dmasize = %ld\n", sc->sc_dmasize)); /* Load address, set/clear unaligned transfer and read/write bits. */ /* XXX PICK AN ADDRESS TYPE, AND STICK TO IT! */ diff --git a/sys/arch/alpha/tc/tcdsvar.h b/sys/arch/alpha/tc/tcdsvar.h index a877de2dc7f..13d2b9c8378 100644 --- a/sys/arch/alpha/tc/tcdsvar.h +++ b/sys/arch/alpha/tc/tcdsvar.h @@ -1,5 +1,5 @@ -/* $OpenBSD: tcdsvar.h,v 1.4 1996/10/30 22:41:31 niklas Exp $ */ -/* $NetBSD: tcdsvar.h,v 1.4 1996/09/09 18:10:39 cgd Exp $ */ +/* $OpenBSD: tcdsvar.h,v 1.5 1997/01/24 19:58:24 niklas Exp $ */ +/* $NetBSD: tcdsvar.h,v 1.5 1996/11/13 21:13:38 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -89,6 +89,7 @@ void tcds_intr_establish __P((struct device *, void *, tc_intrlevel_t, void tcds_intr_disestablish __P((struct device *, void *)); void tcds_dma_enable __P((struct tcds_slotconfig *, int)); void tcds_scsi_enable __P((struct tcds_slotconfig *, int)); +int tcds_scsi_iserr __P((struct tcds_slotconfig *)); int tcds_scsi_isintr __P((struct tcds_slotconfig *, int)); void tcds_scsi_reset __P((struct tcds_slotconfig *)); int tcds_scsi_iserr __P((struct tcds_slotconfig *)); |