From owner-svn-src-projects@FreeBSD.ORG Tue Oct 19 21:02:06 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18BF610656A5; Tue, 19 Oct 2010 21:02:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 039608FC0A; Tue, 19 Oct 2010 21:02:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9JL255q027033; Tue, 19 Oct 2010 21:02:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9JL255v027000; Tue, 19 Oct 2010 21:02:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010192102.o9JL255v027000@svn.freebsd.org> From: Dimitry Andric Date: Tue, 19 Oct 2010 21:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214078 - in projects/binutils-2.17: contrib/bsnmp/lib contrib/netcat contrib/top include lib/libc/include lib/libradius lib/libthr lib/libthr/thread libexec/bootpd sbin/camcontrol sbin... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2010 21:02:06 -0000 Author: dim Date: Tue Oct 19 21:02:05 2010 New Revision: 214078 URL: http://svn.freebsd.org/changeset/base/214078 Log: Sync: merge r213992 through r214076 from ^/head. Added: projects/binutils-2.17/sys/net80211/ieee80211_ratectl_none.c - copied unchanged from r214075, head/sys/net80211/ieee80211_ratectl_none.c projects/binutils-2.17/sys/nfs/nfs_mountcommon.h - copied unchanged from r214075, head/sys/nfs/nfs_mountcommon.h Modified: projects/binutils-2.17/contrib/bsnmp/lib/bsnmplib.3 projects/binutils-2.17/contrib/netcat/nc.1 projects/binutils-2.17/contrib/netcat/netcat.c projects/binutils-2.17/contrib/netcat/socks.c projects/binutils-2.17/include/pthread.h projects/binutils-2.17/lib/libc/include/namespace.h projects/binutils-2.17/lib/libc/include/un-namespace.h projects/binutils-2.17/lib/libradius/Makefile projects/binutils-2.17/lib/libthr/pthread.map projects/binutils-2.17/lib/libthr/thread/thr_private.h projects/binutils-2.17/lib/libthr/thread/thr_rwlock.c projects/binutils-2.17/lib/libthr/thread/thr_rwlockattr.c projects/binutils-2.17/libexec/bootpd/bootptab.5 projects/binutils-2.17/sbin/camcontrol/camcontrol.8 projects/binutils-2.17/sbin/camcontrol/camcontrol.c projects/binutils-2.17/sbin/routed/routed.8 projects/binutils-2.17/sbin/setkey/setkey.8 projects/binutils-2.17/sbin/sunlabel/sunlabel.8 projects/binutils-2.17/share/man/man4/lagg.4 projects/binutils-2.17/share/man/man4/man4.arm/mge.4 projects/binutils-2.17/share/man/man4/man4.i386/ep.4 projects/binutils-2.17/share/man/man4/man4.i386/mse.4 projects/binutils-2.17/share/man/man4/man4.powerpc/tsec.4 projects/binutils-2.17/share/man/man4/nxge.4 projects/binutils-2.17/share/man/man5/freebsd-update.conf.5 projects/binutils-2.17/share/man/man9/Makefile projects/binutils-2.17/share/man/man9/vrele.9 projects/binutils-2.17/share/man/man9/zone.9 projects/binutils-2.17/sys/arm/mv/mv_sata.c projects/binutils-2.17/sys/conf/files projects/binutils-2.17/sys/dev/acpica/acpi.c projects/binutils-2.17/sys/dev/acpica/acpi_if.m projects/binutils-2.17/sys/dev/acpica/acpi_pci.c projects/binutils-2.17/sys/dev/ata/ata-all.c projects/binutils-2.17/sys/dev/ata/ata-all.h projects/binutils-2.17/sys/dev/ata/ata-pci.c projects/binutils-2.17/sys/dev/ata/ata-sata.c projects/binutils-2.17/sys/dev/ata/chipsets/ata-ahci.c projects/binutils-2.17/sys/dev/ata/chipsets/ata-intel.c projects/binutils-2.17/sys/dev/ata/chipsets/ata-marvell.c projects/binutils-2.17/sys/dev/ata/chipsets/ata-nvidia.c projects/binutils-2.17/sys/dev/ata/chipsets/ata-promise.c projects/binutils-2.17/sys/dev/ata/chipsets/ata-siliconimage.c projects/binutils-2.17/sys/dev/ata/chipsets/ata-via.c projects/binutils-2.17/sys/dev/firewire/fwohci.c projects/binutils-2.17/sys/dev/if_ndis/if_ndis.c projects/binutils-2.17/sys/dev/md/md.c projects/binutils-2.17/sys/dev/mii/brgphy.c projects/binutils-2.17/sys/dev/pci/pci.c projects/binutils-2.17/sys/fs/msdosfs/msdosfs_lookup.c projects/binutils-2.17/sys/fs/nfsclient/nfs_clnode.c projects/binutils-2.17/sys/fs/nfsclient/nfs_clvfsops.c projects/binutils-2.17/sys/fs/nfsclient/nfs_clvnops.c projects/binutils-2.17/sys/fs/nfsclient/nfsmount.h projects/binutils-2.17/sys/geom/geom_dev.c projects/binutils-2.17/sys/kern/kern_resource.c projects/binutils-2.17/sys/kern/kern_shutdown.c projects/binutils-2.17/sys/kern/vfs_mount.c projects/binutils-2.17/sys/kern/vfs_mountroot.c projects/binutils-2.17/sys/modules/mps/Makefile projects/binutils-2.17/sys/modules/wlan/Makefile projects/binutils-2.17/sys/net80211/ieee80211_ratectl.c projects/binutils-2.17/sys/net80211/ieee80211_ratectl.h projects/binutils-2.17/sys/netinet/libalias/libalias.3 projects/binutils-2.17/sys/nfs/nfs_lock.c projects/binutils-2.17/sys/nfs/nfs_lock.h projects/binutils-2.17/sys/nfsclient/nfs.h projects/binutils-2.17/sys/nfsclient/nfs_bio.c projects/binutils-2.17/sys/nfsclient/nfs_nfsiod.c projects/binutils-2.17/sys/nfsclient/nfs_node.c projects/binutils-2.17/sys/nfsclient/nfs_vfsops.c projects/binutils-2.17/sys/nfsclient/nfs_vnops.c projects/binutils-2.17/sys/nfsclient/nfsmount.h projects/binutils-2.17/sys/nfsclient/nfsnode.h projects/binutils-2.17/sys/nfsserver/nfs_serv.c projects/binutils-2.17/sys/nlm/nlm_advlock.c projects/binutils-2.17/sys/nlm/nlm_prot_impl.c projects/binutils-2.17/sys/sparc64/include/tick.h projects/binutils-2.17/sys/sparc64/sparc64/mp_machdep.c projects/binutils-2.17/sys/sparc64/sparc64/tick.c projects/binutils-2.17/sys/sys/systm.h projects/binutils-2.17/sys/vm/uma_core.c projects/binutils-2.17/usr.bin/calendar/calendars/calendar.freebsd projects/binutils-2.17/usr.bin/nc/Makefile projects/binutils-2.17/usr.bin/uudecode/uudecode.c projects/binutils-2.17/usr.sbin/apmd/apmd.8 projects/binutils-2.17/usr.sbin/gpioctl/gpioctl.8 projects/binutils-2.17/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh projects/binutils-2.17/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh projects/binutils-2.17/usr.sbin/ppp/ipcp.c Directory Properties: projects/binutils-2.17/ (props changed) projects/binutils-2.17/cddl/contrib/opensolaris/ (props changed) projects/binutils-2.17/contrib/bind9/ (props changed) projects/binutils-2.17/contrib/binutils/ (props changed) projects/binutils-2.17/contrib/bzip2/ (props changed) projects/binutils-2.17/contrib/ee/ (props changed) projects/binutils-2.17/contrib/expat/ (props changed) projects/binutils-2.17/contrib/file/ (props changed) projects/binutils-2.17/contrib/gdb/ (props changed) projects/binutils-2.17/contrib/gdtoa/ (props changed) projects/binutils-2.17/contrib/gnu-sort/ (props changed) projects/binutils-2.17/contrib/groff/ (props changed) projects/binutils-2.17/contrib/less/ (props changed) projects/binutils-2.17/contrib/libpcap/ (props changed) projects/binutils-2.17/contrib/llvm/ (props changed) projects/binutils-2.17/contrib/llvm/tools/clang/ (props changed) projects/binutils-2.17/contrib/ncurses/ (props changed) projects/binutils-2.17/contrib/netcat/ (props changed) projects/binutils-2.17/contrib/ntp/ (props changed) projects/binutils-2.17/contrib/one-true-awk/ (props changed) projects/binutils-2.17/contrib/openbsm/ (props changed) projects/binutils-2.17/contrib/openpam/ (props changed) projects/binutils-2.17/contrib/pf/ (props changed) projects/binutils-2.17/contrib/sendmail/ (props changed) projects/binutils-2.17/contrib/tcpdump/ (props changed) projects/binutils-2.17/contrib/tcsh/ (props changed) projects/binutils-2.17/contrib/top/ (props changed) projects/binutils-2.17/contrib/top/install-sh (props changed) projects/binutils-2.17/contrib/tzcode/stdtime/ (props changed) projects/binutils-2.17/contrib/tzcode/zic/ (props changed) projects/binutils-2.17/contrib/tzdata/ (props changed) projects/binutils-2.17/contrib/wpa/ (props changed) projects/binutils-2.17/contrib/xz/ (props changed) projects/binutils-2.17/crypto/openssh/ (props changed) projects/binutils-2.17/crypto/openssl/ (props changed) projects/binutils-2.17/lib/libc/ (props changed) projects/binutils-2.17/lib/libc/stdtime/ (props changed) projects/binutils-2.17/lib/libutil/ (props changed) projects/binutils-2.17/lib/libz/ (props changed) projects/binutils-2.17/sbin/ (props changed) projects/binutils-2.17/sbin/ipfw/ (props changed) projects/binutils-2.17/share/mk/bsd.arch.inc.mk (props changed) projects/binutils-2.17/share/zoneinfo/ (props changed) projects/binutils-2.17/sys/ (props changed) projects/binutils-2.17/sys/amd64/include/xen/ (props changed) projects/binutils-2.17/sys/cddl/contrib/opensolaris/ (props changed) projects/binutils-2.17/sys/contrib/dev/acpica/ (props changed) projects/binutils-2.17/sys/contrib/pf/ (props changed) projects/binutils-2.17/sys/contrib/x86emu/ (props changed) projects/binutils-2.17/sys/dev/xen/xenpci/ (props changed) projects/binutils-2.17/usr.bin/calendar/ (props changed) projects/binutils-2.17/usr.bin/csup/ (props changed) projects/binutils-2.17/usr.bin/procstat/ (props changed) projects/binutils-2.17/usr.sbin/zic/ (props changed) Modified: projects/binutils-2.17/contrib/bsnmp/lib/bsnmplib.3 ============================================================================== --- projects/binutils-2.17/contrib/bsnmp/lib/bsnmplib.3 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/contrib/bsnmp/lib/bsnmplib.3 Tue Oct 19 21:02:05 2010 (r214078) @@ -134,7 +134,6 @@ is not zero, .Fa v.octetstring.octets points to a string allocated by .Xr malloc 3 . -.Pp .Bd -literal -offset indent #define SNMP_COMMUNITY_MAXLEN 128 #define SNMP_MAX_BINDINGS 100 Modified: projects/binutils-2.17/contrib/netcat/nc.1 ============================================================================== --- projects/binutils-2.17/contrib/netcat/nc.1 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/contrib/netcat/nc.1 Tue Oct 19 21:02:05 2010 (r214078) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.53 2010/02/23 23:00:52 schwarze Exp $ +.\" $OpenBSD: nc.1,v 1.55 2010/07/25 07:51:39 guenther Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2010 +.Dd July 25, 2010 .Dt NC 1 .Os .Sh NAME @@ -46,7 +46,7 @@ .Op Fl p Ar source_port .Op Fl s Ar source_ip_address .Op Fl T Ar ToS -.Op Fl V Ar fib +.Op Fl V Ar rtable .Op Fl w Ar timeout .Op Fl X Ar proxy_protocol .Oo Xo @@ -158,7 +158,6 @@ TCP_NOOPT socket option. .It Fl O Ar length Specifies the size of the TCP send buffer. -When .It Fl P Ar proxy_username Specifies a username to present to a proxy server that requires authentication. If no username is specified then authentication will not be attempted. @@ -202,8 +201,10 @@ Specifies to use sockets. .It Fl u Use UDP instead of the default option of TCP. -.It Fl V Ar fib -Set the routing table (FIB). +.It Fl V Ar rtable +Set the routing table +.Pq Dq FIB +to be used. The default is 0. .It Fl v Have Modified: projects/binutils-2.17/contrib/netcat/netcat.c ============================================================================== --- projects/binutils-2.17/contrib/netcat/netcat.c Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/contrib/netcat/netcat.c Tue Oct 19 21:02:05 2010 (r214078) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.95 2010/02/27 00:58:56 nicm Exp $ */ +/* $OpenBSD: netcat.c,v 1.98 2010/07/03 04:44:51 guenther Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -93,7 +93,7 @@ int Iflag; /* TCP receive buffer siz int Oflag; /* TCP send buffer size */ int Sflag; /* TCP MD5 signature option */ int Tflag = -1; /* IP Type of Service */ -u_int rdomain; +u_int rtableid; int timeout = -1; int family = AF_UNSPEC; @@ -139,7 +139,6 @@ main(int argc, char *argv[]) { NULL, 0, NULL, 0 } }; - rdomain = 0; ret = 1; ipsec_count = 0; s = 0; @@ -235,10 +234,10 @@ main(int argc, char *argv[]) case 'V': if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1) errx(1, "Multiple FIBS not supported"); - rdomain = (unsigned int)strtonum(optarg, 0, + rtableid = (unsigned int)strtonum(optarg, 0, numfibs - 1, &errstr); if (errstr) - errx(1, "FIB %s: %s", errstr, optarg); + errx(1, "rtable %s: %s", errstr, optarg); break; case 'v': vflag = 1; @@ -371,11 +370,11 @@ main(int argc, char *argv[]) */ if (uflag) { int rv, plen; - char buf[8192]; + char buf[16384]; struct sockaddr_storage z; len = sizeof(z); - plen = jflag ? 8192 : 1024; + plen = jflag ? 16384 : 2048; rv = recvfrom(s, buf, plen, MSG_PEEK, (struct sockaddr *)&z, &len); if (rv < 0) @@ -561,8 +560,8 @@ remote_connect(const char *host, const c add_ipsec_policy(s, ipsec_policy[1]); #endif - if (rdomain) { - if (setfib(rdomain) == -1) + if (rtableid) { + if (setfib(rtableid) == -1) err(1, "setfib"); } @@ -634,8 +633,8 @@ local_listen(char *host, char *port, str res0->ai_protocol)) < 0) continue; - if (rdomain) { - if (setfib(rdomain) == -1) + if (rtableid) { + if (setfib(rtableid) == -1) err(1, "setfib"); } @@ -680,12 +679,12 @@ void readwrite(int nfd) { struct pollfd pfd[2]; - unsigned char buf[8192]; + unsigned char buf[16384]; int n, wfd = fileno(stdin); int lfd = fileno(stdout); int plen; - plen = jflag ? 8192 : 1024; + plen = jflag ? 16384 : 2048; /* Setup Network FD */ pfd[0].fd = nfd; @@ -827,10 +826,9 @@ build_ports(char *p) hi = strtonum(p, 1, PORT_MAX, &errstr); if (errstr) errx(1, "port number %s: %s", errstr, p); - portlist[0] = calloc(1, PORT_MAX_LEN); + portlist[0] = strdup(p); if (portlist[0] == NULL) err(1, NULL); - portlist[0] = p; } } @@ -947,7 +945,7 @@ help(void) \t-t Answer TELNET negotiation\n\ \t-U Use UNIX domain socket\n\ \t-u UDP mode\n\ - \t-V fib Specify alternate routing table (FIB)\n\ + \t-V rtable Specify alternate routing table\n\ \t-v Verbose\n\ \t-w secs\t Timeout for connects and final net reads\n\ \t-X proto Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\ @@ -992,7 +990,7 @@ usage(int ret) "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n" #endif "\t [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS]\n" - "\t [-V fib] [-w timeout] [-X proxy_protocol]\n" + "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" "\t [-x proxy_address[:port]] [hostname] [port]\n"); if (ret) exit(1); Modified: projects/binutils-2.17/contrib/netcat/socks.c ============================================================================== --- projects/binutils-2.17/contrib/netcat/socks.c Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/contrib/netcat/socks.c Tue Oct 19 21:02:05 2010 (r214078) @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.17 2006/09/25 04:51:20 ray Exp $ */ +/* $OpenBSD: socks.c,v 1.18 2010/04/20 07:26:35 nicm Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -167,11 +167,11 @@ socks_connect(const char *host, const ch buf[2] = SOCKS_NOAUTH; cnt = atomicio(vwrite, proxyfd, buf, 3); if (cnt != 3) - err(1, "write failed (%d/3)", cnt); + err(1, "write failed (%zu/3)", cnt); cnt = atomicio(read, proxyfd, buf, 2); if (cnt != 2) - err(1, "read failed (%d/3)", cnt); + err(1, "read failed (%zu/3)", cnt); if (buf[1] == SOCKS_NOMETHOD) errx(1, "authentication method negotiation failed"); @@ -220,11 +220,11 @@ socks_connect(const char *host, const ch cnt = atomicio(vwrite, proxyfd, buf, wlen); if (cnt != wlen) - err(1, "write failed (%d/%d)", cnt, wlen); + err(1, "write failed (%zu/%zu)", cnt, wlen); cnt = atomicio(read, proxyfd, buf, 10); if (cnt != 10) - err(1, "read failed (%d/10)", cnt); + err(1, "read failed (%zu/10)", cnt); if (buf[1] != 0) errx(1, "connection failed, SOCKS error %d", buf[1]); } else if (socksv == 4) { @@ -242,11 +242,11 @@ socks_connect(const char *host, const ch cnt = atomicio(vwrite, proxyfd, buf, wlen); if (cnt != wlen) - err(1, "write failed (%d/%d)", cnt, wlen); + err(1, "write failed (%zu/%zu)", cnt, wlen); cnt = atomicio(read, proxyfd, buf, 8); if (cnt != 8) - err(1, "read failed (%d/8)", cnt); + err(1, "read failed (%zu/8)", cnt); if (buf[1] != 90) errx(1, "connection failed, SOCKS error %d", buf[1]); } else if (socksv == -1) { @@ -272,7 +272,7 @@ socks_connect(const char *host, const ch cnt = atomicio(vwrite, proxyfd, buf, r); if (cnt != r) - err(1, "write failed (%d/%d)", cnt, r); + err(1, "write failed (%zu/%d)", cnt, r); if (authretry > 1) { char resp[1024]; @@ -290,7 +290,7 @@ socks_connect(const char *host, const ch errx(1, "Proxy auth response too long"); r = strlen(buf); if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r) - err(1, "write failed (%d/%d)", cnt, r); + err(1, "write failed (%zu/%d)", cnt, r); } /* Terminate headers */ Modified: projects/binutils-2.17/include/pthread.h ============================================================================== --- projects/binutils-2.17/include/pthread.h Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/include/pthread.h Tue Oct 19 21:02:05 2010 (r214078) @@ -135,6 +135,15 @@ enum pthread_mutextype { #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK +enum pthread_rwlocktype_np +{ + PTHREAD_RWLOCK_PREFER_READER_NP, + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, + PTHREAD_RWLOCK_PREFER_WRITER_NP, + PTHREAD_RWLOCK_DEFAULT_NP = + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP +}; + struct _pthread_cleanup_info { __uintptr_t pthread_cleanup_pad[8]; }; @@ -233,11 +242,14 @@ int pthread_rwlock_tryrdlock(pthread_rw int pthread_rwlock_trywrlock(pthread_rwlock_t *); int pthread_rwlock_unlock(pthread_rwlock_t *); int pthread_rwlock_wrlock(pthread_rwlock_t *); -int pthread_rwlockattr_init(pthread_rwlockattr_t *); +int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); +int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, + int *); int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, int *); +int pthread_rwlockattr_init(pthread_rwlockattr_t *); +int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); Modified: projects/binutils-2.17/lib/libc/include/namespace.h ============================================================================== --- projects/binutils-2.17/lib/libc/include/namespace.h Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/lib/libc/include/namespace.h Tue Oct 19 21:02:05 2010 (r214078) @@ -177,8 +177,10 @@ #define pthread_rwlock_unlock _pthread_rwlock_unlock #define pthread_rwlock_wrlock _pthread_rwlock_wrlock #define pthread_rwlockattr_destroy _pthread_rwlockattr_destroy +#define pthread_rwlockattr_getkind_np _pthread_rwlockattr_getkind_np #define pthread_rwlockattr_getpshared _pthread_rwlockattr_getpshared #define pthread_rwlockattr_init _pthread_rwlockattr_init +#define pthread_rwlockattr_setkind_np _pthread_rwlockattr_setkind_np #define pthread_rwlockattr_setpshared _pthread_rwlockattr_setpshared #define pthread_self _pthread_self #define pthread_set_name_np _pthread_set_name_np Modified: projects/binutils-2.17/lib/libc/include/un-namespace.h ============================================================================== --- projects/binutils-2.17/lib/libc/include/un-namespace.h Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/lib/libc/include/un-namespace.h Tue Oct 19 21:02:05 2010 (r214078) @@ -158,8 +158,10 @@ #undef pthread_rwlock_unlock #undef pthread_rwlock_wrlock #undef pthread_rwlockattr_destroy +#undef pthread_rwlockattr_getkind_np #undef pthread_rwlockattr_getpshared #undef pthread_rwlockattr_init +#undef pthread_rwlockattr_setkind_np #undef pthread_rwlockattr_setpshared #undef pthread_self #undef pthread_set_name_np Modified: projects/binutils-2.17/lib/libradius/Makefile ============================================================================== --- projects/binutils-2.17/lib/libradius/Makefile Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/lib/libradius/Makefile Tue Oct 19 21:02:05 2010 (r214078) @@ -33,6 +33,39 @@ CFLAGS+= -Wall SHLIB_MAJOR= 4 MAN= libradius.3 radius.conf.5 +MLINKS+=libradius.3 rad_acct_open.3 \ + libradius.3 rad_add_server.3 \ + libradius.3 rad_auth_open.3 \ + libradius.3 rad_close.3 \ + libradius.3 rad_config.3 \ + libradius.3 rad_continue_send_request.3 \ + libradius.3 rad_create_request.3 \ + libradius.3 rad_create_response.3 \ + libradius.3 rad_cvt_addr.3 \ + libradius.3 rad_cvt_int.3 \ + libradius.3 rad_cvt_string.3 \ + libradius.3 rad_demangle.3 \ + libradius.3 rad_demangle_mppe_key.3 \ + libradius.3 rad_get_attr.3 \ + libradius.3 rad_get_vendor_attr.3 \ + libradius.3 rad_init_send_request.3 \ + libradius.3 rad_put_addr.3 \ + libradius.3 rad_put_attr.3 \ + libradius.3 rad_put_int.3 \ + libradius.3 rad_put_message_authentic.3 \ + libradius.3 rad_put_string.3 \ + libradius.3 rad_put_vendor_addr.3 \ + libradius.3 rad_put_vendor_attr.3 \ + libradius.3 rad_put_vendor_int.3 \ + libradius.3 rad_put_vendor_string.3 \ + libradius.3 rad_receive_request.3 \ + libradius.3 rad_request_authenticator.3 \ + libradius.3 rad_send_request.3 \ + libradius.3 rad_send_response.3 \ + libradius.3 rad_server_open.3 \ + libradius.3 rad_server_secret.3 \ + libradius.3 rad_strerror.3 + WARNS?= 3 .if ${MK_OPENSSL} == "no" Modified: projects/binutils-2.17/lib/libthr/pthread.map ============================================================================== --- projects/binutils-2.17/lib/libthr/pthread.map Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/lib/libthr/pthread.map Tue Oct 19 21:02:05 2010 (r214078) @@ -318,7 +318,9 @@ FBSDprivate_1.0 { _pthread_rwlock_wrlock; _pthread_rwlockattr_destroy; _pthread_rwlockattr_getpshared; + _pthread_rwlockattr_getkind_np; _pthread_rwlockattr_init; + _pthread_rwlockattr_setkind_np; _pthread_rwlockattr_setpshared; _pthread_self; _pthread_set_name_np; @@ -401,6 +403,8 @@ FBSD_1.1 { FBSD_1.2 { openat; + pthread_rwlockattr_getkind_np; + pthread_rwlockattr_setkind_np; setcontext; swapcontext; }; Modified: projects/binutils-2.17/lib/libthr/thread/thr_private.h ============================================================================== --- projects/binutils-2.17/lib/libthr/thread/thr_private.h Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/lib/libthr/thread/thr_private.h Tue Oct 19 21:02:05 2010 (r214078) @@ -285,11 +285,14 @@ struct pthread_prio { struct pthread_rwlockattr { int pshared; + int kind; }; struct pthread_rwlock { struct urwlock lock; struct pthread *owner; + int recurse; + int kind; }; /* Modified: projects/binutils-2.17/lib/libthr/thread/thr_rwlock.c ============================================================================== --- projects/binutils-2.17/lib/libthr/thread/thr_rwlock.c Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/lib/libthr/thread/thr_rwlock.c Tue Oct 19 21:02:05 2010 (r214078) @@ -63,13 +63,19 @@ __weak_reference(_pthread_rwlock_timedwr */ static int -rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr __unused) +rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) { pthread_rwlock_t prwlock; prwlock = (pthread_rwlock_t)calloc(1, sizeof(struct pthread_rwlock)); if (prwlock == NULL) return (ENOMEM); + if (attr != NULL) + prwlock->kind = (*attr)->kind; + else + prwlock->kind = PTHREAD_RWLOCK_DEFAULT_NP; + if (prwlock->kind == PTHREAD_RWLOCK_PREFER_READER_NP) + prwlock->lock.rw_flags |= URWLOCK_PREFER_READER; *rwlock = prwlock; return (0); } @@ -112,7 +118,7 @@ init_static(struct pthread *thread, pthr } int -_pthread_rwlock_init (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) +_pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) { *rwlock = NULL; return (rwlock_init(rwlock, attr)); @@ -260,6 +266,14 @@ rwlock_wrlock_common (pthread_rwlock_t * CHECK_AND_INIT_RWLOCK + if (__predict_false(prwlock->owner == curthread)) { + if (__predict_false( + prwlock->kind == PTHREAD_RWLOCK_PREFER_WRITER_NP)) { + prwlock->recurse++; + return (0); + } + } + /* * POSIX said the validity of the abstimeout parameter need * not be checked if the lock can be immediately acquired. @@ -335,6 +349,13 @@ _pthread_rwlock_unlock (pthread_rwlock_t if (state & URWLOCK_WRITE_OWNER) { if (__predict_false(prwlock->owner != curthread)) return (EPERM); + if (__predict_false( + prwlock->kind == PTHREAD_RWLOCK_PREFER_WRITER_NP)) { + if (prwlock->recurse > 0) { + prwlock->recurse--; + return (0); + } + } prwlock->owner = NULL; } Modified: projects/binutils-2.17/lib/libthr/thread/thr_rwlockattr.c ============================================================================== --- projects/binutils-2.17/lib/libthr/thread/thr_rwlockattr.c Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/lib/libthr/thread/thr_rwlockattr.c Tue Oct 19 21:02:05 2010 (r214078) @@ -36,8 +36,10 @@ __weak_reference(_pthread_rwlockattr_destroy, pthread_rwlockattr_destroy); __weak_reference(_pthread_rwlockattr_getpshared, pthread_rwlockattr_getpshared); +__weak_reference(_pthread_rwlockattr_getkind_np, pthread_rwlockattr_getkind_np); __weak_reference(_pthread_rwlockattr_init, pthread_rwlockattr_init); __weak_reference(_pthread_rwlockattr_setpshared, pthread_rwlockattr_setpshared); +__weak_reference(_pthread_rwlockattr_setkind_np, pthread_rwlockattr_setkind_np); int _pthread_rwlockattr_destroy(pthread_rwlockattr_t *rwlockattr) @@ -81,6 +83,7 @@ _pthread_rwlockattr_init(pthread_rwlocka return(ENOMEM); prwlockattr->pshared = PTHREAD_PROCESS_PRIVATE; + prwlockattr->kind = PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP; *rwlockattr = prwlockattr; return(0); @@ -98,3 +101,21 @@ _pthread_rwlockattr_setpshared(pthread_r return(0); } +int +_pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *attr, int kind) +{ + if (kind != PTHREAD_RWLOCK_PREFER_READER_NP && + kind != PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP && + kind != PTHREAD_RWLOCK_PREFER_WRITER_NP) { + return (EINVAL); + } + (*attr)->kind = kind; + return (0); +} + +int +_pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *attr, int *kind) +{ + *kind = (*attr)->kind; + return (0); +} Modified: projects/binutils-2.17/libexec/bootpd/bootptab.5 ============================================================================== --- projects/binutils-2.17/libexec/bootpd/bootptab.5 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/libexec/bootpd/bootptab.5 Tue Oct 19 21:02:05 2010 (r214078) @@ -388,7 +388,6 @@ hardware address. An example .Pa /etc/bootptab file follows: -.Pp .Bd -literal -offset indent # Sample bootptab file (domain=andrew.cmu.edu) Modified: projects/binutils-2.17/sbin/camcontrol/camcontrol.8 ============================================================================== --- projects/binutils-2.17/sbin/camcontrol/camcontrol.8 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/sbin/camcontrol/camcontrol.8 Tue Oct 19 21:02:05 2010 (r214078) @@ -207,9 +207,6 @@ A device identifier can take one of thre .Bl -tag -width 14n .It deviceUNIT Specify a device name and unit number combination, like "da5" or "cd3". -Note that character device node names (e.g.\& /dev/da0) are -.Em not -allowed here. .It bus:target Specify a bus number and target id. The bus number can be determined from Modified: projects/binutils-2.17/sbin/camcontrol/camcontrol.c ============================================================================== --- projects/binutils-2.17/sbin/camcontrol/camcontrol.c Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/sbin/camcontrol/camcontrol.c Tue Oct 19 21:02:05 2010 (r214078) @@ -4605,15 +4605,7 @@ main(int argc, char **argv) char name[30]; int rv; - /* - * First catch people who try to do things like: - * camcontrol tur /dev/da0 - * camcontrol doesn't take device nodes as arguments. - */ - if (argv[2][0] == '/') { - warnx("%s is not a valid device identifier", argv[2]); - errx(1, "please read the camcontrol(8) man page"); - } else if (isdigit(argv[2][0])) { + if (isdigit(argv[2][0])) { /* device specified as bus:target[:lun] */ rv = parse_btl(argv[2], &bus, &target, &lun, &arglist); if (rv < 2) Modified: projects/binutils-2.17/sbin/routed/routed.8 ============================================================================== --- projects/binutils-2.17/sbin/routed/routed.8 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/sbin/routed/routed.8 Tue Oct 19 21:02:05 2010 (r214078) @@ -440,7 +440,6 @@ The file is comprised of a series of lines, each in one of the following two formats or consist of parameters described later. Blank lines and lines starting with '#' are comments. -.Pp .Bd -ragged .Cm net .Ar Nname[/mask] Modified: projects/binutils-2.17/sbin/setkey/setkey.8 ============================================================================== --- projects/binutils-2.17/sbin/setkey/setkey.8 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/sbin/setkey/setkey.8 Tue Oct 19 21:02:05 2010 (r214078) @@ -565,7 +565,6 @@ There are small, but important, differen See .Xr ipsec_set_policy 3 for details. -.Pp .El .Pp .\" @@ -583,7 +582,6 @@ in the of the .Ar protocol parameter: -.Pp .Bd -literal -offset indent algorithm keylen (bits) comment hmac-md5 128 ah: rfc2403 @@ -616,7 +614,6 @@ in the of the .Ar protocol parameter: -.Pp .Bd -literal -offset indent algorithm keylen (bits) comment des-cbc 64 esp-old: rfc1829, esp: rfc2405 @@ -643,7 +640,6 @@ in the of the .Ar protocol parameter: -.Pp .Bd -literal -offset indent algorithm comment deflate rfc2394 Modified: projects/binutils-2.17/sbin/sunlabel/sunlabel.8 ============================================================================== --- projects/binutils-2.17/sbin/sunlabel/sunlabel.8 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/sbin/sunlabel/sunlabel.8 Tue Oct 19 21:02:05 2010 (r214078) @@ -120,7 +120,6 @@ Options are listed in alphabetical order Note that only those option combinations listed under .Sx SYNOPSIS are allowable. -.Pp .Bl -tag -width ".Fl b Ar bootpath" .It Fl b Ar bootpath Specify that Modified: projects/binutils-2.17/share/man/man4/lagg.4 ============================================================================== --- projects/binutils-2.17/share/man/man4/lagg.4 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/share/man/man4/lagg.4 Tue Oct 19 21:02:05 2010 (r214078) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2010 +.Dd October 18, 2010 .Dt LAGG 4 .Os .Sh NAME @@ -73,14 +73,14 @@ The interface link state is used to vali not. .Bl -tag -width loadbalance .It Ic failover -Sends traffic only through the master port. +Sends traffic only through the active port. If the master port becomes unavailable, the next active port is used. The first interface added is the master port; any interfaces added after that are used as failover devices. .Pp By default, received traffic is only accepted when they are received -through the master port. +through the active port. This constraint can be relaxed by setting the .Va net.link.lagg.failover_rx_all .Xr sysctl 8 Modified: projects/binutils-2.17/share/man/man4/man4.arm/mge.4 ============================================================================== --- projects/binutils-2.17/share/man/man4/man4.arm/mge.4 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/share/man/man4/man4.arm/mge.4 Tue Oct 19 21:02:05 2010 (r214078) @@ -47,7 +47,6 @@ system-on-chip devices. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options @@ -62,7 +61,6 @@ Set 1000baseT operation The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Set full duplex operation Modified: projects/binutils-2.17/share/man/man4/man4.i386/ep.4 ============================================================================== --- projects/binutils-2.17/share/man/man4/man4.i386/ep.4 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/share/man/man4/man4.i386/ep.4 Tue Oct 19 21:02:05 2010 (r214078) @@ -57,7 +57,6 @@ Parallel Tasking chipset. .Pp Various models of these cards come with a different assortment of connectors: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It AUI/DIX Standard 15 pin connector, also known as 10base5 (thick-net) @@ -74,7 +73,6 @@ To override this, use the following medi or in your .Pa /etc/rc.conf file. -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It 10base5/AUI Use the AUI port. Modified: projects/binutils-2.17/share/man/man4/man4.i386/mse.4 ============================================================================== --- projects/binutils-2.17/share/man/man4/man4.i386/mse.4 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/share/man/man4/man4.i386/mse.4 Tue Oct 19 21:02:05 2010 (r214078) @@ -147,7 +147,6 @@ or in the User Configuration Menu at the boot time (see .Xr boot 8 ) . -.Pp .Bl -tag -width MOUSE .It bit 4..7 ACCELERATION This flag controls the amount of acceleration effect. Modified: projects/binutils-2.17/share/man/man4/man4.powerpc/tsec.4 ============================================================================== --- projects/binutils-2.17/share/man/man4/man4.powerpc/tsec.4 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/share/man/man4/man4.powerpc/tsec.4 Tue Oct 19 21:02:05 2010 (r214078) @@ -47,7 +47,6 @@ some of the Freescale system-on-chip dev The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options @@ -62,7 +61,6 @@ Set 1000baseT operation The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Set full duplex operation Modified: projects/binutils-2.17/share/man/man4/nxge.4 ============================================================================== --- projects/binutils-2.17/share/man/man4/nxge.4 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/share/man/man4/nxge.4 Tue Oct 19 21:02:05 2010 (r214078) @@ -49,7 +49,7 @@ The .Nm driver provides support for Neterion Xframe-I and Xframe-II adapters. The driver supports TCP Segmentation Offload (TSO/LSO), -Large Receive Offlaod (LRO), Jumbo Frames (5 buffer mode), +Large Receive Offload (LRO), Jumbo Frames (5 buffer mode), Header Separation (Rx 2 buffer mode), VLAN, and Promiscuous mode. .Pp For general information and support, please visit the Neterion support page Modified: projects/binutils-2.17/share/man/man5/freebsd-update.conf.5 ============================================================================== --- projects/binutils-2.17/share/man/man5/freebsd-update.conf.5 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/share/man/man5/freebsd-update.conf.5 Tue Oct 19 21:02:05 2010 (r214078) @@ -47,7 +47,6 @@ Unless stated otherwise, specifying an o error. .Pp The possible options and their meanings are as follows: -.Pp .Bl -tag -width ".Cm BackupKernelSymbolFiles" .It Cm KeyPrint The single parameter following this keyword is the SHA256 hash Modified: projects/binutils-2.17/share/man/man9/Makefile ============================================================================== --- projects/binutils-2.17/share/man/man9/Makefile Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/share/man/man9/Makefile Tue Oct 19 21:02:05 2010 (r214078) @@ -1212,11 +1212,17 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent sysctl_ctx_init.9 sysctl_ctx_free.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 taskqueue_create.9 \ + taskqueue.9 taskqueue_create_fast.9 \ taskqueue.9 TASKQUEUE_DECLARE.9 \ taskqueue.9 TASKQUEUE_DEFINE.9 \ + taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ + taskqueue.9 taskqueue_drain.9 \ taskqueue.9 taskqueue_enqueue.9 \ - taskqueue.9 taskqueue_find.9 \ + taskqueue.9 taskqueue_enqueue_fast.9 \ + taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ + taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ + taskqueue.9 taskqueue_member.9 \ taskqueue.9 taskqueue_run.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ Modified: projects/binutils-2.17/share/man/man9/vrele.9 ============================================================================== --- projects/binutils-2.17/share/man/man9/vrele.9 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/share/man/man9/vrele.9 Tue Oct 19 21:02:05 2010 (r214078) @@ -59,7 +59,7 @@ The .Fn vrele function takes an unlocked vnode and returns with the vnode unlocked. .Pp -.The +The .Fn vput function should be given a locked vnode as argument, the vnode is unlocked after the function returned. Modified: projects/binutils-2.17/share/man/man9/zone.9 ============================================================================== --- projects/binutils-2.17/share/man/man9/zone.9 Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/share/man/man9/zone.9 Tue Oct 19 21:02:05 2010 (r214078) @@ -153,6 +153,13 @@ Items are released back to the zone from calling .Fn uma_zfree with a pointer to the zone and a pointer to the item. +If +.Fa item +is +.Dv NULL , +then +.Fn uma_zfree +does nothing. .Pp The variations .Fn uma_zalloc_arg Modified: projects/binutils-2.17/sys/arm/mv/mv_sata.c ============================================================================== --- projects/binutils-2.17/sys/arm/mv/mv_sata.c Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/sys/arm/mv/mv_sata.c Tue Oct 19 21:02:05 2010 (r214078) @@ -710,7 +710,7 @@ sata_channel_status(device_t dev) if ((icr & SATA_ICR_DEV(ch->unit)) || iecr) { /* Disable EDMA before accessing SATA registers */ sata_edma_ctrl(dev, 0); - ata_sata_phy_check_events(dev); + ata_sata_phy_check_events(dev, -1); /* Ack device and error interrupt */ SATA_OUTL(sc, SATA_ICR, ~SATA_ICR_DEV(ch->unit)); Modified: projects/binutils-2.17/sys/conf/files ============================================================================== --- projects/binutils-2.17/sys/conf/files Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/sys/conf/files Tue Oct 19 21:02:05 2010 (r214078) @@ -2453,6 +2453,7 @@ net80211/ieee80211_power.c optional wlan net80211/ieee80211_proto.c optional wlan net80211/ieee80211_radiotap.c optional wlan net80211/ieee80211_ratectl.c optional wlan +net80211/ieee80211_ratectl_none.c optional wlan net80211/ieee80211_regdomain.c optional wlan net80211/ieee80211_rssadapt.c optional wlan wlan_rssadapt net80211/ieee80211_scan.c optional wlan Modified: projects/binutils-2.17/sys/dev/acpica/acpi.c ============================================================================== --- projects/binutils-2.17/sys/dev/acpica/acpi.c Tue Oct 19 20:53:30 2010 (r214077) +++ projects/binutils-2.17/sys/dev/acpica/acpi.c Tue Oct 19 21:02:05 2010 (r214078) @@ -66,10 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pci_if.h" -#include -#include - #include MALLOC_DEFINE(M_ACPIDEV, "acpidev", "ACPI devices"); @@ -133,8 +129,7 @@ static ACPI_STATUS acpi_device_scan_cb(A void *context, void **retval); static ACPI_STATUS acpi_device_scan_children(device_t bus, device_t dev, int max_depth, acpi_scan_cb_t user_fn, void *arg); -static int acpi_set_powerstate_method(device_t bus, device_t child, - int state); +static int acpi_set_powerstate(device_t child, int state); static int acpi_isa_pnp_probe(device_t bus, device_t child, struct isa_pnp_id *ids); static void acpi_probe_children(device_t bus); @@ -205,9 +200,6 @@ static device_method_t acpi_methods[] = DEVMETHOD(acpi_pwr_for_sleep, acpi_device_pwr_for_sleep), DEVMETHOD(acpi_scan_children, acpi_device_scan_children), - /* PCI emulation */ - DEVMETHOD(pci_set_powerstate, acpi_set_powerstate_method), - /* ISA emulation */ DEVMETHOD(isa_pnp_probe, acpi_isa_pnp_probe), @@ -262,12 +254,6 @@ TUNABLE_INT("debug.acpi.interpreter_slac SYSCTL_INT(_debug_acpi, OID_AUTO, interpreter_slack, CTLFLAG_RDTUN, &acpi_interpreter_slack, 1, "Turn on interpreter slack mode."); -/* Power devices off and on in suspend and resume. XXX Remove once tested. */ -static int acpi_do_powerstate = 1; -TUNABLE_INT("debug.acpi.do_powerstate", &acpi_do_powerstate); -SYSCTL_INT(_debug_acpi, OID_AUTO, do_powerstate, CTLFLAG_RW, - &acpi_do_powerstate, 1, "Turn off devices when suspending."); - /* Reset system clock while resuming. XXX Remove once tested. */ static int acpi_reset_clock = 1; TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock); @@ -668,45 +654,43 @@ acpi_attach(device_t dev) return_VALUE (error); } +static void +acpi_set_power_children(device_t dev, int state) +{ + device_t child, parent; + device_t *devlist; + struct pci_devinfo *dinfo; + int dstate, i, numdevs; + + if (device_get_children(dev, &devlist, &numdevs) != 0) + return; + + /* + * Retrieve and set D-state for the sleep state if _SxD is present. + * Skip children who aren't attached since they are handled separately. + */ + parent = device_get_parent(dev); + for (i = 0; i < numdevs; i++) { + child = devlist[i]; + dinfo = device_get_ivars(child); + dstate = state; + if (device_is_attached(child) && + acpi_device_pwr_for_sleep(parent, dev, &dstate) == 0) + acpi_set_powerstate(child, dstate); + } + free(devlist, M_TEMP); +} + static int acpi_suspend(device_t dev) { - device_t child, *devlist; - int error, i, numdevs, pstate; + int error; GIANT_REQUIRED; - /* First give child devices a chance to suspend. */ error = bus_generic_suspend(dev); - if (error) - return (error); - - /* - * Now, set them into the appropriate power state, usually D3. If the - * device has an _SxD method for the next sleep state, use that power - * state instead. - */ - error = device_get_children(dev, &devlist, &numdevs); - if (error) - return (error); - for (i = 0; i < numdevs; i++) { - /* If the device is not attached, we've powered it down elsewhere. */ - child = devlist[i]; - if (!device_is_attached(child)) - continue; - - /* - * Default to D3 for all sleep states. The _SxD method is optional - * so set the powerstate even if it's absent. - */ - pstate = PCI_POWERSTATE_D3; - error = acpi_device_pwr_for_sleep(device_get_parent(child), - child, &pstate); - if ((error == 0 || error == ESRCH) && acpi_do_powerstate) - pci_set_powerstate(child, pstate); - } - free(devlist, M_TEMP); - error = 0; + if (error == 0) + acpi_set_power_children(dev, ACPI_STATE_D3); return (error); } @@ -714,28 +698,10 @@ acpi_suspend(device_t dev) static int acpi_resume(device_t dev) { - ACPI_HANDLE handle; - int i, numdevs, error; - device_t child, *devlist; GIANT_REQUIRED; - /* - * Put all devices in D0 before resuming them. Call _S0D on each one - * since some systems expect this. - */ - error = device_get_children(dev, &devlist, &numdevs); - if (error) - return (error); - for (i = 0; i < numdevs; i++) { - child = devlist[i]; - handle = acpi_get_handle(child); - if (handle) - AcpiEvaluateObject(handle, "_S0D", NULL, NULL); - if (device_is_attached(child) && acpi_do_powerstate) - pci_set_powerstate(child, PCI_POWERSTATE_D0); - } - free(devlist, M_TEMP); + acpi_set_power_children(dev, ACPI_STATE_D0); return (bus_generic_resume(dev)); } @@ -811,7 +777,7 @@ static void acpi_probe_nomatch(device_t bus, device_t child) { #ifdef ACPI_ENABLE_POWERDOWN_NODRIVER - pci_set_powerstate(child, PCI_POWERSTATE_D3); + acpi_set_powerstate(child, ACPI_STATE_D3); #endif } @@ -833,9 +799,9 @@ acpi_driver_added(device_t dev, driver_t child = devlist[i]; if (device_get_state(child) == DS_NOTPRESENT) { #ifdef ACPI_ENABLE_POWERDOWN_NODRIVER - pci_set_powerstate(child, PCI_POWERSTATE_D0); + acpi_set_powerstate(child, ACPI_STATE_D0); if (device_probe_and_attach(child) != 0) - pci_set_powerstate(child, PCI_POWERSTATE_D3); + acpi_set_powerstate(child, ACPI_STATE_D3); #else device_probe_and_attach(child); #endif @@ -1401,9 +1367,7 @@ acpi_device_pwr_for_sleep(device_t bus, ACPI_HANDLE handle; ACPI_STATUS status; char sxd[8]; - int error; - sc = device_get_softc(bus); handle = acpi_get_handle(dev); /* @@ -1412,7 +1376,7 @@ acpi_device_pwr_for_sleep(device_t bus, * set to D3 and it appears that such legacy devices may * need special handling in their drivers. */ - if (handle == NULL || + if (dstate == NULL || handle == NULL || acpi_MatchHid(handle, "PNP0500") || acpi_MatchHid(handle, "PNP0501") || acpi_MatchHid(handle, "PNP0502") || @@ -1421,28 +1385,19 @@ acpi_device_pwr_for_sleep(device_t bus, return (ENXIO); /* - * Override next state with the value from _SxD, if present. If no - * dstate argument was provided, don't fetch the return value. + * Override next state with the value from _SxD, if present. + * Note illegal _S0D is evaluated because some systems expect this. */ + sc = device_get_softc(bus); snprintf(sxd, sizeof(sxd), "_S%dD", sc->acpi_sstate); - if (dstate) - status = acpi_GetInteger(handle, sxd, dstate); - else - status = AcpiEvaluateObject(handle, sxd, NULL, NULL); - - switch (status) { - case AE_OK: - error = 0; - break; - case AE_NOT_FOUND: - error = ESRCH; - break; - default: - error = ENXIO; - break; + status = acpi_GetInteger(handle, sxd, dstate); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + device_printf(dev, "failed to get %s on %s: %s\n", sxd, + acpi_name(handle), AcpiFormatException(status)); + return (ENXIO); } - return (error); + return (0); } /* Callback arg for our implementation of walking the namespace. */ @@ -1524,13 +1479,11 @@ acpi_device_scan_children(device_t bus, * device power states since it's close enough to ACPI. */ static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***