diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mvme88k/dev/cl.c | 82 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/clock.c | 31 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/dart.c | 34 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/if_ie.c | 13 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/memc.c | 21 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/sclock.c | 18 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/syscon.c | 54 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vme.c | 41 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vsdma.c | 10 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vx.c | 65 |
10 files changed, 184 insertions, 185 deletions
diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c index 8a07a627861..ab0119b0643 100644 --- a/sys/arch/mvme88k/dev/cl.c +++ b/sys/arch/mvme88k/dev/cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl.c,v 1.8 2001/02/12 08:16:22 smurph Exp $ */ +/* $OpenBSD: cl.c,v 1.9 2001/03/07 23:45:50 miod Exp $ */ /* * Copyright (c) 1995 Dale Rahn. All rights reserved. @@ -158,9 +158,9 @@ void cl_unblock __P((struct tty *tp)); int clccparam __P((struct clsoftc *sc, struct termios *par, int channel)); int clparam __P((struct tty *tp, struct termios *t)); -int cl_mintr __P((struct clsoftc *sc)); -int cl_txintr __P((struct clsoftc *sc)); -int cl_rxintr __P((struct clsoftc *sc)); +int cl_mintr __P((void *)); +int cl_txintr __P((void *)); +int cl_rxintr __P((void *)); void cl_overflow __P((struct clsoftc *sc, int channel, long *ptime, u_char *msg)); void cl_parity __P((struct clsoftc *sc, int channel)); void cl_frame __P((struct clsoftc *sc, int channel)); @@ -178,10 +178,12 @@ int clwrite __P((dev_t dev, struct uio *uio, int flag)); int clioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)); int clstop __P((struct tty *tp, int flag)); -static void cl_initchannel __P((struct clsoftc *sc, int channel)); -static void clputc __P((struct clsoftc *sc, int unit, u_char c)); -static u_char clgetc __P((struct clsoftc *sc, int *channel)); -static void cloutput __P( (struct tty *tp)); +void cl_initchannel __P((struct clsoftc *sc, int channel)); +void clputc __P((struct clsoftc *sc, int unit, u_char c)); +u_char clgetc __P((struct clsoftc *sc, int *channel)); +#if 0 +void cloutput __P( (struct tty *tp)); +#endif struct cfattach cl_ca = { sizeof(struct clsoftc), clprobe, clattach @@ -201,7 +203,9 @@ int dopoll = 1; extern int cputyp; -struct tty * cltty(dev) +struct tty *cltty __P((dev_t dev)); + +struct tty *cltty(dev) dev_t dev; { int unit, channel; @@ -298,8 +302,9 @@ clattach(parent, self, aux) sc->sc_cl[3].tx[0] = (void *)(((int)sc->sc_cl[2].tx[1]) + CL_BUFSIZE); sc->sc_cl[3].tx[1] = (void *)(((int)sc->sc_cl[3].tx[0]) + CL_BUFSIZE); for (i = 0; i < CLCD_PORTS_PER_CHIP; i++) { - int j; #if 0 + int j; + for (j = 0; j < 2 ; j++) { sc->sc_cl[i].rxp[j] = (void *)kvtop(sc->sc_cl[i].rx[j]); printf("cl[%d].rxbuf[%d] %x p %x\n", @@ -322,23 +327,23 @@ clattach(parent, self, aux) /* enable interrupts */ sc->sc_ih_e.ih_fn = cl_rxintr; sc->sc_ih_e.ih_arg = sc; - sc->sc_ih_e.ih_ipl = ca->ca_ipl; sc->sc_ih_e.ih_wantframe = 0; + sc->sc_ih_e.ih_ipl = ca->ca_ipl; sc->sc_ih_m.ih_fn = cl_mintr; sc->sc_ih_m.ih_arg = sc; + sc->sc_ih_e.ih_wantframe = 0; sc->sc_ih_m.ih_ipl = ca->ca_ipl; - sc->sc_ih_m.ih_wantframe = 0; sc->sc_ih_t.ih_fn = cl_txintr; sc->sc_ih_t.ih_arg = sc; + sc->sc_ih_e.ih_wantframe = 0; sc->sc_ih_t.ih_ipl = ca->ca_ipl; - sc->sc_ih_t.ih_wantframe = 0; sc->sc_ih_r.ih_fn = cl_rxintr; sc->sc_ih_r.ih_arg = sc; + sc->sc_ih_e.ih_wantframe = 0; sc->sc_ih_r.ih_ipl = ca->ca_ipl; - sc->sc_ih_r.ih_wantframe = 0; dopoll = 0; intr_establish(PCC2_VECT + SRXEIRQ, &sc->sc_ih_e); intr_establish(PCC2_VECT + SMOIRQ, &sc->sc_ih_m); @@ -357,7 +362,7 @@ clattach(parent, self, aux) evcnt_attach(&sc->sc_dev, "intr", &sc->sc_mxintrcnt); printf("\n"); } -static void +void cl_initchannel(sc, channel) struct clsoftc *sc; int channel; @@ -667,7 +672,9 @@ int clparam(tp, t) return 0; } -void cloutput(tp) +#if 0 +void +cloutput(tp) struct tty *tp; { int cc, s, unit, cnt; @@ -704,6 +711,7 @@ void cloutput(tp) } splx(s); } +#endif int clclose (dev, flag, mode, p) dev_t dev; @@ -976,7 +984,10 @@ int clcngetc(dev) dev_t dev; { - u_char val, reoir, licr, isrl, data, status, fifo_cnt; + u_char val, reoir, licr, isrl, data, fifo_cnt; +#if 0 + u_char status; +#endif int got_char = 0; u_char ier_old = 0xff; volatile struct clreg *cl_reg = cl_cons.cl_vaddr; @@ -1043,6 +1054,8 @@ clcnputc(dev, c) clputc(0, 0, c); return 0; } + +void clcnpollc(dev, on) dev_t dev; int on; @@ -1054,7 +1067,7 @@ clcnpollc(dev, on) } return; } -static void +void clputc(sc, unit, c) struct clsoftc *sc; int unit; @@ -1156,7 +1169,8 @@ cl_chkinput() } } #endif -static u_char + +u_char clgetc(sc, channel) struct clsoftc *sc; int *channel; @@ -1383,9 +1397,12 @@ clstart(tp) struct tty *tp; { dev_t dev; - u_char cbuf; struct clsoftc *sc; - int channel, unit, s, cnt; + int channel, unit, s; +#if 0 + int cnt; + u_char cbuf; +#endif dev = tp->t_dev; channel = CL_CHANNEL(dev); @@ -1433,12 +1450,14 @@ clstart(tp) } int -cl_mintr(sc) - struct clsoftc *sc; +cl_mintr(arg) + void *arg; { + struct clsoftc *sc = arg; + u_char mir, misr, msvr; int channel; - struct tty *tp; + if(((mir = sc->cl_reg->cl_mir) & 0x40) == 0x0) { /* only if intr is not shared? */ log(LOG_WARNING, "cl_mintr extra intr\n"); @@ -1479,10 +1498,12 @@ cl_mintr(sc) } int -cl_txintr(sc) -struct clsoftc *sc; +cl_txintr(arg) + void *arg; { - static empty = 0; + struct clsoftc *sc = arg; + + static int empty = 0; u_char tir, cmr, teoir; u_char max; int channel; @@ -1601,11 +1622,12 @@ struct clsoftc *sc; } int -cl_rxintr(sc) - struct clsoftc *sc; +cl_rxintr(arg) + void *arg; { + struct clsoftc *sc = arg; + u_char rir, channel, cmr, risrl; - u_char c; u_char fifocnt; struct tty *tp; int i; diff --git a/sys/arch/mvme88k/dev/clock.c b/sys/arch/mvme88k/dev/clock.c index b113c1583a5..e5673a1cce9 100644 --- a/sys/arch/mvme88k/dev/clock.c +++ b/sys/arch/mvme88k/dev/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.8 2001/02/12 08:16:22 smurph Exp $ */ +/* $OpenBSD: clock.c,v 1.9 2001/03/07 23:45:50 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1995 Theo de Raadt @@ -84,6 +84,7 @@ #include <sys/simplelock.h> #include <sys/kernel.h> #include <sys/device.h> +#include <sys/systm.h> #ifdef GPROF #include <sys/gmon.h> #endif @@ -97,10 +98,16 @@ #include <machine/mmu.h> /* DMA_CACHE_SYNC, etc... */ #include "pcctwo.h" #if NPCCTWO > 0 +#include <mvme88k/dev/pcctwofunc.h> #include <mvme88k/dev/pcctworeg.h> +#include "bugtty.h" +#if NBUGTTY > 0 +#include <mvme88k/dev/bugttyfunc.h> +#endif #endif #include "syscon.h" #if NSYSCON > 0 +#include <mvme88k/dev/sysconfunc.h> #include <mvme88k/dev/sysconreg.h> #endif #include <mvme88k/dev/vme.h> @@ -132,9 +139,7 @@ struct cfdriver clock_cd = { }; int sbc_clockintr __P((void *)); -int sbc_statintr __P((void *)); int m188_clockintr __P((void *)); -int m188_statintr __P((void *)); int clockbus; u_char prof_reset; @@ -208,8 +213,6 @@ void *args; void sbc_initclock(void) { - register int statint, minint; - #ifdef CLOCK_DEBUG printf("SBC clock init\n"); #endif @@ -233,16 +236,15 @@ sbc_initclock(void) * clockintr: ack intr and call hardclock */ int -sbc_clockintr(arg) -void *arg; +sbc_clockintr(eframe) + void *eframe; { sys_pcc2->pcc2_t1irq = prof_reset; /* increment intr counter */ intrcnt[M88K_CLK_IRQ]++; - hardclock(arg); -#include "bugtty.h" + hardclock(eframe); #if NBUGTTY > 0 bugtty_chkinput(); #endif /* NBUGTTY */ @@ -255,7 +257,7 @@ delay(us) register int us; { volatile register int c; - unsigned long st; + /* * We use the vme system controller for the delay clock. * Do not go to the real timer until vme device is present. @@ -280,8 +282,8 @@ register int us; int counter = 0; #define IST int -m188_clockintr(arg) -void *arg; +m188_clockintr(eframe) + void *eframe; { volatile int tmp; volatile int *dti_stop = (volatile int *)DART_STOPC; @@ -320,8 +322,7 @@ void *arg; *((volatile int *) DART_CTLR) = counter % 256; /* set counter LSB */ *((volatile int *) DART_IVR) = SYSCV_TIMER1; /* set interrupt vec */ #endif - hardclock(arg); -#include "bugtty.h" + hardclock(eframe); #if NBUGTTY > 0 bugtty_chkinput(); #endif /* NBUGTTY */ @@ -339,8 +340,6 @@ void *arg; void m188_initclock(void) { - register int statint, minint; - #ifdef CLOCK_DEBUG printf("VME188 clock init\n"); #endif diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c index 124c2eeb040..c54e57717af 100644 --- a/sys/arch/mvme88k/dev/dart.c +++ b/sys/arch/mvme88k/dev/dart.c @@ -95,7 +95,7 @@ int dart_cons = -1; int dartcnprobe __P((struct consdev *cp)); int dartcninit __P((struct consdev *cp)); int dartcngetc __P((dev_t dev)); -int dartcnputc __P((dev_t dev, char c)); +void dartcnputc __P((dev_t dev, char c)); int dartopen __P((dev_t dev, int flag, int mode, struct proc *p)); int dartclose __P((dev_t dev, int flag, int mode, struct proc *p)); @@ -103,7 +103,7 @@ int dartread __P((dev_t dev, struct uio *uio, int flag)); int dartwrite __P((dev_t dev, struct uio *uio, int flag)); int dartioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)); int dartstop __P((struct tty *tp, int flag)); -int dartintr __P((struct dartsoftc *sc)); +int dartintr __P((void *)); void dartbreak __P((dev_t dev, int state)); /* @@ -171,7 +171,6 @@ dartmatch(parent, vcf, args) struct device *parent; void *vcf, *args; { - struct cfdata *cf = vcf; struct confargs *ca = args; union dartreg *addr; @@ -194,7 +193,6 @@ void *aux; { struct dartsoftc *sc = (struct dartsoftc *)self; struct confargs *ca = aux; - int i; union dartreg *addr; /* pointer to DUART regs */ union dart_pt_io *ptaddr; /* pointer to port regs */ int port; /* port index */ @@ -287,8 +285,8 @@ void *aux; /* enable interrupts */ sc->sc_ih.ih_fn = dartintr; sc->sc_ih.ih_arg = sc; - sc->sc_ih.ih_ipl = ca->ca_ipl; sc->sc_ih.ih_wantframe = 0; + sc->sc_ih.ih_ipl = ca->ca_ipl; intr_establish(ca->ca_vec, &sc->sc_ih); evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); @@ -304,7 +302,7 @@ struct tty *tp; { dev_t dev; struct dartsoftc *sc; - int s, cnt, cc; + int s, cc; union dart_pt_io *ptaddr; union dartreg *addr; int port; @@ -435,7 +433,7 @@ int how; struct dartsoftc *sc; int s; - if (port = DART_PORT(dev) > 1) { + if ((port = DART_PORT(dev)) > 1) { return (ENODEV); } sc = (struct dartsoftc *) dart_cd.cd_devs[0]; @@ -863,11 +861,10 @@ int flag; int mode; struct proc *p; { - int unit, channel; struct tty *tp; struct dart_info *dart; struct dartsoftc *sc; - int s, port; + int port; if ((port = DART_PORT(dev)) > 1) { printf("dartclose: inavalid device dev(%d, %d)\n", major(dev), minor(dev)); @@ -888,12 +885,12 @@ dev_t dev; struct uio *uio; int flag; { - int unit, port; + int port; struct tty *tp; struct dart_info *dart; struct dartsoftc *sc; - if (port = DART_PORT(dev) > 1) { + if ((port = DART_PORT(dev)) > 1) { return (ENODEV); } sc = (struct dartsoftc *) dart_cd.cd_devs[0]; @@ -916,7 +913,7 @@ int flag; struct dart_info *dart; struct dartsoftc *sc; - if (port = DART_PORT(dev) > 1) { + if ((port = DART_PORT(dev)) > 1) { return (ENODEV); } sc = (struct dartsoftc *)dart_cd.cd_devs[0]; @@ -1026,7 +1023,6 @@ int port; struct tty *tp; struct dart_info *dart; union dartreg *addr; - dev_t dev; dart = &sc->sc_dart[port]; addr = sc->dart_reg; @@ -1069,11 +1065,12 @@ out: } int -dartintr(sc) -struct dartsoftc *sc; +dartintr(arg) + void *arg; { + struct dartsoftc *sc = arg; + unsigned char isr; - unsigned char sr; int port; union dartreg *addr; @@ -1159,14 +1156,16 @@ struct consdev *cp; return 0; } -int +void dartcnputc(dev, c) dev_t dev; char c; { union dartreg *addr; union dart_pt_io *ptaddr; +#if 0 m88k_psr_type psr; +#endif int s; int port; @@ -1220,7 +1219,6 @@ char c; #else set_psr(psr); #endif - return; } int diff --git a/sys/arch/mvme88k/dev/if_ie.c b/sys/arch/mvme88k/dev/if_ie.c index 392cceea122..aa51cdaa6fd 100644 --- a/sys/arch/mvme88k/dev/if_ie.c +++ b/sys/arch/mvme88k/dev/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.8 2001/02/20 19:39:32 mickey Exp $ */ +/* $OpenBSD: if_ie.c,v 1.9 2001/03/07 23:45:51 miod Exp $ */ /*- * Copyright (c) 1998 Steve Murphree, Jr. @@ -334,7 +334,6 @@ iematch(parent, vcf, args) struct device *parent; void *vcf, *args; { - struct cfdata *cf = vcf; struct confargs *ca = args; int ret; @@ -396,7 +395,6 @@ ieattach(parent, self, aux) struct confargs *ca = aux; struct ifnet *ifp = &sc->sc_arpcom.ac_if; extern void myetheraddr(u_char *); /* should be elsewhere */ - register struct bootpath *bp; int pri = ca->ca_ipl; volatile struct ieob *ieo; vm_offset_t pa; @@ -465,9 +463,11 @@ ieattach(parent, self, aux) sc->sc_ih.ih_fn = ieintr; sc->sc_ih.ih_arg = sc; + sc->sc_ih.ih_wantframe = 0; sc->sc_ih.ih_ipl = pri; sc->sc_failih.ih_fn = iefailintr; sc->sc_failih.ih_arg = sc; + sc->sc_failih.ih_wantframe = 0; sc->sc_failih.ih_ipl = pri; pcctwointr_establish(PCC2V_IE, &sc->sc_ih); @@ -1336,6 +1336,7 @@ iereset(sc) splx(s); } +#if 0 /* * This is called if we time out. */ @@ -1346,6 +1347,7 @@ chan_attn_timeout(rock) *(int *)rock = 1; } +#endif /* * Send a command to the controller and wait for it to either complete @@ -1366,7 +1368,9 @@ command_and_wait(sc, cmd, pcmd, mask) volatile struct ie_cmd_common *cc = pcmd; volatile struct ie_sys_ctl_block *scb = sc->scb; volatile int timedout = 0; +#if 0 extern int hz; +#endif scb->ie_command = (u_short)cmd; @@ -1493,8 +1497,6 @@ setup_bufs(sc) struct ie_softc *sc; { caddr_t ptr = sc->buf_area; /* memory pool */ - volatile struct ie_recv_frame_desc *rfd = (void *) ptr; - volatile struct ie_recv_buf_desc *rbd; int n, r; /* @@ -1659,7 +1661,6 @@ ieinit(sc) { volatile struct ie_sys_ctl_block *scb = sc->scb; void *ptr; - int n; ptr = sc->buf_area; diff --git a/sys/arch/mvme88k/dev/memc.c b/sys/arch/mvme88k/dev/memc.c index e2296d236de..40c51e540db 100644 --- a/sys/arch/mvme88k/dev/memc.c +++ b/sys/arch/mvme88k/dev/memc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memc.c,v 1.4 2000/03/26 23:32:00 deraadt Exp $ */ +/* $OpenBSD: memc.c,v 1.5 2001/03/07 23:45:51 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -48,8 +48,10 @@ #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/memcreg.h> @@ -79,11 +81,10 @@ memcmatch(parent, vcf, args) struct device *parent; void *vcf, *args; { - struct cfdata *cf = vcf; struct confargs *ca = args; struct memcreg *memc = (struct memcreg *)ca->ca_vaddr; - if (badvaddr(memc, 4)) + if (badvaddr((vm_offset_t)memc, 4)) return (0); if (memc->memc_chipid==MEMC_CHIPID || memc->memc_chipid==MCECC_CHIPID) return (1); @@ -111,8 +112,8 @@ memcattach(parent, self, args) #if 0 sc->sc_ih.ih_fn = memcintr; sc->sc_ih.ih_arg = 0; - sc->sc_ih.ih_ipl = 7; sc->sc_ih.ih_wantframe = 1; + sc->sc_ih.ih_ipl = 7; mcintr_establish(xxx, &sc->sc_ih); #endif @@ -126,9 +127,11 @@ memcattach(parent, self, args) printf("\n"); } -/*int -memcintr(frame) - struct frame *frame; +#if 0 +int +memcintr(eframe) + void *eframe; { return (0); -}*/ +} +#endif diff --git a/sys/arch/mvme88k/dev/sclock.c b/sys/arch/mvme88k/dev/sclock.c index 1e01b9d087d..e129aa29703 100644 --- a/sys/arch/mvme88k/dev/sclock.c +++ b/sys/arch/mvme88k/dev/sclock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sclock.c,v 1.3 2001/02/12 08:16:23 smurph Exp $ */ +/* $OpenBSD: sclock.c,v 1.4 2001/03/07 23:45:51 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * @@ -82,6 +82,7 @@ #include <sys/simplelock.h> #include <sys/kernel.h> #include <sys/device.h> +#include <sys/systm.h> #ifdef GPROF #include <sys/gmon.h> #endif @@ -93,10 +94,12 @@ #include <machine/cpu.h> #include "pcctwo.h" #if NPCCTWO > 0 +#include <mvme88k/dev/pcctwofunc.h> #include <mvme88k/dev/pcctworeg.h> #endif #include "syscon.h" #if NSYSCON > 0 +#include <mvme88k/dev/sysconfunc.h> #include <mvme88k/dev/sysconreg.h> #endif #include <mvme88k/dev/vme.h> @@ -240,8 +243,8 @@ sbc_initstatclock(void) } int -sbc_statintr(cap) -void *cap; +sbc_statintr(eframe) + void *eframe; { register u_long newint, r, var; @@ -250,7 +253,7 @@ void *cap; /* increment intr counter */ intrcnt[M88K_SCLK_IRQ]++; - statclock((struct clockframe *)cap); + statclock((struct clockframe *)eframe); /* * Compute new randomized interval. The intervals are uniformly @@ -277,18 +280,17 @@ void *cap; #define CIO_UNLOCK simple_unlock(&cio_lock) int -m188_statintr(cap) -void *cap; +m188_statintr(eframe) + void *eframe; { register u_long newint, r, var; - volatile int *ist = (volatile int *)MVME188_IST; CIO_LOCK; /* increment intr counter */ intrcnt[M88K_SCLK_IRQ]++; - statclock((struct clockframe *)cap); + statclock((struct clockframe *)eframe); write_cio(CIO_CSR1, CIO_GCB|CIO_CIP); /* Ack the interrupt */ /* diff --git a/sys/arch/mvme88k/dev/syscon.c b/sys/arch/mvme88k/dev/syscon.c index 8056a228db3..3d56c575605 100644 --- a/sys/arch/mvme88k/dev/syscon.c +++ b/sys/arch/mvme88k/dev/syscon.c @@ -1,5 +1,4 @@ - -/* $OpenBSD: syscon.c,v 1.3 2001/02/01 03:38:15 smurph Exp $ */ +/* $OpenBSD: syscon.c,v 1.4 2001/03/07 23:45:52 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -47,12 +46,15 @@ #include <sys/syslog.h> #include <sys/fcntl.h> #include <sys/device.h> -#include <machine/cpu.h> + #include <machine/autoconf.h> -#include <machine/frame.h> +#include <machine/cpu.h> #include <machine/board.h> +#include <machine/frame.h> + #include <dev/cons.h> +#include <mvme88k/dev/sysconfunc.h> #include <mvme88k/dev/sysconreg.h> struct sysconreg syscon_reg = { @@ -88,10 +90,10 @@ struct sysconsoftc { void sysconattach __P((struct device *, struct device *, void *)); int sysconmatch __P((struct device *, void *, void *)); void setupiackvectors __P((void)); -int sysconabort __P((struct frame *frame)); -int sysconacfail __P((struct frame *frame)); -int sysconsysfail __P((struct frame *frame)); -int sysconm188 __P((struct frame *frame)); +int sysconabort __P((void *)); +int sysconacfail __P((void *)); +int sysconsysfail __P((void *)); +int sysconm188 __P((void *)); struct cfattach syscon_ca = { sizeof(struct sysconsoftc), sysconmatch, sysconattach @@ -103,12 +105,14 @@ struct cfdriver syscon_cd = { struct sysconreg *sys_syscon = NULL; +int syscon_print __P((void *args, const char *bus)); +int syscon_scan __P((struct device *parent, void *child, void *args)); + int sysconmatch(parent, vcf, args) struct device *parent; void *vcf, *args; { - struct cfdata *cf = vcf; struct confargs *ca = args; struct sysconreg *syscon; @@ -141,7 +145,6 @@ void *child, *args; { struct cfdata *cf = child; struct sysconsoftc *sc = (struct sysconsoftc *)parent; - struct confargs *ca = args; struct confargs oca; if (parent->dv_cfdata->cf_driver->cd_indirect) { @@ -176,7 +179,6 @@ void *args; { struct confargs *ca = args; struct sysconsoftc *sc = (struct sysconsoftc *)self; - int i; if (sys_syscon) panic("syscon already attached!"); @@ -197,20 +199,20 @@ void *args; */ sc->sc_abih.ih_fn = sysconabort; sc->sc_abih.ih_arg = 0; - sc->sc_abih.ih_ipl = IPL_ABORT; sc->sc_abih.ih_wantframe = 1; + sc->sc_abih.ih_ipl = IPL_ABORT; sc->sc_acih.ih_fn = sysconacfail; sc->sc_acih.ih_arg = 0; + sc->sc_abih.ih_wantframe = 1; sc->sc_acih.ih_ipl = IPL_ABORT; - sc->sc_acih.ih_wantframe = 1; sc->sc_sfih.ih_fn = sysconsysfail; sc->sc_sfih.ih_arg = 0; + sc->sc_abih.ih_wantframe = 1; sc->sc_sfih.ih_ipl = IPL_ABORT; - sc->sc_sfih.ih_wantframe = 1; sc->sc_m188ih.ih_fn = sysconm188; sc->sc_m188ih.ih_arg = 0; + sc->sc_abih.ih_wantframe = 1; sc->sc_m188ih.ih_ipl = IPL_ABORT; - sc->sc_m188ih.ih_wantframe = 1; intr_establish(SYSCV_ABRT, &sc->sc_abih); intr_establish(SYSCV_ACF, &sc->sc_acih); @@ -229,35 +231,35 @@ struct intrhand *ih; } int -sysconabort(frame) -struct frame *frame; +sysconabort(eframe) + void *eframe; { ISR_RESET_NMI; - nmihand(frame); + nmihand((struct frame *)eframe); return (1); } int -sysconsysfail(frame) -struct frame *frame; +sysconsysfail(eframe) + void *eframe; { ISR_RESET_SYSFAIL; - nmihand(frame); + nmihand((struct frame *)eframe); return (1); } int -sysconacfail(frame) -struct frame *frame; +sysconacfail(eframe) + void *eframe; { ISR_RESET_ACFAIL; - nmihand(frame); + nmihand((struct frame *)eframe); return (1); } int -sysconm188(frame) -struct frame *frame; +sysconm188(eframe) + void *eframe; { printf("MVME188 interrupting?\n"); return (1); diff --git a/sys/arch/mvme88k/dev/vme.c b/sys/arch/mvme88k/dev/vme.c index b3498243929..a62a9386d8a 100644 --- a/sys/arch/mvme88k/dev/vme.c +++ b/sys/arch/mvme88k/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.7 2001/02/01 03:38:15 smurph Exp $ */ +/* $OpenBSD: vme.c,v 1.8 2001/03/07 23:45:52 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1995 Theo de Raadt @@ -61,10 +61,10 @@ int vmematch __P((struct device *, void *, void *)); void vmeattach __P((struct device *, struct device *, void *)); -int vme2chip_init __P((struct vmesoftc *sc)); +void vme2chip_init __P((struct vmesoftc *sc)); u_long vme2chip_map __P((u_long base, int len, int dwidth)); -int vme2abort __P((struct frame *frame)); -int sysconabort __P((struct frame *frame)); +int vme2abort __P((void *)); +int sysconabort __P((void *)); int intr_findvec __P((int start, int end)); static int vmebustype; @@ -86,7 +86,6 @@ vmematch(parent, cf, args) void *cf; void *args; { - struct confargs *ca = args; return (1); } @@ -189,7 +188,7 @@ vmerw(sc, uio, flags, bus) int flags; int bus; { - register vm_offset_t o, v; + register vm_offset_t v; register int c; register struct iovec *iov; void *vme; @@ -247,7 +246,6 @@ vmescan(parent, child, args, bustype) { struct cfdata *cf = child; struct vmesoftc *sc = (struct vmesoftc *)parent; - struct confargs *ca = args; struct confargs oca; if (parent->dv_cfdata->cf_driver->cd_indirect) { @@ -292,7 +290,6 @@ void *args; { struct vmesoftc *sc = (struct vmesoftc *)self; struct confargs *ca = args; - struct vme1reg *vme1; struct vme2reg *vme2; int scon; char sconc; @@ -394,12 +391,12 @@ vmeintr_establish(vec, ih) } #if NPCCTWO > 0 -int +void vme2chip_init(sc) struct vmesoftc *sc; { struct vme2reg *vme2 = (struct vme2reg *)sc->sc_vaddr; - u_long ctl, addr, vasize; + u_long ctl; /* turn off SYSFAIL LED */ vme2->vme2_tctl &= ~VME2_TCTL_SYSFAIL; @@ -428,8 +425,8 @@ vme2chip_init(sc) printf("%s: 4phys 0x%08x-0x%08x to VME 0x%08x-0x%08x\n", sc->sc_dev.dv_xname, vme2->vme2_master4 << 16, vme2->vme2_master4 & 0xffff0000, - vme2->vme2_master4 << 16 + vme2->vme2_master4mod << 16, - vme2->vme2_master4 & 0xffff0000 + vme2->vme2_master4 & 0xffff0000); + (vme2->vme2_master4 << 16) + (vme2->vme2_master4mod << 16), + (vme2->vme2_master4 & 0xffff0000) + (vme2->vme2_master4 & 0xffff0000)); /* * Map the VME irq levels to the cpu levels 1:1. * This is rather inflexible, but much easier. @@ -462,8 +459,8 @@ vme2chip_init(sc) */ sc->sc_abih.ih_fn = vme2abort; sc->sc_abih.ih_arg = 0; - sc->sc_abih.ih_ipl = IPL_NMI; sc->sc_abih.ih_wantframe = 1; + sc->sc_abih.ih_ipl = IPL_NMI; intr_establish(110, &sc->sc_abih); vme2->vme2_irqen |= VME2_IRQ_AB; vme2->vme2_irqen |= VME2_IRQ_ACF; @@ -471,14 +468,14 @@ vme2chip_init(sc) #endif /* NPCCTWO */ #if NSYSCON > 0 -int +void vmesyscon_init(sc) struct vmesoftc *sc; { +#ifdef TODO struct sysconreg *syscon = (struct sysconreg *)sc->sc_vaddr; - u_long ctl, addr, vasize; + u_long ctl; -#ifdef TODO /* turn off SYSFAIL LED */ vme2->vme2_tctl &= ~VME2_TCTL_SYSFAIL; @@ -498,15 +495,13 @@ struct vmesoftc *sc; */ sc->sc_abih.ih_fn = sysconabort; sc->sc_abih.ih_arg = 0; - sc->sc_abih.ih_ipl = IPL_NMI; sc->sc_abih.ih_wantframe = 1; + sc->sc_abih.ih_ipl = IPL_NMI; intr_establish(110, &sc->sc_abih); #endif /* TODO */ } #endif /* NSYSCON */ -#if defined(MVME162) || defined(MVME167) || defined(MVME177) || defined(MVME188) || defined (MVME187) || defined (MVME197) - /* * A32 accesses on the MVME1[6789]x require setting up mappings in * the VME2 chip. @@ -532,9 +527,11 @@ vme2chip_map(base, len, dwidth) #if NPCCTWO > 0 int -vme2abort(frame) - struct frame *frame; +vme2abort(eframe) + void *eframe; { + struct frame *frame = eframe; + struct vmesoftc *sc = (struct vmesoftc *) vme_cd.cd_devs[0]; struct vme2reg *vme2 = (struct vme2reg *)sc->sc_vaddr; int rc = 0; @@ -560,6 +557,4 @@ vme2abort(frame) return (1); } #endif -#endif /* MVME1[678]x */ - diff --git a/sys/arch/mvme88k/dev/vsdma.c b/sys/arch/mvme88k/dev/vsdma.c index 1b7819f780a..fe7a8a331af 100644 --- a/sys/arch/mvme88k/dev/vsdma.c +++ b/sys/arch/mvme88k/dev/vsdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vsdma.c,v 1.3 2001/02/01 03:38:16 smurph Exp $ */ +/* $OpenBSD: vsdma.c,v 1.4 2001/03/07 23:45:52 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -62,8 +62,8 @@ void vsattach __P((struct device *, struct device *, void *)); int vsprint __P((void *auxp, char *)); int vs_initialize __P((struct vs_softc *)); int vs_intr __P((struct vs_softc *)); -int vs_nintr __P((struct vs_softc *)); -int vs_eintr __P((struct vs_softc *)); +int vs_nintr __P((void *)); +int vs_eintr __P((void *)); struct scsi_adapter vs_scsiswitch = { vs_scsicmd, @@ -92,7 +92,6 @@ vsmatch(pdp, vcf, args) struct device *pdp; void *vcf, *args; { - struct cfdata *cf = vcf; struct confargs *ca = args; if (!badvaddr(ca->ca_vaddr, 1)) { return (1); @@ -110,7 +109,6 @@ void *auxp; struct confargs *ca = auxp; struct vsreg * rp; int tmp; - extern int cpuspeed; sc->sc_vsreg = rp = ca->ca_vaddr; @@ -126,10 +124,12 @@ void *auxp; sc->sc_ih_n.ih_fn = vs_nintr; sc->sc_ih_n.ih_arg = sc; + sc->sc_ih_n.ih_wantframe = 0; sc->sc_ih_n.ih_ipl = ca->ca_ipl; sc->sc_ih_e.ih_fn = vs_eintr; sc->sc_ih_e.ih_arg = sc; + sc->sc_ih_e.ih_wantframe = 0; sc->sc_ih_e.ih_ipl = ca->ca_ipl; if (vs_initialize(sc)) diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c index b0ed05470b9..fdb2366c631 100644 --- a/sys/arch/mvme88k/dev/vx.c +++ b/sys/arch/mvme88k/dev/vx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vx.c,v 1.4 2001/01/25 03:50:48 todd Exp $ */ +/* $OpenBSD: vx.c,v 1.5 2001/03/07 23:45:52 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -108,7 +108,7 @@ void read_wakeup __P((struct vxsoftc *sc, int port)); int bpp_send __P((struct vxsoftc *sc, void *pkt, int wait_flag)); int create_channels __P((struct vxsoftc *sc)); -void *memcpy2 __P((void *dest, const void *src, size_t size)); +void memcpy2 __P((void *dest, const void *src, size_t size)); void *get_free_envelope __P((struct vxsoftc *sc)); void put_free_envelope __P((struct vxsoftc *sc, void *envp)); void *get_free_packet __P((struct vxsoftc *sc)); @@ -121,7 +121,7 @@ void vx_unblock __P((struct tty *tp)); int vx_ccparam __P((struct vxsoftc *sc, struct termios *par, int port)); int vx_param __P((struct tty *tp, struct termios *t)); -int vx_intr __P((struct vxsoftc *sc)); +int vx_intr __P((void * arg)); int vx_sintr __P((struct vxsoftc *sc)); int vx_poll __P((struct vxsoftc *sc, struct packet *wpktp)); void vx_overflow __P((struct vxsoftc *sc, int port, long *ptime, u_char *msg)); @@ -141,7 +141,6 @@ void vxstart __P((struct tty *tp)); int vxstop __P((struct tty *tp, int flag)); static void vxputc __P((struct vxsoftc *sc, int port, u_char c)); -static u_char vxgetc __P((struct vxsoftc *sc, int *port)); struct cfattach vx_ca = { sizeof(struct vxsoftc), vxmatch, vxattach @@ -179,9 +178,8 @@ void *self; void *aux; { struct vxreg *vx_reg; - struct vxsoftc *sc = self; struct confargs *ca = aux; - int ret; + if (cputyp != CPU_187) return 0; #ifdef OLD_MAPPINGS @@ -211,7 +209,6 @@ void *aux; { struct vxsoftc *sc = (struct vxsoftc *)self; struct confargs *ca = aux; - int i; /* set up dual port memory and registers and init*/ sc->vx_reg = (struct vxreg *)ca->ca_vaddr; @@ -238,8 +235,8 @@ void *aux; /* enable interrupts */ sc->sc_ih_c.ih_fn = vx_intr; sc->sc_ih_c.ih_arg = sc; - sc->sc_ih_c.ih_ipl = ca->ca_ipl; sc->sc_ih_c.ih_wantframe = 0; + sc->sc_ih_c.ih_ipl = ca->ca_ipl; vmeintr_establish(ca->ca_vec, &sc->sc_ih_c); evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); @@ -247,6 +244,7 @@ void *aux; int vxtdefaultrate = TTYDEF_SPEED; +short dtr_ctl(sc, port, on) struct vxsoftc *sc; int port; @@ -268,6 +266,7 @@ dtr_ctl(sc, port, on) return (pkt.error_l); } +short rts_ctl(sc, port, on) struct vxsoftc *sc; int port; @@ -289,6 +288,7 @@ rts_ctl(sc, port, on) return (pkt.error_l); } +short flush_ctl(sc, port, which) struct vxsoftc *sc; int port; @@ -312,7 +312,6 @@ int bits; int how; { int s, unit, port; - int vxbits; struct vxsoftc *sc; struct vx_info *vxt; u_char msvr; @@ -515,7 +514,6 @@ struct termios *t; { int unit, port; struct vxsoftc *sc; - int s; dev_t dev; dev = tp->t_dev; @@ -587,7 +585,6 @@ read_wakeup(sc, port) struct vxsoftc *sc; int port; { - struct rring *rp; struct read_wakeup_packet rwp; volatile struct vx_info *vxt; vxt = &sc->sc_info[port]; @@ -655,7 +652,6 @@ int flag; struct wring *wp; struct write_wakeup_packet wwp; u_short get, put; - int i, cnt, s; unit = VX_UNIT(dev); if (unit >= vx_cd.cd_ndevs || @@ -793,14 +789,6 @@ int flag; return 0; } -static u_char -vxgetc(sc, port) -struct vxsoftc *sc; -int *port; -{ - return 0; -} - static void vxputc(sc, port, c) struct vxsoftc *sc; @@ -879,9 +867,8 @@ struct vxsoftc *sc; struct termios *par; int port; { - struct termio tio; - int imask=0, ints, s; - int cflag, iflag, oflag, lflag; + int imask=0, s; + int cflag /*, iflag, oflag, lflag*/; struct ioctl_a_packet pkt; bzero(&pkt, sizeof(struct packet)); @@ -974,13 +961,11 @@ vxstart(tp) struct tty *tp; { dev_t dev; - u_char cbuf; struct vxsoftc *sc; struct wring *wp; int cc, port, unit, s, cnt, i; u_short get, put; char buffer[WRING_BUF_SIZE]; - char *wrdp; dev = tp->t_dev; port = VX_PORT(dev); @@ -1029,10 +1014,9 @@ int port; */ struct vx_info *vxt; struct rring *rp; - struct read_wakeup_packet rwp; struct tty *tp; u_short get, put; - int frame_count, i, pc = 0, open; + int frame_count, i, open; char c; vxt = &sc->sc_info[port]; @@ -1070,6 +1054,7 @@ int port; return; } +void ccode(sc, port, c) struct vxsoftc *sc; int port; @@ -1084,13 +1069,14 @@ char c; } int -vx_intr(sc) -struct vxsoftc *sc; +vx_intr(arg) + void *arg; { + struct vxsoftc *sc = arg; + struct envelope *envp, *next_envp; - struct envelope env; struct packet *pktp, pkt; - int valid, i; + int valid; short cmd; u_char port; #if defined(MVME187) || defined(MVME197) @@ -1267,7 +1253,7 @@ int port; /* Not needed now that I figured out VME bus */ /* mappings and address modifiers, but I don't */ /* want to change them :) */ -void * +void memcpy2(void *dest, const void *src, size_t size) { int i; @@ -1299,9 +1285,7 @@ struct vxsoftc *sc; { int i; struct envelope *envp; - struct envelope env; struct packet *pktp; - struct packet pkt; envp = (struct envelope *)ENVELOPE_AREA; sc->elist_head = envp; @@ -1392,11 +1376,8 @@ create_channels(sc) struct vxsoftc *sc; { struct envelope *envp; - struct envelope env; - struct packet *pktp; - u_char valid; u_short status; - u_short tas, csr; + u_short tas; struct vxreg *ipc_csr; ipc_csr = sc->vx_reg; @@ -1486,9 +1467,8 @@ void print_dump(sc) struct vxsoftc *sc; { - char *dump_area, *end_dump, *dumpp; + char *dump_area; char dump[209]; - char dump2[209]; bzero(&dump, 209); dump_area = (char *)0xff780030; @@ -1546,7 +1526,6 @@ get_packet(sc, thisenv) struct vxsoftc *sc; struct envelope *thisenv; { - struct envelope env; unsigned long baseaddr; if (thisenv == NULL) return NULL; @@ -1568,10 +1547,8 @@ int bpp_send(struct vxsoftc *sc, void *pkt, int wait_flag) { struct envelope *envp; - struct init_packet init, *initp; - struct packet *wpktp, *pktp, *testpktp; + struct packet *pktp; unsigned long newenv; - int i, s; /* load up packet in dual port mem */ |