summaryrefslogtreecommitdiff
path: root/sys/dev/dec
diff options
context:
space:
mode:
authorragge <ragge@NetBSD.org>1996-04-08 18:32:26 +0000
committerragge <ragge@NetBSD.org>1996-04-08 18:32:26 +0000
commita24af7a7c282a97cd2fdcb59d52b566154f8bbd5 (patch)
treec1de4c6eccfea66eda655c05631771415c50fab9 /sys/dev/dec
parent86c328d230d8b719209787212bd2a0ca9f3bfcee (diff)
Added prototypes to everything. Made all files compile with -Wall.
Diffstat (limited to 'sys/dev/dec')
-rw-r--r--sys/dev/dec/qbus/uba.c71
-rw-r--r--sys/dev/dec/qbus/ubareg.h8
-rw-r--r--sys/dev/dec/qbus/ubavar.h37
3 files changed, 67 insertions, 49 deletions
diff --git a/sys/dev/dec/qbus/uba.c b/sys/dev/dec/qbus/uba.c
index 12ac14b5dad..7444fc60d88 100644
--- a/sys/dev/dec/qbus/uba.c
+++ b/sys/dev/dec/qbus/uba.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uba.c,v 1.21 1996/03/18 16:47:31 ragge Exp $ */
+/* $NetBSD: uba.c,v 1.22 1996/04/08 18:37:34 ragge Exp $ */
/*
* Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -78,7 +78,14 @@ void uba_dw780int __P((int));
void ubaerror __P((int, struct uba_softc *, int *, int *,
struct uba_regs *));
void ubainit __P((struct uba_softc *));
-void ubareset __P((int));
+void ubastray __P((int));
+void unifind __P((struct uba_softc *, caddr_t));
+void ubapurge __P((struct uba_ctlr *));
+void ubainitmaps __P((struct uba_softc *));
+int qbgetpri __P((void));
+int ubamem __P((int, int, int, int));
+void uba_dw780int __P((int));
+
struct cfdriver uba_cd = {
NULL, "uba", DV_DULL, 1
@@ -124,7 +131,7 @@ ubastray(arg)
* and then fills in the tables, with help from a per-driver
* slave initialization routine.
*/
-
+void
unifind(uhp0, pumem)
struct uba_softc *uhp0;
caddr_t pumem;
@@ -136,8 +143,6 @@ unifind(uhp0, pumem)
u_short *reg, *ap, addr;
struct uba_driver *udp;
int i;
- caddr_t ualloc;
- volatile extern int br, cvec;
volatile extern int rbr, rcvec;
#define ubaddr(uhp, off) (u_short *)((int)(uhp)->uh_iopage + ubdevreg(off))
@@ -147,9 +152,9 @@ unifind(uhp0, pumem)
* see if it is really there, and if it is record it and
* then go looking for slaves.
*/
- for (um = ubminit; udp = um->um_driver; um++) {
- if (um->um_ubanum != uhp->uh_dev.dv_unit &&
- um->um_ubanum != '?' || um->um_alive)
+ for (um = ubminit; (udp = um->um_driver); um++) {
+ if ((um->um_ubanum != uhp->uh_dev.dv_unit &&
+ um->um_ubanum != '?') || um->um_alive)
continue;
addr = (u_short)(u_long)um->um_addr;
/*
@@ -170,7 +175,7 @@ unifind(uhp0, pumem)
}
#endif
rcvec = 0x200;
- i = (*udp->ud_probe)(reg, um->um_ctlr, um, uhp);
+ i = (*udp->ud_probe)((caddr_t)reg, um->um_ctlr, um, uhp);
#if DW780
if (uhp->uh_type == DW780 && ubar->uba_sr) {
ubar->uba_sr = ubar->uba_sr;
@@ -201,13 +206,13 @@ unifind(uhp0, pumem)
int t;
if (ui->ui_driver != udp || ui->ui_alive ||
- ui->ui_ctlr != um->um_ctlr && ui->ui_ctlr != '?' ||
- ui->ui_ubanum != uhp->uh_dev.dv_unit &&
- ui->ui_ubanum != '?')
+ (ui->ui_ctlr != um->um_ctlr && ui->ui_ctlr != '?') ||
+ (ui->ui_ubanum != uhp->uh_dev.dv_unit &&
+ ui->ui_ubanum != '?'))
continue;
t = ui->ui_ctlr;
ui->ui_ctlr = um->um_ctlr;
- if ((*udp->ud_slave)(ui, reg) == 0)
+ if ((*udp->ud_slave)(ui, (caddr_t)reg) == 0)
ui->ui_ctlr = t;
else {
ui->ui_alive = 1;
@@ -257,6 +262,7 @@ char ubasr_bits[] = UBASR_BITS;
* to the controller, unless it is zero, indicating that the controller
* does not now have a BDP.
*/
+int
ubaqueue(ui, onq)
register struct uba_device *ui;
int onq;
@@ -272,7 +278,7 @@ ubaqueue(ui, onq)
/*
* Honor exclusive BDP use requests.
*/
- if (ud->ud_xclu && uh->uh_users > 0 || uh->uh_xclu)
+ if ((ud->ud_xclu && uh->uh_users > 0) || uh->uh_xclu)
goto rwait;
if (ud->ud_keepbdp) {
/*
@@ -321,6 +327,7 @@ rwait:
return (0);
}
+void
ubadone(um)
struct uba_ctlr *um;
{
@@ -341,6 +348,7 @@ ubadone(um)
* Return value encodes map register plus page offset,
* bdp number and number of map registers.
*/
+int
ubasetup(uban, bp, flags)
struct buf *bp;
int uban, flags;
@@ -451,6 +459,7 @@ ubasetup(uban, bp, flags)
/*
* Non buffer setup interface... set up a buffer and call ubasetup.
*/
+int
uballoc(uban, addr, bcnt, flags)
caddr_t addr;
int uban, bcnt, flags;
@@ -544,6 +553,7 @@ ubarelse(uban, amr)
;
}
+void
ubapurge(um)
register struct uba_ctlr *um;
{
@@ -571,6 +581,7 @@ ubapurge(um)
}
}
+void
ubainitmaps(uhp)
register struct uba_softc *uhp;
{
@@ -695,13 +706,14 @@ ubainit(uhp)
* delaying as necessary, then call this routine
* before resetting the device.
*/
+int
qbgetpri()
{
+#ifdef notyet
int pri;
extern int cvec;
panic("qbgetpri");
-#if 0
for (pri = 0x17; pri > 0x14; ) {
if (cvec && cvec != 0x200) /* interrupted at pri */
break;
@@ -710,6 +722,8 @@ qbgetpri()
}
(void) spl0();
return (pri);
+#else
+ return 0x17;
#endif
}
#endif
@@ -750,7 +764,7 @@ ubaerror(uban, uh, ipl, uvec, uba)
}
if (++uh->uh_zvcnt > zvcnt_max) {
printf("uba%d: too many zero vectors (%d in <%d sec)\n",
- uban, uh->uh_zvcnt, dt + 1);
+ uban, uh->uh_zvcnt, (int)dt + 1);
printf("\tIPL 0x%x\n\tcnfgr: %b Adapter Code: 0x%x\n",
*ipl, uba->uba_cnfgr&(~0xff), UBACNFGR_BITS,
uba->uba_cnfgr&0xff);
@@ -843,11 +857,6 @@ jdhfgsjdkfhgsdjkfghak
}
#endif
-rmget(){
- showstate(curproc);
- panic("rmget() not implemented. (in uba.c)");
-}
-
/*
* Allocate UNIBUS memory. Allocates and initializes
* sufficient mapping registers for access. On a 780,
@@ -859,6 +868,7 @@ rmget(){
* the last unibus memory would free unusable map registers.
* Doalloc is 1 to allocate, 0 to deallocate.
*/
+int
ubamem(uban, addr, npg, doalloc)
int uban, addr, npg, doalloc;
{
@@ -869,7 +879,8 @@ ubamem(uban, addr, npg, doalloc)
a = (addr >> 9) + 1;
s = spluba();
if (doalloc)
- a = rmget(uh->uh_map, npg, a);
+ panic("uba: rmget");
+/* a = rmget(uh->uh_map, npg, a); */
else
rmfree(uh->uh_map, (long)npg, (long)a);
splx(s);
@@ -925,12 +936,6 @@ unmaptouser(vaddress)
}
#endif
-resuba()
-{
- showstate(curproc);
- panic("resuba");
-}
-
#ifdef DW780
void
uba_dw780int(uba)
@@ -939,7 +944,7 @@ uba_dw780int(uba)
int br, svec, vec, arg;
struct uba_softc *sc = uba_cd.cd_devs[uba];
struct uba_regs *ur = sc->uh_uba;
- void (*func)();
+ void (*func) __P((int));
br = mfpr(PR_IPL);
svec = ur->uba_brrvr[br - 0x14];
@@ -1008,7 +1013,6 @@ uba_attach(parent, self, aux)
struct uba_softc *sc = (struct uba_softc *)self;
vm_offset_t min, max, ubaphys, ubaiophys;
extern struct ivec_dsp idsptch;
- void ubascan();
printf("\n");
/*
@@ -1088,6 +1092,9 @@ uba_attach(parent, self, aux)
ubaiophys = QIOPAGE630;
break;
#endif
+ default:
+ ubaphys = QMEM630;
+ ubaiophys = QIOPAGE630;
};
break;
#endif
@@ -1160,7 +1167,7 @@ uba_attach(parent, self, aux)
/*
* Now start searching for devices.
*/
- unifind(sc, ubaiophys); /* Some devices are not yet converted */
+ unifind(sc, (caddr_t)ubaiophys);/* Some devices are not yet converted */
config_scan(ubascan,self);
#ifdef DW780
@@ -1246,7 +1253,7 @@ void
ubasetvec(dev, vec, func)
struct device *dev;
int vec;
- void (*func)();
+ void (*func) __P((int));
{
struct uba_softc *sc = (void *)dev->dv_parent;
diff --git a/sys/dev/dec/qbus/ubareg.h b/sys/dev/dec/qbus/ubareg.h
index 10671309281..d63093e5613 100644
--- a/sys/dev/dec/qbus/ubareg.h
+++ b/sys/dev/dec/qbus/ubareg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ubareg.h,v 1.6 1996/03/09 23:38:36 ragge Exp $ */
+/* $NetBSD: ubareg.h,v 1.7 1996/04/08 18:37:35 ragge Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -223,7 +223,7 @@ struct uba_regs {
#define UBADPR_BS 0x007f0000 /* buffer state field */
#define UBADPR_BUBA 0x0000ffff /* buffered UNIBUS address */
#define UBA_PURGE780(uba, bdp) \
- ((uba)->uba_dpr[bdp] |= UBADPR_BNE)
+ ((uba)->uba_dpr[(int)bdp] |= UBADPR_BNE)
#else
#define UBA_PURGE780(uba, bdp)
#endif
@@ -234,8 +234,8 @@ struct uba_regs {
#define UBADPR_PURGE 0x00000001 /* purge bdp */
/* the DELAY is for a hardware problem */
#define UBA_PURGE750(uba, bdp) { \
- ((uba)->uba_dpr[bdp] |= (UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE)); \
- {int N=8;while(N--);} \
+ ((uba)->uba_dpr[(int)bdp] |= (UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE)); \
+ {volatile int N=8;while(N--);} \
}
#else
#define UBA_PURGE750(uba, bdp)
diff --git a/sys/dev/dec/qbus/ubavar.h b/sys/dev/dec/qbus/ubavar.h
index 9b8323f3bf5..c179cb4887c 100644
--- a/sys/dev/dec/qbus/ubavar.h
+++ b/sys/dev/dec/qbus/ubavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ubavar.h,v 1.14 1996/03/18 16:47:33 ragge Exp $ */
+/* $NetBSD: ubavar.h,v 1.15 1996/04/08 18:37:36 ragge Exp $ */
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
@@ -78,7 +78,7 @@ struct uba_softc {
int uh_memsize; /* size of uba memory, pages */
caddr_t uh_mem; /* start of uba memory address space */
caddr_t uh_iopage; /* start of uba io page */
- void (**uh_reset)(); /* UBA reset function array */
+ void (**uh_reset) __P((int));/* UBA reset function array */
int *uh_resarg; /* array of ubareset args */
int uh_resno; /* Number of devices to reset */
struct ivec_dsp *uh_idsp; /* Interrupt dispatch area */
@@ -122,7 +122,7 @@ struct uba_ctlr {
short um_ctlr; /* controller index in driver */
short um_ubanum; /* the uba it is on */
short um_alive; /* controller exists */
- void (*um_intr)(); /* interrupt handler(s) */
+ void (*um_intr) __P((int)); /* interrupt handler(s) XXX */
caddr_t um_addr; /* address of device in i/o space */
struct uba_softc *um_hd;
/* the driver saves the prototype command here for use in its go routine */
@@ -154,7 +154,7 @@ struct uba_device {
short ui_ctlr; /* mass ctlr number; -1 if none */
short ui_ubanum; /* the uba it is on */
short ui_slave; /* slave on controller */
- void (*ui_intr)(); /* interrupt handler(s) */
+ void (*ui_intr) __P((int)); /* interrupt handler(s) XXX */
caddr_t ui_addr; /* address of device in i/o space */
short ui_dk; /* if init 1 set to number for iostat */
int ui_flags; /* parameter from system specification */
@@ -176,10 +176,15 @@ struct uba_device {
* These are used at boot time by the configuration program.
*/
struct uba_driver {
- int (*ud_probe)(); /* see if a driver is really there */
- int (*ud_slave)(); /* see if a slave is there */
- int (*ud_attach)(); /* setup driver for a slave */
- int (*ud_dgo)(); /* fill csr/ba to start transfer */
+ /* see if a driver is really there XXX*/
+ int (*ud_probe) __P((caddr_t, int, struct uba_ctlr *,
+ struct uba_softc *));
+ /* see if a slave is there XXX */
+ int (*ud_slave) __P((struct uba_device *, caddr_t));
+ /* setup driver for a slave XXX */
+ void (*ud_attach) __P((struct uba_device *));
+ /* fill csr/ba to start transfer XXX */
+ void (*ud_dgo) __P((struct uba_ctlr *));
u_short *ud_addr; /* device csr addresses */
char *ud_dname; /* name of a device */
struct uba_device **ud_dinfo; /* backpointers to ubdinit structs */
@@ -187,7 +192,8 @@ struct uba_driver {
struct uba_ctlr **ud_minfo; /* backpointers to ubminit structs */
short ud_xclu; /* want exclusive use of bdp's */
short ud_keepbdp; /* hang on to bdp's once allocated */
- int (*ud_ubamem)(); /* see if dedicated memory is present */
+ int (*ud_ubamem) __P((struct uba_device *, int));
+ /* see if dedicated memory is present */
};
/*
@@ -196,8 +202,10 @@ struct uba_driver {
*/
struct uba_attach_args {
caddr_t ua_addr;
- void (*ua_ivec)(); /* Pointer to int routine, filled in by probe*/
- void (*ua_reset)(); /* UBA reset routine, filled in by probe */
+ /* Pointer to int routine, filled in by probe*/
+ void (*ua_ivec) __P((int));
+ /* UBA reset routine, filled in by probe */
+ void (*ua_reset) __P((int));
int ua_iaddr;
int ua_br;
int ua_cvec;
@@ -250,10 +258,13 @@ extern struct uba_device ubdinit[];
extern struct cfdriver uba_cd;
void ubainit __P((struct uba_softc *));
-void ubasetvec __P((struct device *, int, void (*)()));
+void ubasetvec __P((struct device *, int, void (*) __P((int))));
int uballoc __P((int, caddr_t, int, int));
void ubarelse __P((int, int *));
-
+int ubaqueue __P((struct uba_device *, int));
+void ubadone __P((struct uba_ctlr *));
+void ubareset __P((int));
+int ubasetup __P((int, struct buf *, int));
#endif /* _KERNEL */
#endif !_LOCORE