diff --git a/sys/arch/macppc/dev/zs.c b/sys/arch/macppc/dev/zs.c index fe33b8487a78..5427f9e90d1e 100644 --- a/sys/arch/macppc/dev/zs.c +++ b/sys/arch/macppc/dev/zs.c @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.29 2004/03/24 19:42:04 matt Exp $ */ +/* $NetBSD: zs.c,v 1.30 2005/01/10 16:34:46 chs Exp $ */ /* * Copyright (c) 1996, 1998 Bill Studenmund @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.29 2004/03/24 19:42:04 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.30 2005/01/10 16:34:46 chs Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -127,7 +127,7 @@ int zs_cons_canabort = 0; /* device to which the console is attached--if serial. */ /* Mac stuff */ -static int zs_get_speed __P((struct zs_chanstate *)); +static int zs_get_speed(struct zs_chanstate *); /* * Even though zsparam will set up the clock multiples, etc., we @@ -160,35 +160,32 @@ static u_char zs_init_reg[16] = { ****************************************************************/ /* Definition of the driver for autoconfig. */ -static int zsc_match __P((struct device *, struct cfdata *, void *)); -static void zsc_attach __P((struct device *, struct device *, void *)); -static int zsc_print __P((void *, const char *name)); +static int zsc_match(struct device *, struct cfdata *, void *); +static void zsc_attach(struct device *, struct device *, void *); +static int zsc_print(void *, const char *); CFATTACH_DECL(zsc, sizeof(struct zsc_softc), zsc_match, zsc_attach, NULL, NULL); extern struct cfdriver zsc_cd; -int zshard __P((void *)); -int zssoft __P((void *)); +int zshard(void *); +int zssoft(void *); #ifdef ZS_TXDMA -static int zs_txdma_int __P((void *)); +static int zs_txdma_int(void *); #endif -void zscnprobe __P((struct consdev *)); -void zscninit __P((struct consdev *)); -int zscngetc __P((dev_t)); -void zscnputc __P((dev_t, int)); -void zscnpollc __P((dev_t, int)); +void zscnprobe(struct consdev *); +void zscninit(struct consdev *); +int zscngetc(dev_t); +void zscnputc(dev_t, int); +void zscnpollc(dev_t, int); /* * Is the zs chip present? */ static int -zsc_match(parent, cf, aux) - struct device *parent; - struct cfdata *cf; - void *aux; +zsc_match(struct device *parent, struct cfdata *cf, void *aux) { struct confargs *ca = aux; int unit = cf->cf_unit; @@ -209,10 +206,7 @@ zsc_match(parent, cf, aux) * not set up the keyboard as ttya, etc. */ static void -zsc_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; +zsc_attach(struct device *parent, struct device *self, void *aux) { struct zsc_softc *zsc = (void *)self; struct confargs *ca = aux; @@ -414,9 +408,7 @@ zsc_attach(parent, self, aux) } static int -zsc_print(aux, name) - void *aux; - const char *name; +zsc_print(void *aux, const char *name) { struct zsc_attach_args *args = aux; @@ -430,10 +422,7 @@ zsc_print(aux, name) } int -zsmdioctl(cs, cmd, data) - struct zs_chanstate *cs; - u_long cmd; - caddr_t data; +zsmdioctl(struct zs_chanstate *cs, u_long cmd, caddr_t data) { switch (cmd) { default: @@ -443,8 +432,7 @@ zsmdioctl(cs, cmd, data) } void -zsmd_setclock(cs) - struct zs_chanstate *cs; +zsmd_setclock(struct zs_chanstate *cs) { #ifdef NOTYET struct xzs_chanstate *xcs = (void *)cs; @@ -469,11 +457,10 @@ static int zssoftpending; * so we have to look at all of them on each interrupt. */ int -zshard(arg) - void *arg; +zshard(void *arg) { - register struct zsc_softc *zsc; - register int unit, rval; + struct zsc_softc *zsc; + int unit, rval; rval = 0; for (unit = 0; unit < zsc_cd.cd_ndevs; unit++) { @@ -504,11 +491,10 @@ zshard(arg) * Similar scheme as for zshard (look at all of them) */ int -zssoft(arg) - void *arg; +zssoft(void *arg) { - register struct zsc_softc *zsc; - register int unit; + struct zsc_softc *zsc; + int unit; /* This is not the only ISR on this IPL. */ if (zssoftpending == 0) @@ -532,8 +518,7 @@ zssoft(arg) #ifdef ZS_TXDMA int -zs_txdma_int(arg) - void *arg; +zs_txdma_int(void *arg) { int ch = (int)arg; struct zsc_softc *zsc; @@ -561,10 +546,7 @@ zs_txdma_int(arg) } void -zs_dma_setup(cs, pa, len) - struct zs_chanstate *cs; - caddr_t pa; - int len; +zs_dma_setup(struct zs_chanstate *cs, caddr_t pa, int len) { struct zsc_softc *zsc; dbdma_command_t *cmdp; @@ -590,8 +572,7 @@ zs_dma_setup(cs, pa, len) * XXX Assume internal BRG. */ int -zs_get_speed(cs) - struct zs_chanstate *cs; +zs_get_speed(struct zs_chanstate *cs) { int tconst; @@ -618,9 +599,7 @@ zs_get_speed(cs) * By Bill Studenmund, 1996-05-12 */ int -zs_set_speed(cs, bps) - struct zs_chanstate *cs; - int bps; /* bits per second */ +zs_set_speed(struct zs_chanstate *cs, int bps) { struct xzs_chanstate *xcs = (void *) cs; int i, tc, tc0 = 0, tc1, s, sf = 0; @@ -759,9 +738,7 @@ zs_set_speed(cs, bps) } int -zs_set_modes(cs, cflag) - struct zs_chanstate *cs; - int cflag; /* bits per second */ +zs_set_modes(struct zs_chanstate *cs, int cflag) { struct xzs_chanstate *xcs = (void*)cs; int s; @@ -846,9 +823,7 @@ zs_set_modes(cs, cflag) #define ZS_DELAY() u_char -zs_read_reg(cs, reg) - struct zs_chanstate *cs; - u_char reg; +zs_read_reg(struct zs_chanstate *cs, u_char reg) { u_char val; @@ -860,9 +835,7 @@ zs_read_reg(cs, reg) } void -zs_write_reg(cs, reg, val) - struct zs_chanstate *cs; - u_char reg, val; +zs_write_reg(struct zs_chanstate *cs, u_char reg, u_char val) { out8(cs->cs_reg_csr, reg); ZS_DELAY(); @@ -870,10 +843,10 @@ zs_write_reg(cs, reg, val) ZS_DELAY(); } -u_char zs_read_csr(cs) - struct zs_chanstate *cs; +u_char +zs_read_csr(struct zs_chanstate *cs) { - register u_char val; + u_char val; val = in8(cs->cs_reg_csr); ZS_DELAY(); @@ -882,28 +855,26 @@ u_char zs_read_csr(cs) return val; } -void zs_write_csr(cs, val) - struct zs_chanstate *cs; - u_char val; +void +zs_write_csr(struct zs_chanstate *cs, u_char val) { /* Note, the csr does not write CTS... */ out8(cs->cs_reg_csr, val); ZS_DELAY(); } -u_char zs_read_data(cs) - struct zs_chanstate *cs; +u_char +zs_read_data(struct zs_chanstate *cs) { - register u_char val; + u_char val; val = in8(cs->cs_reg_data); ZS_DELAY(); return val; } -void zs_write_data(cs, val) - struct zs_chanstate *cs; - u_char val; +void +zs_write_data(struct zs_chanstate *cs, u_char val) { out8(cs->cs_reg_data, val); ZS_DELAY(); @@ -944,11 +915,10 @@ static int stdin, stdout; * Polled input char. */ int -zs_getc(v) - void *v; +zs_getc(void *v) { - register volatile struct zschan *zc = v; - register int s, c, rr0; + volatile struct zschan *zc = v; + int s, c, rr0; s = splhigh(); /* Wait for a character to arrive. */ @@ -972,13 +942,11 @@ zs_getc(v) * Polled output char. */ void -zs_putc(v, c) - void *v; - int c; +zs_putc(void *v, int c) { - register volatile struct zschan *zc = v; - register int s, rr0; - register long wait = 0; + volatile struct zschan *zc = v; + int s, rr0; + long wait = 0; s = splhigh(); /* Wait for transmitter to become ready. */ @@ -999,11 +967,10 @@ zs_putc(v, c) * Polled console input putchar. */ int -zscngetc(dev) - dev_t dev; +zscngetc(dev_t dev) { - register volatile struct zschan *zc = zs_conschan; - register int c; + volatile struct zschan *zc = zs_conschan; + int c; if (zc) { c = zs_getc((void *)zc); @@ -1019,11 +986,9 @@ zscngetc(dev) * Polled console output putchar. */ void -zscnputc(dev, c) - dev_t dev; - int c; +zscnputc(dev_t dev, int c) { - register volatile struct zschan *zc = zs_conschan; + volatile struct zschan *zc = zs_conschan; if (zc) { zs_putc((void *)zc, c); @@ -1037,12 +1002,11 @@ zscnputc(dev, c) * Handle user request to enter kernel debugger. */ void -zs_abort(cs) - struct zs_chanstate *cs; +zs_abort(struct zs_chanstate *cs) { volatile struct zschan *zc = zs_conschan; int rr0; - register long wait = 0; + long wait = 0; if (zs_cons_canabort == 0) return; @@ -1065,8 +1029,8 @@ zs_abort(cs) #endif } -extern int ofccngetc __P((dev_t)); -extern void ofccnputc __P((dev_t, int)); +extern int ofccngetc(dev_t); +extern void ofccnputc(dev_t, int); struct consdev consdev_zs = { zscnprobe, @@ -1078,8 +1042,7 @@ struct consdev consdev_zs = { }; void -zscnprobe(cp) - struct consdev *cp; +zscnprobe(struct consdev *cp) { int chosen, pkg; int unit = 0; @@ -1116,8 +1079,7 @@ zscnprobe(cp) } void -zscninit(cp) - struct consdev *cp; +zscninit(struct consdev *cp) { int escc, escc_ch, obio, zs_offset; int ch = 0;