diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2001-03-08 00:03:16 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2001-03-08 00:03:16 +0000 |
commit | aea1fc865c99ac9305a3e480b9515fa515c4c236 (patch) | |
tree | 0476fa27f493434d76aa82df5f5052d7d75489a8 | |
parent | 956a2d3274c29598b59ffab23e3e3ef4b87d7ef7 (diff) |
Some warning hunting.
Define new include files for convenience, for use by drivers who can
attach either to pcctwo or syscon, or need bug console routines.
-rw-r--r-- | sys/arch/mvme88k/dev/bugtty.c | 30 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/bugttyfunc.h | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/busswitch.c | 9 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/dartreg.h | 2 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/if_ve.c | 9 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/memdevs.c | 10 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/nvram.c | 29 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/pcctwo.c | 18 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/pcctwofunc.h | 9 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/sysconfunc.h | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vs.c | 38 |
11 files changed, 94 insertions, 76 deletions
diff --git a/sys/arch/mvme88k/dev/bugtty.c b/sys/arch/mvme88k/dev/bugtty.c index 32edeb79178..e198e426e6c 100644 --- a/sys/arch/mvme88k/dev/bugtty.c +++ b/sys/arch/mvme88k/dev/bugtty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bugtty.c,v 1.5 2001/02/12 08:16:22 smurph Exp $ */ +/* $OpenBSD: bugtty.c,v 1.6 2001/03/08 00:03:12 miod Exp $ */ /* Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. * All rights reserved. @@ -41,8 +41,11 @@ #include <dev/cons.h> #include <machine/autoconf.h> +#include <machine/bugio.h> #include <machine/cpu.h> +#include <mvme88k/dev/bugttyfunc.h> + #include "bugtty.h" int bugttymatch __P((struct device *parent, void *self, void *aux)); @@ -60,7 +63,7 @@ struct cfdriver bugtty_cd = { int bugttycnprobe __P((struct consdev *cp)); int bugttycninit __P((struct consdev *cp)); int bugttycngetc __P((dev_t dev)); -int bugttycnputc __P((dev_t dev, char c)); +void bugttycnputc __P((dev_t dev, char c)); int bugttyopen __P((dev_t dev, int flag, int mode, struct proc *p)); int bugttyclose __P((dev_t dev, int flag, int mode, struct proc *p)); @@ -69,6 +72,10 @@ int bugttywrite __P((dev_t dev, struct uio *uio, int flag)); int bugttyioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)); int bugttystop __P((struct tty *tp, int flag)); +struct tty *bugttytty __P((dev_t dev)); +int bugttymctl __P((dev_t dev, int bits, int how)); +int bugttyparam __P((struct tty *tp, struct termios *tm)); + #define DIALOUT(x) ((x) & 0x80) #define SWFLAGS(dev) (bugttyswflags | (DIALOUT(dev) ? TIOCFLAG_SOFTCAR : 0)) @@ -141,8 +148,6 @@ bugttymctl(dev, bits, how) dev_t dev; int bits, how; { - static int settings = TIOCM_DTR | TIOCM_RTS | - TIOCM_CTS | TIOCM_CD | TIOCM_DSR; int s; /*printf("mctl: dev %x, bits %x, how %x,",dev, bits, how);*/ @@ -256,7 +261,9 @@ struct proc *p; } int -bugttyparam() +bugttyparam(tp, tm) + struct tty *tp; + struct termios *tm; { return (0); } @@ -265,7 +272,7 @@ void bugttyoutput(tp) struct tty *tp; { - int cc, s, unit, cnt ; + int cc, s, cnt ; /* only supports one unit */ @@ -314,8 +321,8 @@ int flag; return ((*linesw[tp->t_line].l_read)(tp, uio, flag)); } -#if 1 /* only to be called at splclk() */ +void bugtty_chkinput() { struct tty *tp; @@ -324,8 +331,8 @@ bugtty_chkinput() if (tp == NULL ) return; - if (rc = buginstat()) { - while (buginstat()) { + if ((rc = buginstat()) != 0) { + while (buginstat() != 0) { u_char c = buginchr() & 0xff; (*linesw[tp->t_line].l_rint)(c, tp); } @@ -334,7 +341,6 @@ bugtty_chkinput() */ } } -#endif int bugttywrite(dev, uio, flag) @@ -510,13 +516,11 @@ dev_t dev; return (buginchr()); } -int +void bugttycnputc(dev, c) dev_t dev; char c; { - int s; - if (c == '\n') bugoutchr('\r'); bugoutchr(c); diff --git a/sys/arch/mvme88k/dev/bugttyfunc.h b/sys/arch/mvme88k/dev/bugttyfunc.h new file mode 100644 index 00000000000..3be39203f7b --- /dev/null +++ b/sys/arch/mvme88k/dev/bugttyfunc.h @@ -0,0 +1,8 @@ +/* $OpenBSD: bugttyfunc.h,v 1.1 2001/03/08 00:03:13 miod Exp $ */ + +#ifndef _MVME88K_BUGTTY_H_ +#define _MVME88K_BUGTTY_H_ + +void bugtty_chkinput __P((void)); + +#endif /* _MVME88K_BUGTTY_H_ */ diff --git a/sys/arch/mvme88k/dev/busswitch.c b/sys/arch/mvme88k/dev/busswitch.c index e6637439613..e62261cd43f 100644 --- a/sys/arch/mvme88k/dev/busswitch.c +++ b/sys/arch/mvme88k/dev/busswitch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: busswitch.c,v 1.2 2001/02/01 03:38:13 smurph Exp $ */ +/* $OpenBSD: busswitch.c,v 1.3 2001/03/08 00:03:13 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. @@ -66,19 +66,21 @@ struct cfdriver busswitch_cd = { NULL, "busswitch", DV_DULL, 0 }; +int busswitch_print __P((void *args, const char *bus)); +int busswitch_scan __P((struct device *parent, void *child, void *args)); + int busswitchmatch(parent, vcf, args) struct device *parent; void *vcf, *args; { - struct cfdata *cf = vcf; struct confargs *ca = args; struct busswitchreg *busswitch; /* Don't match if wrong cpu */ if (cputyp != CPU_197) return (0); busswitch = (struct busswitchreg *)(IIOV(ca->ca_paddr)); - if (badvaddr(busswitch, 4) <= 0){ + if (badvaddr((vm_offset_t)busswitch, 4) <= 0){ printf("==> busswitch: failed address check.\n"); return (0); } @@ -123,7 +125,6 @@ busswitch_scan(parent, child, args) { struct cfdata *cf = child; struct busswitchsoftc *sc = (struct busswitchsoftc *)parent; - struct confargs *ca = args; struct confargs oca; if (parent->dv_cfdata->cf_driver->cd_indirect) { diff --git a/sys/arch/mvme88k/dev/dartreg.h b/sys/arch/mvme88k/dev/dartreg.h index 10d996a172d..a3087093e71 100644 --- a/sys/arch/mvme88k/dev/dartreg.h +++ b/sys/arch/mvme88k/dev/dartreg.h @@ -37,7 +37,7 @@ /* the access to the same command register must be delayed, because the chip has some hardware problems in this case */ -#define DELAY_CR { volatile register i; for ( i=0; i<250; ++i ); } +#define DELAY_CR { volatile register int i; for ( i=0; i<250; ++i ); } /*********************** MC68681 DEFINITIONS ************************/ #define PORTOFFSET 0x10 /* offset for port b address space */ diff --git a/sys/arch/mvme88k/dev/if_ve.c b/sys/arch/mvme88k/dev/if_ve.c index 7ad19ce5073..39f7b2c0cb7 100644 --- a/sys/arch/mvme88k/dev/if_ve.c +++ b/sys/arch/mvme88k/dev/if_ve.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ve.c,v 1.4 2001/02/20 19:39:32 mickey Exp $ */ +/* $OpenBSD: if_ve.c,v 1.5 2001/03/08 00:03:13 miod Exp $ */ /*- * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1982, 1992, 1993 @@ -149,7 +149,6 @@ u_short addr; { int i; u_char rcmd = 0; - u_char rcmd2= 0; struct vereg1 *reg1 = ((struct ve_softc *)sc)->sc_r1; rcmd = addr; @@ -170,7 +169,6 @@ u_char nvram_addr; u_short val = 0, mask = 0x04000; u_int16_t wbit; /* these used by macros DO NOT CHANGE!*/ - int i; struct vereg1 *reg1 = ((struct ve_softc *)sc)->sc_r1; sc->csr = 0x4f; ENABLE_NVRAM; @@ -268,13 +266,9 @@ void *aux; register struct ve_softc *lesc = (struct ve_softc *)self; struct vam7990_softc *sc = &lesc->sc_am7990; struct confargs *ca = aux; - register int a; int pri = ca->ca_ipl; caddr_t addr; - char *cp; - int i, ipl; - addr = ca->ca_vaddr; if (addr == 0) { @@ -337,6 +331,7 @@ void *aux; /* connect the interrupt */ lesc->sc_ih.ih_fn = ve_intr; lesc->sc_ih.ih_arg = sc; + lesc->sc_ih.ih_wantframe = 0; lesc->sc_ih.ih_ipl = pri; vmeintr_establish(ca->ca_vec + 0, &lesc->sc_ih); } diff --git a/sys/arch/mvme88k/dev/memdevs.c b/sys/arch/mvme88k/dev/memdevs.c index bb3163cc130..9eebe15b9ec 100644 --- a/sys/arch/mvme88k/dev/memdevs.c +++ b/sys/arch/mvme88k/dev/memdevs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memdevs.c,v 1.2 1998/12/15 05:52:30 smurph Exp $ */ +/* $OpenBSD: memdevs.c,v 1.3 2001/03/08 00:03:13 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -36,10 +36,12 @@ #include <sys/systm.h> #include <sys/uio.h> #include <sys/malloc.h> - #include <sys/device.h> -#include <machine/cpu.h> + #include <machine/autoconf.h> +#include <machine/cpu.h> + +#include <mvme88k/dev/memdevs.h> /*ARGSUSED*/ int @@ -49,7 +51,7 @@ memdevrw(base, len, uio, flags) struct uio *uio; int flags; { - register vm_offset_t o, v; + register vm_offset_t v; register int c; register struct iovec *iov; int error = 0; diff --git a/sys/arch/mvme88k/dev/nvram.c b/sys/arch/mvme88k/dev/nvram.c index dbcc962c228..97f51e5e57c 100644 --- a/sys/arch/mvme88k/dev/nvram.c +++ b/sys/arch/mvme88k/dev/nvram.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvram.c,v 1.7 2001/01/04 04:01:59 smurph Exp $ */ +/* $OpenBSD: nvram.c,v 1.8 2001/03/08 00:03:14 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -49,6 +49,8 @@ #include <machine/cpu.h> #include <machine/mioctl.h> #include <machine/vmparam.h> + +#include <mvme88k/dev/memdevs.h> #include <mvme88k/dev/nvramreg.h> #include <mvme88k/dev/pcctworeg.h> @@ -71,13 +73,22 @@ struct cfdriver nvram_cd = { NULL, "nvram", DV_DULL, 0 }; +int nvramopen __P((dev_t dev, int flag, int mode)); +int nvramclose __P((dev_t dev, int flag, int mode)); +int nvramioctl __P((dev_t dev, int cmd, caddr_t data, int flag, + struct proc *p)); +int nvramread __P((dev_t dev, struct uio *uio, int flags)); +int nvramwrite __P((dev_t dev, struct uio *uio, int flags)); +int nvrammmap __P((dev_t dev, int off, int prot)); + int nvrammatch(parent, vcf, args) struct device *parent; void *vcf, *args; { +#if 0 int ret; - struct cfdata *cf = vcf; +#endif struct confargs *ca = args; struct bugrtc rtc; ca->ca_vaddr = ca->ca_paddr; /* map 1:1 */ @@ -233,8 +244,11 @@ struct chiptime { int year; }; +void timetochip __P((struct chiptime *c)); + +void timetochip(c) -register struct chiptime *c; + register struct chiptime *c; { register int t, t2, t3, now = time.tv_sec; @@ -417,10 +431,11 @@ int flag, mode; /*ARGSUSED*/ int nvramioctl(dev, cmd, data, flag, p) -dev_t dev; -caddr_t data; -int cmd, flag; -struct proc *p; + dev_t dev; + int cmd; + caddr_t data; + int flag; + struct proc *p; { int unit = minor(dev); struct nvramsoftc *sc = (struct nvramsoftc *) nvram_cd.cd_devs[unit]; diff --git a/sys/arch/mvme88k/dev/pcctwo.c b/sys/arch/mvme88k/dev/pcctwo.c index e91514f62a9..6cd485df2a2 100644 --- a/sys/arch/mvme88k/dev/pcctwo.c +++ b/sys/arch/mvme88k/dev/pcctwo.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pcctwo.c,v 1.9 2001/01/12 07:29:27 smurph Exp $ */ +/* $OpenBSD: pcctwo.c,v 1.10 2001/03/08 00:03:14 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -47,10 +47,13 @@ #include <sys/syslog.h> #include <sys/fcntl.h> #include <sys/device.h> -#include <machine/cpu.h> + #include <machine/autoconf.h> +#include <machine/cpu.h> + #include <dev/cons.h> +#include <mvme88k/dev/pcctwofunc.h> #include <mvme88k/dev/pcctworeg.h> struct pcctwosoftc { @@ -62,9 +65,6 @@ struct pcctwosoftc { void pcctwoattach __P((struct device *, struct device *, void *)); int pcctwomatch __P((struct device *, void *, void *)); -#ifdef MVME187 -void setupiackvectors __P((void)); -#endif /* MVME187 */ struct cfattach pcctwo_ca = { sizeof(struct pcctwosoftc), pcctwomatch, pcctwoattach @@ -76,12 +76,14 @@ struct cfdriver pcctwo_cd = { struct pcctworeg *sys_pcc2 = NULL; +int pcctwo_print __P((void *args, const char *bus)); +int pcctwo_scan __P((struct device *parent, void *child, void *args)); + int pcctwomatch(parent, vcf, args) struct device *parent; void *vcf, *args; { - struct cfdata *cf = vcf; struct confargs *ca = args; struct pcctworeg *pcc2; @@ -98,7 +100,7 @@ pcctwomatch(parent, vcf, args) return (0); } - if (badvaddr(pcc2, 4) <= 0){ + if (badvaddr((vm_offset_t)pcc2, 4) <= 0){ printf("==> pcctwo: failed address check.\n"); return (0); } @@ -130,7 +132,6 @@ pcctwo_scan(parent, child, args) { struct cfdata *cf = child; struct pcctwosoftc *sc = (struct pcctwosoftc *)parent; - struct confargs *ca = args; struct confargs oca; if (parent->dv_cfdata->cf_driver->cd_indirect) { @@ -164,7 +165,6 @@ pcctwoattach(parent, self, args) { struct confargs *ca = args; struct pcctwosoftc *sc = (struct pcctwosoftc *)self; - int i; if (sys_pcc2) panic("pcc2 already attached!"); diff --git a/sys/arch/mvme88k/dev/pcctwofunc.h b/sys/arch/mvme88k/dev/pcctwofunc.h new file mode 100644 index 00000000000..dfb2a52cf2d --- /dev/null +++ b/sys/arch/mvme88k/dev/pcctwofunc.h @@ -0,0 +1,9 @@ +/* $OpenBSD: pcctwofunc.h,v 1.1 2001/03/08 00:03:14 miod Exp $ */ + +#ifndef _MVME88K_PCCTWO_H_ +#define _MVME88K_PCCTWO_H_ + +int pcctwointr_establish __P((int vec, struct intrhand *ih)); + +#endif /* _MVME88K_PCCTWO_H_ */ + diff --git a/sys/arch/mvme88k/dev/sysconfunc.h b/sys/arch/mvme88k/dev/sysconfunc.h new file mode 100644 index 00000000000..0855f495b27 --- /dev/null +++ b/sys/arch/mvme88k/dev/sysconfunc.h @@ -0,0 +1,8 @@ +/* $OpenBSD: sysconfunc.h,v 1.1 2001/03/08 00:03:14 miod Exp $ */ + +#ifndef _MVME88K_SYSCON_H_ +#define _MVME88K_SYSCON_H_ + +int sysconintr_establish __P((int vec, struct intrhand *ih)); + +#endif /* _MVME88K_SYSCON_H_ */ diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c index d63ae1ba75e..13fb08a3b81 100644 --- a/sys/arch/mvme88k/dev/vs.c +++ b/sys/arch/mvme88k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.3 2001/02/01 03:38:16 smurph Exp $ */ +/* $OpenBSD: vs.c,v 1.4 2001/03/08 00:03:15 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. @@ -70,7 +70,7 @@ #endif /* MVME187 */ int vs_checkintr __P((struct vs_softc *, struct scsi_xfer *, int *)); -int vs_chksense __P((struct scsi_xfer *)); +void vs_chksense __P((struct scsi_xfer *)); void vs_reset __P((struct vs_softc *)); void vs_resync __P((struct vs_softc *)); int vs_initialize __P((struct vs_softc *)); @@ -181,17 +181,7 @@ vs_poll(sc, xs) struct vs_softc *sc; struct scsi_xfer *xs; { - M328_CIB *cib = (M328_CIB *)&sc->sc_vsreg->sh_CIB; - M328_CQE *mc = (M328_CQE*)&sc->sc_vsreg->sh_MCE; - M328_CRB *crb = (M328_CRB *)&sc->sc_vsreg->sh_CRB; - M328_IOPB *riopb = (M328_IOPB *)&sc->sc_vsreg->sh_RET_IOPB; - M328_IOPB *miopb = (M328_IOPB *)&sc->sc_vsreg->sh_MCE_IOPB; - M328_MCSB *mcsb = (M328_MCSB *)&sc->sc_vsreg->sh_MCSB; - M328_CQE *cqep; - M328_IOPB *iopb; - int i; int status; - int s; int to; /*s = splbio();*/ @@ -240,7 +230,6 @@ struct scsi_xfer *xs; int stat; { int tgt; - struct scsi_link *slp = xs->sc_link; xs->status = stat; while (xs->status == SCSI_CHECK) { @@ -264,14 +253,12 @@ struct scsi_xfer *xs; { struct scsi_link *slp = xs->sc_link; struct vs_softc *sc = slp->adapter_softc; - int flags, s, i; + int flags; unsigned long buf, len; u_short iopb_len; M328_CQE *mc = (M328_CQE*)&sc->sc_vsreg->sh_MCE; M328_CRB *crb = (M328_CRB *)&sc->sc_vsreg->sh_CRB; - M328_IOPB *riopb = (M328_IOPB *)&sc->sc_vsreg->sh_RET_IOPB; M328_IOPB *miopb = (M328_IOPB *)&sc->sc_vsreg->sh_MCE_IOPB; - M328_MCSB *mcsb = (M328_MCSB *)&sc->sc_vsreg->sh_MCSB; M328_CQE *cqep; M328_IOPB *iopb; M328_CMD *m328_cmd; @@ -409,11 +396,11 @@ struct scsi_xfer *xs; return (SUCCESSFULLY_QUEUED); } -int +void vs_chksense(xs) struct scsi_xfer *xs; { - int flags, s, i; + int s; struct scsi_link *slp = xs->sc_link; struct vs_softc *sc = slp->adapter_softc; struct scsi_sense *ss; @@ -654,20 +641,10 @@ void vs_reset(sc) struct vs_softc *sc; { - struct vsreg * rp; u_int s; - u_char i; - struct iopb_reset* iopr; - struct cqe *cqep; - struct iopb_scsi *iopbs; - struct scsi_sense *ss; - M328_CIB *cib = (M328_CIB *)&sc->sc_vsreg->sh_CIB; M328_CQE *mc = (M328_CQE*)&sc->sc_vsreg->sh_MCE; - M328_CRB *crb = (M328_CRB *)&sc->sc_vsreg->sh_CRB; M328_IOPB *riopb = (M328_IOPB *)&sc->sc_vsreg->sh_RET_IOPB; - M328_MCSB *mcsb = (M328_MCSB *)&sc->sc_vsreg->sh_MCSB; M328_SRCF *reset = (M328_SRCF *)&sc->sc_vsreg->sh_MCE_IOPB; - M328_IOPB *iopb; vs_zero(reset, sizeof(M328_SRCF)); reset->srcf_CMD = IOPB_RESET; @@ -712,10 +689,8 @@ struct vs_softc *sc; struct scsi_xfer *xs; int *status; { - struct vsreg * rp = sc->sc_vsreg; int target = -1; int lun = -1; - M328_CRB *crb = (M328_CRB *)&sc->sc_vsreg->sh_CRB; M328_IOPB *riopb = (M328_IOPB *)&sc->sc_vsreg->sh_RET_IOPB; struct scsi_generic *cmd; u_long buf; @@ -808,7 +783,6 @@ vs_nintr(sc) register struct vs_softc *sc; { M328_CRB *crb = (M328_CRB *)&sc->sc_vsreg->sh_CRB; - M328_IOPB *riopb = (M328_IOPB *)&sc->sc_vsreg->sh_RET_IOPB; M328_CMD *m328_cmd; struct scsi_xfer *xs; int status; @@ -861,9 +835,11 @@ register struct vs_softc *sc; M328_CMD *m328_cmd; struct scsi_xfer *xs; int crsw = crb->cevsb_CRSW; +#ifdef SDEBUG int type = crb->cevsb_TYPE; int length = crb->cevsb_IOPB_LENGTH; int wq = crb->cevsb_WORK_QUEUE; +#endif int ecode = crb->cevsb_ERROR; int status, s; |