diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2006-01-05 05:05:08 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2006-01-05 05:05:08 +0000 |
commit | 5b2a424ce2d437402a1b7084e2b02add0c5a4f5e (patch) | |
tree | 28ec0d92af9a3ffccfab92949cfa37f73c449202 /sys | |
parent | d194f3ac9d286cf4cd191f67cfec096043ff8038 (diff) |
ansi/deregister
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 140 | ||||
-rw-r--r-- | sys/kern/uipc_mbuf2.c | 59 | ||||
-rw-r--r-- | sys/kern/uipc_socket.c | 88 | ||||
-rw-r--r-- | sys/kern/uipc_socket2.c | 56 | ||||
-rw-r--r-- | sys/kern/uipc_syscalls.c | 125 | ||||
-rw-r--r-- | sys/kern/uipc_usrreq.c | 91 |
6 files changed, 171 insertions, 388 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 31a281a8e87..9f3d7dba3a7 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.71 2005/12/31 19:18:05 krw Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.72 2006/01/05 05:05:06 jsg Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -110,7 +110,7 @@ const char *mclpool_warnmsg = * Initialize the mbuf allcator. */ void -mbinit() +mbinit(void) { pool_init(&mbpool, MSIZE, 0, 0, 0, "mbpl", NULL); pool_init(&mclpool, MCLBYTES, 0, 0, 0, "mclpl", NULL); @@ -144,8 +144,8 @@ nmbclust_update(void) void m_reclaim(void *arg, int flags) { - register struct domain *dp; - register struct protosw *pr; + struct domain *dp; + struct protosw *pr; int s = splimp(); for (dp = domains; dp; dp = dp->dom_next) @@ -162,30 +162,27 @@ m_reclaim(void *arg, int flags) * for critical paths. */ struct mbuf * -m_get(nowait, type) - int nowait, type; +m_get(int nowait, int type) { - register struct mbuf *m; + struct mbuf *m; MGET(m, nowait, type); return (m); } struct mbuf * -m_gethdr(nowait, type) - int nowait, type; +m_gethdr(int nowait, int type) { - register struct mbuf *m; + struct mbuf *m; MGETHDR(m, nowait, type); return (m); } struct mbuf * -m_getclr(nowait, type) - int nowait, type; +m_getclr(int nowait, int type) { - register struct mbuf *m; + struct mbuf *m; MGET(m, nowait, type); if (m == NULL) @@ -195,20 +192,18 @@ m_getclr(nowait, type) } struct mbuf * -m_free(m) - struct mbuf *m; +m_free(struct mbuf *m) { - register struct mbuf *n; + struct mbuf *n; MFREE(m, n); return (n); } void -m_freem(m) - register struct mbuf *m; +m_freem(struct mbuf *m) { - register struct mbuf *n; + struct mbuf *n; if (m == NULL) return; @@ -227,9 +222,7 @@ m_freem(m) * copy junk along. */ struct mbuf * -m_prepend(m, len, how) - register struct mbuf *m; - int len, how; +m_prepend(struct mbuf *m, int len, int how) { struct mbuf *mn; @@ -256,10 +249,7 @@ m_prepend(m, len, how) int MCFail; struct mbuf * -m_copym(m, off0, len, wait) - struct mbuf *m; - int off0, wait; - int len; +m_copym(struct mbuf *m, int off0, int len, int wait) { return m_copym0(m, off0, len, wait, 0); /* shallow copy on M_EXT */ } @@ -269,20 +259,13 @@ m_copym(m, off0, len, wait) * of merely bumping the reference count. */ struct mbuf * -m_copym2(m, off0, len, wait) - struct mbuf *m; - int off0, wait; - int len; +m_copym2(struct mbuf *m, int off0, int len, int wait) { return m_copym0(m, off0, len, wait, 1); /* deep copy */ } struct mbuf * -m_copym0(m, off0, len, wait, deep) - struct mbuf *m; - int off0, wait; - int len; - int deep; /* deep copy */ +m_copym0(struct mbuf *m, int off0, int len, int wait, int deep) { struct mbuf *n, **np; int off = off0; @@ -370,13 +353,9 @@ nospace: * continuing for "len" bytes, into the indicated buffer. */ void -m_copydata(m, off, len, cp) - register struct mbuf *m; - register int off; - register int len; - caddr_t cp; +m_copydata(struct mbuf *m, int off, int len, caddr_t cp) { - register unsigned count; + unsigned count; if (off < 0) panic("m_copydata: off %d < 0", off); @@ -409,14 +388,10 @@ m_copydata(m, off, len, cp) * including the setting of m_len. */ void -m_copyback(m0, off, len, cp) - struct mbuf *m0; - register int off; - register int len; - const void *cp; +m_copyback(struct mbuf *m0, int off, int len, const void *cp) { - register int mlen; - register struct mbuf *m = m0, *n; + int mlen; + struct mbuf *m = m0, *n; int totlen = 0; if (m0 == NULL) @@ -462,8 +437,7 @@ out: if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen)) * Any m_pkthdr is not updated. */ void -m_cat(m, n) - register struct mbuf *m, *n; +m_cat(struct mbuf *m, struct mbuf *n) { while (m->m_next) m = m->m_next; @@ -483,13 +457,11 @@ m_cat(m, n) } void -m_adj(mp, req_len) - struct mbuf *mp; - int req_len; +m_adj(struct mbuf *mp, int req_len) { - register int len = req_len; - register struct mbuf *m; - register int count; + int len = req_len; + struct mbuf *m; + int count; if ((m = mp) == NULL) return; @@ -567,12 +539,10 @@ m_adj(mp, req_len) int MPFail; struct mbuf * -m_pullup(n, len) - register struct mbuf *n; - int len; +m_pullup(struct mbuf *n, int len) { - register struct mbuf *m; - register int count; + struct mbuf *m; + int count; int space; /* @@ -632,10 +602,8 @@ bad: * * KEBE SAYS: Remember that dtom() calls with data in clusters does not work! */ -struct mbuf * -m_pullup2(n, len) - struct mbuf *n; - int len; +struct mbuf * +m_pullup2(struct mbuf *n, int len) { struct mbuf *m; int count; @@ -698,10 +666,7 @@ bad: * Return a pointer to mbuf/offset of location in mbuf chain. */ struct mbuf * -m_getptr(m, loc, off) - struct mbuf *m; - int loc; - int *off; +m_getptr(struct mbuf *m, int loc, int *off) { while (loc >= 0) { /* Normal end of search */ @@ -739,11 +704,9 @@ m_getptr(m, loc, off) * XXX It is assumed that siz is less than the size of an mbuf at the moment. */ struct mbuf * -m_inject(m0, len0, siz, wait) - register struct mbuf *m0; - int len0, siz, wait; +m_inject(struct mbuf *m0, int len0, int siz, int wait) { - register struct mbuf *m, *n, *n2 = NULL, *n3; + struct mbuf *m, *n, *n2 = NULL, *n3; unsigned len = len0, remain; if ((siz >= MHLEN) || (len0 <= 0)) @@ -797,11 +760,9 @@ m_inject(m0, len0, siz, wait) * attempts to restore the chain to its original state. */ struct mbuf * -m_split(m0, len0, wait) - register struct mbuf *m0; - int len0, wait; +m_split(struct mbuf *m0, int len0, int wait) { - register struct mbuf *m, *n; + struct mbuf *m, *n; unsigned len = len0, remain, olen; for (m = m0; m && len > m->m_len; m = m->m_next) @@ -860,16 +821,13 @@ extpacket: * Routine to copy from device local memory into mbufs. */ struct mbuf * -m_devget(buf, totlen, off0, ifp, copy) - char *buf; - int totlen, off0; - struct ifnet *ifp; - void (*copy)(const void *, void *, size_t); +m_devget(char *buf, int totlen, int off0, struct ifnet *ifp, + void (*copy)(const void *, void *, size_t)) { - register struct mbuf *m; + struct mbuf *m; struct mbuf *top = NULL, **mp = ⊤ - register int off = off0, len; - register char *cp; + int off = off0, len; + char *cp; char *epkt; cp = buf; @@ -932,8 +890,7 @@ m_devget(buf, totlen, off0, ifp, copy) } void -m_zero(m) - struct mbuf *m; +m_zero(struct mbuf *m) { while (m) { #ifdef DIAGNOSTIC @@ -957,13 +914,8 @@ m_zero(m) * beginning, continuing for "len" bytes. */ int -m_apply(m, off, len, f, fstate) - struct mbuf *m; - int off; - int len; - /* fstate, data, len */ - int (*f)(caddr_t, caddr_t, unsigned int); - caddr_t fstate; +m_apply(struct mbuf *m, int off, int len, + int (*f)(caddr_t, caddr_t, unsigned int), caddr_t fstate) { int rval; unsigned int count; diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c index 4dc69d117f3..ce757a5d8c1 100644 --- a/sys/kern/uipc_mbuf2.c +++ b/sys/kern/uipc_mbuf2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf2.c,v 1.22 2004/07/22 09:33:21 itojun Exp $ */ +/* $OpenBSD: uipc_mbuf2.c,v 1.23 2006/01/05 05:05:06 jsg Exp $ */ /* $KAME: uipc_mbuf2.c,v 1.29 2001/02/14 13:42:10 itojun Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */ @@ -82,10 +82,7 @@ static struct mbuf *m_dup1(struct mbuf *, int, int, int); * XXX M_TRAILINGSPACE/M_LEADINGSPACE on shared cluster (sharedcluster) */ struct mbuf * -m_pulldown(m, off, len, offp) - struct mbuf *m; - int off, len; - int *offp; +m_pulldown(struct mbuf *m, int off, int len, int *offp) { struct mbuf *n, *o; int hlen, tlen, olen; @@ -225,11 +222,7 @@ ok: } static struct mbuf * -m_dup1(m, off, len, wait) - struct mbuf *m; - int off; - int len; - int wait; +m_dup1(struct mbuf *m, int off, int len, int wait) { struct mbuf *n; int l; @@ -266,10 +259,7 @@ m_dup1(m, off, len, wait) /* Get a packet tag structure along with specified data following. */ struct m_tag * -m_tag_get(type, len, wait) - int type; - int len; - int wait; +m_tag_get(int type, int len, int wait) { struct m_tag *t; @@ -285,35 +275,28 @@ m_tag_get(type, len, wait) /* Free a packet tag. */ void -m_tag_free(t) - struct m_tag *t; +m_tag_free(struct m_tag *t) { free(t, M_PACKET_TAGS); } /* Prepend a packet tag. */ void -m_tag_prepend(m, t) - struct mbuf *m; - struct m_tag *t; +m_tag_prepend(struct mbuf *m, struct m_tag *t) { SLIST_INSERT_HEAD(&m->m_pkthdr.tags, t, m_tag_link); } /* Unlink a packet tag. */ void -m_tag_unlink(m, t) - struct mbuf *m; - struct m_tag *t; +m_tag_unlink(struct mbuf *m, struct m_tag *t) { SLIST_REMOVE(&m->m_pkthdr.tags, t, m_tag, m_tag_link); } /* Unlink and free a packet tag. */ void -m_tag_delete(m, t) - struct mbuf *m; - struct m_tag *t; +m_tag_delete(struct mbuf *m, struct m_tag *t) { m_tag_unlink(m, t); m_tag_free(t); @@ -321,9 +304,7 @@ m_tag_delete(m, t) /* Unlink and free a packet tag chain, starting from given tag. */ void -m_tag_delete_chain(m, t) - struct mbuf *m; - struct m_tag *t; +m_tag_delete_chain(struct mbuf *m, struct m_tag *t) { struct m_tag *p, *q; @@ -340,10 +321,7 @@ m_tag_delete_chain(m, t) /* Find a tag, starting from a given position. */ struct m_tag * -m_tag_find(m, type, t) - struct mbuf *m; - int type; - struct m_tag *t; +m_tag_find(struct mbuf *m, int type, struct m_tag *t) { struct m_tag *p; @@ -361,8 +339,7 @@ m_tag_find(m, type, t) /* Copy a single tag. */ struct m_tag * -m_tag_copy(t) - struct m_tag *t; +m_tag_copy(struct m_tag *t) { struct m_tag *p; @@ -380,9 +357,7 @@ m_tag_copy(t) * destination mbuf. */ int -m_tag_copy_chain(to, from) - struct mbuf *to; - struct mbuf *from; +m_tag_copy_chain(struct mbuf *to, struct mbuf *from) { struct m_tag *p, *t, *tprev = NULL; @@ -404,25 +379,21 @@ m_tag_copy_chain(to, from) /* Initialize tags on an mbuf. */ void -m_tag_init(m) - struct mbuf *m; +m_tag_init(struct mbuf *m) { SLIST_INIT(&m->m_pkthdr.tags); } /* Get first tag in chain. */ struct m_tag * -m_tag_first(m) - struct mbuf *m; +m_tag_first(struct mbuf *m) { return (SLIST_FIRST(&m->m_pkthdr.tags)); } /* Get next tag in chain. */ struct m_tag * -m_tag_next(m, t) - struct mbuf *m; - struct m_tag *t; +m_tag_next(struct mbuf *m, struct m_tag *t) { return (SLIST_NEXT(t, m_tag_link)); } diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index f022c752103..6b0a5d685c9 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.61 2005/09/16 16:44:43 deraadt Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.62 2006/01/05 05:05:06 jsg Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -87,11 +87,7 @@ soinit(void) */ /*ARGSUSED*/ int -socreate(dom, aso, type, proto) - int dom; - struct socket **aso; - register int type; - int proto; +socreate(int dom, struct socket **aso, int type, int proto) { struct proc *p = curproc; /* XXX */ struct protosw *prp; @@ -141,9 +137,7 @@ socreate(dom, aso, type, proto) } int -sobind(so, nam) - struct socket *so; - struct mbuf *nam; +sobind(struct socket *so, struct mbuf *nam) { int s = splsoftnet(); int error; @@ -154,9 +148,7 @@ sobind(so, nam) } int -solisten(so, backlog) - register struct socket *so; - int backlog; +solisten(struct socket *so, int backlog) { int s = splsoftnet(), error; @@ -207,8 +199,7 @@ sofree(struct socket *so) * Free socket when disconnect complete. */ int -soclose(so) - register struct socket *so; +soclose(struct socket *so) { struct socket *so2; int s = splsoftnet(); /* conservative */ @@ -273,9 +264,7 @@ soabort(struct socket *so) } int -soaccept(so, nam) - register struct socket *so; - struct mbuf *nam; +soaccept(struct socket *so, struct mbuf *nam) { int s = splsoftnet(); int error = 0; @@ -294,9 +283,7 @@ soaccept(so, nam) } int -soconnect(so, nam) - register struct socket *so; - struct mbuf *nam; +soconnect(struct socket *so, struct mbuf *nam) { int s; int error; @@ -322,9 +309,7 @@ soconnect(so, nam) } int -soconnect2(so1, so2) - register struct socket *so1; - struct socket *so2; +soconnect2(struct socket *so1, struct socket *so2) { int s = splsoftnet(); int error; @@ -336,8 +321,7 @@ soconnect2(so1, so2) } int -sodisconnect(so) - register struct socket *so; +sodisconnect(struct socket *so) { int s = splsoftnet(); int error; @@ -376,13 +360,8 @@ bad: * Data and control buffers are freed on return. */ int -sosend(so, addr, uio, top, control, flags) - register struct socket *so; - struct mbuf *addr; - struct uio *uio; - struct mbuf *top; - struct mbuf *control; - int flags; +sosend(struct socket *so, struct mbuf *addr, struct uio *uio, struct mbuf *top, + struct mbuf *control, int flags) { struct mbuf **mp; struct mbuf *m; @@ -563,16 +542,11 @@ out: * only for the count in uio_resid. */ int -soreceive(so, paddr, uio, mp0, controlp, flagsp) - register struct socket *so; - struct mbuf **paddr; - struct uio *uio; - struct mbuf **mp0; - struct mbuf **controlp; - int *flagsp; +soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio, + struct mbuf **mp0, struct mbuf **controlp, int *flagsp) { - register struct mbuf *m, **mp; - register int flags, len, error, s, offset; + struct mbuf *m, **mp; + int flags, len, error, s, offset; struct protosw *pr = so->so_proto; struct mbuf *nextrecord; int moff, type = 0; @@ -949,11 +923,9 @@ release: } int -soshutdown(so, how) - register struct socket *so; - register int how; +soshutdown(struct socket *so, int how) { - register struct protosw *pr = so->so_proto; + struct protosw *pr = so->so_proto; switch (how) { case SHUT_RD: @@ -970,12 +942,11 @@ soshutdown(so, how) } void -sorflush(so) - register struct socket *so; +sorflush(struct socket *so) { - register struct sockbuf *sb = &so->so_rcv; - register struct protosw *pr = so->so_proto; - register int s; + struct sockbuf *sb = &so->so_rcv; + struct protosw *pr = so->so_proto; + int s; struct sockbuf asb; sb->sb_flags |= SB_NOINTR; @@ -997,13 +968,10 @@ sorflush(so) } int -sosetopt(so, level, optname, m0) - register struct socket *so; - int level, optname; - struct mbuf *m0; +sosetopt(struct socket *so, int level, int optname, struct mbuf *m0) { int error = 0; - register struct mbuf *m = m0; + struct mbuf *m = m0; if (level != SOL_SOCKET) { if (so->so_proto && so->so_proto->pr_ctloutput) @@ -1136,12 +1104,9 @@ bad: } int -sogetopt(so, level, optname, mp) - register struct socket *so; - int level, optname; - struct mbuf **mp; +sogetopt(struct socket *so, int level, int optname, struct mbuf **mp) { - register struct mbuf *m; + struct mbuf *m; if (level != SOL_SOCKET) { if (so->so_proto && so->so_proto->pr_ctloutput) { @@ -1222,8 +1187,7 @@ sogetopt(so, level, optname, mp) } void -sohasoutofband(so) - register struct socket *so; +sohasoutofband(struct socket *so) { csignal(so->so_pgid, SIGURG, so->so_siguid, so->so_sigeuid); selwakeup(&so->so_rcv.sb_sel); diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index b38ff081d2b..b72b5ca7d43 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.40 2005/07/18 02:43:27 fgsch Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.41 2006/01/05 05:05:07 jsg Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -88,8 +88,7 @@ u_long sb_max = SB_MAX; /* patchable */ */ void -soisconnecting(so) - register struct socket *so; +soisconnecting(struct socket *so) { so->so_state &= ~(SS_ISCONNECTED|SS_ISDISCONNECTING); @@ -97,10 +96,9 @@ soisconnecting(so) } void -soisconnected(so) - register struct socket *so; +soisconnected(struct socket *so) { - register struct socket *head = so->so_head; + struct socket *head = so->so_head; so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING); so->so_state |= SS_ISCONNECTED; @@ -116,8 +114,7 @@ soisconnected(so) } void -soisdisconnecting(so) - register struct socket *so; +soisdisconnecting(struct socket *so) { so->so_state &= ~SS_ISCONNECTING; @@ -128,8 +125,7 @@ soisdisconnecting(so) } void -soisdisconnected(so) - register struct socket *so; +soisdisconnected(struct socket *so) { so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); @@ -261,8 +257,7 @@ soqremque(struct socket *so, int q) */ void -socantsendmore(so) - struct socket *so; +socantsendmore(struct socket *so) { so->so_state |= SS_CANTSENDMORE; @@ -270,8 +265,7 @@ socantsendmore(so) } void -socantrcvmore(so) - struct socket *so; +socantrcvmore(struct socket *so) { so->so_state |= SS_CANTRCVMORE; @@ -282,8 +276,7 @@ socantrcvmore(so) * Wait for data to arrive at/drain from a socket buffer. */ int -sbwait(sb) - struct sockbuf *sb; +sbwait(struct sockbuf *sb) { sb->sb_flags |= SB_WAIT; @@ -297,8 +290,7 @@ sbwait(sb) * return any error returned from sleep (EINTR). */ int -sb_lock(sb) - register struct sockbuf *sb; +sb_lock(struct sockbuf *sb) { int error; @@ -320,9 +312,7 @@ sb_lock(sb) * if the socket has the SS_ASYNC flag set. */ void -sowakeup(so, sb) - register struct socket *so; - register struct sockbuf *sb; +sowakeup(struct socket *so, struct sockbuf *sb) { selwakeup(&sb->sb_sel); sb->sb_flags &= ~SB_SEL; @@ -368,9 +358,7 @@ sowakeup(so, sb) */ int -soreserve(so, sndcc, rcvcc) - register struct socket *so; - u_long sndcc, rcvcc; +soreserve(struct socket *so, u_long sndcc, u_long rcvcc) { if (sbreserve(&so->so_snd, sndcc) == 0) @@ -396,9 +384,7 @@ bad: * if buffering efficiency is near the normal case. */ int -sbreserve(sb, cc) - struct sockbuf *sb; - u_long cc; +sbreserve(struct sockbuf *sb, u_long cc) { if (cc == 0 || cc > sb_max) @@ -427,8 +413,7 @@ sbcheckreserve(u_long cnt, u_long defcnt) * Free mbufs held by a socket, and reserved mbuf space. */ void -sbrelease(sb) - struct sockbuf *sb; +sbrelease(struct sockbuf *sb) { sbflush(sb); @@ -522,11 +507,9 @@ do { \ * discarded and mbufs are compacted where possible. */ void -sbappend(sb, m) - struct sockbuf *sb; - struct mbuf *m; +sbappend(struct sockbuf *sb, struct mbuf *m) { - register struct mbuf *n; + struct mbuf *n; if (m == NULL) return; @@ -916,12 +899,9 @@ sbdroprecord(struct sockbuf *sb) * with the specified type for presentation on a socket buffer. */ struct mbuf * -sbcreatecontrol(p, size, type, level) - caddr_t p; - register int size; - int type, level; +sbcreatecontrol(caddr_t p, int size, int type, int level) { - register struct cmsghdr *cp; + struct cmsghdr *cp; struct mbuf *m; if (CMSG_SPACE(size) > MCLBYTES) { diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index b4987772d50..f0379902744 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_syscalls.c,v 1.61 2005/07/06 20:41:44 krw Exp $ */ +/* $OpenBSD: uipc_syscalls.c,v 1.62 2006/01/05 05:05:07 jsg Exp $ */ /* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */ /* @@ -60,12 +60,9 @@ extern struct fileops socketops; int -sys_socket(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_socket(struct proc *p, void *v, register_t *retval) { - register struct sys_socket_args /* { + struct sys_socket_args /* { syscallarg(int) domain; syscallarg(int) type; syscallarg(int) protocol; @@ -99,12 +96,9 @@ out: /* ARGSUSED */ int -sys_bind(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_bind(struct proc *p, void *v, register_t *retval) { - register struct sys_bind_args /* { + struct sys_bind_args /* { syscallarg(int) s; syscallarg(const struct sockaddr *) name; syscallarg(socklen_t) namelen; @@ -127,12 +121,9 @@ sys_bind(p, v, retval) /* ARGSUSED */ int -sys_listen(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_listen(struct proc *p, void *v, register_t *retval) { - register struct sys_listen_args /* { + struct sys_listen_args /* { syscallarg(int) s; syscallarg(int) backlog; } */ *uap = v; @@ -147,10 +138,7 @@ sys_listen(p, v, retval) } int -sys_accept(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_accept(struct proc *p, void *v, register_t *retval) { struct sys_accept_args /* { syscallarg(int) s; @@ -262,10 +250,7 @@ bad: /* ARGSUSED */ int -sys_connect(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_connect(struct proc *p, void *v, register_t *retval) { struct sys_connect_args /* { syscallarg(int) s; @@ -319,18 +304,15 @@ bad: } int -sys_socketpair(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_socketpair(struct proc *p, void *v, register_t *retval) { - register struct sys_socketpair_args /* { + struct sys_socketpair_args /* { syscallarg(int) domain; syscallarg(int) type; syscallarg(int) protocol; syscallarg(int *) rsv; } */ *uap = v; - register struct filedesc *fdp = p->p_fd; + struct filedesc *fdp = p->p_fd; struct file *fp1, *fp2; struct socket *so1, *so2; int fd, error, sv[2]; @@ -394,12 +376,9 @@ free1: } int -sys_sendto(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_sendto(struct proc *p, void *v, register_t *retval) { - register struct sys_sendto_args /* { + struct sys_sendto_args /* { syscallarg(int) s; syscallarg(const void *) buf; syscallarg(size_t) len; @@ -424,12 +403,9 @@ sys_sendto(p, v, retval) } int -sys_sendmsg(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_sendmsg(struct proc *p, void *v, register_t *retval) { - register struct sys_sendmsg_args /* { + struct sys_sendmsg_args /* { syscallarg(int) s; syscallarg(const struct msghdr *) msg; syscallarg(int) flags; @@ -464,12 +440,7 @@ done: } int -sendit(p, s, mp, flags, retsize) - struct proc *p; - int s; - struct msghdr *mp; - int flags; - register_t *retsize; +sendit(struct proc *p, int s, struct msghdr *mp, int flags, register_t *retsize) { struct file *fp; struct uio auio; @@ -522,7 +493,7 @@ sendit(p, s, mp, flags, retsize) goto bad; #ifdef COMPAT_OLDSOCK if (mp->msg_flags == MSG_COMPAT) { - register struct cmsghdr *cm; + struct cmsghdr *cm; M_PREPEND(control, sizeof(*cm), M_WAIT); cm = mtod(control, struct cmsghdr *); @@ -568,12 +539,9 @@ bad: } int -sys_recvfrom(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_recvfrom(struct proc *p, void *v, register_t *retval) { - register struct sys_recvfrom_args /* { + struct sys_recvfrom_args /* { syscallarg(int) s; syscallarg(void *) buf; syscallarg(size_t) len; @@ -604,12 +572,9 @@ sys_recvfrom(p, v, retval) } int -sys_recvmsg(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_recvmsg(struct proc *p, void *v, register_t *retval) { - register struct sys_recvmsg_args /* { + struct sys_recvmsg_args /* { syscallarg(int) s; syscallarg(struct msghdr *) msg; syscallarg(int) flags; @@ -652,17 +617,13 @@ done: } int -recvit(p, s, mp, namelenp, retsize) - struct proc *p; - int s; - struct msghdr *mp; - caddr_t namelenp; - register_t *retsize; +recvit(struct proc *p, int s, struct msghdr *mp, caddr_t namelenp, + register_t *retsize) { struct file *fp; struct uio auio; - register struct iovec *iov; - register int i; + struct iovec *iov; + int i; size_t len; int error; struct mbuf *from = NULL, *control = NULL; @@ -806,10 +767,7 @@ out: /* ARGSUSED */ int -sys_shutdown(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_shutdown(struct proc *p, void *v, register_t *retval) { struct sys_shutdown_args /* { syscallarg(int) s; @@ -827,10 +785,7 @@ sys_shutdown(p, v, retval) /* ARGSUSED */ int -sys_setsockopt(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_setsockopt(struct proc *p, void *v, register_t *retval) { struct sys_setsockopt_args /* { syscallarg(int) s; @@ -881,10 +836,7 @@ bad: /* ARGSUSED */ int -sys_getsockopt(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_getsockopt(struct proc *p, void *v, register_t *retval) { struct sys_getsockopt_args /* { syscallarg(int) s; @@ -927,7 +879,7 @@ out: int sys_pipe(struct proc *p, void *v, register_t *retval) { - register struct sys_pipe_args /* { + struct sys_pipe_args /* { syscallarg(int *) fdp; } */ *uap = v; int error, fds[2]; @@ -954,10 +906,7 @@ sys_pipe(struct proc *p, void *v, register_t *retval) */ /* ARGSUSED */ int -sys_getsockname(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_getsockname(struct proc *p, void *v, register_t *retval) { struct sys_getsockname_args /* { syscallarg(int) fdes; @@ -998,10 +947,7 @@ bad: */ /* ARGSUSED */ int -sys_getpeername(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_getpeername(struct proc *p, void *v, register_t *retval) { struct sys_getpeername_args /* { syscallarg(int) fdes; @@ -1009,7 +955,7 @@ sys_getpeername(p, v, retval) syscallarg(socklen_t *) alen; } */ *uap = v; struct file *fp; - register struct socket *so; + struct socket *so; struct mbuf *m = NULL; socklen_t len; int error; @@ -1045,10 +991,7 @@ bad: */ /* ARGSUSED */ int -sys_getpeereid(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_getpeereid(struct proc *p, void *v, register_t *retval) { struct sys_getpeereid_args /* { syscallarg(int) fdes; diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index d3973fadb68..6fb5e6587e6 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_usrreq.c,v 1.29 2005/05/17 21:43:08 fgsch Exp $ */ +/* $OpenBSD: uipc_usrreq.c,v 1.30 2006/01/05 05:05:07 jsg Exp $ */ /* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */ /* @@ -61,14 +61,12 @@ ino_t unp_ino; /* prototype for fake inode numbers */ /*ARGSUSED*/ int -uipc_usrreq(so, req, m, nam, control) - struct socket *so; - int req; - struct mbuf *m, *nam, *control; +uipc_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, + struct mbuf *control) { struct unpcb *unp = sotounpcb(so); - register struct socket *so2; - register int error = 0; + struct socket *so2; + int error = 0; struct proc *p = curproc; /* XXX */ if (req == PRU_CONTROL) @@ -326,10 +324,9 @@ u_long unpdg_recvspace = 4*1024; int unp_rights; /* file descriptors in flight */ int -unp_attach(so) - struct socket *so; +unp_attach(struct socket *so) { - register struct unpcb *unp; + struct unpcb *unp; int error; if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { @@ -360,8 +357,7 @@ unp_attach(so) } void -unp_detach(unp) - register struct unpcb *unp; +unp_detach(struct unpcb *unp) { if (unp->unp_vnode) { @@ -392,13 +388,10 @@ unp_detach(unp) } int -unp_bind(unp, nam, p) - struct unpcb *unp; - struct mbuf *nam; - struct proc *p; +unp_bind(struct unpcb *unp, struct mbuf *nam, struct proc *p) { struct sockaddr_un *soun = mtod(nam, struct sockaddr_un *); - register struct vnode *vp; + struct vnode *vp; struct vattr vattr; int error, namelen; struct nameidata nd; @@ -441,14 +434,11 @@ unp_bind(unp, nam, p) } int -unp_connect(so, nam, p) - struct socket *so; - struct mbuf *nam; - struct proc *p; +unp_connect(struct socket *so, struct mbuf *nam, struct proc *p) { - register struct sockaddr_un *soun = mtod(nam, struct sockaddr_un *); - register struct vnode *vp; - register struct socket *so2, *so3; + struct sockaddr_un *soun = mtod(nam, struct sockaddr_un *); + struct vnode *vp; + struct socket *so2, *so3; struct unpcb *unp2, *unp3; int error; struct nameidata nd; @@ -500,12 +490,10 @@ bad: } int -unp_connect2(so, so2) - register struct socket *so; - register struct socket *so2; +unp_connect2(struct socket *so, struct socket *so2) { - register struct unpcb *unp = sotounpcb(so); - register struct unpcb *unp2; + struct unpcb *unp = sotounpcb(so); + struct unpcb *unp2; if (so2->so_type != so->so_type) return (EPROTOTYPE); @@ -532,10 +520,9 @@ unp_connect2(so, so2) } void -unp_disconnect(unp) - struct unpcb *unp; +unp_disconnect(struct unpcb *unp) { - register struct unpcb *unp2 = unp->unp_conn; + struct unpcb *unp2 = unp->unp_conn; if (unp2 == NULL) return; @@ -569,17 +556,14 @@ unp_disconnect(unp) } #ifdef notdef -unp_abort(unp) - struct unpcb *unp; +unp_abort(struct unpcb *unp) { - unp_detach(unp); } #endif void -unp_shutdown(unp) - struct unpcb *unp; +unp_shutdown(struct unpcb *unp) { struct socket *so; @@ -589,9 +573,7 @@ unp_shutdown(unp) } void -unp_drop(unp, errno) - struct unpcb *unp; - int errno; +unp_drop(struct unpcb *unp, int errno) { struct socket *so = unp->unp_socket; @@ -606,15 +588,14 @@ unp_drop(unp, errno) } #ifdef notdef -unp_drain() +unp_drain(void) { } #endif int -unp_externalize(rights) - struct mbuf *rights; +unp_externalize(struct mbuf *rights) { struct proc *p = curproc; /* XXX */ struct cmsghdr *cm = mtod(rights, struct cmsghdr *); @@ -732,9 +713,7 @@ restart: } int -unp_internalize(control, p) - struct mbuf *control; - struct proc *p; +unp_internalize(struct mbuf *control, struct proc *p) { struct filedesc *fdp = p->p_fd; struct cmsghdr *cm = mtod(control, struct cmsghdr *); @@ -809,10 +788,10 @@ int unp_defer, unp_gcing; extern struct domain unixdomain; void -unp_gc() +unp_gc(void) { - register struct file *fp, *nextfp; - register struct socket *so; + struct file *fp, *nextfp; + struct socket *so; struct file **extra_ref, **fpp; int nunref, i; @@ -924,8 +903,7 @@ unp_gc() } void -unp_dispose(m) - struct mbuf *m; +unp_dispose(struct mbuf *m) { if (m) @@ -933,10 +911,7 @@ unp_dispose(m) } void -unp_scan(m0, op, discard) - struct mbuf *m0; - void (*op)(struct file *); - int discard; +unp_scan(struct mbuf *m0, void (*op)(struct file *), int discard) { struct mbuf *m; struct file **rp, *fp; @@ -970,8 +945,7 @@ unp_scan(m0, op, discard) } void -unp_mark(fp) - struct file *fp; +unp_mark(struct file *fp) { if (fp == NULL) return; @@ -991,8 +965,7 @@ unp_mark(fp) } void -unp_discard(fp) - struct file *fp; +unp_discard(struct file *fp) { if (fp == NULL) |