From owner-p4-projects@FreeBSD.ORG Wed Jul 5 20:42:46 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 177CC16A4E1; Wed, 5 Jul 2006 20:42:46 +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 CD77316A4DA for ; Wed, 5 Jul 2006 20:42:45 +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 8C08D43D49 for ; Wed, 5 Jul 2006 20:42:45 +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 k65Kgj13047422 for ; Wed, 5 Jul 2006 20:42:45 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k65Kgja9047419 for perforce@freebsd.org; Wed, 5 Jul 2006 20:42:45 GMT (envelope-from jhb@freebsd.org) Date: Wed, 5 Jul 2006 20:42:45 GMT Message-Id: <200607052042.k65Kgja9047419@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 100654 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, 05 Jul 2006 20:42:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=100654 Change 100654 by jhb@jhb_mutex on 2006/07/05 20:42:09 Just use regular poll() for ibcs2_poll(). ibcs2_poll() was broken in so many ways and completely unnecessary. Affected files ... .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_msg.c#7 edit .. //depot/projects/smpng/sys/i386/ibcs2/syscalls.master#12 edit .. //depot/projects/smpng/sys/notes#71 edit Differences ... ==== //depot/projects/smpng/sys/i386/ibcs2/ibcs2_msg.c#7 (text+ko) ==== @@ -38,7 +38,6 @@ #include #include #include -#include #include @@ -57,79 +56,3 @@ { return 0; /* fake */ } - - -int -ibcs2_poll(td, uap) - struct thread *td; - struct ibcs2_poll_args *uap; -{ - int error, i, nfds; - fd_set *readfds, *writefds, *exceptfds; - struct timeval timeout, *tp; - struct ibcs2_poll conv; - caddr_t sg = stackgap_init(); - - if (uap->nfds > FD_SETSIZE) - return EINVAL; - readfds = stackgap_alloc(&sg, sizeof(fd_set *)); - writefds = stackgap_alloc(&sg, sizeof(fd_set *)); - exceptfds = stackgap_alloc(&sg, sizeof(fd_set *)); - - FD_ZERO(readfds); - FD_ZERO(writefds); - FD_ZERO(exceptfds); - if (uap->timeout == -1) - tp = NULL; - else { - timeout.tv_usec = (uap->timeout % 1000)*1000; - timeout.tv_sec = uap->timeout / 1000; - tp = &timeout; - } - - nfds = 0; - for (i = 0; i < uap->nfds; i++) { - if ((error = copyin(uap->fds + i*sizeof(struct ibcs2_poll), - &conv, sizeof(conv))) != 0) - return error; - conv.revents = 0; - if (conv.fd < 0 || conv.fd >= FD_SETSIZE) - continue; - if (conv.fd >= nfds) - nfds = conv.fd + 1; - if (conv.events & IBCS2_READPOLL) - FD_SET(conv.fd, readfds); - if (conv.events & IBCS2_WRITEPOLL) - FD_SET(conv.fd, writefds); - FD_SET(conv.fd, exceptfds); - } - error = kern_select(td, nfds, readfds, writefds, exceptfds, tp); - if (error != 0) - return error; - if (td->td_retval[0] == 0) - return 0; - td->td_retval[0] = 0; - for (td->td_retval[0] = 0, i = 0; i < uap->nfds; i++) { - copyin(uap->fds + i*sizeof(struct ibcs2_poll), - &conv, sizeof(conv)); - conv.revents = 0; - if (conv.fd < 0 || conv.fd > FD_SETSIZE) - /* should check for open as well */ - conv.revents |= IBCS2_POLLNVAL; - else { - if (FD_ISSET(conv.fd, readfds)) - conv.revents |= IBCS2_POLLIN; - if (FD_ISSET(conv.fd, writefds)) - conv.revents |= IBCS2_POLLOUT; - if (FD_ISSET(conv.fd, exceptfds)) - conv.revents |= IBCS2_POLLERR; - if (conv.revents) - ++td->td_retval[0]; - } - if ((error = copyout(&conv, - uap->fds + i*sizeof(struct ibcs2_poll), - sizeof(conv))) != 0) - return error; - } - return 0; -} ==== //depot/projects/smpng/sys/i386/ibcs2/syscalls.master#12 (text+ko) ==== @@ -158,8 +158,8 @@ 86 AUE_PUTMSG MSTD { int ibcs2_putmsg(int fd, \ struct ibcs2_stropts *ctl, \ struct ibcs2_stropts *dat, int flags); } -87 AUE_POLL STD { int ibcs2_poll(struct ibcs2_poll *fds, \ - long nfds, int timeout); } +87 AUE_POLL MNOPROTO { int poll(struct pollfd *fds, u_int nfds, \ + int timeout); } 88 AUE_NULL UNIMPL nosys 89 AUE_NULL MSTD { int ibcs2_secure(int cmd, int a1, int a2, \ int a3, int a4, int a5); } ==== //depot/projects/smpng/sys/notes#71 (text+ko) ==== @@ -79,6 +79,40 @@ recursion) and panic if we try to sleep with any held to provide a cheaper version of the current WITNESS check that doesn't bog the system down quite as bad. +- compat ABI cleanups + - axe stackgap + + svr4 + + linux + - ibcs2 + - ibcs2_msg.c + - push Giant down and mark all remaining syscalls MPSAFE + + freebsd + + compat32 + - svr4 + - svr4_sys_ioctl() + - svr4_sys_getmsg() + - svr4_sys_putmsg() + - svr4_sys_waitsys() + - svr4_sys_fchroot() + - svr4_sys_resolvepath() + - linux + - linux_uselib() + - ibcs2 + - ibcs2_read() + - ibcs2_mount() + - ibcs2_umount() + - ibcs2_msgsys() + - ibcs2_shmsys() + - ibcs2_semsys() + - ibcs2_ioctl() + - ibcs2_getdents() + + ibcs2_poll() + + axe ibcs2_poll.h + - ibcs2_sigprocmask() + - xenix_rdchk() + - ibcs2_getgroups() + - ibcs2_setgruops() + - don't mess with td_retval in any kern_foo() functions Active child branches: - jhb_intr - fast ithreads and MSI? (perhaps do MSI in jhb_acpipci)