diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-04-22 00:42:17 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-04-22 00:42:17 +0000 |
commit | 6ca0465503b5d87bd9dca1cbaadf8de986104de6 (patch) | |
tree | 8e77ea8763a422038479d8dabe0f7c96e47b8a78 | |
parent | 7102af90d5d205ad0826346650bbd84ca7178f52 (diff) |
Pass -Wall, complete prototypes, some KNF; no functional change.
23 files changed, 180 insertions, 109 deletions
diff --git a/sys/arch/hp300/stand/cdboot/cdboot.c b/sys/arch/hp300/stand/cdboot/cdboot.c index 549bc006f79..1f4ac02d3a5 100644 --- a/sys/arch/hp300/stand/cdboot/cdboot.c +++ b/sys/arch/hp300/stand/cdboot/cdboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cdboot.c,v 1.5 2003/06/02 23:27:45 millert Exp $ */ +/* $OpenBSD: cdboot.c,v 1.6 2005/04/22 00:42:14 miod Exp $ */ /* $NetBSD: uboot.c,v 1.3 1997/04/27 21:17:13 thorpej Exp $ */ /*- @@ -69,6 +69,7 @@ char *names[] = { static int bdev, badapt, bctlr, bunit, bpart; +int main() { int currname = 0; @@ -94,4 +95,5 @@ main() exec(name, lowram, howto); printf("boot: %s\n", strerror(errno)); } + return (0); } diff --git a/sys/arch/hp300/stand/cdboot/devopen.c b/sys/arch/hp300/stand/cdboot/devopen.c index 3a93b1bf9b9..3cdf09b63ad 100644 --- a/sys/arch/hp300/stand/cdboot/devopen.c +++ b/sys/arch/hp300/stand/cdboot/devopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: devopen.c,v 1.1 1999/08/16 09:43:08 downsj Exp $ */ +/* $OpenBSD: devopen.c,v 1.2 2005/04/22 00:42:14 miod Exp $ */ /* $NetBSD: devopen.c,v 1.7 1996/10/14 07:31:47 thorpej Exp $ */ /*- @@ -41,6 +41,7 @@ u_int opendev; #define ispart(c) ((c) >= 'a' && (c) <= 'h') +int atoi(char *cp) { int val = 0; @@ -49,14 +50,14 @@ atoi(char *cp) return(val); } +void usage() { - printf("\ -Usage: device(adaptor, controller, drive, partition)file\n\ - <device><unit><partitionletter>:file\n\ -"); + printf("Usage: device(adaptor, controller, drive, partition)file\n" + " <device><unit><partitionletter>:file\n"); } +int devlookup(d, len) const char *d; int len; @@ -103,12 +104,13 @@ devlookup(d, len) * [A-Za-z]*[0-9]*[A-Za-z]:file * dev unit part */ +int devparse(fname, dev, adapt, ctlr, unit, part, file) const char *fname; int *dev, *adapt, *ctlr, *unit, *part; char **file; { - int *argp, i; + int i; char *s, *args[4]; /* get device name and make lower case */ @@ -195,12 +197,13 @@ devparse(fname, dev, adapt, ctlr, unit, part, file) } +int devopen(f, fname, file) struct open_file *f; const char *fname; char **file; { - int n, error; + int error; int dev, adapt, ctlr, unit, part; struct devsw *dp = &devsw[0]; @@ -210,7 +213,7 @@ devopen(f, fname, file) unit = B_UNIT(bootdev); part = B_PARTITION(bootdev); - if (error = devparse(fname, &dev, &adapt, &ctlr, &unit, &part, file)) + if ((error = devparse(fname, &dev, &adapt, &ctlr, &unit, &part, file))) return(error); /* diff --git a/sys/arch/hp300/stand/common/apci.c b/sys/arch/hp300/stand/common/apci.c index 80487ef5e62..a97b0816691 100644 --- a/sys/arch/hp300/stand/common/apci.c +++ b/sys/arch/hp300/stand/common/apci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apci.c,v 1.4 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: apci.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: apci.c,v 1.2 1997/10/04 17:20:15 thorpej Exp $ */ /*- @@ -90,8 +90,6 @@ void apciprobe(cp) struct consdev *cp; { - struct apciregs *apci = apcicnaddr = - (struct apciregs *)IIOV(FRODO_BASE + FRODO_APCI_OFFSET(1)); cp->cn_pri = CN_DEAD; diff --git a/sys/arch/hp300/stand/common/autoconf.c b/sys/arch/hp300/stand/common/autoconf.c index e6f575dcf5a..962d8d4647f 100644 --- a/sys/arch/hp300/stand/common/autoconf.c +++ b/sys/arch/hp300/stand/common/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.4 2005/01/19 17:09:30 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.12 1997/01/30 10:32:51 thorpej Exp $ */ /* @@ -67,6 +67,8 @@ int cpuspeed; extern int internalhpib; +void find_devs(void); + #ifdef PRINTROMINFO printrominfo() { @@ -79,6 +81,7 @@ printrominfo() } #endif +void configure() { u_long msustobdev(); @@ -156,6 +159,7 @@ msustobdev() return (bdev); } +u_long sctoaddr(sc) int sc; { @@ -176,6 +180,7 @@ sctoaddr(sc) * * Note that we only care about displays, LANCEs, SCSIs and HP-IBs. */ +void find_devs() { short sc, sctop; diff --git a/sys/arch/hp300/stand/common/ct.c b/sys/arch/hp300/stand/common/ct.c index a7c92778d1c..bda4470b65e 100644 --- a/sys/arch/hp300/stand/common/ct.c +++ b/sys/arch/hp300/stand/common/ct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ct.c,v 1.2 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: ct.c,v 1.3 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: ct.c,v 1.9 1996/10/14 07:29:57 thorpej Exp $ */ /* @@ -67,20 +67,20 @@ struct ctinfo { short hwid; short punit; } ctinfo[] = { - CT7946ID, 1, - CT7912PID, 1, - CT7914PID, 1, - CT9144ID, 0, - CT9145ID, 0, + { CT7946ID, 1 }, + { CT7912PID, 1 }, + { CT7914PID, 1 }, + { CT9144ID, 0 }, + { CT9145ID, 0 } }; int nctinfo = sizeof(ctinfo) / sizeof(ctinfo[0]); +int ctinit(ctlr, unit) register int ctlr, unit; { register struct ct_softc *rs = &ct_softc[ctlr][unit]; u_char stat; - register int type; if (hpibrecv(ctlr, unit, C_QSTAT, &stat, 1) != 1 || stat) return (0); @@ -100,6 +100,7 @@ ctinit(ctlr, unit) return (1); } +int ctident(ctlr, unit) int ctlr, unit; { @@ -168,6 +169,7 @@ ctpunit(ctlr, slave, punit) return (0); } +int ctopen(f, ctlr, unit, part) struct open_file *f; int ctlr, unit, part; @@ -195,14 +197,17 @@ ctopen(f, ctlr, unit, part) return(0); } +int ctclose(f) struct open_file *f; { size_t resid; ctstrategy(f->f_devdata, MTREW, 0, 0, ctio_buf, &resid); + return (0); } +int ctstrategy(devdata, func, dblk, size, v_buf, rsize) void *devdata; int func; @@ -280,6 +285,7 @@ retry: return(0); } +int cterror(ctlr, unit) register int ctlr, unit; { @@ -305,7 +311,7 @@ cterror(ctlr, unit) rs->sc_blkno = ct_stat.c_blk; return (2); } - printf("ct%d err: vu 0x%x, pend 0x%x, bn%d", unit, + printf("ct%d err: vu 0x%x, pend 0x%x, bn%ld", unit, ct_stat.c_vu, ct_stat.c_pend, ct_stat.c_blk); printf(", R 0x%x F 0x%x A 0x%x I 0x%x\n", ct_stat.c_ref, ct_stat.c_fef, ct_stat.c_aef, ct_stat.c_ief); diff --git a/sys/arch/hp300/stand/common/fhpib.c b/sys/arch/hp300/stand/common/fhpib.c index 7f695d6fb42..29ce39e2b69 100644 --- a/sys/arch/hp300/stand/common/fhpib.c +++ b/sys/arch/hp300/stand/common/fhpib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fhpib.c,v 1.2 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: fhpib.c,v 1.3 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: fhpib.c,v 1.5 1995/08/05 16:47:42 thorpej Exp $ */ /* @@ -43,6 +43,9 @@ #include "hpibvar.h" #include "samachdep.h" +void fhpibreset(int); + +int fhpibinit(unit) register int unit; { @@ -57,6 +60,7 @@ fhpibinit(unit) return(1); } +void fhpibreset(unit) { register struct hpib_softc *hs = &hpib_softc[unit]; @@ -77,6 +81,7 @@ fhpibreset(unit) DELAY(100000); } +int fhpibsend(unit, slave, sec, buf, cnt) register char *buf; register int cnt; @@ -118,6 +123,7 @@ fhpibsend(unit, slave, sec, buf, cnt) return(origcnt - cnt); } +int fhpibrecv(unit, slave, sec, buf, cnt) register char *buf; register int cnt; @@ -155,6 +161,7 @@ fhpibrecv(unit, slave, sec, buf, cnt) return(origcnt - cnt); } +int fhpibppoll(unit) register int unit; { @@ -178,6 +185,7 @@ fhpibppoll(unit) return(ppoll); } +int fhpibwait(hd, x) register struct fhpibdevice *hd; { diff --git a/sys/arch/hp300/stand/common/hd.c b/sys/arch/hp300/stand/common/hd.c index 48d540d7cc0..28d34b9a0b5 100644 --- a/sys/arch/hp300/stand/common/hd.c +++ b/sys/arch/hp300/stand/common/hd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hd.c,v 1.2 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: hd.c,v 1.3 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: rd.c,v 1.11 1996/12/21 21:34:40 thorpej Exp $ */ /* @@ -102,11 +102,11 @@ struct hdidentinfo { }; int numhdidentinfo = sizeof(hdidentinfo) / sizeof(hdidentinfo[0]); +int hdinit(ctlr, unit) int ctlr, unit; { register struct hd_softc *rs = &hd_softc[ctlr][unit]; - u_char stat; rs->sc_type = hdident(ctlr, unit); if (rs->sc_type < 0) @@ -115,6 +115,7 @@ hdinit(ctlr, unit) return (1); } +void hdreset(ctlr, unit) register int ctlr, unit; { @@ -131,6 +132,7 @@ hdreset(ctlr, unit) hpibrecv(ctlr, unit, C_QSTAT, &stat, 1); } +int hdident(ctlr, unit) register int ctlr, unit; { @@ -196,6 +198,7 @@ hdident(ctlr, unit) char io_buf[MAXBSIZE]; +int hdgetinfo(rs) register struct hd_softc *rs; { @@ -237,12 +240,12 @@ hdgetinfo(rs) return(1); } +int hdopen(f, ctlr, unit, part) struct open_file *f; int ctlr, unit, part; { register struct hd_softc *rs; - struct hdinfo *ri; if (ctlr >= NHPIB || hpibalive(ctlr) == 0) return (EADAPT); @@ -265,6 +268,7 @@ hdopen(f, ctlr, unit, part) return (0); } +int hdclose(f) struct open_file *f; { @@ -276,10 +280,10 @@ hdclose(f) */ bzero(rs, sizeof(struct hd_softc)); f->f_devdata = NULL; - return (0); } +int hdstrategy(devdata, func, dblk, size, v_buf, rsize) void *devdata; int func; @@ -332,11 +336,11 @@ retry: return(0); } +int hderror(ctlr, unit, part) register int ctlr, unit; int part; { - register struct hd_softc *hd = &hd_softc[ctlr][unit]; char stat; hd_rsc.c_unit = C_SUNIT(0); @@ -354,7 +358,7 @@ hderror(ctlr, unit, part) printf("hd(%d,%d,0,%d) err: vu 0x%x", ctlr, unit, part, hd_stat.c_vu); if ((hd_stat.c_aef & AEF_UD) || (hd_stat.c_ief & (IEF_MD|IEF_RD))) - printf(", block %d", hd_stat.c_blk); + printf(", block %ld", hd_stat.c_blk); printf(", R0x%x F0x%x A0x%x I0x%x\n", hd_stat.c_ref, hd_stat.c_fef, hd_stat.c_aef, hd_stat.c_ief); return(1); diff --git a/sys/arch/hp300/stand/common/hil.c b/sys/arch/hp300/stand/common/hil.c index f484575c991..b6f04cbe3e2 100644 --- a/sys/arch/hp300/stand/common/hil.c +++ b/sys/arch/hp300/stand/common/hil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hil.c,v 1.3 2005/01/19 17:09:30 miod Exp $ */ +/* $OpenBSD: hil.c,v 1.4 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: hil.c,v 1.2 1997/04/14 19:00:10 thorpej Exp $ */ /* @@ -182,16 +182,16 @@ char hil_uk_ctrlmap[] = { * Lookup is by hardware returned language code. */ struct kbdmap hilkbd_map[] = { - KBD_US, NULL, - hil_us_keymap, hil_us_shiftmap, hil_us_ctrlmap, NULL, NULL, + { KBD_US, NULL, + hil_us_keymap, hil_us_shiftmap, hil_us_ctrlmap, NULL, NULL }, #ifdef UK_KEYBOARD - KBD_UK, NULL, - hil_uk_keymap, hil_uk_shiftmap, hil_uk_ctrlmap, NULL, NULL, + { KBD_UK, NULL, + hil_uk_keymap, hil_uk_shiftmap, hil_uk_ctrlmap, NULL, NULL }, #endif - 0, NULL, - NULL, NULL, NULL, NULL, NULL, + { 0, NULL, + NULL, NULL, NULL, NULL, NULL } }; char *hilkbd_keymap = hil_us_keymap; @@ -273,5 +273,7 @@ hilkbd_init() } HILWAIT(hiladdr); hiladdr->hil_cmd = HIL_INTON; + + return (0); } #endif /* ITECONSOLE && HIL_KEYBOARD */ diff --git a/sys/arch/hp300/stand/common/hpib.c b/sys/arch/hp300/stand/common/hpib.c index 64858e97d8f..68362f09710 100644 --- a/sys/arch/hp300/stand/common/hpib.c +++ b/sys/arch/hp300/stand/common/hpib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hpib.c,v 1.2 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: hpib.c,v 1.3 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: hpib.c,v 1.2 1997/05/12 07:48:23 thorpej Exp $ */ /* @@ -52,12 +52,13 @@ int fhpibppoll(), nhpibppoll(); struct hpib_softc hpib_softc[NHPIB]; +void hpibinit() { extern struct hp_hw sc_table[]; register struct hp_hw *hw; register struct hpib_softc *hs; - register int i, addr; + register int i; i = 0; for (hw = sc_table; i < NHPIB && hw < &sc_table[MAXCTLRS]; hw++) { @@ -76,6 +77,7 @@ hpibinit() } } +int hpibalive(unit) register int unit; { @@ -84,6 +86,7 @@ hpibalive(unit) return (1); } +int hpibid(unit, slave) int unit, slave; { @@ -99,6 +102,7 @@ hpibid(unit, slave) return (id); } +int hpibsend(unit, slave, sec, buf, cnt) int unit, slave; char *buf; @@ -109,6 +113,7 @@ hpibsend(unit, slave, sec, buf, cnt) return (nhpibsend(unit, slave, sec, buf, cnt)); } +int hpibrecv(unit, slave, sec, buf, cnt) int unit, slave; char *buf; @@ -119,6 +124,7 @@ hpibrecv(unit, slave, sec, buf, cnt) return (nhpibrecv(unit, slave, sec, buf, cnt)); } +int hpibswait(unit, slave) register int unit, slave; { @@ -138,6 +144,7 @@ hpibswait(unit, slave) return (0); } +void hpibgo(unit, slave, sec, addr, count, flag) int unit, slave; char *addr; diff --git a/sys/arch/hp300/stand/common/if_le.c b/sys/arch/hp300/stand/common/if_le.c index ad9a0c72a40..fb1ca449433 100644 --- a/sys/arch/hp300/stand/common/if_le.c +++ b/sys/arch/hp300/stand/common/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.3 2003/12/12 08:56:11 deraadt Exp $ */ +/* $OpenBSD: if_le.c,v 1.4 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: if_le.c,v 1.9 1997/01/30 10:32:54 thorpej Exp $ */ /* @@ -144,6 +144,7 @@ lerdcsr(sc, port) return (val); } +void leinit() { extern struct hp_hw sc_table[]; @@ -226,12 +227,11 @@ le_match(nif, machdep_hint) return rv; } +int le_probe(nif, machdep_hint) struct netif *nif; void *machdep_hint; { - char *cp; - int i; /* the set unit is the current unit */ #ifdef LE_DEBUG @@ -391,7 +391,7 @@ le_reset(unit, myea) { struct le_softc *sc = &le_softc[unit]; u_long a; - int timo = 100000, stat, i; + int timo = 100000; #ifdef LE_DEBUG if (le_debug) { @@ -454,11 +454,13 @@ le_poll(desc, pkt, len) void *pkt; int len; { +#if 0 struct netif *nif = desc->io_netif; - int unit = /*nif->nif_unit*/0; + int unit = nif->nif_unit; +#else + int unit = 0; +#endif struct le_softc *sc = &le_softc[unit]; - volatile struct lereg0 *ler0 = sc->sc_r0; - volatile struct lereg1 *ler1 = sc->sc_r1; int length; volatile struct mds *cdm; register int stat; @@ -535,11 +537,13 @@ le_put(desc, pkt, len) void *pkt; int len; { +#if 0 struct netif *nif = desc->io_netif; - int unit = /*nif->nif_unit*/0; + int unit = nif->nif_unit; +#else + int unit = 0; +#endif struct le_softc *sc = &le_softc[unit]; - volatile struct lereg0 *ler0 = sc->sc_r0; - volatile struct lereg1 *ler1 = sc->sc_r1; volatile struct mds *cdm; int timo, i, stat; diff --git a/sys/arch/hp300/stand/common/ite.c b/sys/arch/hp300/stand/common/ite.c index 9275656bfef..26b1e737ab1 100644 --- a/sys/arch/hp300/stand/common/ite.c +++ b/sys/arch/hp300/stand/common/ite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ite.c,v 1.4 2005/01/19 17:09:30 miod Exp $ */ +/* $OpenBSD: ite.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: ite.c,v 1.12 1997/01/30 10:32:55 thorpej Exp $ */ /* @@ -54,6 +54,8 @@ #include "consdefs.h" #include "samachdep.h" +void itecheckwrap(struct ite_data *, struct itesw *); +void ite_clrtoeol(struct ite_data *, struct itesw *, int, int); void ite_deinit_noop(struct ite_data *); struct itesw itesw[] = { @@ -93,12 +95,13 @@ int nitesw = sizeof(itesw) / sizeof(itesw[0]); /* these guys need to be in initialized data */ int itecons = -1; -struct ite_data ite_data[NITE] = { 0 }; +struct ite_data ite_data[NITE] = { { 0 } }; int ite_scode[NITE] = { 0 }; /* * Locate all bitmapped displays */ +void iteconfig() { extern struct hp_hw sc_table[]; @@ -267,9 +270,8 @@ iteputchar(dev, c) } } -itecheckwrap(ip, sp) - register struct ite_data *ip; - register struct itesw *sp; +void +itecheckwrap(struct ite_data *ip, struct itesw *sp) { if (++ip->curx == ip->cols) { ip->curx = 0; @@ -283,10 +285,8 @@ itecheckwrap(ip, sp) (*sp->ite_cursor)(ip, MOVE_CURSOR); } -ite_clrtoeol(ip, sp, y, x) - register struct ite_data *ip; - register struct itesw *sp; - register int y, x; +void +ite_clrtoeol(struct ite_data *ip, struct itesw *sp, int y, int x) { (*sp->ite_clear)(ip, y, x, 1, ip->cols - x); (*sp->ite_cursor)(ip, DRAW_CURSOR); diff --git a/sys/arch/hp300/stand/common/ite_dv.c b/sys/arch/hp300/stand/common/ite_dv.c index 719ffed7171..68e5a1fbc2d 100644 --- a/sys/arch/hp300/stand/common/ite_dv.c +++ b/sys/arch/hp300/stand/common/ite_dv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ite_dv.c,v 1.4 2005/01/19 17:09:30 miod Exp $ */ +/* $OpenBSD: ite_dv.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: ite_dv.c,v 1.8 1996/03/03 04:23:35 thorpej Exp $ */ /* @@ -52,8 +52,8 @@ #define REGBASE ((struct dvboxfb *)(ip->regbase)) #define WINDOWMOVER dvbox_windowmove -void dvbox_windowmove(struct ite_data *, int, int, int, int, - int, int, int); +void dvbox_windowmove(struct ite_data *, int, int, int, int, int, int, int); +void dv_reset(struct dvboxfb *); void dvbox_init(ip) @@ -205,8 +205,8 @@ dvbox_windowmove(ip, sy, sx, dy, dx, h, w, func) dp->wmove = 1; } -dv_reset(dbp) - register struct dvboxfb *dbp; +void +dv_reset(struct dvboxfb *dbp) { dbp->reset = 0x80; DELAY(400); diff --git a/sys/arch/hp300/stand/common/ite_hy.c b/sys/arch/hp300/stand/common/ite_hy.c index 3445a4e8c4a..b22e0bcada6 100644 --- a/sys/arch/hp300/stand/common/ite_hy.c +++ b/sys/arch/hp300/stand/common/ite_hy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ite_hy.c,v 1.4 2005/01/19 17:09:30 miod Exp $ */ +/* $OpenBSD: ite_hy.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: ite_hy.c,v 1.3 1996/03/03 04:23:37 thorpej Exp $ */ /* @@ -259,8 +259,6 @@ hyper_windowmove(ip, sy, sx, dy, dx, h, w, func) struct ite_data *ip; int sy, sx, dy, dx, h, w, func; { - unsigned int *psrcBase, *pdstBase; - /* start of src and dst bitmaps */ int width; /* add to get to same position in next line */ unsigned int *psrcLine, *pdstLine; diff --git a/sys/arch/hp300/stand/common/ite_subr.c b/sys/arch/hp300/stand/common/ite_subr.c index e6cf31ea40c..9c657d697d3 100644 --- a/sys/arch/hp300/stand/common/ite_subr.c +++ b/sys/arch/hp300/stand/common/ite_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ite_subr.c,v 1.3 2005/01/19 17:09:30 miod Exp $ */ +/* $OpenBSD: ite_subr.c,v 1.4 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: ite_subr.c,v 1.8 1996/03/03 04:23:40 thorpej Exp $ */ /* @@ -48,6 +48,7 @@ #include "itevar.h" #include "itereg.h" +void ite_fontinfo(ip) struct ite_data *ip; { @@ -80,6 +81,7 @@ ite_fontinfo(ip) } } +void ite_fontinit(ip) register struct ite_data *ip; { @@ -121,7 +123,7 @@ ite_writeglyph(ip, fbmem, glyphp) register u_char *fbmem, *glyphp; { register int bn; - int c, l, b; + int l, b; for (l = 0; l < ip->ftheight; l++) { bn = 7; diff --git a/sys/arch/hp300/stand/common/machdep.c b/sys/arch/hp300/stand/common/machdep.c index f739959ff7a..e3404df7ed2 100644 --- a/sys/arch/hp300/stand/common/machdep.c +++ b/sys/arch/hp300/stand/common/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.4 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: machdep.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1997/06/28 07:20:25 thorpej Exp $ */ /* @@ -111,6 +111,7 @@ struct trapframe { short frame; }; +int trap(fp) struct trapframe *fp; { diff --git a/sys/arch/hp300/stand/common/nhpib.c b/sys/arch/hp300/stand/common/nhpib.c index c8964a87aa6..e496e919291 100644 --- a/sys/arch/hp300/stand/common/nhpib.c +++ b/sys/arch/hp300/stand/common/nhpib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nhpib.c,v 1.2 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: nhpib.c,v 1.3 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: nhpib.c,v 1.5 1995/08/05 16:47:46 thorpej Exp $ */ /* @@ -43,6 +43,9 @@ #include "hpibvar.h" #include "samachdep.h" +void nhpibreset(int); + +int nhpibinit(unit) { register struct hpib_softc *hs = &hpib_softc[unit]; @@ -63,6 +66,7 @@ nhpibinit(unit) return(1); } +void nhpibreset(unit) { register struct hpib_softc *hs = &hpib_softc[unit]; @@ -92,6 +96,7 @@ nhpibreset(unit) DELAY(100000); } +int nhpibsend(unit, slave, sec, buf, cnt) register char *buf; register int cnt; @@ -129,6 +134,7 @@ nhpibsend(unit, slave, sec, buf, cnt) return(origcnt - cnt); } +int nhpibrecv(unit, slave, sec, buf, cnt) register char *buf; register int cnt; @@ -164,6 +170,7 @@ nhpibrecv(unit, slave, sec, buf, cnt) return(origcnt - cnt); } +int nhpibppoll(unit) register int unit; { @@ -179,6 +186,7 @@ nhpibppoll(unit) return(ppoll); } +int nhpibowait(hd) register struct nhpibdevice *hd; { @@ -191,6 +199,7 @@ nhpibowait(hd) return(0); } +int nhpibiwait(hd) register struct nhpibdevice *hd; { diff --git a/sys/arch/hp300/stand/common/prf.c b/sys/arch/hp300/stand/common/prf.c index 85c6f0312ec..c17e23ba4cc 100644 --- a/sys/arch/hp300/stand/common/prf.c +++ b/sys/arch/hp300/stand/common/prf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prf.c,v 1.2 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: prf.c,v 1.3 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: prf.c,v 1.5 1994/10/26 07:27:50 cgd Exp $ */ /* @@ -32,6 +32,7 @@ * @(#)prf.c 8.1 (Berkeley) 6/10/93 */ +int getchar() { register int c; @@ -47,6 +48,7 @@ getchar() return(c); } +int tgetchar() { register int c; @@ -63,6 +65,7 @@ tgetchar() return(c); } +void putchar(c) register int c; { diff --git a/sys/arch/hp300/stand/common/scsi.c b/sys/arch/hp300/stand/common/scsi.c index 5564b0be567..c2c58193b35 100644 --- a/sys/arch/hp300/stand/common/scsi.c +++ b/sys/arch/hp300/stand/common/scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi.c,v 1.4 2004/08/03 21:44:35 miod Exp $ */ +/* $OpenBSD: scsi.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: scsi.c,v 1.7 1997/01/30 10:32:57 thorpej Exp $ */ /* @@ -67,12 +67,13 @@ void scsireset(); int scsi_cmd_wait = 50000; /* use the "real" driver init_wait value */ int scsi_data_wait = 50000; /* use the "real" driver init_wait value */ +void scsiinit() { extern struct hp_hw sc_table[]; register struct hp_hw *hw; register struct scsi_softc *hs; - register int i, addr; + register int i; static int waitset = 0; i = 0; @@ -98,6 +99,7 @@ scsiinit() } } +int scsialive(unit) register int unit; { @@ -151,7 +153,7 @@ scsireset(unit) } -int +void scsiabort(hs, hd) register struct scsi_softc *hs; volatile register struct scsidevice *hd; diff --git a/sys/arch/hp300/stand/common/sd.c b/sys/arch/hp300/stand/common/sd.c index da6e1704e4e..65986800281 100644 --- a/sys/arch/hp300/stand/common/sd.c +++ b/sys/arch/hp300/stand/common/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.4 2004/08/03 21:44:35 miod Exp $ */ +/* $OpenBSD: sd.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: sd.c,v 1.9 1996/12/21 21:34:41 thorpej Exp $ */ /* @@ -72,6 +72,7 @@ struct sd_softc { #define SDRETRY 2 +int sdinit(ctlr, unit) int ctlr, unit; { @@ -108,6 +109,7 @@ sdinit(ctlr, unit) return (1); } +void sdreset(ctlr, unit) int ctlr, unit; { @@ -115,6 +117,7 @@ sdreset(ctlr, unit) char io_buf[MAXBSIZE]; +int sdgetinfo(ss) register struct sd_softc *ss; { @@ -162,6 +165,7 @@ sdgetinfo(ss) return(1); } +int sdopen(f, ctlr, unit, part) struct open_file *f; int ctlr, unit, part; @@ -195,6 +199,7 @@ sdopen(f, ctlr, unit, part) return (0); } +int sdclose(f) struct open_file *f; { @@ -210,6 +215,7 @@ sdclose(f) return (0); } +int sdstrategy(ss, func, dblk, size, v_buf, rsize) register struct sd_softc *ss; int func; diff --git a/sys/arch/hp300/stand/libsa/devopen.c b/sys/arch/hp300/stand/libsa/devopen.c index 44d6aefefe3..4c958c52645 100644 --- a/sys/arch/hp300/stand/libsa/devopen.c +++ b/sys/arch/hp300/stand/libsa/devopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: devopen.c,v 1.2 1997/09/14 07:02:05 downsj Exp $ */ +/* $OpenBSD: devopen.c,v 1.3 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: devopen.c,v 1.7 1996/10/14 07:31:47 thorpej Exp $ */ /*- @@ -41,29 +41,29 @@ u_int opendev; #define ispart(c) ((c) >= 'a' && (c) <= 'h') +int atoi(char *cp) { - int val = 0; - while(isdigit(*cp)) - val = val * 10 + (*cp++ - '0'); - return(val); + int val = 0; + + while(isdigit(*cp)) + val = val * 10 + (*cp++ - '0'); + return(val); } +void usage() { - printf("\ -Usage: device(adaptor, controller, drive, partition)file\n\ - <device><unit><partitionletter>:file\n\ -"); + printf("Usage: device(adaptor, controller, drive, partition)file\n" + " <device><unit><partitionletter>:file\n"); } -devlookup(d, len) - const char *d; - int len; +int +devlookup(const char *d, int len) { - struct devsw *dp = devsw; - int i; - + struct devsw *dp = devsw; + int i; + for (i = 0; i < ndevs; i++, dp++) { if (dp->dv_name && strncmp(dp->dv_name, d, len) == 0) { /* @@ -115,12 +115,13 @@ devlookup(d, len) * [A-Za-z]*[0-9]*[A-Za-z]:file * dev unit part */ +int devparse(fname, dev, adapt, ctlr, unit, part, file) const char *fname; int *dev, *adapt, *ctlr, *unit, *part; char **file; { - int *argp, i; + int i; char *s, *args[4]; /* get device name and make lower case */ @@ -195,24 +196,21 @@ devparse(fname, dev, adapt, ctlr, unit, part, file) /* no device present */ else *file = (char *)fname; - + /* return the remaining unparsed part as the file to boot */ return(0); - + bad: usage(); baddev: return(-1); -} - +} -devopen(f, fname, file) - struct open_file *f; - const char *fname; - char **file; +int +devopen(struct open_file *f, const char *fname, char **file) { - int n, error; + int error; int dev, adapt, ctlr, unit, part; struct devsw *dp = &devsw[0]; @@ -222,7 +220,7 @@ devopen(f, fname, file) unit = B_UNIT(bootdev); part = B_PARTITION(bootdev); - if (error = devparse(fname, &dev, &adapt, &ctlr, &unit, &part, file)) + if ((error = devparse(fname, &dev, &adapt, &ctlr, &unit, &part, file))) return(error); /* diff --git a/sys/arch/hp300/stand/mkboot/mkboot.c b/sys/arch/hp300/stand/mkboot/mkboot.c index 52c051f6e2d..7686aeb23a7 100644 --- a/sys/arch/hp300/stand/mkboot/mkboot.c +++ b/sys/arch/hp300/stand/mkboot/mkboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkboot.c,v 1.3 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: mkboot.c,v 1.4 2005/04/22 00:42:16 miod Exp $ */ /* * Copyright (c) 1990, 1993 @@ -42,7 +42,7 @@ static char copyright[] = static char sccsid[] = "@(#)mkboot.c 7.2 (Berkeley) 12/16/90"; static char rcsid[] = "$NetBSD: mkboot.c,v 1.5 1994/10/26 07:27:45 cgd Exp $"; #endif -static char rcsid[] = "$OpenBSD: mkboot.c,v 1.3 2003/06/02 23:27:46 millert Exp $"; +static char rcsid[] = "$OpenBSD: mkboot.c,v 1.4 2005/04/22 00:42:16 miod Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -73,6 +73,10 @@ struct lifdir lifd[LIF_NUMDIR]; struct exec ex; char buf[10240]; +void bcddate(int, char *); +void putfile(int, int); +void usage(void); + /* * Old Format: * sector 0: LIF volume header (40 bytes) @@ -89,6 +93,7 @@ char buf[10240]; * sector 4-31: disklabel (~300 bytes right now) * sector 32-: LIF file 0, LIF file 1, etc. */ +int main(argc, argv) char **argv; { @@ -211,12 +216,13 @@ main(argc, argv) write(to, &lifv, LIF_VOLSIZE); lseek(to, LIF_DIRSTART, 0); write(to, lifd, LIF_DIRSIZE); - exit(0); + return (0); } -putfile(from, to) +void +putfile(int from, int to) { - register int n, tcnt, dcnt; + int n, tcnt, dcnt; n = read(from, &ex, sizeof(ex)); if (n != sizeof(ex)) { @@ -278,6 +284,7 @@ putfile(from, to) } } +void usage() { fprintf(stderr, @@ -309,6 +316,7 @@ lifname(str) #include <sys/stat.h> #include <time.h> /* XXX */ +void bcddate(fd, toc) int fd; char *toc; diff --git a/sys/arch/hp300/stand/uboot/netio.c b/sys/arch/hp300/stand/uboot/netio.c index d74e39570cf..084af743a72 100644 --- a/sys/arch/hp300/stand/uboot/netio.c +++ b/sys/arch/hp300/stand/uboot/netio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netio.c,v 1.1 1997/07/14 08:14:57 downsj Exp $ */ +/* $OpenBSD: netio.c,v 1.2 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: netio.c,v 1.5 1997/01/30 10:32:56 thorpej Exp $ */ /* @@ -115,6 +115,7 @@ netclose(f) if (--open_count == 0) netif_close(netdev_sock); f->f_devdata = NULL; + return (0); } int diff --git a/sys/arch/hp300/stand/uboot/uboot.c b/sys/arch/hp300/stand/uboot/uboot.c index 7c52d3a9455..59cc5570800 100644 --- a/sys/arch/hp300/stand/uboot/uboot.c +++ b/sys/arch/hp300/stand/uboot/uboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uboot.c,v 1.3 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: uboot.c,v 1.4 2005/04/22 00:42:16 miod Exp $ */ /* $NetBSD: uboot.c,v 1.3 1997/04/27 21:17:13 thorpej Exp $ */ /*- @@ -66,6 +66,9 @@ char *names[] = { static int bdev, badapt, bctlr, bunit, bpart; +void getbootdev(int *); + +int main() { int currname = 0; @@ -94,10 +97,11 @@ main() exec(name, lowram, howto); printf("boot: %s\n", strerror(errno)); } + return (0); } -getbootdev(howto) - int *howto; +void +getbootdev(int *howto) { char c, *ptr = line; @@ -110,7 +114,7 @@ getbootdev(howto) printf("panic: can't reboot, halting\n"); asm("stop #0x2700"); } - while (c = *ptr) { + while ((c = *ptr) != '\0') { while (c == ' ') c = *++ptr; if (!c) |