From owner-p4-projects@FreeBSD.ORG Wed Jun 28 18:08:43 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A990E16A416; Wed, 28 Jun 2006 18:08:43 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57E7B16A407 for ; Wed, 28 Jun 2006 18:08:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84E5943EE9 for ; Wed, 28 Jun 2006 18:08:41 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5SI8fmP037662 for ; Wed, 28 Jun 2006 18:08:41 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5SI8fWk037659 for perforce@freebsd.org; Wed, 28 Jun 2006 18:08:41 GMT (envelope-from jhb@freebsd.org) Date: Wed, 28 Jun 2006 18:08:41 GMT Message-Id: <200606281808.k5SI8fWk037659@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 100220 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2006 18:08:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=100220 Change 100220 by jhb@jhb_mutex on 2006/06/28 18:07:51 Make kern_recvit() accept a separate uio_seg to specify where msg_name points to so ABIs can make that a kmem pointer rather than userland. Affected files ... .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#37 edit .. //depot/projects/smpng/sys/kern/uipc_syscalls.c#79 edit .. //depot/projects/smpng/sys/sys/syscallsubr.h#34 edit Differences ... ==== //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#37 (text+ko) ==== @@ -1009,7 +1009,8 @@ msg.msg_iov = iov; controlp = (msg.msg_control != NULL) ? &control : NULL; - error = kern_recvit(td, uap->s, &msg, NULL, UIO_USERSPACE, controlp); + error = kern_recvit(td, uap->s, &msg, NULL, UIO_USERSPACE, + UIO_USERSPACE, controlp); if (error == 0) { msg.msg_iov = uiov; @@ -1150,7 +1151,8 @@ msg.msg_control = 0; msg.msg_flags = uap->flags; error = kern_recvit(td, uap->s, &msg, - (void *)(uintptr_t)uap->fromlenaddr, UIO_USERSPACE, NULL); + (void *)(uintptr_t)uap->fromlenaddr, UIO_USERSPACE, UIO_USERSPACE, + NULL); return (error); } ==== //depot/projects/smpng/sys/kern/uipc_syscalls.c#79 (text+ko) ==== @@ -926,12 +926,12 @@ } int -kern_recvit(td, s, mp, namelenp, segflg, controlp) +kern_recvit(td, s, mp, namelenp, uioseg, fromseg, controlp) struct thread *td; int s; struct msghdr *mp; void *namelenp; - enum uio_seg segflg; + enum uio_seg uioseg, fromseg; struct mbuf **controlp; { struct uio auio; @@ -972,7 +972,7 @@ auio.uio_iov = mp->msg_iov; auio.uio_iovcnt = mp->msg_iovlen; - auio.uio_segflg = segflg; + auio.uio_segflg = uioseg; auio.uio_rw = UIO_READ; auio.uio_td = td; auio.uio_offset = 0; /* XXX */ @@ -1020,9 +1020,13 @@ ((struct osockaddr *)fromsa)->sa_family = fromsa->sa_family; #endif - error = copyout(fromsa, mp->msg_name, (unsigned)len); - if (error) - goto out; + if (fromseg == UIO_USERSPACE) { + error = copyout(fromsa, mp->msg_name, + (unsigned)len); + if (error) + goto out; + } else + bcopy(fromsa, mp->msg_name, len); } mp->msg_namelen = len; if (namelenp && @@ -1103,7 +1107,8 @@ void *namelenp; { - return (kern_recvit(td, s, mp, namelenp, UIO_USERSPACE, NULL)); + return (kern_recvit(td, s, mp, namelenp, UIO_USERSPACE, UIO_USERSPACE, + NULL)); } /* ==== //depot/projects/smpng/sys/sys/syscallsubr.h#34 (text+ko) ==== @@ -121,8 +121,9 @@ int kern_readlink(struct thread *td, char *path, enum uio_seg pathseg, char *buf, enum uio_seg bufseg, int count); int kern_readv(struct thread *td, int fd, struct uio *auio); -int kern_recvit(struct thread *td, int s, struct msghdr *mp, void *namelenp, - enum uio_seg segflg, struct mbuf **controlp); +int kern_recvit(struct thread *td, int s, struct msghdr *mp, + void *namelenp, enum uio_seg uioseg, enum uio_seg fromseg, + struct mbuf **controlp); int kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg); int kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg);