summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2005-12-21 12:43:50 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2005-12-21 12:43:50 +0000
commit3438dfc917d2152b0744f293818ae70796c04500 (patch)
tree8725985cd9607a8836639e574485dc650cdae44b /sys/kern
parent80056e6892045973422f75004a44b361593ff4db (diff)
ansi/deregister. No binary change.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/tty.c177
-rw-r--r--sys/kern/tty_conf.c9
-rw-r--r--sys/kern/tty_pty.c107
-rw-r--r--sys/kern/tty_subr.c73
-rw-r--r--sys/kern/tty_tb.c58
-rw-r--r--sys/kern/tty_tty.c33
6 files changed, 139 insertions, 318 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 7542b035602..a4196c475fb 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.68 2004/12/26 21:22:13 miod Exp $ */
+/* $OpenBSD: tty.c,v 1.69 2005/12/21 12:43:49 jsg Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -172,9 +172,7 @@ int64_t tk_cancc, tk_nin, tk_nout, tk_rawcc;
* Initial open of tty, or (re)entry to standard tty line discipline.
*/
int
-ttyopen(device, tp)
- dev_t device;
- register struct tty *tp;
+ttyopen(dev_t device, struct tty *tp)
{
int s;
@@ -198,8 +196,7 @@ ttyopen(device, tp)
* can detect recycling of the tty.
*/
int
-ttyclose(tp)
- register struct tty *tp;
+ttyclose(struct tty *tp)
{
extern struct tty *constty; /* Temporary virtual console. */
@@ -232,12 +229,10 @@ ttyclose(tp)
* Process input of a single character received on a tty.
*/
int
-ttyinput(c, tp)
- register int c;
- register struct tty *tp;
+ttyinput(int c, struct tty *tp)
{
- register int iflag, lflag;
- register u_char *cc;
+ int iflag, lflag;
+ u_char *cc;
int i, error;
int s;
@@ -596,12 +591,10 @@ startoutput:
* Must be recursive.
*/
int
-ttyoutput(c, tp)
- register int c;
- register struct tty *tp;
+ttyoutput(int c, struct tty *tp)
{
- register long oflag;
- register int col, notout, s, c2;
+ long oflag;
+ int col, notout, s, c2;
oflag = tp->t_oflag;
if (!ISSET(oflag, OPOST)) {
@@ -722,12 +715,7 @@ ttyoutput(c, tp)
*/
/* ARGSUSED */
int
-ttioctl(tp, cmd, data, flag, p)
- register struct tty *tp;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
+ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
{
extern struct tty *constty; /* Temporary virtual console. */
extern int nlinesw;
@@ -796,7 +784,7 @@ ttioctl(tp, cmd, data, flag, p)
splx(s);
break;
case TIOCFLUSH: { /* flush buffers */
- register int flags = *(int *)data;
+ int flags = *(int *)data;
if (flags == 0)
flags = FREAD | FWRITE;
@@ -870,7 +858,7 @@ ttioctl(tp, cmd, data, flag, p)
case TIOCSETA: /* set termios struct */
case TIOCSETAW: /* drain output, set */
case TIOCSETAF: { /* drn out, fls in, set */
- register struct termios *t = (struct termios *)data;
+ struct termios *t = (struct termios *)data;
s = spltty();
if (cmd == TIOCSETAW || cmd == TIOCSETAF) {
@@ -938,7 +926,7 @@ ttioctl(tp, cmd, data, flag, p)
break;
}
case TIOCSETD: { /* set line discipline */
- register int t = *(int *)data;
+ int t = *(int *)data;
dev_t device = tp->t_dev;
if ((u_int)t >= nlinesw)
@@ -997,7 +985,7 @@ ttioctl(tp, cmd, data, flag, p)
p->p_flag |= P_CONTROLT;
break;
case TIOCSPGRP: { /* set pgrp of tty */
- register struct pgrp *pgrp = pgfind(*(int *)data);
+ struct pgrp *pgrp = pgfind(*(int *)data);
if (!isctty(p, tp))
return (ENOTTY);
@@ -1029,10 +1017,7 @@ ttioctl(tp, cmd, data, flag, p)
}
int
-ttpoll(device, events, p)
- dev_t device;
- int events;
- struct proc *p;
+ttpoll(dev_t device, int events, struct proc *p)
{
struct tty *tp;
int revents, s;
@@ -1066,9 +1051,7 @@ struct filterops ttywrite_filtops =
{ 1, NULL, filt_ttywdetach, filt_ttywrite };
int
-ttkqfilter(dev, kn)
- dev_t dev;
- struct knote *kn;
+ttkqfilter(dev_t dev, struct knote *kn)
{
struct tty *tp = (*cdevsw[major(dev)].d_tty)(dev);
struct klist *klist;
@@ -1136,9 +1119,7 @@ filt_ttywdetach(struct knote *kn)
}
int
-filt_ttywrite(kn, hint)
- struct knote *kn;
- long hint;
+filt_ttywrite(struct knote *kn, long hint)
{
dev_t dev = (dev_t)((u_long)kn->kn_hook);
struct tty *tp = (*cdevsw[major(dev)].d_tty)(dev);
@@ -1148,8 +1129,7 @@ filt_ttywrite(kn, hint)
}
static int
-ttnread(tp)
- struct tty *tp;
+ttnread(struct tty *tp)
{
int nread;
@@ -1170,8 +1150,7 @@ ttnread(tp)
* Wait for output to drain.
*/
int
-ttywait(tp)
- register struct tty *tp;
+ttywait(struct tty *tp)
{
int error, s;
@@ -1199,8 +1178,7 @@ ttywait(tp)
* Flush if successfully wait.
*/
int
-ttywflush(tp)
- struct tty *tp;
+ttywflush(struct tty *tp)
{
int error;
@@ -1213,11 +1191,9 @@ ttywflush(tp)
* Flush tty read and/or write queues, notifying anyone waiting.
*/
void
-ttyflush(tp, rw)
- register struct tty *tp;
- int rw;
+ttyflush(struct tty *tp, int rw)
{
- register int s;
+ int s;
s = spltty();
if (rw & FREAD) {
@@ -1243,8 +1219,7 @@ ttyflush(tp, rw)
* Copy in the default termios characters.
*/
void
-ttychars(tp)
- struct tty *tp;
+ttychars(struct tty *tp)
{
bcopy(ttydefchars, tp->t_cc, sizeof(ttydefchars));
@@ -1254,10 +1229,9 @@ ttychars(tp)
* Send stop character on input overflow.
*/
static void
-ttyblock(tp)
- register struct tty *tp;
+ttyblock(struct tty *tp)
{
- register int total;
+ int total;
total = tp->t_rawq.c_cc + tp->t_canq.c_cc;
if (tp->t_rawq.c_cc > TTYHOG) {
@@ -1285,8 +1259,7 @@ ttyblock(tp)
}
void
-ttrstrt(tp_arg)
- void *tp_arg;
+ttrstrt(void *tp_arg)
{
struct tty *tp;
int s;
@@ -1305,8 +1278,7 @@ ttrstrt(tp_arg)
}
int
-ttstart(tp)
- struct tty *tp;
+ttstart(struct tty *tp)
{
if (tp->t_oproc != NULL) /* XXX: Kludge for pty. */
@@ -1318,9 +1290,7 @@ ttstart(tp)
* "close" a line discipline
*/
int
-ttylclose(tp, flag)
- struct tty *tp;
- int flag;
+ttylclose(struct tty *tp, int flag)
{
if (flag & FNONBLOCK)
@@ -1336,9 +1306,7 @@ ttylclose(tp, flag)
* Returns 0 if the line should be turned off, otherwise 1.
*/
int
-ttymodem(tp, flag)
- register struct tty *tp;
- int flag;
+ttymodem(struct tty *tp, int flag)
{
if (!ISSET(tp->t_state, TS_WOPEN) && ISSET(tp->t_cflag, MDMBUF)) {
@@ -1379,9 +1347,7 @@ ttymodem(tp, flag)
* Return argument flag, to turn off device on carrier drop.
*/
int
-nullmodem(tp, flag)
- register struct tty *tp;
- int flag;
+nullmodem(struct tty *tp, int flag)
{
if (flag)
@@ -1435,10 +1401,7 @@ ttvtimeout(void *arg)
* Process a read call on a tty device.
*/
int
-ttread(tp, uio, flag)
- register struct tty *tp;
- struct uio *uio;
- int flag;
+ttread(struct tty *tp, struct uio *uio, int flag)
{
struct timeout *stime = NULL;
struct proc *p = curproc;
@@ -1650,9 +1613,7 @@ ttyunblock(struct tty *tp)
* arrive.
*/
int
-ttycheckoutq(tp, wait)
- register struct tty *tp;
- int wait;
+ttycheckoutq(struct tty *tp, int wait)
{
int hiwat, s, oldsig;
@@ -1677,10 +1638,7 @@ ttycheckoutq(tp, wait)
* Process a write call on a tty device.
*/
int
-ttwrite(tp, uio, flag)
- struct tty *tp;
- struct uio *uio;
- int flag;
+ttwrite(struct tty *tp, struct uio *uio, int flag)
{
u_char *cp = NULL;
int cc, ce;
@@ -1861,12 +1819,10 @@ ovhiwat:
* as cleanly as possible.
*/
void
-ttyrub(c, tp)
- int c;
- register struct tty *tp;
+ttyrub(int c, struct tty *tp)
{
- register u_char *cp;
- register int savecol;
+ u_char *cp;
+ int savecol;
int tabc, s;
if (!ISSET(tp->t_lflag, ECHO) || ISSET(tp->t_lflag, EXTPROC))
@@ -1944,9 +1900,7 @@ ttyrub(c, tp)
* Back over cnt characters, erasing them.
*/
static void
-ttyrubo(tp, cnt)
- register struct tty *tp;
- int cnt;
+ttyrubo(struct tty *tp, int cnt)
{
while (cnt-- > 0) {
@@ -1962,10 +1916,9 @@ ttyrubo(tp, cnt)
* been checked.
*/
void
-ttyretype(tp)
- register struct tty *tp;
+ttyretype(struct tty *tp)
{
- register u_char *cp;
+ u_char *cp;
int s, c;
/* Echo the reprint character. */
@@ -1990,9 +1943,7 @@ ttyretype(tp)
* Echo a typed character to the terminal.
*/
static void
-ttyecho(c, tp)
- register int c;
- register struct tty *tp;
+ttyecho(int c, struct tty *tp)
{
if (!ISSET(tp->t_state, TS_CNTTB))
@@ -2018,8 +1969,7 @@ ttyecho(c, tp)
* Wake up any readers on a tty.
*/
void
-ttwakeup(tp)
- register struct tty *tp;
+ttwakeup(struct tty *tp)
{
selwakeup(&tp->t_rsel);
@@ -2034,9 +1984,7 @@ ttwakeup(tp)
* used by drivers to map software speed values to hardware parameters.
*/
int
-ttspeedtab(speed, table)
- int speed;
- const struct speedtab *table;
+ttspeedtab(int speed, const struct speedtab *table)
{
for ( ; table->sp_speed != -1; table++)
@@ -2052,10 +2000,9 @@ ttspeedtab(speed, table)
* from hi to low water.
*/
void
-ttsetwater(tp)
- struct tty *tp;
+ttsetwater(struct tty *tp)
{
- register int cps, x;
+ int cps, x;
#define CLAMP(x, h, l) ((x) > h ? h : ((x) < l) ? l : (x))
@@ -2071,10 +2018,9 @@ ttsetwater(tp)
* Report on state of foreground process group.
*/
void
-ttyinfo(tp)
- register struct tty *tp;
+ttyinfo(struct tty *tp)
{
- register struct proc *p, *pick;
+ struct proc *p, *pick;
struct timeval utime, stime;
int tmp;
@@ -2154,8 +2100,7 @@ ttyinfo(tp)
#define BOTH 3
static int
-proc_compare(p1, p2)
- register struct proc *p1, *p2;
+proc_compare(struct proc *p1, struct proc *p2)
{
if (p1 == NULL)
@@ -2210,11 +2155,9 @@ proc_compare(p1, p2)
* Output char to tty; console putchar style.
*/
int
-tputchar(c, tp)
- int c;
- struct tty *tp;
+tputchar(int c, struct tty *tp)
{
- register int s;
+ int s;
s = spltty();
if (ISSET(tp->t_state,
@@ -2237,11 +2180,7 @@ tputchar(c, tp)
* at the start of the call.
*/
int
-ttysleep(tp, chan, pri, wmesg, timo)
- struct tty *tp;
- void *chan;
- int pri, timo;
- char *wmesg;
+ttysleep(struct tty *tp, void *chan, int pri, char *wmesg, int timo)
{
int error;
short gen;
@@ -2256,7 +2195,7 @@ ttysleep(tp, chan, pri, wmesg, timo)
* Initialise the global tty list.
*/
void
-tty_init()
+tty_init(void)
{
TAILQ_INIT(&ttylist);
@@ -2268,7 +2207,7 @@ tty_init()
* tty list.
*/
struct tty *
-ttymalloc()
+ttymalloc(void)
{
struct tty *tp;
@@ -2292,8 +2231,7 @@ ttymalloc()
* Free a tty structure and its buffers, after removing it from the tty list.
*/
void
-ttyfree(tp)
- struct tty *tp;
+ttyfree(struct tty *tp)
{
--tty_count;
@@ -2343,13 +2281,8 @@ ttystats_init(void)
* Return tty-related information.
*/
int
-sysctl_tty(name, namelen, oldp, oldlenp, newp, newlen)
- int *name;
- u_int namelen;
- void *oldp;
- size_t *oldlenp;
- void *newp;
- size_t newlen;
+sysctl_tty(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
+ size_t newlen)
{
int err;
diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c
index 229a357224b..e5ab5c36215 100644
--- a/sys/kern/tty_conf.c
+++ b/sys/kern/tty_conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_conf.c,v 1.8 2003/06/02 23:28:06 millert Exp $ */
+/* $OpenBSD: tty_conf.c,v 1.9 2005/12/21 12:43:49 jsg Exp $ */
/* $NetBSD: tty_conf.c,v 1.18 1996/05/19 17:17:55 jonathan Exp $ */
/*-
@@ -151,12 +151,7 @@ int nlinesw = sizeof (linesw) / sizeof (linesw[0]);
*/
/*ARGSUSED*/
int
-nullioctl(tp, cmd, data, flags, p)
- struct tty *tp;
- u_long cmd;
- char *data;
- int flags;
- struct proc *p;
+nullioctl(struct tty *tp, u_long cmd, char *data, int flags, struct proc *p)
{
#ifdef lint
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 73d5f7c60c1..b095cbe2a44 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.30 2005/11/21 01:16:02 millert Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.31 2005/12/21 12:43:49 jsg Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -233,13 +233,10 @@ ptyattach(int n)
/*ARGSUSED*/
int
-ptsopen(dev, flag, devtype, p)
- dev_t dev;
- int flag, devtype;
- struct proc *p;
+ptsopen(dev_t dev, int flag, int devtype, struct proc *p)
{
struct pt_softc *pti;
- register struct tty *tp;
+ struct tty *tp;
int error;
if ((error = check_pty(minor(dev))))
@@ -278,13 +275,10 @@ ptsopen(dev, flag, devtype, p)
}
int
-ptsclose(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
+ptsclose(dev_t dev, int flag, int mode, struct proc *p)
{
- register struct pt_softc *pti = pt_softc[minor(dev)];
- register struct tty *tp = pti->pt_tty;
+ struct pt_softc *pti = pt_softc[minor(dev)];
+ struct tty *tp = pti->pt_tty;
int error;
error = (*linesw[tp->t_line].l_close)(tp, flag);
@@ -294,14 +288,11 @@ ptsclose(dev, flag, mode, p)
}
int
-ptsread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
+ptsread(dev_t dev, struct uio *uio, int flag)
{
struct proc *p = curproc;
- register struct pt_softc *pti = pt_softc[minor(dev)];
- register struct tty *tp = pti->pt_tty;
+ struct pt_softc *pti = pt_softc[minor(dev)];
+ struct tty *tp = pti->pt_tty;
int error = 0;
again:
@@ -349,13 +340,10 @@ again:
* indirectly, when tty driver calls ptsstart.
*/
int
-ptswrite(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
+ptswrite(dev_t dev, struct uio *uio, int flag)
{
- register struct pt_softc *pti = pt_softc[minor(dev)];
- register struct tty *tp = pti->pt_tty;
+ struct pt_softc *pti = pt_softc[minor(dev)];
+ struct tty *tp = pti->pt_tty;
if (tp->t_oproc == 0)
return (EIO);
@@ -367,10 +355,9 @@ ptswrite(dev, uio, flag)
* Wake up process polling or sleeping for input from controlling tty.
*/
void
-ptsstart(tp)
- struct tty *tp;
+ptsstart(struct tty *tp)
{
- register struct pt_softc *pti = pt_softc[minor(tp->t_dev)];
+ struct pt_softc *pti = pt_softc[minor(tp->t_dev)];
if (tp->t_state & TS_TTSTOP)
return;
@@ -382,9 +369,7 @@ ptsstart(tp)
}
int
-ptsstop(tp, flush)
- register struct tty *tp;
- int flush;
+ptsstop(struct tty *tp, int flush)
{
struct pt_softc *pti = pt_softc[minor(tp->t_dev)];
int flag;
@@ -407,9 +392,7 @@ ptsstop(tp, flush)
}
void
-ptcwakeup(tp, flag)
- struct tty *tp;
- int flag;
+ptcwakeup(struct tty *tp, int flag)
{
struct pt_softc *pti = pt_softc[minor(tp->t_dev)];
@@ -429,13 +412,10 @@ int ptcopen(dev_t, int, int, struct proc *);
/*ARGSUSED*/
int
-ptcopen(dev, flag, devtype, p)
- dev_t dev;
- int flag, devtype;
- struct proc *p;
+ptcopen(dev_t dev, int flag, int devtype, struct proc *p)
{
struct pt_softc *pti;
- register struct tty *tp;
+ struct tty *tp;
int error;
if ((error = check_pty(minor(dev))))
@@ -459,13 +439,10 @@ ptcopen(dev, flag, devtype, p)
/*ARGSUSED*/
int
-ptcclose(dev, flag, devtype, p)
- dev_t dev;
- int flag, devtype;
- struct proc *p;
+ptcclose(dev_t dev, int flag, int devtype, struct proc *p)
{
- register struct pt_softc *pti = pt_softc[minor(dev)];
- register struct tty *tp = pti->pt_tty;
+ struct pt_softc *pti = pt_softc[minor(dev)];
+ struct tty *tp = pti->pt_tty;
(void)(*linesw[tp->t_line].l_modem)(tp, 0);
tp->t_state &= ~TS_CARR_ON;
@@ -474,13 +451,10 @@ ptcclose(dev, flag, devtype, p)
}
int
-ptcread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
+ptcread(dev_t dev, struct uio *uio, int flag)
{
- register struct pt_softc *pti = pt_softc[minor(dev)];
- register struct tty *tp = pti->pt_tty;
+ struct pt_softc *pti = pt_softc[minor(dev)];
+ struct tty *tp = pti->pt_tty;
char buf[BUFSIZ];
int error = 0, cc;
@@ -543,15 +517,12 @@ ptcread(dev, uio, flag)
int
-ptcwrite(dev, uio, flag)
- dev_t dev;
- register struct uio *uio;
- int flag;
+ptcwrite(dev_t dev, struct uio *uio, int flag)
{
- register struct pt_softc *pti = pt_softc[minor(dev)];
- register struct tty *tp = pti->pt_tty;
- register u_char *cp = NULL;
- register int cc = 0;
+ struct pt_softc *pti = pt_softc[minor(dev)];
+ struct tty *tp = pti->pt_tty;
+ u_char *cp = NULL;
+ int cc = 0;
u_char locbuf[BUFSIZ];
int cnt = 0;
int error = 0;
@@ -777,27 +748,21 @@ ptckqfilter(dev_t dev, struct knote *kn)
}
struct tty *
-ptytty(dev)
- dev_t dev;
+ptytty(dev_t dev)
{
- register struct pt_softc *pti = pt_softc[minor(dev)];
- register struct tty *tp = pti->pt_tty;
+ struct pt_softc *pti = pt_softc[minor(dev)];
+ struct tty *tp = pti->pt_tty;
return (tp);
}
/*ARGSUSED*/
int
-ptyioctl(dev, cmd, data, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
+ptyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
- register struct pt_softc *pti = pt_softc[minor(dev)];
- register struct tty *tp = pti->pt_tty;
- register u_char *cc = tp->t_cc;
+ struct pt_softc *pti = pt_softc[minor(dev)];
+ struct tty *tp = pti->pt_tty;
+ u_char *cc = tp->t_cc;
int stop, error;
/*
diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c
index 111c71706fa..6ab18d8e19d 100644
--- a/sys/kern/tty_subr.c
+++ b/sys/kern/tty_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_subr.c,v 1.17 2003/06/02 04:00:16 deraadt Exp $ */
+/* $OpenBSD: tty_subr.c,v 1.18 2005/12/21 12:43:49 jsg Exp $ */
/* $NetBSD: tty_subr.c,v 1.13 1996/02/09 19:00:43 christos Exp $ */
/*
@@ -52,7 +52,7 @@ void clrbits(u_char *, int, int);
* Initialize clists.
*/
void
-cinit()
+cinit(void)
{
}
@@ -61,10 +61,7 @@ cinit()
* of the specified length, with/without quoting support.
*/
int
-clalloc(clp, size, quot)
- struct clist *clp;
- int size;
- int quot;
+clalloc(struct clist *clp, int size, int quot)
{
clp->c_cs = malloc(size, M_TTYS, M_WAITOK);
@@ -84,8 +81,7 @@ clalloc(clp, size, quot)
}
void
-clfree(clp)
- struct clist *clp;
+clfree(struct clist *clp)
{
if (clp->c_cs) {
bzero(clp->c_cs, clp->c_cn);
@@ -103,10 +99,9 @@ clfree(clp)
* Get a character from a clist.
*/
int
-getc(clp)
- struct clist *clp;
+getc(struct clist *clp)
{
- register int c = -1;
+ int c = -1;
int s;
s = spltty();
@@ -132,12 +127,9 @@ out:
* Return number of bytes moved.
*/
int
-q_to_b(clp, cp, count)
- struct clist *clp;
- u_char *cp;
- int count;
+q_to_b(struct clist *clp, u_char *cp, int count)
{
- register int cc;
+ int cc;
u_char *p = cp;
int s;
@@ -168,13 +160,11 @@ q_to_b(clp, cp, count)
* Stop counting if flag&character is non-null.
*/
int
-ndqb(clp, flag)
- struct clist *clp;
- int flag;
+ndqb(struct clist *clp, int flag)
{
int count = 0;
- register int i;
- register int cc;
+ int i;
+ int cc;
int s;
s = spltty();
@@ -212,11 +202,9 @@ out:
* Flush count bytes from clist.
*/
void
-ndflush(clp, count)
- struct clist *clp;
- int count;
+ndflush(struct clist *clp, int count)
{
- register int cc;
+ int cc;
int s;
s = spltty();
@@ -248,11 +236,9 @@ out:
* Put a character into the output queue.
*/
int
-putc(c, clp)
- int c;
- struct clist *clp;
+putc(int c, struct clist *clp)
{
- register int i;
+ int i;
int s;
s = spltty();
@@ -296,13 +282,10 @@ out:
* clrbit(cp, off + len);
*/
void
-clrbits(cp, off, len)
- u_char *cp;
- int off;
- int len;
+clrbits(u_char *cp, int off, int len)
{
int sby, sbi, eby, ebi;
- register int i;
+ int i;
u_char mask;
if (len==1) {
@@ -334,10 +317,7 @@ clrbits(cp, off, len)
* Return number of bytes not transferred.
*/
int
-b_to_q(cp, count, clp)
- u_char *cp;
- int count;
- struct clist *clp;
+b_to_q(u_char *cp, int count, struct clist *clp)
{
int cc;
u_char *p = cp;
@@ -395,10 +375,7 @@ static int cc;
* masked.
*/
u_char *
-nextc(clp, cp, c)
- struct clist *clp;
- register u_char *cp;
- int *c;
+nextc(struct clist *clp, u_char *cp, int *c)
{
if (clp->c_cf == cp) {
@@ -432,11 +409,9 @@ nextc(clp, cp, c)
* *c is set to the NEXT character
*/
u_char *
-firstc(clp, c)
- struct clist *clp;
- int *c;
+firstc(struct clist *clp, int *c)
{
- register u_char *cp;
+ u_char *cp;
cc = clp->c_cc;
if (cc == 0)
@@ -454,8 +429,7 @@ firstc(clp, c)
* Remove the last character in the clist and return it.
*/
int
-unputc(clp)
- struct clist *clp;
+unputc(struct clist *clp)
{
unsigned int c = -1;
int s;
@@ -486,8 +460,7 @@ out:
* Put the chars in the from queue on the end of the to queue.
*/
void
-catq(from, to)
- struct clist *from, *to;
+catq(struct clist *from, struct clist *to)
{
int c;
int s;
diff --git a/sys/kern/tty_tb.c b/sys/kern/tty_tb.c
index c87c94ed37d..8f66fab24c5 100644
--- a/sys/kern/tty_tb.c
+++ b/sys/kern/tty_tb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_tb.c,v 1.5 2003/08/11 09:56:49 mickey Exp $ */
+/* $OpenBSD: tty_tb.c,v 1.6 2005/12/21 12:43:49 jsg Exp $ */
/* $NetBSD: tty_tb.c,v 1.18 1996/02/04 02:17:36 christos Exp $ */
/*-
@@ -117,11 +117,9 @@ void tbattach(int);
*/
/*ARGSUSED*/
int
-tbopen(dev, tp)
- dev_t dev;
- register struct tty *tp;
+tbopen(dev_t dev, struct tty *tp)
{
- register struct tb *tbp;
+ struct tb *tbp;
if (tp->t_line == TABLDISC)
return (ENODEV);
@@ -144,8 +142,7 @@ tbopen(dev, tp)
* Line discipline change or last device close.
*/
void
-tbclose(tp)
- register struct tty *tp;
+tbclose(struct tty *tp)
{
int modebits = TBPOINT|TBSTOP;
@@ -157,9 +154,7 @@ tbclose(tp)
* Characters have been buffered in a buffer and decoded.
*/
int
-tbread(tp, uio)
- register struct tty *tp;
- struct uio *uio;
+tbread(struct tty *tp, struct uio *uio)
{
struct tb *tbp = (struct tb *)tp->t_sc;
const struct tbconf *tc = &tbconf[tbp->tbflags & TBTYPE];
@@ -182,9 +177,7 @@ tbread(tp, uio)
* interrupt routine to make it run as fast as possible.
*/
void
-tbinput(c, tp)
- register int c;
- register struct tty *tp;
+tbinput(int c, struct tty *tp)
{
struct tb *tbp = (struct tb *)tp->t_sc;
const struct tbconf *tc = &tbconf[tbp->tbflags & TBTYPE];
@@ -210,10 +203,7 @@ tbinput(c, tp)
* Decode GTCO 8 byte format (high res, tilt, and pressure).
*/
static void
-gtcodecode(tc, cp, u)
- const struct tbconf *tc;
- register char *cp;
- register union tbpos *u;
+gtcodecode(const struct tbconf *tc, char *cp, union tbpos *u)
{
struct gtcopos *pos = &u->gtcopos;
pos->pressure = *cp >> 2;
@@ -233,13 +223,10 @@ gtcodecode(tc, cp, u)
* Decode old Hitachi 5 byte format (low res).
*/
static void
-tbolddecode(tc, cp, u)
- const struct tbconf *tc;
- register char *cp;
- register union tbpos *u;
+tbolddecode(const struct tbconf *tc, char *cp, union tbpos *u)
{
struct hitpos *pos = &u->hitpos;
- register char byte;
+ char byte;
byte = *cp++;
pos->status = (byte&0100) ? TBINPROX : 0;
@@ -259,10 +246,7 @@ tbolddecode(tc, cp, u)
* Decode new Hitach 5-byte format (low res).
*/
static void
-tblresdecode(tc, cp, u)
- const struct tbconf *tc;
- register char *cp;
- register union tbpos *u;
+tblresdecode(const struct tbconf *tc, char *cp, union tbpos *u)
{
struct hitpos *pos = &u->hitpos;
@@ -281,10 +265,7 @@ tblresdecode(tc, cp, u)
* Decode new Hitach 6-byte format (high res).
*/
static void
-tbhresdecode(tc, cp, u)
- const struct tbconf *tc;
- register char *cp;
- register union tbpos *u;
+tbhresdecode(const struct tbconf *tc, char *cp, union tbpos *u)
{
struct hitpos *pos = &u->hitpos;
char byte;
@@ -306,10 +287,7 @@ tbhresdecode(tc, cp, u)
* Polhemus decode.
*/
static void
-poldecode(tc, cp, u)
- const struct tbconf *tc;
- register char *cp;
- register union tbpos *u;
+poldecode(const struct tbconf *tc, char *cp, union tbpos *u)
{
struct polpos *pos = &u->polpos;
@@ -326,14 +304,9 @@ poldecode(tc, cp, u)
/*ARGSUSED*/
int
-tbtioctl(tp, cmd, data, flag, p)
- struct tty *tp;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
+tbtioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
{
- register struct tb *tbp = (struct tb *)tp->t_sc;
+ struct tb *tbp = (struct tb *)tp->t_sc;
switch (cmd) {
@@ -391,8 +364,7 @@ tbtioctl(tp, cmd, data, flag, p)
}
void
-tbattach(dummy)
- int dummy;
+tbattach(int dummy)
{
/* stub to handle side effect of new config */
}
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index 2c6ea90231b..8723c197c41 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_tty.c,v 1.8 2003/09/23 16:51:12 millert Exp $ */
+/* $OpenBSD: tty_tty.c,v 1.9 2005/12/21 12:43:49 jsg Exp $ */
/* $NetBSD: tty_tty.c,v 1.13 1996/03/30 22:24:46 christos Exp $ */
/*-
@@ -49,10 +49,7 @@
/*ARGSUSED*/
int
-cttyopen(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
+cttyopen(dev_t dev, int flag, int mode, struct proc *p)
{
struct vnode *ttyvp = cttyvp(p);
int error;
@@ -80,13 +77,10 @@ cttyopen(dev, flag, mode, p)
/*ARGSUSED*/
int
-cttyread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
+cttyread(dev_t dev, struct uio *uio, int flag)
{
struct proc *p = uio->uio_procp;
- register struct vnode *ttyvp = cttyvp(uio->uio_procp);
+ struct vnode *ttyvp = cttyvp(uio->uio_procp);
int error;
if (ttyvp == NULL)
@@ -99,13 +93,10 @@ cttyread(dev, uio, flag)
/*ARGSUSED*/
int
-cttywrite(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
+cttywrite(dev_t dev, struct uio *uio, int flag)
{
struct proc *p = uio->uio_procp;
- register struct vnode *ttyvp = cttyvp(uio->uio_procp);
+ struct vnode *ttyvp = cttyvp(uio->uio_procp);
int error;
if (ttyvp == NULL)
@@ -118,12 +109,7 @@ cttywrite(dev, uio, flag)
/*ARGSUSED*/
int
-cttyioctl(dev, cmd, addr, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t addr;
- int flag;
- struct proc *p;
+cttyioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
{
struct vnode *ttyvp = cttyvp(p);
@@ -143,10 +129,7 @@ cttyioctl(dev, cmd, addr, flag, p)
/*ARGSUSED*/
int
-cttypoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
+cttypoll(dev_t dev, int events, struct proc *p)
{
struct vnode *ttyvp = cttyvp(p);