From owner-svn-src-head@FreeBSD.ORG Sun May 31 01:56:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABDC41065672; Sun, 31 May 2009 01:56:06 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A4AA8FC1C; Sun, 31 May 2009 01:56:06 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4V1u61o026017; Sun, 31 May 2009 01:56:06 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4V1u6Of026016; Sun, 31 May 2009 01:56:06 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200905310156.n4V1u6Of026016@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 31 May 2009 01:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193144 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 01:56:07 -0000 Author: marcel Date: Sun May 31 01:56:06 2009 New Revision: 193144 URL: http://svn.freebsd.org/changeset/base/193144 Log: Mark the cascaded AT interrupt handler as MP safe to avoid having it grab Giant. The next step would be to make it a filter. Modified: head/sys/powerpc/mpc85xx/atpic.c Modified: head/sys/powerpc/mpc85xx/atpic.c ============================================================================== --- head/sys/powerpc/mpc85xx/atpic.c Sun May 31 01:27:27 2009 (r193143) +++ head/sys/powerpc/mpc85xx/atpic.c Sun May 31 01:56:06 2009 (r193144) @@ -211,7 +211,7 @@ atpic_isa_attach(device_t dev) if (sc->sc_ires == NULL) goto fail; - error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_MISC | INTR_FAST, + error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_MISC | INTR_MPSAFE, NULL, atpic_intr, NULL, &sc->sc_icookie); if (error) goto fail; From owner-svn-src-head@FreeBSD.ORG Sun May 31 02:03:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AD5D106564A; Sun, 31 May 2009 02:03:41 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC6FE8FC25; Sun, 31 May 2009 02:03:40 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4V23evC026210; Sun, 31 May 2009 02:03:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4V23ekr026206; Sun, 31 May 2009 02:03:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200905310203.n4V23ekr026206@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 31 May 2009 02:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193145 - in head/lib: libc/arm libc/arm/gen libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 02:03:41 -0000 Author: marcel Date: Sun May 31 02:03:40 2009 New Revision: 193145 URL: http://svn.freebsd.org/changeset/base/193145 Log: Use GCC's __SOFTFP__ to test whether we're being compiled with softfloat or not. Now -msoft-float can be overridden more easily. Modified: head/lib/libc/arm/Makefile.inc head/lib/libc/arm/gen/_setjmp.S head/lib/libc/arm/gen/setjmp.S head/lib/libstand/Makefile Modified: head/lib/libc/arm/Makefile.inc ============================================================================== --- head/lib/libc/arm/Makefile.inc Sun May 31 01:56:06 2009 (r193144) +++ head/lib/libc/arm/Makefile.inc Sun May 31 02:03:40 2009 (r193145) @@ -5,8 +5,6 @@ SOFTFLOAT_BITS=32 -CFLAGS+=-DSOFTFLOAT - # Long double is just double precision. MDSRCS+=machdep_ldisd.c SYM_MAPS+=${.CURDIR}/arm/Symbol.map Modified: head/lib/libc/arm/gen/_setjmp.S ============================================================================== --- head/lib/libc/arm/gen/_setjmp.S Sun May 31 01:56:06 2009 (r193144) +++ head/lib/libc/arm/gen/_setjmp.S Sun May 31 02:03:40 2009 (r193145) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); ENTRY(_setjmp) ldr r1, .L_setjmp_magic str r1, [r0], #4 -#ifdef SOFTFLOAT +#ifdef __SOFTFP__ add r0, r0, #52 #else /* Store fp registers */ @@ -59,7 +59,7 @@ ENTRY(_setjmp) /* Store fpsr */ rfs r1 str r1, [r0], #0x0004 -#endif /* SOFTFLOAT */ +#endif /* __SOFTFP__ */ /* Store integer registers */ stmia r0, {r4-r14} @@ -76,7 +76,7 @@ ENTRY(_longjmp) teq r2, r3 bne botch -#ifdef SOFTFLOAT +#ifdef __SOFTFP__ add r0, r0, #52 #else /* Restore fp registers */ @@ -84,7 +84,7 @@ ENTRY(_longjmp) /* Restore fpsr */ ldr r4, [r0], #0x0004 wfs r4 -#endif /* SOFTFLOAT */ +#endif /* __SOFTFP__ */ /* Restore integer registers */ ldmia r0, {r4-r14} Modified: head/lib/libc/arm/gen/setjmp.S ============================================================================== --- head/lib/libc/arm/gen/setjmp.S Sun May 31 01:56:06 2009 (r193144) +++ head/lib/libc/arm/gen/setjmp.S Sun May 31 02:03:40 2009 (r193145) @@ -58,7 +58,7 @@ ENTRY(setjmp) ldr r1, .Lsetjmp_magic str r1, [r0], #4 -#ifdef SOFTFLOAT +#ifdef __SOFTFP__ add r0, r0, #52 #else /* Store fp registers */ @@ -66,7 +66,7 @@ ENTRY(setjmp) /* Store fpsr */ rfs r1 str r1, [r0], #0x0004 -#endif /*SOFTFLOAT*/ +#endif /* __SOFTFP__ */ /* Store integer registers */ stmia r0, {r4-r14} mov r0, #0x00000000 @@ -98,7 +98,7 @@ ENTRY(__longjmp) ldmfd sp!, {r0, r1, r14} add r0, r0, #4 -#ifdef SOFTFLOAT +#ifdef __SOFTFP__ add r0, r0, #52 #else /* Restore fp registers */ @@ -106,7 +106,7 @@ ENTRY(__longjmp) /* Restore FPSR */ ldr r4, [r0], #0x0004 wfs r4 -#endif /* SOFTFLOAT */ +#endif /* __SOFTFP__ */ /* Restore integer registers */ ldmia r0, {r4-r14} Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Sun May 31 01:56:06 2009 (r193144) +++ head/lib/libstand/Makefile Sun May 31 02:03:40 2009 (r193145) @@ -35,7 +35,7 @@ CFLAGS+= -msoft-float -D_STANDALONE CFLAGS+= -m32 -I. .endif .if ${MACHINE_ARCH} == "arm" -CFLAGS+= -msoft-float -DSOFTFLOAT -D_STANDALONE +CFLAGS+= -msoft-float -D_STANDALONE .endif # standalone components and stuff we have modified locally From owner-svn-src-head@FreeBSD.ORG Sun May 31 05:42:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 860B9106566C; Sun, 31 May 2009 05:42:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE8F8FC0A; Sun, 31 May 2009 05:42:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4V5gxGP030722; Sun, 31 May 2009 05:42:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4V5gxtB030719; Sun, 31 May 2009 05:42:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200905310542.n4V5gxtB030719@svn.freebsd.org> From: Doug Barton Date: Sun, 31 May 2009 05:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193149 - in head: contrib/bind9 contrib/bind9/bin contrib/bind9/bin/check contrib/bind9/bin/dig contrib/bind9/bin/dig/include/dig contrib/bind9/bin/dnssec contrib/bind9/bin/named contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 05:43:00 -0000 Author: dougb Date: Sun May 31 05:42:58 2009 New Revision: 193149 URL: http://svn.freebsd.org/changeset/base/193149 Log: Update BIND to version 9.6.1rc1. This version has better performance and lots of new features compared to 9.4.x, including: Full NSEC3 support Automatic zone re-signing New update-policy methods tcp-self and 6to4-self DHCID support. More detailed statistics counters including those supported in BIND 8. Faster ACL processing. Efficient LRU cache-cleaning mechanism. NSID support. Added: head/contrib/bind9/NSEC3-NOTES - copied unchanged from r193141, vendor/bind9/dist/NSEC3-NOTES head/contrib/bind9/README.pkcs11 - copied unchanged from r193141, vendor/bind9/dist/README.pkcs11 head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.8 - copied unchanged from r193141, vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.8 head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.c - copied unchanged from r193141, vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.c head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.docbook - copied unchanged from r193141, vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.docbook head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.html - copied unchanged from r193141, vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.html head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.8 - copied unchanged from r193141, vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.8 head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c - copied unchanged from r193141, vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.c head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook - copied unchanged from r193141, vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.docbook head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.html - copied unchanged from r193141, vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.html head/contrib/bind9/bin/named/bind9.xsl - copied unchanged from r193141, vendor/bind9/dist/bin/named/bind9.xsl head/contrib/bind9/bin/named/bind9.xsl.h - copied unchanged from r193141, vendor/bind9/dist/bin/named/bind9.xsl.h head/contrib/bind9/bin/named/convertxsl.pl - copied unchanged from r193141, vendor/bind9/dist/bin/named/convertxsl.pl head/contrib/bind9/bin/named/include/named/statschannel.h - copied unchanged from r193141, vendor/bind9/dist/bin/named/include/named/statschannel.h head/contrib/bind9/bin/named/statschannel.c - copied unchanged from r193141, vendor/bind9/dist/bin/named/statschannel.c head/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html - copied unchanged from r193141, vendor/bind9/dist/doc/arm/man.dnssec-dsfromkey.html head/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html - copied unchanged from r193141, vendor/bind9/dist/doc/arm/man.dnssec-keyfromlabel.html head/contrib/bind9/doc/arm/man.nsupdate.html - copied unchanged from r193141, vendor/bind9/dist/doc/arm/man.nsupdate.html head/contrib/bind9/lib/dns/include/dns/iptable.h - copied unchanged from r193141, vendor/bind9/dist/lib/dns/include/dns/iptable.h head/contrib/bind9/lib/dns/include/dns/nsec3.h - copied unchanged from r193141, vendor/bind9/dist/lib/dns/include/dns/nsec3.h head/contrib/bind9/lib/dns/iptable.c - copied unchanged from r193141, vendor/bind9/dist/lib/dns/iptable.c head/contrib/bind9/lib/dns/nsec3.c - copied unchanged from r193141, vendor/bind9/dist/lib/dns/nsec3.c head/contrib/bind9/lib/dns/rdata/generic/nsec3_50.c - copied unchanged from r193141, vendor/bind9/dist/lib/dns/rdata/generic/nsec3_50.c head/contrib/bind9/lib/dns/rdata/generic/nsec3_50.h - copied unchanged from r193141, vendor/bind9/dist/lib/dns/rdata/generic/nsec3_50.h head/contrib/bind9/lib/dns/rdata/generic/nsec3param_51.c - copied unchanged from r193141, vendor/bind9/dist/lib/dns/rdata/generic/nsec3param_51.c head/contrib/bind9/lib/dns/rdata/generic/nsec3param_51.h - copied unchanged from r193141, vendor/bind9/dist/lib/dns/rdata/generic/nsec3param_51.h head/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.c - copied unchanged from r193141, vendor/bind9/dist/lib/dns/rdata/in_1/dhcid_49.c head/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.h - copied unchanged from r193141, vendor/bind9/dist/lib/dns/rdata/in_1/dhcid_49.h head/contrib/bind9/lib/dns/spnego.asn1 - copied unchanged from r193141, vendor/bind9/dist/lib/dns/spnego.asn1 head/contrib/bind9/lib/dns/spnego.c - copied unchanged from r193141, vendor/bind9/dist/lib/dns/spnego.c head/contrib/bind9/lib/dns/spnego.h - copied unchanged from r193141, vendor/bind9/dist/lib/dns/spnego.h head/contrib/bind9/lib/dns/spnego_asn1.c - copied unchanged from r193141, vendor/bind9/dist/lib/dns/spnego_asn1.c head/contrib/bind9/lib/dns/spnego_asn1.pl - copied unchanged from r193141, vendor/bind9/dist/lib/dns/spnego_asn1.pl head/contrib/bind9/lib/isc/base32.c - copied unchanged from r193141, vendor/bind9/dist/lib/isc/base32.c head/contrib/bind9/lib/isc/httpd.c - copied unchanged from r193141, vendor/bind9/dist/lib/isc/httpd.c head/contrib/bind9/lib/isc/include/isc/base32.h - copied unchanged from r193141, vendor/bind9/dist/lib/isc/include/isc/base32.h head/contrib/bind9/lib/isc/include/isc/httpd.h - copied unchanged from r193141, vendor/bind9/dist/lib/isc/include/isc/httpd.h head/contrib/bind9/lib/isc/include/isc/iterated_hash.h - copied unchanged from r193141, vendor/bind9/dist/lib/isc/include/isc/iterated_hash.h head/contrib/bind9/lib/isc/include/isc/radix.h - copied unchanged from r193141, vendor/bind9/dist/lib/isc/include/isc/radix.h head/contrib/bind9/lib/isc/include/isc/stats.h - copied unchanged from r193141, vendor/bind9/dist/lib/isc/include/isc/stats.h head/contrib/bind9/lib/isc/include/isc/xml.h - copied unchanged from r193141, vendor/bind9/dist/lib/isc/include/isc/xml.h head/contrib/bind9/lib/isc/iterated_hash.c - copied unchanged from r193141, vendor/bind9/dist/lib/isc/iterated_hash.c head/contrib/bind9/lib/isc/radix.c - copied unchanged from r193141, vendor/bind9/dist/lib/isc/radix.c head/contrib/bind9/lib/isc/stats.c - copied unchanged from r193141, vendor/bind9/dist/lib/isc/stats.c head/usr.sbin/dnssec-dsfromkey/ head/usr.sbin/dnssec-dsfromkey/Makefile (contents, props changed) head/usr.sbin/dnssec-keyfromlabel/ head/usr.sbin/dnssec-keyfromlabel/Makefile (contents, props changed) Deleted: head/contrib/bind9/doc/draft/ head/contrib/bind9/doc/rfc/ head/contrib/bind9/isc-config.sh.in head/contrib/bind9/lib/bind/ head/lib/bind/bind/ Modified: head/contrib/bind9/ (props changed) head/contrib/bind9/CHANGES head/contrib/bind9/COPYRIGHT head/contrib/bind9/FAQ head/contrib/bind9/FAQ.xml head/contrib/bind9/Makefile.in head/contrib/bind9/README head/contrib/bind9/README.idnkit head/contrib/bind9/acconfig.h head/contrib/bind9/bin/Makefile.in head/contrib/bind9/bin/check/Makefile.in head/contrib/bind9/bin/check/check-tool.c head/contrib/bind9/bin/check/check-tool.h head/contrib/bind9/bin/check/named-checkconf.8 head/contrib/bind9/bin/check/named-checkconf.c head/contrib/bind9/bin/check/named-checkconf.docbook head/contrib/bind9/bin/check/named-checkconf.html head/contrib/bind9/bin/check/named-checkzone.8 head/contrib/bind9/bin/check/named-checkzone.c head/contrib/bind9/bin/check/named-checkzone.docbook head/contrib/bind9/bin/check/named-checkzone.html head/contrib/bind9/bin/dig/Makefile.in head/contrib/bind9/bin/dig/dig.1 head/contrib/bind9/bin/dig/dig.c head/contrib/bind9/bin/dig/dig.docbook head/contrib/bind9/bin/dig/dig.html head/contrib/bind9/bin/dig/dighost.c head/contrib/bind9/bin/dig/host.1 head/contrib/bind9/bin/dig/host.c head/contrib/bind9/bin/dig/host.docbook head/contrib/bind9/bin/dig/host.html head/contrib/bind9/bin/dig/include/dig/dig.h head/contrib/bind9/bin/dig/nslookup.1 head/contrib/bind9/bin/dig/nslookup.c head/contrib/bind9/bin/dig/nslookup.docbook head/contrib/bind9/bin/dig/nslookup.html head/contrib/bind9/bin/dnssec/Makefile.in head/contrib/bind9/bin/dnssec/dnssec-keygen.8 head/contrib/bind9/bin/dnssec/dnssec-keygen.c head/contrib/bind9/bin/dnssec/dnssec-keygen.docbook head/contrib/bind9/bin/dnssec/dnssec-keygen.html head/contrib/bind9/bin/dnssec/dnssec-signzone.8 head/contrib/bind9/bin/dnssec/dnssec-signzone.c head/contrib/bind9/bin/dnssec/dnssec-signzone.docbook head/contrib/bind9/bin/dnssec/dnssec-signzone.html head/contrib/bind9/bin/dnssec/dnssectool.c head/contrib/bind9/bin/dnssec/dnssectool.h head/contrib/bind9/bin/named/Makefile.in head/contrib/bind9/bin/named/builtin.c head/contrib/bind9/bin/named/client.c head/contrib/bind9/bin/named/config.c head/contrib/bind9/bin/named/control.c head/contrib/bind9/bin/named/controlconf.c head/contrib/bind9/bin/named/include/named/builtin.h head/contrib/bind9/bin/named/include/named/client.h head/contrib/bind9/bin/named/include/named/config.h head/contrib/bind9/bin/named/include/named/control.h head/contrib/bind9/bin/named/include/named/globals.h head/contrib/bind9/bin/named/include/named/interfacemgr.h head/contrib/bind9/bin/named/include/named/listenlist.h head/contrib/bind9/bin/named/include/named/log.h head/contrib/bind9/bin/named/include/named/logconf.h head/contrib/bind9/bin/named/include/named/lwaddr.h head/contrib/bind9/bin/named/include/named/lwdclient.h head/contrib/bind9/bin/named/include/named/lwresd.h head/contrib/bind9/bin/named/include/named/lwsearch.h head/contrib/bind9/bin/named/include/named/main.h head/contrib/bind9/bin/named/include/named/notify.h head/contrib/bind9/bin/named/include/named/ns_smf_globals.h head/contrib/bind9/bin/named/include/named/query.h head/contrib/bind9/bin/named/include/named/server.h head/contrib/bind9/bin/named/include/named/sortlist.h head/contrib/bind9/bin/named/include/named/tkeyconf.h head/contrib/bind9/bin/named/include/named/tsigconf.h head/contrib/bind9/bin/named/include/named/types.h head/contrib/bind9/bin/named/include/named/update.h head/contrib/bind9/bin/named/include/named/xfrout.h head/contrib/bind9/bin/named/include/named/zoneconf.h head/contrib/bind9/bin/named/interfacemgr.c head/contrib/bind9/bin/named/listenlist.c head/contrib/bind9/bin/named/log.c head/contrib/bind9/bin/named/logconf.c head/contrib/bind9/bin/named/lwaddr.c head/contrib/bind9/bin/named/lwdclient.c head/contrib/bind9/bin/named/lwderror.c head/contrib/bind9/bin/named/lwdgabn.c head/contrib/bind9/bin/named/lwdgnba.c head/contrib/bind9/bin/named/lwdgrbn.c head/contrib/bind9/bin/named/lwdnoop.c head/contrib/bind9/bin/named/lwresd.8 head/contrib/bind9/bin/named/lwresd.c head/contrib/bind9/bin/named/lwresd.docbook head/contrib/bind9/bin/named/lwresd.html head/contrib/bind9/bin/named/lwsearch.c head/contrib/bind9/bin/named/main.c head/contrib/bind9/bin/named/named.8 head/contrib/bind9/bin/named/named.conf.5 head/contrib/bind9/bin/named/named.conf.docbook head/contrib/bind9/bin/named/named.conf.html head/contrib/bind9/bin/named/named.docbook head/contrib/bind9/bin/named/named.html head/contrib/bind9/bin/named/notify.c head/contrib/bind9/bin/named/query.c head/contrib/bind9/bin/named/server.c head/contrib/bind9/bin/named/sortlist.c head/contrib/bind9/bin/named/tkeyconf.c head/contrib/bind9/bin/named/tsigconf.c head/contrib/bind9/bin/named/unix/Makefile.in head/contrib/bind9/bin/named/unix/include/named/os.h head/contrib/bind9/bin/named/unix/os.c head/contrib/bind9/bin/named/update.c head/contrib/bind9/bin/named/xfrout.c head/contrib/bind9/bin/named/zoneconf.c head/contrib/bind9/bin/nsupdate/Makefile.in head/contrib/bind9/bin/nsupdate/nsupdate.1 head/contrib/bind9/bin/nsupdate/nsupdate.c head/contrib/bind9/bin/nsupdate/nsupdate.docbook head/contrib/bind9/bin/nsupdate/nsupdate.html head/contrib/bind9/bin/rndc/Makefile.in head/contrib/bind9/bin/rndc/include/rndc/os.h head/contrib/bind9/bin/rndc/rndc-confgen.8 head/contrib/bind9/bin/rndc/rndc-confgen.c head/contrib/bind9/bin/rndc/rndc-confgen.docbook head/contrib/bind9/bin/rndc/rndc-confgen.html head/contrib/bind9/bin/rndc/rndc.8 head/contrib/bind9/bin/rndc/rndc.c head/contrib/bind9/bin/rndc/rndc.conf head/contrib/bind9/bin/rndc/rndc.conf.5 head/contrib/bind9/bin/rndc/rndc.conf.docbook head/contrib/bind9/bin/rndc/rndc.conf.html head/contrib/bind9/bin/rndc/rndc.docbook head/contrib/bind9/bin/rndc/rndc.html head/contrib/bind9/bin/rndc/unix/Makefile.in head/contrib/bind9/bin/rndc/unix/os.c head/contrib/bind9/bin/rndc/util.c head/contrib/bind9/bin/rndc/util.h head/contrib/bind9/config.guess head/contrib/bind9/config.h.in head/contrib/bind9/configure.in head/contrib/bind9/doc/Makefile.in head/contrib/bind9/doc/arm/Bv9ARM-book.xml head/contrib/bind9/doc/arm/Bv9ARM.ch01.html head/contrib/bind9/doc/arm/Bv9ARM.ch02.html head/contrib/bind9/doc/arm/Bv9ARM.ch03.html head/contrib/bind9/doc/arm/Bv9ARM.ch04.html head/contrib/bind9/doc/arm/Bv9ARM.ch05.html head/contrib/bind9/doc/arm/Bv9ARM.ch06.html head/contrib/bind9/doc/arm/Bv9ARM.ch07.html head/contrib/bind9/doc/arm/Bv9ARM.ch08.html head/contrib/bind9/doc/arm/Bv9ARM.ch09.html head/contrib/bind9/doc/arm/Bv9ARM.ch10.html head/contrib/bind9/doc/arm/Bv9ARM.html head/contrib/bind9/doc/arm/Bv9ARM.pdf head/contrib/bind9/doc/arm/Makefile.in head/contrib/bind9/doc/arm/man.dig.html head/contrib/bind9/doc/arm/man.dnssec-keygen.html head/contrib/bind9/doc/arm/man.dnssec-signzone.html head/contrib/bind9/doc/arm/man.host.html head/contrib/bind9/doc/arm/man.named-checkconf.html head/contrib/bind9/doc/arm/man.named-checkzone.html head/contrib/bind9/doc/arm/man.named.html head/contrib/bind9/doc/arm/man.rndc-confgen.html head/contrib/bind9/doc/arm/man.rndc.conf.html head/contrib/bind9/doc/arm/man.rndc.html head/contrib/bind9/doc/misc/Makefile.in head/contrib/bind9/doc/misc/format-options.pl head/contrib/bind9/doc/misc/ipv6 head/contrib/bind9/doc/misc/migration head/contrib/bind9/doc/misc/options head/contrib/bind9/doc/misc/sort-options.pl head/contrib/bind9/lib/Makefile.in head/contrib/bind9/lib/bind9/Makefile.in head/contrib/bind9/lib/bind9/api head/contrib/bind9/lib/bind9/check.c head/contrib/bind9/lib/bind9/getaddresses.c head/contrib/bind9/lib/bind9/include/Makefile.in head/contrib/bind9/lib/bind9/include/bind9/Makefile.in head/contrib/bind9/lib/bind9/include/bind9/check.h head/contrib/bind9/lib/bind9/include/bind9/getaddresses.h head/contrib/bind9/lib/bind9/include/bind9/version.h head/contrib/bind9/lib/bind9/version.c head/contrib/bind9/lib/dns/Makefile.in head/contrib/bind9/lib/dns/acache.c head/contrib/bind9/lib/dns/acl.c head/contrib/bind9/lib/dns/adb.c head/contrib/bind9/lib/dns/api head/contrib/bind9/lib/dns/byaddr.c head/contrib/bind9/lib/dns/cache.c head/contrib/bind9/lib/dns/callbacks.c head/contrib/bind9/lib/dns/compress.c head/contrib/bind9/lib/dns/db.c head/contrib/bind9/lib/dns/dbiterator.c head/contrib/bind9/lib/dns/dbtable.c head/contrib/bind9/lib/dns/diff.c head/contrib/bind9/lib/dns/dispatch.c head/contrib/bind9/lib/dns/dlz.c head/contrib/bind9/lib/dns/dnssec.c head/contrib/bind9/lib/dns/ds.c head/contrib/bind9/lib/dns/dst_api.c head/contrib/bind9/lib/dns/dst_internal.h head/contrib/bind9/lib/dns/dst_lib.c head/contrib/bind9/lib/dns/dst_openssl.h head/contrib/bind9/lib/dns/dst_parse.c head/contrib/bind9/lib/dns/dst_parse.h head/contrib/bind9/lib/dns/dst_result.c head/contrib/bind9/lib/dns/forward.c head/contrib/bind9/lib/dns/gen-unix.h head/contrib/bind9/lib/dns/gen.c head/contrib/bind9/lib/dns/gssapi_link.c head/contrib/bind9/lib/dns/gssapictx.c head/contrib/bind9/lib/dns/hmac_link.c head/contrib/bind9/lib/dns/include/Makefile.in head/contrib/bind9/lib/dns/include/dns/Makefile.in head/contrib/bind9/lib/dns/include/dns/acache.h head/contrib/bind9/lib/dns/include/dns/acl.h head/contrib/bind9/lib/dns/include/dns/adb.h head/contrib/bind9/lib/dns/include/dns/bit.h head/contrib/bind9/lib/dns/include/dns/byaddr.h head/contrib/bind9/lib/dns/include/dns/cache.h head/contrib/bind9/lib/dns/include/dns/callbacks.h head/contrib/bind9/lib/dns/include/dns/cert.h head/contrib/bind9/lib/dns/include/dns/compress.h head/contrib/bind9/lib/dns/include/dns/db.h head/contrib/bind9/lib/dns/include/dns/dbiterator.h head/contrib/bind9/lib/dns/include/dns/dbtable.h head/contrib/bind9/lib/dns/include/dns/diff.h head/contrib/bind9/lib/dns/include/dns/dispatch.h head/contrib/bind9/lib/dns/include/dns/dlz.h head/contrib/bind9/lib/dns/include/dns/dnssec.h head/contrib/bind9/lib/dns/include/dns/ds.h head/contrib/bind9/lib/dns/include/dns/events.h head/contrib/bind9/lib/dns/include/dns/fixedname.h head/contrib/bind9/lib/dns/include/dns/forward.h head/contrib/bind9/lib/dns/include/dns/journal.h head/contrib/bind9/lib/dns/include/dns/keyflags.h head/contrib/bind9/lib/dns/include/dns/keytable.h head/contrib/bind9/lib/dns/include/dns/keyvalues.h head/contrib/bind9/lib/dns/include/dns/lib.h head/contrib/bind9/lib/dns/include/dns/log.h head/contrib/bind9/lib/dns/include/dns/lookup.h head/contrib/bind9/lib/dns/include/dns/master.h head/contrib/bind9/lib/dns/include/dns/masterdump.h head/contrib/bind9/lib/dns/include/dns/message.h head/contrib/bind9/lib/dns/include/dns/name.h head/contrib/bind9/lib/dns/include/dns/ncache.h head/contrib/bind9/lib/dns/include/dns/nsec.h head/contrib/bind9/lib/dns/include/dns/opcode.h head/contrib/bind9/lib/dns/include/dns/order.h head/contrib/bind9/lib/dns/include/dns/peer.h head/contrib/bind9/lib/dns/include/dns/portlist.h head/contrib/bind9/lib/dns/include/dns/rbt.h head/contrib/bind9/lib/dns/include/dns/rcode.h head/contrib/bind9/lib/dns/include/dns/rdata.h head/contrib/bind9/lib/dns/include/dns/rdataclass.h head/contrib/bind9/lib/dns/include/dns/rdatalist.h head/contrib/bind9/lib/dns/include/dns/rdataset.h head/contrib/bind9/lib/dns/include/dns/rdatasetiter.h head/contrib/bind9/lib/dns/include/dns/rdataslab.h head/contrib/bind9/lib/dns/include/dns/rdatatype.h head/contrib/bind9/lib/dns/include/dns/request.h head/contrib/bind9/lib/dns/include/dns/resolver.h head/contrib/bind9/lib/dns/include/dns/result.h head/contrib/bind9/lib/dns/include/dns/rootns.h head/contrib/bind9/lib/dns/include/dns/sdb.h head/contrib/bind9/lib/dns/include/dns/sdlz.h head/contrib/bind9/lib/dns/include/dns/secalg.h head/contrib/bind9/lib/dns/include/dns/secproto.h head/contrib/bind9/lib/dns/include/dns/soa.h head/contrib/bind9/lib/dns/include/dns/ssu.h head/contrib/bind9/lib/dns/include/dns/stats.h head/contrib/bind9/lib/dns/include/dns/tcpmsg.h head/contrib/bind9/lib/dns/include/dns/time.h head/contrib/bind9/lib/dns/include/dns/timer.h head/contrib/bind9/lib/dns/include/dns/tkey.h head/contrib/bind9/lib/dns/include/dns/tsig.h head/contrib/bind9/lib/dns/include/dns/ttl.h head/contrib/bind9/lib/dns/include/dns/types.h head/contrib/bind9/lib/dns/include/dns/validator.h head/contrib/bind9/lib/dns/include/dns/version.h head/contrib/bind9/lib/dns/include/dns/view.h head/contrib/bind9/lib/dns/include/dns/xfrin.h head/contrib/bind9/lib/dns/include/dns/zone.h head/contrib/bind9/lib/dns/include/dns/zonekey.h head/contrib/bind9/lib/dns/include/dns/zt.h head/contrib/bind9/lib/dns/include/dst/Makefile.in head/contrib/bind9/lib/dns/include/dst/dst.h head/contrib/bind9/lib/dns/include/dst/gssapi.h head/contrib/bind9/lib/dns/include/dst/lib.h head/contrib/bind9/lib/dns/include/dst/result.h head/contrib/bind9/lib/dns/journal.c head/contrib/bind9/lib/dns/key.c head/contrib/bind9/lib/dns/keytable.c head/contrib/bind9/lib/dns/lib.c head/contrib/bind9/lib/dns/log.c head/contrib/bind9/lib/dns/lookup.c head/contrib/bind9/lib/dns/master.c head/contrib/bind9/lib/dns/masterdump.c head/contrib/bind9/lib/dns/message.c head/contrib/bind9/lib/dns/name.c head/contrib/bind9/lib/dns/ncache.c head/contrib/bind9/lib/dns/nsec.c head/contrib/bind9/lib/dns/openssl_link.c head/contrib/bind9/lib/dns/openssldh_link.c head/contrib/bind9/lib/dns/openssldsa_link.c head/contrib/bind9/lib/dns/opensslrsa_link.c head/contrib/bind9/lib/dns/order.c head/contrib/bind9/lib/dns/peer.c head/contrib/bind9/lib/dns/portlist.c head/contrib/bind9/lib/dns/rbt.c head/contrib/bind9/lib/dns/rbtdb.c head/contrib/bind9/lib/dns/rbtdb.h head/contrib/bind9/lib/dns/rbtdb64.c head/contrib/bind9/lib/dns/rbtdb64.h head/contrib/bind9/lib/dns/rcode.c head/contrib/bind9/lib/dns/rdata.c head/contrib/bind9/lib/dns/rdata/any_255/tsig_250.c head/contrib/bind9/lib/dns/rdata/any_255/tsig_250.h head/contrib/bind9/lib/dns/rdata/ch_3/a_1.c head/contrib/bind9/lib/dns/rdata/ch_3/a_1.h head/contrib/bind9/lib/dns/rdata/generic/afsdb_18.c head/contrib/bind9/lib/dns/rdata/generic/afsdb_18.h head/contrib/bind9/lib/dns/rdata/generic/cert_37.c head/contrib/bind9/lib/dns/rdata/generic/cert_37.h head/contrib/bind9/lib/dns/rdata/generic/cname_5.c head/contrib/bind9/lib/dns/rdata/generic/cname_5.h head/contrib/bind9/lib/dns/rdata/generic/dlv_32769.c head/contrib/bind9/lib/dns/rdata/generic/dlv_32769.h head/contrib/bind9/lib/dns/rdata/generic/dname_39.c head/contrib/bind9/lib/dns/rdata/generic/dname_39.h head/contrib/bind9/lib/dns/rdata/generic/dnskey_48.c head/contrib/bind9/lib/dns/rdata/generic/dnskey_48.h head/contrib/bind9/lib/dns/rdata/generic/ds_43.c head/contrib/bind9/lib/dns/rdata/generic/ds_43.h head/contrib/bind9/lib/dns/rdata/generic/gpos_27.c head/contrib/bind9/lib/dns/rdata/generic/gpos_27.h head/contrib/bind9/lib/dns/rdata/generic/hinfo_13.c head/contrib/bind9/lib/dns/rdata/generic/hinfo_13.h head/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.c head/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.h head/contrib/bind9/lib/dns/rdata/generic/isdn_20.c head/contrib/bind9/lib/dns/rdata/generic/isdn_20.h head/contrib/bind9/lib/dns/rdata/generic/key_25.c head/contrib/bind9/lib/dns/rdata/generic/key_25.h head/contrib/bind9/lib/dns/rdata/generic/loc_29.c head/contrib/bind9/lib/dns/rdata/generic/loc_29.h head/contrib/bind9/lib/dns/rdata/generic/mb_7.c head/contrib/bind9/lib/dns/rdata/generic/mb_7.h head/contrib/bind9/lib/dns/rdata/generic/md_3.c head/contrib/bind9/lib/dns/rdata/generic/md_3.h head/contrib/bind9/lib/dns/rdata/generic/mf_4.c head/contrib/bind9/lib/dns/rdata/generic/mf_4.h head/contrib/bind9/lib/dns/rdata/generic/mg_8.c head/contrib/bind9/lib/dns/rdata/generic/mg_8.h head/contrib/bind9/lib/dns/rdata/generic/minfo_14.c head/contrib/bind9/lib/dns/rdata/generic/minfo_14.h head/contrib/bind9/lib/dns/rdata/generic/mr_9.c head/contrib/bind9/lib/dns/rdata/generic/mr_9.h head/contrib/bind9/lib/dns/rdata/generic/mx_15.c head/contrib/bind9/lib/dns/rdata/generic/mx_15.h head/contrib/bind9/lib/dns/rdata/generic/ns_2.c head/contrib/bind9/lib/dns/rdata/generic/ns_2.h head/contrib/bind9/lib/dns/rdata/generic/nsec_47.c head/contrib/bind9/lib/dns/rdata/generic/nsec_47.h head/contrib/bind9/lib/dns/rdata/generic/null_10.c head/contrib/bind9/lib/dns/rdata/generic/null_10.h head/contrib/bind9/lib/dns/rdata/generic/nxt_30.c head/contrib/bind9/lib/dns/rdata/generic/nxt_30.h head/contrib/bind9/lib/dns/rdata/generic/opt_41.c head/contrib/bind9/lib/dns/rdata/generic/opt_41.h head/contrib/bind9/lib/dns/rdata/generic/proforma.c head/contrib/bind9/lib/dns/rdata/generic/proforma.h head/contrib/bind9/lib/dns/rdata/generic/ptr_12.c head/contrib/bind9/lib/dns/rdata/generic/ptr_12.h head/contrib/bind9/lib/dns/rdata/generic/rp_17.c head/contrib/bind9/lib/dns/rdata/generic/rp_17.h head/contrib/bind9/lib/dns/rdata/generic/rrsig_46.c head/contrib/bind9/lib/dns/rdata/generic/rrsig_46.h head/contrib/bind9/lib/dns/rdata/generic/rt_21.c head/contrib/bind9/lib/dns/rdata/generic/rt_21.h head/contrib/bind9/lib/dns/rdata/generic/sig_24.c head/contrib/bind9/lib/dns/rdata/generic/sig_24.h head/contrib/bind9/lib/dns/rdata/generic/soa_6.c head/contrib/bind9/lib/dns/rdata/generic/soa_6.h head/contrib/bind9/lib/dns/rdata/generic/spf_99.c head/contrib/bind9/lib/dns/rdata/generic/spf_99.h head/contrib/bind9/lib/dns/rdata/generic/sshfp_44.c head/contrib/bind9/lib/dns/rdata/generic/sshfp_44.h head/contrib/bind9/lib/dns/rdata/generic/tkey_249.c head/contrib/bind9/lib/dns/rdata/generic/tkey_249.h head/contrib/bind9/lib/dns/rdata/generic/txt_16.c head/contrib/bind9/lib/dns/rdata/generic/txt_16.h head/contrib/bind9/lib/dns/rdata/generic/unspec_103.c head/contrib/bind9/lib/dns/rdata/generic/unspec_103.h head/contrib/bind9/lib/dns/rdata/generic/x25_19.c head/contrib/bind9/lib/dns/rdata/generic/x25_19.h head/contrib/bind9/lib/dns/rdata/hs_4/a_1.c head/contrib/bind9/lib/dns/rdata/hs_4/a_1.h head/contrib/bind9/lib/dns/rdata/in_1/a6_38.c head/contrib/bind9/lib/dns/rdata/in_1/a6_38.h head/contrib/bind9/lib/dns/rdata/in_1/a_1.c head/contrib/bind9/lib/dns/rdata/in_1/a_1.h head/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.c head/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.h head/contrib/bind9/lib/dns/rdata/in_1/apl_42.c head/contrib/bind9/lib/dns/rdata/in_1/apl_42.h head/contrib/bind9/lib/dns/rdata/in_1/kx_36.c head/contrib/bind9/lib/dns/rdata/in_1/kx_36.h head/contrib/bind9/lib/dns/rdata/in_1/naptr_35.c head/contrib/bind9/lib/dns/rdata/in_1/naptr_35.h head/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.c head/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.h head/contrib/bind9/lib/dns/rdata/in_1/nsap_22.c head/contrib/bind9/lib/dns/rdata/in_1/nsap_22.h head/contrib/bind9/lib/dns/rdata/in_1/px_26.c head/contrib/bind9/lib/dns/rdata/in_1/px_26.h head/contrib/bind9/lib/dns/rdata/in_1/srv_33.c head/contrib/bind9/lib/dns/rdata/in_1/srv_33.h head/contrib/bind9/lib/dns/rdata/in_1/wks_11.c head/contrib/bind9/lib/dns/rdata/in_1/wks_11.h head/contrib/bind9/lib/dns/rdata/rdatastructpre.h head/contrib/bind9/lib/dns/rdata/rdatastructsuf.h head/contrib/bind9/lib/dns/rdatalist.c head/contrib/bind9/lib/dns/rdatalist_p.h head/contrib/bind9/lib/dns/rdataset.c head/contrib/bind9/lib/dns/rdatasetiter.c head/contrib/bind9/lib/dns/rdataslab.c head/contrib/bind9/lib/dns/request.c head/contrib/bind9/lib/dns/resolver.c head/contrib/bind9/lib/dns/result.c head/contrib/bind9/lib/dns/rootns.c head/contrib/bind9/lib/dns/sdb.c head/contrib/bind9/lib/dns/sdlz.c head/contrib/bind9/lib/dns/soa.c head/contrib/bind9/lib/dns/ssu.c head/contrib/bind9/lib/dns/stats.c head/contrib/bind9/lib/dns/tcpmsg.c head/contrib/bind9/lib/dns/time.c head/contrib/bind9/lib/dns/timer.c head/contrib/bind9/lib/dns/tkey.c head/contrib/bind9/lib/dns/tsig.c head/contrib/bind9/lib/dns/ttl.c head/contrib/bind9/lib/dns/validator.c head/contrib/bind9/lib/dns/version.c head/contrib/bind9/lib/dns/view.c head/contrib/bind9/lib/dns/xfrin.c head/contrib/bind9/lib/dns/zone.c head/contrib/bind9/lib/dns/zonekey.c head/contrib/bind9/lib/dns/zt.c head/contrib/bind9/lib/isc/Makefile.in head/contrib/bind9/lib/isc/alpha/Makefile.in head/contrib/bind9/lib/isc/alpha/include/Makefile.in head/contrib/bind9/lib/isc/alpha/include/isc/Makefile.in head/contrib/bind9/lib/isc/alpha/include/isc/atomic.h head/contrib/bind9/lib/isc/api head/contrib/bind9/lib/isc/assertions.c head/contrib/bind9/lib/isc/base64.c head/contrib/bind9/lib/isc/bitstring.c head/contrib/bind9/lib/isc/buffer.c head/contrib/bind9/lib/isc/bufferlist.c head/contrib/bind9/lib/isc/commandline.c head/contrib/bind9/lib/isc/entropy.c head/contrib/bind9/lib/isc/error.c head/contrib/bind9/lib/isc/event.c head/contrib/bind9/lib/isc/fsaccess.c head/contrib/bind9/lib/isc/hash.c head/contrib/bind9/lib/isc/heap.c head/contrib/bind9/lib/isc/hex.c head/contrib/bind9/lib/isc/hmacmd5.c head/contrib/bind9/lib/isc/hmacsha.c head/contrib/bind9/lib/isc/ia64/Makefile.in head/contrib/bind9/lib/isc/ia64/include/Makefile.in head/contrib/bind9/lib/isc/ia64/include/isc/Makefile.in head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h head/contrib/bind9/lib/isc/include/Makefile.in head/contrib/bind9/lib/isc/include/isc/Makefile.in head/contrib/bind9/lib/isc/include/isc/app.h head/contrib/bind9/lib/isc/include/isc/assertions.h head/contrib/bind9/lib/isc/include/isc/base64.h head/contrib/bind9/lib/isc/include/isc/bitstring.h head/contrib/bind9/lib/isc/include/isc/boolean.h head/contrib/bind9/lib/isc/include/isc/buffer.h head/contrib/bind9/lib/isc/include/isc/bufferlist.h head/contrib/bind9/lib/isc/include/isc/commandline.h head/contrib/bind9/lib/isc/include/isc/entropy.h head/contrib/bind9/lib/isc/include/isc/error.h head/contrib/bind9/lib/isc/include/isc/event.h head/contrib/bind9/lib/isc/include/isc/eventclass.h head/contrib/bind9/lib/isc/include/isc/file.h head/contrib/bind9/lib/isc/include/isc/formatcheck.h head/contrib/bind9/lib/isc/include/isc/fsaccess.h head/contrib/bind9/lib/isc/include/isc/hash.h head/contrib/bind9/lib/isc/include/isc/heap.h head/contrib/bind9/lib/isc/include/isc/hex.h head/contrib/bind9/lib/isc/include/isc/hmacmd5.h head/contrib/bind9/lib/isc/include/isc/hmacsha.h head/contrib/bind9/lib/isc/include/isc/interfaceiter.h head/contrib/bind9/lib/isc/include/isc/ipv6.h head/contrib/bind9/lib/isc/include/isc/lang.h head/contrib/bind9/lib/isc/include/isc/lex.h head/contrib/bind9/lib/isc/include/isc/lfsr.h head/contrib/bind9/lib/isc/include/isc/lib.h head/contrib/bind9/lib/isc/include/isc/list.h head/contrib/bind9/lib/isc/include/isc/log.h head/contrib/bind9/lib/isc/include/isc/magic.h head/contrib/bind9/lib/isc/include/isc/md5.h head/contrib/bind9/lib/isc/include/isc/mem.h head/contrib/bind9/lib/isc/include/isc/msgcat.h head/contrib/bind9/lib/isc/include/isc/msgs.h head/contrib/bind9/lib/isc/include/isc/mutexblock.h head/contrib/bind9/lib/isc/include/isc/netaddr.h head/contrib/bind9/lib/isc/include/isc/netscope.h head/contrib/bind9/lib/isc/include/isc/ondestroy.h head/contrib/bind9/lib/isc/include/isc/os.h head/contrib/bind9/lib/isc/include/isc/parseint.h head/contrib/bind9/lib/isc/include/isc/platform.h.in head/contrib/bind9/lib/isc/include/isc/portset.h head/contrib/bind9/lib/isc/include/isc/print.h head/contrib/bind9/lib/isc/include/isc/quota.h head/contrib/bind9/lib/isc/include/isc/random.h head/contrib/bind9/lib/isc/include/isc/ratelimiter.h head/contrib/bind9/lib/isc/include/isc/refcount.h head/contrib/bind9/lib/isc/include/isc/region.h head/contrib/bind9/lib/isc/include/isc/resource.h head/contrib/bind9/lib/isc/include/isc/result.h head/contrib/bind9/lib/isc/include/isc/resultclass.h head/contrib/bind9/lib/isc/include/isc/rwlock.h head/contrib/bind9/lib/isc/include/isc/serial.h head/contrib/bind9/lib/isc/include/isc/sha1.h head/contrib/bind9/lib/isc/include/isc/sha2.h head/contrib/bind9/lib/isc/include/isc/sockaddr.h head/contrib/bind9/lib/isc/include/isc/socket.h head/contrib/bind9/lib/isc/include/isc/stdio.h head/contrib/bind9/lib/isc/include/isc/stdlib.h head/contrib/bind9/lib/isc/include/isc/string.h head/contrib/bind9/lib/isc/include/isc/symtab.h head/contrib/bind9/lib/isc/include/isc/task.h head/contrib/bind9/lib/isc/include/isc/taskpool.h head/contrib/bind9/lib/isc/include/isc/timer.h head/contrib/bind9/lib/isc/include/isc/types.h head/contrib/bind9/lib/isc/include/isc/util.h head/contrib/bind9/lib/isc/include/isc/version.h head/contrib/bind9/lib/isc/inet_aton.c head/contrib/bind9/lib/isc/inet_ntop.c head/contrib/bind9/lib/isc/inet_pton.c head/contrib/bind9/lib/isc/lex.c head/contrib/bind9/lib/isc/lfsr.c head/contrib/bind9/lib/isc/lib.c head/contrib/bind9/lib/isc/log.c head/contrib/bind9/lib/isc/md5.c head/contrib/bind9/lib/isc/mem.c head/contrib/bind9/lib/isc/mips/Makefile.in head/contrib/bind9/lib/isc/mips/include/Makefile.in head/contrib/bind9/lib/isc/mips/include/isc/Makefile.in head/contrib/bind9/lib/isc/mips/include/isc/atomic.h head/contrib/bind9/lib/isc/mutexblock.c head/contrib/bind9/lib/isc/netaddr.c head/contrib/bind9/lib/isc/netscope.c head/contrib/bind9/lib/isc/nls/Makefile.in head/contrib/bind9/lib/isc/nls/msgcat.c head/contrib/bind9/lib/isc/noatomic/Makefile.in head/contrib/bind9/lib/isc/noatomic/include/Makefile.in head/contrib/bind9/lib/isc/noatomic/include/isc/Makefile.in head/contrib/bind9/lib/isc/noatomic/include/isc/atomic.h head/contrib/bind9/lib/isc/nothreads/Makefile.in head/contrib/bind9/lib/isc/nothreads/condition.c head/contrib/bind9/lib/isc/nothreads/include/Makefile.in head/contrib/bind9/lib/isc/nothreads/include/isc/Makefile.in head/contrib/bind9/lib/isc/nothreads/include/isc/condition.h head/contrib/bind9/lib/isc/nothreads/include/isc/mutex.h head/contrib/bind9/lib/isc/nothreads/include/isc/once.h head/contrib/bind9/lib/isc/nothreads/include/isc/thread.h head/contrib/bind9/lib/isc/nothreads/mutex.c head/contrib/bind9/lib/isc/nothreads/thread.c head/contrib/bind9/lib/isc/ondestroy.c head/contrib/bind9/lib/isc/parseint.c head/contrib/bind9/lib/isc/portset.c head/contrib/bind9/lib/isc/powerpc/Makefile.in head/contrib/bind9/lib/isc/powerpc/include/Makefile.in head/contrib/bind9/lib/isc/powerpc/include/isc/Makefile.in head/contrib/bind9/lib/isc/powerpc/include/isc/atomic.h head/contrib/bind9/lib/isc/print.c head/contrib/bind9/lib/isc/pthreads/Makefile.in head/contrib/bind9/lib/isc/pthreads/condition.c head/contrib/bind9/lib/isc/pthreads/include/Makefile.in head/contrib/bind9/lib/isc/pthreads/include/isc/Makefile.in head/contrib/bind9/lib/isc/pthreads/include/isc/condition.h head/contrib/bind9/lib/isc/pthreads/include/isc/mutex.h head/contrib/bind9/lib/isc/pthreads/include/isc/once.h head/contrib/bind9/lib/isc/pthreads/include/isc/thread.h head/contrib/bind9/lib/isc/pthreads/mutex.c head/contrib/bind9/lib/isc/pthreads/thread.c head/contrib/bind9/lib/isc/quota.c head/contrib/bind9/lib/isc/random.c head/contrib/bind9/lib/isc/ratelimiter.c head/contrib/bind9/lib/isc/refcount.c head/contrib/bind9/lib/isc/region.c head/contrib/bind9/lib/isc/result.c head/contrib/bind9/lib/isc/rwlock.c head/contrib/bind9/lib/isc/serial.c head/contrib/bind9/lib/isc/sha1.c head/contrib/bind9/lib/isc/sha2.c head/contrib/bind9/lib/isc/sockaddr.c head/contrib/bind9/lib/isc/sparc64/Makefile.in head/contrib/bind9/lib/isc/sparc64/include/Makefile.in head/contrib/bind9/lib/isc/sparc64/include/isc/Makefile.in head/contrib/bind9/lib/isc/sparc64/include/isc/atomic.h head/contrib/bind9/lib/isc/string.c head/contrib/bind9/lib/isc/strtoul.c head/contrib/bind9/lib/isc/symtab.c head/contrib/bind9/lib/isc/task.c head/contrib/bind9/lib/isc/task_p.h head/contrib/bind9/lib/isc/taskpool.c head/contrib/bind9/lib/isc/timer.c head/contrib/bind9/lib/isc/timer_p.h head/contrib/bind9/lib/isc/unix/Makefile.in head/contrib/bind9/lib/isc/unix/app.c head/contrib/bind9/lib/isc/unix/dir.c head/contrib/bind9/lib/isc/unix/entropy.c head/contrib/bind9/lib/isc/unix/errno2result.c head/contrib/bind9/lib/isc/unix/errno2result.h head/contrib/bind9/lib/isc/unix/file.c head/contrib/bind9/lib/isc/unix/fsaccess.c head/contrib/bind9/lib/isc/unix/ifiter_getifaddrs.c head/contrib/bind9/lib/isc/unix/ifiter_ioctl.c head/contrib/bind9/lib/isc/unix/ifiter_sysctl.c head/contrib/bind9/lib/isc/unix/include/Makefile.in head/contrib/bind9/lib/isc/unix/include/isc/Makefile.in head/contrib/bind9/lib/isc/unix/include/isc/dir.h head/contrib/bind9/lib/isc/unix/include/isc/int.h head/contrib/bind9/lib/isc/unix/include/isc/keyboard.h head/contrib/bind9/lib/isc/unix/include/isc/net.h head/contrib/bind9/lib/isc/unix/include/isc/netdb.h head/contrib/bind9/lib/isc/unix/include/isc/offset.h head/contrib/bind9/lib/isc/unix/include/isc/stat.h head/contrib/bind9/lib/isc/unix/include/isc/stdtime.h head/contrib/bind9/lib/isc/unix/include/isc/strerror.h head/contrib/bind9/lib/isc/unix/include/isc/syslog.h head/contrib/bind9/lib/isc/unix/include/isc/time.h head/contrib/bind9/lib/isc/unix/interfaceiter.c head/contrib/bind9/lib/isc/unix/ipv6.c head/contrib/bind9/lib/isc/unix/keyboard.c head/contrib/bind9/lib/isc/unix/net.c head/contrib/bind9/lib/isc/unix/os.c head/contrib/bind9/lib/isc/unix/resource.c head/contrib/bind9/lib/isc/unix/socket.c head/contrib/bind9/lib/isc/unix/socket_p.h head/contrib/bind9/lib/isc/unix/stdio.c head/contrib/bind9/lib/isc/unix/stdtime.c head/contrib/bind9/lib/isc/unix/strerror.c head/contrib/bind9/lib/isc/unix/syslog.c head/contrib/bind9/lib/isc/unix/time.c head/contrib/bind9/lib/isc/version.c head/contrib/bind9/lib/isc/x86_32/Makefile.in head/contrib/bind9/lib/isc/x86_32/include/Makefile.in head/contrib/bind9/lib/isc/x86_32/include/isc/Makefile.in head/contrib/bind9/lib/isc/x86_32/include/isc/atomic.h head/contrib/bind9/lib/isc/x86_64/Makefile.in head/contrib/bind9/lib/isc/x86_64/include/Makefile.in head/contrib/bind9/lib/isc/x86_64/include/isc/Makefile.in head/contrib/bind9/lib/isc/x86_64/include/isc/atomic.h head/contrib/bind9/lib/isccc/Makefile.in head/contrib/bind9/lib/isccc/alist.c head/contrib/bind9/lib/isccc/api head/contrib/bind9/lib/isccc/base64.c head/contrib/bind9/lib/isccc/cc.c head/contrib/bind9/lib/isccc/ccmsg.c head/contrib/bind9/lib/isccc/include/Makefile.in head/contrib/bind9/lib/isccc/include/isccc/Makefile.in head/contrib/bind9/lib/isccc/include/isccc/alist.h head/contrib/bind9/lib/isccc/include/isccc/base64.h head/contrib/bind9/lib/isccc/include/isccc/cc.h head/contrib/bind9/lib/isccc/include/isccc/ccmsg.h head/contrib/bind9/lib/isccc/include/isccc/events.h head/contrib/bind9/lib/isccc/include/isccc/lib.h head/contrib/bind9/lib/isccc/include/isccc/result.h head/contrib/bind9/lib/isccc/include/isccc/sexpr.h head/contrib/bind9/lib/isccc/include/isccc/symtab.h head/contrib/bind9/lib/isccc/include/isccc/symtype.h head/contrib/bind9/lib/isccc/include/isccc/types.h head/contrib/bind9/lib/isccc/include/isccc/util.h head/contrib/bind9/lib/isccc/include/isccc/version.h head/contrib/bind9/lib/isccc/lib.c head/contrib/bind9/lib/isccc/result.c head/contrib/bind9/lib/isccc/sexpr.c head/contrib/bind9/lib/isccc/symtab.c head/contrib/bind9/lib/isccc/version.c head/contrib/bind9/lib/isccfg/Makefile.in head/contrib/bind9/lib/isccfg/aclconf.c head/contrib/bind9/lib/isccfg/api head/contrib/bind9/lib/isccfg/include/Makefile.in head/contrib/bind9/lib/isccfg/include/isccfg/Makefile.in head/contrib/bind9/lib/isccfg/include/isccfg/aclconf.h head/contrib/bind9/lib/isccfg/include/isccfg/cfg.h head/contrib/bind9/lib/isccfg/include/isccfg/grammar.h head/contrib/bind9/lib/isccfg/include/isccfg/log.h head/contrib/bind9/lib/isccfg/include/isccfg/namedconf.h head/contrib/bind9/lib/isccfg/include/isccfg/version.h head/contrib/bind9/lib/isccfg/log.c head/contrib/bind9/lib/isccfg/namedconf.c head/contrib/bind9/lib/isccfg/parser.c head/contrib/bind9/lib/isccfg/version.c head/contrib/bind9/lib/lwres/Makefile.in head/contrib/bind9/lib/lwres/api head/contrib/bind9/lib/lwres/assert_p.h head/contrib/bind9/lib/lwres/context.c head/contrib/bind9/lib/lwres/context_p.h head/contrib/bind9/lib/lwres/gai_strerror.c head/contrib/bind9/lib/lwres/getaddrinfo.c head/contrib/bind9/lib/lwres/gethost.c head/contrib/bind9/lib/lwres/getipnode.c head/contrib/bind9/lib/lwres/getnameinfo.c head/contrib/bind9/lib/lwres/getrrset.c head/contrib/bind9/lib/lwres/herror.c head/contrib/bind9/lib/lwres/include/Makefile.in head/contrib/bind9/lib/lwres/include/lwres/Makefile.in head/contrib/bind9/lib/lwres/include/lwres/context.h head/contrib/bind9/lib/lwres/include/lwres/int.h head/contrib/bind9/lib/lwres/include/lwres/ipv6.h head/contrib/bind9/lib/lwres/include/lwres/lang.h head/contrib/bind9/lib/lwres/include/lwres/list.h head/contrib/bind9/lib/lwres/include/lwres/lwbuffer.h head/contrib/bind9/lib/lwres/include/lwres/lwpacket.h head/contrib/bind9/lib/lwres/include/lwres/lwres.h head/contrib/bind9/lib/lwres/include/lwres/netdb.h.in head/contrib/bind9/lib/lwres/include/lwres/platform.h.in head/contrib/bind9/lib/lwres/include/lwres/result.h head/contrib/bind9/lib/lwres/include/lwres/stdlib.h head/contrib/bind9/lib/lwres/include/lwres/version.h head/contrib/bind9/lib/lwres/lwbuffer.c head/contrib/bind9/lib/lwres/lwconfig.c head/contrib/bind9/lib/lwres/lwinetaton.c head/contrib/bind9/lib/lwres/lwinetntop.c head/contrib/bind9/lib/lwres/lwinetpton.c head/contrib/bind9/lib/lwres/lwpacket.c head/contrib/bind9/lib/lwres/lwres_gabn.c head/contrib/bind9/lib/lwres/lwres_gnba.c head/contrib/bind9/lib/lwres/lwres_grbn.c head/contrib/bind9/lib/lwres/lwres_noop.c head/contrib/bind9/lib/lwres/lwresutil.c head/contrib/bind9/lib/lwres/man/Makefile.in head/contrib/bind9/lib/lwres/man/lwres.3 head/contrib/bind9/lib/lwres/man/lwres.docbook head/contrib/bind9/lib/lwres/man/lwres.html head/contrib/bind9/lib/lwres/man/lwres_buffer.3 head/contrib/bind9/lib/lwres/man/lwres_buffer.docbook head/contrib/bind9/lib/lwres/man/lwres_buffer.html head/contrib/bind9/lib/lwres/man/lwres_config.3 head/contrib/bind9/lib/lwres/man/lwres_config.docbook head/contrib/bind9/lib/lwres/man/lwres_config.html head/contrib/bind9/lib/lwres/man/lwres_context.3 head/contrib/bind9/lib/lwres/man/lwres_context.docbook head/contrib/bind9/lib/lwres/man/lwres_context.html head/contrib/bind9/lib/lwres/man/lwres_gabn.3 head/contrib/bind9/lib/lwres/man/lwres_gabn.docbook head/contrib/bind9/lib/lwres/man/lwres_gabn.html head/contrib/bind9/lib/lwres/man/lwres_gai_strerror.3 head/contrib/bind9/lib/lwres/man/lwres_gai_strerror.docbook head/contrib/bind9/lib/lwres/man/lwres_gai_strerror.html head/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.3 head/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.docbook head/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.html head/contrib/bind9/lib/lwres/man/lwres_gethostent.3 head/contrib/bind9/lib/lwres/man/lwres_gethostent.docbook head/contrib/bind9/lib/lwres/man/lwres_gethostent.html head/contrib/bind9/lib/lwres/man/lwres_getipnode.3 head/contrib/bind9/lib/lwres/man/lwres_getipnode.docbook head/contrib/bind9/lib/lwres/man/lwres_getipnode.html head/contrib/bind9/lib/lwres/man/lwres_getnameinfo.3 head/contrib/bind9/lib/lwres/man/lwres_getnameinfo.docbook head/contrib/bind9/lib/lwres/man/lwres_getnameinfo.html head/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3 head/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.docbook head/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.html head/contrib/bind9/lib/lwres/man/lwres_gnba.3 head/contrib/bind9/lib/lwres/man/lwres_gnba.docbook head/contrib/bind9/lib/lwres/man/lwres_gnba.html head/contrib/bind9/lib/lwres/man/lwres_hstrerror.3 head/contrib/bind9/lib/lwres/man/lwres_hstrerror.docbook head/contrib/bind9/lib/lwres/man/lwres_hstrerror.html head/contrib/bind9/lib/lwres/man/lwres_inetntop.3 head/contrib/bind9/lib/lwres/man/lwres_inetntop.docbook head/contrib/bind9/lib/lwres/man/lwres_inetntop.html head/contrib/bind9/lib/lwres/man/lwres_noop.3 head/contrib/bind9/lib/lwres/man/lwres_noop.docbook head/contrib/bind9/lib/lwres/man/lwres_noop.html head/contrib/bind9/lib/lwres/man/lwres_packet.3 head/contrib/bind9/lib/lwres/man/lwres_packet.docbook head/contrib/bind9/lib/lwres/man/lwres_packet.html head/contrib/bind9/lib/lwres/man/lwres_resutil.3 head/contrib/bind9/lib/lwres/man/lwres_resutil.docbook head/contrib/bind9/lib/lwres/man/lwres_resutil.html head/contrib/bind9/lib/lwres/print.c head/contrib/bind9/lib/lwres/print_p.h head/contrib/bind9/lib/lwres/strtoul.c head/contrib/bind9/lib/lwres/unix/Makefile.in head/contrib/bind9/lib/lwres/unix/include/Makefile.in head/contrib/bind9/lib/lwres/unix/include/lwres/Makefile.in head/contrib/bind9/lib/lwres/unix/include/lwres/net.h head/contrib/bind9/lib/lwres/version.c head/contrib/bind9/libtool.m4 head/contrib/bind9/ltmain.sh head/contrib/bind9/make/Makefile.in head/contrib/bind9/make/includes.in head/contrib/bind9/make/mkdep.in head/contrib/bind9/make/rules.in head/contrib/bind9/version head/lib/bind/Makefile head/lib/bind/config.h head/lib/bind/dns/Makefile head/lib/bind/dns/code.h head/lib/bind/dns/dns/enumclass.h head/lib/bind/dns/dns/enumtype.h head/lib/bind/dns/dns/rdatastruct.h head/lib/bind/isc/Makefile head/lib/bind/isc/isc/platform.h head/lib/bind/lwres/Makefile head/lib/bind/lwres/lwres/netdb.h head/lib/bind/lwres/lwres/platform.h head/share/doc/bind9/Makefile head/usr.sbin/Makefile head/usr.sbin/named/Makefile Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Sun May 31 05:37:15 2009 (r193148) +++ head/contrib/bind9/CHANGES Sun May 31 05:42:58 2009 (r193149) @@ -1,18 +1,258 @@ - --- 9.4.3-P2 released --- + + --- 9.6.1rc1 released --- + +2599. [bug] Address rapid memory growth when validation fails. + [RT #19654] + +2597. [bug] Handle a validation failure with a insecure delegation + from a NSEC3 signed master/slave zone. [RT #19464] + +2596. [bug] Stale tree nodes of cache/dynamic rbtdb could stay + long, leading to inefficient memory usage or rejecting + newer cache entries in the worst case. [RT #19563] + +2595. [bug] Fix unknown extended rcodes in dig. [RT #19625] + +2592. [bug] Treat "any" as a type in nsupdate. [RT #19455] + +2591. [bug] named could die when processing a update in + removed_orphaned_ds(). [RT #19507] + +2588. [bug] SO_REUSEADDR could be set unconditionally after failure + of bind(2) call. This should be rare and mostly + harmless, but may cause interference with other + processes that happen to use the same port. [RT #19642] + +2586. [bug] Missing cleanup of SIG rdataset in searching a DLZ DB + or SDB. [RT #19577] + +2585. [bug] Uninitialized socket name could be referenced via a + statistics channel, triggering an assertion failure in + XML rendering. [RT #19427] + +2584. [bug] alpha: gcc optimization could break atomic operations. + [RT #19227] + +2583. [port] netbsd: provide a control to not add the compile + date to the version string, -DNO_VERSION_DATE. + +2582. [bug] Don't emit warning log message when we attempt to + remove non-existant journal. [RT #19516] 2579. [bug] DNSSEC lookaside validation failed to handle unknown algorithms. [RT #19479] - --- 9.4.3-P1 released --- +2578. [bug] Changed default sig-signing-type to 65534, because + 65535 turns out to be reserved. [RT #19477] + +2499. [port] solaris: lib/lwres/getaddrinfo.c namespace clash. + [RT #18837] + + --- 9.6.1b1 released --- + +2577. [doc] Clarified some statistics counters. [RT #19454] + +2576. [bug] NSEC record were not being correctly signed when + a zone transitions from insecure to secure. + Handle such incorrectly signed zones. [RT #19114] + +2574. [doc] Document nsupdate -g and -o. [RT #19351] + +2573. [bug] Replacing a non-CNAME record with a CNAME record in a + single transaction in a signed zone failed. [RT #19397] + +2568. [bug] Report when the write to indicate a otherwise + successful start fails. [RT #19360] + +2567. [bug] dst__privstruct_writefile() could miss write errors. + write_public_key() could miss write errors. + dnssec-dsfromkey could miss write errors. + [RT #19360] + +2564. [bug] Only take EDNS fallback steps when processing timeouts. + [RT #19405] + +2563. [bug] Dig could leak a socket causing it to wait forever + to exit. [RT #19359] + +2562. [doc] ARM: miscellaneous improvements, reorganization, + and some new content. + +2561. [doc] Add isc-config.sh(1) man page. [RT #16378] + +2560. [bug] Add #include to iptable.c. [RT #18258] + +2559. [bug] dnssec-dsfromkey could compute bad DS records when + reading from a K* files. [RT #19357] + +2557. [cleanup] PCI compliance: + * new libisc log module file + * isc_dir_chroot() now also changes the working + directory to "/". + * additional INSISTs + * additional logging when files can't be removed. + +2556. [port] Solaris: mkdir(2) on tmpfs filesystems does not do the + error checks in the correct order resulting in the + wrong error code sometimes being returned. [RT #19249] + +2554. [bug] Validation of uppercase queries from NSEC3 zones could + fail. [RT #19297] + +2553. [bug] Reference leak on DNSSEC validation errors. [RT #19291] + +2552. [bug] zero-no-soa-ttl-cache was not being honoured. + [RT #19340] + +2551. [bug] Potential Reference leak on return. [RT #19341] + +2550. [bug] Check --with-openssl= finds . + [RT #19343] + +2549. [port] linux: define NR_OPEN if not currently defined. + [RT #19344] + +2548. [bug] Install iterated_hash.h. [RT #19335] + +2547. [bug] openssl_link.c:mem_realloc() could reference an + out-of-range area of the source buffer. New public + function isc_mem_reallocate() was introduced to address + this bug. [RT #19313] + +2545. [doc] ARM: Legal hostname checking (check-names) is + for SRV RDATA too. [RT #19304] + +2544. [cleanup] Removed unused structure members in adb.c. [RT #19225] + +2543. [contrib] Update contrib/zkt to version 0.98. [RT #19113] + +2542. [doc] Update the description of dig +adflag. [RT #19290] + +2541. [bug] Conditionally update dispatch manager statistics. + [RT #19247] + +2539. [security] Update the interaction between recursion, allow-query, + allow-query-cache and allow-recursion. [RT #19198] + +2538. [bug] cache/ADB memory could grow over max-cache-size, + especially with threads and smaller max-cache-size + values. [RT #19240] + +2537. [experimental] Added more statistics counters including those on socket + I/O events and query RTT histograms. [RT #18802] + +2536. [cleanup] Silence some warnings when -Werror=format-security is + specified. [RT #19083] + +2535. [bug] dig +showsearh and +trace interacted badly. [RT #19091] + +2532. [bug] dig: check the question section of the response to + see if it matches the asked question. [RT #18495] + +2531. [bug] Change #2207 was incomplete. [RT #19098] + +2530. [bug] named failed to reject insecure to secure transitions + via UPDATE. [RT #19101] + +2529. [cleanup] Upgrade libtool to silence complaints from recent + version of autoconf. [RT #18657] + +2528. [cleanup] Silence spurious configure warning about + --datarootdir [RT #19096] + +2527. [bug] named could reuse cache on reload with + enabling/disabling validation. [RT #19119] + +2525. [experimental] New logging category "query-errors" to provide detailed + internal information about query failures, especially + about server failures. [RT #19027] + +2524. [port] sunos: dnssec-signzone needs strtoul(). [RT #19129] + +2523. [bug] Random type rdata freed by dns_nsec_typepresent(). + [RT #19112] + +2522. [security] Handle -1 from DSA_do_verify() and EVP_VerifyFinal(). + +2521. [bug] Improve epoll cross compilation support. [RT #19047] + +2519. [bug] dig/host with -4 or -6 didn't work if more than two + nameserver addresses of the excluded address family + preceded in resolv.conf. [RT #19081] + +2517. [bug] dig +trace with -4 or -6 failed when it chose a + nameserver address of the excluded address. + [RT #18843] + +2516. [bug] glue sort for responses was performed even when not + needed. [RT #19039] + +2514. [bug] dig/host failed with -4 or -6 when resolv.conf contains + a nameserver of the excluded address family. + [RT #18848] + +2511. [cleanup] dns_rdata_tofmttext() add const to linebreak. + [RT #18885] + +2506. [port] solaris: Check at configure time if + hack_shutup_pthreadonceinit is needed. [RT #19037] + +2505. [port] Treat amd64 similarly to x86_64 when determining + atomic operation support. [RT #19031] + +2503. [port] linux: improve compatibility with Linux Standard + Base. [RT #18793] + +2502. [cleanup] isc_radix: Improve compliance with coding style, + document function in . [RT #18534] + + --- 9.6.0 released --- + +2520. [bug] Update xml statistics version number to 2.0 as change + #2388 made the schema incompatible to the previous + version. [RT #19080] + + --- 9.6.0rc2 released --- + +2515. [port] win32: build dnssec-dsfromkey and dnssec-keyfromlabel. + [RT #19063] + +2513 [bug] Fix windows cli build. [RT #19062] + +2510. [bug] "dig +sigchase" could trigger REQUIRE failures. + [RT #19033] + +2509. [bug] Specifying a fixed query source port was broken. + [RT #19051] -2522. [security] Handle -1 from DSA_do_verify(). +2504. [bug] Address race condition in the socket code. [RT #18899] + + --- 9.6.0rc1 released --- 2498. [bug] Removed a bogus function argument used with ISC_SOCKET_USE_POLLWATCH: it could cause compiler warning or crash named with the debug 1 level of logging. [RT #18917] - --- 9.4.3 released --- +2497. [bug] Don't add RRSIG bit to NSEC3 bit map for insecure + delegation. + +2496. [bug] Add sanity length checks to NSID option. [RT #18813] + +2495. [bug] Tighten RRSIG checks. [RT #18795] + +2494. [bug] isc/radix.h, dns/sdlz.h and dns/dlz.h were not being + installed. [RT #18826] + +2493. [bug] The linux capabilities code was not correctly cleaning + up after itself. [RT #18767] + +2492. [func] Rndc status now reports the number of cpus discovered + and the number of worker threads when running + multi-threaded. [RT #18273] + +2491. [func] Attempt to re-use a local port if we are already using + the port. [RT #18548] 2490. [port] aix: work around a kernel bug where IPV6_RECVPKTINFO is cleared when IPV6_V6ONLY is set. [RT #18785] @@ -23,7 +263,58 @@ Define ISC_SOCKET_USE_POLLWATCH at build time to enable this workaround. [RT #18870] - --- 9.4.3rc1 released --- +2488. [func] Added a tool, dnssec-dsfromkey, to generate DS records + from keyset and .key files. [RT #18694] + +2487. [bug] Give TCP connections longer to complete. [RT #18675] + +2486. [func] The default locations for named.pid and lwresd.pid + are now /var/run/named/named.pid and + /var/run/lwresd/lwresd.pid respectively. + + This allows the owner of the containing directory + to be set, for "named -u" support, and allows there + to be a permanent symbolic link in the path, for + "named -t" support. [RT #18306] + +2485. [bug] Change update's the handling of obscured RRSIG + records. Not all orphaned DS records were being + removed. [RT #18828] + +2484. [bug] It was possible to trigger a REQUIRE failure when + adding NSEC3 proofs to the response in + query_addwildcardproof(). [RT #18828] + +2483. [port] win32: chroot() is not supported. [RT #18805] + +2482. [port] libxml2: support versions 2.7.* in addition + to 2.6.*. [RT #18806] + + --- 9.6.0b1 released --- + +2481. [bug] rbtdb.c:matchparams() failed to handle NSEC3 chain + collisions. [RT #18812] + +2480. [bug] named could fail to emit all the required NSEC3 + records. [RT #18812] + +2479. [bug] xfrout:covers was not properly initialized. [RT #18801] + +2478. [bug] 'addresses' could be used uninitialized in + configure_forward(). [RT #18800] + +2477. [bug] dig: the global option to print the command line is + +cmd not print_cmd. Update the output to reflect + this. [RT #17008] + +2476. [doc] ARM: improve documentation for max-journal-size and + ixfr-from-differences. [RT #15909] [RT #18541] + +2475. [bug] LRU cache cleanup under overmem condition could purge + particular entries more aggressively. [RT #17628] + +2474. [bug] ACL structures could be allocated with insufficient + space, causing an array overrun. [RT #18765] 2473. [port] linux: raise the limit on open files to the possible maximum value before spawning threads; 'files' @@ -33,9 +324,12 @@ 2472. [port] linux: check the number of available cpu's before calling chroot as it depends on "/proc". [RT #16923] -2471. [bug] named-checkzone was not reporting missing manditory +2471. [bug] named-checkzone was not reporting missing mandatory glue when sibling checks were disabled. [RT #18768] +2470. [bug] Elements of the isc_radix_node_t could be incorrectly + overwritten. [RT# 18719] + 2469. [port] solaris: Work around Solaris's select() limitations. [RT #18769] @@ -50,10 +344,14 @@ 2465. [bug] Adb's handling of lame addresses was different for IPv4 and IPv6. [RT #18738] +2464. [port] linux: check that a capability is present before + trying to set it. [RT #18135] + 2463. [port] linux: POSIX doesn't include the IPv6 Advanced Socket API and glibc hides parts of the IPv6 Advanced Socket API as a result. This is stupid as it breaks how the - two halves (Basic and Advanced) of the IPv6 Socket API were designed to be used but we have to live with it. + two halves (Basic and Advanced) of the IPv6 Socket API + were designed to be used but we have to live with it. Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API. [RT #18388] @@ -62,17 +360,48 @@ 2461. [port] sunos: Change #2363 was not complete. [RT #17513] + --- 9.6.0a1 released --- + +2460. [bug] Don't call dns_db_getnsec3parameters() on the cache. + [RT #18697] + +2459. [contrib] Import dnssec-zkt to contrib/zkt. [RT #18448] + 2458. [doc] ARM: update and correction for max-cache-size. [RT #18294] -2455. [bug] Stop metadata being transfered via axfr/ixfr. +2457. [tuning] max-cache-size is reverted to 0, the previous + default. It should be safe because expired cache + entries are also purged. [RT #18684] + +2456. [bug] In ACLs, ::/0 and 0.0.0.0/0 would both match any + address, regardless of family. They now correctly + distinguish IPv4 from IPv6. [RT #18559] + +2455. [bug] Stop metadata being transferred via axfr/ixfr. [RT #18639] +2454. [func] nsupdate: you can now set a default ttl. [RT #18317] + 2453. [bug] Remove NULL pointer dereference in dns_journal_print(). [RT #18316] -2449. [bug] libbind: Out of bounds reference in dns_ho.c:addrsort. - [RT #18044] +2452. [func] Improve bin/test/journalprint. [RT #18316] + +2451. [port] solaris: handle runtime linking better. [RT #18356] + +2450. [doc] Fix lwresd docbook problem for manual page. + [RT #18672] + +2449. [placeholder] + +2448. [func] Add NSEC3 support. [RT #15452] + +2447. [cleanup] libbind has been split out as a separate product. + +2446. [func] Add a new log message about build options on startup. + A new command-line option '-V' for named is also + provided to show this information. [RT# 18645] 2445. [doc] ARM out-of-date on empty reverse zones (list includes RFC1918 address, but these are not yet compiled in). @@ -81,31 +410,46 @@ 2444. [port] Linux, FreeBSD, AIX: Turn off path mtu discovery (clear DF) for UDP responses and requests. - --- 9.4.3b3 released --- - 2443. [bug] win32: UDP connect() would not generate an event, and so connected UDP sockets would never clean up. Fix this by doing an immediate WSAConnect() rather than an io completion port type for UDP. -2438. [bug] Timeouts could be logged incorrectly under win32. - [RT #18617] +2442. [bug] A lock could be destroyed twice. [RT# 18626] + +2441. [bug] isc_radix_insert() could copy radix tree nodes + incompletely. [RT #18573] + +2440. [bug] named-checkconf used an incorrect test to determine + if an ACL was set to none. + +2439. [bug] Potential NULL dereference in dns_acl_isanyornone(). + [RT #18559] + +2438. [bug] Timeouts could be logged incorrectly under win32. 2437. [bug] Sockets could be closed too early, leading to inconsistent states in the socket module. [RT #18298] 2436. [security] win32: UDP client handler can be shutdown. [RT #18576] +2435. [bug] Fixed an ACL memory leak affecting win32. + +2434. [bug] Fixed a minor error-reporting bug in + lib/isc/win32/socket.c. + 2433. [tuning] Set initial timeout to 800ms. -2432. [bug] More Windows socket handling improvements. Stop +2432. [bug] More Windows socket handling improvements. Stop using I/O events and use IO Completion Ports throughout. Rewrite the receive path logic to make it easier to support multiple simultaneous - requestrs in the future. Add stricter consistency + requesters in the future. Add stricter consistency checking as a compile-time option (define ISC_SOCKET_CONSISTENCY_CHECKS; defaults to off). +2431. [bug] Acl processing could leak memory. [RT #18323] + 2430. [bug] win32: isc_interval_set() could round down to zero if the input was less than NS_INTERVAL nanoseconds. Round up instead. [RT #18549] @@ -113,8 +457,14 @@ 2429. [doc] nsupdate should be in section 1 of the man pages. [RT #18283] +2428. [bug] dns_iptable_merge() mishandled merges of negative + tables. [RT #18409] + +2427. [func] Treat DNSKEY queries as if "minimal-response yes;" + was set. [RT #18528] + 2426. [bug] libbind: inet_net_pton() can sometimes return the - wrong value if excessively large netmasks are + wrong value if excessively large net masks are supplied. [RT #18512] 2425. [bug] named didn't detect unavailable query source addresses @@ -125,6 +475,12 @@ epoll and /dev/poll to be selected at compile time. [RT #18277] +2423. [security] Randomize server selection on queries, so as to + make forgery a little more difficult. Instead of + always preferring the server with the lowest RTT, + pick a server with RTT within the same 128 + millisecond band. [RT #18441] + 2422. [bug] Handle the special return value of a empty node as if it was a NXRRSET in the validator. [RT #18447] @@ -133,13 +489,20 @@ Use caution: this option may not work for some operating systems without rebuilding named. -2420. [bug] Windows socket handling cleanup. Let the io - completion event send out cancelled read/write - done events, which keeps us from writing to memeory +2420. [bug] Windows socket handling cleanup. Let the io + completion event send out canceled read/write + done events, which keeps us from writing to memory we no longer have ownership of. Add debugging socket_log() function. Rework TCP socket handling to not leak sockets. +2419. [cleanup] Document that isc_socket_create() and isc_socket_open() + should not be used for isc_sockettype_fdwatch sockets. + [RT #18521] + +2418. [bug] AXFR request on a DLZ could trigger a REQUIRE failure + [RT #18430] + 2417. [bug] Connecting UDP sockets for outgoing queries could unexpectedly fail with an 'address already in use' error. [RT #18411] @@ -147,26 +510,42 @@ 2416. [func] Log file descriptors that cause exceeding the internal maximum. [RT #18460] +2415. [bug] 'rndc dumpdb' could trigger various assertion failures + in rbtdb.c. [RT #18455] + 2414. [bug] A masterdump context held the database lock too long, causing various troubles such as dead lock and recursive lock acquisition. [RT #18311, #18456] 2413. [bug] Fixed an unreachable code path in socket.c. [RT #18442] -2412. [bug] win32: address a resourse leak. [RT #18374] +2412. [bug] win32: address a resource leak. [RT #18374] 2411. [bug] Allow using a larger number of sockets than FD_SETSIZE for select(). To enable this, set ISC_SOCKET_MAXSOCKETS at compilation time. [RT #18433] + Note: with changes #2469 and #2421 above, there is no + need to tweak ISC_SOCKET_MAXSOCKETS at compilation time + any more. + 2410. [bug] Correctly delete m_versionInfo. [RT #18432] +2409. [bug] Only log that we disabled EDNS processing if we were + subsequently successful. [RT #18029] + 2408. [bug] A duplicate TCP dispatch event could be sent, which could then trigger an assertion failure in resquery_response(). [RT #18275] 2407. [port] hpux: test for sys/dyntune.h. [RT #18421] +2406. [placeholder] + +2405. [cleanup] The default value for dnssec-validation was changed to + "yes" in 9.5.0-P1 and all subsequent releases; this + was inadvertently omitted from CHANGES at the time. + 2404. [port] hpux: files unlimited support. 2403. [bug] TSIG context leak. [RT #18341] @@ -176,13 +555,17 @@ 2401. [bug] Expect to get E[MN]FILE errno internal_accept() (from accept() or fcntl() system calls). [RT #18358] -2399. [bug] Abort timeout queries to reduce the number of open - UDP sockets. [RT #18367] +2400. [bug] Log if kqueue()/epoll_create()/open(/dev/poll) fails. + [RT #18297] + +2399. [placeholder] 2398. [bug] Improve file descriptor management. New, temporary, named.conf option reserved-sockets, default 512. [RT #18344] +2397. [bug] gssapi_functions had too many elements. [RT #18355] + 2396. [bug] Don't set SO_REUSEADDR for randomized ports. [RT #18336] @@ -193,35 +576,42 @@ open files to 'unlimited' as described in the documentation. [RT #18331] +2393. [bug] nested acls containing keys could trigger an + assertion in acl.c. [RT #18166] + 2392. [bug] remove 'grep -q' from acl test script, some platforms don't support it. [RT #18253] -2391 [port] hpux: cover additional recvmsg() error codes. +2391. [port] hpux: cover additional recvmsg() error codes. [RT #18301] -2390 [bug] dispatch.c could make a false warning on 'odd socket'. +2390. [bug] dispatch.c could make a false warning on 'odd socket'. [RT #18301]. -2389 [bug] Move the "working directory writable" check to after +2389. [bug] Move the "working directory writable" check to after the ns_os_changeuser() call. [RT #18326] +2388. [bug] Avoid using tables for layout purposes in + statistics XSL [RT #18159]. + +2387. [bug] Silence compiler warnings in lib/isc/radix.c. + [RT #18147] [RT #18258] + 2386. [func] Add warning about too small 'open files' limit. [RT #18269] - --- 9.4.3b2 released --- - 2385. [bug] A condition variable in socket.c could leak in rare error handling [RT #17968]. -2384. [security] Additional support for query port randomization (change - #2375) including performance improvement and port range - specification. [RT #17949, #18098] +2384. [security] Fully randomize UDP query ports to improve + forgery resilience. [RT #17949, #18098] 2383. [bug] named could double queries when they resulted in SERVFAIL due to overkilling EDNS0 failure detection. [RT #18182] -2382. [doc] Add descriptions of IPSECKEY, SPF and SSHFP to ARM. +2382. [doc] Add descriptions of DHCID, IPSECKEY, SPF and SSHFP + to ARM. 2381. [port] dlz/mysql: support multiple install layouts for mysql. /include/{,mysql/}mysql.h and @@ -235,41 +625,104 @@ 2379. [contrib] queryperf/gen-data-queryperf.py: removed redundant TLDs and supported RRs with TTLs [RT #17972] +2378. [bug] gssapi_functions{} had a redundant member in BIND 9.5. + [RT #18169] + 2377. [bug] Address race condition in dnssec-signzone. [RT #18142] 2376. [bug] Change #2144 was not complete. -2375. [security] Fully randomize UDP query ports to improve - forgery resilience. [RT #17949] +2375. [placeholder] + +2374. [bug] "blackhole" ACLs could cause named to segfault due + to some uninitialized memory. [RT #18095] -2372. [bug] fixed incorrect TAG_HMACSHA256_BITS value [RT #18047] +2373. [bug] Default values of zone ACLs were re-parsed each time a + new zone was configured, causing an overconsumption + of memory. [RT #18092] + +2372. [bug] Fixed incorrect TAG_HMACSHA256_BITS value [RT #18047] + +2371. [doc] Add +nsid option to dig man page. [RT #18039] + +2370. [bug] "rndc freeze" could trigger an assertion in named + when called on a nonexistent zone. [RT #18050] 2369. [bug] libbind: Array bounds overrun on read in bitncmp(). [RT #18054] +2368. [port] Linux: use libcap for capability management if + possible. [RT# 18026] + +2367. [bug] Improve counting of dns_resstatscounter_retry + [RT #18030] + +2366. [bug] Adb shutdown race. [RT #18021] + +2365. [bug] Fix a bug that caused dns_acl_isany() to return + spurious results. [RT #18000] + 2364. [bug] named could trigger a assertion when serving a malformed signed zone. [RT #17828] 2363. [port] sunos: pre-set "lt_cv_sys_max_cmd_len=4096;". [RT #17513] +2362. [cleanup] Make "rrset-order fixed" a compile-time option. + settable by "./configure --enable-fixed-rrset". + Disabled by default. [RT #17977] + 2361. [bug] "recursion" statistics counter could be counted multiple times for a single query. [RT #17990] - --- 9.4.3b1 released --- +2360. [bug] Fix a condition where we release a database version + (which may acquire a lock) while holding the lock. + +2359. [bug] Fix NSID bug. [RT #17942] 2358. [doc] Update host's default query description. [RT #17934] +2357. [port] Don't use OpenSSL's engine support in versions before + OpenSSL 0.9.7f. [RT #17922] + 2356. [bug] Built in mutex profiler was not scalable enough. [RT #17436] -2353. [func] libbind: nsid support. [RT #17091] +2355. [func] Extend the number statistics counters available. + [RT #17590] + +2354. [bug] Failed to initialize some rdatasetheader_t elements. + [RT #17927] + +2353. [func] Add support for Name Server ID (RFC 5001). + 'dig +nsid' requests NSID from server. + 'request-nsid yes;' causes recursive server to send + NSID requests to upstream servers. Server responds + to NSID requests with the string configured by + 'server-id' option. [RT #17091] + +2352. [bug] Various GSS_API fixups. [RT #17729] + +2351. [bug] convertxsl.pl generated very long lines. [RT #17906] 2350. [port] win32: IPv6 support. [RT #17797] +2349. [func] Provide incremental re-signing support for secure + dynamic zones. [RT #1091] + +2348. [func] Use the EVP interface to OpenSSL. Add PKCS#11 support. + Documentation is in the new README.pkcs11 file. + New tool, dnssec-keyfromlabel, which takes the + label of a key pair in a HSM and constructs a DNS + key pair for use by named and dnssec-signzone. + [RT #16844] + 2347. [bug] Delete now traverses the RB tree in the canonical order. [RT #17451] +2346. [func] Memory statistics now cover all active memory contexts + in increased detail. [RT #17580] + 2345. [bug] named-checkconf failed to detect when forwarders were set at both the options/view level and in a root zone. [RT #17671] @@ -280,6 +733,8 @@ 2343. [bug] (Seemingly) duplicate IPv6 entries could be created in ADB. [RT #17837] +2342. [func] Use getifaddrs() if available under Linux. [RT #17224] + 2341. [bug] libbind: add missing -I../include for off source tree builds. [RT #17606] @@ -292,12 +747,16 @@ 2337. [bug] BUILD_LDFLAGS was not being correctly set. [RT #17614] -2335. [port] sunos: libbind and *printf() support for long long. +2336. [func] If "named -6" is specified then listen on all IPv6 + interfaces if there are not listen-on-v6 clauses in + named.conf. [RT #17581] + +2335. [port] sunos: libbind and *printf() support for long long. [RT #17513] 2334. [bug] Bad REQUIRES in fromstruct_in_naptr(), off by one bug in fromstruct_txt(). [RT #17609] - + 2333. [bug] Fix off by one error in isc_time_nowplusinterval(). [RT #17608] @@ -321,21 +780,40 @@ J.ROOT-SERVERS.NET, K.ROOT-SERVERS.NET and M.ROOT-SERVERS.NET. +2327. [bug] It was possible to dereference a NULL pointer in + rbtdb.c. Implement dead node processing in zones as + we do for caches. [RT #17312] + 2326. [bug] It was possible to trigger a INSIST in the acache processing. 2325. [port] Linux: use capset() function if available. [RT #17557] +2324. [bug] Fix IPv6 matching against "any;". [RT #17533] + 2323. [port] tru64: namespace clash. [RT #17547] 2322. [port] MacOS: work around the limitation of setrlimit() for RLIMIT_NOFILE. [RT #17526] -2319. [bug] Silence Coverity warnings in +2321. [placeholder] + +2320. [func] Make statistics counters thread-safe for platforms + that support certain atomic operations. [RT #17466] + +2319. [bug] Silence Coverity warnings in lib/dns/rdata/in_1/apl_42.c. [RT #17469] 2318. [port] sunos fixes for libbind. [RT #17514] +2317. [bug] "make distclean" removed bind9.xsl.h. [RT #17518] + +2316. [port] Missing #include in lib/dns/gssapictx.c. + [RT #17513] + +2315. [bug] Used incorrect address family for mapped IPv4 + addresses in acl.c. [RT #17519] + 2314. [bug] Uninitialized memory use on error path in bin/named/lwdnoop.c. [RT #17476] @@ -345,11 +823,15 @@ 2312. [cleanup] Silence Coverity warning in lib/isc/unix/socket.c. [RT #17458] -2311. [func] Update ACL regression test. [RT #17462] +2311. [bug] IPv6 addresses could match IPv4 ACL entries and + vice versa. [RT #17462] 2310. [bug] dig, host, nslookup: flush stdout before emitting debug/fatal messages. [RT #17501] +2309. [cleanup] Fix Coverity warnings in lib/dns/acl.c and iptable.c. + [RT #17455] + 2308. [cleanup] Silence Coverity warning in bin/named/controlconf.c. [RT #17495] @@ -371,7 +853,7 @@ 2301. [bug] Remove resource leak and fix error messages in bin/tests/system/lwresd/lwtest.c. [RT #17474] -2300. [bug] Fixed failure to close open file in +2300. [bug] Fixed failure to close open file in bin/tests/names/t_names.c. [RT #17473] 2299. [bug] Remove unnecessary NULL check in @@ -389,22 +871,39 @@ 2295. [bug] Silence static overrun error in bin/named/lwaddr.c. [RT #17459] +2294. [func] Allow the experimental statistics channels to have + multiple connections and ACL. + Note: the stats-server and stats-server-v6 options + available in the previous beta releases are replaced + with the generic statistics-channels statement. + 2293. [func] Add ACL regression test. [RT #17375] 2292. [bug] Log if the working directory is not writable. [RT #17312] -2291. [bug] PR_SET_DUMPABLE may be set too late. Also report +2291. [bug] PR_SET_DUMPABLE may be set too late. Also report failure to set PR_SET_DUMPABLE. [RT #17312] 2290. [bug] Let AD in the query signal that the client wants AD set in the response. [RT #17301] +2289. [func] named-checkzone now reports the out-of-zone CNAME + found. [RT #17309] + 2288. [port] win32: mark service as running when we have finished loading. [RT #17441] 2287. [bug] Use 'volatile' if the compiler supports it. [RT #17413] +2286. [func] Allow a TCP connection to be used as a weak + authentication method for reverse zones. + New update-policy methods tcp-self and 6to4-self. + [RT #17378] + +2285. [func] Test framework for client memory context management. + [RT #17377] + 2284. [bug] Memory leak in UPDATE prerequisite processing. [RT #17377] @@ -413,7 +912,15 @@ memory context rather than the clients memory context. [RT #17377] -2279. [bug] Use setsockopt(SO_NOSIGPIPE), when available, +2282. [bug] Acl code fixups. [RT #17346] [RT #17374] + +2281. [bug] Attempts to use undefined acls were not being logged. + [RT #17307] + +2280. [func] Allow the experimental http server to be reached + over IPv6 as well as IPv4. [RT #17332] + +2279. [bug] Use setsockopt(SO_NOSIGPIPE), when available, to protect applications from receiving spurious SIGPIPE signals when using the resolver. @@ -423,12 +930,21 @@ 2277. [bug] Empty zone names were not correctly being caught at in the post parse checks. [RT #17357] +2276. [bug] Install . [RT# 17359] + +2275. [func] Add support to dig to perform IXFR queries over UDP. + [RT #17235] + +2274. [func] Log zone transfer statistics. [RT #17336] + 2273. [bug] Adjust log level to WARNING when saving inconsistent stub/slave master and journal files. [RT# 17279] 2272. [bug] Handle illegal dnssec-lookaside trust-anchor names. [RT #17262] +2271. [bug] Fix a memory leak in http server code [RT #17100] + 2270. [bug] dns_db_closeversion() version->writer could be reset before it is tested. [RT #17290] @@ -437,6 +953,12 @@ 2268. [bug] 0.IN-ADDR.ARPA was missing from the empty zones list. + --- 9.5.0b1 released --- + +2267. [bug] Radix tree node_num value could be set incorrectly, + causing positive ACL matches to look like negative + ones. [RT #17311] + 2266. [bug] client.c:get_clientmctx() returned the same mctx once the pool of mctx's was filled. [RT #17218] @@ -451,21 +973,14 @@ 2262. [bug] Error status from all but the last view could be lost. [RT #17292] -2260. [bug] Reported wrong clients-per-query when increasing the - value. [RT #17236] - -2247. [doc] Sort doc/misc/options. [RT #17067] - -2246. [bug] Make the startup of test servers (ans.pl) more - robust. [RT #17147] +2261. [bug] Fix memory leak with "any" and "none" ACLs [RT #17272] - --- 9.4.2 released --- +2260. [bug] Reported wrong clients-per-query when increasing the + value. [RT #17236] - --- 9.4.2rc2 released --- +2259. [placeholder] -2259. [bug] Reverse incorrect LIBINTERFACE bump of libisc - in 9.4.2rc1. Applications built against 9.4.2rc1 - will need to be rebuilt. + --- 9.5.0a7 released --- 2258. [bug] Fallback from IXFR/TSIG to SOA/AXFR/TSIG broken. [RT #17241] @@ -483,20 +998,52 @@ intermediate values as timer->idle was reset by isc_timer_touch(). [RT #17243] - --- 9.4.2rc1 released --- +2253. [func] "max-cache-size" defaults to 32M. + "max-acache-size" defaults to 16M. + +2252. [bug] Fixed errors in sortlist code [RT #17216] + +2251. [placeholder] + +2250. [func] New flag 'memstatistics' to state whether the + memory statistics file should be written or not. + Additionally named's -m option will cause the + statistics file to be written. [RT #17113] + +2249. [bug] Only set Authentic Data bit if client requested + DNSSEC, per RFC 3655 [RT #17175] -2251. [doc] Update memstatistics-file documentation to reflect - reality. Note there is behaviour change for BIND 9.5. - [RT #17113] +2248. [cleanup] Fix several errors reported by Coverity. [RT #17160] -2249. [bug] Only set Authentic Data bit if client requested - DNSSEC, per RFC 3655 [RT #17175] +2247. [doc] Sort doc/misc/options. [RT #17067] -2248. [cleanup] Fix several errors reported by Coverity. [RT #17160] +2246. [bug] Make the startup of test servers (ans.pl) more + robust. [RT #17147] 2245. [bug] Validating lack of DS records at trust anchors wasn't working. [RT #17151] +2244. [func] Allow the check of nameserver names against the + SOA MNAME field to be disabled by specifying + 'notify-to-soa yes;'. [RT #17073] + +2243. [func] Configuration files without a newline at the end now + parse without error. [RT #17120] + +2242. [bug] nsupdate: GSS-TSIG support using the Heimdal Kerberos + library could require a source of random data. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun May 31 05:44:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82F5C1065676; Sun, 31 May 2009 05:44:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 713E28FC15; Sun, 31 May 2009 05:44:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4V5iLWm030796; Sun, 31 May 2009 05:44:21 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4V5iLnH030795; Sun, 31 May 2009 05:44:21 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200905310544.n4V5iLnH030795@svn.freebsd.org> From: Doug Barton Date: Sun, 31 May 2009 05:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193150 - head/contrib/bind9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 05:44:22 -0000 Author: dougb Date: Sun May 31 05:44:21 2009 New Revision: 193150 URL: http://svn.freebsd.org/changeset/base/193150 Log: Update BIND to version 9.6.1rc1. This version has better performance and lots of new features compared to 9.4.x, including: Full NSEC3 support Automatic zone re-signing New update-policy methods tcp-self and 6to4-self DHCID support. More detailed statistics counters including those supported in BIND 8. Faster ACL processing. Efficient LRU cache-cleaning mechanism. NSID support. Added: head/contrib/bind9/isc-config.sh.in (contents, props changed) Added: head/contrib/bind9/isc-config.sh.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/bind9/isc-config.sh.in Sun May 31 05:44:21 2009 (r193150) @@ -0,0 +1,149 @@ +#!/bin/sh +# +# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2000, 2001, 2003 Internet Software Consortium. +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +# $Id: isc-config.sh.in,v 1.17 2007/06/19 23:46:59 tbox Exp $ + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +exec_prefix_set= + +usage() +{ + cat << EOF +Usage: isc-config [OPTIONS] [LIBRARIES] +Options: + [--prefix[=DIR]] + [--exec-prefix[=DIR]] + [--version] + [--libs] + [--cflags] +Libraries: + isc + isccc + isccfg + dns + lwres + bind9 +EOF + exit $1 +} + +if test $# -eq 0; then + usage 1 1>&2 +fi + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case "$1" in + --prefix=*) + prefix=$optarg + if test "x$exec_prefix_set" = x ; then + exec_prefix=$prefix + fi + ;; + --prefix) + echo_prefix=true + ;; + --exec-prefix=*) + exec_prefix=$optarg + ;; + --exec-prefix) + echo_exec_prefix=true + ;; + --version) + echo @BIND9_VERSION@ + exit 0 + ;; + --cflags) + echo_cflags=true + ;; + --libs) + echo_libs=true; + ;; + isc) + libisc=true; + ;; + isccc) + libisccc=true; + libisc=true; + ;; + isccfg) + libisccfg=true; + libisc=true; + ;; + dns) + libdns=true; + libisc=true; + ;; + lwres) + liblwres=true; + ;; + bind9) + libdns=true; + libisc=true; + libisccfg=true; + libbind9=true; + ;; + *) + usage 1 1>&2 + esac + shift +done + +if test x"$echo_prefix" = x"true" ; then + echo $prefix +fi +if test x"$echo_exec_prefix" = x"true" ; then + echo $exec_prefix +fi +if test x"$echo_cflags" = x"true"; then + includes="-I${exec_prefix}/include" + if test x"$libisc" = x"true"; then + includes="$includes @ALWAYS_DEFINES@ @STD_CINCLUDES@ @STD_CDEFINES@ @CCOPT@" + fi + echo $includes +fi +if test x"$echo_libs" = x"true"; then + libs=-L${exec_prefix}/lib + if test x"$liblwres" = x"true" ; then + libs="$libs -llwres" + fi + if test x"$libbind9" = x"true" ; then + libs="$libs -lbind9" + fi + if test x"$libdns" = x"true" ; then + libs="$libs -ldns @DNS_CRYPTO_LIBS@" + fi + if test x"$libisccfg" = x"true" ; then + libs="$libs -lisccfg" + fi + if test x"$libisccc" = x"true" ; then + libs="$libs -lisccc" + fi + if test x"$libisc" = x"true" ; then + libs="$libs -lisc" + needothers=true + fi + if test x"$needothers" = x"true" ; then + libs="$libs @CCOPT@ @LIBS@" + fi + echo $libs +fi From owner-svn-src-head@FreeBSD.ORG Sun May 31 07:25:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3648D106564A; Sun, 31 May 2009 07:25:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E34DB8FC15; Sun, 31 May 2009 07:25:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4V7POFj033209; Sun, 31 May 2009 07:25:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4V7PONb033208; Sun, 31 May 2009 07:25:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <200905310725.n4V7PONb033208@svn.freebsd.org> From: Adrian Chadd Date: Sun, 31 May 2009 07:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193153 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 07:25:25 -0000 Author: adrian Date: Sun May 31 07:25:24 2009 New Revision: 193153 URL: http://svn.freebsd.org/changeset/base/193153 Log: Remove some unused code in ipi_selected() . The code path this was copied from (sys/i386/i386/mp_machdep.c:ipi_selected()) handles bitmap'ed IPIs and normal IPIs via separate notification paths. Xen SMP handles them the same way. Modified: head/sys/i386/xen/mp_machdep.c Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Sun May 31 06:58:35 2009 (r193152) +++ head/sys/i386/xen/mp_machdep.c Sun May 31 07:25:24 2009 (r193153) @@ -1146,11 +1146,6 @@ ipi_selected(cpumask_t cpus, u_int ipi) void ipi_all_but_self(u_int ipi) { - - if (IPI_IS_BITMAPED(ipi) || (ipi == IPI_STOP && stop_cpus_with_nmi)) { - ipi_selected(PCPU_GET(other_cpus), ipi); - return; - } CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); ipi_selected(PCPU_GET(other_cpus), ipi); } From owner-svn-src-head@FreeBSD.ORG Sun May 31 08:11:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4C271065673; Sun, 31 May 2009 08:11:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B988F8FC13; Sun, 31 May 2009 08:11:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4V8Bdek035275; Sun, 31 May 2009 08:11:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4V8BdwE035273; Sun, 31 May 2009 08:11:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <200905310811.n4V8BdwE035273@svn.freebsd.org> From: Adrian Chadd Date: Sun, 31 May 2009 08:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193154 - in head/sys/i386: include xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 08:11:40 -0000 Author: adrian Date: Sun May 31 08:11:39 2009 New Revision: 193154 URL: http://svn.freebsd.org/changeset/base/193154 Log: Fix the MP IPI code to differentiate between bitmapped IPIs and function IPIs. This attempts to fix the IPI handling code to correctly differentiate between bitmapped IPIs and function IPIs. The Xen IPIs were on low numbers which clashed with the bitmapped IPIs. This commit bumps those IPI numbers up to 240 and above (just like in the i386 code) and fiddles with the ipi_vectors[] logic to call the correct function. This still isn't "right". Specifically, the IPI code may work fine for TLB shootdown events but the rendezvous/lazypmap IPIs are thrown by calling ipi_*() routines which don't set the call_func stuff (function id, addr1, addr2) that the TLB shootdown events are. So the Xen SMP support is still broken. PR: 135069 Modified: head/sys/i386/include/apicvar.h head/sys/i386/xen/mp_machdep.c Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Sun May 31 07:25:24 2009 (r193153) +++ head/sys/i386/include/apicvar.h Sun May 31 08:11:39 2009 (r193154) @@ -114,14 +114,14 @@ #define APIC_IPI_INTS (APIC_LOCAL_INTS + 2) #ifdef XEN -#define IPI_RENDEZVOUS (2) /* Inter-CPU rendezvous. */ -#define IPI_INVLTLB (3) /* TLB Shootdown IPIs */ -#define IPI_INVLPG (4) -#define IPI_INVLRNG (5) -#define IPI_INVLCACHE (6) -#define IPI_LAZYPMAP (7) /* Lazy pmap release. */ +#define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */ +#define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */ +#define IPI_INVLPG (APIC_IPI_INTS + 2) +#define IPI_INVLRNG (APIC_IPI_INTS + 3) +#define IPI_INVLCACHE (APIC_IPI_INTS + 4) +#define IPI_LAZYPMAP (APIC_IPI_INTS + 5) /* Lazy pmap release. */ /* Vector to handle bitmap based IPIs */ -#define IPI_BITMAP_VECTOR (8) +#define IPI_BITMAP_VECTOR (APIC_IPI_INTS + 6) #else #define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */ Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Sun May 31 07:25:24 2009 (r193153) +++ head/sys/i386/xen/mp_machdep.c Sun May 31 08:11:39 2009 (r193154) @@ -350,17 +350,11 @@ iv_lazypmap(uintptr_t a, uintptr_t b) atomic_add_int(&smp_tlb_wait, 1); } - -static void -iv_noop(uintptr_t a, uintptr_t b) -{ - atomic_add_int(&smp_tlb_wait, 1); -} - -static call_data_func_t *ipi_vectors[IPI_BITMAP_VECTOR] = +/* + * These start from "IPI offset" APIC_IPI_INTS + */ +static call_data_func_t *ipi_vectors[6] = { - iv_noop, - iv_noop, iv_rendezvous, iv_invltlb, iv_invlpg, @@ -419,10 +413,11 @@ smp_call_function_interrupt(void *unused atomic_t *started = &call_data->started; atomic_t *finished = &call_data->finished; - if (call_data->func_id > IPI_BITMAP_VECTOR) + /* We only handle function IPIs, not bitmap IPIs */ + if (call_data->func_id < APIC_IPI_INTS || call_data->func_id > IPI_BITMAP_VECTOR) panic("invalid function id %u", call_data->func_id); - func = ipi_vectors[call_data->func_id]; + func = ipi_vectors[call_data->func_id - APIC_IPI_INTS]; /* * Notify initiating CPU that I've grabbed the data and am * about to execute the function From owner-svn-src-head@FreeBSD.ORG Sun May 31 08:59:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1E3A1065670; Sun, 31 May 2009 08:59:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D53F98FC0C; Sun, 31 May 2009 08:59:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4V8xF7n036299; Sun, 31 May 2009 08:59:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4V8xFsq036297; Sun, 31 May 2009 08:59:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200905310859.n4V8xFsq036297@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 31 May 2009 08:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193155 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 08:59:16 -0000 Author: nwhitehorn Date: Sun May 31 08:59:15 2009 New Revision: 193155 URL: http://svn.freebsd.org/changeset/base/193155 Log: Provide a new CPU device driver ivar to report the nominal speed of the CPU, if available. This is meant to solve the issue of cpufreq misreporting speeds on CPUs that boot in a reduced power mode and have only relative speed control. Modified: head/sys/kern/kern_cpu.c head/sys/sys/cpu.h Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Sun May 31 08:11:39 2009 (r193154) +++ head/sys/kern/kern_cpu.c Sun May 31 08:59:15 2009 (r193155) @@ -158,12 +158,16 @@ cpufreq_attach(device_t dev) CF_MTX_INIT(&sc->lock); sc->curr_level.total_set.freq = CPUFREQ_VAL_UNKNOWN; SLIST_INIT(&sc->saved_freq); - /* Try to get current CPU freq to use it as maximum later if needed */ - pc = cpu_get_pcpu(dev); - if (cpu_est_clockrate(pc->pc_cpuid, &rate) == 0) - sc->max_mhz = rate / 1000000; - else - sc->max_mhz = CPUFREQ_VAL_UNKNOWN; + /* Try to get nominal CPU freq to use it as maximum later if needed */ + sc->max_mhz = cpu_get_nominal_mhz(dev); + /* If that fails, try to measure the current rate */ + if (sc->max_mhz <= 0) { + pc = cpu_get_pcpu(dev); + if (cpu_est_clockrate(pc->pc_cpuid, &rate) == 0) + sc->max_mhz = rate / 1000000; + else + sc->max_mhz = CPUFREQ_VAL_UNKNOWN; + } /* * Only initialize one set of sysctls for all CPUs. In the future, @@ -581,15 +585,20 @@ cf_levels_method(device_t dev, struct cf /* * If there are no absolute levels, create a fake one at 100%. We * then cache the clockrate for later use as our base frequency. - * - * XXX This assumes that the first time through, if we only have - * relative drivers, the CPU is currently running at 100%. */ if (TAILQ_EMPTY(&sc->all_levels)) { if (sc->max_mhz == CPUFREQ_VAL_UNKNOWN) { - pc = cpu_get_pcpu(dev); - cpu_est_clockrate(pc->pc_cpuid, &rate); - sc->max_mhz = rate / 1000000; + sc->max_mhz = cpu_get_nominal_mhz(dev); + /* + * If the CPU can't report a rate for 100%, hope + * the CPU is running at its nominal rate right now, + * and use that instead. + */ + if (sc->max_mhz <= 0) { + pc = cpu_get_pcpu(dev); + cpu_est_clockrate(pc->pc_cpuid, &rate); + sc->max_mhz = rate / 1000000; + } } memset(&sets[0], CPUFREQ_VAL_UNKNOWN, sizeof(*sets)); sets[0].freq = sc->max_mhz; Modified: head/sys/sys/cpu.h ============================================================================== --- head/sys/sys/cpu.h Sun May 31 08:11:39 2009 (r193154) +++ head/sys/sys/cpu.h Sun May 31 08:59:15 2009 (r193155) @@ -36,6 +36,7 @@ */ #define CPU_IVAR_PCPU 1 +#define CPU_IVAR_NOMINAL_MHZ 2 static __inline struct pcpu *cpu_get_pcpu(device_t dev) { @@ -44,6 +45,15 @@ static __inline struct pcpu *cpu_get_pcp return ((struct pcpu *)v); } +static __inline int32_t cpu_get_nominal_mhz(device_t dev) +{ + uintptr_t v = 0; + if (BUS_READ_IVAR(device_get_parent(dev), dev, + CPU_IVAR_NOMINAL_MHZ, &v) != 0) + return (-1); + return ((int32_t)v); +} + /* * CPU frequency control interface. */ From owner-svn-src-head@FreeBSD.ORG Sun May 31 09:01:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28F94106566B; Sun, 31 May 2009 09:01:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 138848FC13; Sun, 31 May 2009 09:01:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4V91O9x036413; Sun, 31 May 2009 09:01:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4V91NVH036402; Sun, 31 May 2009 09:01:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200905310901.n4V91NVH036402@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 31 May 2009 09:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193156 - in head/sys: conf modules modules/cpufreq powerpc/aim powerpc/booke powerpc/conf powerpc/cpufreq powerpc/ofw powerpc/powermac powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 09:01:24 -0000 Author: nwhitehorn Date: Sun May 31 09:01:23 2009 New Revision: 193156 URL: http://svn.freebsd.org/changeset/base/193156 Log: Introduce support for cpufreq on PowerPC with the dynamic frequency switching capabilities of the MPC7447A and MPC7448. Added: head/sys/powerpc/cpufreq/ head/sys/powerpc/cpufreq/dfs.c (contents, props changed) head/sys/powerpc/ofw/ofw_cpu.c (contents, props changed) head/sys/powerpc/powermac/vcoregpio.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/modules/Makefile head/sys/modules/cpufreq/Makefile head/sys/powerpc/aim/machdep.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/NOTES head/sys/powerpc/powerpc/cpu.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun May 31 08:59:15 2009 (r193155) +++ head/sys/conf/files.powerpc Sun May 31 09:01:23 2009 (r193156) @@ -97,6 +97,7 @@ powerpc/booke/pmap.c optional e500 powerpc/booke/swtch.S optional e500 powerpc/booke/trap.c optional e500 powerpc/booke/vm_machdep.c optional e500 +powerpc/cpufreq/dfs.c optional cpufreq powerpc/fpu/fpu_add.c optional fpu_emu powerpc/fpu/fpu_compare.c optional fpu_emu powerpc/fpu/fpu_div.c optional fpu_emu @@ -114,6 +115,7 @@ powerpc/mpc85xx/nexus.c optional mpc85x powerpc/mpc85xx/ocpbus.c optional mpc85xx powerpc/mpc85xx/opic.c optional mpc85xx powerpc/mpc85xx/pci_ocp.c optional pci mpc85xx +powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_pcibus.c optional pci aim powerpc/ofw/ofw_pcib_pci.c optional pci aim powerpc/ofw/ofw_real.c optional aim @@ -133,6 +135,7 @@ powerpc/powermac/cuda.c optional powerm powerpc/powermac/pmu.c optional powermac pmu powerpc/powermac/macgpio.c optional powermac pci powerpc/powermac/cpcht.c optional powermac pci +powerpc/powermac/vcoregpio.c optional powermac powerpc/powerpc/altivec.c optional aim powerpc/powerpc/atomic.S standard powerpc/powerpc/autoconf.c standard Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun May 31 08:59:15 2009 (r193155) +++ head/sys/modules/Makefile Sun May 31 09:01:23 2009 (r193156) @@ -576,6 +576,7 @@ _xe= xe .if ${MACHINE_ARCH} == "powerpc" _an= an _bm= bm +_cpufreq= cpufreq _nvram= powermac_nvram _smbfs= smbfs _sound= sound Modified: head/sys/modules/cpufreq/Makefile ============================================================================== --- head/sys/modules/cpufreq/Makefile Sun May 31 08:59:15 2009 (r193155) +++ head/sys/modules/cpufreq/Makefile Sun May 31 09:01:23 2009 (r193156) @@ -19,4 +19,9 @@ SRCS+= est.c hwpstate.c p4tcc.c powernow SRCS+= smist.c .endif +.if ${MACHINE} == "powerpc" +.PATH: ${.CURDIR}/../../powerpc/cpufreq +SRCS+= dfs.c +.endif + .include Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sun May 31 08:59:15 2009 (r193155) +++ head/sys/powerpc/aim/machdep.c Sun May 31 09:01:23 2009 (r193156) @@ -881,14 +881,6 @@ cpu_initclocks(void) decr_tc_init(); } -/* Get current clock frequency for the given cpu id. */ -int -cpu_est_clockrate(int cpu_id, uint64_t *rate) -{ - - return (ENXIO); -} - /* * Shutdown the CPU as much as possible. */ Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sun May 31 08:59:15 2009 (r193155) +++ head/sys/powerpc/booke/machdep.c Sun May 31 09:01:23 2009 (r193156) @@ -587,14 +587,6 @@ cpu_flush_dcache(void *ptr, size_t len) /* TBD */ } -/* Get current clock frequency for the given cpu id. */ -int -cpu_est_clockrate(int cpu_id, uint64_t *rate) -{ - - return (ENXIO); -} - /* * Construct a PCB from a trapframe. This is called from kdb_trap() where * we want to start a backtrace from the function that caused us to enter Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun May 31 08:59:15 2009 (r193155) +++ head/sys/powerpc/conf/GENERIC Sun May 31 09:01:23 2009 (r193156) @@ -76,6 +76,9 @@ options WITNESS_SKIPSPIN #Don't run wit # To make an SMP kernel, the next line is needed #options SMP # Symmetric MultiProcessor Kernel +# CPU frequency control +device cpufreq + # Standard busses device pci Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Sun May 31 08:59:15 2009 (r193155) +++ head/sys/powerpc/conf/NOTES Sun May 31 09:01:23 2009 (r193156) @@ -21,6 +21,9 @@ options PSIM #GDB PSIM ppc simulator options SC_OFWFB # OFW frame buffer +# The cpufreq(4) driver provides support for CPU frequency control +device cpufreq + # Standard busses device pci Added: head/sys/powerpc/cpufreq/dfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/cpufreq/dfs.c Sun May 31 09:01:23 2009 (r193156) @@ -0,0 +1,230 @@ +/*- + * Copyright (c) 2009 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include "cpufreq_if.h" + +struct dfs_softc { + device_t dev; + int dfs4; +}; + +static void dfs_identify(driver_t *driver, device_t parent); +static int dfs_probe(device_t dev); +static int dfs_attach(device_t dev); +static int dfs_settings(device_t dev, struct cf_setting *sets, int *count); +static int dfs_set(device_t dev, const struct cf_setting *set); +static int dfs_get(device_t dev, struct cf_setting *set); +static int dfs_type(device_t dev, int *type); + +static device_method_t dfs_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, dfs_identify), + DEVMETHOD(device_probe, dfs_probe), + DEVMETHOD(device_attach, dfs_attach), + + /* cpufreq interface */ + DEVMETHOD(cpufreq_drv_set, dfs_set), + DEVMETHOD(cpufreq_drv_get, dfs_get), + DEVMETHOD(cpufreq_drv_type, dfs_type), + DEVMETHOD(cpufreq_drv_settings, dfs_settings), + + {0, 0} +}; + +static driver_t dfs_driver = { + "dfs", + dfs_methods, + sizeof(struct dfs_softc) +}; + +static devclass_t dfs_devclass; +DRIVER_MODULE(dfs, cpu, dfs_driver, dfs_devclass, 0, 0); + +/* + * Bits of the HID1 register to enable DFS. See page 2-24 of "MPC7450 + * RISC Microprocessor Family Reference Manual", rev. 5. + */ + +#define HID1_DFS2 (1UL << 22) +#define HID1_DFS4 (1UL << 23) + +static void +dfs_identify(driver_t *driver, device_t parent) +{ + uint16_t vers; + vers = mfpvr() >> 16; + + /* Check for an MPC 7447A or 7448 CPU */ + switch (vers) { + case MPC7447A: + case MPC7448: + break; + default: + return; + } + + /* Make sure we're not being doubly invoked. */ + if (device_find_child(parent, "dfs", -1) != NULL) + return; + + /* + * We attach a child for every CPU since settings need to + * be performed on every CPU in the SMP case. + */ + if (BUS_ADD_CHILD(parent, 10, "dfs", -1) == NULL) + device_printf(parent, "add dfs child failed\n"); +} + +static int +dfs_probe(device_t dev) +{ + if (resource_disabled("dfs", 0)) + return (ENXIO); + + device_set_desc(dev, "Dynamic Frequency Switching"); + return (0); +} + +static int +dfs_attach(device_t dev) +{ + struct dfs_softc *sc; + uint16_t vers; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->dfs4 = 0; + vers = mfpvr() >> 16; + + /* The 7448 supports divide-by-four as well */ + if (vers == MPC7448) + sc->dfs4 = 1; + + cpufreq_register(dev); + return (0); +} + +static int +dfs_settings(device_t dev, struct cf_setting *sets, int *count) +{ + struct dfs_softc *sc; + int states; + + sc = device_get_softc(dev); + states = sc->dfs4 ? 3 : 2; + if (sets == NULL || count == NULL) + return (EINVAL); + if (*count < states) + return (E2BIG); + + /* Return a list of valid settings for this driver. */ + memset(sets, CPUFREQ_VAL_UNKNOWN, sizeof(*sets) * states); + + sets[0].freq = 10000; sets[0].dev = dev; + sets[1].freq = 5000; sets[1].dev = dev; + if (sc->dfs4) + sets[2].freq = 2500; sets[2].dev = dev; + *count = states; + + return (0); +} + +static int +dfs_set(device_t dev, const struct cf_setting *set) +{ + struct dfs_softc *sc; + register_t hid1; + + if (set == NULL) + return (EINVAL); + sc = device_get_softc(dev); + + hid1 = mfspr(SPR_HID1); + hid1 &= ~(HID1_DFS2 | HID1_DFS4); + + if (set->freq == 5000) + hid1 |= HID1_DFS2; + else if (set->freq == 2500) + hid1 |= HID1_DFS4; + + /* + * Now set the HID1 register with new values. Calling sequence + * taken from page 2-26 of the MPC7450 family CPU manual. + */ + + powerpc_sync(); + mtspr(SPR_HID1, hid1); + powerpc_sync(); isync(); + + return (0); +} + +static int +dfs_get(device_t dev, struct cf_setting *set) +{ + struct dfs_softc *sc; + register_t hid1; + + if (set == NULL) + return (EINVAL); + sc = device_get_softc(dev); + + memset(set, CPUFREQ_VAL_UNKNOWN, sizeof(*set)); + + hid1 = mfspr(SPR_HID1); + + set->freq = 10000; + if (hid1 & HID1_DFS2) + set->freq = 5000; + else if (sc->dfs4 && (hid1 & HID1_DFS4)) + set->freq = 2500; + + set->dev = dev; + + return (0); +} + +static int +dfs_type(device_t dev, int *type) +{ + + if (type == NULL) + return (EINVAL); + + *type = CPUFREQ_TYPE_RELATIVE; + return (0); +} + Added: head/sys/powerpc/ofw/ofw_cpu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/ofw/ofw_cpu.c Sun May 31 09:01:23 2009 (r193156) @@ -0,0 +1,206 @@ +/*- + * Copyright (C) 2009 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static int ofw_cpulist_probe(device_t); +static int ofw_cpulist_attach(device_t); +static const struct ofw_bus_devinfo *ofw_cpulist_get_devinfo(device_t dev, + device_t child); + +static MALLOC_DEFINE(M_OFWCPU, "ofwcpu", "OFW CPU device information"); + +static device_method_t ofw_cpulist_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ofw_cpulist_probe), + DEVMETHOD(device_attach, ofw_cpulist_attach), + + /* Bus interface */ + DEVMETHOD(bus_driver_added, bus_generic_driver_added), + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, ofw_cpulist_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + { 0, 0 } +}; + +static driver_t ofw_cpulist_driver = { + "cpulist", + ofw_cpulist_methods, + 0 +}; + +static devclass_t ofw_cpulist_devclass; + +DRIVER_MODULE(ofw_cpulist, nexus, ofw_cpulist_driver, ofw_cpulist_devclass, + 0, 0); + +static int +ofw_cpulist_probe(device_t dev) +{ + const char *name; + + name = ofw_bus_get_name(dev); + + if (name == NULL || strcmp(name, "cpus") != 0) + return (ENXIO); + + device_set_desc(dev, "Open Firmware CPU Group"); + + return (0); +} + +static int +ofw_cpulist_attach(device_t dev) +{ + phandle_t root, child; + device_t cdev; + struct ofw_bus_devinfo *dinfo; + + root = ofw_bus_get_node(dev); + + for (child = OF_child(root); child != 0; child = OF_peer(child)) { + dinfo = malloc(sizeof(*dinfo), M_OFWCPU, M_WAITOK | M_ZERO); + + if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { + free(dinfo, M_OFWCPU); + continue; + } + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + dinfo->obd_name); + ofw_bus_gen_destroy_devinfo(dinfo); + free(dinfo, M_OFWCPU); + continue; + } + device_set_ivars(cdev, dinfo); + } + + return (bus_generic_attach(dev)); +} + +static const struct ofw_bus_devinfo * +ofw_cpulist_get_devinfo(device_t dev, device_t child) +{ + return (device_get_ivars(child)); +} + +static int ofw_cpu_probe(device_t); +static int ofw_cpu_attach(device_t); +static int ofw_cpu_read_ivar(device_t dev, device_t child, int index, + uintptr_t *result); + +static device_method_t ofw_cpu_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ofw_cpu_probe), + DEVMETHOD(device_attach, ofw_cpu_attach), + + /* Bus interface */ + DEVMETHOD(bus_driver_added, bus_generic_driver_added), + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, ofw_cpu_read_ivar), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), + + { 0, 0 } +}; + +static driver_t ofw_cpu_driver = { + "cpu", + ofw_cpu_methods, + 0 +}; + +static devclass_t ofw_cpu_devclass; + +DRIVER_MODULE(ofw_cpu, cpulist, ofw_cpu_driver, ofw_cpu_devclass, 0, 0); + +static int +ofw_cpu_probe(device_t dev) +{ + const char *type = ofw_bus_get_type(dev); + + if (strcmp(type, "cpu") != 0) + return (ENXIO); + + device_set_desc(dev, "Open Firmware CPU"); + return (0); +} + +static int +ofw_cpu_attach(device_t dev) +{ + bus_generic_probe(dev); + return (bus_generic_attach(dev)); +} + +static int +ofw_cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) +{ + uint32_t cell; + + switch (index) { + case CPU_IVAR_PCPU: + OF_getprop(ofw_bus_get_node(dev), "reg", &cell, sizeof(cell)); + *result = (uintptr_t)(pcpu_find(cell)); + return (0); + case CPU_IVAR_NOMINAL_MHZ: + cell = 0; + OF_getprop(ofw_bus_get_node(dev), "clock-frequency", + &cell, sizeof(cell)); + cell /= 1000000; /* convert to MHz */ + *result = (uintptr_t)(cell); + return (0); + } + + return (ENOENT); +} + Added: head/sys/powerpc/powermac/vcoregpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powermac/vcoregpio.c Sun May 31 09:01:23 2009 (r193156) @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 2009 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +static int vcoregpio_probe(device_t); +static int vcoregpio_attach(device_t); +static void vcoregpio_pre_change(device_t, const struct cf_level *level); +static void vcoregpio_post_change(device_t, const struct cf_level *level); + +static device_method_t vcoregpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, vcoregpio_probe), + DEVMETHOD(device_attach, vcoregpio_attach), + { 0, 0 }, +}; + +static driver_t vcoregpio_driver = { + "vcoregpio", + vcoregpio_methods, + 0 +}; + +static devclass_t vcoregpio_devclass; + +DRIVER_MODULE(vcoregpio, macgpio, vcoregpio_driver, vcoregpio_devclass, 0, 0); + +static int +vcoregpio_probe(device_t dev) +{ + const char *name = ofw_bus_get_name(dev); + + if (strcmp(name, "cpu-vcore-select") != 0) + return (ENXIO); + + device_set_desc(dev, "CPU Core Voltage Control"); + return (0); +} + +static int +vcoregpio_attach(device_t dev) +{ + EVENTHANDLER_REGISTER(cpufreq_pre_change, vcoregpio_pre_change, dev, + EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(cpufreq_post_change, vcoregpio_post_change, dev, + EVENTHANDLER_PRI_ANY); + + return (0); +} + +static void +vcoregpio_pre_change(device_t dev, const struct cf_level *level) +{ + if (level->rel_set[0].freq == 10000 /* max */) { + /* + * Make sure the CPU voltage is raised before we raise + * the clock. + */ + macgpio_write(dev, GPIO_DDR_OUTPUT | 1); + DELAY(1000); + } +} + +static void +vcoregpio_post_change(device_t dev, const struct cf_level *level) +{ + if (level->rel_set[0].freq < 10000 /* max */) { + DELAY(1000); + /* We are safe to reduce CPU voltage now */ + macgpio_write(dev, GPIO_DDR_OUTPUT | 0); + } +} + Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sun May 31 08:59:15 2009 (r193155) +++ head/sys/powerpc/powerpc/cpu.c Sun May 31 09:01:23 2009 (r193156) @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -288,13 +289,38 @@ void cpu_print_speed(void) { uint64_t cps; + + if (cpu_est_clockrate(0, &cps) == 0) + printf(", %lld.%02lld MHz", cps / 1000000, (cps / 10000) % 100); +} + +/* Get current clock frequency for the given cpu id. */ +int +cpu_est_clockrate(int cpu_id, uint64_t *cps) +{ + uint16_t vers; + + vers = mfpvr() >> 16; - mtspr(SPR_MMCR0, SPR_MMCR0_FC); - mtspr(SPR_PMC1, 0); - mtspr(SPR_MMCR0, SPR_MMCR0_PMC1SEL(PMCN_CYCLES)); - DELAY(100000); - cps = (mfspr(SPR_PMC1) * 10) + 4999; - printf(", %lld.%02lld MHz", cps / 1000000, (cps / 10000) % 100); + switch (vers) { + case MPC7450: + case MPC7455: + case MPC7457: + case MPC750: + case IBM750FX: + case MPC7400: + case MPC7410: + case MPC7447A: + case MPC7448: + mtspr(SPR_MMCR0, SPR_MMCR0_FC); + mtspr(SPR_PMC1, 0); + mtspr(SPR_MMCR0, SPR_MMCR0_PMC1SEL(PMCN_CYCLES)); + DELAY(100000); + *cps = (mfspr(SPR_PMC1) * 10) + 4999; + return (0); + } + + return (ENXIO); } void From owner-svn-src-head@FreeBSD.ORG Sun May 31 09:03:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EF64106564A; Sun, 31 May 2009 09:03:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D3918FC16; Sun, 31 May 2009 09:03:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4V93E8M036487; Sun, 31 May 2009 09:03:14 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4V93EGi036486; Sun, 31 May 2009 09:03:14 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200905310903.n4V93EGi036486@svn.freebsd.org> From: Robert Watson Date: Sun, 31 May 2009 09:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193157 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 09:03:15 -0000 Author: rwatson Date: Sun May 31 09:03:14 2009 New Revision: 193157 URL: http://svn.freebsd.org/changeset/base/193157 Log: Upgrade audit(4) from experimental to production status for FreeBSD 8.0. While there remain some incomplete aspects of the implementation (such as incomplete auditing of some system calls), the implementation has been burned in for a few years, as well as in GENERIC for a few years. Obtained from: TrustedBSD Project Modified: head/share/man/man4/audit.4 Modified: head/share/man/man4/audit.4 ============================================================================== --- head/share/man/man4/audit.4 Sun May 31 09:01:23 2009 (r193156) +++ head/share/man/man4/audit.4 Sun May 31 09:03:14 2009 (r193157) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2006 +.Dd May 31, 2009 .Os .Dt AUDIT 4 .Sh NAME @@ -125,13 +125,6 @@ This manual page was written by .An Robert Watson Aq rwatson@FreeBSD.org . .Sh BUGS The -.Nm -facility in -.Fx -is considered experimental, and production deployment should occur only after -careful consideration of the risks of deploying experimental software. -.Pp -The .Fx kernel does not fully validate that audit records submitted by user applications are syntactically valid BSM; as submission of records is limited From owner-svn-src-head@FreeBSD.ORG Sun May 31 09:24:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48456106566B; Sun, 31 May 2009 09:24:56 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 18FAC8FC17; Sun, 31 May 2009 09:24:55 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 1DA2F5806D; Sun, 31 May 2009 04:03:00 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id yburJKP2DXjJ; Sun, 31 May 2009 04:03:00 -0500 (CDT) Received: from wanderer.tachypleus.net (e179145056.adsl.alicedsl.de [85.179.145.56]) by mail.icecube.wisc.edu (Postfix) with ESMTP id DA15158043; Sun, 31 May 2009 04:02:58 -0500 (CDT) Message-ID: <4A2247C0.4010507@freebsd.org> Date: Sun, 31 May 2009 11:02:56 +0200 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.21 (X11/20090410) MIME-Version: 1.0 To: Nathan Whitehorn References: <200905310901.n4V91NVH036402@svn.freebsd.org> In-Reply-To: <200905310901.n4V91NVH036402@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193156 - in head/sys: conf modules modules/cpufreq powerpc/aim powerpc/booke powerpc/conf powerpc/cpufreq powerpc/ofw powerpc/powermac powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 09:24:56 -0000 Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun May 31 09:01:23 2009 > New Revision: 193156 > URL: http://svn.freebsd.org/changeset/base/193156 > > Log: > Introduce support for cpufreq on PowerPC with the dynamic frequency > switching capabilities of the MPC7447A and MPC7448. > Based on code by: Andreas Tobler -Nathan From owner-svn-src-head@FreeBSD.ORG Sun May 31 10:02:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80D4E106566C; Sun, 31 May 2009 10:02:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E9628FC17; Sun, 31 May 2009 10:02:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VA2Kg3037777; Sun, 31 May 2009 10:02:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VA2K6c037776; Sun, 31 May 2009 10:02:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200905311002.n4VA2K6c037776@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 31 May 2009 10:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193159 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 10:02:20 -0000 Author: nwhitehorn Date: Sun May 31 10:02:20 2009 New Revision: 193159 URL: http://svn.freebsd.org/changeset/base/193159 Log: Provide an analogous sysctl to hw.acpi.acline (dev.pmu.0.acline) to determine whether the computer is plugged in to mains power. Modified: head/sys/powerpc/powermac/pmu.c Modified: head/sys/powerpc/powermac/pmu.c ============================================================================== --- head/sys/powerpc/powermac/pmu.c Sun May 31 09:22:26 2009 (r193158) +++ head/sys/powerpc/powermac/pmu.c Sun May 31 10:02:20 2009 (r193159) @@ -72,6 +72,7 @@ static void pmu_poll(device_t dev); static void pmu_set_sleepled(void *xsc, int onoff); static int pmu_server_mode(SYSCTL_HANDLER_ARGS); +static int pmu_acline_state(SYSCTL_HANDLER_ARGS); static int pmu_query_battery(struct pmu_softc *sc, int batt, struct pmu_battstate *info); static int pmu_battquery_sysctl(SYSCTL_HANDLER_ARGS); @@ -393,6 +394,10 @@ pmu_attach(device_t dev) struct sysctl_oid *oid, *battroot; char battnum[2]; + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "acline", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + pmu_acline_state, "I", "AC Line Status"); + battroot = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "batteries", CTLFLAG_RD, 0, "Battery Information"); @@ -843,6 +848,27 @@ pmu_query_battery(struct pmu_softc *sc, } static int +pmu_acline_state(SYSCTL_HANDLER_ARGS) +{ + struct pmu_softc *sc; + struct pmu_battstate batt; + int error, result; + + sc = arg1; + + /* The PMU treats the AC line status as a property of the battery */ + error = pmu_query_battery(sc, 0, &batt); + + if (error != 0) + return (error); + + result = (batt.state & PMU_PWR_AC_PRESENT) ? 1 : 0; + error = sysctl_handle_int(oidp, &result, 0, req); + + return (error); +} + +static int pmu_battquery_sysctl(SYSCTL_HANDLER_ARGS) { struct pmu_softc *sc; From owner-svn-src-head@FreeBSD.ORG Sun May 31 10:27:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5480106566B; Sun, 31 May 2009 10:27:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8D028FC12; Sun, 31 May 2009 10:27:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VAROfl038325; Sun, 31 May 2009 10:27:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VAROFt038324; Sun, 31 May 2009 10:27:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200905311027.n4VAROFt038324@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 31 May 2009 10:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193161 - head/usr.sbin/powerd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 10:27:25 -0000 Author: nwhitehorn Date: Sun May 31 10:27:24 2009 New Revision: 193161 URL: http://svn.freebsd.org/changeset/base/193161 Log: Teach powerd how to query the PMU AC line state on PowerPC. Modified: head/usr.sbin/powerd/powerd.c Modified: head/usr.sbin/powerd/powerd.c ============================================================================== --- head/usr.sbin/powerd/powerd.c Sun May 31 10:13:10 2009 (r193160) +++ head/usr.sbin/powerd/powerd.c Sun May 31 10:27:24 2009 (r193161) @@ -74,6 +74,7 @@ const char *modes[] = { }; #define ACPIAC "hw.acpi.acline" +#define PMUAC "dev.pmu.0.acline" #define APMDEV "/dev/apm" #define DEVDPIPE "/var/run/devd.pipe" #define DEVCTL_MAXBUF 1024 @@ -93,7 +94,8 @@ static void usage(void); static int cp_times_mib[2]; static int freq_mib[4]; static int levels_mib[4]; -static int acline_mib[3]; +static int acline_mib[4]; +static size_t acline_mib_len; /* Configuration */ static int cpu_running_mark; @@ -105,7 +107,7 @@ static volatile sig_atomic_t exit_reques static power_src_t acline_status; static enum { ac_none, - ac_acpi_sysctl, + ac_sysctl, ac_acpi_devd, #ifdef USE_APM ac_apm, @@ -259,13 +261,18 @@ get_freq_id(int freq, int *freqs, int nu static void acline_init() { - size_t len; + acline_mib_len = 4; - len = 3; - if (sysctlnametomib(ACPIAC, acline_mib, &len) == 0) { - acline_mode = ac_acpi_sysctl; + if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) { + acline_mode = ac_sysctl; + if (vflag) + warnx("using sysctl for AC line status"); +#if __powerpc__ + } else if (sysctlnametomib(PMUAC, acline_mib, &acline_mib_len) == 0) { + acline_mode = ac_sysctl; if (vflag) warnx("using sysctl for AC line status"); +#endif #ifdef USE_APM } else if ((apm_fd = open(APMDEV, O_RDONLY)) >= 0) { if (vflag) @@ -291,7 +298,7 @@ acline_read(void) if (vflag) warnx("lost devd connection, switching to sysctl"); devd_close(); - acline_mode = ac_acpi_sysctl; + acline_mode = ac_sysctl; /* FALLTHROUGH */ } if (rlen > 0 && @@ -301,12 +308,13 @@ acline_read(void) sscanf(ptr, "notify=%x", ¬ify) == 1) acline_status = (notify ? SRC_AC : SRC_BATTERY); } - if (acline_mode == ac_acpi_sysctl) { + if (acline_mode == ac_sysctl) { int acline; size_t len; len = sizeof(acline); - if (sysctl(acline_mib, 3, &acline, &len, NULL, 0) == 0) + if (sysctl(acline_mib, acline_mib_len, &acline, &len, + NULL, 0) == 0) acline_status = (acline ? SRC_AC : SRC_BATTERY); else acline_status = SRC_UNKNOWN; @@ -326,7 +334,7 @@ acline_read(void) } #endif /* try to (re)connect to devd */ - if (acline_mode == ac_acpi_sysctl) { + if (acline_mode == ac_sysctl) { struct timeval now; gettimeofday(&now, NULL); From owner-svn-src-head@FreeBSD.ORG Sun May 31 10:32:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98D37106564A; Sun, 31 May 2009 10:32:21 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 1AD738FC0A; Sun, 31 May 2009 10:32:20 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.3/8.14.3) with ESMTP id n4VALMdU061176; Sun, 31 May 2009 14:21:22 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Sun, 31 May 2009 14:21:22 +0400 (MSD) From: Dmitry Morozovsky To: Doug Barton , Pawel Jakub Dawidek In-Reply-To: <200905301938.n4UJcpbF017191@svn.freebsd.org> Message-ID: References: <200905301938.n4UJcpbF017191@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (woozle.rinet.ru [0.0.0.0]); Sun, 31 May 2009 14:21:22 +0400 (MSD) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193112 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 10:32:22 -0000 Doug, On Sat, 30 May 2009, Doug Barton wrote: DB> Author: dougb DB> Date: Sat May 30 19:38:51 2009 DB> New Revision: 193112 DB> URL: http://svn.freebsd.org/changeset/base/193112 DB> DB> Log: DB> As previously advertised, remove this script prior to the 8.0 branch. Was there an agreement what should one do with dumping to gmirror (see sbin/geom/class/mirror/gmirror.8) ? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Sun May 31 11:57:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 661541065670; Sun, 31 May 2009 11:57:51 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 547008FC1D; Sun, 31 May 2009 11:57:51 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VBvpVD042286; Sun, 31 May 2009 11:57:51 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VBvpeM042284; Sun, 31 May 2009 11:57:51 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200905311157.n4VBvpeM042284@svn.freebsd.org> From: Marko Zec Date: Sun, 31 May 2009 11:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193162 - in head/sys/fs: nfsclient nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 11:57:51 -0000 Author: zec Date: Sun May 31 11:57:51 2009 New Revision: 193162 URL: http://svn.freebsd.org/changeset/base/193162 Log: Unbreak options VIMAGE kernel builds. Approved by: julian (mentor) Modified: head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun May 31 10:27:24 2009 (r193161) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun May 31 11:57:51 2009 (r193162) @@ -1374,7 +1374,7 @@ again: } mtx_unlock(&dnp->n_mtx); - CURVNET_SET(nmp->nm_sockreq.nr_so->so_vnet); + CURVNET_SET(P_TO_VNET(&proc0)); #ifdef INET INIT_VNET_INET(curvnet); if (!TAILQ_EMPTY(&V_in_ifaddrhead)) Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun May 31 10:27:24 2009 (r193161) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun May 31 11:57:51 2009 (r193162) @@ -2673,6 +2673,7 @@ nfsrv_v4rootexport(void *argp, struct uc int nfsrv_getsocksndseq(struct socket *so, tcp_seq *maxp, tcp_seq *unap) { + INIT_VNET_INET(so->so_vnet); struct inpcb *inp; struct tcpcb *tp; int error = EPIPE; From owner-svn-src-head@FreeBSD.ORG Sun May 31 11:59:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BF2F106566B; Sun, 31 May 2009 11:59:32 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79AFF8FC08; Sun, 31 May 2009 11:59:32 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VBxWSP042351; Sun, 31 May 2009 11:59:32 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VBxWsl042350; Sun, 31 May 2009 11:59:32 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200905311159.n4VBxWsl042350@svn.freebsd.org> From: Doug Rabson Date: Sun, 31 May 2009 11:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193163 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 11:59:32 -0000 Author: dfr Date: Sun May 31 11:59:32 2009 New Revision: 193163 URL: http://svn.freebsd.org/changeset/base/193163 Log: Allow the bootfs property to be set for raidz pools on FreeBSD. Reviewed by: pjd Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sun May 31 11:57:51 2009 (r193162) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sun May 31 11:59:32 2009 (r193163) @@ -2392,13 +2392,23 @@ vdev_set_state(vdev_t *vd, boolean_t iso /* * Check the vdev configuration to ensure that it's capable of supporting - * a root pool. Currently, we do not support RAID-Z or partial configuration. - * In addition, only a single top-level vdev is allowed and none of the leaves - * can be wholedisks. + * a root pool. + * + * On Solaris, we do not support RAID-Z or partial configuration. In + * addition, only a single top-level vdev is allowed and none of the + * leaves can be wholedisks. + * + * For FreeBSD, we can boot from any configuration. There is a + * limitation that the boot filesystem must be either uncompressed or + * compresses with lzjb compression but I'm not sure how to enforce + * that here. */ boolean_t vdev_is_bootable(vdev_t *vd) { +#ifdef __FreeBSD_version + return (B_TRUE); +#else int c; if (!vd->vdev_ops->vdev_op_leaf) { @@ -2420,4 +2430,5 @@ vdev_is_bootable(vdev_t *vd) return (B_FALSE); } return (B_TRUE); +#endif } From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:00:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE8951065678; Sun, 31 May 2009 12:00:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA6ED8FC0C; Sun, 31 May 2009 12:00:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VC0GdI042435; Sun, 31 May 2009 12:00:16 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VC0G03042434; Sun, 31 May 2009 12:00:16 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200905311200.n4VC0G03042434@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 31 May 2009 12:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193164 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 12:00:17 -0000 Author: dchagin Date: Sun May 31 12:00:16 2009 New Revision: 193164 URL: http://svn.freebsd.org/changeset/base/193164 Log: Remove empty lines. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun May 31 11:59:32 2009 (r193163) +++ head/sys/compat/linux/linux_socket.c Sun May 31 12:00:16 2009 (r193164) @@ -445,8 +445,6 @@ bsd_to_linux_cmsg_type(int cmsg_type) return (-1); } - - static int linux_to_bsd_msghdr(struct msghdr *bhdr, const struct l_msghdr *lhdr) { From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:04:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65BE510656BB; Sun, 31 May 2009 12:04:01 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5110D8FC19; Sun, 31 May 2009 12:04:01 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VC41ub042550; Sun, 31 May 2009 12:04:01 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VC41GR042549; Sun, 31 May 2009 12:04:01 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200905311204.n4VC41GR042549@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 31 May 2009 12:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193165 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 12:04:05 -0000 Author: dchagin Date: Sun May 31 12:04:01 2009 New Revision: 193165 URL: http://svn.freebsd.org/changeset/base/193165 Log: Move new socket flags handling into a separate function as Linux introduced more syscalls which uses these flags. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun May 31 12:00:16 2009 (r193164) +++ head/sys/compat/linux/linux_socket.c Sun May 31 12:04:01 2009 (r193165) @@ -475,6 +475,24 @@ bsd_to_linux_msghdr(const struct msghdr } static int +linux_set_socket_flags(struct thread *td, int s, int flags) +{ + int error; + + if (flags & LINUX_SOCK_NONBLOCK) { + error = kern_fcntl(td, s, F_SETFL, O_NONBLOCK); + if (error) + return (error); + } + if (flags & LINUX_SOCK_CLOEXEC) { + error = kern_fcntl(td, s, F_SETFD, FD_CLOEXEC); + if (error) + return (error); + } + return (0); +} + +static int linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, struct mbuf *control, enum uio_seg segflg) { @@ -608,21 +626,11 @@ linux_socket(struct thread *td, struct l if (retval_socket) return (retval_socket); - if (socket_flags & LINUX_SOCK_NONBLOCK) { - retval_socket = kern_fcntl(td, td->td_retval[0], - F_SETFL, O_NONBLOCK); - if (retval_socket) { - (void)kern_close(td, td->td_retval[0]); - goto out; - } - } - if (socket_flags & LINUX_SOCK_CLOEXEC) { - retval_socket = kern_fcntl(td, td->td_retval[0], - F_SETFD, FD_CLOEXEC); - if (retval_socket) { - (void)kern_close(td, td->td_retval[0]); - goto out; - } + retval_socket = linux_set_socket_flags(td, td->td_retval[0], + socket_flags); + if (retval_socket) { + (void)kern_close(td, td->td_retval[0]); + goto out; } if (bsd_args.type == SOCK_RAW From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:10:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 723281065673; Sun, 31 May 2009 12:10:04 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F3628FC15; Sun, 31 May 2009 12:10:04 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VCA4lt042726; Sun, 31 May 2009 12:10:04 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VCA4rA042721; Sun, 31 May 2009 12:10:04 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200905311210.n4VCA4rA042721@svn.freebsd.org> From: Marko Zec Date: Sun, 31 May 2009 12:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193166 - in head/sys: kern net sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 12:10:04 -0000 Author: zec Date: Sun May 31 12:10:04 2009 New Revision: 193166 URL: http://svn.freebsd.org/changeset/base/193166 Log: Introduce an interm userland-kernel API for creating vnets and assigning ifnets from one vnet to another. Deletion of vnets is not yet supported. The interface is implemented as an ioctl extension so that no syscalls had to be introduced. This should be acceptable given that the new interface will be used for a short / interim period only, until the new jail management framwork gains the capability of managing vnets. This method for managing vimages / vnets has been in use for the past 7 years without any observable issues. The userland tool to be used in conjunction with the interim API can be found in p4: //depot/projects/vimage-commit2/src/usr.sbin/vimage/... and will most probably never get commited to svn. While here, bump copyright notices in kern_vimage.c and vimage.h to cover work done in year 2009. Approved by: julian (mentor) Discussed with: bz, rwatson Modified: head/sys/kern/kern_prot.c head/sys/kern/kern_vimage.c head/sys/net/if.c head/sys/sys/sockio.h head/sys/sys/vimage.h Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sun May 31 12:04:01 2009 (r193165) +++ head/sys/kern/kern_prot.c Sun May 31 12:10:04 2009 (r193166) @@ -1748,7 +1748,11 @@ p_canwait(struct thread *td, struct proc KASSERT(td == curthread, ("%s: td not curthread", __func__)); PROC_LOCK_ASSERT(p, MA_OWNED); - if ((error = prison_check(td->td_ucred, p->p_ucred))) + if ( +#ifdef VIMAGE /* XXX temporary until struct vimage goes away */ + !vi_child_of(TD_TO_VIMAGE(td), P_TO_VIMAGE(p)) && +#endif + (error = prison_check(td->td_ucred, p->p_ucred))) return (error); #ifdef MAC if ((error = mac_proc_check_wait(td->td_ucred, p))) Modified: head/sys/kern/kern_vimage.c ============================================================================== --- head/sys/kern/kern_vimage.c Sun May 31 12:04:01 2009 (r193165) +++ head/sys/kern/kern_vimage.c Sun May 31 12:10:04 2009 (r193166) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2004-2008 University of Zagreb - * Copyright (c) 2006-2008 FreeBSD Foundation + * Copyright (c) 2004-2009 University of Zagreb + * Copyright (c) 2006-2009 FreeBSD Foundation * * This software was developed by the University of Zagreb and the * FreeBSD Foundation under sponsorship by the Stichting NLnet and the @@ -34,16 +34,24 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include -#include #include #include +#include #include -#include +#include +#include +#include +#include +#include #include #ifdef DDB #include #endif +#include +#include +#include + #ifndef VIMAGE_GLOBALS MALLOC_DEFINE(M_VIMAGE, "vimage", "vimage resource container"); @@ -57,6 +65,22 @@ static int vnet_mod_constructor(struct v static int vnet_mod_destructor(struct vnet_modlink *); #ifdef VIMAGE +static struct vimage *vimage_by_name(struct vimage *, char *); +static struct vimage *vi_alloc(struct vimage *, char *); +static struct vimage *vimage_get_next(struct vimage *, struct vimage *, int); +static void vimage_relative_name(struct vimage *, struct vimage *, + char *, int); +#endif + +#define VNET_LIST_WLOCK() \ + mtx_lock(&vnet_list_refc_mtx); \ + while (vnet_list_refc != 0) \ + cv_wait(&vnet_list_condvar, &vnet_list_refc_mtx); + +#define VNET_LIST_WUNLOCK() \ + mtx_unlock(&vnet_list_refc_mtx); + +#ifdef VIMAGE struct vimage_list_head vimage_head; struct vnet_list_head vnet_head; struct vprocg_list_head vprocg_head; @@ -67,9 +91,294 @@ struct vprocg vprocg_0; #endif #ifdef VIMAGE +struct cv vnet_list_condvar; +struct mtx vnet_list_refc_mtx; +int vnet_list_refc = 0; + +static u_int last_vi_id = 0; +static u_int last_vnet_id = 0; +static u_int last_vprocg_id = 0; + struct vnet *vnet0; #endif +#ifdef VIMAGE + +/* + * Interim userspace interface - will be replaced by jail soon. + */ + +/* + * Move an ifnet to another vnet. The ifnet can be specified either + * by ifp argument, or by name contained in vi_req->vi_if_xname if NULL is + * passed as ifp. The target vnet can be specified either by vnet + * argument or by name. If vnet name equals to ".." or vi_req is set to + * NULL the interface is moved to the parent vnet. + */ +int +vi_if_move(struct vi_req *vi_req, struct ifnet *ifp, struct vimage *vip) +{ + struct vimage *new_vip; + struct vnet *new_vnet = NULL; + + /* Check for API / ABI version mismatch. */ + if (vi_req->vi_api_cookie != VI_API_COOKIE) + return (EDOOFUS); + + /* Find the target vnet. */ + if (vi_req == NULL || strcmp(vi_req->vi_name, "..") == 0) { + if (IS_DEFAULT_VIMAGE(vip)) + return (ENXIO); + new_vnet = vip->vi_parent->v_net; + } else { + new_vip = vimage_by_name(vip, vi_req->vi_name); + if (new_vip == NULL) + return (ENXIO); + new_vnet = new_vip->v_net; + } + + /* Try to find the target ifnet by name. */ + if (ifp == NULL) + ifp = ifunit(vi_req->vi_if_xname); + + if (ifp == NULL) + return (ENXIO); + + /* + * Check for naming clashes in target vnet. Not locked so races + * are possible. + */ + if (vi_req != NULL) { + struct ifnet *t_ifp; + + CURVNET_SET_QUIET(new_vnet); + t_ifp = ifunit(vi_req->vi_if_xname); + CURVNET_RESTORE(); + if (t_ifp != NULL) + return (EEXIST); + } + + /* Detach from curvnet and attach to new_vnet. */ + if_vmove(ifp, new_vnet); + + /* Report the new if_xname back to the userland */ + if (vi_req != NULL) + sprintf(vi_req->vi_if_xname, "%s", ifp->if_xname); + + return (0); +} + +int +vi_td_ioctl(u_long cmd, struct vi_req *vi_req, struct thread *td) +{ + int error = 0; + struct vimage *vip = TD_TO_VIMAGE(td); + struct vimage *vip_r = NULL; + + /* Check for API / ABI version mismatch. */ + if (vi_req->vi_api_cookie != VI_API_COOKIE) + return (EDOOFUS); + + error = priv_check(td, PRIV_REBOOT); /* XXX temp. priv abuse */ + if (error) + return (error); + + vip_r = vimage_by_name(vip, vi_req->vi_name); + if (vip_r == NULL && !(vi_req->vi_req_action & VI_CREATE)) + return (ESRCH); + if (vip_r != NULL && vi_req->vi_req_action & VI_CREATE) + return (EADDRINUSE); + if (vi_req->vi_req_action == VI_GETNEXT) { + vip_r = vimage_get_next(vip, vip_r, 0); + if (vip_r == NULL) + return (ESRCH); + } + if (vi_req->vi_req_action == VI_GETNEXT_RECURSE) { + vip_r = vimage_get_next(vip, vip_r, 1); + if (vip_r == NULL) + return (ESRCH); + } + + if (vip_r && !vi_child_of(vip, vip_r) && /* XXX delete the rest? */ + vi_req->vi_req_action != VI_GET && + vi_req->vi_req_action != VI_GETNEXT) + return (EPERM); + + switch (cmd) { + + case SIOCGPVIMAGE: + vimage_relative_name(vip, vip_r, vi_req->vi_name, + sizeof (vi_req->vi_name)); + vi_req->vi_proc_count = vip_r->v_procg->nprocs; + vi_req->vi_if_count = vip_r->v_net->ifcnt; + vi_req->vi_sock_count = vip_r->v_net->sockcnt; + break; + + case SIOCSPVIMAGE: + if (vi_req->vi_req_action == VI_DESTROY) { +#ifdef NOTYET + error = vi_destroy(vip_r); +#else + error = EOPNOTSUPP; +#endif + break; + } + + if (vi_req->vi_req_action == VI_SWITCHTO) { + struct proc *p = td->td_proc; + struct ucred *oldcred, *newcred; + + /* + * XXX priv_check()? + * XXX allow only a single td per proc here? + */ + newcred = crget(); + PROC_LOCK(p); + oldcred = p->p_ucred; + setsugid(p); + crcopy(newcred, oldcred); + refcount_release(&newcred->cr_vimage->vi_ucredrefc); + newcred->cr_vimage = vip_r; + refcount_acquire(&newcred->cr_vimage->vi_ucredrefc); + p->p_ucred = newcred; + PROC_UNLOCK(p); + sx_xlock(&allproc_lock); + oldcred->cr_vimage->v_procg->nprocs--; + refcount_release(&oldcred->cr_vimage->vi_ucredrefc); + P_TO_VPROCG(p)->nprocs++; + sx_xunlock(&allproc_lock); + crfree(oldcred); + break; + } + + if (vi_req->vi_req_action & VI_CREATE) { + char *dotpos; + + dotpos = strrchr(vi_req->vi_name, '.'); + if (dotpos != NULL) { + *dotpos = 0; + vip = vimage_by_name(vip, vi_req->vi_name); + if (vip == NULL) + return (ESRCH); + dotpos++; + vip_r = vi_alloc(vip, dotpos); + } else + vip_r = vi_alloc(vip, vi_req->vi_name); + if (vip_r == NULL) + return (ENOMEM); + } + } + return (error); +} + +int +vi_child_of(struct vimage *parent, struct vimage *child) +{ + + if (child == parent) + return (0); + for (; child; child = child->vi_parent) + if (child == parent) + return (1); + return (0); +} + +static struct vimage * +vimage_by_name(struct vimage *top, char *name) +{ + struct vimage *vip; + char *next_name; + int namelen; + + next_name = strchr(name, '.'); + if (next_name != NULL) { + namelen = next_name - name; + next_name++; + if (namelen == 0) { + if (strlen(next_name) == 0) + return (top); /* '.' == this vimage */ + else + return (NULL); + } + } else + namelen = strlen(name); + if (namelen == 0) + return (NULL); + LIST_FOREACH(vip, &top->vi_child_head, vi_sibling) { + if (strlen(vip->vi_name) == namelen && + strncmp(name, vip->vi_name, namelen) == 0) { + if (next_name != NULL) + return (vimage_by_name(vip, next_name)); + else + return (vip); + } + } + return (NULL); +} + +static void +vimage_relative_name(struct vimage *top, struct vimage *where, + char *buffer, int bufflen) +{ + int used = 1; + + if (where == top) { + sprintf(buffer, "."); + return; + } else + *buffer = 0; + + do { + int namelen = strlen(where->vi_name); + + if (namelen + used + 1 >= bufflen) + panic("buffer overflow"); + + if (used > 1) { + bcopy(buffer, &buffer[namelen + 1], used); + buffer[namelen] = '.'; + used++; + } else + bcopy(buffer, &buffer[namelen], used); + bcopy(where->vi_name, buffer, namelen); + used += namelen; + where = where->vi_parent; + } while (where != top); +} + +static struct vimage * +vimage_get_next(struct vimage *top, struct vimage *where, int recurse) +{ + struct vimage *next; + + if (recurse) { + /* Try to go deeper in the hierarchy */ + next = LIST_FIRST(&where->vi_child_head); + if (next != NULL) + return (next); + } + + do { + /* Try to find next sibling */ + next = LIST_NEXT(where, vi_sibling); + if (!recurse || next != NULL) + return (next); + + /* Nothing left on this level, go one level up */ + where = where->vi_parent; + } while (where != top->vi_parent); + + /* Nothing left to be visited, we are done */ + return (NULL); +} + +#endif /* VIMAGE */ /* User interface block */ + + +/* + * Kernel interfaces and handlers. + */ + void vnet_mod_register(const struct vnet_modinfo *vmi) { @@ -221,7 +530,7 @@ vnet_mod_constructor(struct vnet_modlink void *mem = malloc(vmi->vmi_size, M_VNET, M_NOWAIT | M_ZERO); if (mem == NULL) /* XXX should return error, not panic. */ - panic("vi_alloc: malloc for %s\n", vmi->vmi_name); + panic("malloc for %s\n", vmi->vmi_name); curvnet->mod_data[vmi->vmi_id] = mem; } #endif @@ -301,43 +610,84 @@ vi_symlookup(struct kld_sym_lookup *look return (ENOENT); } -static void -vi_init(void *unused) -{ #ifdef VIMAGE +static struct vimage * +vi_alloc(struct vimage *parent, char *name) +{ struct vimage *vip; struct vprocg *vprocg; struct vnet *vnet; -#endif - - TAILQ_INIT(&vnet_modlink_head); - TAILQ_INIT(&vnet_modpending_head); - -#ifdef VIMAGE - LIST_INIT(&vimage_head); - LIST_INIT(&vprocg_head); - LIST_INIT(&vnet_head); + struct vnet_modlink *vml; vip = malloc(sizeof(struct vimage), M_VIMAGE, M_NOWAIT | M_ZERO); if (vip == NULL) - panic("malloc failed for struct vimage"); + panic("vi_alloc: malloc failed for vimage \"%s\"\n", name); + vip->vi_id = last_vi_id++; + LIST_INIT(&vip->vi_child_head); + sprintf(vip->vi_name, "%s", name); + vip->vi_parent = parent; + /* XXX locking */ + if (parent != NULL) + LIST_INSERT_HEAD(&parent->vi_child_head, vip, vi_sibling); + else if (!LIST_EMPTY(&vimage_head)) + panic("there can be only one default vimage!"); LIST_INSERT_HEAD(&vimage_head, vip, vi_le); + vnet = malloc(sizeof(struct vnet), M_VNET, M_NOWAIT | M_ZERO); + if (vnet == NULL) + panic("vi_alloc: malloc failed for vnet \"%s\"\n", name); + vip->v_net = vnet; + vnet->vnet_id = last_vnet_id++; + if (vnet->vnet_id == 0) + vnet0 = vnet; + vnet->vnet_magic_n = VNET_MAGIC_N; + vprocg = malloc(sizeof(struct vprocg), M_VPROCG, M_NOWAIT | M_ZERO); if (vprocg == NULL) - panic("malloc failed for struct vprocg"); + panic("vi_alloc: malloc failed for vprocg \"%s\"\n", name); vip->v_procg = vprocg; - LIST_INSERT_HEAD(&vprocg_head, vprocg, vprocg_le); + vprocg->vprocg_id = last_vprocg_id++; - vnet = malloc(sizeof(struct vnet), M_VNET, M_NOWAIT | M_ZERO); - if (vnet == NULL) - panic("vi_alloc: malloc failed"); + /* Initialize / attach vnet module instances. */ + CURVNET_SET_QUIET(vnet); + TAILQ_FOREACH(vml, &vnet_modlink_head, vml_mod_le) + vnet_mod_constructor(vml); + CURVNET_RESTORE(); + + VNET_LIST_WLOCK(); LIST_INSERT_HEAD(&vnet_head, vnet, vnet_le); - vnet->vnet_magic_n = VNET_MAGIC_N; - vip->v_net = vnet; - vnet0 = vnet; + VNET_LIST_WUNLOCK(); + + /* XXX locking */ + LIST_INSERT_HEAD(&vprocg_head, vprocg, vprocg_le); + + return (vip); +} +#endif /* VIMAGE */ - /* We MUST clear curvnet in vi_init_done before going SMP. */ +static void +vi_init(void *unused) +{ + + TAILQ_INIT(&vnet_modlink_head); + TAILQ_INIT(&vnet_modpending_head); + +#ifdef VIMAGE + LIST_INIT(&vimage_head); + LIST_INIT(&vprocg_head); + LIST_INIT(&vnet_head); + + mtx_init(&vnet_list_refc_mtx, "vnet_list_refc_mtx", NULL, MTX_DEF); + cv_init(&vnet_list_condvar, "vnet_list_condvar"); + + /* Default image has no parent and no name. */ + vi_alloc(NULL, ""); + + /* + * We MUST clear curvnet in vi_init_done() before going SMP, + * otherwise CURVNET_SET() macros would scream about unnecessary + * curvnet recursions. + */ curvnet = LIST_FIRST(&vnet_head); #endif } Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun May 31 12:04:01 2009 (r193165) +++ head/sys/net/if.c Sun May 31 12:10:04 2009 (r193166) @@ -2283,6 +2283,21 @@ ifioctl(struct socket *so, u_long cmd, c ifr = (struct ifreq *)data; switch (cmd) { +#ifdef VIMAGE + /* + * XXX vnet creation will be implemented through the new jail + * framework - this is just a temporary hack for testing the + * vnet create / destroy mechanisms. + */ + case SIOCSIFVIMAGE: + error = vi_if_move((struct vi_req *) data, NULL, + TD_TO_VIMAGE(td)); + return (error); + case SIOCSPVIMAGE: + case SIOCGPVIMAGE: + error = vi_td_ioctl(cmd, (struct vi_req *) data, td); + return (error); +#endif case SIOCIFCREATE: case SIOCIFCREATE2: error = priv_check(td, PRIV_NET_IFCREATE); Modified: head/sys/sys/sockio.h ============================================================================== --- head/sys/sys/sockio.h Sun May 31 12:04:01 2009 (r193165) +++ head/sys/sys/sockio.h Sun May 31 12:10:04 2009 (r193166) @@ -108,6 +108,10 @@ #define SIOCGPRIVATE_0 _IOWR('i', 80, struct ifreq) /* device private 0 */ #define SIOCGPRIVATE_1 _IOWR('i', 81, struct ifreq) /* device private 1 */ +#define SIOCSPVIMAGE _IOW('i', 101, struct vi_req) /* set proc vimage */ +#define SIOCGPVIMAGE _IOWR('i', 102, struct vi_req) /* get proc vimage */ +#define SIOCSIFVIMAGE _IOWR('i', 103, struct vi_req) /* set ifc vi/net */ + #define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific parameters */ #define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Sun May 31 12:04:01 2009 (r193165) +++ head/sys/sys/vimage.h Sun May 31 12:10:04 2009 (r193166) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2006-2008 University of Zagreb - * Copyright (c) 2006-2008 FreeBSD Foundation + * Copyright (c) 2006-2009 University of Zagreb + * Copyright (c) 2006-2009 FreeBSD Foundation * * This software was developed by the University of Zagreb and the * FreeBSD Foundation under sponsorship by the Stichting NLnet and the @@ -36,6 +36,31 @@ #include #include +/* Interim userspace API. */ +struct vi_req { + int vi_api_cookie; /* Catch API mismatch. */ + int vi_req_action; /* What to do with this request? */ + u_short vi_proc_count; /* Current number of processes. */ + int vi_if_count; /* Current number of ifnets. */ + int vi_sock_count; + char vi_name[MAXPATHLEN]; + char vi_if_xname[MAXPATHLEN]; /* XXX should be IFNAMSIZ */ +}; + +#define VI_CREATE 0x00000001 +#define VI_DESTROY 0x00000002 +#define VI_SWITCHTO 0x00000008 +#define VI_IFACE 0x00000010 +#define VI_GET 0x00000100 +#define VI_GETNEXT 0x00000200 +#define VI_GETNEXT_RECURSE 0x00000300 + +#define VI_API_VERSION 1 /* Bump on struct changes. */ + +#define VI_API_COOKIE ((sizeof(struct vi_req) << 16) | VI_API_VERSION) + +#ifdef _KERNEL + #if defined(VIMAGE) && defined(VIMAGE_GLOBALS) #error "You cannot have both option VIMAGE and option VIMAGE_GLOBALS!" #endif @@ -46,6 +71,8 @@ struct vprocg; struct vnet; +struct vi_req; +struct ifnet; struct kld_sym_lookup; typedef int vnet_attach_fn(const void *); @@ -129,6 +156,9 @@ struct vnet_modlink { #define V_MOD_vprocg 0 /* no minor module ids like in vnet */ int vi_symlookup(struct kld_sym_lookup *, char *); +int vi_td_ioctl(u_long, struct vi_req *, struct thread *); +int vi_if_move(struct vi_req *, struct ifnet *, struct vimage *); +int vi_child_of(struct vimage *, struct vimage *); void vnet_mod_register(const struct vnet_modinfo *); void vnet_mod_register_multi(const struct vnet_modinfo *, void *, char *); void vnet_mod_deregister(const struct vnet_modinfo *); @@ -449,4 +479,6 @@ extern struct vprocg_list_head vprocg_he #define VIMAGE_CTASSERT(x, y) struct __hack #endif +#endif /* _KERNEL */ + #endif /* !_SYS_VIMAGE_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:12:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E30821065670; Sun, 31 May 2009 12:12:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0E458FC13; Sun, 31 May 2009 12:12:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VCCcX9042814; Sun, 31 May 2009 12:12:38 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VCCciW042812; Sun, 31 May 2009 12:12:38 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200905311212.n4VCCciW042812@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 31 May 2009 12:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193167 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 12:12:39 -0000 Author: dchagin Date: Sun May 31 12:12:38 2009 New Revision: 193167 URL: http://svn.freebsd.org/changeset/base/193167 Log: Split native socketpair() syscall onto kern_socketpair() which should be used by kernel consumers and socketpair() itself. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/kern/uipc_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sun May 31 12:10:04 2009 (r193166) +++ head/sys/kern/uipc_syscalls.c Sun May 31 12:12:38 2009 (r193167) @@ -588,51 +588,43 @@ done1: } int -socketpair(td, uap) - struct thread *td; - struct socketpair_args /* { - int domain; - int type; - int protocol; - int *rsv; - } */ *uap; +kern_socketpair(struct thread *td, int domain, int type, int protocol, + int *rsv) { struct filedesc *fdp = td->td_proc->p_fd; struct file *fp1, *fp2; struct socket *so1, *so2; - int fd, error, sv[2]; + int fd, error; #ifdef MAC /* We might want to have a separate check for socket pairs. */ - error = mac_socket_check_create(td->td_ucred, uap->domain, uap->type, - uap->protocol); + error = mac_socket_check_create(td->td_ucred, domain, type, + protocol); if (error) return (error); #endif - error = socreate(uap->domain, &so1, uap->type, uap->protocol, - td->td_ucred, td); + error = socreate(domain, &so1, type, protocol, td->td_ucred, td); if (error) return (error); - error = socreate(uap->domain, &so2, uap->type, uap->protocol, - td->td_ucred, td); + error = socreate(domain, &so2, type, protocol, td->td_ucred, td); if (error) goto free1; /* On success extra reference to `fp1' and 'fp2' is set by falloc. */ error = falloc(td, &fp1, &fd); if (error) goto free2; - sv[0] = fd; + rsv[0] = fd; fp1->f_data = so1; /* so1 already has ref count */ error = falloc(td, &fp2, &fd); if (error) goto free3; fp2->f_data = so2; /* so2 already has ref count */ - sv[1] = fd; + rsv[1] = fd; error = soconnect2(so1, so2); if (error) goto free4; - if (uap->type == SOCK_DGRAM) { + if (type == SOCK_DGRAM) { /* * Datagram socket connection is asymmetric. */ @@ -642,18 +634,14 @@ socketpair(td, uap) } finit(fp1, FREAD | FWRITE, DTYPE_SOCKET, fp1->f_data, &socketops); finit(fp2, FREAD | FWRITE, DTYPE_SOCKET, fp2->f_data, &socketops); - so1 = so2 = NULL; - error = copyout(sv, uap->rsv, 2 * sizeof (int)); - if (error) - goto free4; fdrop(fp1, td); fdrop(fp2, td); return (0); free4: - fdclose(fdp, fp2, sv[1], td); + fdclose(fdp, fp2, rsv[1], td); fdrop(fp2, td); free3: - fdclose(fdp, fp1, sv[0], td); + fdclose(fdp, fp1, rsv[0], td); fdrop(fp1, td); free2: if (so2 != NULL) @@ -664,6 +652,23 @@ free1: return (error); } +int +socketpair(struct thread *td, struct socketpair_args *uap) +{ + int error, sv[2]; + + error = kern_socketpair(td, uap->domain, uap->type, + uap->protocol, sv); + if (error) + return (error); + error = copyout(sv, uap->rsv, 2 * sizeof(int)); + if (error) { + (void)kern_close(td, sv[0]); + (void)kern_close(td, sv[1]); + } + return (error); +} + static int sendit(td, s, mp, flags) struct thread *td; Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Sun May 31 12:10:04 2009 (r193166) +++ head/sys/sys/syscallsubr.h Sun May 31 12:12:38 2009 (r193167) @@ -220,6 +220,8 @@ int kern_utimesat(struct thread *td, int int kern_wait(struct thread *td, pid_t pid, int *status, int options, struct rusage *rup); int kern_writev(struct thread *td, int fd, struct uio *auio); +int kern_socketpair(struct thread *td, int domain, int type, int protocol, + int *rsv); /* flags for kern_sigaction */ #define KSA_OSIGSET 0x0001 /* uses osigact_t */ From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:16:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5118F106566C; Sun, 31 May 2009 12:16:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BF988FC13; Sun, 31 May 2009 12:16:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VCGWYq042920; Sun, 31 May 2009 12:16:32 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VCGWwP042919; Sun, 31 May 2009 12:16:32 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200905311216.n4VCGWwP042919@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 31 May 2009 12:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193168 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 12:16:32 -0000 Author: dchagin Date: Sun May 31 12:16:31 2009 New Revision: 193168 URL: http://svn.freebsd.org/changeset/base/193168 Log: Implement a variation of the socketpair() syscall which takes a flags in addition to the type argument. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun May 31 12:12:38 2009 (r193167) +++ head/sys/compat/linux/linux_socket.c Sun May 31 12:16:31 2009 (r193168) @@ -884,12 +884,20 @@ linux_socketpair(struct thread *td, stru int protocol; int *rsv; } */ bsd_args; + int error, socket_flags; + int sv[2]; bsd_args.domain = linux_to_bsd_domain(args->domain); if (bsd_args.domain != PF_LOCAL) return (EAFNOSUPPORT); - bsd_args.type = args->type; + socket_flags = args->type & ~LINUX_SOCK_TYPE_MASK; + if (socket_flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK)) + return (EINVAL); + bsd_args.type = args->type & LINUX_SOCK_TYPE_MASK; + if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX) + return (EINVAL); + if (args->protocol != 0 && args->protocol != PF_UNIX) /* @@ -902,7 +910,25 @@ linux_socketpair(struct thread *td, stru else bsd_args.protocol = 0; bsd_args.rsv = (int *)PTRIN(args->rsv); - return (socketpair(td, &bsd_args)); + error = kern_socketpair(td, bsd_args.domain, bsd_args.type, + bsd_args.protocol, sv); + if (error) + return (error); + error = linux_set_socket_flags(td, sv[0], socket_flags); + if (error) + goto out; + error = linux_set_socket_flags(td, sv[1], socket_flags); + if (error) + goto out; + + error = copyout(sv, bsd_args.rsv, 2 * sizeof(int)); + +out: + if (error) { + (void)kern_close(td, sv[0]); + (void)kern_close(td, sv[1]); + } + return (error); } struct linux_send_args { From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:27:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BE41106566B; Sun, 31 May 2009 12:27:01 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 59D078FC22; Sun, 31 May 2009 12:27:01 +0000 (UTC) (envelope-from jilles@stack.nl) Received: by mx1.stack.nl (Postfix, from userid 65534) id BEC3E359934; Sun, 31 May 2009 14:27:00 +0200 (CEST) X-Spam-DCC: sonic.net: scanner01.stack.nl 1117; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on scanner01.stack.nl X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Relay-Country: _RELAYCOUNTRY_ Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 4A53835994C; Sun, 31 May 2009 14:26:55 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id A15FF228BC; Sun, 31 May 2009 14:26:42 +0200 (CEST) Date: Sun, 31 May 2009 14:26:42 +0200 From: Jilles Tjoelker To: Dmitry Chagin Message-ID: <20090531122642.GA18020@stack.nl> References: <200905311204.n4VC41GR042549@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200905311204.n4VC41GR042549@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193165 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 12:27:02 -0000 On Sun, May 31, 2009 at 12:04:01PM +0000, Dmitry Chagin wrote: > Author: dchagin > Date: Sun May 31 12:04:01 2009 > New Revision: 193165 > URL: http://svn.freebsd.org/changeset/base/193165 > Log: > Move new socket flags handling into a separate function as Linux > introduced more syscalls which uses these flags. I think this does not fulfill the purpose of LINUX_SOCK_CLOEXEC exactly: if another thread forks and execs at the wrong time, it may inherit the socket without the CLOEXEC flag set. The obvious way to fix this is to implement SOCK_CLOEXEC in the native syscalls, in such a way that other threads can never see the new fd without the CLOEXEC flag set. That could be fairly complicated and it is a pretty rare situation, however. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:36:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18CDF106564A; Sun, 31 May 2009 12:36:15 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06E538FC08; Sun, 31 May 2009 12:36:15 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VCaEf6043388; Sun, 31 May 2009 12:36:14 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VCaEjQ043383; Sun, 31 May 2009 12:36:14 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200905311236.n4VCaEjQ043383@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 31 May 2009 12:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193169 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 12:36:15 -0000 Author: stefanf Date: Sun May 31 12:36:14 2009 New Revision: 193169 URL: http://svn.freebsd.org/changeset/base/193169 Log: Fix the eval command in combination with set -e. Before this change the shell would always terminate if eval returned with a non-zero exit status regardless if the status was actually tested. Unfortunately a new file-scope variable is needed, the alternative would only be to add a new parameter to all built-ins. PR: 134881 Modified: head/bin/sh/eval.c head/bin/sh/eval.h head/bin/sh/histedit.c head/bin/sh/main.c head/bin/sh/trap.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun May 31 12:16:31 2009 (r193168) +++ head/bin/sh/eval.c Sun May 31 12:36:14 2009 (r193169) @@ -83,6 +83,7 @@ MKINIT int evalskip; /* set if we are s STATIC int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ +STATIC int builtin_flags; /* evalcommand flags for builtins */ char *commandname; @@ -147,7 +148,7 @@ evalcmd(int argc, char **argv) STPUTC('\0', concat); p = grabstackstr(concat); } - evalstring(p); + evalstring(p, builtin_flags & EV_TESTED); } return exitstatus; } @@ -158,7 +159,7 @@ evalcmd(int argc, char **argv) */ void -evalstring(char *s) +evalstring(char *s, int flags) { union node *n; struct stackmark smark; @@ -167,7 +168,7 @@ evalstring(char *s) setinputstring(s, 1); while ((n = parsecmd(0)) != NEOF) { if (n != NULL) - evaltree(n, 0); + evaltree(n, flags); popstackmark(&smark); } popfile(); @@ -839,6 +840,7 @@ evalcommand(union node *cmd, int flags, commandname = argv[0]; argptr = argv + 1; optptr = NULL; /* initialize nextopt */ + builtin_flags = flags; exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv); flushall(); cmddone: Modified: head/bin/sh/eval.h ============================================================================== --- head/bin/sh/eval.h Sun May 31 12:16:31 2009 (r193168) +++ head/bin/sh/eval.h Sun May 31 12:36:14 2009 (r193169) @@ -46,7 +46,7 @@ struct backcmd { /* result of evalbackc }; int evalcmd(int, char **); -void evalstring(char *); +void evalstring(char *, int); union node; /* BLETCH for ansi C */ void evaltree(union node *, int); void evalbackcmd(union node *, struct backcmd *); Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Sun May 31 12:16:31 2009 (r193168) +++ head/bin/sh/histedit.c Sun May 31 12:36:14 2009 (r193169) @@ -350,7 +350,7 @@ histcmd(int argc, char **argv) if (displayhist) { out2str(s); } - evalstring(s); + evalstring(s, 0); if (displayhist && hist) { /* * XXX what about recursive and @@ -382,7 +382,7 @@ histcmd(int argc, char **argv) fclose(efp); editcmd = stalloc(strlen(editor) + strlen(editfile) + 2); sprintf(editcmd, "%s %s", editor, editfile); - evalstring(editcmd); /* XXX - should use no JC command */ + evalstring(editcmd, 0); /* XXX - should use no JC command */ INTON; readcmdfile(editfile); /* XXX - should read back - quick tst */ unlink(editfile); Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sun May 31 12:16:31 2009 (r193168) +++ head/bin/sh/main.c Sun May 31 12:36:14 2009 (r193169) @@ -178,7 +178,7 @@ state2: state3: state = 4; if (minusc) { - evalstring(minusc); + evalstring(minusc, 0); } if (sflag || minusc == NULL) { state4: /* XXX ??? - why isn't this before the "if" statement */ Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Sun May 31 12:16:31 2009 (r193168) +++ head/bin/sh/trap.c Sun May 31 12:36:14 2009 (r193169) @@ -416,7 +416,7 @@ dotrap(void) if (i == SIGCHLD) ignore_sigchld++; savestatus = exitstatus; - evalstring(trap[i]); + evalstring(trap[i], 0); exitstatus = savestatus; if (i == SIGCHLD) ignore_sigchld--; @@ -471,7 +471,7 @@ exitshell(int status) handler = &loc1; if ((p = trap[0]) != NULL && *p != '\0') { trap[0] = NULL; - evalstring(p); + evalstring(p, 0); } l1: handler = &loc2; /* probably unnecessary */ flushall(); From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:46:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3F60106566C; Sun, 31 May 2009 12:46:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 617F38FC14; Sun, 31 May 2009 12:46:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1MAkQI-0001KK-UV; Sun, 31 May 2009 15:45:59 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n4VCjudM083210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 May 2009 15:45:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n4VCjt7G011160; Sun, 31 May 2009 15:45:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n4VCjt0V011159; Sun, 31 May 2009 15:45:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 31 May 2009 15:45:55 +0300 From: Kostik Belousov To: Jilles Tjoelker Message-ID: <20090531124555.GT1927@deviant.kiev.zoral.com.ua> References: <200905311204.n4VC41GR042549@svn.freebsd.org> <20090531122642.GA18020@stack.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KRI42z441+znMDe3" Content-Disposition: inline In-Reply-To: <20090531122642.GA18020@stack.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.1 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1MAkQI-0001KK-UV e54191725f7a303664b5f17bb18178d5 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Chagin Subject: Re: svn commit: r193165 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 12:46:01 -0000 --KRI42z441+znMDe3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 31, 2009 at 02:26:42PM +0200, Jilles Tjoelker wrote: > On Sun, May 31, 2009 at 12:04:01PM +0000, Dmitry Chagin wrote: > > Author: dchagin > > Date: Sun May 31 12:04:01 2009 > > New Revision: 193165 > > URL: http://svn.freebsd.org/changeset/base/193165 >=20 > > Log: > > Move new socket flags handling into a separate function as Linux > > introduced more syscalls which uses these flags. >=20 > I think this does not fulfill the purpose of LINUX_SOCK_CLOEXEC exactly: > if another thread forks and execs at the wrong time, it may inherit the > socket without the CLOEXEC flag set. >=20 > The obvious way to fix this is to implement SOCK_CLOEXEC in the native > syscalls, in such a way that other threads can never see the new fd > without the CLOEXEC flag set. >=20 > That could be fairly complicated and it is a pretty rare situation, > however. This is well-known issue, that is omnipresent in the linuxolator. Your analysis is right, but until we implement corresponding facilities for the native ABI, linuxolator will be in is this state. Whether we really need to do the work for freebsd binaries is debatable. For the typical case, see linux_common_open().=20 --KRI42z441+znMDe3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkoifAMACgkQC3+MBN1Mb4heEACdHjkX04k1V/l0phjSPK6S6p+P AQIAoJ7GE0IugwNr9shxAUJsslek2z+G =YiZx -----END PGP SIGNATURE----- --KRI42z441+znMDe3-- From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:54:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25BAF1065679; Sun, 31 May 2009 12:54:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id B73EC8FC08; Sun, 31 May 2009 12:54:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1MAkYB-0001u8-1g; Sun, 31 May 2009 15:54:07 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n4VCs0mg083553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 May 2009 15:54:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n4VCs0F8011216; Sun, 31 May 2009 15:54:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n4VCs0Jq011215; Sun, 31 May 2009 15:54:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 31 May 2009 15:54:00 +0300 From: Kostik Belousov To: Jilles Tjoelker Message-ID: <20090531125400.GU1927@deviant.kiev.zoral.com.ua> References: <200905311204.n4VC41GR042549@svn.freebsd.org> <20090531122642.GA18020@stack.nl> <20090531124555.GT1927@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5GtKBH2IVcxTg5OS" Content-Disposition: inline In-Reply-To: <20090531124555.GT1927@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.1 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1MAkYB-0001u8-1g 350072e7ec5269d41efbe5196abfd308 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Chagin Subject: Re: svn commit: r193165 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 12:54:09 -0000 --5GtKBH2IVcxTg5OS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 31, 2009 at 03:45:55PM +0300, Kostik Belousov wrote: > On Sun, May 31, 2009 at 02:26:42PM +0200, Jilles Tjoelker wrote: > > On Sun, May 31, 2009 at 12:04:01PM +0000, Dmitry Chagin wrote: > > > Author: dchagin > > > Date: Sun May 31 12:04:01 2009 > > > New Revision: 193165 > > > URL: http://svn.freebsd.org/changeset/base/193165 > >=20 > > > Log: > > > Move new socket flags handling into a separate function as Linux > > > introduced more syscalls which uses these flags. > >=20 > > I think this does not fulfill the purpose of LINUX_SOCK_CLOEXEC exactly: > > if another thread forks and execs at the wrong time, it may inherit the > > socket without the CLOEXEC flag set. > >=20 > > The obvious way to fix this is to implement SOCK_CLOEXEC in the native > > syscalls, in such a way that other threads can never see the new fd > > without the CLOEXEC flag set. > >=20 > > That could be fairly complicated and it is a pretty rare situation, > > however. >=20 > This is well-known issue, that is omnipresent in the linuxolator. > Your analysis is right, but until we implement corresponding > facilities for the native ABI, linuxolator will be in is this state. > Whether we really need to do the work for freebsd binaries is > debatable. >=20 > For the typical case, see linux_common_open().=20 Mostly replying to myself. The fact that your statement about race is right actually points to the deficiency in the implementation of the linux_execve(), as opposed to the bug in the LINUX_SOCK_CLOEXEC handling. Complete execve(2) implementation should do single-threading for the curproc, and singlethreading happens only when all threads except the one doing execve cross the boundary. See call to thread_single in kern_execve. This does not really happen for linux ABI processes, since multithreading is implemented as multiprocessing. When (if) a singlethreading solution will be implemented for linux ABI, exec cannot happen between these two calls, since the thread is still in kernel not on the single-threading boundary. --5GtKBH2IVcxTg5OS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkoifegACgkQC3+MBN1Mb4h9/wCfSQXzhPce7YSbTDsjS3OGstoH HikAniPvTjdVE2WG9MDKvzG5dGf2zYm4 =v8gh -----END PGP SIGNATURE----- --5GtKBH2IVcxTg5OS-- From owner-svn-src-head@FreeBSD.ORG Sun May 31 14:48:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CE431065678; Sun, 31 May 2009 14:48:52 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AD7F8FC26; Sun, 31 May 2009 14:48:52 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VEmpxi046578; Sun, 31 May 2009 14:48:52 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VEmpgQ046576; Sun, 31 May 2009 14:48:51 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <200905311448.n4VEmpgQ046576@svn.freebsd.org> From: Daniel Eischen Date: Sun, 31 May 2009 14:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193171 - in head/sys/dev/usb: . storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 14:48:53 -0000 Author: deischen Date: Sun May 31 14:48:51 2009 New Revision: 193171 URL: http://svn.freebsd.org/changeset/base/193171 Log: Add a NO_SYNCHRONIZE_CACHE quirk for an AIPTEK2 part identified as Sunplus Technology Inc. This happens to sit in a Rosewill RX81U-ES-25A 2.5" SATA to USB 2.0 external enclosure. Reviewed by: Hans Petter Selasky Modified: head/sys/dev/usb/storage/umass.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Sun May 31 13:52:17 2009 (r193170) +++ head/sys/dev/usb/storage/umass.c Sun May 31 14:48:51 2009 (r193171) @@ -396,6 +396,10 @@ static const struct umass_devdescr umass UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS }, + {USB_VENDOR_AIPTEK2, USB_PRODUCT_AIPTEK2_SUNPLUS_TECH, RID_WILDCARD, + UMASS_PROTO_DEFAULT, + NO_SYNCHRONIZE_CACHE + }, {USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_AU6390, RID_WILDCARD, UMASS_PROTO_DEFAULT, NO_SYNCHRONIZE_CACHE Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun May 31 13:52:17 2009 (r193170) +++ head/sys/dev/usb/usbdevs Sun May 31 14:48:51 2009 (r193171) @@ -805,6 +805,7 @@ product AINCOMM AWU2000B 0x1001 AWU2000B /* AIPTEK products */ product AIPTEK POCKETCAM3M 0x2011 PocketCAM 3Mega product AIPTEK2 PENCAM_MEGA_1_3 0x504a PenCam Mega 1.3 +product AIPTEK2 SUNPLUS_TECH 0x0c15 Sunplus Technology Inc. /* AirPrime products */ product AIRPRIME PC5220 0x0112 CDMA Wireless PC Card From owner-svn-src-head@FreeBSD.ORG Sun May 31 14:52:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15F011065677; Sun, 31 May 2009 14:52:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 046B78FC25; Sun, 31 May 2009 14:52:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VEqjgu046696; Sun, 31 May 2009 14:52:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VEqjHf046695; Sun, 31 May 2009 14:52:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200905311452.n4VEqjHf046695@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 31 May 2009 14:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193172 - head/sys/fs/nullfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 14:52:47 -0000 Author: kib Date: Sun May 31 14:52:45 2009 New Revision: 193172 URL: http://svn.freebsd.org/changeset/base/193172 Log: Lock the real null vnode lock before substitution of vp->v_vnlock. This should not really matter for correctness, since vp->v_lock is not locked before the call, and null_lock() holds the interlock, but makes the control flow for reclaim more clear. Tested by: pho Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sun May 31 14:48:51 2009 (r193171) +++ head/sys/fs/nullfs/null_vnops.c Sun May 31 14:52:45 2009 (r193172) @@ -683,14 +683,15 @@ null_reclaim(struct vop_reclaim_args *ap * Use the interlock to protect the clearing of v_data to * prevent faults in null_lock(). */ + lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL); VI_LOCK(vp); vp->v_data = NULL; vp->v_object = NULL; vp->v_vnlock = &vp->v_lock; - if (lowervp) { - lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_INTERLOCK, VI_MTX(vp)); + VI_UNLOCK(vp); + if (lowervp) vput(lowervp); - } else + else panic("null_reclaim: reclaiming a node with no lowervp"); free(xp, M_NULLFSNODE); From owner-svn-src-head@FreeBSD.ORG Sun May 31 14:54:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 327AD106564A; Sun, 31 May 2009 14:54:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06D188FC13; Sun, 31 May 2009 14:54:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VEsK2u046759; Sun, 31 May 2009 14:54:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VEsK9s046758; Sun, 31 May 2009 14:54:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200905311454.n4VEsK9s046758@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 31 May 2009 14:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193173 - head/sys/fs/nullfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 14:54:21 -0000 Author: kib Date: Sun May 31 14:54:20 2009 New Revision: 193173 URL: http://svn.freebsd.org/changeset/base/193173 Log: Do not drop vnode interlock in null_checkvp(). null_lock() verifies that v_data is not-null before calling NULLVPTOLOWERVP(), and dropping the interlock allows for reclaim to clean v_data and free the memory. While there, remove unneeded semicolons and convert the infinite loops to panics. I have a will to remove null_checkvp() altogether, or leave it as a trivial stub, but not now. Reported and tested by: pho Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Sun May 31 14:52:45 2009 (r193172) +++ head/sys/fs/nullfs/null_subr.c Sun May 31 14:54:20 2009 (r193173) @@ -269,20 +269,14 @@ null_hashrem(xp) #ifdef DIAGNOSTIC -#ifdef KDB -#define null_checkvp_barrier 1 -#else -#define null_checkvp_barrier 0 -#endif - struct vnode * null_checkvp(vp, fil, lno) struct vnode *vp; char *fil; int lno; { - int interlock = 0; struct null_node *a = VTONULL(vp); + #ifdef notyet /* * Can't do this check because vop_reclaim runs @@ -290,9 +284,8 @@ null_checkvp(vp, fil, lno) */ if (vp->v_op != null_vnodeop_p) { printf ("null_checkvp: on non-null-node\n"); - while (null_checkvp_barrier) /*WAIT*/ ; panic("null_checkvp"); - }; + } #endif if (a->null_lowervp == NULLVP) { /* Should never happen */ @@ -301,32 +294,24 @@ null_checkvp(vp, fil, lno) for (p = (u_long *) a, i = 0; i < 8; i++) printf(" %lx", p[i]); printf("\n"); - /* wait for debugger */ - while (null_checkvp_barrier) /*WAIT*/ ; panic("null_checkvp"); } - if (mtx_owned(VI_MTX(vp)) != 0) { - VI_UNLOCK(vp); - interlock = 1; - } - if (vrefcnt(a->null_lowervp) < 1) { + VI_LOCK_FLAGS(a->null_lowervp, MTX_DUPOK); + if (a->null_lowervp->v_usecount < 1) { int i; u_long *p; printf("vp = %p, unref'ed lowervp\n", (void *)vp); for (p = (u_long *) a, i = 0; i < 8; i++) printf(" %lx", p[i]); printf("\n"); - /* wait for debugger */ - while (null_checkvp_barrier) /*WAIT*/ ; panic ("null with unref'ed lowervp"); - }; - if (interlock != 0) - VI_LOCK(vp); + } + VI_UNLOCK(a->null_lowervp); #ifdef notyet printf("null %x/%d -> %x/%d [%s, %d]\n", NULLTOV(a), vrefcnt(NULLTOV(a)), a->null_lowervp, vrefcnt(a->null_lowervp), fil, lno); #endif - return a->null_lowervp; + return (a->null_lowervp); } #endif From owner-svn-src-head@FreeBSD.ORG Sun May 31 14:57:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 466661065674; Sun, 31 May 2009 14:57:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32EF48FC14; Sun, 31 May 2009 14:57:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VEviMA046933; Sun, 31 May 2009 14:57:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VEvihD046931; Sun, 31 May 2009 14:57:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200905311457.n4VEvihD046931@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 31 May 2009 14:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193174 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 14:57:45 -0000 Author: kib Date: Sun May 31 14:57:43 2009 New Revision: 193174 URL: http://svn.freebsd.org/changeset/base/193174 Log: Eliminate code duplication in vn_fullpath1() around the cache lookups and calls to vn_vptocnp() by moving more of the common code to vn_vptocnp(). Rename vn_vptocnp() to vn_vptocnp_locked() to signify that cache is locked around the call. Do not track buffer position by both the pointer and offset, use only buflen to record the start of the free space. Export vn_vptocnp() for external consumers as a wrapper around vn_vptocnp_locked() that locks the cache and handles hold counts. Tested by: pho Modified: head/sys/kern/vfs_cache.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun May 31 14:54:20 2009 (r193173) +++ head/sys/kern/vfs_cache.c Sun May 31 14:57:43 2009 (r193174) @@ -206,7 +206,7 @@ SYSCTL_OPAQUE(_vfs_cache, OID_AUTO, nchs static void cache_zap(struct namecache *ncp); -static int vn_vptocnp(struct vnode **vp, char **bp, char *buf, u_int *buflen); +static int vn_vptocnp_locked(struct vnode **vp, char *buf, u_int *buflen); static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, u_int buflen); @@ -1036,12 +1036,55 @@ vn_fullpath_global(struct thread *td, st return (error); } +int +vn_vptocnp(struct vnode **vp, char *buf, u_int *buflen) +{ + int error; + + CACHE_RLOCK(); + error = vn_vptocnp_locked(vp, buf, buflen); + if (error == 0) { + /* + * vn_vptocnp_locked() dropped hold acquired by + * VOP_VPTOCNP immediately after locking the + * cache. Since we are going to drop the cache rlock, + * re-hold the result. + */ + vhold(*vp); + CACHE_RUNLOCK(); + } + return (error); +} + static int -vn_vptocnp(struct vnode **vp, char **bp, char *buf, u_int *buflen) +vn_vptocnp_locked(struct vnode **vp, char *buf, u_int *buflen) { struct vnode *dvp; + struct namecache *ncp; int error, vfslocked; + TAILQ_FOREACH(ncp, &((*vp)->v_cache_dst), nc_dst) { + if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) + break; + } + if (ncp != NULL) { + if (*buflen < ncp->nc_nlen) { + CACHE_RUNLOCK(); + numfullpathfail4++; + error = ENOMEM; + SDT_PROBE(vfs, namecache, fullpath, return, error, + startvp, NULL, 0, 0); + return (error); + } + *buflen -= ncp->nc_nlen; + memcpy(buf + *buflen, ncp->nc_name, ncp->nc_nlen); + SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp, + ncp->nc_name, vp, 0, 0); + *vp = ncp->nc_dvp; + return (0); + } + SDT_PROBE(vfs, namecache, fullpath, miss, vp, 0, 0, 0, 0); + vhold(*vp); CACHE_RUNLOCK(); vfslocked = VFS_LOCK_GIANT((*vp)->v_mount); @@ -1052,16 +1095,21 @@ vn_vptocnp(struct vnode **vp, char **bp, VFS_UNLOCK_GIANT(vfslocked); if (error) { numfullpathfail2++; + SDT_PROBE(vfs, namecache, fullpath, return, error, startvp, + NULL, 0, 0); return (error); } - *bp = buf + *buflen; + *vp = dvp; CACHE_RLOCK(); if ((*vp)->v_iflag & VI_DOOMED) { /* forced unmount */ CACHE_RUNLOCK(); vdrop(*vp); - return (ENOENT); + error = ENOENT; + SDT_PROBE(vfs, namecache, fullpath, return, error, startvp, + NULL, 0, 0); + return (error); } vdrop(*vp); @@ -1075,59 +1123,26 @@ static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, u_int buflen) { - char *bp; - int error, i, slash_prefixed; - struct namecache *ncp; + int error, slash_prefixed; #ifdef KDTRACE_HOOKS struct vnode *startvp = vp; #endif buflen--; - bp = buf + buflen; - *bp = '\0'; + buf[buflen] = '\0'; error = 0; slash_prefixed = 0; SDT_PROBE(vfs, namecache, fullpath, entry, vp, 0, 0, 0, 0); - CACHE_RLOCK(); numfullpathcalls++; + CACHE_RLOCK(); if (vp->v_type != VDIR) { - ncp = TAILQ_FIRST(&vp->v_cache_dst); - if (ncp != NULL) { - buflen -= ncp->nc_nlen; - for (i = ncp->nc_nlen - 1; i >= 0 && bp != buf; i--) - *--bp = ncp->nc_name[i]; - if (bp == buf) { - numfullpathfail4++; - CACHE_RUNLOCK(); - error = ENOMEM; - SDT_PROBE(vfs, namecache, fullpath, return, - error, startvp, NULL, 0, 0); - return (error); - } - SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp, - ncp->nc_name, vp, 0, 0); - vp = ncp->nc_dvp; - } else { - SDT_PROBE(vfs, namecache, fullpath, miss, vp, 0, 0, - 0, 0); - error = vn_vptocnp(&vp, &bp, buf, &buflen); - if (error) { - SDT_PROBE(vfs, namecache, fullpath, return, - error, startvp, NULL, 0, 0); - return (error); - } - } - if (buflen <= 0) { - numfullpathfail4++; - CACHE_RUNLOCK(); - error = ENOMEM; - SDT_PROBE(vfs, namecache, fullpath, return, error, - startvp, NULL, 0, 0); + error = vn_vptocnp_locked(&vp, buf, &buflen); + if (error) return (error); - } - *--bp = '/'; - buflen--; + if (buflen == 0) + return (ENOMEM); + buf[--buflen] = '/'; slash_prefixed = 1; } while (vp != rdir && vp != rootvnode) { @@ -1141,64 +1156,39 @@ vn_fullpath1(struct thread *td, struct v continue; } if (vp->v_type != VDIR) { - numfullpathfail1++; CACHE_RUNLOCK(); + numfullpathfail1++; error = ENOTDIR; break; } - TAILQ_FOREACH(ncp, &vp->v_cache_dst, nc_dst) - if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) - break; - if (ncp != NULL) { - buflen -= ncp->nc_nlen; - for (i = ncp->nc_nlen - 1; i >= 0 && bp != buf; i--) - *--bp = ncp->nc_name[i]; - if (bp == buf) { - numfullpathfail4++; - CACHE_RUNLOCK(); - error = ENOMEM; - break; - } - SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp, - ncp->nc_name, vp, 0, 0); - vp = ncp->nc_dvp; - } else { - SDT_PROBE(vfs, namecache, fullpath, miss, vp, 0, 0, - 0, 0); - error = vn_vptocnp(&vp, &bp, buf, &buflen); - if (error) - break; - } - if (buflen <= 0) { - numfullpathfail4++; - CACHE_RUNLOCK(); + error = vn_vptocnp_locked(&vp, buf, &buflen); + if (error) + break; + if (buflen == 0) { error = ENOMEM; break; } - *--bp = '/'; - buflen--; + buf[--buflen] = '/'; slash_prefixed = 1; } - if (error) { - SDT_PROBE(vfs, namecache, fullpath, return, error, startvp, - NULL, 0, 0); + if (error) return (error); - } if (!slash_prefixed) { - if (bp == buf) { - numfullpathfail4++; + if (buflen == 0) { CACHE_RUNLOCK(); + numfullpathfail4++; SDT_PROBE(vfs, namecache, fullpath, return, 0, - startvp, bp, 0, 0); + startvp, fullpath, 0, 0); return (ENOMEM); - } else - *--bp = '/'; + } + buf[--buflen] = '/'; } numfullpathfound++; CACHE_RUNLOCK(); - SDT_PROBE(vfs, namecache, fullpath, return, 0, startvp, bp, 0, 0); - *retbuf = bp; + SDT_PROBE(vfs, namecache, fullpath, return, 0, startvp, buf + *buflen, + 0, 0); + *retbuf = buf + buflen; return (0); } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun May 31 14:54:20 2009 (r193173) +++ head/sys/sys/vnode.h Sun May 31 14:57:43 2009 (r193174) @@ -598,6 +598,7 @@ int insmntque1(struct vnode *vp, struct int insmntque(struct vnode *vp, struct mount *mp); u_quad_t init_va_filerev(void); int speedup_syncer(void); +int vn_vptocnp(struct vnode **vp, char *buf, u_int *buflen); #define textvp_fullpath(p, rb, rfb) \ vn_fullpath(FIRST_THREAD_IN_PROC(p), (p)->p_textvp, rb, rfb) int vn_fullpath(struct thread *td, struct vnode *vn, From owner-svn-src-head@FreeBSD.ORG Sun May 31 14:58:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4634D1065674; Sun, 31 May 2009 14:58:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A6FD8FC17; Sun, 31 May 2009 14:58:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VEwhnL046982; Sun, 31 May 2009 14:58:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VEwhvH046981; Sun, 31 May 2009 14:58:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200905311458.n4VEwhvH046981@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 31 May 2009 14:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193175 - head/sys/fs/nullfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 14:58:44 -0000 Author: kib Date: Sun May 31 14:58:43 2009 New Revision: 193175 URL: http://svn.freebsd.org/changeset/base/193175 Log: Implement the bypass routine for VOP_VPTOCNP in nullfs. Among other things, this makes procfs /file working for executables started from nullfs mount. Tested by: pho PR: 94269, 104938 Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sun May 31 14:57:43 2009 (r193174) +++ head/sys/fs/nullfs/null_vnops.c Sun May 31 14:58:43 2009 (r193175) @@ -741,6 +741,55 @@ null_vptofh(struct vop_vptofh_args *ap) return VOP_VPTOFH(lvp, ap->a_fhp); } +static int +null_vptocnp(struct vop_vptocnp_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct vnode **dvp = ap->a_vpp; + struct vnode *lvp, *ldvp; + int error, locked; + + if (vp->v_type == VDIR) + return (vop_stdvptocnp(ap)); + + locked = VOP_ISLOCKED(vp); + lvp = NULLVPTOLOWERVP(vp); + vhold(lvp); + VOP_UNLOCK(vp, 0); /* vp is held by vn_vptocnp_locked that called us */ + ldvp = lvp; + error = vn_vptocnp(&ldvp, ap->a_buf, ap->a_buflen); + vdrop(lvp); + if (error != 0) { + vn_lock(vp, locked | LK_RETRY); + return (ENOENT); + } + + /* + * Exclusive lock is required by insmntque1 call in + * null_nodeget() + */ + error = vn_lock(ldvp, LK_EXCLUSIVE); + if (error != 0) { + vn_lock(vp, locked | LK_RETRY); + vdrop(ldvp); + return (ENOENT); + } + vref(ldvp); + vdrop(ldvp); + error = null_nodeget(vp->v_mount, ldvp, dvp); + if (error == 0) { +#ifdef DIAGNOSTIC + NULLVPTOLOWERVP(*dvp); +#endif + vhold(*dvp); + vput(*dvp); + } else + vput(ldvp); + + vn_lock(vp, locked | LK_RETRY); + return (error); +} + /* * Global vfs data structures */ @@ -762,6 +811,6 @@ struct vop_vector null_vnodeops = { .vop_setattr = null_setattr, .vop_strategy = VOP_EOPNOTSUPP, .vop_unlock = null_unlock, - .vop_vptocnp = vop_stdvptocnp, + .vop_vptocnp = null_vptocnp, .vop_vptofh = null_vptofh, }; From owner-svn-src-head@FreeBSD.ORG Sun May 31 15:01:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EDC5106566C; Sun, 31 May 2009 15:01:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F15538FC15; Sun, 31 May 2009 15:01:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VF1ood047098; Sun, 31 May 2009 15:01:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VF1on1047097; Sun, 31 May 2009 15:01:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200905311501.n4VF1on1047097@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 31 May 2009 15:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193176 - head/sys/fs/pseudofs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 15:01:51 -0000 Author: kib Date: Sun May 31 15:01:50 2009 New Revision: 193176 URL: http://svn.freebsd.org/changeset/base/193176 Log: Unlock the pseudofs vnode before calling fill method for pfs_readlink(). The fill code may need to lock another vnode, e.g. procfs file implementation. Reviewed by: des Tested by: pho MFC after: 2 weeks Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Sun May 31 14:58:43 2009 (r193175) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Sun May 31 15:01:50 2009 (r193176) @@ -827,7 +827,7 @@ pfs_readlink(struct vop_readlink_args *v struct proc *proc = NULL; char buf[PATH_MAX]; struct sbuf sb; - int error; + int error, locked; PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); @@ -849,6 +849,9 @@ pfs_readlink(struct vop_readlink_args *v _PHOLD(proc); PROC_UNLOCK(proc); } + vhold(vn); + locked = VOP_ISLOCKED(vn); + VOP_UNLOCK(vn, 0); /* sbuf_new() can't fail with a static buffer */ sbuf_new(&sb, buf, sizeof buf, 0); @@ -857,6 +860,8 @@ pfs_readlink(struct vop_readlink_args *v if (proc != NULL) PRELE(proc); + vn_lock(vn, locked | LK_RETRY); + vdrop(vn); if (error) { sbuf_delete(&sb); From owner-svn-src-head@FreeBSD.ORG Sun May 31 15:41:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40E381065686; Sun, 31 May 2009 15:41:47 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0438FC1E; Sun, 31 May 2009 15:41:47 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VFflX6047849; Sun, 31 May 2009 15:41:47 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VFflOx047848; Sun, 31 May 2009 15:41:47 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200905311541.n4VFflOx047848@svn.freebsd.org> From: Marko Zec Date: Sun, 31 May 2009 15:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193177 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 15:41:48 -0000 Author: zec Date: Sun May 31 15:41:46 2009 New Revision: 193177 URL: http://svn.freebsd.org/changeset/base/193177 Log: Unbreak buildworld. (not waiting for an approval from mentor (julian) due to emergency) Modified: head/usr.bin/kdump/mkioctls Modified: head/usr.bin/kdump/mkioctls ============================================================================== --- head/usr.bin/kdump/mkioctls Sun May 31 15:01:50 2009 (r193176) +++ head/usr.bin/kdump/mkioctls Sun May 31 15:41:46 2009 (r193177) @@ -41,6 +41,7 @@ BEGIN { print "#include " print "#include " print "#include " + print "#include " print "#include " print "#include " print "#include " From owner-svn-src-head@FreeBSD.ORG Sun May 31 17:23:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA361065675; Sun, 31 May 2009 17:23:27 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA4D78FC1B; Sun, 31 May 2009 17:23:27 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VHNRaN049900; Sun, 31 May 2009 17:23:27 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VHNRku049896; Sun, 31 May 2009 17:23:27 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200905311723.n4VHNRku049896@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 31 May 2009 17:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193178 - in head/tools/regression/bin/sh: builtins set-e X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 17:23:28 -0000 Author: stefanf Date: Sun May 31 17:23:27 2009 New Revision: 193178 URL: http://svn.freebsd.org/changeset/base/193178 Log: Add tests for r193169. Added: head/tools/regression/bin/sh/builtins/eval1.0 (contents, props changed) head/tools/regression/bin/sh/set-e/eval1.0 (contents, props changed) head/tools/regression/bin/sh/set-e/eval2.1 (contents, props changed) Modified: head/tools/regression/bin/sh/set-e/not2.0 Added: head/tools/regression/bin/sh/builtins/eval1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/eval1.0 Sun May 31 17:23:27 2009 (r193178) @@ -0,0 +1,9 @@ +# $FreeBSD$ +set -e + +eval +eval "" "" +eval "true" +! eval "false + +" Added: head/tools/regression/bin/sh/set-e/eval1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/set-e/eval1.0 Sun May 31 17:23:27 2009 (r193178) @@ -0,0 +1,3 @@ +# $FreeBSD$ +set -e +eval false || true Added: head/tools/regression/bin/sh/set-e/eval2.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/set-e/eval2.1 Sun May 31 17:23:27 2009 (r193178) @@ -0,0 +1,4 @@ +# $FreeBSD$ +set -e +eval false +exit 0 Modified: head/tools/regression/bin/sh/set-e/not2.0 ============================================================================== --- head/tools/regression/bin/sh/set-e/not2.0 Sun May 31 15:41:46 2009 (r193177) +++ head/tools/regression/bin/sh/set-e/not2.0 Sun May 31 17:23:27 2009 (r193178) @@ -1,3 +1,4 @@ # $FreeBSD$ set -e ! false +! eval false From owner-svn-src-head@FreeBSD.ORG Sun May 31 18:42:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 263D4106567A for ; Sun, 31 May 2009 18:42:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id A8F788FC12 for ; Sun, 31 May 2009 18:42:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 11273 invoked by uid 399); 31 May 2009 18:42:43 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 31 May 2009 18:42:43 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4A22CFA1.3050408@FreeBSD.org> Date: Sun, 31 May 2009 11:42:41 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.21 (X11/20090423) MIME-Version: 1.0 To: Dmitry Morozovsky References: <200905301938.n4UJcpbF017191@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.95.7 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r193112 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 18:42:46 -0000 Dmitry Morozovsky wrote: > Doug, > > On Sat, 30 May 2009, Doug Barton wrote: > > DB> Author: dougb > DB> Date: Sat May 30 19:38:51 2009 > DB> New Revision: 193112 > DB> URL: http://svn.freebsd.org/changeset/base/193112 > DB> > DB> Log: > DB> As previously advertised, remove this script prior to the 8.0 branch. > > Was there an agreement what should one do with dumping to gmirror (see > sbin/geom/class/mirror/gmirror.8) ? I'm not familiar with that issue, but it sounds like something that needs its own rc.d script. If someone who knows what is supposed to happen wants to write something up and send it to the freebsd-rc@ list I'll be glad to help review it. Meanwhile, the old early.sh script has been emitting a warning that it is deprecated every time it's run for 19 months now ... Doug -- This .signature sanitized for your protection From owner-svn-src-head@FreeBSD.ORG Sun May 31 19:35:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB571065673; Sun, 31 May 2009 19:35:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADA978FC23; Sun, 31 May 2009 19:35:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VJZfhZ053027; Sun, 31 May 2009 19:35:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VJZfhl053022; Sun, 31 May 2009 19:35:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200905311935.n4VJZfhl053022@svn.freebsd.org> From: Ed Schouten Date: Sun, 31 May 2009 19:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193184 - in head/sys/dev/syscons: . teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 19:35:42 -0000 Author: ed Date: Sun May 31 19:35:41 2009 New Revision: 193184 URL: http://svn.freebsd.org/changeset/base/193184 Log: Restore support for bell pitch/duration. Because we only support a single argument to tf_param, use 16 bits for the pitch and 16 bits for the duration. While there, make the argument unsigned. There isn't a single param call that needs a signed integer. Submitted by: danfe (modified) Modified: head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/teken/sequences head/sys/dev/syscons/teken/teken.c head/sys/dev/syscons/teken/teken.h head/sys/dev/syscons/teken/teken_subr_compat.h Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sun May 31 18:14:40 2009 (r193183) +++ head/sys/dev/syscons/scterm-teken.c Sun May 31 19:35:41 2009 (r193184) @@ -491,7 +491,7 @@ scteken_copy(void *arg, const teken_rect } static void -scteken_param(void *arg, int cmd, int value) +scteken_param(void *arg, int cmd, unsigned int value) { scr_stat *scp = arg; @@ -508,6 +508,10 @@ scteken_param(void *arg, int cmd, int va case TP_SWITCHVT: sc_switch_scr(scp->sc, value); break; + case TP_SETBELLPD: + scp->bell_pitch = TP_SETBELLPD_PITCH(value); + scp->bell_duration = TP_SETBELLPD_DURATION(value); + break; } } Modified: head/sys/dev/syscons/teken/sequences ============================================================================== --- head/sys/dev/syscons/teken/sequences Sun May 31 18:14:40 2009 (r193183) +++ head/sys/dev/syscons/teken/sequences Sun May 31 19:35:41 2009 (r193184) @@ -102,6 +102,7 @@ VPA Vertical Position Absolute ^[ [ d # Cons25 compatibility sequences C25ADBG Cons25 set adapter background ^[ [ = G r C25ADFG Cons25 set adapter foreground ^[ [ = F r +C25BLPD Cons25 set bell pitch duration ^[ [ = B r r C25CURS Cons25 set cursor type ^[ [ = S r C25VTSW Cons25 switch virtual terminal ^[ [ z r Modified: head/sys/dev/syscons/teken/teken.c ============================================================================== --- head/sys/dev/syscons/teken/teken.c Sun May 31 18:14:40 2009 (r193183) +++ head/sys/dev/syscons/teken/teken.c Sun May 31 19:35:41 2009 (r193184) @@ -167,7 +167,7 @@ teken_funcs_copy(teken_t *t, const teken } static inline void -teken_funcs_param(teken_t *t, int cmd, int value) +teken_funcs_param(teken_t *t, int cmd, unsigned int value) { t->t_funcs->tf_param(t->t_softc, cmd, value); Modified: head/sys/dev/syscons/teken/teken.h ============================================================================== --- head/sys/dev/syscons/teken/teken.h Sun May 31 18:14:40 2009 (r193183) +++ head/sys/dev/syscons/teken/teken.h Sun May 31 19:35:41 2009 (r193184) @@ -98,13 +98,16 @@ typedef void tf_putchar_t(void *, const typedef void tf_fill_t(void *, const teken_rect_t *, teken_char_t, const teken_attr_t *); typedef void tf_copy_t(void *, const teken_rect_t *, const teken_pos_t *); -typedef void tf_param_t(void *, int, int); +typedef void tf_param_t(void *, int, unsigned int); #define TP_SHOWCURSOR 0 #define TP_CURSORKEYS 1 #define TP_KEYPADAPP 2 #define TP_AUTOREPEAT 3 #define TP_SWITCHVT 4 #define TP_132COLS 5 +#define TP_SETBELLPD 6 +#define TP_SETBELLPD_PITCH(pd) ((pd) >> 16) +#define TP_SETBELLPD_DURATION(pd) ((pd) & 0xffff) typedef void tf_respond_t(void *, const void *, size_t); typedef struct { Modified: head/sys/dev/syscons/teken/teken_subr_compat.h ============================================================================== --- head/sys/dev/syscons/teken/teken_subr_compat.h Sun May 31 18:14:40 2009 (r193183) +++ head/sys/dev/syscons/teken/teken_subr_compat.h Sun May 31 19:35:41 2009 (r193184) @@ -66,6 +66,15 @@ teken_subr_cons25_switch_virtual_termina teken_funcs_param(t, TP_SWITCHVT, vt); } +static void +teken_subr_cons25_set_bell_pitch_duration(teken_t *t, unsigned int pitch, + unsigned int duration) +{ + + teken_funcs_param(t, TP_SETBELLPD, (pitch << 16) | + (duration & 0xffff)); +} + #if 0 static void teken_subr_vt52_decid(teken_t *t) From owner-svn-src-head@FreeBSD.ORG Sun May 31 19:37:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9188A106567E; Sun, 31 May 2009 19:37:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 172138FC0C; Sun, 31 May 2009 19:37:07 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VJb6ew053088; Sun, 31 May 2009 19:37:06 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VJb6Dx053086; Sun, 31 May 2009 19:37:06 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200905311937.n4VJb6Dx053086@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 31 May 2009 19:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193185 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 19:37:10 -0000 Author: jilles Date: Sun May 31 19:37:06 2009 New Revision: 193185 URL: http://svn.freebsd.org/changeset/base/193185 Log: sh: Make read's timeout (-t) apply to the entire line, not only the first character. This avoids using non-standard behaviour of the old (upto FreeBSD 7) TTY layer: it reprocesses the input queue when switching to canonical mode. The new TTY layer does not provide this functionality and so read -t worked very poorly (first character is not echoed, cannot be backspaced but is still read). This also agrees with what most other shells with read -t do. PR: bin/129566 Reviewed by: stefanf Approved by: ed (mentor) Modified: head/bin/sh/miscbltin.c head/bin/sh/sh.1 Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun May 31 19:35:41 2009 (r193184) +++ head/bin/sh/miscbltin.c Sun May 31 19:37:06 2009 (r193185) @@ -103,8 +103,6 @@ readcmd(int argc __unused, char **argv _ struct timeval tv; char *tvptr; fd_set ifds; - struct termios told, tnew; - int tsaved; rflag = 0; prompt = NULL; @@ -151,26 +149,11 @@ readcmd(int argc __unused, char **argv _ if (tv.tv_sec >= 0) { /* - * See if we can disable input processing; this will - * not give the desired result if we are in a pipeline - * and someone upstream is still in line-by-line mode. - */ - tsaved = 0; - if (tcgetattr(0, &told) == 0) { - memcpy(&tnew, &told, sizeof(told)); - cfmakeraw(&tnew); - tnew.c_iflag |= told.c_iflag & ICRNL; - tcsetattr(0, TCSANOW, &tnew); - tsaved = 1; - } - /* * Wait for something to become available. */ FD_ZERO(&ifds); FD_SET(0, &ifds); status = select(1, &ifds, NULL, NULL, &tv); - if (tsaved) - tcsetattr(0, TCSANOW, &told); /* * If there's nothing ready, return an error. */ Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun May 31 19:35:41 2009 (r193184) +++ head/bin/sh/sh.1 Sun May 31 19:37:06 2009 (r193185) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd October 7, 2006 +.Dd May 31, 2009 .Dt SH 1 .Os .Sh NAME @@ -1949,7 +1949,7 @@ If the .Fl t option is specified and the .Ar timeout -elapses before any input is supplied, +elapses before a complete line of input is supplied, the .Ic read command will return an exit status of 1 without assigning any values. From owner-svn-src-head@FreeBSD.ORG Sun May 31 20:00:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6879E106564A; Sun, 31 May 2009 20:00:52 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id F39688FC15; Sun, 31 May 2009 20:00:51 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from deuterium.andreas.nets ([91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id n4VK0mjA075565; Sun, 31 May 2009 22:00:49 +0200 (CEST) (envelope-from andreast-list@fgznet.ch) Message-ID: <4A22E1F0.8080908@fgznet.ch> Date: Sun, 31 May 2009 22:00:48 +0200 From: Andreas Tobler User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Nathan Whitehorn References: <200905310901.n4V91NVH036402@svn.freebsd.org> <4A2247C0.4010507@freebsd.org> In-Reply-To: <4A2247C0.4010507@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193156 - in head/sys: conf modules modules/cpufreq powerpc/aim powerpc/booke powerpc/conf powerpc/cpufreq powerpc/ofw powerpc/powermac powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 20:00:53 -0000 Nathan Whitehorn wrote: > Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Sun May 31 09:01:23 2009 >> New Revision: 193156 >> URL: http://svn.freebsd.org/changeset/base/193156 >> >> Log: >> Introduce support for cpufreq on PowerPC with the dynamic frequency >> switching capabilities of the MPC7447A and MPC7448. >> > Based on code by: Andreas Tobler Man, you've stolen me 5MHz! :) svn r193177: dev.cpu.0.freq: 1499 dev.cpu.0.freq_levels: 1499/-1 749/-1 Previous patch: dev.cpu.0.freq: 1504 dev.cpu.0.freq_levels: 1504/-1 752/-1 Thanks a lot! Andreas From owner-svn-src-head@FreeBSD.ORG Sun May 31 20:16:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1BF21065677; Sun, 31 May 2009 20:16:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75A7D8FC23; Sun, 31 May 2009 20:16:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VKG7HV053831; Sun, 31 May 2009 20:16:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VKG7E2053830; Sun, 31 May 2009 20:16:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200905312016.n4VKG7E2053830@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 31 May 2009 20:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193186 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 20:16:10 -0000 Author: kib Date: Sun May 31 20:16:06 2009 New Revision: 193186 URL: http://svn.freebsd.org/changeset/base/193186 Log: Unbreak the build. Add missed probes. Reviewed by: rwatson Pointy hat to: me Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun May 31 19:37:06 2009 (r193185) +++ head/sys/kern/vfs_cache.c Sun May 31 20:16:06 2009 (r193186) @@ -1073,7 +1073,7 @@ vn_vptocnp_locked(struct vnode **vp, cha numfullpathfail4++; error = ENOMEM; SDT_PROBE(vfs, namecache, fullpath, return, error, - startvp, NULL, 0, 0); + vp, NULL, 0, 0); return (error); } *buflen -= ncp->nc_nlen; @@ -1095,7 +1095,7 @@ vn_vptocnp_locked(struct vnode **vp, cha VFS_UNLOCK_GIANT(vfslocked); if (error) { numfullpathfail2++; - SDT_PROBE(vfs, namecache, fullpath, return, error, startvp, + SDT_PROBE(vfs, namecache, fullpath, return, error, vp, NULL, 0, 0); return (error); } @@ -1107,7 +1107,7 @@ vn_vptocnp_locked(struct vnode **vp, cha CACHE_RUNLOCK(); vdrop(*vp); error = ENOENT; - SDT_PROBE(vfs, namecache, fullpath, return, error, startvp, + SDT_PROBE(vfs, namecache, fullpath, return, error, vp, NULL, 0, 0); return (error); } @@ -1150,6 +1150,8 @@ vn_fullpath1(struct thread *td, struct v if (vp->v_iflag & VI_DOOMED) { /* forced unmount */ CACHE_RUNLOCK(); error = ENOENT; + SDT_PROBE(vfs, namecache, fullpath, return, + error, vp, NULL, 0, 0); break; } vp = vp->v_mount->mnt_vnodecovered; @@ -1159,6 +1161,8 @@ vn_fullpath1(struct thread *td, struct v CACHE_RUNLOCK(); numfullpathfail1++; error = ENOTDIR; + SDT_PROBE(vfs, namecache, fullpath, return, + error, vp, NULL, 0, 0); break; } error = vn_vptocnp_locked(&vp, buf, &buflen); @@ -1166,6 +1170,8 @@ vn_fullpath1(struct thread *td, struct v break; if (buflen == 0) { error = ENOMEM; + SDT_PROBE(vfs, namecache, fullpath, return, error, + startvp, NULL, 0, 0); break; } buf[--buflen] = '/'; @@ -1177,8 +1183,8 @@ vn_fullpath1(struct thread *td, struct v if (buflen == 0) { CACHE_RUNLOCK(); numfullpathfail4++; - SDT_PROBE(vfs, namecache, fullpath, return, 0, - startvp, fullpath, 0, 0); + SDT_PROBE(vfs, namecache, fullpath, return, ENOMEM, + startvp, NULL, 0, 0); return (ENOMEM); } buf[--buflen] = '/'; @@ -1186,7 +1192,7 @@ vn_fullpath1(struct thread *td, struct v numfullpathfound++; CACHE_RUNLOCK(); - SDT_PROBE(vfs, namecache, fullpath, return, 0, startvp, buf + *buflen, + SDT_PROBE(vfs, namecache, fullpath, return, 0, startvp, buf + buflen, 0, 0); *retbuf = buf + buflen; return (0); From owner-svn-src-head@FreeBSD.ORG Sun May 31 20:18:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 442F710656FF; Sun, 31 May 2009 20:18:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 266A38FC14; Sun, 31 May 2009 20:18:03 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VKI3bn053904; Sun, 31 May 2009 20:18:03 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VKI21g053901; Sun, 31 May 2009 20:18:02 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200905312018.n4VKI21g053901@svn.freebsd.org> From: Alan Cox Date: Sun, 31 May 2009 20:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193187 - in head/sys: fs/nfsclient kern nfsclient sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 20:18:08 -0000 Author: alc Date: Sun May 31 20:18:02 2009 New Revision: 193187 URL: http://svn.freebsd.org/changeset/base/193187 Log: nfs_write() can use the recently introduced vfs_bio_set_valid() instead of vfs_bio_set_validclean(), thereby avoiding the page queues lock. Garbage collect vfs_bio_set_validclean(). Nothing uses it any longer. Modified: head/sys/fs/nfsclient/nfs_clbio.c head/sys/kern/vfs_bio.c head/sys/nfsclient/nfs_bio.c head/sys/sys/buf.h Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Sun May 31 20:16:06 2009 (r193186) +++ head/sys/fs/nfsclient/nfs_clbio.c Sun May 31 20:18:02 2009 (r193187) @@ -1302,7 +1302,7 @@ again: bp->b_dirtyoff = on; bp->b_dirtyend = on + n; } - vfs_bio_set_validclean(bp, on, n); + vfs_bio_set_valid(bp, on, n); } /* Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun May 31 20:16:06 2009 (r193186) +++ head/sys/kern/vfs_bio.c Sun May 31 20:18:02 2009 (r193187) @@ -3673,47 +3673,6 @@ vfs_bio_set_valid(struct buf *bp, int ba } /* - * vfs_bio_set_validclean: - * - * Set the range within the buffer to valid and clean. The range is - * relative to the beginning of the buffer, b_offset. Note that b_offset - * itself may be offset from the beginning of the first page. - * - */ - -void -vfs_bio_set_validclean(struct buf *bp, int base, int size) -{ - int i, n; - vm_page_t m; - - if (!(bp->b_flags & B_VMIO)) - return; - /* - * Fixup base to be relative to beginning of first page. - * Set initial n to be the maximum number of bytes in the - * first page that can be validated. - */ - - base += (bp->b_offset & PAGE_MASK); - n = PAGE_SIZE - (base & PAGE_MASK); - - VM_OBJECT_LOCK(bp->b_bufobj->bo_object); - vm_page_lock_queues(); - for (i = base / PAGE_SIZE; size > 0 && i < bp->b_npages; ++i) { - m = bp->b_pages[i]; - if (n > size) - n = size; - vm_page_set_validclean(m, base & PAGE_MASK, n); - base += n; - size -= n; - n = PAGE_SIZE; - } - vm_page_unlock_queues(); - VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); -} - -/* * vfs_bio_clrbuf: * * If the specified buffer is a non-VMIO buffer, clear the entire Modified: head/sys/nfsclient/nfs_bio.c ============================================================================== --- head/sys/nfsclient/nfs_bio.c Sun May 31 20:16:06 2009 (r193186) +++ head/sys/nfsclient/nfs_bio.c Sun May 31 20:18:02 2009 (r193187) @@ -1200,7 +1200,7 @@ again: bp->b_dirtyoff = on; bp->b_dirtyend = on + n; } - vfs_bio_set_validclean(bp, on, n); + vfs_bio_set_valid(bp, on, n); } /* Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Sun May 31 20:16:06 2009 (r193186) +++ head/sys/sys/buf.h Sun May 31 20:18:02 2009 (r193187) @@ -499,7 +499,6 @@ int cluster_read(struct vnode *, u_quad_ int cluster_wbuild(struct vnode *, long, daddr_t, int); void cluster_write(struct vnode *, struct buf *, u_quad_t, int); void vfs_bio_set_valid(struct buf *, int base, int size); -void vfs_bio_set_validclean(struct buf *, int base, int size); void vfs_bio_clrbuf(struct buf *); void vfs_busy_pages(struct buf *, int clear_modify); void vfs_unbusy_pages(struct buf *); From owner-svn-src-head@FreeBSD.ORG Sun May 31 20:59:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7E71106566C; Sun, 31 May 2009 20:59:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5B318FC0A; Sun, 31 May 2009 20:59:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VKxKa3054842; Sun, 31 May 2009 20:59:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VKxKmj054840; Sun, 31 May 2009 20:59:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200905312059.n4VKxKmj054840@svn.freebsd.org> From: Ed Schouten Date: Sun, 31 May 2009 20:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193188 - head/usr.sbin/ipfwpcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 20:59:21 -0000 Author: ed Date: Sun May 31 20:59:20 2009 New Revision: 193188 URL: http://svn.freebsd.org/changeset/base/193188 Log: Several cleanups to ipfwpcap(8). - Enable WARNS?=6. - Include missing headers. - Mark prog and pidfile as static. Remove unneeded initializer. - Use ANSI prototypes. - Remove unneeded fp variable. - snprintf() guarantees the buffer to be null terminated. Remove unneeded - 1 and bzero call. - Remove unneeded casting. Submitted by: Pawel Worach, Christoph Mallon Modified: head/usr.sbin/ipfwpcap/Makefile head/usr.sbin/ipfwpcap/ipfwpcap.c Modified: head/usr.sbin/ipfwpcap/Makefile ============================================================================== --- head/usr.sbin/ipfwpcap/Makefile Sun May 31 20:18:02 2009 (r193187) +++ head/usr.sbin/ipfwpcap/Makefile Sun May 31 20:59:20 2009 (r193188) @@ -11,6 +11,8 @@ DPADD= ${LIBPCAP} MAN= ipfwpcap.8 +WARNS?= 6 + .include test: $(CMD) Modified: head/usr.sbin/ipfwpcap/ipfwpcap.c ============================================================================== --- head/usr.sbin/ipfwpcap/ipfwpcap.c Sun May 31 20:18:02 2009 (r193187) +++ head/usr.sbin/ipfwpcap/ipfwpcap.c Sun May 31 20:59:20 2009 (r193188) @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include #include #include @@ -61,15 +63,14 @@ static int reflect = 0; /* 1 == write p static ssize_t totbytes = 0, maxbytes = 0; static ssize_t totpkts = 0, maxpkts = 0; -char *prog = NULL; -char pidfile[MAXPATHLEN] = { '\0' }; +static char *prog = NULL; +static char pidfile[MAXPATHLEN]; /* * tidy up. */ -void -quit(sig) -int sig; +static void +quit(int sig) { (void) unlink(pidfile); exit(sig); @@ -79,80 +80,76 @@ int sig; * do the "paper work" * - save my own pid in /var/run/$0.{port#}.pid */ -okay(pn) -int pn; +static void +okay(int pn) { - FILE *fp; - int fd, numlen, n; + int fd; char *p, numbuf[80]; - numlen = sizeof(numbuf); - bzero(numbuf, numlen); - snprintf(numbuf, numlen-1, "%ld\n", getpid()); - numlen = strlen(numbuf); - if (pidfile[0] == '\0') { - p = (char *)rindex(prog, '/'); - p = (p == NULL) ? prog : p+1 ; + p = rindex(prog, '/'); + p = (p == NULL) ? prog : p + 1; - snprintf(pidfile, sizeof(pidfile)-1, + snprintf(pidfile, sizeof pidfile, "%s%s.%d.pid", _PATH_VARRUN, p, pn); } fd = open(pidfile, O_WRONLY|O_CREAT|O_EXCL, 0644); - if (fd < 0) { perror(pidfile); exit(21); } - - siginterrupt(SIGTERM, 1); - siginterrupt(SIGHUP, 1); - signal (SIGTERM, quit); - signal (SIGHUP, quit); - signal (SIGINT, quit); + if (fd < 0) { + perror(pidfile); + exit(21); + } - n = write(fd, numbuf, numlen); - if (n < 0) { perror(pidfile); quit(23); } + siginterrupt(SIGTERM, 1); + siginterrupt(SIGHUP, 1); + signal(SIGTERM, quit); + signal(SIGHUP, quit); + signal(SIGINT, quit); + + snprintf(numbuf, sizeof numbuf, "%d\n", getpid()); + if (write(fd, numbuf, strlen(numbuf)) < 0) { + perror(pidfile); + quit(23); + } (void) close(fd); } -usage() +static void +usage(void) { - fprintf(stderr, "\ -\n\ -usage:\n\ - %s [-dr] [-b maxbytes] [-p maxpkts] [-P pidfile] portnum dumpfile\n\ -\n\ -where:\n\ - '-d' = enable debugging messages.\n\ - '-r' = reflect. write packets back to the divert socket.\n\ - (ie. simulate the original intent of \"ipfw tee\").\n\ - '-rr' = indicate that it is okay to quit if packet-count or\n\ - byte-count limits are reached (see the NOTE below\n\ - about what this implies).\n\ - '-b bytcnt' = stop dumping after {bytcnt} bytes.\n\ - '-p pktcnt' = stop dumping after {pktcnt} packets.\n\ - '-P pidfile' = alternate file to store the PID\n\ - (default: /var/run/%s.{portnum}.pid).\n\ -\n\ - portnum = divert(4) socket port number.\n\ - dumpfile = file to write captured packets (tcpdump format).\n\ - (specify '-' to write packets to stdout).\n\ -\n\ -", prog, prog); - - fprintf(stderr, "\ -The '-r' option should not be necessary, but because \"ipfw tee\" is broken\n\ -(see BUGS in ipfw(8) for details) this feature can be used along with\n\ -an \"ipfw divert\" rule to simulate the original intent of \"ipfw tee\".\n\ -\n\ -NOTE: With an \"ipfw divert\" rule, diverted packets will silently\n\ - disappear if there is nothing listening to the divert socket.\n\ -\n\ -"); - exit(-1); + fprintf(stderr, +"\n" +"usage:\n" +" %s [-dr] [-b maxbytes] [-p maxpkts] [-P pidfile] portnum dumpfile\n" +"\n" +"where:\n" +" '-d' = enable debugging messages.\n" +" '-r' = reflect. write packets back to the divert socket.\n" +" (ie. simulate the original intent of \"ipfw tee\").\n" +" '-rr' = indicate that it is okay to quit if packet-count or\n" +" byte-count limits are reached (see the NOTE below\n" +" about what this implies).\n" +" '-b bytcnt' = stop dumping after {bytcnt} bytes.\n" +" '-p pktcnt' = stop dumping after {pktcnt} packets.\n" +" '-P pidfile' = alternate file to store the PID\n" +" (default: /var/run/%s.{portnum}.pid).\n" +"\n" +" portnum = divert(4) socket port number.\n" +" dumpfile = file to write captured packets (tcpdump format).\n" +" (specify '-' to write packets to stdout).\n" +"\n" +"The '-r' option should not be necessary, but because \"ipfw tee\" is broken\n" +"(see BUGS in ipfw(8) for details) this feature can be used along with\n" +"an \"ipfw divert\" rule to simulate the original intent of \"ipfw tee\".\n" +"\n" +"NOTE: With an \"ipfw divert\" rule, diverted packets will silently\n" +" disappear if there is nothing listening to the divert socket.\n" +"\n", prog, prog); + exit(1); } -main(ac, av) -int ac; -char *av[]; +int +main(int ac, char *av[]) { int r, sd, portnum, l; struct sockaddr_in sin; @@ -254,7 +251,7 @@ if (debug) fprintf(stderr, "bind to %d.\ */ l = sizeof(sin); nr = recvfrom(sd, buf, sizeof(buf), 0, (struct sockaddr *)&sin, &l); -if (debug) fprintf(stderr, "recvfrom(%d) = %d (%d)\n", sd, nr, l); +if (debug) fprintf(stderr, "recvfrom(%d) = %zd (%d)\n", sd, nr, l); if (nr < 0 && errno != EINTR) { perror("recvfrom(sd)"); quit(12); From owner-svn-src-head@FreeBSD.ORG Sun May 31 21:29:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BEF91065677; Sun, 31 May 2009 21:29:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AAB68FC1D; Sun, 31 May 2009 21:29:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VLT8jR055499; Sun, 31 May 2009 21:29:08 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VLT8vg055497; Sun, 31 May 2009 21:29:08 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200905312129.n4VLT8vg055497@svn.freebsd.org> From: Ed Schouten Date: Sun, 31 May 2009 21:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193189 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 21:29:08 -0000 Author: ed Date: Sun May 31 21:29:07 2009 New Revision: 193189 URL: http://svn.freebsd.org/changeset/base/193189 Log: Fix minor issues in libstand. - Don't call tftp_makereq() with too many arguments. - Don't forget to close one of the comments. Submitted by: Pawel Worach Modified: head/lib/libstand/bootp.c head/lib/libstand/tftp.c Modified: head/lib/libstand/bootp.c ============================================================================== --- head/lib/libstand/bootp.c Sun May 31 20:59:20 2009 (r193188) +++ head/lib/libstand/bootp.c Sun May 31 21:29:07 2009 (r193189) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #define DHCP_ENV_NOVENDOR 1 /* do not parse vendor options */ #define DHCP_ENV_PXE 10 /* assume pxe vendor options */ -#define DHCP_ENV_FREEBSD 11 /* assume freebsd vendor options +#define DHCP_ENV_FREEBSD 11 /* assume freebsd vendor options */ /* set DHCP_ENV to one of the values above to export dhcp options to kenv */ #define DHCP_ENV DHCP_ENV_NO_VENDOR Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Sun May 31 20:59:20 2009 (r193188) +++ head/lib/libstand/tftp.c Sun May 31 21:29:07 2009 (r193189) @@ -275,7 +275,7 @@ tftp_open(path, f) return(ENOMEM); } - res = tftp_makereq(tftpfile, path); + res = tftp_makereq(tftpfile); if (res) { free(tftpfile->path); From owner-svn-src-head@FreeBSD.ORG Sun May 31 22:33:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 720BA10656A9; Sun, 31 May 2009 22:33:53 +0000 (UTC) (envelope-from avl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9456D8FC16; Sun, 31 May 2009 22:33:53 +0000 (UTC) (envelope-from avl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VMXrmr056709; Sun, 31 May 2009 22:33:53 GMT (envelope-from avl@svn.freebsd.org) Received: (from avl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VMXrTS056708; Sun, 31 May 2009 22:33:53 GMT (envelope-from avl@svn.freebsd.org) Message-Id: <200905312233.n4VMXrTS056708@svn.freebsd.org> From: Alexander Logvinov Date: Sun, 31 May 2009 22:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193190 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 22:33:55 -0000 Author: avl (ports committer) Date: Sun May 31 22:33:53 2009 New Revision: 193190 URL: http://svn.freebsd.org/changeset/base/193190 Log: Add myself to the list of ports committers Approved by: tabthorpe (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun May 31 21:29:07 2009 (r193189) +++ head/share/misc/committers-ports.dot Sun May 31 22:33:53 2009 (r193190) @@ -51,6 +51,7 @@ amdmi3 [label="Dmitry Marakasov\namdmi3@ anray [label="Andrey Slusar\nanray@FreeBSD.org\n2005/12/11"] araujo [label="Marcelo Araujo\naraujo@FreeBSD.org\n2007/04/26"] arved [label="Tilman Linneweh\narved@FreeBSD.org\n2002/10/15"] +avl [label="Alexander Logvinov\navl@FreeBSD.org\n2009/05/27"] az [label="Andrej Zverev\naz@FreeBSD.org\n2005/10/03"] beat [label="Beat Gaetzi\nbeat@FreeBSD.org\n2009/01/28"] beech [label="Beech Rintoul\nbeech@FreeBSD.org\n2007/05/30"] @@ -229,6 +230,8 @@ garga -> vd garga -> wxs garga -> xride +glarkin -> avl + glewis -> hq glewis -> jkim @@ -322,6 +325,7 @@ stas -> araujo steve -> netchild +tabthorpe -> avl tabthorpe -> jadawin tabthorpe -> pgj From owner-svn-src-head@FreeBSD.ORG Sun May 31 23:12:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BD8810656C7 for ; Sun, 31 May 2009 23:12:51 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outN.internet-mail-service.net (outn.internet-mail-service.net [216.240.47.237]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF728FC1F for ; Sun, 31 May 2009 23:12:51 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 10AFDB755C; Sun, 31 May 2009 16:13:22 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id A33FB2D6004; Sun, 31 May 2009 16:12:50 -0700 (PDT) Message-ID: <4A230EF2.4020802@elischer.org> Date: Sun, 31 May 2009 16:12:50 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Marko Zec References: <200905311210.n4VCA4rA042721@svn.freebsd.org> In-Reply-To: <200905311210.n4VCA4rA042721@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193166 - in head/sys: kern net sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 23:12:53 -0000 Marko Zec wrote: > Author: zec > Date: Sun May 31 12:10:04 2009 > New Revision: 193166 > URL: http://svn.freebsd.org/changeset/base/193166 > > Log: > Introduce an interm userland-kernel API for creating vnets and > assigning ifnets from one vnet to another. Deletion of vnets is not > yet supported. > > The interface is implemented as an ioctl extension so that no syscalls > had to be introduced. This should be acceptable given that the new > interface will be used for a short / interim period only, until the > new jail management framwork gains the capability of managing vnets. > This method for managing vimages / vnets has been in use for the past > 7 years without any observable issues. > > The userland tool to be used in conjunction with the interim API can be > found in p4: //depot/projects/vimage-commit2/src/usr.sbin/vimage/... and > will most probably never get commited to svn. please check the tool into tools where it can be gotten too easily. in: http://svn.freebsd.org/viewvc/base/head/tools/tools/ we can remove them when we transition to the jamie's front-end. From owner-svn-src-head@FreeBSD.ORG Sun May 31 23:32:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A375106564A; Sun, 31 May 2009 23:32:38 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f212.google.com (mail-ew0-f212.google.com [209.85.219.212]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE668FC1E; Sun, 31 May 2009 23:32:37 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ewy8 with SMTP id 8so4016865ewy.43 for ; Sun, 31 May 2009 16:32:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-pgp-agent:x-mailer; bh=Ww8KbWpmPFo+R7HBmlkZUg1OsfW9CH5j6u3gNTaQQkY=; b=Kpj3eZmUSNhJwTgyzAmCvGczH7cIWEyVED1OeqACBJ253n0wbT+S/B5kmSrauZHcsc FZXUylmbB681iBokNwb1pESJys2KZfLnYtw84l/1h5SI3uG1GHfJRZWJ/TlmDnsf0U69 5fg3VUZWD/sJNE04MgTXZznHJ5Img1sDD3kNM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-pgp-agent:x-mailer; b=DpL/b3TK6dph1OEgThWArUqz7zjF9OqgpGI1jWu1W7mK1IWmMR6joGfaBEgqWUghwQ CKMtWkOFwumkPFV7dAn5gthUI5tUxB3Zf8xdtRHFrU4BIvvjFHGisHYWtV+nAqgMSIcG fIa6rg6jEK1ijEVYcxNI/rCSjwYbeRzW4JKvU= Received: by 10.210.67.4 with SMTP id p4mr3274166eba.36.1243812756532; Sun, 31 May 2009 16:32:36 -0700 (PDT) Received: from epsilon.lan (bl7-116-14.dsl.telepac.pt [85.240.116.14]) by mx.google.com with ESMTPS id 10sm209915eyd.42.2009.05.31.16.32.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 31 May 2009 16:32:35 -0700 (PDT) Sender: Rui Paulo Message-Id: From: Rui Paulo To: Andrew Thompson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Hans Petter Selasky In-Reply-To: Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-8--782418027" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Mon, 1 Jun 2009 00:32:34 +0100 References: <200905271927.n4RJRUH8009289@svn.freebsd.org> X-Pgp-Agent: GPGMail 1.2.0 (v56) X-Mailer: Apple Mail (2.935.3) Cc: Subject: Re: svn commit: r192925 - in head/sys/dev/usb: . input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 23:32:39 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-8--782418027 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Including Hans on the list. On 30 May 2009, at 22:18, Rui Paulo wrote: > > On 27 May 2009, at 20:27, Andrew Thompson wrote: > >> Author: thompsa >> Date: Wed May 27 19:27:29 2009 >> New Revision: 192925 >> URL: http://svn.freebsd.org/changeset/base/192925 >> >> Log: >> Add support for the Apple MacBook Pro keyboard >> - add key mappings for fn keys >> - byte swapping for certain models >> - Fix leds for keyboards which require an ID byte for the HID >> output structures >> >> Submitted by: Hans Petter Selasky > > Oh, very nice! I've failed to do this with the old usb stack. > This should work on a macbook too, right? > > The eject key was easily handled on user space (at least with the > old usb stack). Why is it being handled in kernel now? Here's how it worked: http://wiki.freebsd.org/AppleMacbook#head-7eab3730c3bf3d04bdfb0d1d3649eaddf2fed595 If there's any problem with the userland approach, I would like to know. If there isn't, please consider removing the kenrel support for the eject key. I'm assuming this can be done on the new USB stack too (likely). Thanks. -- Rui Paulo --Apple-Mail-8--782418027 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkojE5IACgkQfD8M/ASTygImhgCgzs6MUHurk8gfZK2jNI2mLlb4 uhIAnA3djpnb/sPdPdEZuewF0+psOsSe =ImUh -----END PGP SIGNATURE----- --Apple-Mail-8--782418027-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 00:40:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDB5E106564A; Mon, 1 Jun 2009 00:40:39 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC1548FC08; Mon, 1 Jun 2009 00:40:39 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n510ed3g059059; Mon, 1 Jun 2009 00:40:39 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n510edH2059058; Mon, 1 Jun 2009 00:40:39 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200906010040.n510edH2059058@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 1 Jun 2009 00:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193191 - head/sbin/mount_nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 00:40:40 -0000 Author: rodrigc Date: Mon Jun 1 00:40:39 2009 New Revision: 193191 URL: http://svn.freebsd.org/changeset/base/193191 Log: Code for parsing nmount options in kernel was merged to stable/7 branch in r190315. So only resort to fallback_mount() could which passes struct nfs_args to kernel in kernel versions less than 702100. Modified: head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Sun May 31 22:33:53 2009 (r193190) +++ head/sbin/mount_nfs/mount_nfs.c Mon Jun 1 00:40:39 2009 (r193191) @@ -430,7 +430,7 @@ main(int argc, char *argv[]) * struct nfs_args to be passed in via nmount(). */ osversion = getosreldate(); - if (osversion >= 800048) { + if (osversion >= 702100) { if (nmount(iov, iovlen, mntflags)) err(1, "%s, %s", mntpath, errmsg); } else { From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 01:02:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0088F106564A; Mon, 1 Jun 2009 01:02:31 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1B3E8FC08; Mon, 1 Jun 2009 01:02:30 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5112U7Y059563; Mon, 1 Jun 2009 01:02:30 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5112UmB059561; Mon, 1 Jun 2009 01:02:30 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200906010102.n5112UmB059561@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 1 Jun 2009 01:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193192 - in head/sys: boot/common kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 01:02:31 -0000 Author: rodrigc Date: Mon Jun 1 01:02:30 2009 New Revision: 193192 URL: http://svn.freebsd.org/changeset/base/193192 Log: sys/boot/common.c ================= Extend the loader to parse the root file system mount options in /etc/fstab, and set a new loader variable vfs.root.mountfrom.options with these options. The root mount options must be a comma-delimited string, as specified in /etc/fstab. Only set the vfs.root.mountfrom.options variable if it has not been set in the environment. sys/kern/vfs_mount.c ==================== When mounting the root file system, pass the mount options specified in vfs.root.mountfrom.options, but filter out "rw" and "noro", since the initial mount of the root file system must be done as "ro". While we are here, try to add a few hints to the mountroot prompt to give users and idea what might of gone wrong during mounting of the root file system. Reviewed by: jhb (an earlier patch) Modified: head/sys/boot/common/boot.c head/sys/kern/vfs_mount.c Modified: head/sys/boot/common/boot.c ============================================================================== --- head/sys/boot/common/boot.c Mon Jun 1 00:40:39 2009 (r193191) +++ head/sys/boot/common/boot.c Mon Jun 1 01:02:30 2009 (r193192) @@ -287,7 +287,7 @@ getbootfile(int try) int getrootmount(char *rootdev) { - char lbuf[128], *cp, *ep, *dev, *fstyp; + char lbuf[128], *cp, *ep, *dev, *fstyp, *options; int fd, error; if (getenv("vfs.root.mountfrom") != NULL) @@ -331,11 +331,30 @@ getrootmount(char *rootdev) *cp = 0; fstyp = strdup(ep); - /* build the final result and save it */ + /* skip whitespace up to mount options */ + cp += 1; + while ((*cp != 0) && isspace(*cp)) + cp++; + if (*cp == 0) /* misformatted */ + continue; + /* skip text to end of mount options and delimit */ + ep = cp; + while ((*cp != 0) && !isspace(*cp)) + cp++; + *cp = 0; + options = strdup(ep); + /* Build the : and save it in vfs.root.mountfrom */ sprintf(lbuf, "%s:%s", fstyp, dev); free(dev); free(fstyp); setenv("vfs.root.mountfrom", lbuf, 0); + + /* Don't override vfs.root.mountfrom.options if it is already set */ + if (getenv("vfs.root.mountfrom.options") == NULL) { + /* save mount options */ + setenv("vfs.root.mountfrom.options", options, 0); + } + free(options); error = 0; break; } Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Jun 1 00:40:39 2009 (r193191) +++ head/sys/kern/vfs_mount.c Mon Jun 1 01:02:30 2009 (r193192) @@ -77,7 +77,7 @@ static void set_rootvnode(void); static int vfs_domount(struct thread *td, const char *fstype, char *fspath, int fsflags, void *fsdata); static int vfs_mountroot_ask(void); -static int vfs_mountroot_try(const char *mountfrom); +static int vfs_mountroot_try(const char *mountfrom, const char *options); static void free_mntarg(struct mntarg *ma); static int usermount = 0; @@ -110,6 +110,10 @@ struct vnode *rootvnode; * of being mounted as root * path := disk device name or other data used by the filesystem * to locate its physical store + * + * The environment variable vfs.root.mountfrom options is a comma delimited + * set of string mount options. These mount options must be parseable + * by nmount() in the kernel. */ /* @@ -1637,9 +1641,11 @@ vfs_opterror(struct vfsoptlist *opts, co void vfs_mountroot(void) { - char *cp; + char *cp, *options; int error, i, asked = 0; + options = NULL; + root_mount_prepare(); mount_zone = uma_zcreate("Mountpoints", sizeof(struct mount), @@ -1656,12 +1662,14 @@ vfs_mountroot(void) asked = 1; } + options = getenv("vfs.root.mountfrom.options"); + /* * The root filesystem information is compiled in, and we are * booted with instructions to use it. */ if (ctrootdevname != NULL && (boothowto & RB_DFLTROOT)) { - if (!vfs_mountroot_try(ctrootdevname)) + if (!vfs_mountroot_try(ctrootdevname, options)) goto mounted; ctrootdevname = NULL; } @@ -1673,7 +1681,7 @@ vfs_mountroot(void) */ if (boothowto & RB_CDROM) { for (i = 0; cdrom_rootdevnames[i] != NULL; i++) { - if (!vfs_mountroot_try(cdrom_rootdevnames[i])) + if (!vfs_mountroot_try(cdrom_rootdevnames[i], options)) goto mounted; } } @@ -1685,7 +1693,7 @@ vfs_mountroot(void) */ cp = getenv("vfs.root.mountfrom"); if (cp != NULL) { - error = vfs_mountroot_try(cp); + error = vfs_mountroot_try(cp, options); freeenv(cp); if (!error) goto mounted; @@ -1694,16 +1702,16 @@ vfs_mountroot(void) /* * Try values that may have been computed by code during boot */ - if (!vfs_mountroot_try(rootdevnames[0])) + if (!vfs_mountroot_try(rootdevnames[0], options)) goto mounted; - if (!vfs_mountroot_try(rootdevnames[1])) + if (!vfs_mountroot_try(rootdevnames[1], options)) goto mounted; /* * If we (still) have a compiled-in default, try it. */ if (ctrootdevname != NULL) - if (!vfs_mountroot_try(ctrootdevname)) + if (!vfs_mountroot_try(ctrootdevname, options)) goto mounted; /* * Everything so far has failed, prompt on the console if we haven't @@ -1717,24 +1725,75 @@ vfs_mountroot(void) mounted: root_mount_done(); + freeenv(options); +} + +static struct mntarg * +parse_mountroot_options(struct mntarg *ma, const char *options) +{ + char *p; + char *name, *name_arg; + char *val, *val_arg; + char *opts; + + if (options == NULL || options[0] == '\0') + return (ma); + + p = opts = strdup(options, M_MOUNT); + if (opts == NULL) { + return (ma); + } + + while((name = strsep(&p, ",")) != NULL) { + if (name[0] == '\0') + break; + + val = strchr(name, '='); + if (val != NULL) { + *val = '\0'; + ++val; + } + if( strcmp(name, "rw") == 0 || + strcmp(name, "noro") == 0) { + /* + * The first time we mount the root file system, + * we need to mount 'ro', so We need to ignore + * 'rw' and 'noro' mount options. + */ + continue; + } + name_arg = strdup(name, M_MOUNT); + val_arg = NULL; + if (val != NULL) + val_arg = strdup(val, M_MOUNT); + + ma = mount_arg(ma, name_arg, val_arg, + (val_arg != NULL ? -1 : 0)); + } + free(opts, M_MOUNT); + return (ma); } /* * Mount (mountfrom) as the root filesystem. */ static int -vfs_mountroot_try(const char *mountfrom) +vfs_mountroot_try(const char *mountfrom, const char *options) { struct mount *mp; + struct mntarg *ma; char *vfsname, *path; time_t timebase; int error; char patt[32]; + char errmsg[255]; vfsname = NULL; path = NULL; mp = NULL; + ma = NULL; error = EINVAL; + bzero(errmsg, sizeof(errmsg)); if (mountfrom == NULL) return (error); /* don't complain */ @@ -1751,12 +1810,14 @@ vfs_mountroot_try(const char *mountfrom) if (path[0] == '\0') strcpy(path, ROOTNAME); - error = kernel_vmount( - MNT_RDONLY | MNT_ROOTFS, - "fstype", vfsname, - "fspath", "/", - "from", path, - NULL); + ma = mount_arg(ma, "fstype", vfsname, -1); + ma = mount_arg(ma, "fspath", "/", -1); + ma = mount_arg(ma, "from", path, -1); + ma = mount_arg(ma, "errmsg", errmsg, sizeof(errmsg)); + ma = mount_arg(ma, "ro", NULL, 0); + ma = parse_mountroot_options(ma, options); + error = kernel_mount(ma, MNT_ROOTFS); + if (error == 0) { /* * We mount devfs prior to mounting the / FS, so the first @@ -1783,6 +1844,16 @@ vfs_mountroot_try(const char *mountfrom) devfs_fixup(curthread); } + + if (error != 0 ) { + printf("ROOT MOUNT ERROR: %s\n", errmsg); + printf("If you have invalid mount options, reboot, and "); + printf("first try the following from\n"); + printf("the loader prompt:\n\n"); + printf(" set vfs.root.mountfrom.options=rw\n\n"); + printf("and then remove invalid mount options from "); + printf("/etc/fstab.\n\n"); + } out: free(path, M_MOUNT); free(vfsname, M_MOUNT); @@ -1798,15 +1869,32 @@ static int vfs_mountroot_ask(void) { char name[128]; + char *mountfrom; + char *options; for(;;) { + printf("Loader variables:\n"); + printf("vfs.root.mountfrom="); + mountfrom = getenv("vfs.root.mountfrom"); + if (mountfrom != NULL) { + printf("%s", mountfrom); + } + printf("\n"); + printf("vfs.root.mountfrom.options="); + options = getenv("vfs.root.mountfrom.options"); + if (options != NULL) { + printf("%s", options); + } + printf("\n"); + freeenv(mountfrom); + freeenv(options); printf("\nManual root filesystem specification:\n"); printf(" : Mount using filesystem \n"); -#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) - printf(" eg. ufs:da0s1a\n"); -#else - printf(" eg. ufs:/dev/da0a\n"); -#endif + printf(" eg. ufs:/dev/da0s1a\n"); + printf(" eg. cd9660:/dev/acd0\n"); + printf(" This is equivalent to: "); + printf("mount -t cd9660 /dev/acd0 /\n"); + printf("\n"); printf(" ? List valid disk boot devices\n"); printf(" Abort manual input\n"); printf("\nmountroot> "); @@ -1818,7 +1906,7 @@ vfs_mountroot_ask(void) g_dev_print(); continue; } - if (!vfs_mountroot_try(name)) + if (!vfs_mountroot_try(name, NULL)) return (0); } } From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 01:51:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A52361065670; Mon, 1 Jun 2009 01:51:37 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9322E8FC28; Mon, 1 Jun 2009 01:51:37 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n511pbW7060571; Mon, 1 Jun 2009 01:51:37 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n511pbMb060570; Mon, 1 Jun 2009 01:51:37 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200906010151.n511pbMb060570@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 1 Jun 2009 01:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193194 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 01:51:38 -0000 Author: weongyo Date: Mon Jun 1 01:51:37 2009 New Revision: 193194 URL: http://svn.freebsd.org/changeset/base/193194 Log: ZyXEL G-202 has zd1211b chipset, not zd1211. Tested by: Samuel Boivie Modified: head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Mon Jun 1 01:42:56 2009 (r193193) +++ head/sys/dev/usb/wlan/if_zyd.c Mon Jun 1 01:51:37 2009 (r193194) @@ -232,7 +232,6 @@ static const struct usb_device_id zyd_de {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_AG225H, ZYD_ZD1211)}, {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_ZYAIRG220, ZYD_ZD1211)}, {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G200V2, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G202, ZYD_ZD1211)}, /* ZYD_ZD1211B */ {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_SMCWUSBG, ZYD_ZD1211B)}, {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_ZD1211B, ZYD_ZD1211B)}, @@ -252,6 +251,7 @@ static const struct usb_device_id zyd_de {USB_VPI(USB_VENDOR_ZCOM, USB_PRODUCT_ZCOM_ZD1211B, ZYD_ZD1211B)}, {USB_VPI(USB_VENDOR_ZYDAS, USB_PRODUCT_ZYDAS_ZD1211B, ZYD_ZD1211B)}, {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_M202, ZYD_ZD1211B)}, + {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G202, ZYD_ZD1211B)}, {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G220V2, ZYD_ZD1211B)}, }; From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 02:37:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBCB01065673; Mon, 1 Jun 2009 02:37:06 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA3958FC0A; Mon, 1 Jun 2009 02:37:06 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n512b6Wi061551; Mon, 1 Jun 2009 02:37:06 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n512b6Qc061550; Mon, 1 Jun 2009 02:37:06 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200906010237.n512b6Qc061550@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 1 Jun 2009 02:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193195 - head/sys/modules/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 02:37:07 -0000 Author: weongyo Date: Mon Jun 1 02:37:06 2009 New Revision: 193195 URL: http://svn.freebsd.org/changeset/base/193195 Log: connect urtw(4) to the amd64/i386 build that it's not tested on the big endian machines yet. Modified: head/sys/modules/usb/Makefile Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Jun 1 01:51:37 2009 (r193194) +++ head/sys/modules/usb/Makefile Mon Jun 1 02:37:06 2009 (r193195) @@ -27,7 +27,7 @@ SUBDIR = usb SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci} -SUBDIR += rum uath upgt ural zyd +SUBDIR += rum uath upgt ural zyd ${_urtw} SUBDIR += uhid ukbd ums udbp ufm SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umodem umoscom uplcom uslcom uvisor uvscom @@ -35,9 +35,17 @@ SUBDIR += uether aue axe cdce cue kue ru SUBDIR += usfs umass urio SUBDIR += quirk template +.if ${MACHINE_ARCH} == "amd64" +_urtw= urtw +.endif + .if ${MACHINE_ARCH} == "arm" _at91dci= at91dci _atmegadci= atmegadci .endif +.if ${MACHINE_ARCH} == "i386" +_urtw= urtw +.endif + .include From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 04:55:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA326106564A; Mon, 1 Jun 2009 04:55:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE1B48FC0A; Mon, 1 Jun 2009 04:55:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n514tDNK064422; Mon, 1 Jun 2009 04:55:13 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n514tDRb064417; Mon, 1 Jun 2009 04:55:13 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200906010455.n514tDRb064417@svn.freebsd.org> From: Doug Barton Date: Mon, 1 Jun 2009 04:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193197 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 04:55:14 -0000 Author: dougb Date: Mon Jun 1 04:55:13 2009 New Revision: 193197 URL: http://svn.freebsd.org/changeset/base/193197 Log: Substitute ypset for ypbind in REQUIRE lines. If you use ypset it has to happen right after ypbind, and before anything that uses NIS. The only change in rcorder accomplished by this patch is make that happen. PR: conf/117555 Submitted by: John Marshall Modified: head/etc/rc.d/amd head/etc/rc.d/keyserv head/etc/rc.d/nisdomain head/etc/rc.d/quota head/etc/rc.d/yppasswdd Modified: head/etc/rc.d/amd ============================================================================== --- head/etc/rc.d/amd Mon Jun 1 04:44:43 2009 (r193196) +++ head/etc/rc.d/amd Mon Jun 1 04:55:13 2009 (r193197) @@ -4,7 +4,7 @@ # # PROVIDE: amd -# REQUIRE: rpcbind ypbind nfsclient cleanvar ldconfig +# REQUIRE: rpcbind ypset nfsclient cleanvar ldconfig # BEFORE: DAEMON # KEYWORD: nojail shutdown Modified: head/etc/rc.d/keyserv ============================================================================== --- head/etc/rc.d/keyserv Mon Jun 1 04:44:43 2009 (r193196) +++ head/etc/rc.d/keyserv Mon Jun 1 04:55:13 2009 (r193197) @@ -6,7 +6,7 @@ # Start keyserv if we are running Secure RPC # PROVIDE: keyserv -# REQUIRE: ypbind +# REQUIRE: ypset # BEFORE: DAEMON # KEYWORD: shutdown Modified: head/etc/rc.d/nisdomain ============================================================================== --- head/etc/rc.d/nisdomain Mon Jun 1 04:44:43 2009 (r193196) +++ head/etc/rc.d/nisdomain Mon Jun 1 04:55:13 2009 (r193197) @@ -28,7 +28,7 @@ # PROVIDE: nisdomain # REQUIRE: SERVERS rpcbind -# BEFORE: ypbind ypserv ypxfrd +# BEFORE: ypset ypbind ypserv ypxfrd . /etc/rc.subr Modified: head/etc/rc.d/quota ============================================================================== --- head/etc/rc.d/quota Mon Jun 1 04:44:43 2009 (r193196) +++ head/etc/rc.d/quota Mon Jun 1 04:55:13 2009 (r193197) @@ -6,7 +6,7 @@ # Enable/Check the quotas (must be after ypbind if using NIS) # PROVIDE: quota -# REQUIRE: mountcritremote +# REQUIRE: mountcritremote ypset # BEFORE: DAEMON # KEYWORD: nojail Modified: head/etc/rc.d/yppasswdd ============================================================================== --- head/etc/rc.d/yppasswdd Mon Jun 1 04:44:43 2009 (r193196) +++ head/etc/rc.d/yppasswdd Mon Jun 1 04:55:13 2009 (r193197) @@ -4,7 +4,7 @@ # # PROVIDE: yppasswdd -# REQUIRE: ypserv ypbind +# REQUIRE: ypserv ypset # BEFORE: LOGIN # KEYWORD: shutdown From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 05:06:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 4867F1066BFB; Mon, 1 Jun 2009 05:06:25 +0000 (UTC) Date: Mon, 1 Jun 2009 05:06:25 +0000 From: Alexey Dokuchaev To: Ed Schouten Message-ID: <20090601050625.GA98269@FreeBSD.org> References: <200905311935.n4VJZfhl053022@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200905311935.n4VJZfhl053022@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193184 - in head/sys/dev/syscons: . teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 05:06:41 -0000 On Sun, May 31, 2009 at 07:35:41PM +0000, Ed Schouten wrote: > Author: ed > Date: Sun May 31 19:35:41 2009 > New Revision: 193184 > URL: http://svn.freebsd.org/changeset/base/193184 > > Log: > Restore support for bell pitch/duration. > > Because we only support a single argument to tf_param, use 16 bits for > the pitch and 16 bits for the duration. While there, make the argument > unsigned. There isn't a single param call that needs a signed integer. > > Submitted by: danfe (modified) Thanks! ./danfe From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 05:35:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 878D5106567A; Mon, 1 Jun 2009 05:35:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75CFF8FC22; Mon, 1 Jun 2009 05:35:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n515Z4Bb065283; Mon, 1 Jun 2009 05:35:04 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n515Z4qK065272; Mon, 1 Jun 2009 05:35:04 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200906010535.n515Z4qK065272@svn.freebsd.org> From: Doug Barton Date: Mon, 1 Jun 2009 05:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193198 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 05:35:05 -0000 Author: dougb Date: Mon Jun 1 05:35:03 2009 New Revision: 193198 URL: http://svn.freebsd.org/changeset/base/193198 Log: Make the pf and ipfw firewalls start before netif, just like ipfilter already does. This eliminates a logical inconsistency, and a small window where the system is open after the network comes up. Modified: head/etc/rc.d/ip6fw head/etc/rc.d/ipfilter head/etc/rc.d/ipfs head/etc/rc.d/ipfw head/etc/rc.d/ipnat head/etc/rc.d/netif head/etc/rc.d/network_ipv6 head/etc/rc.d/pf head/etc/rc.d/pflog head/etc/rc.d/pfsync Modified: head/etc/rc.d/ip6fw ============================================================================== --- head/etc/rc.d/ip6fw Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/ip6fw Mon Jun 1 05:35:03 2009 (r193198) @@ -5,7 +5,6 @@ # PROVIDE: ip6fw # REQUIRE: routing -# BEFORE: network_ipv6 # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/ipfilter ============================================================================== --- head/etc/rc.d/ipfilter Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/ipfilter Mon Jun 1 05:35:03 2009 (r193198) @@ -5,7 +5,6 @@ # PROVIDE: ipfilter # REQUIRE: FILESYSTEMS -# BEFORE: netif # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/ipfs ============================================================================== --- head/etc/rc.d/ipfs Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/ipfs Mon Jun 1 05:35:03 2009 (r193198) @@ -5,7 +5,6 @@ # PROVIDE: ipfs # REQUIRE: ipnat -# BEFORE: netif # KEYWORD: nojail shutdown . /etc/rc.subr Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/ipfw Mon Jun 1 05:35:03 2009 (r193198) @@ -4,8 +4,7 @@ # # PROVIDE: ipfw -# REQUIRE: ppp -# BEFORE: NETWORKING +# REQUIRE: FILESYSTEMS # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/ipnat ============================================================================== --- head/etc/rc.d/ipnat Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/ipnat Mon Jun 1 05:35:03 2009 (r193198) @@ -5,7 +5,6 @@ # PROVIDE: ipnat # REQUIRE: ipfilter -# BEFORE: DAEMON netif # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/netif Mon Jun 1 05:35:03 2009 (r193198) @@ -26,7 +26,8 @@ # # PROVIDE: netif -# REQUIRE: atm1 cleanvar ipfilter FILESYSTEMS serial sppp sysctl +# REQUIRE: atm1 cleanvar FILESYSTEMS serial sppp sysctl +# REQUIRE: ipfilter ipfs pf ipfw # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/network_ipv6 ============================================================================== --- head/etc/rc.d/network_ipv6 Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/network_ipv6 Mon Jun 1 05:35:03 2009 (r193198) @@ -29,7 +29,7 @@ # # PROVIDE: network_ipv6 -# REQUIRE: routing +# REQUIRE: routing ip6fw # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/pf Mon Jun 1 05:35:03 2009 (r193198) @@ -4,7 +4,7 @@ # # PROVIDE: pf -# REQUIRE: FILESYSTEMS netif pflog pfsync +# REQUIRE: FILESYSTEMS pflog pfsync # BEFORE: routing # KEYWORD: nojail Modified: head/etc/rc.d/pflog ============================================================================== --- head/etc/rc.d/pflog Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/pflog Mon Jun 1 05:35:03 2009 (r193198) @@ -4,7 +4,7 @@ # # PROVIDE: pflog -# REQUIRE: FILESYSTEMS netif cleanvar +# REQUIRE: FILESYSTEMS cleanvar # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/pfsync ============================================================================== --- head/etc/rc.d/pfsync Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/pfsync Mon Jun 1 05:35:03 2009 (r193198) @@ -4,7 +4,7 @@ # # PROVIDE: pfsync -# REQUIRE: FILESYSTEMS netif +# REQUIRE: FILESYSTEMS # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 05:37:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 092A51065674; Mon, 1 Jun 2009 05:37:14 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBE888FC25; Mon, 1 Jun 2009 05:37:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n515bD8u065358; Mon, 1 Jun 2009 05:37:13 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n515bDou065357; Mon, 1 Jun 2009 05:37:13 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200906010537.n515bDou065357@svn.freebsd.org> From: Doug Barton Date: Mon, 1 Jun 2009 05:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 05:37:14 -0000 Author: dougb Date: Mon Jun 1 05:37:13 2009 New Revision: 193199 URL: http://svn.freebsd.org/changeset/base/193199 Log: Eliminate the warning that "Values of network_interfaces other than AUTO are deprecated.' There is no good reason to deprecate them, and setting this to different values can be useful for custom solutions and/or one-off configuration problems. Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Mon Jun 1 05:35:03 2009 (r193198) +++ head/etc/network.subr Mon Jun 1 05:37:13 2009 (r193199) @@ -726,10 +726,6 @@ list_net_interfaces() _tmplist="${_lo}${_tmplist}" ;; *) - if [ -z "$type" ]; then - warn "Values of network_interfaces other than" \ - "AUTO are deprecated" - fi _tmplist="${network_interfaces} ${cloned_interfaces}" ;; esac From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:12:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D21DE106567C; Mon, 1 Jun 2009 06:12:08 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0FB88FC1C; Mon, 1 Jun 2009 06:12:08 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n516C80Q066175; Mon, 1 Jun 2009 06:12:08 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n516C89j066174; Mon, 1 Jun 2009 06:12:08 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906010612.n516C89j066174@svn.freebsd.org> From: Alan Cox Date: Mon, 1 Jun 2009 06:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193201 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 06:12:09 -0000 Author: alc Date: Mon Jun 1 06:12:08 2009 New Revision: 193201 URL: http://svn.freebsd.org/changeset/base/193201 Log: Eliminate a comment describing code that was deleted over eight years ago. Move another comment to its proper place. Fix a typo in a third comment. Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Jun 1 05:48:30 2009 (r193200) +++ head/sys/kern/vfs_bio.c Mon Jun 1 06:12:08 2009 (r193201) @@ -638,13 +638,6 @@ bufinit(void) hifreebuffers = 2 * lofreebuffers; numfreebuffers = nbuf; -/* - * Maximum number of async ops initiated per buf_daemon loop. This is - * somewhat of a hack at the moment, we really need to limit ourselves - * based on the number of bytes of I/O in-transit that were initiated - * from buf_daemon. - */ - bogus_page = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL | VM_ALLOC_WIRED); } @@ -1202,7 +1195,7 @@ brelse(struct buf *bp) /* * Failed write, redirty. Must clear BIO_ERROR to prevent * pages from being scrapped. If the error is anything - * other than an I/O error (EIO), assume that retryingi + * other than an I/O error (EIO), assume that retrying * is futile. */ bp->b_ioflags &= ~BIO_ERROR; @@ -2403,15 +2396,9 @@ vfs_setdirty(struct buf *bp) /* * Degenerate case - empty buffer */ - if (bp->b_bufsize == 0) return; - /* - * We qualify the scan for modified pages on whether the - * object has been flushed yet. - */ - if ((bp->b_flags & B_VMIO) == 0) return; @@ -2428,6 +2415,11 @@ vfs_setdirty_locked_object(struct buf *b object = bp->b_bufobj->bo_object; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + + /* + * We qualify the scan for modified pages on whether the + * object has been flushed yet. + */ if (object->flags & (OBJ_MIGHTBEDIRTY|OBJ_CLEANING)) { vm_offset_t boffset; vm_offset_t eoffset; From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:30:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB2071065677; Mon, 1 Jun 2009 06:30:12 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 8258B8FC12; Mon, 1 Jun 2009 06:30:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 3A2FA41C707; Mon, 1 Jun 2009 08:30:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id dmi9zvOCZarK; Mon, 1 Jun 2009 08:30:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id BF84141C6FC; Mon, 1 Jun 2009 08:30:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id D3B724448E6; Mon, 1 Jun 2009 06:29:53 +0000 (UTC) Date: Mon, 1 Jun 2009 06:29:53 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Doug Barton In-Reply-To: <200906010535.n515Z4qK065272@svn.freebsd.org> Message-ID: <20090601062701.C12292@maildrop.int.zabbadoz.net> References: <200906010535.n515Z4qK065272@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193198 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 06:30:13 -0000 On Mon, 1 Jun 2009, Doug Barton wrote: > Author: dougb > Date: Mon Jun 1 05:35:03 2009 > New Revision: 193198 > URL: http://svn.freebsd.org/changeset/base/193198 > > Log: > Make the pf and ipfw firewalls start before netif, just like ipfilter > already does. This eliminates a logical inconsistency, and a small > window where the system is open after the network comes up. Unfortunetaly this is contrary to a lot of PRs and requests on mailing lists out there that actually want the netif/network_ipv6 to be run _before_ things come up. Espescially pf really needs this to avoid rules that needs to do per paket lookups of the interface address. Further ipfw has a default option being setaable at compile time and as TUNABLE to handle this window. -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:31:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2C921065674; Mon, 1 Jun 2009 06:31:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E135D8FC15; Mon, 1 Jun 2009 06:31:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n516V4V6066644; Mon, 1 Jun 2009 06:31:04 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n516V4b9066643; Mon, 1 Jun 2009 06:31:04 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200906010631.n516V4b9066643@svn.freebsd.org> From: Doug Barton Date: Mon, 1 Jun 2009 06:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193202 - head/contrib/bind9/lib/isc/ia64/include/isc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 06:31:05 -0000 Author: dougb Date: Mon Jun 1 06:31:04 2009 New Revision: 193202 URL: http://svn.freebsd.org/changeset/base/193202 Log: Local hack to get the build going again while ISC works on a more permanent solution for 9.6.1-release. "My suggestion is to remove the whole attribute construct. It only suppresses a warning when a function is unused. In this case the function is defined as inline, so it's not causing a warning when not used." Submitted by: marcel Modified: head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Modified: head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h ============================================================================== --- head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Mon Jun 1 06:12:08 2009 (r193201) +++ head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Mon Jun 1 06:31:04 2009 (r193202) @@ -32,9 +32,6 @@ */ static inline isc_int32_t isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) -#ifdef __GNUC__ -__attribute__ ((unused)) -#endif { isc_int32_t prev, swapped; @@ -58,9 +55,6 @@ __attribute__ ((unused)) */ static inline void isc_atomic_store(isc_int32_t *p, isc_int32_t val) -#ifdef __GNUC__ -__attribute__ ((unused)) -#endif { __asm__ volatile( "st4.rel %0=%1" @@ -77,9 +71,6 @@ __attribute__ ((unused)) */ static inline isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) -#ifdef __GNUC__ -__attribute__ ((unused)) -#endif { isc_int32_t ret; From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:32:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C215106566C for ; Mon, 1 Jun 2009 06:32:41 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id C52EB8FC13 for ; Mon, 1 Jun 2009 06:32:40 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-064-187-205.pools.arcor-ip.net [88.64.187.205]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MKv5w-1MB0sO3r2J-0001Qu; Mon, 01 Jun 2009 08:20:05 +0200 Received: (qmail 98309 invoked from network); 1 Jun 2009 06:20:04 -0000 Received: from kvm.laiers.local (HELO kvm.localnet) (192.168.4.187) by mx.laiers.local with SMTP; 1 Jun 2009 06:20:04 -0000 From: Max Laier Organization: FreeBSD To: Doug Barton Date: Mon, 1 Jun 2009 08:20:02 +0200 User-Agent: KMail/1.11.3 (Linux/2.6.30-rc5-ARCH; KDE/4.2.3; x86_64; ; ) References: <200906010535.n515Z4qK065272@svn.freebsd.org> In-Reply-To: <200906010535.n515Z4qK065272@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906010820.03864.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1+NPgO0xBiPQbJqAviP7jxJA12F6IMMgiU/7P3 LQRMe971LAvmEIf58gifQ1VSQFUw0rDObeVimzGDRf1T/rhwZE k1MVv+mI+eErECVWmk1xg== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193198 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 06:32:41 -0000 On Monday 01 June 2009 07:35:03 Doug Barton wrote: > Author: dougb > Date: Mon Jun 1 05:35:03 2009 > New Revision: 193198 > URL: http://svn.freebsd.org/changeset/base/193198 > > Log: > Make the pf and ipfw firewalls start before netif, just like ipfilter > already does. This eliminates a logical inconsistency, and a small > window where the system is open after the network comes up. Can you please add a note about this in UPDATING? It might be a slight POLA violation for people who rely on the interfaces being configured to setup the firewall. For instance when one doesn't use dynamic address rules in pf i.e. "from/to ifX" instead of "from/to (ifX)". > Modified: > head/etc/rc.d/ip6fw > head/etc/rc.d/ipfilter > head/etc/rc.d/ipfs > head/etc/rc.d/ipfw > head/etc/rc.d/ipnat > head/etc/rc.d/netif > head/etc/rc.d/network_ipv6 > head/etc/rc.d/pf > head/etc/rc.d/pflog > head/etc/rc.d/pfsync -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:40:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC62B106566B; Mon, 1 Jun 2009 06:40:06 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id A35298FC12; Mon, 1 Jun 2009 06:40:06 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id EAAE441C6DB; Mon, 1 Jun 2009 08:40:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id ONYYljH4tc2k; Mon, 1 Jun 2009 08:40:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 9021C41C6A7; Mon, 1 Jun 2009 08:40:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 955314448E6; Mon, 1 Jun 2009 06:35:30 +0000 (UTC) Date: Mon, 1 Jun 2009 06:35:30 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Doug Barton In-Reply-To: <200906010537.n515bDou065357@svn.freebsd.org> Message-ID: <20090601063455.R12292@maildrop.int.zabbadoz.net> References: <200906010537.n515bDou065357@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 06:40:07 -0000 On Mon, 1 Jun 2009, Doug Barton wrote: > Author: dougb > Date: Mon Jun 1 05:37:13 2009 > New Revision: 193199 > URL: http://svn.freebsd.org/changeset/base/193199 > > Log: > Eliminate the warning that "Values of network_interfaces other than > AUTO are deprecated.' There is no good reason to deprecate them, and > setting this to different values can be useful for custom solutions > and/or one-off configuration problems. There used to be adisucssion about this last year. I think you would have wanted to talk to brooks before who had put this in: http://lists.freebsd.org/pipermail/cvs-all/2008-July/thread.html#263409 > Modified: > head/etc/network.subr > > Modified: head/etc/network.subr > ============================================================================== > --- head/etc/network.subr Mon Jun 1 05:35:03 2009 (r193198) > +++ head/etc/network.subr Mon Jun 1 05:37:13 2009 (r193199) > @@ -726,10 +726,6 @@ list_net_interfaces() > _tmplist="${_lo}${_tmplist}" > ;; > *) > - if [ -z "$type" ]; then > - warn "Values of network_interfaces other than" \ > - "AUTO are deprecated" > - fi > _tmplist="${network_interfaces} ${cloned_interfaces}" > ;; > esac > -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:45:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3AE3106566B; Mon, 1 Jun 2009 06:45:33 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.swip.net [212.247.154.161]) by mx1.freebsd.org (Postfix) with ESMTP id AD6D88FC19; Mon, 1 Jun 2009 06:45:31 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=nQFUiTvL6WUA:10 a=3nnSMyBP6osA:10 a=6I5d2MoRAAAA:8 a=50XKn_MYgKWNrfaHf2cA:9 a=LZBvPhvyD8p0eqtLxlFaLjzzngcA:4 Received: from [62.113.132.61] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe06.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 1251398106; Mon, 01 Jun 2009 07:45:28 +0200 From: Hans Petter Selasky To: Rui Paulo Date: Mon, 1 Jun 2009 07:49:35 +0200 User-Agent: KMail/1.9.7 References: <200905271927.n4RJRUH8009289@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906010749.37072.hselasky@c2i.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrew Thompson Subject: Re: svn commit: r192925 - in head/sys/dev/usb: . input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 06:45:33 -0000 On Monday 01 June 2009, Rui Paulo wrote: > http://wiki.freebsd.org/AppleMacbook#head-7eab3730c3bf3d04bdfb0d1d3649eaddf >2fed595 Hi Rui Paulo, Regarding the eject button, can you have a look at: /sys/dev/usb/input/ukbd.c And provide a patch that masks this key the way you want? Debugging: sysctl hw.usb.ukbd.debug=15 --HPS From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:49:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A32E7106564A; Mon, 1 Jun 2009 06:49:09 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 905028FC1E; Mon, 1 Jun 2009 06:49:09 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n516n9p2067055; Mon, 1 Jun 2009 06:49:09 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n516n9IE067053; Mon, 1 Jun 2009 06:49:09 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <200906010649.n516n9IE067053@svn.freebsd.org> From: Juli Mallett Date: Mon, 1 Jun 2009 06:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193203 - head/usr.sbin/tcpdrop X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 06:49:10 -0000 Author: jmallett Date: Mon Jun 1 06:49:09 2009 New Revision: 193203 URL: http://svn.freebsd.org/changeset/base/193203 Log: o) Restructure tcpdrop(8) to provide a facility to try to drop all established connections. Including a flag to instead output a sequence of tcpdrop(8) invocations that would accomplish the same thing, which is convenient for scripting. o) Make tcpdrop complain if the addresses given to it are entirely in different address families, rather than failing silently. o) When cross-referencing httpd(8), do not explicitly specify the apache2 port, since the example in question is generic. Modified: head/usr.sbin/tcpdrop/tcpdrop.8 head/usr.sbin/tcpdrop/tcpdrop.c Modified: head/usr.sbin/tcpdrop/tcpdrop.8 ============================================================================== --- head/usr.sbin/tcpdrop/tcpdrop.8 Mon Jun 1 06:31:04 2009 (r193202) +++ head/usr.sbin/tcpdrop/tcpdrop.8 Mon Jun 1 06:49:09 2009 (r193203) @@ -1,5 +1,6 @@ .\" $OpenBSD: tcpdrop.8,v 1.5 2004/05/24 13:57:31 jmc Exp $ .\" +.\" Copyright (c) 2009 Juli Mallett .\" Copyright (c) 2004 Markus Friedl .\" .\" Permission to use, copy, modify, and distribute this software for any @@ -16,35 +17,58 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2004 +.Dd March 24, 2009 .Dt TCPDROP 8 .Os .Sh NAME .Nm tcpdrop -.Nd drop a TCP connection +.Nd drop TCP connections .Sh SYNOPSIS .Nm tcpdrop -.Ar laddr -.Ar lport -.Ar faddr -.Ar fport +.Ar local-address +.Ar local-port +.Ar foreign-address +.Ar foreign-port +.Nm tcpdrop +.Op Fl l +.Fl a .Sh DESCRIPTION The .Nm -command drops the TCP connection specified by the local address -.Ar laddr , +command may be used to drop TCP connections from the command line. +.Pp +If +.Fl a +is specified then +.Nm +will attempt to drop all active connections. +The +.Fl l +flag may be given to list the tcpdrop invocation to drop all active +connections one at a time. +.Pp +If +.Fl a +is not specified then only the connection between the given local +address +.Ar local-address , port -.Ar lport +.Ar local-port , and the foreign address -.Ar faddr , +.Ar foreign-address , port -.Ar fport . -Addresses and ports can be specified by name or numeric value. +.Ar foreign-port , +will be dropped. +.Pp +Addresses and ports may be specified by name or numeric value. +Both IPv4 and IPv6 address formats are supported. +.Nm +in case of success or failure. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES If a connection to -.Xr httpd 8 Pq Pa ports/www/apache2 +.Xr httpd 8 is causing congestion on a network link, one can drop the TCP session in charge: .Bd -literal -offset indent @@ -57,8 +81,16 @@ The following command will drop the conn .Bd -literal -offset indent # tcpdrop 192.168.5.41 80 192.168.5.1 26747 .Ed +.Pp +The following command will drop all connections but those to or from +port 22, the port used by +.Xr sshd 8 : +.Bd -literal -offset indent +# tcpdrop -l -a | grep -vw 22 | sh +.Ed .Sh SEE ALSO .Xr netstat 1 , .Xr sockstat 1 .Sh AUTHORS .An Markus Friedl Aq markus@openbsd.org +.An Juli Mallett Aq jmallett@FreeBSD.org Modified: head/usr.sbin/tcpdrop/tcpdrop.c ============================================================================== --- head/usr.sbin/tcpdrop/tcpdrop.c Mon Jun 1 06:31:04 2009 (r193202) +++ head/usr.sbin/tcpdrop/tcpdrop.c Mon Jun 1 06:49:09 2009 (r193203) @@ -1,6 +1,7 @@ /* $OpenBSD: tcpdrop.c,v 1.4 2004/05/22 23:55:22 deraadt Exp $ */ /*- + * Copyright (c) 2009 Juli Mallett * Copyright (c) 2004 Markus Friedl * * Permission to use, copy, modify, and distribute this software for any @@ -21,15 +22,41 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include + +#include +#define TCPSTATES +#include #include #include #include +#include #include #include #include +#include + +#define TCPDROP_FOREIGN 0 +#define TCPDROP_LOCAL 1 + +struct host_service { + char hs_host[NI_MAXHOST]; + char hs_service[NI_MAXSERV]; +}; + +static bool tcpdrop_list_commands = false; + +static struct xinpgen *getxpcblist(const char *); +static void sockinfo(const struct sockaddr *, struct host_service *); +static bool tcpdrop(const struct sockaddr *, const struct sockaddr *); +static bool tcpdropall(void); +static bool tcpdropbyname(const char *, const char *, const char *, + const char *); +static bool tcpdropconn(const struct in_conninfo *); +static void usage(void); /* * Drop a tcp connection. @@ -37,55 +64,259 @@ __FBSDID("$FreeBSD$"); int main(int argc, char *argv[]) { - struct addrinfo hints, *ail, *aif, *laddr, *faddr; - /* addrs[0] is a foreign socket, addrs[1] is a local one. */ - struct sockaddr_storage addrs[2]; - int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_DROP }; - int gaierr, rval = 0; - char fhbuf[NI_MAXHOST], fsbuf[NI_MAXSERV], lhbuf[NI_MAXHOST], - lsbuf[NI_MAXSERV]; + bool dropall; + int ch; + + dropall = false; + + while ((ch = getopt(argc, argv, "al")) != -1) { + switch (ch) { + case 'a': + dropall = true; + break; + case 'l': + tcpdrop_list_commands = true; + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (dropall) { + if (argc != 0) + usage(); + if (!tcpdropall()) + exit(1); + exit(0); + } - if (argc != 5) { - fprintf(stderr, "usage: tcpdrop laddr lport faddr fport\n"); + if (argc != 4 || tcpdrop_list_commands) + usage(); + + if (!tcpdropbyname(argv[0], argv[1], argv[2], argv[3])) exit(1); + + exit(0); +} + +static struct xinpgen * +getxpcblist(const char *name) +{ + struct xinpgen *xinp; + size_t len; + int rv; + + len = 0; + rv = sysctlbyname(name, NULL, &len, NULL, 0); + if (rv == -1) + err(1, "sysctlbyname %s", name); + + if (len == 0) + errx(1, "%s is empty", name); + + xinp = malloc(len); + if (xinp == NULL) + errx(1, "malloc failed"); + + rv = sysctlbyname(name, xinp, &len, NULL, 0); + if (rv == -1) + err(1, "sysctlbyname %s", name); + + return (xinp); +} + +static void +sockinfo(const struct sockaddr *sa, struct host_service *hs) +{ + static const int flags = NI_NUMERICHOST | NI_NUMERICSERV; + int rv; + + rv = getnameinfo(sa, sa->sa_len, hs->hs_host, sizeof hs->hs_host, + hs->hs_service, sizeof hs->hs_service, flags); + if (rv == -1) + err(1, "getnameinfo"); +} + +static bool +tcpdrop(const struct sockaddr *lsa, const struct sockaddr *fsa) +{ + struct host_service local, foreign; + struct sockaddr_storage addrs[2]; + int rv; + + memcpy(&addrs[TCPDROP_FOREIGN], fsa, fsa->sa_len); + memcpy(&addrs[TCPDROP_LOCAL], lsa, lsa->sa_len); + + sockinfo(lsa, &local); + sockinfo(fsa, &foreign); + + if (tcpdrop_list_commands) { + printf("tcpdrop %s %s %s %s\n", local.hs_host, local.hs_service, + foreign.hs_host, foreign.hs_service); + return (true); + } + + rv = sysctlbyname("net.inet.tcp.drop", NULL, NULL, &addrs, + sizeof addrs); + if (rv == -1) { + warn("%s %s %s %s", local.hs_host, local.hs_service, + foreign.hs_host, foreign.hs_service); + return (false); + } + printf("%s %s %s %s: dropped\n", local.hs_host, local.hs_service, + foreign.hs_host, foreign.hs_service); + return (true); +} + +static bool +tcpdropall(void) +{ + struct xinpgen *head, *xinp; + struct xtcpcb *xpcb; + struct tcpcb *tp; + struct inpcb *inp; + bool ok; + + ok = true; + + head = getxpcblist("net.inet.tcp.pcblist"); + +#define XINP_NEXT(xinp) \ + ((struct xinpgen *)((uintptr_t)(xinp) + (xinp)->xig_len)) + + for (xinp = XINP_NEXT(head); xinp->xig_len > sizeof *xinp; + xinp = XINP_NEXT(xinp)) { + xpcb = (struct xtcpcb *)xinp; + tp = &xpcb->xt_tp; + inp = &xpcb->xt_inp; + + /* + * XXX + * Check protocol, support just v4 or v6, etc. + */ + + /* Ignore PCBs which were freed during copyout. */ + if (inp->inp_gencnt > head->xig_gen) + continue; + + /* Skip listening sockets. */ + if (tp->t_state == TCPS_LISTEN) + continue; + + if (!tcpdropconn(&inp->inp_inc)) + ok = false; } - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - if ((gaierr = getaddrinfo(argv[1], argv[2], &hints, &laddr)) != 0) - errx(1, "%s port %s: %s", argv[1], argv[2], - gai_strerror(gaierr)); - if ((gaierr = getaddrinfo(argv[3], argv[4], &hints, &faddr)) != 0) { - freeaddrinfo(laddr); - errx(1, "%s port %s: %s", argv[3], argv[4], - gai_strerror(gaierr)); + free(head); + + return (ok); +} + +static bool +tcpdropbyname(const char *lhost, const char *lport, const char *fhost, + const char *fport) +{ + static const struct addrinfo hints = { + /* + * Look for streams in all domains. + */ + .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_STREAM, + }; + struct addrinfo *ail, *local, *aif, *foreign; + int error; + bool ok, infamily; + + error = getaddrinfo(lhost, lport, &hints, &local); + if (error != 0) + errx(1, "getaddrinfo: %s port %s: %s", lhost, lport, + gai_strerror(error)); + + error = getaddrinfo(fhost, fport, &hints, &foreign); + if (error != 0) { + freeaddrinfo(local); /* XXX gratuitous */ + errx(1, "getaddrinfo: %s port %s: %s", lhost, lport, + gai_strerror(error)); } - for (ail = laddr; ail; ail = ail->ai_next) { - for (aif = faddr; aif; aif = aif->ai_next) { + + ok = true; + infamily = false; + + /* + * Try every combination of local and foreign address pairs. + */ + for (ail = local; ail != NULL; ail = ail->ai_next) { + for (aif = foreign; aif != NULL; aif = aif->ai_next) { if (ail->ai_family != aif->ai_family) continue; - memcpy(&addrs[0], aif->ai_addr, aif->ai_addrlen); - memcpy(&addrs[1], ail->ai_addr, ail->ai_addrlen); - if (getnameinfo(aif->ai_addr, aif->ai_addrlen, - fhbuf, sizeof(fhbuf), - fsbuf, sizeof(fsbuf), - NI_NUMERICHOST | NI_NUMERICSERV) == -1) - err(1, "getnameinfo"); - if (getnameinfo(ail->ai_addr, ail->ai_addrlen, - lhbuf, sizeof(lhbuf), - lsbuf, sizeof(lsbuf), - NI_NUMERICHOST | NI_NUMERICSERV) == -1) - err(1, "getnameinfo"); - if (sysctl(mib, sizeof (mib) / sizeof (int), NULL, - NULL, &addrs, sizeof(addrs)) == -1) { - rval = 1; - warn("%s %s %s %s", lhbuf, lsbuf, fhbuf, fsbuf); - } else - printf("%s %s %s %s: dropped\n", - lhbuf, lsbuf, fhbuf, fsbuf); + infamily = true; + if (!tcpdrop(ail->ai_addr, aif->ai_addr)) + ok = false; } } - freeaddrinfo(laddr); - freeaddrinfo(faddr); - exit(rval); + + if (!infamily) { + warnx("%s %s %s %s: different address families", lhost, lport, + fhost, fport); + ok = false; + } + + freeaddrinfo(local); + freeaddrinfo(foreign); + + return (ok); +} + +static bool +tcpdropconn(const struct in_conninfo *inc) +{ + struct sockaddr *local, *foreign; + struct sockaddr_in6 sin6[2]; + struct sockaddr_in sin4[2]; + + if ((inc->inc_flags & INC_ISIPV6) != 0) { + memset(sin6, 0, sizeof sin6); + + sin6[TCPDROP_LOCAL].sin6_len = sizeof sin6[TCPDROP_LOCAL]; + sin6[TCPDROP_LOCAL].sin6_family = AF_INET6; + sin6[TCPDROP_LOCAL].sin6_port = inc->inc_lport; + memcpy(&sin6[TCPDROP_LOCAL].sin6_addr, &inc->inc6_laddr, + sizeof inc->inc6_laddr); + local = (struct sockaddr *)&sin6[TCPDROP_LOCAL]; + + sin6[TCPDROP_FOREIGN].sin6_len = sizeof sin6[TCPDROP_FOREIGN]; + sin6[TCPDROP_FOREIGN].sin6_family = AF_INET6; + sin6[TCPDROP_FOREIGN].sin6_port = inc->inc_fport; + memcpy(&sin6[TCPDROP_FOREIGN].sin6_addr, &inc->inc6_faddr, + sizeof inc->inc6_faddr); + foreign = (struct sockaddr *)&sin6[TCPDROP_FOREIGN]; + } else { + memset(&sin4[TCPDROP_LOCAL], 0, sizeof sin4[TCPDROP_LOCAL]); + + sin4[TCPDROP_LOCAL].sin_len = sizeof sin4[TCPDROP_LOCAL]; + sin4[TCPDROP_LOCAL].sin_family = AF_INET; + sin4[TCPDROP_LOCAL].sin_port = inc->inc_lport; + memcpy(&sin4[TCPDROP_LOCAL].sin_addr, &inc->inc_laddr, + sizeof inc->inc_laddr); + local = (struct sockaddr *)&sin4[TCPDROP_LOCAL]; + + sin4[TCPDROP_FOREIGN].sin_len = sizeof sin4[TCPDROP_FOREIGN]; + sin4[TCPDROP_FOREIGN].sin_family = AF_INET; + sin4[TCPDROP_FOREIGN].sin_port = inc->inc_fport; + memcpy(&sin4[TCPDROP_FOREIGN].sin_addr, &inc->inc_faddr, + sizeof inc->inc_faddr); + foreign = (struct sockaddr *)&sin4[TCPDROP_FOREIGN]; + } + + return (tcpdrop(local, foreign)); +} + +static void +usage(void) +{ + fprintf(stderr, +"usage: tcpdrop local-address local-port foreign-address foreign-port\n" +" tcpdrop [-l] -a\n"); + exit(1); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:52:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A3EA106566C; Mon, 1 Jun 2009 06:52:03 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88FCE8FC0A; Mon, 1 Jun 2009 06:52:03 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n516q3p5067177; Mon, 1 Jun 2009 06:52:03 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n516q3Ol067175; Mon, 1 Jun 2009 06:52:03 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <200906010652.n516q3Ol067175@svn.freebsd.org> From: Juli Mallett Date: Mon, 1 Jun 2009 06:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193204 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 06:52:03 -0000 Author: jmallett Date: Mon Jun 1 06:52:03 2009 New Revision: 193204 URL: http://svn.freebsd.org/changeset/base/193204 Log: o) Remove some references to long-unsupported old-style config(8) directives. o) Borrow da(4) language about autoconfiguration for ch(4). Modified: head/share/man/man4/ch.4 head/share/man/man4/scsi.4 Modified: head/share/man/man4/ch.4 ============================================================================== --- head/share/man/man4/ch.4 Mon Jun 1 06:49:09 2009 (r193203) +++ head/share/man/man4/ch.4 Mon Jun 1 06:52:03 2009 (r193204) @@ -32,7 +32,6 @@ .Nd SCSI media-changer (juke box) driver .Sh SYNOPSIS .Cd device ch -.Cd device ch1 target 4 unit 0 .Sh DESCRIPTION The .Nm @@ -67,13 +66,12 @@ come on line as; refer to .Xr scsi 4 for details on kernel configuration. .Sh KERNEL CONFIGURATION -In configuring, if an optional -.Ar count -is given in the specification, that number of SCSI media changers -are configured; Most storage for them is allocated only when found -so a large number of configured devices is cheap. -(once the first -has included the driver). +It is only necessary to explicitly configure one +.Nm +device; data structures are dynamically allocated as media changes are found +on the +.Tn SCSI +bus. .Sh IOCTLS User mode programs communicate with the changer driver through a number of ioctls which are described below. Modified: head/share/man/man4/scsi.4 ============================================================================== --- head/share/man/man4/scsi.4 Mon Jun 1 06:49:09 2009 (r193203) +++ head/share/man/man4/scsi.4 Mon Jun 1 06:52:03 2009 (r193204) @@ -150,7 +150,7 @@ will be reset to 100ms. .Pp All devices and the SCSI busses support boot time allocation so that an upper number of devices and controllers does not need to be configured; -.Cd "device da0" +.Cd "device da" will suffice for any number of disk drivers. .Pp The devices are either From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 07:05:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1179A1065674; Mon, 1 Jun 2009 07:05:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3E6B8FC1B; Mon, 1 Jun 2009 07:05:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5175qo5067514; Mon, 1 Jun 2009 07:05:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5175q4K067513; Mon, 1 Jun 2009 07:05:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200906010705.n5175q4K067513@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jun 2009 07:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193205 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 07:05:53 -0000 Author: delphij Date: Mon Jun 1 07:05:52 2009 New Revision: 193205 URL: http://svn.freebsd.org/changeset/base/193205 Log: According to Intel documentation (307013), 3Gbps mode is supported on Desktop chipsets only for ICH7 series, so mark all ICH7M as ATA_SA150 instead of ATA_SA300. Modified: head/sys/dev/ata/ (props changed) head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Mon Jun 1 06:52:03 2009 (r193204) +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Jun 1 07:05:52 2009 (r193205) @@ -104,9 +104,9 @@ ata_intel_probe(device_t dev) { ATA_I82801GB_S1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, { ATA_I82801GB_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, { ATA_I82801GB_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, - { ATA_I82801GBM_S1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7M" }, - { ATA_I82801GBM_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7M" }, - { ATA_I82801GBM_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7M" }, + { ATA_I82801GBM_S1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, + { ATA_I82801GBM_R1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, + { ATA_I82801GBM_AH, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, { ATA_I63XXESB2, 0, 0, 1, ATA_UDMA5, "63XXESB2" }, { ATA_I63XXESB2_S1, 0, INTEL_AHCI, 0, ATA_SA300, "63XXESB2" }, { ATA_I63XXESB2_S2, 0, INTEL_AHCI, 0, ATA_SA300, "63XXESB2" }, From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 07:48:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25FFA106564A; Mon, 1 Jun 2009 07:48:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 145948FC21; Mon, 1 Jun 2009 07:48:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n517mRRQ068319; Mon, 1 Jun 2009 07:48:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n517mRlU068318; Mon, 1 Jun 2009 07:48:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200906010748.n517mRlU068318@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 1 Jun 2009 07:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193206 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 07:48:28 -0000 Author: trasz Date: Mon Jun 1 07:48:27 2009 New Revision: 193206 URL: http://svn.freebsd.org/changeset/base/193206 Log: Use the "flag" word consistently. Submitted by: Ben Kaduk Modified: head/share/man/man9/VOP_ACCESS.9 Modified: head/share/man/man9/VOP_ACCESS.9 ============================================================================== --- head/share/man/man9/VOP_ACCESS.9 Mon Jun 1 07:05:52 2009 (r193205) +++ head/share/man/man9/VOP_ACCESS.9 Mon Jun 1 07:48:27 2009 (r193206) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2009 +.Dd June 1, 2009 .Os .Dt VOP_ACCESS 9 .Sh NAME @@ -77,7 +77,7 @@ are .Dv VADMIN and .Dv VAPPEND . -To check for other bits, one has to use +To check for other flags, one has to use .Fn VOP_ACCESSX instead. .Sh LOCKS From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 09:25:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64D8E106564A; Mon, 1 Jun 2009 09:25:32 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5323D8FC13; Mon, 1 Jun 2009 09:25:32 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n519PWi2071146; Mon, 1 Jun 2009 09:25:32 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n519PWad071145; Mon, 1 Jun 2009 09:25:32 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200906010925.n519PWad071145@svn.freebsd.org> From: Ulf Lilleengen Date: Mon, 1 Jun 2009 09:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193213 - head/contrib/csup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 09:25:32 -0000 Author: lulf Date: Mon Jun 1 09:25:32 2009 New Revision: 193213 URL: http://svn.freebsd.org/changeset/base/193213 Log: - Add missing data argument to printf. Submitted by: Pawel Worach MFC after: 1 week Modified: head/contrib/csup/updater.c Modified: head/contrib/csup/updater.c ============================================================================== --- head/contrib/csup/updater.c Mon Jun 1 09:03:55 2009 (r193212) +++ head/contrib/csup/updater.c Mon Jun 1 09:25:32 2009 (r193213) @@ -1858,7 +1858,7 @@ updater_append_file(struct updater *up, goto bad; } if (nread == -1) { - xasprintf(&up->errmsg, "%s: Error reading: %s", + xasprintf(&up->errmsg, "%s: Error reading: %s", fup->destpath, strerror(errno)); return (UPDATER_ERR_MSG); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 09:32:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 958A11065670; Mon, 1 Jun 2009 09:32:12 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 838848FC16; Mon, 1 Jun 2009 09:32:12 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n519WC6t071345; Mon, 1 Jun 2009 09:32:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n519WC19071344; Mon, 1 Jun 2009 09:32:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200906010932.n519WC19071344@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 1 Jun 2009 09:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193214 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 09:32:13 -0000 Author: pjd Date: Mon Jun 1 09:32:12 2009 New Revision: 193214 URL: http://svn.freebsd.org/changeset/base/193214 Log: Document EINVAL for bind(2). Reviewed by: rwatson Obtained from: SuSv3 Modified: head/lib/libc/sys/bind.2 Modified: head/lib/libc/sys/bind.2 ============================================================================== --- head/lib/libc/sys/bind.2 Mon Jun 1 09:25:32 2009 (r193213) +++ head/lib/libc/sys/bind.2 Mon Jun 1 09:32:12 2009 (r193214) @@ -82,6 +82,9 @@ The .Fa s argument is not a valid descriptor. +.It Bq Er EINVAL +The socket is already bound to an address, and the protocol does not support +binding to a new address; or the socket has been shut down. .It Bq Er ENOTSOCK The .Fa s From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 10:27:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09A381065704; Mon, 1 Jun 2009 10:27:27 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f212.google.com (mail-ew0-f212.google.com [209.85.219.212]) by mx1.freebsd.org (Postfix) with ESMTP id EB8FE8FC26; Mon, 1 Jun 2009 10:27:25 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ewy8 with SMTP id 8so4242347ewy.43 for ; Mon, 01 Jun 2009 03:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:cc:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-pgp-agent:content-transfer-encoding:x-mailer; bh=2lJDecSa4v15VPi3XbMo82/uEI7jfNHYUsUzax35D6E=; b=F3pOk1OMJKbQlSA+34hqdCxDCWtKwexJJxqhRDvl+uk4P1gvCU4sO+eh5Mmfk56enD XLbrlBXAW1wMUFkz7iKQw9bbfdm8kCUTPHDvvzMwOcwmIjNWH0sms+9nXfLNQuVO36sS qIBkWOVjpp4u/o9+tOdnszeUXgLFMtK9tPF2E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:cc:message-id:from:to:in-reply-to:content-type:mime-version :subject:date:references:x-pgp-agent:content-transfer-encoding :x-mailer; b=IhSozE2PlUx2Hc19PHfpIOOoWjBpgWp/A2B6OyRxKUEhRAYCQumoxbJwA0K+IWmEkb f5p790f0RxIJh6fCa5koB9otxPhA6To+5HudFLQPrI9pM8+hs2z1qT7a74RQhTksWm35 pIyKGnrilWlJ+9vhaX2mRFsY754NegwgDlURk= Received: by 10.210.88.7 with SMTP id l7mr6184885ebb.55.1243852044626; Mon, 01 Jun 2009 03:27:24 -0700 (PDT) Received: from epsilon.lan (bl11-193-231.dsl.telepac.pt [85.244.193.231]) by mx.google.com with ESMTPS id 28sm6541893eye.56.2009.06.01.03.27.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 01 Jun 2009 03:27:24 -0700 (PDT) Sender: Rui Paulo Message-Id: <5C52056B-8E4A-4C15-8451-2A5576A8FC9F@freebsd.org> From: Rui Paulo To: Hans Petter Selasky In-Reply-To: <200906010749.37072.hselasky@c2i.net> Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-5--743129881" Mime-Version: 1.0 (Apple Message framework v935.3) Date: Mon, 1 Jun 2009 11:27:22 +0100 References: <200905271927.n4RJRUH8009289@svn.freebsd.org> <200906010749.37072.hselasky@c2i.net> X-Pgp-Agent: GPGMail 1.2.0 (v56) Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrew Thompson Subject: Re: svn commit: r192925 - in head/sys/dev/usb: . input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 10:27:27 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-5--743129881 Content-Type: multipart/mixed; boundary=Apple-Mail-4--743129911 --Apple-Mail-4--743129911 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi, On 1 Jun 2009, at 06:49, Hans Petter Selasky wrote: > On Monday 01 June 2009, Rui Paulo wrote: >> http://wiki.freebsd.org/AppleMacbook#head-7eab3730c3bf3d04bdfb0d1d3649eaddf >> 2fed595 > > Hi Rui Paulo, > > Regarding the eject button, can you have a look at: > > /sys/dev/usb/input/ukbd.c > > And provide a patch that masks this key the way you want? I'm not sure what you mean. I'm proposing to remove the key handling code from the kernel. See the attached patch. Thanks, -- Rui Paulo --Apple-Mail-4--743129911 Content-Disposition: attachment; filename=rem-eject.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="rem-eject.diff" Content-Transfer-Encoding: 7bit Index: input/ukbd.c =================================================================== --- input/ukbd.c (revision 193216) +++ input/ukbd.c (working copy) @@ -127,7 +127,6 @@ keymap_t sc_keymap; accentmap_t sc_accmap; fkeytab_t sc_fkeymap[UKBD_NFKEY]; - struct hid_location sc_loc_apple_eject; struct hid_location sc_loc_apple_fn; struct usb_callout sc_callout; struct ukbd_data sc_ndata; @@ -151,9 +150,8 @@ #define UKBD_FLAG_SET_LEDS 0x0004 #define UKBD_FLAG_ATTACHED 0x0010 #define UKBD_FLAG_GONE 0x0020 -#define UKBD_FLAG_APPLE_EJECT 0x0040 -#define UKBD_FLAG_APPLE_FN 0x0080 -#define UKBD_FLAG_APPLE_SWAP 0x0100 +#define UKBD_FLAG_APPLE_FN 0x0040 +#define UKBD_FLAG_APPLE_SWAP 0x0080 int32_t sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ int32_t sc_state; /* shift/lock key state */ @@ -488,7 +486,6 @@ uint8_t offset; uint8_t id; uint8_t apple_fn; - uint8_t apple_eject; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -521,13 +518,6 @@ usb2_copy_out(xfer->frbuffers, offset, &sc->sc_ndata, len); - if ((sc->sc_flags & UKBD_FLAG_APPLE_EJECT) && - hid_get_data((uint8_t *)&sc->sc_ndata, - len, &sc->sc_loc_apple_eject)) - apple_eject = 1; - else - apple_eject = 0; - if ((sc->sc_flags & UKBD_FLAG_APPLE_FN) && hid_get_data((uint8_t *)&sc->sc_ndata, len, &sc->sc_loc_apple_fn)) @@ -535,8 +525,7 @@ else apple_fn = 0; #if USB_DEBUG - DPRINTF("apple_eject=%u apple_fn=%u\n", - apple_eject, apple_fn); + DPRINTF("apple_fn=%u\n", apple_fn); if (sc->sc_ndata.modifiers) { DPRINTF("mod: 0x%04x\n", sc->sc_ndata.modifiers); @@ -747,22 +736,14 @@ /* investigate if this is an Apple Keyboard */ if (hid_locate(hid_ptr, hid_len, - HID_USAGE2(HUP_CONSUMER, HUG_APPLE_EJECT), - hid_input, 0, &sc->sc_loc_apple_eject, &flags, - &sc->sc_kbd_id)) { + HID_USAGE2(0xFFFF, 0x0003), + hid_input, 0, &sc->sc_loc_apple_fn, &flags, + &temp_id)) { if (flags & HIO_VARIABLE) - sc->sc_flags |= UKBD_FLAG_APPLE_EJECT | + sc->sc_flags |= UKBD_FLAG_APPLE_FN | UKBD_FLAG_APPLE_SWAP; - if (hid_locate(hid_ptr, hid_len, - HID_USAGE2(0xFFFF, 0x0003), - hid_input, 0, &sc->sc_loc_apple_fn, &flags, - &temp_id)) { - if (flags & HIO_VARIABLE) - sc->sc_flags |= UKBD_FLAG_APPLE_FN | - UKBD_FLAG_APPLE_SWAP; - if (temp_id != sc->sc_kbd_id) { - DPRINTF("HID IDs mismatch\n"); - } + if (temp_id != sc->sc_kbd_id) { + DPRINTF("HID IDs mismatch\n"); } } else { /* --Apple-Mail-4--743129911-- --Apple-Mail-5--743129881 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkojrQoACgkQfD8M/ASTygIA+QCfZREngzfyflYG9dduU9JyhDC6 fVIAn1+LDaY/tV6n+LC3Q7uG9KkBRn3n =LMIa -----END PGP SIGNATURE----- --Apple-Mail-5--743129881-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 10:30:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 893C510656C3; Mon, 1 Jun 2009 10:30:01 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 751068FC1D; Mon, 1 Jun 2009 10:30:01 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51AU1qM072750; Mon, 1 Jun 2009 10:30:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51AU0SW072735; Mon, 1 Jun 2009 10:30:00 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200906011030.n51AU0SW072735@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 1 Jun 2009 10:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193217 - in head/sys: conf netinet netinet6 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 10:30:02 -0000 Author: pjd Date: Mon Jun 1 10:30:00 2009 New Revision: 193217 URL: http://svn.freebsd.org/changeset/base/193217 Log: - Rename IP_NONLOCALOK IP socket option to IP_BINDANY, to be more consistent with OpenBSD (and BSD/OS originally). We can't easly do it SOL_SOCKET option as there is no more space for more SOL_SOCKET options, but this option also fits better as an IP socket option, it seems. - Implement this functionality also for IPv6 and RAW IP sockets. - Always compile it in (don't use additional kernel options). - Remove sysctl to turn this functionality on and off. - Introduce new privilege - PRIV_NETINET_BINDANY, which allows to use this functionality (currently only unjail root can use it). Discussed with: julian, adrian, jhb, rwatson, kmacy Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/netinet/in.h head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet/raw_ip.c head/sys/netinet6/in6.h head/sys/netinet6/in6_pcb.c head/sys/netinet6/ip6_output.c head/sys/sys/priv.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/conf/NOTES Mon Jun 1 10:30:00 2009 (r193217) @@ -639,14 +639,6 @@ options ALTQ_PRIQ # Priority Queueing options ALTQ_NOPCC # Required if the TSC is unusable options ALTQ_DEBUG -# IP optional behaviour. -# IP_NONLOCALBIND disables the check that bind() usually makes that the -# address is one that is assigned to an interface on this machine. -# It allows transparent proxies to pretend to be other machines. -# How the packet GET to that machine is a problem solved elsewhere, -# smart routers, ipfw fwd, etc. -options IP_NONLOCALBIND # Allow impersonation for proxies. - # netgraph(4). Enable the base netgraph code with the NETGRAPH option. # Individual node types can be enabled with the corresponding option # listed below; however, this is not strictly necessary as netgraph Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/conf/options Mon Jun 1 10:30:00 2009 (r193217) @@ -400,7 +400,6 @@ IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h IPSEC opt_ipsec.h IPSEC_DEBUG opt_ipsec.h -IP_NONLOCALBIND opt_inet.h IPSEC_FILTERTUNNEL opt_ipsec.h IPSTEALTH IPX Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet/in.h Mon Jun 1 10:30:00 2009 (r193217) @@ -441,8 +441,7 @@ __END_DECLS #define IP_FAITH 22 /* bool; accept FAITH'ed connections */ #define IP_ONESBCAST 23 /* bool: send all-ones broadcast */ -#define IP_NONLOCALOK 24 /* bool: allow bind to spoof non-local addresses; - requires kernel compile option IP_NONLOCALBIND */ +#define IP_BINDANY 24 /* bool: allow bind to any address */ #define IP_FW_TABLE_ADD 40 /* add entry */ #define IP_FW_TABLE_DEL 41 /* delete entry */ Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet/in_pcb.c Mon Jun 1 10:30:00 2009 (r193217) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_inet.h" #include "opt_ipsec.h" #include "opt_inet6.h" #include "opt_mac.h" @@ -357,14 +356,11 @@ in_pcbbind_setup(struct inpcb *inp, stru bzero(&sin->sin_zero, sizeof(sin->sin_zero)); /* * Is the address a local IP address? - * If INP_NONLOCALOK is set, then the socket may be bound + * If INP_BINDANY is set, then the socket may be bound * to any endpoint address, local or not. */ - if ( -#if defined(IP_NONLOCALBIND) - ((inp->inp_flags & INP_NONLOCALOK) == 0) && -#endif - (ifa_ifwithaddr((struct sockaddr *)sin) == 0)) + if ((inp->inp_flags & INP_BINDANY) == 0 && + ifa_ifwithaddr((struct sockaddr *)sin) == NULL) return (EADDRNOTAVAIL); } laddr = sin->sin_addr; Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet/in_pcb.h Mon Jun 1 10:30:00 2009 (r193217) @@ -410,8 +410,7 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_FAITH 0x00000200 /* accept FAITH'ed connections */ #define INP_RECVTTL 0x00000400 /* receive incoming IP TTL */ #define INP_DONTFRAG 0x00000800 /* don't fragment packet */ -#define INP_NONLOCALOK 0x00001000 /* Allow bind to spoof any address */ - /* - requires options IP_NONLOCALBIND */ +#define INP_BINDANY 0x00001000 /* allow bind to any address */ #define INP_INHASHLIST 0x00002000 /* in_pcbinshash() has been called */ #define IN6P_IPV6_V6ONLY 0x00008000 /* restrict AF_INET6 socket for v6 */ #define IN6P_PKTINFO 0x00010000 /* receive IP6 dst and I/F */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet/ip_output.c Mon Jun 1 10:30:00 2009 (r193217) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipfw.h" -#include "opt_inet.h" #include "opt_ipsec.h" #include "opt_route.h" #include "opt_mac.h" @@ -103,12 +102,6 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, mbuf_ &mbuf_frag_size, 0, "Fragment outgoing mbufs to this size"); #endif -#if defined(IP_NONLOCALBIND) -static int ip_nonlocalok = 0; -SYSCTL_INT(_net_inet_ip, OID_AUTO, nonlocalok, - CTLFLAG_RW|CTLFLAG_SECURE, &ip_nonlocalok, 0, ""); -#endif - static void ip_mloopback (struct ifnet *, struct mbuf *, struct sockaddr_in *, int); @@ -931,14 +924,14 @@ ip_ctloutput(struct socket *so, struct s return (error); } -#if defined(IP_NONLOCALBIND) - case IP_NONLOCALOK: - if (! ip_nonlocalok) { - error = ENOPROTOOPT; - break; + case IP_BINDANY: + if (sopt->sopt_td != NULL) { + error = priv_check(sopt->sopt_td, + PRIV_NETINET_BINDANY); + if (error) + break; } /* FALLTHROUGH */ -#endif case IP_TOS: case IP_TTL: case IP_MINTTL: @@ -1010,11 +1003,9 @@ ip_ctloutput(struct socket *so, struct s case IP_DONTFRAG: OPTSET(INP_DONTFRAG); break; -#if defined(IP_NONLOCALBIND) - case IP_NONLOCALOK: - OPTSET(INP_NONLOCALOK); + case IP_BINDANY: + OPTSET(INP_BINDANY); break; -#endif } break; #undef OPTSET Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet/raw_ip.c Mon Jun 1 10:30:00 2009 (r193217) @@ -853,15 +853,16 @@ rip_bind(struct socket *so, struct socka if (error != 0) return (error); + inp = sotoinpcb(so); + KASSERT(inp != NULL, ("rip_bind: inp == NULL")); + if (TAILQ_EMPTY(&V_ifnet) || (addr->sin_family != AF_INET && addr->sin_family != AF_IMPLINK) || (addr->sin_addr.s_addr && - ifa_ifwithaddr((struct sockaddr *)addr) == 0)) + (inp->inp_flags & INP_BINDANY) == 0 && + ifa_ifwithaddr((struct sockaddr *)addr) == NULL)) return (EADDRNOTAVAIL); - inp = sotoinpcb(so); - KASSERT(inp != NULL, ("rip_bind: inp == NULL")); - INP_INFO_WLOCK(&V_ripcbinfo); INP_WLOCK(inp); rip_delhash(inp); Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet6/in6.h Mon Jun 1 10:30:00 2009 (r193217) @@ -477,6 +477,8 @@ struct route_in6 { * the source address. */ +#define IPV6_BINDANY 64 /* bool: allow bind to any address */ + /* * The following option is private; do not use it from user applications. * It is deliberately defined to the same value as IP_MSFILTER. Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet6/in6_pcb.c Mon Jun 1 10:30:00 2009 (r193217) @@ -163,11 +163,13 @@ in6_pcbbind(register struct inpcb *inp, if (so->so_options & SO_REUSEADDR) reuseport = SO_REUSEADDR|SO_REUSEPORT; } else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { - struct ifaddr *ia = NULL; + struct ifaddr *ia; sin6->sin6_port = 0; /* yech... */ - if ((ia = ifa_ifwithaddr((struct sockaddr *)sin6)) == 0) + if ((ia = ifa_ifwithaddr((struct sockaddr *)sin6)) == NULL && + (inp->inp_flags & INP_BINDANY) == 0) { return (EADDRNOTAVAIL); + } /* * XXX: bind to an anycast address might accidentally Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet6/ip6_output.c Mon Jun 1 10:30:00 2009 (r193217) @@ -1405,6 +1405,14 @@ ip6_ctloutput(struct socket *so, struct case IPV6_RECVTCLASS: case IPV6_V6ONLY: case IPV6_AUTOFLOWLABEL: + case IPV6_BINDANY: + if (optname == IPV6_BINDANY && td != NULL) { + error = priv_check(td, + PRIV_NETINET_BINDANY); + if (error) + break; + } + if (optlen != sizeof(int)) { error = EINVAL; break; @@ -1558,6 +1566,9 @@ do { \ OPTSET(IN6P_AUTOFLOWLABEL); break; + case IPV6_BINDANY: + OPTSET(INP_BINDANY); + break; } break; @@ -1831,6 +1842,10 @@ do { \ case IPV6_AUTOFLOWLABEL: optval = OPTBIT(IN6P_AUTOFLOWLABEL); break; + + case IPV6_BINDANY: + optval = OPTBIT(INP_BINDANY); + break; } if (error) break; Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/sys/priv.h Mon Jun 1 10:30:00 2009 (r193217) @@ -374,6 +374,7 @@ #define PRIV_NETINET_IPSEC 503 /* Administer IPSEC. */ #define PRIV_NETINET_REUSEPORT 504 /* Allow [rapid] port/address reuse. */ #define PRIV_NETINET_SETHDROPTS 505 /* Set certain IPv4/6 header options. */ +#define PRIV_NETINET_BINDANY 506 /* Allow bind to any address. */ /* * IPX/SPX privileges. From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 10:30:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09A441065680; Mon, 1 Jun 2009 10:30:53 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBD238FC08; Mon, 1 Jun 2009 10:30:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51AUqw8072811; Mon, 1 Jun 2009 10:30:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51AUqiN072810; Mon, 1 Jun 2009 10:30:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200906011030.n51AUqiN072810@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 1 Jun 2009 10:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193218 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 10:30:53 -0000 Author: pjd Date: Mon Jun 1 10:30:52 2009 New Revision: 193218 URL: http://svn.freebsd.org/changeset/base/193218 Log: Document IP_BINDANY IP socket option. Reviewed by: brueffer Modified: head/share/man/man4/ip.4 Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Mon Jun 1 10:30:00 2009 (r193217) +++ head/share/man/man4/ip.4 Mon Jun 1 10:30:52 2009 (r193218) @@ -32,7 +32,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd March 9, 2009 +.Dd June 1, 2009 .Dt IP 4 .Os .Sh NAME @@ -243,6 +243,23 @@ socket level option, otherwise the .Dv IP_ONESBCAST option has no effect. .Pp If the +.Dv IP_BINDANY +option is enabled on a +.Dv SOCK_STREAM , +.Dv SOCK_DGRAM +or a +.Dv SOCK_RAW +socket, one can +.Xr bind 2 +to any address, even one not bound to any available network interface in the +system. +This functionality (in conjunction with special firewall rules) can be used for +implementing a transparent proxy. +The +.Dv PRIV_NETINET_BINDANY +privilege is needed to set this option. +.Pp +If the .Dv IP_RECVTTL option is enabled on a .Dv SOCK_DGRAM From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 10:41:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF681106564A; Mon, 1 Jun 2009 10:41:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A4F38FC16; Mon, 1 Jun 2009 10:41:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51AfcNl073052; Mon, 1 Jun 2009 10:41:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51AfcUu073049; Mon, 1 Jun 2009 10:41:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906011041.n51AfcUu073049@svn.freebsd.org> From: Robert Watson Date: Mon, 1 Jun 2009 10:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193219 - in head/sys: kern net netatalk netinet netinet6 netipsec netipx netnatm sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 10:41:39 -0000 Author: rwatson Date: Mon Jun 1 10:41:38 2009 New Revision: 193219 URL: http://svn.freebsd.org/changeset/base/193219 Log: Reimplement the netisr framework in order to support parallel netisr threads: - Support up to one netisr thread per CPU, each processings its own workstream, or set of per-protocol queues. Threads may be bound to specific CPUs, or allowed to migrate, based on a global policy. In the future it would be desirable to support topology-centric policies, such as "one netisr per package". - Allow each protocol to advertise an ordering policy, which can currently be one of: NETISR_POLICY_SOURCE: packets must maintain ordering with respect to an implicit or explicit source (such as an interface or socket). NETISR_POLICY_FLOW: make use of mbuf flow identifiers to place work, as well as allowing protocols to provide a flow generation function for mbufs without flow identifers (m2flow). Falls back on NETISR_POLICY_SOURCE if now flow ID is available. NETISR_POLICY_CPU: allow protocols to inspect and assign a CPU for each packet handled by netisr (m2cpuid). - Provide utility functions for querying the number of workstreams being used, as well as a mapping function from workstream to CPU ID, which protocols may use in work placement decisions. - Add explicit interfaces to get and set per-protocol queue limits, and get and clear drop counters, which query data or apply changes across all workstreams. - Add a more extensible netisr registration interface, in which protocols declare 'struct netisr_handler' structures for each registered NETISR_ type. These include name, handler function, optional mbuf to flow ID function, optional mbuf to CPU ID function, queue limit, and ordering policy. Padding is present to allow these to be expanded in the future. If no queue limit is declared, then a default is used. - Queue limits are now per-workstream, and raised from the previous IFQ_MAXLEN default of 50 to 256. - All protocols are updated to use the new registration interface, and with the exception of netnatm, default queue limits. Most protocols register as NETISR_POLICY_SOURCE, except IPv4 and IPv6, which use NETISR_POLICY_FLOW, and will therefore take advantage of driver- generated flow IDs if present. - Formalize a non-packet based interface between interface polling and the netisr, rather than having polling pretend to be two protocols. Provide two explicit hooks in the netisr worker for start and end events for runs: netisr_poll() and netisr_pollmore(), as well as a function, netisr_sched_poll(), to allow the polling code to schedule netisr execution. DEVICE_POLLING still embeds single-netisr assumptions in its implementation, so for now if it is compiled into the kernel, a single and un-bound netisr thread is enforced regardless of tunable configuration. In the default configuration, the new netisr implementation maintains the same basic assumptions as the previous implementation: a single, un-bound worker thread processes all deferred work, and direct dispatch is enabled by default wherever possible. Performance measurement shows a marginal performance improvement over the old implementation due to the use of batched dequeue. An rmlock is used to synchronize use and registration/unregistration using the framework; currently, synchronized use is disabled (replicating current netisr policy) due to a measurable 3%-6% hit in ping-pong micro-benchmarking. It will be enabled once further rmlock optimization has taken place. However, in practice, netisrs are rarely registered or unregistered at runtime. A new man page for netisr will follow, but since one doesn't currently exist, it hasn't been updated. This change is not appropriate for MFC, although the polling shutdown handler should be merged to 7-STABLE. Bump __FreeBSD_version. Reviewed by: bz Modified: head/sys/kern/kern_poll.c head/sys/net/netisr.c head/sys/net/netisr.h head/sys/net/rtsock.c head/sys/netatalk/ddp_usrreq.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_input.c head/sys/netinet6/ip6_input.c head/sys/netinet6/vinet6.h head/sys/netipsec/ipsec_input.c head/sys/netipx/ipx_input.c head/sys/netnatm/natm_proto.c head/sys/sys/param.h head/sys/sys/pcpu.h Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Mon Jun 1 10:30:52 2009 (r193218) +++ head/sys/kern/kern_poll.c Mon Jun 1 10:41:38 2009 (r193219) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include /* needed by net/if.h */ #include @@ -48,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -static void netisr_poll(void); /* the two netisr handlers */ -static void netisr_pollmore(void); static int poll_switch(SYSCTL_HANDLER_ARGS); void hardclock_device_poll(void); /* hook from hardclock */ @@ -110,6 +109,10 @@ SYSCTL_NODE(_kern, OID_AUTO, polling, CT SYSCTL_UINT(_kern_polling, OID_AUTO, burst, CTLFLAG_RD, &poll_burst, 0, "Current polling burst size"); +static int netisr_poll_scheduled; +static int netisr_pollmore_scheduled; +static int poll_shutting_down; + static int poll_burst_max_sysctl(SYSCTL_HANDLER_ARGS) { uint32_t val = poll_burst_max; @@ -260,12 +263,19 @@ struct pollrec { static struct pollrec pr[POLL_LIST_LEN]; static void +poll_shutdown(void *arg, int howto) +{ + + poll_shutting_down = 1; +} + +static void init_device_poll(void) { mtx_init(&poll_mtx, "polling", NULL, MTX_DEF); - netisr_register(NETISR_POLL, (netisr_t *)netisr_poll, NULL, 0); - netisr_register(NETISR_POLLMORE, (netisr_t *)netisr_pollmore, NULL, 0); + EVENTHANDLER_REGISTER(shutdown_post_sync, poll_shutdown, NULL, + SHUTDOWN_PRI_LAST); } SYSINIT(device_poll, SI_SUB_CLOCKS, SI_ORDER_MIDDLE, init_device_poll, NULL); @@ -289,7 +299,7 @@ hardclock_device_poll(void) static struct timeval prev_t, t; int delta; - if (poll_handlers == 0) + if (poll_handlers == 0 || poll_shutting_down) return; microuptime(&t); @@ -314,7 +324,9 @@ hardclock_device_poll(void) if (phase != 0) suspect++; phase = 1; - schednetisrbits(1 << NETISR_POLL | 1 << NETISR_POLLMORE); + netisr_poll_scheduled = 1; + netisr_pollmore_scheduled = 1; + netisr_sched_poll(); phase = 2; } if (pending_polls++ > 0) @@ -365,9 +377,16 @@ netisr_pollmore() int kern_load; mtx_lock(&poll_mtx); + if (!netisr_pollmore_scheduled) { + mtx_unlock(&poll_mtx); + return; + } + netisr_pollmore_scheduled = 0; phase = 5; if (residual_burst > 0) { - schednetisrbits(1 << NETISR_POLL | 1 << NETISR_POLLMORE); + netisr_poll_scheduled = 1; + netisr_pollmore_scheduled = 1; + netisr_sched_poll(); mtx_unlock(&poll_mtx); /* will run immediately on return, followed by netisrs */ return; @@ -397,23 +416,29 @@ netisr_pollmore() poll_burst -= (poll_burst / 8); if (poll_burst < 1) poll_burst = 1; - schednetisrbits(1 << NETISR_POLL | 1 << NETISR_POLLMORE); + netisr_poll_scheduled = 1; + netisr_pollmore_scheduled = 1; + netisr_sched_poll(); phase = 6; } mtx_unlock(&poll_mtx); } /* - * netisr_poll is scheduled by schednetisr when appropriate, typically once - * per tick. + * netisr_poll is typically scheduled once per tick. */ -static void +void netisr_poll(void) { int i, cycles; enum poll_cmd arg = POLL_ONLY; mtx_lock(&poll_mtx); + if (!netisr_poll_scheduled) { + mtx_unlock(&poll_mtx); + return; + } + netisr_poll_scheduled = 0; phase = 3; if (residual_burst == 0) { /* first call in this tick */ microuptime(&poll_start_t); Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Mon Jun 1 10:30:52 2009 (r193218) +++ head/sys/net/netisr.c Mon Jun 1 10:41:38 2009 (r193219) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2001,2002,2003 Jonathan Lemon - * Copyright (c) 1997, Stefan Esser + * Copyright (c) 2007-2009 Robert N. M. Watson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,230 +22,1103 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * netisr is a packet dispatch service, allowing synchronous (directly + * dispatched) and asynchronous (deferred dispatch) processing of packets by + * registered protocol handlers. Callers pass a protocol identifier and + * packet to netisr, along with a direct dispatch hint, and work will either + * be immediately processed with the registered handler, or passed to a + * kernel software interrupt (SWI) thread for deferred dispatch. Callers + * will generally select one or the other based on: + * + * - Might directly dispatching a netisr handler lead to code reentrance or + * lock recursion, such as entering the socket code from the socket code. + * - Might directly dispatching a netisr handler lead to recursive + * processing, such as when decapsulating several wrapped layers of tunnel + * information (IPSEC within IPSEC within ...). * - * $FreeBSD$ + * Maintaining ordering for protocol streams is a critical design concern. + * Enforcing ordering limits the opportunity for concurrency, but maintains + * the strong ordering requirements found in some protocols, such as TCP. Of + * related concern is CPU affinity--it is desirable to process all data + * associated with a particular stream on the same CPU over time in order to + * avoid acquiring locks associated with the connection on different CPUs, + * keep connection data in one cache, and to generally encourage associated + * user threads to live on the same CPU as the stream. It's also desirable + * to avoid lock migration and contention where locks are associated with + * more than one flow. + * + * netisr supports several policy variations, represented by the + * NETISR_POLICY_* constants, allowing protocols to play a varying role in + * identifying flows, assigning work to CPUs, etc. These are described in + * detail in netisr.h. */ +#include "opt_ddb.h" #include "opt_device_polling.h" #include #include -#include -#include -#include #include #include +#include #include -#include +#include +#include #include -#include -#include +#include +#include +#include +#include #include -#include +#include #include -#include -#include -#include -#include -#include +#ifdef DDB +#include +#endif #include -#include #include #include -volatile unsigned int netisr; /* scheduling bits for network */ +/*- + * Synchronize use and modification of the registered netisr data structures; + * acquire a read lock while modifying the set of registered protocols to + * prevent partially registered or unregistered protocols from being run. + * + * The following data structures and fields are protected by this lock: + * + * - The np array, including all fields of struct netisr_proto. + * - The nws array, including all fields of struct netisr_worker. + * - The nws_array array. + * + * Note: the NETISR_LOCKING define controls whether read locks are acquired + * in packet processing paths requiring netisr registration stability. This + * is disabled by default as it can lead to a measurable performance + * degradation even with rmlocks (3%-6% for loopback ping-pong traffic), and + * because netisr registration and unregistration is extremely rare at + * runtime. If it becomes more common, this decision should be revisited. + * + * XXXRW: rmlocks don't support assertions. + */ +static struct rmlock netisr_rmlock; +#define NETISR_LOCK_INIT() rm_init_flags(&netisr_rmlock, "netisr", \ + RM_NOWITNESS) +#define NETISR_LOCK_ASSERT() +#define NETISR_RLOCK(tracker) rm_rlock(&netisr_rmlock, (tracker)) +#define NETISR_RUNLOCK(tracker) rm_runlock(&netisr_rmlock, (tracker)) +#define NETISR_WLOCK() rm_wlock(&netisr_rmlock) +#define NETISR_WUNLOCK() rm_wunlock(&netisr_rmlock) +/* #define NETISR_LOCKING */ + +SYSCTL_NODE(_net, OID_AUTO, isr, CTLFLAG_RW, 0, "netisr"); + +/*- + * Three direct dispatch policies are supported: + * + * - Always defer: all work is scheduled for a netisr, regardless of context. + * (!direct) + * + * - Hybrid: if the executing context allows direct dispatch, and we're + * running on the CPU the work would be done on, then direct dispatch if it + * wouldn't violate ordering constraints on the workstream. + * (direct && !direct_force) + * + * - Always direct: if the executing context allows direct dispatch, always + * direct dispatch. (direct && direct_force) + * + * Notice that changing the global policy could lead to short periods of + * misordered processing, but this is considered acceptable as compared to + * the complexity of enforcing ordering during policy changes. + */ +static int netisr_direct_force = 1; /* Always direct dispatch. */ +TUNABLE_INT("net.isr.direct_force", &netisr_direct_force); +SYSCTL_INT(_net_isr, OID_AUTO, direct_force, CTLFLAG_RW, + &netisr_direct_force, 0, "Force direct dispatch"); + +static int netisr_direct = 1; /* Enable direct dispatch. */ +TUNABLE_INT("net.isr.direct", &netisr_direct); +SYSCTL_INT(_net_isr, OID_AUTO, direct, CTLFLAG_RW, + &netisr_direct, 0, "Enable direct dispatch"); + +/* + * Allow the administrator to limit the number of threads (CPUs) to use for + * netisr. We don't check netisr_maxthreads before creating the thread for + * CPU 0, so in practice we ignore values <= 1. This must be set at boot. + * We will create at most one thread per CPU. + */ +static int netisr_maxthreads = 1; /* Max number of threads. */ +TUNABLE_INT("net.isr.maxthreads", &netisr_maxthreads); +SYSCTL_INT(_net_isr, OID_AUTO, maxthreads, CTLFLAG_RD, + &netisr_maxthreads, 0, + "Use at most this many CPUs for netisr processing"); + +static int netisr_bindthreads = 0; /* Bind threads to CPUs. */ +TUNABLE_INT("net.isr.bindthreads", &netisr_bindthreads); +SYSCTL_INT(_net_isr, OID_AUTO, bindthreads, CTLFLAG_RD, + &netisr_bindthreads, 0, "Bind netisr threads to CPUs."); + +/* + * Limit per-workstream queues to at most net.isr.maxqlimit, both for initial + * configuration and later modification using netisr_setqlimit(). + */ +#define NETISR_DEFAULT_MAXQLIMIT 10240 +static u_int netisr_maxqlimit = NETISR_DEFAULT_MAXQLIMIT; +TUNABLE_INT("net.isr.maxqlimit", &netisr_maxqlimit); +SYSCTL_INT(_net_isr, OID_AUTO, maxqlimit, CTLFLAG_RD, + &netisr_maxqlimit, 0, + "Maximum netisr per-protocol, per-CPU queue depth."); + +/* + * The default per-workstream queue limit for protocols that don't initialize + * the nh_qlimit field of their struct netisr_handler. If this is set above + * netisr_maxqlimit, we truncate it to the maximum during boot. + */ +#define NETISR_DEFAULT_DEFAULTQLIMIT 256 +static u_int netisr_defaultqlimit = NETISR_DEFAULT_DEFAULTQLIMIT; +TUNABLE_INT("net.isr.defaultqlimit", &netisr_defaultqlimit); +SYSCTL_INT(_net_isr, OID_AUTO, defaultqlimit, CTLFLAG_RD, + &netisr_defaultqlimit, 0, + "Default netisr per-protocol, per-CPU queue limit if not set by protocol"); + +/* + * Each protocol is described by a struct netisr_proto, which holds all + * global per-protocol information. This data structure is set up by + * netisr_register(), and derived from the public struct netisr_handler. + */ +struct netisr_proto { + const char *np_name; /* Character string protocol name. */ + netisr_handler_t *np_handler; /* Protocol handler. */ + netisr_m2flow_t *np_m2flow; /* Query flow for untagged packet. */ + netisr_m2cpuid_t *np_m2cpuid; /* Query CPU to process packet on. */ + u_int np_qlimit; /* Maximum per-CPU queue depth. */ + u_int np_policy; /* Work placement policy. */ +}; + +#define NETISR_MAXPROT 32 /* Compile-time limit. */ + +/* + * The np array describes all registered protocols, indexed by protocol + * number. + */ +static struct netisr_proto np[NETISR_MAXPROT]; + +/* + * Protocol-specific work for each workstream is described by struct + * netisr_work. Each work descriptor consists of an mbuf queue and + * statistics. + */ +struct netisr_work { + /* + * Packet queue, linked by m_nextpkt. + */ + struct mbuf *nw_head; + struct mbuf *nw_tail; + u_int nw_len; + u_int nw_qlimit; + u_int nw_watermark; + + /* + * Statistics -- written unlocked, but mostly from curcpu. + */ + u_int64_t nw_dispatched; /* Number of direct dispatches. */ + u_int64_t nw_hybrid_dispatched; /* "" hybrid dispatches. */ + u_int64_t nw_qdrops; /* "" drops. */ + u_int64_t nw_queued; /* "" enqueues. */ + u_int64_t nw_handled; /* "" handled in worker. */ +}; + +/* + * Workstreams hold a set of ordered work across each protocol, and are + * described by netisr_workstream. Each workstream is associated with a + * worker thread, which in turn is pinned to a CPU. Work associated with a + * workstream can be processd in other threads during direct dispatch; + * concurrent processing is prevented by the NWS_RUNNING flag, which + * indicates that a thread is already processing the work queue. + */ +struct netisr_workstream { + struct intr_event *nws_intr_event; /* Handler for stream. */ + void *nws_swi_cookie; /* swi(9) cookie for stream. */ + struct mtx nws_mtx; /* Synchronize work. */ + u_int nws_cpu; /* CPU pinning. */ + u_int nws_flags; /* Wakeup flags. */ + u_int nws_pendingbits; /* Scheduled protocols. */ + + /* + * Each protocol has per-workstream data. + */ + struct netisr_work nws_work[NETISR_MAXPROT]; +} __aligned(CACHE_LINE_SIZE); + +/* + * Per-CPU workstream data, indexed by CPU ID. + */ +static struct netisr_workstream nws[MAXCPU]; + +/* + * Map contiguous values between 0 and nws_count into CPU IDs appropriate for + * indexing the nws[] array. This allows constructions of the form + * nws[nws_array(arbitraryvalue % nws_count)]. + */ +static u_int nws_array[MAXCPU]; + +/* + * Number of registered workstreams. Will be at most the number of running + * CPUs once fully started. + */ +static u_int nws_count; +SYSCTL_INT(_net_isr, OID_AUTO, numthreads, CTLFLAG_RD, + &nws_count, 0, "Number of extant netisr threads."); + +/* + * Per-workstream flags. + */ +#define NWS_RUNNING 0x00000001 /* Currently running in a thread. */ +#define NWS_DISPATCHING 0x00000002 /* Currently being direct-dispatched. */ +#define NWS_SCHEDULED 0x00000004 /* Signal issued. */ + +/* + * Synchronization for each workstream: a mutex protects all mutable fields + * in each stream, including per-protocol state (mbuf queues). The SWI is + * woken up if asynchronous dispatch is required. + */ +#define NWS_LOCK(s) mtx_lock(&(s)->nws_mtx) +#define NWS_LOCK_ASSERT(s) mtx_assert(&(s)->nws_mtx, MA_OWNED) +#define NWS_UNLOCK(s) mtx_unlock(&(s)->nws_mtx) +#define NWS_SIGNAL(s) swi_sched((s)->nws_swi_cookie, 0) -struct netisr { - netisr_t *ni_handler; - struct ifqueue *ni_queue; - int ni_flags; -} netisrs[32]; +/* + * Utility routines for protocols that implement their own mapping of flows + * to CPUs. + */ +u_int +netisr_get_cpucount(void) +{ + + return (nws_count); +} -static void *net_ih; +u_int +netisr_get_cpuid(u_int cpunumber) +{ + + KASSERT(cpunumber < nws_count, ("%s: %u > %u", __func__, cpunumber, + nws_count)); + + return (nws_array[cpunumber]); +} + +/* + * The default implementation of -> CPU ID mapping. + * + * Non-static so that protocols can use it to map their own work to specific + * CPUs in a manner consistent to netisr for affinity purposes. + */ +u_int +netisr_default_flow2cpu(u_int flowid) +{ + return (nws_array[flowid % nws_count]); +} + +/* + * Register a new netisr handler, which requires initializing per-protocol + * fields for each workstream. All netisr work is briefly suspended while + * the protocol is installed. + */ void -legacy_setsoftnet(void) +netisr_register(const struct netisr_handler *nhp) { - swi_sched(net_ih, 0); + struct netisr_work *npwp; + const char *name; + u_int i, proto; + + proto = nhp->nh_proto; + name = nhp->nh_name; + + /* + * Test that the requested registration is valid. + */ + KASSERT(nhp->nh_name != NULL, + ("%s: nh_name NULL for %u", __func__, proto)); + KASSERT(nhp->nh_handler != NULL, + ("%s: nh_handler NULL for %s", __func__, name)); + KASSERT(nhp->nh_policy == NETISR_POLICY_SOURCE || + nhp->nh_policy == NETISR_POLICY_FLOW || + nhp->nh_policy == NETISR_POLICY_CPU, + ("%s: unsupported nh_policy %u for %s", __func__, + nhp->nh_policy, name)); + KASSERT(nhp->nh_policy == NETISR_POLICY_FLOW || + nhp->nh_m2flow == NULL, + ("%s: nh_policy != FLOW but m2flow defined for %s", __func__, + name)); + KASSERT(nhp->nh_policy == NETISR_POLICY_CPU || nhp->nh_m2cpuid == NULL, + ("%s: nh_policy != CPU but m2cpuid defined for %s", __func__, + name)); + KASSERT(nhp->nh_policy != NETISR_POLICY_CPU || nhp->nh_m2cpuid != NULL, + ("%s: nh_policy == CPU but m2cpuid not defined for %s", __func__, + name)); + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u, %s): protocol too big", __func__, proto, name)); + + /* + * Test that no existing registration exists for this protocol. + */ + NETISR_WLOCK(); + KASSERT(np[proto].np_name == NULL, + ("%s(%u, %s): name present", __func__, proto, name)); + KASSERT(np[proto].np_handler == NULL, + ("%s(%u, %s): handler present", __func__, proto, name)); + + np[proto].np_name = name; + np[proto].np_handler = nhp->nh_handler; + np[proto].np_m2flow = nhp->nh_m2flow; + np[proto].np_m2cpuid = nhp->nh_m2cpuid; + if (nhp->nh_qlimit == 0) + np[proto].np_qlimit = netisr_defaultqlimit; + else if (nhp->nh_qlimit > netisr_maxqlimit) { + printf("%s: %s requested queue limit %u capped to " + "net.isr.maxqlimit %u\n", __func__, name, nhp->nh_qlimit, + netisr_maxqlimit); + np[proto].np_qlimit = netisr_maxqlimit; + } else + np[proto].np_qlimit = nhp->nh_qlimit; + np[proto].np_policy = nhp->nh_policy; + for (i = 0; i < MAXCPU; i++) { + npwp = &nws[i].nws_work[proto]; + bzero(npwp, sizeof(*npwp)); + npwp->nw_qlimit = np[proto].np_qlimit; + } + NETISR_WUNLOCK(); } +/* + * Clear drop counters across all workstreams for a protocol. + */ void -netisr_register(int num, netisr_t *handler, struct ifqueue *inq, int flags) +netisr_clearqdrops(const struct netisr_handler *nhp) { - - KASSERT(!(num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs))), - ("bad isr %d", num)); - KASSERT(flags == 0, ("netisr_register: bad flags 0x%x\n", flags)); - netisrs[num].ni_handler = handler; - netisrs[num].ni_queue = inq; - netisrs[num].ni_flags = flags; + struct netisr_work *npwp; +#ifdef INVARIANTS + const char *name; +#endif + u_int i, proto; + + proto = nhp->nh_proto; +#ifdef INVARIANTS + name = nhp->nh_name; +#endif + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, name)); + + NETISR_WLOCK(); + KASSERT(np[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + name)); + + for (i = 0; i < MAXCPU; i++) { + npwp = &nws[i].nws_work[proto]; + npwp->nw_qdrops = 0; + } + NETISR_WUNLOCK(); } +/* + * Query the current drop counters across all workstreams for a protocol. + */ void -netisr_unregister(int num) +netisr_getqdrops(const struct netisr_handler *nhp, u_int64_t *qdropp) { - struct netisr *ni; - - KASSERT(!(num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs))), - ("bad isr %d", num)); - ni = &netisrs[num]; - ni->ni_handler = NULL; - if (ni->ni_queue != NULL) - IF_DRAIN(ni->ni_queue); - ni->ni_queue = NULL; + struct netisr_work *npwp; + struct rm_priotracker tracker; +#ifdef INVARIANTS + const char *name; +#endif + u_int i, proto; + + *qdropp = 0; + proto = nhp->nh_proto; +#ifdef INVARIANTS + name = nhp->nh_name; +#endif + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, name)); + + NETISR_RLOCK(&tracker); + KASSERT(np[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + name)); + + for (i = 0; i < MAXCPU; i++) { + npwp = &nws[i].nws_work[proto]; + *qdropp += npwp->nw_qdrops; + } + NETISR_RUNLOCK(&tracker); } -struct isrstat { - int isrs_count; /* dispatch count */ - int isrs_directed; /* ...directly dispatched */ - int isrs_deferred; /* ...queued instead */ - int isrs_queued; /* intentionally queueued */ - int isrs_drop; /* dropped 'cuz no handler */ - int isrs_swi_count; /* swi_net handlers called */ -}; -static struct isrstat isrstat; +/* + * Query the current queue limit for per-workstream queues for a protocol. + */ +void +netisr_getqlimit(const struct netisr_handler *nhp, u_int *qlimitp) +{ + struct rm_priotracker tracker; +#ifdef INVARIANTS + const char *name; +#endif + u_int proto; -SYSCTL_NODE(_net, OID_AUTO, isr, CTLFLAG_RW, 0, "netisr counters"); + proto = nhp->nh_proto; +#ifdef INVARIANTS + name = nhp->nh_name; +#endif + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, name)); -static int netisr_direct = 1; -SYSCTL_INT(_net_isr, OID_AUTO, direct, CTLFLAG_RW, - &netisr_direct, 0, "enable direct dispatch"); -TUNABLE_INT("net.isr.direct", &netisr_direct); + NETISR_RLOCK(&tracker); + KASSERT(np[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + name)); + *qlimitp = np[proto].np_qlimit; + NETISR_RUNLOCK(&tracker); +} + +/* + * Update the queue limit across per-workstream queues for a protocol. We + * simply change the limits, and don't drain overflowed packets as they will + * (hopefully) take care of themselves shortly. + */ +int +netisr_setqlimit(const struct netisr_handler *nhp, u_int qlimit) +{ + struct netisr_work *npwp; +#ifdef INVARIANTS + const char *name; +#endif + u_int i, proto; + + if (qlimit > netisr_maxqlimit) + return (EINVAL); + + proto = nhp->nh_proto; +#ifdef INVARIANTS + name = nhp->nh_name; +#endif + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, name)); + + NETISR_WLOCK(); + KASSERT(np[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + name)); + + np[proto].np_qlimit = qlimit; + for (i = 0; i < MAXCPU; i++) { + npwp = &nws[i].nws_work[proto]; + npwp->nw_qlimit = qlimit; + } + NETISR_WUNLOCK(); + return (0); +} -SYSCTL_INT(_net_isr, OID_AUTO, count, CTLFLAG_RD, - &isrstat.isrs_count, 0, ""); -SYSCTL_INT(_net_isr, OID_AUTO, directed, CTLFLAG_RD, - &isrstat.isrs_directed, 0, ""); -SYSCTL_INT(_net_isr, OID_AUTO, deferred, CTLFLAG_RD, - &isrstat.isrs_deferred, 0, ""); -SYSCTL_INT(_net_isr, OID_AUTO, queued, CTLFLAG_RD, - &isrstat.isrs_queued, 0, ""); -SYSCTL_INT(_net_isr, OID_AUTO, drop, CTLFLAG_RD, - &isrstat.isrs_drop, 0, ""); -SYSCTL_INT(_net_isr, OID_AUTO, swi_count, CTLFLAG_RD, - &isrstat.isrs_swi_count, 0, ""); - -/* - * Process all packets currently present in a netisr queue. Used to - * drain an existing set of packets waiting for processing when we - * begin direct dispatch, to avoid processing packets out of order. +/* + * Drain all packets currently held in a particular protocol work queue. */ static void -netisr_processqueue(struct netisr *ni) +netisr_drain_proto(struct netisr_work *npwp) { struct mbuf *m; - for (;;) { - IF_DEQUEUE(ni->ni_queue, m); - if (m == NULL) - break; - VNET_ASSERT(m->m_pkthdr.rcvif != NULL); - CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); - ni->ni_handler(m); - CURVNET_RESTORE(); + /* + * We would assert the lock on the workstream but it's not passed in. + */ + while ((m = npwp->nw_head) != NULL) { + npwp->nw_head = m->m_nextpkt; + m->m_nextpkt = NULL; + if (npwp->nw_head == NULL) + npwp->nw_tail = NULL; + npwp->nw_len--; + m_freem(m); } + KASSERT(npwp->nw_tail == NULL, ("%s: tail", __func__)); + KASSERT(npwp->nw_len == 0, ("%s: len", __func__)); } /* - * Call the netisr directly instead of queueing the packet, if possible. + * Remove the registration of a network protocol, which requires clearing + * per-protocol fields across all workstreams, including freeing all mbufs in + * the queues at time of unregister. All work in netisr is briefly suspended + * while this takes place. */ void -netisr_dispatch(int num, struct mbuf *m) +netisr_unregister(const struct netisr_handler *nhp) { - struct netisr *ni; - - isrstat.isrs_count++; /* XXX redundant */ - KASSERT(!(num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs))), - ("bad isr %d", num)); - ni = &netisrs[num]; - if (ni->ni_queue == NULL) { - isrstat.isrs_drop++; - m_freem(m); - return; + struct netisr_work *npwp; +#ifdef INVARIANTS + const char *name; +#endif + u_int i, proto; + + proto = nhp->nh_proto; +#ifdef INVARIANTS + name = nhp->nh_name; +#endif + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, name)); + + NETISR_WLOCK(); + KASSERT(np[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + name)); + + np[proto].np_name = NULL; + np[proto].np_handler = NULL; + np[proto].np_m2flow = NULL; + np[proto].np_m2cpuid = NULL; + np[proto].np_qlimit = 0; + np[proto].np_policy = 0; + for (i = 0; i < MAXCPU; i++) { + npwp = &nws[i].nws_work[proto]; + netisr_drain_proto(npwp); + bzero(npwp, sizeof(*npwp)); } + NETISR_WUNLOCK(); +} + +/* + * Look up the workstream given a packet and source identifier. Do this by + * checking the protocol's policy, and optionally call out to the protocol + * for assistance if required. + */ +static struct mbuf * +netisr_select_cpuid(struct netisr_proto *npp, uintptr_t source, + struct mbuf *m, u_int *cpuidp) +{ + struct ifnet *ifp; + + NETISR_LOCK_ASSERT(); /* - * Directly dispatch handling of this packet, if permitted by global - * policy. Source ordering is maintained by virtue of callers - * consistently calling one of queued or direct dispatch. + * In the event we have only one worker, shortcut and deliver to it + * without further ado. */ - if (netisr_direct) { - isrstat.isrs_directed++; - ni->ni_handler(m); + if (nws_count == 1) { + *cpuidp = nws_array[0]; + return (m); + } + + /* + * What happens next depends on the policy selected by the protocol. + * If we want to support per-interface policies, we should do that + * here first. + */ + switch (npp->np_policy) { + case NETISR_POLICY_CPU: + return (npp->np_m2cpuid(m, source, cpuidp)); + + case NETISR_POLICY_FLOW: + if (!(m->m_flags & M_FLOWID) && npp->np_m2flow != NULL) { + m = npp->np_m2flow(m, source); + if (m == NULL) + return (NULL); + } + if (m->m_flags & M_FLOWID) { + *cpuidp = + netisr_default_flow2cpu(m->m_pkthdr.flowid); + return (m); + } + /* FALLTHROUGH */ + + case NETISR_POLICY_SOURCE: + ifp = m->m_pkthdr.rcvif; + if (ifp != NULL) + *cpuidp = nws_array[(ifp->if_index + source) % + nws_count]; + else + *cpuidp = nws_array[source % nws_count]; + return (m); + + default: + panic("%s: invalid policy %u for %s", __func__, + npp->np_policy, npp->np_name); + } +} + +/* + * Process packets associated with a workstream and protocol. For reasons of + * fairness, we process up to one complete netisr queue at a time, moving the + * queue to a stack-local queue for processing, but do not loop refreshing + * from the global queue. The caller is responsible for deciding whether to + * loop, and for setting the NWS_RUNNING flag. The passed workstream will be + * locked on entry and relocked before return, but will be released while + * processing. The number of packets processed is returned. + */ +static u_int +netisr_process_workstream_proto(struct netisr_workstream *nwsp, u_int proto) +{ + struct netisr_work local_npw, *npwp; + u_int handled; + struct mbuf *m; + + NETISR_LOCK_ASSERT(); + NWS_LOCK_ASSERT(nwsp); + + KASSERT(nwsp->nws_flags & NWS_RUNNING, + ("%s(%u): not running", __func__, proto)); + KASSERT(proto >= 0 && proto < NETISR_MAXPROT, + ("%s(%u): invalid proto\n", __func__, proto)); + + npwp = &nwsp->nws_work[proto]; + if (npwp->nw_len == 0) + return (0); + + /* + * Move the global work queue to a thread-local work queue. + * + * Notice that this means the effective maximum length of the queue + * is actually twice that of the maximum queue length specified in + * the protocol registration call. + */ + handled = npwp->nw_len; + local_npw = *npwp; + npwp->nw_head = NULL; + npwp->nw_tail = NULL; + npwp->nw_len = 0; + nwsp->nws_pendingbits &= ~(1 << proto); + NWS_UNLOCK(nwsp); + while ((m = local_npw.nw_head) != NULL) { + local_npw.nw_head = m->m_nextpkt; + m->m_nextpkt = NULL; + if (local_npw.nw_head == NULL) + local_npw.nw_tail = NULL; + local_npw.nw_len--; + VNET_ASSERT(m->m_pkthdr.rcvif != NULL); + CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); + np[proto].np_handler(m); + CURVNET_RESTORE(); + } + KASSERT(local_npw.nw_len == 0, + ("%s(%u): len %u", __func__, proto, local_npw.nw_len)); + NWS_LOCK(nwsp); + npwp->nw_handled += handled; + return (handled); +} + +/* + * SWI handler for netisr -- processes prackets in a set of workstreams that + * it owns, woken up by calls to NWS_SIGNAL(). If this workstream is already + * being direct dispatched, go back to sleep and wait for the dispatching + * thread to wake us up again. + */ +static void +swi_net(void *arg) +{ +#ifdef NETISR_LOCKING + struct rm_priotracker tracker; +#endif + struct netisr_workstream *nwsp; + u_int bits, prot; + + nwsp = arg; + +#ifdef DEVICE_POLLING + KASSERT(nws_count == 1, + ("%s: device_polling but nws_count != 1", __func__)); + netisr_poll(); +#endif +#ifdef NETISR_LOCKING + NETISR_RLOCK(&tracker); +#endif + NWS_LOCK(nwsp); + KASSERT(!(nwsp->nws_flags & NWS_RUNNING), ("swi_net: running")); + if (nwsp->nws_flags & NWS_DISPATCHING) + goto out; + nwsp->nws_flags |= NWS_RUNNING; + nwsp->nws_flags &= ~NWS_SCHEDULED; + while ((bits = nwsp->nws_pendingbits) != 0) { + while ((prot = ffs(bits)) != 0) { + prot--; + bits &= ~(1 << prot); + (void)netisr_process_workstream_proto(nwsp, prot); + } + } + nwsp->nws_flags &= ~NWS_RUNNING; +out: + NWS_UNLOCK(nwsp); +#ifdef NETISR_LOCKING + NETISR_RUNLOCK(&tracker); +#endif +#ifdef DEVICE_POLLING + netisr_pollmore(); +#endif +} + +static int +netisr_queue_workstream(struct netisr_workstream *nwsp, u_int proto, + struct netisr_work *npwp, struct mbuf *m, int *dosignalp) +{ + + NWS_LOCK_ASSERT(nwsp); + + *dosignalp = 0; + if (npwp->nw_len < npwp->nw_qlimit) { + m->m_nextpkt = NULL; + if (npwp->nw_head == NULL) { + npwp->nw_head = m; + npwp->nw_tail = m; + } else { + npwp->nw_tail->m_nextpkt = m; + npwp->nw_tail = m; + } + npwp->nw_len++; + if (npwp->nw_len > npwp->nw_watermark) + npwp->nw_watermark = npwp->nw_len; + nwsp->nws_pendingbits |= (1 << proto); + if (!(nwsp->nws_flags & + (NWS_RUNNING | NWS_DISPATCHING | NWS_SCHEDULED))) { + nwsp->nws_flags |= NWS_SCHEDULED; + *dosignalp = 1; /* Defer until unlocked. */ + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 10:50:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DC5E1065675; Mon, 1 Jun 2009 10:50:18 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 312488FC1C; Mon, 1 Jun 2009 10:50:18 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51AoIfl076681; Mon, 1 Jun 2009 10:50:18 GMT (envelope-from rse@svn.freebsd.org) Received: (from rse@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51AoH4n076677; Mon, 1 Jun 2009 10:50:17 GMT (envelope-from rse@svn.freebsd.org) Message-Id: <200906011050.n51AoH4n076677@svn.freebsd.org> From: "Ralf S. Engelschall" Date: Mon, 1 Jun 2009 10:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 10:50:18 -0000 Author: rse Date: Mon Jun 1 10:50:17 2009 New Revision: 193221 URL: http://svn.freebsd.org/changeset/base/193221 Log: be more type correct and align local ckmalloc() with its underlying malloc(3) by using a "size_t" instead of an "int" argument Modified: head/bin/sh/alias.c head/bin/sh/memalloc.c head/bin/sh/memalloc.h head/bin/sh/mkinit.c Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Mon Jun 1 10:49:08 2009 (r193220) +++ head/bin/sh/alias.c Mon Jun 1 10:50:17 2009 (r193221) @@ -97,7 +97,7 @@ setalias(char *name, char *val) ap->val = savestr(val); #else /* hack */ { - int len = strlen(val); + size_t len = strlen(val); ap->val = ckmalloc(len + 2); memcpy(ap->val, val, len); ap->val[len] = ' '; /* fluff */ Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Mon Jun 1 10:49:08 2009 (r193220) +++ head/bin/sh/memalloc.c Mon Jun 1 10:50:17 2009 (r193221) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); */ pointer -ckmalloc(int nbytes) +ckmalloc(size_t nbytes) { pointer p; Modified: head/bin/sh/memalloc.h ============================================================================== --- head/bin/sh/memalloc.h Mon Jun 1 10:49:08 2009 (r193220) +++ head/bin/sh/memalloc.h Mon Jun 1 10:50:17 2009 (r193221) @@ -33,6 +33,8 @@ * $FreeBSD$ */ +#include + struct stackmark { struct stack_block *stackp; char *stacknxt; @@ -46,7 +48,7 @@ extern int stacknleft; extern int sstrnleft; extern int herefd; -pointer ckmalloc(int); +pointer ckmalloc(size_t); pointer ckrealloc(pointer, int); void ckfree(pointer); char *savestr(char *); Modified: head/bin/sh/mkinit.c ============================================================================== --- head/bin/sh/mkinit.c Mon Jun 1 10:49:08 2009 (r193220) +++ head/bin/sh/mkinit.c Mon Jun 1 10:50:17 2009 (r193221) @@ -159,7 +159,7 @@ void addstr(char *, struct text *); void addchar(int, struct text *); void writetext(struct text *, FILE *); FILE *ckfopen(char *, char *); -void *ckmalloc(int); +void *ckmalloc(size_t); char *savestr(char *); void error(char *); @@ -464,7 +464,7 @@ ckfopen(char *file, char *mode) } void * -ckmalloc(int nbytes) +ckmalloc(size_t nbytes) { char *p; From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 11:02:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93A46106564A; Mon, 1 Jun 2009 11:02:10 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8E08FC1B; Mon, 1 Jun 2009 11:02:10 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51B2AIW076965; Mon, 1 Jun 2009 11:02:10 GMT (envelope-from rse@svn.freebsd.org) Received: (from rse@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51B2AFv076962; Mon, 1 Jun 2009 11:02:10 GMT (envelope-from rse@svn.freebsd.org) Message-Id: <200906011102.n51B2AFv076962@svn.freebsd.org> From: "Ralf S. Engelschall" Date: Mon, 1 Jun 2009 11:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193222 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 11:02:11 -0000 Author: rse Date: Mon Jun 1 11:02:09 2009 New Revision: 193222 URL: http://svn.freebsd.org/changeset/base/193222 Log: correctly test for __GNUC__ macro (non-GCC compilers do not have it defined at all) Modified: head/bin/sh/eval.c head/bin/sh/parser.c head/bin/sh/var.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Mon Jun 1 10:50:17 2009 (r193221) +++ head/bin/sh/eval.c Mon Jun 1 11:02:09 2009 (r193222) @@ -594,7 +594,7 @@ evalcommand(union node *cmd, int flags, char *lastarg; int realstatus; int do_clearcmdentry; -#if __GNUC__ +#ifdef __GNUC__ /* Avoid longjmp clobbering */ (void) &argv; (void) &argc; Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Mon Jun 1 10:50:17 2009 (r193221) +++ head/bin/sh/parser.c Mon Jun 1 11:02:09 2009 (r193222) @@ -898,7 +898,7 @@ readtoken1(int firstc, char const *synta int oldstyle; char const *prevsyntax; /* syntax before arithmetic */ int synentry; -#if __GNUC__ +#ifdef __GNUC__ /* Avoid longjmp clobbering */ (void) &out; (void) "ef; @@ -1323,7 +1323,7 @@ parsebackq: { struct jmploc *volatile savehandler; int savelen; int saveprompt; -#if __GNUC__ +#ifdef __GNUC__ /* Avoid longjmp clobbering */ (void) &saveprompt; #endif Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Mon Jun 1 10:50:17 2009 (r193221) +++ head/bin/sh/var.c Mon Jun 1 11:02:09 2009 (r193222) @@ -195,7 +195,7 @@ setvarsafe(char *name, char *val, int fl struct jmploc jmploc; struct jmploc *volatile savehandler = handler; int err = 0; -#if __GNUC__ +#ifdef __GNUC__ /* Avoid longjmp clobbering */ (void) &err; #endif From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 11:11:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2CF91065679; Mon, 1 Jun 2009 11:11:46 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0CDD8FC0A; Mon, 1 Jun 2009 11:11:46 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51BBkcR077176; Mon, 1 Jun 2009 11:11:46 GMT (envelope-from rse@svn.freebsd.org) Received: (from rse@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51BBkZt077175; Mon, 1 Jun 2009 11:11:46 GMT (envelope-from rse@svn.freebsd.org) Message-Id: <200906011111.n51BBkZt077175@svn.freebsd.org> From: "Ralf S. Engelschall" Date: Mon, 1 Jun 2009 11:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193223 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 11:11:47 -0000 Author: rse Date: Mon Jun 1 11:11:46 2009 New Revision: 193223 URL: http://svn.freebsd.org/changeset/base/193223 Log: align coding style with style(9) to avoid misunderstandings Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Mon Jun 1 11:02:09 2009 (r193222) +++ head/bin/sh/exec.c Mon Jun 1 11:11:46 2009 (r193223) @@ -187,7 +187,8 @@ padvance(char **path, char *name) if (*path == NULL) return NULL; start = *path; - for (p = start ; *p && *p != ':' && *p != '%' ; p++); + for (p = start; *p && *p != ':' && *p != '%'; p++) + ; /* nothing */ len = p - start + strlen(name) + 2; /* "2" is for '/' and '\0' */ while (stackblocksize() < len) growstackblock(); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 11:38:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B0C9106564A; Mon, 1 Jun 2009 11:38:39 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 491128FC0C; Mon, 1 Jun 2009 11:38:39 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51BcdAH077728; Mon, 1 Jun 2009 11:38:39 GMT (envelope-from rse@svn.freebsd.org) Received: (from rse@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51BcduU077727; Mon, 1 Jun 2009 11:38:39 GMT (envelope-from rse@svn.freebsd.org) Message-Id: <200906011138.n51BcduU077727@svn.freebsd.org> From: "Ralf S. Engelschall" Date: Mon, 1 Jun 2009 11:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193225 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 11:38:39 -0000 Author: rse Date: Mon Jun 1 11:38:38 2009 New Revision: 193225 URL: http://svn.freebsd.org/changeset/base/193225 Log: use explicit 'unsigned int' instead of just the implicit-style 'unsigned' to make linting tools (e.g. FlexeLint) happy, too Modified: head/bin/sh/mksyntax.c Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Mon Jun 1 11:15:54 2009 (r193224) +++ head/bin/sh/mksyntax.c Mon Jun 1 11:38:38 2009 (r193225) @@ -354,7 +354,7 @@ output_type_macros(void) char **pp; if (digit_contig) - macro[0] = "#define is_digit(c)\t((unsigned)((c) - '0') <= 9)"; + macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)"; for (pp = macro ; *pp ; pp++) fprintf(hfile, "%s\n", *pp); if (digit_contig) From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 13:13:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23AA61065673; Mon, 1 Jun 2009 13:13:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10A748FC16; Mon, 1 Jun 2009 13:13:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51DDl7l079873; Mon, 1 Jun 2009 13:13:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51DDl9f079872; Mon, 1 Jun 2009 13:13:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200906011313.n51DDl9f079872@svn.freebsd.org> From: Alexander Motin Date: Mon, 1 Jun 2009 13:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193228 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 13:13:48 -0000 Author: mav Date: Mon Jun 1 13:13:47 2009 New Revision: 193228 URL: http://svn.freebsd.org/changeset/base/193228 Log: Comment out old Realtek ALC883 quirk, that was disabling phantop power on mic inputs. I have no idea what for it was made that time, but now I have several reports that it should be removed to make microphones work. If this quirk is still required for some systems then they should be identified and specified explicitly. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Jun 1 12:29:27 2009 (r193227) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Jun 1 13:13:47 2009 (r193228) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090401_0132" +#define HDA_DRV_TEST_REV "20090601_0133" SND_DECLARE_FILE("$FreeBSD$"); @@ -4657,6 +4657,7 @@ hdac_vendor_patch_parse(struct hdac_devi } switch (id) { +#if 0 case HDA_CODEC_ALC883: /* * nid: 24/25 = External (jack) or Internal (fixed) Mic. @@ -4686,6 +4687,7 @@ hdac_vendor_patch_parse(struct hdac_devi * nid: 26 = Line-in, leave it alone. */ break; +#endif case HDA_CODEC_AD1983: /* * This codec has several possible usages, but none From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 14:20:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41316106564A; Mon, 1 Jun 2009 14:20:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F6A28FC1A; Mon, 1 Jun 2009 14:20:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51EKEua081351; Mon, 1 Jun 2009 14:20:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51EKEMT081350; Mon, 1 Jun 2009 14:20:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906011420.n51EKEMT081350@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Jun 2009 14:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193229 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 14:20:14 -0000 Author: jhb Date: Mon Jun 1 14:20:13 2009 New Revision: 193229 URL: http://svn.freebsd.org/changeset/base/193229 Log: Add a missing parameter when displaying GPT partitions with an unknown UUID. Submitted by: Pawel Worach pawel.worach | gmail MFC after: 1 week Modified: head/sys/boot/i386/libi386/biosdisk.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Mon Jun 1 13:13:47 2009 (r193228) +++ head/sys/boot/i386/libi386/biosdisk.c Mon Jun 1 14:20:13 2009 (r193229) @@ -387,6 +387,7 @@ bd_printgptpart(struct open_disk *od, st sprintf(line, "%s: FreeBSD swap%s\n", prefix, stats); else sprintf(line, "%s: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x%s\n", + prefix, gp->gp_type.time_low, gp->gp_type.time_mid, gp->gp_type.time_hi_and_version, gp->gp_type.clock_seq_hi_and_reserved, gp->gp_type.clock_seq_low, From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 14:26:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B63A81065679; Mon, 1 Jun 2009 14:26:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 87DE88FC1C; Mon, 1 Jun 2009 14:26:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3B21246B2C; Mon, 1 Jun 2009 10:26:20 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 272DE8A02C; Mon, 1 Jun 2009 10:26:19 -0400 (EDT) From: John Baldwin To: Nathan Whitehorn Date: Mon, 1 Jun 2009 08:22:19 -0400 User-Agent: KMail/1.9.7 References: <200905311002.n4VA2K6c037776@svn.freebsd.org> In-Reply-To: <200905311002.n4VA2K6c037776@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906010822.19951.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 01 Jun 2009 10:26:19 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193159 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 14:26:21 -0000 On Sunday 31 May 2009 6:02:20 am Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun May 31 10:02:20 2009 > New Revision: 193159 > URL: http://svn.freebsd.org/changeset/base/193159 > > Log: > Provide an analogous sysctl to hw.acpi.acline (dev.pmu.0.acline) to > determine whether the computer is plugged in to mains power. I wonder if it would be a good idea to introduce a platform-independent 'acline' sysctl? Something like 'hw.acline'? For now we could simply have these devices create it. We could do something fancier where AC adapter drivers register with a centralized thingie at some point and it exports a global setting that is true so long as at least one adapter is online. I'm not sure that level of complexity is warranted until we have platforms with multiple AC lines exposed to the OS though. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 14:34:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12533106566B; Mon, 1 Jun 2009 14:34:18 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id D73208FC08; Mon, 1 Jun 2009 14:34:17 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 119B034C402; Mon, 1 Jun 2009 10:34:17 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Mon, 01 Jun 2009 10:34:17 -0400 X-Sasl-enc: mYK5NYPLJFqky65JJgaJsviWs4+2TgVMS96Z9l3xtlUR 1243866856 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 4D9EB223B6; Mon, 1 Jun 2009 10:34:16 -0400 (EDT) Message-ID: <4A23E6E4.7020506@incunabulum.net> Date: Mon, 01 Jun 2009 15:34:12 +0100 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Doug Barton References: <200906010537.n515bDou065357@svn.freebsd.org> In-Reply-To: <200906010537.n515bDou065357@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 14:34:18 -0000 Doug Barton wrote: > Log: > Eliminate the warning that "Values of network_interfaces other than > AUTO are deprecated.' There is no good reason to deprecate them, and > setting this to different values can be useful for custom solutions > and/or one-off configuration problems. > Thanks, I wasn't sure what the alternative to this functionality was going to be, and was relying on this mechanism for a product. From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 15:03:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA659106566B; Mon, 1 Jun 2009 15:03:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 985048FC15; Mon, 1 Jun 2009 15:03:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51F3wMF082276; Mon, 1 Jun 2009 15:03:58 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51F3wp5082274; Mon, 1 Jun 2009 15:03:58 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906011503.n51F3wp5082274@svn.freebsd.org> From: Robert Watson Date: Mon, 1 Jun 2009 15:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193230 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 15:03:59 -0000 Author: rwatson Date: Mon Jun 1 15:03:58 2009 New Revision: 193230 URL: http://svn.freebsd.org/changeset/base/193230 Log: Garbage collect NETISR_POLL and NETISR_POLLMORE, which are no longer required for options DEVICE_POLLING. De-fragment the NETISR_ constant space and lower NETISR_MAXPROT from 32 to 16 -- when sizing queue arrays using this compile-time constant, significant amounts of memory are saved. Warn on the console when tunable values for netisr are automatically adjusted during boot due to exceeding limits, invalid values, or as a result of DEVICE_POLLING. Modified: head/sys/net/netisr.c head/sys/net/netisr.h Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Mon Jun 1 14:20:13 2009 (r193229) +++ head/sys/net/netisr.c Mon Jun 1 15:03:58 2009 (r193230) @@ -201,7 +201,7 @@ struct netisr_proto { u_int np_policy; /* Work placement policy. */ }; -#define NETISR_MAXPROT 32 /* Compile-time limit. */ +#define NETISR_MAXPROT 16 /* Compile-time limit. */ /* * The np array describes all registered protocols, indexed by protocol @@ -1045,20 +1045,31 @@ netisr_init(void *arg) KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__)); NETISR_LOCK_INIT(); - if (netisr_maxthreads < 1) + if (netisr_maxthreads < 1) { + printf("netisr2: forcing maxthreads to 1\n"); netisr_maxthreads = 1; - if (netisr_maxthreads > MAXCPU) + } + if (netisr_maxthreads > MAXCPU) { + printf("netisr2: forcing maxthreads to %d\n", MAXCPU); netisr_maxthreads = MAXCPU; - if (netisr_defaultqlimit > netisr_maxqlimit) + } + if (netisr_defaultqlimit > netisr_maxqlimit) { + printf("netisr2: forcing defaultqlimit to %d\n", + netisr_maxqlimit); netisr_defaultqlimit = netisr_maxqlimit; + } #ifdef DEVICE_POLLING /* * The device polling code is not yet aware of how to deal with * multiple netisr threads, so for the time being compiling in device * polling disables parallel netisr workers. */ - netisr_maxthreads = 1; - netisr_bindthreads = 0; + if (netisr_maxthreads != 1 || netisr_bindthreads != 0) { + printf("netisr2: forcing maxthreads to 1 and bindthreads to " + "0 for device polling\n"); + netisr_maxthreads = 1; + netisr_bindthreads = 0; + } #endif netisr_start_swi(curcpu, pcpu_find(curcpu)); Modified: head/sys/net/netisr.h ============================================================================== --- head/sys/net/netisr.h Mon Jun 1 14:20:13 2009 (r193229) +++ head/sys/net/netisr.h Mon Jun 1 15:03:58 2009 (r193230) @@ -39,19 +39,17 @@ * Historically, this was implemented by the BSD software ISR facility; it is * now implemented via a software ithread (SWI). */ -#define NETISR_POLL 0 /* polling callback, must be first */ -#define NETISR_IP 2 /* same as AF_INET */ -#define NETISR_IGMP 3 /* IGMPv3 output queue */ -#define NETISR_ROUTE 14 /* routing socket */ -#define NETISR_AARP 15 /* Appletalk ARP */ -#define NETISR_ATALK2 16 /* Appletalk phase 2 */ -#define NETISR_ATALK1 17 /* Appletalk phase 1 */ -#define NETISR_ARP 18 /* same as AF_LINK */ -#define NETISR_IPX 23 /* same as AF_IPX */ -#define NETISR_ETHER 24 /* ethernet input */ -#define NETISR_IPV6 27 -#define NETISR_NATM 28 -#define NETISR_POLLMORE 31 /* polling callback, must be last */ +#define NETISR_IP 1 +#define NETISR_IGMP 2 /* IGMPv3 output queue */ +#define NETISR_ROUTE 3 /* routing socket */ +#define NETISR_AARP 4 /* Appletalk ARP */ +#define NETISR_ATALK2 5 /* Appletalk phase 2 */ +#define NETISR_ATALK1 6 /* Appletalk phase 1 */ +#define NETISR_ARP 7 /* same as AF_LINK */ +#define NETISR_IPX 8 /* same as AF_IPX */ +#define NETISR_ETHER 9 /* ethernet input */ +#define NETISR_IPV6 10 +#define NETISR_NATM 11 /*- * Protocols express ordering constraints and affinity preferences by From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 15:13:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23DAE106566C; Mon, 1 Jun 2009 15:13:23 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-ew0-f212.google.com (mail-ew0-f212.google.com [209.85.219.212]) by mx1.freebsd.org (Postfix) with ESMTP id BCF3C8FC20; Mon, 1 Jun 2009 15:13:21 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: by ewy8 with SMTP id 8so4429265ewy.43 for ; Mon, 01 Jun 2009 08:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=x8mtx0Q7x/AWJnIR3wU05dajc+dRFedvaJrCkyZaU1c=; b=CMYx9oqU2A1HuNhHMNGnnKU31hReRBUi8aYrwXdO2JYwqPVStD3IS7Gj/a2OYUb8FB k+PnPvgjl5W8dN+SY19X/2jHECQZ2HaO24u2r5CFivFPrQvLD9ZQTOP9qbObEGcpGC5l RHgm9ubI4kfZPBGcfQ0/qQNjWkA1DuYqYEMhg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=OFVqzBwJLwm0XbDTyr0y+Lz+im7dk0ym/NP1y/6P4F0tOKZzbEetuB7aWSMBzER/Lc YZUqGtS6kf7bfbt0ws9lsyM9ZH0gW4nUTfuPM3RBBJIFqJ36nHJtMcRuAz2aKbmpdXOF zomX/46O7ucK2WfYi48iw5XlKYemCoAvzgp7w= Received: by 10.210.120.7 with SMTP id s7mr6472171ebc.67.1243867781244; Mon, 01 Jun 2009 07:49:41 -0700 (PDT) Received: from ?127.0.0.1? (87-194-39-182.bethere.co.uk [87.194.39.182]) by mx.google.com with ESMTPS id 24sm23984eyx.43.2009.06.01.07.49.38 (version=SSLv3 cipher=RC4-MD5); Mon, 01 Jun 2009 07:49:39 -0700 (PDT) From: Tom Evans To: Brooks Davis In-Reply-To: <20090526200925.GA41682@lor.one-eyed-alien.net> References: <200905260822.n4Q8M0Zv051280@svn.freebsd.org> <9bbcef730905260624x289af079ue8524e821c1dc891@mail.gmail.com> <20090526200925.GA41682@lor.one-eyed-alien.net> Content-Type: text/plain Date: Mon, 01 Jun 2009 15:49:38 +0100 Message-Id: <1243867778.9871.78.camel@strangepork.london.mintel.ad> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Robert Watson , Ivan Voras , svn-src-head@FreeBSD.org, Edward Tomasz Napierala Subject: Re: svn commit: r192800 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/common/acl cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/u... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 15:13:23 -0000 On Tue, 2009-05-26 at 15:09 -0500, Brooks Davis wrote: > On Tue, May 26, 2009 at 03:24:05PM +0200, Ivan Voras wrote: > > 2009/5/26 Robert Watson : > > > On Tue, 26 May 2009, Edward Tomasz Napierala wrote: > > > > > >> +/*- > > >> + * Copyright (c) 2008, 2009 Edward Tomasz Napiera??a > > >> + * All rights reserved. > > >> + * > > >> + * Redistribution and use in source and binary forms, with or without > > >> + * modification, are permitted provided that the following conditions > > >> + * are met: > > >> + * 1. Redistributions of source code must retain the above copyright > > >> + * ?? ??notice, this list of conditions and the following disclaimer. > > >> + * 2. Redistributions in binary form must reproduce the above copyright > > >> + * ?? ??notice, this list of conditions and the following disclaimer in the > > >> + * ?? ??documentation and/or other materials provided with the > > >> distribution. > > >> + * > > >> + * ALTHOUGH THIS SOFTWARE IS MADE OF WIN AND SCIENCE, IT IS PROVIDED BY > > >> THE > > > > > > Cute though this BSD license variation is, I'm pretty sure it's not on the > > > approved license list. ??Sticking to the standard license templates > > > potentially saves significant trouble later -- especially when people > > > > Hmm, I'm sure that there exists some SVN magic which would allow > > authors to enter something > > > > $BSDL2 Charlie Root 2008,2009$ > > > > and it expands to a perfect boilerplate on checkout :) > > Such a change would result in a repository filled without license blocks. > This might be appropriate in a corporate setting, but isn't worth > considering here since copies of the repo would lack correct > attributions. > > -- Brooks It could also be written as a pre-commit hook, rather than as a property expansion, which would assuage those concerns. Of course you then get a whole bunch of other concerns, like what is checked by the committer is not what is actually checked in. Cheers Tom From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 15:30:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5E02106564A; Mon, 1 Jun 2009 15:30:18 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92F2C8FC13; Mon, 1 Jun 2009 15:30:18 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51FUI8D082845; Mon, 1 Jun 2009 15:30:18 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51FUIJ9082844; Mon, 1 Jun 2009 15:30:18 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200906011530.n51FUIJ9082844@svn.freebsd.org> From: Bruce M Simpson Date: Mon, 1 Jun 2009 15:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193231 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 15:30:19 -0000 Author: bms Date: Mon Jun 1 15:30:18 2009 New Revision: 193231 URL: http://svn.freebsd.org/changeset/base/193231 Log: Merge fixes from p4: * Tighten v1 query input processing. * Borrow changes from MLDv2 for how general queries are processed. * Do address field validation upfront before accepting input. * Do NOT switch protocol version if old querier present timer active. * Always clear IGMPv3 state in igmp_v3_cancel_link_timers(). * Update comments. Tested by: deeptech71 at gmail dot com Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Mon Jun 1 15:03:58 2009 (r193230) +++ head/sys/netinet/igmp.c Mon Jun 1 15:30:18 2009 (r193231) @@ -98,7 +98,8 @@ static void igmp_final_leave(struct in_m static int igmp_handle_state_change(struct in_multi *, struct igmp_ifinfo *); static int igmp_initial_join(struct in_multi *, struct igmp_ifinfo *); -static int igmp_input_v1_query(struct ifnet *, const struct ip *); +static int igmp_input_v1_query(struct ifnet *, const struct ip *, + const struct igmp *); static int igmp_input_v2_query(struct ifnet *, const struct ip *, const struct igmp *); static int igmp_input_v3_query(struct ifnet *, const struct ip *, @@ -702,7 +703,8 @@ igi_delete_locked(const struct ifnet *if * VIMAGE: The curvnet pointer is derived from the input ifp. */ static int -igmp_input_v1_query(struct ifnet *ifp, const struct ip *ip) +igmp_input_v1_query(struct ifnet *ifp, const struct ip *ip, + const struct igmp *igmp) { INIT_VNET_INET(ifp->if_vnet); struct ifmultiaddr *ifma; @@ -710,20 +712,18 @@ igmp_input_v1_query(struct ifnet *ifp, c struct in_multi *inm; /* - * IGMPv1 General Queries SHOULD always addressed to 224.0.0.1. + * IGMPv1 Host Mmembership Queries SHOULD always be addressed to + * 224.0.0.1. They are always treated as General Queries. * igmp_group is always ignored. Do not drop it as a userland * daemon may wish to see it. + * XXX SMPng: unlocked increments in igmpstat assumed atomic. */ - if (!in_allhosts(ip->ip_dst)) { + if (!in_allhosts(ip->ip_dst) || !in_nullhost(igmp->igmp_group)) { IGMPSTAT_INC(igps_rcv_badqueries); return (0); } - IGMPSTAT_INC(igps_rcv_gen_queries); - /* - * Switch to IGMPv1 host compatibility mode. - */ IN_MULTI_LOCK(); IGMP_LOCK(); @@ -736,6 +736,9 @@ igmp_input_v1_query(struct ifnet *ifp, c goto out_locked; } + /* + * Switch to IGMPv1 host compatibility mode. + */ igmp_set_version(igi, IGMP_VERSION_1); CTR2(KTR_IGMPV3, "process v1 query on ifp %p(%s)", ifp, ifp->if_xname); @@ -793,12 +796,29 @@ igmp_input_v2_query(struct ifnet *ifp, c struct ifmultiaddr *ifma; struct igmp_ifinfo *igi; struct in_multi *inm; + int is_general_query; uint16_t timer; + is_general_query = 0; + /* - * Perform lazy allocation of IGMP link info if required, - * and switch to IGMPv2 host compatibility mode. + * Validate address fields upfront. + * XXX SMPng: unlocked increments in igmpstat assumed atomic. */ + if (in_nullhost(igmp->igmp_group)) { + /* + * IGMPv2 General Query. + * If this was not sent to the all-hosts group, ignore it. + */ + if (!in_allhosts(ip->ip_dst)) + return (0); + IGMPSTAT_INC(igps_rcv_gen_queries); + is_general_query = 1; + } else { + /* IGMPv2 Group-Specific Query. */ + IGMPSTAT_INC(igps_rcv_group_queries); + } + IN_MULTI_LOCK(); IGMP_LOCK(); @@ -811,16 +831,37 @@ igmp_input_v2_query(struct ifnet *ifp, c goto out_locked; } + /* + * Ignore v2 query if in v1 Compatibility Mode. + */ + if (igi->igi_version == IGMP_VERSION_1) + goto out_locked; + igmp_set_version(igi, IGMP_VERSION_2); timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE; if (timer == 0) timer = 1; - if (!in_nullhost(igmp->igmp_group)) { + if (is_general_query) { /* - * IGMPv2 Group-Specific Query. - * If this is a group-specific IGMPv2 query, we need only + * For each reporting group joined on this + * interface, kick the report timer. + */ + CTR2(KTR_IGMPV3, "process v2 general query on ifp %p(%s)", + ifp, ifp->if_xname); + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_INET || + ifma->ifma_protospec == NULL) + continue; + inm = (struct in_multi *)ifma->ifma_protospec; + igmp_v2_update_group(inm, timer); + } + IF_ADDR_UNLOCK(ifp); + } else { + /* + * Group-specific IGMPv2 query, we need only * look up the single group to process it. */ inm = inm_lookup(ifp, igmp->igmp_group); @@ -829,32 +870,6 @@ igmp_input_v2_query(struct ifnet *ifp, c inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); igmp_v2_update_group(inm, timer); } - IGMPSTAT_INC(igps_rcv_group_queries); - } else { - /* - * IGMPv2 General Query. - * If this was not sent to the all-hosts group, ignore it. - */ - if (in_allhosts(ip->ip_dst)) { - /* - * For each reporting group joined on this - * interface, kick the report timer. - */ - CTR2(KTR_IGMPV3, - "process v2 general query on ifp %p(%s)", - ifp, ifp->if_xname); - - IF_ADDR_LOCK(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET || - ifma->ifma_protospec == NULL) - continue; - inm = (struct in_multi *)ifma->ifma_protospec; - igmp_v2_update_group(inm, timer); - } - IF_ADDR_UNLOCK(ifp); - } - IGMPSTAT_INC(igps_rcv_gen_queries); } out_locked: @@ -933,10 +948,13 @@ igmp_input_v3_query(struct ifnet *ifp, c INIT_VNET_INET(ifp->if_vnet); struct igmp_ifinfo *igi; struct in_multi *inm; + int is_general_query; uint32_t maxresp, nsrc, qqi; uint16_t timer; uint8_t qrv; + is_general_query = 0; + CTR2(KTR_IGMPV3, "process v3 query on ifp %p(%s)", ifp, ifp->if_xname); maxresp = igmpv3->igmp_code; /* in 1/10ths of a second */ @@ -947,7 +965,7 @@ igmp_input_v3_query(struct ifnet *ifp, c /* * Robustness must never be less than 2 for on-wire IGMPv3. - * FIXME: Check if ifp has IGIF_LOOPBACK set, as we make + * FUTURE: Check if ifp has IGIF_LOOPBACK set, as we will make * an exception for interfaces whose IGMPv3 state changes * are redirected to loopback (e.g. MANET). */ @@ -970,6 +988,33 @@ igmp_input_v3_query(struct ifnet *ifp, c nsrc = ntohs(igmpv3->igmp_numsrc); + /* + * Validate address fields and versions upfront before + * accepting v3 query. + * XXX SMPng: Unlocked access to igmpstat counters here. + */ + if (in_nullhost(igmpv3->igmp_group)) { + /* + * IGMPv3 General Query. + * + * General Queries SHOULD be directed to 224.0.0.1. + * A general query with a source list has undefined + * behaviour; discard it. + */ + IGMPSTAT_INC(igps_rcv_gen_queries); + if (!in_allhosts(ip->ip_dst) || nsrc > 0) { + IGMPSTAT_INC(igps_rcv_badqueries); + return (0); + } + is_general_query = 1; + } else { + /* Group or group-source specific query. */ + if (nsrc == 0) + IGMPSTAT_INC(igps_rcv_group_queries); + else + IGMPSTAT_INC(igps_rcv_gsr_queries); + } + IN_MULTI_LOCK(); IGMP_LOCK(); @@ -982,8 +1027,19 @@ igmp_input_v3_query(struct ifnet *ifp, c goto out_locked; } - igmp_set_version(igi, IGMP_VERSION_3); + /* + * Discard the v3 query if we're in Compatibility Mode. + * The RFC is not obviously worded that hosts need to stay in + * compatibility mode until the Old Version Querier Present + * timer expires. + */ + if (igi->igi_version != IGMP_VERSION_3) { + CTR3(KTR_IGMPV3, "ignore v3 query in v%d mode on ifp %p(%s)", + igi->igi_version, ifp, ifp->if_xname); + goto out_locked; + } + igmp_set_version(igi, IGMP_VERSION_3); igi->igi_rv = qrv; igi->igi_qi = qqi; igi->igi_qri = maxresp; @@ -991,41 +1047,23 @@ igmp_input_v3_query(struct ifnet *ifp, c CTR4(KTR_IGMPV3, "%s: qrv %d qi %d qri %d", __func__, qrv, qqi, maxresp); - if (in_nullhost(igmpv3->igmp_group)) { + if (is_general_query) { /* - * IGMPv3 General Query. * Schedule a current-state report on this ifp for * all groups, possibly containing source lists. - */ - IGMPSTAT_INC(igps_rcv_gen_queries); - - if (!in_allhosts(ip->ip_dst) || nsrc > 0) { - /* - * General Queries SHOULD be directed to 224.0.0.1. - * A general query with a source list has undefined - * behaviour; discard it. - */ - IGMPSTAT_INC(igps_rcv_badqueries); - goto out_locked; - } - - CTR2(KTR_IGMPV3, "process v3 general query on ifp %p(%s)", - ifp, ifp->if_xname); - - /* * If there is a pending General Query response * scheduled earlier than the selected delay, do * not schedule any other reports. * Otherwise, reset the interface timer. */ + CTR2(KTR_IGMPV3, "process v3 general query on ifp %p(%s)", + ifp, ifp->if_xname); if (igi->igi_v3_timer == 0 || igi->igi_v3_timer >= timer) { igi->igi_v3_timer = IGMP_RANDOM_DELAY(timer); V_interface_timers_running = 1; } } else { /* - * IGMPv3 Group-specific or Group-and-source-specific Query. - * * Group-source-specific queries are throttled on * a per-group basis to defeat denial-of-service attempts. * Queries for groups we are not a member of on this @@ -1035,7 +1073,6 @@ igmp_input_v3_query(struct ifnet *ifp, c if (inm == NULL) goto out_locked; if (nsrc > 0) { - IGMPSTAT_INC(igps_rcv_gsr_queries); if (!ratecheck(&inm->inm_lastgsrtv, &V_igmp_gsrdelay)) { CTR1(KTR_IGMPV3, "%s: GS query throttled.", @@ -1043,8 +1080,6 @@ igmp_input_v3_query(struct ifnet *ifp, c IGMPSTAT_INC(igps_drop_gsr_queries); goto out_locked; } - } else { - IGMPSTAT_INC(igps_rcv_group_queries); } CTR3(KTR_IGMPV3, "process v3 %s query on ifp %p(%s)", inet_ntoa(igmpv3->igmp_group), ifp, ifp->if_xname); @@ -1467,7 +1502,7 @@ igmp_input(struct mbuf *m, int off) IGMPSTAT_INC(igps_rcv_v1v2_queries); if (!V_igmp_v1enable) break; - if (igmp_input_v1_query(ifp, ip) != 0) { + if (igmp_input_v1_query(ifp, ip, igmp) != 0) { m_freem(m); return; } @@ -1909,6 +1944,7 @@ igmp_v3_suppress_group_record(struct in_ static void igmp_set_version(struct igmp_ifinfo *igi, const int version) { + int old_version_timer; IGMP_LOCK_ASSERT(); @@ -1916,7 +1952,6 @@ igmp_set_version(struct igmp_ifinfo *igi version, igi->igi_ifp, igi->igi_ifp->if_xname); if (version == IGMP_VERSION_1 || version == IGMP_VERSION_2) { - int old_version_timer; /* * Compute the "Older Version Querier Present" timer as per * Section 8.12. @@ -1949,6 +1984,11 @@ igmp_set_version(struct igmp_ifinfo *igi /* * Cancel pending IGMPv3 timers for the given link and all groups * joined on it; state-change, general-query, and group-query timers. + * + * Only ever called on a transition from v3 to Compatibility mode. Kill + * the timers stone dead (this may be expensive for large N groups), they + * will be restarted if Compatibility Mode deems that they must be due to + * query processing. */ static void igmp_v3_cancel_link_timers(struct igmp_ifinfo *igi) @@ -1965,21 +2005,21 @@ igmp_v3_cancel_link_timers(struct igmp_i IGMP_LOCK_ASSERT(); /* - * Fast-track this potentially expensive operation - * by checking all the global 'timer pending' flags. + * Stop the v3 General Query Response on this link stone dead. + * If fasttimo is woken up due to V_interface_timers_running, + * the flag will be cleared if there are no pending link timers. */ - if (!V_interface_timers_running && - !V_state_change_timers_running && - !V_current_state_timers_running) - return; - igi->igi_v3_timer = 0; + /* + * Now clear the current-state and state-change report timers + * for all memberships scoped to this link. + */ ifp = igi->igi_ifp; - IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET) + if (ifma->ifma_addr->sa_family != AF_INET || + ifma->ifma_protospec == NULL) continue; inm = (struct in_multi *)ifma->ifma_protospec; switch (inm->inm_state) { @@ -1989,12 +2029,19 @@ igmp_v3_cancel_link_timers(struct igmp_i case IGMP_LAZY_MEMBER: case IGMP_SLEEPING_MEMBER: case IGMP_AWAKENING_MEMBER: + /* + * These states are either not relevant in v3 mode, + * or are unreported. Do nothing. + */ break; case IGMP_LEAVING_MEMBER: /* - * If we are leaving the group and switching - * IGMP version, we need to release the final - * reference held for issuing the INCLUDE {}. + * If we are leaving the group and switching to + * compatibility mode, we need to release the final + * reference held for issuing the INCLUDE {}, and + * transition to REPORTING to ensure the host leave + * message is sent upstream to the old querier -- + * transition to NOT would lose the leave and race. * * SMPNG: Must drop and re-acquire IF_ADDR_LOCK * around inm_release_locked(), as it is not @@ -2009,15 +2056,16 @@ igmp_v3_cancel_link_timers(struct igmp_i inm_clear_recorded(inm); /* FALLTHROUGH */ case IGMP_REPORTING_MEMBER: - inm->inm_sctimer = 0; - inm->inm_timer = 0; inm->inm_state = IGMP_REPORTING_MEMBER; - /* - * Free any pending IGMPv3 state-change records. - */ - _IF_DRAIN(&inm->inm_scq); break; } + /* + * Always clear state-change and group report timers. + * Free any pending IGMPv3 state-change records. + */ + inm->inm_sctimer = 0; + inm->inm_timer = 0; + _IF_DRAIN(&inm->inm_scq); } IF_ADDR_UNLOCK(ifp); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 15:49:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E62B41065674; Mon, 1 Jun 2009 15:49:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D24898FC27; Mon, 1 Jun 2009 15:49:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51FngDY083312; Mon, 1 Jun 2009 15:49:42 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51FngRA083299; Mon, 1 Jun 2009 15:49:42 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906011549.n51FngRA083299@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 1 Jun 2009 15:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193232 - in head: . sys/net sys/netinet sys/netinet6 sys/nfsclient sys/sys usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 15:49:43 -0000 Author: bz Date: Mon Jun 1 15:49:42 2009 New Revision: 193232 URL: http://svn.freebsd.org/changeset/base/193232 Log: Convert the two dimensional array to be malloced and introduce an accessor function to get the correct rnh pointer back. Update netstat to get the correct pointer using kvm_read() as well. This not only fixes the ABI problem depending on the kernel option but also permits the tunable to overwrite the kernel option at boot time up to MAXFIBS, enlarging the number of FIBs without having to recompile. So people could just use GENERIC now. Reviewed by: julian, rwatson, zec X-MFC: not possible Modified: head/UPDATING head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/net/vnet.h head/sys/netinet/in_rmx.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/nd6_rtr.c head/sys/nfsclient/bootp_subr.c head/sys/sys/param.h head/usr.bin/netstat/route.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 1 15:30:18 2009 (r193231) +++ head/UPDATING Mon Jun 1 15:49:42 2009 (r193232) @@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090601: + The way we are storing and accessing `routeing table' entries + has changed. Programs reading the FIB, like netstat, need to + be re-compiled. + Bump __FreeBSD_version to 800097. + 20090530: Remove the tunable/sysctl debug.mpsafevfs as its initial purpose is no more valid. Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/net/if.c Mon Jun 1 15:49:42 2009 (r193232) @@ -1001,7 +1001,8 @@ if_detach_internal(struct ifnet *ifp, in */ for (i = 1; i <= AF_MAX; i++) { for (j = 0; j < rt_numfibs; j++) { - if ((rnh = V_rt_tables[j][i]) == NULL) + rnh = rt_tables_get_rnh(j, i); + if (rnh == NULL) continue; RADIX_NODE_HEAD_LOCK(rnh); (void) rnh->rnh_walktree(rnh, if_rtdel, ifp); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/net/route.c Mon Jun 1 15:49:42 2009 (r193232) @@ -91,15 +91,7 @@ TUNABLE_INT("net.add_addr_allfibs", &rt_ #ifdef VIMAGE_GLOBALS static struct rtstat rtstat; - -/* by default only the first 'row' of tables will be accessed. */ -/* - * XXXMRT When we fix netstat, and do this differnetly, - * we can allocate this dynamically. As long as we are keeping - * things backwards compaitble we need to allocate this - * statically. - */ -struct radix_node_head *rt_tables[RT_MAXFIBS][AF_MAX+1]; +struct radix_node_head *rt_tables; static int rttrash; /* routes not in table but not freed */ #endif @@ -158,6 +150,32 @@ sysctl_my_fibnum(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net, OID_AUTO, my_fibnum, CTLTYPE_INT|CTLFLAG_RD, NULL, 0, &sysctl_my_fibnum, "I", "default FIB of caller"); +static __inline struct radix_node_head ** +rt_tables_get_rnh_ptr(int table, int fam) +{ + INIT_VNET_NET(curvnet); + struct radix_node_head **rnh; + + KASSERT(table >= 0 && table < rt_numfibs, ("%s: table out of bounds.", + __func__)); + KASSERT(fam >= 0 && fam < (AF_MAX+1), ("%s: fam out of bounds.", + __func__)); + + /* rnh is [fib=0][af=0]. */ + rnh = (struct radix_node_head **)V_rt_tables; + /* Get the offset to the requested table and fam. */ + rnh += table * (AF_MAX+1) + fam; + + return (rnh); +} + +struct radix_node_head * +rt_tables_get_rnh(int table, int fam) +{ + + return (*rt_tables_get_rnh_ptr(table, fam)); +} + static void route_init(void) { @@ -179,10 +197,14 @@ route_init(void) static int vnet_route_iattach(const void *unused __unused) { INIT_VNET_NET(curvnet); - int table; struct domain *dom; + struct radix_node_head **rnh; + int table; int fam; + V_rt_tables = malloc(rt_numfibs * (AF_MAX+1) * + sizeof(struct radix_node_head *), M_RTABLE, M_WAITOK|M_ZERO); + V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); for (dom = domains; dom; dom = dom->dom_next) { @@ -198,8 +220,10 @@ static int vnet_route_iattach(const void * (only for AF_INET and AF_INET6 * which don't need it anyhow) */ - dom->dom_rtattach( - (void **)&V_rt_tables[table][fam], + rnh = rt_tables_get_rnh_ptr(table, fam); + if (rnh == NULL) + panic("%s: rnh NULL", __func__); + dom->dom_rtattach((void **)rnh, dom->dom_rtoffset); } else { break; @@ -300,7 +324,7 @@ rtalloc1_fib(struct sockaddr *dst, int r KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); if (dst->sa_family != AF_INET) /* Only INET supports > 1 fib now */ fibnum = 0; - rnh = V_rt_tables[fibnum][dst->sa_family]; + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); newrt = NULL; /* * Look up the address in the table for that Address Family @@ -362,7 +386,7 @@ rtfree(struct rtentry *rt) struct radix_node_head *rnh; KASSERT(rt != NULL,("%s: NULL rt", __func__)); - rnh = V_rt_tables[rt->rt_fibnum][rt_key(rt)->sa_family]; + rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family); KASSERT(rnh != NULL,("%s: NULL rnh", __func__)); RT_LOCK_ASSERT(rt); @@ -463,8 +487,13 @@ rtredirect_fib(struct sockaddr *dst, short *stat = NULL; struct rt_addrinfo info; struct ifaddr *ifa; - struct radix_node_head *rnh = - V_rt_tables[fibnum][dst->sa_family]; + struct radix_node_head *rnh; + + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); + if (rnh == NULL) { + error = EAFNOSUPPORT; + goto out; + } /* verify the gateway is directly reachable */ if ((ifa = ifa_ifwithnet(gateway)) == NULL) { @@ -774,7 +803,7 @@ rtexpunge(struct rtentry *rt) /* * Find the correct routing tree to use for this Address Family */ - rnh = V_rt_tables[rt->rt_fibnum][rt_key(rt)->sa_family]; + rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family); RT_LOCK_ASSERT(rt); if (rnh == NULL) return (EAFNOSUPPORT); @@ -942,7 +971,7 @@ rtrequest1_fib(int req, struct rt_addrin /* * Find the correct routing tree to use for this Address Family */ - rnh = V_rt_tables[fibnum][dst->sa_family]; + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); if (rnh == NULL) return (EAFNOSUPPORT); needlock = ((flags & RTF_RNH_LOCKED) == 0); @@ -1134,9 +1163,9 @@ rt_setgate(struct rtentry *rt, struct so /* XXX dst may be overwritten, can we move this to below */ int dlen = SA_SIZE(dst), glen = SA_SIZE(gate); #ifdef INVARIANTS - INIT_VNET_NET(curvnet); - struct radix_node_head *rnh = - V_rt_tables[rt->rt_fibnum][dst->sa_family]; + struct radix_node_head *rnh; + + rnh = rt_tables_get_rnh(rt->rt_fibnum, dst->sa_family); #endif RT_LOCK_ASSERT(rt); @@ -1203,7 +1232,6 @@ rt_maskedcopy(struct sockaddr *src, stru static inline int rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) { - INIT_VNET_NET(curvnet); struct sockaddr *dst; struct sockaddr *netmask; struct rtentry *rt = NULL; @@ -1273,7 +1301,8 @@ rtinit1(struct ifaddr *ifa, int cmd, int * Look up an rtentry that is in the routing tree and * contains the correct info. */ - if ((rnh = V_rt_tables[fibnum][dst->sa_family]) == NULL) + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); + if (rnh == NULL) /* this table doesn't exist but others might */ continue; RADIX_NODE_HEAD_LOCK(rnh); Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/net/route.h Mon Jun 1 15:49:42 2009 (r193232) @@ -373,7 +373,8 @@ struct rt_addrinfo { } \ } while (0) -extern struct radix_node_head *rt_tables[][AF_MAX+1]; +extern struct radix_node_head *rt_tables; +struct radix_node_head *rt_tables_get_rnh(int, int); struct ifmultiaddr; Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/net/rtsock.c Mon Jun 1 15:49:42 2009 (r193232) @@ -460,7 +460,6 @@ static int route_output(struct mbuf *m, struct socket *so) { #define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) - INIT_VNET_NET(so->so_vnet); struct rt_msghdr *rtm = NULL; struct rtentry *rt = NULL; struct radix_node_head *rnh; @@ -561,7 +560,8 @@ route_output(struct mbuf *m, struct sock case RTM_GET: case RTM_CHANGE: case RTM_LOCK: - rnh = V_rt_tables[so->so_fibnum][info.rti_info[RTAX_DST]->sa_family]; + rnh = rt_tables_get_rnh(so->so_fibnum, + info.rti_info[RTAX_DST]->sa_family); if (rnh == NULL) senderr(EAFNOSUPPORT); RADIX_NODE_HEAD_RLOCK(rnh); @@ -1418,10 +1418,9 @@ done: static int sysctl_rtsock(SYSCTL_HANDLER_ARGS) { - INIT_VNET_NET(curvnet); int *name = (int *)arg1; u_int namelen = arg2; - struct radix_node_head *rnh; + struct radix_node_head *rnh = NULL; /* silence compiler. */ int i, lim, error = EINVAL; u_char af; struct walkarg w; @@ -1469,7 +1468,8 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) * take care of routing entries */ for (error = 0; error == 0 && i <= lim; i++) - if ((rnh = V_rt_tables[req->td->td_proc->p_fibnum][i]) != NULL) { + rnh = rt_tables_get_rnh(req->td->td_proc->p_fibnum, i); + if (rnh != NULL) { RADIX_NODE_HEAD_LOCK(rnh); error = rnh->rnh_walktree(rnh, sysctl_dumpentry, &w); Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/net/vnet.h Mon Jun 1 15:49:42 2009 (r193232) @@ -45,7 +45,7 @@ struct vnet_net { struct knlist _ifklist; struct rtstat _rtstat; - struct radix_node_head *_rt_tables[RT_MAXFIBS][AF_MAX+1]; + struct radix_node_head *_rt_tables; int _rttrash; uma_zone_t _rtzone; Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/netinet/in_rmx.c Mon Jun 1 15:49:42 2009 (r193232) @@ -251,14 +251,14 @@ static void in_rtqtimo(void *rock) { CURVNET_SET((struct vnet *) rock); - INIT_VNET_NET(curvnet); INIT_VNET_INET(curvnet); int fibnum; void *newrock; struct timeval atv; for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - if ((newrock = V_rt_tables[fibnum][AF_INET]) != NULL) + newrock = rt_tables_get_rnh(fibnum, AF_INET); + if (newrock != NULL) in_rtqtimo_one(newrock); } atv.tv_usec = 0; @@ -324,10 +324,9 @@ in_rtqdrain(void) VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - INIT_VNET_NET(vnet_iter); for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = V_rt_tables[fibnum][AF_INET]; + rnh = rt_tables_get_rnh(fibnum, AF_INET); arg.found = arg.killed = 0; arg.rnh = rnh; arg.nextstop = 0; @@ -423,7 +422,6 @@ in_ifadownkill(struct radix_node *rn, vo int in_ifadown(struct ifaddr *ifa, int delete) { - INIT_VNET_NET(curvnet); struct in_ifadown_arg arg; struct radix_node_head *rnh; int fibnum; @@ -432,7 +430,7 @@ in_ifadown(struct ifaddr *ifa, int delet return 1; for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = V_rt_tables[fibnum][AF_INET]; + rnh = rt_tables_get_rnh(fibnum, AF_INET); arg.ifa = ifa; arg.del = delete; RADIX_NODE_HEAD_LOCK(rnh); Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/netinet6/in6_ifattach.c Mon Jun 1 15:49:42 2009 (r193232) @@ -777,11 +777,11 @@ statinit: void in6_ifdetach(struct ifnet *ifp) { - INIT_VNET_NET(ifp->if_vnet); INIT_VNET_INET(ifp->if_vnet); INIT_VNET_INET6(ifp->if_vnet); struct in6_ifaddr *ia, *oia; struct ifaddr *ifa, *next; + struct radix_node_head *rnh; struct rtentry *rt; short rtflags; struct sockaddr_in6 sin6; @@ -874,15 +874,16 @@ in6_ifdetach(struct ifnet *ifp) /* XXX: should not fail */ return; /* XXX grab lock first to avoid LOR */ - if (V_rt_tables[0][AF_INET6] != NULL) { - RADIX_NODE_HEAD_LOCK(V_rt_tables[0][AF_INET6]); + rnh = rt_tables_get_rnh(0, AF_INET6); + if (rnh != NULL) { + RADIX_NODE_HEAD_LOCK(rnh); rt = rtalloc1((struct sockaddr *)&sin6, 0, RTF_RNH_LOCKED); if (rt) { if (rt->rt_ifp == ifp) rtexpunge(rt); RTFREE_LOCKED(rt); } - RADIX_NODE_HEAD_UNLOCK(V_rt_tables[0][AF_INET6]); + RADIX_NODE_HEAD_UNLOCK(rnh); } } Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/netinet6/in6_rmx.c Mon Jun 1 15:49:42 2009 (r193232) @@ -289,13 +289,17 @@ static void in6_rtqtimo(void *rock) { CURVNET_SET_QUIET((struct vnet *) rock); - INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); - struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; + struct radix_node_head *rnh; struct rtqk_arg arg; struct timeval atv; static time_t last_adjusted_timeout = 0; + rnh = rt_tables_get_rnh(0, AF_INET6); + if (rnh == NULL) { + CURVNET_RESTORE(); + return; + } arg.found = arg.killed = 0; arg.rnh = rnh; arg.nextstop = time_uptime + V_rtq_timeout6; @@ -377,12 +381,16 @@ static void in6_mtutimo(void *rock) { CURVNET_SET_QUIET((struct vnet *) rock); - INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); - struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; + struct radix_node_head *rnh; struct mtuex_arg arg; struct timeval atv; + rnh = rt_tables_get_rnh(0, AF_INET6); + if (rnh == NULL) { + CURVNET_RESTORE(); + return; + } arg.rnh = rnh; arg.nextstop = time_uptime + MTUTIMO_DEFAULT; RADIX_NODE_HEAD_LOCK(rnh); @@ -405,9 +413,12 @@ void in6_rtqdrain(void) { INIT_VNET_NET(curvnet); - struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; + struct radix_node_head *rnh; struct rtqk_arg arg; + rnh = rt_tables_get_rnh(0, AF_INET6); + if (rnh == NULL) + panic("%s: rnh == NULL", __func__); arg.found = arg.killed = 0; arg.rnh = rnh; arg.nextstop = 0; @@ -429,9 +440,6 @@ in6_rtqdrain(void) int in6_inithead(void **head, int off) { -#ifdef INVARIANTS - INIT_VNET_NET(curvnet); -#endif INIT_VNET_INET6(curvnet); struct radix_node_head *rnh; @@ -447,7 +455,7 @@ in6_inithead(void **head, int off) V_rtq_timeout6 = RTQ_TIMEOUT; rnh = *head; - KASSERT(rnh == V_rt_tables[0][AF_INET6], ("rnh?")); + KASSERT(rnh == rt_tables_get_rnh(0, AF_INET6), ("rnh?")); rnh->rnh_addaddr = in6_addroute; rnh->rnh_matchaddr = in6_matroute; callout_init(&V_rtq_timer6, CALLOUT_MPSAFE); Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/netinet6/nd6_rtr.c Mon Jun 1 15:49:42 2009 (r193232) @@ -1549,7 +1549,6 @@ pfxlist_onlink_check() int nd6_prefix_onlink(struct nd_prefix *pr) { - INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); struct ifaddr *ifa; struct ifnet *ifp = pr->ndpr_ifp; @@ -1632,7 +1631,8 @@ nd6_prefix_onlink(struct nd_prefix *pr) ifa->ifa_addr, (struct sockaddr *)&mask6, rtflags, &rt); if (error == 0) { if (rt != NULL) /* this should be non NULL, though */ { - rnh = V_rt_tables[rt->rt_fibnum][AF_INET6]; + rnh = rt_tables_get_rnh(rt->rt_fibnum, AF_INET6); + /* XXX what if rhn == NULL? */ RADIX_NODE_HEAD_LOCK(rnh); RT_LOCK(rt); if (!rt_setgate(rt, rt_key(rt), (struct sockaddr *)&null_sdl)) { @@ -2058,8 +2058,7 @@ in6_init_address_ltimes(struct nd_prefix void rt6_flush(struct in6_addr *gateway, struct ifnet *ifp) { - INIT_VNET_NET(curvnet); - struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; + struct radix_node_head *rnh; int s = splnet(); /* We'll care only link-local addresses */ @@ -2068,6 +2067,10 @@ rt6_flush(struct in6_addr *gateway, stru return; } + rnh = rt_tables_get_rnh(0, AF_INET6); + if (rnh == NULL) + return; + RADIX_NODE_HEAD_LOCK(rnh); rnh->rnh_walktree(rnh, rt6_deleteroute, (void *)gateway); RADIX_NODE_HEAD_UNLOCK(rnh); Modified: head/sys/nfsclient/bootp_subr.c ============================================================================== --- head/sys/nfsclient/bootp_subr.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/nfsclient/bootp_subr.c Mon Jun 1 15:49:42 2009 (r193232) @@ -361,11 +361,15 @@ void bootpboot_p_rtlist(void) { INIT_VNET_NET(curvnet); + struct radix_node_head *rnh; printf("Routing table:\n"); - RADIX_NODE_HEAD_RLOCK(V_rt_tables[0][AF_INET]); /* could sleep XXX */ - bootpboot_p_tree(V_rt_tables[0][AF_INET]->rnh_treetop); - RADIX_NODE_HEAD_RUNLOCK(V_rt_tables[0][AF_INET]); + rnh = rt_tables_get_rnh(0, AF_INET); + if (rnh == NULL) + return; + RADIX_NODE_HEAD_RLOCK(rnh); /* could sleep XXX */ + bootpboot_p_tree(rnh->rnh_treetop); + RADIX_NODE_HEAD_RUNLOCK(rnh); } void Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/sys/param.h Mon Jun 1 15:49:42 2009 (r193232) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800096 /* Master, propagated to newvers */ +#define __FreeBSD_version 800097 /* Master, propagated to newvers */ #ifndef LOCORE #include Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/usr.bin/netstat/route.c Mon Jun 1 15:49:42 2009 (r193232) @@ -122,12 +122,7 @@ int do_rtent = 0; struct rtentry rtentry; struct radix_node rnode; struct radix_mask rmask; -struct rtline { - struct radix_node_head *tables[AF_MAX+1]; /*xxx*/ -}; -struct rtline *rt_tables; - -struct radix_node_head *rt_tables_line[1][AF_MAX+1]; /*xxx*/ +struct radix_node_head **rt_tables; int NewTree = 0; @@ -155,7 +150,7 @@ static void domask(char *, in_addr_t, u_ void routepr(u_long rtree) { - struct radix_node_head *rnh, head; + struct radix_node_head **rnhp, *rnh, head; size_t intsize; int i; int numfibs; @@ -165,7 +160,8 @@ routepr(u_long rtree) fibnum = 0; if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1) numfibs = 1; - rt_tables = calloc(numfibs, sizeof(struct rtline)); + rt_tables = calloc(numfibs * (AF_MAX+1), + sizeof(struct radix_node_head *)); if (rt_tables == NULL) err(EX_OSERR, "memory allocation failed"); /* @@ -186,8 +182,8 @@ routepr(u_long rtree) return; } - if (kread((u_long)(rtree), (char *)(rt_tables), - (numfibs * sizeof(struct rtline))) != 0) + if (kread((u_long)(rtree), (char *)(rt_tables), (numfibs * + (AF_MAX+1) * sizeof(struct radix_node_head *))) != 0) return; for (i = 0; i <= AF_MAX; i++) { int tmpfib; @@ -195,8 +191,15 @@ routepr(u_long rtree) tmpfib = 0; else tmpfib = fibnum; - if ((rnh = rt_tables[tmpfib].tables[i]) == 0) + rnhp = (struct radix_node_head **)*rt_tables; + /* Calculate the in-kernel address. */ + rnhp += tmpfib * (AF_MAX+1) + i; + /* Read the in kernel rhn pointer. */ + if (kget(rnhp, rnh) != 0) + continue; + if (rnh == NULL) continue; + /* Read the rnh data. */ if (kget(rnh, head) != 0) continue; if (i == AF_UNSPEC) { From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 15:50:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B4791065674; Mon, 1 Jun 2009 15:50:09 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id 71AA98FC16; Mon, 1 Jun 2009 15:50:08 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=nQFUiTvL6WUA:10 a=3nnSMyBP6osA:10 a=6I5d2MoRAAAA:8 a=WzewUs9J6QCyKufMGlwA:9 a=Nu4nfGhUVJG2irtVg6sA:7 a=44bBxM9jwo9wDXQZDV0N-AkiBzoA:4 Received: from [62.113.132.61] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 1251160946; Mon, 01 Jun 2009 17:50:06 +0200 From: Hans Petter Selasky To: Rui Paulo Date: Mon, 1 Jun 2009 17:54:13 +0200 User-Agent: KMail/1.9.7 References: <200905271927.n4RJRUH8009289@svn.freebsd.org> <200906010749.37072.hselasky@c2i.net> <5C52056B-8E4A-4C15-8451-2A5576A8FC9F@freebsd.org> In-Reply-To: <5C52056B-8E4A-4C15-8451-2A5576A8FC9F@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906011754.14349.hselasky@c2i.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrew Thompson Subject: Re: svn commit: r192925 - in head/sys/dev/usb: . input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 15:50:10 -0000 On Monday 01 June 2009, Rui Paulo wrote: > Hi, > > On 1 Jun 2009, at 06:49, Hans Petter Selasky wrote: > > On Monday 01 June 2009, Rui Paulo wrote: > >> http://wiki.freebsd.org/AppleMacbook#head-7eab3730c3bf3d04bdfb0d1d3649ea > >>ddf 2fed595 > > > > Hi Rui Paulo, > > > > Regarding the eject button, can you have a look at: > > > > /sys/dev/usb/input/ukbd.c > > > > And provide a patch that masks this key the way you want? > > I'm not sure what you mean. I'm proposing to remove the key handling > code from the kernel. See the attached patch. Your patch looks OK. Make sure you test it before committing. --HPS From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 15:55:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D25341065678; Mon, 1 Jun 2009 15:55:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 8953E8FC1B; Mon, 1 Jun 2009 15:55:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 4DA1141C707; Mon, 1 Jun 2009 17:55:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id vEtNpXT5ttup; Mon, 1 Jun 2009 17:55:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id E174A41C729; Mon, 1 Jun 2009 17:55:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 41E544448E6; Mon, 1 Jun 2009 15:54:42 +0000 (UTC) Date: Mon, 1 Jun 2009 15:54:42 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <200906011549.n51FngRA083299@svn.freebsd.org> Message-ID: <20090601155120.D12292@maildrop.int.zabbadoz.net> References: <200906011549.n51FngRA083299@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r193232 - in head: . sys/net sys/netinet sys/netinet6 sys/nfsclient sys/sys usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 15:55:08 -0000 On Mon, 1 Jun 2009, Bjoern A. Zeeb wrote: > Author: bz > Date: Mon Jun 1 15:49:42 2009 > New Revision: 193232 > URL: http://svn.freebsd.org/changeset/base/193232 > > Log: > Convert the two dimensional array to be malloced and introduce > an accessor function to get the correct rnh pointer back. > > Update netstat to get the correct pointer using kvm_read() > as well. > > This not only fixes the ABI problem depending on the kernel > option but also permits the tunable to overwrite the kernel > option at boot time up to MAXFIBS, enlarging the number of > FIBs without having to recompile. So people could just use > GENERIC now. > > Reviewed by: julian, rwatson, zec > X-MFC: not possible The solution is not ideal but will help FreeBSD 8.x. Julian has suggested a cleaner way but I considered that to be to late and intrusive for 8.x; this way we will have enough time for 9.x to convert this io per AF/domain handler routines. Note: I will garbage collect a lot of opt_route.h dependencies by the end of the week as that option no longer has to be visible to most of the tree. PS: I cannot spell 'routing' correctly usually so whoever touches UPDATING next please fix the spelling;-) -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 16:00:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E08D71065675; Mon, 1 Jun 2009 16:00:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE6138FC18; Mon, 1 Jun 2009 16:00:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51G0aDH083599; Mon, 1 Jun 2009 16:00:36 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51G0aN9083598; Mon, 1 Jun 2009 16:00:36 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906011600.n51G0aN9083598@svn.freebsd.org> From: Robert Watson Date: Mon, 1 Jun 2009 16:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193233 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 16:00:37 -0000 Author: rwatson Date: Mon Jun 1 16:00:36 2009 New Revision: 193233 URL: http://svn.freebsd.org/changeset/base/193233 Log: Update UPDATING for NETISR2 merge, fix a typo in another UPDATING entry. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 1 15:49:42 2009 (r193232) +++ head/UPDATING Mon Jun 1 16:00:36 2009 (r193233) @@ -23,11 +23,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. ln -s aj /etc/malloc.conf.) 20090601: - The way we are storing and accessing `routeing table' entries + The way we are storing and accessing `routing table' entries has changed. Programs reading the FIB, like netstat, need to be re-compiled. Bump __FreeBSD_version to 800097. +20090601: + A new netisr implementation has been added for FreeBSD 8. Network + file system modules, such as igmp, ipdivert, and others, should be + rebuilt. + Bump __FreeBSD_version to 800096. + 20090530: Remove the tunable/sysctl debug.mpsafevfs as its initial purpose is no more valid. From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 16:01:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 119A01065686; Mon, 1 Jun 2009 16:01:09 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id B73288FC25; Mon, 1 Jun 2009 16:01:08 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id ABFFC581DC; Mon, 1 Jun 2009 11:01:07 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id DAPn7mFRm7j8; Mon, 1 Jun 2009 11:01:07 -0500 (CDT) Received: from wanderer.tachypleus.net (e179147144.adsl.alicedsl.de [85.179.147.144]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 6069958295; Mon, 1 Jun 2009 11:01:06 -0500 (CDT) Message-ID: <4A23FB40.1050405@freebsd.org> Date: Mon, 01 Jun 2009 18:01:04 +0200 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.21 (X11/20090410) MIME-Version: 1.0 To: John Baldwin References: <200905311002.n4VA2K6c037776@svn.freebsd.org> <200906010822.19951.jhb@freebsd.org> In-Reply-To: <200906010822.19951.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193159 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 16:01:09 -0000 John Baldwin wrote: > On Sunday 31 May 2009 6:02:20 am Nathan Whitehorn wrote: > >> Author: nwhitehorn >> Date: Sun May 31 10:02:20 2009 >> New Revision: 193159 >> URL: http://svn.freebsd.org/changeset/base/193159 >> >> Log: >> Provide an analogous sysctl to hw.acpi.acline (dev.pmu.0.acline) to >> determine whether the computer is plugged in to mains power. >> > > I wonder if it would be a good idea to introduce a > platform-independent 'acline' sysctl? Something like 'hw.acline'? For now > we could simply have these devices create it. We could do something fancier > where AC adapter drivers register with a centralized thingie at some point > and it exports a global setting that is true so long as at least one adapter > is online. I'm not sure that level of complexity is warranted until we have > platforms with multiple AC lines exposed to the OS though. > That would be nice, and easy to implement, though the existing one should be kept for a while for compatibility. In the longer term, pmu(4) also provides an ACPI-alike interface to battery status under dev.pmu.*, which it would likewise be good to report in a platform-independent way. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 16:13:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB749106597C; Mon, 1 Jun 2009 16:13:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B92AB8FC17; Mon, 1 Jun 2009 16:13:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51GD6jA083857; Mon, 1 Jun 2009 16:13:06 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51GD6kZ083855; Mon, 1 Jun 2009 16:13:06 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906011613.n51GD6kZ083855@svn.freebsd.org> From: Robert Watson Date: Mon, 1 Jun 2009 16:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193234 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 16:13:07 -0000 Author: rwatson Date: Mon Jun 1 16:13:06 2009 New Revision: 193234 URL: http://svn.freebsd.org/changeset/base/193234 Log: Add 'sy_flags', a currently unused per-syscall entry flags field that will see future use in 9-CURRENT and 8-STABLE for features such as the capability-mode enable flag and pay-as-you-audit. Discussed with: jhb, sson Modified: head/sys/kern/makesyscalls.sh head/sys/sys/sysent.h Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Mon Jun 1 16:00:36 2009 (r193233) +++ head/sys/kern/makesyscalls.sh Mon Jun 1 16:13:06 2009 (r193234) @@ -318,6 +318,13 @@ s/\$//g auditev = $2; } + # + # The currently-empty flags field. + # + { + flags = "0"; + } + $3 == "STD" || $3 == "NODEF" || $3 == "NOARGS" || $3 == "NOPROTO" \ || $3 == "NOIMPL" || $3 == "NOSTD" { parseline() @@ -369,14 +376,14 @@ s/\$//g printf("\t{ %s, (sy_call_t *)", argssize) > sysent column = 8 + 2 + length(argssize) + 15 if ($3 == "NOIMPL") { - printf("%s },", "nosys, AUE_NULL, NULL, 0, 0") > sysent - column = column + length("nosys") + 3 + printf("%s },", "nosys, AUE_NULL, NULL, 0, 0, 0") > sysent + column = column + length("nosys") + length("AUE_NULL") + 3 } else if ($3 == "NOSTD") { - printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0") > sysent - column = column + length("lkmressys") + 3 + printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0, 0") > sysent + column = column + length("lkmressys") + length("AUE_NULL") + 3 } else { - printf("%s, %s, NULL, 0, 0 },", funcname, auditev) > sysent - column = column + length(funcname) + length(auditev) + 3 + printf("%s, %s, NULL, 0, 0, %s },", funcname, auditev, flags) > sysent + column = column + length(funcname) + length(auditev) + length(flags) + 3 } align_sysent_comment(column) printf("/* %d = %s */\n", syscall, funcalias) > sysent @@ -426,10 +433,10 @@ s/\$//g argalias) > sysarg printf("%s\t%s%s(struct thread *, struct %s *);\n", rettype, prefix, funcname, argalias) > outdcl - printf("\t{ %s(%s,%s), %s, NULL, 0, 0 },", - wrap, argssize, funcname, auditev) > sysent + printf("\t{ %s(%s,%s), %s, NULL, 0, 0, %s },", + wrap, argssize, funcname, auditev, flags) > sysent align_sysent_comment(8 + 9 + \ - length(argssize) + 1 + length(funcname) + length(auditev) + 4) + length(argssize) + 1 + length(funcname) + length(auditev) + length(flags) + 4) printf("/* %d = old %s */\n", syscall, funcalias) > sysent printf("\t\"%s.%s\",\t\t/* %d = old %s */\n", wrap, funcalias, syscall, funcalias) > sysnames @@ -448,10 +455,10 @@ s/\$//g ncompat++ parseline() printf("%s\to%s();\n", rettype, funcname) > syscompatdcl - printf("\t{ compat(%s,%s), %s, NULL, 0, 0 },", - argssize, funcname, auditev) > sysent + printf("\t{ compat(%s,%s), %s, NULL, 0, 0, %s },", + argssize, funcname, auditev, flags) > sysent align_sysent_comment(8 + 9 + \ - length(argssize) + 1 + length(funcname) + length(auditev) + 4) + length(argssize) + 1 + length(funcname) + length(auditev) + length(flags) + 4) printf("/* %d = old %s */\n", syscall, funcalias) > sysent printf("\t\"old.%s\",\t\t/* %d = old %s */\n", funcalias, syscall, funcalias) > sysnames @@ -462,7 +469,7 @@ s/\$//g next } $3 == "OBSOL" { - printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },") > sysent + printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },") > sysent align_sysent_comment(34) printf("/* %d = obsolete %s */\n", syscall, comment) > sysent printf("\t\"obs_%s\",\t\t\t/* %d = obsolete %s */\n", @@ -473,7 +480,7 @@ s/\$//g next } $3 == "UNIMPL" { - printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },\t\t\t/* %d = %s */\n", + printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },\t\t\t/* %d = %s */\n", syscall, comment) > sysent printf("\t\"#%d\",\t\t\t/* %d = %s */\n", syscall, syscall, comment) > sysnames Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Mon Jun 1 16:00:36 2009 (r193233) +++ head/sys/sys/sysent.h Mon Jun 1 16:13:06 2009 (r193234) @@ -60,6 +60,7 @@ struct sysent { /* system call table * /* optional argument conversion function. */ u_int32_t sy_entry; /* DTrace entry ID for systrace. */ u_int32_t sy_return; /* DTrace return ID for systrace. */ + u_int32_t sy_flags; /* General flags for system calls. */ }; struct image_params; From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 16:14:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 955DD106566C; Mon, 1 Jun 2009 16:14:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F38A8FC35; Mon, 1 Jun 2009 16:14:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51GEc3d083920; Mon, 1 Jun 2009 16:14:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51GEc9J083917; Mon, 1 Jun 2009 16:14:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906011614.n51GEc9J083917@svn.freebsd.org> From: Robert Watson Date: Mon, 1 Jun 2009 16:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193235 - in head/sys: amd64/linux32 compat/freebsd32 compat/svr4 i386/ibcs2 i386/linux kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 16:14:39 -0000 Author: rwatson Date: Mon Jun 1 16:14:38 2009 New Revision: 193235 URL: http://svn.freebsd.org/changeset/base/193235 Log: Regenerate generated syscall files following changes to struct sysent in r193234. Modified: head/sys/amd64/linux32/linux32_sysent.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/svr4/svr4_sysent.c head/sys/i386/ibcs2/ibcs2_sysent.c head/sys/i386/linux/linux_sysent.c head/sys/kern/init_sysent.c Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Mon Jun 1 16:13:06 2009 (r193234) +++ head/sys/amd64/linux32/linux32_sysent.c Mon Jun 1 16:14:38 2009 (r193235) @@ -19,321 +19,321 @@ /* The casts are bogus but will do for now. */ struct sysent linux_sysent[] = { #define nosys linux_nosys - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 0 = setup */ - { AS(sys_exit_args), (sy_call_t *)sys_exit, AUE_EXIT, NULL, 0, 0 }, /* 1 = exit */ - { 0, (sy_call_t *)linux_fork, AUE_FORK, NULL, 0, 0 }, /* 2 = linux_fork */ - { AS(read_args), (sy_call_t *)read, AUE_NULL, NULL, 0, 0 }, /* 3 = read */ - { AS(write_args), (sy_call_t *)write, AUE_NULL, NULL, 0, 0 }, /* 4 = write */ - { AS(linux_open_args), (sy_call_t *)linux_open, AUE_OPEN_RWTC, NULL, 0, 0 }, /* 5 = linux_open */ - { AS(close_args), (sy_call_t *)close, AUE_CLOSE, NULL, 0, 0 }, /* 6 = close */ - { AS(linux_waitpid_args), (sy_call_t *)linux_waitpid, AUE_WAIT4, NULL, 0, 0 }, /* 7 = linux_waitpid */ - { AS(linux_creat_args), (sy_call_t *)linux_creat, AUE_CREAT, NULL, 0, 0 }, /* 8 = linux_creat */ - { AS(linux_link_args), (sy_call_t *)linux_link, AUE_LINK, NULL, 0, 0 }, /* 9 = linux_link */ - { AS(linux_unlink_args), (sy_call_t *)linux_unlink, AUE_UNLINK, NULL, 0, 0 }, /* 10 = linux_unlink */ - { AS(linux_execve_args), (sy_call_t *)linux_execve, AUE_EXECVE, NULL, 0, 0 }, /* 11 = linux_execve */ - { AS(linux_chdir_args), (sy_call_t *)linux_chdir, AUE_CHDIR, NULL, 0, 0 }, /* 12 = linux_chdir */ - { AS(linux_time_args), (sy_call_t *)linux_time, AUE_NULL, NULL, 0, 0 }, /* 13 = linux_time */ - { AS(linux_mknod_args), (sy_call_t *)linux_mknod, AUE_MKNOD, NULL, 0, 0 }, /* 14 = linux_mknod */ - { AS(linux_chmod_args), (sy_call_t *)linux_chmod, AUE_CHMOD, NULL, 0, 0 }, /* 15 = linux_chmod */ - { AS(linux_lchown16_args), (sy_call_t *)linux_lchown16, AUE_LCHOWN, NULL, 0, 0 }, /* 16 = linux_lchown16 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 17 = break */ - { AS(linux_stat_args), (sy_call_t *)linux_stat, AUE_STAT, NULL, 0, 0 }, /* 18 = linux_stat */ - { AS(linux_lseek_args), (sy_call_t *)linux_lseek, AUE_LSEEK, NULL, 0, 0 }, /* 19 = linux_lseek */ - { 0, (sy_call_t *)linux_getpid, AUE_GETPID, NULL, 0, 0 }, /* 20 = linux_getpid */ - { AS(linux_mount_args), (sy_call_t *)linux_mount, AUE_MOUNT, NULL, 0, 0 }, /* 21 = linux_mount */ - { AS(linux_oldumount_args), (sy_call_t *)linux_oldumount, AUE_UMOUNT, NULL, 0, 0 }, /* 22 = linux_oldumount */ - { AS(linux_setuid16_args), (sy_call_t *)linux_setuid16, AUE_SETUID, NULL, 0, 0 }, /* 23 = linux_setuid16 */ - { 0, (sy_call_t *)linux_getuid16, AUE_GETUID, NULL, 0, 0 }, /* 24 = linux_getuid16 */ - { 0, (sy_call_t *)linux_stime, AUE_SETTIMEOFDAY, NULL, 0, 0 }, /* 25 = linux_stime */ - { AS(linux_ptrace_args), (sy_call_t *)linux_ptrace, AUE_PTRACE, NULL, 0, 0 }, /* 26 = linux_ptrace */ - { AS(linux_alarm_args), (sy_call_t *)linux_alarm, AUE_NULL, NULL, 0, 0 }, /* 27 = linux_alarm */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 28 = fstat */ - { 0, (sy_call_t *)linux_pause, AUE_NULL, NULL, 0, 0 }, /* 29 = linux_pause */ - { AS(linux_utime_args), (sy_call_t *)linux_utime, AUE_UTIME, NULL, 0, 0 }, /* 30 = linux_utime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 31 = stty */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 32 = gtty */ - { AS(linux_access_args), (sy_call_t *)linux_access, AUE_ACCESS, NULL, 0, 0 }, /* 33 = linux_access */ - { AS(linux_nice_args), (sy_call_t *)linux_nice, AUE_NICE, NULL, 0, 0 }, /* 34 = linux_nice */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 35 = ftime */ - { 0, (sy_call_t *)sync, AUE_SYNC, NULL, 0, 0 }, /* 36 = sync */ - { AS(linux_kill_args), (sy_call_t *)linux_kill, AUE_KILL, NULL, 0, 0 }, /* 37 = linux_kill */ - { AS(linux_rename_args), (sy_call_t *)linux_rename, AUE_RENAME, NULL, 0, 0 }, /* 38 = linux_rename */ - { AS(linux_mkdir_args), (sy_call_t *)linux_mkdir, AUE_MKDIR, NULL, 0, 0 }, /* 39 = linux_mkdir */ - { AS(linux_rmdir_args), (sy_call_t *)linux_rmdir, AUE_RMDIR, NULL, 0, 0 }, /* 40 = linux_rmdir */ - { AS(dup_args), (sy_call_t *)dup, AUE_DUP, NULL, 0, 0 }, /* 41 = dup */ - { AS(linux_pipe_args), (sy_call_t *)linux_pipe, AUE_PIPE, NULL, 0, 0 }, /* 42 = linux_pipe */ - { AS(linux_times_args), (sy_call_t *)linux_times, AUE_NULL, NULL, 0, 0 }, /* 43 = linux_times */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 44 = prof */ - { AS(linux_brk_args), (sy_call_t *)linux_brk, AUE_NULL, NULL, 0, 0 }, /* 45 = linux_brk */ - { AS(linux_setgid16_args), (sy_call_t *)linux_setgid16, AUE_SETGID, NULL, 0, 0 }, /* 46 = linux_setgid16 */ - { 0, (sy_call_t *)linux_getgid16, AUE_GETGID, NULL, 0, 0 }, /* 47 = linux_getgid16 */ - { AS(linux_signal_args), (sy_call_t *)linux_signal, AUE_NULL, NULL, 0, 0 }, /* 48 = linux_signal */ - { 0, (sy_call_t *)linux_geteuid16, AUE_GETEUID, NULL, 0, 0 }, /* 49 = linux_geteuid16 */ - { 0, (sy_call_t *)linux_getegid16, AUE_GETEGID, NULL, 0, 0 }, /* 50 = linux_getegid16 */ - { AS(acct_args), (sy_call_t *)acct, AUE_ACCT, NULL, 0, 0 }, /* 51 = acct */ - { AS(linux_umount_args), (sy_call_t *)linux_umount, AUE_UMOUNT, NULL, 0, 0 }, /* 52 = linux_umount */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 53 = lock */ - { AS(linux_ioctl_args), (sy_call_t *)linux_ioctl, AUE_IOCTL, NULL, 0, 0 }, /* 54 = linux_ioctl */ - { AS(linux_fcntl_args), (sy_call_t *)linux_fcntl, AUE_FCNTL, NULL, 0, 0 }, /* 55 = linux_fcntl */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 56 = mpx */ - { AS(setpgid_args), (sy_call_t *)setpgid, AUE_SETPGRP, NULL, 0, 0 }, /* 57 = setpgid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 58 = ulimit */ - { 0, (sy_call_t *)linux_olduname, AUE_NULL, NULL, 0, 0 }, /* 59 = linux_olduname */ - { AS(umask_args), (sy_call_t *)umask, AUE_UMASK, NULL, 0, 0 }, /* 60 = umask */ - { AS(chroot_args), (sy_call_t *)chroot, AUE_CHROOT, NULL, 0, 0 }, /* 61 = chroot */ - { AS(linux_ustat_args), (sy_call_t *)linux_ustat, AUE_NULL, NULL, 0, 0 }, /* 62 = linux_ustat */ - { AS(dup2_args), (sy_call_t *)dup2, AUE_DUP2, NULL, 0, 0 }, /* 63 = dup2 */ - { 0, (sy_call_t *)linux_getppid, AUE_GETPPID, NULL, 0, 0 }, /* 64 = linux_getppid */ - { 0, (sy_call_t *)getpgrp, AUE_GETPGRP, NULL, 0, 0 }, /* 65 = getpgrp */ - { 0, (sy_call_t *)setsid, AUE_SETSID, NULL, 0, 0 }, /* 66 = setsid */ - { AS(linux_sigaction_args), (sy_call_t *)linux_sigaction, AUE_NULL, NULL, 0, 0 }, /* 67 = linux_sigaction */ - { 0, (sy_call_t *)linux_sgetmask, AUE_NULL, NULL, 0, 0 }, /* 68 = linux_sgetmask */ - { AS(linux_ssetmask_args), (sy_call_t *)linux_ssetmask, AUE_NULL, NULL, 0, 0 }, /* 69 = linux_ssetmask */ - { AS(linux_setreuid16_args), (sy_call_t *)linux_setreuid16, AUE_SETREUID, NULL, 0, 0 }, /* 70 = linux_setreuid16 */ - { AS(linux_setregid16_args), (sy_call_t *)linux_setregid16, AUE_SETREGID, NULL, 0, 0 }, /* 71 = linux_setregid16 */ - { AS(linux_sigsuspend_args), (sy_call_t *)linux_sigsuspend, AUE_NULL, NULL, 0, 0 }, /* 72 = linux_sigsuspend */ - { AS(linux_sigpending_args), (sy_call_t *)linux_sigpending, AUE_NULL, NULL, 0, 0 }, /* 73 = linux_sigpending */ - { AS(linux_sethostname_args), (sy_call_t *)linux_sethostname, AUE_SYSCTL, NULL, 0, 0 }, /* 74 = linux_sethostname */ - { AS(linux_setrlimit_args), (sy_call_t *)linux_setrlimit, AUE_SETRLIMIT, NULL, 0, 0 }, /* 75 = linux_setrlimit */ - { AS(linux_old_getrlimit_args), (sy_call_t *)linux_old_getrlimit, AUE_GETRLIMIT, NULL, 0, 0 }, /* 76 = linux_old_getrlimit */ - { AS(linux_getrusage_args), (sy_call_t *)linux_getrusage, AUE_GETRUSAGE, NULL, 0, 0 }, /* 77 = linux_getrusage */ - { AS(linux_gettimeofday_args), (sy_call_t *)linux_gettimeofday, AUE_NULL, NULL, 0, 0 }, /* 78 = linux_gettimeofday */ - { AS(linux_settimeofday_args), (sy_call_t *)linux_settimeofday, AUE_SETTIMEOFDAY, NULL, 0, 0 }, /* 79 = linux_settimeofday */ - { AS(linux_getgroups16_args), (sy_call_t *)linux_getgroups16, AUE_GETGROUPS, NULL, 0, 0 }, /* 80 = linux_getgroups16 */ - { AS(linux_setgroups16_args), (sy_call_t *)linux_setgroups16, AUE_SETGROUPS, NULL, 0, 0 }, /* 81 = linux_setgroups16 */ - { AS(linux_old_select_args), (sy_call_t *)linux_old_select, AUE_SELECT, NULL, 0, 0 }, /* 82 = linux_old_select */ - { AS(linux_symlink_args), (sy_call_t *)linux_symlink, AUE_SYMLINK, NULL, 0, 0 }, /* 83 = linux_symlink */ - { AS(linux_lstat_args), (sy_call_t *)linux_lstat, AUE_LSTAT, NULL, 0, 0 }, /* 84 = linux_lstat */ - { AS(linux_readlink_args), (sy_call_t *)linux_readlink, AUE_READLINK, NULL, 0, 0 }, /* 85 = linux_readlink */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 86 = linux_uselib */ - { AS(swapon_args), (sy_call_t *)swapon, AUE_SWAPON, NULL, 0, 0 }, /* 87 = swapon */ - { AS(linux_reboot_args), (sy_call_t *)linux_reboot, AUE_REBOOT, NULL, 0, 0 }, /* 88 = linux_reboot */ - { AS(linux_readdir_args), (sy_call_t *)linux_readdir, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 89 = linux_readdir */ - { AS(linux_mmap_args), (sy_call_t *)linux_mmap, AUE_MMAP, NULL, 0, 0 }, /* 90 = linux_mmap */ - { AS(munmap_args), (sy_call_t *)munmap, AUE_MUNMAP, NULL, 0, 0 }, /* 91 = munmap */ - { AS(linux_truncate_args), (sy_call_t *)linux_truncate, AUE_TRUNCATE, NULL, 0, 0 }, /* 92 = linux_truncate */ - { AS(linux_ftruncate_args), (sy_call_t *)linux_ftruncate, AUE_FTRUNCATE, NULL, 0, 0 }, /* 93 = linux_ftruncate */ - { AS(fchmod_args), (sy_call_t *)fchmod, AUE_FCHMOD, NULL, 0, 0 }, /* 94 = fchmod */ - { AS(fchown_args), (sy_call_t *)fchown, AUE_FCHOWN, NULL, 0, 0 }, /* 95 = fchown */ - { AS(linux_getpriority_args), (sy_call_t *)linux_getpriority, AUE_GETPRIORITY, NULL, 0, 0 }, /* 96 = linux_getpriority */ - { AS(setpriority_args), (sy_call_t *)setpriority, AUE_SETPRIORITY, NULL, 0, 0 }, /* 97 = setpriority */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 98 = profil */ - { AS(linux_statfs_args), (sy_call_t *)linux_statfs, AUE_STATFS, NULL, 0, 0 }, /* 99 = linux_statfs */ - { AS(linux_fstatfs_args), (sy_call_t *)linux_fstatfs, AUE_FSTATFS, NULL, 0, 0 }, /* 100 = linux_fstatfs */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 101 = ioperm */ - { AS(linux_socketcall_args), (sy_call_t *)linux_socketcall, AUE_NULL, NULL, 0, 0 }, /* 102 = linux_socketcall */ - { AS(linux_syslog_args), (sy_call_t *)linux_syslog, AUE_NULL, NULL, 0, 0 }, /* 103 = linux_syslog */ - { AS(linux_setitimer_args), (sy_call_t *)linux_setitimer, AUE_SETITIMER, NULL, 0, 0 }, /* 104 = linux_setitimer */ - { AS(linux_getitimer_args), (sy_call_t *)linux_getitimer, AUE_GETITIMER, NULL, 0, 0 }, /* 105 = linux_getitimer */ - { AS(linux_newstat_args), (sy_call_t *)linux_newstat, AUE_STAT, NULL, 0, 0 }, /* 106 = linux_newstat */ - { AS(linux_newlstat_args), (sy_call_t *)linux_newlstat, AUE_LSTAT, NULL, 0, 0 }, /* 107 = linux_newlstat */ - { AS(linux_newfstat_args), (sy_call_t *)linux_newfstat, AUE_FSTAT, NULL, 0, 0 }, /* 108 = linux_newfstat */ - { 0, (sy_call_t *)linux_uname, AUE_NULL, NULL, 0, 0 }, /* 109 = linux_uname */ - { AS(linux_iopl_args), (sy_call_t *)linux_iopl, AUE_NULL, NULL, 0, 0 }, /* 110 = linux_iopl */ - { 0, (sy_call_t *)linux_vhangup, AUE_NULL, NULL, 0, 0 }, /* 111 = linux_vhangup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 112 = idle */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 113 = vm86old */ - { AS(linux_wait4_args), (sy_call_t *)linux_wait4, AUE_WAIT4, NULL, 0, 0 }, /* 114 = linux_wait4 */ - { 0, (sy_call_t *)linux_swapoff, AUE_SWAPOFF, NULL, 0, 0 }, /* 115 = linux_swapoff */ - { AS(linux_sysinfo_args), (sy_call_t *)linux_sysinfo, AUE_NULL, NULL, 0, 0 }, /* 116 = linux_sysinfo */ - { AS(linux_ipc_args), (sy_call_t *)linux_ipc, AUE_NULL, NULL, 0, 0 }, /* 117 = linux_ipc */ - { AS(fsync_args), (sy_call_t *)fsync, AUE_FSYNC, NULL, 0, 0 }, /* 118 = fsync */ - { AS(linux_sigreturn_args), (sy_call_t *)linux_sigreturn, AUE_SIGRETURN, NULL, 0, 0 }, /* 119 = linux_sigreturn */ - { AS(linux_clone_args), (sy_call_t *)linux_clone, AUE_RFORK, NULL, 0, 0 }, /* 120 = linux_clone */ - { AS(linux_setdomainname_args), (sy_call_t *)linux_setdomainname, AUE_SYSCTL, NULL, 0, 0 }, /* 121 = linux_setdomainname */ - { AS(linux_newuname_args), (sy_call_t *)linux_newuname, AUE_NULL, NULL, 0, 0 }, /* 122 = linux_newuname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 123 = modify_ldt */ - { 0, (sy_call_t *)linux_adjtimex, AUE_ADJTIME, NULL, 0, 0 }, /* 124 = linux_adjtimex */ - { AS(linux_mprotect_args), (sy_call_t *)linux_mprotect, AUE_MPROTECT, NULL, 0, 0 }, /* 125 = linux_mprotect */ - { AS(linux_sigprocmask_args), (sy_call_t *)linux_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0 }, /* 126 = linux_sigprocmask */ - { 0, (sy_call_t *)linux_create_module, AUE_NULL, NULL, 0, 0 }, /* 127 = linux_create_module */ - { 0, (sy_call_t *)linux_init_module, AUE_NULL, NULL, 0, 0 }, /* 128 = linux_init_module */ - { 0, (sy_call_t *)linux_delete_module, AUE_NULL, NULL, 0, 0 }, /* 129 = linux_delete_module */ - { 0, (sy_call_t *)linux_get_kernel_syms, AUE_NULL, NULL, 0, 0 }, /* 130 = linux_get_kernel_syms */ - { 0, (sy_call_t *)linux_quotactl, AUE_QUOTACTL, NULL, 0, 0 }, /* 131 = linux_quotactl */ - { AS(getpgid_args), (sy_call_t *)getpgid, AUE_GETPGID, NULL, 0, 0 }, /* 132 = getpgid */ - { AS(fchdir_args), (sy_call_t *)fchdir, AUE_FCHDIR, NULL, 0, 0 }, /* 133 = fchdir */ - { 0, (sy_call_t *)linux_bdflush, AUE_BDFLUSH, NULL, 0, 0 }, /* 134 = linux_bdflush */ - { AS(linux_sysfs_args), (sy_call_t *)linux_sysfs, AUE_NULL, NULL, 0, 0 }, /* 135 = linux_sysfs */ - { AS(linux_personality_args), (sy_call_t *)linux_personality, AUE_PERSONALITY, NULL, 0, 0 }, /* 136 = linux_personality */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 137 = afs_syscall */ - { AS(linux_setfsuid16_args), (sy_call_t *)linux_setfsuid16, AUE_SETFSUID, NULL, 0, 0 }, /* 138 = linux_setfsuid16 */ - { AS(linux_setfsgid16_args), (sy_call_t *)linux_setfsgid16, AUE_SETFSGID, NULL, 0, 0 }, /* 139 = linux_setfsgid16 */ - { AS(linux_llseek_args), (sy_call_t *)linux_llseek, AUE_LSEEK, NULL, 0, 0 }, /* 140 = linux_llseek */ - { AS(linux_getdents_args), (sy_call_t *)linux_getdents, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 141 = linux_getdents */ - { AS(linux_select_args), (sy_call_t *)linux_select, AUE_SELECT, NULL, 0, 0 }, /* 142 = linux_select */ - { AS(flock_args), (sy_call_t *)flock, AUE_FLOCK, NULL, 0, 0 }, /* 143 = flock */ - { AS(linux_msync_args), (sy_call_t *)linux_msync, AUE_MSYNC, NULL, 0, 0 }, /* 144 = linux_msync */ - { AS(linux_readv_args), (sy_call_t *)linux_readv, AUE_READV, NULL, 0, 0 }, /* 145 = linux_readv */ - { AS(linux_writev_args), (sy_call_t *)linux_writev, AUE_WRITEV, NULL, 0, 0 }, /* 146 = linux_writev */ - { AS(linux_getsid_args), (sy_call_t *)linux_getsid, AUE_GETSID, NULL, 0, 0 }, /* 147 = linux_getsid */ - { AS(linux_fdatasync_args), (sy_call_t *)linux_fdatasync, AUE_NULL, NULL, 0, 0 }, /* 148 = linux_fdatasync */ - { AS(linux_sysctl_args), (sy_call_t *)linux_sysctl, AUE_SYSCTL, NULL, 0, 0 }, /* 149 = linux_sysctl */ - { AS(mlock_args), (sy_call_t *)mlock, AUE_MLOCK, NULL, 0, 0 }, /* 150 = mlock */ - { AS(munlock_args), (sy_call_t *)munlock, AUE_MUNLOCK, NULL, 0, 0 }, /* 151 = munlock */ - { AS(mlockall_args), (sy_call_t *)mlockall, AUE_MLOCKALL, NULL, 0, 0 }, /* 152 = mlockall */ - { 0, (sy_call_t *)munlockall, AUE_MUNLOCKALL, NULL, 0, 0 }, /* 153 = munlockall */ - { AS(sched_setparam_args), (sy_call_t *)sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0 }, /* 154 = sched_setparam */ - { AS(sched_getparam_args), (sy_call_t *)sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0 }, /* 155 = sched_getparam */ - { AS(linux_sched_setscheduler_args), (sy_call_t *)linux_sched_setscheduler, AUE_SCHED_SETSCHEDULER, NULL, 0, 0 }, /* 156 = linux_sched_setscheduler */ - { AS(linux_sched_getscheduler_args), (sy_call_t *)linux_sched_getscheduler, AUE_SCHED_GETSCHEDULER, NULL, 0, 0 }, /* 157 = linux_sched_getscheduler */ - { 0, (sy_call_t *)sched_yield, AUE_NULL, NULL, 0, 0 }, /* 158 = sched_yield */ - { AS(linux_sched_get_priority_max_args), (sy_call_t *)linux_sched_get_priority_max, AUE_SCHED_GET_PRIORITY_MAX, NULL, 0, 0 }, /* 159 = linux_sched_get_priority_max */ - { AS(linux_sched_get_priority_min_args), (sy_call_t *)linux_sched_get_priority_min, AUE_SCHED_GET_PRIORITY_MIN, NULL, 0, 0 }, /* 160 = linux_sched_get_priority_min */ - { AS(linux_sched_rr_get_interval_args), (sy_call_t *)linux_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0 }, /* 161 = linux_sched_rr_get_interval */ - { AS(linux_nanosleep_args), (sy_call_t *)linux_nanosleep, AUE_NULL, NULL, 0, 0 }, /* 162 = linux_nanosleep */ - { AS(linux_mremap_args), (sy_call_t *)linux_mremap, AUE_NULL, NULL, 0, 0 }, /* 163 = linux_mremap */ - { AS(linux_setresuid16_args), (sy_call_t *)linux_setresuid16, AUE_SETRESUID, NULL, 0, 0 }, /* 164 = linux_setresuid16 */ - { AS(linux_getresuid16_args), (sy_call_t *)linux_getresuid16, AUE_GETRESUID, NULL, 0, 0 }, /* 165 = linux_getresuid16 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 166 = vm86 */ - { 0, (sy_call_t *)linux_query_module, AUE_NULL, NULL, 0, 0 }, /* 167 = linux_query_module */ - { AS(poll_args), (sy_call_t *)poll, AUE_POLL, NULL, 0, 0 }, /* 168 = poll */ - { 0, (sy_call_t *)linux_nfsservctl, AUE_NULL, NULL, 0, 0 }, /* 169 = linux_nfsservctl */ - { AS(linux_setresgid16_args), (sy_call_t *)linux_setresgid16, AUE_SETRESGID, NULL, 0, 0 }, /* 170 = linux_setresgid16 */ - { AS(linux_getresgid16_args), (sy_call_t *)linux_getresgid16, AUE_GETRESGID, NULL, 0, 0 }, /* 171 = linux_getresgid16 */ - { AS(linux_prctl_args), (sy_call_t *)linux_prctl, AUE_PRCTL, NULL, 0, 0 }, /* 172 = linux_prctl */ - { AS(linux_rt_sigreturn_args), (sy_call_t *)linux_rt_sigreturn, AUE_NULL, NULL, 0, 0 }, /* 173 = linux_rt_sigreturn */ - { AS(linux_rt_sigaction_args), (sy_call_t *)linux_rt_sigaction, AUE_NULL, NULL, 0, 0 }, /* 174 = linux_rt_sigaction */ - { AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL, NULL, 0, 0 }, /* 175 = linux_rt_sigprocmask */ - { AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL, NULL, 0, 0 }, /* 176 = linux_rt_sigpending */ - { AS(linux_rt_sigtimedwait_args), (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL, NULL, 0, 0 }, /* 177 = linux_rt_sigtimedwait */ - { 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0 }, /* 178 = linux_rt_sigqueueinfo */ - { AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL, NULL, 0, 0 }, /* 179 = linux_rt_sigsuspend */ - { AS(linux_pread_args), (sy_call_t *)linux_pread, AUE_PREAD, NULL, 0, 0 }, /* 180 = linux_pread */ - { AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0 }, /* 181 = linux_pwrite */ - { AS(linux_chown16_args), (sy_call_t *)linux_chown16, AUE_CHOWN, NULL, 0, 0 }, /* 182 = linux_chown16 */ - { AS(linux_getcwd_args), (sy_call_t *)linux_getcwd, AUE_GETCWD, NULL, 0, 0 }, /* 183 = linux_getcwd */ - { 0, (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0 }, /* 184 = linux_capget */ - { 0, (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0 }, /* 185 = linux_capset */ - { AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0 }, /* 186 = linux_sigaltstack */ - { 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0 }, /* 187 = linux_sendfile */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 188 = getpmsg */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 189 = putpmsg */ - { 0, (sy_call_t *)linux_vfork, AUE_VFORK, NULL, 0, 0 }, /* 190 = linux_vfork */ - { AS(linux_getrlimit_args), (sy_call_t *)linux_getrlimit, AUE_GETRLIMIT, NULL, 0, 0 }, /* 191 = linux_getrlimit */ - { AS(linux_mmap2_args), (sy_call_t *)linux_mmap2, AUE_MMAP, NULL, 0, 0 }, /* 192 = linux_mmap2 */ - { AS(linux_truncate64_args), (sy_call_t *)linux_truncate64, AUE_TRUNCATE, NULL, 0, 0 }, /* 193 = linux_truncate64 */ - { AS(linux_ftruncate64_args), (sy_call_t *)linux_ftruncate64, AUE_FTRUNCATE, NULL, 0, 0 }, /* 194 = linux_ftruncate64 */ - { AS(linux_stat64_args), (sy_call_t *)linux_stat64, AUE_STAT, NULL, 0, 0 }, /* 195 = linux_stat64 */ - { AS(linux_lstat64_args), (sy_call_t *)linux_lstat64, AUE_LSTAT, NULL, 0, 0 }, /* 196 = linux_lstat64 */ - { AS(linux_fstat64_args), (sy_call_t *)linux_fstat64, AUE_FSTAT, NULL, 0, 0 }, /* 197 = linux_fstat64 */ - { AS(linux_lchown_args), (sy_call_t *)linux_lchown, AUE_LCHOWN, NULL, 0, 0 }, /* 198 = linux_lchown */ - { 0, (sy_call_t *)linux_getuid, AUE_GETUID, NULL, 0, 0 }, /* 199 = linux_getuid */ - { 0, (sy_call_t *)linux_getgid, AUE_GETGID, NULL, 0, 0 }, /* 200 = linux_getgid */ - { 0, (sy_call_t *)geteuid, AUE_GETEUID, NULL, 0, 0 }, /* 201 = geteuid */ - { 0, (sy_call_t *)getegid, AUE_GETEGID, NULL, 0, 0 }, /* 202 = getegid */ - { AS(setreuid_args), (sy_call_t *)setreuid, AUE_SETREUID, NULL, 0, 0 }, /* 203 = setreuid */ - { AS(setregid_args), (sy_call_t *)setregid, AUE_SETREGID, NULL, 0, 0 }, /* 204 = setregid */ - { AS(linux_getgroups_args), (sy_call_t *)linux_getgroups, AUE_GETGROUPS, NULL, 0, 0 }, /* 205 = linux_getgroups */ - { AS(linux_setgroups_args), (sy_call_t *)linux_setgroups, AUE_SETGROUPS, NULL, 0, 0 }, /* 206 = linux_setgroups */ - { AS(fchown_args), (sy_call_t *)fchown, AUE_NULL, NULL, 0, 0 }, /* 207 = fchown */ - { AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0 }, /* 208 = setresuid */ - { AS(getresuid_args), (sy_call_t *)getresuid, AUE_GETRESUID, NULL, 0, 0 }, /* 209 = getresuid */ - { AS(setresgid_args), (sy_call_t *)setresgid, AUE_SETRESGID, NULL, 0, 0 }, /* 210 = setresgid */ - { AS(getresgid_args), (sy_call_t *)getresgid, AUE_GETRESGID, NULL, 0, 0 }, /* 211 = getresgid */ - { AS(linux_chown_args), (sy_call_t *)linux_chown, AUE_CHOWN, NULL, 0, 0 }, /* 212 = linux_chown */ - { AS(setuid_args), (sy_call_t *)setuid, AUE_SETUID, NULL, 0, 0 }, /* 213 = setuid */ - { AS(setgid_args), (sy_call_t *)setgid, AUE_SETGID, NULL, 0, 0 }, /* 214 = setgid */ - { AS(linux_setfsuid_args), (sy_call_t *)linux_setfsuid, AUE_SETFSUID, NULL, 0, 0 }, /* 215 = linux_setfsuid */ - { AS(linux_setfsgid_args), (sy_call_t *)linux_setfsgid, AUE_SETFSGID, NULL, 0, 0 }, /* 216 = linux_setfsgid */ - { AS(linux_pivot_root_args), (sy_call_t *)linux_pivot_root, AUE_PIVOT_ROOT, NULL, 0, 0 }, /* 217 = linux_pivot_root */ - { AS(linux_mincore_args), (sy_call_t *)linux_mincore, AUE_MINCORE, NULL, 0, 0 }, /* 218 = linux_mincore */ - { AS(madvise_args), (sy_call_t *)madvise, AUE_MADVISE, NULL, 0, 0 }, /* 219 = madvise */ - { AS(linux_getdents64_args), (sy_call_t *)linux_getdents64, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 220 = linux_getdents64 */ - { AS(linux_fcntl64_args), (sy_call_t *)linux_fcntl64, AUE_FCNTL, NULL, 0, 0 }, /* 221 = linux_fcntl64 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 222 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 223 = */ - { 0, (sy_call_t *)linux_gettid, AUE_NULL, NULL, 0, 0 }, /* 224 = linux_gettid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 225 = linux_readahead */ - { 0, (sy_call_t *)linux_setxattr, AUE_NULL, NULL, 0, 0 }, /* 226 = linux_setxattr */ - { 0, (sy_call_t *)linux_lsetxattr, AUE_NULL, NULL, 0, 0 }, /* 227 = linux_lsetxattr */ - { 0, (sy_call_t *)linux_fsetxattr, AUE_NULL, NULL, 0, 0 }, /* 228 = linux_fsetxattr */ - { 0, (sy_call_t *)linux_getxattr, AUE_NULL, NULL, 0, 0 }, /* 229 = linux_getxattr */ - { 0, (sy_call_t *)linux_lgetxattr, AUE_NULL, NULL, 0, 0 }, /* 230 = linux_lgetxattr */ - { 0, (sy_call_t *)linux_fgetxattr, AUE_NULL, NULL, 0, 0 }, /* 231 = linux_fgetxattr */ - { 0, (sy_call_t *)linux_listxattr, AUE_NULL, NULL, 0, 0 }, /* 232 = linux_listxattr */ - { 0, (sy_call_t *)linux_llistxattr, AUE_NULL, NULL, 0, 0 }, /* 233 = linux_llistxattr */ - { 0, (sy_call_t *)linux_flistxattr, AUE_NULL, NULL, 0, 0 }, /* 234 = linux_flistxattr */ - { 0, (sy_call_t *)linux_removexattr, AUE_NULL, NULL, 0, 0 }, /* 235 = linux_removexattr */ - { 0, (sy_call_t *)linux_lremovexattr, AUE_NULL, NULL, 0, 0 }, /* 236 = linux_lremovexattr */ - { 0, (sy_call_t *)linux_fremovexattr, AUE_NULL, NULL, 0, 0 }, /* 237 = linux_fremovexattr */ - { AS(linux_tkill_args), (sy_call_t *)linux_tkill, AUE_NULL, NULL, 0, 0 }, /* 238 = linux_tkill */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 239 = linux_sendfile64 */ - { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0 }, /* 240 = linux_sys_futex */ - { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0 }, /* 241 = linux_sched_setaffinity */ - { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0 }, /* 242 = linux_sched_getaffinity */ - { AS(linux_set_thread_area_args), (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0 }, /* 243 = linux_set_thread_area */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 244 = linux_get_thread_area */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 245 = linux_io_setup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 246 = linux_io_destroy */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 247 = linux_io_getevents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 248 = inux_io_submit */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0 }, /* 250 = linux_fadvise64 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 251 = */ - { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0 }, /* 252 = linux_exit_group */ - { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0 }, /* 253 = linux_lookup_dcookie */ - { 0, (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0 }, /* 254 = linux_epoll_create */ - { 0, (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0 }, /* 255 = linux_epoll_ctl */ - { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0 }, /* 256 = linux_epoll_wait */ - { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0 }, /* 257 = linux_remap_file_pages */ - { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0 }, /* 258 = linux_set_tid_address */ - { 0, (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0 }, /* 259 = linux_timer_create */ - { 0, (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0 }, /* 260 = linux_timer_settime */ - { 0, (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0 }, /* 261 = linux_timer_gettime */ - { 0, (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0 }, /* 262 = linux_timer_getoverrun */ - { 0, (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0 }, /* 263 = linux_timer_delete */ - { AS(linux_clock_settime_args), (sy_call_t *)linux_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0 }, /* 264 = linux_clock_settime */ - { AS(linux_clock_gettime_args), (sy_call_t *)linux_clock_gettime, AUE_NULL, NULL, 0, 0 }, /* 265 = linux_clock_gettime */ - { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0 }, /* 266 = linux_clock_getres */ - { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0 }, /* 267 = linux_clock_nanosleep */ - { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_STATFS, NULL, 0, 0 }, /* 268 = linux_statfs64 */ - { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0 }, /* 269 = linux_fstatfs64 */ - { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0 }, /* 270 = linux_tgkill */ - { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0 }, /* 271 = linux_utimes */ - { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0 }, /* 272 = linux_fadvise64_64 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 273 = */ - { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0 }, /* 274 = linux_mbind */ - { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0 }, /* 275 = linux_get_mempolicy */ - { 0, (sy_call_t *)linux_set_mempolicy, AUE_NULL, NULL, 0, 0 }, /* 276 = linux_set_mempolicy */ - { 0, (sy_call_t *)linux_mq_open, AUE_NULL, NULL, 0, 0 }, /* 277 = linux_mq_open */ - { 0, (sy_call_t *)linux_mq_unlink, AUE_NULL, NULL, 0, 0 }, /* 278 = linux_mq_unlink */ - { 0, (sy_call_t *)linux_mq_timedsend, AUE_NULL, NULL, 0, 0 }, /* 279 = linux_mq_timedsend */ - { 0, (sy_call_t *)linux_mq_timedreceive, AUE_NULL, NULL, 0, 0 }, /* 280 = linux_mq_timedreceive */ - { 0, (sy_call_t *)linux_mq_notify, AUE_NULL, NULL, 0, 0 }, /* 281 = linux_mq_notify */ - { 0, (sy_call_t *)linux_mq_getsetattr, AUE_NULL, NULL, 0, 0 }, /* 282 = linux_mq_getsetattr */ - { 0, (sy_call_t *)linux_kexec_load, AUE_NULL, NULL, 0, 0 }, /* 283 = linux_kexec_load */ - { 0, (sy_call_t *)linux_waitid, AUE_NULL, NULL, 0, 0 }, /* 284 = linux_waitid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 285 = */ - { 0, (sy_call_t *)linux_add_key, AUE_NULL, NULL, 0, 0 }, /* 286 = linux_add_key */ - { 0, (sy_call_t *)linux_request_key, AUE_NULL, NULL, 0, 0 }, /* 287 = linux_request_key */ - { 0, (sy_call_t *)linux_keyctl, AUE_NULL, NULL, 0, 0 }, /* 288 = linux_keyctl */ - { 0, (sy_call_t *)linux_ioprio_set, AUE_NULL, NULL, 0, 0 }, /* 289 = linux_ioprio_set */ - { 0, (sy_call_t *)linux_ioprio_get, AUE_NULL, NULL, 0, 0 }, /* 290 = linux_ioprio_get */ - { 0, (sy_call_t *)linux_inotify_init, AUE_NULL, NULL, 0, 0 }, /* 291 = linux_inotify_init */ - { 0, (sy_call_t *)linux_inotify_add_watch, AUE_NULL, NULL, 0, 0 }, /* 292 = linux_inotify_add_watch */ - { 0, (sy_call_t *)linux_inotify_rm_watch, AUE_NULL, NULL, 0, 0 }, /* 293 = linux_inotify_rm_watch */ - { 0, (sy_call_t *)linux_migrate_pages, AUE_NULL, NULL, 0, 0 }, /* 294 = linux_migrate_pages */ - { AS(linux_openat_args), (sy_call_t *)linux_openat, AUE_OPEN_RWTC, NULL, 0, 0 }, /* 295 = linux_openat */ - { AS(linux_mkdirat_args), (sy_call_t *)linux_mkdirat, AUE_MKDIRAT, NULL, 0, 0 }, /* 296 = linux_mkdirat */ - { AS(linux_mknodat_args), (sy_call_t *)linux_mknodat, AUE_MKNODAT, NULL, 0, 0 }, /* 297 = linux_mknodat */ - { AS(linux_fchownat_args), (sy_call_t *)linux_fchownat, AUE_FCHOWNAT, NULL, 0, 0 }, /* 298 = linux_fchownat */ - { AS(linux_futimesat_args), (sy_call_t *)linux_futimesat, AUE_FUTIMESAT, NULL, 0, 0 }, /* 299 = linux_futimesat */ - { AS(linux_fstatat64_args), (sy_call_t *)linux_fstatat64, AUE_FSTATAT, NULL, 0, 0 }, /* 300 = linux_fstatat64 */ - { AS(linux_unlinkat_args), (sy_call_t *)linux_unlinkat, AUE_UNLINKAT, NULL, 0, 0 }, /* 301 = linux_unlinkat */ - { AS(linux_renameat_args), (sy_call_t *)linux_renameat, AUE_RENAMEAT, NULL, 0, 0 }, /* 302 = linux_renameat */ - { AS(linux_linkat_args), (sy_call_t *)linux_linkat, AUE_LINKAT, NULL, 0, 0 }, /* 303 = linux_linkat */ - { AS(linux_symlinkat_args), (sy_call_t *)linux_symlinkat, AUE_SYMLINKAT, NULL, 0, 0 }, /* 304 = linux_symlinkat */ - { AS(linux_readlinkat_args), (sy_call_t *)linux_readlinkat, AUE_READLINKAT, NULL, 0, 0 }, /* 305 = linux_readlinkat */ - { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0 }, /* 306 = linux_fchmodat */ - { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0 }, /* 307 = linux_faccessat */ - { 0, (sy_call_t *)linux_pselect6, AUE_NULL, NULL, 0, 0 }, /* 308 = linux_pselect6 */ - { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0 }, /* 309 = linux_ppoll */ - { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0 }, /* 310 = linux_unshare */ - { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0 }, /* 311 = linux_set_robust_list */ - { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0 }, /* 312 = linux_get_robust_list */ - { 0, (sy_call_t *)linux_splice, AUE_NULL, NULL, 0, 0 }, /* 313 = linux_splice */ - { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0 }, /* 314 = linux_sync_file_range */ - { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0 }, /* 315 = linux_tee */ - { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0 }, /* 316 = linux_vmsplice */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 0 = setup */ + { AS(sys_exit_args), (sy_call_t *)sys_exit, AUE_EXIT, NULL, 0, 0, 0 }, /* 1 = exit */ + { 0, (sy_call_t *)linux_fork, AUE_FORK, NULL, 0, 0, 0 }, /* 2 = linux_fork */ + { AS(read_args), (sy_call_t *)read, AUE_NULL, NULL, 0, 0, 0 }, /* 3 = read */ + { AS(write_args), (sy_call_t *)write, AUE_NULL, NULL, 0, 0, 0 }, /* 4 = write */ + { AS(linux_open_args), (sy_call_t *)linux_open, AUE_OPEN_RWTC, NULL, 0, 0, 0 }, /* 5 = linux_open */ + { AS(close_args), (sy_call_t *)close, AUE_CLOSE, NULL, 0, 0, 0 }, /* 6 = close */ + { AS(linux_waitpid_args), (sy_call_t *)linux_waitpid, AUE_WAIT4, NULL, 0, 0, 0 }, /* 7 = linux_waitpid */ + { AS(linux_creat_args), (sy_call_t *)linux_creat, AUE_CREAT, NULL, 0, 0, 0 }, /* 8 = linux_creat */ + { AS(linux_link_args), (sy_call_t *)linux_link, AUE_LINK, NULL, 0, 0, 0 }, /* 9 = linux_link */ + { AS(linux_unlink_args), (sy_call_t *)linux_unlink, AUE_UNLINK, NULL, 0, 0, 0 }, /* 10 = linux_unlink */ + { AS(linux_execve_args), (sy_call_t *)linux_execve, AUE_EXECVE, NULL, 0, 0, 0 }, /* 11 = linux_execve */ + { AS(linux_chdir_args), (sy_call_t *)linux_chdir, AUE_CHDIR, NULL, 0, 0, 0 }, /* 12 = linux_chdir */ + { AS(linux_time_args), (sy_call_t *)linux_time, AUE_NULL, NULL, 0, 0, 0 }, /* 13 = linux_time */ + { AS(linux_mknod_args), (sy_call_t *)linux_mknod, AUE_MKNOD, NULL, 0, 0, 0 }, /* 14 = linux_mknod */ + { AS(linux_chmod_args), (sy_call_t *)linux_chmod, AUE_CHMOD, NULL, 0, 0, 0 }, /* 15 = linux_chmod */ + { AS(linux_lchown16_args), (sy_call_t *)linux_lchown16, AUE_LCHOWN, NULL, 0, 0, 0 }, /* 16 = linux_lchown16 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 17 = break */ + { AS(linux_stat_args), (sy_call_t *)linux_stat, AUE_STAT, NULL, 0, 0, 0 }, /* 18 = linux_stat */ + { AS(linux_lseek_args), (sy_call_t *)linux_lseek, AUE_LSEEK, NULL, 0, 0, 0 }, /* 19 = linux_lseek */ + { 0, (sy_call_t *)linux_getpid, AUE_GETPID, NULL, 0, 0, 0 }, /* 20 = linux_getpid */ + { AS(linux_mount_args), (sy_call_t *)linux_mount, AUE_MOUNT, NULL, 0, 0, 0 }, /* 21 = linux_mount */ + { AS(linux_oldumount_args), (sy_call_t *)linux_oldumount, AUE_UMOUNT, NULL, 0, 0, 0 }, /* 22 = linux_oldumount */ + { AS(linux_setuid16_args), (sy_call_t *)linux_setuid16, AUE_SETUID, NULL, 0, 0, 0 }, /* 23 = linux_setuid16 */ + { 0, (sy_call_t *)linux_getuid16, AUE_GETUID, NULL, 0, 0, 0 }, /* 24 = linux_getuid16 */ + { 0, (sy_call_t *)linux_stime, AUE_SETTIMEOFDAY, NULL, 0, 0, 0 }, /* 25 = linux_stime */ + { AS(linux_ptrace_args), (sy_call_t *)linux_ptrace, AUE_PTRACE, NULL, 0, 0, 0 }, /* 26 = linux_ptrace */ + { AS(linux_alarm_args), (sy_call_t *)linux_alarm, AUE_NULL, NULL, 0, 0, 0 }, /* 27 = linux_alarm */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 28 = fstat */ + { 0, (sy_call_t *)linux_pause, AUE_NULL, NULL, 0, 0, 0 }, /* 29 = linux_pause */ + { AS(linux_utime_args), (sy_call_t *)linux_utime, AUE_UTIME, NULL, 0, 0, 0 }, /* 30 = linux_utime */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 31 = stty */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 32 = gtty */ + { AS(linux_access_args), (sy_call_t *)linux_access, AUE_ACCESS, NULL, 0, 0, 0 }, /* 33 = linux_access */ + { AS(linux_nice_args), (sy_call_t *)linux_nice, AUE_NICE, NULL, 0, 0, 0 }, /* 34 = linux_nice */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 35 = ftime */ + { 0, (sy_call_t *)sync, AUE_SYNC, NULL, 0, 0, 0 }, /* 36 = sync */ + { AS(linux_kill_args), (sy_call_t *)linux_kill, AUE_KILL, NULL, 0, 0, 0 }, /* 37 = linux_kill */ + { AS(linux_rename_args), (sy_call_t *)linux_rename, AUE_RENAME, NULL, 0, 0, 0 }, /* 38 = linux_rename */ + { AS(linux_mkdir_args), (sy_call_t *)linux_mkdir, AUE_MKDIR, NULL, 0, 0, 0 }, /* 39 = linux_mkdir */ + { AS(linux_rmdir_args), (sy_call_t *)linux_rmdir, AUE_RMDIR, NULL, 0, 0, 0 }, /* 40 = linux_rmdir */ + { AS(dup_args), (sy_call_t *)dup, AUE_DUP, NULL, 0, 0, 0 }, /* 41 = dup */ + { AS(linux_pipe_args), (sy_call_t *)linux_pipe, AUE_PIPE, NULL, 0, 0, 0 }, /* 42 = linux_pipe */ + { AS(linux_times_args), (sy_call_t *)linux_times, AUE_NULL, NULL, 0, 0, 0 }, /* 43 = linux_times */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 44 = prof */ + { AS(linux_brk_args), (sy_call_t *)linux_brk, AUE_NULL, NULL, 0, 0, 0 }, /* 45 = linux_brk */ + { AS(linux_setgid16_args), (sy_call_t *)linux_setgid16, AUE_SETGID, NULL, 0, 0, 0 }, /* 46 = linux_setgid16 */ + { 0, (sy_call_t *)linux_getgid16, AUE_GETGID, NULL, 0, 0, 0 }, /* 47 = linux_getgid16 */ + { AS(linux_signal_args), (sy_call_t *)linux_signal, AUE_NULL, NULL, 0, 0, 0 }, /* 48 = linux_signal */ + { 0, (sy_call_t *)linux_geteuid16, AUE_GETEUID, NULL, 0, 0, 0 }, /* 49 = linux_geteuid16 */ + { 0, (sy_call_t *)linux_getegid16, AUE_GETEGID, NULL, 0, 0, 0 }, /* 50 = linux_getegid16 */ + { AS(acct_args), (sy_call_t *)acct, AUE_ACCT, NULL, 0, 0, 0 }, /* 51 = acct */ + { AS(linux_umount_args), (sy_call_t *)linux_umount, AUE_UMOUNT, NULL, 0, 0, 0 }, /* 52 = linux_umount */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 53 = lock */ + { AS(linux_ioctl_args), (sy_call_t *)linux_ioctl, AUE_IOCTL, NULL, 0, 0, 0 }, /* 54 = linux_ioctl */ + { AS(linux_fcntl_args), (sy_call_t *)linux_fcntl, AUE_FCNTL, NULL, 0, 0, 0 }, /* 55 = linux_fcntl */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 56 = mpx */ + { AS(setpgid_args), (sy_call_t *)setpgid, AUE_SETPGRP, NULL, 0, 0, 0 }, /* 57 = setpgid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 58 = ulimit */ + { 0, (sy_call_t *)linux_olduname, AUE_NULL, NULL, 0, 0, 0 }, /* 59 = linux_olduname */ + { AS(umask_args), (sy_call_t *)umask, AUE_UMASK, NULL, 0, 0, 0 }, /* 60 = umask */ + { AS(chroot_args), (sy_call_t *)chroot, AUE_CHROOT, NULL, 0, 0, 0 }, /* 61 = chroot */ + { AS(linux_ustat_args), (sy_call_t *)linux_ustat, AUE_NULL, NULL, 0, 0, 0 }, /* 62 = linux_ustat */ + { AS(dup2_args), (sy_call_t *)dup2, AUE_DUP2, NULL, 0, 0, 0 }, /* 63 = dup2 */ + { 0, (sy_call_t *)linux_getppid, AUE_GETPPID, NULL, 0, 0, 0 }, /* 64 = linux_getppid */ + { 0, (sy_call_t *)getpgrp, AUE_GETPGRP, NULL, 0, 0, 0 }, /* 65 = getpgrp */ + { 0, (sy_call_t *)setsid, AUE_SETSID, NULL, 0, 0, 0 }, /* 66 = setsid */ + { AS(linux_sigaction_args), (sy_call_t *)linux_sigaction, AUE_NULL, NULL, 0, 0, 0 }, /* 67 = linux_sigaction */ + { 0, (sy_call_t *)linux_sgetmask, AUE_NULL, NULL, 0, 0, 0 }, /* 68 = linux_sgetmask */ + { AS(linux_ssetmask_args), (sy_call_t *)linux_ssetmask, AUE_NULL, NULL, 0, 0, 0 }, /* 69 = linux_ssetmask */ + { AS(linux_setreuid16_args), (sy_call_t *)linux_setreuid16, AUE_SETREUID, NULL, 0, 0, 0 }, /* 70 = linux_setreuid16 */ + { AS(linux_setregid16_args), (sy_call_t *)linux_setregid16, AUE_SETREGID, NULL, 0, 0, 0 }, /* 71 = linux_setregid16 */ + { AS(linux_sigsuspend_args), (sy_call_t *)linux_sigsuspend, AUE_NULL, NULL, 0, 0, 0 }, /* 72 = linux_sigsuspend */ + { AS(linux_sigpending_args), (sy_call_t *)linux_sigpending, AUE_NULL, NULL, 0, 0, 0 }, /* 73 = linux_sigpending */ + { AS(linux_sethostname_args), (sy_call_t *)linux_sethostname, AUE_SYSCTL, NULL, 0, 0, 0 }, /* 74 = linux_sethostname */ + { AS(linux_setrlimit_args), (sy_call_t *)linux_setrlimit, AUE_SETRLIMIT, NULL, 0, 0, 0 }, /* 75 = linux_setrlimit */ + { AS(linux_old_getrlimit_args), (sy_call_t *)linux_old_getrlimit, AUE_GETRLIMIT, NULL, 0, 0, 0 }, /* 76 = linux_old_getrlimit */ + { AS(linux_getrusage_args), (sy_call_t *)linux_getrusage, AUE_GETRUSAGE, NULL, 0, 0, 0 }, /* 77 = linux_getrusage */ + { AS(linux_gettimeofday_args), (sy_call_t *)linux_gettimeofday, AUE_NULL, NULL, 0, 0, 0 }, /* 78 = linux_gettimeofday */ + { AS(linux_settimeofday_args), (sy_call_t *)linux_settimeofday, AUE_SETTIMEOFDAY, NULL, 0, 0, 0 }, /* 79 = linux_settimeofday */ + { AS(linux_getgroups16_args), (sy_call_t *)linux_getgroups16, AUE_GETGROUPS, NULL, 0, 0, 0 }, /* 80 = linux_getgroups16 */ + { AS(linux_setgroups16_args), (sy_call_t *)linux_setgroups16, AUE_SETGROUPS, NULL, 0, 0, 0 }, /* 81 = linux_setgroups16 */ + { AS(linux_old_select_args), (sy_call_t *)linux_old_select, AUE_SELECT, NULL, 0, 0, 0 }, /* 82 = linux_old_select */ + { AS(linux_symlink_args), (sy_call_t *)linux_symlink, AUE_SYMLINK, NULL, 0, 0, 0 }, /* 83 = linux_symlink */ + { AS(linux_lstat_args), (sy_call_t *)linux_lstat, AUE_LSTAT, NULL, 0, 0, 0 }, /* 84 = linux_lstat */ + { AS(linux_readlink_args), (sy_call_t *)linux_readlink, AUE_READLINK, NULL, 0, 0, 0 }, /* 85 = linux_readlink */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 86 = linux_uselib */ + { AS(swapon_args), (sy_call_t *)swapon, AUE_SWAPON, NULL, 0, 0, 0 }, /* 87 = swapon */ + { AS(linux_reboot_args), (sy_call_t *)linux_reboot, AUE_REBOOT, NULL, 0, 0, 0 }, /* 88 = linux_reboot */ + { AS(linux_readdir_args), (sy_call_t *)linux_readdir, AUE_GETDIRENTRIES, NULL, 0, 0, 0 }, /* 89 = linux_readdir */ + { AS(linux_mmap_args), (sy_call_t *)linux_mmap, AUE_MMAP, NULL, 0, 0, 0 }, /* 90 = linux_mmap */ + { AS(munmap_args), (sy_call_t *)munmap, AUE_MUNMAP, NULL, 0, 0, 0 }, /* 91 = munmap */ + { AS(linux_truncate_args), (sy_call_t *)linux_truncate, AUE_TRUNCATE, NULL, 0, 0, 0 }, /* 92 = linux_truncate */ + { AS(linux_ftruncate_args), (sy_call_t *)linux_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, 0 }, /* 93 = linux_ftruncate */ + { AS(fchmod_args), (sy_call_t *)fchmod, AUE_FCHMOD, NULL, 0, 0, 0 }, /* 94 = fchmod */ + { AS(fchown_args), (sy_call_t *)fchown, AUE_FCHOWN, NULL, 0, 0, 0 }, /* 95 = fchown */ + { AS(linux_getpriority_args), (sy_call_t *)linux_getpriority, AUE_GETPRIORITY, NULL, 0, 0, 0 }, /* 96 = linux_getpriority */ + { AS(setpriority_args), (sy_call_t *)setpriority, AUE_SETPRIORITY, NULL, 0, 0, 0 }, /* 97 = setpriority */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 98 = profil */ + { AS(linux_statfs_args), (sy_call_t *)linux_statfs, AUE_STATFS, NULL, 0, 0, 0 }, /* 99 = linux_statfs */ + { AS(linux_fstatfs_args), (sy_call_t *)linux_fstatfs, AUE_FSTATFS, NULL, 0, 0, 0 }, /* 100 = linux_fstatfs */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 101 = ioperm */ + { AS(linux_socketcall_args), (sy_call_t *)linux_socketcall, AUE_NULL, NULL, 0, 0, 0 }, /* 102 = linux_socketcall */ + { AS(linux_syslog_args), (sy_call_t *)linux_syslog, AUE_NULL, NULL, 0, 0, 0 }, /* 103 = linux_syslog */ + { AS(linux_setitimer_args), (sy_call_t *)linux_setitimer, AUE_SETITIMER, NULL, 0, 0, 0 }, /* 104 = linux_setitimer */ + { AS(linux_getitimer_args), (sy_call_t *)linux_getitimer, AUE_GETITIMER, NULL, 0, 0, 0 }, /* 105 = linux_getitimer */ + { AS(linux_newstat_args), (sy_call_t *)linux_newstat, AUE_STAT, NULL, 0, 0, 0 }, /* 106 = linux_newstat */ + { AS(linux_newlstat_args), (sy_call_t *)linux_newlstat, AUE_LSTAT, NULL, 0, 0, 0 }, /* 107 = linux_newlstat */ + { AS(linux_newfstat_args), (sy_call_t *)linux_newfstat, AUE_FSTAT, NULL, 0, 0, 0 }, /* 108 = linux_newfstat */ + { 0, (sy_call_t *)linux_uname, AUE_NULL, NULL, 0, 0, 0 }, /* 109 = linux_uname */ + { AS(linux_iopl_args), (sy_call_t *)linux_iopl, AUE_NULL, NULL, 0, 0, 0 }, /* 110 = linux_iopl */ + { 0, (sy_call_t *)linux_vhangup, AUE_NULL, NULL, 0, 0, 0 }, /* 111 = linux_vhangup */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 112 = idle */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 113 = vm86old */ + { AS(linux_wait4_args), (sy_call_t *)linux_wait4, AUE_WAIT4, NULL, 0, 0, 0 }, /* 114 = linux_wait4 */ + { 0, (sy_call_t *)linux_swapoff, AUE_SWAPOFF, NULL, 0, 0, 0 }, /* 115 = linux_swapoff */ + { AS(linux_sysinfo_args), (sy_call_t *)linux_sysinfo, AUE_NULL, NULL, 0, 0, 0 }, /* 116 = linux_sysinfo */ + { AS(linux_ipc_args), (sy_call_t *)linux_ipc, AUE_NULL, NULL, 0, 0, 0 }, /* 117 = linux_ipc */ + { AS(fsync_args), (sy_call_t *)fsync, AUE_FSYNC, NULL, 0, 0, 0 }, /* 118 = fsync */ + { AS(linux_sigreturn_args), (sy_call_t *)linux_sigreturn, AUE_SIGRETURN, NULL, 0, 0, 0 }, /* 119 = linux_sigreturn */ + { AS(linux_clone_args), (sy_call_t *)linux_clone, AUE_RFORK, NULL, 0, 0, 0 }, /* 120 = linux_clone */ + { AS(linux_setdomainname_args), (sy_call_t *)linux_setdomainname, AUE_SYSCTL, NULL, 0, 0, 0 }, /* 121 = linux_setdomainname */ + { AS(linux_newuname_args), (sy_call_t *)linux_newuname, AUE_NULL, NULL, 0, 0, 0 }, /* 122 = linux_newuname */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 123 = modify_ldt */ + { 0, (sy_call_t *)linux_adjtimex, AUE_ADJTIME, NULL, 0, 0, 0 }, /* 124 = linux_adjtimex */ + { AS(linux_mprotect_args), (sy_call_t *)linux_mprotect, AUE_MPROTECT, NULL, 0, 0, 0 }, /* 125 = linux_mprotect */ + { AS(linux_sigprocmask_args), (sy_call_t *)linux_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, 0 }, /* 126 = linux_sigprocmask */ + { 0, (sy_call_t *)linux_create_module, AUE_NULL, NULL, 0, 0, 0 }, /* 127 = linux_create_module */ + { 0, (sy_call_t *)linux_init_module, AUE_NULL, NULL, 0, 0, 0 }, /* 128 = linux_init_module */ + { 0, (sy_call_t *)linux_delete_module, AUE_NULL, NULL, 0, 0, 0 }, /* 129 = linux_delete_module */ + { 0, (sy_call_t *)linux_get_kernel_syms, AUE_NULL, NULL, 0, 0, 0 }, /* 130 = linux_get_kernel_syms */ + { 0, (sy_call_t *)linux_quotactl, AUE_QUOTACTL, NULL, 0, 0, 0 }, /* 131 = linux_quotactl */ + { AS(getpgid_args), (sy_call_t *)getpgid, AUE_GETPGID, NULL, 0, 0, 0 }, /* 132 = getpgid */ + { AS(fchdir_args), (sy_call_t *)fchdir, AUE_FCHDIR, NULL, 0, 0, 0 }, /* 133 = fchdir */ + { 0, (sy_call_t *)linux_bdflush, AUE_BDFLUSH, NULL, 0, 0, 0 }, /* 134 = linux_bdflush */ + { AS(linux_sysfs_args), (sy_call_t *)linux_sysfs, AUE_NULL, NULL, 0, 0, 0 }, /* 135 = linux_sysfs */ + { AS(linux_personality_args), (sy_call_t *)linux_personality, AUE_PERSONALITY, NULL, 0, 0, 0 }, /* 136 = linux_personality */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 137 = afs_syscall */ + { AS(linux_setfsuid16_args), (sy_call_t *)linux_setfsuid16, AUE_SETFSUID, NULL, 0, 0, 0 }, /* 138 = linux_setfsuid16 */ + { AS(linux_setfsgid16_args), (sy_call_t *)linux_setfsgid16, AUE_SETFSGID, NULL, 0, 0, 0 }, /* 139 = linux_setfsgid16 */ + { AS(linux_llseek_args), (sy_call_t *)linux_llseek, AUE_LSEEK, NULL, 0, 0, 0 }, /* 140 = linux_llseek */ + { AS(linux_getdents_args), (sy_call_t *)linux_getdents, AUE_GETDIRENTRIES, NULL, 0, 0, 0 }, /* 141 = linux_getdents */ + { AS(linux_select_args), (sy_call_t *)linux_select, AUE_SELECT, NULL, 0, 0, 0 }, /* 142 = linux_select */ + { AS(flock_args), (sy_call_t *)flock, AUE_FLOCK, NULL, 0, 0, 0 }, /* 143 = flock */ + { AS(linux_msync_args), (sy_call_t *)linux_msync, AUE_MSYNC, NULL, 0, 0, 0 }, /* 144 = linux_msync */ + { AS(linux_readv_args), (sy_call_t *)linux_readv, AUE_READV, NULL, 0, 0, 0 }, /* 145 = linux_readv */ + { AS(linux_writev_args), (sy_call_t *)linux_writev, AUE_WRITEV, NULL, 0, 0, 0 }, /* 146 = linux_writev */ + { AS(linux_getsid_args), (sy_call_t *)linux_getsid, AUE_GETSID, NULL, 0, 0, 0 }, /* 147 = linux_getsid */ + { AS(linux_fdatasync_args), (sy_call_t *)linux_fdatasync, AUE_NULL, NULL, 0, 0, 0 }, /* 148 = linux_fdatasync */ + { AS(linux_sysctl_args), (sy_call_t *)linux_sysctl, AUE_SYSCTL, NULL, 0, 0, 0 }, /* 149 = linux_sysctl */ + { AS(mlock_args), (sy_call_t *)mlock, AUE_MLOCK, NULL, 0, 0, 0 }, /* 150 = mlock */ + { AS(munlock_args), (sy_call_t *)munlock, AUE_MUNLOCK, NULL, 0, 0, 0 }, /* 151 = munlock */ + { AS(mlockall_args), (sy_call_t *)mlockall, AUE_MLOCKALL, NULL, 0, 0, 0 }, /* 152 = mlockall */ + { 0, (sy_call_t *)munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0 }, /* 153 = munlockall */ + { AS(sched_setparam_args), (sy_call_t *)sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0 }, /* 154 = sched_setparam */ + { AS(sched_getparam_args), (sy_call_t *)sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0 }, /* 155 = sched_getparam */ + { AS(linux_sched_setscheduler_args), (sy_call_t *)linux_sched_setscheduler, AUE_SCHED_SETSCHEDULER, NULL, 0, 0, 0 }, /* 156 = linux_sched_setscheduler */ + { AS(linux_sched_getscheduler_args), (sy_call_t *)linux_sched_getscheduler, AUE_SCHED_GETSCHEDULER, NULL, 0, 0, 0 }, /* 157 = linux_sched_getscheduler */ + { 0, (sy_call_t *)sched_yield, AUE_NULL, NULL, 0, 0, 0 }, /* 158 = sched_yield */ + { AS(linux_sched_get_priority_max_args), (sy_call_t *)linux_sched_get_priority_max, AUE_SCHED_GET_PRIORITY_MAX, NULL, 0, 0, 0 }, /* 159 = linux_sched_get_priority_max */ + { AS(linux_sched_get_priority_min_args), (sy_call_t *)linux_sched_get_priority_min, AUE_SCHED_GET_PRIORITY_MIN, NULL, 0, 0, 0 }, /* 160 = linux_sched_get_priority_min */ + { AS(linux_sched_rr_get_interval_args), (sy_call_t *)linux_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0, 0 }, /* 161 = linux_sched_rr_get_interval */ + { AS(linux_nanosleep_args), (sy_call_t *)linux_nanosleep, AUE_NULL, NULL, 0, 0, 0 }, /* 162 = linux_nanosleep */ + { AS(linux_mremap_args), (sy_call_t *)linux_mremap, AUE_NULL, NULL, 0, 0, 0 }, /* 163 = linux_mremap */ + { AS(linux_setresuid16_args), (sy_call_t *)linux_setresuid16, AUE_SETRESUID, NULL, 0, 0, 0 }, /* 164 = linux_setresuid16 */ + { AS(linux_getresuid16_args), (sy_call_t *)linux_getresuid16, AUE_GETRESUID, NULL, 0, 0, 0 }, /* 165 = linux_getresuid16 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 166 = vm86 */ + { 0, (sy_call_t *)linux_query_module, AUE_NULL, NULL, 0, 0, 0 }, /* 167 = linux_query_module */ + { AS(poll_args), (sy_call_t *)poll, AUE_POLL, NULL, 0, 0, 0 }, /* 168 = poll */ + { 0, (sy_call_t *)linux_nfsservctl, AUE_NULL, NULL, 0, 0, 0 }, /* 169 = linux_nfsservctl */ + { AS(linux_setresgid16_args), (sy_call_t *)linux_setresgid16, AUE_SETRESGID, NULL, 0, 0, 0 }, /* 170 = linux_setresgid16 */ + { AS(linux_getresgid16_args), (sy_call_t *)linux_getresgid16, AUE_GETRESGID, NULL, 0, 0, 0 }, /* 171 = linux_getresgid16 */ + { AS(linux_prctl_args), (sy_call_t *)linux_prctl, AUE_PRCTL, NULL, 0, 0, 0 }, /* 172 = linux_prctl */ + { AS(linux_rt_sigreturn_args), (sy_call_t *)linux_rt_sigreturn, AUE_NULL, NULL, 0, 0, 0 }, /* 173 = linux_rt_sigreturn */ + { AS(linux_rt_sigaction_args), (sy_call_t *)linux_rt_sigaction, AUE_NULL, NULL, 0, 0, 0 }, /* 174 = linux_rt_sigaction */ + { AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL, NULL, 0, 0, 0 }, /* 175 = linux_rt_sigprocmask */ + { AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL, NULL, 0, 0, 0 }, /* 176 = linux_rt_sigpending */ + { AS(linux_rt_sigtimedwait_args), (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL, NULL, 0, 0, 0 }, /* 177 = linux_rt_sigtimedwait */ + { 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0 }, /* 178 = linux_rt_sigqueueinfo */ + { AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL, NULL, 0, 0, 0 }, /* 179 = linux_rt_sigsuspend */ + { AS(linux_pread_args), (sy_call_t *)linux_pread, AUE_PREAD, NULL, 0, 0, 0 }, /* 180 = linux_pread */ + { AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0 }, /* 181 = linux_pwrite */ + { AS(linux_chown16_args), (sy_call_t *)linux_chown16, AUE_CHOWN, NULL, 0, 0, 0 }, /* 182 = linux_chown16 */ + { AS(linux_getcwd_args), (sy_call_t *)linux_getcwd, AUE_GETCWD, NULL, 0, 0, 0 }, /* 183 = linux_getcwd */ + { 0, (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0 }, /* 184 = linux_capget */ + { 0, (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0 }, /* 185 = linux_capset */ + { AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0, 0 }, /* 186 = linux_sigaltstack */ + { 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0 }, /* 187 = linux_sendfile */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 188 = getpmsg */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 189 = putpmsg */ + { 0, (sy_call_t *)linux_vfork, AUE_VFORK, NULL, 0, 0, 0 }, /* 190 = linux_vfork */ + { AS(linux_getrlimit_args), (sy_call_t *)linux_getrlimit, AUE_GETRLIMIT, NULL, 0, 0, 0 }, /* 191 = linux_getrlimit */ + { AS(linux_mmap2_args), (sy_call_t *)linux_mmap2, AUE_MMAP, NULL, 0, 0, 0 }, /* 192 = linux_mmap2 */ + { AS(linux_truncate64_args), (sy_call_t *)linux_truncate64, AUE_TRUNCATE, NULL, 0, 0, 0 }, /* 193 = linux_truncate64 */ + { AS(linux_ftruncate64_args), (sy_call_t *)linux_ftruncate64, AUE_FTRUNCATE, NULL, 0, 0, 0 }, /* 194 = linux_ftruncate64 */ + { AS(linux_stat64_args), (sy_call_t *)linux_stat64, AUE_STAT, NULL, 0, 0, 0 }, /* 195 = linux_stat64 */ + { AS(linux_lstat64_args), (sy_call_t *)linux_lstat64, AUE_LSTAT, NULL, 0, 0, 0 }, /* 196 = linux_lstat64 */ + { AS(linux_fstat64_args), (sy_call_t *)linux_fstat64, AUE_FSTAT, NULL, 0, 0, 0 }, /* 197 = linux_fstat64 */ + { AS(linux_lchown_args), (sy_call_t *)linux_lchown, AUE_LCHOWN, NULL, 0, 0, 0 }, /* 198 = linux_lchown */ + { 0, (sy_call_t *)linux_getuid, AUE_GETUID, NULL, 0, 0, 0 }, /* 199 = linux_getuid */ + { 0, (sy_call_t *)linux_getgid, AUE_GETGID, NULL, 0, 0, 0 }, /* 200 = linux_getgid */ + { 0, (sy_call_t *)geteuid, AUE_GETEUID, NULL, 0, 0, 0 }, /* 201 = geteuid */ + { 0, (sy_call_t *)getegid, AUE_GETEGID, NULL, 0, 0, 0 }, /* 202 = getegid */ + { AS(setreuid_args), (sy_call_t *)setreuid, AUE_SETREUID, NULL, 0, 0, 0 }, /* 203 = setreuid */ + { AS(setregid_args), (sy_call_t *)setregid, AUE_SETREGID, NULL, 0, 0, 0 }, /* 204 = setregid */ + { AS(linux_getgroups_args), (sy_call_t *)linux_getgroups, AUE_GETGROUPS, NULL, 0, 0, 0 }, /* 205 = linux_getgroups */ + { AS(linux_setgroups_args), (sy_call_t *)linux_setgroups, AUE_SETGROUPS, NULL, 0, 0, 0 }, /* 206 = linux_setgroups */ + { AS(fchown_args), (sy_call_t *)fchown, AUE_NULL, NULL, 0, 0, 0 }, /* 207 = fchown */ + { AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0, 0 }, /* 208 = setresuid */ + { AS(getresuid_args), (sy_call_t *)getresuid, AUE_GETRESUID, NULL, 0, 0, 0 }, /* 209 = getresuid */ + { AS(setresgid_args), (sy_call_t *)setresgid, AUE_SETRESGID, NULL, 0, 0, 0 }, /* 210 = setresgid */ + { AS(getresgid_args), (sy_call_t *)getresgid, AUE_GETRESGID, NULL, 0, 0, 0 }, /* 211 = getresgid */ + { AS(linux_chown_args), (sy_call_t *)linux_chown, AUE_CHOWN, NULL, 0, 0, 0 }, /* 212 = linux_chown */ + { AS(setuid_args), (sy_call_t *)setuid, AUE_SETUID, NULL, 0, 0, 0 }, /* 213 = setuid */ + { AS(setgid_args), (sy_call_t *)setgid, AUE_SETGID, NULL, 0, 0, 0 }, /* 214 = setgid */ + { AS(linux_setfsuid_args), (sy_call_t *)linux_setfsuid, AUE_SETFSUID, NULL, 0, 0, 0 }, /* 215 = linux_setfsuid */ + { AS(linux_setfsgid_args), (sy_call_t *)linux_setfsgid, AUE_SETFSGID, NULL, 0, 0, 0 }, /* 216 = linux_setfsgid */ + { AS(linux_pivot_root_args), (sy_call_t *)linux_pivot_root, AUE_PIVOT_ROOT, NULL, 0, 0, 0 }, /* 217 = linux_pivot_root */ + { AS(linux_mincore_args), (sy_call_t *)linux_mincore, AUE_MINCORE, NULL, 0, 0, 0 }, /* 218 = linux_mincore */ + { AS(madvise_args), (sy_call_t *)madvise, AUE_MADVISE, NULL, 0, 0, 0 }, /* 219 = madvise */ + { AS(linux_getdents64_args), (sy_call_t *)linux_getdents64, AUE_GETDIRENTRIES, NULL, 0, 0, 0 }, /* 220 = linux_getdents64 */ + { AS(linux_fcntl64_args), (sy_call_t *)linux_fcntl64, AUE_FCNTL, NULL, 0, 0, 0 }, /* 221 = linux_fcntl64 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 222 = */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 223 = */ + { 0, (sy_call_t *)linux_gettid, AUE_NULL, NULL, 0, 0, 0 }, /* 224 = linux_gettid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 225 = linux_readahead */ + { 0, (sy_call_t *)linux_setxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 226 = linux_setxattr */ + { 0, (sy_call_t *)linux_lsetxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 227 = linux_lsetxattr */ + { 0, (sy_call_t *)linux_fsetxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 228 = linux_fsetxattr */ + { 0, (sy_call_t *)linux_getxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 229 = linux_getxattr */ + { 0, (sy_call_t *)linux_lgetxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 230 = linux_lgetxattr */ + { 0, (sy_call_t *)linux_fgetxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 231 = linux_fgetxattr */ + { 0, (sy_call_t *)linux_listxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 232 = linux_listxattr */ + { 0, (sy_call_t *)linux_llistxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 233 = linux_llistxattr */ + { 0, (sy_call_t *)linux_flistxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 234 = linux_flistxattr */ + { 0, (sy_call_t *)linux_removexattr, AUE_NULL, NULL, 0, 0, 0 }, /* 235 = linux_removexattr */ + { 0, (sy_call_t *)linux_lremovexattr, AUE_NULL, NULL, 0, 0, 0 }, /* 236 = linux_lremovexattr */ + { 0, (sy_call_t *)linux_fremovexattr, AUE_NULL, NULL, 0, 0, 0 }, /* 237 = linux_fremovexattr */ + { AS(linux_tkill_args), (sy_call_t *)linux_tkill, AUE_NULL, NULL, 0, 0, 0 }, /* 238 = linux_tkill */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 239 = linux_sendfile64 */ + { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0, 0 }, /* 240 = linux_sys_futex */ + { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0, 0 }, /* 241 = linux_sched_setaffinity */ + { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0, 0 }, /* 242 = linux_sched_getaffinity */ + { AS(linux_set_thread_area_args), (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0, 0 }, /* 243 = linux_set_thread_area */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 244 = linux_get_thread_area */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 245 = linux_io_setup */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 246 = linux_io_destroy */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 247 = linux_io_getevents */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 248 = inux_io_submit */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 249 = linux_io_cancel */ + { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 251 = */ + { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0 }, /* 252 = linux_exit_group */ + { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0 }, /* 253 = linux_lookup_dcookie */ + { 0, (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0 }, /* 254 = linux_epoll_create */ + { 0, (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0 }, /* 255 = linux_epoll_ctl */ + { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0 }, /* 256 = linux_epoll_wait */ + { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0 }, /* 257 = linux_remap_file_pages */ + { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0 }, /* 258 = linux_set_tid_address */ + { 0, (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0 }, /* 259 = linux_timer_create */ + { 0, (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0, 0 }, /* 260 = linux_timer_settime */ + { 0, (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0, 0 }, /* 261 = linux_timer_gettime */ + { 0, (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0, 0 }, /* 262 = linux_timer_getoverrun */ + { 0, (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0, 0 }, /* 263 = linux_timer_delete */ + { AS(linux_clock_settime_args), (sy_call_t *)linux_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0 }, /* 264 = linux_clock_settime */ + { AS(linux_clock_gettime_args), (sy_call_t *)linux_clock_gettime, AUE_NULL, NULL, 0, 0, 0 }, /* 265 = linux_clock_gettime */ + { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0 }, /* 266 = linux_clock_getres */ + { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0 }, /* 267 = linux_clock_nanosleep */ + { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_STATFS, NULL, 0, 0, 0 }, /* 268 = linux_statfs64 */ + { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0 }, /* 269 = linux_fstatfs64 */ + { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0 }, /* 270 = linux_tgkill */ + { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0 }, /* 271 = linux_utimes */ + { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0 }, /* 272 = linux_fadvise64_64 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 273 = */ + { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0 }, /* 274 = linux_mbind */ + { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0 }, /* 275 = linux_get_mempolicy */ + { 0, (sy_call_t *)linux_set_mempolicy, AUE_NULL, NULL, 0, 0, 0 }, /* 276 = linux_set_mempolicy */ + { 0, (sy_call_t *)linux_mq_open, AUE_NULL, NULL, 0, 0, 0 }, /* 277 = linux_mq_open */ + { 0, (sy_call_t *)linux_mq_unlink, AUE_NULL, NULL, 0, 0, 0 }, /* 278 = linux_mq_unlink */ + { 0, (sy_call_t *)linux_mq_timedsend, AUE_NULL, NULL, 0, 0, 0 }, /* 279 = linux_mq_timedsend */ + { 0, (sy_call_t *)linux_mq_timedreceive, AUE_NULL, NULL, 0, 0, 0 }, /* 280 = linux_mq_timedreceive */ + { 0, (sy_call_t *)linux_mq_notify, AUE_NULL, NULL, 0, 0, 0 }, /* 281 = linux_mq_notify */ + { 0, (sy_call_t *)linux_mq_getsetattr, AUE_NULL, NULL, 0, 0, 0 }, /* 282 = linux_mq_getsetattr */ + { 0, (sy_call_t *)linux_kexec_load, AUE_NULL, NULL, 0, 0, 0 }, /* 283 = linux_kexec_load */ + { 0, (sy_call_t *)linux_waitid, AUE_NULL, NULL, 0, 0, 0 }, /* 284 = linux_waitid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 285 = */ + { 0, (sy_call_t *)linux_add_key, AUE_NULL, NULL, 0, 0, 0 }, /* 286 = linux_add_key */ + { 0, (sy_call_t *)linux_request_key, AUE_NULL, NULL, 0, 0, 0 }, /* 287 = linux_request_key */ + { 0, (sy_call_t *)linux_keyctl, AUE_NULL, NULL, 0, 0, 0 }, /* 288 = linux_keyctl */ + { 0, (sy_call_t *)linux_ioprio_set, AUE_NULL, NULL, 0, 0, 0 }, /* 289 = linux_ioprio_set */ + { 0, (sy_call_t *)linux_ioprio_get, AUE_NULL, NULL, 0, 0, 0 }, /* 290 = linux_ioprio_get */ + { 0, (sy_call_t *)linux_inotify_init, AUE_NULL, NULL, 0, 0, 0 }, /* 291 = linux_inotify_init */ + { 0, (sy_call_t *)linux_inotify_add_watch, AUE_NULL, NULL, 0, 0, 0 }, /* 292 = linux_inotify_add_watch */ + { 0, (sy_call_t *)linux_inotify_rm_watch, AUE_NULL, NULL, 0, 0, 0 }, /* 293 = linux_inotify_rm_watch */ + { 0, (sy_call_t *)linux_migrate_pages, AUE_NULL, NULL, 0, 0, 0 }, /* 294 = linux_migrate_pages */ + { AS(linux_openat_args), (sy_call_t *)linux_openat, AUE_OPEN_RWTC, NULL, 0, 0, 0 }, /* 295 = linux_openat */ + { AS(linux_mkdirat_args), (sy_call_t *)linux_mkdirat, AUE_MKDIRAT, NULL, 0, 0, 0 }, /* 296 = linux_mkdirat */ + { AS(linux_mknodat_args), (sy_call_t *)linux_mknodat, AUE_MKNODAT, NULL, 0, 0, 0 }, /* 297 = linux_mknodat */ + { AS(linux_fchownat_args), (sy_call_t *)linux_fchownat, AUE_FCHOWNAT, NULL, 0, 0, 0 }, /* 298 = linux_fchownat */ + { AS(linux_futimesat_args), (sy_call_t *)linux_futimesat, AUE_FUTIMESAT, NULL, 0, 0, 0 }, /* 299 = linux_futimesat */ + { AS(linux_fstatat64_args), (sy_call_t *)linux_fstatat64, AUE_FSTATAT, NULL, 0, 0, 0 }, /* 300 = linux_fstatat64 */ + { AS(linux_unlinkat_args), (sy_call_t *)linux_unlinkat, AUE_UNLINKAT, NULL, 0, 0, 0 }, /* 301 = linux_unlinkat */ + { AS(linux_renameat_args), (sy_call_t *)linux_renameat, AUE_RENAMEAT, NULL, 0, 0, 0 }, /* 302 = linux_renameat */ + { AS(linux_linkat_args), (sy_call_t *)linux_linkat, AUE_LINKAT, NULL, 0, 0, 0 }, /* 303 = linux_linkat */ + { AS(linux_symlinkat_args), (sy_call_t *)linux_symlinkat, AUE_SYMLINKAT, NULL, 0, 0, 0 }, /* 304 = linux_symlinkat */ + { AS(linux_readlinkat_args), (sy_call_t *)linux_readlinkat, AUE_READLINKAT, NULL, 0, 0, 0 }, /* 305 = linux_readlinkat */ + { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0 }, /* 306 = linux_fchmodat */ + { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0 }, /* 307 = linux_faccessat */ + { 0, (sy_call_t *)linux_pselect6, AUE_NULL, NULL, 0, 0, 0 }, /* 308 = linux_pselect6 */ + { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0 }, /* 309 = linux_ppoll */ + { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0 }, /* 310 = linux_unshare */ + { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0 }, /* 311 = linux_set_robust_list */ + { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0 }, /* 312 = linux_get_robust_list */ + { 0, (sy_call_t *)linux_splice, AUE_NULL, NULL, 0, 0, 0 }, /* 313 = linux_splice */ + { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0 }, /* 314 = linux_sync_file_range */ + { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0 }, /* 315 = linux_tee */ + { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0 }, /* 316 = linux_vmsplice */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Mon Jun 1 16:13:06 2009 (r193234) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Mon Jun 1 16:14:38 2009 (r193235) @@ -38,513 +38,513 @@ /* The casts are bogus but will do for now. */ struct sysent freebsd32_sysent[] = { - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 0 = syscall */ - { AS(sys_exit_args), (sy_call_t *)sys_exit, AUE_EXIT, NULL, 0, 0 }, /* 1 = exit */ - { 0, (sy_call_t *)fork, AUE_FORK, NULL, 0, 0 }, /* 2 = fork */ - { AS(read_args), (sy_call_t *)read, AUE_READ, NULL, 0, 0 }, /* 3 = read */ - { AS(write_args), (sy_call_t *)write, AUE_WRITE, NULL, 0, 0 }, /* 4 = write */ - { AS(open_args), (sy_call_t *)open, AUE_OPEN_RWTC, NULL, 0, 0 }, /* 5 = open */ - { AS(close_args), (sy_call_t *)close, AUE_CLOSE, NULL, 0, 0 }, /* 6 = close */ - { AS(freebsd32_wait4_args), (sy_call_t *)freebsd32_wait4, AUE_WAIT4, NULL, 0, 0 }, /* 7 = freebsd32_wait4 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 8 = obsolete old creat */ - { AS(link_args), (sy_call_t *)link, AUE_LINK, NULL, 0, 0 }, /* 9 = link */ - { AS(unlink_args), (sy_call_t *)unlink, AUE_UNLINK, NULL, 0, 0 }, /* 10 = unlink */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 11 = obsolete execv */ - { AS(chdir_args), (sy_call_t *)chdir, AUE_CHDIR, NULL, 0, 0 }, /* 12 = chdir */ - { AS(fchdir_args), (sy_call_t *)fchdir, AUE_FCHDIR, NULL, 0, 0 }, /* 13 = fchdir */ - { AS(mknod_args), (sy_call_t *)mknod, AUE_MKNOD, NULL, 0, 0 }, /* 14 = mknod */ - { AS(chmod_args), (sy_call_t *)chmod, AUE_CHMOD, NULL, 0, 0 }, /* 15 = chmod */ - { AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0 }, /* 16 = chown */ - { AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0 }, /* 17 = break */ - { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0 }, /* 18 = old freebsd32_getfsstat */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 19 = obsolete olseek */ - { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0 }, /* 20 = getpid */ - { AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0 }, /* 21 = mount */ - { AS(unmount_args), (sy_call_t *)unmount, AUE_UMOUNT, NULL, 0, 0 }, /* 22 = unmount */ - { AS(setuid_args), (sy_call_t *)setuid, AUE_SETUID, NULL, 0, 0 }, /* 23 = setuid */ - { 0, (sy_call_t *)getuid, AUE_GETUID, NULL, 0, 0 }, /* 24 = getuid */ - { 0, (sy_call_t *)geteuid, AUE_GETEUID, NULL, 0, 0 }, /* 25 = geteuid */ - { AS(ptrace_args), (sy_call_t *)ptrace, AUE_PTRACE, NULL, 0, 0 }, /* 26 = ptrace */ - { AS(freebsd32_recvmsg_args), (sy_call_t *)freebsd32_recvmsg, AUE_RECVMSG, NULL, 0, 0 }, /* 27 = freebsd32_recvmsg */ - { AS(freebsd32_sendmsg_args), (sy_call_t *)freebsd32_sendmsg, AUE_SENDMSG, NULL, 0, 0 }, /* 28 = freebsd32_sendmsg */ - { AS(freebsd32_recvfrom_args), (sy_call_t *)freebsd32_recvfrom, AUE_RECVFROM, NULL, 0, 0 }, /* 29 = freebsd32_recvfrom */ - { AS(accept_args), (sy_call_t *)accept, AUE_ACCEPT, NULL, 0, 0 }, /* 30 = accept */ - { AS(getpeername_args), (sy_call_t *)getpeername, AUE_GETPEERNAME, NULL, 0, 0 }, /* 31 = getpeername */ - { AS(getsockname_args), (sy_call_t *)getsockname, AUE_GETSOCKNAME, NULL, 0, 0 }, /* 32 = getsockname */ - { AS(access_args), (sy_call_t *)access, AUE_ACCESS, NULL, 0, 0 }, /* 33 = access */ - { AS(chflags_args), (sy_call_t *)chflags, AUE_CHFLAGS, NULL, 0, 0 }, /* 34 = chflags */ - { AS(fchflags_args), (sy_call_t *)fchflags, AUE_FCHFLAGS, NULL, 0, 0 }, /* 35 = fchflags */ - { 0, (sy_call_t *)sync, AUE_SYNC, NULL, 0, 0 }, /* 36 = sync */ - { AS(kill_args), (sy_call_t *)kill, AUE_KILL, NULL, 0, 0 }, /* 37 = kill */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 38 = ostat */ - { 0, (sy_call_t *)getppid, AUE_GETPPID, NULL, 0, 0 }, /* 39 = getppid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 40 = olstat */ - { AS(dup_args), (sy_call_t *)dup, AUE_DUP, NULL, 0, 0 }, /* 41 = dup */ - { 0, (sy_call_t *)pipe, AUE_PIPE, NULL, 0, 0 }, /* 42 = pipe */ - { 0, (sy_call_t *)getegid, AUE_GETEGID, NULL, 0, 0 }, /* 43 = getegid */ - { AS(profil_args), (sy_call_t *)profil, AUE_PROFILE, NULL, 0, 0 }, /* 44 = profil */ - { AS(ktrace_args), (sy_call_t *)ktrace, AUE_KTRACE, NULL, 0, 0 }, /* 45 = ktrace */ - { compat(AS(ofreebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0 }, /* 46 = old freebsd32_sigaction */ - { 0, (sy_call_t *)getgid, AUE_GETGID, NULL, 0, 0 }, /* 47 = getgid */ - { compat(AS(ofreebsd32_sigprocmask_args),freebsd32_sigprocmask), AUE_SIGPROCMASK, NULL, 0, 0 }, /* 48 = old freebsd32_sigprocmask */ - { AS(getlogin_args), (sy_call_t *)getlogin, AUE_GETLOGIN, NULL, 0, 0 }, /* 49 = getlogin */ - { AS(setlogin_args), (sy_call_t *)setlogin, AUE_SETLOGIN, NULL, 0, 0 }, /* 50 = setlogin */ - { AS(acct_args), (sy_call_t *)acct, AUE_ACCT, NULL, 0, 0 }, /* 51 = acct */ - { compat(0,freebsd32_sigpending), AUE_SIGPENDING, NULL, 0, 0 }, /* 52 = old freebsd32_sigpending */ - { AS(freebsd32_sigaltstack_args), (sy_call_t *)freebsd32_sigaltstack, AUE_SIGALTSTACK, NULL, 0, 0 }, /* 53 = freebsd32_sigaltstack */ - { AS(freebsd32_ioctl_args), (sy_call_t *)freebsd32_ioctl, AUE_NULL, NULL, 0, 0 }, /* 54 = freebsd32_ioctl */ - { AS(reboot_args), (sy_call_t *)reboot, AUE_REBOOT, NULL, 0, 0 }, /* 55 = reboot */ - { AS(revoke_args), (sy_call_t *)revoke, AUE_REVOKE, NULL, 0, 0 }, /* 56 = revoke */ - { AS(symlink_args), (sy_call_t *)symlink, AUE_SYMLINK, NULL, 0, 0 }, /* 57 = symlink */ - { AS(readlink_args), (sy_call_t *)readlink, AUE_READLINK, NULL, 0, 0 }, /* 58 = readlink */ - { AS(freebsd32_execve_args), (sy_call_t *)freebsd32_execve, AUE_EXECVE, NULL, 0, 0 }, /* 59 = freebsd32_execve */ - { AS(umask_args), (sy_call_t *)umask, AUE_UMASK, NULL, 0, 0 }, /* 60 = umask */ - { AS(chroot_args), (sy_call_t *)chroot, AUE_CHROOT, NULL, 0, 0 }, /* 61 = chroot */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 62 = obsolete ofstat */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 63 = obsolete ogetkerninfo */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 64 = obsolete ogetpagesize */ - { AS(msync_args), (sy_call_t *)msync, AUE_MSYNC, NULL, 0, 0 }, /* 65 = msync */ - { 0, (sy_call_t *)vfork, AUE_VFORK, NULL, 0, 0 }, /* 66 = vfork */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 67 = obsolete vread */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 68 = obsolete vwrite */ - { AS(sbrk_args), (sy_call_t *)sbrk, AUE_SBRK, NULL, 0, 0 }, /* 69 = sbrk */ - { AS(sstk_args), (sy_call_t *)sstk, AUE_SSTK, NULL, 0, 0 }, /* 70 = sstk */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 71 = obsolete ommap */ - { AS(ovadvise_args), (sy_call_t *)ovadvise, AUE_O_VADVISE, NULL, 0, 0 }, /* 72 = vadvise */ - { AS(munmap_args), (sy_call_t *)munmap, AUE_MUNMAP, NULL, 0, 0 }, /* 73 = munmap */ - { AS(mprotect_args), (sy_call_t *)mprotect, AUE_MPROTECT, NULL, 0, 0 }, /* 74 = mprotect */ - { AS(madvise_args), (sy_call_t *)madvise, AUE_MADVISE, NULL, 0, 0 }, /* 75 = madvise */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 76 = obsolete vhangup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 77 = obsolete vlimit */ - { AS(mincore_args), (sy_call_t *)mincore, AUE_MINCORE, NULL, 0, 0 }, /* 78 = mincore */ - { AS(getgroups_args), (sy_call_t *)getgroups, AUE_GETGROUPS, NULL, 0, 0 }, /* 79 = getgroups */ - { AS(setgroups_args), (sy_call_t *)setgroups, AUE_SETGROUPS, NULL, 0, 0 }, /* 80 = setgroups */ - { 0, (sy_call_t *)getpgrp, AUE_GETPGRP, NULL, 0, 0 }, /* 81 = getpgrp */ - { AS(setpgid_args), (sy_call_t *)setpgid, AUE_SETPGRP, NULL, 0, 0 }, /* 82 = setpgid */ - { AS(freebsd32_setitimer_args), (sy_call_t *)freebsd32_setitimer, AUE_SETITIMER, NULL, 0, 0 }, /* 83 = freebsd32_setitimer */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 84 = obsolete owait */ - { AS(swapon_args), (sy_call_t *)swapon, AUE_SWAPON, NULL, 0, 0 }, /* 85 = swapon */ - { AS(freebsd32_getitimer_args), (sy_call_t *)freebsd32_getitimer, AUE_GETITIMER, NULL, 0, 0 }, /* 86 = freebsd32_getitimer */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 87 = obsolete ogethostname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 88 = obsolete osethostname */ - { 0, (sy_call_t *)getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0 }, /* 89 = getdtablesize */ - { AS(dup2_args), (sy_call_t *)dup2, AUE_DUP2, NULL, 0, 0 }, /* 90 = dup2 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 91 = getdopt */ - { AS(fcntl_args), (sy_call_t *)fcntl, AUE_FCNTL, NULL, 0, 0 }, /* 92 = fcntl */ - { AS(freebsd32_select_args), (sy_call_t *)freebsd32_select, AUE_SELECT, NULL, 0, 0 }, /* 93 = freebsd32_select */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 94 = setdopt */ - { AS(fsync_args), (sy_call_t *)fsync, AUE_FSYNC, NULL, 0, 0 }, /* 95 = fsync */ - { AS(setpriority_args), (sy_call_t *)setpriority, AUE_SETPRIORITY, NULL, 0, 0 }, /* 96 = setpriority */ - { AS(socket_args), (sy_call_t *)socket, AUE_SOCKET, NULL, 0, 0 }, /* 97 = socket */ - { AS(connect_args), (sy_call_t *)connect, AUE_CONNECT, NULL, 0, 0 }, /* 98 = connect */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 99 = obsolete oaccept */ - { AS(getpriority_args), (sy_call_t *)getpriority, AUE_GETPRIORITY, NULL, 0, 0 }, /* 100 = getpriority */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 101 = obsolete osend */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 102 = obsolete orecv */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 103 = obsolete osigreturn */ - { AS(bind_args), (sy_call_t *)bind, AUE_BIND, NULL, 0, 0 }, /* 104 = bind */ - { AS(setsockopt_args), (sy_call_t *)setsockopt, AUE_SETSOCKOPT, NULL, 0, 0 }, /* 105 = setsockopt */ - { AS(listen_args), (sy_call_t *)listen, AUE_LISTEN, NULL, 0, 0 }, /* 106 = listen */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 107 = obsolete vtimes */ - { compat(AS(ofreebsd32_sigvec_args),freebsd32_sigvec), AUE_O_SIGVEC, NULL, 0, 0 }, /* 108 = old freebsd32_sigvec */ - { compat(AS(ofreebsd32_sigblock_args),freebsd32_sigblock), AUE_O_SIGBLOCK, NULL, 0, 0 }, /* 109 = old freebsd32_sigblock */ - { compat(AS(ofreebsd32_sigsetmask_args),freebsd32_sigsetmask), AUE_O_SIGSETMASK, NULL, 0, 0 }, /* 110 = old freebsd32_sigsetmask */ - { compat(AS(ofreebsd32_sigsuspend_args),freebsd32_sigsuspend), AUE_SIGSUSPEND, NULL, 0, 0 }, /* 111 = old freebsd32_sigsuspend */ - { compat(AS(ofreebsd32_sigstack_args),freebsd32_sigstack), AUE_O_SIGSTACK, NULL, 0, 0 }, /* 112 = old freebsd32_sigstack */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 113 = obsolete orecvmsg */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 114 = obsolete osendmsg */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 115 = obsolete vtrace */ - { AS(freebsd32_gettimeofday_args), (sy_call_t *)freebsd32_gettimeofday, AUE_GETTIMEOFDAY, NULL, 0, 0 }, /* 116 = freebsd32_gettimeofday */ - { AS(freebsd32_getrusage_args), (sy_call_t *)freebsd32_getrusage, AUE_GETRUSAGE, NULL, 0, 0 }, /* 117 = freebsd32_getrusage */ - { AS(getsockopt_args), (sy_call_t *)getsockopt, AUE_GETSOCKOPT, NULL, 0, 0 }, /* 118 = getsockopt */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 119 = resuba */ - { AS(freebsd32_readv_args), (sy_call_t *)freebsd32_readv, AUE_READV, NULL, 0, 0 }, /* 120 = freebsd32_readv */ - { AS(freebsd32_writev_args), (sy_call_t *)freebsd32_writev, AUE_WRITEV, NULL, 0, 0 }, /* 121 = freebsd32_writev */ - { AS(freebsd32_settimeofday_args), (sy_call_t *)freebsd32_settimeofday, AUE_SETTIMEOFDAY, NULL, 0, 0 }, /* 122 = freebsd32_settimeofday */ - { AS(fchown_args), (sy_call_t *)fchown, AUE_FCHOWN, NULL, 0, 0 }, /* 123 = fchown */ - { AS(fchmod_args), (sy_call_t *)fchmod, AUE_FCHMOD, NULL, 0, 0 }, /* 124 = fchmod */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 125 = obsolete orecvfrom */ - { AS(setreuid_args), (sy_call_t *)setreuid, AUE_SETREUID, NULL, 0, 0 }, /* 126 = setreuid */ - { AS(setregid_args), (sy_call_t *)setregid, AUE_SETREGID, NULL, 0, 0 }, /* 127 = setregid */ - { AS(rename_args), (sy_call_t *)rename, AUE_RENAME, NULL, 0, 0 }, /* 128 = rename */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 129 = obsolete otruncate */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 130 = obsolete ftruncate */ - { AS(flock_args), (sy_call_t *)flock, AUE_FLOCK, NULL, 0, 0 }, /* 131 = flock */ - { AS(mkfifo_args), (sy_call_t *)mkfifo, AUE_MKFIFO, NULL, 0, 0 }, /* 132 = mkfifo */ - { AS(sendto_args), (sy_call_t *)sendto, AUE_SENDTO, NULL, 0, 0 }, /* 133 = sendto */ - { AS(shutdown_args), (sy_call_t *)shutdown, AUE_SHUTDOWN, NULL, 0, 0 }, /* 134 = shutdown */ - { AS(socketpair_args), (sy_call_t *)socketpair, AUE_SOCKETPAIR, NULL, 0, 0 }, /* 135 = socketpair */ - { AS(mkdir_args), (sy_call_t *)mkdir, AUE_MKDIR, NULL, 0, 0 }, /* 136 = mkdir */ - { AS(rmdir_args), (sy_call_t *)rmdir, AUE_RMDIR, NULL, 0, 0 }, /* 137 = rmdir */ - { AS(freebsd32_utimes_args), (sy_call_t *)freebsd32_utimes, AUE_UTIMES, NULL, 0, 0 }, /* 138 = freebsd32_utimes */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 139 = obsolete 4.2 sigreturn */ - { AS(freebsd32_adjtime_args), (sy_call_t *)freebsd32_adjtime, AUE_ADJTIME, NULL, 0, 0 }, /* 140 = freebsd32_adjtime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 141 = obsolete ogetpeername */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 142 = obsolete ogethostid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 143 = obsolete sethostid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 144 = obsolete getrlimit */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 145 = obsolete setrlimit */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 146 = obsolete killpg */ - { 0, (sy_call_t *)setsid, AUE_SETSID, NULL, 0, 0 }, /* 147 = setsid */ - { AS(quotactl_args), (sy_call_t *)quotactl, AUE_QUOTACTL, NULL, 0, 0 }, /* 148 = quotactl */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 149 = obsolete oquota */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 150 = obsolete ogetsockname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 151 = sem_lock */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 152 = sem_wakeup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 153 = asyncdaemon */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 154 = nlm_syscall */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 155 = nfssvc */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 156 = obsolete ogetdirentries */ - { compat4(AS(freebsd4_freebsd32_statfs_args),freebsd32_statfs), AUE_STATFS, NULL, 0, 0 }, /* 157 = old freebsd32_statfs */ - { compat4(AS(freebsd4_freebsd32_fstatfs_args),freebsd32_fstatfs), AUE_FSTATFS, NULL, 0, 0 }, /* 158 = old freebsd32_fstatfs */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 159 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 160 = lgetfh */ - { AS(getfh_args), (sy_call_t *)getfh, AUE_NFS_GETFH, NULL, 0, 0 }, /* 161 = getfh */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 162 = obsolete getdomainname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 163 = obsolete setdomainname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 164 = obsolete uname */ - { AS(freebsd32_sysarch_args), (sy_call_t *)freebsd32_sysarch, AUE_SYSARCH, NULL, 0, 0 }, /* 165 = freebsd32_sysarch */ - { AS(rtprio_args), (sy_call_t *)rtprio, AUE_RTPRIO, NULL, 0, 0 }, /* 166 = rtprio */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 167 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 168 = nosys */ - { AS(freebsd32_semsys_args), (sy_call_t *)freebsd32_semsys, AUE_SEMSYS, NULL, 0, 0 }, /* 169 = freebsd32_semsys */ - { AS(freebsd32_msgsys_args), (sy_call_t *)freebsd32_msgsys, AUE_MSGSYS, NULL, 0, 0 }, /* 170 = freebsd32_msgsys */ - { AS(freebsd32_shmsys_args), (sy_call_t *)freebsd32_shmsys, AUE_SHMSYS, NULL, 0, 0 }, /* 171 = freebsd32_shmsys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 172 = nosys */ - { compat6(AS(freebsd6_freebsd32_pread_args),freebsd32_pread), AUE_PREAD, NULL, 0, 0 }, /* 173 = old freebsd32_pread */ - { compat6(AS(freebsd6_freebsd32_pwrite_args),freebsd32_pwrite), AUE_PWRITE, NULL, 0, 0 }, /* 174 = old freebsd32_pwrite */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 175 = nosys */ - { AS(ntp_adjtime_args), (sy_call_t *)ntp_adjtime, AUE_NTP_ADJTIME, NULL, 0, 0 }, /* 176 = ntp_adjtime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 177 = sfork */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 178 = getdescriptor */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 179 = setdescriptor */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 180 = nosys */ - { AS(setgid_args), (sy_call_t *)setgid, AUE_SETGID, NULL, 0, 0 }, /* 181 = setgid */ - { AS(setegid_args), (sy_call_t *)setegid, AUE_SETEGID, NULL, 0, 0 }, /* 182 = setegid */ - { AS(seteuid_args), (sy_call_t *)seteuid, AUE_SETEUID, NULL, 0, 0 }, /* 183 = seteuid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 184 = lfs_bmapv */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 185 = lfs_markv */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 186 = lfs_segclean */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 187 = lfs_segwait */ - { AS(freebsd32_stat_args), (sy_call_t *)freebsd32_stat, AUE_STAT, NULL, 0, 0 }, /* 188 = freebsd32_stat */ - { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0 }, /* 189 = freebsd32_fstat */ - { AS(freebsd32_lstat_args), (sy_call_t *)freebsd32_lstat, AUE_LSTAT, NULL, 0, 0 }, /* 190 = freebsd32_lstat */ - { AS(pathconf_args), (sy_call_t *)pathconf, AUE_PATHCONF, NULL, 0, 0 }, /* 191 = pathconf */ - { AS(fpathconf_args), (sy_call_t *)fpathconf, AUE_FPATHCONF, NULL, 0, 0 }, /* 192 = fpathconf */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 193 = nosys */ - { AS(__getrlimit_args), (sy_call_t *)getrlimit, AUE_GETRLIMIT, NULL, 0, 0 }, /* 194 = getrlimit */ - { AS(__setrlimit_args), (sy_call_t *)setrlimit, AUE_SETRLIMIT, NULL, 0, 0 }, /* 195 = setrlimit */ - { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 196 = freebsd32_getdirentries */ - { compat6(AS(freebsd6_freebsd32_mmap_args),freebsd32_mmap), AUE_MMAP, NULL, 0, 0 }, /* 197 = old freebsd32_mmap */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 198 = __syscall */ - { compat6(AS(freebsd6_freebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0 }, /* 199 = old freebsd32_lseek */ - { compat6(AS(freebsd6_freebsd32_truncate_args),freebsd32_truncate), AUE_TRUNCATE, NULL, 0, 0 }, /* 200 = old freebsd32_truncate */ - { compat6(AS(freebsd6_freebsd32_ftruncate_args),freebsd32_ftruncate), AUE_FTRUNCATE, NULL, 0, 0 }, /* 201 = old freebsd32_ftruncate */ - { AS(freebsd32_sysctl_args), (sy_call_t *)freebsd32_sysctl, AUE_SYSCTL, NULL, 0, 0 }, /* 202 = freebsd32_sysctl */ - { AS(mlock_args), (sy_call_t *)mlock, AUE_MLOCK, NULL, 0, 0 }, /* 203 = mlock */ - { AS(munlock_args), (sy_call_t *)munlock, AUE_MUNLOCK, NULL, 0, 0 }, /* 204 = munlock */ - { AS(undelete_args), (sy_call_t *)undelete, AUE_UNDELETE, NULL, 0, 0 }, /* 205 = undelete */ - { AS(freebsd32_futimes_args), (sy_call_t *)freebsd32_futimes, AUE_FUTIMES, NULL, 0, 0 }, /* 206 = freebsd32_futimes */ - { AS(getpgid_args), (sy_call_t *)getpgid, AUE_GETPGID, NULL, 0, 0 }, /* 207 = getpgid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 208 = newreboot */ - { AS(poll_args), (sy_call_t *)poll, AUE_POLL, NULL, 0, 0 }, /* 209 = poll */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 210 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 211 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 212 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 213 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 214 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 215 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 216 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 217 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 218 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 219 = lkmnosys */ - { AS(freebsd32_semctl_args), (sy_call_t *)freebsd32_semctl, AUE_SEMCTL, NULL, 0, 0 }, /* 220 = freebsd32_semctl */ - { AS(semget_args), (sy_call_t *)semget, AUE_SEMGET, NULL, 0, 0 }, /* 221 = semget */ - { AS(semop_args), (sy_call_t *)semop, AUE_SEMOP, NULL, 0, 0 }, /* 222 = semop */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 223 = semconfig */ - { AS(freebsd32_msgctl_args), (sy_call_t *)freebsd32_msgctl, AUE_MSGCTL, NULL, 0, 0 }, /* 224 = freebsd32_msgctl */ - { AS(msgget_args), (sy_call_t *)msgget, AUE_MSGGET, NULL, 0, 0 }, /* 225 = msgget */ - { AS(freebsd32_msgsnd_args), (sy_call_t *)freebsd32_msgsnd, AUE_MSGSND, NULL, 0, 0 }, /* 226 = freebsd32_msgsnd */ - { AS(freebsd32_msgrcv_args), (sy_call_t *)freebsd32_msgrcv, AUE_MSGRCV, NULL, 0, 0 }, /* 227 = freebsd32_msgrcv */ - { AS(shmat_args), (sy_call_t *)shmat, AUE_SHMAT, NULL, 0, 0 }, /* 228 = shmat */ - { AS(freebsd32_shmctl_args), (sy_call_t *)freebsd32_shmctl, AUE_SHMCTL, NULL, 0, 0 }, /* 229 = freebsd32_shmctl */ - { AS(shmdt_args), (sy_call_t *)shmdt, AUE_SHMDT, NULL, 0, 0 }, /* 230 = shmdt */ - { AS(shmget_args), (sy_call_t *)shmget, AUE_SHMGET, NULL, 0, 0 }, /* 231 = shmget */ - { AS(freebsd32_clock_gettime_args), (sy_call_t *)freebsd32_clock_gettime, AUE_NULL, NULL, 0, 0 }, /* 232 = freebsd32_clock_gettime */ - { AS(freebsd32_clock_settime_args), (sy_call_t *)freebsd32_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0 }, /* 233 = freebsd32_clock_settime */ - { AS(freebsd32_clock_getres_args), (sy_call_t *)freebsd32_clock_getres, AUE_NULL, NULL, 0, 0 }, /* 234 = freebsd32_clock_getres */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 235 = timer_create */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 236 = timer_delete */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 237 = timer_settime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 238 = timer_gettime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 239 = timer_getoverrun */ - { AS(freebsd32_nanosleep_args), (sy_call_t *)freebsd32_nanosleep, AUE_NULL, NULL, 0, 0 }, /* 240 = freebsd32_nanosleep */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 241 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 242 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 243 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 244 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 245 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 246 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 247 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 248 = ntp_gettime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 249 = nosys */ - { AS(minherit_args), (sy_call_t *)minherit, AUE_MINHERIT, NULL, 0, 0 }, /* 250 = minherit */ - { AS(rfork_args), (sy_call_t *)rfork, AUE_RFORK, NULL, 0, 0 }, /* 251 = rfork */ - { AS(openbsd_poll_args), (sy_call_t *)openbsd_poll, AUE_POLL, NULL, 0, 0 }, /* 252 = openbsd_poll */ - { 0, (sy_call_t *)issetugid, AUE_ISSETUGID, NULL, 0, 0 }, /* 253 = issetugid */ - { AS(lchown_args), (sy_call_t *)lchown, AUE_LCHOWN, NULL, 0, 0 }, /* 254 = lchown */ - { AS(freebsd32_aio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 255 = freebsd32_aio_read */ - { AS(freebsd32_aio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 256 = freebsd32_aio_write */ - { AS(freebsd32_lio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 257 = freebsd32_lio_listio */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 258 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 259 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 260 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 261 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 262 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 263 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 264 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 265 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 266 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 267 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 268 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 269 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 270 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 271 = nosys */ - { AS(getdents_args), (sy_call_t *)getdents, AUE_O_GETDENTS, NULL, 0, 0 }, /* 272 = getdents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 273 = nosys */ - { AS(lchmod_args), (sy_call_t *)lchmod, AUE_LCHMOD, NULL, 0, 0 }, /* 274 = lchmod */ - { AS(lchown_args), (sy_call_t *)lchown, AUE_LCHOWN, NULL, 0, 0 }, /* 275 = netbsd_lchown */ - { AS(freebsd32_lutimes_args), (sy_call_t *)freebsd32_lutimes, AUE_LUTIMES, NULL, 0, 0 }, /* 276 = freebsd32_lutimes */ - { AS(msync_args), (sy_call_t *)msync, AUE_MSYNC, NULL, 0, 0 }, /* 277 = netbsd_msync */ - { AS(nstat_args), (sy_call_t *)nstat, AUE_STAT, NULL, 0, 0 }, /* 278 = nstat */ - { AS(nfstat_args), (sy_call_t *)nfstat, AUE_FSTAT, NULL, 0, 0 }, /* 279 = nfstat */ - { AS(nlstat_args), (sy_call_t *)nlstat, AUE_LSTAT, NULL, 0, 0 }, /* 280 = nlstat */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 281 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 282 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 283 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 284 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 285 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 286 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 287 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 288 = nosys */ - { AS(freebsd32_preadv_args), (sy_call_t *)freebsd32_preadv, AUE_PREADV, NULL, 0, 0 }, /* 289 = freebsd32_preadv */ - { AS(freebsd32_pwritev_args), (sy_call_t *)freebsd32_pwritev, AUE_PWRITEV, NULL, 0, 0 }, /* 290 = freebsd32_pwritev */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 291 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 292 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 293 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 294 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 295 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 296 = nosys */ - { compat4(AS(freebsd4_freebsd32_fhstatfs_args),freebsd32_fhstatfs), AUE_FHSTATFS, NULL, 0, 0 }, /* 297 = old freebsd32_fhstatfs */ - { AS(fhopen_args), (sy_call_t *)fhopen, AUE_FHOPEN, NULL, 0, 0 }, /* 298 = fhopen */ - { AS(fhstat_args), (sy_call_t *)fhstat, AUE_FHSTAT, NULL, 0, 0 }, /* 299 = fhstat */ - { AS(modnext_args), (sy_call_t *)modnext, AUE_NULL, NULL, 0, 0 }, /* 300 = modnext */ - { AS(freebsd32_modstat_args), (sy_call_t *)freebsd32_modstat, AUE_NULL, NULL, 0, 0 }, /* 301 = freebsd32_modstat */ - { AS(modfnext_args), (sy_call_t *)modfnext, AUE_NULL, NULL, 0, 0 }, /* 302 = modfnext */ - { AS(modfind_args), (sy_call_t *)modfind, AUE_NULL, NULL, 0, 0 }, /* 303 = modfind */ - { AS(kldload_args), (sy_call_t *)kldload, AUE_MODLOAD, NULL, 0, 0 }, /* 304 = kldload */ - { AS(kldunload_args), (sy_call_t *)kldunload, AUE_MODUNLOAD, NULL, 0, 0 }, /* 305 = kldunload */ - { AS(kldfind_args), (sy_call_t *)kldfind, AUE_NULL, NULL, 0, 0 }, /* 306 = kldfind */ - { AS(kldnext_args), (sy_call_t *)kldnext, AUE_NULL, NULL, 0, 0 }, /* 307 = kldnext */ - { AS(kldstat_args), (sy_call_t *)kldstat, AUE_NULL, NULL, 0, 0 }, /* 308 = kldstat */ - { AS(kldfirstmod_args), (sy_call_t *)kldfirstmod, AUE_NULL, NULL, 0, 0 }, /* 309 = kldfirstmod */ - { AS(getsid_args), (sy_call_t *)getsid, AUE_GETSID, NULL, 0, 0 }, /* 310 = getsid */ - { AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0 }, /* 311 = setresuid */ - { AS(setresgid_args), (sy_call_t *)setresgid, AUE_SETRESGID, NULL, 0, 0 }, /* 312 = setresgid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 313 = obsolete signanosleep */ - { AS(freebsd32_aio_return_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 314 = freebsd32_aio_return */ - { AS(freebsd32_aio_suspend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 315 = freebsd32_aio_suspend */ - { AS(freebsd32_aio_cancel_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 316 = freebsd32_aio_cancel */ - { AS(freebsd32_aio_error_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 317 = freebsd32_aio_error */ - { AS(freebsd32_oaio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 318 = freebsd32_oaio_read */ - { AS(freebsd32_oaio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 319 = freebsd32_oaio_write */ - { AS(freebsd32_olio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 320 = freebsd32_olio_listio */ - { 0, (sy_call_t *)yield, AUE_NULL, NULL, 0, 0 }, /* 321 = yield */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 322 = obsolete thr_sleep */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 323 = obsolete thr_wakeup */ - { AS(mlockall_args), (sy_call_t *)mlockall, AUE_MLOCKALL, NULL, 0, 0 }, /* 324 = mlockall */ - { 0, (sy_call_t *)munlockall, AUE_MUNLOCKALL, NULL, 0, 0 }, /* 325 = munlockall */ - { AS(__getcwd_args), (sy_call_t *)__getcwd, AUE_GETCWD, NULL, 0, 0 }, /* 326 = __getcwd */ - { AS(sched_setparam_args), (sy_call_t *)sched_setparam, AUE_NULL, NULL, 0, 0 }, /* 327 = sched_setparam */ - { AS(sched_getparam_args), (sy_call_t *)sched_getparam, AUE_NULL, NULL, 0, 0 }, /* 328 = sched_getparam */ - { AS(sched_setscheduler_args), (sy_call_t *)sched_setscheduler, AUE_NULL, NULL, 0, 0 }, /* 329 = sched_setscheduler */ - { AS(sched_getscheduler_args), (sy_call_t *)sched_getscheduler, AUE_NULL, NULL, 0, 0 }, /* 330 = sched_getscheduler */ - { 0, (sy_call_t *)sched_yield, AUE_NULL, NULL, 0, 0 }, /* 331 = sched_yield */ - { AS(sched_get_priority_max_args), (sy_call_t *)sched_get_priority_max, AUE_NULL, NULL, 0, 0 }, /* 332 = sched_get_priority_max */ - { AS(sched_get_priority_min_args), (sy_call_t *)sched_get_priority_min, AUE_NULL, NULL, 0, 0 }, /* 333 = sched_get_priority_min */ - { AS(sched_rr_get_interval_args), (sy_call_t *)sched_rr_get_interval, AUE_NULL, NULL, 0, 0 }, /* 334 = sched_rr_get_interval */ - { AS(utrace_args), (sy_call_t *)utrace, AUE_NULL, NULL, 0, 0 }, /* 335 = utrace */ - { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0 }, /* 336 = old freebsd32_sendfile */ - { AS(kldsym_args), (sy_call_t *)kldsym, AUE_NULL, NULL, 0, 0 }, /* 337 = kldsym */ - { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, NULL, 0, 0 }, /* 338 = freebsd32_jail */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 339 = pioctl */ - { AS(sigprocmask_args), (sy_call_t *)sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0 }, /* 340 = sigprocmask */ - { AS(sigsuspend_args), (sy_call_t *)sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0 }, /* 341 = sigsuspend */ - { compat4(AS(freebsd4_freebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0 }, /* 342 = old freebsd32_sigaction */ - { AS(sigpending_args), (sy_call_t *)sigpending, AUE_SIGPENDING, NULL, 0, 0 }, /* 343 = sigpending */ - { compat4(AS(freebsd4_freebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0 }, /* 344 = old freebsd32_sigreturn */ - { AS(freebsd32_sigtimedwait_args), (sy_call_t *)freebsd32_sigtimedwait, AUE_SIGWAIT, NULL, 0, 0 }, /* 345 = freebsd32_sigtimedwait */ - { AS(freebsd32_sigwaitinfo_args), (sy_call_t *)freebsd32_sigwaitinfo, AUE_NULL, NULL, 0, 0 }, /* 346 = freebsd32_sigwaitinfo */ - { AS(__acl_get_file_args), (sy_call_t *)__acl_get_file, AUE_NULL, NULL, 0, 0 }, /* 347 = __acl_get_file */ - { AS(__acl_set_file_args), (sy_call_t *)__acl_set_file, AUE_NULL, NULL, 0, 0 }, /* 348 = __acl_set_file */ - { AS(__acl_get_fd_args), (sy_call_t *)__acl_get_fd, AUE_NULL, NULL, 0, 0 }, /* 349 = __acl_get_fd */ - { AS(__acl_set_fd_args), (sy_call_t *)__acl_set_fd, AUE_NULL, NULL, 0, 0 }, /* 350 = __acl_set_fd */ - { AS(__acl_delete_file_args), (sy_call_t *)__acl_delete_file, AUE_NULL, NULL, 0, 0 }, /* 351 = __acl_delete_file */ - { AS(__acl_delete_fd_args), (sy_call_t *)__acl_delete_fd, AUE_NULL, NULL, 0, 0 }, /* 352 = __acl_delete_fd */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 16:22:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F0D81065692; Mon, 1 Jun 2009 16:22:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D88F8FC25; Mon, 1 Jun 2009 16:22:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51GM1QZ084184; Mon, 1 Jun 2009 16:22:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51GM1O4084183; Mon, 1 Jun 2009 16:22:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200906011622.n51GM1O4084183@svn.freebsd.org> From: Warner Losh Date: Mon, 1 Jun 2009 16:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193236 - head/sys/dev/bwi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 16:22:02 -0000 Author: imp Date: Mon Jun 1 16:22:01 2009 New Revision: 193236 URL: http://svn.freebsd.org/changeset/base/193236 Log: Add a comment about what may be happening when we get certain messages. No change to actual code. Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:14:38 2009 (r193235) +++ head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:22:01 2009 (r193236) @@ -1628,6 +1628,23 @@ bwi_intr(void *xsc) /* Disable all interrupts */ bwi_disable_intrs(sc, BWI_ALL_INTRS); + /* + * http://bcm-specs.sipsolutions.net/Interrupts + * Says for this bit (0x800): + * "Fatal Error + * + * We got this one while testing things when by accident the + * template ram wasn't set to big endian when it should have + * been after writing the initial values. It keeps on being + * triggered, the only way to stop it seems to shut down the + * chip." + * + * Suggesting that we should never get it and if we do we're not + * feeding TX packets into the MAC correctly if we do... Apparently, + * it is valid only on mac version 5 and higher, but I couldn't + * find a reference for that... Since I see them from time to time + * on my card, this suggests an error in the tx path still... + */ if (intr_status & BWI_INTR_PHY_TXERR) { if (mac->mac_flags & BWI_MAC_F_PHYE_RESET) { if_printf(ifp, "%s: intr PHY TX error\n", __func__); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 16:27:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76A1210656C2; Mon, 1 Jun 2009 16:27:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6528B8FC14; Mon, 1 Jun 2009 16:27:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51GRDF4084322; Mon, 1 Jun 2009 16:27:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51GRDD4084321; Mon, 1 Jun 2009 16:27:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200906011627.n51GRDD4084321@svn.freebsd.org> From: Warner Losh Date: Mon, 1 Jun 2009 16:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193237 - head/sys/dev/bwi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 16:27:14 -0000 Author: imp Date: Mon Jun 1 16:27:13 2009 New Revision: 193237 URL: http://svn.freebsd.org/changeset/base/193237 Log: Make sure that we drain the LED blinking callout on detach. Submitted by: Paul B. Mahol Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:22:01 2009 (r193236) +++ head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:27:13 2009 (r193237) @@ -579,6 +579,7 @@ bwi_detach(struct bwi_softc *sc) int i; bwi_stop(sc, 1); + callout_drain(&sc->sc_led_blink_ch); callout_drain(&sc->sc_calib_ch); ieee80211_ifdetach(ic); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 16:29:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A5D7106564A; Mon, 1 Jun 2009 16:29:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 391878FC08; Mon, 1 Jun 2009 16:29:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51GT4jV084393; Mon, 1 Jun 2009 16:29:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51GT4ck084392; Mon, 1 Jun 2009 16:29:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200906011629.n51GT4ck084392@svn.freebsd.org> From: Warner Losh Date: Mon, 1 Jun 2009 16:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193238 - head/sys/dev/bwi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 16:29:04 -0000 Author: imp Date: Mon Jun 1 16:29:03 2009 New Revision: 193238 URL: http://svn.freebsd.org/changeset/base/193238 Log: Move the unlock to after the ifdef (maybe the right fix is to remove the ifdef) since it calls bwi_start_locked, which expects to the lock to be held... Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:27:13 2009 (r193237) +++ head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:29:03 2009 (r193238) @@ -4069,8 +4069,8 @@ bwi_restart(void *xsc, int pending) if_printf(ifp, "%s begin, help!\n", __func__); BWI_LOCK(sc); bwi_init_statechg(xsc, 0); - BWI_UNLOCK(sc); #if 0 bwi_start_locked(ifp); #endif + BWI_UNLOCK(sc); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 16:36:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C2E110656F6; Mon, 1 Jun 2009 16:36:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19D2E8FC12; Mon, 1 Jun 2009 16:36:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51GaSgg084605; Mon, 1 Jun 2009 16:36:28 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51GaSAA084599; Mon, 1 Jun 2009 16:36:28 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906011636.n51GaSAA084599@svn.freebsd.org> From: Sam Leffler Date: Mon, 1 Jun 2009 16:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193239 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 16:36:30 -0000 Author: sam Date: Mon Jun 1 16:36:28 2009 New Revision: 193239 URL: http://svn.freebsd.org/changeset/base/193239 Log: pad data structures to enable integration of future features w/o abi breakage Modified: head/sys/net80211/ieee80211_ht.h head/sys/net80211/ieee80211_ioctl.h head/sys/net80211/ieee80211_node.h head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_scan.h head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_ht.h Mon Jun 1 16:36:28 2009 (r193239) @@ -58,6 +58,7 @@ struct ieee80211_tx_ampdu { int txa_nextrequest;/* soonest to make next request */ struct callout txa_timer; void *txa_private; /* driver-private storage */ + uint64_t txa_pad[4]; }; /* return non-zero if AMPDU tx for the TID is running */ @@ -141,6 +142,7 @@ struct ieee80211_rx_ampdu { int rxa_age; /* age of oldest frame in window */ int rxa_nframes; /* frames since ADDBA */ struct mbuf *rxa_m[IEEE80211_AGGR_BAWMAX]; + uint64_t rxa_pad[4]; }; void ieee80211_ht_attach(struct ieee80211com *); Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_ioctl.h Mon Jun 1 16:36:28 2009 (r193239) @@ -64,6 +64,7 @@ struct ieee80211_nodestats { uint32_t ns_tx_data; /* tx data frames */ uint32_t ns_tx_mgmt; /* tx management frames */ + uint32_t ns_tx_ctrl; /* tx control frames */ uint32_t ns_tx_ucast; /* tx unicast frames */ uint32_t ns_tx_mcast; /* tx multi/broadcast frames */ uint64_t ns_tx_bytes; /* tx data count (bytes) */ @@ -83,6 +84,7 @@ struct ieee80211_nodestats { uint32_t ns_tx_deauth_code; /* last deauth reason */ uint32_t ns_tx_disassoc; /* disassociations */ uint32_t ns_tx_disassoc_code; /* last disassociation reason */ + uint32_t ns_spare[8]; }; /* @@ -101,7 +103,7 @@ struct ieee80211_stats { uint32_t is_rx_wepfail; /* rx wep processing failed */ uint32_t is_rx_decap; /* rx decapsulation failed */ uint32_t is_rx_mgtdiscard; /* rx discard mgt frames */ - uint32_t is_rx_ctl; /* rx discard ctrl frames */ + uint32_t is_rx_ctl; /* rx ctrl frames */ uint32_t is_rx_beacon; /* rx beacon frames */ uint32_t is_rx_rstoobig; /* rx rate set truncated */ uint32_t is_rx_elem_missing; /* rx required element missing*/ @@ -218,7 +220,10 @@ struct ieee80211_stats { uint32_t is_beacon_miss; /* beacon miss notification */ uint32_t is_rx_badstate; /* rx discard state != RUN */ uint32_t is_ff_flush; /* ff's flush'd from stageq */ - uint32_t is_spare[11]; + uint32_t is_tx_ctl; /* tx ctrl frames */ + uint32_t is_ampdu_rexmt; /* A-MPDU frames rexmt ok */ + uint32_t is_ampdu_rexmt_fail; /* A-MPDU frames rexmt fail */ + uint32_t is_spare[16]; }; /* Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_node.h Mon Jun 1 16:36:28 2009 (r193239) @@ -81,6 +81,7 @@ struct ieee80211_ies { uint8_t *htcap_ie; /* captured HTCAP ie */ uint8_t *htinfo_ie; /* captured HTINFO ie */ uint8_t *tdma_ie; /* captured TDMA ie */ + uint8_t *spare[4]; /* NB: these must be the last members of this structure */ uint8_t *data; /* frame data > 802.11 header */ int len; /* data size in bytes */ @@ -192,6 +193,7 @@ struct ieee80211_node { struct ieee80211vap *ni_wdsvap; /* associated WDS vap */ /* XXX move to vap? */ struct ifqueue ni_wdsq; /* wds pending queue */ + uint64_t ni_spare[4]; }; MALLOC_DECLARE(M_80211_NODE); MALLOC_DECLARE(M_80211_NODE_IE); Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_proto.h Mon Jun 1 16:36:28 2009 (r193239) @@ -305,6 +305,7 @@ struct ieee80211_beacon_offsets { uint16_t bo_appie_len; /* AppIE length in bytes */ uint16_t bo_csa_trailer_len;; uint8_t *bo_csa; /* start of CSA element */ + uint8_t *bo_spare[4]; }; struct mbuf *ieee80211_beacon_alloc(struct ieee80211_node *, struct ieee80211_beacon_offsets *); Modified: head/sys/net80211/ieee80211_scan.h ============================================================================== --- head/sys/net80211/ieee80211_scan.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_scan.h Mon Jun 1 16:36:28 2009 (r193239) @@ -211,6 +211,7 @@ struct ieee80211_scanparams { uint8_t *htinfo; uint8_t *ath; uint8_t *tdma; + uint8_t *spare[4]; }; /* @@ -281,6 +282,10 @@ struct ieee80211_scanner { /* iterate over entries in the scan cache */ void (*scan_iterate)(struct ieee80211_scan_state *, ieee80211_scan_iter_func *, void *); + void (*scan_spare0)(void); + void (*scan_spare1)(void); + void (*scan_spare2)(void); + void (*scan_spare4)(void); }; void ieee80211_scanner_register(enum ieee80211_opmode, const struct ieee80211_scanner *); Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_var.h Mon Jun 1 16:36:28 2009 (r193239) @@ -307,6 +307,7 @@ struct ieee80211com { int batimeout, int baseqctl); void (*ic_ampdu_rx_stop)(struct ieee80211_node *, struct ieee80211_rx_ampdu *); + uint64_t ic_spare[8]; }; struct ieee80211_aclator; @@ -456,6 +457,7 @@ struct ieee80211vap { /* 802.3 output method for raw frame xmit */ int (*iv_output)(struct ifnet *, struct mbuf *, struct sockaddr *, struct route *); + uint64_t iv_spare[8]; }; MALLOC_DECLARE(M_80211_VAP); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 16:46:57 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 603E2106564A; Mon, 1 Jun 2009 16:46:57 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 215798FC1E; Mon, 1 Jun 2009 16:46:57 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n51Ghmv7093905; Mon, 1 Jun 2009 10:43:48 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 01 Jun 2009 10:43:58 -0600 (MDT) Message-Id: <20090601.104358.-345495454.imp@bsdimp.com> To: rse@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200906011111.n51BBkZt077175@svn.freebsd.org> References: <200906011111.n51BBkZt077175@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193223 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 16:46:57 -0000 In message: <200906011111.n51BBkZt077175@svn.freebsd.org> "Ralf S. Engelschall" writes: : Author: rse : Date: Mon Jun 1 11:11:46 2009 : New Revision: 193223 : URL: http://svn.freebsd.org/changeset/base/193223 : : Log: : align coding style with style(9) to avoid misunderstandings : : Modified: : head/bin/sh/exec.c : : Modified: head/bin/sh/exec.c : ============================================================================== : --- head/bin/sh/exec.c Mon Jun 1 11:02:09 2009 (r193222) : +++ head/bin/sh/exec.c Mon Jun 1 11:11:46 2009 (r193223) : @@ -187,7 +187,8 @@ padvance(char **path, char *name) : if (*path == NULL) : return NULL; : start = *path; : - for (p = start ; *p && *p != ':' && *p != '%' ; p++); : + for (p = start; *p && *p != ':' && *p != '%'; p++) : + ; /* nothing */ C already has a way of saying this: for (p = start; *p && *p != ':' && *p != '%'; p++) contionue; Warner From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 16:49:10 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C083B1065676; Mon, 1 Jun 2009 16:49:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1448FC19; Mon, 1 Jun 2009 16:49:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n51GjphY093943; Mon, 1 Jun 2009 10:45:52 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 01 Jun 2009 10:46:01 -0600 (MDT) Message-Id: <20090601.104601.1021575663.imp@bsdimp.com> To: jhb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200906010822.19951.jhb@freebsd.org> References: <200905311002.n4VA2K6c037776@svn.freebsd.org> <200906010822.19951.jhb@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, nwhitehorn@FreeBSD.org Subject: Re: svn commit: r193159 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 16:49:11 -0000 In message: <200906010822.19951.jhb@freebsd.org> John Baldwin writes: : On Sunday 31 May 2009 6:02:20 am Nathan Whitehorn wrote: : > Author: nwhitehorn : > Date: Sun May 31 10:02:20 2009 : > New Revision: 193159 : > URL: http://svn.freebsd.org/changeset/base/193159 : > : > Log: : > Provide an analogous sysctl to hw.acpi.acline (dev.pmu.0.acline) to : > determine whether the computer is plugged in to mains power. : : I wonder if it would be a good idea to introduce a : platform-independent 'acline' sysctl? Something like 'hw.acline'? For now : we could simply have these devices create it. We could do something fancier : where AC adapter drivers register with a centralized thingie at some point : and it exports a global setting that is true so long as at least one adapter : is online. I'm not sure that level of complexity is warranted until we have : platforms with multiple AC lines exposed to the OS though. We'll likely need some additional interface to the power system as well. acline is likely to be just the first one... Warner From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:11:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A981F1065678; Mon, 1 Jun 2009 17:11:04 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A2CA18FC0A; Mon, 1 Jun 2009 17:11:03 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA08994; Mon, 01 Jun 2009 19:51:23 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4A24070A.8020508@freebsd.org> Date: Mon, 01 Jun 2009 19:51:22 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.21 (X11/20090406) MIME-Version: 1.0 To: "M. Warner Losh" References: <200906011111.n51BBkZt077175@svn.freebsd.org> <20090601.104358.-345495454.imp@bsdimp.com> In-Reply-To: <20090601.104358.-345495454.imp@bsdimp.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, rse@freebsd.org Subject: Re: svn commit: r193223 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 17:11:05 -0000 on 01/06/2009 19:43 M. Warner Losh said the following: > In message: <200906011111.n51BBkZt077175@svn.freebsd.org> > "Ralf S. Engelschall" writes: > : + for (p = start; *p && *p != ':' && *p != '%'; p++) > : + ; /* nothing */ > > C already has a way of saying this: > > for (p = start; *p && *p != ':' && *p != '%'; p++) > contionue; But style(9) is holy, must never been changed or deviated from. Sorry about that :-) P.S. the typo doesn't deserve any mentioning but just in case :-) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:19:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CB50106567B for ; Mon, 1 Jun 2009 17:19:03 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id EF1A18FC2A for ; Mon, 1 Jun 2009 17:18:58 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 14816 invoked by uid 399); 1 Jun 2009 17:18:50 -0000 Received: from localhost (HELO ?192.168.0.101?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 1 Jun 2009 17:18:50 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4A240D79.1080905@FreeBSD.org> Date: Mon, 01 Jun 2009 10:18:49 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <200906010537.n515bDou065357@svn.freebsd.org> <20090601063455.R12292@maildrop.int.zabbadoz.net> In-Reply-To: <20090601063455.R12292@maildrop.int.zabbadoz.net> X-Enigmail-Version: 0.95.7 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 17:19:03 -0000 Bjoern A. Zeeb wrote: > On Mon, 1 Jun 2009, Doug Barton wrote: > >> Author: dougb >> Date: Mon Jun 1 05:37:13 2009 >> New Revision: 193199 >> URL: http://svn.freebsd.org/changeset/base/193199 >> >> Log: >> Eliminate the warning that "Values of network_interfaces other than >> AUTO are deprecated.' There is no good reason to deprecate them, and >> setting this to different values can be useful for custom solutions >> and/or one-off configuration problems. > > There used to be adisucssion about this last year. > > I think you would have wanted to talk to brooks before who had put > this in: > > http://lists.freebsd.org/pipermail/cvs-all/2008-July/thread.html#263409 The discussion has come up several times on the -rc list from various users who like the functionality and didn't want to see it go away. I'm aware of the argument brooks has put forth in the past that it adds "needless complexity" however I actually use the existing feature, as do other users. FWIW, I also sent an "I am going to remove this if I don't hear an objection" message to the -rc list, although given the impending freeze I didn't wait as long as I usually would have. Leaving the code "as is" costs us nothing in the common case since the default is AUTO and the code to generate the list of interfaces is super-trivial. Removing the existing feature however would be problematic for at least a vocal subset of our user base. hth, Doug From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:25:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE508106564A; Mon, 1 Jun 2009 17:25:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id AFF168FC1A; Mon, 1 Jun 2009 17:25:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6345046B2E; Mon, 1 Jun 2009 13:25:29 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 5686E8A02B; Mon, 1 Jun 2009 13:25:28 -0400 (EDT) From: John Baldwin To: Nathan Whitehorn Date: Mon, 1 Jun 2009 13:23:14 -0400 User-Agent: KMail/1.9.7 References: <200905311002.n4VA2K6c037776@svn.freebsd.org> <200906010822.19951.jhb@freebsd.org> <4A23FB40.1050405@freebsd.org> In-Reply-To: <4A23FB40.1050405@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906011323.15189.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 01 Jun 2009 13:25:28 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193159 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 17:25:30 -0000 On Monday 01 June 2009 12:01:04 pm Nathan Whitehorn wrote: > John Baldwin wrote: > > On Sunday 31 May 2009 6:02:20 am Nathan Whitehorn wrote: > > > >> Author: nwhitehorn > >> Date: Sun May 31 10:02:20 2009 > >> New Revision: 193159 > >> URL: http://svn.freebsd.org/changeset/base/193159 > >> > >> Log: > >> Provide an analogous sysctl to hw.acpi.acline (dev.pmu.0.acline) to > >> determine whether the computer is plugged in to mains power. > >> > > > > I wonder if it would be a good idea to introduce a > > platform-independent 'acline' sysctl? Something like 'hw.acline'? For now > > we could simply have these devices create it. We could do something fancier > > where AC adapter drivers register with a centralized thingie at some point > > and it exports a global setting that is true so long as at least one adapter > > is online. I'm not sure that level of complexity is warranted until we have > > platforms with multiple AC lines exposed to the OS though. > > > That would be nice, and easy to implement, though the existing one > should be kept for a while for compatibility. In the longer term, pmu(4) > also provides an ACPI-alike interface to battery status under dev.pmu.*, > which it would likewise be good to report in a platform-independent way. Yes, the existing names would have to stay around for a while for compatability. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:38:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 572071065675 for ; Mon, 1 Jun 2009 17:38:47 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id F0ABD8FC16 for ; Mon, 1 Jun 2009 17:38:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 16334 invoked by uid 399); 1 Jun 2009 17:38:42 -0000 Received: from localhost (HELO ?192.168.0.101?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 1 Jun 2009 17:38:42 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4A241221.6090707@FreeBSD.org> Date: Mon, 01 Jun 2009 10:38:41 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <200906010535.n515Z4qK065272@svn.freebsd.org> <20090601062701.C12292@maildrop.int.zabbadoz.net> In-Reply-To: <20090601062701.C12292@maildrop.int.zabbadoz.net> X-Enigmail-Version: 0.95.7 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, max@love2party.net, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193198 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 17:38:47 -0000 Bjoern A. Zeeb wrote: > On Mon, 1 Jun 2009, Doug Barton wrote: > >> Author: dougb Date: Mon Jun 1 05:35:03 2009 New Revision: 193198 >> URL: http://svn.freebsd.org/changeset/base/193198 >> >> Log: Make the pf and ipfw firewalls start before netif, just like >> ipfilter already does. This eliminates a logical inconsistency, >> and a small window where the system is open after the network >> comes up. > > Unfortunetaly this is contrary to a lot of PRs and requests on > mailing lists out there that actually want the netif/network_ipv6 > to be run _before_ things come up. Can you provide links to some of those PRs? I'd love to learn more about this issue. > Espescially pf really needs this to avoid rules that needs to do > per paket lookups of the interface address. Not sure what you mean here. > Further ipfw has a default option being setaable at compile time > and as TUNABLE to handle this window. And what happens if someone sets the default to accept? You could argue that they are knowingly opening a window of vulnerability but I would argue that the right thing to do is to have the firewall rules loaded before the network comes up regardless of the default. That way you avoid both the potential window of vulnerability AND the window of time between the network being loaded and the firewall allowing access to the box. To give a little more history, this patch was discussed and reviewed a while back and someone told me that they would incorporate it into some overall work they were doing to improve the way that rc.d handles networking, so I stopped paying attention to it. Last night a user pointed out to me that another patch that this same person said they would handle never got in, so I reviewed other outstanding work and found that this one had not been done either. Obviously if this change breaks something it will have to be reverted. However from the security standpoint (primary concern) it would seem to be the right thing to do, and the previous rcorder was not logically consistent in any case. Max Laier wrote: > Can you please add a note about this in UPDATING? Yes. I was on the fence about this anyways, so now you've pushed me over. :) > It might be a slight POLA violation for people who rely on the > interfaces being configured to setup the firewall. For instance > when one doesn't use dynamic address rules in pf i.e. "from/to ifX" > instead of "from/to (ifX)". I don't understand what you've written here. It seems to me that if the interfaces are always the same then the firewall rules will be fine, but if they are using dynamic rules it doesn't matter if it starts before or after the network is up. Doug From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:42:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87744106564A for ; Mon, 1 Jun 2009 17:42:06 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outK.internet-mail-service.net (outk.internet-mail-service.net [216.240.47.234]) by mx1.freebsd.org (Postfix) with ESMTP id 2089E8FC1C for ; Mon, 1 Jun 2009 17:42:05 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id AD5E47A76D; Mon, 1 Jun 2009 10:42:05 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 194E62D6010; Mon, 1 Jun 2009 10:42:05 -0700 (PDT) Message-ID: <4A2412EC.6020009@elischer.org> Date: Mon, 01 Jun 2009 10:42:04 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <200906011549.n51FngRA083299@svn.freebsd.org> <20090601155120.D12292@maildrop.int.zabbadoz.net> In-Reply-To: <20090601155120.D12292@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193232 - in head: . sys/net sys/netinet sys/netinet6 sys/nfsclient sys/sys usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 17:42:06 -0000 Bjoern A. Zeeb wrote: > On Mon, 1 Jun 2009, Bjoern A. Zeeb wrote: > >> Author: bz >> Date: Mon Jun 1 15:49:42 2009 >> New Revision: 193232 >> URL: http://svn.freebsd.org/changeset/base/193232 >> >> Log: >> Convert the two dimensional array to be malloced and introduce >> an accessor function to get the correct rnh pointer back. >> >> Update netstat to get the correct pointer using kvm_read() >> as well. >> >> This not only fixes the ABI problem depending on the kernel >> option but also permits the tunable to overwrite the kernel >> option at boot time up to MAXFIBS, enlarging the number of >> FIBs without having to recompile. So people could just use >> GENERIC now. >> >> Reviewed by: julian, rwatson, zec >> X-MFC: not possible > > The solution is not ideal but will help FreeBSD 8.x. The previous code was needed for 7.0 and 6.0 compatibility. 8 can break that ABI so this is an excellent step in the right direction. we could look at making multiple fibs not need any compile option but always be enabled and control it purely through NUMFIB -> 1 > > Julian has suggested a cleaner way but I considered that to be to > late and intrusive for 8.x; this way we will have enough time for > 9.x to convert this to per AF/domain handler routines. > > > Note: I will garbage collect a lot of opt_route.h dependencies by the > end of the week as that option no longer has to be visible to most of > the tree. > > > PS: I cannot spell 'routing' correctly usually so whoever touches > UPDATING next please fix the spelling;-) > From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:50:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A88F31065687; Mon, 1 Jun 2009 17:50:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 5D1698FC1E; Mon, 1 Jun 2009 17:50:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 983D841C75C; Mon, 1 Jun 2009 19:50:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id LX8jtMNbysNF; Mon, 1 Jun 2009 19:50:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 2EB9241C750; Mon, 1 Jun 2009 19:50:06 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 48D734448E6; Mon, 1 Jun 2009 17:47:47 +0000 (UTC) Date: Mon, 1 Jun 2009 17:47:47 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Doug Barton In-Reply-To: <4A241221.6090707@FreeBSD.org> Message-ID: <20090601174604.J12292@maildrop.int.zabbadoz.net> References: <200906010535.n515Z4qK065272@svn.freebsd.org> <20090601062701.C12292@maildrop.int.zabbadoz.net> <4A241221.6090707@FreeBSD.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, max@love2party.net, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193198 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 17:50:08 -0000 On Mon, 1 Jun 2009, Doug Barton wrote: > Bjoern A. Zeeb wrote: >> On Mon, 1 Jun 2009, Doug Barton wrote: >> >>> Author: dougb Date: Mon Jun 1 05:35:03 2009 New Revision: 193198 >>> URL: http://svn.freebsd.org/changeset/base/193198 >>> >>> Log: Make the pf and ipfw firewalls start before netif, just like >>> ipfilter already does. This eliminates a logical inconsistency, >>> and a small window where the system is open after the network >>> comes up. >> >> Unfortunetaly this is contrary to a lot of PRs and requests on >> mailing lists out there that actually want the netif/network_ipv6 >> to be run _before_ things come up. > > Can you provide links to some of those PRs? I'd love to learn more > about this issue. PR 130381 has one report and I had added another link to a freebsd-rc post at one point. -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:52:25 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADD82106566C; Mon, 1 Jun 2009 17:52:25 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 6B1538FC1A; Mon, 1 Jun 2009 17:52:25 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 4B4356D41D; Mon, 1 Jun 2009 19:52:24 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 26CE9844CC; Mon, 1 Jun 2009 19:52:24 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "M. Warner Losh" References: <200906011111.n51BBkZt077175@svn.freebsd.org> <20090601.104358.-345495454.imp@bsdimp.com> Date: Mon, 01 Jun 2009 19:52:24 +0200 In-Reply-To: <20090601.104358.-345495454.imp@bsdimp.com> (M. Warner Losh's message of "Mon, 01 Jun 2009 10:43:58 -0600 (MDT)") Message-ID: <86vdnfq1t3.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, rse@FreeBSD.org Subject: Re: svn commit: r193223 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 17:52:26 -0000 "M. Warner Losh" writes: > : @@ -187,7 +187,8 @@ padvance(char **path, char *name) > : if (*path =3D=3D NULL) > : return NULL; > : start =3D *path; > : - for (p =3D start ; *p && *p !=3D ':' && *p !=3D '%' ; p++); > : + for (p =3D start; *p && *p !=3D ':' && *p !=3D '%'; p++) > : + ; /* nothing */ > > C already has a way of saying this: > > for (p =3D start; *p && *p !=3D ':' && *p !=3D '%'; p++) > contionue; It's a matter of taste. There is plenty of precedent for /* nothing */ ; and some for ; /* nothing */ (for varying spellings of "nothing") in the tree. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:06:59 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 056C91065680 for ; Mon, 1 Jun 2009 18:06:59 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outC.internet-mail-service.net (outc.internet-mail-service.net [216.240.47.226]) by mx1.freebsd.org (Postfix) with ESMTP id DC5FD8FC24 for ; Mon, 1 Jun 2009 18:06:58 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 72DDB53305; Mon, 1 Jun 2009 11:06:58 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 1BDDD2D6015; Mon, 1 Jun 2009 11:06:58 -0700 (PDT) Message-ID: <4A2418C1.5020406@elischer.org> Date: Mon, 01 Jun 2009 11:06:57 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <200906011111.n51BBkZt077175@svn.freebsd.org> <20090601.104358.-345495454.imp@bsdimp.com> <86vdnfq1t3.fsf@ds4.des.no> In-Reply-To: <86vdnfq1t3.fsf@ds4.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, rse@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r193223 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:06:59 -0000 Dag-Erling Smørgrav wrote: > "M. Warner Losh" writes: >> : @@ -187,7 +187,8 @@ padvance(char **path, char *name) >> : if (*path == NULL) >> : return NULL; >> : start = *path; >> : - for (p = start ; *p && *p != ':' && *p != '%' ; p++); >> : + for (p = start; *p && *p != ':' && *p != '%'; p++) >> : + ; /* nothing */ >> >> C already has a way of saying this: >> >> for (p = start; *p && *p != ':' && *p != '%'; p++) >> contionue; > > It's a matter of taste. There is plenty of precedent for > > /* nothing */ ; > > and some for > > ; /* nothing */ > > (for varying spellings of "nothing") in the tree. > > DES and just for bikeshed's sake, In non BSD code I prefer for (p = start; *p && *p != ':' && *p != '%'; p++) { /* Nothing */ } for (p = start; *p && *p != ':' && *p != '%'; p++) { /* Nothing extra */ } From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:07:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78C0D1065695; Mon, 1 Jun 2009 18:07:02 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6410E8FC2F; Mon, 1 Jun 2009 18:07:02 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51I72I8086760; Mon, 1 Jun 2009 18:07:02 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51I71jV086754; Mon, 1 Jun 2009 18:07:01 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906011807.n51I71jV086754@svn.freebsd.org> From: Sam Leffler Date: Mon, 1 Jun 2009 18:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193240 - in head/sys: conf contrib/dev/mwl dev/mwl modules modules/mwl modules/mwlfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:07:03 -0000 Author: sam Date: Mon Jun 1 18:07:01 2009 New Revision: 193240 URL: http://svn.freebsd.org/changeset/base/193240 Log: driver for Marvell 88W8363 Wireless LAN controller Added: head/sys/contrib/dev/mwl/ head/sys/contrib/dev/mwl/LICENSE head/sys/contrib/dev/mwl/Makefile (contents, props changed) head/sys/contrib/dev/mwl/mw88W8363.fw.uu head/sys/contrib/dev/mwl/mwlboot.fw.uu head/sys/dev/mwl/ head/sys/dev/mwl/if_mwl.c (contents, props changed) head/sys/dev/mwl/if_mwl_pci.c (contents, props changed) head/sys/dev/mwl/if_mwlioctl.h (contents, props changed) head/sys/dev/mwl/if_mwlvar.h (contents, props changed) head/sys/dev/mwl/mwldiag.h (contents, props changed) head/sys/dev/mwl/mwlhal.c (contents, props changed) head/sys/dev/mwl/mwlhal.h (contents, props changed) head/sys/dev/mwl/mwlreg.h (contents, props changed) head/sys/modules/mwl/ head/sys/modules/mwl/Makefile (contents, props changed) head/sys/modules/mwlfw/ head/sys/modules/mwlfw/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options head/sys/modules/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jun 1 16:36:28 2009 (r193239) +++ head/sys/conf/files Mon Jun 1 18:07:01 2009 (r193240) @@ -1162,6 +1162,33 @@ dev/mpt/mpt_pci.c optional mpt pci dev/mpt/mpt_raid.c optional mpt dev/mpt/mpt_user.c optional mpt dev/msk/if_msk.c optional msk +dev/mwl/if_mwl.c optional mwl +dev/mwl/if_mwl_pci.c optional mwl pci +dev/mwl/mwlhal.c optional mwl +mwlfw.c optional mwlfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk mw88W8363.fw:mw88W8363fw mwlboot.fw:mwlboot -mmwl -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "mwlfw.c" +mw88W8363.fwo optional mwlfw \ + dependency "mw88W8363.fw" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mw88W8363.fw" \ + no-implicit-rule \ + clean "mw88W8363.fwo" +mw88W8363.fw optional mwlfw \ + dependency ".PHONY" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mw88W8363.fw.uu" \ + no-obj no-implicit-rule \ + clean "mw88W8363.fw" +mwlboot.fwo optional mwlfw \ + dependency "mwlboot.fw" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mwlboot.fw" \ + no-implicit-rule \ + clean "mwlboot.fwo" +mwlboot.fw optional mwlfw \ + dependency ".PHONY" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu" \ + no-obj no-implicit-rule \ + clean "mwlboot.fw" dev/mxge/if_mxge.c optional mxge pci dev/mxge/mxge_lro.c optional mxge pci dev/mxge/mxge_eth_z8e.c optional mxge pci Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jun 1 16:36:28 2009 (r193239) +++ head/sys/conf/options Mon Jun 1 18:07:01 2009 (r193240) @@ -777,6 +777,14 @@ MALO_DEBUG opt_malo.h MALO_TXBUF opt_malo.h MALO_RXBUF opt_malo.h +# options for the Marvell wireless driver +MWL_DEBUG opt_mwl.h +MWL_TXBUF opt_mwl.h +MWL_RXBUF opt_mwl.h +MWL_DIAGAPI opt_mwl.h +MWL_AGGR_SIZE opt_mwl.h +MWL_TX_NODROP opt_mwl.h + # dcons options DCONS_BUF_SIZE opt_dcons.h DCONS_POLL_HZ opt_dcons.h Added: head/sys/contrib/dev/mwl/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/mwl/LICENSE Mon Jun 1 18:07:01 2009 (r193240) @@ -0,0 +1,43 @@ +FIRMWARE LICENSE TERMS + + +Copyright (c) Marvell International Ltd. + +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* Redistributions must reproduce the above copyright notice and the +following disclaimer in the documentation and/or other materials +provided with the distribution. + +* Neither the name of Marvell International Ltd. nor the names of its +suppliers may be used to endorse or promote products derived from this +software without specific prior written permission. + +* No reverse engineering, decompilation, or disassembly of this software +is permitted. + +Limited patent license. Marvell International Ltd. grants a world-wide, +royalty-free, non-exclusive license under patents it now or hereafter +owns or controls to make, have made, use, import, offer to sell and sell +("Utilize") this software, but solely to the extent that any such patent +is necessary to Utilize the software alone, or in combination with an +operating system licensed under an approved Open Source license as +listed by the Open Source Initiative at http://opensource.org/licenses. +The patent license shall not apply to any other combinations which +include this software. No hardware per se is licensed hereunder. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIPOSSIBILITY OF SUCH DAMAGE. + + Added: head/sys/contrib/dev/mwl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/mwl/Makefile Mon Jun 1 18:07:01 2009 (r193240) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +FILES= mw88W8363.fw.uu mwlboot.fw.uu + +mw88W8363.fw.uu: mv88W8363fw.h LICENSE + (cat mv88W8363fw.h; \ + echo 'int main(void) { \ + write(1, fmimage, sizeof(fmimage)); return 0; \ + }') | ${CC} -o build -x c - + (sed 's/^/# /' LICENSE; ./build | uuencode mw88W8363.fw) > ${.TARGET} + +mwlboot.fw.uu: mvbootfw.h LICENSE + (cat mvbootfw.h; \ + echo 'int main(void) { \ + write(1, hlpimage, sizeof(hlpimage)); return 0; \ + }') | ${CC} -o build -x c - + (sed 's/^/# /' LICENSE; ./build | uuencode mwlboot.fw) > ${.TARGET} + +clean: + rm -f build build.c ${FILES} + +.include Added: head/sys/contrib/dev/mwl/mw88W8363.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/mwl/mw88W8363.fw.uu Mon Jun 1 18:07:01 2009 (r193240) @@ -0,0 +1,2179 @@ +# FIRMWARE LICENSE TERMS +# +# +# Copyright (c) Marvell International Ltd. +# +# All rights reserved. +# +# Redistribution. Redistribution and use in binary form, without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions must reproduce the above copyright notice and the +# following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# * Neither the name of Marvell International Ltd. nor the names of its +# suppliers may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# * No reverse engineering, decompilation, or disassembly of this software +# is permitted. +# +# Limited patent license. Marvell International Ltd. grants a world-wide, +# royalty-free, non-exclusive license under patents it now or hereafter +# owns or controls to make, have made, use, import, offer to sell and sell +# ("Utilize") this software, but solely to the extent that any such patent +# is necessary to Utilize the software alone, or in combination with an +# operating system licensed under an approved Open Source license as +# listed by the Open Source Initiative at http://opensource.org/licenses. +# The patent license shall not apply to any other combinations which +# include this software. No hardware per se is licensed hereunder. +# +# DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIPOSSIBILITY OF SUCH DAMAGE. +# +# +begin 644 mw88W8363.fw +M`0```````````@``!$>Z"!CPG^48\)_E&/"?Y1CPG^48\)_E&/"?Y1CPG^48 +M\)_E8#4!`#PU`0!`-0$`1#4!`$@U`0!,-0$`4#4!`%PU`0#$@(_B`P"8Z`@` +M@.`($('@`;!`X@$`4.$3```*<`"PZ`4`5.'Z__\*`0`4XPM`A!`!`!7C"U"% +M$`(`%>,)4(40`U#%XQ!@5N*,$+0HC!"E*/O__XJ&;K#A#`"T*`P`I2@$<)1$ +M!'"%1.G__^H(()CE##"8Y0@@@N`(,(/@`+!"*0H_/__BH5> +ML.%!`*0H!'"$1/#__^H`0P$`/$,!`#Q#`0!D0P$`@+0/(``#@+P`27!'`"`` +M!/=*`""1:``I!-`%*0/1]4@`:`#@]$@!,9%@<$<0M1/P._L,(`;P"_SM3&!A +M$"`&\`;\(&%,(`;P`OP0,`;P__L``@`.`0<)#P`&``\A<>!P`"`0O8"U"?"Q +M^P`@@+WXM=]-_R$E,2`U*!P2\*/]+AQ`-@$D-',*(%,A2%4I''(Q,!SA,!+P +M[OX(('"#!R"P@P8@\(,H'&`P""$!@`HA08`,(8&`#B'!@!`A`8$2(4&!%"&! +M@3&)@"`@(H%#0""!0S&!Z8PO'!`W(4,10X%#Z82N-\]K`0```/P!`````@`` +MP))E(RD<`"8B,08@_G,2\,/^`B$H'"`PN7.$@0XA#_R'Y +M,9!#B$-@,"P<,#0HAJ-X8'@&(1L"&$.(0SA#8".80X`AB$,#"F!PHW!P-2YP +M;G``(`PA@"6L2X(`(#/6&'-X,GC_)QL"&D-3"%L``B*30P0BDT,*')(&^3>[ +M0](-&D,R')X`3D;`AI#!B/;0Q-`&"(30Q\<8".?0Z]#=W`["K-P +M,WGW>`$P&P(?0S\)/P$"-SL*]W`S<00HR=.12`$F(#`!B`0G,4,Y0PL<_R'Y +M,8M#>#,#@`-YQG@;`AY#-@DV`0$VQG`S"@-Q@X@!)C-#.T.+0V@S@X`#>L9Y +M&P(>0S8)-@$"-L9Q,PH#<@.)`28S0SM#BT,#@0-[QGH;`AY#-@DV`08VQG(S +M"@-S@XE;"%L`NT.+0R@S@X$#><%XQGD;`AE#`WIN3QL"'D.)&0-[QGH;`AY# +MB1D/(UD:`WS&>PD'&P(>0S,)&P$)#QE#"PK!$IX +M@"4;`AI#JD-*X +M0V`C&$-H8R@<-3`%'!/PD_FP0P0AB$,((8A#N$,@(A!#*1P2\)[]_R"@<>!Q +M`B``(34]*A@P,@$P$"B16$>2P0S&6@/(A(%$4,98!I+(#O9 +M:O\B$@*10]EB,8L3*0?1&TEE(L`Y2F+%(HIB)R'!80`@P>=T)0#`PDT`P"T! +M````I0"`@J@"E+^H`@8`J`"`S!,"P-`3`L#4$P+`W!,"P-@3`L!T!```X!," +MP$#H`(#___\/-CX``"`@`(`44`+`_P$``#8(```(@`"0*)``D,"B`("`M1/P +M6?@3\%OX`""`O>1)@+6(:`$PB&#B2$%J`2%!8A/P5O@!(("]_[4)G@8H`=(2 +M*0+3F"`$L/"]VTV"`*Q8`"P!T)<@]N?73P0!8#_D&:Q0(6"O6`*P!!P&+!&8$)V61IQ&`M.8(`NP\+VZ2:8`&#F)60`I`="7 +M(/7G`"("(021!9*P3P(<`Y`X:;-)`)"4(&!#1!@"D@B:(!QA1@&5PM0$H +M!])Z380`%#4H61+PT/\`("A1L+T(M0$H"])T28``%#$(6&E&`"(2\,K_`"@! +MT0"8"+T`(/SG@[4!*`K2;$F``!0Q"%@!J0`B$O#!_P`H`-&,O0$@_.<`M0,< +M`2B)L!/2!*D%J`"0`9%A29@``ZH"DA0Q"%@(J0>J!JL2\+#_`"@"T0>8";`` +MO0`@^^=P1X"U@"`2\*S_@+V`M0`@$O"G_X"]<$=P1W!'@+6`(!+PG_^`O8"U +M$O";_X"]@+4%*`C2'"-,2EA#8#*`&`H<`"&RL.CN`0```.P)`````@``'G.Y +M#A+PEO^`O8"U!2@&TAPC1DE80V`Q0!@2\)/_@+V`M04H"-(<(T!)6$-@,4`8 +M`"')0Q+PCO^`O8"U!2@&TAPC.DE80V`Q0!@2\(O_@+V`M08H!M(U24`![#%` +M&``A$O"(_X"]@+4&*`;2+TI``>PR@!@`(A+PA?^`O1RU%!P&*`[2`"+20P"2 +M*$I``>PR@!@B'`&K$O!]_P`H`=$!F!R]`"#\YX"U!B@%TA])0`'L,4`8$O!V +M_X"]@+4&*`;2&DI``>PR@!@"(A+P6_^`O0"UA[`&*!'2`ZD`D1-)`JI``>PQ +M0!@!D@6J!JD$JQ+P8?\`*`+1!9@'L`"]`"#[YQ"U!!P$*`S2'"`,26!#0!@! +M(@`A$O`._PA*`""A`!`Z4%`0O00```0`D`"0G!<`!'L'``"\!``$+`$`!%@9 +M``2`M00H!](<(W5)6$-`&``AR4,2\/_^@+V`M00H#-)P2P$A@@`0.YE0'"-M +M25A#0!@`(25A#0!@2\-K^@+V`M<%H`AP`:))H$O`"_X"]\+4" +M*`'3F"#PO55-A``K60`K`="7(/"]+"-03D-#<#:;&4Y/*U$&`<@WN%'P&8%@ +MPF``(4%@2TD982E92&&"X3Q3`0```.@+`````@``ZIL'LP`@\+W^M0L<$1P" +M*!;21$P"`<@T%1EJ:(0``"I!3@[1`2("D@"3`9$P60`A`FE#:1+PT/X`*`'1 +M`2!H8/Z]-1P*'!D<,%D2\,W^*%D2\-+^].>PM0(H!M(R380`*%D2\-'^`"`H +M4;"]@+4"*`32+4F```A8$O"^_H"]@+4"*`32*$F```A8$O#%_H"]$+4$'!+P +MR/X@8!"]`","X`%P`3`!,Y-"^M-P1_BU($@`:`5H`"T@T!Y/`"0!(*!`*$`7 +MT!M)H``8,0A8A@"Y60`I#]`(:(IH*1P2\'7^`B@(T;A9PV@`*P30*AP!(0!H +M$O"B_@$T$BS@VPM,(#P#S`@\@4(+T`A)"#$(7!+PG/X`*`30(&@!,``&``X@ +M8``@^+T``%@9``0D```$FPL```````2<%P`$@+4+\.7__R$#(`_P9OWK200@ +M"&`&\(C]!/!<^X"]YTAPM8`P!&D`:^5-`"9I:Z%"!M'D28Q"`]!IBP$Q:8,! +MX&Z#;&.J:P$#$@,2"PD+D4(>T0$#'-"IBP$Q"00)#*F#"BD,V=5*0#(1:5)I +M$4,&T:Z#*&2H;`$PJ&3_]\'_:(L**`39;H/L8VAL`3!H9'"]KH.H8_/G<$`M0`H!=`!'``@__=`_@`@@+T!(("]PT@'(0%B'R)"8H%B +MPF*A>`!V`0```.0-`````@``\V/9PP%C0F.!8\)CODDD(`A@2&"(8,A@O$D! +M(`AP<$=P1X"U2W@*>!L"&D,!(]L#&D,*,MX&P(:0P7P +M_?R`O8"U2W@*>!L"&D,!(]L#&D,*`"*`'0 +M`R@%T04@#/!1^@0!L"&D,!(]L#&D,*@$K`M$!,``&``X!,A(&$@X'*O'3`20`(P$H=4I] +M3038`2@(T8A^`2@%T%1R*&L`*`#0*V,PO5-R*&L`*/K19B`H8S"]L+4,'!4< +M`2$(\.OZ`"@`T;"]1($%@;"]^+4/'`0<`"AQT"`=`)`2\`7\T")I27I#5A@` +M*!/0!"!<23!W"&H!,`AB`2@+T5Y(6TD`BT`Y#R@!T0P@`N`3*`'1!2!(8S4< +M'C4@'!+PYOLI'#DQ$?#X_P"8$O#?^RDBEY&P(80VMYP`?` +M#QL"&4-)"$D`"$,H<0,*:W'C>J%Z`B(;`AE#B0?)#Y!#20#]0"E3`0```.`/ +M`````@``!XMG?@%#*7$+"FMQXWJ@>B`B&P(80X`&P`^10T`!"$,H<0,*:W'C +M>J%Z0"(;`AE#20;)#XD!D$,(0RAQ`PH@'`@P:W$2\*#[:7BK>(`&P`\;`AE# +M("*10P#@3N!``0A#:'`#"JMP8'M!(0PB2%4@>ZAQXWJ@>G&,&P(80P`'@`^` +M`)%#"$-PA``'@`\!)0$H`M$;2AL"&$,`!X`/ +M`=$`(0#@`2$X'`OP3?P52`"+#R@:T1E(`GH"*@'0`RH4T0-[%DF0.0`K!M&* +M>P(J`=`#*@K117(#X(M[`2L%T4)R0'J(A-`"((X(1"!=%0`$`90'@(<`$@,+T! +M,E,`[%QC'/+1`"`PO?BU!1S?2E`U*'FC3X2%`0```-P1`````@``>9#`SFEY +M_R<6'!0<<#00-ODW`"DDT6E&__?<_P"K&'C722!P2W@*>!L"&D,"(YI#4@A2 +M``0CFD,*P`K`]&Z0X`&@`X&X`4C`R@`TP,6E&__>4_P"K&'A@?PM:E/!"8`(F`ED0#)&0QX2W@; +M`AQ#XP<5U+1#(PH,<$MP`R@&T4QXBW@;`AQ#K$,@-`3@3'B+>!L"'$.L0TQP +M(PJ+<`3@8P<"U`,H\M'JYP$R!"K9T_"]$+5+>`IX!'@;`AI#0WB2!](/&P(< +M0P(CG$-2`")#`G`3"D-PBWA*>$1X&P(:0X-XT@:2#QL"'$,8(YQ#T@`B0T)P +M$PJ#<(MX27@;`AE#20:)#V`CFD-)`1%#07`+"GY*@W"2:/\R83+3>8`B`2L! +MT1%#`."10T%P"PJ#1L"&$/`!S#4#_!4^B@<0###>H!Z`28;`AA#P`8`*`K:94F( +M:#(X"&!C2$`P!F!#\=N$`0```-@3`````@``C7A^1L"&$,P0Z!Q`PHH'"(PXW$2\+/YH7H`(P"1*1P0,8I[S'L!'"`<$/!! +M^OB]\+5.3K^P,1P@,0$@(9`^D8AYRWD;`AA#P`<$U$Q)"&A`(A!#"&`(\!S[ +M!!P(\"O[/ID%'(AYRWD;`AA#P`<)U"!X8W@;`AA#0`1`#!PH`=#_]YK_(7AC +M>#E*%AQ@-CV6%AP;`AE#H#8\EA8<2`0X2T`,$#:80EO06]P7'%`W.Y<7'"(W +M,#+_(Q`SF$(YDCJ78]!CW/\G`3<=*`'1`?!M^W3<&2@!T0'P0OM8W`,H`=$! +M\`'X!"@!T0'P0O@4*`'0`O#K^6!Y`2@!T0'PM?D"*`'1`?#+^0,H`=`!\`3Z +M`"$@'`@P"/`*^`8<(!RZ(0XP$?#'^P`N`=$!\,[YO""`7;@C%$D@UA#0!BP,(!X,1P.,>!S<(D@="`<(#`1\/W[`?#6^=+C#^$``.!+ +M`0#\)0#`4$T`P$A-`,`44`+``*8`@`P@`(`"`@``2,,!`+'C9N`:*`'1`?!4 +M^QLH`=$!\'O['"BFT2!Z8WH;`AA#`2@!T`+P,?F@>N-Z&P(80P#@$N`!*`'1 +M`?`4^0,H`=$!\`CY!2CMT?=)`2"):/\Q83&(<0`@`?`+^;A"<=`BW!XH`=%$ +M-U_<`0```-05`````@``E("@`P'P!OD@*`'1`?!5^%`H`-!WYP$@P`,(0R!P +M`PIC<``@H''@<2`<)AP(,!+PL?CF20`H8GELT`$@D$`*>!!#"'"WX_\C"S.8 +M0F/0`S.80G'0`3.80MS1`"`,\(OYVTD`(`A@VTD(:$`B$$,(8*CG_R,D,YA" +MAL"&$,` +M*`'0`O`5^F-Z +M&P(80P`HCV8&P(90X![$/`Y_[A)`2`( +M<3J8$O!'^#N9`"<)>@"1LGOV>Y#BU^,VX_\C*3.80@'1`?"8_R/AL"&$,!*)+1XWJ@>B$<&P(80P(&$@ZA +M2`PQ`G`"X-C@4^'CX`$P$?``^RKG_R,J,YA"`=$!\&#_FDN80MW18WH@>I!) +M&P*):!A##B#_,6$QB'(6YP+BA.*03Y)+4#>80@'1`?#Q^''OIA"F]$!(,`#"$,@<`,*8W`!X(SCP.,`(*!QX'$@'`@P$?"X_VU) +M#"+(<0+P9/AN2P<[F$(!T0'P$?DOW&I+%SN80I/0`C.80@'1`?"/^69+"#N8 +M0@#05N9>24`Y"&H!,!V0(!P(,!'PE?\8J]AV(!P,,!'PC_\8JYAV(!P0,!'P +MB?\8JQAW(!P`)A0P`.`AX":0`3`ED`'P8?CGXU)+!#N80@'1`?`S^@$SF$(! +MT0'P'_H",YA"SM%&24`Y"&H!X&#AU.,!,``F)QP(-Q^0`?!8^,WC1$L',\`: +M%"@$T@.C&Q@;6EL`GT0-Y@``90@Z`D`"R0[0#G0/I@BE#[-ZH7I@?1L"&4,.\.+X8'T<(UA#@1F@>N-ZQ#$;`AA#$?`%^R!Z8WH; +M`AA#0`<@U2%]8'T3X!10`L#$)@#``*4`@`"C`(#&30#`)#,`P+E(`L`!`@`` +M*1$``'!$`0`.\+[X8'T<(UA#@1G;DPP&`0```,P9`````@``IW$J!ZZ4D;`AA#"'`@>NA)8WH.'*(Q&P(80Y8V`"@XD5S1 +M)QP((!^0*#<"(!#P$_@*X#B8$?"H_C%H"@)1&A'P5_HX8`0_!#X?F`$X'Y!# +M'._1V$@!)P%H.4,!8`OP6/F`(1\@#O#9_M`A&R`.\-7^8"$G(`[PT?Y0(2@@ +M#O#-_B@A*R`.\,G^/IF(>H9)8WH.'`\<&P(80YHWGC8`*!'1,1PX'`WP\O\X'!'PZ?T! +M`@\:,!P1\.3].1P1\)7Y(1P,,6[E.1P`)S@<$?#O^3$<.!P1\.OY#?#-_UOE +M=$H0:`$A"02?"8S/`0```,@;`````@``4YFB7@A#$&`!(`[PE/AQ24AI,"*0 +M0TAA;4D@.4AJ!"*00TAB"_#N^69)`"_9[ +M`1PP'#L<#_!#_L#D74D!(`AQ.I@1\*/].Y\`(SEZ`)&R>_9[`1PP'`_P,OY8 +M2B`Z$&H!(0D$B$,08E1)!#$(:`0B$$,(8``@#O!4^%%)%#$(:#`B$$,(8`OP +MN?FA>N-Z/9@;`AE#@'L0\&7\C^1)2$%H20A)`$%@B>3^]Z'^!AQ@>?\C73-$ +M3UA#P!DP,!HB(1P(,1'P3_CC>*)X8'D;`AI#_R-=,UA#P!E0,!HZ(1PB,1'P +M0/A@>?\A)C$X2D%#B1@W2H``$5`(\&SX,!SQXS5(`&@`*!70+DD(:@$P`"8G +M'`@W'Y`*X*WB.!P1\#?]`1PP!@$B``X(\'_X`38?F(9"\M,@'`@P$?`I_8`' +M`=4!(`#@`"`D20DBB6B2`8D8B&/_]Y+X$.<@'`@P$?`7_3R9P.,720]J`3<` +M)@7@,`8`#B%Z"/#"^`$VOD+WT_SF('IC>AL"&$,!*(?1(!P+,`<<$?#\_,(' +M$4DFU0`@\',(<`])6B`(8`])9"`(8"'@E^(D,P#`4$T`P%3Q`0`@J`"`P*(` +M@$"F`(#H(P+`Z#X"P.@8`L!T)0#`%%`"P'\L`,!`10$`1$4!`$`'`M4]*@'' +M`0```,0=`````@``2F%\+@$@\',(<#@<$?#*_$`%P`X!*`S1`""P!!X&P(80XA#$'`#"E-P5N!@)P(H%=$!(+!S.9H$(5-X$'@;`AA#B$,0<`,* +M4W`YFI-X4'@;`AA#N$-0<`,*DW`]X#F:!"%3>!!X&P(80PA#$'`#"B`<##!3 +M<#>0$?"1_,`&/IF`#PAP-Y@1\(K\P`:`#P$H#-$YFI-X4'@;`AA#N$-0<`,* +MDW`"(+!S`"`.X`,H$=$YFI-X4'@;`AA#N$,@,%!P`PJ3<`,@L',!(.Q)B'0$ +MX`KB8>`^F0(@"'"@>CJ9$?!T^+![/)D()-X&P(80T`& +M@`\+\![].I@1\$O\.YF$1@EZ`",`D;)[\'MA1@_PVORP>__WXOG620$@B'%( +M:@`H`-`BY+!["O#.^![DT4@$8R`<"#`1\"W\STD!*!S1X&@1\#WX(!P,,!'P +M(_R`!P?5.9H0>%-X&P(80P(C&$,&X#F:$'A3>!L"&$,"(YA#.9H#"A!P4W`, +MY``HTM$('!'P"/PA'`PQ$?`:^,CD(!P*,`OP=O_#Y/[W+?T=D+5(Q&(@'`@P +M$?#U^[-/&#\!*''1/)C`>P`H%]"O2-PP$?#I^P$<`B`-\+?]JTCL,!'PX?L! +M'`(@#?#%_:=(Y#`1\-G[`1P"(`WPP_VB2,!J__<#H9R@`0```,`?`````@`` +MOHG"DPCYH$C`:C:0##`1\,O[GDD4.361`2AKT3D<`"`0\-C_-I@4,!'POON7 +M2<`'+#E+>`EXP`\;`AE#20A)``%#DD@/'"PX!W`["D-P-I@<,!'PJ?L`!@`. +M^0<3U!ZI__?&^(E)!"(L.4MX"'@;`AA#D$,"(YA#"'`#"DMP'.!SX3_A!.(8 +MJQAV.9H$(8]#$7A3>'U(&P(90TH'T@\L.)(`.D,"(YI#`.#/X(D'R0])`!%# +M`7`+"D-P=$C_(BPX0W@!>/DR&P(90Y%#&*L:?I(&T@T10P%P"PI#<`-YP7@/ +M(AL"&4,10\%P"PH#<369#B"`?F0@! +M-)#`&3.0%#`1\$?['YE;2HD`+#J/&'MX.7C`!QL"&4-)"$D`P`\(0SAP`PI[ +M<#*0,9`SF!PP$?`P^P`&,9D`#LD'"]0>J?_W3/@X>'MX!"$;`AA#B$,"(8A# +M$N`8JQAV,I@$(0A#.'`#"GMP.9H"(8A#$7A3>!L"&4.)!\D/20`(0SAP`PK_ +M(?DQ>W`8JXA#&7Z)!LD-"$,X<`,*>W`V2328R6I`&#"0&#`1\/;Z`"@-T3"8 +M(#`1\/#Z^7@[>0`'&P(90PD)"0$`#PA#!N#X>#MY&P(80P`)``$",/AP`PH[ +M<368$?#9^OEX.WD;`AE#"0=VFW*-`0```+PA`````@``ME8S3@D/0!@UF1#P +MY?X?F0$Q'D@?D<=J.!P0,!'PQOH?F8A"`-ERYS68$?"_^C69`3@0\-'^`2`- +M\+;]__?%^#$<`2`0\,C^L'O_]U/X&>`.20`H%M`"*!31(!S^]]W_"DG(:@PP +M$?"A^@$H`M$Y'``@`>`Y'`$@$/"N_C$<`"`0\*K^'9C^]\?[A>0D,P#`?$T` +MP"!Z8WH;`AA#`"@6T?E.!B(A'`HQ,&@0\&O],&@!:""1"ASU28IB@(@@JQB` +M()C(8F%Y\DK_(%!4Q.0!*`;1(AP*,@$A8'D.\,KXN^0"*//1(!P*,`8<"_#6 +M_3`<"_`&_K#D`2"00`IX@D,*<`AX"_#P_<'@8'G_(R8SX4Y80X`9&APA'`@Q +M$/`S_6-X('@!(1L"&$/)`PA#('`#"F-P`""@<>!Q/)C)",-Y@'G_(AL"&$,( +M0SR9`PJ(<!Q(!PF'`@P$?`1^@$H)-$\F`$GPWF`>3R9&P(80SA#B'$# +M"KY(RW$`:`OP\?I@>0@H!]+_(28QMTI!0XD8"/!S_0/@LTD(7`WPO/ZU20AH +M""(00PA@!"!*X``&#=5@>0@H!=(`(@`A!_`O_6!Y`>"H20A<#?"]_CS@#?#+ +M_@</`0```+@C`````@``0KZ-\P!H`"@0T0`O#M!@>0@H!=(`(@`A +M!_`8_6!Y`>"<20A<#?"F_@$O)-$\F0`@B''(<9U)"2*):)(!B1B(8_[W+/U@ +M>0@H`](`(@`A!_#]_`KP1?N620AH!"(00PA@D$D(:`@BD$,(8``@#?!K_`$@ +M$?#U^8](PWJ!>AL"&4/)",D``C$0(YE#@7(+"L-R#"(Q'`'P/OHA'(=."#$& +M(C`<$/!Q_&-X('@!(1L"&$/)`PA#('`#"F-P`""@<>!Q/)A)",-Y@'D;`AA# +M"$,\F0,*B'%R2,MQ`&@`*`K0,'AS>!L"&$,`*`318'G`&0%X`3$!<+`<$?!; +M^7-X,7AF>1L"&4,!X/+BH>("'#`<"/!%_`XB`?#]^:![_R@'T5M(!B(!:"`< +M#C`0\"[\$>!73@8B(1P.,3!H$/`F_#!H`6@@D0H<4DF*8H"((*L8@""8R&([ +MF0$G2'J@=0,*XW4["B=S(!P<,&-S!_`N^@KPD?P@P,* +M('5C=4U(&#$0\"C]/IG+>8AY&P(80SA#B'$#"LMQ`?"H^2`<)#`OD"Z0$?`! +M^0<<(!P@,!'P_/@B'"@R.1P'\!/Z+I@1\/3X/4D`)TAT(!P\,"V0%^"Y``@9 +M*#`KD"R1$?#F^#=*+)E04"N8$?#@^"J0+9@1\-SX*IE``0@8+)D#'DUE`0`` +M`+0E`````@``6T93@S%*`3=04"^8$?#2^+A"XM@@'#@P!QP1\,OX`0[-[&P(80Q_@S!,"P`"E`(!<+`#`Z#X"P.@8`L!T)0#``*,` +M@%A0`L`44`+`)*@`@)!-`,`82P+``1D$`R0S`,"(5`#`F%0`P!!#<',#"K-S +MF-Z\D_R2!L"&D,!*O%)&-`"*@O0!"INT`@J`-!3YPAX`BAITZ=R.PKC +MCN9&P(80P`&``[(<0KPY_E!YZ)ZXWH;`AI#ND(1T3N92'H!*.+9 +M/IG+>8AY&P(80Q`C&$.(<0,*RW';20`@"'`IYSZ?UTG[>;IY&P(:0Q`CFD.Z +M<1,*^W$`)P]P.YD)>@(I`=$'<`#@`7"@>N-Z.YD;`AA#``8`#@ARS$D)BQ0I +M#M`3*0S0`R@*T1^I`2`-\./_&*L8?P,H`M`[F0(@"'(ZF!'P`?@[F0EZ`)&R +M>_9[`1PP'#L<#_"0^+I)`2`)>`[P"/CGY@#@`N``>`(HD=(!,*!R`PKCF-Z&P*K3PB>`0```+`G`````@``KZ[M +M/AA#`2B*T:!ZXWH;`AA#"O"_^<;FJ$D`((EH_S%A,8AQ`2`%X*1)`""):/\Q +M83&(<F-Z&P(80P$H$-&@>N-Z&P(80P`&``X-\"O\.I@0\*__LWL" +M'``@\7L*\(+\('IC>AL"&$,"*`G1.I@0\*#_`AP@'+=[\7L0,`#P"/\ZF!#P +MEO\[F0`C"7H`D;)[]GL!'#`<#_`E^('F(!P(,,`A!AP0\!_Z`2$P'`;PF/X@ +M'$0P"_`[^P`F!B!P0P$92C$P'`WPP_T!-A`N]=MVX``A(!P(,`;P0_X&'"`< +MNB$.,!#P`/H`+FG0NR"`73$<6#&@!!X&P(80T`'P`\@ +M=#F:DWA0>!L"&$-`!H`/8'0]F,![@`?`#Z!T/9C`>\`'P`_@=`+P+?DA'"`Q +M2'!?2`!H"'$,(B`<%#!=20/@;")=22`<"#`0\!KZ,N`EF!#P*O_`!HYAP8'O8 +M<*![&''A?%@=`"D%T`,Q67`A'!0QXGP&X.%[`*L#,5EPXGLA'!`Q$/"M^0`F +M!>`P!@`.:48(\.?[`3:^0O?3%>,@>F-Z/9D;`AA#B',^Y"!Z8WHA'!L"&$,` +M*`318'D*,0CP]?LRY`$H\-%@>0HQ"/``_"OD_??+_P<<)AP0-B`<"#`0\)/^ +M`081L"&D,['/[W%?L!*!'0`28/X`$H$-%C?")\ +M(7H;`AI#8WH@'!L"&4,*,/[W%?H`*.W0!?#J^0C@`B@&T2`<"C`&\%W]!B@` +MT0$F`"$@'`HP!O#S_"$<+#$0\"[Z`"X`T0OE@>$@>O=)"':"X_5(0&H`*`/0 +M(1PH'/[WL?D@>F-Z`2;V!QL"&$,`*`K0(!P,,!#P_/WC>J%Z&P(90S%#"&#K +MY.-Z(1R@>@PQ&P(80S!#`&@0\`'ZX.3B2$!J`"@#T"$<*!S^]XOYH'OC>QL" +M&$-E0?''`0```*@K`````@``G%]1W@`H$M`!*"[0`B@)T2`<"#`0\-3]`1P@ +M'#H<$#`#\$#^(1PH'/[W&?FMXR![8WL;`AA#0"CTV"`<"#`0\+_]!QP`)@G@ +ML``!&3AH$#$0\,SY!#V-[&P(80[!"W=GNYR`<"#`0\*?]!AP@ +M'!`P$/"B_3!@T>>]2$!J`"@#T"$<*!S^]T'Y"O!:^"!Z8WH;`AA#`"@2T"%[ +MH'KC>AL"&$,-\&G\H'KC>AL"&$.$*#[1L$D@>XEHT#$(<3C@H'KC>A^I&P(8 +M0PWP3OT>X*A(0&H`*`/0(1PH'/[W%OD*\"3X('IC>AL"&$,`*`?0(7N@>N-Z +M&P(80PWP,OP8X*!ZXWH?J1L"&$,-\([]&*L8?R!S#>"82`$G!W!]()=)P`#( +M8R!Z""@#T)%)3W$/\/S[P>,@'`@P$/`__9%/`"ALT2$B(1P,,1>H$/`B^!>8 +M`"'`!\`/%I`3J`+``L`7F!VJ`C(`!T$/`"DDDFW1%Z@&\"OZ`"@$T7Y)B&H! +M,(ABB>`8JQA]&ZDCD0`H;]%X:``H!]%\2``A0G@`*@+1@'@`*`+0!2!X21'A +M<4C`>@`H<=$$\%#^`"@%T03PB_]L20$@R')GX`$A(Y@&\,W[:$FP,4AA!QQ> +MT&M(0'P`*`+1`2`%\,3X`"`%\,'X`"$!(`7P2/@`(A>I%IAY`H3_`0```*0M +M`````@``A:>/K@3PWOXDF1#P\?@8JUA]84F`"!606'V`!X`/`R@"T1@@">#K +MX@(H`=$0(`3@`2@!T0@@`.`$(!BK"?%-)B'%-2$!Y`"@$T`4@#_!Q^P7@ +MP.)1204@%9H/\-;Z,!P0\*_\`2@.T!68!B@$T0$@NB'(50/@GN``(;H@P55X +M>P`A"?#%_@`AO2#!51BKV'P`*`_1/$A!8P\A!2``X!?A#/!A_C\A!2`,\&C^ +M/$E!($AA(.`8J]A\.DXP7`$P#/!8_@$0`H!-`&(`_P6?H%X`?BR$D& +M(!6:#_"^^3`<$/"7^P$H#=`5F`8H`]$!(`#@A^``X``@NB'(57A[`2$)\*[] +M`"&](,%5&*O8?``H#]&Y2(%C#R$&(`SP3/T`X.G@/R$&(`SP4?VT24$@B&$@ +MX!BKV'RR3C!<`3`,\$']`1P&(`SP-_T8J]A\,%P!,`SP0OT!'`8@#/`X_1BK +MV'RG23!<@`!"&%)HBF&C24`80&J(8YM.`"`7J0D8"7PR&`$P!BA1P`H!=`ZB1BKV7P`(`OP'OF72(!K`"@%T)5*@#*0:4`A"$,$X))*@#*0:4`A +MB$.082.8@'L`*`'0`2`P=`$GBTEX`X`Q=W2(8/WWV?XCF`-\P7L;`AE#2![" +M%Q(-$A@2$Q(#@!H`!``,"@IB``%(8G=(AW$/X7I)`2"(2/SA&*M8?1E]@@C8?,L`61A82\D8B'%< +M23@<#_#G^#`<$/#`^@$H!=`8JQE]$IA`>PGPW_P2F`$AL#!!".X07BB1@)>@$I`M`!,`@H\]L(*"S1 +M!"\!V``O-=$8J]A\.DXP7`$P#/!0_`$<.!P,\$;\&*O8?#!<`3`,\%'\`1PX +M'`SP1_P8J]A\+DDP7(``0!A`:"*:41@(8-A\*4DP7(``0!A`:B*:41@(8@S@ +M!"$X'`SP)/P/(3@<#/`K_"%*(ID@((D8"&`!+P'0`B\(T1BKV'P$*`32&DHB +MF0`@B1@(8B.8@'L`*`?0&*L8?0Y*`2'#`!@8@!C!<1BK&'T*2@$APP`8&(`8 +M`7(BF0U("!@`:@`H(M`*2H`R4&D!(0D$B$,:X&3A@E`"P#1H`L!P1`$```P` +M@"0S`,!44`+`_V<``$"B`("`I@"`'"<`P$"K`(!`I`"`*',"P%!A`2#E2B*9 +M0`.)&`AC_?>S_0G@0`\!*`;1%ZD6F`3PIOTDF0_P`OXDF!#PZ?G_*$_1(1RR +M=^7Z`0```)@S`````@``^[PH'B@<_?>,_2SA`BA?T0@B(1P,,1VH#_#&_!Z8 +MU$H&!C8.@`H +M$]$&X`$N!-&[26@Y2'L`*`O1'Y@.\/__,!P$\"K\`"X$T;5)`2!H.`! +M+F/1L4D!(&@Y2'->X*]*`"!(,M!1K4@?F1`X05P`*531'YD!)T=44.`\X0$H +M$-$*(B$<##$=J`_P9/P=F!Z9P`?`#Q"K"08)#IJ/!/`H_3S@`R@+T0@B(1P, +M,1ZH#_!1_!^8``8`#@3P&_TNX`0H+-$A(B$<##$7J`_P0_P7F``'0`\BT1>H +M!?!8_@`H`-$KY!BK&'T;K@`H+-%X:``H1M&+2$%X`"E"T8!X`"@_T89/:#_X +M>@`H.M$$\(7Z`"@%T03PP/L!(/AR,>!UX`$A,!P&\`+X?4E(,4AA`"@GT$![ +M"?!?^@"(P06)#@,I']/`!V+4'.`8JQA]`2@MT3AK`"@5T7)(@7H`*1'1P'H` +M*`[1;D]H/WA[`"@)T0$@!/!3^@`H!=$!(`3PC?L!('AS/N`!(3`PGP+?H`B,$%B0X#*2W3P`PGP`?H`B,$%B0X#*0'3P`<$ +MU"$<*!S]]V/\!N`A'"@<_?<9_"&8`"@"T$1)!"#(8C^P\+T@>F-Z&P(80P$H +M8]&@>N-Z&P(80PGPL?A_%[`AP` +M(#L<"?!G_?_W\_@@>CR9R',L26@Y"'+/X"!Z+DD>*&C0'MP1*%W0$-P`*#_0 +M#B@VT`\H/-`0*#'18'H.*"[2="-80T`8*2$)`87@$RA2T!4H4M`:*%30'2@@ +MT2<@@`%-X",H%=`)W!\H7-`@*&/0(2@+T"(H$M$82$#@)"@+T"4H8M#_*`K1 +M%4@XX!<@P`$UX!)(,#`RX!!(T#`OX'3@8'H"*''27"-80T$80#%4X&!Z`BAI +MTLPC6$-!&/@Q3."`H@"`C#,`P#1H`L`H@,H3](P(UA#0!CA23'@#N#A2`'@X$A$,`D8*^!@>@(H0-(D(UA#0!C: +M29`Q(>!@>@(H-](8(UA#0!C623`Y&.!@>@,H+M(4(UA#0!C22=PQ#^#_YV!Z +M`R@DTD`!0!A9(4D!!N!@>@,H'-*C8G,>`0```)`W`````@``%JQ(TUPC6$-` +M&,I)01@`*170H")/X`$G`2$@'`@P!?"R_@8<(]"A>PP@`"D-T'**X7N"0X@' +M``\00W""`.!LX.![`"@$T0`G`N!QB@A#<()PB@`'@`\!*`#1`.``(+9)R'/] +M]R_[<'LY'`GPG/@A'"@<_?<5^_WF`2$@'`@P!?""_@`H2=!`>[@CK$E80T`8 +M`1QH,2`<'B(.,"C@J$@!:$MX"'@;`AA#('(#"F-R"GA+>!L"&D,@'`PP&.!@ +M>2%Z.50JX&=Y)GIC>B`<&P(>0PHP#_"!_P(<,1PX'`?P-Q""(A'"@<`O"K_Y?F +M^+5\3.%L`3'A9``H;=']]RSZ"O">_N!Z`"4`*!/0('M!'"%S`2@.V?WW9?@& +M'"5S`2$`(.5R!?"+^P4@`?!N^3`<_?==^&M,8'L`*!30)ARP>T$![X`5@24@!:``I"=$!(`3P +M&O@`*`710TD&(`AP]V(`X`5@`?!2^3A*U70W2I!]01R1=00H&=D`(#U+`"&, +M`!Q99"P"V0$P``8`#@$Q""GUVP`DH0`!-`@L75#ZVP(H`MD!(-!U`.#5=95U +M)TH0?4$<$74!*!G9`"0#X`4L$-`&+`[0*TF@``I8`"H(T2`@`H`=`+\#O[^+T``.@(```("@``U`P``"0S`,!(PP$`T"8`P!`W`L#01P$` +M``P`@$!0`L!P1`$`1%`"P+10`L"44`+`*',"P/BU!?#H_PGP:_H7(4D"2D@/ +M\.SX24]*30`F`2(Y'``@_/>F_P0<^-#@!`+5`"#_]]7^H``M21(`_",^0`H +M!-`92D%H46``(0%@@+T`(@$<%4B`M4!H`_">^8"]$DB`M4!H`_"@^8"]$+4/ +M3&!H`"@'VP/PF/E@:`/PF?D`(,!#8&`0O8"U`2```_WWS_B`O8"U#O!+_H"] +M2,,!`/__``#L$P+`&3P``/`E`,!#0B!0/\CR3/<2EE###*.&#$<_S&! +M,=E*CF(2>-E,_R"3`!H90#K5:P$P36+23=PU71E`/>UKTFNJ&A($$@P`)8)" +M`M,(8LUB$."`&@ACR4@W'/\WS#`8&+$W"F+/8D`XP&M(8XAJ@!B(8\UC,!S_ +M,,5)H3#(8\-*0#+0:(D-B$/08,!+3#,8:#TA"0((0QA@T&A`!/S4_/='_C<< +M_S?!-P"0O8!6X!0A04.-&?\U0`&$&0$U(!P/\`;]`"A-VF%Y`"`(*0'1`2!@ +M<:Q)"7@$*0#1`3!A>0#PYO\!D``H!-$!\"GX`?!FF'RR`0```(0]`````@`` +M/*4J0RCX-^`T(0&8#O"$_P&8-#`!D"A@(!P/\./\0`!`""$<#_#T^"`<%#`/ +M\-K\FDF;2@EXB0")&$`YR&-C>R![&P(80VA@`9CH8"`<"#`/\,C\J&``("AA +MN(@!*`73%"-80X`9!#7`,,5CN(@!,+B`N(@(**73`)C\]^G]N(@`*`[0`2`" +MD(-)`""(8(9)@TH(8(%(`'B``(`80#C`:SA@`IC^O7Q(_R,`>,DS>DE80PPQ +M0!C_,'I)!3#(8WE*0#+0:(D-B$/08'9*3#(0:#TA"0((0Q!@<$=R24`QR&A` +M!/S4<$=L2'"U`'C_(\DS:4E80PPQ01@+'/\SP3,8'$`X'&A":@`EE$(%V:(: +M`F)":D%B@F(3X$%B8$R"8B1X7$X::,PVI`"D&4`\Y&NB0@;9$AL"8T)KA&N" +M8T1C`.#%8O\Q5TBA,<%C5DI`,M!HD0V(0]!@4TQ,-"!H/2$)`@A#(�:$`$ +M_-1029B("FB`&`A@<+WXM1<<'AP-'`0!L"&$,!!XH/`-$! +M)00M!MB)#P(I$]$`!@`/""@/T0`N`="X-C9H(!P@,$-X`'@Z'!L"&$,!!PD/ +M(!P*\/GY,QPZ'"D<(!P+\$_Y^+VPM35,`"4@>``H!]`-\)+^(7@!*0'1,4D( +M8"5P,4P@>``H!]`.\!?Y(7@%*WC``0```(`_`````@``R$V4_@$I`=$M20A@ +M)7"PO?"U#QP4'`0PA[`&D`_PY/LH204!L"&4,)!XD/<=`` +M+&_0NR$)72%*$7`(*6G2`:-;7%L`GT0#965E/64]/28<0#8PBX$'7-7`!(`. +M(1P#\&3Z`"A5T`:8#_"Y^T-X`'@QBQL"&$/*!`@X``22#@`,203+#P"2P>`` +M`#`F`,"\4P#`/%``P(@/`,!D#P#``.@`@!@T`,"$#P#`I3X`P*P^`,"D/@#` +MJ#X`P+!-`,`=)@#`@7D_!C\.S@&MXH"`;`AE#%#D`D0-;G"`"62D<(#$H'`WPK_\"(/-)`"X(<`W0(!R@,(&) +M`3$)!`D,@8$#T8`TH&H!,*!B![#PO2``$B&P(80Q`X +M`00K'`&2(APH,PD,*!P`EPWPF?P"(-1)'N``+LS0`"C*T2$<`_"#^0`HQ=`& +MF`_P]/IR6`9>`0```'Q!`````@``+1K)^4-X`'@`(AL"&$,(.``$``R`-`"2 +MXWHI'"0Q`AP('PWP@?[$20(@"'"MY_BU#AP$'!<<_/<*_`4<__?/_@`L!-`Z +M'#$<(!S_]^/^*!S\]P+\^+WXM04"P<+#0;`AE#"0>)#P(I +MLTH%T8!YP`<"U2$<$!P!X"$<$!T.\,?^KD@!>``I!M"M2QEH`2(10QE@`"$! +M<"`<#_"C^@$P0W@&>&`G&P(>0[Y#!G`S"D-PI$B`>P,H"=$@'`_PDOJ^0S$< +M(#%!<`L*@W`(X`(H!M$@'`_PAOJ^0T9P,PJ#<"@<'#`$'`_P??H!(0D#B$,A +M'`[PC?[XO9-)2&!P1Y)(0&AP1_"UF[``(`B0C4B-21`P&I`",!F0"C@6D`0X +M0#$8D160`",$DQPP$#$4D"`X$Y`7D0$B`R"$2?SWT_L$'(-(`(L4*`O1&)E( +M>0(H!]&`2E!H0`0#U%!HT0$(0U!@(!P$\.?[`"@"T`#P=/WAYR`<`/"@_AJ8 +M8!Y$#H;`AA#P`?5U1.8@WM`>QL"&$.`!L[5<$D!(`AW;TD$(PMP`"`' +MD/_WJO\`*!S0!/"?_0`H9-#_]T'\`"@4T1F8#_`0^AB9`"0)>B,<`)$3F8I[ +MS7L!'"@<#?"=^A.8@'O\]Z3_6$A$8`B8`2@>T5Q(`6E`:8%"`=`RO9E:`0`` +M`'A#`````@``V?)W1`#P+?T`\"K]__=K_0>8`"@%T`>8!ID%F@2;__>P_?_W +M9OW_]WW\`2@"T?_W0/T6X``@$^#_]W3\`"AQT/_W-_W_]T_]0DD!(@AX4$`( +M(!X&P(80P`'@`\"*`;1$9@/\";Y!QR`><`'4=4@'/_W5/X1F`_P'/F! +M>,-X&P(90PH'D@]#T0D&"0\%*3_1%YD'',E[B0<9U.I)"6@`*0/0.1P@,0`@ +M!N`!'!(Q`"`*\"O^.1P@,07P`?L!D!&8#_#3(;L>`0```'1%`````@``P`JI +M-/?X`9D!<`L*0W`'X`%X0W@;`AE###DL,`;P@/T"(-I)('`(:$EH.AP@,@,$ +M&PX0<%-P`P(;#I-P``[0<`@$``X1<5!Q"`(`#I!Q"`[0<9?A$Y@/\,WX`2AF +MT2$<+#$0D`AX_R$;`AA#^3&(0P"K&7F)!LD-"$-`"$``!"&( +M0PZ9`PH(<$MP"/"`^@Z9&"*+>$EX@`<;`AE#D4/`#@A##ID#"DAPBW`/F`_P +MA_@!*`31`*L8>0$H"-`#X`"K&'D$*`/0`*L8>?\P&'$!-S\&/PX$+\#3#Y@/ +M\'#X`2@*T9U)_R((>TM[^3(;`AA#D$,(,`G@P."82?\B"'M+>_DR&P(80Y!# +M*#`(0`M`9$3T1&8#_!-^`8P`"$$\"#_!1P*T1280W@` +M>!L"&$-!!\D/@`?`#P"1"N!H>P3PN_\!!@D.`)%H>P3PR/\`!@`.`)G`!\D' +M20\-D8$/#)%[2;@`01@+D0AX2W@!(1L"&$,(0P(AB$,,F0A#_R'Y,8A#`9F) +M!LD-"$,$(8A##9D(0PN9`PH(<$MP"/#S^0N9&"*+>$EX@`<;`AE#D4/`#@A# +M"YD#"DAPBW`!F0`I!]`F8H6>`0```'!'`````@``-.(7B0&9("D$T`&9_S$) +M!@D.`9$!-S\&/PX$+\+374K_(5-[$'OY,1L"&$.(0Q!S`PI3U1)&P(80XA""]E03Q:8#O#0__E[.WP;`AE#"0<)#T`:`N`6 +MF`[PQ?\!,"!P(!P<,`<<#O"^_P$A"0.(0SD<#O#.^T1)"&@!(A!#"&`0F`[P +ML/\!>#L=&7)!>%ER"9D$*6_2.D\X>#!W>'AP=VG@`"T2T;@=`"$$\'/^!1P, +MT0`A,B`!52$<"B`@,8AR`PK+WH; +M`AA#P`<*U'MX.'A@(1L"&$.(0P`A"$,X<`,*>W`P'`[P`O\!(A!#,1P.\!/[ +M`"UL.Y/1`0```&Q)`````@``\_L5U`C1$9@.\/C^!C`!(03PR_T%'!K0+HEH +MB@`'@`\!*"#1.'I[>AL"&$/!!QK5P`6`#@!L"&$-` +M!@G5.'A[>"H<&P(80P$'"0\@'/_WV?O%28AL`3"(9`>8`"@%T`>8!ID%F@2; +M__=T^@F9!Y0%E@25!I$#F`$P``0`#`.0$IB`B`.9B$(`V>GD^_?*_P0<__>/ +M^B`<^_?)_PB8`"@`T)#D!Y@`*`70!Y@&F06:!)O_]T_Z__<%^H3DK$D(>/\P +M``8`#@AP`-!9Y``DJ$D`(`QW!/#'_QOD?+4#(/OWVO^D2`+PAOVB32AB`O"K +M_BACH$@@,`+P??UH8@+PH_YH8YQ(8#`"\'7]J&*:2$`P`O!P_>AB`R#\]Q7X +M?2')``4B`9(`(@"1EDD#().C^_>B_@`H`=`!('R]!_#:_XQ.`"0X-BAJ`O"? +M_:$``305+'!0]]L%X&AJ`O"6_:$`<%`!-"4L]]L`)*``,%@"\.S]`30E+/C; +M`"#>YQ"U?4P@:@+P8?XA:XA"!]%@:@+P6_YA:XA"`=$!(!"]`"`0O71(@+4` +M:@+P3_Z`O8"U`R#[]Z'^@+V`M0`H!=`!'`,@^_=U_P`@@+T/>.QV`0```&A+ +M`````@``!Q.K:0$@@+WXM08<;4@/'`!X-#<-'``D`"@3T`PB,1QI2`'P7_X! +M\'[^9T@`(08P!/"]_``H!=``B0GPL/P`*`#0`20A'#@<`/#*^`0<`"A>20?1 +MB&@!,(A@4TE(;`$P2&0/X%I*`"`08(A@64D(8#0A(!P.\%[X-#0J'#$<(!P! +M\##^(!SXO?BU!1S[]^G^!AP`)``G1DF@`#@Q"%@!(8D'!2+2`T$8D4(/V`$< +M(#&*>LMZ&P(:0ZI"!]$R(A=4""**AL" +M&$,%*`'0!B@6T2!X_B@!T/\H$=$@'#`P@G@!,A(&$@Z"<`(J"-D((HIR$PK+ +M/_X"]L+4$'``H$TT, +MT2P@$DI(0X`8@&H`*`70!2D#T`8I`=!->.N;`0```&1-`````@``'NMU&2AH +M#N`-2`!H`O"$_``H"M$H:`+P?_P`*`71`BP#T0A(`&@"\'?\L+V`M0+PK/R` +MO7!'<$?@4P#`*',"P-Q3`,#H4P#`H"%+`%D8`"!)"`#@`3"!0OS8<$=!!DD/ +M@+4%T`$<`R#[]T'^`""`O0$@@+UP1_"US$J%L!%H`Y$0:5=I`"3*2\I-`"$! +MKLE-,54I50$T""SXT^O@.`8#F0`."$,-(0D"`"4(0P!H`"AIT,%)"$`)!T08 +M(!PD,`20#O"@_`8&-@XP!S?4(!P@,,-Z@'H;`AA#!2@*T`8H"-`L(;-*04.) +M&(EJ`"D$T'$'`M6R2H$`55@`+1+0!2@!T`8H&]%H>[@CK4E80T$8#1P,-2@< +M#O!V_`$P*1P.\(CX#.`@'0[P;OP&,``A!/!!^P`H`]!!>R`MR"%4_X"PC +MU0`FZWJH>@`A&P)T[H>*`0```&!/`````@``Z@/+I!A#`:H15*IZZWH!J!L" +M&D,1&"`<`_#._>MZJ'H!J1L"&$,(7``H$=#_]P[_`38(+N+3"^!P!PG4`"`R +M(0A5"B"H<@,*ZW(@'/_W\/X`(`29#?#N_PG@`"`R(0A5"B"H<@,*ZW(@'/_W +MX?XX'4]*QP40:?\-N$(`T!#G3$I7851(`'@`*"70^_?N_`4<""1)3@`G`:@` +M&1`XP'L!*`O1A2```4Q)8$-`&(4A"0%`&@\A`_#.^0C@,!D0.,%[`2D#T<=S +M8!X#\$/[`3SBT2@<^_?/_`6P\+WXM00?-Y&P(80\`' +M]M4`+`K1N'K[>AL"&$.!!L`&P`_)#P@8`-`!)"M-*'A!'"EP"B@0V:AH`1PI +M.2((ABKN>,M2,A"0$>(@&2`"(`D1%)`2`.H_OW_/H`*`/1!DG(8`AA +MC+T!(/SG@+4!(/OW+_N`O0``4$T`P`0T`,`<)@#``*8`@$SQ`0!`I`"`261L +M90````!940``\+7M2`0A`6'L2>U/06%+(4D!"QS_.X%A.3O#80(A`6(`(0$B +M$@-'8H%BPF+C2TLFY$UV`0%CS``]4>098V";&0$Q`2GWV^!,R0!\4,D92V#9 +M208C0#&+8=Q+I`W+80QBVTP!(DQB"B2,8M5,$@,0-,QB2F,`)-).#&,`(M5- +M$#:,8]0`-5&D&6-@`21D`AL9`3()*O7;T$S2`+10DAE38`4B0F/-2@,C&P*" +M8\-CS$OD#`M@`B-+8,%+P4T0.XM@`"/+8`QA2V$`(<9,$#W+`.Q06QE:8`,C +M&P+2&`$Q`2GUV[E+R0!K4$D92F"R2@,A@#K19KQ)L$N6:O1<`0```%A3```` +M`@``8/#2J1%G@#O4(EIG`2)2`YIG:2+:9ZU,`2,`(F`T&P-"8(-@!&#"8+-+ +M`"#"`*-0$AE18-0Q`3!H*/?;KTK``")0HDI@,H`806"M2``B`F"K24`QS6$" +M(XMAJ4K##$`Z4V)/80(D#&$38DYB"B0,8I-BEDE@,4%C:2$!8Q-AH4D`((A@ +MGDEC(,`Y"&*=2<`'0#D(88AA2&$(8/"]-N?_M0P<'AQ+>`EXA;`;`AE#`9'A +M>"-Y`"4;`AE#2086U0`N%-"[(8E=D$H''!%P(AP@,@.2!#(@-P@I!))ST@&C +M6UQ;`)]$!@-O;T-O0T,`(`FP\+TP'$`P`I``BX`'8M4#F()*P7B-"0%X$7!! +M>%%P@'B0"-Y&P(80T`'`R#[]U'[`I@`E`"+ +M!)E`!,,/`9@D.`($$@PX'`SP:OT%'`,@^_=O^P`M!=$@>&-X&P(80P@X=>#[ +M]X7Z!"4_X*!YQ0?M#_[W1OTP'%`P`"T#T8%Z`2D_T0+@P7H!*3O1,AP`(2@< +M`O`9^``H+=`#(/OW&OL!FCD<*#H@'`>;#/!L_@4<`R#[]S[[`"T3T>!X(WD; +M`AA#`.!)X$`'!=0@>&-X&P(80Q0X/.`@>&-X&P(80PPX-N#[]T;Z*0>)#P70 +M_R%(2@$QT6(#X&/@J0<`U0(E^_=!1=Y-`0```%15`````@``>0@,V3WZ*N"! +M>@(I`M#`>@(H)M$Q'"@<`?"__P4<4=`#(/OWV?H'FBL<`)(!FCD<,#H@'`SP +ME?L%'`,@^_?[^@`M`=!K'`G1('AC>``E&P(80Q`X('`#"F-P`.`0)2@<1^<` +M+2[0`"@LT0.8*$K!>(T)`7@1<$%X47"`>)!P_O?"_#$<*!P!\$__`"@:T.!X +M(WD;`AA#0`<#(/OWG?H`E(`V\WH!F`29)#@"!!(,.!P,\+C\!1P#(/OWO?H` +M+0#04N=+YRC@``!D$0+`<&\!P#P-`L``E@"`@((`@/B``<`4!````"``@$!! +M`(!(9`'`*`@````P`(`,EP'`0`T`@````H#`HP"`P*0`@!TF`,!\-@#```P` +M@`$@ZN;PM96P`*L`(1ER)"/W25A#1!C@:0`%P`V@86%IP``/&'YH`2`.\-#Y +M\4D(:`$P"&"P>/-X[TD;`AA#B$($T.Y)2&D!,$AA?N``(+!P\'`P'"`P!Y`Q +MC`$@0`,@.0B1@4)QV`B8`"ANT`>8!9##>(!X&P(80P$'B0\!*1K1``8`#PHH +M`]$%F`3P8OA)#P(I"M$`!@`/ +M""@&T7-[,'NZBQ(D`0```%!7`````@``C>"R9!L"&$,H=`,*:W0H?&M\&P(8 +M0T`'0`\$D,%(P'N`!A+4!9@!(1(P`_#,_@.0*!P(,`WP\/\"J@"2!)H'F0.; +M__9")H!\!GXL'D'\#SYL4D(7`#@D^#H<3%YR0<# +MU`(H`=$8(.AQ\'EHBAWL7TH'!0P$Y`4D0WPL?\`"A29``((0Q.9#?#`^W%]*!P5 +M,!&0$I$-\*/_``H2F0`""$,1F0WPLOLQ?2@<%C`/D!"1#?"5_P`*$)D``@A# +M#YD-\*3[L7XH'!@P#9`.D0WPA_\`"@Z9``((0PV9#?"6^W%^*!P9,`N0#)$- +M\'G_``H,F0`""$,+F0WPB/LQ?B@<&C`)D`J1#?!K_P`*"ID``@A#"9D-\'K[ +M*!P$\,[X,'ET20:0<4@@.,-Z@'H;`AA#@`8$U0680'P*>)!""-!N2`!H`"@( +MT`68P'H)>(A"`]$P'`B9!_#;^`$F-@,`(:!I]00!(SIH&P4:0"-I`3N#0@K1 +MX&@``2A#.&#C:3`0FC1`""X[A[&P(80[!Q$)@P<0,*Y?3`<%#`.D`^1#?"R_@`*#YD``@A##ID-\,'Z>7TP'!4P#)`-D0WPI/X` +M"@V9``((0PR9#?"S^CE],!P6,`J0"Y$-\);^``H+F0`""$,*F0WPI?JY?C`< +M&#`(D`F1#?"(_AC@^>#D$`+`##0`P.^^```P9`'`+C,`P`"@`("P30#`L"8` +MP$GQ`0!T)0#`%%`"P"P-`L``"@F9``((0PB9#?!]^GE^,!P9,`:0!Y$-\&#^ +M``H'F0`""$,&F0WP;_HY?C`<&C`$D`61#?!2_@`*!9D``@A#!)D-\&'Z,!P# +M\+7_\$XP:`$P,&#O3K!Z\WH;`AA#@`8-U0&8[$E`?`EXB$('T.M(`&@`*`/1 +M.!P"F0;PQO^P>O-Z&P(80X`&1M7A3AX@,6@-\-CY`2D\T0.8(#!">P$<##%7 +M&/%H`"D*T0HP#?`6_D`&!=1X>`4H*='X>2PH)M'L[<#Z`0```$A;`````@`` +MOA$.A-=(`'@`*"31UDD)($AC`B$`(`GPU?\/(0`@"?#<_P(A`2`)\,W_#R$! +M(`GPU/\"(0,@"?#%_P\A`R`)\,S_R4D6($`Q"&!(8,A@`2``X``@L&`P:`$P +M,&`!(A(#`"&@:=<$`28K:#8%,T`F:0$^AD(*T>!H``$X0RA@Y6D0'*A#X&%E +M:0`@"N"F:`$P-@$^0RY@YFD(-0@V]@3V#.9A`"L#T2-I`3&+0MO2`2`1L/"] +M`"(!)Z%I_P5I"0.I0^%A96D` +M(0K@IF@!,38!/D,N8.9I"#4(-O8$]@SF80`KV-$C:0$RDT+:TM/GF$M34-+G +M\+5!:8)I`2?4``D9/P,`(_X$`24,:"T%+$`%:0$]E4(*T<)H$@$R0PI@PFDY +M')%#P6%!:0`B"N"%:`$R+0$U0PU@Q6D(->T$[0S%80@Q`"P#T01I`3.<0MO2 +M\+WXM8!.`"0`)Z``A1FH:@`H`M`!\!/]KV(!-!`L]-,W<'>$^+WPM<%I`"8) +M!$,D4/!84%I`"(,X(-H`23D!QL!(T,+8,-I`3((,]L$VPS#80@QQ&D# +M:B4%'P4_#2T-O4+2T0$E+0/J5/,=`0```$1=`````@``I^G0]"Q`*T"<0LS0 +M@F$P'/"]\+6OL`"K`"$9=P`B!)(D(D)#5$@2&"Z23$I`.A,<0#-@,H`P*Y`L +MDBV3`"0`(`B0`"$*E`"K&7<%D`.0+I@.D/_WGO\`*`+1!)@OL/"]#IB`:0Z9 +MP`!):0@816@!(`V5#?`__D%)"&@!,`A@#9T_2:AXZW@;`AA#B$)CT0`@J'#H +M<`V?`2`@-SJ(0`,@.@R2@D)7V`R:`"I4T`R:/AP0!``,*I`X@/AX.WD!(1L" +M&$/`!S@<##`#\(/[`Y#P>#-Y&P(80T$&6-4#F2E*L#')>A%P!"D&T``P9`'`D$T`P$GQ`0!T)0#`_#,`P$"F`(``,`"` +ME!("P.00`L`,-`#`[[X``!TF`,#<4P#`[$D!(`AP#IB`:`SPJ_X#\)G]!!Q( +MT+!X\W@;`AA#``8`#P@H"=%K>RA[&P(80R!T`PI`!T`/8W0*D`28`3`$D/!X +M,WD;`AA#0`9DU0$@")`@'`@P&Y`-\!_\!ZH`D@J:.1P#F__W7_H`*''0`B@7 +MT1N8#?`WPXN<`0```$!?`````@``4P%N21'\("(Y'`#P1_P!X(;@$N`@("!Q +M`PIC<8`@('""(*!P`"`@=&!T(!P#\&G]Q4F(;@$PB&9TX,1*4(P!F8A")=$0 +M>`*9`3"(0B#1`ID&F(D`B1B(8@*9$7`"F2J820")&$B`\'@S>1L"&$-`!UC4 +MMT@`>``H#M!K>RA[&P(80P,*('1C=$$'20\#F@7@!I@!\(S[0^`#F@`A,!P# +M\/O[`"#-X-S@`_`4_00<-]`)F*9)@`!`&"F0A6H)F"\<0`!`&$"((#<^'"B$ +MN'C[>!L"&$,!!XD/`BD,T0`&`."WX``/""@&T6M[*'L;`AA#('0#"F-T('QC +M?!L"&$-`!T`/"I`@'`@P*)`-\(W[!ZH`D@J:.1P#F__WS?D`*`+0__0;PU/R$20AAY8'#K>ZA[&P(80Z!Q>W@X>!L"&$,@<0,*8W&`("!P`2"@<`KP:?O@<&AZ +M('>I?2`<%#`FD">1#?!,^P`*)YD``@A#)ID,\%O_:7T@'!4P))`ED0WP/OL` +M"B69``((0R29#/!-_RE](!P6,"*0(Y$-\##[``HCF0`""$,BF0SP/_^I?B`< +M&#`@D"&1#?`B^P`*(9D``@A#()D,\#'_:7X@'!DP'I`?D0WP%/M\`J@;`0`` +M`#QA`````@``6]Z?E``*'YD``@A#'ID,\"/_*7X@'!HP')`=D0WP!OL`"AV9 +M``((0QR9#/`5_R`<`_!I_"F8@&H!\+OZ*9@`(8%B"9@!,`*9"9"(0@#8+>![>#AX&P(80R!Q`PIC<0[@>W@X>!L"&$,@<0,*(!P(,&-Q#?#8^CD< +M#)H`\`[[*'D+D"V8PWJ`>AL"&$.`!@35,4EP?`EXB$((T"](`&@`*`C0+$GP +M>@EXB$(#T2@<#)D&\%#\#IC_]RW]!9@!*&C0+)C`>\`&*]0#F``H!]$!(3`< +M##`#\'[Y`Y``*!O0`YBP,$!Z`"@6T+!X\W@;`AA#``8`#P0H`]`,*`'0""@/ +MT6M[*'L;`AA#`PH@=&-T00=)#P.:`>`#F@`A,!P#\+OZ#TB`:/\P83"!>0`I +M&]`*20EH`"D"T0N9R0<2U0$A$>```!TF`,`@-`#`E!("P"0;PIOOU20AAY8'#K +M>ZA[&P(80Z!Q@"`@<`$@H'`*\$+ZX'!K>"AX&P(80Z!T`PKC=&AZ('>I?2`< +M%#`8D!F1#?`>^@`*&9D``@A#&)D,\"W^:7V#&M6U`0```#AC`````@``KS8A +M*2`<%3`6D!>1#?`0^@`*%YD``@A#%ID,\!_^*7T@'!8P%)`5D0WP`OH`"A69 +M``((0Q29#/`1_JE^(!P8,!*0$Y$-\/3Y``H3F0`""$,2F0SP`_YI?B`<&3`0 +MD!&1#?#F^0`*$9D``@A#$)D,\/7]*7X@'!HP!1P/D0WPV/D`"@^9``((0RD< +M#/#G_0#P*OH+\&#\!1P(F``H!]`@'`@P#?#%^2`B.1P`\/OY`"T"T2`<`_`I +M^RN8L4F`:`AAPN3XM:](!!S`-`4<@#4!(@(@K4GZ]RS[!ASXT'`'2M6G2(`P +M`&D`#"AC`"<2X*=(`'@`*`K0ID@!(4%A@6(`(<%B_R&B2(DQ0#`!8`0@__<3 +M^0$WZ6HH:PH%`P4;#1(-FD+DT0$B$@,10!!`@4+>T)-)Z&H(8I=)"&C`&0A@ +M`"\)T``@`_#A^I-(`"&32@%@4&@!,%!@DDB23SAAD4E`.4AHP`4'U8U*$&D! +M,!!ACDA(8(Y(.&'P!SG5@4E`,0AK``SH8`,@__=*_'U*J6@188!*$6@)&!%@ +M`"@"T``@`_"T^H`@?T_`0SAA=4FH:$`Q"6L)#`H%`P4;#1(-FD($T?H,$4`0 +M0(%"`]$!(0(@^O>D^G1)0#E(:``'"-5O2A!I`3`080@@P$-(8'!(.&&P!SG5 +M8TB`,(!I``Q@80`G!.`,\UI``0```#1E`````@``ML[_60CP4_K_]P[Z`3R_7TAR0`" +M(@&2`"(`D1=)!"`4H_KW@_@`*`#1C+T!(/SG@+4$(/KWN?B`O8"U`"@%T`$< +M`B"TI64@`0```#!G`````@``0B9!Y/KWC?D`(("]`2"`O?BU"TX`)``GH`"% +M&:AJ`"@"T`#PS/^O8@$T$"STTS=P=X3XO4U!0R!2>```]V,``)02`L"PM0T< +M`0,(&($-04`(`4`800I!0(@"0!B!"$%`R`%`&`$+2$`-\,KZ7R')!0WP_/H$ +M'"@<#?#"^B$<#?#U^@WPC?JPO0LP`I_-$Z22`Q"'((>7!'-T@( +M(0&`@B$!<3A(`(C`!C=)`=4"(`#@`R`(<'!'-$HPM11X`1PS2^("!*F0$10QI*$8$93`,A(#0A<0$&`@02#@D. +M`BL$T`,K!-$``@`.('$B<2%Q('D0O1"U`AP,'/_W7_^D`0`J"=$_(/_W:O^` +M!H`.($,!!@D./R`(X$`@__=@_X`&@`X@0P$&"0Y`(/_W3?\0O0#H`(``P0"` +M?2P`P`"C`(``(`"`Y!,"P`($``#XM>Q)`"#(8!@Q"'#J3@`E`"1(2_@$U`302+._3^+UPM=].`"4`).``,%@`*`/0 +M*!SY]XW_`34!-!(L]--PO?BUV$@%:`$DUD\!)C`?\@!0/5!"$"(/GW<__@!`?5.&A`(2AA`B#Y]VO_JT@P82`&!=4X:`$A +M*&$"(/GW8?^G2*A/`&@`*!/0X``#U0?P(/^E2#!A(`$+U:1)`"`):``I`=&B +M2(!J``8`#@3P'O@W82`$`]40(0,@^?="_YA(`&@`*`+1(`$`U3=AX`>93PK5 +M>&L$(0$P>&-H:`A#:&!`(0,@^?'1+)#.(`!I0A4I`,I)I%#,:4(-* +M0#+2:10S&E"`2D`R$FH4,QI02!PH<`0I`=D`("AP("$#(/GW^/X$X"$@>$G` +M`H`Y"&)@!PG5:&@0(0A#:&"X:@$PN&($(,!#,&$@!PK5:&@@(0A#:&#X:A`A +M`3#X8@(@^??9_N`&$=5H:$`A"$-H8#AK!"$!,#AC9$B`.`%@`/#%_?[WF?L0 +M(,!#,&&@!A'5:&B`(0A#:&!X:@0A`3!X8EI(@#@!8`#PL?W^]X7[("#`0S!A +MH`0$U?\A`3$"(/GWJOYH:``H`]`!(,`#^O=<^#U)"#$(:`$BD@(00PA@^+W_ +M(#E)`3#(8`(@<$=<3CVX`0```"1M`````@``:"\C=("U`O!%_C5*"#(0:/\A +M`3$(0Q!@@+TQ2`!H`B!P1W!'_K4N2$`FQF!`3WAJ!?#,_P*I/2`)\$O]`:D[ +M(`GP1_T`JQAZ&GJ`(0A`?R&10RM,"$-V/"$<(#'+>8EY``8;`AE#`!:)!@#5 +M!3!`0@`&5B')0P`6B$("W"`<>C!>X`$<5C$$*0+8(!Q^,%?@`1Q1,00I`M@@ +M'((P4.`!'$PQ!"D"V"`&()20AH,$,(8`(@_KUP1P9)@"`(.!@HV"*8,M@`2$!(/GW>OT`(!"]L+4%'`$@^?>+_2!) +M'T@@,=R0$@^?=^_0`@L+V`M?GW7OZ`O1!)``%`&'!' +M@+7Y]Y'^@+T0M00<`2#Y]U[]"4D@`4`8@6@`*0G1P6@`*0;1!4H@,M%HB� +M8,%@@F`!(/GW6/T0O5P4`L!PM0`@BTH`)($``3`**%10^M.(38=)*#V&3B@< +M4#D-810P/#[P8"AAZ6`&(2@=+&`+\';^+6)L808A*!P8,&YB"_!N_G"]@+7_ +M]]K_`2$"(/GW!OUW20$@5#D(<``@@+W.Y_BU%AP$(@4<#!R!'&A&"_"H_@HA +M`)C_][[[,&!M28``"%@@8``H%=`$,`0B*1P+\!K^`"@*T0?@(&`$,`0B*1P+ +M\!'^`"@!T0(@^+T@:`!I`"CQT00@^.=\M08<`"``D%Q(#!Q4.`!X`"@!T0,@ +M?+T"(/GWW/P!JFE&(!S_]\#_!"@$T`(@^???_`4@[^=035!)4#TH:3PYB$(D +MT`0P!B(A'`OP7OXI:0`B#F``F``H"M$`D0AI*&'%8,I@"F$!F$1*@``14`G@ +M`6$I:0EI*6'-8`%IR&``:0"0`F$"(/GWL_P`(,/G`B#Y]Z[\!R"^YWRU!1P` +M(`"0-D@,'%0X`'@`*`'1`R!\O0(@^?>0_`&J:48@'/_W=/\$'`(H!-`"(/GW +MDOP@'.[G`)@I3@!H4#XH8`"8,FDF3=!@,&$!:0`I!=%`5K<[`0```!QQ```` +M`@``XMPZ><-H`"L"T0&;FP`$X`&;FP#L6(1"`='I4`/@PV@`*P#0&6$!:0`I +M`=##:,M@`F'&8`(@^?=H_`$@Q.?XM0(@^?=5_!-/`":U`!?@(&C_]^?^(&C_ +M]^C^(&D`*`+1`"%Y40/@`"'!8"!I>%$)25`Y"&G$8.%@"&D@80QA?%D`+.31 +M`38*+M_3`B#Y]SW\^+T``/`4`L!PM04<`2$Z,`+PJ_D$'"70Z4B`(H-[07L; +M`AE#D4-!.MX&P(80P`H%M`!*`'0`B@1T2@=!1P,\+KZ``<`)@`H +M`=I9(`95*!P,\+'Z0`>`#P'04#1FP&8&P(: +M0PXC6$,`&5LP,1RNX"$.MX&P(80P#@>N``!@`.B'(I>VM[&P(90P`I<=`!*"C1$"(Q'"`<7#`+\/G\ +M.!P,\`KZ@`$+U0@B(!QL,`.9"_#N_`@B(!QT,`29"_#H_#@<#/#Y^4`&4]4% +MF`SP]/F<(0A1!II3>1!Y&P(80Z`T((!&X`(H1-$0(C$<(!Q<,%'@(!Q0,`$A +M07+K>*EX&P(90PD&"0[!<@*1")@,\-3Y`R@!V0`@`>"`!X`/!YD(<2I[:WL; +M`AI#`"HBT`*9`2DJT1`B,1P@''PP"_"I_#@<#/"Z^8`!"]4((B`QL"&$,-*`/1`2&`-.%R`N``((`TX'(`(`NP\+TPM0`I#-"+($!<`"@! +MT0@C`N`!*`31$",`(-P>-DH'X``@,+T+&'`S&WL5&`$PZW"@0O?3`2`PO3"U +M`"D!T0`@,+U8(E):4@0!U`@D`.`0)`XC6$-`&``BXQXG307@@1A0,"#8<9`@&'*@ +M(%AR`""8<@20`Y5IBR`<$#``&T`8$#``"0`!`)`0(B`<`:D+\)[[KHH!/@S@ +M`)@G'"08$"(@'`&I"_"3^R$<##$X'`OPN/P!/O#2*!PL8S^0`M`M`H'!`P<+T`('"]L+4$'`#PS/C@B@`H%=`!.``$``S@ +M@B&+B$(`TB"#)6DH'`PP#/!B^"!A`2#H<:AQ`"T"T"@<$#"PO0`@L+T!'!`Y +M$+4*:%U+6TR:0@/0('@!,"!P">!B:)%"!M.B:)%"`]@*'!`R@D(!T``@$+T( +M'!"]<+7_]^/_!!P(T"`<"#`,\#3X!1P`\(OX`"@!T`$@<+V@>0`H!='GSB*`3#H@@`@H'$P'/GW0_D`('"]L+7_]['_!!P(T"`< +M"#`,\`+X!1P`\%GX`"@!T`$@L+V@>0`H!=$N20PQ"&@!,`A@].?@>?\P``8` +M#N!Q"M$A'`PQ*&D+\/W[+&'HB@$PZ((`(*!Q`""PO1"U__>%_P0<$-`@'`@P +M"_#6_P#P+O@`*`C1^?%Y`"D!T`$QX7'Y]__X$+T0M00<`/`>^``H`=`` +M(!"]((L0O1"U!!P`\!3X`"@!T``@$+W@BA"]$#B">1%#@7%P1Q`X@GF*0X)Q +M<$<0.(!Y"$!P1P5)2FB00@+3B6B(0@'9`2!P1P`@<$<``!@5`L`2-%9X@+4! +M8`$@"?`&^("][TCP20A@<$?XM>Y.@"0@-C<=`"7K2"@P!&`!(`CP]?\]8`$@ +M"/#Q_S5@`2`(\.W__R!!,`$TA$+LT^-(16#_]]__^+WXM0`DA2```=])8$-% +M&(4A"0$H'`OP(/I8(-Q)8$-!&`$@P`(H&$$B4@$!80`AJA@1_#`0````QY`````@`` +M/#WF5%(`B5J)!LL-G$:!`'$82W@*>`$P&P(:0_\C^3.:0V-&&D,*$]X2AP;`A]#&",?0T]P.PJ+<$MX#W@`!AL"'T,"(Y]#?PA_``0CGT,/<#L* +M2W!3>!=X`C$;`A]#@".?0Q=P.PI3<`J(`2/;`YI#``X"*`J`QM-QB`\B$@*1 +M0YL)R1AQ@/&(D4,#(I("B1CQ@"@<"_#>_@0A`7`+"D-P*!P+\-?^`C!#>`9X +M#"$;`AY#CD,$-@9P,PI#<"@<"_#)_O`BED,Q'(`Q@7`+"L-P*!P+\+_^CTD, +M,`8B"6@+\*7Y`30D!B0.""P`TD;G^+V)2@`H&M&`2X`[&&M9:\D%P`7`#``B_S#H +M<")S(6@('"`PPWJ`>AL"&$,'*`;9#"@$TEU)"&@!,`A@$.`D,0`@"_!D^B%H +M"2`@,8AR`PK+$-$&$$@0`$F&#![`"@=T#@<__>K_P$G_P(`(3%SX!F!8@%I#APD-C`<"_`3 +M_D`(0``Q'`OP)/H`(``A(A@!,``&TAD`#@8H$7+WTR@<^/`$"E`(`!+-S1]DL: +M8QH](06@!(E('$4-!8.U) +M`2`(8,'GZ4I`.M%H`"@'T0$@P`6!0]%@$&A`"$``!^`!*`;1P`:!0]%@$&@" +M(8A#$&!P1X4C&P'?25A#0!A!(4D!0!C`>``H`=`!('!'`"!P1_>UA+`-'/CW +M>?[52@`A$6`&F84C&P'32EE#CAA!(4D!=!@A>P`I#-$!)R=S!ID`D?CW:?X` +MF0@I!M'\.?81`0````1]`````@``T2V&F0`@P$,'L/"]^/=@_OCG@R```3`8 +M`Y`'<@`@`"$#Q@/&`2')`A`^=Q@"EWA@.&`!(&!S$#%Q&``@"''X8;AAX'!@ +M<2@<##`+\`O]('$`F"D`IX +M``<;`AI#$@D2`0`/$$,(<`,*2W!H?@:9A2,;`:A*64.*&"$AB0&`!X`/41@# +M*`'1&"`(X`(H`=$/(`3@`2@!T0@@`.`$(`AS`9@`(0'PJ/L`*`+00'L#F4AR +M.!T$'`OPR/P@,$-X`7@$(AL"&4,10P%P"PI#<`*9`""(8CD<)#$*(`OPS/@@ +M'`OPL_P&,`8B`9D*\)K_[7T@'`OPJOPA,$-X`7CP(AL"&4.10RH'$@X10P%P +M"PI#<`"8;.?XM7Q-`"88/2P<*#P@:``I(-$!)S\'.$,@8`$@"/``_2!HN$,@ +M8`$@"/#Z_/\@"3`H8`$@"/#T_"@?!F`!(`CP[_QL2"`X!F`!(`CPZ?QI2,`X +M(.`!)W\'.$,@8`$@"/#?_"!HN$,@8`$@"/#9_/\@"C`H8`$@"/#3_%Y('#@& +M8`$@"/#-_%M((#@&8`$@"/#'_%A(0#`&8EQ)06(!(`CPO_SXO0`@<$=P1W!' +M<$W$8"WH"'"`RG4(DT4-[3'JC0B#1@WN,>J-"'-'#>\QZHT(8T0-\ +M#'NC0A310WQ)>XM"$-&3>%%X&P(90Y)+"08@,_,8G'@)#Z%"!-$9>P`I`=`' +M(37@`"&%(QL!ATQ+0QP9`2/;`N,8'GJU0B+11GM?>KY"'M&&>Y]ZOD(:T<9[ +MWWJ^0A;1!GP?>[Y"$M%&?%M[GD(.T9-X5G@;`AY#,P9!)G8!I!FF>!L/LT(" +MT2-[`"L$T0$Q"08)#@@IS-,(*1[0A2,;`5E#;$X!).0"B1D,&0`CHV+3>))X +M020;`AI#$@ED`0L9VH(`(H,8C1@@,QMY`3(2!BT9$@X(*JMS]-/PO?.UA;`, +M'/CW@OL!D(4@``%@0UE)`I0%G4$8`"0$-0.1*!P+\$/Z`!F`>0.9`2+2`@D9 +MB1@)>HA"-]$!-"0&)`[?Z6'L`0```/B"`````@``5OU=Z@8L[=-!(`.90`$/ +M&#A[`"@KT'UY`YP`)B@!`!D`>P`H&=$H`009`2`@P\+T!-6@&0`YX<0$@`YG``@@8`6@`*0'1!&`!X$%H +M3&!$8/AX`3#X<'A[`2@%T0*`%X#R(;`AE#$4`R`1%#`7`+"D-P(&D'<"%I`"!(<"%IB'#(<"%I$#$* +M\+[](&D$,`OPI/D#,`%X0W@((AL"&4.10PG@X*H`@+R``0`("```2!4"P#!" +M```!<`L*0W`A:20Q"R`*\*#](6D/'!PW.!P+\(3Y`2%)`PA#.1P*\)3](6D! +M(APQ$@,00PKPC?T@:2@P0W@!>!L"&4-)"$D``7`+"D-P_R/Y,YE#"!PB:2@P +M*#(0<`,*4W`@:2DP`.`.X$-X`7@8(AL"&4,10P%P"PI#<*EY(&D%\-?]`"@! +MT0`@^+VH>?!)@``*6K)"!=%`&`(P`H@!,@*`!>`.4JAY`"*``$`80H"H>>A+ +M@@`;8+T'`0```/2$`````@``3P6#FE(84H@;:)I""MGF2A!P`2#E2H`"T&*J +M>0`@D@!1&$B``2#B2:!B2&@!,$A@`2#1Y_&UB+`(F$$A20%`&`>0P(H(F@`F +M`Y`('"`X%1@L:``@!I`%D`B8!9E`&$$A20%`&(![`9``(`20`9C`!VG5`Y@& +MF4`8`04)#0*1`"QAT"!H!#`+\/7X0WX`?@*9&P(80P`)"!H!(0D#0!C!%PD- +M"1@)$PD#0!H`!``,0"A)V"!H`"<$,`OPW/A#?@!^`ID;`AA#``F(0CW1`"(B +MS^R!H`"(P,,)PZ&D!,.AA`>`)X"8<9&@`+P/0`"`X8'A@ +M`>``+*K1!)@&F0$P``8`#@20`9@!,4`(`9`)!@D.!)@&D0@H`-)VYP69`3$) +M!@D.!9$'*0#89.>!(0B:"0%1&``@"'$'F(^0:0$IB%(QL!>DE80T$8!9$`(0`D`)0! +MD4$@!9E``0\8.'L`*`71!ICX]W?Y`"`3L/"]`2`%F<`""1@0]0QC`0```/"& +M`````@``N^T])Q&1#F@`+@G0,&@$,`OP,OA#?@!^&P(80P$)!)$`(0*1!9F# +M(``!"!@0D!*8!R$``0A##Y`A(`69@`$)&!*8+",.D5Y)6$-!&`V174D,D6GA +M,&@$'`0A__=C^``H"]%221*8"'`!(%%)@`+(8E5)2&@!,$A@D^`0F`!Z`2AR +MT0`E(!T+D`N8"O#U_T`9@'D%F0$BT@))&8D8"7J(0@?00DG_(`AP04E0",AB +M`2$!D0$U+08M#@8MY=,!F0`I;]$!("!P`"!@<"$<)#$/F`KPZ/MP:``H)]`` +M:`4`$Q&P(80XA"N'D'TBM) +M@``4,4`8`6@!,0%@">`G28``%#$*6`0J`=D!(@"2`"(*4`Z9"'L"F8A"#M!P +M:``H"]``F@`J"-$#F`290!H`(4`8``4`#4`H!M,-F0$@B&$!(0&1#ID(<`N8 +M"O")_P#@UN"!>,-X&P(90PH'D@\"*@;1"08)#P@I`M&`><`'(=4`(#(A"%4A +M'`H@(#&(<@,*RW(@'/[W+_^VX,3@?!@"P,`F`,!P1`$```P`@$@5`L`H9`'` +MO(`!`"AS`L!,30#`)!4"P"4<(#4I>FMZ&P(90PJ1R`&L`0```.R(`````@``?/0_>LAB +MY4F(:`$PB&"0X`J9`2(10RER"PIKBAZ&P(80Y!#8#`H +M<@,*:W(@'#`P!Y#`>``H']`$*!/2N'F_28``"%@`*`W00'L$\"#X(1PL,0KP +M]OH!>",<(#,93^`'@`2!X:%(QL!DDI80X`8(2*2`0`A@!@!<'!' +M<$>%(QL!6D.,2S"UTQ@!(M("FA@$>!5ZK$(>T41X57JL0AK1A'B5>JQ"%M'$ +M>-5ZK$(2T01Y%7NL0@[10'E2>Y!""M%!($`!&!B">(I"!-$`>P`H`=`!(#"] +M`"`PO1"U!!P`((`L*=-A!`/5!R#_]_/]`2`A!@/5`"#_]^W]`2#A!0/5`2#_ +M]^?]`2"A!0/5`B"TW?OL`0```.B*`````@``B!R!Q__WX?T!(&$%`]4#(/_W +MV_T!("$%`]4$(/_WU?T!(.$$`-4!(*$$`-4!(!"]^+4,'!4<]_=4_P8/\QP7`A:`@<(###>H!Z +M&P(80P Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2083010656BF; Mon, 1 Jun 2009 18:07:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01D498FC22; Mon, 1 Jun 2009 18:07:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51I7cYt086814; Mon, 1 Jun 2009 18:07:38 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51I7ccW086812; Mon, 1 Jun 2009 18:07:38 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906011807.n51I7ccW086812@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 1 Jun 2009 18:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193241 - in head: . sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:07:41 -0000 Author: bz Date: Mon Jun 1 18:07:38 2009 New Revision: 193241 URL: http://svn.freebsd.org/changeset/base/193241 Log: Decrement __FreeBSD_version again to 96 as we are runing out of digits and want to be conservative - so not more than one version bump per day. Discussed with: jhb, kensmith Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 1 18:07:01 2009 (r193240) +++ head/UPDATING Mon Jun 1 18:07:38 2009 (r193241) @@ -26,7 +26,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. The way we are storing and accessing `routing table' entries has changed. Programs reading the FIB, like netstat, need to be re-compiled. - Bump __FreeBSD_version to 800097. 20090601: A new netisr implementation has been added for FreeBSD 8. Network Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jun 1 18:07:01 2009 (r193240) +++ head/sys/sys/param.h Mon Jun 1 18:07:38 2009 (r193241) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800097 /* Master, propagated to newvers */ +#define __FreeBSD_version 800096 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:15:47 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BA6C1065677; Mon, 1 Jun 2009 18:15:47 +0000 (UTC) (envelope-from kensmith@cse.Buffalo.EDU) Received: from phoebe.cse.buffalo.edu (phoebe.cse.buffalo.edu [128.205.32.89]) by mx1.freebsd.org (Postfix) with ESMTP id 0C4C78FC29; Mon, 1 Jun 2009 18:15:46 +0000 (UTC) (envelope-from kensmith@cse.Buffalo.EDU) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) (authenticated bits=0) by phoebe.cse.buffalo.edu (8.14.1/8.13.7) with ESMTP id n51IFe8W049650 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Jun 2009 14:15:46 -0400 (EDT) (envelope-from kensmith@cse.buffalo.edu) From: Ken Smith To: "Bjoern A. Zeeb" In-Reply-To: <200906011807.n51I7ccW086812@svn.freebsd.org> References: <200906011807.n51I7ccW086812@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-59o58l9ZHsQKIyiYjBau" Organization: U. Buffalo CSE Department Date: Mon, 01 Jun 2009 14:15:40 -0400 Message-Id: <1243880140.25229.23.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port X-DCC-Buffalo.EDU-Metrics: phoebe.cse.buffalo.edu 1336; Body=0 Fuz1=0 Fuz2=0 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193241 - in head: . sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:15:47 -0000 --=-59o58l9ZHsQKIyiYjBau Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2009-06-01 at 18:07 +0000, Bjoern A. Zeeb wrote: > Author: bz > Date: Mon Jun 1 18:07:38 2009 > New Revision: 193241 > URL: http://svn.freebsd.org/changeset/base/193241 >=20 > Log: > Decrement __FreeBSD_version again to 96 as we are runing out of digits > and want to be conservative - so not more than one version bump per day= . > =20 > Discussed with: jhb, kensmith >=20 > Modified: > head/UPDATING > head/sys/sys/param.h >=20 > Modified: head/UPDATING > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/UPDATING Mon Jun 1 18:07:01 2009 (r193240) > +++ head/UPDATING Mon Jun 1 18:07:38 2009 (r193241) > @@ -26,7 +26,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. > The way we are storing and accessing `routing table' entries > has changed. Programs reading the FIB, like netstat, need to > be re-compiled. > - Bump __FreeBSD_version to 800097. > =20 > 20090601: > A new netisr implementation has been added for FreeBSD 8. Network >=20 > Modified: head/sys/sys/param.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/param.h Mon Jun 1 18:07:01 2009 (r193240) > +++ head/sys/sys/param.h Mon Jun 1 18:07:38 2009 (r193241) > @@ -57,7 +57,7 @@ > * is created, otherwise 1. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 800097 /* Master, propagated to newvers */ > +#define __FreeBSD_version 800096 /* Master, propagated to newvers */ > =20 > #ifndef LOCORE > #include It was noted we're close to running out of numbers we can use before we hit code freeze and the branch for the release. Since we're entering code slush at the end of today in theory all changes that would warrant a bump in __FreeBSD_version are supposed to be done. But it wouldn't surprise me if we have one or two or so things that come along between now and when we hit code freeze and the branch. So we need to be a bit conservative with this. Please be sure to coordinate anything that might require a bump in __FreeBSD_version with re@ from now on. If it turns out things do come along that require bumps we'll need to "batch them up" having one bump represent several changes. Thanks. --=20 Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-59o58l9ZHsQKIyiYjBau Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkokGrwACgkQ/G14VSmup/bw2gCeNkXtbUpq73pbhbCLFHArTd4a SOMAn0hjCs0WqImk1tBMzWreyNxsMaDS =ZRsC -----END PGP SIGNATURE----- --=-59o58l9ZHsQKIyiYjBau-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:23:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B25D106566B; Mon, 1 Jun 2009 18:23:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 51E208FC12; Mon, 1 Jun 2009 18:23:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n51IKiE6095675; Mon, 1 Jun 2009 12:20:44 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 01 Jun 2009 12:20:54 -0600 (MDT) Message-Id: <20090601.122054.1585999559.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <86vdnfq1t3.fsf@ds4.des.no> References: <200906011111.n51BBkZt077175@svn.freebsd.org> <20090601.104358.-345495454.imp@bsdimp.com> <86vdnfq1t3.fsf@ds4.des.no> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, rse@freebsd.org Subject: Re: svn commit: r193223 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:23:43 -0000 In message: <86vdnfq1t3.fsf@ds4.des.no> Dag-Erling_Sm=F8rgrav writes: : "M. Warner Losh" writes: : > : @@ -187,7 +187,8 @@ padvance(char **path, char *name) : > : if (*path =3D=3D NULL) : > : return NULL; : > : start =3D *path; : > : - for (p =3D start ; *p && *p !=3D ':' && *p !=3D '%' ; p++); : > : + for (p =3D start; *p && *p !=3D ':' && *p !=3D '%'; p++) : > : + ; /* nothing */ : > : > C already has a way of saying this: : > : > for (p =3D start; *p && *p !=3D ':' && *p !=3D '%'; p++) : > continue; : = : It's a matter of taste. There is plenty of precedent for : = : /* nothing */ ; : = : and some for : = : ; /* nothing */ : = : (for varying spellings of "nothing") in the tree. True. I had some experience with early static analysis tools preferred the continue form because for them it was clear that you indented to do nothing. I suppose that the state of the art has progressed since then (this was like mid 1990's). Warner From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:27:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BA551065670; Mon, 1 Jun 2009 18:27:17 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 278CF8FC1E; Mon, 1 Jun 2009 18:27:17 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51IRHSG087337; Mon, 1 Jun 2009 18:27:17 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51IRGZl087328; Mon, 1 Jun 2009 18:27:16 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906011827.n51IRGZl087328@svn.freebsd.org> From: Sam Leffler Date: Mon, 1 Jun 2009 18:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193242 - in head/tools/tools: . mwl mwl/mwldebug mwl/mwlstats X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:27:17 -0000 Author: sam Date: Mon Jun 1 18:27:16 2009 New Revision: 193242 URL: http://svn.freebsd.org/changeset/base/193242 Log: tools for mwl driver Added: head/tools/tools/mwl/ head/tools/tools/mwl/Makefile (contents, props changed) head/tools/tools/mwl/mwldebug/ head/tools/tools/mwl/mwldebug/Makefile (contents, props changed) head/tools/tools/mwl/mwldebug/mwldebug.c (contents, props changed) head/tools/tools/mwl/mwlstats/ head/tools/tools/mwl/mwlstats/Makefile (contents, props changed) head/tools/tools/mwl/mwlstats/main.c (contents, props changed) head/tools/tools/mwl/mwlstats/mwlstats.c (contents, props changed) head/tools/tools/mwl/mwlstats/mwlstats.h (contents, props changed) head/tools/tools/mwl/mwlstats/statfoo.c (contents, props changed) head/tools/tools/mwl/mwlstats/statfoo.h (contents, props changed) Modified: head/tools/tools/README Modified: head/tools/tools/README ============================================================================== --- head/tools/tools/README Mon Jun 1 18:07:38 2009 (r193241) +++ head/tools/tools/README Mon Jun 1 18:27:16 2009 (r193242) @@ -46,6 +46,7 @@ mctest A multicast test program mfc Merge a directory from HEAD to a branch where it does not already exist and other MFC related script(s). mid Create a Message-ID database for mailing lists. +mwl Tools specific to the Marvell 88W8363 support ncpus Count the number of processors npe Tools specific to the Intel IXP4XXX NPE device nxge A diagnostic tool for the nxge(4) driver Added: head/tools/tools/mwl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/Makefile Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= mwlstats mwldebug + +.include Added: head/tools/tools/mwl/mwldebug/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwldebug/Makefile Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= mwldebug +BINDIR= /usr/local/bin +NO_MAN= + +.include Added: head/tools/tools/mwl/mwldebug/mwldebug.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwldebug/mwldebug.c Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,212 @@ +/*- + * Copyright (c) 2007 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +/* + * mwldebug [-i interface] flags + * (default interface is mwl0). + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#define N(a) (sizeof(a)/sizeof(a[0])) + +const char *progname; + +enum { + MWL_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ + MWL_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */ + MWL_DEBUG_RECV = 0x00000004, /* basic recv operation */ + MWL_DEBUG_RECV_DESC = 0x00000008, /* recv descriptors */ + MWL_DEBUG_RESET = 0x00000010, /* reset processing */ + MWL_DEBUG_BEACON = 0x00000020, /* beacon handling */ + MWL_DEBUG_INTR = 0x00000040, /* ISR */ + MWL_DEBUG_TX_PROC = 0x00000080, /* tx ISR proc */ + MWL_DEBUG_RX_PROC = 0x00000100, /* rx ISR proc */ + MWL_DEBUG_KEYCACHE = 0x00000200, /* key cache management */ + MWL_DEBUG_STATE = 0x00000400, /* 802.11 state transitions */ + MWL_DEBUG_NODE = 0x00000800, /* node management */ + MWL_DEBUG_RECV_ALL = 0x00001000, /* trace all frames (beacons) */ + MWL_DEBUG_TSO = 0x00002000, /* TSO processing */ + MWL_DEBUG_AMPDU = 0x00004000, /* BA stream handling */ + MWL_DEBUG_ANY = 0xffffffff +}; + +static struct { + const char *name; + u_int bit; +} flags[] = { + { "xmit", MWL_DEBUG_XMIT }, + { "xmit_desc", MWL_DEBUG_XMIT_DESC }, + { "recv", MWL_DEBUG_RECV }, + { "recv_desc", MWL_DEBUG_RECV_DESC }, + { "reset", MWL_DEBUG_RESET }, + { "beacon", MWL_DEBUG_BEACON }, + { "intr", MWL_DEBUG_INTR }, + { "xmit_proc", MWL_DEBUG_TX_PROC }, + { "recv_proc", MWL_DEBUG_RX_PROC }, + { "keycache", MWL_DEBUG_KEYCACHE }, + { "state", MWL_DEBUG_STATE }, + { "node", MWL_DEBUG_NODE }, + { "recv_all", MWL_DEBUG_RECV_ALL }, + { "tso", MWL_DEBUG_TSO }, + { "ampdu", MWL_DEBUG_AMPDU }, + /* XXX these are a hack; there should be a separate sysctl knob */ + { "hal", 0x02000000 }, /* cmd-completion processing */ + { "hal2", 0x01000000 }, /* cmd submission processing */ + { "halhang", 0x04000000 }, /* disable fw hang stuff */ +}; + +static u_int +getflag(const char *name, int len) +{ + int i; + + for (i = 0; i < N(flags); i++) + if (strncasecmp(flags[i].name, name, len) == 0) + return flags[i].bit; + return 0; +} + +#if 0 +static const char * +getflagname(u_int flag) +{ + int i; + + for (i = 0; i < N(flags); i++) + if (flags[i].bit == flag) + return flags[i].name; + return "???"; +} +#endif + +static void +usage(void) +{ + int i; + + fprintf(stderr, "usage: %s [-i device] [flags]\n", progname); + fprintf(stderr, "where flags are:\n"); + for (i = 0; i < N(flags); i++) + printf("%s\n", flags[i].name); + exit(-1); +} + +int +main(int argc, char *argv[]) +{ + const char *ifname = "mwl0"; + const char *cp, *tp; + const char *sep; + int c, op, i; + u_int32_t debug, ndebug; + size_t debuglen; + char oid[256]; + + progname = argv[0]; + if (argc > 1) { + if (strcmp(argv[1], "-i") == 0) { + if (argc < 2) + errx(1, "missing interface name for -i option"); + ifname = argv[2]; + if (strncmp(ifname, "mv", 2) != 0) + errx(2, "huh, this is for mv devices?"); + argc -= 2, argv += 2; + } else if (strcmp(argv[1], "-?") == 0) + usage(); + } + + snprintf(oid, sizeof(oid), "dev.mwl.%s.debug", ifname+3); + debuglen = sizeof(debug); + if (sysctlbyname(oid, &debug, &debuglen, NULL, 0) < 0) + err(1, "sysctl-get(%s)", oid); + ndebug = debug; + for (; argc > 1; argc--, argv++) { + cp = argv[1]; + do { + u_int bit; + + if (*cp == '-') { + cp++; + op = -1; + } else if (*cp == '+') { + cp++; + op = 1; + } else + op = 0; + for (tp = cp; *tp != '\0' && *tp != '+' && *tp != '-';) + tp++; + bit = getflag(cp, tp-cp); + if (op < 0) + ndebug &= ~bit; + else if (op > 0) + ndebug |= bit; + else { + if (bit == 0) { + c = *cp; + if (isdigit(c)) + bit = strtoul(cp, NULL, 0); + else + errx(1, "unknown flag %.*s", + (int)(tp-cp), cp); + } + ndebug = bit; + } + } while (*(cp = tp) != '\0'); + } + if (debug != ndebug) { + printf("%s: 0x%x => ", oid, debug); + if (sysctlbyname(oid, NULL, NULL, &ndebug, sizeof(ndebug)) < 0) + err(1, "sysctl-set(%s)", oid); + printf("0x%x", ndebug); + debug = ndebug; + } else + printf("%s: 0x%x", oid, debug); + sep = "<"; + for (i = 0; i < N(flags); i++) + if (debug & flags[i].bit) { + printf("%s%s", sep, flags[i].name); + sep = ","; + } + printf("%s\n", *sep != '<' ? ">" : ""); + return 0; +} Added: head/tools/tools/mwl/mwlstats/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwlstats/Makefile Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +PROG= mwlstats +BINDIR= /usr/local/bin +NO_MAN= + +SRCS= main.c statfoo.c mwlstats.c + +.include + +CFLAGS+= -I. Added: head/tools/tools/mwl/mwlstats/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwlstats/main.c Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,128 @@ +/*- + * Copyright (c) 2006 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +/* + * Simple Marvell-specific tool to inspect and monitor network traffic + * statistics. + * + * mwlstats [-i interface] [-l] [-o fmtstring] [interval] + * + * (default interface is mv0). If interval is specified a rolling output + * a la netstat -i is displayed every interval seconds. The format of + * the rolling display can be controlled a la ps. The -l option will + * print a list of all possible statistics for use with the -o option. + */ + +#include +#include +#include +#include +#include + +#include "mwlstats.h" + +#define S_DEFAULT \ + "input,output,txtry,txretry,txmretry,txdoneput,rxfcs,rxcrypt,rxicv,rssi,rate" + +static int signalled; + +static void +catchalarm(int signo __unused) +{ + signalled = 1; +} + +int +main(int argc, char *argv[]) +{ + struct mwlstatfoo *wf; + int c; + + wf = mwlstats_new("mwl0", S_DEFAULT); + while ((c = getopt(argc, argv, "i:lo:")) != -1) { + switch (c) { + case 'i': + wf->setifname(wf, optarg); + break; + case 'l': + wf->print_fields(wf, stdout); + return 0; + case 'o': + wf->setfmt(wf, optarg); + break; + default: + errx(-1, "usage: %s [-a] [-i ifname] [-l] [-o fmt] [interval]\n", argv[0]); + /*NOTREACHED*/ + } + } + argc -= optind; + argv += optind; + + if (argc > 0) { + u_long interval = strtoul(argv[0], NULL, 0); + int line, omask; + + if (interval < 1) + interval = 1; + signal(SIGALRM, catchalarm); + signalled = 0; + alarm(interval); + banner: + wf->print_header(wf, stdout); + line = 0; + loop: + if (line != 0) { + wf->collect_cur(wf); + wf->print_current(wf, stdout); + wf->update_tot(wf); + } else { + wf->collect_tot(wf); + wf->print_total(wf, stdout); + } + fflush(stdout); + omask = sigblock(sigmask(SIGALRM)); + if (!signalled) + sigpause(0); + sigsetmask(omask); + signalled = 0; + alarm(interval); + line++; + if (line == 21) /* XXX tty line count */ + goto banner; + else + goto loop; + /*NOTREACHED*/ + } else { + wf->collect_tot(wf); + wf->print_verbose(wf, stdout); + } + return 0; +} Added: head/tools/tools/mwl/mwlstats/mwlstats.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwlstats/mwlstats.c Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,578 @@ +/*- + * Copyright (c) 2007 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +/* + * mwl statistics class. + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../../sys/net80211/ieee80211_ioctl.h" +#include "../../sys/net80211/ieee80211_radiotap.h" + +/* + * Get Hardware Statistics. + */ +struct mwl_hal_hwstats { + uint32_t TxRetrySuccesses; + uint32_t TxMultipleRetrySuccesses; + uint32_t TxFailures; + uint32_t RTSSuccesses; + uint32_t RTSFailures; + uint32_t AckFailures; + uint32_t RxDuplicateFrames; + uint32_t FCSErrorCount; + uint32_t TxWatchDogTimeouts; + uint32_t RxOverflows; + uint32_t RxFragErrors; + uint32_t RxMemErrors; + uint32_t PointerErrors; + uint32_t TxUnderflows; + uint32_t TxDone; + uint32_t TxDoneBufTryPut; + uint32_t TxDoneBufPut; + uint32_t Wait4TxBuf; + uint32_t TxAttempts; + uint32_t TxSuccesses; + uint32_t TxFragments; + uint32_t TxMulticasts; + uint32_t RxNonCtlPkts; + uint32_t RxMulticasts; + uint32_t RxUndecryptableFrames; + uint32_t RxICVErrors; + uint32_t RxExcludedFrames; +}; +#include "../../../../sys/dev/mwl/if_mwlioctl.h" + +#include "mwlstats.h" + +#define AFTER(prev) ((prev)+1) + +static const struct fmt mwlstats[] = { +#define S_INPUT 0 + { 8, "input", "input", "total frames received" }, +#define S_RX_MCAST AFTER(S_INPUT) + { 7, "rxmcast", "rxmcast", "rx multicast frames" }, +#define S_RX_NONCTL AFTER(S_RX_MCAST) + { 8, "rxnonctl", "rxnonctl" "rx non control frames" }, +#define S_RX_MGT AFTER(S_RX_NONCTL) + { 5, "rxmgt", "rxmgt", "rx management frames" }, +#define S_RX_CTL AFTER(S_RX_MGT) + { 5, "rxctl", "rxctl", "rx control frames" }, +#define S_OUTPUT AFTER(S_RX_CTL) + { 8, "output", "output", "total frames transmit" }, +#define S_TX_MCAST AFTER(S_OUTPUT) + { 7, "txmcast", "txmcast", "tx multicast frames" }, +#define S_TX_MGMT AFTER(S_TX_MCAST) + { 5, "txmgt", "txmgt", "tx management frames" }, +#define S_TX_RETRY AFTER(S_TX_MGMT) + { 7, "txretry", "txretry", "tx success with 1 retry" }, +#define S_TX_MRETRY AFTER(S_TX_RETRY) + { 8, "txmretry", "txmretry", "tx success with >1 retry" }, +#define S_TX_RTSGOOD AFTER(S_TX_MRETRY) + { 7, "rtsgood", "rtsgood", "RTS tx success" }, +#define S_TX_RTSBAD AFTER(S_TX_RTSGOOD) + { 6, "rtsbad", "rtsbad", "RTS tx failed" }, +#define S_TX_NOACK AFTER(S_TX_RTSBAD) + { 5, "noack", "noack", "tx failed because no ACK was received" }, +#define S_RX_DUPLICATE AFTER(S_TX_NOACK) + { 5, "rxdup", "rxdup", "rx discarded by f/w as dup" }, +#define S_RX_FCS AFTER(S_RX_DUPLICATE) + { 5, "rxfcs", "rxfcs", "rx discarded by f/w for bad FCS" }, +#define S_TX_WATCHDOG AFTER(S_RX_FCS) + { 7, "txwatch", "txwatch", "MAC tx hang (f/w recovery)" }, +#define S_RX_OVERFLOW AFTER(S_TX_WATCHDOG) + { 6, "rxover", "rxover", "no f/w buffer for rx" }, +#define S_RX_FRAGERROR AFTER(S_RX_OVERFLOW) + { 6, "rxfrag", "rxfrag", "rx failed in f/w due to defrag" }, +#define S_RX_MEMERROR AFTER(S_RX_FRAGERROR) + { 5, "rxmem", "rxmem", "rx failed in f/w 'cuz out of of memory" }, +#define S_PTRERROR AFTER(S_RX_MEMERROR) + { 6, "badptr", "badptr", "MAC internal pointer problem" }, +#define S_TX_UNDERFLOW AFTER(S_PTRERROR) + { 7, "txunder", "txunder", "tx failed in f/w 'cuz of underflow" }, +#define S_TX_DONE AFTER(S_TX_UNDERFLOW) + { 6, "txdone", "txdone", "MAC tx ops completed" }, +#define S_TX_DONEBUFPUT AFTER(S_TX_DONE) + { 9, "txdoneput", "txdoneput", "tx buffers returned by f/w to host" }, +#define S_TX_WAIT4BUF AFTER(S_TX_DONEBUFPUT) + { 6, "txwait", "txwait", "no f/w buffers available when supplied a tx descriptor" }, +#define S_TX_ATTEMPTS AFTER(S_TX_WAIT4BUF) + { 5, "txtry", "txtry", "tx descriptors processed by f/w" }, +#define S_TX_SUCCESS AFTER(S_TX_ATTEMPTS) + { 4, "txok", "txok", "tx attempts successful" }, +#define S_TX_FRAGS AFTER(S_TX_SUCCESS) + { 6, "txfrag", "txfrag", "tx attempts with fragmentation" }, +#define S_RX_UNDECRYPT AFTER(S_TX_FRAGS) + { 7, "rxcrypt", "rxcrypt", "rx failed in f/w 'cuz decrypt failed" }, +#define S_RX_ICVERROR AFTER(S_RX_UNDECRYPT) + { 5, "rxicv", "rxicv", "rx failed in f/w 'cuz ICV check" }, +#define S_RX_EXCLUDE AFTER(S_RX_ICVERROR) + { 8, "rxfilter", "rxfilter", "rx frames filtered in f/w" }, +#define S_TX_LINEAR AFTER(S_RX_EXCLUDE) + { 5, "txlinear", "txlinear", "tx linearized to cluster" }, +#define S_TX_DISCARD AFTER(S_TX_LINEAR) + { 5, "txdisc", "txdisc", "tx frames discarded prior to association" }, +#define S_TX_QSTOP AFTER(S_TX_DISCARD) + { 5, "qstop", "qstop", "tx stopped 'cuz no xmit buffer" }, +#define S_TX_ENCAP AFTER(S_TX_QSTOP) + { 5, "txencode", "txencode", "tx encapsulation failed" }, +#define S_TX_NOMBUF AFTER(S_TX_ENCAP) + { 5, "txnombuf", "txnombuf", "tx failed 'cuz mbuf allocation failed" }, +#define S_TX_SHORTPRE AFTER(S_TX_NOMBUF) + { 5, "shpre", "shpre", "tx frames with short preamble" }, +#define S_TX_NOHEADROOM AFTER(S_TX_SHORTPRE) + { 5, "nohead", "nohead", "tx frames discarded for lack of headroom" }, +#define S_TX_BADFRAMETYPE AFTER(S_TX_NOHEADROOM) + { 5, "badtxtype", "badtxtype", "tx frames discarded for invalid/unknown 802.11 frame type" }, +#define S_RX_CRYPTO_ERR AFTER(S_TX_BADFRAMETYPE) + { 5, "crypt", "crypt", "rx failed 'cuz decryption" }, +#define S_RX_NOMBUF AFTER(S_RX_CRYPTO_ERR) + { 5, "rxnombuf", "rxnombuf", "rx setup failed 'cuz no mbuf" }, +#define S_RX_TKIPMIC AFTER(S_RX_NOMBUF) + { 5, "rxtkipmic", "rxtkipmic", "rx failed 'cuz TKIP MIC error" }, +#define S_RX_NODMABUF AFTER(S_RX_TKIPMIC) + { 5, "rxnodmabuf", "rxnodmabuf", "rx failed 'cuz no DMA buffer available" }, +#define S_RX_DMABUFMISSING AFTER(S_RX_NODMABUF) + { 5, "rxdmabufmissing", "rxdmabufmissing", "rx descriptor with no DMA buffer attached" }, +#define S_TX_NODATA AFTER(S_RX_DMABUFMISSING) + { 5, "txnodata", "txnodata", "tx discarded empty frame" }, +#define S_TX_BUSDMA AFTER(S_TX_NODATA) + { 5, "txbusdma", "txbusdma", "tx failed for dma resources" }, +#define S_RX_BUSDMA AFTER(S_TX_BUSDMA) + { 5, "rxbusdma", "rxbusdma", "rx setup failed for dma resources" }, +#define S_AMPDU_NOSTREAM AFTER(S_RX_BUSDMA) + { 5, "ampdu_nostream","ampdu_nostream","ADDBA request failed 'cuz all BA streams in use" }, +#define S_AMPDU_REJECT AFTER(S_AMPDU_NOSTREAM) + { 5, "ampdu_reject","ampdu_reject","ADDBA request failed 'cuz station already has one BA stream" }, +#define S_ADDBA_NOSTREAM AFTER(S_AMPDU_REJECT) + { 5, "addba_nostream","addba_nostream","ADDBA response processed but no BA stream present" }, +#define S_TX_TSO AFTER(S_ADDBA_NOSTREAM) + { 8, "txtso", "tso", "tx frames using TSO" }, +#define S_TSO_BADETH AFTER(S_TX_TSO) + { 5, "tsoeth", "tsoeth", "TSO failed 'cuz ether header type not IPv4" }, +#define S_TSO_NOHDR AFTER(S_TSO_BADETH) + { 5, "tsonohdr", "tsonohdr", "TSO failed 'cuz header not in first mbuf" }, +#define S_TSO_BADSPLIT AFTER(S_TSO_NOHDR) + { 5, "tsobadsplit", "tsobadsplit", "TSO failed 'cuz payload split failed" }, +#define S_BAWATCHDOG AFTER(S_TSO_BADSPLIT) + { 5, "bawatchdog", "bawatchdog", "BA watchdog interrupts" }, +#define S_BAWATCHDOG_NOTFOUND AFTER(S_BAWATCHDOG) + { 5, "bawatchdog_notfound", "bawatchdog_notfound", + "BA watchdog for unknown stream" }, +#define S_BAWATCHDOG_EMPTY AFTER(S_BAWATCHDOG_NOTFOUND) + { 5, "bawatchdog_empty", "bawatchdog_empty", + "BA watchdog on all streams but none found" }, +#define S_BAWATCHDOG_FAILED AFTER(S_BAWATCHDOG_EMPTY) + { 5, "bawatchdog_failed", "bawatchdog_failed", + "BA watchdog processing failed to get bitmap from f/w" }, +#define S_RADARDETECT AFTER(S_BAWATCHDOG_FAILED) + { 5, "radardetect", "radardetect", "radar detect interrupts" }, +#define S_RATE AFTER(S_RADARDETECT) + { 4, "rate", "rate", "rate of last transmit" }, +#define S_TX_RSSI AFTER(S_RATE) + { 4, "arssi", "arssi", "rssi of last ack" }, +#define S_RX_RSSI AFTER(S_TX_RSSI) + { 4, "rssi", "rssi", "avg recv rssi" }, +#define S_RX_NOISE AFTER(S_RX_RSSI) + { 5, "noise", "noise", "rx noise floor" }, +#define S_TX_SIGNAL AFTER(S_RX_NOISE) + { 4, "asignal", "asig", "signal of last ack (dBm)" }, +#define S_RX_SIGNAL AFTER(S_TX_SIGNAL) + { 4, "signal", "sig", "avg recv signal (dBm)" }, +#define S_ANT_TX0 AFTER(S_RX_SIGNAL) + { 8, "tx0", "ant0(tx)", "frames tx on antenna 0" }, +#define S_ANT_TX1 (S_RX_SIGNAL+2) + { 8, "tx1", "ant1(tx)", "frames tx on antenna 1" }, +#define S_ANT_TX2 (S_RX_SIGNAL+3) + { 8, "tx2", "ant2(tx)", "frames tx on antenna 2" }, +#define S_ANT_TX3 (S_RX_SIGNAL+4) + { 8, "tx3", "ant3(tx)", "frames tx on antenna 3" }, +#define S_ANT_RX0 AFTER(S_ANT_TX3) + { 8, "rx0", "ant0(rx)", "frames rx on antenna 0" }, +#define S_ANT_RX1 (S_ANT_TX3+2) + { 8, "rx1", "ant1(rx)", "frames rx on antenna 1" }, +#define S_ANT_RX2 (S_ANT_TX3+3) + { 8, "rx2", "ant2(rx)", "frames rx on antenna 2" }, +#define S_ANT_RX3 (S_ANT_TX3+4) + { 8, "rx3", "ant3(rx)", "frames rx on antenna 3" }, +}; +/* NB: this intentionally avoids per-antenna stats */ +#define S_LAST (S_RX_SIGNAL+1) + +struct mwlstatfoo_p { + struct mwlstatfoo base; + int s; + struct ifreq ifr; + struct mwl_stats cur; + struct mwl_stats total; +}; + +static void +mwl_setifname(struct mwlstatfoo *wf0, const char *ifname) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) wf0; + + strncpy(wf->ifr.ifr_name, ifname, sizeof (wf->ifr.ifr_name)); +} + +static void +mwl_collect(struct mwlstatfoo_p *wf, struct mwl_stats *stats) +{ + wf->ifr.ifr_data = (caddr_t) stats; + if (ioctl(wf->s, SIOCGMVSTATS, &wf->ifr) < 0) + err(1, wf->ifr.ifr_name); +} + +static void +mwl_collect_cur(struct statfoo *sf) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; + + mwl_collect(wf, &wf->cur); +} + +static void +mwl_collect_tot(struct statfoo *sf) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; + + mwl_collect(wf, &wf->total); +} + +static void +mwl_update_tot(struct statfoo *sf) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; + + wf->total = wf->cur; +} + +static void +setrate(char b[], size_t bs, uint8_t rate) +{ + if (rate & IEEE80211_RATE_MCS) + snprintf(b, bs, "MCS%u", rate & IEEE80211_RATE_VAL); + else if (rate & 1) + snprintf(b, bs, "%u.5M", rate / 2); + else + snprintf(b, bs, "%uM", rate / 2); +} + +static int +mwl_get_curstat(struct statfoo *sf, int s, char b[], size_t bs) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; +#define STAT(x) \ + snprintf(b, bs, "%u", wf->cur.mst_##x - wf->total.mst_##x); return 1 +#define HWSTAT(x) \ + snprintf(b, bs, "%u", wf->cur.hw_stats.x - wf->total.hw_stats.x); return 1 +#define RXANT(x) \ + snprintf(b, bs, "%u", wf->cur.mst_ant_rx[x] - wf->total.mst_ant_rx[x]); return 1 +#define TXANT(x) \ + snprintf(b, bs, "%u", wf->cur.mst_ant_tx[x] - wf->total.mst_ant_tx[x]); return 1 + + switch (s) { + case S_INPUT: + snprintf(b, bs, "%lu", (u_long)( + (wf->cur.mst_rx_packets - wf->total.mst_rx_packets))); + return 1; + case S_OUTPUT: + snprintf(b, bs, "%lu", (u_long)( + wf->cur.mst_tx_packets - wf->total.mst_tx_packets)); + return 1; + case S_RATE: + setrate(b, bs, wf->cur.mst_tx_rate); + return 1; + case S_TX_RETRY: HWSTAT(TxRetrySuccesses); + case S_TX_MRETRY: HWSTAT(TxMultipleRetrySuccesses); + case S_TX_RTSGOOD: HWSTAT(RTSSuccesses); + case S_TX_RTSBAD: HWSTAT(RTSFailures); + case S_TX_NOACK: HWSTAT(AckFailures); + case S_RX_DUPLICATE: HWSTAT(RxDuplicateFrames); + case S_RX_FCS: HWSTAT(FCSErrorCount); + case S_TX_WATCHDOG: HWSTAT(TxWatchDogTimeouts); + case S_RX_OVERFLOW: HWSTAT(RxOverflows); + case S_RX_FRAGERROR: HWSTAT(RxFragErrors); + case S_RX_MEMERROR: HWSTAT(RxMemErrors); + case S_PTRERROR: HWSTAT(PointerErrors); + case S_TX_UNDERFLOW: HWSTAT(TxUnderflows); + case S_TX_DONE: HWSTAT(TxDone); + case S_TX_DONEBUFPUT: HWSTAT(TxDoneBufPut); + case S_TX_WAIT4BUF: HWSTAT(Wait4TxBuf); + case S_TX_ATTEMPTS: HWSTAT(TxAttempts); + case S_TX_SUCCESS: HWSTAT(TxSuccesses); + case S_TX_FRAGS: HWSTAT(TxFragments); + case S_TX_MCAST: HWSTAT(TxMulticasts); + case S_RX_NONCTL: HWSTAT(RxNonCtlPkts); + case S_RX_MCAST: HWSTAT(RxMulticasts); + case S_RX_UNDECRYPT: HWSTAT(RxUndecryptableFrames); + case S_RX_ICVERROR: HWSTAT(RxICVErrors); + case S_RX_EXCLUDE: HWSTAT(RxExcludedFrames); + case S_TX_MGMT: STAT(tx_mgmt); + case S_TX_DISCARD: STAT(tx_discard); + case S_TX_QSTOP: STAT(tx_qstop); + case S_TX_ENCAP: STAT(tx_encap); + case S_TX_NOMBUF: STAT(tx_nombuf); + case S_TX_LINEAR: STAT(tx_linear); + case S_TX_NODATA: STAT(tx_nodata); + case S_TX_BUSDMA: STAT(tx_busdma); + case S_TX_SHORTPRE: STAT(tx_shortpre); + case S_TX_NOHEADROOM: STAT(tx_noheadroom); + case S_TX_BADFRAMETYPE: STAT(tx_badframetype); + case S_RX_CRYPTO_ERR: STAT(rx_crypto); + case S_RX_TKIPMIC: STAT(rx_tkipmic); + case S_RX_NODMABUF: STAT(rx_nodmabuf); + case S_RX_DMABUFMISSING:STAT(rx_dmabufmissing); + case S_RX_NOMBUF: STAT(rx_nombuf); + case S_RX_BUSDMA: STAT(rx_busdma); + case S_AMPDU_NOSTREAM: STAT(ampdu_nostream); + case S_AMPDU_REJECT: STAT(ampdu_reject); + case S_ADDBA_NOSTREAM: STAT(addba_nostream); + case S_TX_TSO: STAT(tx_tso); + case S_TSO_BADETH: STAT(tso_badeth); + case S_TSO_NOHDR: STAT(tso_nohdr); + case S_TSO_BADSPLIT: STAT(tso_badsplit); + case S_BAWATCHDOG: STAT(bawatchdog); + case S_BAWATCHDOG_NOTFOUND:STAT(bawatchdog_notfound); + case S_BAWATCHDOG_EMPTY: STAT(bawatchdog_empty); + case S_BAWATCHDOG_FAILED:STAT(bawatchdog_failed); + case S_RADARDETECT: STAT(radardetect); + case S_RX_RSSI: + snprintf(b, bs, "%d", wf->cur.mst_rx_rssi); + return 1; + case S_ANT_TX0: TXANT(0); + case S_ANT_TX1: TXANT(1); + case S_ANT_TX2: TXANT(2); + case S_ANT_TX3: TXANT(3); + case S_ANT_RX0: RXANT(0); + case S_ANT_RX1: RXANT(1); + case S_ANT_RX2: RXANT(2); + case S_ANT_RX3: RXANT(3); + case S_RX_NOISE: + snprintf(b, bs, "%d", wf->cur.mst_rx_noise); + return 1; + case S_RX_SIGNAL: + snprintf(b, bs, "%d", + wf->cur.mst_rx_rssi + wf->cur.mst_rx_noise); + return 1; + } + b[0] = '\0'; + return 0; +#undef RXANT +#undef TXANT +#undef HWSTAT +#undef STAT +} + +static int +mwl_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; +#define STAT(x) \ + snprintf(b, bs, "%u", wf->total.mst_##x); return 1 +#define HWSTAT(x) \ + snprintf(b, bs, "%u", wf->total.hw_stats.x); return 1 +#define TXANT(x) \ + snprintf(b, bs, "%u", wf->total.mst_ant_tx[x]); return 1 +#define RXANT(x) \ + snprintf(b, bs, "%u", wf->total.mst_ant_rx[x]); return 1 + + switch (s) { + case S_INPUT: + snprintf(b, bs, "%lu", (u_long)wf->total.mst_rx_packets); + return 1; + case S_OUTPUT: + snprintf(b, bs, "%lu", (u_long) wf->total.mst_tx_packets); + return 1; + case S_RATE: + setrate(b, bs, wf->total.mst_tx_rate); + return 1; + case S_TX_RETRY: HWSTAT(TxRetrySuccesses); + case S_TX_MRETRY: HWSTAT(TxMultipleRetrySuccesses); + case S_TX_RTSGOOD: HWSTAT(RTSSuccesses); + case S_TX_RTSBAD: HWSTAT(RTSFailures); + case S_TX_NOACK: HWSTAT(AckFailures); + case S_RX_DUPLICATE: HWSTAT(RxDuplicateFrames); + case S_RX_FCS: HWSTAT(FCSErrorCount); + case S_TX_WATCHDOG: HWSTAT(TxWatchDogTimeouts); + case S_RX_OVERFLOW: HWSTAT(RxOverflows); + case S_RX_FRAGERROR: HWSTAT(RxFragErrors); + case S_RX_MEMERROR: HWSTAT(RxMemErrors); + case S_PTRERROR: HWSTAT(PointerErrors); + case S_TX_UNDERFLOW: HWSTAT(TxUnderflows); + case S_TX_DONE: HWSTAT(TxDone); + case S_TX_DONEBUFPUT: HWSTAT(TxDoneBufPut); + case S_TX_WAIT4BUF: HWSTAT(Wait4TxBuf); + case S_TX_ATTEMPTS: HWSTAT(TxAttempts); + case S_TX_SUCCESS: HWSTAT(TxSuccesses); + case S_TX_FRAGS: HWSTAT(TxFragments); + case S_TX_MCAST: HWSTAT(TxMulticasts); + case S_RX_NONCTL: HWSTAT(RxNonCtlPkts); + case S_RX_MCAST: HWSTAT(RxMulticasts); + case S_RX_UNDECRYPT: HWSTAT(RxUndecryptableFrames); + case S_RX_ICVERROR: HWSTAT(RxICVErrors); + case S_RX_EXCLUDE: HWSTAT(RxExcludedFrames); + case S_TX_MGMT: STAT(tx_mgmt); + case S_TX_DISCARD: STAT(tx_discard); + case S_TX_QSTOP: STAT(tx_qstop); + case S_TX_ENCAP: STAT(tx_encap); + case S_TX_NOMBUF: STAT(tx_nombuf); + case S_TX_LINEAR: STAT(tx_linear); + case S_TX_NODATA: STAT(tx_nodata); + case S_TX_BUSDMA: STAT(tx_busdma); + case S_TX_SHORTPRE: STAT(tx_shortpre); + case S_TX_NOHEADROOM: STAT(tx_noheadroom); + case S_TX_BADFRAMETYPE: STAT(tx_badframetype); + case S_RX_CRYPTO_ERR: STAT(rx_crypto); + case S_RX_TKIPMIC: STAT(rx_tkipmic); + case S_RX_NODMABUF: STAT(rx_nodmabuf); + case S_RX_DMABUFMISSING:STAT(rx_dmabufmissing); + case S_RX_NOMBUF: STAT(rx_nombuf); + case S_RX_BUSDMA: STAT(rx_busdma); + case S_AMPDU_NOSTREAM: STAT(ampdu_nostream); + case S_AMPDU_REJECT: STAT(ampdu_reject); + case S_ADDBA_NOSTREAM: STAT(addba_nostream); + case S_TX_TSO: STAT(tx_tso); + case S_TSO_BADETH: STAT(tso_badeth); + case S_TSO_NOHDR: STAT(tso_nohdr); + case S_TSO_BADSPLIT: STAT(tso_badsplit); + case S_BAWATCHDOG: STAT(bawatchdog); + case S_BAWATCHDOG_NOTFOUND:STAT(bawatchdog_notfound); + case S_BAWATCHDOG_EMPTY: STAT(bawatchdog_empty); + case S_BAWATCHDOG_FAILED:STAT(bawatchdog_failed); + case S_RADARDETECT: STAT(radardetect); + case S_RX_RSSI: + snprintf(b, bs, "%d", wf->total.mst_rx_rssi); + return 1; + case S_ANT_TX0: TXANT(0); + case S_ANT_TX1: TXANT(1); + case S_ANT_TX2: TXANT(2); + case S_ANT_TX3: TXANT(3); + case S_ANT_RX0: RXANT(0); + case S_ANT_RX1: RXANT(1); + case S_ANT_RX2: RXANT(2); + case S_ANT_RX3: RXANT(3); + case S_RX_NOISE: + snprintf(b, bs, "%d", wf->total.mst_rx_noise); + return 1; + case S_RX_SIGNAL: + snprintf(b, bs, "%d", + wf->total.mst_rx_rssi + wf->total.mst_rx_noise); + return 1; + } + b[0] = '\0'; + return 0; +#undef RXANT +#undef TXANT +#undef HWSTAT +#undef STAT +} + +static void +mwl_print_verbose(struct statfoo *sf, FILE *fd) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; + const struct fmt *f; + char s[32]; + const char *indent; + int i, width; + + width = 0; + for (i = 0; i < S_LAST; i++) { + f = &sf->stats[i]; + if (f->width > width) + width = f->width; + } + for (i = 0; i < S_LAST; i++) { + f = &sf->stats[i]; + if (mwl_get_totstat(sf, i, s, sizeof(s)) && strcmp(s, "0")) { + indent = ""; + fprintf(fd, "%s%-*s %s\n", indent, width, s, f->desc); + } + } + fprintf(fd, "Antenna profile:\n"); + for (i = 0; i < 4; i++) + if (wf->total.mst_ant_rx[i] || wf->total.mst_ant_tx[i]) + fprintf(fd, "[%u] tx %8u rx %8u\n", i, + wf->total.mst_ant_tx[i], + wf->total.mst_ant_rx[i]); +} + +STATFOO_DEFINE_BOUNCE(mwlstatfoo) + +struct mwlstatfoo * +mwlstats_new(const char *ifname, const char *fmtstring) +{ +#define N(a) (sizeof(a) / sizeof(a[0])) + struct mwlstatfoo_p *wf; + + wf = calloc(1, sizeof(struct mwlstatfoo_p)); + if (wf != NULL) { + statfoo_init(&wf->base.base, "mwlstats", mwlstats, N(mwlstats)); + /* override base methods */ + wf->base.base.collect_cur = mwl_collect_cur; + wf->base.base.collect_tot = mwl_collect_tot; + wf->base.base.get_curstat = mwl_get_curstat; + wf->base.base.get_totstat = mwl_get_totstat; + wf->base.base.update_tot = mwl_update_tot; + wf->base.base.print_verbose = mwl_print_verbose; + + /* setup bounce functions for public methods */ + STATFOO_BOUNCE(wf, mwlstatfoo); + + /* setup our public methods */ + wf->base.setifname = mwl_setifname; +#if 0 + wf->base.setstamac = wlan_setstamac; +#endif + wf->s = socket(AF_INET, SOCK_DGRAM, 0); + if (wf->s < 0) + err(1, "socket"); + + mwl_setifname(&wf->base, ifname); + wf->base.setfmt(&wf->base, fmtstring); + } + return &wf->base; +#undef N +} Added: head/tools/tools/mwl/mwlstats/mwlstats.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwlstats/mwlstats.h Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2007 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:38:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B8051065674; Mon, 1 Jun 2009 18:38:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49D5B8FC1A; Mon, 1 Jun 2009 18:38:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51Ica2A087616; Mon, 1 Jun 2009 18:38:36 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51Ica2i087615; Mon, 1 Jun 2009 18:38:36 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906011838.n51Ica2i087615@svn.freebsd.org> From: Robert Watson Date: Mon, 1 Jun 2009 18:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193243 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:38:36 -0000 Author: rwatson Date: Mon Jun 1 18:38:36 2009 New Revision: 193243 URL: http://svn.freebsd.org/changeset/base/193243 Log: Revert a recent netisr2 change: when billing packets to the current CPU, don't lock the workstream, as its mutexes may not have been initialized if there are fewer workstreams than CPUs. Run into by: hps, ps Modified: head/sys/net/netisr.c Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Mon Jun 1 18:27:16 2009 (r193242) +++ head/sys/net/netisr.c Mon Jun 1 18:38:36 2009 (r193243) @@ -893,10 +893,8 @@ netisr_dispatch_src(u_int proto, uintptr if (netisr_direct_force) { nwsp = &nws[curcpu]; npwp = &nwsp->nws_work[proto]; - NWS_LOCK(nwsp); npwp->nw_dispatched++; npwp->nw_handled++; - NWS_UNLOCK(nwsp); np[proto].np_handler(m); error = 0; goto out_unlock; From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:40:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D71FD106566B; Mon, 1 Jun 2009 18:40:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 8DED88FC0A; Mon, 1 Jun 2009 18:40:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 75E6541C7A3; Mon, 1 Jun 2009 20:40:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id 7rmaO37tzEpx; Mon, 1 Jun 2009 20:40:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 149F041C795; Mon, 1 Jun 2009 20:40:06 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 3A50B4448E6; Mon, 1 Jun 2009 18:35:21 +0000 (UTC) Date: Mon, 1 Jun 2009 18:35:21 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Ken Smith In-Reply-To: <1243880140.25229.23.camel@bauer.cse.buffalo.edu> Message-ID: <20090601182802.N12292@maildrop.int.zabbadoz.net> References: <200906011807.n51I7ccW086812@svn.freebsd.org> <1243880140.25229.23.camel@bauer.cse.buffalo.edu> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193241 - in head: . sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:40:08 -0000 On Mon, 1 Jun 2009, Ken Smith wrote: > On Mon, 2009-06-01 at 18:07 +0000, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Mon Jun 1 18:07:38 2009 >> New Revision: 193241 >> URL: http://svn.freebsd.org/changeset/base/193241 >> >> Log: >> Decrement __FreeBSD_version again to 96 as we are runing out of digits >> and want to be conservative - so not more than one version bump per day. >> >> Discussed with: jhb, kensmith > > It was noted we're close to running out of numbers we can use before we > hit code freeze and the branch for the release. Since we're entering > code slush at the end of today in theory all changes that would warrant > a bump in __FreeBSD_version are supposed to be done. But it wouldn't > surprise me if we have one or two or so things that come along between > now and when we hit code freeze and the branch. So we need to be a bit > conservative with this. Please be sure to coordinate anything that > might require a bump in __FreeBSD_version with re@ from now on. If it > turns out things do come along that require bumps we'll need to "batch > them up" having one bump represent several changes. Talking about "padding of structures", as this will be one of those changes most likely, I had suggested previously in private email: Can't we start collecting all those somewhere, perhaps on the wiki, and do one big padding day, one commit for all and everything? This would have several advantages: 1) no ABI breakage in HEAD as v-structs would possibly change in size 2) actual documentation of A|KB|PI relevant structures which would be good to have them written down finally after I heard people talking about this for multiple releases now. 3) a list of things we might need to work on in the future to reduce the problem and also a list for the time 9.x would come;-) just my 0.01$ /bz -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:42:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 931A01065676; Mon, 1 Jun 2009 18:42:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FE068FC13; Mon, 1 Jun 2009 18:42:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51IgHfp087724; Mon, 1 Jun 2009 18:42:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51IgHpW087717; Mon, 1 Jun 2009 18:42:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200906011842.n51IgHpW087717@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jun 2009 18:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193244 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:42:18 -0000 Author: delphij Date: Mon Jun 1 18:42:16 2009 New Revision: 193244 URL: http://svn.freebsd.org/changeset/base/193244 Log: Code cleanups to make this WARNS=6 clean. PR: bin/96128 Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c head/sys/dev/aic7xxx/aicasm/aicasm_gram.y head/sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l head/sys/dev/aic7xxx/aicasm/aicasm_scan.l head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c head/sys/dev/aic7xxx/aicasm/aicasm_symbol.h Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm.c Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm.c Mon Jun 1 18:42:16 2009 (r193244) @@ -79,8 +79,8 @@ static void output_code(void); static void output_listing(char *ifilename); static void dump_scope(scope_t *scope); static void emit_patch(scope_t *scope, int patch); -static int check_patch(patch_t **start_patch, int start_instr, - int *skip_addr, int *func_vals); +static int check_patch(patch_t **start_patch, unsigned int start_instr, + unsigned int *skip_addr, int *func_vals); struct path_list search_path; int includes_search_curdir; @@ -116,8 +116,6 @@ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { - extern char *optarg; - extern int optind; int ch; int retval; char *inputfilename; @@ -530,7 +528,7 @@ output_listing(char *ifilename) int *func_values; int instrcount; int instrptr; - int line; + unsigned int line; int func_count; int skip_addr; @@ -649,8 +647,8 @@ output_listing(char *ifilename) } static int -check_patch(patch_t **start_patch, int start_instr, - int *skip_addr, int *func_vals) +check_patch(patch_t **start_patch, unsigned int start_instr, + unsigned int *skip_addr, int *func_vals) { patch_t *cur_patch; Modified: head/sys/dev/aic7xxx/aicasm/aicasm_gram.y ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_gram.y Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_gram.y Mon Jun 1 18:42:16 2009 (r193244) @@ -88,7 +88,7 @@ static int in_critical_section; static u_int enum_increment; static u_int enum_next_value; -static void process_field(int field_type, symbol_t *sym, int mask); +static void process_field(unsigned int field_type, symbol_t *sym, int mask); static void initialize_symbol(symbol_t *symbol); static void add_macro_arg(const char *argtext, int position); static void add_macro_body(const char *bodytext); @@ -107,6 +107,9 @@ static void add_conditional(symbol_t *sy static void add_version(const char *verstring); static int is_download_const(expression_t *immed); +extern int yylex (void); +extern int yyparse (void); + #define SRAM_SYMNAME "SRAM_BASE" #define SCB_SYMNAME "SCB_BASE" %} @@ -867,7 +870,7 @@ reg_symbol: stop("register offset must be a constant", EX_DATAERR); /* NOTREACHED */ } - if (($3->info.cinfo->value + 1) > $1->info.rinfo->size) { + if (($3->info.cinfo->value + 1) > (unsigned)$1->info.rinfo->size) { stop("Accessing offset beyond range of register", EX_DATAERR); /* NOTREACHED */ @@ -878,7 +881,7 @@ reg_symbol: | T_SYMBOL '[' T_NUMBER ']' { process_register(&$1); - if (($3 + 1) > $1->info.rinfo->size) { + if (($3 + 1) > (unsigned)$1->info.rinfo->size) { stop("Accessing offset beyond range of register", EX_DATAERR); /* NOTREACHED */ @@ -1379,7 +1382,7 @@ code: %% static void -process_field(int field_type, symbol_t *sym, int value) +process_field(unsigned int field_type, symbol_t *sym, int value) { /* * Add the current register to its @@ -1531,10 +1534,9 @@ initialize_symbol(symbol_t *symbol) } static void -add_macro_arg(const char *argtext, int argnum) +add_macro_arg(const char *argtext, int argnum __unused) { struct macro_arg *marg; - int i; int retval; @@ -1553,7 +1555,7 @@ add_macro_arg(const char *argtext, int a retval = snprintf(regex_pattern, sizeof(regex_pattern), "[^-/A-Za-z0-9_](%s)([^-/A-Za-z0-9_]|$)", argtext); - if (retval >= sizeof(regex_pattern)) { + if (retval >= (int)sizeof(regex_pattern)) { stop("Regex text buffer too small for arg", EX_SOFTWARE); /* NOTREACHED */ @@ -1911,24 +1913,24 @@ add_conditional(symbol_t *symbol) static void add_version(const char *verstring) { - const char prefix[] = " * "; + const char verprefix[] = " * "; int newlen; int oldlen; - newlen = strlen(verstring) + strlen(prefix); + newlen = strlen(verstring) + strlen(verprefix); oldlen = 0; if (versions != NULL) oldlen = strlen(versions); versions = realloc(versions, newlen + oldlen + 2); if (versions == NULL) stop("Can't allocate version string", EX_SOFTWARE); - strcpy(&versions[oldlen], prefix); - strcpy(&versions[oldlen + strlen(prefix)], verstring); + strcpy(&versions[oldlen], verprefix); + strcpy(&versions[oldlen + strlen(verprefix)], verstring); versions[newlen + oldlen] = '\n'; versions[newlen + oldlen + 1] = '\0'; } -void +static void yyerror(const char *string) { stop(string, EX_DATAERR); Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y Mon Jun 1 18:42:16 2009 (r193244) @@ -66,6 +66,9 @@ static symbol_t *macro_symbol; static void add_macro_arg(const char *argtext, int position); +extern int mmlex(void); +extern int mmparse(void); + %} %union { @@ -157,7 +160,7 @@ add_macro_arg(const char *argtext, int a } } -void +static void mmerror(const char *string) { stop(string, EX_DATAERR); Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Mon Jun 1 18:42:16 2009 (r193244) @@ -65,7 +65,9 @@ static char string_buf[MAX_STR_CONST]; static char *string_buf_ptr; static int parren_count; -static char buf[255]; +static char msgbuf[255]; + +extern int mmlex(void); %} WORD [A-Za-z_][-A-Za-z_0-9]* @@ -143,9 +145,9 @@ MCARG [^(), \t]+ return T_SYMBOL; } . { - snprintf(buf, sizeof(buf), "Invalid character " + snprintf(msgbuf, sizeof(msgbuf), "Invalid character " "'%c'", mmtext[0]); - stop(buf, EX_DATAERR); + stop(msgbuf, EX_DATAERR); } %% @@ -153,4 +155,5 @@ int mmwrap() { stop("EOF encountered in macro call", EX_DATAERR); + return (1); } Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Mon Jun 1 18:42:16 2009 (r193244) @@ -67,7 +67,13 @@ static char string_buf[MAX_STR_CONST]; static char *string_buf_ptr; static int parren_count; static int quote_count; -static char buf[255]; +static char msgbuf[255]; + +extern int yylex(void); +extern int mmlex(void); +extern int mmparse(void); +extern void mm_switch_to_buffer(YY_BUFFER_STATE); +extern void mm_delete_buffer(YY_BUFFER_STATE); %} PATH ([/]*[-A-Za-z0-9_.])+ @@ -315,10 +321,10 @@ else { return T_ELSE; } return ')'; } . { - snprintf(buf, sizeof(buf), "Invalid character " + snprintf(msgbuf, sizeof(msgbuf), "Invalid character " "'%c' in macro argument list", yytext[0]); - stop(buf, EX_DATAERR); + stop(msgbuf, EX_DATAERR); } {SPACE} ; \( { @@ -375,7 +381,7 @@ else { return T_ELSE; } char c; yptr = yytext; - while (c = *yptr++) { + while ((c = *yptr++)) { /* * Strip carriage returns. */ @@ -430,9 +436,9 @@ else { return T_ELSE; } } } . { - snprintf(buf, sizeof(buf), "Invalid character " + snprintf(msgbuf, sizeof(msgbuf), "Invalid character " "'%c'", yytext[0]); - stop(buf, EX_DATAERR); + stop(msgbuf, EX_DATAERR); } %% Modified: head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c Mon Jun 1 18:42:16 2009 (r193244) @@ -49,6 +49,7 @@ #else #include #endif +#include #include #include #include @@ -62,8 +63,8 @@ static DB *symtable; -symbol_t * -symbol_create(char *name) +static symbol_t * +symbol_create(const char *name) { symbol_t *new_symbol; @@ -163,14 +164,14 @@ symtable_close() * if a lookup fails. */ symbol_t * -symtable_get(char *name) +symtable_get(const char *name) { symbol_t *stored_ptr; DBT key; DBT data; int retval; - key.data = (void *)name; + key.data = strdup(name); key.size = strlen(name); if ((retval = symtable->get(symtable, &key, &data, /*flags*/0)) != 0) { @@ -190,6 +191,7 @@ symtable_get(char *name) perror("Symtable put failed"); exit(EX_SOFTWARE); } + free(key.data); return (new_symbol); } else { perror("Unexpected return value from db get routine"); @@ -198,6 +200,7 @@ symtable_get(char *name) } } memcpy(&stored_ptr, data.data, sizeof(stored_ptr)); + free(key.data); return (stored_ptr); } @@ -321,7 +324,7 @@ symlist_merge(symlist_t *symlist_dest, s SLIST_INIT(symlist_src2); } -void +static void aic_print_file_prologue(FILE *ofile) { @@ -337,16 +340,16 @@ aic_print_file_prologue(FILE *ofile) versions); } -void -aic_print_include(FILE *dfile, char *include_file) +static void +aic_print_include(FILE *dfile, char *header_file) { if (dfile == NULL) return; - fprintf(dfile, "\n#include \"%s\"\n\n", include_file); + fprintf(dfile, "\n#include \"%s\"\n\n", header_file); } -void +static void aic_print_reg_dump_types(FILE *ofile) { if (ofile == NULL) @@ -586,10 +589,9 @@ symtable_dump(FILE *ofile, FILE *dfile) /* Output generated #defines. */ while (SLIST_FIRST(®isters) != NULL) { - symbol_node_t *curnode; u_int value; - char *tab_str; - char *tab_str2; + const char *tab_str; + const char *tab_str2; curnode = SLIST_FIRST(®isters); SLIST_REMOVE_HEAD(®isters, links); @@ -636,7 +638,6 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "\n\n"); while (SLIST_FIRST(&constants) != NULL) { - symbol_node_t *curnode; curnode = SLIST_FIRST(&constants); SLIST_REMOVE_HEAD(&constants, links); @@ -650,7 +651,6 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "\n\n/* Downloaded Constant Definitions */\n"); for (i = 0; SLIST_FIRST(&download_constants) != NULL; i++) { - symbol_node_t *curnode; curnode = SLIST_FIRST(&download_constants); SLIST_REMOVE_HEAD(&download_constants, links); @@ -664,7 +664,6 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "\n\n/* Exported Labels */\n"); while (SLIST_FIRST(&exported_labels) != NULL) { - symbol_node_t *curnode; curnode = SLIST_FIRST(&exported_labels); SLIST_REMOVE_HEAD(&exported_labels, links); Modified: head/sys/dev/aic7xxx/aicasm/aicasm_symbol.h ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_symbol.h Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_symbol.h Mon Jun 1 18:42:16 2009 (r193244) @@ -190,7 +190,7 @@ void symtable_open(void); void symtable_close(void); symbol_t * - symtable_get(char *name); + symtable_get(const char *name); symbol_node_t * symlist_search(symlist_t *symlist, char *symname); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:43:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1B8B1065673; Mon, 1 Jun 2009 18:43:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFFBC8FC0C; Mon, 1 Jun 2009 18:43:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51IhXpd087782; Mon, 1 Jun 2009 18:43:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51IhXt4087781; Mon, 1 Jun 2009 18:43:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200906011843.n51IhXt4087781@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jun 2009 18:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:43:34 -0000 Author: delphij Date: Mon Jun 1 18:43:33 2009 New Revision: 193245 URL: http://svn.freebsd.org/changeset/base/193245 Log: Mark as WARNS=6. Modified: head/sys/dev/aic7xxx/aicasm/Makefile Modified: head/sys/dev/aic7xxx/aicasm/Makefile ============================================================================== --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} DPADD= ${LIBL} LDADD= -ll +WARNS?= 6 # Correct path for kernel builds # Don't rely on the kernel's .depend file From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:48:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 279EE1065674 for ; Mon, 1 Jun 2009 18:48:43 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id A9FDE8FC1C for ; Mon, 1 Jun 2009 18:48:42 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 4809 invoked by uid 399); 1 Jun 2009 18:48:36 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 1 Jun 2009 18:48:36 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4A242282.4030404@FreeBSD.org> Date: Mon, 01 Jun 2009 11:48:34 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.21 (X11/20090423) MIME-Version: 1.0 To: Xin LI References: <200906011843.n51IhXt4087781@svn.freebsd.org> In-Reply-To: <200906011843.n51IhXt4087781@svn.freebsd.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:48:43 -0000 Xin LI wrote: > Author: delphij > Date: Mon Jun 1 18:43:33 2009 > New Revision: 193245 > URL: http://svn.freebsd.org/changeset/base/193245 > > Log: > Mark as WARNS=6. > > Modified: > head/sys/dev/aic7xxx/aicasm/Makefile > > Modified: head/sys/dev/aic7xxx/aicasm/Makefile > ============================================================================== > --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) > +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) > @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR > CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} > DPADD= ${LIBL} > LDADD= -ll > +WARNS?= 6 > > # Correct path for kernel builds > # Don't rely on the kernel's .depend file > Is there more coming? cc -O2 -pipe -ggdb -nostdinc -I/usr/include -I. -I/usr/local/src/sys/dev/aic7xxx/aicasm -ggdb -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c aicasm_scan.c cc1: warnings being treated as errors /usr/local/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l: In function 'expand_macro': /usr/local/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:528: warning: 'match.rm_eo' may be used uninitialized in this function /usr/local/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:528: warning: 'match.rm_so' may be used uninitialized in this function *** Error code 1 Stop in /usr/local/obj/usr/local/src/sys/LAP. *** Error code 1 -- This .signature sanitized for your protection From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:58:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57A301065673; Mon, 1 Jun 2009 18:58:47 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44D648FC0C; Mon, 1 Jun 2009 18:58:47 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51Iwl87088147; Mon, 1 Jun 2009 18:58:47 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51Iwlvr088146; Mon, 1 Jun 2009 18:58:47 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <200906011858.n51Iwlvr088146@svn.freebsd.org> From: Joel Dahl Date: Mon, 1 Jun 2009 18:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193246 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:58:48 -0000 Author: joel (doc committer) Date: Mon Jun 1 18:58:46 2009 New Revision: 193246 URL: http://svn.freebsd.org/changeset/base/193246 Log: - Remove obsolete and confusing comment about renaming "sound" to "snd". We will look at renaming stuff for 9.0, but it's far from certain that we will do it this way. - Sort sysctl's alphabetically. I'll add a bunch of new sysctl's once ariff's next mega-patch goes in, and having everything sorted makes my job easier. Modified: head/share/man/man4/pcm.4 Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Mon Jun 1 18:43:33 2009 (r193245) +++ head/share/man/man4/pcm.4 Mon Jun 1 18:58:46 2009 (r193246) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2007 +.Dd June 1, 2009 .Dt SOUND 4 .Os .Sh NAME @@ -51,16 +51,6 @@ hint.pcm.0.drq="1" hint.pcm.0.flags="0x0" .Ed .Sh DESCRIPTION -.Bf -emphasis -Note: There exists some ambiguity in the naming at the moment -.Pq Nm sound , pcm , snd . -It will be resolved soon by renaming -.Cd "device sound" -to -.Cd "device snd" , -and doing associated changes. -.Ef -.Pp The .Nm driver provides support for @@ -170,14 +160,34 @@ tunables are global settings and .Va dev.pcm.* are device specific. .Bl -tag -width ".Va hw.snd.report_soft_formats" -offset indent -.It Va hw.snd.latency_profile -Define sets of buffering latency conversion tables for the -.Va hw.snd.latency -tunable. -A value of 0 will use a low and aggressive latency profile which can result -in possible underruns if the application cannot keep up with a rapid irq -rate, especially during high workload. -The default value is 1, which is considered a moderate/safe latency profile. +.It Va hw.snd.compat_linux_mmap +Enable to allow PROT_EXEC page mappings. +All Linux applications using sound and +.Xr mmap 2 +require this. +.It Va hw.snd.default_auto +Enable to automatically assign default sound unit to the most recent +attached device. +.It Va hw.snd.default_unit +Default sound card for systems with multiple sound cards. +When using +.Xr devfs 5 , +the default device for +.Pa /dev/dsp . +Equivalent to a symlink from +.Pa /dev/dsp +to +.Pa /dev/dsp Ns Va ${hw.snd.default_unit} . +.It Va hw.snd.feeder_rate_max +Maximum allowable sample rate. +.It Va hw.snd.feeder_rate_min +Minimum allowable sample rate. +.It Va hw.snd.feeder_rate_round +Sample rate rounding threshold, to avoid large prime division at the +cost of accuracy. +All requested sample rates will be rounded to the nearest threshold value. +Possible values range between 0 (disabled) and 500. +Default is 25. .It Va hw.snd.latency Configure the buffering latency. Only affects applications that do not explicitly request @@ -186,26 +196,31 @@ This tunable provides finer granularity .Va hw.snd.latency_profile tunable. Possible values range between 0 (lowest latency) and 10 (highest latency). +.It Va hw.snd.latency_profile +Define sets of buffering latency conversion tables for the +.Va hw.snd.latency +tunable. +A value of 0 will use a low and aggressive latency profile which can result +in possible underruns if the application cannot keep up with a rapid irq +rate, especially during high workload. +The default value is 1, which is considered a moderate/safe latency profile. +.It Va hw.snd.maxautovchans +Global +.Tn VCHAN +setting that only affects devices with at least one playback or recording channel available. +The sound system will dynamically create up this many +.Tn VCHANs . +Set to +.Dq 0 +if no +.Tn VCHANS +are desired. +Maximum value is 256. .It Va hw.snd.report_soft_formats Controls the internal format conversion if it is available transparently to the application software. When disabled or not available, the application will only be able to select formats the device natively supports. -.It Va hw.snd.compat_linux_mmap -Enable to allow PROT_EXEC page mappings. -All Linux applications using sound and -.Xr mmap 2 -require this. -.It Va hw.snd.feeder_rate_round -Sample rate rounding threshold, to avoid large prime division at the -cost of accuracy. -All requested sample rates will be rounded to the nearest threshold value. -Possible values range between 0 (disabled) and 500. -Default is 25. -.It Va hw.snd.feeder_rate_max -Maximum allowable sample rate. -.It Va hw.snd.feeder_rate_min -Minimum allowable sample rate. .It Va hw.snd.verbose Level of verbosity for the .Pa /dev/sndstat @@ -228,31 +243,6 @@ File names and versions of the currently .It 4 Various messages intended for debugging. .El -.It Va hw.snd.maxautovchans -Global -.Tn VCHAN -setting that only affects devices with at least one playback or recording channel available. -The sound system will dynamically create up this many -.Tn VCHANs . -Set to -.Dq 0 -if no -.Tn VCHANS -are desired. -Maximum value is 256. -.It Va hw.snd.default_unit -Default sound card for systems with multiple sound cards. -When using -.Xr devfs 5 , -the default device for -.Pa /dev/dsp . -Equivalent to a symlink from -.Pa /dev/dsp -to -.Pa /dev/dsp Ns Va ${hw.snd.default_unit} . -.It Va hw.snd.default_auto -Enable to automatically assign default sound unit to the most recent -attached device. .It Va dev.pcm.%d.[play|rec].vchans The current number of .Tn VCHANs @@ -264,18 +254,18 @@ Setting this value to will disable .Tn VCHANs for this device. -.It Va dev.pcm.%d.[play|rec].vchanrate -Sample rate speed for -.Tn VCHAN -mixing. -All playback paths will be converted to this sample rate before the mixing -process begins. .It Va dev.pcm.%d.[play|rec].vchanformat Format for .Tn VCHAN mixing. All playback paths will be converted to this format before the mixing process begins. +.It Va dev.pcm.%d.[play|rec].vchanrate +Sample rate speed for +.Tn VCHAN +mixing. +All playback paths will be converted to this sample rate before the mixing +process begins. .It Va dev.pcm.%d.polling Experimental polling mode support where the driver operates by querying the device state on each tick using a From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 19:04:02 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A28B71065670 for ; Mon, 1 Jun 2009 19:04:02 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 5D61A8FC1A for ; Mon, 1 Jun 2009 19:04:02 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 18D7D9CB171; Mon, 1 Jun 2009 20:55:44 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AgnzftpjFvVm; Mon, 1 Jun 2009 20:55:32 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 503C19CB19F; Mon, 1 Jun 2009 20:55:32 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n51ItWT4025023; Mon, 1 Jun 2009 20:55:32 +0200 (CEST) (envelope-from rdivacky) Date: Mon, 1 Jun 2009 20:55:32 +0200 From: Roman Divacky To: src-committers@FreeBSD.org Message-ID: <20090601185532.GA24838@freebsd.org> References: <200906011843.n51IhXt4087781@svn.freebsd.org> <4A242282.4030404@FreeBSD.org> <20090601184937.GA24177@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090601184937.GA24177@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 19:04:02 -0000 On Mon, Jun 01, 2009 at 08:49:37PM +0200, Roman Divacky wrote: > On Mon, Jun 01, 2009 at 11:48:34AM -0700, Doug Barton wrote: > > Xin LI wrote: > > > Author: delphij > > > Date: Mon Jun 1 18:43:33 2009 > > > New Revision: 193245 > > > URL: http://svn.freebsd.org/changeset/base/193245 > > > > > > Log: > > > Mark as WARNS=6. > > > > > > Modified: > > > head/sys/dev/aic7xxx/aicasm/Makefile > > > > > > Modified: head/sys/dev/aic7xxx/aicasm/Makefile > > > ============================================================================== > > > --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) > > > +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) > > > @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR > > > CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} > > > DPADD= ${LIBL} > > > LDADD= -ll > > > +WARNS?= 6 > > > > > > # Correct path for kernel builds > > > # Don't rely on the kernel's .depend file > > > > > > > Is there more coming? > > > > cc -O2 -pipe -ggdb -nostdinc -I/usr/include -I. > > -I/usr/local/src/sys/dev/aic7xxx/aicasm -ggdb -std=gnu99 > ^^^^^^^^^^ > > how did you get this? this should be used for userland compilation, > kernel is done with -std=c99, can you show me how you got this? ok.. when you cd /usr/src make you build the kernel with -std=gnu99 instead of -std=c99. which is a bug. I am trying to fix this. if anyone has any idea please mail me.. roman From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 19:06:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AD40106566C; Mon, 1 Jun 2009 19:06:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1916F8FC14; Mon, 1 Jun 2009 19:06:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51J68K5088368; Mon, 1 Jun 2009 19:06:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51J68CY088367; Mon, 1 Jun 2009 19:06:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200906011906.n51J68CY088367@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jun 2009 19:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193247 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 19:06:09 -0000 Author: delphij Date: Mon Jun 1 19:06:08 2009 New Revision: 193247 URL: http://svn.freebsd.org/changeset/base/193247 Log: Revert the WARNS change for now, need some time to fix the real problem. Modified: head/sys/dev/aic7xxx/aicasm/Makefile Modified: head/sys/dev/aic7xxx/aicasm/Makefile ============================================================================== --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:58:46 2009 (r193246) +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 19:06:08 2009 (r193247) @@ -15,7 +15,6 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} DPADD= ${LIBL} LDADD= -ll -WARNS?= 6 # Correct path for kernel builds # Don't rely on the kernel's .depend file From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 19:09:02 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EEDF106566C; Mon, 1 Jun 2009 19:09:02 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 541918FC12; Mon, 1 Jun 2009 19:09:02 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 6F5E89CB0B7; Mon, 1 Jun 2009 20:49:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jIkap9Aohxiy; Mon, 1 Jun 2009 20:49:38 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id E9A159CB171; Mon, 1 Jun 2009 20:49:37 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n51InbcM024319; Mon, 1 Jun 2009 20:49:37 +0200 (CEST) (envelope-from rdivacky) Date: Mon, 1 Jun 2009 20:49:37 +0200 From: Roman Divacky To: Doug Barton Message-ID: <20090601184937.GA24177@freebsd.org> References: <200906011843.n51IhXt4087781@svn.freebsd.org> <4A242282.4030404@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: <4A242282.4030404@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI Subject: Re: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 19:09:02 -0000 --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 01, 2009 at 11:48:34AM -0700, Doug Barton wrote: > Xin LI wrote: > > Author: delphij > > Date: Mon Jun 1 18:43:33 2009 > > New Revision: 193245 > > URL: http://svn.freebsd.org/changeset/base/193245 > >=20 > > Log: > > Mark as WARNS=3D6. > >=20 > > Modified: > > head/sys/dev/aic7xxx/aicasm/Makefile > >=20 > > Modified: head/sys/dev/aic7xxx/aicasm/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193= 244) > > +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193= 245) > > @@ -15,6 +15,7 @@ SRCS=3D ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR > > CLEANFILES+=3D ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} > > DPADD=3D ${LIBL} > > LDADD=3D -ll > > +WARNS?=3D 6 > > =20 > > # Correct path for kernel builds > > # Don't rely on the kernel's .depend file > >=20 >=20 > Is there more coming? >=20 > cc -O2 -pipe -ggdb -nostdinc -I/usr/include -I. > -I/usr/local/src/sys/dev/aic7xxx/aicasm -ggdb -std=3Dgnu99 ^^^^^^^^^^ how did you get this? this should be used for userland compilation, kernel is done with -std=3Dc99, can you show me how you got this? thnx roman --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkokIsEACgkQLVEj6D3CBEy7AwCeJjVdtMz+jyNu9a1+xw7OMR8L z/kAn1TLE6JopI9FoSNjhxOl7OMZQlls =emLt -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 19:10:56 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C64561065686; Mon, 1 Jun 2009 19:10:56 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5206B8FC0C; Mon, 1 Jun 2009 19:10:56 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 7317B5C070; Tue, 2 Jun 2009 03:10:55 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 43D7355CDB2F; Tue, 2 Jun 2009 03:10:55 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id lt8aVl9FefdA; Tue, 2 Jun 2009 03:10:04 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id BC97555CDB46; Tue, 2 Jun 2009 03:09:56 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=a9xQjWo70JQyM11jbrNjmJF4V1NisONh4uCQ1fmHlD1VspGWozUrAPJjMojI2SO0L gVWVgIw0xcMJleUWidMjQ== Message-ID: <4A242771.3090605@delphij.net> Date: Mon, 01 Jun 2009 12:09:37 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.21 (X11/20090408) MIME-Version: 1.0 To: Roman Divacky References: <200906011843.n51IhXt4087781@svn.freebsd.org> <4A242282.4030404@FreeBSD.org> <20090601184937.GA24177@freebsd.org> <20090601185532.GA24838@freebsd.org> In-Reply-To: <20090601185532.GA24838@freebsd.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 19:10:57 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roman Divacky wrote: > On Mon, Jun 01, 2009 at 08:49:37PM +0200, Roman Divacky wrote: >> On Mon, Jun 01, 2009 at 11:48:34AM -0700, Doug Barton wrote: >>> Xin LI wrote: >>>> Author: delphij >>>> Date: Mon Jun 1 18:43:33 2009 >>>> New Revision: 193245 >>>> URL: http://svn.freebsd.org/changeset/base/193245 >>>> >>>> Log: >>>> Mark as WARNS=6. >>>> >>>> Modified: >>>> head/sys/dev/aic7xxx/aicasm/Makefile >>>> >>>> Modified: head/sys/dev/aic7xxx/aicasm/Makefile >>>> ============================================================================== >>>> --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) >>>> +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) >>>> @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR >>>> CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} >>>> DPADD= ${LIBL} >>>> LDADD= -ll >>>> +WARNS?= 6 >>>> >>>> # Correct path for kernel builds >>>> # Don't rely on the kernel's .depend file >>>> >>> Is there more coming? >>> >>> cc -O2 -pipe -ggdb -nostdinc -I/usr/include -I. >>> -I/usr/local/src/sys/dev/aic7xxx/aicasm -ggdb -std=gnu99 >> ^^^^^^^^^^ >> >> how did you get this? this should be used for userland compilation, >> kernel is done with -std=c99, can you show me how you got this? > > ok.. when you > > cd /usr/src > make > > you build the kernel with -std=gnu99 instead of -std=c99. which is a bug. I am > trying to fix this. if anyone has any idea please mail me.. This is strange... Let me take a look at this, I have reverted the WARNS?=6 change for now. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkokJ3EACgkQi+vbBBjt66AnHACfXXyxcoKUsfCORzcOv4Nz8X3D IJoAn2dXFSLAq/HzO+S0XXuFbFFTJuhJ =3Uqo -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 19:16:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C5C1106566C; Mon, 1 Jun 2009 19:16:58 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A39D58FC15; Mon, 1 Jun 2009 19:16:57 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51JGvdl088716; Mon, 1 Jun 2009 19:16:57 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51JGvB3088714; Mon, 1 Jun 2009 19:16:57 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200906011916.n51JGvB3088714@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 1 Jun 2009 19:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193250 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 19:16:59 -0000 Author: gallatin Date: Mon Jun 1 19:16:57 2009 New Revision: 193250 URL: http://svn.freebsd.org/changeset/base/193250 Log: Set an rx jumbo cluster to the correct size before using bus_dmamap_load_mbuf_sg() on it. This prevents data corruption when the mxge MTU is between 4076 and 8172 on machines with 4KB pages and MXGE_VIRT_JUMBOS is in use (which it isn't, in -current or -stable) Modified: head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Jun 1 19:16:31 2009 (r193249) +++ head/sys/dev/mxge/if_mxge.c Mon Jun 1 19:16:57 2009 (r193250) @@ -2351,7 +2351,7 @@ mxge_get_buf_big(struct mxge_slice_state err = ENOBUFS; goto done; } - m->m_len = rx->cl_size; + m->m_len = rx->mlen; err = bus_dmamap_load_mbuf_sg(rx->dmat, map, m, seg, &cnt, BUS_DMA_NOWAIT); if (err != 0) { @@ -3432,6 +3432,8 @@ mxge_slice_open(struct mxge_slice_state } ss->rx_big.nbufs = nbufs; ss->rx_big.cl_size = cl_size; + ss->rx_big.mlen = ss->sc->ifp->if_mtu + ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + MXGEFW_PAD; for (i = 0; i <= ss->rx_big.mask; i += ss->rx_big.nbufs) { map = ss->rx_big.info[i].map; err = mxge_get_buf_big(ss, map, i); Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Mon Jun 1 19:16:31 2009 (r193249) +++ head/sys/dev/mxge/if_mxge_var.h Mon Jun 1 19:16:57 2009 (r193250) @@ -120,6 +120,7 @@ typedef struct int cl_size; int alloc_fail; int mask; /* number of rx slots -1 */ + int mlen; } mxge_rx_ring_t; typedef struct From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:17:21 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AA701065677; Mon, 1 Jun 2009 20:17:21 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 01A788FC1D; Mon, 1 Jun 2009 20:17:20 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 033DD9CB04A; Mon, 1 Jun 2009 22:16:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gr6cLPLJhU86; Mon, 1 Jun 2009 22:16:21 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id CB27B9CB171; Mon, 1 Jun 2009 22:16:21 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n51KGLfI035461; Mon, 1 Jun 2009 22:16:21 +0200 (CEST) (envelope-from rdivacky) Date: Mon, 1 Jun 2009 22:16:21 +0200 From: Roman Divacky To: d@delphij.net Message-ID: <20090601201621.GA35383@freebsd.org> References: <200906011843.n51IhXt4087781@svn.freebsd.org> <4A242282.4030404@FreeBSD.org> <20090601184937.GA24177@freebsd.org> <20090601185532.GA24838@freebsd.org> <4A242771.3090605@delphij.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A242771.3090605@delphij.net> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:17:21 -0000 On Mon, Jun 01, 2009 at 12:09:37PM -0700, Xin LI wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Roman Divacky wrote: > > On Mon, Jun 01, 2009 at 08:49:37PM +0200, Roman Divacky wrote: > >> On Mon, Jun 01, 2009 at 11:48:34AM -0700, Doug Barton wrote: > >>> Xin LI wrote: > >>>> Author: delphij > >>>> Date: Mon Jun 1 18:43:33 2009 > >>>> New Revision: 193245 > >>>> URL: http://svn.freebsd.org/changeset/base/193245 > >>>> > >>>> Log: > >>>> Mark as WARNS=6. > >>>> > >>>> Modified: > >>>> head/sys/dev/aic7xxx/aicasm/Makefile > >>>> > >>>> Modified: head/sys/dev/aic7xxx/aicasm/Makefile > >>>> ============================================================================== > >>>> --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) > >>>> +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) > >>>> @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR > >>>> CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} > >>>> DPADD= ${LIBL} > >>>> LDADD= -ll > >>>> +WARNS?= 6 > >>>> > >>>> # Correct path for kernel builds > >>>> # Don't rely on the kernel's .depend file > >>>> > >>> Is there more coming? > >>> > >>> cc -O2 -pipe -ggdb -nostdinc -I/usr/include -I. > >>> -I/usr/local/src/sys/dev/aic7xxx/aicasm -ggdb -std=gnu99 > >> ^^^^^^^^^^ > >> > >> how did you get this? this should be used for userland compilation, > >> kernel is done with -std=c99, can you show me how you got this? > > > > ok.. when you > > > > cd /usr/src > > make > > > > you build the kernel with -std=gnu99 instead of -std=c99. which is a bug. I am > > trying to fix this. if anyone has any idea please mail me.. > > This is strange... Let me take a look at this, I have reverted the > WARNS?=6 change for now. oh.. sorry. this has nothing to do with this commit. I just noticed it in doug's reply.. From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:26:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 590C01065679; Mon, 1 Jun 2009 20:26:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5CC8FC20; Mon, 1 Jun 2009 20:26:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51KQpdX090581; Mon, 1 Jun 2009 20:26:51 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51KQp6x090577; Mon, 1 Jun 2009 20:26:51 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906012026.n51KQp6x090577@svn.freebsd.org> From: Robert Watson Date: Mon, 1 Jun 2009 20:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193255 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:26:52 -0000 Author: rwatson Date: Mon Jun 1 20:26:51 2009 New Revision: 193255 URL: http://svn.freebsd.org/changeset/base/193255 Log: Add a flags field to struct ucred, and export that via kinfo_proc, consuming one of its spare fields. The cr_flags field is currently unused, but will be used for features, including capability mode and pay-as-you-go audit. Discussed with: jhb, sson Modified: head/sys/kern/kern_proc.c head/sys/sys/ucred.h head/sys/sys/user.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Jun 1 20:21:13 2009 (r193254) +++ head/sys/kern/kern_proc.c Mon Jun 1 20:26:51 2009 (r193255) @@ -736,6 +736,7 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_ngroups * sizeof(gid_t)); kp->ki_rgid = cred->cr_rgid; kp->ki_svgid = cred->cr_svgid; + kp->ki_cr_flags = cred->cr_flags; /* If jailed(cred), emulate the old P_JAILED flag. */ if (jailed(cred)) { kp->ki_flag |= P_JAILED; Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Mon Jun 1 20:21:13 2009 (r193254) +++ head/sys/sys/ucred.h Mon Jun 1 20:26:51 2009 (r193255) @@ -56,6 +56,7 @@ struct ucred { struct uidinfo *cr_ruidinfo; /* per ruid resource consumption */ struct prison *cr_prison; /* jail(2) */ struct vimage *cr_vimage; /* vimage */ + u_int cr_flags; /* credential flags */ void *cr_pspare[2]; /* general use 2 */ #define cr_endcopy cr_label struct label *cr_label; /* MAC label */ Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Mon Jun 1 20:21:13 2009 (r193254) +++ head/sys/sys/user.h Mon Jun 1 20:26:51 2009 (r193255) @@ -83,7 +83,7 @@ * it in two places: function fill_kinfo_proc in sys/kern/kern_proc.c and * function kvm_proclist in lib/libkvm/kvm_proc.c . */ -#define KI_NSPARE_INT 10 +#define KI_NSPARE_INT 9 #define KI_NSPARE_LONG 12 #define KI_NSPARE_PTR 7 @@ -190,6 +190,7 @@ struct kinfo_proc { */ char ki_sparestrings[68]; /* spare string space */ int ki_spareints[KI_NSPARE_INT]; /* spare room for growth */ + u_int ki_cr_flags; /* Credential flags */ int ki_jid; /* Process jail ID */ int ki_numthreads; /* XXXKSE number of threads in total */ lwpid_t ki_tid; /* XXXKSE thread id */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:27:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAD261065670; Mon, 1 Jun 2009 20:27:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C97E98FC2D; Mon, 1 Jun 2009 20:27:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51KREEF090625; Mon, 1 Jun 2009 20:27:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51KREdb090624; Mon, 1 Jun 2009 20:27:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906012027.n51KREdb090624@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Jun 2009 20:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193256 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:27:15 -0000 Author: jhb Date: Mon Jun 1 20:27:14 2009 New Revision: 193256 URL: http://svn.freebsd.org/changeset/base/193256 Log: Adjust some comments. Modified: head/sys/dev/pci/pcivar.h Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Mon Jun 1 20:26:51 2009 (r193255) +++ head/sys/dev/pci/pcivar.h Mon Jun 1 20:27:14 2009 (r193256) @@ -159,10 +159,10 @@ typedef struct pcicfg { uint8_t slot; /* config space slot address */ uint8_t func; /* config space function number */ - struct pcicfg_pp pp; /* pci power management */ - struct pcicfg_vpd vpd; /* pci vital product data */ - struct pcicfg_msi msi; /* pci msi */ - struct pcicfg_msix msix; /* pci msi-x */ + struct pcicfg_pp pp; /* Power management */ + struct pcicfg_vpd vpd; /* Vital product data */ + struct pcicfg_msi msi; /* PCI MSI */ + struct pcicfg_msix msix; /* PCI MSI-X */ struct pcicfg_ht ht; /* HyperTransport */ } pcicfgregs; From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:30:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C4311065672; Mon, 1 Jun 2009 20:30:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A0488FC29; Mon, 1 Jun 2009 20:30:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51KU0YE090715; Mon, 1 Jun 2009 20:30:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51KU01x090713; Mon, 1 Jun 2009 20:30:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906012030.n51KU01x090713@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Jun 2009 20:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193257 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:30:01 -0000 Author: jhb Date: Mon Jun 1 20:30:00 2009 New Revision: 193257 URL: http://svn.freebsd.org/changeset/base/193257 Log: Add an internal pci_printf() routine similar to device_printf() except that it prefixes the output with 'pci:::: '. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Jun 1 20:27:14 2009 (r193256) +++ head/sys/dev/pci/pci.c Mon Jun 1 20:30:00 2009 (r193257) @@ -76,6 +76,7 @@ static const char *pci_maptype(uint64_t static int pci_mapsize(uint64_t testval); static int pci_maprange(uint64_t mapreg); static void pci_fixancient(pcicfgregs *cfg); +static int pci_printf(pcicfgregs *cfg, const char *fmt, ...); static int pci_porten(device_t dev); static int pci_memen(device_t dev); @@ -313,6 +314,20 @@ pci_find_device(uint16_t vendor, uint16_ return (NULL); } +static int +pci_printf(pcicfgregs *cfg, const char *fmt, ...) +{ + va_list ap; + int retval; + + retval = printf("pci%d:%d:%d:%d: ", cfg->domain, cfg->bus, cfg->slot, + cfg->func); + va_start(ap, fmt); + retval += vprintf(fmt, ap); + va_end(ap); + return (retval); +} + /* return base address of memory or port map */ static pci_addr_t @@ -2049,10 +2064,8 @@ pci_set_powerstate_method(device_t dev, } if (bootverbose) - printf( - "pci%d:%d:%d:%d: Transition from D%d to D%d\n", - dinfo->cfg.domain, dinfo->cfg.bus, dinfo->cfg.slot, - dinfo->cfg.func, oldstate, state); + pci_printf(cfg, "Transition from D%d to D%d\n", oldstate, + state); PCI_WRITE_CONFIG(dev, child, cfg->pp.pp_status, status, 2); if (delay) @@ -2815,9 +2828,7 @@ pci_driver_added(device_t dev, driver_t dinfo = device_get_ivars(child); pci_print_verbose(dinfo); if (bootverbose) - printf("pci%d:%d:%d:%d: reprobing on driver added\n", - dinfo->cfg.domain, dinfo->cfg.bus, dinfo->cfg.slot, - dinfo->cfg.func); + pci_printf(&dinfo->cfg, "reprobing on driver added\n"); pci_cfg_restore(child, dinfo); if (device_probe_and_attach(child) != 0) pci_cfg_save(child, dinfo, 1); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:34:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D24DE1065680; Mon, 1 Jun 2009 20:34:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0A938FC1B; Mon, 1 Jun 2009 20:34:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51KY01m090921; Mon, 1 Jun 2009 20:34:00 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51KY00Z090919; Mon, 1 Jun 2009 20:34:00 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906012034.n51KY00Z090919@svn.freebsd.org> From: Rick Macklem Date: Mon, 1 Jun 2009 20:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193258 - head/usr.bin/nfsstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:34:01 -0000 Author: rmacklem Date: Mon Jun 1 20:34:00 2009 New Revision: 193258 URL: http://svn.freebsd.org/changeset/base/193258 Log: Change the "-4" option flag to "-e" since it does not refer to IPv4 and to make it consistent with the flag used by nfsd and mountd. Approved by: kib (mentor) Modified: head/usr.bin/nfsstat/nfsstat.1 head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.1 ============================================================================== --- head/usr.bin/nfsstat/nfsstat.1 Mon Jun 1 20:30:00 2009 (r193257) +++ head/usr.bin/nfsstat/nfsstat.1 Mon Jun 1 20:34:00 2009 (r193258) @@ -42,7 +42,7 @@ statistics .Sh SYNOPSIS .Nm -.Op Fl cszW4 +.Op Fl ceszW .Op Fl M Ar core .Op Fl N Ar system .Op Fl w Ar wait @@ -83,7 +83,7 @@ second intervals. .It Fl z Reset statistics after displaying them. (Not currently supported by the experimental nfs subsystem.) -.It Fl 4 +.It Fl e Gather statistics from the experimental nfs subsystem that includes support for NFSv4 instead of the regular nfs subsystem. .El Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Mon Jun 1 20:30:00 2009 (r193257) +++ head/usr.bin/nfsstat/nfsstat.c Mon Jun 1 20:34:00 2009 (r193258) @@ -113,7 +113,7 @@ main(int argc, char **argv) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "csWM:N:w:z4")) != -1) + while ((ch = getopt(argc, argv, "cesWM:N:w:z")) != -1) switch(ch) { case 'M': memf = optarg; @@ -140,7 +140,7 @@ main(int argc, char **argv) case 'z': zflag = 1; break; - case '4': + case 'e': run_v4 = 1; break; case '?': @@ -505,7 +505,7 @@ void usage(void) { (void)fprintf(stderr, - "usage: nfsstat [-cszW] [-M core] [-N system] [-w interval]\n"); + "usage: nfsstat [-ceszW] [-M core] [-N system] [-w interval]\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:35:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91C551065829; Mon, 1 Jun 2009 20:35:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4A58FC19; Mon, 1 Jun 2009 20:35:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51KZdF5091044; Mon, 1 Jun 2009 20:35:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51KZdgc091039; Mon, 1 Jun 2009 20:35:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906012035.n51KZdgc091039@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Jun 2009 20:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193260 - in head: share/man/man9 sys/conf sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:35:40 -0000 Author: jhb Date: Mon Jun 1 20:35:39 2009 New Revision: 193260 URL: http://svn.freebsd.org/changeset/base/193260 Log: Add a simple API to manage scatter/gather lists of phyiscal addresses. Each list describes a logical memory object that is backed by one or more physical address ranges. To minimize locking, the sglist objects themselves are immutable once they are shared. These objects may be used in the future to facilitate I/O requests using physically-addressed buffers. For the immediate future I plan to use them to implement a new type of VM object and pager. Reviewed by: jeff, scottl MFC after: 1 month Added: head/share/man/man9/sglist.9 (contents, props changed) head/sys/kern/subr_sglist.c (contents, props changed) head/sys/sys/sglist.h (contents, props changed) Modified: head/share/man/man9/Makefile head/sys/conf/files Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Jun 1 20:35:09 2009 (r193259) +++ head/share/man/man9/Makefile Mon Jun 1 20:35:39 2009 (r193260) @@ -218,6 +218,7 @@ MAN= accept_filter.9 \ selrecord.9 \ sema.9 \ sf_buf.9 \ + sglist.9 \ signal.9 \ sleep.9 \ sleepqueue.9 \ @@ -1022,6 +1023,24 @@ MLINKS+=sf_buf.9 sf_buf_alloc.9 \ sf_buf.9 sf_buf_free.9 \ sf_buf.9 sf_buf_kva.9 \ sf_buf.9 sf_buf_page.9 +MLINKS+=sglist.9 sglist_alloc.9 \ + sglist.9 sglist_append.9 \ + sglist.9 sglist_append_mbuf.9 \ + sglist.9 sglist_append_phys.9 \ + sglist.9 sglist_append_uio.9 \ + sglist.9 sglist_append_user.9 \ + sglist.9 sglist_build.9 \ + sglist.9 sglist_clone.9 \ + sglist.9 sglist_consume_uio.9 \ + sglist.9 sglist_count.9 \ + sglist.9 sglist_free.9 \ + sglist.9 sglist_hold.9 \ + sglist.9 sglist_init.9 \ + sglist.9 sglist_join.9 \ + sglist.9 sglist_length.9 \ + sglist.9 sglist_reset.9 \ + sglist.9 sglist_slice.9 \ + sglist.9 sglist_split.9 MLINKS+=signal.9 cursig.9 \ signal.9 execsigs.9 \ signal.9 issignal.9 \ Added: head/share/man/man9/sglist.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/sglist.9 Mon Jun 1 20:35:39 2009 (r193260) @@ -0,0 +1,503 @@ +.\" +.\" Copyright (c) 2009 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 15, 2009 +.Dt SGLIST 9 +.Os +.Sh NAME +.Nm sglist , +.Nm sglist_alloc , +.Nm sglist_append , +.Nm sglist_append_mbuf , +.Nm sglist_append_phys , +.Nm sglist_append_uio , +.Nm sglist_append_user , +.Nm sglist_build , +.Nm sglist_clone , +.Nm sglist_consume_uio , +.Nm sglist_count , +.Nm sglist_free , +.Nm sglist_hold , +.Nm sglist_init , +.Nm sglist_join , +.Nm sglist_length , +.Nm sglist_reset , +.Nm sglist_slice , +.Nm sglist_split +.Nd manage a scatter/gather list of physical memory addresses +.Sh SYNOPSIS +.In sys/types.h +.In sys/sglist.h +.Ft struct sglist * +.Fn sglist_alloc "int nsegs" "int mflags" +.Ft int +.Fn sglist_append "struct sglist *sg" "void *buf" "size_t len" +.Ft int +.Fn sglist_append_mbuf "struct sglist *sg" "struct mbuf *m" +.Ft int +.Fn sglist_append_phys "struct sglist *sg" "vm_paddr_t paddr" "size_t len" +.Ft int +.Fn sglist_append_uio "struct sglist *sg" "struct uio *uio" +.Ft int +.Fn sglist_append_user "struct sglist *sg" "void *buf" "size_t len" "struct thread *td" +.Ft struct sglist * +.Fn sglist_build "void *buf" "size_t len" "int mflags" +.Ft struct sglist * +.Fn sglist_clone "struct sglist *sg" "int mflags" +.Ft int +.Fn sglist_consume_uio "struct sglist *sg" "struct uio *uio" "int resid" +.Ft int +.Fn sglist_count "void *buf" "size_t len" +.Ft void +.Fn sglist_free "struct sglist *sg" +.Ft struct sglist * +.Fn sglist_hold "struct sglist *sg" +.Ft void +.Fn sglist_init "struct sglist *sg" "int maxsegs" "struct sglist_seg *segs" +.Ft int +.Fn sglist_join "struct sglist *first" "struct sglist *second" +.Ft size_t +.Fn sglist_length "struct sglist *sg" +.Ft void +.Fn sglist_reset "struct sglist *sg" +.Ft int +.Fn sglist_slice "struct sglist *original" "struct sglist **slice" "size_t offset" "size_t length" "int mflags" +.Ft int +.Fn sglist_split "struct sglist *original" "struct sglist **head" "size_t length" "int mflags" +.Sh DESCRIPTION +The +.Nm +API manages physical address ranges. +Each list contains one or more elements. +Each element contains a starting physical address and a length. +Scatter/gather lists are read-only while they are shared. +If one wishes to alter an existing scatter/gather list and does not hold the +sole reference to the list, +then one should create a new list instead of modifying the existing list. +.Pp +Each scatter/gather list object contains a reference count. +New lists are created with a single reference. +New references are obtained by calling +.Nm sglist_hold +and are released by calling +.Nm sglist_free . +.Ss Allocating and Initializing Lists +Each +.Nm +object consists of a header structure and a variable-length array of +scatter/gather list elements. +The +.Nm sglist_alloc +function allocates a new list that contains a header and +.Fa nsegs +scatter/gather list elements. +The +.Fa mflags +argument can be set to either +.Dv M_NOWAIT +or +.Dv M_WAITOK . +.Pp +The +.Nm sglist_count +function returns the number of scatter/gather list elements needed to describe +the physical address ranges mapped by a single kernel virtual address range. +The kernel virtual address range starts at +.Fa buf +and is +.Fa len +bytes long. +.Pp +The +.Nm sglist_build +function allocates a new scatter/gather list object that describes the physical +address ranges mapped by a single kernel virtual address range. +The kernel virtual address range starts at +.Fa buf +and is +.Fa len +bytes long. +The +.Fa mflags +argument can be set to either +.Dv M_NOWAIT +or +.Dv M_WAITOK . +.Pp +The +.Nm sglist_clone +function returns a copy of an exising scatter/gather list object +.Fa sg . +The +.Fa mflags +argument can be set to either +.Dv M_NOWAIT +or +.Dv M_WAITOK . +This can be used to obtain a private copy of a scatter/gather list before +modifying it. +.Pp +The +.Nm sglist_init +function initializes a scatter/gather list header. +The header is pointed to by +.Fa sg +and is initialized to manage an array of +.Fa maxsegs +scatter/gather list elements pointed to by +.Fa segs . +This can be used to initialize a scatter/gather list header whose storage +is not provided by +.Nm sglist_alloc . +In that case, the caller should not call +.Nm sglist_free +to release its own reference and is responsible for ensuring all other +references to the list are dropped before it releases the storage for +.Fa sg +and +.Fa segs . +.Ss Constructing Scatter/Gather Lists +The +.Nm +API provides several routines for building a scatter/gather list to describe +one or more objects. +Specifically, the +.Nm sglist_append +family of routines can be used to append the physical address ranges described +by an object to the end of a scatter/gather list. +All of these routines return 0 on success or an error on failure. +.Pp +The +.Nm sglist_append +function appends the physical address ranges described by a single kernel +virtual address range to the scatter/gather list +.Fa sg . +The kernel virtual address range starts at +.Fa buf +and is +.Fa len +bytes long. +.Pp +The +.Nm sglist_append_mbuf +function appends the physical address ranges described by an entire mbuf +chain +.Fa m +to the scatter/gather list +.Fa sg . +.Pp +The +.Nm sglist_append_phys +function appends a single physical address range to the scatter/gather list +.Fa sg . +The physical address range starts at +.Fa paddr +and is +.Fa len +bytes long. +.Pp +The +.Nm sglist_append_uio +function appends the physical address ranges described by a +.Xr uio 9 +object to the scatter/gather list +.Fa sg . +Note that it is the caller's responsibility to ensure that the pages backing +the I/O request are wired for the lifetime of +.Fa sg . +Note also that this routine does not modify +.Fa uio . +.Pp +The +.Nm sglist_append_user +function appends the physical address ranges described by a single user +virtual address range to the scatter/gather list +.Fa sg . +The user virtual address range is relative to the address space of the thread +.Fa td . +It starts at +.Fa buf +and is +.Fa len +bytes long. +Note that it is the caller's responsibility to ensure that the pages backing +the user buffer are wired for the lifetime of +.Fa sg . +.Pp +The +.Nm sglist_consume_uio +function is a variation of +.Nm sglist_append_uio . +As with +.Nm sglist_append_uio , +it appends the physical address ranges described by +.Fa uio +to the scatter/gather list +.Fa sg . +Unlike +.Nm sglist_append_uio , +however, +.Nm sglist_consume_uio +modifies the I/O request to indicate that the appended address ranges have +been processed similar to calling +.Xr uiomove 9 . +This routine will only append ranges that describe up to +.Fa resid +total bytes in length. +If the available segments in the scatter/gather list are exhausted before +.Fa resid +bytes are processed, +then the +.Fa uio +structure will be updated to reflect the actual number of bytes processed, +and +.Nm sglist_consume_io +will return zero to indicate success. +In effect, this function will perform partial reads or writes. +The caller can compare the +.Fa uio_resid +member of +.Fa uio +before and after calling +.Nm sglist_consume_uio +to determine the actual number of bytes processed. +.Ss Manipulating Scatter/Gather Lists +The +.Nm sglist_join +function appends physical address ranges from the scatter/gather list +.Fa second +onto +.Fa first +and then resets +.Fa second +to an empty list. +It returns zero on success or an error on failure. +.Pp +The +.Nm sglist_split +function splits an existing scatter/gather list into two lists. +The first +.Fa length +bytes described by the list +.Fa original +are moved to a new list +.Fa *head . +If +.Fa original +describes a total address range that is smaller than +.Fa length +bytes, +then all of the address ranges will be moved to the new list at +.Fa *head +and +.Fa original +will be an empty list. +The caller may supply an existing scatter/gather list in +.Fa *head . +If so, the list must be empty. +Otherwise, the caller may set +.Fa *head +to +.Dv NULL +in which case a new scatter/gather list will be allocated. +In that case, +.Fa mflags +may be set to either +.Dv M_NOWAIT +or +.Dv M_WAITOK . +Note that since the +.Fa original +list is modified by this call, it must be a private list with no other +references. +The +.Nm sglist_split +function returns zero on success or an error on failure. +.Pp +The +.Nm sglist_slice +function generates a new scatter/gather list from a sub-range of an existing +scatter/gather list +.Fa original . +The sub-range to extract is specified by the +.Fa offset +and +.Fa length +parameters. +The new scatter/gather list is stored in +.Fa *slice . +As with +.Fa head +for +.Nm sglist_join , +the caller may either provide an empty scatter/gather list, +or it may set +.Fa *slice +to +.Dv NULL +in which case +.Nm sglist_slice +will allocate a new list subject to +.Fa mflags . +Unlike +.Nm sglist_split , +.Nm sglist_slice +does not modify +.Fa original +and does not require it to be a private list. +The +.Nm sglist_split +function returns zero on success or an error on failure. +.Ss Miscellaneous Routines +The +.Nm sglist_reset +function clears the scatter/gather list +.Fa sg +so that it no longer maps any address ranges. +This can allow reuse of a single scatter/gather list object for multiple +requests. +.Pp +The +.Nm sglist_length +function returns the total length of the physical address ranges described +by the scatter/gather list +.Fa sg . +.Sh RETURN VALUES +The +.Nm sglist_alloc , +.Nm sglist_build , +and +.Nm sglist_clone +functions return a new scatter/gather list on success or +.Dv NULL +on failure. +.Pp +The +.Nm sglist_append +family of functions and the +.Nm sglist_consume_uio , +.Nm sglist_join , +.Nm sglist_slice , +and +.Nm sglist_split +functions return zero on success or an error on failure. +.Pp +The +.Nm sglist_count +function returns a count of scatter/gather list elements. +.Pp +The +.Nm sglist_length +function returns a count of address space described by a scatter/gather list +in bytes. +.Sh ERRORS +The +.Nm sglist_append +functions return the following errors on failure: +.Bl -tag -width Er +.It Bq Er EINVAL +The scatter/gather list has zero segments. +.It Bq Er EFBIG +There are not enough available segments in the scatter/gather list to append +the specified physical address ranges. +.El +.Pp +The +.Nm sglist_consume_uio +function returns the following error on failure: +.Bl -tag -width Er +.It Bq Er EINVAL +The scatter/gather list has zero segments. +.El +.Pp +The +.Nm sglist_join +function returns the following error on failure: +.Bl -tag -width Er +.It Bq Er EFBIG +There are not enough available segments in the scatter/gather list +.Fa first +to append the physical address ranges from +.Fa second . +.El +The +.Nm sglist_slice +function returns the following errors on failure: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa original +scatter/gather list does not describe enough address space to cover the +requested sub-range. +.It Bq Er EINVAL +The caller-supplied scatter/gather list in +.Fa *slice +is not empty. +.It Bq Er ENOMEM +An attempt to allocate a new scatter/gather list with +.Dv M_NOWAIT +set in +.Fa mflags +failed. +.It Bq Er EFBIG +There are not enough available segments in the caller-supplied scatter/gather +list in +.Fa *slice +to describe the requested physical address ranges. +.El +The +.Nm sglist_split +function returns the following errors on failure: +.Bl -tag -width Er +.It Bq Er EDOOFUS +The +.Fa original +scatter/gather list has more than one reference. +.It Bq Er EINVAL +The caller-supplied scatter/gather list in +.Fa *head +is not empty. +.It Bq Er ENOMEM +An attempt to allocate a new scatter/gather list with +.Dv M_NOWAIT +set in +.Fa mflags +failed. +.It Bq Er EFBIG +There are not enough available segments in the caller-supplied scatter/gather +list in +.Fa *head +to describe the requested physical address ranges. +.El +.Sh SEE ALSO +.Xr malloc 9 , +.Xr mbuf 9 , +.Xr uio 9 +.Sh HISTORY +This API was first introduced in +.Fx 8.0 . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jun 1 20:35:09 2009 (r193259) +++ head/sys/conf/files Mon Jun 1 20:35:39 2009 (r193260) @@ -1994,6 +1994,7 @@ kern/subr_rman.c standard kern/subr_rtc.c standard kern/subr_sbuf.c standard kern/subr_scanf.c standard +kern/subr_sglist.c standard kern/subr_sleepqueue.c standard kern/subr_smp.c standard kern/subr_stack.c optional ddb | stack | ktr Added: head/sys/kern/subr_sglist.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/subr_sglist.c Mon Jun 1 20:35:39 2009 (r193260) @@ -0,0 +1,656 @@ +/*- + * Copyright (c) 2008 Yahoo!, Inc. + * All rights reserved. + * Written by: John Baldwin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +static MALLOC_DEFINE(M_SGLIST, "sglist", "scatter/gather lists"); + +/* + * Append a single (paddr, len) to a sglist. sg is the list and ss is + * the current segment in the list. If we run out of segments then + * EFBIG will be returned. + */ +static __inline int +_sglist_append_range(struct sglist *sg, struct sglist_seg **ssp, + vm_paddr_t paddr, size_t len) +{ + struct sglist_seg *ss; + + ss = *ssp; + if (ss->ss_paddr + ss->ss_len == paddr) + ss->ss_len += len; + else { + if (sg->sg_nseg == sg->sg_maxseg) { + sg->sg_nseg = 0; + return (EFBIG); + } + ss++; + ss->ss_paddr = paddr; + ss->ss_len = len; + sg->sg_nseg++; + *ssp = ss; + } + return (0); +} + +/* + * Worker routine to append a virtual address range (either kernel or + * user) to a scatter/gather list. + */ +static __inline int +_sglist_append_buf(struct sglist *sg, void *buf, size_t len, pmap_t pmap, + size_t *donep) +{ + struct sglist_seg *ss; + vm_offset_t vaddr, offset; + vm_paddr_t paddr; + size_t seglen; + int error; + + if (donep) + *donep = 0; + if (len == 0) + return (0); + + /* Do the first page. It may have an offset. */ + vaddr = (vm_offset_t)buf; + offset = vaddr & PAGE_MASK; + if (pmap != NULL) + paddr = pmap_extract(pmap, vaddr); + else + paddr = pmap_kextract(vaddr); + seglen = MIN(len, PAGE_SIZE - offset); + if (sg->sg_nseg == 0) { + ss = sg->sg_segs; + ss->ss_paddr = paddr; + ss->ss_len = seglen; + sg->sg_nseg = 1; + error = 0; + } else { + ss = &sg->sg_segs[sg->sg_nseg - 1]; + error = _sglist_append_range(sg, &ss, paddr, seglen); + } + + while (error == 0 && len > seglen) { + vaddr += seglen; + len -= seglen; + if (donep) + *donep += seglen; + seglen = MIN(len, PAGE_SIZE); + if (pmap != NULL) + paddr = pmap_extract(pmap, vaddr); + else + paddr = pmap_kextract(vaddr); + error = _sglist_append_range(sg, &ss, paddr, seglen); + } + + return (error); +} + +/* + * Determine the number of scatter/gather list elements needed to + * describe a kernel virtual address range. + */ +int +sglist_count(void *buf, size_t len) +{ + vm_offset_t vaddr, vendaddr; + vm_paddr_t lastaddr, paddr; + int nsegs; + + if (len == 0) + return (0); + + vaddr = trunc_page((vm_offset_t)buf); + vendaddr = (vm_offset_t)buf + len; + nsegs = 1; + lastaddr = pmap_kextract(vaddr); + vaddr += PAGE_SIZE; + while (vaddr < vendaddr) { + paddr = pmap_kextract(vaddr); + if (lastaddr + PAGE_SIZE != paddr) + nsegs++; + lastaddr = paddr; + vaddr += PAGE_SIZE; + } + return (nsegs); +} + +/* + * Allocate a scatter/gather list along with 'nsegs' segments. The + * 'mflags' parameters are the same as passed to malloc(9). The caller + * should use sglist_free() to free this list. + */ +struct sglist * +sglist_alloc(int nsegs, int mflags) +{ + struct sglist *sg; + + sg = malloc(sizeof(struct sglist) + nsegs * sizeof(struct sglist_seg), + M_SGLIST, mflags); + if (sg == NULL) + return (NULL); + sglist_init(sg, nsegs, (struct sglist_seg *)(sg + 1)); + return (sg); +} + +/* + * Free a scatter/gather list allocated via sglist_allc(). + */ +void +sglist_free(struct sglist *sg) +{ + + if (refcount_release(&sg->sg_refs)) + free(sg, M_SGLIST); +} + +/* + * Append the segments to describe a single kernel virtual address + * range to a scatter/gather list. If there are insufficient + * segments, then this fails with EFBIG. + */ +int +sglist_append(struct sglist *sg, void *buf, size_t len) +{ + + if (sg->sg_maxseg == 0) + return (EINVAL); + return (_sglist_append_buf(sg, buf, len, NULL, NULL)); +} + +/* + * Append a single physical address range to a scatter/gather list. + * If there are insufficient segments, then this fails with EFBIG. + */ +int +sglist_append_phys(struct sglist *sg, vm_paddr_t paddr, size_t len) +{ + struct sglist_seg *ss; + + if (sg->sg_maxseg == 0) + return (EINVAL); + if (len == 0) + return (0); + + if (sg->sg_nseg == 0) { + sg->sg_segs[0].ss_paddr = paddr; + sg->sg_segs[0].ss_len = len; + sg->sg_nseg = 1; + return (0); + } + ss = &sg->sg_segs[sg->sg_nseg - 1]; + return (_sglist_append_range(sg, &ss, paddr, len)); +} + +/* + * Append the segments that describe a single mbuf chain to a + * scatter/gather list. If there are insufficient segments, then this + * fails with EFBIG. + */ +int +sglist_append_mbuf(struct sglist *sg, struct mbuf *m0) +{ + struct mbuf *m; + int error; + + if (sg->sg_maxseg == 0) + return (EINVAL); + + error = 0; + for (m = m0; m != NULL; m = m->m_next) { + if (m->m_len > 0) { + error = sglist_append(sg, m->m_data, m->m_len); + if (error) + return (error); + } + } + return (0); +} + +/* + * Append the segments that describe a single user address range to a + * scatter/gather list. If there are insufficient segments, then this + * fails with EFBIG. + */ +int +sglist_append_user(struct sglist *sg, void *buf, size_t len, struct thread *td) +{ + + if (sg->sg_maxseg == 0) + return (EINVAL); + return (_sglist_append_buf(sg, buf, len, + vmspace_pmap(td->td_proc->p_vmspace), NULL)); +} + +/* + * Append the segments that describe a single uio to a scatter/gather + * list. If there are insufficient segments, then this fails with + * EFBIG. + */ +int +sglist_append_uio(struct sglist *sg, struct uio *uio) +{ + struct iovec *iov; + size_t resid, minlen; + pmap_t pmap; + int error, i; + + if (sg->sg_maxseg == 0) + return (EINVAL); + + resid = uio->uio_resid; + iov = uio->uio_iov; + + if (uio->uio_segflg == UIO_USERSPACE) { + KASSERT(uio->uio_td != NULL, + ("sglist_append_uio: USERSPACE but no thread")); + pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); + } else + pmap = NULL; + + error = 0; + for (i = 0; i < uio->uio_iovcnt && resid != 0; i++) { + /* + * Now at the first iovec to load. Load each iovec + * until we have exhausted the residual count. + */ + minlen = MIN(resid, iov[i].iov_len); + if (minlen > 0) { + error = _sglist_append_buf(sg, iov[i].iov_base, minlen, + pmap, NULL); + if (error) + return (error); + resid -= minlen; + } + } + return (0); +} + +/* + * Append the segments that describe at most 'resid' bytes from a + * single uio to a scatter/gather list. If there are insufficient + * segments, then only the amount that fits is appended. + */ +int +sglist_consume_uio(struct sglist *sg, struct uio *uio, int resid) +{ + struct iovec *iov; + size_t done; + pmap_t pmap; + int error, len; + + if (sg->sg_maxseg == 0) + return (EINVAL); + + if (uio->uio_segflg == UIO_USERSPACE) { + KASSERT(uio->uio_td != NULL, + ("sglist_consume_uio: USERSPACE but no thread")); + pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); + } else + pmap = NULL; + + error = 0; + while (resid > 0 && uio->uio_resid) { + iov = uio->uio_iov; + len = iov->iov_len; + if (len == 0) { + uio->uio_iov++; + uio->uio_iovcnt--; + continue; + } + if (len > resid) + len = resid; + + /* + * Try to append this iovec. If we run out of room, + * then break out of the loop. + */ + error = _sglist_append_buf(sg, iov->iov_base, len, pmap, &done); + iov->iov_base = (char *)iov->iov_base + done; + iov->iov_len -= done; + uio->uio_resid -= done; + uio->uio_offset += done; + resid -= done; + if (error) + break; + } + return (0); +} + +/* + * Allocate and populate a scatter/gather list to describe a single + * kernel virtual address range. + */ +struct sglist * +sglist_build(void *buf, size_t len, int mflags) +{ + struct sglist *sg; + int nsegs; + + if (len == 0) + return (NULL); + + nsegs = sglist_count(buf, len); + sg = sglist_alloc(nsegs, mflags); + if (sg == NULL) + return (NULL); + if (sglist_append(sg, buf, len) != 0) { + sglist_free(sg); + return (NULL); + } + return (sg); +} + +/* + * Clone a new copy of a scatter/gather list. + */ +struct sglist * +sglist_clone(struct sglist *sg, int mflags) +{ + struct sglist *new; + + if (sg == NULL) + return (NULL); + new = sglist_alloc(sg->sg_maxseg, mflags); + if (new == NULL) + return (NULL); + bcopy(sg->sg_segs, new->sg_segs, sizeof(struct sglist_seg) * + sg->sg_nseg); + return (new); +} + +/* + * Calculate the total length of the segments described in a + * scatter/gather list. + */ +size_t +sglist_length(struct sglist *sg) +{ + size_t space; + int i; + + space = 0; + for (i = 0; i < sg->sg_nseg; i++) + space += sg->sg_segs[i].ss_len; + return (space); +} + +/* + * Split a scatter/gather list into two lists. The scatter/gather + * entries for the first 'length' bytes of the 'original' list are + * stored in the '*head' list and are removed from 'original'. + * + * If '*head' is NULL, then a new list will be allocated using + * 'mflags'. If M_NOWAIT is specified and the allocation fails, + * ENOMEM will be returned. + * + * If '*head' is not NULL, it should point to an empty sglist. If it + * does not have enough room for the remaining space, then EFBIG will + * be returned. If '*head' is not empty, then EINVAL will be + * returned. + * + * If 'original' is shared (refcount > 1), then EDOOFUS will be + * returned. + */ +int +sglist_split(struct sglist *original, struct sglist **head, size_t length, + int mflags) +{ + struct sglist *sg; + size_t space, split; + int count, i; + + if (original->sg_refs > 1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:42:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5082A1065675; Mon, 1 Jun 2009 20:42:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 249CC8FC08; Mon, 1 Jun 2009 20:42:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51KgSNC091262; Mon, 1 Jun 2009 20:42:28 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51KgSc5091261; Mon, 1 Jun 2009 20:42:28 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200906012042.n51KgSc5091261@svn.freebsd.org> From: Dmitry Chagin Date: Mon, 1 Jun 2009 20:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193262 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:42:28 -0000 Author: dchagin Date: Mon Jun 1 20:42:27 2009 New Revision: 193262 URL: http://svn.freebsd.org/changeset/base/193262 Log: Split linux_accept() syscall onto linux_accept_common() which should be used by linuxulator and linux_accept() itself. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Jun 1 20:41:33 2009 (r193261) +++ head/sys/compat/linux/linux_socket.c Mon Jun 1 20:42:27 2009 (r193262) @@ -763,14 +763,9 @@ linux_listen(struct thread *td, struct l return (listen(td, &bsd_args)); } -struct linux_accept_args { - int s; - l_uintptr_t addr; - l_uintptr_t namelen; -}; - static int -linux_accept(struct thread *td, struct linux_accept_args *args) +linux_accept_common(struct thread *td, int s, l_uintptr_t addr, + l_uintptr_t namelen) { struct accept_args /* { int s; @@ -779,19 +774,19 @@ linux_accept(struct thread *td, struct l } */ bsd_args; int error, fd; - bsd_args.s = args->s; + bsd_args.s = s; /* XXX: */ - bsd_args.name = (struct sockaddr * __restrict)PTRIN(args->addr); - bsd_args.anamelen = PTRIN(args->namelen);/* XXX */ + bsd_args.name = (struct sockaddr * __restrict)PTRIN(addr); + bsd_args.anamelen = PTRIN(namelen);/* XXX */ error = accept(td, &bsd_args); bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.name); if (error) { - if (error == EFAULT && args->namelen != sizeof(struct sockaddr_in)) + if (error == EFAULT && namelen != sizeof(struct sockaddr_in)) return (EINVAL); return (error); } - if (args->addr) { - error = linux_sa_put(PTRIN(args->addr)); + if (addr) { + error = linux_sa_put(PTRIN(addr)); if (error) { (void)kern_close(td, td->td_retval[0]); return (error); @@ -809,6 +804,20 @@ linux_accept(struct thread *td, struct l return (0); } +struct linux_accept_args { + int s; + l_uintptr_t addr; + l_uintptr_t namelen; +}; + +static int +linux_accept(struct thread *td, struct linux_accept_args *args) +{ + + return (linux_accept_common(td, args->s, args->addr, + args->namelen)); +} + struct linux_getsockname_args { int s; l_uintptr_t addr; From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:44:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B8AE1065670; Mon, 1 Jun 2009 20:44:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09F1B8FC1C; Mon, 1 Jun 2009 20:44:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51Kiwff091374; Mon, 1 Jun 2009 20:44:58 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51Kiwxd091373; Mon, 1 Jun 2009 20:44:58 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200906012044.n51Kiwxd091373@svn.freebsd.org> From: Dmitry Chagin Date: Mon, 1 Jun 2009 20:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193263 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:44:59 -0000 Author: dchagin Date: Mon Jun 1 20:44:58 2009 New Revision: 193263 URL: http://svn.freebsd.org/changeset/base/193263 Log: Implement a variation of the accept_common() which takes a flags argument. Do not preserve td_retval before kern_fcntl(F_SETFL) as it does not changed. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Jun 1 20:42:27 2009 (r193262) +++ head/sys/compat/linux/linux_socket.c Mon Jun 1 20:44:58 2009 (r193263) @@ -772,7 +772,10 @@ linux_accept_common(struct thread *td, i struct sockaddr * __restrict name; socklen_t * __restrict anamelen; } */ bsd_args; - int error, fd; + int error; + + if (flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK)) + return (EINVAL); bsd_args.s = s; /* XXX: */ @@ -785,23 +788,27 @@ linux_accept_common(struct thread *td, i return (EINVAL); return (error); } - if (addr) { - error = linux_sa_put(PTRIN(addr)); - if (error) { - (void)kern_close(td, td->td_retval[0]); - return (error); - } - } /* * linux appears not to copy flags from the parent socket to the - * accepted one, so we must clear the flags in the new descriptor. - * Ignore any errors, because we already have an open fd. + * accepted one, so we must clear the flags in the new descriptor + * and apply the requested flags. */ - fd = td->td_retval[0]; - (void)kern_fcntl(td, fd, F_SETFL, 0); - td->td_retval[0] = fd; - return (0); + error = kern_fcntl(td, td->td_retval[0], F_SETFL, 0); + if (error) + goto out; + error = linux_set_socket_flags(td, td->td_retval[0], flags); + if (error) + goto out; + if (addr) + error = linux_sa_put(PTRIN(addr)); + +out: + if (error) { + (void)kern_close(td, td->td_retval[0]); + td->td_retval[0] = 0; + } + return (error); } struct linux_accept_args { From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:48:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 796EE1065673; Mon, 1 Jun 2009 20:48:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CCCA8FC15; Mon, 1 Jun 2009 20:48:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51Kme8Z091491; Mon, 1 Jun 2009 20:48:40 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51KmeAi091488; Mon, 1 Jun 2009 20:48:40 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200906012048.n51KmeAi091488@svn.freebsd.org> From: Dmitry Chagin Date: Mon, 1 Jun 2009 20:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193264 - in head/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:48:40 -0000 Author: dchagin Date: Mon Jun 1 20:48:39 2009 New Revision: 193264 URL: http://svn.freebsd.org/changeset/base/193264 Log: Implement accept4 syscall. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/amd64/linux32/linux.h head/sys/compat/linux/linux_socket.c head/sys/i386/linux/linux.h Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Mon Jun 1 20:44:58 2009 (r193263) +++ head/sys/amd64/linux32/linux.h Mon Jun 1 20:48:39 2009 (r193264) @@ -669,6 +669,7 @@ union l_semun { #define LINUX_GETSOCKOPT 15 #define LINUX_SENDMSG 16 #define LINUX_RECVMSG 17 +#define LINUX_ACCEPT4 18 #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Jun 1 20:44:58 2009 (r193263) +++ head/sys/compat/linux/linux_socket.c Mon Jun 1 20:48:39 2009 (r193264) @@ -825,6 +825,21 @@ linux_accept(struct thread *td, struct l args->namelen)); } +struct linux_accept4_args { + int s; + l_uintptr_t addr; + l_uintptr_t namelen; + int flags; +}; + +static int +linux_accept4(struct thread *td, struct linux_accept4_args *args) +{ + + return (linux_accept_common(td, args->s, args->addr, + args->namelen, args->flags)); +} + struct linux_getsockname_args { int s; l_uintptr_t addr; @@ -1528,7 +1543,8 @@ static const unsigned char lxs_args[] = LINUX_AL(4) /* recv */, LINUX_AL(6) /* sendto */, LINUX_AL(6) /* recvfrom */, LINUX_AL(2) /* shutdown */, LINUX_AL(5) /* setsockopt */, LINUX_AL(5) /* getsockopt */, - LINUX_AL(3) /* sendmsg */, LINUX_AL(3) /* recvmsg */ + LINUX_AL(3) /* sendmsg */, LINUX_AL(3) /* recvmsg */, + LINUX_AL(4) /* accept4 */ }; #define LINUX_AL_SIZE sizeof(lxs_args) / sizeof(lxs_args[0]) - 1 @@ -1582,6 +1598,8 @@ linux_socketcall(struct thread *td, stru return (linux_sendmsg(td, arg)); case LINUX_RECVMSG: return (linux_recvmsg(td, arg)); + case LINUX_ACCEPT4: + return (linux_accept4(td, arg)); } uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what); Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Mon Jun 1 20:44:58 2009 (r193263) +++ head/sys/i386/linux/linux.h Mon Jun 1 20:48:39 2009 (r193264) @@ -645,6 +645,7 @@ union l_semun { #define LINUX_GETSOCKOPT 15 #define LINUX_SENDMSG 16 #define LINUX_RECVMSG 17 +#define LINUX_ACCEPT4 18 #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:54:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F63C1065672; Mon, 1 Jun 2009 20:54:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D9848FC08; Mon, 1 Jun 2009 20:54:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51Ksfsa091636; Mon, 1 Jun 2009 20:54:41 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51KsfPt091635; Mon, 1 Jun 2009 20:54:41 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200906012054.n51KsfPt091635@svn.freebsd.org> From: Dmitry Chagin Date: Mon, 1 Jun 2009 20:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193265 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:54:42 -0000 Author: dchagin Date: Mon Jun 1 20:54:41 2009 New Revision: 193265 URL: http://svn.freebsd.org/changeset/base/193265 Log: Add forgotten in previous commit flags argument. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Jun 1 20:48:39 2009 (r193264) +++ head/sys/compat/linux/linux_socket.c Mon Jun 1 20:54:41 2009 (r193265) @@ -765,7 +765,7 @@ linux_listen(struct thread *td, struct l static int linux_accept_common(struct thread *td, int s, l_uintptr_t addr, - l_uintptr_t namelen) + l_uintptr_t namelen, int flags) { struct accept_args /* { int s; @@ -822,7 +822,7 @@ linux_accept(struct thread *td, struct l { return (linux_accept_common(td, args->s, args->addr, - args->namelen)); + args->namelen, 0)); } struct linux_accept4_args { From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:59:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A7521065675; Mon, 1 Jun 2009 20:59:40 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 697558FC25; Mon, 1 Jun 2009 20:59:40 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51KxeAF091790; Mon, 1 Jun 2009 20:59:40 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51Kxe1l091789; Mon, 1 Jun 2009 20:59:40 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200906012059.n51Kxe1l091789@svn.freebsd.org> From: Marko Zec Date: Mon, 1 Jun 2009 20:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193266 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:59:41 -0000 Author: zec Date: Mon Jun 1 20:59:40 2009 New Revision: 193266 URL: http://svn.freebsd.org/changeset/base/193266 Log: Remove an #undef MIN that slipped under the radar and led me to hastily introduce an #define MIN() a few lines below in r191816. Approved by: julian (mentor) Discussed with: bz Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jun 1 20:54:41 2009 (r193265) +++ head/sys/netinet6/nd6.c Mon Jun 1 20:59:40 2009 (r193266) @@ -281,7 +281,6 @@ nd6_setmtu0(struct ifnet *ifp, struct nd if (ndi->maxmtu > V_in6_maxmtu) in6_setmaxmtu(); /* check all interfaces just in case */ -#undef MIN } void @@ -489,14 +488,6 @@ nd6_llinfo_timer(void *arg) if ((ifp = ((ln->lle_tbl != NULL) ? ln->lle_tbl->llt_ifp : NULL)) == NULL) panic("ln ifp == NULL"); -/* - * XXX XXX XXX XXX XXX - * - * Why the ^%(@)*&%^) is this #define MIN() needed for CURVNET_SET()?!? - * And #define MIN() is in sys/param.h already, which is #included first - * here?!? - */ -#define MIN(a,b) (((a)<(b))?(a):(b)) CURVNET_SET(ifp->if_vnet); INIT_VNET_INET6(curvnet); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:02:02 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15F33106567B; Mon, 1 Jun 2009 21:02:02 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id A7F868FC08; Mon, 1 Jun 2009 21:02:01 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id D56D05C024; Tue, 2 Jun 2009 05:02:00 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id A860355CDB47; Tue, 2 Jun 2009 05:02:00 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id Z799oo7BpyTt; Tue, 2 Jun 2009 05:01:09 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 9BF6655CDB45; Tue, 2 Jun 2009 05:01:02 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=O0D1IBFRBvp9eRGQWu4HlrVYjOmKHa1Tvk/SD4Fezk7+WB3HKspKSklSuXAJo/GPH MebK9+x48YyehyRx0M3Tw== Message-ID: <4A24417C.9060509@delphij.net> Date: Mon, 01 Jun 2009 14:00:44 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.21 (X11/20090408) MIME-Version: 1.0 To: Roman Divacky References: <200906011843.n51IhXt4087781@svn.freebsd.org> <4A242282.4030404@FreeBSD.org> <20090601184937.GA24177@freebsd.org> <20090601185532.GA24838@freebsd.org> <4A242771.3090605@delphij.net> <20090601201621.GA35383@freebsd.org> In-Reply-To: <20090601201621.GA35383@freebsd.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, d@delphij.net Subject: Re: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:02:02 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roman Divacky wrote: [...] >>> you build the kernel with -std=gnu99 instead of -std=c99. which is a bug. I am >>> trying to fix this. if anyone has any idea please mail me.. >> This is strange... Let me take a look at this, I have reverted the >> WARNS?=6 change for now. > > oh.. sorry. this has nothing to do with this commit. I just noticed it in > doug's reply.. The commit itself has a problem :) I'll correct it before marking this back to WARNS=6. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkokQXsACgkQi+vbBBjt66DrKACdH90YE8KyOq+lmN8adEBP50Yz ZyEAoLVQvb95bpC2jQCF3YXpJh/roNkm =w4NO -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:07:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FC0F106567A; Mon, 1 Jun 2009 21:07:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DECD8FC12; Mon, 1 Jun 2009 21:07:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51L7scW092074; Mon, 1 Jun 2009 21:07:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51L7slY092073; Mon, 1 Jun 2009 21:07:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200906012107.n51L7slY092073@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jun 2009 21:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193268 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:07:55 -0000 Author: delphij Date: Mon Jun 1 21:07:54 2009 New Revision: 193268 URL: http://svn.freebsd.org/changeset/base/193268 Log: Initialize the match structure. This is unnecessary but gcc insists to complain about it when we raise the WARNS level. Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Mon Jun 1 21:02:40 2009 (r193267) +++ head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Mon Jun 1 21:07:54 2009 (r193268) @@ -516,6 +516,7 @@ expand_macro(struct symbol *macro_symbol const char *body_head; const char *body_pos; const char *next_match; + regmatch_t match = { .rm_so = 0, .rm_eo = 0 }; /* * Due to the nature of unput, we must work @@ -525,8 +526,6 @@ expand_macro(struct symbol *macro_symbol body_head = macro_symbol->info.macroinfo->body; body_pos = body_head + strlen(body_head); while (body_pos > body_head) { - regmatch_t match; - next_match = body_head; match_marg = NULL; next_substitution(macro_symbol, body_pos, &next_match, From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:10:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 964001065747; Mon, 1 Jun 2009 21:10:23 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84FD48FC21; Mon, 1 Jun 2009 21:10:23 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51LANvE092213; Mon, 1 Jun 2009 21:10:23 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51LANuj092212; Mon, 1 Jun 2009 21:10:23 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200906012110.n51LANuj092212@svn.freebsd.org> From: Marko Zec Date: Mon, 1 Jun 2009 21:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193270 - head/sys/dev/cxgb/ulp/tom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:10:24 -0000 Author: zec Date: Mon Jun 1 21:10:23 2009 New Revision: 193270 URL: http://svn.freebsd.org/changeset/base/193270 Log: Update VNET base pointer setting macro to use a correct source of vnet context. Approved by: julian (mentor) Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Mon Jun 1 21:10:19 2009 (r193269) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Mon Jun 1 21:10:23 2009 (r193270) @@ -1219,7 +1219,7 @@ install_offload_ops(struct socket *so) static __inline int select_rcv_wscale(int space, struct vnet *vnet) { - INIT_VNET_INET(so->so_vnet); + INIT_VNET_INET(vnet); int wscale = 0; if (space > MAX_RCV_WND) From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:17:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7988B106564A; Mon, 1 Jun 2009 21:17:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 650FE8FC08; Mon, 1 Jun 2009 21:17:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51LH4HK092469; Mon, 1 Jun 2009 21:17:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51LH3F8092452; Mon, 1 Jun 2009 21:17:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906012117.n51LH3F8092452@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Jun 2009 21:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193272 - in head/sys: dev/cxgb/ulp/iw_cxgb kern netgraph netgraph/bluetooth/socket netinet netsmb nfsclient nfsserver rpc sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:17:04 -0000 Author: jhb Date: Mon Jun 1 21:17:03 2009 New Revision: 193272 URL: http://svn.freebsd.org/changeset/base/193272 Log: Rework socket upcalls to close some races with setup/teardown of upcalls. - Each socket upcall is now invoked with the appropriate socket buffer locked. It is not permissible to call soisconnected() with this lock held; however, so socket upcalls now return an integer value. The two possible values are SU_OK and SU_ISCONNECTED. If an upcall returns SU_ISCONNECTED, then the soisconnected() will be invoked on the socket after the socket buffer lock is dropped. - A new API is provided for setting and clearing socket upcalls. The API consists of soupcall_set() and soupcall_clear(). - To simplify locking, each socket buffer now has a separate upcall. - When a socket upcall returns SU_ISCONNECTED, the upcall is cleared from the receive socket buffer automatically. Note that a SO_SND upcall should never return SU_ISCONNECTED. - All this means that accept filters should now return SU_ISCONNECTED instead of calling soisconnected() directly. They also no longer need to explicitly clear the upcall on the new socket. - The HTTP accept filter still uses soupcall_set() to manage its internal state machine, but other accept filters no longer have any explicit knowlege of socket upcall internals aside from their return value. - The various RPC client upcalls currently drop the socket buffer lock while invoking soreceive() as a temporary band-aid. The plan for the future is to add a new flag to allow soreceive() to be called with the socket buffer locked. - The AIO callback for socket I/O is now also invoked with the socket buffer locked. Previously sowakeup() would drop the socket buffer lock only to call aio_swake() which immediately re-acquired the socket buffer lock for the duration of the function call. Discussed with: rwatson, rmacklem Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/kern/vfs_aio.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/ng_ksocket.c head/sys/netinet/accf_data.c head/sys/netinet/accf_dns.c head/sys/netinet/accf_http.c head/sys/netsmb/smb_trantcp.c head/sys/nfsclient/nfs_socket.c head/sys/nfsserver/nfs.h head/sys/nfsserver/nfs_srvsock.c head/sys/nfsserver/nfs_syscalls.c head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c head/sys/rpc/svc_dg.c head/sys/rpc/svc_vc.c head/sys/sys/sockbuf.h head/sys/sys/socketvar.h Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Mon Jun 1 21:17:03 2009 (r193272) @@ -141,7 +141,7 @@ SYSCTL_UINT(_hw_cxgb, OID_AUTO, cong_fla static void ep_timeout(void *arg); static void connect_reply_upcall(struct iwch_ep *ep, int status); -static void iwch_so_upcall(struct socket *so, void *arg, int waitflag); +static int iwch_so_upcall(struct socket *so, void *arg, int waitflag); /* * Cruft to offload socket upcalls onto thread. @@ -335,9 +335,7 @@ close_socket(struct iwch_ep_common *epc) { CTR4(KTR_IW_CXGB, "%s ep %p so %p state %s", __FUNCTION__, epc, epc->so, states[epc->state]); SOCK_LOCK(epc->so); - epc->so->so_upcall = NULL; - epc->so->so_upcallarg = NULL; - epc->so->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(epc->so, SO_RCV); SOCK_UNLOCK(epc->so); soshutdown(epc->so, SHUT_WR|SHUT_RD); epc->so = NULL; @@ -1108,7 +1106,7 @@ terminate(struct t3cdev *tdev, struct mb { struct toepcb *toep = (struct toepcb *)ctx; struct socket *so = toeptoso(toep); - struct iwch_ep *ep = so->so_upcallarg; + struct iwch_ep *ep = so->so_rcv.sb_upcallarg; CTR2(KTR_IW_CXGB, "%s ep %p", __FUNCTION__, ep); m_adj(m, sizeof(struct cpl_rdma_terminate)); @@ -1129,7 +1127,7 @@ ec_status(struct t3cdev *tdev, struct mb struct iwch_qp_attributes attrs; int release = 0; - ep = so->so_upcallarg; + ep = so->so_rcv.sb_upcallarg; CTR5(KTR_IW_CXGB, "%s ep %p so %p state %s ec_status %d", __FUNCTION__, ep, ep->com.so, states[ep->com.state], rep->status); if (!so || !ep) { panic("bogosity ep %p state %d, so %p state %x\n", ep, ep ? ep->com.state : -1, so, so ? so->so_state : -1); @@ -1309,10 +1307,10 @@ static int init_sock(struct iwch_ep_comm struct sockopt sopt; int on=1; - epc->so->so_upcall = iwch_so_upcall; - epc->so->so_upcallarg = epc; - epc->so->so_rcv.sb_flags |= SB_UPCALL; + SOCK_LOCK(epc->so); + soupcall_set(epc->so, SO_RCV, iwch_so_upcall, epc); epc->so->so_state |= SS_NBIO; + SOCK_UNLOCK(epc->so); sopt.sopt_dir = SOPT_SET; sopt.sopt_level = SOL_SOCKET; sopt.sopt_name = SO_NO_DDP; @@ -1611,10 +1609,8 @@ dequeue_socket(struct socket *head, stru so->so_qstate &= ~SQ_COMP; so->so_head = NULL; soref(so); - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, iwch_so_upcall, child_ep); so->so_state |= SS_NBIO; - so->so_upcall = iwch_so_upcall; - so->so_upcallarg = child_ep; PANIC_IF(!(so->so_state & SS_ISCONNECTED)); PANIC_IF(so->so_error); SOCK_UNLOCK(so); @@ -1661,7 +1657,7 @@ process_newconn(struct iwch_ep *parent_e process_mpa_request(child_ep); } -static void +static int iwch_so_upcall(struct socket *so, void *arg, int waitflag) { struct iwch_ep *ep = arg; @@ -1674,6 +1670,7 @@ iwch_so_upcall(struct socket *so, void * taskqueue_enqueue(iw_cxgb_taskq, &iw_cxgb_task); } mtx_unlock(&req_lock); + return (SU_OK); } static void Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/kern/uipc_sockbuf.c Mon Jun 1 21:17:03 2009 (r193272) @@ -175,6 +175,7 @@ sbunlock(struct sockbuf *sb) void sowakeup(struct socket *so, struct sockbuf *sb) { + int ret; SOCKBUF_LOCK_ASSERT(sb); @@ -186,13 +187,22 @@ sowakeup(struct socket *so, struct sockb wakeup(&sb->sb_cc); } KNOTE_LOCKED(&sb->sb_sel.si_note, 0); + if (sb->sb_upcall != NULL) { + ret = sb->sb_upcall(so, sb->sb_upcallarg, M_DONTWAIT); + if (ret == SU_ISCONNECTED) { + KASSERT(sb == &so->so_rcv, + ("SO_SND upcall returned SU_ISCONNECTED")); + soupcall_clear(so, SO_RCV); + } + } else + ret = SU_OK; + if (sb->sb_flags & SB_AIO) + aio_swake(so, sb); SOCKBUF_UNLOCK(sb); + if (ret == SU_ISCONNECTED) + soisconnected(so); if ((so->so_state & SS_ASYNC) && so->so_sigio != NULL) pgsigio(&so->so_sigio, SIGIO, 0); - if (sb->sb_flags & SB_UPCALL) - (*so->so_upcall)(so, so->so_upcallarg, M_DONTWAIT); - if (sb->sb_flags & SB_AIO) - aio_swake(so, sb); mtx_assert(SOCKBUF_MTX(sb), MA_NOTOWNED); } Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/kern/uipc_socket.c Mon Jun 1 21:17:03 2009 (r193272) @@ -3054,8 +3054,10 @@ soisconnecting(struct socket *so) void soisconnected(struct socket *so) { - struct socket *head; + struct socket *head; + int ret; +restart: ACCEPT_LOCK(); SOCK_LOCK(so); so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING); @@ -3075,13 +3077,17 @@ soisconnected(struct socket *so) wakeup_one(&head->so_timeo); } else { ACCEPT_UNLOCK(); - so->so_upcall = - head->so_accf->so_accept_filter->accf_callback; - so->so_upcallarg = head->so_accf->so_accept_filter_arg; - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, + head->so_accf->so_accept_filter->accf_callback, + head->so_accf->so_accept_filter_arg); so->so_options &= ~SO_ACCEPTFILTER; + ret = head->so_accf->so_accept_filter->accf_callback(so, + head->so_accf->so_accept_filter_arg, M_DONTWAIT); + if (ret == SU_ISCONNECTED) + soupcall_clear(so, SO_RCV); SOCK_UNLOCK(so); - so->so_upcall(so, so->so_upcallarg, M_DONTWAIT); + if (ret == SU_ISCONNECTED) + goto restart; } return; } @@ -3146,6 +3152,57 @@ sodupsockaddr(const struct sockaddr *sa, } /* + * Register per-socket buffer upcalls. + */ +void +soupcall_set(struct socket *so, int which, + int (*func)(struct socket *, void *, int), void *arg) +{ + struct sockbuf *sb; + + switch (which) { + case SO_RCV: + sb = &so->so_rcv; + break; + case SO_SND: + sb = &so->so_snd; + break; + default: + panic("soupcall_set: bad which"); + } + SOCKBUF_LOCK_ASSERT(sb); +#if 0 + /* XXX: accf_http actually wants to do this on purpose. */ + KASSERT(sb->sb_upcall == NULL, ("soupcall_set: overwriting upcall")); +#endif + sb->sb_upcall = func; + sb->sb_upcallarg = arg; + sb->sb_flags |= SB_UPCALL; +} + +void +soupcall_clear(struct socket *so, int which) +{ + struct sockbuf *sb; + + switch (which) { + case SO_RCV: + sb = &so->so_rcv; + break; + case SO_SND: + sb = &so->so_snd; + break; + default: + panic("soupcall_clear: bad which"); + } + SOCKBUF_LOCK_ASSERT(sb); + KASSERT(sb->sb_upcall != NULL, ("soupcall_clear: no upcall to clear")); + sb->sb_upcall = NULL; + sb->sb_upcallarg = NULL; + sb->sb_flags &= ~SB_UPCALL; +} + +/* * Create an external-format (``xsocket'') structure using the information in * the kernel-format socket structure pointed to by so. This is done to * reduce the spew of irrelevant information over this interface, to isolate Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/kern/vfs_aio.c Mon Jun 1 21:17:03 2009 (r193272) @@ -1313,12 +1313,12 @@ aio_swake_cb(struct socket *so, struct s struct aiocblist *cb, *cbn; int opcode; + SOCKBUF_LOCK_ASSERT(sb); if (sb == &so->so_snd) opcode = LIO_WRITE; else opcode = LIO_READ; - SOCKBUF_LOCK(sb); sb->sb_flags &= ~SB_AIO; mtx_lock(&aio_job_mtx); TAILQ_FOREACH_SAFE(cb, &so->so_aiojobq, list, cbn) { @@ -1336,7 +1336,6 @@ aio_swake_cb(struct socket *so, struct s } } mtx_unlock(&aio_job_mtx); - SOCKBUF_UNLOCK(sb); } static int Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Mon Jun 1 21:17:03 2009 (r193272) @@ -93,7 +93,7 @@ MALLOC_DEFINE(M_NETGRAPH_BTSOCKET_RFCOMM #define ALOT 0x7fff /* Local prototypes */ -static void ng_btsocket_rfcomm_upcall +static int ng_btsocket_rfcomm_upcall (struct socket *so, void *arg, int waitflag); static void ng_btsocket_rfcomm_sessions_task (void *ctx, int pending); @@ -1007,7 +1007,7 @@ ng_btsocket_rfcomm_sockaddr(struct socke * Upcall function for L2CAP sockets. Enqueue RFCOMM task. */ -static void +static int ng_btsocket_rfcomm_upcall(struct socket *so, void *arg, int waitflag) { int error; @@ -1018,6 +1018,7 @@ ng_btsocket_rfcomm_upcall(struct socket if ((error = ng_btsocket_rfcomm_task_wakeup()) != 0) NG_BTSOCKET_RFCOMM_ALERT( "%s: Could not enqueue RFCOMM task, error=%d\n", __func__, error); + return (SU_OK); } /* ng_btsocket_rfcomm_upcall */ /* @@ -1047,13 +1048,11 @@ ng_btsocket_rfcomm_sessions_task(void *c panic("%s: DLC list is not empty\n", __func__); /* Close L2CAP socket */ - s->l2so->so_upcallarg = NULL; - s->l2so->so_upcall = NULL; SOCKBUF_LOCK(&s->l2so->so_rcv); - s->l2so->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(s->l2so, SO_RCV); SOCKBUF_UNLOCK(&s->l2so->so_rcv); SOCKBUF_LOCK(&s->l2so->so_snd); - s->l2so->so_snd.sb_flags &= ~SB_UPCALL; + soupcall_clear(s->l2so, SO_SND); SOCKBUF_UNLOCK(&s->l2so->so_snd); soclose(s->l2so); @@ -1286,13 +1285,11 @@ ng_btsocket_rfcomm_session_create(ng_bts LIST_INIT(&s->dlcs); /* Prepare L2CAP socket */ - l2so->so_upcallarg = NULL; - l2so->so_upcall = ng_btsocket_rfcomm_upcall; SOCKBUF_LOCK(&l2so->so_rcv); - l2so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(l2so, SO_RCV, ng_btsocket_rfcomm_upcall, NULL); SOCKBUF_UNLOCK(&l2so->so_rcv); SOCKBUF_LOCK(&l2so->so_snd); - l2so->so_snd.sb_flags |= SB_UPCALL; + soupcall_set(l2so, SO_SND, ng_btsocket_rfcomm_upcall, NULL); SOCKBUF_UNLOCK(&l2so->so_snd); l2so->so_state |= SS_NBIO; s->l2so = l2so; @@ -1370,13 +1367,11 @@ bad: mtx_unlock(&s->session_mtx); /* Return L2CAP socket back to its original state */ - l2so->so_upcallarg = NULL; - l2so->so_upcall = NULL; SOCKBUF_LOCK(&l2so->so_rcv); - l2so->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(s->l2so, SO_RCV); SOCKBUF_UNLOCK(&l2so->so_rcv); SOCKBUF_LOCK(&l2so->so_snd); - l2so->so_snd.sb_flags &= ~SB_UPCALL; + soupcall_clear(s->l2so, SO_SND); SOCKBUF_UNLOCK(&l2so->so_snd); l2so->so_state &= ~SS_NBIO; Modified: head/sys/netgraph/ng_ksocket.c ============================================================================== --- head/sys/netgraph/ng_ksocket.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netgraph/ng_ksocket.c Mon Jun 1 21:17:03 2009 (r193272) @@ -158,7 +158,7 @@ static const struct ng_ksocket_alias ng_ /* Helper functions */ static int ng_ksocket_check_accept(priv_p); static void ng_ksocket_finish_accept(priv_p); -static void ng_ksocket_incoming(struct socket *so, void *arg, int waitflag); +static int ng_ksocket_incoming(struct socket *so, void *arg, int waitflag); static int ng_ksocket_parse(const struct ng_ksocket_alias *aliases, const char *s, int family); static void ng_ksocket_incoming2(node_p node, hook_p hook, @@ -616,13 +616,11 @@ ng_ksocket_connect(hook_p hook) struct socket *const so = priv->so; /* Add our hook for incoming data and other events */ - priv->so->so_upcallarg = (caddr_t)node; - priv->so->so_upcall = ng_ksocket_incoming; SOCKBUF_LOCK(&priv->so->so_rcv); - priv->so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(priv->so, SO_RCV, ng_ksocket_incoming, node); SOCKBUF_UNLOCK(&priv->so->so_rcv); SOCKBUF_LOCK(&priv->so->so_snd); - priv->so->so_snd.sb_flags |= SB_UPCALL; + soupcall_set(priv->so, SO_SND, ng_ksocket_incoming, node); SOCKBUF_UNLOCK(&priv->so->so_snd); SOCK_LOCK(priv->so); priv->so->so_state |= SS_NBIO; @@ -941,12 +939,11 @@ ng_ksocket_shutdown(node_p node) /* Close our socket (if any) */ if (priv->so != NULL) { SOCKBUF_LOCK(&priv->so->so_rcv); - priv->so->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(priv->so, SO_RCV); SOCKBUF_UNLOCK(&priv->so->so_rcv); SOCKBUF_LOCK(&priv->so->so_snd); - priv->so->so_snd.sb_flags &= ~SB_UPCALL; + soupcall_clear(priv->so, SO_SND); SOCKBUF_UNLOCK(&priv->so->so_snd); - priv->so->so_upcall = NULL; soclose(priv->so); priv->so = NULL; } @@ -1000,7 +997,7 @@ ng_ksocket_disconnect(hook_p hook) * To decouple stack, we use queue version of ng_send_fn(). */ -static void +static int ng_ksocket_incoming(struct socket *so, void *arg, int waitflag) { const node_p node = arg; @@ -1017,6 +1014,7 @@ ng_ksocket_incoming(struct socket *so, v ng_send_fn1(node, NULL, &ng_ksocket_incoming2, so, 0, wait)) { atomic_store_rel_int(&priv->fn_sent, 0); } + return (SU_OK); } @@ -1258,13 +1256,11 @@ ng_ksocket_finish_accept(priv_p priv) */ LIST_INSERT_HEAD(&priv->embryos, priv2, siblings); - so->so_upcallarg = (caddr_t)node; - so->so_upcall = ng_ksocket_incoming; SOCKBUF_LOCK(&so->so_rcv); - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, ng_ksocket_incoming, node); SOCKBUF_UNLOCK(&so->so_rcv); SOCKBUF_LOCK(&so->so_snd); - so->so_snd.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, ng_ksocket_incoming, node); SOCKBUF_UNLOCK(&so->so_snd); /* Fill in the response data and send it or return it to the caller */ Modified: head/sys/netinet/accf_data.c ============================================================================== --- head/sys/netinet/accf_data.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netinet/accf_data.c Mon Jun 1 21:17:03 2009 (r193272) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); /* accept filter that holds a socket until data arrives */ -static void sohasdata(struct socket *so, void *arg, int waitflag); +static int sohasdata(struct socket *so, void *arg, int waitflag); static struct accept_filter accf_data_filter = { "dataready", @@ -55,15 +55,12 @@ static moduledata_t accf_data_mod = { DECLARE_MODULE(accf_data, accf_data_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); -static void +static int sohasdata(struct socket *so, void *arg, int waitflag) { if (!soreadable(so)) - return; + return (SU_OK); - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; + return (SU_ISCONNECTED); } Modified: head/sys/netinet/accf_dns.c ============================================================================== --- head/sys/netinet/accf_dns.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netinet/accf_dns.c Mon Jun 1 21:17:03 2009 (r193272) @@ -37,7 +37,7 @@ #include /* check for full DNS request */ -static void sohasdns(struct socket *so, void *arg, int waitflag); +static int sohasdns(struct socket *so, void *arg, int waitflag); struct packet { struct mbuf *m; /* Current mbuf. */ @@ -69,7 +69,7 @@ static moduledata_t accf_dns_mod = { DECLARE_MODULE(accf_dns, accf_dns_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); -static void +static int sohasdns(struct socket *so, void *arg, int waitflag) { struct sockbuf *sb = &so->so_rcv; @@ -80,13 +80,10 @@ sohasdns(struct socket *so, void *arg, i /* Check to see if we have a request. */ if (skippacket(sb) == DNS_WAIT) - return; + return (SU_OK); ready: - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; + return (SU_ISCONNECTED); } #define GET8(p, val) do { \ Modified: head/sys/netinet/accf_http.c ============================================================================== --- head/sys/netinet/accf_http.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netinet/accf_http.c Mon Jun 1 21:17:03 2009 (r193272) @@ -39,11 +39,11 @@ __FBSDID("$FreeBSD$"); #include /* check for GET/HEAD */ -static void sohashttpget(struct socket *so, void *arg, int waitflag); +static int sohashttpget(struct socket *so, void *arg, int waitflag); /* check for HTTP/1.0 or HTTP/1.1 */ -static void soparsehttpvers(struct socket *so, void *arg, int waitflag); +static int soparsehttpvers(struct socket *so, void *arg, int waitflag); /* check for end of HTTP/1.x request */ -static void soishttpconnected(struct socket *so, void *arg, int waitflag); +static int soishttpconnected(struct socket *so, void *arg, int waitflag); /* strcmp on an mbuf chain */ static int mbufstrcmp(struct mbuf *m, struct mbuf *npkt, int offset, char *cmp); /* strncmp on an mbuf chain */ @@ -158,7 +158,7 @@ mbufstrncmp(struct mbuf *m, struct mbuf slen = sizeof(str) - 1; \ } while(0) -static void +static int sohashttpget(struct socket *so, void *arg, int waitflag) { @@ -170,7 +170,7 @@ sohashttpget(struct socket *so, void *ar m = so->so_rcv.sb_mb; cc = so->so_rcv.sb_cc - 1; if (cc < 1) - return; + return (SU_OK); switch (*mtod(m, char *)) { case 'G': STRSETUP(cmp, cmplen, "ET "); @@ -184,7 +184,7 @@ sohashttpget(struct socket *so, void *ar if (cc < cmplen) { if (mbufstrncmp(m, m->m_nextpkt, 1, cc, cmp) == 1) { DPRINT("short cc (%d) but mbufstrncmp ok", cc); - return; + return (SU_OK); } else { DPRINT("short cc (%d) mbufstrncmp failed", cc); goto fallout; @@ -193,23 +193,19 @@ sohashttpget(struct socket *so, void *ar if (mbufstrcmp(m, m->m_nextpkt, 1, cmp) == 1) { DPRINT("mbufstrcmp ok"); if (parse_http_version == 0) - soishttpconnected(so, arg, waitflag); + return (soishttpconnected(so, arg, waitflag)); else - soparsehttpvers(so, arg, waitflag); - return; + return (soparsehttpvers(so, arg, waitflag)); } DPRINT("mbufstrcmp bad"); } fallout: DPRINT("fallout"); - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; + return (SU_ISCONNECTED); } -static void +static int soparsehttpvers(struct socket *so, void *arg, int waitflag) { struct mbuf *m, *n; @@ -261,10 +257,9 @@ soparsehttpvers(struct socket *so, void } else if ( mbufstrcmp(m, n, i, "HTTP/1.0") || mbufstrcmp(m, n, i, "HTTP/1.1")) { - DPRINT("ok"); - soishttpconnected(so, - arg, waitflag); - return; + DPRINT("ok"); + return (soishttpconnected(so, + arg, waitflag)); } else { DPRINT("bad"); goto fallout; @@ -279,22 +274,18 @@ readmore: * if we hit here we haven't hit something * we don't understand or a newline, so try again */ - so->so_upcall = soparsehttpvers; - so->so_rcv.sb_flags |= SB_UPCALL; - return; + soupcall_set(so, SO_RCV, soparsehttpvers, arg); + return (SU_OK); fallout: DPRINT("fallout"); - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; + return (SU_ISCONNECTED); } #define NCHRS 3 -static void +static int soishttpconnected(struct socket *so, void *arg, int waitflag) { char a, b, c; @@ -350,13 +341,9 @@ soishttpconnected(struct socket *so, voi } readmore: - so->so_upcall = soishttpconnected; - so->so_rcv.sb_flags |= SB_UPCALL; - return; + soupcall_set(so, SO_RCV, soishttpconnected, arg); + return (SU_OK); gotit: - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; + return (SU_ISCONNECTED); } Modified: head/sys/netsmb/smb_trantcp.c ============================================================================== --- head/sys/netsmb/smb_trantcp.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netsmb/smb_trantcp.c Mon Jun 1 21:17:03 2009 (r193272) @@ -100,14 +100,15 @@ nb_intr(struct nbpcb *nbp, struct proc * return 0; } -static void +static int nb_upcall(struct socket *so, void *arg, int waitflag) { struct nbpcb *nbp = arg; if (arg == NULL || nbp->nbp_selectid == NULL) - return; + return (SU_OK); wakeup(nbp->nbp_selectid); + return (SU_OK); } static int @@ -152,10 +153,8 @@ nb_connect_in(struct nbpcb *nbp, struct if (error) return error; nbp->nbp_tso = so; - so->so_upcallarg = (caddr_t)nbp; - so->so_upcall = nb_upcall; SOCKBUF_LOCK(&so->so_rcv); - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, nb_upcall, nbp); SOCKBUF_UNLOCK(&so->so_rcv); so->so_rcv.sb_timeo = (5 * hz); so->so_snd.sb_timeo = (5 * hz); Modified: head/sys/nfsclient/nfs_socket.c ============================================================================== --- head/sys/nfsclient/nfs_socket.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/nfsclient/nfs_socket.c Mon Jun 1 21:17:03 2009 (r193272) @@ -122,8 +122,8 @@ static int nfs_realign(struct mbuf **pm, static int nfs_reply(struct nfsreq *); static void nfs_softterm(struct nfsreq *rep); static int nfs_reconnect(struct nfsreq *rep); -static void nfs_clnt_tcp_soupcall(struct socket *so, void *arg, int waitflag); -static void nfs_clnt_udp_soupcall(struct socket *so, void *arg, int waitflag); +static int nfs_clnt_tcp_soupcall(struct socket *so, void *arg, int waitflag); +static int nfs_clnt_udp_soupcall(struct socket *so, void *arg, int waitflag); extern struct mtx nfs_reqq_mtx; @@ -457,12 +457,10 @@ nfs_connect(struct nfsmount *nmp, struct goto bad; SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_flags |= SB_NOINTR; - so->so_upcallarg = (caddr_t)nmp; if (so->so_type == SOCK_STREAM) - so->so_upcall = nfs_clnt_tcp_soupcall; - else - so->so_upcall = nfs_clnt_udp_soupcall; - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, nfs_clnt_tcp_soupcall, nmp); + else + soupcall_set(so, SO_RCV, nfs_clnt_udp_soupcall, nmp); SOCKBUF_UNLOCK(&so->so_rcv); SOCKBUF_LOCK(&so->so_snd); so->so_snd.sb_flags |= SB_NOINTR; @@ -600,9 +598,7 @@ nfs_disconnect(struct nfsmount *nmp) nmp->nm_so = NULL; mtx_unlock(&nmp->nm_mtx); SOCKBUF_LOCK(&so->so_rcv); - so->so_upcallarg = NULL; - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(so, SO_RCV); SOCKBUF_UNLOCK(&so->so_rcv); soshutdown(so, SHUT_WR); soclose(so); @@ -811,7 +807,7 @@ tryagain: * XXX TO DO * Make nfs_realign() non-blocking. Also make nfsm_dissect() nonblocking. */ -static void +static int nfs_clnt_match_xid(struct socket *so, struct nfsmount *nmp, struct mbuf *mrep) @@ -928,11 +924,10 @@ nfstcp_readable(struct socket *so, int b { int retval; - SOCKBUF_LOCK(&so->so_rcv); + SOCKBUF_LOCK_ASSERT(&so->so_rcv); retval = (so->so_rcv.sb_cc >= (bytes) || (so->so_rcv.sb_state & SBS_CANTRCVMORE) || so->so_error); - SOCKBUF_UNLOCK(&so->so_rcv); return (retval); } @@ -969,7 +964,7 @@ nfs_clnt_tcp_soupcall(struct socket *so, mtx_lock(&nmp->nm_mtx); if (nmp->nm_nfstcpstate.flags & NFS_TCP_FORCE_RECONNECT) { mtx_unlock(&nmp->nm_mtx); - return; + return (SU_OK); } else mtx_unlock(&nmp->nm_mtx); auio.uio_td = curthread; @@ -983,8 +978,9 @@ nfs_clnt_tcp_soupcall(struct socket *so, mtx_unlock(&nmp->nm_mtx); if (!nfstcp_marker_readable(so)) { /* Marker is not readable */ - return; + return (SU_OK); } + SOCKBUF_UNLOCK(&so->so_rcv); auio.uio_resid = sizeof(u_int32_t); auio.uio_iov = NULL; auio.uio_iovcnt = 0; @@ -992,6 +988,7 @@ nfs_clnt_tcp_soupcall(struct socket *so, rcvflg = (MSG_DONTWAIT | MSG_SOCALLBCK); error = soreceive(so, (struct sockaddr **)0, &auio, &mp, (struct mbuf **)0, &rcvflg); + SOCKBUF_LOCK(&so->so_rcv); /* * We've already tested that the socket is readable. 2 cases * here, we either read 0 bytes (client closed connection), @@ -1052,8 +1049,9 @@ nfs_clnt_tcp_soupcall(struct socket *so, mtx_unlock(&nmp->nm_mtx); if (!nfstcp_readable(so, nmp->nm_nfstcpstate.rpcresid)) { /* All data not readable */ - return; + return (SU_OK); } + SOCKBUF_UNLOCK(&so->so_rcv); auio.uio_resid = nmp->nm_nfstcpstate.rpcresid; auio.uio_iov = NULL; auio.uio_iovcnt = 0; @@ -1061,6 +1059,7 @@ nfs_clnt_tcp_soupcall(struct socket *so, rcvflg = (MSG_DONTWAIT | MSG_SOCALLBCK); error = soreceive(so, (struct sockaddr **)0, &auio, &mp, (struct mbuf **)0, &rcvflg); + SOCKBUF_LOCK(&so->so_rcv); if (error || auio.uio_resid > 0) { if (error && error != ECONNRESET) { log(LOG_ERR, @@ -1083,6 +1082,7 @@ nfs_clnt_tcp_soupcall(struct socket *so, mark_reconnect: nfs_mark_for_reconnect(nmp); + return (SU_OK); } static void @@ -1094,6 +1094,7 @@ nfs_clnt_udp_soupcall(struct socket *so, struct mbuf *control = NULL; int error, rcvflag; + SOCKBUF_UNLOCK(&so->so_rcv); auio.uio_resid = 1000000; auio.uio_td = curthread; rcvflag = MSG_DONTWAIT; @@ -1106,6 +1107,8 @@ nfs_clnt_udp_soupcall(struct socket *so, if (mp) nfs_clnt_match_xid(so, nmp, mp); } while (mp && !error); + SOCKBUF_LOCK(&so->so_rcv); + return (SU_OK); } /* Modified: head/sys/nfsserver/nfs.h ============================================================================== --- head/sys/nfsserver/nfs.h Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/nfsserver/nfs.h Mon Jun 1 21:17:03 2009 (r193272) @@ -367,7 +367,7 @@ void nfsrv_timer(void *); int nfsrv_getcache(struct nfsrv_descript *, struct mbuf **); void nfsrv_updatecache(struct nfsrv_descript *, int, struct mbuf *); void nfsrv_cleancache(void); -void nfsrv_rcv(struct socket *so, void *arg, int waitflag); +int nfsrv_rcv(struct socket *so, void *arg, int waitflag); void nfsrv_slpderef(struct nfssvc_sock *slp); void nfsrv_wakenfsd(struct nfssvc_sock *slp); int nfsrv_writegather(struct nfsrv_descript **, struct nfssvc_sock *, Modified: head/sys/nfsserver/nfs_srvsock.c ============================================================================== --- head/sys/nfsserver/nfs_srvsock.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/nfsserver/nfs_srvsock.c Mon Jun 1 21:17:03 2009 (r193272) @@ -406,7 +406,7 @@ nfsmout: * Essentially do as much as possible non-blocking, else punt and it will * be called with M_WAIT from an nfsd. */ -void +int nfsrv_rcv(struct socket *so, void *arg, int waitflag) { struct nfssvc_sock *slp = (struct nfssvc_sock *)arg; @@ -420,7 +420,7 @@ nfsrv_rcv(struct socket *so, void *arg, /* XXXRW: Unlocked read. */ if ((slp->ns_flag & SLP_VALID) == 0) - return; + return (SU_OK); /* * We can't do this in the context of a socket callback Modified: head/sys/nfsserver/nfs_syscalls.c ============================================================================== --- head/sys/nfsserver/nfs_syscalls.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/nfsserver/nfs_syscalls.c Mon Jun 1 21:17:03 2009 (r193272) @@ -263,11 +263,11 @@ nfssvc_addsock(struct file *fp, struct s slp->ns_nam = mynam; fhold(fp); slp->ns_fp = fp; + NFSD_UNLOCK(); SOCKBUF_LOCK(&so->so_rcv); - so->so_upcallarg = (caddr_t)slp; - so->so_upcall = nfsrv_rcv; - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, nfsrv_rcv, slp); SOCKBUF_UNLOCK(&so->so_rcv); + NFSD_LOCK(); slp->ns_flag = (SLP_VALID | SLP_NEEDQ); nfsrv_wakenfsd(slp); NFSD_UNLOCK(); @@ -585,9 +585,7 @@ nfsrv_zapsock(struct nfssvc_sock *slp) slp->ns_fp = NULL; so = slp->ns_so; SOCKBUF_LOCK(&so->so_rcv); - so->so_rcv.sb_flags &= ~SB_UPCALL; - so->so_upcall = NULL; - so->so_upcallarg = NULL; + soupcall_clear(so, SO_RCV); SOCKBUF_UNLOCK(&so->so_rcv); soshutdown(so, SHUT_RDWR); closef(fp, NULL); Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/rpc/clnt_dg.c Mon Jun 1 21:17:03 2009 (r193272) @@ -79,7 +79,7 @@ static void clnt_dg_abort(CLIENT *); static bool_t clnt_dg_control(CLIENT *, u_int, void *); static void clnt_dg_close(CLIENT *); static void clnt_dg_destroy(CLIENT *); -static void clnt_dg_soupcall(struct socket *so, void *arg, int waitflag); +static int clnt_dg_soupcall(struct socket *so, void *arg, int waitflag); static struct clnt_ops clnt_dg_ops = { .cl_call = clnt_dg_call, @@ -112,7 +112,7 @@ TAILQ_HEAD(cu_request_list, cu_request); #define MCALL_MSG_SIZE 24 /* - * This structure is pointed to by the socket's so_upcallarg + * This structure is pointed to by the socket buffer's sb_upcallarg * member. It is separate from the client private data to facilitate * multiple clients sharing the same socket. The cs_lock mutex is used * to protect all fields of this structure, the socket's receive @@ -183,6 +183,7 @@ clnt_dg_create( CLIENT *cl = NULL; /* client handle */ struct cu_data *cu = NULL; /* private data */ struct cu_socket *cs = NULL; + struct sockbuf *sb; struct timeval now; struct rpc_msg call_msg; struct __rpc_sockinfo si; @@ -260,15 +261,16 @@ clnt_dg_create( cu->cu_socket = so; soreserve(so, 256*1024, 256*1024); + sb = &so->so_rcv; SOCKBUF_LOCK(&so->so_rcv); recheck_socket: - if (so->so_upcall) { - if (so->so_upcall != clnt_dg_soupcall) { + if (sb->sb_upcall) { + if (sb->sb_upcall != clnt_dg_soupcall) { SOCKBUF_UNLOCK(&so->so_rcv); printf("clnt_dg_create(): socket already has an incompatible upcall\n"); goto err2; } - cs = (struct cu_socket *) so->so_upcallarg; + cs = (struct cu_socket *) sb->sb_upcallarg; mtx_lock(&cs->cs_lock); cs->cs_refs++; mtx_unlock(&cs->cs_lock); @@ -277,10 +279,10 @@ recheck_socket: * We are the first on this socket - allocate the * structure and install it in the socket. */ - SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); + SOCKBUF_UNLOCK(&so->so_rcv); cs = mem_alloc(sizeof(*cs)); - SOCKBUF_LOCK(&cu->cu_socket->so_rcv); - if (so->so_upcall) { + SOCKBUF_LOCK(&so->so_rcv); + if (sb->sb_upcall) { /* * We have lost a race with some other client. */ @@ -290,9 +292,7 @@ recheck_socket: mtx_init(&cs->cs_lock, "cs->cs_lock", NULL, MTX_DEF); cs->cs_refs = 1; TAILQ_INIT(&cs->cs_pending); - so->so_upcallarg = cs; - so->so_upcall = clnt_dg_soupcall; - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, clnt_dg_soupcall, cs); } SOCKBUF_UNLOCK(&so->so_rcv); @@ -322,7 +322,7 @@ clnt_dg_call( struct timeval utimeout) /* seconds to wait before giving up */ { struct cu_data *cu = (struct cu_data *)cl->cl_private; - struct cu_socket *cs = (struct cu_socket *) cu->cu_socket->so_upcallarg; + struct cu_socket *cs; struct rpc_timers *rt; AUTH *auth; struct rpc_err *errp; @@ -343,6 +343,7 @@ clnt_dg_call( struct cu_request *cr; int error; + cs = cu->cu_socket->so_rcv.sb_upcallarg; cr = malloc(sizeof(struct cu_request), M_RPC, M_WAITOK); mtx_lock(&cs->cs_lock); @@ -797,9 +798,10 @@ static bool_t clnt_dg_control(CLIENT *cl, u_int request, void *info) { struct cu_data *cu = (struct cu_data *)cl->cl_private; - struct cu_socket *cs = (struct cu_socket *) cu->cu_socket->so_upcallarg; + struct cu_socket *cs; struct sockaddr *addr; + cs = cu->cu_socket->so_rcv.sb_upcallarg; mtx_lock(&cs->cs_lock); switch (request) { @@ -929,9 +931,10 @@ static void clnt_dg_close(CLIENT *cl) { struct cu_data *cu = (struct cu_data *)cl->cl_private; - struct cu_socket *cs = (struct cu_socket *) cu->cu_socket->so_upcallarg; + struct cu_socket *cs; struct cu_request *cr; + cs = cu->cu_socket->so_rcv.sb_upcallarg; mtx_lock(&cs->cs_lock); if (cu->cu_closed) { @@ -974,10 +977,11 @@ static void clnt_dg_destroy(CLIENT *cl) { struct cu_data *cu = (struct cu_data *)cl->cl_private; - struct cu_socket *cs = (struct cu_socket *) cu->cu_socket->so_upcallarg; + struct cu_socket *cs; struct socket *so = NULL; bool_t lastsocketref; + cs = cu->cu_socket->so_rcv.sb_upcallarg; clnt_dg_close(cl); mtx_lock(&cs->cs_lock); @@ -986,9 +990,7 @@ clnt_dg_destroy(CLIENT *cl) if (cs->cs_refs == 0) { mtx_destroy(&cs->cs_lock); SOCKBUF_LOCK(&cu->cu_socket->so_rcv); - cu->cu_socket->so_upcallarg = NULL; - cu->cu_socket->so_upcall = NULL; - cu->cu_socket->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(cu->cu_socket, SO_RCV); SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); mem_free(cs, sizeof(*cs)); lastsocketref = TRUE; @@ -1023,7 +1025,7 @@ time_not_ok(struct timeval *t) t->tv_usec < -1 || t->tv_usec > 1000000); } -void +int clnt_dg_soupcall(struct socket *so, void *arg, int waitflag) { struct cu_socket *cs = (struct cu_socket *) arg; @@ -1037,12 +1039,14 @@ clnt_dg_soupcall(struct socket *so, void uio.uio_resid = 1000000000; uio.uio_td = curthread; do { + SOCKBUF_UNLOCK(&so->so_rcv); m = NULL; control = NULL; rcvflag = MSG_DONTWAIT; error = soreceive(so, NULL, &uio, &m, &control, &rcvflag); if (control) m_freem(control); + SOCKBUF_LOCK(&so->so_rcv); if (error == EWOULDBLOCK) break; @@ -1107,5 +1111,6 @@ clnt_dg_soupcall(struct socket *so, void if (!foundreq) m_freem(m); } while (m); + return (SU_OK); } Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/rpc/clnt_vc.c Mon Jun 1 21:17:03 2009 (r193272) @@ -91,7 +91,7 @@ static bool_t clnt_vc_control(CLIENT *, static void clnt_vc_close(CLIENT *); static void clnt_vc_destroy(CLIENT *); static bool_t time_not_ok(struct timeval *); -static void clnt_vc_soupcall(struct socket *so, void *arg, int waitflag); +static int clnt_vc_soupcall(struct socket *so, void *arg, int waitflag); static struct clnt_ops clnt_vc_ops = { .cl_call = clnt_vc_call, @@ -286,9 +286,7 @@ clnt_vc_create( soreserve(ct->ct_socket, sendsz, recvsz); SOCKBUF_LOCK(&ct->ct_socket->so_rcv); - ct->ct_socket->so_upcallarg = ct; - ct->ct_socket->so_upcall = clnt_vc_soupcall; - ct->ct_socket->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(ct->ct_socket, SO_RCV, clnt_vc_soupcall, ct); SOCKBUF_UNLOCK(&ct->ct_socket->so_rcv); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:26:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 189A1106566B; Mon, 1 Jun 2009 21:26:53 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 071768FC08; Mon, 1 Jun 2009 21:26:53 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51LQq5p092707; Mon, 1 Jun 2009 21:26:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51LQqNw092706; Mon, 1 Jun 2009 21:26:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200906012126.n51LQqNw092706@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 1 Jun 2009 21:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193273 - head/usr.sbin/pkg_install/info X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:26:53 -0000 Author: jilles Date: Mon Jun 1 21:26:52 2009 New Revision: 193273 URL: http://svn.freebsd.org/changeset/base/193273 Log: Fix segfault when giving invalid long option to pkg_info. PR: bin/133473 Submitted by: Rafal Grodzinski Approved by: ed (mentor) MFC after: 1 week Modified: head/usr.sbin/pkg_install/info/main.c Modified: head/usr.sbin/pkg_install/info/main.c ============================================================================== --- head/usr.sbin/pkg_install/info/main.c Mon Jun 1 21:17:03 2009 (r193272) +++ head/usr.sbin/pkg_install/info/main.c Mon Jun 1 21:26:52 2009 (r193273) @@ -58,6 +58,7 @@ static struct option longopts[] = { { "verbose", no_argument, NULL, 'v' }, { "version", no_argument, NULL, 'P' }, { "which", required_argument, NULL, 'W' }, + { NULL, 0, NULL, 0 } }; int From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:29:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17CA4106564A; Mon, 1 Jun 2009 21:29:55 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 065F28FC1C; Mon, 1 Jun 2009 21:29:55 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51LTsQU092818; Mon, 1 Jun 2009 21:29:54 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51LTsN7092816; Mon, 1 Jun 2009 21:29:54 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200906012129.n51LTsN7092816@svn.freebsd.org> From: Marko Zec Date: Mon, 1 Jun 2009 21:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193274 - in head/sys: contrib/pf/net netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:29:55 -0000 Author: zec Date: Mon Jun 1 21:29:54 2009 New Revision: 193274 URL: http://svn.freebsd.org/changeset/base/193274 Log: V_loif is not an array but a pure pointer, so treat it as such. Reviewed by: bz Approved by: julian (mentor) Modified: head/sys/contrib/pf/net/pf_ioctl.c head/sys/netinet6/ip6_input.c Modified: head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- head/sys/contrib/pf/net/pf_ioctl.c Mon Jun 1 21:26:52 2009 (r193273) +++ head/sys/contrib/pf/net/pf_ioctl.c Mon Jun 1 21:29:54 2009 (r193274) @@ -3717,7 +3717,7 @@ pf_check6_in(void *arg, struct mbuf **m, * order to support scoped addresses. In order to support stateful * filtering we have change this to lo0 as it is the case in IPv4. */ - chk = pf_test6(PF_IN, (*m)->m_flags & M_LOOP ? &V_loif[0] : ifp, m, + chk = pf_test6(PF_IN, (*m)->m_flags & M_LOOP ? V_loif : ifp, m, NULL, inp); if (chk && *m) { m_freem(*m); Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Mon Jun 1 21:26:52 2009 (r193273) +++ head/sys/netinet6/ip6_input.c Mon Jun 1 21:29:54 2009 (r193274) @@ -380,7 +380,7 @@ ip6_input(struct mbuf *m) #define M2MMAX (sizeof(V_ip6stat.ip6s_m2m)/sizeof(V_ip6stat.ip6s_m2m[0])) if (m->m_next) { if (m->m_flags & M_LOOP) { - V_ip6stat.ip6s_m2m[V_loif[0].if_index]++; /* XXX */ + V_ip6stat.ip6s_m2m[V_loif->if_index]++; } else if (m->m_pkthdr.rcvif->if_index < M2MMAX) V_ip6stat.ip6s_m2m[m->m_pkthdr.rcvif->if_index]++; else From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:32:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10865106566C; Mon, 1 Jun 2009 21:32:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F25D38FC12; Mon, 1 Jun 2009 21:32:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51LWqNE092927; Mon, 1 Jun 2009 21:32:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51LWq2U092924; Mon, 1 Jun 2009 21:32:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906012132.n51LWq2U092924@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Jun 2009 21:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193275 - in head/sys: kern sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:32:53 -0000 Author: jhb Date: Mon Jun 1 21:32:52 2009 New Revision: 193275 URL: http://svn.freebsd.org/changeset/base/193275 Log: Add an extension to the character device interface that allows character device drivers to use arbitrary VM objects to satisfy individual mmap() requests. - A new d_mmap_single(cdev, &foff, objsize, &object, prot) callback is added to cdevsw. This function is called for each mmap() request. If it returns ENODEV, then the mmap() request will fall back to using the device's device pager object and d_mmap(). Otherwise, the method can return a VM object to satisfy this entire mmap() request via *object. It can also modify the starting offset into this object via *foff. This allows device drivers to use the file offset as a cookie to identify specific VM objects. - vm_mmap_vnode() has been changed to call vm_mmap_cdev() directly when mapping V_CHR vnodes. This avoids duplicating all the cdev mmap handling code and simplifies some of vm_mmap_vnode(). - D_VERSION has been bumped to D_VERSION_02. Older device drivers using D_VERSION_01 are still supported. MFC after: 1 month Modified: head/sys/kern/kern_conf.c head/sys/sys/conf.h head/sys/vm/vm_mmap.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Mon Jun 1 21:29:54 2009 (r193274) +++ head/sys/kern/kern_conf.c Mon Jun 1 21:32:52 2009 (r193275) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include static MALLOC_DEFINE(M_DEVT, "cdev", "cdev storage"); @@ -275,6 +276,7 @@ dead_strategy(struct bio *bp) #define dead_dump (dumper_t *)enxio #define dead_kqfilter (d_kqfilter_t *)enxio +#define dead_mmap_single (d_mmap_single_t *)enodev static struct cdevsw dead_cdevsw = { .d_version = D_VERSION, @@ -289,7 +291,8 @@ static struct cdevsw dead_cdevsw = { .d_strategy = dead_strategy, .d_name = "dead", .d_dump = dead_dump, - .d_kqfilter = dead_kqfilter + .d_kqfilter = dead_kqfilter, + .d_mmap_single = dead_mmap_single }; /* Default methods if driver does not specify method */ @@ -301,6 +304,7 @@ static struct cdevsw dead_cdevsw = { #define no_ioctl (d_ioctl_t *)enodev #define no_mmap (d_mmap_t *)enodev #define no_kqfilter (d_kqfilter_t *)enodev +#define no_mmap_single (d_mmap_single_t *)enodev static void no_strategy(struct bio *bp) @@ -480,6 +484,23 @@ giant_mmap(struct cdev *dev, vm_offset_t return (retval); } +static int +giant_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, + vm_object_t *object, int nprot) +{ + struct cdevsw *dsw; + int retval; + + dsw = dev_refthread(dev); + if (dsw == NULL) + return (ENXIO); + mtx_lock(&Giant); + retval = dsw->d_gianttrick->d_mmap_single(dev, offset, size, object, + nprot); + mtx_unlock(&Giant); + dev_relthread(dev); + return (retval); +} static void notify(struct cdev *dev, const char *ev) @@ -569,7 +590,8 @@ prep_cdevsw(struct cdevsw *devsw) return; } - if (devsw->d_version != D_VERSION_01) { + if (devsw->d_version != D_VERSION_01 && + devsw->d_version != D_VERSION_02) { printf( "WARNING: Device driver \"%s\" has wrong version %s\n", devsw->d_name == NULL ? "???" : devsw->d_name, @@ -585,6 +607,8 @@ prep_cdevsw(struct cdevsw *devsw) devsw->d_dump = dead_dump; devsw->d_kqfilter = dead_kqfilter; } + if (devsw->d_version == D_VERSION_01) + devsw->d_mmap_single = NULL; if (devsw->d_flags & D_NEEDGIANT) { if (devsw->d_gianttrick == NULL) { @@ -613,6 +637,7 @@ prep_cdevsw(struct cdevsw *devsw) FIXUP(d_mmap, no_mmap, giant_mmap); FIXUP(d_strategy, no_strategy, giant_strategy); FIXUP(d_kqfilter, no_kqfilter, giant_kqfilter); + FIXUP(d_mmap_single, no_mmap_single, giant_mmap_single); if (devsw->d_dump == NULL) devsw->d_dump = no_dump; Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Mon Jun 1 21:29:54 2009 (r193274) +++ head/sys/sys/conf.h Mon Jun 1 21:32:52 2009 (r193275) @@ -103,6 +103,7 @@ struct thread; struct uio; struct knote; struct clonedevs; +struct vm_object; struct vnode; /* @@ -136,6 +137,8 @@ typedef int d_poll_t(struct cdev *dev, i typedef int d_kqfilter_t(struct cdev *dev, struct knote *kn); typedef int d_mmap_t(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot); +typedef int d_mmap_single_t(struct cdev *cdev, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **object, int nprot); typedef void d_purge_t(struct cdev *dev); typedef int d_spare2_t(struct cdev *dev); @@ -175,7 +178,8 @@ typedef int dumper_t( */ #define D_VERSION_00 0x20011966 #define D_VERSION_01 0x17032005 /* Add d_uid,gid,mode & kind */ -#define D_VERSION D_VERSION_01 +#define D_VERSION_02 0x28042009 /* Add d_mmap_single */ +#define D_VERSION D_VERSION_02 /* * Flags used for internal housekeeping @@ -201,7 +205,7 @@ struct cdevsw { dumper_t *d_dump; d_kqfilter_t *d_kqfilter; d_purge_t *d_purge; - d_spare2_t *d_spare2; + d_mmap_single_t *d_mmap_single; uid_t d_uid; gid_t d_gid; mode_t d_mode; Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Jun 1 21:29:54 2009 (r193274) +++ head/sys/vm/vm_mmap.c Mon Jun 1 21:32:52 2009 (r193275) @@ -117,9 +117,9 @@ vmmapentry_rsrc_init(dummy) } static int vm_mmap_vnode(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, - int *, struct vnode *, vm_ooffset_t, vm_object_t *); + int *, struct vnode *, vm_ooffset_t *, vm_object_t *); static int vm_mmap_cdev(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, - int *, struct cdev *, vm_ooffset_t, vm_object_t *); + int *, struct cdev *, vm_ooffset_t *, vm_object_t *); static int vm_mmap_shm(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, int *, struct shmfd *, vm_ooffset_t, vm_object_t *); @@ -1142,15 +1142,14 @@ munlock(td, uap) int vm_mmap_vnode(struct thread *td, vm_size_t objsize, vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp, - struct vnode *vp, vm_ooffset_t foff, vm_object_t *objp) + struct vnode *vp, vm_ooffset_t *foffp, vm_object_t *objp) { struct vattr va; - void *handle; vm_object_t obj; + vm_offset_t foff; struct mount *mp; - struct cdevsw *dsw; struct ucred *cred; - int error, flags, type; + int error, flags; int vfslocked; mp = vp->v_mount; @@ -1160,6 +1159,7 @@ vm_mmap_vnode(struct thread *td, vm_size VFS_UNLOCK_GIANT(vfslocked); return (error); } + foff = *foffp; flags = *flagsp; obj = vp->v_object; if (vp->v_type == VREG) { @@ -1175,41 +1175,12 @@ vm_mmap_vnode(struct thread *td, vm_size vp = (struct vnode*)obj->handle; vget(vp, LK_SHARED, td); } - type = OBJT_VNODE; - handle = vp; } else if (vp->v_type == VCHR) { - type = OBJT_DEVICE; - handle = vp->v_rdev; - - dsw = dev_refthread(handle); - if (dsw == NULL) { - error = ENXIO; - goto done; - } - if (dsw->d_flags & D_MMAP_ANON) { - dev_relthread(handle); - *maxprotp = VM_PROT_ALL; - *flagsp |= MAP_ANON; - error = 0; - goto done; - } - dev_relthread(handle); - /* - * cdevs does not provide private mappings of any kind. - */ - if ((*maxprotp & VM_PROT_WRITE) == 0 && - (prot & PROT_WRITE) != 0) { - error = EACCES; - goto done; - } - if (flags & (MAP_PRIVATE|MAP_COPY)) { - error = EINVAL; - goto done; - } - /* - * Force device mappings to be shared. - */ - flags |= MAP_SHARED; + error = vm_mmap_cdev(td, objsize, prot, maxprotp, flagsp, + vp->v_rdev, foffp, objp); + if (error == 0) + goto mark_atime; + goto done; } else { error = EINVAL; goto done; @@ -1235,18 +1206,18 @@ vm_mmap_vnode(struct thread *td, vm_size * we do not need to sync it. * Adjust object size to be the size of actual file. */ - if (vp->v_type == VREG) { - objsize = round_page(va.va_size); - if (va.va_nlink == 0) - flags |= MAP_NOSYNC; - } - obj = vm_pager_allocate(type, handle, objsize, prot, foff); + objsize = round_page(va.va_size); + if (va.va_nlink == 0) + flags |= MAP_NOSYNC; + obj = vm_pager_allocate(OBJT_VNODE, vp, objsize, prot, foff); if (obj == NULL) { - error = (type == OBJT_DEVICE ? EINVAL : ENOMEM); + error = ENOMEM; goto done; } *objp = obj; *flagsp = flags; + +mark_atime: vfs_mark_atime(vp, cred); done: @@ -1266,11 +1237,11 @@ done: int vm_mmap_cdev(struct thread *td, vm_size_t objsize, vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp, - struct cdev *cdev, vm_ooffset_t foff, vm_object_t *objp) + struct cdev *cdev, vm_ooffset_t *foff, vm_object_t *objp) { vm_object_t obj; struct cdevsw *dsw; - int flags; + int error, flags; flags = *flagsp; @@ -1283,25 +1254,43 @@ vm_mmap_cdev(struct thread *td, vm_size_ *flagsp |= MAP_ANON; return (0); } - dev_relthread(cdev); /* - * cdevs does not provide private mappings of any kind. + * cdevs do not provide private mappings of any kind. */ if ((*maxprotp & VM_PROT_WRITE) == 0 && - (prot & PROT_WRITE) != 0) + (prot & PROT_WRITE) != 0) { + dev_relthread(cdev); return (EACCES); - if (flags & (MAP_PRIVATE|MAP_COPY)) + } + if (flags & (MAP_PRIVATE|MAP_COPY)) { + dev_relthread(cdev); return (EINVAL); + } /* * Force device mappings to be shared. */ flags |= MAP_SHARED; #ifdef MAC_XXX - error = mac_check_cdev_mmap(td->td_ucred, cdev, prot); - if (error != 0) + error = mac_cdev_check_mmap(td->td_ucred, cdev, prot); + if (error != 0) { + dev_relthread(cdev); return (error); + } #endif - obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, foff); + /* + * First, try d_mmap_single(). If that is not implemented + * (returns ENODEV), fall back to using the device pager. + * Note that d_mmap_single() must return a reference to the + * object (it needs to bump the reference count of the object + * it returns somehow). + * + * XXX assumes VM_PROT_* == PROT_* + */ + error = dsw->d_mmap_single(cdev, foff, objsize, objp, (int)prot); + dev_relthread(cdev); + if (error != ENODEV) + return (error); + obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff); if (obj == NULL) return (EINVAL); *objp = obj; @@ -1396,11 +1385,11 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, switch (handle_type) { case OBJT_DEVICE: error = vm_mmap_cdev(td, size, prot, &maxprot, &flags, - handle, foff, &object); + handle, &foff, &object); break; case OBJT_VNODE: error = vm_mmap_vnode(td, size, prot, &maxprot, &flags, - handle, foff, &object); + handle, &foff, &object); break; case OBJT_SWAP: error = vm_mmap_shm(td, size, prot, &maxprot, &flags, From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:36:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8B07106566B; Mon, 1 Jun 2009 21:36:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id AB52F8FC20; Mon, 1 Jun 2009 21:36:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4F3C546B2D; Mon, 1 Jun 2009 17:36:01 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 651B08A029; Mon, 1 Jun 2009 17:36:00 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Mon, 1 Jun 2009 17:34:06 -0400 User-Agent: KMail/1.9.7 References: <200906012117.n51LH3F8092452@svn.freebsd.org> In-Reply-To: <200906012117.n51LH3F8092452@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906011734.06721.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 01 Jun 2009 17:36:00 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r193272 - in head/sys: dev/cxgb/ulp/iw_cxgb kern netgraph netgraph/bluetooth/socket netinet netsmb nfsclient nfsserver rpc sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:36:02 -0000 On Monday 01 June 2009 5:17:03 pm John Baldwin wrote: > Author: jhb > Date: Mon Jun 1 21:17:03 2009 > New Revision: 193272 > URL: http://svn.freebsd.org/changeset/base/193272 > > Log: > Rework socket upcalls to close some races with setup/teardown of upcalls. > - The various RPC client upcalls currently drop the socket buffer lock > while invoking soreceive() as a temporary band-aid. The plan for > the future is to add a new flag to allow soreceive() to be called with > the socket buffer locked. Hopefully once this last bit is done, the various panics people have seen with the new NFS code in 8 will be fixed as they all seem to be due to races between socket upcall teardown and socket upcall invocations. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:42:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0DC6106564A; Mon, 1 Jun 2009 21:42:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF94F8FC19; Mon, 1 Jun 2009 21:42:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51LgQBu093223; Mon, 1 Jun 2009 21:42:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51LgQrU093221; Mon, 1 Jun 2009 21:42:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200906012142.n51LgQrU093221@svn.freebsd.org> From: Alexander Motin Date: Mon, 1 Jun 2009 21:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193277 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:42:27 -0000 Author: mav Date: Mon Jun 1 21:42:26 2009 New Revision: 193277 URL: http://svn.freebsd.org/changeset/base/193277 Log: MFp4. Log supported AHCI controller capabilities. Modified: head/sys/dev/ata/ata-all.h head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Mon Jun 1 21:38:44 2009 (r193276) +++ head/sys/dev/ata/ata-all.h Mon Jun 1 21:42:26 2009 (r193277) @@ -149,11 +149,26 @@ /* SATA AHCI v1.0 register defines */ #define ATA_AHCI_CAP 0x00 #define ATA_AHCI_CAP_NPMASK 0x0000001f +#define ATA_AHCI_CAP_SXS 0x00000020 +#define ATA_AHCI_CAP_EMS 0x00000040 +#define ATA_AHCI_CAP_CCCS 0x00000080 +#define ATA_AHCI_CAP_NCS 0x00001F00 +#define ATA_AHCI_CAP_NCS_SHIFT 8 #define ATA_AHCI_CAP_PSC 0x00002000 #define ATA_AHCI_CAP_SSC 0x00004000 +#define ATA_AHCI_CAP_PMD 0x00008000 +#define ATA_AHCI_CAP_FBSS 0x00010000 #define ATA_AHCI_CAP_SPM 0x00020000 -#define ATA_AHCI_CAP_CLO 0x01000000 +#define ATA_AHCI_CAP_SAM 0x00080000 +#define ATA_AHCI_CAP_ISS 0x00F00000 +#define ATA_AHCI_CAP_ISS_SHIFT 20 +#define ATA_AHCI_CAP_SCLO 0x01000000 +#define ATA_AHCI_CAP_SAL 0x02000000 #define ATA_AHCI_CAP_SALP 0x04000000 +#define ATA_AHCI_CAP_SSS 0x08000000 +#define ATA_AHCI_CAP_SMPS 0x10000000 +#define ATA_AHCI_CAP_SSNTF 0x20000000 +#define ATA_AHCI_CAP_SNCQ 0x40000000 #define ATA_AHCI_CAP_64BIT 0x80000000 #define ATA_AHCI_GHC 0x04 Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Mon Jun 1 21:38:44 2009 (r193276) +++ head/sys/dev/ata/chipsets/ata-ahci.c Mon Jun 1 21:42:26 2009 (r193277) @@ -101,8 +101,8 @@ int ata_ahci_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - int error; - u_int32_t version; + int error, speed; + u_int32_t caps, version; /* if we have a memory BAR(5) we are likely on an AHCI part */ ctlr->r_type2 = SYS_RES_MEMORY; @@ -142,16 +142,45 @@ ata_ahci_chipinit(device_t dev) ctlr->suspend = ata_ahci_suspend; ctlr->resume = ata_ahci_ctlr_reset; - /* announce we support the HW */ - version = ATA_INL(ctlr->r_res2, ATA_AHCI_VS); - device_printf(dev, - "AHCI Version %x%x.%x%x controller with %d ports PM %s\n", - (version >> 24) & 0xff, (version >> 16) & 0xff, - (version >> 8) & 0xff, version & 0xff, - (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_NPMASK) + 1, - (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) ? - "supported" : "not supported"); - return 0; + /* announce we support the HW */ + version = ATA_INL(ctlr->r_res2, ATA_AHCI_VS); + caps = ATA_INL(ctlr->r_res2, ATA_AHCI_CAP); + speed = (caps & ATA_AHCI_CAP_ISS) >> ATA_AHCI_CAP_ISS_SHIFT; + device_printf(dev, + "AHCI v%x.%02x controller with %d %sGbps ports, PM %s\n", + ((version >> 20) & 0xf0) + ((version >> 16) & 0x0f), + ((version >> 4) & 0xf0) + (version & 0x0f), + (caps & ATA_AHCI_CAP_NPMASK) + 1, + ((speed == 1) ? "1.5":((speed == 2) ? "3": + ((speed == 3) ? "6":"?"))), + (caps & ATA_AHCI_CAP_SPM) ? + "supported" : "not supported"); + if (bootverbose) { + device_printf(dev, "Caps:%s%s%s%s%s%s%s%s %sGbps", + (caps & ATA_AHCI_CAP_64BIT) ? " 64bit":"", + (caps & ATA_AHCI_CAP_SNCQ) ? " NCQ":"", + (caps & ATA_AHCI_CAP_SSNTF) ? " SNTF":"", + (caps & ATA_AHCI_CAP_SMPS) ? " MPS":"", + (caps & ATA_AHCI_CAP_SSS) ? " SS":"", + (caps & ATA_AHCI_CAP_SALP) ? " ALP":"", + (caps & ATA_AHCI_CAP_SAL) ? " AL":"", + (caps & ATA_AHCI_CAP_SCLO) ? " CLO":"", + ((speed == 1) ? "1.5":((speed == 2) ? "3": + ((speed == 3) ? "6":"?")))); + printf("%s%s%s%s%s%s %dcmd%s%s%s %dports\n", + (caps & ATA_AHCI_CAP_SAM) ? " AM":"", + (caps & ATA_AHCI_CAP_SPM) ? " PM":"", + (caps & ATA_AHCI_CAP_FBSS) ? " FBS":"", + (caps & ATA_AHCI_CAP_PMD) ? " PMD":"", + (caps & ATA_AHCI_CAP_SSC) ? " SSC":"", + (caps & ATA_AHCI_CAP_PSC) ? " PSC":"", + ((caps & ATA_AHCI_CAP_NCS) >> ATA_AHCI_CAP_NCS_SHIFT) + 1, + (caps & ATA_AHCI_CAP_CCCS) ? " CCC":"", + (caps & ATA_AHCI_CAP_EMS) ? " EM":"", + (caps & ATA_AHCI_CAP_SXS) ? " eSATA":"", + (caps & ATA_AHCI_CAP_NPMASK) + 1); + } + return 0; } int @@ -625,7 +654,7 @@ ata_ahci_clo(device_t dev) int timeout; /* issue Command List Override if supported */ - if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_CLO) { + if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SCLO) { cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); cmd |= ATA_AHCI_P_CMD_CLO; ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, cmd); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:54:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B56B2106566B; Mon, 1 Jun 2009 21:54:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A44BE8FC14; Mon, 1 Jun 2009 21:54:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51LsMJO093528; Mon, 1 Jun 2009 21:54:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51LsMA7093527; Mon, 1 Jun 2009 21:54:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906012154.n51LsMA7093527@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Jun 2009 21:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193278 - head/sys/dev/ksyms X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:54:23 -0000 Author: jhb Date: Mon Jun 1 21:54:22 2009 New Revision: 193278 URL: http://svn.freebsd.org/changeset/base/193278 Log: Remove another d_thread_t use that crept in. Modified: head/sys/dev/ksyms/ksyms.c Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Mon Jun 1 21:42:26 2009 (r193277) +++ head/sys/dev/ksyms/ksyms.c Mon Jun 1 21:54:22 2009 (r193278) @@ -552,7 +552,7 @@ ksyms_read(struct cdev *dev, struct uio /* ARGSUSED */ static int ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int32_t flag __unused, - d_thread_t *td __unused) + struct thread *td __unused) { int error = 0; struct ksyms_softc *sc; From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:54:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB46E1065677; Mon, 1 Jun 2009 21:54:59 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D935E8FC24; Mon, 1 Jun 2009 21:54:59 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51LsxZc093573; Mon, 1 Jun 2009 21:54:59 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51Lsx4M093571; Mon, 1 Jun 2009 21:54:59 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <200906012154.n51Lsx4M093571@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 1 Jun 2009 21:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193279 - in head/usr.bin/ee: . nls/hu_HU.ISO8859-2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:55:00 -0000 Author: gabor (doc,ports committer) Date: Mon Jun 1 21:54:59 2009 New Revision: 193279 URL: http://svn.freebsd.org/changeset/base/193279 Log: - Add Hungarian catalog Added: head/usr.bin/ee/nls/hu_HU.ISO8859-2/ head/usr.bin/ee/nls/hu_HU.ISO8859-2/ee.msg (contents, props changed) Modified: head/usr.bin/ee/Makefile Modified: head/usr.bin/ee/Makefile ============================================================================== --- head/usr.bin/ee/Makefile Mon Jun 1 21:54:22 2009 (r193278) +++ head/usr.bin/ee/Makefile Mon Jun 1 21:54:59 2009 (r193279) @@ -14,7 +14,7 @@ LDADD= -lncurses WARNS?= 2 NLS= en_US.US-ASCII fr_FR.ISO8859-1 de_DE.ISO8859-1 pl_PL.ISO8859-2 \ - uk_UA.KOI8-U ru_RU.KOI8-R + uk_UA.KOI8-U ru_RU.KOI8-R hu_HU.ISO8859-2 NLSLINKS_en_US.US-ASCII= en_US.ISO8859-1 en_US.ISO8859-15 NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \ Added: head/usr.bin/ee/nls/hu_HU.ISO8859-2/ee.msg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ee/nls/hu_HU.ISO8859-2/ee.msg Mon Jun 1 21:54:59 2009 (r193279) @@ -0,0 +1,185 @@ +$ This file contains the messages for ee ("easy editor"). See the file +$ ee.i18n.guide for more information +$ +$ For ee patchlevel 3 +$ +$ $FreeBSD$ +$ +$ +$set 1 +$quote " +1 "üzemmód menü" +2 "tabulátorok szóközzé " +3 "kis- és nagybetû érzékeny keresés " +4 "margók megfigyelésre " +5 "automatikus bekezdésformázás " +6 "nyolcbites karakterek " +7 "info ablak " +8 "jobb margó " +9 "kilépés a menübõl " +10 "változtatások mentése" +11 "nincs mentés" +12 "fájl menü" +13 "fájl olvasása" +14 "fájl írása" +15 "fájl mentése" +16 "a szerkesztõ tartalmának nyomtatása" +17 "keresés menü" +18 "keresés erre" +19 "keresés" +20 "helyesírás menü" +21 "'spell' használata" +22 "'ispell' használata" +23 "egyéb menü" +24 "bekezdés formázása" +25 "shell parancs" +26 "helyesírás-ellenõrzés" +27 "fõmenü" +28 "kilépés a szerkesztõbõl" +29 "súgó" +30 "fájlmûveletek" +31 "képernyõ újrarajzolása" +32 "beállítások" +33 "keresés" +34 "egyéb" +35 "Vezérlõbillentyûk: " +36 "^a ascii kód ^i tabulátor ^r jobb " +37 "^b szöveg alja ^j újsor ^t szöveg teteje " +38 "^c parancs ^k karakter törlése ^u fel " +39 "^d le ^l balra ^v szótörlés vissza " +40 "^e keresés prompt ^m újsor ^w szó törlése " +41 "^f karaktertörlés vissza ^n következõ oldal ^x keresés " +42 "^g sor eleje ^o sor vége ^y sor törlése " +43 "^h visszatörlés ^p elõzõ oldal ^z sortörlés vissza " +44 "^[ (escape) menü " +45 " " +46 "Parancsok: " +47 "help : ez az info file : fájlnév megjelenítése " +48 "read : fájl olvasása char : karakter ascii kódja " +49 "write : fájl írása case : k/n betû érzékeny keresés" +50 "exit : kilépés és mentés nocase : nem betûérzékeny keresés " +51 "quit : kilépés mentés nélkül !cmd : \"cmd\" shell parancs " +52 "line : #. sor megjelenítése 0-9 : \"#\" sorra ugrás " +53 "expand : tabok kifejtése noexpand: ne fejtse ki a tabokat " +54 " " +55 " ee [+#] [-i] [-e] [-h] [fájl(ok) " +56 "+# :ugrás sorra # -i :info ablak ki -e :tabkifejtés ki -h :kiemelés ki" +57 "^[ (escape) menü ^e keresés prompt ^y sor törlése ^u fel ^p elõzõ old " +58 "^a ascii kód ^x keresés ^z sortörl vissza ^d le ^n köv old " +59 "^b szöve alja ^g sor eleje ^w szó törlése ^l bal " +60 "^t szöveg teteje ^o sor vége ^v szótörl vissza ^r jobb " +61 "^c parancs ^k karalter törl ^f kartörl vissza " +62 "help : súgó |file : fájlnév megjelenítése |line : sor # kiírása " +63 "read : fájl olvasása |char : ascii kód |0-9 : # sorra ugrás " +64 "write: fájl írása |case : k/n érzékeny keresés |exit : kilép és ment " +65 "!cmd : shell parancs |nocase: nem érzékeny keresés |quit : kilép, nem ment" +66 "expand: tabkifejtés |noexpand: ne legyen tabkifejtés " +67 " nyomja le az Escape billentyût (^[) a menü eléréséhez" +68 "nincs fájl" +69 "ascii kód: " +70 "a puffer tartalmának küldése -> \"%s\" " +71 "parancs: " +72 "a mentendõ fájl neve: " +73 "az olvasandó fájl neve: " +74 "karakter = %d" +75 "ismeretlen parancs: \"%s\"" +76 "a megadott parancs nem egyéni" +77 "sor %d " +78 "hossz = %d" +79 "az aktuális fájl \"%s\" " +80 "használat: %s [-i] [-e] [-h] [+sor_száma] [fájl(ok)]\n" +81 " -i info ablak kikapcsolása\n" +82 " -e ne konvertálja a tabokat szóközzé\n" +83 " -h ne használjon kiemelést\n" +84 "\"%s\" egy könyvtár" +85 "új fájl: \"%s\"" +86 "\"%s\" nem nyitható meg" +87 "\"%s\" fájl, %d sor" +88 "\"%s\" fájl olvasása befejezõdött" +89 "\"%s\" fájl olvasása" +90 ", csak olvasható" +91 "\"%s\" fájl, %d sor" +92 "adja meg a fájlnevet: " +93 "nem adott meg fájlnevet: a fájl nem lett elmentve" +94 "változások történtek, biztos benne? (i/n [n]) " +95 "i" +96 "a fájl már létezik, felülírjam? (i/n) [n] " +97 "\"%s\" fájl nem hozható létre" +98 "\"%s\" fájl írása" +99 "\"%s\" %d sor, %d karakter" +100 " ...keresés" +101 "\"%s\" karakterlánc nem található" +102 "keresés erre: " +103 "%s nem hajtható végre\n" +104 "nyomjon entert a folytatáshoz" +105 "nyomja le az Esc billentyût a visszalépéshez" +106 "a menü túl nagy az ablakhoz" +107 "nyomjon le egy billentyût a folytatáshoz" +108 "shell parancs: " +109 "...bekezdés formázása..." +110 " Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3ADC1065670; Mon, 1 Jun 2009 21:58:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B128C8FC08; Mon, 1 Jun 2009 21:58:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51Lwxj3093816; Mon, 1 Jun 2009 21:58:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51Lwxu0093806; Mon, 1 Jun 2009 21:58:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200906012158.n51Lwxu0093806@svn.freebsd.org> From: Doug Barton Date: Mon, 1 Jun 2009 21:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193280 - in head: lib/bind share/mk tools/build/options usr.bin/dig usr.sbin/named X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 21:59:00 -0000 Author: dougb Date: Mon Jun 1 21:58:59 2009 New Revision: 193280 URL: http://svn.freebsd.org/changeset/base/193280 Log: Add support for the build options that are currently in the port: WITH_BIND_IDN WITH_BIND_LARGE_FILE WITH_BIND_SIGCHASE WITH_BIND_XML Added: head/tools/build/options/WITH_BIND_IDN (contents, props changed) head/tools/build/options/WITH_BIND_LARGE_FILE (contents, props changed) head/tools/build/options/WITH_BIND_SIGCHASE (contents, props changed) head/tools/build/options/WITH_BIND_XML (contents, props changed) Replaced: head/tools/build/options/WITH_BIND_LIBS (contents, props changed) Modified: head/lib/bind/config.mk head/share/mk/bsd.own.mk head/usr.bin/dig/Makefile head/usr.sbin/named/Makefile Modified: head/lib/bind/config.mk ============================================================================== --- head/lib/bind/config.mk Mon Jun 1 21:54:59 2009 (r193279) +++ head/lib/bind/config.mk Mon Jun 1 21:58:59 2009 (r193280) @@ -70,6 +70,19 @@ ISC_ATOMIC_ARCH= x86_32 ISC_ATOMIC_ARCH= ${MACHINE_ARCH} .endif +# Optional features +.if ${MK_BIND_LARGE_FILE} == "yes" +CFLAGS+= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +.endif +.if ${MK_BIND_SIGCHASE} == "yes" +CFLAGS+= -DDIG_SIGCHASE +.endif +.if ${MK_BIND_XML} == "yes" +CFLAGS+= -DHAVE_LIBXML2 +CFLAGS+= -I/usr/local/include -I/usr/local/include/libxml2 +CFLAGS+= -L/usr/local/lib -lxml2 -lz -liconv -lm +.endif + # Link against BIND libraries .if ${MK_BIND_LIBS} == "no" LIBBIND9= ${LIB_BIND_REL}/bind9/libbind9.a Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Jun 1 21:54:59 2009 (r193279) +++ head/share/mk/bsd.own.mk Mon Jun 1 21:58:59 2009 (r193280) @@ -402,7 +402,11 @@ MK_${var}:= yes # MK_* options which default to "no". # .for var in \ + BIND_IDN \ + BIND_LARGE_FILE \ BIND_LIBS \ + BIND_SIGCHASE \ + BIND_XML \ GNU_CPIO \ HESIOD \ IDEA Added: head/tools/build/options/WITH_BIND_IDN ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BIND_IDN Mon Jun 1 21:58:59 2009 (r193280) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to enable IDN support for dig, host, and nslookup. +This requires ports/dns/idnkit to be installed in /usr/local. Added: head/tools/build/options/WITH_BIND_LARGE_FILE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BIND_LARGE_FILE Mon Jun 1 21:58:59 2009 (r193280) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to enable 64-bit file support. Added: head/tools/build/options/WITH_BIND_LIBS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BIND_LIBS Mon Jun 1 21:58:59 2009 (r193280) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to install BIND libraries and include files. Added: head/tools/build/options/WITH_BIND_SIGCHASE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BIND_SIGCHASE Mon Jun 1 21:58:59 2009 (r193280) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to enable DNSSEC validation support for dig, host, and nslookup. Added: head/tools/build/options/WITH_BIND_XML ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BIND_XML Mon Jun 1 21:58:59 2009 (r193280) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to enable the http statistics interface for named. +This requires ports/textproc/libxml2 to be installed in /usr/local. Modified: head/usr.bin/dig/Makefile ============================================================================== --- head/usr.bin/dig/Makefile Mon Jun 1 21:54:59 2009 (r193279) +++ head/usr.bin/dig/Makefile Mon Jun 1 21:58:59 2009 (r193280) @@ -15,6 +15,11 @@ SRCS+= dig.c dighost.c CFLAGS+= -I${SRCDIR}/include CFLAGS+= -I${BIND_DIR}/lib/isc/${ISC_ATOMIC_ARCH}/include +.if ${MK_BIND_IDN} == "yes" +CFLAGS+= -DWITH_IDN -I/usr/local/include +CFLAGS+= -L/usr/local/lib -lidnkit -R/usr/local/lib -liconv +.endif + DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD} LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD} Modified: head/usr.sbin/named/Makefile ============================================================================== --- head/usr.sbin/named/Makefile Mon Jun 1 21:54:59 2009 (r193279) +++ head/usr.sbin/named/Makefile Mon Jun 1 21:58:59 2009 (r193280) @@ -9,7 +9,25 @@ SRCDIR= ${BIND_DIR}/bin/named PROG= named -CONFIGARGS='--prefix=/usr' '--without-libxml2' '--without-idn' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-threads' '--disable-ipv6' '--enable-getifaddrs' '--disable-linux-caps' '--with-openssl=/usr' '--with-randomdev=/dev/random' +CONFIGARGS='--prefix=/usr' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-threads' '--disable-ipv6' '--enable-getifaddrs' '--disable-linux-caps' '--with-openssl=/usr' '--with-randomdev=/dev/random' + +# Optional features +.if ${MK_BIND_LARGE_FILE} == "yes" +CONFIGARGS+='--enable-largefile' +.endif +.if ${MK_BIND_SIGCHASE} == "yes" +CONFIGARGS+='STD_CDEFINES=-DDIG_SIGCHASE=1' +.endif +.if ${MK_BIND_IDN} == "yes" +CONFIGARGS+='--with-idn=/usr/local' +.else +CONFIGARGS+='--without-idn' +.endif +.if ${MK_BIND_XML} == "yes" +CONFIGARGS+='--with-libxml2=/usr/local' +.else +CONFIGARGS+='--without-libxml2' +.endif .PATH: ${SRCDIR}/unix SRCS+= os.c From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 22:01:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45F6E106564A; Mon, 1 Jun 2009 22:01:49 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by mx1.freebsd.org (Postfix) with ESMTP id 430AB8FC08; Mon, 1 Jun 2009 22:01:47 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ey-out-2122.google.com with SMTP id 22so448097eye.7 for ; Mon, 01 Jun 2009 15:01:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-pgp-agent:x-mailer; bh=C9e5rZle6fTjHk5jj/m3i6q3Rjwp6f6oSc4+bsHAVZU=; b=GzaILwlutyyWWGsyR9YD+P8XW5kRA5/eU1XfMnQLAIo0bm2Hv4YvISISifcEcil5SU 4JQ71HsE79iUj+uYM0rdw1gOUW2VBNfjTIQN4nPC+FGaE7yZTv03eMEsPsO5kkM0D6y3 YNCRkvkzym95aBDWlCJYfNbJv6p967ETKl/bI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-pgp-agent:x-mailer; b=t+CceqG2ljnaDrPxnzPID/KeQsMUgT8J72VYBmbHZH4nV/aTKHkl4ZkRKHneasPkmh LjCdaWvXaiCOg8tL3zk9TzoxzrYoWggV2oRB0zEf73AXwrTIRCpXWBFt0an1q2SmB2V8 pXKSBqtS0rF5MI5chHP620hBN+kUHoB/Bi20c= Received: by 10.210.41.1 with SMTP id o1mr4621494ebo.63.1243893707185; Mon, 01 Jun 2009 15:01:47 -0700 (PDT) Received: from ?192.168.1.70? (bl6-146-118.dsl.telepac.pt [82.155.146.118]) by mx.google.com with ESMTPS id 28sm83026eye.46.2009.06.01.15.01.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 01 Jun 2009 15:01:46 -0700 (PDT) Sender: Rui Paulo Message-Id: From: Rui Paulo To: Hans Petter Selasky In-Reply-To: <200906011754.14349.hselasky@c2i.net> Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-1--701470531" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Mon, 1 Jun 2009 23:01:41 +0100 References: <200905271927.n4RJRUH8009289@svn.freebsd.org> <200906010749.37072.hselasky@c2i.net> <5C52056B-8E4A-4C15-8451-2A5576A8FC9F@freebsd.org> <200906011754.14349.hselasky@c2i.net> X-Pgp-Agent: GPGMail 1.2.0 (v56) X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrew Thompson Subject: Re: svn commit: r192925 - in head/sys/dev/usb: . input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 22:01:50 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-1--701470531 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On 1 Jun 2009, at 16:54, Hans Petter Selasky wrote: > On Monday 01 June 2009, Rui Paulo wrote: >> Hi, >> >> On 1 Jun 2009, at 06:49, Hans Petter Selasky wrote: >>> On Monday 01 June 2009, Rui Paulo wrote: >>>> http://wiki.freebsd.org/AppleMacbook#head-7eab3730c3bf3d04bdfb0d1d3649ea >>>> ddf 2fed595 >>> >>> Hi Rui Paulo, >>> >>> Regarding the eject button, can you have a look at: >>> >>> /sys/dev/usb/input/ukbd.c >>> >>> And provide a patch that masks this key the way you want? >> >> I'm not sure what you mean. I'm proposing to remove the key handling >> code from the kernel. See the attached patch. > > Your patch looks OK. Make sure you test it before committing. I can't test it right now for various reasons. If anyone can test it, I would be glad. Regards, -- Rui Paulo --Apple-Mail-1--701470531 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkokT8UACgkQfD8M/ASTygLImACcD5tu7DF6eHTFQQOG+d9Cfh2g kGYAoIIc5WMBPIKNmiy8Z36Dih48wkez =z20Q -----END PGP SIGNATURE----- --Apple-Mail-1--701470531-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 22:14:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51C32106566B; Mon, 1 Jun 2009 22:14:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25DE18FC08; Mon, 1 Jun 2009 22:14:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51MEkOa094370; Mon, 1 Jun 2009 22:14:46 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51MEk75094369; Mon, 1 Jun 2009 22:14:46 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200906012214.n51MEk75094369@svn.freebsd.org> From: Doug Barton Date: Mon, 1 Jun 2009 22:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193283 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 22:14:46 -0000 Author: dougb Date: Mon Jun 1 22:14:45 2009 New Revision: 193283 URL: http://svn.freebsd.org/changeset/base/193283 Log: Commit the updates to this file for the new BIND options Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Jun 1 22:09:42 2009 (r193282) +++ head/share/man/man5/src.conf.5 Mon Jun 1 22:14:45 2009 (r193283) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm .\" $FreeBSD$ -.Dd April 5, 2009 +.Dd June 1, 2009 .Dt SRC.CONF 5 .Os .Sh NAME @@ -150,8 +150,15 @@ and .\" from FreeBSD: head/tools/build/options/WITHOUT_BIND_ETC 156932 2006-03-21 07:50:50Z ru Set to avoid installing the default files to .Pa /var/named/etc/namedb . +.It Va WITH_BIND_IDN +.\" from FreeBSD: head/tools/build/options/WITH_BIND_IDN 193280 2009-06-01 21:58:59Z dougb +Set to enable IDN support for dig, host, and nslookup. +This requires ports/dns/idnkit to be installed in /usr/local. +.It Va WITH_BIND_LARGE_FILE +.\" from FreeBSD: head/tools/build/options/WITH_BIND_LARGE_FILE 193280 2009-06-01 21:58:59Z dougb +Set to enable 64-bit file support. .It Va WITH_BIND_LIBS -.\" from FreeBSD: head/tools/build/options/WITH_BIND_LIBS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITH_BIND_LIBS 193280 2009-06-01 21:58:59Z dougb Set to install BIND libraries and include files. .It Va WITHOUT_BIND_LIBS_LWRES .\" from FreeBSD: head/tools/build/options/WITHOUT_BIND_LIBS_LWRES 156932 2006-03-21 07:50:50Z ru @@ -182,6 +189,9 @@ Set to avoid building or installing .Xr rndc 8 , and .Xr rndc-confgen 8 . +.It Va WITH_BIND_SIGCHASE +.\" from FreeBSD: head/tools/build/options/WITH_BIND_SIGCHASE 193280 2009-06-01 21:58:59Z dougb +Set to enable DNSSEC validation support for dig, host, and nslookup. .It Va WITHOUT_BIND_UTILS .\" from FreeBSD: head/tools/build/options/WITHOUT_BIND_UTILS 156932 2006-03-21 07:50:50Z ru Set to avoid building or installing the BIND userland utilities, @@ -190,6 +200,10 @@ Set to avoid building or installing the .Xr nslookup 1 , and .Xr nsupdate 8 . +.It Va WITH_BIND_XML +.\" from FreeBSD: head/tools/build/options/WITH_BIND_XML 193280 2009-06-01 21:58:59Z dougb +Set to enable the http statistics interface for named. +This requires ports/textproc/libxml2 to be installed in /usr/local. .It Va WITHOUT_BLUETOOTH .\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 22:48:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D541065673; Mon, 1 Jun 2009 22:48:00 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 406E48FC12; Mon, 1 Jun 2009 22:48:00 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51Mm0XN095112; Mon, 1 Jun 2009 22:48:00 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51Mm0ED095111; Mon, 1 Jun 2009 22:48:00 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200906012248.n51Mm0ED095111@svn.freebsd.org> From: Doug Barton Date: Mon, 1 Jun 2009 22:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193285 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 22:48:01 -0000 Author: dougb Date: Mon Jun 1 22:47:59 2009 New Revision: 193285 URL: http://svn.freebsd.org/changeset/base/193285 Log: Add a note about the change to rcorder for pf and ipfw. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 1 22:34:09 2009 (r193284) +++ head/UPDATING Mon Jun 1 22:47:59 2009 (r193285) @@ -33,6 +33,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. rebuilt. Bump __FreeBSD_version to 800096. +20090531: + For those who use ipfw and especially pf, those two firewalls + are now started BEFORE the network is initialized (i.e., before + rc.d/netif). Please review your rules to make sure that your + interfaces will be properly described. + 20090530: Remove the tunable/sysctl debug.mpsafevfs as its initial purpose is no more valid. From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 00:04:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F40801065674; Tue, 2 Jun 2009 00:04:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2BAF8FC21; Tue, 2 Jun 2009 00:04:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5204A2Z096635; Tue, 2 Jun 2009 00:04:10 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5204AYY096634; Tue, 2 Jun 2009 00:04:10 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906020004.n5204AYY096634@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 00:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193287 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 00:04:11 -0000 Author: sam Date: Tue Jun 2 00:04:10 2009 New Revision: 193287 URL: http://svn.freebsd.org/changeset/base/193287 Log: count packets Modified: head/sys/net80211/ieee80211_monitor.c Modified: head/sys/net80211/ieee80211_monitor.c ============================================================================== --- head/sys/net80211/ieee80211_monitor.c Mon Jun 1 23:53:15 2009 (r193286) +++ head/sys/net80211/ieee80211_monitor.c Tue Jun 2 00:04:10 2009 (r193287) @@ -127,6 +127,9 @@ static int monitor_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) { struct ieee80211vap *vap = ni->ni_vap; + struct ifnet *ifp = vap->iv_ifp; + + ifp->if_ipackets++; if (ieee80211_radiotap_active_vap(vap)) ieee80211_radiotap_rx(vap, m); From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 00:06:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBB04106566C; Tue, 2 Jun 2009 00:06:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA90C8FC17; Tue, 2 Jun 2009 00:06:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5206d74096717; Tue, 2 Jun 2009 00:06:39 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5206d51096716; Tue, 2 Jun 2009 00:06:39 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906020006.n5206d51096716@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 00:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193288 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 00:06:40 -0000 Author: sam Date: Tue Jun 2 00:06:39 2009 New Revision: 193288 URL: http://svn.freebsd.org/changeset/base/193288 Log: don't dispatch frames to vap's not running Modified: head/sys/net80211/ieee80211_input.c Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Tue Jun 2 00:04:10 2009 (r193287) +++ head/sys/net80211/ieee80211_input.c Tue Jun 2 00:06:39 2009 (r193288) @@ -65,6 +65,9 @@ ieee80211_input_all(struct ieee80211com struct ieee80211_node *ni; struct mbuf *mcopy; + /* NB: could check for IFF_UP but this is cheaper */ + if (vap->iv_state == IEEE80211_S_INIT) + continue; /* * WDS vap's only receive directed traffic from the * station at the ``far end''. That traffic should From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 00:21:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A97A106566C; Tue, 2 Jun 2009 00:21:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28E248FC4E; Tue, 2 Jun 2009 00:21:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n520LVRL097035; Tue, 2 Jun 2009 00:21:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n520LVHR097034; Tue, 2 Jun 2009 00:21:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200906020021.n520LVHR097034@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 2 Jun 2009 00:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193289 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 00:21:31 -0000 Author: yongari Date: Tue Jun 2 00:21:30 2009 New Revision: 193289 URL: http://svn.freebsd.org/changeset/base/193289 Log: Don't assume page register value is 0 and restore previous page register after issuing 'powerup'. Modified: head/sys/dev/mii/e1000phy.c Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Tue Jun 2 00:06:39 2009 (r193288) +++ head/sys/dev/mii/e1000phy.c Tue Jun 2 00:21:30 2009 (r193289) @@ -239,11 +239,13 @@ e1000phy_reset(struct mii_softc *sc) PHY_WRITE(sc, E1000_SCR, reg); if (esc->mii_model == MII_MODEL_MARVELL_E1116) { + page = PHY_READ(sc, E1000_EADR); + /* Select page 2, MAC specific control register. */ PHY_WRITE(sc, E1000_EADR, 2); reg = PHY_READ(sc, E1000_SCR); reg |= E1000_SCR_RGMII_POWER_UP; PHY_WRITE(sc, E1000_SCR, reg); - PHY_WRITE(sc, E1000_EADR, 0); + PHY_WRITE(sc, E1000_EADR, page); } } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 00:30:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B1CE106566B; Tue, 2 Jun 2009 00:30:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38F8B8FC20; Tue, 2 Jun 2009 00:30:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n520UVUG097291; Tue, 2 Jun 2009 00:30:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n520UV0K097289; Tue, 2 Jun 2009 00:30:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200906020030.n520UV0K097289@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 2 Jun 2009 00:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193291 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 00:30:31 -0000 Author: yongari Date: Tue Jun 2 00:30:30 2009 New Revision: 193291 URL: http://svn.freebsd.org/changeset/base/193291 Log: Program LED registers for 88E1116/88E1149 PHYs. These PHYs are found on Marvell Yukon Ultra, Marvell Yukon Extreme controllers. While I'm here explicitly issue 'powerup' command for 88E1149 PHY. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) Modified: head/sys/dev/mii/e1000phy.c head/sys/dev/mii/e1000phyreg.h Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Tue Jun 2 00:21:47 2009 (r193290) +++ head/sys/dev/mii/e1000phy.c Tue Jun 2 00:30:30 2009 (r193291) @@ -238,7 +238,8 @@ e1000phy_reset(struct mii_softc *sc) } PHY_WRITE(sc, E1000_SCR, reg); - if (esc->mii_model == MII_MODEL_MARVELL_E1116) { + if (esc->mii_model == MII_MODEL_MARVELL_E1116 || + esc->mii_model == MII_MODEL_MARVELL_E1149) { page = PHY_READ(sc, E1000_EADR); /* Select page 2, MAC specific control register. */ PHY_WRITE(sc, E1000_EADR, 2); @@ -252,9 +253,22 @@ e1000phy_reset(struct mii_softc *sc) switch (MII_MODEL(esc->mii_model)) { case MII_MODEL_MARVELL_E3082: case MII_MODEL_MARVELL_E1112: - case MII_MODEL_MARVELL_E1116: case MII_MODEL_MARVELL_E1118: + break; + case MII_MODEL_MARVELL_E1116: case MII_MODEL_MARVELL_E1149: + page = PHY_READ(sc, E1000_EADR); + /* Select page 3, LED control register. */ + PHY_WRITE(sc, E1000_EADR, 3); + PHY_WRITE(sc, E1000_SCR, + E1000_SCR_LED_LOS(1) | /* Link/Act */ + E1000_SCR_LED_INIT(8) | /* 10Mbps */ + E1000_SCR_LED_STAT1(7) | /* 100Mbps */ + E1000_SCR_LED_STAT0(7)); /* 1000Mbps */ + /* Set blink rate. */ + PHY_WRITE(sc, E1000_IER, E1000_PULSE_DUR(E1000_PULSE_170MS) | + E1000_BLINK_RATE(E1000_BLINK_84MS)); + PHY_WRITE(sc, E1000_EADR, page); break; case MII_MODEL_MARVELL_E3016: /* LED2 -> ACT, LED1 -> LINK, LED0 -> SPEED. */ Modified: head/sys/dev/mii/e1000phyreg.h ============================================================================== --- head/sys/dev/mii/e1000phyreg.h Tue Jun 2 00:21:47 2009 (r193290) +++ head/sys/dev/mii/e1000phyreg.h Tue Jun 2 00:30:30 2009 (r193291) @@ -256,9 +256,19 @@ /* 88E1116 page 0 */ #define E1000_SCR_POWER_DOWN 0x0004 -/* 88E1116 page 2 */ +/* 88E1116, 88E1149 page 2 */ #define E1000_SCR_RGMII_POWER_UP 0x0008 +/* 88E1116, 88E1149 page 3 */ +#define E1000_SCR_LED_STAT0_MASK 0x000F +#define E1000_SCR_LED_STAT1_MASK 0x00F0 +#define E1000_SCR_LED_INIT_MASK 0x0F00 +#define E1000_SCR_LED_LOS_MASK 0xF000 +#define E1000_SCR_LED_STAT0(x) ((x) & E1000_SCR_LED_STAT0_MASK) +#define E1000_SCR_LED_STAT1(x) ((x) & E1000_SCR_LED_STAT1_MASK) +#define E1000_SCR_LED_INIT(x) ((x) & E1000_SCR_LED_INIT_MASK) +#define E1000_SCR_LED_LOS(x) ((x) & E1000_SCR_LED_LOS_MASK) + #define E1000_SSR 0x11 /* special status register */ #define E1000_SSR_JABBER 0x0001 #define E1000_SSR_REV_POLARITY 0x0002 @@ -286,6 +296,26 @@ #define E1000_IER_SPEED_CHANGED 0x4000 #define E1000_IER_AUTO_NEG_ERR 0x8000 +/* 88E1116, 88E1149 page 3, LED timer control. */ +#define E1000_PULSE_MASK 0x7000 +#define E1000_PULSE_NO_STR 0 /* no pulse stretching */ +#define E1000_PULSE_21MS 1 /* 21 ms to 42 ms */ +#define E1000_PULSE_42MS 2 /* 42 ms to 84 ms */ +#define E1000_PULSE_84MS 3 /* 84 ms to 170 ms */ +#define E1000_PULSE_170MS 4 /* 170 ms to 340 ms */ +#define E1000_PULSE_340MS 5 /* 340 ms to 670 ms */ +#define E1000_PULSE_670MS 6 /* 670 ms to 1300 ms */ +#define E1000_PULSE_1300MS 7 /* 1300 ms to 2700 ms */ +#define E1000_PULSE_DUR(x) ((x) & E1000_PULSE_MASK) + +#define E1000_BLINK_MASK 0x0700 +#define E1000_BLINK_42MS 0 /* 42 ms */ +#define E1000_BLINK_84MS 1 /* 84 ms */ +#define E1000_BLINK_170MS 2 /* 170 ms */ +#define E1000_BLINK_340MS 3 /* 340 ms */ +#define E1000_BLINK_670MS 4 /* 670 ms */ +#define E1000_BLINK_RATE(x) ((x) & E1000_BLINK_MASK) + #define E1000_ISR 0x13 /* interrupt status reg */ #define E1000_ISR_JABBER 0x0001 #define E1000_ISR_POLARITY_CHANGE 0x0002 From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 00:33:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44287106566C; Tue, 2 Jun 2009 00:33:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 317A58FC22; Tue, 2 Jun 2009 00:33:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n520XSss097404; Tue, 2 Jun 2009 00:33:28 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n520XSbb097397; Tue, 2 Jun 2009 00:33:28 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906020033.n520XSbb097397@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 00:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193292 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 00:33:29 -0000 Author: sam Date: Tue Jun 2 00:33:28 2009 New Revision: 193292 URL: http://svn.freebsd.org/changeset/base/193292 Log: Fix monitor mode vaps to work as intended: o track # bpf taps on monitor mode vaps instead of # monitor mode vaps o spam monitor mode taps on tx/rx o fix ieee80211_radiotap_rx_all to dispatch frames only if the vap is up o while here print radiotap (and superg) state in show com Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_radiotap.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211.c Tue Jun 2 00:33:28 2009 (r193292) @@ -513,8 +513,6 @@ ieee80211_vap_attach(struct ieee80211vap IEEE80211_LOCK(ic); TAILQ_INSERT_TAIL(&ic->ic_vaps, vap, iv_next); - if (vap->iv_opmode == IEEE80211_M_MONITOR) - ic->ic_monvaps++; ieee80211_syncflag_locked(ic, IEEE80211_F_WME); #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_syncflag_locked(ic, IEEE80211_F_TURBOP); @@ -575,8 +573,6 @@ ieee80211_vap_detach(struct ieee80211vap IEEE80211_LOCK(ic); KASSERT(vap->iv_state == IEEE80211_S_INIT , ("vap still running")); TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next); - if (vap->iv_opmode == IEEE80211_M_MONITOR) - ic->ic_monvaps--; ieee80211_syncflag_locked(ic, IEEE80211_F_WME); #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_syncflag_locked(ic, IEEE80211_F_TURBOP); Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_ddb.c Tue Jun 2 00:33:28 2009 (r193292) @@ -584,6 +584,11 @@ _db_show_com(const struct ieee80211com * db_printf(" lastnonht %d", ic->ic_lastnonht); db_printf("\n"); + db_printf("\tsuperg %p\n", ic->ic_superg); + + db_printf("\tmontaps %d th %p txchan %p rh %p rxchan %p\n", + ic->ic_montaps, ic->ic_th, ic->ic_txchan, ic->ic_rh, ic->ic_rxchan); + if (showprocs) { DB_PRINTSYM("\t", "ic_vap_create", ic->ic_vap_create); DB_PRINTSYM("\t", "ic_vap_delete", ic->ic_vap_delete); Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_freebsd.c Tue Jun 2 00:33:28 2009 (r193292) @@ -706,11 +706,16 @@ bpf_track(void *arg, struct ifnet *ifp, * vap. This flag is used by drivers to prepare radiotap * state only when needed. */ - if (attach) + if (attach) { ieee80211_syncflag_ext(vap, IEEE80211_FEXT_BPF); + if (vap->iv_opmode == IEEE80211_M_MONITOR) + atomic_add_int(&vap->iv_ic->ic_montaps, 1); /* NB: if_softc is NULL on vap detach */ - else if (vap != NULL && !bpf_peers_present(vap->iv_rawbpf)) + } else if (vap != NULL && !bpf_peers_present(vap->iv_rawbpf)) { ieee80211_syncflag_ext(vap, -IEEE80211_FEXT_BPF); + if (vap->iv_opmode == IEEE80211_M_MONITOR) + atomic_subtract_int(&vap->iv_ic->ic_montaps, 1); + } } } Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_hostap.c Tue Jun 2 00:33:28 2009 (r193292) @@ -302,6 +302,9 @@ hostap_deliver_data(struct ieee80211vap struct ether_header *eh = mtod(m, struct ether_header *); struct ifnet *ifp = vap->iv_ifp; + /* clear driver/net80211 flags before passing up */ + m->m_flags &= ~(M_80211_RX | M_MCAST | M_BCAST); + KASSERT(vap->iv_opmode == IEEE80211_M_HOSTAP, ("gack, opmode %d", vap->iv_opmode)); /* @@ -316,9 +319,6 @@ hostap_deliver_data(struct ieee80211vap } else IEEE80211_NODE_STAT(ni, rx_ucast); - /* clear driver/net80211 flags before passing up */ - m->m_flags &= ~M_80211_RX; - /* perform as a bridge within the AP */ if ((vap->iv_flags & IEEE80211_F_NOBRIDGE) == 0) { struct mbuf *mcopy = NULL; Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_input.c Tue Jun 2 00:33:28 2009 (r193292) @@ -60,6 +60,8 @@ ieee80211_input_all(struct ieee80211com struct ieee80211vap *vap; int type = -1; + m->m_flags |= M_BCAST; /* NB: mark for bpf tap'ing */ + /* XXX locking */ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { struct ieee80211_node *ni; @@ -199,6 +201,9 @@ ieee80211_deliver_data(struct ieee80211v struct ether_header *eh = mtod(m, struct ether_header *); struct ifnet *ifp = vap->iv_ifp; + /* clear driver/net80211 flags before passing up */ + m->m_flags &= ~(M_80211_RX | M_MCAST | M_BCAST); + /* NB: see hostap_deliver_data, this path doesn't handle hostap */ KASSERT(vap->iv_opmode != IEEE80211_M_HOSTAP, ("gack, hostap")); /* @@ -214,9 +219,6 @@ ieee80211_deliver_data(struct ieee80211v IEEE80211_NODE_STAT(ni, rx_ucast); m->m_pkthdr.rcvif = ifp; - /* clear driver/net80211 flags before passing up */ - m->m_flags &= ~M_80211_RX; - if (ni->ni_vlan != 0) { /* attach vlan tag */ m->m_pkthdr.ether_vtag = ni->ni_vlan; Modified: head/sys/net80211/ieee80211_radiotap.c ============================================================================== --- head/sys/net80211/ieee80211_radiotap.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_radiotap.c Tue Jun 2 00:33:28 2009 (r193292) @@ -168,6 +168,7 @@ ieee80211_radiotap_chan_change(struct ie } } +#if 0 static void dispatch_radiotap(struct ieee80211vap *vap0, struct mbuf *m, struct ieee80211_radiotap_header *rh) @@ -175,17 +176,46 @@ dispatch_radiotap(struct ieee80211vap *v struct ieee80211com *ic = vap0->iv_ic; int len = le16toh(rh->it_len); - if (ieee80211_radiotap_active_vap(vap0)) + if (vap0->iv_flags_ext & IEEE80211_FEXT_BPF) bpf_mtap2(vap0->iv_rawbpf, rh, len, m); - if (ic->ic_monvaps) { + /* + * Spam monitor mode vaps with unicast frames. Multicast + * frames are handled by passing through ieee80211_input_all + * which distributes copies to the monitor mode vaps to be + * processed above. + */ + if (ic->ic_montaps != 0 && (m->m_flags & M_BCAST) == 0) { struct ieee80211vap *vap; TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { - if (vap->iv_opmode == IEEE80211_M_MONITOR && - vap != vap0 && ieee80211_radiotap_active_vap(vap)) + if (vap != vap0 && + vap->iv_opmode == IEEE80211_M_MONITOR && + (vap->iv_flags_ext & IEEE80211_FEXT_BPF) && + vap->iv_state != IEEE80211_S_INIT) bpf_mtap2(vap->iv_rawbpf, rh, len, m); } } } +#endif + +/* + * Distribute radiotap data (+packet) to all monitor mode + * vaps with an active tap other than vap0. + */ +static void +spam_vaps(struct ieee80211vap *vap0, struct mbuf *m, + struct ieee80211_radiotap_header *rh, int len) +{ + struct ieee80211com *ic = vap0->iv_ic; + struct ieee80211vap *vap; + + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + if (vap != vap0 && + vap->iv_opmode == IEEE80211_M_MONITOR && + (vap->iv_flags_ext & IEEE80211_FEXT_BPF) && + vap->iv_state != IEEE80211_S_INIT) + bpf_mtap2(vap->iv_rawbpf, rh, len, m); + } +} /* * Dispatch radiotap data for transmitted packet. @@ -193,8 +223,20 @@ dispatch_radiotap(struct ieee80211vap *v void ieee80211_radiotap_tx(struct ieee80211vap *vap0, struct mbuf *m) { - KASSERT(vap0->iv_ic->ic_th != NULL, ("no tx radiotap header")); - dispatch_radiotap(vap0, m, vap0->iv_ic->ic_th); + struct ieee80211com *ic = vap0->iv_ic; + struct ieee80211_radiotap_header *th = ic->ic_th; + int len; + + KASSERT(th != NULL, ("no tx radiotap header")); + len = le16toh(th->it_len); + + if (vap0->iv_flags_ext & IEEE80211_FEXT_BPF) + bpf_mtap2(vap0->iv_rawbpf, th, len, m); + /* + * Spam monitor mode vaps. + */ + if (ic->ic_montaps != 0) + spam_vaps(vap0, m, th, len); } /* @@ -203,8 +245,22 @@ ieee80211_radiotap_tx(struct ieee80211va void ieee80211_radiotap_rx(struct ieee80211vap *vap0, struct mbuf *m) { - KASSERT(vap0->iv_ic->ic_rh != NULL, ("no rx radiotap header")); - dispatch_radiotap(vap0, m, vap0->iv_ic->ic_rh); + struct ieee80211com *ic = vap0->iv_ic; + struct ieee80211_radiotap_header *rh = ic->ic_rh; + int len; + + KASSERT(rh != NULL, ("no rx radiotap header")); + len = le16toh(rh->it_len); + + if (vap0->iv_flags_ext & IEEE80211_FEXT_BPF) + bpf_mtap2(vap0->iv_rawbpf, rh, len, m); + /* + * Spam monitor mode vaps with unicast frames. Multicast + * frames are handled by passing through ieee80211_input_all + * which distributes copies to the monitor mode vaps. + */ + if (ic->ic_montaps != 0 && (m->m_flags & M_BCAST) == 0) + spam_vaps(vap0, m, rh, len); } /* @@ -221,7 +277,8 @@ ieee80211_radiotap_rx_all(struct ieee802 /* XXX locking? */ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { - if (ieee80211_radiotap_active_vap(vap)) + if (ieee80211_radiotap_active_vap(vap) && + vap->iv_state != IEEE80211_S_INIT) bpf_mtap2(vap->iv_rawbpf, rh, len, m); } } Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_var.h Tue Jun 2 00:33:28 2009 (r193292) @@ -215,7 +215,7 @@ struct ieee80211com { void *ic_txchan; /* channel state in ic_th */ struct ieee80211_radiotap_header *ic_rh;/* rx radiotap headers */ void *ic_rxchan; /* channel state in ic_rh */ - int ic_monvaps; /* # monitor mode vaps */ + int ic_montaps; /* active monitor mode taps */ /* virtual ap create/delete */ struct ieee80211vap* (*ic_vap_create)(struct ieee80211com *, @@ -669,7 +669,8 @@ ieee80211_radiotap_active(const struct i static __inline int ieee80211_radiotap_active_vap(const struct ieee80211vap *vap) { - return (vap->iv_flags_ext & IEEE80211_FEXT_BPF) != 0; + return (vap->iv_flags_ext & IEEE80211_FEXT_BPF) || + vap->iv_ic->ic_montaps != 0; } /* From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 04:00:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 101F2106564A; Tue, 2 Jun 2009 04:00:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F16728FC08; Tue, 2 Jun 2009 04:00:17 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5240Hp2001724; Tue, 2 Jun 2009 04:00:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5240He4001722; Tue, 2 Jun 2009 04:00:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200906020400.n5240He4001722@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 2 Jun 2009 04:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193293 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 04:00:18 -0000 Author: yongari Date: Tue Jun 2 04:00:17 2009 New Revision: 193293 URL: http://svn.freebsd.org/changeset/base/193293 Log: Add preliminary Yukon Extreme support and register definitions. Yukon Extreme uses new descriptor format for TSO and has Tx frame parser which greatly reduces CPU cycles spent in computing TCP/UDP payload offset calculation in Tx checksum offloading path. The new descriptor format also removed TCP/UDP payload computation for TSO which in turn results in better TSO performance. It seems Yukon Extreme has a lot of new (unknown) features but only basic offloading is supported at this time. So far there are two known issues. o Sometimes Rx overrun errors happen when pulling data over gigabit link. Running over 100Mbps seem to ok. o Ethernet hardware address shows all-zeroed value on 88E8070. Assigning ethernet address with ifconfig is necessary to make it work. Support for Yukon Extreme is not perfect but it would be better than having a non-working device. Special thanks to jbh who fixed several bugs of initial patch. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Jun 2 00:33:28 2009 (r193292) +++ head/sys/dev/msk/if_msk.c Tue Jun 2 04:00:17 2009 (r193293) @@ -226,7 +226,7 @@ static struct msk_product { static const char *model_name[] = { "Yukon XL", "Yukon EC Ultra", - "Yukon Unknown", + "Yukon EX", "Yukon EC", "Yukon FE", "Yukon FE+" @@ -1116,16 +1116,19 @@ msk_phy_power(struct msk_softc *sc, int val = pci_read_config(sc->msk_dev, PCI_OUR_REG_1, 4); val &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); - switch (sc->msk_hw_id) { - case CHIP_ID_YUKON_XL: + if (sc->msk_hw_id == CHIP_ID_YUKON_XL) { if (sc->msk_hw_rev > CHIP_REV_YU_XL_A1) { /* Deassert Low Power for 1st PHY. */ val |= PCI_Y2_PHY1_COMA; if (sc->msk_num_port > 1) val |= PCI_Y2_PHY2_COMA; } - break; + } + /* Release PHY from PowerDown/COMA mode. */ + pci_write_config(sc->msk_dev, PCI_OUR_REG_1, val, 4); + switch (sc->msk_hw_id) { case CHIP_ID_YUKON_EC_U: + case CHIP_ID_YUKON_EX: case CHIP_ID_YUKON_FE_P: CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); @@ -1136,14 +1139,22 @@ msk_phy_power(struct msk_softc *sc, int PCI_ASPM_INT_FIFO_EMPTY|PCI_ASPM_CLKRUN_REQUEST); /* Set all bits to 0 except bits 15..12. */ pci_write_config(sc->msk_dev, PCI_OUR_REG_4, our, 4); - /* Set to default value. */ - pci_write_config(sc->msk_dev, PCI_OUR_REG_5, 0, 4); + our = pci_read_config(sc->msk_dev, PCI_OUR_REG_5, 4); + our &= PCI_CTL_TIM_VMAIN_AV_MSK; + pci_write_config(sc->msk_dev, PCI_OUR_REG_5, our, 4); + pci_write_config(sc->msk_dev, PCI_CFG_REG_1, 0, 4); + /* + * Disable status race, workaround for + * Yukon EC Ultra & Yukon EX. + */ + val = CSR_READ_4(sc, B2_GP_IO); + val |= GLB_GPIO_STAT_RACE_DIS; + CSR_WRITE_4(sc, B2_GP_IO, val); + CSR_READ_4(sc, B2_GP_IO); break; default: break; } - /* Release PHY from PowerDown/COMA mode. */ - pci_write_config(sc->msk_dev, PCI_OUR_REG_1, val, 4); for (i = 0; i < sc->msk_num_port; i++) { CSR_WRITE_2(sc, MR_ADDR(i, GMAC_LINK_CTRL), GMLC_RST_SET); @@ -1194,10 +1205,18 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); /* Disable ASF. */ - if (sc->msk_hw_id < CHIP_ID_YUKON_XL) { - CSR_WRITE_4(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); - CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); - } + if (sc->msk_hw_id == CHIP_ID_YUKON_EX) { + status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); + /* Clear AHB bridge & microcontroller reset. */ + status &= ~(Y2_ASF_HCU_CCSR_AHB_RST | + Y2_ASF_HCU_CCSR_CPU_RST_MODE); + /* Clear ASF microcontroller state. */ + status &= ~ Y2_ASF_HCU_CCSR_UC_STATE_MSK; + CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); + } else + CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); + CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); + /* * Since we disabled ASF, S/W reset is required for Power Management. */ @@ -1249,6 +1268,10 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_F_LOOPB_OFF); + if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), + GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | + GMC_BYP_RETR_ON); } CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF); @@ -1651,6 +1674,10 @@ mskc_attach(device_t dev) sc->msk_clock = 125; /* 125 Mhz */ sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_JUMBO_NOCSUM; break; + case CHIP_ID_YUKON_EX: + sc->msk_clock = 125; /* 125 Mhz */ + sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2; + break; case CHIP_ID_YUKON_FE: sc->msk_clock = 100; /* 100 Mhz */ sc->msk_pflags |= MSK_FLAG_FASTETHER; @@ -3542,6 +3569,48 @@ done: } static void +msk_set_tx_stfwd(struct msk_if_softc *sc_if) +{ + struct msk_softc *sc; + struct ifnet *ifp; + + ifp = sc_if->msk_ifp; + sc = sc_if->msk_softc; + switch (sc->msk_hw_id) { + case CHIP_ID_YUKON_EX: + if (sc->msk_hw_rev == CHIP_REV_YU_EX_A0) + goto yukon_ex_workaround; + if (ifp->if_mtu > ETHERMTU) + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_ENA | TX_STFW_ENA); + else + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_DIS | TX_STFW_ENA); + break; + default: +yukon_ex_workaround: + if (ifp->if_mtu > ETHERMTU) { + /* Set Tx GMAC FIFO Almost Empty Threshold. */ + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR), + MSK_ECU_JUMBO_WM << 16 | MSK_ECU_AE_THR); + /* Disable Store & Forward mode for Tx. */ + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_ENA | TX_STFW_DIS); + } else { + /* Enable Store & Forward mode for Tx. */ + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_DIS | TX_STFW_ENA); + } + break; + } +} + +static void msk_init(void *xsc) { struct msk_if_softc *sc_if = xsc; @@ -3590,6 +3659,10 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); + if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), + GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | + GMC_BYP_RETR_ON); /* * Initialize GMAC first such that speed/duplex/flow-control @@ -3642,7 +3715,8 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RST_SET); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RST_CLR); reg = GMF_OPER_ON | GMF_RX_F_FL_ON; - if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P) + if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P || + sc->msk_hw_id == CHIP_ID_YUKON_EX) reg |= GMF_RX_OVER_ON; CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), reg); @@ -3678,20 +3752,8 @@ msk_init_locked(struct msk_if_softc *sc_ MSK_ECU_LLPP); CSR_WRITE_1(sc, MR_ADDR(sc_if->msk_port, RX_GMF_UP_THR), MSK_ECU_ULPP); - if (ifp->if_mtu > ETHERMTU) { - /* - * Set Tx GMAC FIFO Almost Empty Threshold. - */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR), - MSK_ECU_JUMBO_WM << 16 | MSK_ECU_AE_THR); - /* Disable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_DIS); - } else { - /* Enable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); - } + /* Configure store-and-forward for Tx. */ + msk_set_tx_stfwd(sc_if); } if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P && Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Tue Jun 2 00:33:28 2009 (r193292) +++ head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:00:17 2009 (r193293) @@ -225,6 +225,8 @@ #define PCI_OUR_REG_3 0x80 /* 32 bit Our Register 3 */ #define PCI_OUR_REG_4 0x84 /* 32 bit Our Register 4 */ #define PCI_OUR_REG_5 0x88 /* 32 bit Our Register 5 */ +#define PCI_CFG_REG_0 0x90 /* 32 bit Config Register 0 */ +#define PCI_CFG_REG_1 0x94 /* 32 bit Config Register 1 */ /* PCI Express Capability */ #define PEX_CAP_ID 0xe0 /* 8 bit PEX Capability ID */ @@ -325,6 +327,56 @@ #define PCI_CLK_GATE_PEX_UNIT_ENA BIT_1 /* Enable Gate PEX Unit Clock */ #define PCI_CLK_GATE_ROOT_COR_ENA BIT_0 /* Enable Gate Root Core Clock */ +/* PCI_OUR_REG_5 32 bit Our Register 5 (Yukon-ECU only) */ + /* Bit 31..27: for A3 & later */ +#define PCI_CTL_DIV_CORE_CLK_ENA BIT_31 /* Divide Core Clock Enable */ +#define PCI_CTL_SRESET_VMAIN_AV BIT_30 /* Soft Reset for Vmain_av De-Glitch */ +#define PCI_CTL_BYPASS_VMAIN_AV BIT_29 /* Bypass En. for Vmain_av De-Glitch */ +#define PCI_CTL_TIM_VMAIN_AV1 BIT_28 /* Bit 28..27: Timer Vmain_av Mask */ +#define PCI_CTL_TIM_VMAIN_AV0 BIT_27 /* Bit 28..27: Timer Vmain_av Mask */ +#define PCI_CTL_TIM_VMAIN_AV_MSK (BIT_28 | BIT_27) + /* Bit 26..16: Release Clock on Event */ +#define PCI_REL_PCIE_RST_DE_ASS BIT_26 /* PCIe Reset De-Asserted */ +#define PCI_REL_GPHY_REC_PACKET BIT_25 /* GPHY Received Packet */ +#define PCI_REL_INT_FIFO_N_EMPTY BIT_24 /* Internal FIFO Not Empty */ +#define PCI_REL_MAIN_PWR_AVAIL BIT_23 /* Main Power Available */ +#define PCI_REL_CLKRUN_REQ_REL BIT_22 /* CLKRUN Request Release */ +#define PCI_REL_PCIE_RESET_ASS BIT_21 /* PCIe Reset Asserted */ +#define PCI_REL_PME_ASSERTED BIT_20 /* PME Asserted */ +#define PCI_REL_PCIE_EXIT_L1_ST BIT_19 /* PCIe Exit L1 State */ +#define PCI_REL_LOADER_NOT_FIN BIT_18 /* EPROM Loader Not Finished */ +#define PCI_REL_PCIE_RX_EX_IDLE BIT_17 /* PCIe Rx Exit Electrical Idle State */ +#define PCI_REL_GPHY_LINK_UP BIT_16 /* GPHY Link Up */ + /* Bit 10.. 0: Mask for Gate Clock */ +#define PCI_GAT_PCIE_RST_ASSERTED BIT_10 /* PCIe Reset Asserted */ +#define PCI_GAT_GPHY_N_REC_PACKET BIT_9 /* GPHY Not Received Packet */ +#define PCI_GAT_INT_FIFO_EMPTY BIT_8 /* Internal FIFO Empty */ +#define PCI_GAT_MAIN_PWR_N_AVAIL BIT_7 /* Main Power Not Available */ +#define PCI_GAT_CLKRUN_REQ_REL BIT_6 /* CLKRUN Not Requested */ +#define PCI_GAT_PCIE_RESET_ASS BIT_5 /* PCIe Reset Asserted */ +#define PCI_GAT_PME_DE_ASSERTED BIT_4 /* PME De-Asserted */ +#define PCI_GAT_PCIE_ENTER_L1_ST BIT_3 /* PCIe Enter L1 State */ +#define PCI_GAT_LOADER_FINISHED BIT_2 /* EPROM Loader Finished */ +#define PCI_GAT_PCIE_RX_EL_IDLE BIT_1 /* PCIe Rx Electrical Idle State */ +#define PCI_GAT_GPHY_LINK_DOWN BIT_0 /* GPHY Link Down */ + +/* PCI_CFG_REG_1 32 bit Config Register 1 */ +#define PCI_CF1_DIS_REL_EVT_RST BIT_24 /* Dis. Rel. Event during PCIE reset */ + /* Bit 23..21: Release Clock on Event */ +#define PCI_CF1_REL_LDR_NOT_FIN BIT_23 /* EEPROM Loader Not Finished */ +#define PCI_CF1_REL_VMAIN_AVLBL BIT_22 /* Vmain available */ +#define PCI_CF1_REL_PCIE_RESET BIT_21 /* PCI-E reset */ + /* Bit 20..18: Gate Clock on Event */ +#define PCI_CF1_GAT_LDR_NOT_FIN BIT_20 /* EEPROM Loader Finished */ +#define PCI_CF1_GAT_PCIE_RX_IDLE BIT_19 /* PCI-E Rx Electrical idle */ +#define PCI_CF1_GAT_PCIE_RESET BIT_18 /* PCI-E Reset */ +#define PCI_CF1_PRST_PHY_CLKREQ BIT_17 /* Enable PCI-E rst & PM2PHY gen. CLKREQ */ +#define PCI_CF1_PCIE_RST_CLKREQ BIT_16 /* Enable PCI-E rst generate CLKREQ */ + +#define PCI_CF1_ENA_CFG_LDR_DONE BIT_8 /* Enable core level Config loader done */ +#define PCI_CF1_ENA_TXBMU_RD_IDLE BIT_1 /* Enable TX BMU Read IDLE for ASPM */ +#define PCI_CF1_ENA_TXBMU_WR_IDLE BIT_0 /* Enable TX BMU Write IDLE for ASPM */ + /* PEX_DEV_CTRL 16 bit PEX Device Control (Yukon-2) */ #define PEX_DC_MAX_RRS_MSK (7<<12) /* Bit 14..12: Max. Read Request Size */ #define PEX_DC_EN_NO_SNOOP BIT_11 /* Enable No Snoop */ @@ -621,6 +673,7 @@ #define B28_Y2_SMB_CSD_REG 0x0e44 /* 32 bit ASF SMB Control/Status/Data */ #define B28_Y2_ASF_IRQ_V_BASE 0x0e60 /* 32 bit ASF IRQ Vector Base */ #define B28_Y2_ASF_STAT_CMD 0x0e68 /* 32 bit ASF Status and Command Reg */ +#define B28_Y2_ASF_HCU_CCSR 0x0e68 /* 32 bit ASF HCU CCSR (Yukon EX) */ #define B28_Y2_ASF_HOST_COM 0x0e6c /* 32 bit ASF Host Communication Reg */ #define B28_Y2_DATA_REG_1 0x0e70 /* 32 bit ASF/Host Data Register 1 */ #define B28_Y2_DATA_REG_2 0x0e74 /* 32 bit ASF/Host Data Register 2 */ @@ -830,6 +883,7 @@ #define CHIP_ID_YUKON_LP 0xb2 /* Chip ID for YUKON-LP */ #define CHIP_ID_YUKON_XL 0xb3 /* Chip ID for YUKON-2 XL */ #define CHIP_ID_YUKON_EC_U 0xb4 /* Chip ID for YUKON-2 EC Ultra */ +#define CHIP_ID_YUKON_EX 0xb5 /* Chip ID for YUKON-2 Extreme */ #define CHIP_ID_YUKON_EC 0xb6 /* Chip ID for YUKON-2 EC */ #define CHIP_ID_YUKON_FE 0xb7 /* Chip ID for YUKON-2 FE */ #define CHIP_ID_YUKON_FE_P 0xb8 /* Chip ID for YUKON-2 FE+ */ @@ -848,6 +902,9 @@ #define CHIP_REV_YU_FE_P_A0 0 /* Chip Rev. for Yukon-2 FE+ A0 */ +#define CHIP_REV_YU_EX_A0 1 /* Chip Rev. for Yukon-2 EX A0 */ +#define CHIP_REV_YU_EX_B0 2 /* Chip Rev. for Yukon-2 EX B0 */ + /* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ #define Y2_STATUS_LNK2_INAC BIT_7 /* Status Link 2 inactiv (0 = activ) */ #define Y2_CLK_GAT_LNK2_DIS BIT_6 /* Disable clock gating Link 2 */ @@ -912,6 +969,18 @@ #define TST_CFG_WRITE_ON BIT_1 /* Enable Config Reg WR */ #define TST_CFG_WRITE_OFF BIT_0 /* Disable Config Reg WR */ +/* B2_GP_IO */ +#define GLB_GPIO_CLK_DEB_ENA BIT_31 /* Clock Debug Enable */ +#define GLB_GPIO_CLK_DBG_MSK 0x3c000000 /* Clock Debug */ + +#define GLB_GPIO_INT_RST_D3_DIS BIT_15 /* Disable Internal Reset After D3 to D0 */ +#define GLB_GPIO_LED_PAD_SPEED_UP BIT_14 /* LED PAD Speed Up */ +#define GLB_GPIO_STAT_RACE_DIS BIT_13 /* Status Race Disable */ +#define GLB_GPIO_TEST_SEL_MSK 0x00001800 /* Testmode Select */ +#define GLB_GPIO_TEST_SEL_BASE BIT_11 +#define GLB_GPIO_RAND_ENA BIT_10 /* Random Enable */ +#define GLB_GPIO_RAND_BIT_1 BIT_9 /* Random Bit 1 */ + /* B2_I2C_CTRL 32 bit I2C HW Control Register */ #define I2C_FLAG BIT_31 /* Start read/write if WR */ #define I2C_ADDR (0x7fff<<16) /* Bit 30..16: Addr to be RD/WR */ @@ -1033,13 +1102,16 @@ /* Bit 10..0: same as for Rx */ /* Q_F 32 bit Flag Register */ -#define F_ALM_FULL BIT_27 /* Rx FIFO: almost full */ -#define F_EMPTY BIT_27 /* Tx FIFO: empty flag */ -#define F_FIFO_EOF BIT_26 /* Tag (EOF Flag) bit in FIFO */ -#define F_WM_REACHED BIT_25 /* Watermark reached */ -#define F_M_RX_RAM_DIS BIT_24 /* MAC Rx RAM Read Port disable */ -#define F_FIFO_LEVEL (0x1f<<16) /* Bit 23..16: # of Qwords in FIFO */ -#define F_WATER_MARK 0x0007ff /* Bit 10.. 0: Watermark */ +#define F_TX_CHK_AUTO_OFF BIT_31 /* Tx checksum auto-calc Off(Yukon EX)*/ +#define F_TX_CHK_AUTO_ON BIT_30 /* Tx checksum auto-calc On(Yukon EX)*/ +#define F_ALM_FULL BIT_28 /* Rx FIFO: almost full */ +#define F_EMPTY BIT_27 /* Tx FIFO: empty flag */ +#define F_FIFO_EOF BIT_26 /* Tag (EOF Flag) bit in FIFO */ +#define F_WM_REACHED BIT_25 /* Watermark reached */ +#define F_M_RX_RAM_DIS BIT_24 /* MAC Rx RAM Read Port disable */ +#define F_FIFO_LEVEL (0x1f<<16) + /* Bit 23..16: # of Qwords in FIFO */ +#define F_WATER_MARK 0x0007ff/* Bit 10.. 0: Watermark */ /* Queue Prefetch Unit Offsets, use Y2_PREF_Q_ADDR() to address (Yukon-2 only)*/ /* PREF_UNIT_CTRL_REG 32 bit Prefetch Control register */ @@ -1927,6 +1999,28 @@ #define Y2_ASF_UC_STATE (3<<2) /* ASF uC State */ #define Y2_ASF_CLK_HALT 0 /* ASF system clock stopped */ +/* B28_Y2_ASF_HCU_CCSR 32bit CPU Control and Status Register (Yukon EX) */ +#define Y2_ASF_HCU_CCSR_SMBALERT_MONITOR BIT_27 /* SMBALERT pin monitor */ +#define Y2_ASF_HCU_CCSR_CPU_SLEEP BIT_26 /* CPU sleep status */ +#define Y2_ASF_HCU_CCSR_CS_TO BIT_25 /* Clock Stretching Timeout */ +#define Y2_ASF_HCU_CCSR_WDOG BIT_24 /* Watchdog Reset */ +#define Y2_ASF_HCU_CCSR_CLR_IRQ_HOST BIT_17 /* Clear IRQ_HOST */ +#define Y2_ASF_HCU_CCSR_SET_IRQ_HCU BIT_16 /* Set IRQ_HCU */ +#define Y2_ASF_HCU_CCSR_AHB_RST BIT_9 /* Reset AHB bridge */ +#define Y2_ASF_HCU_CCSR_CPU_RST_MODE BIT_8 /* CPU Reset Mode */ +#define Y2_ASF_HCU_CCSR_SET_SYNC_CPU BIT_5 +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE1 BIT_4 +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE0 BIT_3 +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE_MSK (BIT_4 | BIT_3) /* CPU Clock Divide */ +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE_BASE BIT_3 +#define Y2_ASF_HCU_CCSR_OS_PRSNT BIT_2 /* ASF OS Present */ + /* Microcontroller State */ +#define Y2_ASF_HCU_CCSR_UC_STATE_MSK 3 +#define Y2_ASF_HCU_CCSR_UC_STATE_BASE BIT_0 +#define Y2_ASF_HCU_CCSR_ASF_RESET 0 +#define Y2_ASF_HCU_CCSR_ASF_HALTED BIT_1 +#define Y2_ASF_HCU_CCSR_ASF_RUNNING BIT_0 + /* B28_Y2_ASF_HOST_COM 32 bit ASF Host Communication Reg */ /* This register is used by the ASF firmware */ #define Y2_ASF_CLR_ASFI BIT_1 /* Clear host IRQ */ @@ -1940,6 +2034,14 @@ #define SC_STAT_RST_SET BIT_0 /* Set Status Unit Reset */ /* GMAC_CTRL 32 bit GMAC Control Reg (YUKON only) */ +#define GMC_SEC_RST BIT_15 /* MAC SEC RST */ +#define GMC_SEC_RST_OFF BIT_14 /* MAC SEC RST Off */ +#define GMC_BYP_MACSECRX_ON BIT_13 /* Bypass MAC SEC RX */ +#define GMC_BYP_MACSECRX_OFF BIT_12 /* Bypass MAC SEC RX Off */ +#define GMC_BYP_MACSECTX_ON BIT_11 /* Bypass MAC SEC TX */ +#define GMC_BYP_MACSECTX_OFF BIT_10 /* Bypass MAC SEC TX Off */ +#define GMC_BYP_RETR_ON BIT_9 /* Bypass MAC retransmit FIFO On */ +#define GMC_BYP_RETR_OFF BIT_8 /* Bypass MAC retransmit FIFO Off */ #define GMC_H_BURST_ON BIT_7 /* Half Duplex Burst Mode On */ #define GMC_H_BURST_OFF BIT_6 /* Half Duplex Burst Mode Off */ #define GMC_F_LOOPB_ON BIT_5 /* FIFO Loopback On */ From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 04:35:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01086106566B; Tue, 2 Jun 2009 04:35:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E32638FC0A; Tue, 2 Jun 2009 04:35:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n524Zin0002472; Tue, 2 Jun 2009 04:35:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n524ZiNk002470; Tue, 2 Jun 2009 04:35:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200906020435.n524ZiNk002470@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 2 Jun 2009 04:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193294 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 04:35:45 -0000 Author: yongari Date: Tue Jun 2 04:35:44 2009 New Revision: 193294 URL: http://svn.freebsd.org/changeset/base/193294 Log: Add frame parser capability of Yukon FE+ and Yukon Extreme. With this feature hardware automatically computes TCP/UDP payload offset. Introduce MSK_FLAG_AUTOTX_CSUM to mark the capability. Yukon Extreme B0 revision is known to have a silicon for the feature so disable it. Yukon Extreme B0 still can do Tx checksum offloading but CPU have to compute TCP/UDP payload offset. To enable traditional checksum offloading, disable automatic Tx checksum calculation capability. Yukon Extreme A0 revision could not use store-and-forward mode for jumbo frames(silicon bug) so disable Tx checksum offloading for jumbo frames. I believe controllers that have MSK_FLAG_AUTOTX_CSUM capability or new descriptor format do not have Tx checksum offload bug so disable checksum offloading workaround for for short frames. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Jun 2 04:00:17 2009 (r193293) +++ head/sys/dev/msk/if_msk.c Tue Jun 2 04:35:44 2009 (r193294) @@ -1676,7 +1676,21 @@ mskc_attach(device_t dev) break; case CHIP_ID_YUKON_EX: sc->msk_clock = 125; /* 125 Mhz */ - sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2; + sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2 | + MSK_FLAG_AUTOTX_CSUM; + /* + * Yukon Extreme seems to have silicon bug for + * automatic Tx checksum calculation capability. + */ + if (sc->msk_hw_rev == CHIP_REV_YU_EX_B0) + sc->msk_pflags &= ~MSK_FLAG_AUTOTX_CSUM; + /* + * Yukon Extreme A0 could not use store-and-forward + * for jumbo frames, so disable Tx checksum + * offloading for jumbo frames. + */ + if (sc->msk_hw_rev == CHIP_REV_YU_EX_A0) + sc->msk_pflags |= MSK_FLAG_JUMBO_NOCSUM; break; case CHIP_ID_YUKON_FE: sc->msk_clock = 100; /* 100 Mhz */ @@ -1684,7 +1698,8 @@ mskc_attach(device_t dev) break; case CHIP_ID_YUKON_FE_P: sc->msk_clock = 50; /* 50 Mhz */ - sc->msk_pflags |= MSK_FLAG_FASTETHER | MSK_FLAG_DESCV2; + sc->msk_pflags |= MSK_FLAG_FASTETHER | MSK_FLAG_DESCV2 | + MSK_FLAG_AUTOTX_CSUM; if (sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) { /* * XXX @@ -2477,8 +2492,10 @@ msk_encap(struct msk_if_softc *sc_if, st tcp_offset = offset = 0; m = *m_head; - if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && - (m->m_pkthdr.csum_flags & (MSK_CSUM_FEATURES | CSUM_TSO)) != 0) { + if (((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && + (m->m_pkthdr.csum_flags & MSK_CSUM_FEATURES) != 0) || + ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (m->m_pkthdr.csum_flags & CSUM_TSO) != 0)) { /* * Since mbuf has no protocol specific structure information * in it we have to inspect protocol information here to @@ -2537,9 +2554,12 @@ msk_encap(struct msk_if_softc *sc_if, st * resort to S/W checksum routine when we encounter short * TCP frames. * Short UDP packets appear to be handled correctly by - * Yukon II. + * Yukon II. Also I assume this bug does not happen on + * controllers that use newer descriptor format or + * automatic Tx checksum calaulcation. */ - if (m->m_pkthdr.len < MSK_MIN_FRAMELEN && + if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && + (m->m_pkthdr.len < MSK_MIN_FRAMELEN) && (m->m_pkthdr.csum_flags & CSUM_TCP) != 0) { m = m_pullup(m, offset + sizeof(struct tcphdr)); if (m == NULL) { @@ -2640,7 +2660,7 @@ msk_encap(struct msk_if_softc *sc_if, st } /* Check if we have to handle checksum offload. */ if (tso == 0 && (m->m_pkthdr.csum_flags & MSK_CSUM_FEATURES) != 0) { - if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0) + if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) != 0) control |= CALSUM; else { tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; @@ -3784,10 +3804,23 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_CSR), BMU_OPER_INIT); CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_CSR), BMU_FIFO_OP_ON); CSR_WRITE_2(sc, Q_ADDR(sc_if->msk_txq, Q_WM), MSK_BMU_TX_WM); - if (sc->msk_hw_id == CHIP_ID_YUKON_EC_U && - sc->msk_hw_rev == CHIP_REV_YU_EC_U_A0) { - /* Fix for Yukon-EC Ultra: set BMU FIFO level */ - CSR_WRITE_2(sc, Q_ADDR(sc_if->msk_txq, Q_AL), MSK_ECU_TXFF_LEV); + switch (sc->msk_hw_id) { + case CHIP_ID_YUKON_EC_U: + if (sc->msk_hw_rev == CHIP_REV_YU_EC_U_A0) { + /* Fix for Yukon-EC Ultra: set BMU FIFO level */ + CSR_WRITE_2(sc, Q_ADDR(sc_if->msk_txq, Q_AL), + MSK_ECU_TXFF_LEV); + } + break; + case CHIP_ID_YUKON_EX: + /* + * Yukon Extreme seems to have silicon bug for + * automatic Tx checksum calculation capability. + */ + if (sc->msk_hw_rev == CHIP_REV_YU_EX_B0) + CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_F), + F_TX_CHK_AUTO_OFF); + break; } /* Setup Rx Queue Bus Memory Interface. */ Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:00:17 2009 (r193293) +++ head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:35:44 2009 (r193294) @@ -2502,8 +2502,9 @@ struct msk_if_softc { #define MSK_FLAG_JUMBO_NOCSUM 0x0010 #define MSK_FLAG_RAMBUF 0x0020 #define MSK_FLAG_DESCV2 0x0040 -#define MSK_FLAG_NOHWVLAN 0x0080 -#define MSK_FLAG_NORXCHK 0x0100 +#define MSK_FLAG_AUTOTX_CSUM 0x0080 +#define MSK_FLAG_NOHWVLAN 0x0100 +#define MSK_FLAG_NORXCHK 0x0200 #define MSK_FLAG_SUSPEND 0x2000 #define MSK_FLAG_DETACH 0x4000 #define MSK_FLAG_LINK 0x8000 From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 04:45:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 916241065674; Tue, 2 Jun 2009 04:45:56 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 801928FC0A; Tue, 2 Jun 2009 04:45:56 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n524juTY002772; Tue, 2 Jun 2009 04:45:56 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n524juhw002771; Tue, 2 Jun 2009 04:45:56 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200906020445.n524juhw002771@svn.freebsd.org> From: Joseph Koshy Date: Tue, 2 Jun 2009 04:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193296 - head/usr.sbin/pmcstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 04:45:57 -0000 Author: jkoshy Date: Tue Jun 2 04:45:56 2009 New Revision: 193296 URL: http://svn.freebsd.org/changeset/base/193296 Log: Catch up with the times: "mozilla" -> "firefox". Modified: head/usr.sbin/pmcstat/pmcstat.8 Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Tue Jun 2 04:44:38 2009 (r193295) +++ head/usr.sbin/pmcstat/pmcstat.8 Tue Jun 2 04:45:56 2009 (r193296) @@ -312,10 +312,10 @@ use: .Dl "pmcstat -O sample.stat -n 32768 -S k7-retired-instructions" .Pp To execute -.Nm mozilla +.Nm firefox and measure the number of data cache misses suffered by it and its children every 12 seconds on an AMD Athlon, use: -.Dl "pmcstat -d -w 12 -p k7-dc-misses mozilla" +.Dl "pmcstat -d -w 12 -p k7-dc-misses firefox" .Pp To measure instructions retired for all processes named .Dq emacs From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 04:59:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE0111065678; Tue, 2 Jun 2009 04:59:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC3128FC0C; Tue, 2 Jun 2009 04:59:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n524xTNM003103; Tue, 2 Jun 2009 04:59:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n524xTE5003101; Tue, 2 Jun 2009 04:59:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200906020459.n524xTE5003101@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 2 Jun 2009 04:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193298 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 04:59:30 -0000 Author: yongari Date: Tue Jun 2 04:59:29 2009 New Revision: 193298 URL: http://svn.freebsd.org/changeset/base/193298 Log: Add Rx checksum offloading support for Yukon FE+ and Yukon Extreme. These controllers use newer descriptor format and the new descriptor format uses status LE to indicate the status of checksum. Rx checksummed value used in previous controllers were very cryptic and I failed to understand how to use them. In addition most controllers in previous generations had Rx checksum offloading bug. While I'm here introduce a MSK_FLAG_NORX_CSUM flag to bypass checking Rx checksum offloading as Yukon FE+ A0 has status LE bug. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Jun 2 04:47:28 2009 (r193297) +++ head/sys/dev/msk/if_msk.c Tue Jun 2 04:59:29 2009 (r193298) @@ -258,8 +258,8 @@ static void msk_intr_hwerr(struct msk_so #ifndef __NO_STRICT_ALIGNMENT static __inline void msk_fixup_rx(struct mbuf *); #endif -static void msk_rxeof(struct msk_if_softc *, uint32_t, int); -static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, int); +static void msk_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); +static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); static void msk_txeof(struct msk_if_softc *, int); static int msk_encap(struct msk_if_softc *, struct mbuf **); static void msk_tx_task(void *, int); @@ -267,6 +267,7 @@ static void msk_start(struct ifnet *); static int msk_ioctl(struct ifnet *, u_long, caddr_t); static void msk_set_prefetch(struct msk_softc *, int, bus_addr_t, uint32_t); static void msk_set_rambuffer(struct msk_if_softc *); +static void msk_set_tx_stfwd(struct msk_if_softc *); static void msk_init(void *); static void msk_init_locked(struct msk_if_softc *); static void msk_stop(struct msk_if_softc *); @@ -991,12 +992,17 @@ msk_ioctl(struct ifnet *ifp, u_long comm else ifp->if_hwassist &= ~MSK_CSUM_FEATURES; } + if ((mask & IFCAP_RXCSUM) != 0 && + (IFCAP_RXCSUM & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; msk_setvlan(sc_if, ifp); } - + if ((mask & IFCAP_VLAN_HWCSUM) != 0 && + (IFCAP_VLAN_HWCSUM & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; if ((mask & IFCAP_TSO4) != 0 && (IFCAP_TSO4 & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_TSO4; @@ -1492,6 +1498,13 @@ msk_attach(device_t dev) * make Rx checksum offload work on Yukon II hardware. */ ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TSO4; + /* + * Enable Rx checksum offloading if controller support new + * descriptor format. + */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && + (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) + ifp->if_capabilities |= IFCAP_RXCSUM; ifp->if_hwassist = MSK_CSUM_FEATURES | CSUM_TSO; ifp->if_capenable = ifp->if_capabilities; ifp->if_ioctl = msk_ioctl; @@ -1535,6 +1548,13 @@ msk_attach(device_t dev) * for VLAN interface. */ ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; + /* + * Enable Rx checksum offloading for VLAN taggedd frames + * if controller support new descriptor format. + */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && + (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) + ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; } ifp->if_capenable = ifp->if_capabilities; @@ -1711,7 +1731,8 @@ mskc_attach(device_t dev) * Just pass received frames to upper stack with * minimal test and let upper stack handle them. */ - sc->msk_pflags |= MSK_FLAG_NOHWVLAN | MSK_FLAG_NORXCHK; + sc->msk_pflags |= MSK_FLAG_NOHWVLAN | + MSK_FLAG_NORXCHK | MSK_FLAG_NORX_CSUM; } break; case CHIP_ID_YUKON_XL: @@ -2942,7 +2963,8 @@ msk_fixup_rx(struct mbuf *m) #endif static void -msk_rxeof(struct msk_if_softc *sc_if, uint32_t status, int len) +msk_rxeof(struct msk_if_softc *sc_if, uint32_t status, uint32_t control, + int len) { struct mbuf *m; struct ifnet *ifp; @@ -2994,6 +3016,18 @@ msk_rxeof(struct msk_if_softc *sc_if, ui msk_fixup_rx(m); #endif ifp->if_ipackets++; + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && + (control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((control & CSS_IPV4_CSUM_OK) != 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + if ((control & (CSS_TCP | CSS_UDP)) != 0 && + (control & (CSS_TCPUDP_CSUM_OK)) != 0) { + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + } /* Check for VLAN tagged packets. */ if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { @@ -3010,7 +3044,8 @@ msk_rxeof(struct msk_if_softc *sc_if, ui } static void -msk_jumbo_rxeof(struct msk_if_softc *sc_if, uint32_t status, int len) +msk_jumbo_rxeof(struct msk_if_softc *sc_if, uint32_t status, uint32_t control, + int len) { struct mbuf *m; struct ifnet *ifp; @@ -3051,6 +3086,18 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_ msk_fixup_rx(m); #endif ifp->if_ipackets++; + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && + (control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((control & CSS_IPV4_CSUM_OK) != 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + if ((control & (CSS_TCP | CSS_UDP)) != 0 && + (control & (CSS_TCPUDP_CSUM_OK)) != 0) { + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + } /* Check for VLAN tagged packets. */ if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { @@ -3379,9 +3426,9 @@ msk_handle_events(struct msk_softc *sc) case OP_RXSTAT: if (sc_if->msk_framesize > (MCLBYTES - MSK_RX_BUF_ALIGN)) - msk_jumbo_rxeof(sc_if, status, len); + msk_jumbo_rxeof(sc_if, status, control, len); else - msk_rxeof(sc_if, status, len); + msk_rxeof(sc_if, status, control, len); rxprog++; /* * Because there is no way to sync single Rx LE Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:47:28 2009 (r193297) +++ head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:59:29 2009 (r193298) @@ -2255,8 +2255,19 @@ struct msk_stat_desc { #define OP_PUTIDX 0x70000000 #define STLE_OP_MASK 0xff000000 +#define STLE_CSS_MASK 0x00ff0000 #define STLE_LEN_MASK 0x0000ffff +/* CSS defined in status LE(valid for descriptor V2 format). */ +#define CSS_TCPUDP_CSUM_OK 0x00800000 +#define CSS_UDP 0x00400000 +#define CSS_TCP 0x00200000 +#define CSS_IPFRAG 0x00100000 +#define CSS_IPV6 0x00080000 +#define CSS_IPV4_CSUM_OK 0x00040000 +#define CSS_IPV4 0x00020000 +#define CSS_PORT 0x00010000 + /* Descriptor Bit Definition */ /* TxCtrl Transmit Buffer Control Field */ /* RxCtrl Receive Buffer Control Field */ @@ -2505,6 +2516,7 @@ struct msk_if_softc { #define MSK_FLAG_AUTOTX_CSUM 0x0080 #define MSK_FLAG_NOHWVLAN 0x0100 #define MSK_FLAG_NORXCHK 0x0200 +#define MSK_FLAG_NORX_CSUM 0x0400 #define MSK_FLAG_SUSPEND 0x2000 #define MSK_FLAG_DETACH 0x4000 #define MSK_FLAG_LINK 0x8000 From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 05:08:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B06B3106566B; Tue, 2 Jun 2009 05:08:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8480C8FC08; Tue, 2 Jun 2009 05:08:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5258vjb003328; Tue, 2 Jun 2009 05:08:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5258vOe003326; Tue, 2 Jun 2009 05:08:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200906020508.n5258vOe003326@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 2 Jun 2009 05:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193299 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 05:08:58 -0000 Author: yongari Date: Tue Jun 2 05:08:57 2009 New Revision: 193299 URL: http://svn.freebsd.org/changeset/base/193299 Log: Add Yukon Extreme device ids, 88E8071 and 88E8072. While I'm here correct description of 88E8070. 88E8070 is Yukon Extreme and have gigabit PHY. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Jun 2 04:59:29 2009 (r193298) +++ head/sys/dev/msk/if_msk.c Tue Jun 2 05:08:57 2009 (r193299) @@ -203,8 +203,6 @@ static struct msk_product { "Marvell Yukon 88E8040T Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8048, "Marvell Yukon 88E8048 Fast Ethernet" }, - { VENDORID_MARVELL, DEVICEID_MRVL_8070, - "Marvell Yukon 88E8070 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4361, "Marvell Yukon 88E8050 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4360, @@ -215,8 +213,14 @@ static struct msk_product { "Marvell Yukon 88E8055 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4364, "Marvell Yukon 88E8056 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_4365, + "Marvell Yukon 88E8070 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_436A, "Marvell Yukon 88E8058 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_436B, + "Marvell Yukon 88E8071 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_436C, + "Marvell Yukon 88E8072 Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE550SX, "D-Link 550SX Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE560T, Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:59:29 2009 (r193298) +++ head/sys/dev/msk/if_mskreg.h Tue Jun 2 05:08:57 2009 (r193299) @@ -139,8 +139,10 @@ #define DEVICEID_MRVL_4362 0x4362 #define DEVICEID_MRVL_4363 0x4363 #define DEVICEID_MRVL_4364 0x4364 -#define DEVICEID_MRVL_8070 0x4365 +#define DEVICEID_MRVL_4365 0x4365 #define DEVICEID_MRVL_436A 0x436A +#define DEVICEID_MRVL_436B 0x436B +#define DEVICEID_MRVL_436C 0x436C /* * D-Link gigabit ethernet device ID From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 05:13:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A971106566C; Tue, 2 Jun 2009 05:13:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED5DA8FC13; Tue, 2 Jun 2009 05:13:02 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n525D2wL003473; Tue, 2 Jun 2009 05:13:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n525D2Oe003472; Tue, 2 Jun 2009 05:13:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200906020513.n525D2Oe003472@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 2 Jun 2009 05:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193300 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 05:13:03 -0000 Author: yongari Date: Tue Jun 2 05:13:02 2009 New Revision: 193300 URL: http://svn.freebsd.org/changeset/base/193300 Log: Add 88E8071, 88E8072 to the supported hardware list. While I'm here correct description of 88E8070. It's Yukon Extreme and have gigabit PHY. Modified: head/share/man/man4/msk.4 Modified: head/share/man/man4/msk.4 ============================================================================== --- head/share/man/man4/msk.4 Tue Jun 2 05:08:57 2009 (r193299) +++ head/share/man/man4/msk.4 Tue Jun 2 05:13:02 2009 (r193300) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2009 +.Dd June 2, 2009 .Dt MSK 4 .Os .Sh NAME @@ -202,7 +202,11 @@ Marvell Yukon 88E8056 Gigabit Ethernet .It Marvell Yukon 88E8058 Gigabit Ethernet .It -Marvell Yukon 88E8070 Fast Ethernet +Marvell Yukon 88E8070 Gigabit Ethernet +.It +Marvell Yukon 88E8071 Gigabit Ethernet +.It +Marvell Yukon 88E8072 Gigabit Ethernet .It SysKonnect SK-9Sxx Gigabit Ethernet .It From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 06:55:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03B021065670; Tue, 2 Jun 2009 06:55:33 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6DCE8FC0C; Tue, 2 Jun 2009 06:55:32 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n526tWeg005451; Tue, 2 Jun 2009 06:55:32 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n526tWQH005450; Tue, 2 Jun 2009 06:55:32 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200906020655.n526tWQH005450@svn.freebsd.org> From: Jeff Roberson Date: Tue, 2 Jun 2009 06:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193301 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 06:55:33 -0000 Author: jeff Date: Tue Jun 2 06:55:32 2009 New Revision: 193301 URL: http://svn.freebsd.org/changeset/base/193301 Log: - Use an acquire barrier to increment f_count in fget_unlocked and remove the volatile cast. Describe the reason in detail in a comment. Discussed with: bde, jhb Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Jun 2 05:13:02 2009 (r193300) +++ head/sys/kern/kern_descrip.c Tue Jun 2 06:55:32 2009 (r193301) @@ -2075,9 +2075,13 @@ fget_unlocked(struct filedesc *fdp, int count = fp->f_count; if (count == 0) continue; - if (atomic_cmpset_int(&fp->f_count, count, count + 1) != 1) + /* + * Use an acquire barrier to prevent caching of fd_ofiles + * so it is refreshed for verification. + */ + if (atomic_cmpset_acq_int(&fp->f_count, count, count + 1) != 1) continue; - if (fp == ((struct file *volatile*)fdp->fd_ofiles)[fd]) + if (fp == fdp->fd_ofiles[fd]) break; fdrop(fp, curthread); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 07:35:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF980106564A; Tue, 2 Jun 2009 07:35:51 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE6838FC17; Tue, 2 Jun 2009 07:35:51 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n527ZpbL006239; Tue, 2 Jun 2009 07:35:51 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n527Zppv006238; Tue, 2 Jun 2009 07:35:51 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200906020735.n527Zppv006238@svn.freebsd.org> From: Brian Somers Date: Tue, 2 Jun 2009 07:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193302 - head/etc/periodic/daily X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 07:35:52 -0000 Author: brian Date: Tue Jun 2 07:35:51 2009 New Revision: 193302 URL: http://svn.freebsd.org/changeset/base/193302 Log: Rather than using both -prune (which requires directory-first tree traversal) and -delete (which implies depth-first traversal), avoid using -delete in favour of -execdir. This has a side-effect of not removing directories that contain files, even if we delete all of those files, but IMHO that's a better option than specifying all possible local filesystem types in this script. PR: 122811 MFC after: 3 weeks Modified: head/etc/periodic/daily/100.clean-disks Modified: head/etc/periodic/daily/100.clean-disks ============================================================================== --- head/etc/periodic/daily/100.clean-disks Tue Jun 2 06:55:32 2009 (r193301) +++ head/etc/periodic/daily/100.clean-disks Tue Jun 2 07:35:51 2009 (r193302) @@ -29,7 +29,7 @@ case "$daily_clean_disks_enable" in echo "" echo "Cleaning disks:" set -f noglob - args="$args -name "`echo "$daily_clean_disks_files" | + args="-name "`echo "$daily_clean_disks_files" | sed -e 's/^[ ]*//' \ -e 's/[ ]*$//' \ -e 's/[ ][ ]*/ -o -name /g'` @@ -41,9 +41,9 @@ case "$daily_clean_disks_enable" in print=;; esac - rc=$(find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \ - \( $args \) -atime +$daily_clean_disks_days -delete $print | - tee /dev/stderr | wc -l) + rc=$(find / \( ! -fstype local -o -fstype rdonly \) -prune -o \ + \( $args \) -atime +$daily_clean_disks_days \ + -execdir rm -df {} \; $print | tee /dev/stderr | wc -l) [ -z "$print" ] && rc=0 [ $rc -gt 1 ] && rc=1 set -f glob From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 07:50:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74FA8106564A; Tue, 2 Jun 2009 07:50:08 +0000 (UTC) (envelope-from prvs=13978336d1=brian@Awfulhak.org) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id 15E778FC26; Tue, 2 Jun 2009 07:50:07 +0000 (UTC) (envelope-from prvs=13978336d1=brian@Awfulhak.org) Received: from pd4ml2so-ssvc.prod.shaw.ca ([10.0.141.136]) by pd4mo1so-svcs.prod.shaw.ca with ESMTP; 02 Jun 2009 01:21:59 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=0 a=00oY-3fLdEK2Tr9ouLEA:9 a=8dWpSQzE5nIiinARJIuWRnGFw9gA:4 a=z2jkVXLrYuwA:10 a=WJ3hkfHDukgA:10 a=SV7veod9ZcQA:10 a=_W7fz1QDWZwA:10 Received: from unknown (HELO store.lan.Awfulhak.org) ([174.7.23.140]) by pd4ml2so-dmz.prod.shaw.ca with ESMTP; 02 Jun 2009 01:21:58 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 4EE56C433AC_A24D32DB; Tue, 2 Jun 2009 07:22:21 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id 1E9EBC460F8_A24D325F; Tue, 2 Jun 2009 07:22:13 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.3/8.14.3) with ESMTP id n527Lnlt097436; Tue, 2 Jun 2009 00:21:50 -0700 (PDT) (envelope-from brian@Awfulhak.org) Date: Tue, 2 Jun 2009 00:21:49 -0700 From: Brian Somers To: Bruce Simpson Message-ID: <20090602002149.1d7822b2@dev.lan.Awfulhak.org> In-Reply-To: <4A23E6E4.7020506@incunabulum.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Doug Barton , src-committers@FreeBSD.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 07:50:09 -0000 On Mon, 01 Jun 2009 15:34:12 +0100 Bruce Simpson wrote: > Doug Barton wrote: > > Log: > > Eliminate the warning that "Values of network_interfaces other than > > AUTO are deprecated.' There is no good reason to deprecate them, and > > setting this to different values can be useful for custom solutions > > and/or one-off configuration problems. > > > > Thanks, I wasn't sure what the alternative to this functionality was > going to be, and was relying on this mechanism for a product. +1 - I rely on it to handle renamed interfaces properly (ifconfig -l gives different answers before and after the rename(s)). -- Brian Somers Don't _EVER_ lose your sense of humour ! From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 08:02:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF09F106567C; Tue, 2 Jun 2009 08:02:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD3658FC1D; Tue, 2 Jun 2009 08:02:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5282ROp006796; Tue, 2 Jun 2009 08:02:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5282RM0006794; Tue, 2 Jun 2009 08:02:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906020802.n5282RM0006794@svn.freebsd.org> From: Alan Cox Date: Tue, 2 Jun 2009 08:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193303 - in head/sys: kern vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 08:02:28 -0000 Author: alc Date: Tue Jun 2 08:02:27 2009 New Revision: 193303 URL: http://svn.freebsd.org/changeset/base/193303 Log: Correct a boundary case error in the management of a page's dirty bits by shm_dotruncate() and vnode_pager_setsize(). Specifically, if the length of a shared memory object or a file is truncated such that the length modulo the page size is between 1 and 511, then all of the page's dirty bits were cleared. Now, a dirty bit is cleared only if the corresponding block is truncated in its entirety. Modified: head/sys/kern/uipc_shm.c head/sys/vm/vnode_pager.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Tue Jun 2 07:35:51 2009 (r193302) +++ head/sys/kern/uipc_shm.c Tue Jun 2 08:02:27 2009 (r193303) @@ -274,7 +274,7 @@ shm_dotruncate(struct shmfd *shmfd, off_ /* * If the last page is partially mapped, then zero out * the garbage at the end of the page. See comments - * in vnode_page_setsize() for more details. + * in vnode_pager_setsize() for more details. * * XXXJHB: This handles in memory pages, but what about * a page swapped out to disk? @@ -286,10 +286,23 @@ shm_dotruncate(struct shmfd *shmfd, off_ int size = PAGE_SIZE - base; pmap_zero_page_area(m, base, size); + + /* + * Update the valid bits to reflect the blocks that + * have been zeroed. Some of these valid bits may + * have already been set. + */ + vm_page_set_valid(m, base, size); + + /* + * Round "base" to the next block boundary so that the + * dirty bit for a partially zeroed block is not + * cleared. + */ + base = roundup2(base, DEV_BSIZE); + vm_page_lock_queues(); - vm_page_set_validclean(m, base, size); - if (m->dirty != 0) - m->dirty = VM_PAGE_BITS_ALL; + vm_page_clear_dirty(m, base, PAGE_SIZE - base); vm_page_unlock_queues(); } else if ((length & PAGE_MASK) && __predict_false(object->cache != NULL)) { Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Jun 2 07:35:51 2009 (r193302) +++ head/sys/vm/vnode_pager.c Tue Jun 2 08:02:27 2009 (r193303) @@ -403,22 +403,28 @@ vnode_pager_setsize(vp, nsize) pmap_zero_page_area(m, base, size); /* - * Clear out partial-page dirty bits. This - * has the side effect of setting the valid - * bits, but that is ok. There are a bunch - * of places in the VM system where we expected - * m->dirty == VM_PAGE_BITS_ALL. The file EOF - * case is one of them. If the page is still - * partially dirty, make it fully dirty. + * Update the valid bits to reflect the blocks that + * have been zeroed. Some of these valid bits may + * have already been set. + */ + vm_page_set_valid(m, base, size); + + /* + * Round "base" to the next block boundary so that the + * dirty bit for a partially zeroed block is not + * cleared. + */ + base = roundup2(base, DEV_BSIZE); + + /* + * Clear out partial-page dirty bits. * * note that we do not clear out the valid * bits. This would prevent bogus_page * replacement from working properly. */ vm_page_lock_queues(); - vm_page_set_validclean(m, base, size); - if (m->dirty != 0) - m->dirty = VM_PAGE_BITS_ALL; + vm_page_clear_dirty(m, base, PAGE_SIZE - base); vm_page_unlock_queues(); } else if ((nsize & PAGE_MASK) && __predict_false(object->cache != NULL)) { From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 09:58:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33565106564A; Tue, 2 Jun 2009 09:58:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2130F8FC23; Tue, 2 Jun 2009 09:58:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n529wI8q009199; Tue, 2 Jun 2009 09:58:18 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n529wImV009198; Tue, 2 Jun 2009 09:58:18 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906020958.n529wImV009198@svn.freebsd.org> From: Robert Watson Date: Tue, 2 Jun 2009 09:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193305 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 09:58:18 -0000 Author: rwatson Date: Tue Jun 2 09:58:17 2009 New Revision: 193305 URL: http://svn.freebsd.org/changeset/base/193305 Log: Add support for the four PUC serial interfaces found on IBM SurePOS 300 series POS terminals. MFC after: 3 days Submitted by: Marc Balmer Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Tue Jun 2 09:25:56 2009 (r193304) +++ head/sys/dev/puc/pucdata.c Tue Jun 2 09:58:17 2009 (r193305) @@ -234,6 +234,17 @@ const struct puc_cfg puc_pci_devices[] = }, /* + * IBM SurePOS 300 Series (481033H) serial ports + * Details can be found on the IBM RSS websites + */ + + { 0x1014, 0x0297, 0xffff, 0, + "IBM SurePOS 300 Series (481033H) serial ports", + DEFAULT_RCLK, + PUC_PORT_4S, 0x10, 4, 0 + }, + + /* * SIIG Boards. * * SIIG provides documentation for their boards at: From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 12:35:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11AE4106567B; Tue, 2 Jun 2009 12:35:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 002C88FC24; Tue, 2 Jun 2009 12:35:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52CZ49D015808; Tue, 2 Jun 2009 12:35:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52CZ4BF015807; Tue, 2 Jun 2009 12:35:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906021235.n52CZ4BF015807@svn.freebsd.org> From: John Baldwin Date: Tue, 2 Jun 2009 12:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193306 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 12:35:05 -0000 Author: jhb Date: Tue Jun 2 12:35:04 2009 New Revision: 193306 URL: http://svn.freebsd.org/changeset/base/193306 Log: Include for va_*(). I'm not sure how this compiled on amd64 without this. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Jun 2 09:58:17 2009 (r193305) +++ head/sys/dev/pci/pci.c Tue Jun 2 12:35:04 2009 (r193306) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(__i386__) || defined(__amd64__) #include From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 13:03:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33FA3106566B; Tue, 2 Jun 2009 13:03:36 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 175288FC1D; Tue, 2 Jun 2009 13:03:36 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52D3ZUM016390; Tue, 2 Jun 2009 13:03:35 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52D3ZwD016385; Tue, 2 Jun 2009 13:03:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200906021303.n52D3ZwD016385@svn.freebsd.org> From: Attilio Rao Date: Tue, 2 Jun 2009 13:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193307 - in head/sys: kern sys ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 13:03:36 -0000 Author: attilio Date: Tue Jun 2 13:03:35 2009 New Revision: 193307 URL: http://svn.freebsd.org/changeset/base/193307 Log: Handle lock recursion differenty by always checking against LO_RECURSABLE instead the lock own flag itself. Tested by: pho Modified: head/sys/kern/kern_lock.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Tue Jun 2 12:35:04 2009 (r193306) +++ head/sys/kern/kern_lock.c Tue Jun 2 13:03:35 2009 (r193307) @@ -51,8 +51,7 @@ __FBSDID("$FreeBSD$"); #include #endif -CTASSERT(((LK_CANRECURSE | LK_NOSHARE) & LO_CLASSFLAGS) == - (LK_CANRECURSE | LK_NOSHARE)); +CTASSERT((LK_NOSHARE & LO_CLASSFLAGS) == LK_NOSHARE); #define SQ_EXCLUSIVE_QUEUE 0 #define SQ_SHARED_QUEUE 1 @@ -316,7 +315,9 @@ lockinit(struct lock *lk, int pri, const MPASS((flags & ~LK_INIT_MASK) == 0); - iflags = LO_RECURSABLE | LO_SLEEPABLE | LO_UPGRADABLE; + iflags = LO_SLEEPABLE | LO_UPGRADABLE; + if (flags & LK_CANRECURSE) + iflags |= LO_RECURSABLE; if ((flags & LK_NODUP) == 0) iflags |= LO_DUPOK; if (flags & LK_NOPROFILE) @@ -325,7 +326,7 @@ lockinit(struct lock *lk, int pri, const iflags |= LO_WITNESS; if (flags & LK_QUIET) iflags |= LO_QUIET; - iflags |= flags & (LK_CANRECURSE | LK_NOSHARE); + iflags |= flags & LK_NOSHARE; lk->lk_lock = LK_UNLOCKED; lk->lk_recurse = 0; @@ -530,7 +531,7 @@ __lockmgr_args(struct lock *lk, u_int fl */ if (lockmgr_xlocked(lk)) { if ((flags & LK_CANRECURSE) == 0 && - (lk->lock_object.lo_flags & LK_CANRECURSE) == 0) { + (lk->lock_object.lo_flags & LO_RECURSABLE) == 0) { /* * If the lock is expected to not panic just Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Jun 2 12:35:04 2009 (r193306) +++ head/sys/kern/kern_rwlock.c Tue Jun 2 13:03:35 2009 (r193307) @@ -51,8 +51,6 @@ __FBSDID("$FreeBSD$"); #include -CTASSERT((RW_RECURSE & LO_CLASSFLAGS) == RW_RECURSE); - #if defined(SMP) && !defined(NO_ADAPTIVE_RWLOCKS) #define ADAPTIVE_RWLOCKS #endif @@ -177,16 +175,17 @@ rw_init_flags(struct rwlock *rw, const c MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET | RW_RECURSE)) == 0); - flags = LO_UPGRADABLE | LO_RECURSABLE; + flags = LO_UPGRADABLE; if (opts & RW_DUPOK) flags |= LO_DUPOK; if (opts & RW_NOPROFILE) flags |= LO_NOPROFILE; if (!(opts & RW_NOWITNESS)) flags |= LO_WITNESS; + if (opts & RW_RECURSE) + flags |= LO_RECURSABLE; if (opts & RW_QUIET) flags |= LO_QUIET; - flags |= opts & RW_RECURSE; rw->rw_lock = RW_UNLOCKED; rw->rw_recurse = 0; @@ -249,7 +248,8 @@ _rw_try_wlock(struct rwlock *rw, const c KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_try_wlock() of destroyed rwlock @ %s:%d", file, line)); - if (rw_wlocked(rw) && (rw->lock_object.lo_flags & RW_RECURSE) != 0) { + if (rw_wlocked(rw) && + (rw->lock_object.lo_flags & LO_RECURSABLE) != 0) { rw->rw_recurse++; rval = 1; } else @@ -646,7 +646,7 @@ _rw_wlock_hard(struct rwlock *rw, uintpt #endif if (rw_wlocked(rw)) { - KASSERT(rw->lock_object.lo_flags & RW_RECURSE, + KASSERT(rw->lock_object.lo_flags & LO_RECURSABLE, ("%s: recursing but non-recursive rw %s @ %s:%d\n", __func__, rw->lock_object.lo_name, file, line)); rw->rw_recurse++; Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Tue Jun 2 12:35:04 2009 (r193306) +++ head/sys/kern/kern_sx.c Tue Jun 2 13:03:35 2009 (r193307) @@ -66,8 +66,7 @@ __FBSDID("$FreeBSD$"); #define ADAPTIVE_SX #endif -CTASSERT(((SX_NOADAPTIVE | SX_RECURSE) & LO_CLASSFLAGS) == - (SX_NOADAPTIVE | SX_RECURSE)); +CTASSERT((SX_NOADAPTIVE & LO_CLASSFLAGS) == SX_NOADAPTIVE); /* Handy macros for sleep queues. */ #define SQ_EXCLUSIVE_QUEUE 0 @@ -207,17 +206,19 @@ sx_init_flags(struct sx *sx, const char MPASS((opts & ~(SX_QUIET | SX_RECURSE | SX_NOWITNESS | SX_DUPOK | SX_NOPROFILE | SX_NOADAPTIVE)) == 0); - flags = LO_RECURSABLE | LO_SLEEPABLE | LO_UPGRADABLE; + flags = LO_SLEEPABLE | LO_UPGRADABLE; if (opts & SX_DUPOK) flags |= LO_DUPOK; if (opts & SX_NOPROFILE) flags |= LO_NOPROFILE; if (!(opts & SX_NOWITNESS)) flags |= LO_WITNESS; + if (opts & SX_RECURSE) + flags |= LO_RECURSABLE; if (opts & SX_QUIET) flags |= LO_QUIET; - flags |= opts & (SX_NOADAPTIVE | SX_RECURSE); + flags |= opts & SX_NOADAPTIVE; sx->sx_lock = SX_LOCK_UNLOCKED; sx->sx_recurse = 0; lock_init(&sx->lock_object, &lock_class_sx, description, NULL, flags); @@ -305,7 +306,8 @@ _sx_try_xlock(struct sx *sx, const char KASSERT(sx->sx_lock != SX_LOCK_DESTROYED, ("sx_try_xlock() of destroyed sx @ %s:%d", file, line)); - if (sx_xlocked(sx) && (sx->lock_object.lo_flags & SX_RECURSE) != 0) { + if (sx_xlocked(sx) && + (sx->lock_object.lo_flags & LO_RECURSABLE) != 0) { sx->sx_recurse++; atomic_set_ptr(&sx->sx_lock, SX_LOCK_RECURSED); rval = 1; @@ -479,7 +481,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t /* If we already hold an exclusive lock, then recurse. */ if (sx_xlocked(sx)) { - KASSERT((sx->lock_object.lo_flags & SX_RECURSE) != 0, + KASSERT((sx->lock_object.lo_flags & LO_RECURSABLE) != 0, ("_sx_xlock_hard: recursed on non-recursive sx %s @ %s:%d\n", sx->lock_object.lo_name, file, line)); sx->sx_recurse++; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Jun 2 12:35:04 2009 (r193306) +++ head/sys/sys/vnode.h Tue Jun 2 13:03:35 2009 (r193307) @@ -419,7 +419,7 @@ extern struct vattr va_null; /* predefi #define VI_MTX(vp) (&(vp)->v_interlock) #define VN_LOCK_AREC(vp) \ - ((vp)->v_vnlock->lock_object.lo_flags |= LK_CANRECURSE) + ((vp)->v_vnlock->lock_object.lo_flags |= LO_RECURSABLE) #define VN_LOCK_ASHARE(vp) \ ((vp)->v_vnlock->lock_object.lo_flags &= ~LK_NOSHARE) Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Jun 2 12:35:04 2009 (r193306) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Jun 2 13:03:35 2009 (r193307) @@ -556,8 +556,8 @@ MTX_SYSINIT(softdep_lock, &lk, "Softdep #define ACQUIRE_LOCK(lk) mtx_lock(lk) #define FREE_LOCK(lk) mtx_unlock(lk) -#define BUF_AREC(bp) ((bp)->b_lock.lock_object.lo_flags |= LK_CANRECURSE) -#define BUF_NOREC(bp) ((bp)->b_lock.lock_object.lo_flags &= ~LK_CANRECURSE) +#define BUF_AREC(bp) ((bp)->b_lock.lock_object.lo_flags |= LO_RECURSABLE) +#define BUF_NOREC(bp) ((bp)->b_lock.lock_object.lo_flags &= ~LO_RECURSABLE) /* * Worklist queue management. From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 13:44:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB40B1065674; Tue, 2 Jun 2009 13:44:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F5CF8FC1A; Tue, 2 Jun 2009 13:44:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52Dia7g017271; Tue, 2 Jun 2009 13:44:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52Dia3s017267; Tue, 2 Jun 2009 13:44:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906021344.n52Dia3s017267@svn.freebsd.org> From: Ed Schouten Date: Tue, 2 Jun 2009 13:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193308 - in head: . usr.bin usr.bin/window X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 13:44:37 -0000 Author: ed Date: Tue Jun 2 13:44:36 2009 New Revision: 193308 URL: http://svn.freebsd.org/changeset/base/193308 Log: Remove window(1) from the base system. Some time ago Tom Rhodes sent me an email that he was willing to perform various cleanups to the window(1) source code. After some discussion, we both decided the best thing to do, was to move window(1) to the ports tree. The application isn't used a lot nowadays, mainly because it has been superseeded by screen, tmux, etc. A couple of hours ago Tom committed window(1) to ports (misc/window), so I'm removing it from the tree. I don't think people will really miss it, but I'm describing the change in UPDATING anyway. Discussed with: trhodes, pav, kib Approved by: re Deleted: head/usr.bin/window/ Modified: head/ObsoleteFiles.inc head/UPDATING head/usr.bin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jun 2 13:03:35 2009 (r193307) +++ head/ObsoleteFiles.inc Tue Jun 2 13:44:36 2009 (r193308) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090602: removal of window(1) +OLD_FILES+=usr/bin/window +OLD_FILES+=usr/share/man/man1/window.1.gz # 20090530: removal of early.sh OLD_FILES+=etc/rc.d/early.sh # 20090527: renaming of S{LIST,TAILQ}_REMOVE_NEXT() to _REMOVE_AFTER() Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Jun 2 13:03:35 2009 (r193307) +++ head/UPDATING Tue Jun 2 13:44:36 2009 (r193308) @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090602: + window(1) has been removed from the base system. It can now be + installed from ports. The port is called misc/window. + 20090601: The way we are storing and accessing `routing table' entries has changed. Programs reading the FIB, like netstat, need to Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Tue Jun 2 13:03:35 2009 (r193307) +++ head/usr.bin/Makefile Tue Jun 2 13:44:36 2009 (r193308) @@ -222,7 +222,6 @@ SUBDIR= alias \ which \ who \ whois \ - window \ write \ xargs \ xinstall \ From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 14:26:03 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F20CB1065675; Tue, 2 Jun 2009 14:26:02 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 9E2DF8FC1F; Tue, 2 Jun 2009 14:26:02 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [172.31.193.10] (cpe-075-177-134-250.nc.res.rr.com [75.177.134.250]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id n52EOjZl007365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 2 Jun 2009 10:25:19 -0400 (EDT) Message-ID: <4A253627.4090505@cs.duke.edu> Date: Tue, 02 Jun 2009 10:24:39 -0400 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: John Baldwin References: <200906012132.n51LWq2U092924@svn.freebsd.org> In-Reply-To: <200906012132.n51LWq2U092924@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193275 - in head/sys: kern sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 14:26:03 -0000 John Baldwin wrote: > Author: jhb > Date: Mon Jun 1 21:32:52 2009 > New Revision: 193275 > URL: http://svn.freebsd.org/changeset/base/193275 > > Log: > Add an extension to the character device interface that allows character > device drivers to use arbitrary VM objects to satisfy individual mmap() > requests. Is there an example usage of this? Was this one of the things that Nvidia asked for? Thanks, Drew From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 15:11:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 832761065673; Tue, 2 Jun 2009 15:11:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 417A68FC19; Tue, 2 Jun 2009 15:11:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B85A646B35; Tue, 2 Jun 2009 11:11:47 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 8D6A28A02B; Tue, 2 Jun 2009 11:11:46 -0400 (EDT) From: John Baldwin To: Andrew Gallatin Date: Tue, 2 Jun 2009 11:10:39 -0400 User-Agent: KMail/1.9.7 References: <200906012132.n51LWq2U092924@svn.freebsd.org> <4A253627.4090505@cs.duke.edu> In-Reply-To: <4A253627.4090505@cs.duke.edu> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200906021110.40347.jhb@freebsd.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 02 Jun 2009 11:11:46 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193275 - in head/sys: kern sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 15:11:49 -0000 On Tuesday 02 June 2009 10:24:39 am Andrew Gallatin wrote: > John Baldwin wrote: > > Author: jhb > > Date: Mon Jun 1 21:32:52 2009 > > New Revision: 193275 > > URL: http://svn.freebsd.org/changeset/base/193275 > > > > Log: > > Add an extension to the character device interface that allows character > > device drivers to use arbitrary VM objects to satisfy individual mmap() > > requests. > > Is there an example usage of this? Was this one of the things that > Nvidia asked for? Yes, this is for Nvidia. I have a bizarr-o test device in //depot/user/jhb/pat/modules/patdev/patdev.c. It exports a single anonymous memory object for mappings that use an offset at page 0 and a OBJT_SG (new type of VM object) object that maps the local APIC for mappings that use an offset at page 1. It's d_mmap_single() routine looks like this: static int pat_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, vm_object_t *object, int nprot) { struct patdev_softc *sc; int error; sc = dev->si_drv1; error = 0; sx_xlock(&sc->lock); switch (*offset) { case 0: /* * The first mmap() attempt with an offset of 0 creates * a new memory object with the requested size. Subsequent * mmap()'s map the same object. */ if (sc->mem == NULL) { /* * Note that this does not wire any backing * pages. I could do that later before a DMA * was started by wiring pages (even just * using the userland mapping to do that) * while the DMA was in-progress and unwiring * them later. */ sc->mem = vm_pager_allocate(OBJT_DEFAULT, NULL, size, VM_PROT_DEFAULT, 0); VM_OBJECT_LOCK(sc->mem); vm_object_clear_flag(sc->mem, OBJ_ONEMAPPING); vm_object_set_flag(sc->mem, OBJ_NOSPLIT); vm_object_set_cache_mode(sc->mem, VM_CACHE_WRITE_COMBINING); VM_OBJECT_UNLOCK(sc->mem); } vm_object_reference(sc->mem); *object = sc->mem; break; case PAGE_SIZE: /* Map the local APIC. */ vm_object_reference(sc->sgobj); *object = sc->sgobj; *offset = 0; break; default: /* Use ENODEV to fallback to d_mmap(). */ error = EINVAL; break; } sx_xunlock(&sc->lock); return (error); } The 'sgobj' object is created when the module is loaded: static int pat_attach(struct patdev_softc *sc) { vm_offset_t va; int rv; bzero(sc, sizeof(*sc)); sx_init(&sc->lock, "patdev"); sc->cdev = make_dev(&pat_devsw, 0, UID_ROOT, GID_WHEEL, 0640, "pat"); sc->cdev->si_drv1 = sc; /* Create a scatter/gather list that maps the local APIC. */ sc->sg = sglist_alloc(1, M_WAITOK); sglist_append_phys(sc->sg, lapic_paddr, LAPIC_LEN); /* Create a VM object that is backed by the scatter/gather list. */ sc->sgobj = vm_pager_allocate(OBJT_SG, sc->sg, LAPIC_LEN, VM_PROT_READ, 0); VM_OBJECT_LOCK(sc->sgobj); vm_object_set_cache_mode(sc->sgobj, VM_CACHE_UNCACHEABLE); VM_OBJECT_UNLOCK(sc->sgobj); ... } -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 15:27:11 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAB231065757; Tue, 2 Jun 2009 15:27:11 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:a1::2]) by mx1.freebsd.org (Postfix) with ESMTP id C846E8FC0A; Tue, 2 Jun 2009 15:27:09 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n52FRJP8014958; Tue, 2 Jun 2009 10:27:19 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n52FRIk8014957; Tue, 2 Jun 2009 10:27:18 -0500 (CDT) (envelope-from brooks) Date: Tue, 2 Jun 2009 10:27:18 -0500 From: Brooks Davis To: Brian Somers Message-ID: <20090602152718.GA14685@lor.one-eyed-alien.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> <20090602002149.1d7822b2@dev.lan.Awfulhak.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <20090602002149.1d7822b2@dev.lan.Awfulhak.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Tue, 02 Jun 2009 10:27:20 -0500 (CDT) Cc: Doug Barton , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Bruce Simpson , src-committers@FreeBSD.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 15:27:12 -0000 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 02, 2009 at 12:21:49AM -0700, Brian Somers wrote: > On Mon, 01 Jun 2009 15:34:12 +0100 Bruce Simpson wr= ote: > > Doug Barton wrote: > > > Log: > > > Eliminate the warning that "Values of network_interfaces other than > > > AUTO are deprecated.' There is no good reason to deprecate them, and > > > setting this to different values can be useful for custom solutions > > > and/or one-off configuration problems. > > > =20 > >=20 > > Thanks, I wasn't sure what the alternative to this functionality was=20 > > going to be, and was relying on this mechanism for a product. >=20 > +1 - I rely on it to handle renamed interfaces properly (ifconfig -l > gives different answers before and after the rename(s)). That's a supported configuration with network_interfaces=3DAUTO. I use it on the server I'm writing this from. For instance you can do something like: ifconfig_fxp0_name=3D"iatel" ifconfig_iatel=3D"up" ipv4_addrs_iatel=3D"#.#.#.#/26" ifconfig_em0_name=3D"priv" ifconfig_priv=3D"inet 192.168.1.100 netmask 255.255.255.0" The use of ipv4_addrs_iatel is mostly just testing the feature. -- Brooks --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFKJUTVXY6L6fI4GtQRAgvFAJ45CZfY/nNrswx6FCRojk0ZEfXrIgCeM039 //jailNjkKC6U9PF8nVgoVE= =Hsyk -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 15:27:30 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 439CB1065816; Tue, 2 Jun 2009 15:27:30 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:a1::2]) by mx1.freebsd.org (Postfix) with ESMTP id C3ED98FC13; Tue, 2 Jun 2009 15:27:29 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n52FRfbB014967; Tue, 2 Jun 2009 10:27:41 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n52FRf2M014966; Tue, 2 Jun 2009 10:27:41 -0500 (CDT) (envelope-from brooks) Date: Tue, 2 Jun 2009 10:27:41 -0500 From: Brooks Davis To: Bruce Simpson Message-ID: <20090602152741.GB14685@lor.one-eyed-alien.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IrhDeMKUP4DT/M7F" Content-Disposition: inline In-Reply-To: <4A23E6E4.7020506@incunabulum.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Tue, 02 Jun 2009 10:27:41 -0500 (CDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Doug Barton , src-committers@FreeBSD.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 15:27:30 -0000 --IrhDeMKUP4DT/M7F Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 01, 2009 at 03:34:12PM +0100, Bruce Simpson wrote: > Doug Barton wrote: >> Log: >> Eliminate the warning that "Values of network_interfaces other than >> AUTO are deprecated.' There is no good reason to deprecate them, and >> setting this to different values can be useful for custom solutions >> and/or one-off configuration problems. >> =20 >=20 > Thanks, I wasn't sure what the alternative to this functionality was goin= g=20 > to be, and was relying on this mechanism for a product. Could you please say what you are actually doing? -- Brooks --IrhDeMKUP4DT/M7F Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFKJUTsXY6L6fI4GtQRAqCNAJ4tjGRj0D6QY85fhxKaSGDph1o+tACg2pMJ FBDz/e1UrXIaiqaV79fejYY= =gPdA -----END PGP SIGNATURE----- --IrhDeMKUP4DT/M7F-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 15:34:11 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10AB31065670; Tue, 2 Jun 2009 15:34:11 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id CDFAE8FC25; Tue, 2 Jun 2009 15:34:10 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id EFEC5349C65; Tue, 2 Jun 2009 11:34:09 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 02 Jun 2009 11:34:10 -0400 X-Sasl-enc: Y+cQeIMoNI5TWeTb6ne80LgvC9jtrjTZVpfVs2OHXrxn 1243956849 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 20049424B0; Tue, 2 Jun 2009 11:34:09 -0400 (EDT) Message-ID: <4A25466F.40504@incunabulum.net> Date: Tue, 02 Jun 2009 16:34:07 +0100 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.21 (X11/20090412) MIME-Version: 1.0 To: Brooks Davis References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> <20090602152741.GB14685@lor.one-eyed-alien.net> In-Reply-To: <20090602152741.GB14685@lor.one-eyed-alien.net> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Doug Barton , src-committers@FreeBSD.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 15:34:12 -0000 Brooks Davis wrote: > On Mon, Jun 01, 2009 at 03:34:12PM +0100, Bruce Simpson wrote: > >> Doug Barton wrote: >> >>> Log: >>> Eliminate the warning that "Values of network_interfaces other than >>> AUTO are deprecated.' There is no good reason to deprecate them, and >>> setting this to different values can be useful for custom solutions >>> and/or one-off configuration problems. >>> >>> >> Thanks, I wasn't sure what the alternative to this functionality was going >> to be, and was relying on this mechanism for a product. >> > > Could you please say what you are actually doing? > On boot time I instantiate a tap0 instance from cloned_interfaces=".." in /etc/rc.conf, and then use ifconfig_tap0="..." to clone the MAC address on the tap instance from the internal Ethernet port, as there is no other way of uniquely identifying the client for an automated bootstrap. This happens from within a flash image. From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 15:37:08 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C2291065673; Tue, 2 Jun 2009 15:37:08 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:a1::2]) by mx1.freebsd.org (Postfix) with ESMTP id D0FAB8FC1F; Tue, 2 Jun 2009 15:37:07 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n52FbJ8V015074; Tue, 2 Jun 2009 10:37:19 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n52FbJGf015073; Tue, 2 Jun 2009 10:37:19 -0500 (CDT) (envelope-from brooks) Date: Tue, 2 Jun 2009 10:37:19 -0500 From: Brooks Davis To: Bruce Simpson Message-ID: <20090602153719.GD14685@lor.one-eyed-alien.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> <20090602152741.GB14685@lor.one-eyed-alien.net> <4A25466F.40504@incunabulum.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fOHHtNG4YXGJ0yqR" Content-Disposition: inline In-Reply-To: <4A25466F.40504@incunabulum.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Tue, 02 Jun 2009 10:37:19 -0500 (CDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Doug Barton , src-committers@FreeBSD.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 15:37:09 -0000 --fOHHtNG4YXGJ0yqR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 02, 2009 at 04:34:07PM +0100, Bruce Simpson wrote: > Brooks Davis wrote: >> On Mon, Jun 01, 2009 at 03:34:12PM +0100, Bruce Simpson wrote: >> =20 >>> Doug Barton wrote: >>> =20 >>>> Log: >>>> Eliminate the warning that "Values of network_interfaces other than >>>> AUTO are deprecated.' There is no good reason to deprecate them, and >>>> setting this to different values can be useful for custom solutions >>>> and/or one-off configuration problems. >>>> =20 >>> Thanks, I wasn't sure what the alternative to this functionality was=20 >>> going to be, and was relying on this mechanism for a product. >>> =20 >>=20 >> Could you please say what you are actually doing? >> =20 >=20 > On boot time I instantiate a tap0 instance from cloned_interfaces=3D".." = in=20 > /etc/rc.conf, and then use ifconfig_tap0=3D"..." to clone the MAC address= on=20 > the tap instance from the internal Ethernet port, as there is no other wa= y=20 > of uniquely identifying the client for an automated bootstrap. >=20 > This happens from within a flash image. I see nothing related to network_interfaces here... -- Brooks --fOHHtNG4YXGJ0yqR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFKJUcuXY6L6fI4GtQRApmRAKCVb0MV4LjKx2u08jP/WBC22xwTaACfQMIV eLFynn8xwpSckVE+pq+rM84= =WR4V -----END PGP SIGNATURE----- --fOHHtNG4YXGJ0yqR-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 15:45:33 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C41D1106567A; Tue, 2 Jun 2009 15:45:33 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id 8E85F8FC1A; Tue, 2 Jun 2009 15:45:33 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 0ACE734C800; Tue, 2 Jun 2009 11:45:33 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Tue, 02 Jun 2009 11:45:33 -0400 X-Sasl-enc: NV79q4yqZHjHJsOwOyuynkrdFzjOLu/19BEZchyNRz7u 1243957532 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 3AC9254B79; Tue, 2 Jun 2009 11:45:32 -0400 (EDT) Message-ID: <4A25491B.4030406@incunabulum.net> Date: Tue, 02 Jun 2009 16:45:31 +0100 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.21 (X11/20090412) MIME-Version: 1.0 To: Brooks Davis References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> <20090602152741.GB14685@lor.one-eyed-alien.net> <4A25466F.40504@incunabulum.net> <20090602153719.GD14685@lor.one-eyed-alien.net> In-Reply-To: <20090602153719.GD14685@lor.one-eyed-alien.net> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Doug Barton , src-committers@FreeBSD.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 15:45:35 -0000 Brooks Davis wrote: > ... >> On boot time I instantiate a tap0 instance from cloned_interfaces=".." in >> /etc/rc.conf, and then use ifconfig_tap0="..." to clone the MAC address on >> the tap instance from the internal Ethernet port, as there is no other way >> of uniquely identifying the client for an automated bootstrap. >> >> This happens from within a flash image. >> > > I see nothing related to network_interfaces here... > I did explicitly name them there, so there would be no automated DHCP setup of any interfaces, even if hot-plugged. Perhaps I am thinking of cloned_interfaces=""... From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 15:59:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E45DD1065678; Tue, 2 Jun 2009 15:59:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D30EA8FC1C; Tue, 2 Jun 2009 15:59:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52FxkZ5020019; Tue, 2 Jun 2009 15:59:46 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52FxklU020018; Tue, 2 Jun 2009 15:59:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906021559.n52FxklU020018@svn.freebsd.org> From: Robert Watson Date: Tue, 2 Jun 2009 15:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193309 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 15:59:47 -0000 Author: rwatson Date: Tue Jun 2 15:59:46 2009 New Revision: 193309 URL: http://svn.freebsd.org/changeset/base/193309 Log: Remove unneeded include. MFC after: 3 days Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Tue Jun 2 13:44:36 2009 (r193308) +++ head/sys/kern/uipc_mbuf.c Tue Jun 2 15:59:46 2009 (r193309) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - int max_linkhdr; int max_protohdr; int max_hdr; From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 16:48:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48505106564A; Tue, 2 Jun 2009 16:48:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CA8C8FC2D; Tue, 2 Jun 2009 16:48:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52GmBTU021053; Tue, 2 Jun 2009 16:48:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52GmAhp021052; Tue, 2 Jun 2009 16:48:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200906021648.n52GmAhp021052@svn.freebsd.org> From: Warner Losh Date: Tue, 2 Jun 2009 16:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193310 - head/sys/dev/bwi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 16:48:11 -0000 Author: imp Date: Tue Jun 2 16:48:10 2009 New Revision: 193310 URL: http://svn.freebsd.org/changeset/base/193310 Log: In bwi_newstate, only zero the bssid when we stop a STA. And only when we've not stopped the card. It hangs the system when we touch the CSR after bwistop. This fixes the hanging on kldunload. Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Tue Jun 2 15:59:46 2009 (r193309) +++ head/sys/dev/bwi/if_bwi.c Tue Jun 2 16:48:10 2009 (r193310) @@ -1771,10 +1771,12 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); - struct ifnet *ifp = vap->iv_ic->ic_ifp; + struct ieee80211com *ic= vap->iv_ic; + struct ifnet *ifp = ic->ic_ifp; + enum ieee80211_state ostate = vap->iv_state; struct bwi_softc *sc = ifp->if_softc; struct bwi_mac *mac; - struct ieee80211_node *ni; + struct ieee80211_node *ni = vap->iv_bss; int error; BWI_LOCK(sc); @@ -1790,11 +1792,25 @@ bwi_newstate(struct ieee80211vap *vap, e if (error != 0) goto back; + /* + * Clear the BSSID when we stop a STA + */ + if (vap->iv_opmode == IEEE80211_M_STA) { + if (ostate == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) { + /* + * Clear out the BSSID. If we reassociate to + * the same AP, this will reinialize things + * correctly... + */ + if (ic->ic_opmode == IEEE80211_M_STA && + !(sc->sc_flags & BWI_F_STOP)) + bwi_set_bssid(sc, bwi_zero_addr); + } + } + if (vap->iv_opmode == IEEE80211_M_MONITOR) { /* Nothing to do */ } else if (nstate == IEEE80211_S_RUN) { - ni = vap->iv_bss; - bwi_set_bssid(sc, vap->iv_bss->ni_bssid); KASSERT(sc->sc_cur_regwin->rw_type == BWI_REGWIN_T_MAC, @@ -1814,8 +1830,6 @@ bwi_newstate(struct ieee80211vap *vap, e } callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); - } else { - bwi_set_bssid(sc, bwi_zero_addr); } back: BWI_UNLOCK(sc); From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 16:50:10 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AB9B106566B; Tue, 2 Jun 2009 16:50:10 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:a1::2]) by mx1.freebsd.org (Postfix) with ESMTP id C33B38FC29; Tue, 2 Jun 2009 16:50:09 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n52GoL0F015716; Tue, 2 Jun 2009 11:50:21 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n52GoLuE015715; Tue, 2 Jun 2009 11:50:21 -0500 (CDT) (envelope-from brooks) Date: Tue, 2 Jun 2009 11:50:21 -0500 From: Brooks Davis To: Bruce Simpson Message-ID: <20090602165021.GB15552@lor.one-eyed-alien.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> <20090602152741.GB14685@lor.one-eyed-alien.net> <4A25466F.40504@incunabulum.net> <20090602153719.GD14685@lor.one-eyed-alien.net> <4A25491B.4030406@incunabulum.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JP+T4n/bALQSJXh8" Content-Disposition: inline In-Reply-To: <4A25491B.4030406@incunabulum.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Tue, 02 Jun 2009 11:50:21 -0500 (CDT) Cc: Doug Barton , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Brooks Davis , src-committers@FreeBSD.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 16:50:10 -0000 --JP+T4n/bALQSJXh8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 02, 2009 at 04:45:31PM +0100, Bruce Simpson wrote: > Brooks Davis wrote: >> ... >>> On boot time I instantiate a tap0 instance from cloned_interfaces=3D"..= " in=20 >>> /etc/rc.conf, and then use ifconfig_tap0=3D"..." to clone the MAC addre= ss=20 >>> on the tap instance from the internal Ethernet port, as there is no oth= er=20 >>> way of uniquely identifying the client for an automated bootstrap. >>>=20 >>> This happens from within a flash image. >>> =20 >>=20 >> I see nothing related to network_interfaces here... >> =20 >=20 > I did explicitly name them there, so there would be no automated DHCP set= up=20 > of any interfaces, even if hot-plugged. Perhaps I am thinking of=20 > cloned_interfaces=3D""... cloned_interfaces is different and will definiterly remain since you've got to create them some how. They get created early and thus end up on the list. Also, there's no need to worry about hot plugged interfaces getting margically configured to do dhcp. For the system to do something with an interface they following must be true: - It makes it in to the list of interfaces some how - It actually exists or is create early in the process via cloned_interfaces, gif_interfaces, etc - The ifconfig_ variable is set (I think i can be "", but "up" is alwasy a good choice if you just want a stub. - The ifconfig_ variable must not contain the NOAUTO keyword. If all of those things are true, the interface will be configured at startup or on insert. Otherwise, it won't be. -- Brooks --JP+T4n/bALQSJXh8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFKJVhMXY6L6fI4GtQRApe1AJsHLDUnOuRO7u2e2Zmxzy1sPpUNbgCgv9bQ q+ijmhO3CtYSRKQRlC+ZNFs= =VfQC -----END PGP SIGNATURE----- --JP+T4n/bALQSJXh8-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 16:52:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD9C106566B; Tue, 2 Jun 2009 16:52:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2919D8FC12; Tue, 2 Jun 2009 16:52:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52GqYIA021166; Tue, 2 Jun 2009 16:52:34 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52GqYnj021164; Tue, 2 Jun 2009 16:52:34 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200906021652.n52GqYnj021164@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 2 Jun 2009 16:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193311 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 16:52:34 -0000 Author: gallatin Date: Tue Jun 2 16:52:33 2009 New Revision: 193311 URL: http://svn.freebsd.org/changeset/base/193311 Log: Buf-ring fixes for mxge - always maintain byte/mcast/drop stats via drbr - move #define of IFNET_BUF_RING so that its picked up by all files in the driver - conditionalize IFNET_BUF_RING on the FreeBSD_version bump just after it appeared in the tree. Sponsored by: Myricom Inc. Modified: head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Tue Jun 2 16:48:10 2009 (r193310) +++ head/sys/dev/mxge/if_mxge.c Tue Jun 2 16:52:33 2009 (r193311) @@ -30,8 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#define IFNET_BUF_RING - #include #include #include @@ -68,9 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef IFNET_BUF_RING -#include -#endif #include #include #include @@ -90,6 +85,9 @@ __FBSDID("$FreeBSD$"); #include /*#define MXGE_FAKE_IFP*/ #include +#ifdef IFNET_BUF_RING +#include +#endif /* tunable params */ static int mxge_nvidia_ecrc_enable = 1; @@ -2200,6 +2198,7 @@ mxge_transmit_locked(struct mxge_slice_s BPF_MTAP(ifp, m); /* give it to the nic */ mxge_encap(ss, m); + drbr_stats_update(ifp, m->m_pkthdr.len, m->m_flags); } else if ((err = drbr_enqueue(ifp, tx->br, m)) != 0) { return (err); } @@ -2656,11 +2655,6 @@ mxge_tx_done(struct mxge_slice_state *ss /* mbuf and DMA map only attached to the first segment per-mbuf */ if (m != NULL) { -#ifdef IFNET_BUF_RING - ss->obytes += m->m_pkthdr.len; - if (m->m_flags & M_MCAST) - ss->omcasts++; -#endif ss->opackets++; tx->info[idx].m = NULL; map = tx->info[idx].map; @@ -3787,11 +3781,6 @@ mxge_update_stats(mxge_softc_t *sc) struct mxge_slice_state *ss; u_long ipackets = 0; u_long opackets = 0; -#ifdef IFNET_BUF_RING - u_long obytes = 0; - u_long omcasts = 0; - u_long odrops = 0; -#endif u_long oerrors = 0; int slice; @@ -3799,20 +3788,10 @@ mxge_update_stats(mxge_softc_t *sc) ss = &sc->ss[slice]; ipackets += ss->ipackets; opackets += ss->opackets; -#ifdef IFNET_BUF_RING - obytes += ss->obytes; - omcasts += ss->omcasts; - odrops += ss->tx.br->br_drops; -#endif oerrors += ss->oerrors; } sc->ifp->if_ipackets = ipackets; sc->ifp->if_opackets = opackets; -#ifdef IFNET_BUF_RING - sc->ifp->if_obytes = obytes; - sc->ifp->if_omcasts = omcasts; - sc->ifp->if_snd.ifq_drops = odrops; -#endif sc->ifp->if_oerrors = oerrors; } Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Tue Jun 2 16:48:10 2009 (r193310) +++ head/sys/dev/mxge/if_mxge_var.h Tue Jun 2 16:52:33 2009 (r193311) @@ -46,6 +46,10 @@ $FreeBSD$ #define MXGE_VIRT_JUMBOS 0 #endif +#if (__FreeBSD_version > 800082) +#define IFNET_BUF_RING 1 +#endif + #ifndef VLAN_CAPABILITIES #define VLAN_CAPABILITIES(ifp) #define mxge_vlans_active(sc) (sc)->ifp->if_nvlans @@ -192,8 +196,6 @@ struct mxge_slice_state { volatile uint32_t *irq_claim; u_long ipackets; u_long opackets; - u_long obytes; - u_long omcasts; u_long oerrors; int if_drv_flags; struct lro_head lro_active; From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 16:57:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C60C106564A; Tue, 2 Jun 2009 16:57:28 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AB4B8FC19; Tue, 2 Jun 2009 16:57:28 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52GvSFD021314; Tue, 2 Jun 2009 16:57:28 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52GvRp5021311; Tue, 2 Jun 2009 16:57:27 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906021657.n52GvRp5021311@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 16:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193312 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 16:57:28 -0000 Author: sam Date: Tue Jun 2 16:57:27 2009 New Revision: 193312 URL: http://svn.freebsd.org/changeset/base/193312 Log: Remove hack used to deal with ifnet teardown now that if_detach and the bridge do a better job. o move ether_ifdetach to the top of ieee80211_detach o do not clear if_softc at the top of ieee80211_detach; we no longer need this because we are safeguarded against calls coming back through if_ioctl o simplify the bpf tracker now that we don't null if_softc This also fixes an issue where having a bpf consumer active when a vap is destroyed would cause a crash because bpf referenced free'd memory. Reviewed by: imp Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Jun 2 16:52:33 2009 (r193311) +++ head/sys/net80211/ieee80211.c Tue Jun 2 16:57:27 2009 (r193312) @@ -544,24 +544,10 @@ ieee80211_vap_detach(struct ieee80211vap __func__, ieee80211_opmode_name[vap->iv_opmode], ic->ic_ifp->if_xname); - IEEE80211_LOCK(ic); - /* block traffic from above */ - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - /* - * Evil hack. Clear the backpointer from the ifnet to the - * vap so any requests from above will return an error or - * be ignored. In particular this short-circuits requests - * by the bridge to turn off promiscuous mode as a result - * of calling ether_ifdetach. - */ - ifp->if_softc = NULL; - /* - * Stop the vap before detaching the ifnet. Ideally we'd - * do this in the other order so the ifnet is inaccessible - * while we cleanup internal state but that is hard. - */ - ieee80211_stop_locked(vap); - IEEE80211_UNLOCK(ic); + /* NB: bpfdetach is called by ether_ifdetach and claims all taps */ + ether_ifdetach(ifp); + + ieee80211_stop(vap); /* * Flush any deferred vap tasks. @@ -587,10 +573,6 @@ ieee80211_vap_detach(struct ieee80211vap ieee80211_syncifflag_locked(ic, IFF_ALLMULTI); IEEE80211_UNLOCK(ic); - /* XXX can't hold com lock */ - /* NB: bpfdetach is called by ether_ifdetach and claims all taps */ - ether_ifdetach(ifp); - ifmedia_removeall(&vap->iv_media); ieee80211_radiotap_vdetach(vap); Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Tue Jun 2 16:52:33 2009 (r193311) +++ head/sys/net80211/ieee80211_freebsd.c Tue Jun 2 16:57:27 2009 (r193312) @@ -710,8 +710,7 @@ bpf_track(void *arg, struct ifnet *ifp, ieee80211_syncflag_ext(vap, IEEE80211_FEXT_BPF); if (vap->iv_opmode == IEEE80211_M_MONITOR) atomic_add_int(&vap->iv_ic->ic_montaps, 1); - /* NB: if_softc is NULL on vap detach */ - } else if (vap != NULL && !bpf_peers_present(vap->iv_rawbpf)) { + } else if (!bpf_peers_present(vap->iv_rawbpf)) { ieee80211_syncflag_ext(vap, -IEEE80211_FEXT_BPF); if (vap->iv_opmode == IEEE80211_M_MONITOR) atomic_subtract_int(&vap->iv_ic->ic_montaps, 1); Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Tue Jun 2 16:52:33 2009 (r193311) +++ head/sys/net80211/ieee80211_ioctl.c Tue Jun 2 16:57:27 2009 (r193312) @@ -3202,29 +3202,14 @@ ieee80211_ioctl_updatemulti(struct ieee8 int ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct ieee80211vap *vap; - struct ieee80211com *ic; + struct ieee80211vap *vap = ifp->if_softc; + struct ieee80211com *ic = vap->iv_ic; int error = 0; struct ifreq *ifr; struct ifaddr *ifa; /* XXX */ - vap = ifp->if_softc; - if (vap == NULL) { - /* - * During detach we clear the backpointer in the softc - * so any ioctl request through the ifnet that arrives - * before teardown is ignored/rejected. In particular - * this hack handles destroying a vap used by an app - * like wpa_supplicant that will respond to the vap - * being forced into INIT state by immediately trying - * to force it back up. We can yank this hack if/when - * we can destroy the ifnet before cleaning up vap state. - */ - return ENXIO; - } switch (cmd) { case SIOCSIFFLAGS: - ic = vap->iv_ic; IEEE80211_LOCK(ic); ieee80211_syncifflag_locked(ic, IFF_PROMISC); ieee80211_syncifflag_locked(ic, IFF_ALLMULTI); @@ -3250,7 +3235,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon break; case SIOCADDMULTI: case SIOCDELMULTI: - ieee80211_ioctl_updatemulti(vap->iv_ic); + ieee80211_ioctl_updatemulti(ic); break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 17:27:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 210DF106566B; Tue, 2 Jun 2009 17:27:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E94B8FC17; Tue, 2 Jun 2009 17:27:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52HRp2r022011; Tue, 2 Jun 2009 17:27:51 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52HRpwa022008; Tue, 2 Jun 2009 17:27:51 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906021727.n52HRpwa022008@svn.freebsd.org> From: Andrew Thompson Date: Tue, 2 Jun 2009 17:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193313 - head/lib/libusb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 17:27:52 -0000 Author: thompsa Date: Tue Jun 2 17:27:51 2009 New Revision: 193313 URL: http://svn.freebsd.org/changeset/base/193313 Log: Add libusb20_tr_get_length to get the transfer length. Submitted by: Hans Petter Selasky Modified: head/lib/libusb/libusb.3 head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Tue Jun 2 16:57:27 2009 (r193312) +++ head/lib/libusb/libusb.3 Tue Jun 2 17:27:51 2009 (r193313) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 21, 2009 +.Dd May 28, 2009 .Dt LIBUSB 3 .Os .Sh NAME @@ -78,6 +78,8 @@ USB access library (libusb -lusb) .Fn libusb20_tr_set_callback "struct libusb20_transfer *xfer" "libusb20_tr_callback_t *cb" .Ft void .Fn libusb20_tr_set_flags "struct libusb20_transfer *xfer" "uint8_t flags" +.Ft uint32_t +.Fn libusb20_tr_get_length "struct libusb20_transfer *xfer" "uint16_t fr_index" .Ft void .Fn libusb20_tr_set_length "struct libusb20_transfer *xfer" "uint32_t length" "uint16_t fr_index" .Ft void @@ -183,6 +185,10 @@ USB access library (libusb -lusb) .Ft int .Fn libusb20_be_remove_dev_quirk "struct libusb20_backend *pbe" "struct libusb20_quirk *pq" .Ft struct libusb20_backend * +.Fn libusb20_be_alloc_default "void" +.Ft struct libusb20_backend * +.Fn libusb20_be_alloc_freebsd "void" +.Ft struct libusb20_backend * .Fn libusb20_be_alloc_linux "void" .Ft struct libusb20_device * .Fn libusb20_be_device_foreach "struct libusb20_backend *pbe" "struct libusb20_device *pdev" @@ -227,7 +233,7 @@ Non-zero return values indicate a LIBUSB .Pp . .Fn libusb20_tr_open -will allocate kernel resources like +will allocate kernel buffer resources according to .Fa max_buf_size and .Fa max_frame_count @@ -235,6 +241,18 @@ associated with an USB .Fa pxfer and bind the transfer to the specified .Fa ep_no . +.Fa max_buf_size +is the minimum buffer size which the data transport layer has to support. +If +.Fa max_buf_size +is zero, the +.Nm +library will use wMaxPacketSize to compute the buffer size. +This can be useful for isochronous transfers. +The actual buffer size can be greater than +.Fa max_buf_size +and is returned by +.Fn libusb20_tr_get_max_total_length . . This function returns zero upon success. . @@ -367,8 +385,14 @@ Will do a clear-stall before starting th . .Pp . +.Fn libusb20_tr_get_length +returns the length of the given USB frame by index. +After an USB transfer is complete the USB frame length will get updated to the actual transferred length. +. +.Pp +. .Fn libusb20_tr_set_length -sets the length of a given USB transfer and frame index. +sets the length of the given USB frame by index. . .Pp . @@ -750,7 +774,7 @@ function will wait until a pending USB t the given USB device. . A timeout value can be specified which is passed on to the -.Xr 2 poll +.Xr poll 2 function. . .Sh USB BACKEND OPERATIONS @@ -829,6 +853,10 @@ returned. If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is returned. . +.Pp +. +.Fn libusb20_be_alloc_default +.Fn libusb20_be_alloc_freebsd .Fn libusb20_be_alloc_linux These functions are used to allocate a specific USB backend or the operating system default USB backend. Allocating a backend is a way to Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Tue Jun 2 16:57:27 2009 (r193312) +++ head/lib/libusb/libusb20.c Tue Jun 2 17:27:51 2009 (r193313) @@ -319,6 +319,12 @@ libusb20_tr_set_flags(struct libusb20_tr return; } +uint32_t +libusb20_tr_get_length(struct libusb20_transfer *xfer, uint16_t frIndex) +{ + return (xfer->pLength[frIndex]); +} + void libusb20_tr_set_length(struct libusb20_transfer *xfer, uint32_t length, uint16_t frIndex) { Modified: head/lib/libusb/libusb20.h ============================================================================== --- head/lib/libusb/libusb20.h Tue Jun 2 16:57:27 2009 (r193312) +++ head/lib/libusb/libusb20.h Tue Jun 2 17:27:51 2009 (r193313) @@ -216,6 +216,7 @@ void libusb20_tr_drain(struct libusb20_t void libusb20_tr_set_buffer(struct libusb20_transfer *xfer, void *buffer, uint16_t fr_index); void libusb20_tr_set_callback(struct libusb20_transfer *xfer, libusb20_tr_callback_t *cb); void libusb20_tr_set_flags(struct libusb20_transfer *xfer, uint8_t flags); +uint32_t libusb20_tr_get_length(struct libusb20_transfer *xfer, uint16_t fr_index); void libusb20_tr_set_length(struct libusb20_transfer *xfer, uint32_t length, uint16_t fr_index); void libusb20_tr_set_priv_sc0(struct libusb20_transfer *xfer, void *sc0); void libusb20_tr_set_priv_sc1(struct libusb20_transfer *xfer, void *sc1); From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 17:27:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40B79106564A; Tue, 2 Jun 2009 17:27:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F34E8FC19; Tue, 2 Jun 2009 17:27:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52HRtGI022049; Tue, 2 Jun 2009 17:27:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52HRtsc022048; Tue, 2 Jun 2009 17:27:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200906021727.n52HRtsc022048@svn.freebsd.org> From: Xin LI Date: Tue, 2 Jun 2009 17:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193314 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 17:27:55 -0000 Author: delphij Date: Tue Jun 2 17:27:54 2009 New Revision: 193314 URL: http://svn.freebsd.org/changeset/base/193314 Log: Re-enable WARNS=6 after my universe test. Modified: head/sys/dev/aic7xxx/aicasm/Makefile Modified: head/sys/dev/aic7xxx/aicasm/Makefile ============================================================================== --- head/sys/dev/aic7xxx/aicasm/Makefile Tue Jun 2 17:27:51 2009 (r193313) +++ head/sys/dev/aic7xxx/aicasm/Makefile Tue Jun 2 17:27:54 2009 (r193314) @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} DPADD= ${LIBL} LDADD= -ll +WARNS?= 6 # Correct path for kernel builds # Don't rely on the kernel's .depend file From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 17:29:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC9911065688; Tue, 2 Jun 2009 17:29:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAFF78FC15; Tue, 2 Jun 2009 17:29:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52HTF3e022118; Tue, 2 Jun 2009 17:29:15 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52HTFsX022117; Tue, 2 Jun 2009 17:29:15 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906021729.n52HTFsX022117@svn.freebsd.org> From: Andrew Thompson Date: Tue, 2 Jun 2009 17:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193315 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 17:29:16 -0000 Author: thompsa Date: Tue Jun 2 17:29:15 2009 New Revision: 193315 URL: http://svn.freebsd.org/changeset/base/193315 Log: Staticize ukbd_detach and fix indentation. Submitted by: Sylvestre Gallon Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Tue Jun 2 17:27:54 2009 (r193314) +++ head/sys/dev/usb/input/ukbd.c Tue Jun 2 17:29:15 2009 (r193315) @@ -822,7 +822,7 @@ detach: return (ENXIO); /* error */ } -int +static int ukbd_detach(device_t dev) { struct ukbd_softc *sc = device_get_softc(dev); @@ -1569,7 +1569,7 @@ static int ukbd_driver_load(module_t mod, int what, void *arg) { switch (what) { - case MOD_LOAD: + case MOD_LOAD: kbd_add_driver(&ukbd_kbd_driver); break; case MOD_UNLOAD: From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 17:30:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C76CD1065672; Tue, 2 Jun 2009 17:30:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BB298FC08; Tue, 2 Jun 2009 17:30:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52HUItn022203; Tue, 2 Jun 2009 17:30:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52HUIMQ022202; Tue, 2 Jun 2009 17:30:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906021730.n52HUIMQ022202@svn.freebsd.org> From: Andrew Thompson Date: Tue, 2 Jun 2009 17:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193316 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 17:30:19 -0000 Author: thompsa Date: Tue Jun 2 17:30:18 2009 New Revision: 193316 URL: http://svn.freebsd.org/changeset/base/193316 Log: Fix multithread issue where the is_uref variable was not set and cleared properly in the CDEV private data. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Tue Jun 2 17:29:15 2009 (r193315) +++ head/sys/dev/usb/usb_dev.c Tue Jun 2 17:30:18 2009 (r193316) @@ -169,21 +169,23 @@ usb2_ref_device(struct usb_cdev_privdata cpd->bus = devclass_get_softc(usb2_devclass_ptr, cpd->bus_index); if (cpd->bus == NULL) { DPRINTFN(2, "no bus at %u\n", cpd->bus_index); + need_uref = 0; goto error; } cpd->udev = cpd->bus->devices[cpd->dev_index]; if (cpd->udev == NULL) { DPRINTFN(2, "no device at %u\n", cpd->dev_index); + need_uref = 0; goto error; } if (cpd->udev->refcount == USB_DEV_REF_MAX) { DPRINTFN(2, "no dev ref\n"); + need_uref = 0; goto error; } if (need_uref) { DPRINTFN(2, "ref udev - needed\n"); cpd->udev->refcount++; - cpd->is_uref = 1; mtx_unlock(&usb2_ref_lock); @@ -194,6 +196,11 @@ usb2_ref_device(struct usb_cdev_privdata sx_xlock(cpd->udev->default_sx + 1); mtx_lock(&usb2_ref_lock); + + /* + * Set "is_uref" after grabbing the default SX lock + */ + cpd->is_uref = 1; } /* check if we are doing an open */ @@ -258,18 +265,18 @@ usb2_ref_device(struct usb_cdev_privdata } mtx_unlock(&usb2_ref_lock); - if (cpd->is_uref) { + if (need_uref) { mtx_lock(&Giant); /* XXX */ } return (0); error: - if (cpd->is_uref) { + if (need_uref) { + cpd->is_uref = 0; sx_unlock(cpd->udev->default_sx + 1); if (--(cpd->udev->refcount) == 0) { usb2_cv_signal(cpd->udev->default_cv + 1); } - cpd->is_uref = 0; } mtx_unlock(&usb2_ref_lock); DPRINTFN(2, "fail\n"); @@ -289,10 +296,14 @@ error: static usb_error_t usb2_usb_ref_device(struct usb_cdev_privdata *cpd) { + uint8_t is_uref; + + is_uref = cpd->is_uref && sx_xlocked(cpd->udev->default_sx + 1); + /* * Check if we already got an USB reference on this location: */ - if (cpd->is_uref) + if (is_uref) return (0); /* success */ /* @@ -313,7 +324,12 @@ usb2_usb_ref_device(struct usb_cdev_priv void usb2_unref_device(struct usb_cdev_privdata *cpd) { - if (cpd->is_uref) { + uint8_t is_uref; + + is_uref = cpd->is_uref && sx_xlocked(cpd->udev->default_sx + 1); + + if (is_uref) { + cpd->is_uref = 0; mtx_unlock(&Giant); /* XXX */ sx_unlock(cpd->udev->default_sx + 1); } @@ -330,11 +346,10 @@ usb2_unref_device(struct usb_cdev_privda } cpd->is_write = 0; } - if (cpd->is_uref) { + if (is_uref) { if (--(cpd->udev->refcount) == 0) { usb2_cv_signal(cpd->udev->default_cv + 1); } - cpd->is_uref = 0; } mtx_unlock(&usb2_ref_lock); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 17:31:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69646106566B; Tue, 2 Jun 2009 17:31:16 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 568288FC19; Tue, 2 Jun 2009 17:31:16 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52HVGhe022276; Tue, 2 Jun 2009 17:31:16 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52HVGEe022275; Tue, 2 Jun 2009 17:31:16 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906021731.n52HVGEe022275@svn.freebsd.org> From: Andrew Thompson Date: Tue, 2 Jun 2009 17:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193317 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 17:31:17 -0000 Author: thompsa Date: Tue Jun 2 17:31:16 2009 New Revision: 193317 URL: http://svn.freebsd.org/changeset/base/193317 Log: Fix compile after the removal of bsd_udev. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_compat_linux.h Modified: head/sys/dev/usb/usb_compat_linux.h ============================================================================== --- head/sys/dev/usb/usb_compat_linux.h Tue Jun 2 17:30:18 2009 (r193316) +++ head/sys/dev/usb/usb_compat_linux.h Tue Jun 2 17:31:16 2009 (r193317) @@ -339,6 +339,6 @@ void usb_linux_register(void *arg); void usb_linux_deregister(void *arg); #define interface_to_usbdev(intf) (intf)->linux_udev -#define interface_to_bsddev(intf) (intf)->linux_udev->bsd_udev +#define interface_to_bsddev(intf) (intf)->linux_udev #endif /* _USB_COMPAT_LINUX_H */ From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 17:31:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E92310656C4; Tue, 2 Jun 2009 17:31:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C8028FC24; Tue, 2 Jun 2009 17:31:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52HVxjc022335; Tue, 2 Jun 2009 17:31:59 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52HVx9K022334; Tue, 2 Jun 2009 17:31:59 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906021731.n52HVx9K022334@svn.freebsd.org> From: Andrew Thompson Date: Tue, 2 Jun 2009 17:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193318 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 17:32:00 -0000 Author: thompsa Date: Tue Jun 2 17:31:59 2009 New Revision: 193318 URL: http://svn.freebsd.org/changeset/base/193318 Log: Reorgansise the logic for tranversing the pipe list. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Tue Jun 2 17:31:16 2009 (r193317) +++ head/sys/dev/usb/usb_request.c Tue Jun 2 17:31:59 2009 (r193318) @@ -109,11 +109,11 @@ usb2_do_clear_stall_callback(struct usb_ pipe_end = udev->pipes + udev->pipes_max; pipe_first = udev->pipes; to = udev->pipes_max; - if (pipe == NULL) { - pipe = pipe_first; - } + switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: + if (pipe == NULL) + goto tr_setup; /* device was unconfigured */ if (pipe->edesc && pipe->is_stalled) { pipe->toggle_next = 0; @@ -126,9 +126,10 @@ usb2_do_clear_stall_callback(struct usb_ case USB_ST_SETUP: tr_setup: - if (pipe == pipe_end) { - pipe = pipe_first; - } + if (to == 0) + break; /* no pipes - nothing to do */ + if ((pipe < pipe_first) || (pipe >= pipe_end)) + pipe = pipe_first; /* pipe wrapped around */ if (pipe->edesc && pipe->is_stalled) { @@ -156,9 +157,8 @@ tr_setup: break; } pipe++; - if (--to) - goto tr_setup; - break; + to--; + goto tr_setup; default: if (xfer->error == USB_ERR_CANCELLED) { From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 17:57:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37D211065678; Tue, 2 Jun 2009 17:57:25 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25C4E8FC1B; Tue, 2 Jun 2009 17:57:25 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52HvPmo023320; Tue, 2 Jun 2009 17:57:25 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52HvPa8023319; Tue, 2 Jun 2009 17:57:25 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200906021757.n52HvPa8023319@svn.freebsd.org> From: Ulf Lilleengen Date: Tue, 2 Jun 2009 17:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193325 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 17:57:26 -0000 Author: lulf Date: Tue Jun 2 17:57:24 2009 New Revision: 193325 URL: http://svn.freebsd.org/changeset/base/193325 Log: - Use volatile for signal variables. Suggested by: Jaakko Heinonen Modified: head/sbin/fsck_ffs/fsck.h Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Tue Jun 2 17:54:45 2009 (r193324) +++ head/sbin/fsck_ffs/fsck.h Tue Jun 2 17:57:24 2009 (r193325) @@ -297,8 +297,8 @@ int lfmode; /* lost & found directory ufs2_daddr_t n_blks; /* number of blocks in use */ ino_t n_files; /* number of files in use */ -sig_atomic_t got_siginfo; /* received a SIGINFO */ -sig_atomic_t got_sigalarm; /* received a SIGALRM */ +volatile sig_atomic_t got_siginfo; /* received a SIGINFO */ +volatile sig_atomic_t got_sigalarm; /* received a SIGALRM */ #define clearinode(dp) \ if (sblock.fs_magic == FS_UFS1_MAGIC) { \ From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 18:26:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B93C1065690; Tue, 2 Jun 2009 18:26:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77AA58FC17; Tue, 2 Jun 2009 18:26:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52IQIrr024423; Tue, 2 Jun 2009 18:26:18 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52IQHrh024410; Tue, 2 Jun 2009 18:26:17 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906021826.n52IQHrh024410@svn.freebsd.org> From: Robert Watson Date: Tue, 2 Jun 2009 18:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193332 - in head/sys: kern netatalk netinet rpc security/mac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 18:26:19 -0000 Author: rwatson Date: Tue Jun 2 18:26:17 2009 New Revision: 193332 URL: http://svn.freebsd.org/changeset/base/193332 Log: Add internal 'mac_policy_count' counter to the MAC Framework, which is a count of the number of registered policies. Rather than unconditionally locking sockets before passing them into MAC, lock them in the MAC entry points only if mac_policy_count is non-zero. This avoids locking overhead for a number of socket system calls when no policies are registered, eliminating measurable overhead for the MAC Framework for the socket subsystem when there are no active policies. Possibly socket locks should be acquired by policies if they are required for socket labels, which would further avoid locking overhead when there are policies but they don't require labeling of sockets, or possibly don't even implement socket controls. Obtained from: TrustedBSD Project Modified: head/sys/kern/kern_prot.c head/sys/kern/sys_socket.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/netatalk/ddp_input.c head/sys/netinet/ip_divert.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c head/sys/rpc/svc_vc.c head/sys/security/mac/mac_framework.c head/sys/security/mac/mac_internal.h head/sys/security/mac/mac_socket.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/kern/kern_prot.c Tue Jun 2 18:26:17 2009 (r193332) @@ -1690,9 +1690,7 @@ cr_canseesocket(struct ucred *cred, stru if (error) return (ENOENT); #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_visible(cred, so); - SOCK_UNLOCK(so); if (error) return (error); #endif Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/kern/sys_socket.c Tue Jun 2 18:26:17 2009 (r193332) @@ -78,9 +78,7 @@ soo_read(struct file *fp, struct uio *ui int error; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_receive(active_cred, so); - SOCK_UNLOCK(so); if (error) return (error); #endif @@ -99,9 +97,7 @@ soo_write(struct file *fp, struct uio *u int error; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_send(active_cred, so); - SOCK_UNLOCK(so); if (error) return (error); #endif @@ -222,9 +218,7 @@ soo_poll(struct file *fp, int events, st #ifdef MAC int error; - SOCK_LOCK(so); error = mac_socket_check_poll(active_cred, so); - SOCK_UNLOCK(so); if (error) return (error); #endif @@ -243,9 +237,7 @@ soo_stat(struct file *fp, struct stat *u bzero((caddr_t)ub, sizeof (*ub)); ub->st_mode = S_IFSOCK; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_stat(active_cred, so); - SOCK_UNLOCK(so); if (error) return (error); #endif Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/kern/uipc_socket.c Tue Jun 2 18:26:17 2009 (r193332) @@ -444,9 +444,7 @@ sonewconn(struct socket *head, int conns so->so_proto = head->so_proto; so->so_cred = crhold(head->so_cred); #ifdef MAC - SOCK_LOCK(head); mac_socket_newconn(head, so); - SOCK_UNLOCK(head); #endif knlist_init(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv), NULL, NULL, NULL); Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/kern/uipc_syscalls.c Tue Jun 2 18:26:17 2009 (r193332) @@ -221,16 +221,10 @@ kern_bind(td, fd, sa) ktrsockaddr(sa); #endif #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_bind(td->td_ucred, so, sa); - SOCK_UNLOCK(so); - if (error) - goto done; -#endif - error = sobind(so, sa, td); -#ifdef MAC -done: + if (error == 0) #endif + error = sobind(so, sa, td); fdrop(fp, td); return (error); } @@ -252,17 +246,14 @@ listen(td, uap) if (error == 0) { so = fp->f_data; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_listen(td->td_ucred, so); - SOCK_UNLOCK(so); - if (error) - goto done; + if (error == 0) { #endif - CURVNET_SET(so->so_vnet); - error = solisten(so, uap->backlog, td); - CURVNET_RESTORE(); + CURVNET_SET(so->so_vnet); + error = solisten(so, uap->backlog, td); + CURVNET_RESTORE(); #ifdef MAC -done: + } #endif fdrop(fp, td); } @@ -354,9 +345,7 @@ kern_accept(struct thread *td, int s, st goto done; } #ifdef MAC - SOCK_LOCK(head); error = mac_socket_check_accept(td->td_ucred, head); - SOCK_UNLOCK(head); if (error != 0) goto done; #endif @@ -549,9 +538,7 @@ kern_connect(td, fd, sa) ktrsockaddr(sa); #endif #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_connect(td->td_ucred, so, sa); - SOCK_UNLOCK(so); if (error) goto bad; #endif @@ -603,7 +590,6 @@ kern_socketpair(struct thread *td, int d if (error) return (error); #endif - error = socreate(domain, &so1, type, protocol, td->td_ucred, td); if (error) return (error); @@ -752,13 +738,13 @@ kern_sendit(td, s, mp, flags, control, s so = (struct socket *)fp->f_data; #ifdef MAC - SOCK_LOCK(so); - if (mp->msg_name != NULL) + if (mp->msg_name != NULL) { error = mac_socket_check_connect(td->td_ucred, so, mp->msg_name); - if (error == 0) - error = mac_socket_check_send(td->td_ucred, so); - SOCK_UNLOCK(so); + if (error) + goto bad; + } + error = mac_socket_check_send(td->td_ucred, so); if (error) goto bad; #endif @@ -951,9 +937,7 @@ kern_recvit(td, s, mp, fromseg, controlp so = fp->f_data; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_receive(td->td_ucred, so); - SOCK_UNLOCK(so); if (error) { fdrop(fp, td); return (error); @@ -1887,9 +1871,7 @@ kern_sendfile(struct thread *td, struct } #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_send(td->td_ucred, so); - SOCK_UNLOCK(so); if (error) goto out; #endif @@ -2417,9 +2399,7 @@ sctp_generic_sendmsg (td, uap) so = (struct socket *)fp->f_data; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_send(td->td_ucred, so); - SOCK_UNLOCK(so); if (error) goto sctp_bad; #endif /* MAC */ @@ -2521,9 +2501,7 @@ sctp_generic_sendmsg_iov(td, uap) so = (struct socket *)fp->f_data; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_send(td->td_ucred, so); - SOCK_UNLOCK(so); if (error) goto sctp_bad; #endif /* MAC */ @@ -2618,9 +2596,7 @@ sctp_generic_recvmsg(td, uap) so = fp->f_data; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_receive(td->td_ucred, so); - SOCK_UNLOCK(so); if (error) { goto out; return (error); Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/kern/uipc_usrreq.c Tue Jun 2 18:26:17 2009 (r193332) @@ -1246,10 +1246,8 @@ unp_connect(struct socket *so, struct so UNP_PCB_UNLOCK(unp2); UNP_PCB_UNLOCK(unp); #ifdef MAC - SOCK_LOCK(so); mac_socketpeer_set_from_socket(so, so3); mac_socketpeer_set_from_socket(so3, so); - SOCK_UNLOCK(so); #endif so2 = so3; Modified: head/sys/netatalk/ddp_input.c ============================================================================== --- head/sys/netatalk/ddp_input.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/netatalk/ddp_input.c Tue Jun 2 18:26:17 2009 (r193332) @@ -410,12 +410,8 @@ ddp_input(struct mbuf *m, struct ifnet * goto out; #ifdef MAC - SOCK_LOCK(ddp->ddp_socket); - if (mac_socket_check_deliver(ddp->ddp_socket, m) != 0) { - SOCK_UNLOCK(ddp->ddp_socket); + if (mac_socket_check_deliver(ddp->ddp_socket, m) != 0) goto out; - } - SOCK_UNLOCK(ddp->ddp_socket); #endif /* Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/netinet/ip_divert.c Tue Jun 2 18:26:17 2009 (r193332) @@ -467,9 +467,7 @@ div_output(struct socket *so, struct mbu m->m_pkthdr.rcvif = ifa->ifa_ifp; } #ifdef MAC - SOCK_LOCK(so); mac_socket_create_mbuf(so, m); - SOCK_UNLOCK(so); #endif /* Send packet to input processing via netisr */ netisr_queue_src(NETISR_IP, (uintptr_t)so, m); Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/netinet/tcp_input.c Tue Jun 2 18:26:17 2009 (r193332) @@ -1562,9 +1562,7 @@ tcp_do_segment(struct mbuf *m, struct tc TCPSTAT_INC(tcps_connects); soisconnected(so); #ifdef MAC - SOCK_LOCK(so); mac_socketpeer_set_from_mbuf(m, so); - SOCK_UNLOCK(so); #endif /* Do window scaling on this connection? */ if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) == Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/netinet/tcp_syncache.c Tue Jun 2 18:26:17 2009 (r193332) @@ -635,9 +635,7 @@ syncache_socket(struct syncache *sc, str goto abort2; } #ifdef MAC - SOCK_LOCK(so); mac_socketpeer_set_from_mbuf(m, so); - SOCK_UNLOCK(so); #endif inp = sotoinpcb(so); Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/rpc/svc_vc.c Tue Jun 2 18:26:17 2009 (r193332) @@ -271,9 +271,7 @@ svc_vc_accept(struct socket *head, struc goto done; } #ifdef MAC - SOCK_LOCK(head); error = mac_socket_check_accept(td->td_ucred, head); - SOCK_UNLOCK(head); if (error != 0) goto done; #endif Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/security/mac/mac_framework.c Tue Jun 2 18:26:17 2009 (r193332) @@ -179,6 +179,7 @@ static struct sx mac_policy_sx; /* Slee struct mac_policy_list_head mac_policy_list; struct mac_policy_list_head mac_static_policy_list; +u_int mac_policy_count; /* Registered policy count. */ static void mac_policy_xlock(void); static void mac_policy_xlock_assert(void); @@ -351,17 +352,22 @@ mac_policy_getlabeled(struct mac_policy_ * requiring labels across all policies. */ static void -mac_policy_updateflags(void) +mac_policy_update(void) { struct mac_policy_conf *mpc; mac_policy_xlock_assert(); mac_labeled = 0; - LIST_FOREACH(mpc, &mac_static_policy_list, mpc_list) + mac_policy_count = 0; + LIST_FOREACH(mpc, &mac_static_policy_list, mpc_list) { mac_labeled |= mac_policy_getlabeled(mpc); - LIST_FOREACH(mpc, &mac_policy_list, mpc_list) + mac_policy_count++; + } + LIST_FOREACH(mpc, &mac_policy_list, mpc_list) { mac_labeled |= mac_policy_getlabeled(mpc); + mac_policy_count++; + } } static int @@ -434,7 +440,7 @@ mac_policy_register(struct mac_policy_co */ if (mpc->mpc_ops->mpo_init != NULL) (*(mpc->mpc_ops->mpo_init))(mpc); - mac_policy_updateflags(); + mac_policy_update(); SDT_PROBE(mac, kernel, policy, register, mpc, 0, 0, 0, 0); printf("Security policy loaded: %s (%s)\n", mpc->mpc_fullname, @@ -480,7 +486,7 @@ mac_policy_unregister(struct mac_policy_ LIST_REMOVE(mpc, mpc_list); mpc->mpc_runtime_flags &= ~MPC_RUNTIME_FLAG_REGISTERED; - mac_policy_updateflags(); + mac_policy_update(); mac_policy_xunlock(); SDT_PROBE(mac, kernel, policy, unregister, mpc, 0, 0, 0, 0); Modified: head/sys/security/mac/mac_internal.h ============================================================================== --- head/sys/security/mac/mac_internal.h Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/security/mac/mac_internal.h Tue Jun 2 18:26:17 2009 (r193332) @@ -189,6 +189,7 @@ struct label { */ extern struct mac_policy_list_head mac_policy_list; extern struct mac_policy_list_head mac_static_policy_list; +extern u_int mac_policy_count; extern uint64_t mac_labeled; extern struct mtx mac_ifnet_mtx; Modified: head/sys/security/mac/mac_socket.c ============================================================================== --- head/sys/security/mac/mac_socket.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/security/mac/mac_socket.c Tue Jun 2 18:26:17 2009 (r193332) @@ -234,10 +234,13 @@ void mac_socket_newconn(struct socket *oldso, struct socket *newso) { - SOCK_LOCK_ASSERT(oldso); + if (mac_policy_count == 0) + return; + SOCK_LOCK(oldso); MAC_POLICY_PERFORM_NOSLEEP(socket_newconn, oldso, oldso->so_label, newso, newso->so_label); + SOCK_UNLOCK(oldso); } static void @@ -256,25 +259,30 @@ mac_socketpeer_set_from_mbuf(struct mbuf { struct label *label; - SOCK_LOCK_ASSERT(so); - label = mac_mbuf_to_label(m); + SOCK_LOCK(so); MAC_POLICY_PERFORM_NOSLEEP(socketpeer_set_from_mbuf, m, label, so, so->so_peerlabel); + SOCK_UNLOCK(so); } void mac_socketpeer_set_from_socket(struct socket *oldso, struct socket *newso) { + + if (mac_policy_count == 0) + return; /* - * XXXRW: only hold the socket lock on one at a time, as one socket - * is the original, and one is the new. However, it's called in both - * directions, so we can't assert the lock here currently. + * XXXRW: We want to hold locks on both sockets, but can't currently + * due to lock order -- opt to lock the socket where we're accessing + * so_label as it's more likely to change. */ + SOCK_LOCK(oldso); MAC_POLICY_PERFORM_NOSLEEP(socketpeer_set_from_socket, oldso, oldso->so_label, newso, newso->so_peerlabel); + SOCK_UNLOCK(oldso); } void @@ -282,12 +290,15 @@ mac_socket_create_mbuf(struct socket *so { struct label *label; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return; label = mac_mbuf_to_label(m); + SOCK_LOCK(so); MAC_POLICY_PERFORM_NOSLEEP(socket_create_mbuf, so, so->so_label, m, label); + SOCK_UNLOCK(so); } MAC_CHECK_PROBE_DEFINE2(socket_check_accept, "struct ucred *", @@ -298,11 +309,14 @@ mac_socket_check_accept(struct ucred *cr { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_accept, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_accept, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -316,11 +330,14 @@ mac_socket_check_bind(struct ucred *cred { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_bind, cred, so, so->so_label, sa); MAC_CHECK_PROBE3(socket_check_bind, error, cred, so, sa); + SOCK_UNLOCK(so); return (error); } @@ -334,11 +351,14 @@ mac_socket_check_connect(struct ucred *c { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_connect, cred, so, so->so_label, sa); MAC_CHECK_PROBE3(socket_check_connect, error, cred, so, sa); + SOCK_UNLOCK(so); return (error); } @@ -368,13 +388,16 @@ mac_socket_check_deliver(struct socket * struct label *label; int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); label = mac_mbuf_to_label(m); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_deliver, so, so->so_label, m, label); MAC_CHECK_PROBE2(socket_check_deliver, error, so, m); + SOCK_UNLOCK(so); return (error); } @@ -387,11 +410,14 @@ mac_socket_check_listen(struct ucred *cr { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_listen, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_listen, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -404,10 +430,13 @@ mac_socket_check_poll(struct ucred *cred { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_poll, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_poll, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -420,11 +449,14 @@ mac_socket_check_receive(struct ucred *c { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_receive, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_receive, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -455,10 +487,13 @@ mac_socket_check_send(struct ucred *cred { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_send, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_send, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -471,10 +506,13 @@ mac_socket_check_stat(struct ucred *cred { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_stat, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_stat, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -487,11 +525,14 @@ mac_socket_check_visible(struct ucred *c { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_visible, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_visible, error, cred, so); + SOCK_UNLOCK(so); return (error); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 18:30:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CE621065740; Tue, 2 Jun 2009 18:30:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79D6B8FC17; Tue, 2 Jun 2009 18:30:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52IU9tb024534; Tue, 2 Jun 2009 18:30:09 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52IU9Aa024533; Tue, 2 Jun 2009 18:30:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200906021830.n52IU9Aa024533@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 2 Jun 2009 18:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193333 - head/sbin/mksnap_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 18:30:11 -0000 Author: pjd Date: Tue Jun 2 18:30:09 2009 New Revision: 193333 URL: http://svn.freebsd.org/changeset/base/193333 Log: Initialize iov and iovlen before use. Reported by: Lucius Windschuh Modified: head/sbin/mksnap_ffs/mksnap_ffs.c Modified: head/sbin/mksnap_ffs/mksnap_ffs.c ============================================================================== --- head/sbin/mksnap_ffs/mksnap_ffs.c Tue Jun 2 18:26:17 2009 (r193332) +++ head/sbin/mksnap_ffs/mksnap_ffs.c Tue Jun 2 18:30:09 2009 (r193333) @@ -112,6 +112,8 @@ main(int argc, char **argv) if ((grp = getgrnam("operator")) == NULL) errx(1, "Cannot retrieve operator gid"); + iov = NULL; + iovlen = 0; build_iovec(&iov, &iovlen, "fstype", "ffs", 4); build_iovec(&iov, &iovlen, "from", snapname, (size_t)-1); build_iovec(&iov, &iovlen, "fspath", stfsbuf.f_mntonname, (size_t)-1); From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 18:31:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D75B10656C7; Tue, 2 Jun 2009 18:31:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41D518FC1D; Tue, 2 Jun 2009 18:31:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52IV9Sa024604; Tue, 2 Jun 2009 18:31:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52IV8YZ024597; Tue, 2 Jun 2009 18:31:08 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906021831.n52IV8YZ024597@svn.freebsd.org> From: Robert Watson Date: Tue, 2 Jun 2009 18:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193334 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 18:31:09 -0000 Author: rwatson Date: Tue Jun 2 18:31:08 2009 New Revision: 193334 URL: http://svn.freebsd.org/changeset/base/193334 Log: Remove MAC kernel config files and add "options MAC" to GENERIC, with the goal of shipping 8.0 with MAC support in the default kernel. No policies will be compiled in or enabled by default, but it will now be possible to load them at boot or runtime without a kernel recompile. While the framework is not believed to impose measurable overhead when no policies are loaded (a result of optimization over the past few months in HEAD), we'll continue to benchmark and optimize as the release approaches. Please keep an eye out for performance or functionality regressions that could be a result of this change. Approved by: re (kensmith) Obtained from: TrustedBSD Project Deleted: head/sys/amd64/conf/MAC head/sys/i386/conf/MAC head/sys/ia64/conf/MAC head/sys/pc98/conf/MAC head/sys/powerpc/conf/MAC head/sys/sparc64/conf/MAC head/sys/sun4v/conf/MAC Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/amd64/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -70,6 +70,7 @@ options KBD_INSTALL_CDEV # install a CD options STOP_NMI # Stop CPUS using NMI instead of IPI options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/i386/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -71,6 +71,7 @@ options KBD_INSTALL_CDEV # install a CD options STOP_NMI # Stop CPUS using NMI instead of IPI options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework #options KDTRACE_HOOKS # Kernel DTrace hooks # Debugging for use in -current Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/ia64/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -40,6 +40,7 @@ options INVARIANTS # Enable calls of ex options INVARIANT_SUPPORT # required by INVARIANTS options KDB # Enable kernel debugger support options KTRACE # ktrace(1) syscall trace support +options MAC # TrustedBSD MAC Framework options MD_ROOT # MD usable as root device options MSDOSFS # MSDOS Filesystem options NFSCLIENT # Network Filesystem Client Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/pc98/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -73,6 +73,7 @@ options _KPOSIX_PRIORITY_SCHEDULING # P options KBD_INSTALL_CDEV # install a CDEV entry in /dev options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework # Debugging for use in -current options KDB # Enable kernel debugger support. Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/powerpc/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -64,6 +64,7 @@ options SYSVSEM #SYSV-style semaphore options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework # Debugging for use in -current options KDB #Enable the kernel debugger Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/sparc64/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -65,6 +65,7 @@ options SYSVSEM # SYSV-style semaphor options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework # Debugging for use in -current options KDB # Enable kernel debugger support. Modified: head/sys/sun4v/conf/GENERIC ============================================================================== --- head/sys/sun4v/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/sun4v/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -66,6 +66,7 @@ options AHC_REG_PRETTY_PRINT # Print re options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework # Debugging for use in -current options KDB # Enable kernel debugger support. From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 18:53:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 543B3106566C; Tue, 2 Jun 2009 18:53:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42A998FC18; Tue, 2 Jun 2009 18:53:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52IrMIG025147; Tue, 2 Jun 2009 18:53:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52IrMsU025146; Tue, 2 Jun 2009 18:53:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906021853.n52IrMsU025146@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 18:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193336 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 18:53:22 -0000 Author: sam Date: Tue Jun 2 18:53:21 2009 New Revision: 193336 URL: http://svn.freebsd.org/changeset/base/193336 Log: move ifq_detach from if_detach to if_free; this permits callers to reference if_snd in the period between detach+free which helps simplify detach code Reviewed by: jhb, rwatson Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Jun 2 18:53:21 2009 (r193335) +++ head/sys/net/if.c Tue Jun 2 18:53:21 2009 (r193336) @@ -574,6 +574,7 @@ if_free_internal(struct ifnet *ifp) knlist_destroy(&ifp->if_klist); IF_AFDATA_DESTROY(ifp); IF_ADDR_LOCK_DESTROY(ifp); + ifq_detach(&ifp->if_snd); free(ifp, M_IFNET); } @@ -1025,9 +1026,6 @@ if_detach_internal(struct ifnet *ifp, in } ifp->if_afdata_initialized = 0; IF_AFDATA_UNLOCK(ifp); - - if (!vmove) - ifq_detach(&ifp->if_snd); } #ifdef VIMAGE From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 18:55:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6542106564A; Tue, 2 Jun 2009 18:55:27 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B44C88FC08; Tue, 2 Jun 2009 18:55:27 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52ItRNf025237; Tue, 2 Jun 2009 18:55:27 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52ItRMw025236; Tue, 2 Jun 2009 18:55:27 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906021855.n52ItRMw025236@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 18:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193337 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 18:55:28 -0000 Author: sam Date: Tue Jun 2 18:55:27 2009 New Revision: 193337 URL: http://svn.freebsd.org/changeset/base/193337 Log: move if_detach to the top of ieee80211_ifdetach to close various races Reviewed by: jhb Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Jun 2 18:53:21 2009 (r193336) +++ head/sys/net80211/ieee80211.c Tue Jun 2 18:55:27 2009 (r193337) @@ -313,6 +313,8 @@ ieee80211_ifdetach(struct ieee80211com * struct ifnet *ifp = ic->ic_ifp; struct ieee80211vap *vap; + if_detach(ifp); + while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) ieee80211_vap_destroy(vap); ieee80211_waitfor_parent(ic); @@ -329,11 +331,10 @@ ieee80211_ifdetach(struct ieee80211com * ieee80211_crypto_detach(ic); ieee80211_power_detach(ic); ieee80211_node_detach(ic); - ifmedia_removeall(&ic->ic_media); + ifmedia_removeall(&ic->ic_media); taskqueue_free(ic->ic_tq); IEEE80211_LOCK_DESTROY(ic); - if_detach(ifp); } /* From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 19:11:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9503A1065686; Tue, 2 Jun 2009 19:11:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5EC928FC46; Tue, 2 Jun 2009 19:11:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 0068F46B2C; Tue, 2 Jun 2009 15:11:09 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 9B7218A02C; Tue, 2 Jun 2009 15:11:07 -0400 (EDT) From: John Baldwin To: Brooks Davis Date: Tue, 2 Jun 2009 15:11:03 -0400 User-Agent: KMail/1.9.7 References: <200906010537.n515bDou065357@svn.freebsd.org> <4A25491B.4030406@incunabulum.net> <20090602165021.GB15552@lor.one-eyed-alien.net> In-Reply-To: <20090602165021.GB15552@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200906021511.03955.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 02 Jun 2009 15:11:07 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Bruce Simpson , src-committers@freebsd.org, Doug Barton Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 19:11:10 -0000 On Tuesday 02 June 2009 12:50:21 pm Brooks Davis wrote: > On Tue, Jun 02, 2009 at 04:45:31PM +0100, Bruce Simpson wrote: > > Brooks Davis wrote: > >> ... > >>> On boot time I instantiate a tap0 instance from cloned_interfaces=".." in > >>> /etc/rc.conf, and then use ifconfig_tap0="..." to clone the MAC address > >>> on the tap instance from the internal Ethernet port, as there is no other > >>> way of uniquely identifying the client for an automated bootstrap. > >>> > >>> This happens from within a flash image. > >>> > >> > >> I see nothing related to network_interfaces here... > >> > > > > I did explicitly name them there, so there would be no automated DHCP setup > > of any interfaces, even if hot-plugged. Perhaps I am thinking of > > cloned_interfaces=""... > > cloned_interfaces is different and will definiterly remain since you've > got to create them some how. They get created early and thus end up on > the list. Also, there's no need to worry about hot plugged interfaces > getting margically configured to do dhcp. For the system to do > something with an interface they following must be true: > > - It makes it in to the list of interfaces some how > - It actually exists or is create early in the process via > cloned_interfaces, gif_interfaces, etc > - The ifconfig_ variable is set (I think i can be "", but "up" is > alwasy a good choice if you just want a stub. > - The ifconfig_ variable must not contain the NOAUTO keyword. > > If all of those things are true, the interface will be configured at > startup or on insert. Otherwise, it won't be. I think more specifically, if you don't set 'ifconfig_' to "DHCP", then when you plug a device in, nothing happens. DHCP is opt-in, not opt-out. The only reason one would want to limit network_interfaces is if you wanted to have an ifconfig_foo0 line in /etc/rc.conf but not have foo0 configured automatically. But you can already accomplish that via either the 'NOAUTO' keyword or just not having a bogus ifconfig_foo0 line. Given that, there really isn't a good reason to customize network_interfaces anymore. Unless someone has a real usage case that NOAUTO, etc. doesn't cover, I think this commit should be reverted. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 19:22:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C40671065679 for ; Tue, 2 Jun 2009 19:22:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 5AD968FC1C for ; Tue, 2 Jun 2009 19:22:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 18680 invoked by uid 399); 2 Jun 2009 19:22:25 -0000 Received: from localhost (HELO ?192.168.0.100?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 2 Jun 2009 19:22:25 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4A257BEF.2010205@FreeBSD.org> Date: Tue, 02 Jun 2009 12:22:23 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: John Baldwin References: <200906010537.n515bDou065357@svn.freebsd.org> <4A25491B.4030406@incunabulum.net> <20090602165021.GB15552@lor.one-eyed-alien.net> <200906021511.03955.jhb@freebsd.org> In-Reply-To: <200906021511.03955.jhb@freebsd.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org, Bruce Simpson Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 19:22:32 -0000 John Baldwin wrote: > I think more specifically, if you don't set 'ifconfig_' to "DHCP", then > when you plug a device in, nothing happens. That's actually not correct, as devd will try to dhcp an interface as soon as it comes up. > DHCP is opt-in, not > opt-out. The only reason one would want to limit network_interfaces is if > you wanted to have an ifconfig_foo0 line in /etc/rc.conf but not have foo0 > configured automatically. I've already said several times that I want to run through my own list of interfaces, configure the first one that comes up, and then stop. There is no support for that currently. Others have also chimed in with things that they do with the existing feature as well. > Unless someone has a real usage case that NOAUTO, etc. doesn't cover, I think > this commit should be reverted. I think that the burden of proof rests on those that want to eliminate existing functionality. Doug From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 19:28:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5489A106566B; Tue, 2 Jun 2009 19:28:27 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40E278FC08; Tue, 2 Jun 2009 19:28:27 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52JSRIx025861; Tue, 2 Jun 2009 19:28:27 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52JSQwh025859; Tue, 2 Jun 2009 19:28:26 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906021928.n52JSQwh025859@svn.freebsd.org> From: Andrew Thompson Date: Tue, 2 Jun 2009 19:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193338 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 19:28:28 -0000 Author: thompsa Date: Tue Jun 2 19:28:26 2009 New Revision: 193338 URL: http://svn.freebsd.org/changeset/base/193338 Log: Place the fifo and ref counting variables on the stack to prevent races. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_dev.h Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Tue Jun 2 18:55:27 2009 (r193337) +++ head/sys/dev/usb/usb_dev.c Tue Jun 2 19:28:26 2009 (r193338) @@ -88,9 +88,9 @@ static struct usb_pipe *usb2_dev_get_pip static void usb2_loc_fill(struct usb_fs_privdata *, struct usb_cdev_privdata *); static void usb2_close(void *); -static usb_error_t usb2_ref_device(struct usb_cdev_privdata *, int); -static usb_error_t usb2_usb_ref_device(struct usb_cdev_privdata *); -static void usb2_unref_device(struct usb_cdev_privdata *); +static usb_error_t usb2_ref_device(struct usb_cdev_privdata *, struct usb_cdev_refdata *, int); +static usb_error_t usb2_usb_ref_device(struct usb_cdev_privdata *, struct usb_cdev_refdata *); +static void usb2_unref_device(struct usb_cdev_privdata *, struct usb_cdev_refdata *); static d_open_t usb2_open; static d_ioctl_t usb2_ioctl; @@ -158,29 +158,30 @@ usb2_loc_fill(struct usb_fs_privdata* pd * Else: Failure. *------------------------------------------------------------------------*/ usb_error_t -usb2_ref_device(struct usb_cdev_privdata* cpd, int need_uref) +usb2_ref_device(struct usb_cdev_privdata *cpd, + struct usb_cdev_refdata *crd, int need_uref) { struct usb_fifo **ppf; struct usb_fifo *f; - DPRINTFN(2, "usb2_ref_device, cpd=%p need uref=%d\n", cpd, need_uref); + DPRINTFN(2, "cpd=%p need uref=%d\n", cpd, need_uref); + + /* clear all refs */ + memset(crd, 0, sizeof(*crd)); mtx_lock(&usb2_ref_lock); cpd->bus = devclass_get_softc(usb2_devclass_ptr, cpd->bus_index); if (cpd->bus == NULL) { DPRINTFN(2, "no bus at %u\n", cpd->bus_index); - need_uref = 0; goto error; } cpd->udev = cpd->bus->devices[cpd->dev_index]; if (cpd->udev == NULL) { DPRINTFN(2, "no device at %u\n", cpd->dev_index); - need_uref = 0; goto error; } if (cpd->udev->refcount == USB_DEV_REF_MAX) { DPRINTFN(2, "no dev ref\n"); - need_uref = 0; goto error; } if (need_uref) { @@ -200,79 +201,64 @@ usb2_ref_device(struct usb_cdev_privdata /* * Set "is_uref" after grabbing the default SX lock */ - cpd->is_uref = 1; + crd->is_uref = 1; } /* check if we are doing an open */ if (cpd->fflags == 0) { - /* set defaults */ - cpd->txfifo = NULL; - cpd->rxfifo = NULL; - cpd->is_write = 0; - cpd->is_read = 0; - cpd->is_usbfs = 0; + /* use zero defaults */ } else { - /* initialise "is_usbfs" flag */ - cpd->is_usbfs = 0; - /* check for write */ if (cpd->fflags & FWRITE) { ppf = cpd->udev->fifo; f = ppf[cpd->fifo_index + USB_FIFO_TX]; - cpd->txfifo = f; - cpd->is_write = 1; /* ref */ + crd->txfifo = f; + crd->is_write = 1; /* ref */ if (f == NULL || f->refcount == USB_FIFO_REF_MAX) goto error; if (f->curr_cpd != cpd) goto error; /* check if USB-FS is active */ if (f->fs_ep_max != 0) { - cpd->is_usbfs = 1; + crd->is_usbfs = 1; } - } else { - cpd->txfifo = NULL; - cpd->is_write = 0; /* no ref */ } /* check for read */ if (cpd->fflags & FREAD) { ppf = cpd->udev->fifo; f = ppf[cpd->fifo_index + USB_FIFO_RX]; - cpd->rxfifo = f; - cpd->is_read = 1; /* ref */ + crd->rxfifo = f; + crd->is_read = 1; /* ref */ if (f == NULL || f->refcount == USB_FIFO_REF_MAX) goto error; if (f->curr_cpd != cpd) goto error; /* check if USB-FS is active */ if (f->fs_ep_max != 0) { - cpd->is_usbfs = 1; + crd->is_usbfs = 1; } - } else { - cpd->rxfifo = NULL; - cpd->is_read = 0; /* no ref */ } } /* when everything is OK we increment the refcounts */ - if (cpd->is_write) { + if (crd->is_write) { DPRINTFN(2, "ref write\n"); - cpd->txfifo->refcount++; + crd->txfifo->refcount++; } - if (cpd->is_read) { + if (crd->is_read) { DPRINTFN(2, "ref read\n"); - cpd->rxfifo->refcount++; + crd->rxfifo->refcount++; } mtx_unlock(&usb2_ref_lock); - if (need_uref) { + if (crd->is_uref) { mtx_lock(&Giant); /* XXX */ } return (0); error: - if (need_uref) { - cpd->is_uref = 0; + if (crd->is_uref) { sx_unlock(cpd->udev->default_sx + 1); if (--(cpd->udev->refcount) == 0) { usb2_cv_signal(cpd->udev->default_cv + 1); @@ -294,25 +280,22 @@ error: * Else: Failure. *------------------------------------------------------------------------*/ static usb_error_t -usb2_usb_ref_device(struct usb_cdev_privdata *cpd) +usb2_usb_ref_device(struct usb_cdev_privdata *cpd, + struct usb_cdev_refdata *crd) { - uint8_t is_uref; - - is_uref = cpd->is_uref && sx_xlocked(cpd->udev->default_sx + 1); - /* * Check if we already got an USB reference on this location: */ - if (is_uref) + if (crd->is_uref) return (0); /* success */ /* * To avoid deadlock at detach we need to drop the FIFO ref * and re-acquire a new ref! */ - usb2_unref_device(cpd); + usb2_unref_device(cpd, crd); - return (usb2_ref_device(cpd, 1 /* need uref */)); + return (usb2_ref_device(cpd, crd, 1 /* need uref */)); } /*------------------------------------------------------------------------* @@ -322,34 +305,34 @@ usb2_usb_ref_device(struct usb_cdev_priv * given USB device. *------------------------------------------------------------------------*/ void -usb2_unref_device(struct usb_cdev_privdata *cpd) +usb2_unref_device(struct usb_cdev_privdata *cpd, + struct usb_cdev_refdata *crd) { - uint8_t is_uref; - is_uref = cpd->is_uref && sx_xlocked(cpd->udev->default_sx + 1); + DPRINTFN(2, "cpd=%p is_uref=%d\n", cpd, crd->is_uref); - if (is_uref) { - cpd->is_uref = 0; + if (crd->is_uref) { mtx_unlock(&Giant); /* XXX */ sx_unlock(cpd->udev->default_sx + 1); } mtx_lock(&usb2_ref_lock); - if (cpd->is_read) { - if (--(cpd->rxfifo->refcount) == 0) { - usb2_cv_signal(&cpd->rxfifo->cv_drain); + if (crd->is_read) { + if (--(crd->rxfifo->refcount) == 0) { + usb2_cv_signal(&crd->rxfifo->cv_drain); } - cpd->is_read = 0; + crd->is_read = 0; } - if (cpd->is_write) { - if (--(cpd->txfifo->refcount) == 0) { - usb2_cv_signal(&cpd->txfifo->cv_drain); + if (crd->is_write) { + if (--(crd->txfifo->refcount) == 0) { + usb2_cv_signal(&crd->txfifo->cv_drain); } - cpd->is_write = 0; + crd->is_write = 0; } - if (is_uref) { + if (crd->is_uref) { if (--(cpd->udev->refcount) == 0) { usb2_cv_signal(cpd->udev->default_cv + 1); } + crd->is_uref = 0; } mtx_unlock(&usb2_ref_lock); } @@ -372,7 +355,8 @@ usb2_fifo_alloc(void) * usb2_fifo_create *------------------------------------------------------------------------*/ static int -usb2_fifo_create(struct usb_cdev_privdata *cpd) +usb2_fifo_create(struct usb_cdev_privdata *cpd, + struct usb_cdev_refdata *crd) { struct usb_device *udev = cpd->udev; struct usb_fifo *f; @@ -396,13 +380,13 @@ usb2_fifo_create(struct usb_cdev_privdat f = udev->fifo[cpd->fifo_index + USB_FIFO_TX]; if (f == NULL) return (EINVAL); - cpd->txfifo = f; + crd->txfifo = f; } if (is_rx) { f = udev->fifo[cpd->fifo_index + USB_FIFO_RX]; if (f == NULL) return (EINVAL); - cpd->rxfifo = f; + crd->rxfifo = f; } return (0); } @@ -531,10 +515,10 @@ usb2_fifo_create(struct usb_cdev_privdat mtx_unlock(&usb2_ref_lock); } if (is_tx) { - cpd->txfifo = udev->fifo[n + USB_FIFO_TX]; + crd->txfifo = udev->fifo[n + USB_FIFO_TX]; } if (is_rx) { - cpd->rxfifo = udev->fifo[n + USB_FIFO_RX]; + crd->rxfifo = udev->fifo[n + USB_FIFO_RX]; } /* fill out fifo index */ DPRINTFN(5, "fifo index = %d\n", n); @@ -821,6 +805,7 @@ static int usb2_open(struct cdev *dev, int fflags, int devtype, struct thread *td) { struct usb_fs_privdata* pd = (struct usb_fs_privdata*)dev->si_drv1; + struct usb_cdev_refdata refs; struct usb_cdev_privdata *cpd; int err, ep; @@ -837,7 +822,7 @@ usb2_open(struct cdev *dev, int fflags, ep = cpd->ep_addr = pd->ep_addr; usb2_loc_fill(pd, cpd); - err = usb2_ref_device(cpd, 1); + err = usb2_ref_device(cpd, &refs, 1); if (err) { DPRINTFN(2, "cannot ref device\n"); free(cpd, M_USBDEV); @@ -846,36 +831,36 @@ usb2_open(struct cdev *dev, int fflags, cpd->fflags = fflags; /* access mode for open lifetime */ /* create FIFOs, if any */ - err = usb2_fifo_create(cpd); + err = usb2_fifo_create(cpd, &refs); /* check for error */ if (err) { DPRINTFN(2, "cannot create fifo\n"); - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); free(cpd, M_USBDEV); return (err); } if (fflags & FREAD) { - err = usb2_fifo_open(cpd, cpd->rxfifo, fflags); + err = usb2_fifo_open(cpd, refs.rxfifo, fflags); if (err) { DPRINTFN(2, "read open failed\n"); - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); free(cpd, M_USBDEV); return (err); } } if (fflags & FWRITE) { - err = usb2_fifo_open(cpd, cpd->txfifo, fflags); + err = usb2_fifo_open(cpd, refs.txfifo, fflags); if (err) { DPRINTFN(2, "write open failed\n"); if (fflags & FREAD) { - usb2_fifo_close(cpd->rxfifo, fflags); + usb2_fifo_close(refs.rxfifo, fflags); } - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); free(cpd, M_USBDEV); return (err); } } - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); devfs_set_cdevpriv(cpd, usb2_close); return (0); @@ -887,24 +872,25 @@ usb2_open(struct cdev *dev, int fflags, static void usb2_close(void *arg) { + struct usb_cdev_refdata refs; struct usb_cdev_privdata *cpd = arg; int err; DPRINTFN(2, "cpd=%p\n", cpd); - err = usb2_ref_device(cpd, 1); + err = usb2_ref_device(cpd, &refs, 1); if (err) { free(cpd, M_USBDEV); return; } if (cpd->fflags & FREAD) { - usb2_fifo_close(cpd->rxfifo, cpd->fflags); + usb2_fifo_close(refs.rxfifo, cpd->fflags); } if (cpd->fflags & FWRITE) { - usb2_fifo_close(cpd->txfifo, cpd->fflags); + usb2_fifo_close(refs.txfifo, cpd->fflags); } - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); free(cpd, M_USBDEV); return; } @@ -1003,6 +989,7 @@ usb2_ioctl_f_sub(struct usb_fifo *f, u_l static int usb2_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int fflag, struct thread* td) { + struct usb_cdev_refdata refs; struct usb_cdev_privdata* cpd; struct usb_fifo *f; int fflags; @@ -1015,11 +1002,11 @@ usb2_ioctl(struct cdev *dev, u_long cmd, return (err); /* - * Performance optimistaion: We try to check for IOCTL's that + * Performance optimisation: We try to check for IOCTL's that * don't need the USB reference first. Then we grab the USB * reference if we need it! */ - err = usb2_ref_device(cpd, 0 /* no uref */ ); + err = usb2_ref_device(cpd, &refs, 0 /* no uref */ ); if (err) { return (ENXIO); } @@ -1029,11 +1016,11 @@ usb2_ioctl(struct cdev *dev, u_long cmd, err = ENOIOCTL; /* set default value */ if (fflags & FWRITE) { - f = cpd->txfifo; + f = refs.txfifo; err = usb2_ioctl_f_sub(f, cmd, addr, td); } if (fflags & FREAD) { - f = cpd->rxfifo; + f = refs.rxfifo; err = usb2_ioctl_f_sub(f, cmd, addr, td); } KASSERT(f != NULL, ("fifo not found")); @@ -1041,7 +1028,7 @@ usb2_ioctl(struct cdev *dev, u_long cmd, err = (f->methods->f_ioctl) (f, cmd, addr, fflags); DPRINTFN(2, "f_ioctl cmd 0x%lx = %d\n", cmd, err); if (err == ENOIOCTL) { - if (usb2_usb_ref_device(cpd)) { + if (usb2_usb_ref_device(cpd, &refs)) { err = ENXIO; goto done; } @@ -1053,7 +1040,7 @@ usb2_ioctl(struct cdev *dev, u_long cmd, err = ENOTTY; } done: - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); return (err); } @@ -1061,13 +1048,14 @@ done: static int usb2_poll(struct cdev* dev, int events, struct thread* td) { + struct usb_cdev_refdata refs; struct usb_cdev_privdata* cpd; struct usb_fifo *f; struct usb_mbuf *m; int fflags, revents; if (devfs_get_cdevpriv((void **)&cpd) != 0 || - usb2_ref_device(cpd, 0) != 0) + usb2_ref_device(cpd, &refs, 0) != 0) return (events & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); @@ -1078,11 +1066,11 @@ usb2_poll(struct cdev* dev, int events, if ((events & (POLLOUT | POLLWRNORM)) && (fflags & FWRITE)) { - f = cpd->txfifo; + f = refs.txfifo; mtx_lock(f->priv_mtx); - if (!cpd->is_usbfs) { + if (!refs.is_usbfs) { if (f->flag_iserror) { /* we got an error */ m = (void *)1; @@ -1117,11 +1105,11 @@ usb2_poll(struct cdev* dev, int events, if ((events & (POLLIN | POLLRDNORM)) && (fflags & FREAD)) { - f = cpd->rxfifo; + f = refs.rxfifo; mtx_lock(f->priv_mtx); - if (!cpd->is_usbfs) { + if (!refs.is_usbfs) { if (f->flag_iserror) { /* we have and error */ m = (void *)1; @@ -1150,7 +1138,7 @@ usb2_poll(struct cdev* dev, int events, f->flag_isselect = 1; selrecord(td, &f->selinfo); - if (!cpd->is_usbfs) { + if (!refs.is_usbfs) { /* start reading data */ (f->methods->f_start_read) (f); } @@ -1158,13 +1146,14 @@ usb2_poll(struct cdev* dev, int events, mtx_unlock(f->priv_mtx); } - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); return (revents); } static int usb2_read(struct cdev *dev, struct uio *uio, int ioflag) { + struct usb_cdev_refdata refs; struct usb_cdev_privdata* cpd; struct usb_fifo *f; struct usb_mbuf *m; @@ -1178,15 +1167,16 @@ usb2_read(struct cdev *dev, struct uio * if (err != 0) return (err); - err = usb2_ref_device(cpd, 0 /* no uref */ ); + err = usb2_ref_device(cpd, &refs, 0 /* no uref */ ); if (err) { return (ENXIO); } fflags = cpd->fflags; - f = cpd->rxfifo; + f = refs.rxfifo; if (f == NULL) { /* should not happen */ + usb2_unref_device(cpd, &refs); return (EPERM); } @@ -1200,7 +1190,7 @@ usb2_read(struct cdev *dev, struct uio * goto done; } /* check if USB-FS interface is active */ - if (cpd->is_usbfs) { + if (refs.is_usbfs) { /* * The queue is used for events that should be * retrieved using the "USB_FS_COMPLETE" ioctl. @@ -1278,7 +1268,7 @@ usb2_read(struct cdev *dev, struct uio * done: mtx_unlock(f->priv_mtx); - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); return (err); } @@ -1286,6 +1276,7 @@ done: static int usb2_write(struct cdev *dev, struct uio *uio, int ioflag) { + struct usb_cdev_refdata refs; struct usb_cdev_privdata* cpd; struct usb_fifo *f; struct usb_mbuf *m; @@ -1301,16 +1292,16 @@ usb2_write(struct cdev *dev, struct uio if (err != 0) return (err); - err = usb2_ref_device(cpd, 0 /* no uref */ ); + err = usb2_ref_device(cpd, &refs, 0 /* no uref */ ); if (err) { return (ENXIO); } fflags = cpd->fflags; - f = cpd->txfifo; + f = refs.txfifo; if (f == NULL) { /* should not happen */ - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); return (EPERM); } resid = uio->uio_resid; @@ -1323,7 +1314,7 @@ usb2_write(struct cdev *dev, struct uio goto done; } /* check if USB-FS interface is active */ - if (cpd->is_usbfs) { + if (refs.is_usbfs) { /* * The queue is used for events that should be * retrieved using the "USB_FS_COMPLETE" ioctl. @@ -1391,7 +1382,7 @@ usb2_write(struct cdev *dev, struct uio done: mtx_unlock(f->priv_mtx); - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); return (err); } Modified: head/sys/dev/usb/usb_dev.h ============================================================================== --- head/sys/dev/usb/usb_dev.h Tue Jun 2 18:55:27 2009 (r193337) +++ head/sys/dev/usb/usb_dev.h Tue Jun 2 19:28:26 2009 (r193338) @@ -88,13 +88,19 @@ struct usb_cdev_privdata { struct usb_bus *bus; struct usb_device *udev; struct usb_interface *iface; - struct usb_fifo *rxfifo; - struct usb_fifo *txfifo; int bus_index; /* bus index */ int dev_index; /* device index */ int ep_addr; /* endpoint address */ int fflags; uint8_t fifo_index; /* FIFO index */ +}; + +/* + * Private per-device and per-thread reference information + */ +struct usb_cdev_refdata { + struct usb_fifo *rxfifo; + struct usb_fifo *txfifo; uint8_t is_read; /* location has read access */ uint8_t is_write; /* location has write access */ uint8_t is_uref; /* USB refcount decr. needed */ From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 19:45:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02B4710656D0; Tue, 2 Jun 2009 19:45:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B428C8FC1B; Tue, 2 Jun 2009 19:45:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4A88046B23; Tue, 2 Jun 2009 15:45:45 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 1A56C8A02C; Tue, 2 Jun 2009 15:45:44 -0400 (EDT) From: John Baldwin To: Doug Barton Date: Tue, 2 Jun 2009 15:45:21 -0400 User-Agent: KMail/1.9.7 References: <200906010537.n515bDou065357@svn.freebsd.org> <200906021511.03955.jhb@freebsd.org> <4A257BEF.2010205@FreeBSD.org> In-Reply-To: <4A257BEF.2010205@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200906021545.22204.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 02 Jun 2009 15:45:44 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org, Bruce Simpson Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 19:45:46 -0000 On Tuesday 02 June 2009 3:22:23 pm Doug Barton wrote: > John Baldwin wrote: > > I think more specifically, if you don't set 'ifconfig_' to "DHCP",= =20 then=20 > > when you plug a device in, nothing happens.=20 >=20 > That's actually not correct, as devd will try to dhcp an interface as > soon as it comes up. That is completely wrong. Checking the actual code would probably be helpf= ul=20 here. From /etc/devd.conf: # # Try to start dhclient on Ethernet like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually # run it. No link down rule exists because dhclient automaticly exits # when the link goes down. # notify 0 { match "system" "IFNET"; match "type" "LINK_UP"; media-type "ethernet"; action "/etc/rc.d/dhclient start $subsystem"; }; Note the comment. From /etc/rc.d/dhclient: ifn=3D"$2" load_rc_config $name load_rc_config network if ! dhcpif $ifn; then return 1 fi run_rc_command "$1" =46rom /etc/network.subr: # dhcpif if # Returns 0 if the interface is a DHCP interface and 1 otherwise. dhcpif() { _tmpargs=3D`_ifconfig_getargs $1` for _arg in $_tmpargs; do case $_arg in [Dd][Hh][Cc][Pp]) return 0 ;; [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) return 0 ;; [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) return 0 ;; esac done return 1 } Clearly if you do not have 'DHCP' set in your ifconfig_ variable, dhcpi= f=20 will be false, and /etc/rc.d/dhclient will be a nop. > > DHCP is opt-in, not=20 > > opt-out. The only reason one would want to limit network_interfaces is= if=20 > > you wanted to have an ifconfig_foo0 line in /etc/rc.conf but not have f= oo0=20 > > configured automatically.=20 >=20 > I've already said several times that I want to run through my own list > of interfaces, configure the first one that comes up, and then stop. > There is no support for that currently. Others have also chimed in > with things that they do with the existing feature as well. This is an interesting problem, though I think network_interfaces is a rath= er=20 odd way of going about it. Do you boot to single user and edit rc.conf all= =20 the time? I don't see how else you are using network_interfaces to impleme= nt=20 this. I think a better solution to that problem would be to assign=20 interfaces priority (if_priority_=3D"N" perhaps). Also, note that=20 the /etc/rc.d/defaultroute script does only hold up the boot until at least= =20 one interface gets a default route. For the common wireless vs. wired case= =20 that works well, and even OS X will configure both wired and wireless=20 interfaces if both work, it simply uses the priority to determine whose=20 default route "wins". =2D-=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 20:00:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EE671065807; Tue, 2 Jun 2009 20:00:44 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D2BC8FC18; Tue, 2 Jun 2009 20:00:44 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52K0iic026586; Tue, 2 Jun 2009 20:00:44 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52K0i4E026585; Tue, 2 Jun 2009 20:00:44 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906022000.n52K0i4E026585@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 20:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193340 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 20:00:45 -0000 Author: sam Date: Tue Jun 2 20:00:43 2009 New Revision: 193340 URL: http://svn.freebsd.org/changeset/base/193340 Log: partially fix mode setting; this no longer returns an error but still needs to handle the case where the vap is up+running Noticed by: "Paul B. Mahol" Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Jun 2 20:00:32 2009 (r193339) +++ head/sys/net80211/ieee80211.c Tue Jun 2 20:00:43 2009 (r193340) @@ -1186,7 +1186,7 @@ ieee80211_media_change(struct ifnet *ifp return EINVAL; if (vap->iv_des_mode != newmode) { vap->iv_des_mode = newmode; - return ENETRESET; + /* XXX kick state machine if up+running */ } return 0; } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 20:32:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B1F41065673; Tue, 2 Jun 2009 20:32:14 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 095208FC28; Tue, 2 Jun 2009 20:32:14 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52KWDFr027354; Tue, 2 Jun 2009 20:32:13 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52KWDk0027353; Tue, 2 Jun 2009 20:32:13 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906022032.n52KWDk0027353@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 20:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193342 - head/sys/dev/if_ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 20:32:14 -0000 Author: sam Date: Tue Jun 2 20:32:13 2009 New Revision: 193342 URL: http://svn.freebsd.org/changeset/base/193342 Log: fix setting of ni_txrate Submitted by: "Paul B. Mahol" Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Tue Jun 2 20:02:58 2009 (r193341) +++ head/sys/dev/if_ndis/if_ndis.c Tue Jun 2 20:32:13 2009 (r193342) @@ -2727,31 +2727,7 @@ ndis_getstate_80211(sc) if (rval) device_printf (sc->ndis_dev, "get link speed failed: %d\n", rval); - - if (isset(ic->ic_modecaps, IEEE80211_MODE_11B)) { - ni->ni_rates = ic->ic_sup_rates[IEEE80211_MODE_11B]; - for (i = 0; i < ni->ni_rates.rs_nrates; i++) { - if ((ni->ni_rates.rs_rates[i] & - IEEE80211_RATE_VAL) == arg / 5000) - break; - } - } - - if (i == ni->ni_rates.rs_nrates && - isset(ic->ic_modecaps, IEEE80211_MODE_11G)) { - ni->ni_rates = ic->ic_sup_rates[IEEE80211_MODE_11G]; - for (i = 0; i < ni->ni_rates.rs_nrates; i++) { - if ((ni->ni_rates.rs_rates[i] & - IEEE80211_RATE_VAL) == arg / 5000) - break; - } - } - - if (i == ni->ni_rates.rs_nrates) - device_printf(sc->ndis_dev, "no matching rate for: %d\n", - arg / 5000); - else - ni->ni_txrate = i; + ni->ni_txrate = arg / 5000; if (ic->ic_caps & IEEE80211_C_PMGT) { len = sizeof(arg); From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 20:48:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 114BB106566B; Tue, 2 Jun 2009 20:48:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3B568FC13; Tue, 2 Jun 2009 20:48:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52KmCIu027924; Tue, 2 Jun 2009 20:48:12 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52KmCbC027923; Tue, 2 Jun 2009 20:48:12 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906022048.n52KmCbC027923@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 20:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193347 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 20:48:13 -0000 Author: sam Date: Tue Jun 2 20:48:12 2009 New Revision: 193347 URL: http://svn.freebsd.org/changeset/base/193347 Log: fix typo Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Tue Jun 2 20:47:10 2009 (r193346) +++ head/sys/net80211/ieee80211_ioctl.c Tue Jun 2 20:48:12 2009 (r193347) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include #define IS_UP_AUTO(_vap) \ - (IFNET_IS_UP_RUNNING(vap->iv_ifp) && \ + (IFNET_IS_UP_RUNNING((_vap)->iv_ifp) && \ (_vap)->iv_roaming == IEEE80211_ROAMING_AUTO) static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 20:51:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7B6F106567F; Tue, 2 Jun 2009 20:51:59 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5FDB8FC0A; Tue, 2 Jun 2009 20:51:59 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52KpxFq028052; Tue, 2 Jun 2009 20:51:59 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52Kpxcd028051; Tue, 2 Jun 2009 20:51:59 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906022051.n52Kpxcd028051@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 20:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193348 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 20:52:00 -0000 Author: sam Date: Tue Jun 2 20:51:59 2009 New Revision: 193348 URL: http://svn.freebsd.org/changeset/base/193348 Log: remove another vestige of the null if_softc on detach hack Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Tue Jun 2 20:48:12 2009 (r193347) +++ head/sys/net80211/ieee80211_proto.c Tue Jun 2 20:51:59 2009 (r193348) @@ -1220,22 +1220,12 @@ ieee80211_init(void *arg) { struct ieee80211vap *vap = arg; - /* - * This routine is publicly accessible through the vap's - * if_init method so guard against calls during detach. - * ieee80211_vap_detach null's the backpointer before - * tearing down state to signal any callback should be - * rejected/ignored. - */ - if (vap != NULL) { - IEEE80211_DPRINTF(vap, - IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, - "%s\n", __func__); - - IEEE80211_LOCK(vap->iv_ic); - ieee80211_start_locked(vap); - IEEE80211_UNLOCK(vap->iv_ic); - } + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, + "%s\n", __func__); + + IEEE80211_LOCK(vap->iv_ic); + ieee80211_start_locked(vap); + IEEE80211_UNLOCK(vap->iv_ic); } /* From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 21:11:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEB061065688; Tue, 2 Jun 2009 21:11:26 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD0168FC12; Tue, 2 Jun 2009 21:11:26 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52LBQZ2028505; Tue, 2 Jun 2009 21:11:26 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52LBQF7028503; Tue, 2 Jun 2009 21:11:26 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906022111.n52LBQF7028503@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 21:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193349 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 21:11:27 -0000 Author: sam Date: Tue Jun 2 21:11:26 2009 New Revision: 193349 URL: http://svn.freebsd.org/changeset/base/193349 Log: restart tdma beacons after vap destroy Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 2 20:51:59 2009 (r193348) +++ head/sys/dev/ath/if_ath.c Tue Jun 2 21:11:26 2009 (r193349) @@ -1153,8 +1153,14 @@ ath_vap_delete(struct ieee80211vap *vap) if (ath_startrecv(sc) != 0) if_printf(ifp, "%s: unable to restart recv logic\n", __func__); - if (sc->sc_beacons) - ath_beacon_config(sc, NULL); + if (sc->sc_beacons) { /* restart beacons */ +#ifdef IEEE80211_SUPPORT_TDMA + if (sc->sc_tdma) + ath_tdma_config(sc, NULL); + else +#endif + ath_beacon_config(sc, NULL); + } ath_hal_intrset(ah, sc->sc_imask); } } @@ -1652,13 +1658,13 @@ ath_reset(struct ifnet *ifp) * might change as a result. */ ath_chan_change(sc, ic->ic_curchan); - if (sc->sc_beacons) { + if (sc->sc_beacons) { /* restart beacons */ #ifdef IEEE80211_SUPPORT_TDMA if (sc->sc_tdma) ath_tdma_config(sc, NULL); else #endif - ath_beacon_config(sc, NULL); /* restart beacons */ + ath_beacon_config(sc, NULL); } ath_hal_intrset(ah, sc->sc_imask); From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 21:12:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF00210656CD; Tue, 2 Jun 2009 21:12:07 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB5038FC0C; Tue, 2 Jun 2009 21:12:07 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52LC7Gk028555; Tue, 2 Jun 2009 21:12:07 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52LC7HN028553; Tue, 2 Jun 2009 21:12:07 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906022112.n52LC7HN028553@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 21:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193350 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 21:12:09 -0000 Author: sam Date: Tue Jun 2 21:12:07 2009 New Revision: 193350 URL: http://svn.freebsd.org/changeset/base/193350 Log: fix comment Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 2 21:11:26 2009 (r193349) +++ head/sys/dev/ath/if_ath.c Tue Jun 2 21:12:07 2009 (r193350) @@ -4132,7 +4132,7 @@ ath_txq_update(struct ath_softc *sc, int /* * AIFS is zero so there's no pre-transmit wait. The * burst time defines the slot duration and is configured - * via sysctl. The QCU is setup to not do post-xmit + * through net80211. The QCU is setup to not do post-xmit * back off, lockout all lower-priority QCU's, and fire * off the DMA beacon alert timer which is setup based * on the slot configuration. From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 21:13:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D69801065694; Tue, 2 Jun 2009 21:13:57 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4C0F8FC17; Tue, 2 Jun 2009 21:13:57 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52LDvQA028629; Tue, 2 Jun 2009 21:13:57 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52LDv1L028627; Tue, 2 Jun 2009 21:13:57 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906022113.n52LDv1L028627@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 21:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193351 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 21:13:58 -0000 Author: sam Date: Tue Jun 2 21:13:57 2009 New Revision: 193351 URL: http://svn.freebsd.org/changeset/base/193351 Log: count frag tx failures as an ifnet error Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 2 21:12:07 2009 (r193350) +++ head/sys/dev/ath/if_ath.c Tue Jun 2 21:13:57 2009 (r193351) @@ -1820,6 +1820,7 @@ ath_start(struct ifnet *ifp) DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of txfrag buffers\n", __func__); sc->sc_stats.ast_tx_nofrag++; + ifp->if_oerrors++; ath_freetx(m); goto bad; } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 21:17:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D98E71065675; Tue, 2 Jun 2009 21:17:56 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD8678FC0A; Tue, 2 Jun 2009 21:17:56 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52LHuv6028743; Tue, 2 Jun 2009 21:17:56 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52LHuq1028741; Tue, 2 Jun 2009 21:17:56 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906022117.n52LHuq1028741@svn.freebsd.org> From: Sam Leffler Date: Tue, 2 Jun 2009 21:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193352 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 21:17:57 -0000 Author: sam Date: Tue Jun 2 21:17:56 2009 New Revision: 193352 URL: http://svn.freebsd.org/changeset/base/193352 Log: improve raw xmit failure handling Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 2 21:13:57 2009 (r193351) +++ head/sys/dev/ath/if_ath.c Tue Jun 2 21:17:56 2009 (r193352) @@ -1710,7 +1710,6 @@ _ath_getbuf_locked(struct ath_softc *sc) DPRINTF(sc, ATH_DEBUG_XMIT, "%s: %s\n", __func__, STAILQ_FIRST(&sc->sc_txbuf) == NULL ? "out of xmit buffers" : "xmit buffer busy"); - sc->sc_stats.ast_tx_nobuf++; } return bf; } @@ -6832,55 +6831,60 @@ ath_raw_xmit(struct ieee80211_node *ni, struct ifnet *ifp = ic->ic_ifp; struct ath_softc *sc = ifp->if_softc; struct ath_buf *bf; + int error; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) { DPRINTF(sc, ATH_DEBUG_XMIT, "%s: discard frame, %s", __func__, (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ? "!running" : "invalid"); - sc->sc_stats.ast_tx_raw_fail++; - ieee80211_free_node(ni); m_freem(m); - return ENETDOWN; + error = ENETDOWN; + goto bad; } /* * Grab a TX buffer and associated resources. */ bf = ath_getbuf(sc); if (bf == NULL) { - /* NB: ath_getbuf handles stat+msg */ - ieee80211_free_node(ni); + sc->sc_stats.ast_tx_nobuf++; m_freem(m); - return ENOBUFS; + error = ENOBUFS; + goto bad; } - ifp->if_opackets++; - sc->sc_stats.ast_tx_raw++; - if (params == NULL) { /* * Legacy path; interpret frame contents to decide * precisely how to send the frame. */ - if (ath_tx_start(sc, ni, bf, m)) - goto bad; + if (ath_tx_start(sc, ni, bf, m)) { + error = EIO; /* XXX */ + goto bad2; + } } else { /* * Caller supplied explicit parameters to use in * sending the frame. */ - if (ath_tx_raw_start(sc, ni, bf, m, params)) - goto bad; + if (ath_tx_raw_start(sc, ni, bf, m, params)) { + error = EIO; /* XXX */ + goto bad2; + } } sc->sc_wd_timer = 5; + ifp->if_opackets++; + sc->sc_stats.ast_tx_raw++; return 0; -bad: - ifp->if_oerrors++; +bad2: ATH_TXBUF_LOCK(sc); STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); +bad: + ifp->if_oerrors++; + sc->sc_stats.ast_tx_raw_fail++; ieee80211_free_node(ni); - return EIO; /* XXX */ + return error; } /* From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 22:15:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3238610656A3; Tue, 2 Jun 2009 22:15:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EC7F8FC17; Tue, 2 Jun 2009 22:15:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52MFmRV029916; Tue, 2 Jun 2009 22:15:48 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52MFl5l029910; Tue, 2 Jun 2009 22:15:47 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906022215.n52MFl5l029910@svn.freebsd.org> From: Rick Macklem Date: Tue, 2 Jun 2009 22:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193354 - in head/etc: defaults rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 22:15:49 -0000 Author: rmacklem Date: Tue Jun 2 22:15:47 2009 New Revision: 193354 URL: http://svn.freebsd.org/changeset/base/193354 Log: Add support for the experimental nfs subsystem to the scripts in /etc/rc.d. They use the following new rc variables: nfsv4_server_enable - set to "YES" to run the experimental server nfsuserd_enable - set to "YES" to run nfsuserd for NFSv4 client and server nfsuserd_flags - command line flags for nfsuserd nfscbd_enable - set to "YES" to run the experimental nfs client's NFSv4 callback daemon nfscbd_flags - command line flags for nfscbd Reviewed by: dougb Approved by: kib (mentor) Added: head/etc/rc.d/nfscbd (contents, props changed) head/etc/rc.d/nfsuserd (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/etc/rc.d/mountd head/etc/rc.d/nfsd Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Jun 2 21:40:57 2009 (r193353) +++ head/etc/defaults/rc.conf Tue Jun 2 22:15:47 2009 (r193354) @@ -315,6 +315,11 @@ rpcbind_flags="" # Flags to rpcbind (if rpc_ypupdated_enable="NO" # Run if NIS master and SecureRPC (or NO). keyserv_enable="NO" # Run the SecureRPC keyserver (or NO). keyserv_flags="" # Flags to keyserv (if enabled). +nfsv4_server_enable="NO" # Enable support for NFSv4 +nfscbd_enable="NO" # NFSv4 client side callback daemon +nfscbd_flags="" # Flags for nfscbd +nfsuserd_enable="NO" # NFSv4 user/group name mapping daemon +nfsuserd_flags="" # Flags for nfsuserd ### Network Time Services options: ### timed_enable="NO" # Run the time daemon (or NO). Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Tue Jun 2 21:40:57 2009 (r193353) +++ head/etc/rc.d/Makefile Tue Jun 2 22:15:47 2009 (r193354) @@ -23,8 +23,8 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI mixer motd mountcritlocal mountcritremote mountlate \ mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ named natd netif netoptions \ - network_ipv6 newsyslog nfsclient nfsd \ - nfsserver nisdomain nsswitch ntpd ntpdate \ + network_ipv6 newsyslog nfsclient nfscbd nfsd \ + nfsserver nfsuserd nisdomain nsswitch ntpd ntpdate \ othermta \ pf pflog pfsync \ powerd power_profile ppp pppoed pwcheck \ Modified: head/etc/rc.d/mountd ============================================================================== --- head/etc/rc.d/mountd Tue Jun 2 21:40:57 2009 (r193353) +++ head/etc/rc.d/mountd Tue Jun 2 22:15:47 2009 (r193354) @@ -37,6 +37,13 @@ mountd_precmd() fi fi + # If nfsv4_server_enable is yes, force use of the experimental + # server + # + if checkyesno nfsv4_server_enable; then + rc_flags="-e ${rc_flags}" + fi + if checkyesno zfs_enable; then rc_flags="${rc_flags} /etc/exports /etc/zfs/exports" fi Added: head/etc/rc.d/nfscbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/nfscbd Tue Jun 2 22:15:47 2009 (r193354) @@ -0,0 +1,19 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: nfscbd +# REQUIRE: NETWORKING nfsuserd +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +name="nfscbd" +rcvar=`set_rcvar` +command="/usr/sbin/${name}" +sig_stop="USR1" + +load_rc_config $name + +run_rc_command "$1" Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Tue Jun 2 21:40:57 2009 (r193353) +++ head/etc/rc.d/nfsd Tue Jun 2 22:15:47 2009 (r193354) @@ -4,7 +4,7 @@ # # PROVIDE: nfsd -# REQUIRE: mountd hostname gssd +# REQUIRE: mountd hostname gssd nfsuserd # KEYWORD: nojail shutdown . /etc/rc.subr @@ -14,14 +14,33 @@ rcvar=`set_rcvar nfs_server` command="/usr/sbin/${name}" load_rc_config $name -command_args="${nfs_server_flags}" start_precmd="nfsd_precmd" sig_stop="USR1" nfsd_precmd() { - if ! sysctl vfs.nfsrv >/dev/null 2>&1; then - force_depend nfsserver || return 1 + if checkyesno nfsv4_server_enable; then + # If nfsv4_server_enable is yes, force use + # of the experimental server + # + rc_flags="-e ${nfs_server_flags}" + + if ! checkyesno nfsuserd_enable && \ + ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1 + then + force_depend nfsuserd || return 1 + fi + else + rc_flags="${nfs_server_flags}" + + if ! sysctl vfs.nfsrv >/dev/null 2>&1; then + force_depend nfsserver || return 1 + fi + + if checkyesno nfs_reserved_port_only; then + echo 'NFS on reserved port only=YES' + sysctl vfs.nfsrv.nfs_privport=1 > /dev/null + fi fi if ! checkyesno rpcbind_enable && \ @@ -35,11 +54,6 @@ nfsd_precmd() then force_depend mountd || return 1 fi - - if checkyesno nfs_reserved_port_only; then - echo 'NFS on reserved port only=YES' - sysctl vfs.nfsrv.nfs_privport=1 > /dev/null - fi return 0 } Added: head/etc/rc.d/nfsuserd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/nfsuserd Tue Jun 2 22:15:47 2009 (r193354) @@ -0,0 +1,19 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: nfsuserd +# REQUIRE: NETWORKING +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +name="nfsuserd" +rcvar=`set_rcvar` +command="/usr/sbin/${name}" +sig_stop="USR1" + +load_rc_config $name + +run_rc_command "$1" From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 22:22:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15B0E1065696; Tue, 2 Jun 2009 22:22:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0347D8FC2B; Tue, 2 Jun 2009 22:22:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n52MM989030080; Tue, 2 Jun 2009 22:22:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n52MM96x030079; Tue, 2 Jun 2009 22:22:09 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906022222.n52MM96x030079@svn.freebsd.org> From: Robert Watson Date: Tue, 2 Jun 2009 22:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193355 - head/sys/security/mac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 22:22:11 -0000 Author: rwatson Date: Tue Jun 2 22:22:09 2009 New Revision: 193355 URL: http://svn.freebsd.org/changeset/base/193355 Log: Mark MAC Framework sx and rm locks as NOWITNESS to suppress warnings that might arise from WITNESS not understanding its locking protocol, which should be deadlock-free. Currently these warnings generally don't occur, but as object locking is pushed into policies for some object types, they would otherwise occur more often. Obtained from: TrustedBSD Project Modified: head/sys/security/mac/mac_framework.c Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Tue Jun 2 22:15:47 2009 (r193354) +++ head/sys/security/mac/mac_framework.c Tue Jun 2 22:22:09 2009 (r193355) @@ -290,8 +290,8 @@ mac_init(void) mac_labelzone_init(); #ifndef MAC_STATIC - rm_init(&mac_policy_rm, "mac_policy_rm"); - sx_init(&mac_policy_sx, "mac_policy_sx"); + rm_init_flags(&mac_policy_rm, "mac_policy_rm", RM_NOWITNESS); + sx_init_flags(&mac_policy_sx, "mac_policy_sx", SX_NOWITNESS); #endif } From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 04:10:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0092D1065676; Wed, 3 Jun 2009 04:10:23 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E37568FC22; Wed, 3 Jun 2009 04:10:22 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n534AMhL037841; Wed, 3 Jun 2009 04:10:22 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n534AMBa037840; Wed, 3 Jun 2009 04:10:22 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200906030410.n534AMBa037840@svn.freebsd.org> From: Weongyo Jeong Date: Wed, 3 Jun 2009 04:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193366 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 04:10:23 -0000 Author: weongyo Date: Wed Jun 3 04:10:22 2009 New Revision: 193366 URL: http://svn.freebsd.org/changeset/base/193366 Log: calls callout_drain(9) to un-schedule a scan timer to prevent a page fault in softclock. Submitted by: sam Reviewed by: jhb, sam (original version), thompsa Modified: head/sys/net80211/ieee80211_scan.c Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Wed Jun 3 03:42:00 2009 (r193365) +++ head/sys/net80211/ieee80211_scan.c Wed Jun 3 04:10:22 2009 (r193366) @@ -131,6 +131,7 @@ ieee80211_scan_detach(struct ieee80211co scan_signal(ss); IEEE80211_UNLOCK(ic); ieee80211_draintask(ic, &SCAN_PRIVATE(ss)->ss_scan_task); + callout_drain(&SCAN_PRIVATE(ss)->ss_scan_timer); KASSERT((ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scan still running")); if (ss->ss_ops != NULL) { From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 08:16:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8530B106566B; Wed, 3 Jun 2009 08:16:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72FCD8FC12; Wed, 3 Jun 2009 08:16:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n538GZ5K043060; Wed, 3 Jun 2009 08:16:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n538GZ6T043054; Wed, 3 Jun 2009 08:16:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906030816.n538GZ6T043054@svn.freebsd.org> From: Ed Schouten Date: Wed, 3 Jun 2009 08:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193368 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 08:16:36 -0000 Author: ed Date: Wed Jun 3 08:16:34 2009 New Revision: 193368 URL: http://svn.freebsd.org/changeset/base/193368 Log: Use ISO C99 style inline semantics in msun. Because we use ISO C99 nowadays, we can just get rid of enforcing GNU89-style inlining. Modified: head/lib/msun/src/e_rem_pio2.c head/lib/msun/src/e_rem_pio2f.c head/lib/msun/src/k_cosf.c head/lib/msun/src/k_sinf.c head/lib/msun/src/k_tanf.c head/lib/msun/src/math_private.h Modified: head/lib/msun/src/e_rem_pio2.c ============================================================================== --- head/lib/msun/src/e_rem_pio2.c Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/e_rem_pio2.c Wed Jun 3 08:16:34 2009 (r193368) @@ -48,10 +48,10 @@ pio2_2t = 2.02226624879595063154e-21, / pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ -#ifdef INLINE_REM_PIO2 -extern __gnu89_inline +#ifndef INLINE_REM_PIO2 +extern #endif -int +__inline int __ieee754_rem_pio2(double x, double *y) { double z,w,t,r,fn; Modified: head/lib/msun/src/e_rem_pio2f.c ============================================================================== --- head/lib/msun/src/e_rem_pio2f.c Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/e_rem_pio2f.c Wed Jun 3 08:16:34 2009 (r193368) @@ -40,10 +40,10 @@ invpio2 = 6.36619772367581382433e-01, / pio2_1 = 1.57079631090164184570e+00, /* 0x3FF921FB, 0x50000000 */ pio2_1t = 1.58932547735281966916e-08; /* 0x3E5110b4, 0x611A6263 */ -#ifdef INLINE_REM_PIO2F -extern __gnu89_inline +#ifndef INLINE_REM_PIO2F +extern #endif -int +__inline int __ieee754_rem_pio2f(float x, double *y) { double w,r,fn; Modified: head/lib/msun/src/k_cosf.c ============================================================================== --- head/lib/msun/src/k_cosf.c Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/k_cosf.c Wed Jun 3 08:16:34 2009 (r193368) @@ -30,10 +30,10 @@ C1 = 0x155553e1053a42.0p-57, /* 0.041 C2 = -0x16c087e80f1e27.0p-62, /* -0.00138867637746099294692 */ C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */ -#ifdef INLINE_KERNEL_COSDF -extern __gnu89_inline +#ifndef INLINE_KERNEL_COSDF +extern #endif -float +__inline float __kernel_cosdf(double x) { double r, w, z; Modified: head/lib/msun/src/k_sinf.c ============================================================================== --- head/lib/msun/src/k_sinf.c Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/k_sinf.c Wed Jun 3 08:16:34 2009 (r193368) @@ -29,10 +29,10 @@ S2 = 0x111110896efbb2.0p-59, /* 0.0083 S3 = -0x1a00f9e2cae774.0p-65, /* -0.000198393348360966317347 */ S4 = 0x16cd878c3b46a7.0p-71; /* 0.0000027183114939898219064 */ -#ifdef INLINE_KERNEL_SINDF -extern __gnu89_inline +#ifndef INLINE_KERNEL_SINDF +extern #endif -float +__inline float __kernel_sindf(double x) { double r, s, w, z; Modified: head/lib/msun/src/k_tanf.c ============================================================================== --- head/lib/msun/src/k_tanf.c Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/k_tanf.c Wed Jun 3 08:16:34 2009 (r193368) @@ -32,10 +32,10 @@ T[] = { 0x1362b9bf971bcd.0p-59, /* 0.00946564784943673166728 */ }; -#ifdef INLINE_KERNEL_TANDF -extern __gnu89_inline +#ifndef INLINE_KERNEL_TANDF +extern #endif -float +__inline float __kernel_tandf(double x, int iy) { double z,r,w,s,t,u; Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/math_private.h Wed Jun 3 08:16:34 2009 (r193368) @@ -345,15 +345,30 @@ irint(double x) int __kernel_rem_pio2(double*,double*,int,int,int); /* double precision kernel functions */ +#ifdef INLINE_REM_PIO2 +__inline +#endif int __ieee754_rem_pio2(double,double*); double __kernel_sin(double,double,int); double __kernel_cos(double,double); double __kernel_tan(double,double,int); /* float precision kernel functions */ +#ifdef INLINE_REM_PIO2F +__inline +#endif int __ieee754_rem_pio2f(float,double*); +#ifdef INLINE_KERNEL_SINDF +__inline +#endif float __kernel_sindf(double); +#ifdef INLINE_KERNEL_COSDF +__inline +#endif float __kernel_cosdf(double); +#ifdef INLINE_KERNEL_TANDF +__inline +#endif float __kernel_tandf(double,int); /* long double precision kernel functions */ From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 08:36:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E35AD1065673; Wed, 3 Jun 2009 08:36:26 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206192061.chello.pl [87.206.192.61]) by mx1.freebsd.org (Postfix) with ESMTP id 2C98D8FC1D; Wed, 3 Jun 2009 08:36:25 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 2C54745CA6; Wed, 3 Jun 2009 10:36:23 +0200 (CEST) Received: from localhost (pjd.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 39735456AB; Wed, 3 Jun 2009 10:36:18 +0200 (CEST) Date: Wed, 3 Jun 2009 10:36:22 +0200 From: Pawel Jakub Dawidek To: Robert Watson Message-ID: <20090603083622.GA3824@garage.freebsd.pl> References: <200906021826.n52IQHrh024410@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <200906021826.n52IQHrh024410@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193332 - in head/sys: kern netatalk netinet rpc security/mac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 08:36:27 -0000 --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 02, 2009 at 06:26:17PM +0000, Robert Watson wrote: > Author: rwatson > Date: Tue Jun 2 18:26:17 2009 > New Revision: 193332 > URL: http://svn.freebsd.org/changeset/base/193332 >=20 > Log: > Add internal 'mac_policy_count' counter to the MAC Framework, which is a > count of the number of registered policies. > =20 > Rather than unconditionally locking sockets before passing them into MA= C, > lock them in the MAC entry points only if mac_policy_count is non-zero. > =20 > This avoids locking overhead for a number of socket system calls when no > policies are registered, eliminating measurable overhead for the MAC > Framework for the socket subsystem when there are no active policies. > =20 > Possibly socket locks should be acquired by policies if they are requir= ed > for socket labels, which would further avoid locking overhead when there > are policies but they don't require labeling of sockets, or possibly > don't even implement socket controls. This may introduce further overhead if there are few policies that implement socket controls. Then you will have cost of npolicies * lock/unlo= ck. Maybe we could check if there is at least one policy implementing particular socket control and if yes lock the socket in the framework only once? This won't be ideal (there might be socket control that doesn't need to lock the socket), but is good enough for my taste:) --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --2oS5YaxWCcQjTEyO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKJjYGForvXbEpPzQRAt2GAKChKnv6ZaUq1YSsRutbx0zLReVnawCfePZM KcfsAcGfd6Qa+FhQeYDQpzY= =vTmO -----END PGP SIGNATURE----- --2oS5YaxWCcQjTEyO-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 08:49:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A9E81065672; Wed, 3 Jun 2009 08:49:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC61C8FC08; Wed, 3 Jun 2009 08:49:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n538niLD043821; Wed, 3 Jun 2009 08:49:44 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n538ni6v043820; Wed, 3 Jun 2009 08:49:44 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906030849.n538ni6v043820@svn.freebsd.org> From: Robert Watson Date: Wed, 3 Jun 2009 08:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193371 - head/sys/security/mac_biba X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 08:49:45 -0000 Author: rwatson Date: Wed Jun 3 08:49:44 2009 New Revision: 193371 URL: http://svn.freebsd.org/changeset/base/193371 Log: By default, label all network interfaces as biba/equal on attach. This makes it easier for first-time users to configure and work with biba as remote acess is still allowed. Effectively, this means that, by default, only local security properties, not distributed ones, are enforced. Obtained from: TrustedBSD Project Modified: head/sys/security/mac_biba/mac_biba.c Modified: head/sys/security/mac_biba/mac_biba.c ============================================================================== --- head/sys/security/mac_biba/mac_biba.c Wed Jun 3 08:21:11 2009 (r193370) +++ head/sys/security/mac_biba/mac_biba.c Wed Jun 3 08:49:44 2009 (r193371) @@ -125,7 +125,7 @@ SYSCTL_INT(_security_mac_biba, OID_AUTO, 0, "Label pty devices as biba/equal on create"); TUNABLE_INT("security.mac.biba.ptys_equal", &ptys_equal); -static int interfaces_equal; +static int interfaces_equal = 1; SYSCTL_INT(_security_mac_biba, OID_AUTO, interfaces_equal, CTLFLAG_RW, &interfaces_equal, 0, "Label network interfaces as biba/equal on create"); TUNABLE_INT("security.mac.biba.interfaces_equal", &interfaces_equal); From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 09:23:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6026106566C; Wed, 3 Jun 2009 09:23:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93FBC8FC29; Wed, 3 Jun 2009 09:23:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n539NVDh044574; Wed, 3 Jun 2009 09:23:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n539NVnW044573; Wed, 3 Jun 2009 09:23:31 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200906030923.n539NVnW044573@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jun 2009 09:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193372 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 09:23:32 -0000 Author: pjd Date: Wed Jun 3 09:23:31 2009 New Revision: 193372 URL: http://svn.freebsd.org/changeset/base/193372 Log: Correct comment. Modified: head/sbin/fsck_ffs/gjournal.c Modified: head/sbin/fsck_ffs/gjournal.c ============================================================================== --- head/sbin/fsck_ffs/gjournal.c Wed Jun 3 08:49:44 2009 (r193371) +++ head/sbin/fsck_ffs/gjournal.c Wed Jun 3 09:23:31 2009 (r193372) @@ -672,7 +672,7 @@ gjournal_check(const char *filesys) devnam = filesys; getdisk(); - /* Are there any unreferenced inodes in this cylinder group? */ + /* Are there any unreferenced inodes in this file system? */ if (fs->fs_unrefs == 0) { //printf("No unreferenced inodes.\n"); closedisk(); From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 09:24:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27B4B1065673; Wed, 3 Jun 2009 09:24:59 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 154FE8FC22; Wed, 3 Jun 2009 09:24:59 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n539OwVV044637; Wed, 3 Jun 2009 09:24:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n539Owgw044636; Wed, 3 Jun 2009 09:24:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200906030924.n539Owgw044636@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jun 2009 09:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193373 - head/tools/regression/fstest X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 09:24:59 -0000 Author: pjd Date: Wed Jun 3 09:24:58 2009 New Revision: 193373 URL: http://svn.freebsd.org/changeset/base/193373 Log: lchflags(2) takes int, not u_long like chflags(2) and fchflags(2). Strange, isn't it? Pointed out by: bde Modified: head/tools/regression/fstest/fstest.c Modified: head/tools/regression/fstest/fstest.c ============================================================================== --- head/tools/regression/fstest/fstest.c Wed Jun 3 09:23:31 2009 (r193372) +++ head/tools/regression/fstest/fstest.c Wed Jun 3 09:24:58 2009 (r193373) @@ -499,7 +499,7 @@ call_syscall(struct syscall_desc *scall, #endif #ifdef HAS_LCHFLAGS case ACTION_LCHFLAGS: - rval = lchflags(STR(0), (unsigned long)str2flags(chflags_flags, STR(1))); + rval = lchflags(STR(0), (int)str2flags(chflags_flags, STR(1))); break; #endif case ACTION_TRUNCATE: From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 09:28:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92E931065672; Wed, 3 Jun 2009 09:28:59 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 622308FC14; Wed, 3 Jun 2009 09:28:59 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n539SxrP044750; Wed, 3 Jun 2009 09:28:59 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n539Sw6J044748; Wed, 3 Jun 2009 09:28:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200906030928.n539Sw6J044748@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jun 2009 09:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193374 - in head/share/examples/kld: dyn_sysctl syscall/module X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 09:29:00 -0000 Author: pjd Date: Wed Jun 3 09:28:58 2009 New Revision: 193374 URL: http://svn.freebsd.org/changeset/base/193374 Log: Where if not in examples we should follow style(9)? Modified: head/share/examples/kld/dyn_sysctl/dyn_sysctl.c head/share/examples/kld/syscall/module/syscall.c Modified: head/share/examples/kld/dyn_sysctl/dyn_sysctl.c ============================================================================== --- head/share/examples/kld/dyn_sysctl/dyn_sysctl.c Wed Jun 3 09:24:58 2009 (r193373) +++ head/share/examples/kld/dyn_sysctl/dyn_sysctl.c Wed Jun 3 09:28:58 2009 (r193374) @@ -42,7 +42,7 @@ static struct sysctl_oid *a_root, *a_roo static struct sysctl_ctx_list clist, clist1, clist2; static int -sysctl_dyn_sysctl_test (SYSCTL_HANDLER_ARGS) +sysctl_dyn_sysctl_test(SYSCTL_HANDLER_ARGS) { char *buf = "let's produce some text..."; @@ -53,7 +53,7 @@ sysctl_dyn_sysctl_test (SYSCTL_HANDLER_A * The function called at load/unload. */ static int -load (module_t mod, int cmd, void *arg) +load(module_t mod, int cmd, void *arg) { int error; @@ -78,37 +78,37 @@ load (module_t mod, int cmd, void *arg) SYSCTL_STATIC_CHILDREN(/* top of sysctl tree */), OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0, "dyn_sysctl root node"); - if(a_root == NULL) { + if (a_root == NULL) { printf("SYSCTL_ADD_NODE failed!\n"); return (EINVAL); } SYSCTL_ADD_LONG(&clist, SYSCTL_CHILDREN(a_root), - OID_AUTO, "long_a", CTLFLAG_RW, &a, "just to try"); + OID_AUTO, "long_a", CTLFLAG_RW, &a, "just to try"); SYSCTL_ADD_INT(&clist, SYSCTL_CHILDREN(a_root), - OID_AUTO, "int_b", CTLFLAG_RW, &b, 0, "just to try 1"); - a_root1=SYSCTL_ADD_NODE(&clist, SYSCTL_CHILDREN(a_root), - OID_AUTO, "nextlevel", CTLFLAG_RD, 0, "one level down"); + OID_AUTO, "int_b", CTLFLAG_RW, &b, 0, "just to try 1"); + a_root1 = SYSCTL_ADD_NODE(&clist, SYSCTL_CHILDREN(a_root), + OID_AUTO, "nextlevel", CTLFLAG_RD, 0, "one level down"); SYSCTL_ADD_STRING(&clist, SYSCTL_CHILDREN(a_root1), - OID_AUTO, "string_c", CTLFLAG_RD, c, 0, "just to try 2"); + OID_AUTO, "string_c", CTLFLAG_RD, c, 0, "just to try 2"); printf("1. (%p) / dyn_sysctl\n", &clist); /* Add a subtree under already existing category */ a_root1 = SYSCTL_ADD_NODE(&clist, SYSCTL_STATIC_CHILDREN(_kern), - OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0, "dyn_sysctl root node"); - if(a_root1 == NULL) { + OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0, "dyn_sysctl root node"); + if (a_root1 == NULL) { printf("SYSCTL_ADD_NODE failed!\n"); return (EINVAL); } SYSCTL_ADD_PROC(&clist, SYSCTL_CHILDREN(a_root1), - OID_AUTO, "procedure", CTLFLAG_RD, 0, 0, - sysctl_dyn_sysctl_test, "A", "I can be here, too"); + OID_AUTO, "procedure", CTLFLAG_RD, 0, 0, + sysctl_dyn_sysctl_test, "A", "I can be here, too"); printf(" (%p) /kern dyn_sysctl\n", &clist); /* Overlap second tree with the first. */ b_root = SYSCTL_ADD_NODE(&clist1, SYSCTL_CHILDREN(a_root), - OID_AUTO, "nextlevel", CTLFLAG_RD, 0, "one level down"); + OID_AUTO, "nextlevel", CTLFLAG_RD, 0, "one level down"); SYSCTL_ADD_STRING(&clist1, SYSCTL_CHILDREN(b_root), - OID_AUTO, "string_c1", CTLFLAG_RD, c, 0, "just to try 2"); + OID_AUTO, "string_c1", CTLFLAG_RD, c, 0, "just to try 2"); printf("2. (%p) / dyn_sysctl (overlapping #1)\n", &clist1); /* @@ -117,19 +117,19 @@ load (module_t mod, int cmd, void *arg) * WARNING: this is an example of WRONG use of dynamic sysctls. */ b_root=SYSCTL_ADD_NODE(&clist2, SYSCTL_CHILDREN(a_root1), - OID_AUTO, "bad", CTLFLAG_RW, 0, "dependent node"); + OID_AUTO, "bad", CTLFLAG_RW, 0, "dependent node"); SYSCTL_ADD_STRING(&clist2, SYSCTL_CHILDREN(b_root), - OID_AUTO, "string_c", CTLFLAG_RD, c, 0, "shouldn't panic"); + OID_AUTO, "string_c", CTLFLAG_RD, c, 0, "shouldn't panic"); printf("3. (%p) /kern/dyn_sysctl bad (WRONG!)\n", &clist2); break; case MOD_UNLOAD : printf("1. Try to free ctx1 (%p): ", &clist); - if(sysctl_ctx_free(&clist)) + if (sysctl_ctx_free(&clist) != 0) printf("failed: expected. Need to remove ctx3 first.\n"); else printf("HELP! sysctl_ctx_free(%p) succeeded. EXPECT PANIC!!!\n", &clist); printf("2. Try to free ctx3 (%p): ", &clist2); - if(sysctl_ctx_free(&clist2)) { + if (sysctl_ctx_free(&clist2) != 0) { printf("sysctl_ctx_free(%p) failed!\n", &clist2); /* Remove subtree forcefully... */ sysctl_remove_oid(b_root, 1, 1); @@ -137,7 +137,7 @@ load (module_t mod, int cmd, void *arg) } else printf("Ok\n"); printf("3. Try to free ctx1 (%p) again: ", &clist); - if(sysctl_ctx_free(&clist)) { + if (sysctl_ctx_free(&clist) != 0) { printf("sysctl_ctx_free(%p) failed!\n", &clist); /* Remove subtree forcefully... */ sysctl_remove_oid(a_root1, 1, 1); @@ -145,7 +145,7 @@ load (module_t mod, int cmd, void *arg) } else printf("Ok\n"); printf("4. Try to free ctx2 (%p): ", &clist1); - if(sysctl_ctx_free(&clist1)) { + if (sysctl_ctx_free(&clist1) != 0) { printf("sysctl_ctx_free(%p) failed!\n", &clist1); /* Remove subtree forcefully... */ sysctl_remove_oid(a_root, 1, 1); @@ -156,10 +156,10 @@ load (module_t mod, int cmd, void *arg) error = EOPNOTSUPP; break; } - return error; + return (error); } -static moduledata_t mod_data= { +static moduledata_t mod_data = { "dyn_sysctl", load, 0 Modified: head/share/examples/kld/syscall/module/syscall.c ============================================================================== --- head/share/examples/kld/syscall/module/syscall.c Wed Jun 3 09:24:58 2009 (r193373) +++ head/share/examples/kld/syscall/module/syscall.c Wed Jun 3 09:28:58 2009 (r193374) @@ -26,7 +26,6 @@ * $FreeBSD$ */ -#include #include #include #include @@ -38,18 +37,17 @@ /* * The function for implementing the syscall. */ - static int -hello (struct thread *td, void *arg) +hello(struct thread *td, void *arg) { - printf ("hello kernel\n"); - return 0; + + printf("hello kernel\n"); + return (0); } /* * The `sysent' for the new syscall */ - static struct sysent hello_sysent = { 0, /* sy_narg */ hello /* sy_call */ @@ -58,30 +56,28 @@ static struct sysent hello_sysent = { /* * The offset in sysent where the syscall is allocated. */ - static int offset = NO_SYSCALL; /* * The function called at load/unload. */ - static int -load (struct module *module, int cmd, void *arg) +load(struct module *module, int cmd, void *arg) { int error = 0; switch (cmd) { case MOD_LOAD : - printf ("syscall loaded at %d\n", offset); + printf("syscall loaded at %d\n", offset); break; case MOD_UNLOAD : - printf ("syscall unloaded from %d\n", offset); + printf("syscall unloaded from %d\n", offset); break; default : error = EOPNOTSUPP; break; } - return error; + return (error); } SYSCALL_MODULE(syscall, &offset, &hello_sysent, load, NULL); From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 09:31:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95A591065674; Wed, 3 Jun 2009 09:31:11 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 4F0FD8FC2A; Wed, 3 Jun 2009 09:31:11 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 6B4C46D41D; Wed, 3 Jun 2009 11:31:10 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 47A39844CC; Wed, 3 Jun 2009 11:31:10 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin References: <200906010537.n515bDou065357@svn.freebsd.org> <4A25491B.4030406@incunabulum.net> <20090602165021.GB15552@lor.one-eyed-alien.net> <200906021511.03955.jhb@freebsd.org> Date: Wed, 03 Jun 2009 11:31:10 +0200 In-Reply-To: <200906021511.03955.jhb@freebsd.org> (John Baldwin's message of "Tue, 2 Jun 2009 15:11:03 -0400") Message-ID: <86iqjdek9t.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Brooks Davis , svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org, Bruce Simpson , svn-src-head@freebsd.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 09:31:12 -0000 John Baldwin writes: > [...] Given that, there really isn't a good reason to customize > network_interfaces anymore. Listing e.g. bge0 in network_interfaces will (indirectly) cause if_bge to be loaded if it wasn't already. If network_interfaces is left blank, only interfaces that already have a driver attached to them will be configured. That being said, setting network_interfaces manually introduces the risk of setting it incorrectly (e.g. forgetting lo0). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 09:44:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09EE21065673; Wed, 3 Jun 2009 09:44:23 +0000 (UTC) (envelope-from snb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAFDA8FC12; Wed, 3 Jun 2009 09:44:22 +0000 (UTC) (envelope-from snb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n539iM37045166; Wed, 3 Jun 2009 09:44:22 GMT (envelope-from snb@svn.freebsd.org) Received: (from snb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n539iM2K045164; Wed, 3 Jun 2009 09:44:22 GMT (envelope-from snb@svn.freebsd.org) Message-Id: <200906030944.n539iM2K045164@svn.freebsd.org> From: Sean Nicholas Barkas Date: Wed, 3 Jun 2009 09:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193375 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 09:44:23 -0000 Author: snb Date: Wed Jun 3 09:44:22 2009 New Revision: 193375 URL: http://svn.freebsd.org/changeset/base/193375 Log: Add vm_lowmem event handler for dirhash. This will cause dirhashes to be deleted when the system is low on memory. This ought to allow an increase to vfs.ufs.dirhash_maxmem on machines that have lots of memory, without degrading performance by having too much memory reserved for dirhash when other things need it. The default value for dirhash_maxmem is being kept at 2MB for now, though. This work was mostly done during the 2008 Google Summer of Code. Approved by: dwmalone (mentor), re MFC after: 3 months Modified: head/sys/ufs/ufs/dirhash.h head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/dirhash.h ============================================================================== --- head/sys/ufs/ufs/dirhash.h Wed Jun 3 09:28:58 2009 (r193374) +++ head/sys/ufs/ufs/dirhash.h Wed Jun 3 09:44:22 2009 (r193375) @@ -105,6 +105,8 @@ struct dirhash { int dh_onlist; /* true if on the ufsdirhash_list chain */ + time_t dh_lastused; /* time the dirhash was last read or written*/ + /* Protected by ufsdirhash_mtx. */ TAILQ_ENTRY(dirhash) dh_list; /* chain of all dirhashes */ }; Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Wed Jun 3 09:28:58 2009 (r193374) +++ head/sys/ufs/ufs/ufs_dirhash.c Wed Jun 3 09:44:22 2009 (r193375) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -81,6 +83,13 @@ SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_m static int ufs_dirhashcheck = 0; SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_docheck, CTLFLAG_RW, &ufs_dirhashcheck, 0, "enable extra sanity tests"); +static int ufs_dirhashlowmemcount = 0; +SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_lowmemcount, CTLFLAG_RD, + &ufs_dirhashlowmemcount, 0, "number of times low memory hook called"); +static int ufs_dirhashreclaimage = 5; +SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_reclaimage, CTLFLAG_RW, + &ufs_dirhashreclaimage, 0, + "max time in seconds of hash inactivity before deletion in low VM events"); static int ufsdirhash_hash(struct dirhash *dh, char *name, int namelen); @@ -90,6 +99,7 @@ static int ufsdirhash_findslot(struct di doff_t offset); static doff_t ufsdirhash_getprev(struct direct *dp, doff_t offset); static int ufsdirhash_recycle(int wanted); +static void ufsdirhash_lowmem(void); static void ufsdirhash_free_locked(struct inode *ip); static uma_zone_t ufsdirhash_zone; @@ -393,6 +403,7 @@ ufsdirhash_build(struct inode *ip) dh->dh_seqopt = 0; dh->dh_seqoff = 0; dh->dh_score = DH_SCOREINIT; + dh->dh_lastused = time_second; /* * Use non-blocking mallocs so that we will revert to a linear @@ -569,6 +580,9 @@ ufsdirhash_lookup(struct inode *ip, char /* Update the score. */ if (dh->dh_score < DH_SCOREMAX) dh->dh_score++; + + /* Update last used time. */ + dh->dh_lastused = time_second; DIRHASHLIST_UNLOCK(); vp = ip->i_vnode; @@ -811,6 +825,9 @@ ufsdirhash_add(struct inode *ip, struct dh->dh_hused++; DH_ENTRY(dh, slot) = offset; + /* Update last used time. */ + dh->dh_lastused = time_second; + /* Update the per-block summary info. */ ufsdirhash_adjfree(dh, offset, -DIRSIZ(0, dirp)); ufsdirhash_release(dh); @@ -1150,6 +1167,46 @@ ufsdirhash_getprev(struct direct *dirp, } /* + * Delete the given dirhash and reclaim its memory. Assumes that + * ufsdirhash_list is locked, and leaves it locked. Also assumes + * that dh is locked. Returns the amount of memory freed. + */ +static int +ufsdirhash_destroy(struct dirhash *dh) +{ + doff_t **hash; + u_int8_t *blkfree; + int i, mem, narrays; + + KASSERT(dh->dh_hash != NULL, ("dirhash: NULL hash on list")); + + /* Remove it from the list and detach its memory. */ + TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); + dh->dh_onlist = 0; + hash = dh->dh_hash; + dh->dh_hash = NULL; + blkfree = dh->dh_blkfree; + dh->dh_blkfree = NULL; + narrays = dh->dh_narrays; + mem = dh->dh_memreq; + dh->dh_memreq = 0; + + /* Unlock everything, free the detached memory. */ + ufsdirhash_release(dh); + DIRHASHLIST_UNLOCK(); + for (i = 0; i < narrays; i++) + DIRHASH_BLKFREE(hash[i]); + free(hash, M_DIRHASH); + free(blkfree, M_DIRHASH); + + /* Account for the returned memory. */ + DIRHASHLIST_LOCK(); + ufs_dirhashmem -= mem; + + return (mem); +} + +/* * Try to free up `wanted' bytes by stealing memory from existing * dirhashes. Returns zero with list locked if successful. */ @@ -1157,9 +1214,6 @@ static int ufsdirhash_recycle(int wanted) { struct dirhash *dh; - doff_t **hash; - u_int8_t *blkfree; - int i, mem, narrays; DIRHASHLIST_LOCK(); dh = TAILQ_FIRST(&ufsdirhash_list); @@ -1177,36 +1231,59 @@ ufsdirhash_recycle(int wanted) dh = TAILQ_NEXT(dh, dh_list); continue; } - KASSERT(dh->dh_hash != NULL, ("dirhash: NULL hash on list")); - /* Remove it from the list and detach its memory. */ - TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); - dh->dh_onlist = 0; - hash = dh->dh_hash; - dh->dh_hash = NULL; - blkfree = dh->dh_blkfree; - dh->dh_blkfree = NULL; - narrays = dh->dh_narrays; - mem = dh->dh_memreq; - dh->dh_memreq = 0; + ufsdirhash_destroy(dh); - /* Unlock everything, free the detached memory. */ - ufsdirhash_release(dh); - DIRHASHLIST_UNLOCK(); - for (i = 0; i < narrays; i++) - DIRHASH_BLKFREE(hash[i]); - free(hash, M_DIRHASH); - free(blkfree, M_DIRHASH); - - /* Account for the returned memory, and repeat if necessary. */ - DIRHASHLIST_LOCK(); - ufs_dirhashmem -= mem; + /* Repeat if necessary. */ dh = TAILQ_FIRST(&ufsdirhash_list); } /* Success; return with list locked. */ return (0); } +/* + * Callback that frees some dirhashes when the system is low on virtual memory. + */ +static void +ufsdirhash_lowmem() +{ + struct dirhash *dh; + int memfreed = 0; + /* XXX: this 10% may need to be adjusted */ + int memwanted = ufs_dirhashmem / 10; + + ufs_dirhashlowmemcount++; + + DIRHASHLIST_LOCK(); + /* + * Delete dirhashes not used for more than ufs_dirhashreclaimage + * seconds. If we can't get a lock on the dirhash, it will be skipped. + */ + for (dh = TAILQ_FIRST(&ufsdirhash_list); dh != NULL; dh = + TAILQ_NEXT(dh, dh_list)) { + if (!sx_try_xlock(&dh->dh_lock)) + continue; + if (time_second - dh->dh_lastused > ufs_dirhashreclaimage) + memfreed += ufsdirhash_destroy(dh); + /* Unlock if we didn't delete the dirhash */ + else + ufsdirhash_release(dh); + } + + /* + * If not enough memory was freed, keep deleting hashes from the head + * of the dirhash list. The ones closest to the head should be the + * oldest. + */ + for (dh = TAILQ_FIRST(&ufsdirhash_list); memfreed < memwanted && + dh !=NULL; dh = TAILQ_NEXT(dh, dh_list)) { + if (!sx_try_xlock(&dh->dh_lock)) + continue; + memfreed += ufsdirhash_destroy(dh); + } + DIRHASHLIST_UNLOCK(); +} + void ufsdirhash_init() @@ -1215,6 +1292,10 @@ ufsdirhash_init() NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); mtx_init(&ufsdirhash_mtx, "dirhash list", NULL, MTX_DEF); TAILQ_INIT(&ufsdirhash_list); + + /* Register a callback function to handle low memory signals */ + EVENTHANDLER_REGISTER(vm_lowmem, ufsdirhash_lowmem, NULL, + EVENTHANDLER_PRI_FIRST); } void From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 10:46:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB083106566B; Wed, 3 Jun 2009 10:46:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C47418FC13; Wed, 3 Jun 2009 10:46:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 6CECB46B39; Wed, 3 Jun 2009 06:46:39 -0400 (EDT) Date: Wed, 3 Jun 2009 11:46:39 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Pawel Jakub Dawidek In-Reply-To: <20090603083622.GA3824@garage.freebsd.pl> Message-ID: References: <200906021826.n52IQHrh024410@svn.freebsd.org> <20090603083622.GA3824@garage.freebsd.pl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193332 - in head/sys: kern netatalk netinet rpc security/mac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 10:46:40 -0000 On Wed, 3 Jun 2009, Pawel Jakub Dawidek wrote: >> Add internal 'mac_policy_count' counter to the MAC Framework, which is a >> count of the number of registered policies. >> >> Rather than unconditionally locking sockets before passing them into MAC, >> lock them in the MAC entry points only if mac_policy_count is non-zero. >> >> This avoids locking overhead for a number of socket system calls when no >> policies are registered, eliminating measurable overhead for the MAC >> Framework for the socket subsystem when there are no active policies. >> >> Possibly socket locks should be acquired by policies if they are required >> for socket labels, which would further avoid locking overhead when there >> are policies but they don't require labeling of sockets, or possibly >> don't even implement socket controls. > > This may introduce further overhead if there are few policies that implement > socket controls. Then you will have cost of npolicies * lock/unlock. Maybe > we could check if there is at least one policy implementing particular > socket control and if yes lock the socket in the framework only once? This > won't be ideal (there might be socket control that doesn't need to lock the > socket), but is good enough for my taste:) Yes, I've been giving this some thought also. I reviewed the set of policies that implement MAC checks on sockets, and found that they basically fall into a few categories: - mac_biba, mac_lomac, mac_mls - ubiquitously labeled policies that will require proper locking of the socket to safely access label data for access control decisions. - mac_test, which uses integer labels on all objects, which doesn't require locking, but doesn't hurt for having it. - mac_portacl, mac_ifoff, mac_partition - no labeling of sockets, but they do access socket fields for enforcement, and those fields don't require locks because they are static (protocol type, credential, etc). - mac_stub - no label use because it's a no-op policy. In general, my feeling is that our users will prefer policies that don't use labels on sockets given the above list, and we should optimize for that case for the time being. Likewise, users who are running with multiple policies that label sockets will likely be using (mac_biba + mac_mls) in which case they've already accepted a significant overhead to label all sockets, packets, etc, and will be less likely to notice it. So at least for now, I'll keep moving in this direction and we can revisit it if desired. My main goal for now is to make sure that options MAC is really zero-overhead, and I have a few more changes in the pipeline for the next few days to clear up a couple of anomolies I've found in testing so far. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 12:17:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5587A1065688; Wed, 3 Jun 2009 12:17:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 256158FC1F; Wed, 3 Jun 2009 12:17:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B728F46B06; Wed, 3 Jun 2009 08:17:19 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id B73C58A02B; Wed, 3 Jun 2009 08:17:18 -0400 (EDT) From: John Baldwin To: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= Date: Wed, 3 Jun 2009 07:57:37 -0400 User-Agent: KMail/1.9.7 References: <200906010537.n515bDou065357@svn.freebsd.org> <200906021511.03955.jhb@freebsd.org> <86iqjdek9t.fsf@ds4.des.no> In-Reply-To: <86iqjdek9t.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200906030757.37937.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 03 Jun 2009 08:17:18 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Brooks Davis , svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org, Bruce Simpson , svn-src-head@freebsd.org Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 12:17:20 -0000 On Wednesday 03 June 2009 5:31:10 am Dag-Erling Sm=C3=B8rgrav wrote: > John Baldwin writes: > > [...] Given that, there really isn't a good reason to customize > > network_interfaces anymore. >=20 > Listing e.g. bge0 in network_interfaces will (indirectly) cause if_bge > to be loaded if it wasn't already. If network_interfaces is left blank, > only interfaces that already have a driver attached to them will be > configured. That is a good argument. Someone noted it on -stable as well as something= =20 they use. Also, I wonder if ipv6_network_interfaces should actually defaul= t=20 to whatever the value of 'network_interfaces' is so that if someone does us= e=20 a customized 'network_interfaces' line it affects IPv6 configuration as wel= l. =20 (Maybe have it default to an empty value and have an empty value get replac= ed=20 with 'network_interfaces'?). =2D-=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 13:25:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26377106566B; Wed, 3 Jun 2009 13:25:51 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 143638FC1D; Wed, 3 Jun 2009 13:25:51 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53DPpc9055631; Wed, 3 Jun 2009 13:25:51 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53DPo2W055626; Wed, 3 Jun 2009 13:25:50 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200906031325.n53DPo2W055626@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 3 Jun 2009 13:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193377 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 13:25:51 -0000 Author: stas Date: Wed Jun 3 13:25:50 2009 New Revision: 193377 URL: http://svn.freebsd.org/changeset/base/193377 Log: - Sync our copies of ext2fs Linux headers to current Linux versions. Minimize differencies between our ext2fs headers and relevant Linux versions by using EXT2_SB macro to access the superblock fields. Most of the differencies in access to these fields are now hidden inside this macro. - Rename the s_db_per_group field of ext2fs_sb_info to s_gdb_count to reflect the similar change in Linux headers. New name also seem to be more appropriate for this field. - Use proper types for s_first_inode and s_inode_size in-core superblock fields. Now they reflec types used in the on-disk superblock version. - Add support for older filesystem revisions that doesn't have proper s_first_ino and s_inode_size fields in the on-disk superblock. In these cases predefined values for these fields are used. - Add simple sanity checks for s_first_inode and s_inode_size correctness. Reviewed by: bde (previous version) MFC after: 2 weeks Modified: head/sys/gnu/fs/ext2fs/ext2_fs.h head/sys/gnu/fs/ext2fs/ext2_fs_sb.h head/sys/gnu/fs/ext2fs/ext2_lookup.c head/sys/gnu/fs/ext2fs/ext2_vfsops.c head/sys/gnu/fs/ext2fs/ext2_vnops.c Modified: head/sys/gnu/fs/ext2fs/ext2_fs.h ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_fs.h Wed Jun 3 13:19:12 2009 (r193376) +++ head/sys/gnu/fs/ext2fs/ext2_fs.h Wed Jun 3 13:25:50 2009 (r193377) @@ -52,6 +52,8 @@ #define umode_t mode_t #define loff_t off_t +#define cpu_to_le32(x) htole32(x) + /* * The second extended filesystem constants/structures */ @@ -87,12 +89,10 @@ #endif /* - * Special inodes numbers + * Special inode numbers */ #define EXT2_BAD_INO 1 /* Bad blocks inode */ #define EXT2_ROOT_INO 2 /* Root inode */ -#define EXT2_ACL_IDX_INO 3 /* ACL inode */ -#define EXT2_ACL_DATA_INO 4 /* ACL inode */ #define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ #define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ @@ -104,17 +104,29 @@ */ #define EXT2_SUPER_MAGIC 0xEF53 +#ifdef __KERNEL__ +#include +static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) +{ + return sb->s_fs_info; +} +#elif defined(_KERNEL) /* - * Maximal count of links to a file + * FreeBSD passes the pointer to the in-core struct with relevant + * fields to EXT2_SB macro when accessing superblock fields. */ -#define EXT2_LINK_MAX 32000 +#define EXT2_SB(sb) (sb) +#else +/* Assume that user mode programs are passing in an ext2fs superblock, not + * a kernel struct super_block. This will allow us to call the feature-test + * macros from user land. */ +#define EXT2_SB(sb) (sb) +#endif /* - * Note: under FreeBSD, the "user" versions of the following macros are - * used (and must be used) in most cases, because ((s)->u.ext2_sb.s_es is - * not accessible. This depends on __KERNEL__ not being defined for - * kernel builds under FreeBSD. + * Maximal count of links to a file */ +#define EXT2_LINK_MAX 32000 /* * Macro-instructions used to manage several block sizes @@ -122,23 +134,22 @@ #define EXT2_MIN_BLOCK_SIZE 1024 #define EXT2_MAX_BLOCK_SIZE 4096 #define EXT2_MIN_BLOCK_LOG_SIZE 10 -#if defined(__KERNEL__) || (defined(__FreeBSD__) && defined(_KERNEL)) +#if defined(__KERNEL__) || defined(_KERNEL) # define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize) #else # define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) #endif -#define EXT2_ACLE_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_acl_entry)) #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32)) -#ifdef __KERNEL__ +#if defined(__KERNEL__) || defined(_KERNEL) # define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits) #else # define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) #endif -#ifdef notyet -#ifdef __KERNEL__ -#define EXT2_ADDR_PER_BLOCK_BITS(s) ((s)->u.ext2_sb.s_addr_per_block_bits) -#define EXT2_INODE_SIZE(s) ((s)->u.ext2_sb.s_inode_size) -#define EXT2_FIRST_INO(s) ((s)->u.ext2_sb.s_first_ino) +#if defined(__KERNEL__) || defined(_KERNEL) +#define EXT2_ADDR_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_addr_per_block_bits) +#define EXT2_INODE_SIZE(s) (EXT2_SB(s)->s_inode_size) +#define EXT2_FIRST_INO(s) (EXT2_SB(s)->s_first_ino) +#define EXT2_INODES_PER_BLOCK(s) ((s)->s_inodes_per_block) #else #define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ EXT2_GOOD_OLD_INODE_SIZE : \ @@ -147,12 +158,6 @@ EXT2_GOOD_OLD_FIRST_INO : \ (s)->s_first_ino) #endif -#else /* !notyet */ -#define EXT2_INODES_PER_BLOCK(s) ((s)->s_inodes_per_block) -/* Should be sizeof(struct ext2_inode): */ -#define EXT2_INODE_SIZE(s) ((s)->s_inode_size) -#define EXT2_FIRST_INO(s) ((s)->s_first_inode) -#endif /* notyet */ /* * Macro-instructions used to manage fragments @@ -160,15 +165,11 @@ #define EXT2_MIN_FRAG_SIZE 1024 #define EXT2_MAX_FRAG_SIZE 4096 #define EXT2_MIN_FRAG_LOG_SIZE 10 -#ifdef __KERNEL__ -# define EXT2_FRAG_SIZE(s) ((s)->u.ext2_sb.s_frag_size) -# define EXT2_FRAGS_PER_BLOCK(s) ((s)->u.ext2_sb.s_frags_per_block) +#if defined(__KERNEL__) || defined(_KERNEL) +# define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->s_frag_size) +# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->s_frags_per_block) #else -# if defined(_KERNEL) && defined(__FreeBSD__) -# define EXT2_FRAG_SIZE(s) ((s)->s_frag_size) -# else # define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) -# endif # define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) #endif @@ -212,11 +213,11 @@ struct ext2_group_desc /* * Macro-instructions used to manage group descriptors */ -#ifdef __KERNEL__ -# define EXT2_BLOCKS_PER_GROUP(s) ((s)->u.ext2_sb.s_blocks_per_group) -# define EXT2_DESC_PER_BLOCK(s) ((s)->u.ext2_sb.s_desc_per_block) -# define EXT2_INODES_PER_GROUP(s) ((s)->u.ext2_sb.s_inodes_per_group) -# define EXT2_DESC_PER_BLOCK_BITS(s) ((s)->u.ext2_sb.s_desc_per_block_bits) +#if defined(__KERNEL__) || defined(_KERNEL) +# define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->s_blocks_per_group) +# define EXT2_DESC_PER_BLOCK(s) (EXT2_SB(s)->s_desc_per_block) +# define EXT2_INODES_PER_GROUP(s) (EXT2_SB(s)->s_inodes_per_group) +# define EXT2_DESC_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_desc_per_block_bits) #else # define EXT2_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group) # define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc)) @@ -366,7 +367,7 @@ struct ext2_inode { #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt #define set_opt(o, opt) o |= EXT2_MOUNT_##opt -#define test_opt(sb, opt) ((sb)->u.ext2_sb.s_mount_opt & \ +#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \ EXT2_MOUNT_##opt) /* * Maximal mount counts between two filesystem checks @@ -444,15 +445,6 @@ struct ext2_super_block { __u32 s_reserved[204]; /* Padding to the end of the block */ }; -#ifdef __KERNEL__ -#define EXT2_SB(sb) (&((sb)->u.ext2_sb)) -#else -/* Assume that user mode programs are passing in an ext2fs superblock, not - * a kernel struct super_block. This will allow us to call the feature-test - * macros from user land. */ -#define EXT2_SB(sb) (sb) -#endif - /* * Codes for operating systems */ @@ -478,11 +470,11 @@ struct ext2_super_block { */ #define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_feature_compat & (mask) ) + ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) ) #define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_feature_ro_compat & (mask) ) + ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) ) #define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_feature_incompat & (mask) ) + ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) ) #define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 Modified: head/sys/gnu/fs/ext2fs/ext2_fs_sb.h ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_fs_sb.h Wed Jun 3 13:19:12 2009 (r193376) +++ head/sys/gnu/fs/ext2fs/ext2_fs_sb.h Wed Jun 3 13:25:50 2009 (r193377) @@ -60,11 +60,9 @@ struct ext2_sb_info { unsigned long s_blocks_per_group;/* Number of blocks in a group */ unsigned long s_inodes_per_group;/* Number of inodes in a group */ unsigned long s_itb_per_group; /* Number of inode table blocks per group */ - unsigned long s_db_per_group; /* Number of descriptor blocks per group */ + unsigned long s_gdb_count; /* Number of group descriptor blocks */ unsigned long s_desc_per_block; /* Number of group descriptors per block */ unsigned long s_groups_count; /* Number of groups in the fs */ - unsigned long s_first_inode; /* First inode on fs */ - unsigned int s_inode_size; /* Size for inode with extra data */ struct buffer_head * s_sbh; /* Buffer containing the super block */ struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ struct buffer_head ** s_group_desc; @@ -74,10 +72,13 @@ struct ext2_sb_info { struct buffer_head * s_inode_bitmap[EXT2_MAX_GROUP_LOADED]; unsigned long s_block_bitmap_number[EXT2_MAX_GROUP_LOADED]; struct buffer_head * s_block_bitmap[EXT2_MAX_GROUP_LOADED]; - int s_rename_lock; unsigned long s_mount_opt; - unsigned short s_resuid; - unsigned short s_resgid; +#ifdef notyet + uid_t s_resuid; + gid_t s_resgid; +#endif + unsigned short s_inode_size; + unsigned int s_first_ino; unsigned short s_mount_state; /* stuff that FFS keeps in its super block or that linux Modified: head/sys/gnu/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_lookup.c Wed Jun 3 13:19:12 2009 (r193376) +++ head/sys/gnu/fs/ext2fs/ext2_lookup.c Wed Jun 3 13:25:50 2009 (r193377) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -771,7 +772,7 @@ ext2_direnter(ip, dvp, cnp) dp = VTOI(dvp); newdir.inode = ip->i_number; newdir.name_len = cnp->cn_namelen; - if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs->s_es, + if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs, EXT2_FEATURE_INCOMPAT_FILETYPE)) newdir.file_type = DTTOFT(IFTODT(ip->i_mode)); else @@ -949,7 +950,7 @@ ext2_dirrewrite(dp, ip, cnp) &bp)) != 0) return (error); ep->inode = ip->i_number; - if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs->s_es, + if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs, EXT2_FEATURE_INCOMPAT_FILETYPE)) ep->file_type = DTTOFT(IFTODT(ip->i_mode)); else Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Wed Jun 3 13:19:12 2009 (r193376) +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Wed Jun 3 13:25:50 2009 (r193377) @@ -78,8 +78,8 @@ #include #include -#include #include +#include static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); static int ext2_mountfs(struct vnode *, struct mount *); @@ -412,7 +412,7 @@ static int compute_sb_data(devvp, es, fs V(s_fsbtodb) fs->s_qbmask = fs->s_blocksize - 1; V(s_qbmask) - fs->s_blocksize_bits = EXT2_BLOCK_SIZE_BITS(es); + fs->s_blocksize_bits = es->s_log_block_size + 10; V(s_blocksize_bits) fs->s_frag_size = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size; V(s_frag_size) @@ -425,10 +425,23 @@ static int compute_sb_data(devvp, es, fs V(s_frags_per_group) fs->s_inodes_per_group = es->s_inodes_per_group; V(s_inodes_per_group) - fs->s_inode_size = es->s_inode_size; - V(s_inode_size) - fs->s_first_inode = es->s_first_ino; - V(s_first_inode); + if (es->s_rev_level == EXT2_GOOD_OLD_REV) { + fs->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; + fs->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; + } else { + fs->s_first_ino = es->s_first_ino; + fs->s_inode_size = es->s_inode_size; + + /* + * Simple sanity check for superblock inode size value. + */ + if (fs->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE || + fs->s_inode_size > fs->s_blocksize || + (fs->s_inode_size & (fs->s_inode_size - 1)) != 0) { + printf("EXT2-fs: invalid inode size %d\n", fs->s_inode_size); + return (EIO); + } + } fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE(fs); V(s_inodes_per_block) fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block; @@ -443,8 +456,8 @@ static int compute_sb_data(devvp, es, fs V(s_groups_count) db_count = (fs->s_groups_count + EXT2_DESC_PER_BLOCK(fs) - 1) / EXT2_DESC_PER_BLOCK(fs); - fs->s_db_per_group = db_count; - V(s_db_per_group) + fs->s_gdb_count = db_count; + V(s_gdb_count) fs->s_group_desc = bsd_malloc(db_count * sizeof (struct buf *), M_EXT2MNT, M_WAITOK); @@ -761,7 +774,7 @@ ext2_unmount(mp, mntflags) } /* release buffers containing group descriptors */ - for(i = 0; i < fs->s_db_per_group; i++) + for(i = 0; i < fs->s_gdb_count; i++) ULCK_BUF(fs->s_group_desc[i]) bsd_free(fs->s_group_desc, M_EXT2MNT); @@ -839,7 +852,7 @@ ext2_statfs(mp, sbp) nsb = fs->s_groups_count; overhead = es->s_first_data_block + /* Superblocks and block group descriptors: */ - nsb * (1 + fs->s_db_per_group) + + nsb * (1 + fs->s_gdb_count) + /* Inode bitmap, block bitmap, and inode table: */ fs->s_groups_count * (1 + 1 + fs->s_itb_per_group); Modified: head/sys/gnu/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vnops.c Wed Jun 3 13:19:12 2009 (r193376) +++ head/sys/gnu/fs/ext2fs/ext2_vnops.c Wed Jun 3 13:25:50 2009 (r193377) @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -1185,7 +1186,7 @@ ext2_mkdir(ap) goto bad; /* Initialize directory with "." and ".." from static template. */ - if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs->s_es, + if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs, EXT2_FEATURE_INCOMPAT_FILETYPE)) dtp = &mastertemplate; else From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 14:09:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 604341065673; Wed, 3 Jun 2009 14:09:08 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:a1::2]) by mx1.freebsd.org (Postfix) with ESMTP id C2E678FC14; Wed, 3 Jun 2009 14:09:07 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n53E9J36029377; Wed, 3 Jun 2009 09:09:19 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n53E9Ix8029375; Wed, 3 Jun 2009 09:09:18 -0500 (CDT) (envelope-from brooks) Date: Wed, 3 Jun 2009 09:09:18 -0500 From: Brooks Davis To: John Baldwin Message-ID: <20090603140918.GB28486@lor.one-eyed-alien.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <200906021511.03955.jhb@freebsd.org> <86iqjdek9t.fsf@ds4.des.no> <200906030757.37937.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2B/JsCI69OhZNC5r" Content-Disposition: inline In-Reply-To: <200906030757.37937.jhb@freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Wed, 03 Jun 2009 09:09:19 -0500 (CDT) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Doug Barton , Bruce Simpson , svn-src-head@freebsd.org, Dag-Erling Sm??rgrav Subject: Re: svn commit: r193199 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 14:09:08 -0000 --2B/JsCI69OhZNC5r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 03, 2009 at 07:57:37AM -0400, John Baldwin wrote: > On Wednesday 03 June 2009 5:31:10 am Dag-Erling Sm??rgrav wrote: > > John Baldwin writes: > > > [...] Given that, there really isn't a good reason to customize > > > network_interfaces anymore. > >=20 > > Listing e.g. bge0 in network_interfaces will (indirectly) cause if_bge > > to be loaded if it wasn't already. If network_interfaces is left blank, > > only interfaces that already have a driver attached to them will be > > configured. Ugh, I thought I'd killed that off. I'm solidly in the camp of people who think the autoloading is a mistake. If you're going to hardcode a list of module you want to load, /boot/loader.conf is the place, not this indirect hack that bites people on the ass because it works for real interfaces, but not all sorts of other types due to the impossibilty of generalizing support. For extra fun, making a typo on your ifconfig command line can lead to loading a random module. > That is a good argument. Someone noted it on -stable as well as somethin= g=20 > they use. Also, I wonder if ipv6_network_interfaces should actually defa= ult=20 > to whatever the value of 'network_interfaces' is so that if someone does = use=20 > a customized 'network_interfaces' line it affects IPv6 configuration as w= ell. =20 > (Maybe have it default to an empty value and have an empty value get repl= aced=20 > with 'network_interfaces'?). That's probably a good solution for ipv6_network_interfaces. -- Brooks --2B/JsCI69OhZNC5r Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFKJoQNXY6L6fI4GtQRAqyXAKCbigMpc2h0+fr6GMGxInCOta2+oACeOZhl xEAXHqKhqTD8IHMz/T5gF1E= =9A9Z -----END PGP SIGNATURE----- --2B/JsCI69OhZNC5r-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 14:18:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2EDD1065673; Wed, 3 Jun 2009 14:18:37 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B12348FC08; Wed, 3 Jun 2009 14:18:37 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53EIbYh057028; Wed, 3 Jun 2009 14:18:37 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53EIbS9057027; Wed, 3 Jun 2009 14:18:37 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200906031418.n53EIbS9057027@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 3 Jun 2009 14:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193382 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 14:18:38 -0000 Author: stas Date: Wed Jun 3 14:18:37 2009 New Revision: 193382 URL: http://svn.freebsd.org/changeset/base/193382 Log: - Style(9) improvements. - Convert all K&R definitions to ANSI equialents. - Retire bsd_malloc and bsd_free macros and use malloc/free directly. - Drop some unused debugging calls. This commit brings no functional changes. Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Wed Jun 3 13:29:37 2009 (r193381) +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Wed Jun 3 14:18:37 2009 (r193382) @@ -81,10 +81,10 @@ #include #include -static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); -static int ext2_mountfs(struct vnode *, struct mount *); -static int ext2_reload(struct mount *mp, struct thread *td); -static int ext2_sbupdate(struct ext2mount *, int); +static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); +static int ext2_mountfs(struct vnode *, struct mount *); +static int ext2_reload(struct mount *mp, struct thread *td); +static int ext2_sbupdate(struct ext2mount *, int); static vfs_unmount_t ext2_unmount; static vfs_root_t ext2_root; @@ -109,9 +109,6 @@ static struct vfsops ext2fs_vfsops = { VFS_SET(ext2fs_vfsops, ext2fs, 0); -#define bsd_malloc malloc -#define bsd_free free - static int ext2_check_sb_compat(struct ext2_super_block *es, struct cdev *dev, int ronly); static int compute_sb_data(struct vnode * devvp, @@ -127,18 +124,17 @@ static const char *ext2_opts[] = { "from * mount system call */ static int -ext2_mount(mp) - struct mount *mp; +ext2_mount(struct mount *mp) { struct vfsoptlist *opts; struct vnode *devvp; struct thread *td; struct ext2mount *ump = 0; struct ext2_sb_info *fs; + struct nameidata nd, *ndp = &nd; + accmode_t accmode; char *path, *fspec; int error, flags, len; - accmode_t accmode; - struct nameidata nd, *ndp = &nd; td = curthread; opts = mp->mnt_optnew; @@ -196,6 +192,7 @@ ext2_mount(mp) if (fs->s_rd_only && !vfs_flagopt(opts, "ro", NULL, 0)) { if (ext2_check_sb_compat(fs->s_es, devvp->v_rdev, 0)) return (EPERM); + /* * If upgrade to read-write by non-root, then verify * that user has necessary permissions on the device. @@ -221,13 +218,12 @@ ext2_mount(mp) if ((fs->s_es->s_state & EXT2_VALID_FS) == 0 || (fs->s_es->s_state & EXT2_ERROR_FS)) { if (mp->mnt_flag & MNT_FORCE) { - printf( -"WARNING: %s was not properly dismounted\n", - fs->fs_fsmnt); + printf("WARNING: %s was not properly " + "dismounted\n", fs->fs_fsmnt); } else { - printf( -"WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", - fs->fs_fsmnt); + printf("WARNING: R/W mount of %s " + "denied. Filesystem is not clean" + " - run fsck\n", fs->fs_fsmnt); return (EPERM); } } @@ -243,6 +239,7 @@ ext2_mount(mp) return (error); } } + /* * Not an update, or updating the name: look up the name * and verify that it refers to a sensible disk device. @@ -292,6 +289,7 @@ ext2_mount(mp) } ump = VFSTOEXT2(mp); fs = ump->um_e2fs; + /* * Note that this strncpy() is ok because of a check at the start * of ext2_mount(). @@ -303,63 +301,55 @@ ext2_mount(mp) } /* - * checks that the data in the descriptor blocks make sense - * this is taken from ext2/super.c + * Checks that the data in the descriptor blocks make sense + * this is taken from ext2/super.c. */ -static int ext2_check_descriptors (struct ext2_sb_info * sb) +static int +ext2_check_descriptors(struct ext2_sb_info *sb) { - int i; - int desc_block = 0; - unsigned long block = sb->s_es->s_first_data_block; - struct ext2_group_desc * gdp = NULL; - - /* ext2_debug ("Checking group descriptors"); */ + struct ext2_group_desc *gdp = NULL; + unsigned long block = sb->s_es->s_first_data_block; + int desc_block = 0; + int i; - for (i = 0; i < sb->s_groups_count; i++) - { + for (i = 0; i < sb->s_groups_count; i++) { /* examine next descriptor block */ - if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) - gdp = (struct ext2_group_desc *) - sb->s_group_desc[desc_block++]->b_data; - if (gdp->bg_block_bitmap < block || - gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) - { - printf ("ext2_check_descriptors: " - "Block bitmap for group %d" - " not in group (block %lu)!\n", - i, (unsigned long) gdp->bg_block_bitmap); - return 0; - } - if (gdp->bg_inode_bitmap < block || - gdp->bg_inode_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) - { - printf ("ext2_check_descriptors: " - "Inode bitmap for group %d" - " not in group (block %lu)!\n", - i, (unsigned long) gdp->bg_inode_bitmap); - return 0; - } - if (gdp->bg_inode_table < block || - gdp->bg_inode_table + sb->s_itb_per_group >= - block + EXT2_BLOCKS_PER_GROUP(sb)) - { - printf ("ext2_check_descriptors: " - "Inode table for group %d" - " not in group (block %lu)!\n", - i, (unsigned long) gdp->bg_inode_table); - return 0; - } - block += EXT2_BLOCKS_PER_GROUP(sb); - gdp++; - } - return 1; + if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) + gdp = (struct ext2_group_desc *) + sb->s_group_desc[desc_block++]->b_data; + if (gdp->bg_block_bitmap < block || + gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) { + printf ("ext2_check_descriptors: " + "Block bitmap for group %d" + " not in group (block %lu)!\n", + i, (unsigned long) gdp->bg_block_bitmap); + return (0); + } + if (gdp->bg_inode_bitmap < block || + gdp->bg_inode_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) { + printf ("ext2_check_descriptors: " + "Inode bitmap for group %d" + " not in group (block %lu)!\n", + i, (unsigned long) gdp->bg_inode_bitmap); + return (0); + } + if (gdp->bg_inode_table < block || + gdp->bg_inode_table + sb->s_itb_per_group >= + block + EXT2_BLOCKS_PER_GROUP(sb)) { + printf ("ext2_check_descriptors: " + "Inode table for group %d" + " not in group (block %lu)!\n", + i, (unsigned long) gdp->bg_inode_table); + return (0); + } + block += EXT2_BLOCKS_PER_GROUP(sb); + gdp++; + } + return (1); } static int -ext2_check_sb_compat(es, dev, ronly) - struct ext2_super_block *es; - struct cdev *dev; - int ronly; +ext2_check_sb_compat(struct ext2_super_block *es, struct cdev *dev, int ronly) { if (es->s_magic != EXT2_SUPER_MAGIC) { @@ -369,16 +359,14 @@ ext2_check_sb_compat(es, dev, ronly) } if (es->s_rev_level > EXT2_GOOD_OLD_REV) { if (es->s_feature_incompat & ~EXT2_FEATURE_INCOMPAT_SUPP) { - printf( -"WARNING: mount of %s denied due to unsupported optional features\n", - devtoname(dev)); + printf("WARNING: mount of %s denied due to unsupported " + "optional features\n", devtoname(dev)); return (1); } if (!ronly && (es->s_feature_ro_compat & ~EXT2_FEATURE_RO_COMPAT_SUPP)) { - printf( -"WARNING: R/W mount of %s denied due to unsupported optional features\n", - devtoname(dev)); + printf("WARNING: R/W mount of %s denied due to " + "unsupported optional features\n", devtoname(dev)); return (1); } } @@ -386,124 +374,101 @@ ext2_check_sb_compat(es, dev, ronly) } /* - * this computes the fields of the ext2_sb_info structure from the - * data in the ext2_super_block structure read in + * This computes the fields of the ext2_sb_info structure from the + * data in the ext2_super_block structure read in. */ -static int compute_sb_data(devvp, es, fs) - struct vnode * devvp; - struct ext2_super_block * es; - struct ext2_sb_info * fs; +static int +compute_sb_data(struct vnode *devvp, struct ext2_super_block *es, + struct ext2_sb_info *fs) { - int db_count, error; - int i, j; - int logic_sb_block = 1; /* XXX for now */ - -#if 1 -#define V(v) -#else -#define V(v) printf(#v"= %lu\n", (unsigned long)fs->v); -#endif + int db_count, error; + int i, j; + int logic_sb_block = 1; /* XXX for now */ + + fs->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; + fs->s_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->s_log_block_size; + fs->s_fsbtodb = es->s_log_block_size + 1; + fs->s_qbmask = fs->s_blocksize - 1; + fs->s_blocksize_bits = es->s_log_block_size + 10; + fs->s_frag_size = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size; + if (fs->s_frag_size) + fs->s_frags_per_block = fs->s_blocksize / fs->s_frag_size; + fs->s_blocks_per_group = es->s_blocks_per_group; + fs->s_frags_per_group = es->s_frags_per_group; + fs->s_inodes_per_group = es->s_inodes_per_group; + if (es->s_rev_level == EXT2_GOOD_OLD_REV) { + fs->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; + fs->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; + } else { + fs->s_first_ino = es->s_first_ino; + fs->s_inode_size = es->s_inode_size; - fs->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; - V(s_blocksize) - fs->s_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->s_log_block_size; - V(s_bshift) - fs->s_fsbtodb = es->s_log_block_size + 1; - V(s_fsbtodb) - fs->s_qbmask = fs->s_blocksize - 1; - V(s_qbmask) - fs->s_blocksize_bits = es->s_log_block_size + 10; - V(s_blocksize_bits) - fs->s_frag_size = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size; - V(s_frag_size) - if (fs->s_frag_size) - fs->s_frags_per_block = fs->s_blocksize / fs->s_frag_size; - V(s_frags_per_block) - fs->s_blocks_per_group = es->s_blocks_per_group; - V(s_blocks_per_group) - fs->s_frags_per_group = es->s_frags_per_group; - V(s_frags_per_group) - fs->s_inodes_per_group = es->s_inodes_per_group; - V(s_inodes_per_group) - if (es->s_rev_level == EXT2_GOOD_OLD_REV) { - fs->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; - fs->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; - } else { - fs->s_first_ino = es->s_first_ino; - fs->s_inode_size = es->s_inode_size; - - /* - * Simple sanity check for superblock inode size value. - */ - if (fs->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE || - fs->s_inode_size > fs->s_blocksize || - (fs->s_inode_size & (fs->s_inode_size - 1)) != 0) { - printf("EXT2-fs: invalid inode size %d\n", fs->s_inode_size); - return (EIO); + /* + * Simple sanity check for superblock inode size value. + */ + if (fs->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE || + fs->s_inode_size > fs->s_blocksize || + (fs->s_inode_size & (fs->s_inode_size - 1)) != 0) { + printf("EXT2-fs: invalid inode size %d\n", + fs->s_inode_size); + return (EIO); + } } - } - fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE(fs); - V(s_inodes_per_block) - fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block; - V(s_itb_per_group) - fs->s_desc_per_block = fs->s_blocksize / sizeof (struct ext2_group_desc); - V(s_desc_per_block) - /* s_resuid / s_resgid ? */ - fs->s_groups_count = (es->s_blocks_count - - es->s_first_data_block + - EXT2_BLOCKS_PER_GROUP(fs) - 1) / - EXT2_BLOCKS_PER_GROUP(fs); - V(s_groups_count) - db_count = (fs->s_groups_count + EXT2_DESC_PER_BLOCK(fs) - 1) / - EXT2_DESC_PER_BLOCK(fs); - fs->s_gdb_count = db_count; - V(s_gdb_count) + fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE(fs); + fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block; + fs->s_desc_per_block = fs->s_blocksize / sizeof (struct ext2_group_desc); + /* s_resuid / s_resgid ? */ + fs->s_groups_count = (es->s_blocks_count - es->s_first_data_block + + EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs); + db_count = (fs->s_groups_count + EXT2_DESC_PER_BLOCK(fs) - 1) / + EXT2_DESC_PER_BLOCK(fs); + fs->s_gdb_count = db_count; + fs->s_group_desc = malloc(db_count * sizeof (struct buf *), + M_EXT2MNT, M_WAITOK); - fs->s_group_desc = bsd_malloc(db_count * sizeof (struct buf *), - M_EXT2MNT, M_WAITOK); + /* + * Adjust logic_sb_block. + * Godmar thinks: if the blocksize is greater than 1024, then + * the superblock is logically part of block zero. + */ + if(fs->s_blocksize > SBSIZE) + logic_sb_block = 0; - /* adjust logic_sb_block */ - if(fs->s_blocksize > SBSIZE) - /* Godmar thinks: if the blocksize is greater than 1024, then - the superblock is logically part of block zero. - */ - logic_sb_block = 0; - - for (i = 0; i < db_count; i++) { - error = bread(devvp , fsbtodb(fs, logic_sb_block + i + 1), - fs->s_blocksize, NOCRED, &fs->s_group_desc[i]); - if(error) { - for (j = 0; j < i; j++) - brelse(fs->s_group_desc[j]); - bsd_free(fs->s_group_desc, M_EXT2MNT); - printf("EXT2-fs: unable to read group descriptors (%d)\n", error); - return EIO; - } - LCK_BUF(fs->s_group_desc[i]) - } - if(!ext2_check_descriptors(fs)) { - for (j = 0; j < db_count; j++) - ULCK_BUF(fs->s_group_desc[j]) - bsd_free(fs->s_group_desc, M_EXT2MNT); - printf("EXT2-fs: (ext2_check_descriptors failure) " - "unable to read group descriptors\n"); - return EIO; - } - - for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) { - fs->s_inode_bitmap_number[i] = 0; - fs->s_inode_bitmap[i] = NULL; - fs->s_block_bitmap_number[i] = 0; - fs->s_block_bitmap[i] = NULL; - } - fs->s_loaded_inode_bitmaps = 0; - fs->s_loaded_block_bitmaps = 0; - if (es->s_rev_level == EXT2_GOOD_OLD_REV || (es->s_feature_ro_compat & - EXT2_FEATURE_RO_COMPAT_LARGE_FILE) == 0) - fs->fs_maxfilesize = 0x7fffffff; - else - fs->fs_maxfilesize = 0x7fffffffffffffff; - return 0; + for (i = 0; i < db_count; i++) { + error = bread(devvp , fsbtodb(fs, logic_sb_block + i + 1), + fs->s_blocksize, NOCRED, &fs->s_group_desc[i]); + if(error) { + for (j = 0; j < i; j++) + brelse(fs->s_group_desc[j]); + free(fs->s_group_desc, M_EXT2MNT); + printf("EXT2-fs: unable to read group descriptors" + " (%d)\n", error); + return (EIO); + } + LCK_BUF(fs->s_group_desc[i]) + } + if(!ext2_check_descriptors(fs)) { + for (j = 0; j < db_count; j++) + ULCK_BUF(fs->s_group_desc[j]) + free(fs->s_group_desc, M_EXT2MNT); + printf("EXT2-fs: (ext2_check_descriptors failure) " + "unable to read group descriptors\n"); + return (EIO); + } + for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) { + fs->s_inode_bitmap_number[i] = 0; + fs->s_inode_bitmap[i] = NULL; + fs->s_block_bitmap_number[i] = 0; + fs->s_block_bitmap[i] = NULL; + } + fs->s_loaded_inode_bitmaps = 0; + fs->s_loaded_block_bitmaps = 0; + if (es->s_rev_level == EXT2_GOOD_OLD_REV || + (es->s_feature_ro_compat & EXT2_FEATURE_RO_COMPAT_LARGE_FILE) == 0) + fs->fs_maxfilesize = 0x7fffffff; + else + fs->fs_maxfilesize = 0x7fffffffffffffff; + return (0); } /* @@ -525,7 +490,7 @@ ext2_reload(struct mount *mp, struct thr struct vnode *vp, *mvp, *devvp; struct inode *ip; struct buf *bp; - struct ext2_super_block * es; + struct ext2_super_block *es; struct ext2_sb_info *fs; int error; @@ -556,7 +521,7 @@ ext2_reload(struct mount *mp, struct thr if((error = compute_sb_data(devvp, es, fs)) != 0) { brelse(bp); - return error; + return (error); } #ifdef UNKLAR if (fs->fs_sbsize < SBSIZE) @@ -582,12 +547,12 @@ loop: } if (vinvalbuf(vp, 0, 0, 0)) panic("ext2_reload: dirty2"); + /* * Step 5: re-read inode data for all active vnodes. */ ip = VTOI(vp); - error = - bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), + error = bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), (int)fs->s_blocksize, NOCRED, &bp); if (error) { VOP_UNLOCK(vp, 0); @@ -607,17 +572,15 @@ loop: } /* - * Common code for mount and mountroot + * Common code for mount and mountroot. */ static int -ext2_mountfs(devvp, mp) - struct vnode *devvp; - struct mount *mp; +ext2_mountfs(struct vnode *devvp, struct mount *mp) { struct ext2mount *ump; struct buf *bp; struct ext2_sb_info *fs; - struct ext2_super_block * es; + struct ext2_super_block *es; struct cdev *dev = devvp->v_rdev; struct g_consumer *cp; struct bufobj *bo; @@ -666,28 +629,31 @@ ext2_mountfs(devvp, mp) if ((es->s_state & EXT2_VALID_FS) == 0 || (es->s_state & EXT2_ERROR_FS)) { if (ronly || (mp->mnt_flag & MNT_FORCE)) { - printf( -"WARNING: Filesystem was not properly dismounted\n"); + printf("WARNING: Filesystem was not properly " + "dismounted\n"); } else { - printf( -"WARNING: R/W mount denied. Filesystem is not clean - run fsck\n"); + printf("WARNING: R/W mount denied. Filesystem " + "is not clean - run fsck\n"); error = EPERM; goto out; } } - ump = bsd_malloc(sizeof *ump, M_EXT2MNT, M_WAITOK); + ump = malloc(sizeof *ump, M_EXT2MNT, M_WAITOK); bzero((caddr_t)ump, sizeof *ump); - /* I don't know whether this is the right strategy. Note that - we dynamically allocate both an ext2_sb_info and an ext2_super_block - while Linux keeps the super block in a locked buffer + + /* + * I don't know whether this is the right strategy. Note that + * we dynamically allocate both an ext2_sb_info and an ext2_super_block + * while Linux keeps the super block in a locked buffer. */ - ump->um_e2fs = bsd_malloc(sizeof(struct ext2_sb_info), + ump->um_e2fs = malloc(sizeof(struct ext2_sb_info), M_EXT2MNT, M_WAITOK); - ump->um_e2fs->s_es = bsd_malloc(sizeof(struct ext2_super_block), + ump->um_e2fs->s_es = malloc(sizeof(struct ext2_super_block), M_EXT2MNT, M_WAITOK); bcopy(es, ump->um_e2fs->s_es, (u_int)sizeof(struct ext2_super_block)); if ((error = compute_sb_data(devvp, ump->um_e2fs->s_es, ump->um_e2fs))) goto out; + /* * We don't free the group descriptors allocated by compute_sb_data() * until ext2_unmount(). This is OK since the mount will succeed. @@ -696,8 +662,10 @@ ext2_mountfs(devvp, mp) bp = NULL; fs = ump->um_e2fs; fs->s_rd_only = ronly; /* ronly is set according to mnt_flags */ - /* if the fs is not mounted read-only, make sure the super block is - always written back on a sync() + + /* + * If the fs is not mounted read-only, make sure the super block is + * always written back on a sync(). */ fs->s_wasvalid = fs->s_es->s_state & EXT2_VALID_FS ? 1 : 0; if (ronly == 0) { @@ -716,9 +684,11 @@ ext2_mountfs(devvp, mp) ump->um_devvp = devvp; ump->um_bo = &devvp->v_bufobj; ump->um_cp = cp; - /* setting those two parameters allowed us to use - ufs_bmap w/o changse ! - */ + + /* + * Setting those two parameters allowed us to use + * ufs_bmap w/o changse! + */ ump->um_nindir = EXT2_ADDR_PER_BLOCK(fs); ump->um_bptrtodb = fs->s_es->s_log_block_size + 1; ump->um_seqinc = EXT2_FRAGS_PER_BLOCK(fs); @@ -736,21 +706,19 @@ out: PICKUP_GIANT(); } if (ump) { - bsd_free(ump->um_e2fs->s_es, M_EXT2MNT); - bsd_free(ump->um_e2fs, M_EXT2MNT); - bsd_free(ump, M_EXT2MNT); + free(ump->um_e2fs->s_es, M_EXT2MNT); + free(ump->um_e2fs, M_EXT2MNT); + free(ump, M_EXT2MNT); mp->mnt_data = NULL; } return (error); } /* - * unmount system call + * Unmount system call. */ static int -ext2_unmount(mp, mntflags) - struct mount *mp; - int mntflags; +ext2_unmount(struct mount *mp, int mntflags) { struct ext2mount *ump; struct ext2_sb_info *fs; @@ -776,16 +744,15 @@ ext2_unmount(mp, mntflags) /* release buffers containing group descriptors */ for(i = 0; i < fs->s_gdb_count; i++) ULCK_BUF(fs->s_group_desc[i]) - bsd_free(fs->s_group_desc, M_EXT2MNT); + free(fs->s_group_desc, M_EXT2MNT); /* release cached inode/block bitmaps */ - for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) - if (fs->s_inode_bitmap[i]) - ULCK_BUF(fs->s_inode_bitmap[i]) - - for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) - if (fs->s_block_bitmap[i]) - ULCK_BUF(fs->s_block_bitmap[i]) + for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) + if (fs->s_inode_bitmap[i]) + ULCK_BUF(fs->s_inode_bitmap[i]) + for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) + if (fs->s_block_bitmap[i]) + ULCK_BUF(fs->s_block_bitmap[i]) DROP_GIANT(); g_topology_lock(); @@ -793,9 +760,9 @@ ext2_unmount(mp, mntflags) g_topology_unlock(); PICKUP_GIANT(); vrele(ump->um_devvp); - bsd_free(fs->s_es, M_EXT2MNT); - bsd_free(fs, M_EXT2MNT); - bsd_free(ump, M_EXT2MNT); + free(fs->s_es, M_EXT2MNT); + free(fs, M_EXT2MNT); + free(ump, M_EXT2MNT); mp->mnt_data = NULL; MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; @@ -807,10 +774,7 @@ ext2_unmount(mp, mntflags) * Flush out all the files in a filesystem. */ static int -ext2_flushfiles(mp, flags, td) - struct mount *mp; - int flags; - struct thread *td; +ext2_flushfiles(struct mount *mp, int flags, struct thread *td) { int error; @@ -820,17 +784,15 @@ ext2_flushfiles(mp, flags, td) /* * Get file system statistics. - * taken from ext2/super.c ext2_statfs + * taken from ext2/super.c ext2_statfs. */ static int -ext2_statfs(mp, sbp) - struct mount *mp; - struct statfs *sbp; +ext2_statfs(struct mount *mp, struct statfs *sbp) { - unsigned long overhead; struct ext2mount *ump; struct ext2_sb_info *fs; struct ext2_super_block *es; + unsigned long overhead; int i, nsb; ump = VFSTOEXT2(mp); @@ -851,10 +813,10 @@ ext2_statfs(mp, sbp) } else nsb = fs->s_groups_count; overhead = es->s_first_data_block + - /* Superblocks and block group descriptors: */ - nsb * (1 + fs->s_gdb_count) + - /* Inode bitmap, block bitmap, and inode table: */ - fs->s_groups_count * (1 + 1 + fs->s_itb_per_group); + /* Superblocks and block group descriptors: */ + nsb * (1 + fs->s_gdb_count) + + /* Inode bitmap, block bitmap, and inode table: */ + fs->s_groups_count * (1 + 1 + fs->s_itb_per_group); sbp->f_bsize = EXT2_FRAG_SIZE(fs); sbp->f_iosize = EXT2_BLOCK_SIZE(fs); @@ -874,9 +836,7 @@ ext2_statfs(mp, sbp) * Note: we are always called with the filesystem marked `MPBUSY'. */ static int -ext2_sync(mp, waitfor) - struct mount *mp; - int waitfor; +ext2_sync(struct mount *mp, int waitfor) { struct vnode *mvp, *vp; struct thread *td; @@ -891,6 +851,7 @@ ext2_sync(mp, waitfor) printf("fs = %s\n", fs->fs_fsmnt); panic("ext2_sync: rofs mod"); } + /* * Write back each (modified) inode. */ @@ -928,6 +889,7 @@ loop: MNT_ILOCK(mp); } MNT_IUNLOCK(mp); + /* * Force stale file system control information to be flushed. */ @@ -937,6 +899,7 @@ loop: allerror = error; VOP_UNLOCK(ump->um_devvp, 0); } + /* * Write back modified superblock. */ @@ -956,11 +919,7 @@ loop: * done by the calling routine. */ static int -ext2_vget(mp, ino, flags, vpp) - struct mount *mp; - ino_t ino; - int flags; - struct vnode **vpp; +ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) { struct ext2_sb_info *fs; struct inode *ip; @@ -968,9 +927,9 @@ ext2_vget(mp, ino, flags, vpp) struct buf *bp; struct vnode *vp; struct cdev *dev; + struct thread *td; int i, error; int used_blocks; - struct thread *td; td = curthread; error = vfs_hash_get(mp, ino, flags, td, vpp, NULL, NULL); @@ -1012,9 +971,6 @@ ext2_vget(mp, ino, flags, vpp) return (error); /* Read in the disk contents for the inode, copy into the inode. */ -#if 0 -printf("ext2_vget(%d) dbn= %lu ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); -#endif if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), (int)fs->s_blocksize, NOCRED, &bp)) != 0) { /* @@ -1036,10 +992,12 @@ printf("ext2_vget(%d) dbn= %lu ", ino, f ip->i_next_alloc_goal = 0; ip->i_prealloc_count = 0; ip->i_prealloc_block = 0; - /* now we want to make sure that block pointers for unused - blocks are zeroed out - ext2_balloc depends on this - although for regular files and directories only - */ + + /* + * Now we want to make sure that block pointers for unused + * blocks are zeroed out - ext2_balloc depends on this + * although for regular files and directories only + */ if(S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode)) { used_blocks = (ip->i_size+fs->s_blocksize-1) / fs->s_blocksize; for(i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) @@ -1059,10 +1017,12 @@ printf("ext2_vget(%d) dbn= %lu ", ino, f *vpp = NULL; return (error); } + /* * Finish inode initialization now that aliasing has been resolved. */ ip->i_devvp = ump->um_devvp; + /* * Set up a generation number for this inode if it does not * already have one. This should only happen on old filesystems. @@ -1087,10 +1047,7 @@ printf("ext2_vget(%d) dbn= %lu ", ino, f * those rights via. exflagsp and credanonp */ static int -ext2_fhtovp(mp, fhp, vpp) - struct mount *mp; - struct fid *fhp; - struct vnode **vpp; +ext2_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) { struct inode *ip; struct ufid *ufhp; @@ -1125,17 +1082,13 @@ ext2_fhtovp(mp, fhp, vpp) * Write a superblock and associated information back to disk. */ static int -ext2_sbupdate(mp, waitfor) - struct ext2mount *mp; - int waitfor; +ext2_sbupdate(struct ext2mount *mp, int waitfor) { struct ext2_sb_info *fs = mp->um_e2fs; struct ext2_super_block *es = fs->s_es; struct buf *bp; int error = 0; -/* -printf("\nupdating superblock, waitfor=%s\n", waitfor == MNT_WAIT ? "yes":"no"); -*/ + bp = getblk(mp->um_devvp, SBLOCK, SBSIZE, 0, 0, 0); bcopy((caddr_t)es, bp->b_data, (u_int)sizeof(struct ext2_super_block)); if (waitfor == MNT_WAIT) @@ -1146,9 +1099,8 @@ printf("\nupdating superblock, waitfor=% /* * The buffers for group descriptors, inode bitmaps and block bitmaps * are not busy at this point and are (hopefully) written by the - * usual sync mechanism. No need to write them here - */ - + * usual sync mechanism. No need to write them here. + */ return (error); } @@ -1156,10 +1108,7 @@ printf("\nupdating superblock, waitfor=% * Return the root of a filesystem. */ static int -ext2_root(mp, flags, vpp) - struct mount *mp; - int flags; - struct vnode **vpp; +ext2_root(struct mount *mp, int flags, struct vnode **vpp) { struct vnode *nvp; int error; From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 16:28:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73CB41065670; Wed, 3 Jun 2009 16:28:29 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 622FB8FC12; Wed, 3 Jun 2009 16:28:29 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53GSTx3059889; Wed, 3 Jun 2009 16:28:29 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53GSTWV059888; Wed, 3 Jun 2009 16:28:29 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200906031628.n53GSTWV059888@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 3 Jun 2009 16:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193387 - head/sys/boot/uboot/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 16:28:29 -0000 Author: raj Date: Wed Jun 3 16:28:29 2009 New Revision: 193387 URL: http://svn.freebsd.org/changeset/base/193387 Log: Make GPT style partitiong endian-safe in U-Boot support library. Submitted by: Piotr Ziecik Obtained from: Semihalf Modified: head/sys/boot/uboot/lib/disk.c Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Wed Jun 3 16:11:27 2009 (r193386) +++ head/sys/boot/uboot/lib/disk.c Wed Jun 3 16:28:29 2009 (r193387) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -122,6 +123,15 @@ struct devsw uboot_storage = { stor_print }; +static void +uuid_letoh(uuid_t *uuid) +{ + + uuid->time_low = le32toh(uuid->time_low); + uuid->time_mid = le16toh(uuid->time_mid); + uuid->time_hi_and_version = le16toh(uuid->time_hi_and_version); +} + static int stor_init(void) { @@ -251,7 +261,7 @@ stor_open_gpt(struct open_dev *od, struc } /* Check the slice table magic. */ - if (*((uint16_t *)(buf + DOSMAGICOFFSET)) != DOSMAGIC) { + if (le16toh(*((uint16_t *)(buf + DOSMAGICOFFSET))) != DOSMAGIC) { err = ENXIO; goto out; } @@ -286,9 +296,10 @@ stor_open_gpt(struct open_dev *od, struc /* Check GPT header */ if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || - hdr->hdr_lba_self != 1 || hdr->hdr_revision < 0x00010000 || - hdr->hdr_entsz < sizeof(*ent) || - od->od_bsize % hdr->hdr_entsz != 0) { + le64toh(hdr->hdr_lba_self) != 1 || + le32toh(hdr->hdr_revision) < 0x00010000 || + le32toh(hdr->hdr_entsz) < sizeof(*ent) || + od->od_bsize % le32toh(hdr->hdr_entsz) != 0) { debugf("Invalid GPT header!\n"); err = EINVAL; goto out; @@ -296,9 +307,9 @@ stor_open_gpt(struct open_dev *od, struc /* Count number of valid partitions */ part = 0; - eps = od->od_bsize / hdr->hdr_entsz; - slba = hdr->hdr_lba_table; - elba = slba + hdr->hdr_entries / eps; + eps = od->od_bsize / le32toh(hdr->hdr_entsz); + slba = le64toh(hdr->hdr_lba_table); + elba = slba + le32toh(hdr->hdr_entries) / eps; for (lba = slba; lba < elba; lba++) { err = stor_readdev(dev, lba, 1, buf); @@ -312,8 +323,9 @@ stor_open_gpt(struct open_dev *od, struc for (i = 0; i < eps; i++) { if (uuid_is_nil(&ent[i].ent_type, NULL) || - ent[i].ent_lba_start == 0 || - ent[i].ent_lba_end < ent[i].ent_lba_start) + le64toh(ent[i].ent_lba_start) == 0 || + le64toh(ent[i].ent_lba_end) < + le64toh(ent[i].ent_lba_start)) continue; part += 1; @@ -343,8 +355,9 @@ stor_open_gpt(struct open_dev *od, struc for (i = 0; i < eps; i++) { if (uuid_is_nil(&ent[i].ent_type, NULL) || - ent[i].ent_lba_start == 0 || - ent[i].ent_lba_end < ent[i].ent_lba_start) + le64toh(ent[i].ent_lba_start) == 0 || + le64toh(ent[i].ent_lba_end) < + le64toh(ent[i].ent_lba_start)) continue; od->od_partitions[part].gp_index = (lba - slba) @@ -352,9 +365,11 @@ stor_open_gpt(struct open_dev *od, struc od->od_partitions[part].gp_type = ent[i].ent_type; od->od_partitions[part].gp_start = - ent[i].ent_lba_start; + le64toh(ent[i].ent_lba_start); od->od_partitions[part].gp_end = - ent[i].ent_lba_end; + le64toh(ent[i].ent_lba_end); + + uuid_letoh(&od->od_partitions[part].gp_type); part += 1; } } From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 17:06:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E586106564A; Wed, 3 Jun 2009 17:06:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 832A28FC1B; Wed, 3 Jun 2009 17:06:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-151-9.carlnfd1.nsw.optusnet.com.au [122.106.151.9]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n53H6rTR005466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Jun 2009 03:06:55 +1000 Date: Thu, 4 Jun 2009 03:06:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Stanislav Sedov In-Reply-To: <200906031325.n53DPo2W055626@svn.freebsd.org> Message-ID: <20090604030639.U1181@besplex.bde.org> References: <200906031325.n53DPo2W055626@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193377 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 17:06:58 -0000 On Wed, 3 Jun 2009, Stanislav Sedov wrote: > Log: > - Sync our copies of ext2fs Linux headers to current Linux versions. > Minimize differencies between our ext2fs headers and relevant Linux > versions by using EXT2_SB macro to access the superblock fields. Most > of the differencies in access to these fields are now hidden inside > this macro. > - Rename the s_db_per_group field of ext2fs_sb_info to s_gdb_count > to reflect the similar change in Linux headers. New name also seem > to be more appropriate for this field. > - Use proper types for s_first_inode and s_inode_size in-core superblock > fields. Now they reflec types used in the on-disk superblock version. > - Add support for older filesystem revisions that doesn't have proper > s_first_ino and s_inode_size fields in the on-disk superblock. In these > cases predefined values for these fields are used. > - Add simple sanity checks for s_first_inode and s_inode_size correctness. > > Reviewed by: bde (previous version) > MFC after: 2 weeks Thanks. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 17:19:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA0131065672; Wed, 3 Jun 2009 17:19:12 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D89208FC0A; Wed, 3 Jun 2009 17:19:12 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53HJCXw061027; Wed, 3 Jun 2009 17:19:12 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53HJCm1061026; Wed, 3 Jun 2009 17:19:12 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200906031719.n53HJCm1061026@svn.freebsd.org> From: Joseph Koshy Date: Wed, 3 Jun 2009 17:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193388 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 17:19:13 -0000 Author: jkoshy Date: Wed Jun 3 17:19:12 2009 New Revision: 193388 URL: http://svn.freebsd.org/changeset/base/193388 Log: Trim an obsolete comment. Noticed by: lifengkai Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Wed Jun 3 16:28:29 2009 (r193387) +++ head/sys/sys/pmc.h Wed Jun 3 17:19:12 2009 (r193388) @@ -709,11 +709,6 @@ struct pmc { * array. The size of this structure is thus PMC architecture * dependent. * - * TODO: Only process-private counting mode PMCs may be attached to a - * process different from the allocator process (since we do not have - * the infrastructure to make sense of an interrupted PC value from a - * 'target' process (yet)). - * */ struct pmc_targetstate { From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 17:25:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5067F106564A; Wed, 3 Jun 2009 17:25:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F5968FC22; Wed, 3 Jun 2009 17:25:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53HPK3Y061197; Wed, 3 Jun 2009 17:25:20 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53HPKUa061196; Wed, 3 Jun 2009 17:25:20 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906031725.n53HPKUa061196@svn.freebsd.org> From: Sam Leffler Date: Wed, 3 Jun 2009 17:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193389 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 17:25:20 -0000 Author: sam Date: Wed Jun 3 17:25:19 2009 New Revision: 193389 URL: http://svn.freebsd.org/changeset/base/193389 Log: treat IEEE80211_S_CSA as a "running state"; this fixes ap mode 11h channel switch announcements Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Jun 3 17:19:12 2009 (r193388) +++ head/sys/dev/ath/if_ath.c Wed Jun 3 17:25:19 2009 (r193389) @@ -2802,7 +2802,7 @@ ath_beacon_proc(void *arg, int pending) slot = ((tsftu % ic->ic_lintval) * ATH_BCBUF) / ic->ic_lintval; vap = sc->sc_bslot[(slot+1) % ATH_BCBUF]; bfaddr = 0; - if (vap != NULL && vap->iv_state == IEEE80211_S_RUN) { + if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { bf = ath_beacon_generate(sc, vap); if (bf != NULL) bfaddr = bf->bf_daddr; @@ -2812,7 +2812,7 @@ ath_beacon_proc(void *arg, int pending) for (slot = 0; slot < ATH_BCBUF; slot++) { vap = sc->sc_bslot[slot]; - if (vap != NULL && vap->iv_state == IEEE80211_S_RUN) { + if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { bf = ath_beacon_generate(sc, vap); if (bf != NULL) { *bflink = bf->bf_daddr; @@ -2878,7 +2878,7 @@ ath_beacon_generate(struct ath_softc *sc struct mbuf *m; int nmcastq, error; - KASSERT(vap->iv_state == IEEE80211_S_RUN, + KASSERT(vap->iv_state >= IEEE80211_S_RUN, ("not running, state %d", vap->iv_state)); KASSERT(avp->av_bcbuf != NULL, ("no beacon buffer")); @@ -5506,7 +5506,7 @@ ath_isanyrunningvaps(struct ieee80211vap IEEE80211_LOCK_ASSERT(ic); TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { - if (vap != this && vap->iv_state == IEEE80211_S_RUN) + if (vap != this && vap->iv_state >= IEEE80211_S_RUN) return 1; } return 0; From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 17:30:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE2521065673; Wed, 3 Jun 2009 17:30:10 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2C8D8FC1A; Wed, 3 Jun 2009 17:30:10 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53HUA4F061317; Wed, 3 Jun 2009 17:30:10 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53HUAdK061316; Wed, 3 Jun 2009 17:30:10 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200906031730.n53HUAdK061316@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 3 Jun 2009 17:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193390 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 17:30:11 -0000 Author: stas Date: Wed Jun 3 17:30:10 2009 New Revision: 193390 URL: http://svn.freebsd.org/changeset/base/193390 Log: - Remove unused sparc64-bitops.h file. Our ext2fs code doesn't use sparc64-specific bitops implemetations and relies on generic ones. Furthermore, bitops implementations present in sparc64-bitops.h are written in C similarly to generic bitops. Deleted: head/sys/gnu/fs/ext2fs/sparc64-bitops.h From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 17:43:24 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 4B6AA1065673; Wed, 3 Jun 2009 17:43:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Wed, 3 Jun 2009 13:43:11 -0400 User-Agent: KMail/1.6.2 References: <200906021235.n52CZ4BF015807@svn.freebsd.org> In-Reply-To: <200906021235.n52CZ4BF015807@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200906031343.13661.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, John Baldwin Subject: Re: svn commit: r193306 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 17:43:25 -0000 On Tuesday 02 June 2009 08:35 am, John Baldwin wrote: > Author: jhb > Date: Tue Jun 2 12:35:04 2009 > New Revision: 193306 > URL: http://svn.freebsd.org/changeset/base/193306 > > Log: > Include for va_*(). I'm not sure how this > compiled on amd64 without this. I am working on importing ACPICA 20090521 and bitten by this because the project tree was copied before this change. :-( Basically, what's happening was: #ifdef __HAVE_ACPI ... #include ... #include ... #include ... #ifdef _KERNEL ... #include Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 18:46:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 799A01065672; Wed, 3 Jun 2009 18:46:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 658108FC1C; Wed, 3 Jun 2009 18:46:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53IkTEW062888; Wed, 3 Jun 2009 18:46:29 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53IkS42062877; Wed, 3 Jun 2009 18:46:28 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906031846.n53IkS42062877@svn.freebsd.org> From: Robert Watson Date: Wed, 3 Jun 2009 18:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193391 - in head/sys: netinet security/mac security/mac_biba security/mac_lomac security/mac_mls security/mac_stub security/mac_test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 18:46:30 -0000 Author: rwatson Date: Wed Jun 3 18:46:28 2009 New Revision: 193391 URL: http://svn.freebsd.org/changeset/base/193391 Log: Continue work to optimize performance of "options MAC" when no MAC policy modules are loaded by avoiding mbuf label lookups when policies aren't loaded, pushing further socket locking into MAC policy modules, and avoiding locking MAC ifnet locks when no policies are loaded: - Check mac_policies_count before looking for mbuf MAC label m_tags in MAC Framework entry points. We will still pay label lookup costs if MAC policies are present but don't require labels (typically a single mbuf header field read, but perhaps further indirection if IPSEC or other m_tag consumers are in use). - Further push socket locking for socket-related access control checks and events into MAC policies from the MAC Framework, so that sockets are only locked if a policy specifically requires a lock to protect a label. This resolves lock order issues during sonewconn() and also in local domain socket cross-connect where multiple socket locks could not be held at once for the purposes of propagatig MAC labels across multiple sockets. Eliminate mac_policy_count check in some entry points where it no longer avoids locking. - Add mac_policy_count checking in some entry points relating to network interfaces that otherwise lock a global MAC ifnet lock used to protect ifnet labels. Obtained from: TrustedBSD Project Modified: head/sys/netinet/in_pcb.c head/sys/security/mac/mac_atalk.c head/sys/security/mac/mac_inet.c head/sys/security/mac/mac_inet6.c head/sys/security/mac/mac_net.c head/sys/security/mac/mac_socket.c head/sys/security/mac_biba/mac_biba.c head/sys/security/mac_lomac/mac_lomac.c head/sys/security/mac_mls/mac_mls.c head/sys/security/mac_stub/mac_stub.c head/sys/security/mac_test/mac_test.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/netinet/in_pcb.c Wed Jun 3 18:46:28 2009 (r193391) @@ -212,9 +212,7 @@ in_pcballoc(struct socket *so, struct in error = mac_inpcb_init(inp, M_NOWAIT); if (error != 0) goto out; - SOCK_LOCK(so); mac_inpcb_create(so, inp); - SOCK_UNLOCK(so); #endif #ifdef IPSEC error = ipsec_init_policy(so, &inp->inp_sp); Modified: head/sys/security/mac/mac_atalk.c ============================================================================== --- head/sys/security/mac/mac_atalk.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac/mac_atalk.c Wed Jun 3 18:46:28 2009 (r193391) @@ -61,6 +61,9 @@ mac_netatalk_aarp_send(struct ifnet *ifp { struct label *mlabel; + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_IFNET_LOCK(ifp); Modified: head/sys/security/mac/mac_inet.c ============================================================================== --- head/sys/security/mac/mac_inet.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac/mac_inet.c Wed Jun 3 18:46:28 2009 (r193391) @@ -193,6 +193,9 @@ mac_ipq_reassemble(struct ipq *q, struct { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ipq_reassemble, q, q->ipq_label, m, @@ -204,6 +207,9 @@ mac_netinet_fragment(struct mbuf *m, str { struct label *mlabel, *fraglabel; + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); fraglabel = mac_mbuf_to_label(frag); @@ -216,6 +222,9 @@ mac_ipq_create(struct mbuf *m, struct ip { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ipq_create, m, label, q, q->ipq_label); @@ -227,6 +236,10 @@ mac_inpcb_create_mbuf(struct inpcb *inp, struct label *mlabel; INP_LOCK_ASSERT(inp); + + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(inpcb_create_mbuf, inp, inp->inp_label, m, @@ -239,6 +252,9 @@ mac_ipq_match(struct mbuf *m, struct ipq struct label *label; int result; + if (mac_policy_count == 0) + return (1); + label = mac_mbuf_to_label(m); result = 1; @@ -252,6 +268,9 @@ mac_netinet_arp_send(struct ifnet *ifp, { struct label *mlabel; + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_IFNET_LOCK(ifp); @@ -265,6 +284,9 @@ mac_netinet_icmp_reply(struct mbuf *mrec { struct label *mrecvlabel, *msendlabel; + if (mac_policy_count == 0) + return; + mrecvlabel = mac_mbuf_to_label(mrecv); msendlabel = mac_mbuf_to_label(msend); @@ -277,6 +299,9 @@ mac_netinet_icmp_replyinplace(struct mbu { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(netinet_icmp_replyinplace, m, label); @@ -287,6 +312,9 @@ mac_netinet_igmp_send(struct ifnet *ifp, { struct label *mlabel; + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_IFNET_LOCK(ifp); @@ -300,6 +328,9 @@ mac_netinet_tcp_reply(struct mbuf *m) { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(netinet_tcp_reply, m, label); @@ -310,6 +341,9 @@ mac_ipq_update(struct mbuf *m, struct ip { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ipq_update, m, label, q, q->ipq_label); @@ -326,6 +360,9 @@ mac_inpcb_check_deliver(struct inpcb *in M_ASSERTPKTHDR(m); + if (mac_policy_count == 0) + return (0); + label = mac_mbuf_to_label(m); MAC_POLICY_CHECK_NOSLEEP(inpcb_check_deliver, inp, inp->inp_label, m, @@ -371,6 +408,9 @@ mac_netinet_firewall_reply(struct mbuf * M_ASSERTPKTHDR(mrecv); M_ASSERTPKTHDR(msend); + if (mac_policy_count == 0) + return; + mrecvlabel = mac_mbuf_to_label(mrecv); msendlabel = mac_mbuf_to_label(msend); @@ -385,6 +425,9 @@ mac_netinet_firewall_send(struct mbuf *m M_ASSERTPKTHDR(m); + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(netinet_firewall_send, m, label); @@ -455,6 +498,9 @@ mac_syncache_create_mbuf(struct label *s M_ASSERTPKTHDR(m); + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(syncache_create_mbuf, sc_label, m, Modified: head/sys/security/mac/mac_inet6.c ============================================================================== --- head/sys/security/mac/mac_inet6.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac/mac_inet6.c Wed Jun 3 18:46:28 2009 (r193391) @@ -118,6 +118,9 @@ mac_ip6q_reassemble(struct ip6q *q6, str { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ip6q_reassemble, q6, q6->ip6q_label, m, @@ -129,6 +132,9 @@ mac_ip6q_create(struct mbuf *m, struct i { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ip6q_create, m, label, q6, @@ -141,6 +147,9 @@ mac_ip6q_match(struct mbuf *m, struct ip struct label *label; int result; + if (mac_policy_count == 0) + return (1); + label = mac_mbuf_to_label(m); result = 1; @@ -155,6 +164,9 @@ mac_ip6q_update(struct mbuf *m, struct i { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ip6q_update, m, label, q6, @@ -166,6 +178,9 @@ mac_netinet6_nd6_send(struct ifnet *ifp, { struct label *mlabel; + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(netinet6_nd6_send, ifp, ifp->if_label, m, Modified: head/sys/security/mac/mac_net.c ============================================================================== --- head/sys/security/mac/mac_net.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac/mac_net.c Wed Jun 3 18:46:28 2009 (r193391) @@ -296,6 +296,9 @@ void mac_ifnet_create(struct ifnet *ifp) { + if (mac_policy_count == 0) + return; + MAC_IFNET_LOCK(ifp); MAC_POLICY_PERFORM_NOSLEEP(ifnet_create, ifp, ifp->if_label); MAC_IFNET_UNLOCK(ifp); @@ -315,6 +318,9 @@ mac_bpfdesc_create_mbuf(struct bpf_d *d, BPFD_LOCK_ASSERT(d); + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(bpfdesc_create_mbuf, d, d->bd_label, m, @@ -326,6 +332,9 @@ mac_ifnet_create_mbuf(struct ifnet *ifp, { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_IFNET_LOCK(ifp); @@ -344,6 +353,9 @@ mac_bpfdesc_check_receive(struct bpf_d * BPFD_LOCK_ASSERT(d); + if (mac_policy_count == 0) + return (0); + MAC_IFNET_LOCK(ifp); MAC_POLICY_CHECK_NOSLEEP(bpfdesc_check_receive, d, d->bd_label, ifp, ifp->if_label); @@ -364,6 +376,9 @@ mac_ifnet_check_transmit(struct ifnet *i M_ASSERTPKTHDR(m); + if (mac_policy_count == 0) + return (0); + label = mac_mbuf_to_label(m); MAC_IFNET_LOCK(ifp); Modified: head/sys/security/mac/mac_socket.c ============================================================================== --- head/sys/security/mac/mac_socket.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac/mac_socket.c Wed Jun 3 18:46:28 2009 (r193391) @@ -88,6 +88,16 @@ __FBSDID("$FreeBSD$"); * remote socket for UNIX domain sockets rather than keeping a local copy on * this endpoint, but be cached and updated based on packets received for * TCP/IP. + * + * Unlike with many other object types, the lock protecting MAC labels on + * sockets (the socket lock) is not frequently held at the points in code + * where socket-related checks are called. The MAC Framework acquires the + * lock over some entry points in order to enforce atomicity (such as label + * copies) but in other cases the policy modules will have to acquire the + * lock themselves if they use labels. This approach (a) avoids lock + * acquisitions when policies don't require labels and (b) solves a number of + * potential lock order issues when multiple sockets are used in the same + * entry point. */ struct label * @@ -234,13 +244,8 @@ void mac_socket_newconn(struct socket *oldso, struct socket *newso) { - if (mac_policy_count == 0) - return; - - SOCK_LOCK(oldso); MAC_POLICY_PERFORM_NOSLEEP(socket_newconn, oldso, oldso->so_label, newso, newso->so_label); - SOCK_UNLOCK(oldso); } static void @@ -259,12 +264,13 @@ mac_socketpeer_set_from_mbuf(struct mbuf { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); - SOCK_LOCK(so); MAC_POLICY_PERFORM_NOSLEEP(socketpeer_set_from_mbuf, m, label, so, so->so_peerlabel); - SOCK_UNLOCK(so); } void @@ -274,15 +280,8 @@ mac_socketpeer_set_from_socket(struct so if (mac_policy_count == 0) return; - /* - * XXXRW: We want to hold locks on both sockets, but can't currently - * due to lock order -- opt to lock the socket where we're accessing - * so_label as it's more likely to change. - */ - SOCK_LOCK(oldso); MAC_POLICY_PERFORM_NOSLEEP(socketpeer_set_from_socket, oldso, oldso->so_label, newso, newso->so_peerlabel); - SOCK_UNLOCK(oldso); } void @@ -295,10 +294,8 @@ mac_socket_create_mbuf(struct socket *so label = mac_mbuf_to_label(m); - SOCK_LOCK(so); MAC_POLICY_PERFORM_NOSLEEP(socket_create_mbuf, so, so->so_label, m, label); - SOCK_UNLOCK(so); } MAC_CHECK_PROBE_DEFINE2(socket_check_accept, "struct ucred *", @@ -309,14 +306,9 @@ mac_socket_check_accept(struct ucred *cr { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_accept, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_accept, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -330,14 +322,9 @@ mac_socket_check_bind(struct ucred *cred { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_bind, cred, so, so->so_label, sa); MAC_CHECK_PROBE3(socket_check_bind, error, cred, so, sa); - SOCK_UNLOCK(so); return (error); } @@ -351,14 +338,9 @@ mac_socket_check_connect(struct ucred *c { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_connect, cred, so, so->so_label, sa); MAC_CHECK_PROBE3(socket_check_connect, error, cred, so, sa); - SOCK_UNLOCK(so); return (error); } @@ -393,11 +375,9 @@ mac_socket_check_deliver(struct socket * label = mac_mbuf_to_label(m); - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_deliver, so, so->so_label, m, label); MAC_CHECK_PROBE2(socket_check_deliver, error, so, m); - SOCK_UNLOCK(so); return (error); } @@ -410,14 +390,9 @@ mac_socket_check_listen(struct ucred *cr { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_listen, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_listen, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -430,13 +405,8 @@ mac_socket_check_poll(struct ucred *cred { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_poll, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_poll, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -449,14 +419,9 @@ mac_socket_check_receive(struct ucred *c { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_receive, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_receive, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -487,13 +452,8 @@ mac_socket_check_send(struct ucred *cred { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_send, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_send, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -506,13 +466,8 @@ mac_socket_check_stat(struct ucred *cred { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_stat, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_stat, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -525,14 +480,9 @@ mac_socket_check_visible(struct ucred *c { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_visible, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_visible, error, cred, so); - SOCK_UNLOCK(so); return (error); } Modified: head/sys/security/mac_biba/mac_biba.c ============================================================================== --- head/sys/security/mac_biba/mac_biba.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac_biba/mac_biba.c Wed Jun 3 18:46:28 2009 (r193391) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2007-2008 Robert N. M. Watson + * Copyright (c) 1999-2002, 2007-2009 Robert N. M. Watson * Copyright (c) 2001-2005 McAfee, Inc. * Copyright (c) 2006 SPARTA, Inc. * All rights reserved. @@ -1177,7 +1177,9 @@ biba_inpcb_create(struct socket *so, str source = SLOT(solabel); dest = SLOT(inplabel); + SOCK_LOCK(so); biba_copy_effective(source, dest); + SOCK_UNLOCK(so); } static void @@ -1198,6 +1200,8 @@ biba_inpcb_sosetlabel(struct socket *so, { struct mac_biba *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(solabel); dest = SLOT(inplabel); @@ -1918,6 +1922,7 @@ biba_socket_check_deliver(struct socket struct mbuf *m, struct label *mlabel) { struct mac_biba *p, *s; + int error; if (!biba_enabled) return (0); @@ -1925,7 +1930,10 @@ biba_socket_check_deliver(struct socket p = SLOT(mlabel); s = SLOT(solabel); - return (biba_equal_effective(p, s) ? 0 : EACCES); + SOCK_LOCK(so); + error = biba_equal_effective(p, s) ? 0 : EACCES; + SOCK_UNLOCK(so); + return (error); } static int @@ -1935,6 +1943,8 @@ biba_socket_check_relabel(struct ucred * struct mac_biba *subj, *obj, *new; int error; + SOCK_LOCK_ASSERT(so); + new = SLOT(newlabel); subj = SLOT(cred->cr_label); obj = SLOT(solabel); @@ -1991,8 +2001,12 @@ biba_socket_check_visible(struct ucred * subj = SLOT(cred->cr_label); obj = SLOT(solabel); - if (!biba_dominate_effective(obj, subj)) + SOCK_LOCK(so); + if (!biba_dominate_effective(obj, subj)) { + SOCK_UNLOCK(so); return (ENOENT); + } + SOCK_UNLOCK(so); return (0); } @@ -2018,19 +2032,26 @@ biba_socket_create_mbuf(struct socket *s source = SLOT(solabel); dest = SLOT(mlabel); + SOCK_LOCK(so); biba_copy_effective(source, dest); + SOCK_UNLOCK(so); } static void biba_socket_newconn(struct socket *oldso, struct label *oldsolabel, struct socket *newso, struct label *newsolabel) { - struct mac_biba *source, *dest; + struct mac_biba source, *dest; + + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); - source = SLOT(oldsolabel); dest = SLOT(newsolabel); - biba_copy_effective(source, dest); + SOCK_LOCK(newso); + biba_copy_effective(&source, dest); + SOCK_UNLOCK(newso); } static void @@ -2039,6 +2060,8 @@ biba_socket_relabel(struct ucred *cred, { struct mac_biba *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(newlabel); dest = SLOT(solabel); @@ -2054,7 +2077,9 @@ biba_socketpeer_set_from_mbuf(struct mbu source = SLOT(mlabel); dest = SLOT(sopeerlabel); + SOCK_LOCK(so); biba_copy_effective(source, dest); + SOCK_UNLOCK(so); } static void @@ -2062,12 +2087,16 @@ biba_socketpeer_set_from_socket(struct s struct label *oldsolabel, struct socket *newso, struct label *newsopeerlabel) { - struct mac_biba *source, *dest; + struct mac_biba source, *dest; - source = SLOT(oldsolabel); + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); dest = SLOT(newsopeerlabel); - biba_copy_effective(source, dest); + SOCK_LOCK(newso); + biba_copy_effective(&source, dest); + SOCK_UNLOCK(newso); } static void Modified: head/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- head/sys/security/mac_lomac/mac_lomac.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac_lomac/mac_lomac.c Wed Jun 3 18:46:28 2009 (r193391) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2007-2008 Robert N. M. Watson + * Copyright (c) 1999-2002, 2007-2009 Robert N. M. Watson * Copyright (c) 2001-2005 Networks Associates Technology, Inc. * Copyright (c) 2006 SPARTA, Inc. * All rights reserved. @@ -1315,6 +1315,8 @@ lomac_inpcb_sosetlabel(struct socket *so { struct mac_lomac *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(solabel); dest = SLOT(inplabel); @@ -1930,6 +1932,7 @@ lomac_socket_check_deliver(struct socket struct mbuf *m, struct label *mlabel) { struct mac_lomac *p, *s; + int error; if (!lomac_enabled) return (0); @@ -1937,7 +1940,10 @@ lomac_socket_check_deliver(struct socket p = SLOT(mlabel); s = SLOT(solabel); - return (lomac_equal_single(p, s) ? 0 : EACCES); + SOCK_LOCK(so); + error = lomac_equal_single(p, s) ? 0 : EACCES; + SOCK_UNLOCK(so); + return (error); } static int @@ -1947,6 +1953,8 @@ lomac_socket_check_relabel(struct ucred struct mac_lomac *subj, *obj, *new; int error; + SOCK_LOCK_ASSERT(so); + new = SLOT(newlabel); subj = SLOT(cred->cr_label); obj = SLOT(solabel); @@ -2003,8 +2011,12 @@ lomac_socket_check_visible(struct ucred subj = SLOT(cred->cr_label); obj = SLOT(solabel); - if (!lomac_dominate_single(obj, subj)) + SOCK_LOCK(so); + if (!lomac_dominate_single(obj, subj)) { + SOCK_UNLOCK(so); return (ENOENT); + } + SOCK_UNLOCK(so); return (0); } @@ -2030,19 +2042,26 @@ lomac_socket_create_mbuf(struct socket * source = SLOT(solabel); dest = SLOT(mlabel); + SOCK_LOCK(so); lomac_copy_single(source, dest); + SOCK_UNLOCK(so); } static void lomac_socket_newconn(struct socket *oldso, struct label *oldsolabel, struct socket *newso, struct label *newsolabel) { - struct mac_lomac *source, *dest; + struct mac_lomac source, *dest; + + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); - source = SLOT(oldsolabel); dest = SLOT(newsolabel); - lomac_copy_single(source, dest); + SOCK_LOCK(newso); + lomac_copy_single(&source, dest); + SOCK_UNLOCK(newso); } static void @@ -2051,6 +2070,8 @@ lomac_socket_relabel(struct ucred *cred, { struct mac_lomac *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(newlabel); dest = SLOT(solabel); @@ -2066,7 +2087,9 @@ lomac_socketpeer_set_from_mbuf(struct mb source = SLOT(mlabel); dest = SLOT(sopeerlabel); + SOCK_LOCK(so); lomac_copy_single(source, dest); + SOCK_UNLOCK(so); } static void @@ -2074,12 +2097,17 @@ lomac_socketpeer_set_from_socket(struct struct label *oldsolabel, struct socket *newso, struct label *newsopeerlabel) { - struct mac_lomac *source, *dest; + struct mac_lomac source, *dest; + + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); - source = SLOT(oldsolabel); dest = SLOT(newsopeerlabel); - lomac_copy_single(source, dest); + SOCK_LOCK(newso); + lomac_copy_single(&source, dest); + SOCK_UNLOCK(newso); } static void Modified: head/sys/security/mac_mls/mac_mls.c ============================================================================== --- head/sys/security/mac_mls/mac_mls.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac_mls/mac_mls.c Wed Jun 3 18:46:28 2009 (r193391) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2007-2008 Robert N. M. Watson + * Copyright (c) 1999-2002, 2007-2009 Robert N. M. Watson * Copyright (c) 2001-2005 McAfee, Inc. * Copyright (c) 2006 SPARTA, Inc. * All rights reserved. @@ -1116,6 +1116,8 @@ mls_inpcb_sosetlabel(struct socket *so, { struct mac_mls *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(solabel); dest = SLOT(inplabel); @@ -1623,6 +1625,7 @@ mls_socket_check_deliver(struct socket * struct mbuf *m, struct label *mlabel) { struct mac_mls *p, *s; + int error; if (!mls_enabled) return (0); @@ -1630,7 +1633,11 @@ mls_socket_check_deliver(struct socket * p = SLOT(mlabel); s = SLOT(solabel); - return (mls_equal_effective(p, s) ? 0 : EACCES); + SOCK_LOCK(so); + error = mls_equal_effective(p, s) ? 0 : EACCES; + SOCK_UNLOCK(so); + + return (error); } static int @@ -1640,6 +1647,8 @@ mls_socket_check_relabel(struct ucred *c struct mac_mls *subj, *obj, *new; int error; + SOCK_LOCK_ASSERT(so); + new = SLOT(newlabel); subj = SLOT(cred->cr_label); obj = SLOT(solabel); @@ -1696,8 +1705,12 @@ mls_socket_check_visible(struct ucred *c subj = SLOT(cred->cr_label); obj = SLOT(solabel); - if (!mls_dominate_effective(subj, obj)) + SOCK_LOCK(so); + if (!mls_dominate_effective(subj, obj)) { + SOCK_UNLOCK(so); return (ENOENT); + } + SOCK_UNLOCK(so); return (0); } @@ -1723,19 +1736,26 @@ mls_socket_create_mbuf(struct socket *so source = SLOT(solabel); dest = SLOT(mlabel); + SOCK_LOCK(so); mls_copy_effective(source, dest); + SOCK_UNLOCK(so); } static void mls_socket_newconn(struct socket *oldso, struct label *oldsolabel, struct socket *newso, struct label *newsolabel) { - struct mac_mls *source, *dest; + struct mac_mls source, *dest; + + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); - source = SLOT(oldsolabel); dest = SLOT(newsolabel); - mls_copy_effective(source, dest); + SOCK_LOCK(newso); + mls_copy_effective(&source, dest); + SOCK_UNLOCK(newso); } static void @@ -1744,6 +1764,8 @@ mls_socket_relabel(struct ucred *cred, s { struct mac_mls *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(newlabel); dest = SLOT(solabel); @@ -1759,7 +1781,9 @@ mls_socketpeer_set_from_mbuf(struct mbuf source = SLOT(mlabel); dest = SLOT(sopeerlabel); + SOCK_LOCK(so); mls_copy_effective(source, dest); + SOCK_UNLOCK(so); } static void @@ -1767,12 +1791,17 @@ mls_socketpeer_set_from_socket(struct so struct label *oldsolabel, struct socket *newso, struct label *newsopeerlabel) { - struct mac_mls *source, *dest; + struct mac_mls source, *dest; + + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); - source = SLOT(oldsolabel); dest = SLOT(newsopeerlabel); - mls_copy_effective(source, dest); + SOCK_LOCK(newso); + mls_copy_effective(&source, dest); + SOCK_UNLOCK(newso); } static void Modified: head/sys/security/mac_stub/mac_stub.c ============================================================================== --- head/sys/security/mac_stub/mac_stub.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac_stub/mac_stub.c Wed Jun 3 18:46:28 2009 (r193391) @@ -413,6 +413,8 @@ stub_inpcb_sosetlabel(struct socket *so, struct inpcb *inp, struct label *inplabel) { + SOCK_LOCK_ASSERT(so); + } static void @@ -809,6 +811,11 @@ stub_socket_check_accept(struct ucred *c struct label *solabel) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -817,6 +824,11 @@ stub_socket_check_bind(struct ucred *cre struct label *solabel, struct sockaddr *sa) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -825,6 +837,11 @@ stub_socket_check_connect(struct ucred * struct label *solabel, struct sockaddr *sa) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -840,6 +857,11 @@ stub_socket_check_deliver(struct socket struct mbuf *m, struct label *mlabel) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -848,6 +870,11 @@ stub_socket_check_listen(struct ucred *c struct label *solabel) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -856,6 +883,11 @@ stub_socket_check_poll(struct ucred *cre struct label *solabel) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -864,6 +896,11 @@ stub_socket_check_receive(struct ucred * struct label *solabel) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -872,6 +909,8 @@ stub_socket_check_relabel(struct ucred * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 19:31:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16D36106566B; Wed, 3 Jun 2009 19:31:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 058CA8FC1D; Wed, 3 Jun 2009 19:31:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53JVQOd063872; Wed, 3 Jun 2009 19:31:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53JVQhG063871; Wed, 3 Jun 2009 19:31:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200906031931.n53JVQhG063871@svn.freebsd.org> From: Marius Strobl Date: Wed, 3 Jun 2009 19:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193392 - head/sys/sun4v/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 19:31:27 -0000 Author: marius Date: Wed Jun 3 19:31:26 2009 New Revision: 193392 URL: http://svn.freebsd.org/changeset/base/193392 Log: Adjust the padding of struct pcpu to r193219. Submitted by: Eygene Ryabinkin Modified: head/sys/sun4v/include/pcpu.h Modified: head/sys/sun4v/include/pcpu.h ============================================================================== --- head/sys/sun4v/include/pcpu.h Wed Jun 3 18:46:28 2009 (r193391) +++ head/sys/sun4v/include/pcpu.h Wed Jun 3 19:31:26 2009 (r193392) @@ -39,9 +39,9 @@ struct pmap; #ifdef KTR -#define PCPU_MD_FIELDS_PAD (4 - (PCPU_NAME_LEN + 7) / 8) +#define PCPU_MD_FIELDS_PAD (3 - (PCPU_NAME_LEN + 7) / 8) #else -#define PCPU_MD_FIELDS_PAD 4 +#define PCPU_MD_FIELDS_PAD 3 #endif /* From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 19:41:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8DC1065672; Wed, 3 Jun 2009 19:41:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D0718FC2C; Wed, 3 Jun 2009 19:41:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53JfDNt064283; Wed, 3 Jun 2009 19:41:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53JfDS1064282; Wed, 3 Jun 2009 19:41:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906031941.n53JfDS1064282@svn.freebsd.org> From: Robert Watson Date: Wed, 3 Jun 2009 19:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193393 - head/sys/security/mac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 19:41:13 -0000 Author: rwatson Date: Wed Jun 3 19:41:12 2009 New Revision: 193393 URL: http://svn.freebsd.org/changeset/base/193393 Log: Add one further check with mac_policy_count to an mbuf copying case (limited to netatalk) to avoid MAC label lookup on both mbufs if no policies are registered. Obtained from: TrustedBSD Project Modified: head/sys/security/mac/mac_net.c Modified: head/sys/security/mac/mac_net.c ============================================================================== --- head/sys/security/mac/mac_net.c Wed Jun 3 19:31:26 2009 (r193392) +++ head/sys/security/mac/mac_net.c Wed Jun 3 19:41:12 2009 (r193393) @@ -258,6 +258,9 @@ mac_mbuf_copy(struct mbuf *m_from, struc { struct label *src_label, *dest_label; + if (mac_policy_count == 0) + return; + src_label = mac_mbuf_to_label(m_from); dest_label = mac_mbuf_to_label(m_to); From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 20:25:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5589C106564A; Wed, 3 Jun 2009 20:25:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 448898FC23; Wed, 3 Jun 2009 20:25:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53KPEr8065493; Wed, 3 Jun 2009 20:25:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53KPE5L065491; Wed, 3 Jun 2009 20:25:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906032025.n53KPE5L065491@svn.freebsd.org> From: John Baldwin Date: Wed, 3 Jun 2009 20:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193396 - head/sys/dev/iir X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 20:25:14 -0000 Author: jhb Date: Wed Jun 3 20:25:13 2009 New Revision: 193396 URL: http://svn.freebsd.org/changeset/base/193396 Log: Remove unused VM includes. Modified: head/sys/dev/iir/iir.c head/sys/dev/iir/iir_ctrl.c Modified: head/sys/dev/iir/iir.c ============================================================================== --- head/sys/dev/iir/iir.c Wed Jun 3 20:24:28 2009 (r193395) +++ head/sys/dev/iir/iir.c Wed Jun 3 20:25:13 2009 (r193396) @@ -67,9 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include MALLOC_DEFINE(M_GDTBUF, "iirbuf", "iir driver buffer"); Modified: head/sys/dev/iir/iir_ctrl.c ============================================================================== --- head/sys/dev/iir/iir_ctrl.c Wed Jun 3 20:24:28 2009 (r193395) +++ head/sys/dev/iir/iir_ctrl.c Wed Jun 3 20:25:13 2009 (r193396) @@ -52,10 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include #include From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 21:06:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 500B81065677; Wed, 3 Jun 2009 21:06:57 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206192061.chello.pl [87.206.192.61]) by mx1.freebsd.org (Postfix) with ESMTP id 967898FC19; Wed, 3 Jun 2009 21:06:56 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id BE92245C9C; Wed, 3 Jun 2009 23:06:54 +0200 (CEST) Received: from localhost (chello087206192061.chello.pl [87.206.192.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 5997E4569A; Wed, 3 Jun 2009 23:06:49 +0200 (CEST) Date: Wed, 3 Jun 2009 23:06:52 +0200 From: Pawel Jakub Dawidek To: Sean Nicholas Barkas Message-ID: <20090603210652.GD3821@garage.freebsd.pl> References: <200906030944.n539iM2K045164@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O5XBE6gyVG5Rl6Rj" Content-Disposition: inline In-Reply-To: <200906030944.n539iM2K045164@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193375 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 21:06:58 -0000 --O5XBE6gyVG5Rl6Rj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 03, 2009 at 09:44:22AM +0000, Sean Nicholas Barkas wrote: > Author: snb > Date: Wed Jun 3 09:44:22 2009 > New Revision: 193375 > URL: http://svn.freebsd.org/changeset/base/193375 >=20 > Log: > Add vm_lowmem event handler for dirhash. This will cause dirhashes to be > deleted when the system is low on memory. This ought to allow an increa= se to > vfs.ufs.dirhash_maxmem on machines that have lots of memory, without > degrading performance by having too much memory reserved for dirhash wh= en > other things need it. The default value for dirhash_maxmem is being kep= t at > 2MB for now, though. > =20 > This work was mostly done during the 2008 Google Summer of Code. > =20 > Approved by: dwmalone (mentor), re > MFC after: 3 months [...] > +static int > +ufsdirhash_destroy(struct dirhash *dh) > +{ [...] > + /* Remove it from the list and detach its memory. */ > + TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); [...] > +static void > +ufsdirhash_lowmem() > +{ [...] > + /*=20 > + * Delete dirhashes not used for more than ufs_dirhashreclaimage=20 > + * seconds. If we can't get a lock on the dirhash, it will be skipped. > + */ > + for (dh =3D TAILQ_FIRST(&ufsdirhash_list); dh !=3D NULL; dh =3D=20 > + TAILQ_NEXT(dh, dh_list)) { > + if (!sx_try_xlock(&dh->dh_lock)) > + continue; > + if (time_second - dh->dh_lastused > ufs_dirhashreclaimage) > + memfreed +=3D ufsdirhash_destroy(dh); > + /* Unlock if we didn't delete the dirhash */ > + else > + ufsdirhash_release(dh); > + } > + > + /*=20 > + * If not enough memory was freed, keep deleting hashes from the head= =20 > + * of the dirhash list. The ones closest to the head should be the=20 > + * oldest.=20 > + */ > + for (dh =3D TAILQ_FIRST(&ufsdirhash_list); memfreed < memwanted && > + dh !=3DNULL; dh =3D TAILQ_NEXT(dh, dh_list)) { > + if (!sx_try_xlock(&dh->dh_lock)) > + continue; > + memfreed +=3D ufsdirhash_destroy(dh); > + } > + DIRHASHLIST_UNLOCK(); > +} I don't see how that works. If you remove dh from the tailq in ufsdirhash_destroy(), you can't do 'dh =3D TAILQ_NEXT(dh, dh_list)' at the end of the loop. You should use TAILQ_FOREACH_SAFE(3). In the second case you also need to move this extra check into the loop, probably. In addition you drop DIRHASHLIST lock in ufsdirhash_destroy() during the loop. Can't the tailq be modified from elsewhere? Or even from parallel call to ufsdirhash_lowmem() (I don't think we serialize those)? --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --O5XBE6gyVG5Rl6Rj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKJuXrForvXbEpPzQRAmzyAKD0A66qjlntobqzZuTayARF3hjSPgCgnAIh 8xMU3V+3afLvKTb3KThI2GY= =LIJ2 -----END PGP SIGNATURE----- --O5XBE6gyVG5Rl6Rj-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 21:50:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84345106566C; Wed, 3 Jun 2009 21:50:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71C7D8FC17; Wed, 3 Jun 2009 21:50:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53LoQoq068068; Wed, 3 Jun 2009 21:50:26 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53LoQ50068067; Wed, 3 Jun 2009 21:50:26 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906032150.n53LoQ50068067@svn.freebsd.org> From: Rick Macklem Date: Wed, 3 Jun 2009 21:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193407 - head/usr.sbin/nfsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 21:50:27 -0000 Author: rmacklem Date: Wed Jun 3 21:50:26 2009 New Revision: 193407 URL: http://svn.freebsd.org/changeset/base/193407 Log: Re-format the nfsv4.4 man page so that all sentences start on a new line. Approved by: kib (mentor) Modified: head/usr.sbin/nfsd/nfsv4.4 Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Wed Jun 3 21:47:13 2009 (r193406) +++ head/usr.sbin/nfsd/nfsv4.4 Wed Jun 3 21:50:26 2009 (r193407) @@ -38,14 +38,16 @@ The experimental nfs client and server p specification; see .%T "Network File System (NFS) Version 4 Protocol \\*(tNRFC\\*(sP 3530" . The protocol is somewhat similar to NFS Version 3, but differs in significant -ways. It uses a single Compound RPC that concatenates operations to-gether. +ways. +It uses a single Compound RPC that concatenates operations to-gether. Each of these operations are similar to the RPCs of NFS Version 3. The operations in the compound are performed in order, until one of them fails (returns an error) and then the RPC terminates at that point. .Pp It has integrated locking support, which implies that the server is no longer -stateless. As such, the +stateless. +As such, the .Tn NFSv4 server remains in recovery mode for a Grace period (always greater than the lease duration the server uses) after a reboot. @@ -53,7 +55,8 @@ During this Grace period, clients may re open/lock state changing operations. To provide for correct recovery semantics, a small file described by .Xr stablerestart 5 -is used by the server during the recovery phase. If this file is missing, +is used by the server during the recovery phase. +If this file is missing, the server will not start. If this file is lost, it should be recovered from backups, since creating an empty @@ -91,7 +94,8 @@ The allows a limited subset of operations to be performed on non-exported subtrees of the local file system, so that traversal of the tree to the exported subtrees is possible. -As such, the ``'' can be in a non-exported file system. However, +As such, the ``'' can be in a non-exported file system. +However, the entire tree that is rooted at that point must be in local file systems that are of types that can be NFS exported. Since the @@ -106,7 +110,8 @@ multiple server file systems, although n this. .Pp .Nm -uses names for users and groups instead of numbers. On the wire, they +uses names for users and groups instead of numbers. +On the wire, they take the form: .sp .Bd -literal -offset indent -compact @@ -114,10 +119,12 @@ take the form: .Ed .sp where ``'' is not the same as the DNS domain used -for host name lookups, but is usually set to the same string. Most systems set this ``'' +for host name lookups, but is usually set to the same string. +Most systems set this ``'' to the domain name part of the machine's .Xr hostname 1 -by default. However, this can normally be overridden by a command line +by default. +However, this can normally be overridden by a command line option or configuration file for the daemon used to do the name<->number mapping. On FreeBSD, the mapping daemon is called @@ -200,8 +207,10 @@ variables that you can change, which mig .Bl -tag -width Ds .It Cm vfs.newnfs.issue_delegations when set non-zero, allows the server to issue Open Delegations to -clients. These delegations permit the client to manipulate the file -locally on the client. Unfortunately, at this time, client use of +clients. +These delegations permit the client to manipulate the file +locally on the client. +Unfortunately, at this time, client use of delegations is limited, so performance gains may not be observed. This can only be enabled when the file systems being exported to .Nm @@ -304,6 +313,7 @@ NFS V4 stable restart file .Xr nfsuserd 8 .Sh BUGS At this time, there is no recall of delegations for local file system -operations. As such, delegations should only be enabled for file systems +operations. +As such, delegations should only be enabled for file systems that are being used soley as NFS export volumes and are not being accessed via local system calls nor services such as Samba. From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 23:01:14 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0A9A1065679; Wed, 3 Jun 2009 23:01:14 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 2D90F8FC1C; Wed, 3 Jun 2009 23:01:13 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id n53Mi81c084582; Thu, 4 Jun 2009 02:44:08 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1244069049; bh=eOiMYaqwru6RegwqBr9H6gKGB6uAeE4gbRaG9QksEOA=; l=290; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=R+oClI8Gnlal2uiaEDEg6qvrEzcPLmgndSV9blUUH07r0E2YQG16GYCos5f1utq4n LamvzhEWJIcFsNkKPa+/fenqWO4mMARNN1xWU+ye1lV6WrGoatYQP9sXJIy+ZpAw3Z dBkVOw+rmAjZc/CukiZFxgf+o2rTwZ/1MgDq2gTs= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id n53Mi8x1084581; Thu, 4 Jun 2009 02:44:08 +0400 (MSD) (envelope-from ache) Date: Thu, 4 Jun 2009 02:44:08 +0400 From: Andrey Chernov To: "George V. Neville-Neil" Message-ID: <20090603224408.GA84437@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , "George V. Neville-Neil" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <200905202219.n4KMJMT9045802@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200905202219.n4KMJMT9045802@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r192486 - head/usr.bin/perror X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 23:01:15 -0000 In the light of localized strerror() messages more interesting utility will be just duing backwards, i.e. to find error number and English explaination using given localized diagnostic. IMHO this functionality can be insterted into perror(1) additionally. -- http://ache.pp.ru/ From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 23:30:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E6521065672; Wed, 3 Jun 2009 23:30:26 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2268FC18; Wed, 3 Jun 2009 23:30:26 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53NUQWl070419; Wed, 3 Jun 2009 23:30:26 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53NUQFb070418; Wed, 3 Jun 2009 23:30:26 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906032330.n53NUQFb070418@svn.freebsd.org> From: Sam Leffler Date: Wed, 3 Jun 2009 23:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193413 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 23:30:26 -0000 Author: sam Date: Wed Jun 3 23:30:25 2009 New Revision: 193413 URL: http://svn.freebsd.org/changeset/base/193413 Log: After a channel switch mark associated stations so they will immediately be probed as inactive; this more quickly weeds out stations that don't follow to the new channel. Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Wed Jun 3 23:28:22 2009 (r193412) +++ head/sys/net80211/ieee80211_hostap.c Wed Jun 3 23:30:25 2009 (r193413) @@ -114,6 +114,19 @@ sta_disassoc(void *arg, struct ieee80211 } } +static void +sta_csa(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni->ni_associd != 0) + if (ni->ni_inact > vap->iv_inact_init) { + ni->ni_inact = vap->iv_inact_init; + IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, + "%s: inact %u", __func__, ni->ni_inact); + } +} + /* * IEEE80211_M_HOSTAP vap state machine handler. */ @@ -249,6 +262,11 @@ hostap_newstate(struct ieee80211vap *vap /* fall thru... */ case IEEE80211_S_CSA: /* + * Shorten inactivity timer of associated stations + * to weed out sta's that don't follow a CSA. + */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_csa, vap); + /* * Update bss node channel to reflect where * we landed after CSA. */ From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 23:33:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D2F8106564A; Wed, 3 Jun 2009 23:33:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2108B8FC12; Wed, 3 Jun 2009 23:33:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53NX9O7070513; Wed, 3 Jun 2009 23:33:09 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53NX9C8070512; Wed, 3 Jun 2009 23:33:09 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906032333.n53NX9C8070512@svn.freebsd.org> From: Sam Leffler Date: Wed, 3 Jun 2009 23:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193414 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 23:33:10 -0000 Author: sam Date: Wed Jun 3 23:33:09 2009 New Revision: 193414 URL: http://svn.freebsd.org/changeset/base/193414 Log: When a channel switch is done to a channel with different operating characteristics force the stations to re-associate so protocol state is re-initialized. Note that for 11h/DFS this is irrelevant as channel changes are never cross-band. Reviewed by: ctlaw Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Wed Jun 3 23:30:25 2009 (r193413) +++ head/sys/net80211/ieee80211_hostap.c Wed Jun 3 23:33:09 2009 (r193414) @@ -127,6 +127,28 @@ sta_csa(void *arg, struct ieee80211_node } } +static void +sta_drop(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni->ni_associd != 0) + ieee80211_node_leave(ni); +} + +/* + * Does a channel change require associated stations to re-associate + * so protocol state is correct. This is used when doing CSA across + * bands or similar (e.g. HT -> legacy). + */ +static int +isbandchange(struct ieee80211com *ic) +{ + return ((ic->ic_bsschan->ic_flags ^ ic->ic_csa_newchan->ic_flags) & + (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HALF | + IEEE80211_CHAN_QUARTER | IEEE80211_CHAN_HT)) != 0; +} + /* * IEEE80211_M_HOSTAP vap state machine handler. */ @@ -307,6 +329,18 @@ hostap_newstate(struct ieee80211vap *vap } ieee80211_node_authorize(vap->iv_bss); break; + case IEEE80211_S_CSA: + if (ostate == IEEE80211_S_RUN && isbandchange(ic)) { + /* + * On a ``band change'' silently drop associated + * stations as they must re-associate before they + * can pass traffic (as otherwise protocol state + * such as capabilities and the negotiated rate + * set may/will be wrong). + */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_drop, vap); + } + break; default: break; } From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 01:55:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0BF9106566C; Thu, 4 Jun 2009 01:55:13 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD8C38FC12; Thu, 4 Jun 2009 01:55:13 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n541tDds073392; Thu, 4 Jun 2009 01:55:13 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n541tDQg073391; Thu, 4 Jun 2009 01:55:13 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200906040155.n541tDQg073391@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 4 Jun 2009 01:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193419 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 01:55:14 -0000 Author: weongyo Date: Thu Jun 4 01:55:13 2009 New Revision: 193419 URL: http://svn.freebsd.org/changeset/base/193419 Log: cleanups the device match list. Modified: head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu Jun 4 01:45:40 2009 (r193418) +++ head/sys/dev/usb/wlan/if_zyd.c Thu Jun 4 01:55:13 2009 (r193419) @@ -204,55 +204,59 @@ static const struct zyd_phy_pair zyd_def #define ZYD_ZD1211 0 #define ZYD_ZD1211B 1 +#define ZYD_ZD1211_DEV(v,p) \ + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211) } +#define ZYD_ZD1211B_DEV(v,p) \ + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211B) } static const struct usb_device_id zyd_devs[] = { - /* ZYD_ZD1211 */ - {USB_VPI(USB_VENDOR_3COM2, USB_PRODUCT_3COM2_3CRUSB10075, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_WL54, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_WL159G, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_CYBERTAN, USB_PRODUCT_CYBERTAN_TG54USB, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_DRAYTEK, USB_PRODUCT_DRAYTEK_VIGOR550, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54GD, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54GZL, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_PLANEX3, USB_PRODUCT_PLANEX3_GWUS54GZ, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_PLANEX3, USB_PRODUCT_PLANEX3_GWUS54MINI, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_SAGEM, USB_PRODUCT_SAGEM_XG760A, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_SENAO, USB_PRODUCT_SENAO_NUB8301, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL113, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_SWEEX, USB_PRODUCT_SWEEX_ZD1211, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_TEKRAM, USB_PRODUCT_TEKRAM_QUICKWLAN, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_TEKRAM, USB_PRODUCT_TEKRAM_ZD1211_1, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_TEKRAM, USB_PRODUCT_TEKRAM_ZD1211_2, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_TWINMOS, USB_PRODUCT_TWINMOS_G240, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_ALL0298V2, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UB_A, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UB, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_WISTRONNEWEB, USB_PRODUCT_WISTRONNEWEB_UR055G, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZCOM, USB_PRODUCT_ZCOM_ZD1211, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZYDAS, USB_PRODUCT_ZYDAS_ZD1211, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_AG225H, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_ZYAIRG220, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G200V2, ZYD_ZD1211)}, - /* ZYD_ZD1211B */ - {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_SMCWUSBG, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_A9T_WIFI, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D7050_V4000, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_CISCOLINKSYS, USB_PRODUCT_CISCOLINKSYS_WUSBF54G, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_FIBERLINE, USB_PRODUCT_FIBERLINE_WL430U, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_KG54L, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_SNU5600, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GW_US54GXS, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_SAGEM, USB_PRODUCT_SAGEM_XG76NA, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UBC1, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_USR, USB_PRODUCT_USR_USR5423, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_VTECH, USB_PRODUCT_VTECH_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ZCOM, USB_PRODUCT_ZCOM_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ZYDAS, USB_PRODUCT_ZYDAS_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_M202, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G202, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G220V2, ZYD_ZD1211B)}, + /* ZYD_ZD1211 */ + ZYD_ZD1211_DEV(3COM2, 3CRUSB10075), + ZYD_ZD1211_DEV(ABOCOM, WL54), + ZYD_ZD1211_DEV(ASUS, WL159G), + ZYD_ZD1211_DEV(CYBERTAN, TG54USB), + ZYD_ZD1211_DEV(DRAYTEK, VIGOR550), + ZYD_ZD1211_DEV(PLANEX2, GWUS54GD), + ZYD_ZD1211_DEV(PLANEX2, GWUS54GZL), + ZYD_ZD1211_DEV(PLANEX3, GWUS54GZ), + ZYD_ZD1211_DEV(PLANEX3, GWUS54MINI), + ZYD_ZD1211_DEV(SAGEM, XG760A), + ZYD_ZD1211_DEV(SENAO, NUB8301), + ZYD_ZD1211_DEV(SITECOMEU, WL113), + ZYD_ZD1211_DEV(SWEEX, ZD1211), + ZYD_ZD1211_DEV(TEKRAM, QUICKWLAN), + ZYD_ZD1211_DEV(TEKRAM, ZD1211_1), + ZYD_ZD1211_DEV(TEKRAM, ZD1211_2), + ZYD_ZD1211_DEV(TWINMOS, G240), + ZYD_ZD1211_DEV(UMEDIA, ALL0298V2), + ZYD_ZD1211_DEV(UMEDIA, TEW429UB_A), + ZYD_ZD1211_DEV(UMEDIA, TEW429UB), + ZYD_ZD1211_DEV(WISTRONNEWEB, UR055G), + ZYD_ZD1211_DEV(ZCOM, ZD1211), + ZYD_ZD1211_DEV(ZYDAS, ZD1211), + ZYD_ZD1211_DEV(ZYXEL, AG225H), + ZYD_ZD1211_DEV(ZYXEL, ZYAIRG220), + ZYD_ZD1211_DEV(ZYXEL, G200V2), + /* ZYD_ZD1211B */ + ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), + ZYD_ZD1211B_DEV(ACCTON, ZD1211B), + ZYD_ZD1211B_DEV(ASUS, A9T_WIFI), + ZYD_ZD1211B_DEV(BELKIN, F5D7050_V4000), + ZYD_ZD1211B_DEV(BELKIN, ZD1211B), + ZYD_ZD1211B_DEV(CISCOLINKSYS, WUSBF54G), + ZYD_ZD1211B_DEV(FIBERLINE, WL430U), + ZYD_ZD1211B_DEV(MELCO, KG54L), + ZYD_ZD1211B_DEV(PHILIPS, SNU5600), + ZYD_ZD1211B_DEV(PLANEX2, GW_US54GXS), + ZYD_ZD1211B_DEV(SAGEM, XG76NA), + ZYD_ZD1211B_DEV(SITECOMEU, ZD1211B), + ZYD_ZD1211B_DEV(UMEDIA, TEW429UBC1), + ZYD_ZD1211B_DEV(USR, USR5423), + ZYD_ZD1211B_DEV(VTECH, ZD1211B), + ZYD_ZD1211B_DEV(ZCOM, ZD1211B), + ZYD_ZD1211B_DEV(ZYDAS, ZD1211B), + ZYD_ZD1211B_DEV(ZYXEL, M202), + ZYD_ZD1211B_DEV(ZYXEL, G202), + ZYD_ZD1211B_DEV(ZYXEL, G220V2) }; static const struct usb_config zyd_config[ZYD_N_TRANSFER] = { From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 02:49:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 159B7106564A; Thu, 4 Jun 2009 02:49:51 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01FFC8FC0A; Thu, 4 Jun 2009 02:49:51 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n542nobX074781; Thu, 4 Jun 2009 02:49:50 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n542noRp074779; Thu, 4 Jun 2009 02:49:50 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200906040249.n542noRp074779@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 4 Jun 2009 02:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193420 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 02:49:51 -0000 Author: weongyo Date: Thu Jun 4 02:49:50 2009 New Revision: 193420 URL: http://svn.freebsd.org/changeset/base/193420 Log: reimplements RF logic for GCT chipset (as known as UW2453) to support ICIDU NI-707503 which is donated by Nick Hibma (great thanks!). Though it has a MAXIM RF (0x8) there's some success reports with using GCT RF (0x9) codes and it worked well for ICIDU NI-707503 too. So codes for MAXIM and GCT RFs are integrated. Before this commit, if I rememeber correctly, MAXIM RF is never tested that it seems it's a first report working with FreeBSD. Modified: head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/usb/wlan/if_zydreg.h Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu Jun 4 01:55:13 2009 (r193419) +++ head/sys/dev/usb/wlan/if_zyd.c Thu Jun 4 02:49:50 2009 (r193420) @@ -190,9 +190,10 @@ static int zyd_al2210_set_channel(struct static int zyd_gct_init(struct zyd_rf *); static int zyd_gct_switch_radio(struct zyd_rf *, int); static int zyd_gct_set_channel(struct zyd_rf *, uint8_t); -static int zyd_maxim_init(struct zyd_rf *); -static int zyd_maxim_switch_radio(struct zyd_rf *, int); -static int zyd_maxim_set_channel(struct zyd_rf *, uint8_t); +static int zyd_gct_mode(struct zyd_rf *); +static int zyd_gct_set_channel_synth(struct zyd_rf *, int, int); +static int zyd_gct_write(struct zyd_rf *, uint16_t); +static int zyd_gct_txgain(struct zyd_rf *, uint8_t); static int zyd_maxim2_init(struct zyd_rf *); static int zyd_maxim2_switch_radio(struct zyd_rf *, int); static int zyd_maxim2_set_channel(struct zyd_rf *, uint8_t); @@ -1421,11 +1422,14 @@ fail: static int zyd_gct_init(struct zyd_rf *rf) { +#define ZYD_GCT_INTR_REG 0x85c1 #define N(a) (sizeof(a) / sizeof((a)[0])) struct zyd_softc *sc = rf->rf_sc; static const struct zyd_phy_pair phyini[] = ZYD_GCT_PHY; static const uint32_t rfini[] = ZYD_GCT_RF; - int i, error; + static const uint16_t vco[11][7] = ZYD_GCT_VCO; + int i, idx = -1, error; + uint16_t data; /* init RF-dependent PHY registers */ for (i = 0; i < N(phyini); i++) @@ -1436,122 +1440,153 @@ zyd_gct_init(struct zyd_rf *rf) if ((error = zyd_rfwrite(sc, rfini[i])) != 0) return (error); } + + error = zyd_gct_mode(rf); + if (error != 0) + return (error); + + for (i = 0; i < N(vco) - 1; i++) { + error = zyd_gct_set_channel_synth(rf, 1, 0); + if (error != 0) + goto fail; + error = zyd_gct_write(rf, vco[i][0]); + if (error != 0) + goto fail; + zyd_write16_m(sc, ZYD_GCT_INTR_REG, 0xf); + zyd_read16_m(sc, ZYD_GCT_INTR_REG, &data); + if ((data & 0xf) == 0) { + idx = i; + break; + } + } + if (idx == -1) { + error = zyd_gct_set_channel_synth(rf, 1, 1); + if (error != 0) + goto fail; + error = zyd_gct_write(rf, 0x6662); + if (error != 0) + goto fail; + } + + rf->idx = idx; + zyd_write16_m(sc, ZYD_CR203, 0x6); fail: return (error); #undef N +#undef ZYD_GCT_INTR_REG } static int -zyd_gct_switch_radio(struct zyd_rf *rf, int on) +zyd_gct_mode(struct zyd_rf *rf) { - /* vendor driver does nothing for this RF chip */ +#define N(a) (sizeof(a) / sizeof((a)[0])) + struct zyd_softc *sc = rf->rf_sc; + static const uint32_t mode[] = { + 0x25f98, 0x25f9a, 0x25f94, 0x27fd4 + }; + int i, error; - return (0); + for (i = 0; i < N(mode); i++) { + if ((error = zyd_rfwrite(sc, mode[i])) != 0) + break; + } + return (error); +#undef N } static int -zyd_gct_set_channel(struct zyd_rf *rf, uint8_t chan) +zyd_gct_set_channel_synth(struct zyd_rf *rf, int chan, int acal) { - int error; + int error, idx = chan - 1; struct zyd_softc *sc = rf->rf_sc; - static const uint32_t rfprog[] = ZYD_GCT_CHANTABLE; + static uint32_t acal_synth[] = ZYD_GCT_CHANNEL_ACAL; + static uint32_t std_synth[] = ZYD_GCT_CHANNEL_STD; + static uint32_t div_synth[] = ZYD_GCT_CHANNEL_DIV; - error = zyd_rfwrite(sc, 0x1c0000); - if (error != 0) - goto fail; - error = zyd_rfwrite(sc, rfprog[chan - 1]); + error = zyd_rfwrite(sc, + (acal == 1) ? acal_synth[idx] : std_synth[idx]); if (error != 0) - goto fail; - error = zyd_rfwrite(sc, 0x1c0008); -fail: - return (error); + return (error); + return zyd_rfwrite(sc, div_synth[idx]); } -/* - * Maxim RF methods. - */ static int -zyd_maxim_init(struct zyd_rf *rf) +zyd_gct_write(struct zyd_rf *rf, uint16_t value) { -#define N(a) (sizeof(a) / sizeof((a)[0])) struct zyd_softc *sc = rf->rf_sc; - static const struct zyd_phy_pair phyini[] = ZYD_MAXIM_PHY; - static const uint32_t rfini[] = ZYD_MAXIM_RF; - uint16_t tmp; - int i, error; - /* init RF-dependent PHY registers */ - for (i = 0; i < N(phyini); i++) - zyd_write16_m(sc, phyini[i].reg, phyini[i].val); - - zyd_read16_m(sc, ZYD_CR203, &tmp); - zyd_write16_m(sc, ZYD_CR203, tmp & ~(1 << 4)); - - /* init maxim radio */ - for (i = 0; i < N(rfini); i++) { - if ((error = zyd_rfwrite(sc, rfini[i])) != 0) - return (error); - } - zyd_read16_m(sc, ZYD_CR203, &tmp); - zyd_write16_m(sc, ZYD_CR203, tmp | (1 << 4)); -fail: - return (error); -#undef N + return zyd_rfwrite(sc, 0x300000 | 0x40000 | value); } static int -zyd_maxim_switch_radio(struct zyd_rf *rf, int on) +zyd_gct_switch_radio(struct zyd_rf *rf, int on) { +#define N(a) (sizeof(a) / sizeof((a)[0])) + int error; + struct zyd_softc *sc = rf->rf_sc; - /* vendor driver does nothing for this RF chip */ - return (0); + error = zyd_rfwrite(sc, on ? 0x25f94 : 0x25f90); + if (error != 0) + return (error); + + zyd_write16_m(sc, ZYD_CR11, on ? 0x00 : 0x04); + zyd_write16_m(sc, ZYD_CR251, + on ? ((sc->sc_macrev == ZYD_ZD1211B) ? 0x7f : 0x3f) : 0x2f); +fail: + return (error); } static int -zyd_maxim_set_channel(struct zyd_rf *rf, uint8_t chan) +zyd_gct_set_channel(struct zyd_rf *rf, uint8_t chan) { #define N(a) (sizeof(a) / sizeof((a)[0])) + int error, i; struct zyd_softc *sc = rf->rf_sc; - static const struct zyd_phy_pair phyini[] = ZYD_MAXIM_PHY; - static const uint32_t rfini[] = ZYD_MAXIM_RF; - static const struct { - uint32_t r1, r2; - } rfprog[] = ZYD_MAXIM_CHANTABLE; - uint16_t tmp; - int i, error; - - /* - * Do the same as we do when initializing it, except for the channel - * values coming from the two channel tables. - */ - - /* init RF-dependent PHY registers */ - for (i = 0; i < N(phyini); i++) - zyd_write16_m(sc, phyini[i].reg, phyini[i].val); - - zyd_read16_m(sc, ZYD_CR203, &tmp); - zyd_write16_m(sc, ZYD_CR203, tmp & ~(1 << 4)); + static const struct zyd_phy_pair cmd[] = { + { ZYD_CR80, 0x30 }, { ZYD_CR81, 0x30 }, { ZYD_CR79, 0x58 }, + { ZYD_CR12, 0xf0 }, { ZYD_CR77, 0x1b }, { ZYD_CR78, 0x58 }, + }; + static const uint16_t vco[11][7] = ZYD_GCT_VCO; - /* first two values taken from the chantables */ - error = zyd_rfwrite(sc, rfprog[chan - 1].r1); + error = zyd_gct_set_channel_synth(rf, chan, 0); if (error != 0) goto fail; - error = zyd_rfwrite(sc, rfprog[chan - 1].r2); + error = zyd_gct_write(rf, (rf->idx == -1) ? 0x6662 : + vco[rf->idx][((chan - 1) / 2)]); if (error != 0) goto fail; - - /* init maxim radio - skipping the two first values */ - for (i = 2; i < N(rfini); i++) { - if ((error = zyd_rfwrite(sc, rfini[i])) != 0) - return (error); - } - zyd_read16_m(sc, ZYD_CR203, &tmp); - zyd_write16_m(sc, ZYD_CR203, tmp | (1 << 4)); + error = zyd_gct_mode(rf); + if (error != 0) + return (error); + for (i = 0; i < N(cmd); i++) + zyd_write16_m(sc, cmd[i].reg, cmd[i].val); + error = zyd_gct_txgain(rf, chan); + if (error != 0) + return (error); + zyd_write16_m(sc, ZYD_CR203, 0x6); fail: return (error); #undef N } +static int +zyd_gct_txgain(struct zyd_rf *rf, uint8_t chan) +{ +#define N(a) (sizeof(a) / sizeof((a)[0])) + struct zyd_softc *sc = rf->rf_sc; + static uint32_t txgain[] = ZYD_GCT_TXGAIN; + uint8_t idx = sc->sc_pwrint[chan - 1]; + + if (idx >= N(txgain)) { + device_printf(sc->sc_dev, "could not set TX gain (%d %#x)\n", + chan, idx); + return 0; + } + + return zyd_rfwrite(sc, 0x700000 | txgain[idx]); +#undef N +} + /* * Maxim2 RF methods. */ @@ -1643,6 +1678,7 @@ zyd_rf_attach(struct zyd_softc *sc, uint struct zyd_rf *rf = &sc->sc_rf; rf->rf_sc = sc; + rf->update_pwr = 1; switch (type) { case ZYD_RF_RFMD: @@ -1676,17 +1712,13 @@ zyd_rf_attach(struct zyd_softc *sc, uint rf->set_channel = zyd_al2210_set_channel; rf->width = 24; /* 24-bit RF values */ break; + case ZYD_RF_MAXIM_NEW: case ZYD_RF_GCT: rf->init = zyd_gct_init; rf->switch_radio = zyd_gct_switch_radio; rf->set_channel = zyd_gct_set_channel; - rf->width = 21; /* 21-bit RF values */ - break; - case ZYD_RF_MAXIM_NEW: - rf->init = zyd_maxim_init; - rf->switch_radio = zyd_maxim_switch_radio; - rf->set_channel = zyd_maxim_set_channel; - rf->width = 18; /* 18-bit RF values */ + rf->width = 24; /* 24-bit RF values */ + rf->update_pwr = 0; break; case ZYD_RF_MAXIM_NEW2: rf->init = zyd_maxim2_init; @@ -2066,16 +2098,21 @@ zyd_set_chan(struct zyd_softc *sc, struc if (error != 0) goto fail; - /* update Tx power */ - zyd_write16_m(sc, ZYD_CR31, sc->sc_pwrint[chan - 1]); + if (rf->update_pwr) { + /* update Tx power */ + zyd_write16_m(sc, ZYD_CR31, sc->sc_pwrint[chan - 1]); - if (sc->sc_macrev == ZYD_ZD1211B) { - zyd_write16_m(sc, ZYD_CR67, sc->sc_ofdm36_cal[chan - 1]); - zyd_write16_m(sc, ZYD_CR66, sc->sc_ofdm48_cal[chan - 1]); - zyd_write16_m(sc, ZYD_CR65, sc->sc_ofdm54_cal[chan - 1]); - zyd_write16_m(sc, ZYD_CR68, sc->sc_pwrcal[chan - 1]); - zyd_write16_m(sc, ZYD_CR69, 0x28); - zyd_write16_m(sc, ZYD_CR69, 0x2a); + if (sc->sc_macrev == ZYD_ZD1211B) { + zyd_write16_m(sc, ZYD_CR67, + sc->sc_ofdm36_cal[chan - 1]); + zyd_write16_m(sc, ZYD_CR66, + sc->sc_ofdm48_cal[chan - 1]); + zyd_write16_m(sc, ZYD_CR65, + sc->sc_ofdm54_cal[chan - 1]); + zyd_write16_m(sc, ZYD_CR68, sc->sc_pwrcal[chan - 1]); + zyd_write16_m(sc, ZYD_CR69, 0x28); + zyd_write16_m(sc, ZYD_CR69, 0x2a); + } } if (sc->sc_cckgain) { /* set CCK baseband gain from EEPROM */ Modified: head/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_zydreg.h Thu Jun 4 01:55:13 2009 (r193419) +++ head/sys/dev/usb/wlan/if_zydreg.h Thu Jun 4 02:49:50 2009 (r193420) @@ -840,82 +840,75 @@ #define ZYD_GCT_PHY \ { \ - { ZYD_CR47, 0x1e }, { ZYD_CR15, 0xdc }, { ZYD_CR113, 0xc0 }, \ - { ZYD_CR20, 0x0c }, { ZYD_CR17, 0x65 }, { ZYD_CR34, 0x04 }, \ - { ZYD_CR35, 0x35 }, { ZYD_CR24, 0x20 }, { ZYD_CR9, 0xe0 }, \ - { ZYD_CR127, 0x02 }, { ZYD_CR10, 0x91 }, { ZYD_CR23, 0x7f }, \ - { ZYD_CR27, 0x10 }, { ZYD_CR28, 0x7a }, { ZYD_CR79, 0xb5 }, \ - { ZYD_CR64, 0x80 }, { ZYD_CR33, 0x28 }, { ZYD_CR38, 0x30 } \ + { ZYD_CR10, 0x89 }, { ZYD_CR15, 0x20 }, { ZYD_CR17, 0x28 }, \ + { ZYD_CR23, 0x38 }, { ZYD_CR24, 0x20 }, { ZYD_CR26, 0x93 }, \ + { ZYD_CR27, 0x15 }, { ZYD_CR28, 0x3e }, { ZYD_CR29, 0x00 }, \ + { ZYD_CR33, 0x28 }, { ZYD_CR34, 0x30 }, { ZYD_CR35, 0x43 }, \ + { ZYD_CR41, 0x24 }, { ZYD_CR44, 0x32 }, { ZYD_CR46, 0x92 }, \ + { ZYD_CR47, 0x1e }, { ZYD_CR48, 0x04 }, { ZYD_CR49, 0xfa }, \ + { ZYD_CR79, 0x58 }, { ZYD_CR80, 0x30 }, { ZYD_CR81, 0x30 }, \ + { ZYD_CR87, 0x0a }, { ZYD_CR89, 0x04 }, { ZYD_CR91, 0x00 }, \ + { ZYD_CR92, 0x0a }, { ZYD_CR98, 0x8d }, { ZYD_CR99, 0x28 }, \ + { ZYD_CR100, 0x02 }, { ZYD_CR101, 0x09 }, { ZYD_CR102, 0x27 }, \ + { ZYD_CR106, 0x1c }, { ZYD_CR107, 0x1c }, { ZYD_CR109, 0x13 }, \ + { ZYD_CR110, 0x1f }, { ZYD_CR111, 0x13 }, { ZYD_CR112, 0x1f }, \ + { ZYD_CR113, 0x27 }, { ZYD_CR114, 0x23 }, { ZYD_CR115, 0x24 }, \ + { ZYD_CR116, 0x24 }, { ZYD_CR117, 0xfa }, { ZYD_CR118, 0xf0 }, \ + { ZYD_CR119, 0x1a }, { ZYD_CR120, 0x4f }, { ZYD_CR121, 0x1f }, \ + { ZYD_CR122, 0xf0 }, { ZYD_CR123, 0x57 }, { ZYD_CR125, 0xad }, \ + { ZYD_CR126, 0x6c }, { ZYD_CR127, 0x03 }, { ZYD_CR128, 0x14 }, \ + { ZYD_CR129, 0x12 }, { ZYD_CR130, 0x10 }, { ZYD_CR137, 0x50 }, \ + { ZYD_CR138, 0xa8 }, { ZYD_CR144, 0xac }, { ZYD_CR146, 0x20 }, \ + { ZYD_CR252, 0xff }, { ZYD_CR253, 0xff } \ } #define ZYD_GCT_RF \ { \ - 0x1f0000, 0x1f0000, 0x1f0200, 0x1f0600, 0x1f8600, 0x1f8600, \ - 0x002050, 0x1f8000, 0x1f8200, 0x1f8600, 0x1c0000, 0x10c458, \ - 0x088e92, 0x187b82, 0x0401b4, 0x140816, 0x0c7000, 0x1c0000, \ - 0x02ccae, 0x128023, 0x0a0000, 0x1a0000, 0x06e380, 0x16cb94, \ - 0x0e1740, 0x014980, 0x116240, 0x090000, 0x192304, 0x05112f, \ - 0x0d54a8, 0x0f8000, 0x1c0008, 0x1c0000, 0x1a0000, 0x1c0008, \ - 0x150000, 0x0c7000, 0x150800, 0x150000 \ + 0x40002b, 0x519e4f, 0x6f81ad, 0x73fffe, 0x25f9c, 0x100047, \ + 0x200999, 0x307602, 0x346063, \ } -#define ZYD_GCT_CHANTABLE \ +#define ZYD_GCT_VCO \ { \ - 0x1a0000, 0x1a8000, 0x1a4000, 0x1ac000, 0x1a2000, 0x1aa000, \ - 0x1a6000, 0x1ae000, 0x1a1000, 0x1a9000, 0x1a5000, 0x1ad000, \ - 0x1a3000, 0x1ab000 \ + { 0x664d, 0x604d, 0x6675, 0x6475, 0x6655, 0x6455, 0x6665 }, \ + { 0x666d, 0x606d, 0x664d, 0x644d, 0x6675, 0x6475, 0x6655 }, \ + { 0x665d, 0x605d, 0x666d, 0x646d, 0x664d, 0x644d, 0x6675 }, \ + { 0x667d, 0x607d, 0x665d, 0x645d, 0x666d, 0x646d, 0x664d }, \ + { 0x6643, 0x6043, 0x667d, 0x647d, 0x665d, 0x645d, 0x666d }, \ + { 0x6663, 0x6063, 0x6643, 0x6443, 0x667d, 0x647d, 0x665d }, \ + { 0x6653, 0x6053, 0x6663, 0x6463, 0x6643, 0x6443, 0x667d }, \ + { 0x6673, 0x6073, 0x6653, 0x6453, 0x6663, 0x6463, 0x6643 }, \ + { 0x664b, 0x604b, 0x6673, 0x6473, 0x6653, 0x6453, 0x6663 }, \ + { 0x666b, 0x606b, 0x664b, 0x644b, 0x6673, 0x6473, 0x6653 }, \ + { 0x665b, 0x605b, 0x666b, 0x646b, 0x664b, 0x644b, 0x6673 } \ } -#define ZYD_MAXIM_PHY \ +#define ZYD_GCT_TXGAIN \ { \ - { ZYD_CR23, 0x40 }, { ZYD_CR15, 0x20 }, { ZYD_CR28, 0x3e }, \ - { ZYD_CR29, 0x00 }, { ZYD_CR26, 0x11 }, { ZYD_CR44, 0x33 }, \ - { ZYD_CR106, 0x2a }, { ZYD_CR107, 0x1a }, { ZYD_CR109, 0x2b }, \ - { ZYD_CR110, 0x2b }, { ZYD_CR111, 0x2b }, { ZYD_CR112, 0x2b }, \ - { ZYD_CR10, 0x89 }, { ZYD_CR17, 0x20 }, { ZYD_CR26, 0x93 }, \ - { ZYD_CR34, 0x30 }, { ZYD_CR35, 0x40 }, { ZYD_CR41, 0x24 }, \ - { ZYD_CR44, 0x32 }, { ZYD_CR46, 0x90 }, { ZYD_CR89, 0x18 }, \ - { ZYD_CR92, 0x0a }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 }, \ - { ZYD_CR106, 0x20 }, { ZYD_CR107, 0x24 }, { ZYD_CR109, 0x09 }, \ - { ZYD_CR110, 0x13 }, { ZYD_CR111, 0x13 }, { ZYD_CR112, 0x13 }, \ - { ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x24 }, \ - { ZYD_CR116, 0x24 }, { ZYD_CR117, 0xf4 }, { ZYD_CR118, 0xfa }, \ - { ZYD_CR120, 0x4f }, { ZYD_CR121, 0x77 }, { ZYD_CR122, 0xfe }, \ - { ZYD_CR10, 0x89 }, { ZYD_CR17, 0x20 }, { ZYD_CR26, 0x93 }, \ - { ZYD_CR34, 0x30 }, { ZYD_CR35, 0x40 }, { ZYD_CR41, 0x24 }, \ - { ZYD_CR44, 0x32 }, { ZYD_CR46, 0x90 }, { ZYD_CR89, 0x18 }, \ - { ZYD_CR92, 0x0a }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 }, \ - { ZYD_CR106, 0x20 }, { ZYD_CR107, 0x24 }, { ZYD_CR109, 0x13 }, \ - { ZYD_CR110, 0x27 }, { ZYD_CR111, 0x27 }, { ZYD_CR112, 0x13 }, \ - { ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x24 }, \ - { ZYD_CR116, 0x24 }, { ZYD_CR117, 0xf4 }, { ZYD_CR118, 0x00 }, \ - { ZYD_CR120, 0x4f }, { ZYD_CR121, 0x06 }, { ZYD_CR122, 0xfe }, \ - { ZYD_CR150, 0x0d } \ + 0x0e313, 0x0fb13, 0x0e093, 0x0f893, 0x0ea93, 0x1f093, 0x1f493, \ + 0x1f693, 0x1f393, 0x1f35b, 0x1e6db, 0x1ff3f, 0x1ffff, 0x361d7, \ + 0x37fbf, 0x3ff8b, 0x3ff33, 0x3fb3f, 0x3ffff \ } -#define ZYD_MAXIM_RF \ +#define ZYD_GCT_CHANNEL_ACAL \ { \ - 0x00ccd4, 0x030a03, 0x000400, 0x000ca1, 0x010072, 0x018645, \ - 0x004006, 0x0000a7, 0x008258, 0x003fc9, 0x00040a, 0x00000b, \ - 0x00026c \ + 0x106847, 0x106847, 0x106867, 0x106867, 0x106867, 0x106867, \ + 0x106857, 0x106857, 0x106857, 0x106857, 0x106877, 0x106877, \ + 0x106877, 0x10684f \ } -#define ZYD_MAXIM_CHANTABLE \ -{ \ - { 0x0ccd4, 0x30a03 }, \ - { 0x22224, 0x00a13 }, \ - { 0x37774, 0x10a13 }, \ - { 0x0ccd4, 0x30a13 }, \ - { 0x22224, 0x00a23 }, \ - { 0x37774, 0x10a23 }, \ - { 0x0ccd4, 0x30a23 }, \ - { 0x22224, 0x00a33 }, \ - { 0x37774, 0x10a33 }, \ - { 0x0ccd4, 0x30a33 }, \ - { 0x22224, 0x00a43 }, \ - { 0x37774, 0x10a43 }, \ - { 0x0ccd4, 0x30a43 }, \ - { 0x199a4, 0x20a53 } \ +#define ZYD_GCT_CHANNEL_STD \ +{ \ + 0x100047, 0x100047, 0x100067, 0x100067, 0x100067, 0x100067, \ + 0x100057, 0x100057, 0x100057, 0x100057, 0x100077, 0x100077, \ + 0x100077, 0x10004f \ +} + +#define ZYD_GCT_CHANNEL_DIV \ +{ \ + 0x200999, 0x20099b, 0x200998, 0x20099a, 0x200999, 0x20099b, \ + 0x200998, 0x20099a, 0x200999, 0x20099b, 0x200998, 0x20099a, \ + 0x200999, 0x200ccc \ } #define ZYD_MAXIM2_PHY \ @@ -1226,6 +1219,8 @@ struct zyd_rf { /* RF attributes */ struct zyd_softc *rf_sc; /* back-pointer */ int width; + int idx; /* for GIT RF */ + int update_pwr; }; struct zyd_rq { From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 03:59:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75087106564A; Thu, 4 Jun 2009 03:59:21 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62B028FC19; Thu, 4 Jun 2009 03:59:21 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n543xL6T076426; Thu, 4 Jun 2009 03:59:21 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n543xLwb076425; Thu, 4 Jun 2009 03:59:21 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200906040359.n543xLwb076425@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 4 Jun 2009 03:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193422 - head/sys/modules/usb/zyd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 03:59:21 -0000 Author: weongyo Date: Thu Jun 4 03:59:20 2009 New Revision: 193422 URL: http://svn.freebsd.org/changeset/base/193422 Log: add two prerequisites; if_zydreg.h and if_zydfw for dependency check. Modified: head/sys/modules/usb/zyd/Makefile Modified: head/sys/modules/usb/zyd/Makefile ============================================================================== --- head/sys/modules/usb/zyd/Makefile Thu Jun 4 03:18:59 2009 (r193421) +++ head/sys/modules/usb/zyd/Makefile Thu Jun 4 03:59:20 2009 (r193422) @@ -31,6 +31,6 @@ S= ${.CURDIR}/../../.. KMOD= if_zyd SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ - if_zyd.c + if_zyd.c if_zydreg.h if_zydfw.h .include From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 08:13:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B8E6106564A; Thu, 4 Jun 2009 08:13:51 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BCD38FC0C; Thu, 4 Jun 2009 08:13:51 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n548Dper081877; Thu, 4 Jun 2009 08:13:51 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n548DpVT081876; Thu, 4 Jun 2009 08:13:51 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200906040813.n548DpVT081876@svn.freebsd.org> From: Doug Rabson Date: Thu, 4 Jun 2009 08:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193432 - head/sys/nlm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 08:13:52 -0000 Author: dfr Date: Thu Jun 4 08:13:51 2009 New Revision: 193432 URL: http://svn.freebsd.org/changeset/base/193432 Log: Don't panic in nlm_record_lock if we get ENOENT from lf_advlockasync. This is likely to be because the file was just removed and in our context this is harmless. Modified: head/sys/nlm/nlm_advlock.c Modified: head/sys/nlm/nlm_advlock.c ============================================================================== --- head/sys/nlm/nlm_advlock.c Thu Jun 4 06:57:50 2009 (r193431) +++ head/sys/nlm/nlm_advlock.c Thu Jun 4 08:13:51 2009 (r193432) @@ -716,8 +716,8 @@ nlm_record_lock(struct vnode *vp, int op newfl.l_sysid = NLM_SYSID_CLIENT | sysid; error = lf_advlockasync(&a, &vp->v_lockf, size); - KASSERT(error == 0, ("Failed to register NFS lock locally - error=%d", - error)); + KASSERT(error == 0 || errno == ENOENT, + ("Failed to register NFS lock locally - error=%d", error)); } static int From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 10:30:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E45561065676; Thu, 4 Jun 2009 10:30:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2CA28FC1F; Thu, 4 Jun 2009 10:30:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54AUIfm084624; Thu, 4 Jun 2009 10:30:18 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54AUIh4084623; Thu, 4 Jun 2009 10:30:18 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906041030.n54AUIh4084623@svn.freebsd.org> From: Robert Watson Date: Thu, 4 Jun 2009 10:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193433 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 10:30:19 -0000 Author: rwatson Date: Thu Jun 4 10:30:18 2009 New Revision: 193433 URL: http://svn.freebsd.org/changeset/base/193433 Log: Re-add opt_mac.h include, which is required in order for MNT_MULTILABEL to be set properly on devfs. Otherwise, it isn't possible to set labels on /dev nodes. Reported by: Sergio Rodriguez MFC after: 3 days Modified: head/sys/fs/devfs/devfs_vfsops.c Modified: head/sys/fs/devfs/devfs_vfsops.c ============================================================================== --- head/sys/fs/devfs/devfs_vfsops.c Thu Jun 4 08:13:51 2009 (r193432) +++ head/sys/fs/devfs/devfs_vfsops.c Thu Jun 4 10:30:18 2009 (r193433) @@ -34,6 +34,8 @@ * $FreeBSD$ */ +#include "opt_mac.h" /* To set MNT_MULTILABEL. */ + #include #include #include From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 11:22:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0659A1065679; Thu, 4 Jun 2009 11:22:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E98268FC25; Thu, 4 Jun 2009 11:22:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54BMrIM089509; Thu, 4 Jun 2009 11:22:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54BMrIP089508; Thu, 4 Jun 2009 11:22:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906041122.n54BMrIP089508@svn.freebsd.org> From: Ed Schouten Date: Thu, 4 Jun 2009 11:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193434 - head/sys/nlm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 11:22:54 -0000 Author: ed Date: Thu Jun 4 11:22:53 2009 New Revision: 193434 URL: http://svn.freebsd.org/changeset/base/193434 Log: Correct typo; errno => error. Modified: head/sys/nlm/nlm_advlock.c Modified: head/sys/nlm/nlm_advlock.c ============================================================================== --- head/sys/nlm/nlm_advlock.c Thu Jun 4 10:30:18 2009 (r193433) +++ head/sys/nlm/nlm_advlock.c Thu Jun 4 11:22:53 2009 (r193434) @@ -716,7 +716,7 @@ nlm_record_lock(struct vnode *vp, int op newfl.l_sysid = NLM_SYSID_CLIENT | sysid; error = lf_advlockasync(&a, &vp->v_lockf, size); - KASSERT(error == 0 || errno == ENOENT, + KASSERT(error == 0 || error == ENOENT, ("Failed to register NFS lock locally - error=%d", error)); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 11:37:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F1921065675; Thu, 4 Jun 2009 11:37:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.221.173]) by mx1.freebsd.org (Postfix) with ESMTP id 579E88FC1D; Thu, 4 Jun 2009 11:37:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by qyk3 with SMTP id 3so1053728qyk.3 for ; Thu, 04 Jun 2009 04:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=0m3WK/bBu1nprCojbWi768Zyq3kenfI6bFrdgPAQwTM=; b=cukJdq2VuzqK7tCFp4HdVCTNb8aN/oYz2f/hE+7wk30qQwWS3+UoGAMrv8Cf29TPLm Rj2pV3lJUzTK6fa8am7m6mXG6k06OWpSZh4LRkKAqxhQtdtkC0rpuDvWcigt//5pJ8wX ATzfFV18JUfo1Npu4UevgQqL141aKAXWoqUPY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=utMcEeU2SYKhobk20qZj62svj2GlQK5+SHX0d55AQCdx2prPUdQ1o4L6e9QArrUjPD G9LcVfvTyFAnkx2t9doy9HAO2nR++ACvGFhFFzTUh3cJpPeciqF+gj5HfW5t2Y/ZyKYZ gjjIRYJVtOvMt3asTcqJmjJfIWtV7h/BHWmBI= MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.229.81.144 with SMTP id x16mr610604qck.69.1244114011299; Thu, 04 Jun 2009 04:13:31 -0700 (PDT) In-Reply-To: <200906040813.n548DpVT081876@svn.freebsd.org> References: <200906040813.n548DpVT081876@svn.freebsd.org> Date: Thu, 4 Jun 2009 19:13:31 +0800 X-Google-Sender-Auth: 81d06dd68cbed3c5 Message-ID: From: Adrian Chadd To: Doug Rabson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193432 - head/sys/nlm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 11:37:27 -0000 This broke the build. errno? adrian 2009/6/4 Doug Rabson : > Author: dfr > Date: Thu Jun =A04 08:13:51 2009 > New Revision: 193432 > URL: http://svn.freebsd.org/changeset/base/193432 > > Log: > =A0Don't panic in nlm_record_lock if we get ENOENT from lf_advlockasync. = This > =A0is likely to be because the file was just removed and in our context t= his is > =A0harmless. > > Modified: > =A0head/sys/nlm/nlm_advlock.c > > Modified: head/sys/nlm/nlm_advlock.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/nlm/nlm_advlock.c =A0Thu Jun =A04 06:57:50 2009 =A0 =A0 =A0 = =A0(r193431) > +++ head/sys/nlm/nlm_advlock.c =A0Thu Jun =A04 08:13:51 2009 =A0 =A0 =A0 = =A0(r193432) > @@ -716,8 +716,8 @@ nlm_record_lock(struct vnode *vp, int op > =A0 =A0 =A0 =A0newfl.l_sysid =3D NLM_SYSID_CLIENT | sysid; > > =A0 =A0 =A0 =A0error =3D lf_advlockasync(&a, &vp->v_lockf, size); > - =A0 =A0 =A0 KASSERT(error =3D=3D 0, ("Failed to register NFS lock local= ly - error=3D%d", > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error)); > + =A0 =A0 =A0 KASSERT(error =3D=3D 0 || errno =3D=3D ENOENT, > + =A0 =A0 =A0 =A0 =A0 ("Failed to register NFS lock locally - error=3D%d"= , error)); > =A0} > > =A0static int > From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 12:03:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A108106580B; Thu, 4 Jun 2009 12:03:31 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from itchy.rabson.org (router.rabson.org [80.177.232.241]) by mx1.freebsd.org (Postfix) with ESMTP id 23FD68FC17; Thu, 4 Jun 2009 12:03:29 +0000 (UTC) (envelope-from dfr@rabson.org) Received: by itchy.rabson.org (Postfix, from userid 80) id 412DD5CF3; Thu, 4 Jun 2009 13:02:58 +0100 (BST) To: Ed Schouten MIME-Version: 1.0 Date: Thu, 04 Jun 2009 13:02:58 +0100 From: Doug Rabson In-Reply-To: <200906041122.n54BMrIP089508@svn.freebsd.org> References: <200906041122.n54BMrIP089508@svn.freebsd.org> Message-ID: <7bed97456290a8e2454188cadae2ff36@mail.rabson.org> X-Sender: dfr@rabson.org User-Agent: RoundCube Webmail/0.2.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UTF-8" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193434 - head/sys/nlm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 12:03:37 -0000 On Thu, 4 Jun 2009 11:22:53 +0000 (UTC), Ed Schouten wrote: > Author: ed > Date: Thu Jun 4 11:22:53 2009 > New Revision: 193434 > URL: http://svn.freebsd.org/changeset/base/193434 > > Log: > Correct typo; errno => error. Thanks Ed. Now where did I leave that pointy hat :( From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 12:27:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDF611065672; Thu, 4 Jun 2009 12:27:57 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC3088FC1B; Thu, 4 Jun 2009 12:27:57 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54CRvWf091601; Thu, 4 Jun 2009 12:27:57 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54CRv4p091600; Thu, 4 Jun 2009 12:27:57 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906041227.n54CRv4p091600@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 4 Jun 2009 12:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193435 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 12:27:58 -0000 Author: luigi Date: Thu Jun 4 12:27:57 2009 New Revision: 193435 URL: http://svn.freebsd.org/changeset/base/193435 Log: fix a bug introduced in rev.190865 related to the signedness of the credit of a pipe. On passing, also use explicit signed/unsigned types for two other fields. Noticed by Oleg Bulyzhin and Maxim Ignatenko long ago, i forgot to commit the fix. Does not affect RELENG_7. Modified: head/sys/netinet/ip_dummynet.h Modified: head/sys/netinet/ip_dummynet.h ============================================================================== --- head/sys/netinet/ip_dummynet.h Thu Jun 4 11:22:53 2009 (r193434) +++ head/sys/netinet/ip_dummynet.h Thu Jun 4 12:27:57 2009 (r193435) @@ -214,8 +214,8 @@ struct dn_flow_queue { * With large bandwidth and large delays, extra_bits (and also numbytes) * can become very large, so better play safe and use 64 bit */ - dn_key numbytes ; /* credit for transmission (dynamic queues) */ - dn_key extra_bits; /* extra bits simulating unavailable channel */ + uint64_t numbytes ; /* credit for transmission (dynamic queues) */ + int64_t extra_bits; /* extra bits simulating unavailable channel */ u_int64_t tot_pkts ; /* statistics counters */ u_int64_t tot_bytes ; @@ -338,7 +338,7 @@ struct dn_pipe { /* a pipe */ int sum; /* sum of weights of all active sessions */ /* Same as in dn_flow_queue, numbytes can become large */ - dn_key numbytes; /* bits I can transmit (more or less). */ + int64_t numbytes; /* bits I can transmit (more or less). */ dn_key sched_time ; /* time pipe was scheduled in ready_heap */ From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 14:13:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0635B1065673; Thu, 4 Jun 2009 14:13:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E76538FC15; Thu, 4 Jun 2009 14:13:06 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54ED6ua094087; Thu, 4 Jun 2009 14:13:06 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54ED66W094084; Thu, 4 Jun 2009 14:13:06 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906041413.n54ED66W094084@svn.freebsd.org> From: Rick Macklem Date: Thu, 4 Jun 2009 14:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193436 - head/sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 14:13:07 -0000 Author: rmacklem Date: Thu Jun 4 14:13:06 2009 New Revision: 193436 URL: http://svn.freebsd.org/changeset/base/193436 Log: Fix two races in the server side krpc w.r.t upcalls: Add a flag so that soupcall_clear() is only called once to cancel an upcall. Move the test for xprt_registered in the upcall down to after the mtx_lock() of the pool mutex, to catch the case where it is unregistered while the upcall is waiting for the mutex. Also, move the mtx_destroy() of the pool mutex to after SVC_RELEASE(), so that it isn't destroyed before the upcalls are disabled. Reviewed by: dfr, jhb Tested by: pho Approved by: kib (mentor) Modified: head/sys/rpc/svc.c head/sys/rpc/svc.h head/sys/rpc/svc_vc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Thu Jun 4 12:27:57 2009 (r193435) +++ head/sys/rpc/svc.c Thu Jun 4 14:13:06 2009 (r193436) @@ -175,12 +175,12 @@ svcpool_destroy(SVCPOOL *pool) mtx_lock(&pool->sp_lock); } - mtx_destroy(&pool->sp_lock); - TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { SVC_RELEASE(xprt); } + mtx_destroy(&pool->sp_lock); + if (pool->sp_rcache) replay_freecache(pool->sp_rcache); @@ -353,15 +353,16 @@ xprt_active(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; + mtx_lock(&pool->sp_lock); + if (!xprt->xp_registered) { /* * Race with xprt_unregister - we lose. */ + mtx_unlock(&pool->sp_lock); return; } - mtx_lock(&pool->sp_lock); - if (!xprt->xp_active) { TAILQ_INSERT_TAIL(&pool->sp_active, xprt, xp_alink); xprt->xp_active = TRUE; Modified: head/sys/rpc/svc.h ============================================================================== --- head/sys/rpc/svc.h Thu Jun 4 12:27:57 2009 (r193435) +++ head/sys/rpc/svc.h Thu Jun 4 14:13:06 2009 (r193436) @@ -166,6 +166,7 @@ typedef struct __rpc_svcxprt { int xp_idletimeout; /* idle time before closing */ time_t xp_lastactive; /* time of last RPC */ u_int64_t xp_sockref; /* set by nfsv4 to identify socket */ + int xp_upcallset; /* socket upcall is set up */ #else int xp_fd; u_short xp_port; /* associated port number */ Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Thu Jun 4 12:27:57 2009 (r193435) +++ head/sys/rpc/svc_vc.c Thu Jun 4 14:13:06 2009 (r193436) @@ -160,6 +160,7 @@ svc_vc_create(SVCPOOL *pool, struct sock solisten(so, SOMAXCONN, curthread); SOCKBUF_LOCK(&so->so_rcv); + xprt->xp_upcallset = 1; soupcall_set(so, SO_RCV, svc_vc_soupcall, xprt); SOCKBUF_UNLOCK(&so->so_rcv); @@ -234,6 +235,7 @@ svc_vc_create_conn(SVCPOOL *pool, struct xprt_register(xprt); SOCKBUF_LOCK(&so->so_rcv); + xprt->xp_upcallset = 1; soupcall_set(so, SO_RCV, svc_vc_soupcall, xprt); SOCKBUF_UNLOCK(&so->so_rcv); @@ -352,7 +354,10 @@ svc_vc_rendezvous_recv(SVCXPRT *xprt, st if (error) { SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); - soupcall_clear(xprt->xp_socket, SO_RCV); + if (xprt->xp_upcallset) { + xprt->xp_upcallset = 0; + soupcall_clear(xprt->xp_socket, SO_RCV); + } SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); xprt_inactive(xprt); sx_xunlock(&xprt->xp_lock); @@ -397,7 +402,10 @@ static void svc_vc_destroy_common(SVCXPRT *xprt) { SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); - soupcall_clear(xprt->xp_socket, SO_RCV); + if (xprt->xp_upcallset) { + xprt->xp_upcallset = 0; + soupcall_clear(xprt->xp_socket, SO_RCV); + } SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); sx_destroy(&xprt->xp_lock); @@ -632,7 +640,10 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms if (error) { SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); - soupcall_clear(xprt->xp_socket, SO_RCV); + if (xprt->xp_upcallset) { + xprt->xp_upcallset = 0; + soupcall_clear(xprt->xp_socket, SO_RCV); + } SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); xprt_inactive(xprt); cd->strm_stat = XPRT_DIED; From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 14:49:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 995A3106566B; Thu, 4 Jun 2009 14:49:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85C478FC17; Thu, 4 Jun 2009 14:49:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54EnRmv094951; Thu, 4 Jun 2009 14:49:27 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54EnRNj094949; Thu, 4 Jun 2009 14:49:27 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906041449.n54EnRNj094949@svn.freebsd.org> From: Rick Macklem Date: Thu, 4 Jun 2009 14:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193437 - head/sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 14:49:28 -0000 Author: rmacklem Date: Thu Jun 4 14:49:27 2009 New Revision: 193437 URL: http://svn.freebsd.org/changeset/base/193437 Log: Fix upcall races in the client side krpc. For the client side upcall, holding SOCKBUF_LOCK() isn't sufficient to guarantee that there is no upcall in progress, since SOCKBUF_LOCK() is released/re-acquired in the upcall. An upcall reference counter was added to the upcall structure that is incremented at the beginning of the upcall and decremented at the end of the upcall. As such, a reference count == 0 when holding the SOCKBUF_LOCK() guarantees there is no upcall in progress. Add a function that is called just after soupcall_clear(), which waits until the reference count == 0. Also, move the mtx_destroy() down to after soupcall_clear(), so that the mutex is not destroyed before upcalls are done. Reviewed by: dfr, jhb Tested by: pho Approved by: kib (mentor) Modified: head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Thu Jun 4 14:13:06 2009 (r193436) +++ head/sys/rpc/clnt_dg.c Thu Jun 4 14:49:27 2009 (r193437) @@ -123,8 +123,11 @@ struct cu_socket { struct mtx cs_lock; int cs_refs; /* Count of clients */ struct cu_request_list cs_pending; /* Requests awaiting replies */ + int cs_upcallrefs; /* Refcnt of upcalls in prog.*/ }; +static void clnt_dg_upcallsdone(struct socket *, struct cu_socket *); + /* * Private data kept per client handle */ @@ -291,6 +294,7 @@ recheck_socket: } mtx_init(&cs->cs_lock, "cs->cs_lock", NULL, MTX_DEF); cs->cs_refs = 1; + cs->cs_upcallrefs = 0; TAILQ_INIT(&cs->cs_pending); soupcall_set(so, SO_RCV, clnt_dg_soupcall, cs); } @@ -988,10 +992,12 @@ clnt_dg_destroy(CLIENT *cl) cs->cs_refs--; if (cs->cs_refs == 0) { - mtx_destroy(&cs->cs_lock); + mtx_unlock(&cs->cs_lock); SOCKBUF_LOCK(&cu->cu_socket->so_rcv); soupcall_clear(cu->cu_socket, SO_RCV); + clnt_dg_upcallsdone(cu->cu_socket, cs); SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); + mtx_destroy(&cs->cs_lock); mem_free(cs, sizeof(*cs)); lastsocketref = TRUE; } else { @@ -1036,6 +1042,7 @@ clnt_dg_soupcall(struct socket *so, void int error, rcvflag, foundreq; uint32_t xid; + cs->cs_upcallrefs++; uio.uio_resid = 1000000000; uio.uio_td = curthread; do { @@ -1111,6 +1118,24 @@ clnt_dg_soupcall(struct socket *so, void if (!foundreq) m_freem(m); } while (m); + cs->cs_upcallrefs--; + if (cs->cs_upcallrefs < 0) + panic("rpcdg upcall refcnt"); + if (cs->cs_upcallrefs == 0) + wakeup(&cs->cs_upcallrefs); return (SU_OK); } +/* + * Wait for all upcalls in progress to complete. + */ +static void +clnt_dg_upcallsdone(struct socket *so, struct cu_socket *cs) +{ + + SOCKBUF_LOCK_ASSERT(&so->so_rcv); + + while (cs->cs_upcallrefs > 0) + (void) msleep(&cs->cs_upcallrefs, SOCKBUF_MTX(&so->so_rcv), 0, + "rpcdgup", 0); +} Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Thu Jun 4 14:13:06 2009 (r193436) +++ head/sys/rpc/clnt_vc.c Thu Jun 4 14:49:27 2009 (r193437) @@ -137,8 +137,11 @@ struct ct_data { size_t ct_record_resid; /* how much left of reply to read */ bool_t ct_record_eor; /* true if reading last fragment */ struct ct_request_list ct_pending; + int ct_upcallrefs; /* Ref cnt of upcalls in prog. */ }; +static void clnt_vc_upcallsdone(struct ct_data *); + static const char clnt_vc_errstr[] = "%s : %s"; static const char clnt_vc_str[] = "clnt_vc_create"; static const char clnt_read_vc_str[] = "read_vc"; @@ -184,6 +187,7 @@ clnt_vc_create( ct->ct_threads = 0; ct->ct_closing = FALSE; ct->ct_closed = FALSE; + ct->ct_upcallrefs = 0; if ((so->so_state & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0) { error = soconnect(so, raddr, curthread); @@ -753,6 +757,7 @@ clnt_vc_close(CLIENT *cl) SOCKBUF_LOCK(&ct->ct_socket->so_rcv); soupcall_clear(ct->ct_socket, SO_RCV); + clnt_vc_upcallsdone(ct); SOCKBUF_UNLOCK(&ct->ct_socket->so_rcv); /* @@ -825,6 +830,7 @@ clnt_vc_soupcall(struct socket *so, void uint32_t xid, header; bool_t do_read; + ct->ct_upcallrefs++; uio.uio_td = curthread; do { /* @@ -845,7 +851,7 @@ clnt_vc_soupcall(struct socket *so, void do_read = TRUE; if (!do_read) - return (SU_OK); + break; SOCKBUF_UNLOCK(&so->so_rcv); uio.uio_resid = sizeof(uint32_t); @@ -898,7 +904,7 @@ clnt_vc_soupcall(struct socket *so, void do_read = TRUE; if (!do_read) - return (SU_OK); + break; /* * We have the record mark. Read as much as @@ -979,5 +985,24 @@ clnt_vc_soupcall(struct socket *so, void } } } while (m); + ct->ct_upcallrefs--; + if (ct->ct_upcallrefs < 0) + panic("rpcvc upcall refcnt"); + if (ct->ct_upcallrefs == 0) + wakeup(&ct->ct_upcallrefs); return (SU_OK); } + +/* + * Wait for all upcalls in progress to complete. + */ +static void +clnt_vc_upcallsdone(struct ct_data *ct) +{ + + SOCKBUF_LOCK_ASSERT(&ct->ct_socket->so_rcv); + + while (ct->ct_upcallrefs > 0) + (void) msleep(&ct->ct_upcallrefs, + SOCKBUF_MTX(&ct->ct_socket->so_rcv), 0, "rpcvcup", 0); +} From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 15:44:17 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2078A106564A; Thu, 4 Jun 2009 15:44:17 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id CDE2D8FC1D; Thu, 4 Jun 2009 15:44:16 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n54FJxJX026617; Thu, 4 Jun 2009 11:19:59 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n54FJxrK026616; Thu, 4 Jun 2009 11:19:59 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Thu, 4 Jun 2009 11:19:59 -0400 From: David Schultz To: Ken Smith Message-ID: <20090604151959.GA26524@zim.MIT.EDU> Mail-Followup-To: Ken Smith , "Bjoern A. Zeeb" , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <200906011807.n51I7ccW086812@svn.freebsd.org> <1243880140.25229.23.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1243880140.25229.23.camel@bauer.cse.buffalo.edu> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, "Bjoern A. Zeeb" , src-committers@FreeBSD.ORG Subject: Re: svn commit: r193241 - in head: . sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 15:44:17 -0000 On Mon, Jun 01, 2009, Ken Smith wrote: > It was noted we're close to running out of numbers we can use before we > hit code freeze and the branch for the release. Since we're entering > code slush at the end of today in theory all changes that would warrant > a bump in __FreeBSD_version are supposed to be done. But it wouldn't > surprise me if we have one or two or so things that come along between > now and when we hit code freeze and the branch. So we need to be a bit > conservative with this. Please be sure to coordinate anything that > might require a bump in __FreeBSD_version with re@ from now on. If it > turns out things do come along that require bumps we'll need to "batch > them up" having one bump represent several changes. To avoid this sort of problem in the future, how about adding a digit to __FreeBSD_version in 9-CURRENT? Admittedly, a lot of the bumps in 8.X were probably unnecessary, but it's good that people are being cautious and documenting their incompatible changes. Better yet, we could automate the process somewhat and use something like the major version of FreeBSD concatenated with the SVN revision in lieu of __FreeBSD_version. From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 15:57:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17777106564A; Thu, 4 Jun 2009 15:57:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 048538FC18; Thu, 4 Jun 2009 15:57:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54FvdpQ096540; Thu, 4 Jun 2009 15:57:39 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54FvcHD096531; Thu, 4 Jun 2009 15:57:38 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906041557.n54FvcHD096531@svn.freebsd.org> From: Sam Leffler Date: Thu, 4 Jun 2009 15:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193439 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 15:57:39 -0000 Author: sam Date: Thu Jun 4 15:57:38 2009 New Revision: 193439 URL: http://svn.freebsd.org/changeset/base/193439 Log: o station mode channel switch support o IEEE80211_IOC_CHANSWITCH fixups: - restrict to hostap vaps - return EOPNOTSUPP instead of EINVAL when applied to !hostap vap or to a vap w/o 11h enabled - interpret count of 0 to mean cancel the current CSA Reviewed by: rpaulo, avatar Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_scan.h head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211.h Thu Jun 4 15:57:38 2009 (r193439) @@ -686,7 +686,7 @@ enum { IEEE80211_ELEMID_TPCREQ = 34, IEEE80211_ELEMID_TPCREP = 35, IEEE80211_ELEMID_SUPPCHAN = 36, - IEEE80211_ELEMID_CHANSWITCHANN = 37, + IEEE80211_ELEMID_CSA = 37, IEEE80211_ELEMID_MEASREQ = 38, IEEE80211_ELEMID_MEASREP = 39, IEEE80211_ELEMID_QUIET = 40, @@ -736,6 +736,14 @@ struct ieee80211_csa_ie { uint8_t csa_count; /* Channel Switch Count */ } __packed; +/* + * Note the min acceptable CSA count is used to guard against + * malicious CSA injection in station mode. Defining this value + * as other than 0 violates the 11h spec. + */ +#define IEEE80211_CSA_COUNT_MIN 2 +#define IEEE80211_CSA_COUNT_MAX 255 + /* rate set entries are in .5 Mb/s units, and potentially marked as basic */ #define IEEE80211_RATE_BASIC 0x80 #define IEEE80211_RATE_VAL 0x7f Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_input.c Thu Jun 4 15:57:38 2009 (r193439) @@ -475,6 +475,7 @@ ieee80211_parse_beacon(struct ieee80211_ * [tlv] ssid * [tlv] supported rates * [tlv] country information + * [tlv] channel switch announcement (CSA) * [tlv] parameter set (FH/DS) * [tlv] erp information * [tlv] extended supported rates @@ -508,6 +509,9 @@ ieee80211_parse_beacon(struct ieee80211_ case IEEE80211_ELEMID_COUNTRY: scan->country = frm; break; + case IEEE80211_ELEMID_CSA: + scan->csa = frm; + break; case IEEE80211_ELEMID_FHPARMS: if (ic->ic_phytype == IEEE80211_T_FH) { scan->fhdwell = LE_READ_2(&frm[2]); @@ -642,6 +646,14 @@ ieee80211_parse_beacon(struct ieee80211_ IEEE80211_VERIFY_LENGTH(scan->country[1], 3 * sizeof(uint8_t), scan->country = NULL); } + if (scan->csa != NULL) { + /* + * Validate Channel Switch Announcement; this must + * be the correct length or we toss the frame. + */ + IEEE80211_VERIFY_LENGTH(scan->csa[1], 3 * sizeof(uint8_t), + scan->status |= IEEE80211_BPARSE_CSA_INVALID); + } /* * Process HT ie's. This is complicated by our * accepting both the standard ie's and the pre-draft Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_ioctl.c Thu Jun 4 15:57:38 2009 (r193439) @@ -2304,8 +2304,10 @@ ieee80211_ioctl_chanswitch(struct ieee80 error = copyin(ireq->i_data, &csr, sizeof(csr)); if (error != 0) return error; - if ((vap->iv_flags & IEEE80211_F_DOTH) == 0) - return EINVAL; + /* XXX adhoc mode not supported */ + if (vap->iv_opmode != IEEE80211_M_HOSTAP || + (vap->iv_flags & IEEE80211_F_DOTH) == 0) + return EOPNOTSUPP; c = ieee80211_find_channel(ic, csr.csa_chan.ic_freq, csr.csa_chan.ic_flags); if (c == NULL) @@ -2313,6 +2315,8 @@ ieee80211_ioctl_chanswitch(struct ieee80 IEEE80211_LOCK(ic); if ((ic->ic_flags & IEEE80211_F_CSAPENDING) == 0) ieee80211_csa_startswitch(ic, c, csr.csa_mode, csr.csa_count); + else if (csr.csa_count == 0) + ieee80211_csa_cancelswitch(ic); else error = EBUSY; IEEE80211_UNLOCK(ic); Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_output.c Thu Jun 4 15:57:38 2009 (r193439) @@ -1468,7 +1468,7 @@ ieee80211_add_csa(uint8_t *frm, struct i struct ieee80211com *ic = vap->iv_ic; struct ieee80211_csa_ie *csa = (struct ieee80211_csa_ie *) frm; - csa->csa_ie = IEEE80211_ELEMID_CHANSWITCHANN; + csa->csa_ie = IEEE80211_ELEMID_CSA; csa->csa_len = 3; csa->csa_mode = 1; /* XXX force quiet on channel */ csa->csa_newchan = ieee80211_chan2ieee(ic, ic->ic_csa_newchan); Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_proto.c Thu Jun 4 15:57:38 2009 (r193439) @@ -1374,7 +1374,7 @@ beacon_miss(void *arg, int npending) * handlers duplicating these checks. */ if (vap->iv_opmode == IEEE80211_M_STA && - vap->iv_state == IEEE80211_S_RUN && + vap->iv_state >= IEEE80211_S_RUN && vap->iv_bmiss != NULL) vap->iv_bmiss(vap); } @@ -1451,8 +1451,8 @@ ieee80211_csa_startswitch(struct ieee802 IEEE80211_LOCK_ASSERT(ic); ic->ic_csa_newchan = c; + ic->ic_csa_mode = mode; ic->ic_csa_count = count; - /* XXX record mode? */ ic->ic_flags |= IEEE80211_F_CSAPENDING; TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { if (vap->iv_opmode == IEEE80211_M_HOSTAP || @@ -1465,6 +1465,19 @@ ieee80211_csa_startswitch(struct ieee802 ieee80211_notify_csa(ic, c, mode, count); } +static void +csa_completeswitch(struct ieee80211com *ic) +{ + struct ieee80211vap *vap; + + ic->ic_csa_newchan = NULL; + ic->ic_flags &= ~IEEE80211_F_CSAPENDING; + + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + if (vap->iv_state == IEEE80211_S_CSA) + ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0); +} + /* * Complete an 802.11h channel switch started by ieee80211_csa_startswitch. * We clear state and move all vap's in CSA state to RUN state @@ -1473,19 +1486,25 @@ ieee80211_csa_startswitch(struct ieee802 void ieee80211_csa_completeswitch(struct ieee80211com *ic) { - struct ieee80211vap *vap; - IEEE80211_LOCK_ASSERT(ic); KASSERT(ic->ic_flags & IEEE80211_F_CSAPENDING, ("csa not pending")); ieee80211_setcurchan(ic, ic->ic_csa_newchan); - ic->ic_csa_newchan = NULL; - ic->ic_flags &= ~IEEE80211_F_CSAPENDING; + csa_completeswitch(ic); +} - TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) - if (vap->iv_state == IEEE80211_S_CSA) - ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0); +/* + * Cancel an 802.11h channel switch started by ieee80211_csa_startswitch. + * We clear state and move all vap's in CSA state to RUN state + * so they can again transmit. + */ +void +ieee80211_csa_cancelswitch(struct ieee80211com *ic) +{ + IEEE80211_LOCK_ASSERT(ic); + + csa_completeswitch(ic); } /* Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_proto.h Thu Jun 4 15:57:38 2009 (r193439) @@ -340,6 +340,7 @@ int ieee80211_beacon_update(struct ieee8 void ieee80211_csa_startswitch(struct ieee80211com *, struct ieee80211_channel *, int mode, int count); void ieee80211_csa_completeswitch(struct ieee80211com *); +void ieee80211_csa_cancelswitch(struct ieee80211com *); void ieee80211_cac_completeswitch(struct ieee80211vap *); /* Modified: head/sys/net80211/ieee80211_scan.h ============================================================================== --- head/sys/net80211/ieee80211_scan.h Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_scan.h Thu Jun 4 15:57:38 2009 (r193439) @@ -176,6 +176,7 @@ enum { IEEE80211_BPARSE_CHAN_INVALID = 0x10, /* invalid FH/DSPARMS chan */ IEEE80211_BPARSE_OFFCHAN = 0x20, /* DSPARMS chan != curchan */ IEEE80211_BPARSE_BINTVAL_INVALID= 0x40, /* invalid beacon interval */ + IEEE80211_BPARSE_CSA_INVALID = 0x80, /* invalid CSA ie */ }; /* @@ -211,7 +212,8 @@ struct ieee80211_scanparams { uint8_t *htinfo; uint8_t *ath; uint8_t *tdma; - uint8_t *spare[4]; + uint8_t *csa; + uint8_t *spare[3]; }; /* Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_sta.c Thu Jun 4 15:57:38 2009 (r193439) @@ -106,15 +106,28 @@ sta_vattach(struct ieee80211vap *vap) static void sta_beacon_miss(struct ieee80211vap *vap) { - KASSERT((vap->iv_ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning")); - KASSERT(vap->iv_state == IEEE80211_S_RUN, - ("wrong state %d", vap->iv_state)); - - IEEE80211_DPRINTF(vap, - IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, - "beacon miss, mode %u state %s\n", - vap->iv_opmode, ieee80211_state_name[vap->iv_state]); + struct ieee80211com *ic = vap->iv_ic; + KASSERT((ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning")); + KASSERT(vap->iv_state >= IEEE80211_S_RUN, + ("wrong state %s", ieee80211_state_name[vap->iv_state])); + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, + "beacon miss, mode %s state %s\n", + ieee80211_opmode_name[vap->iv_opmode], + ieee80211_state_name[vap->iv_state]); + + if (vap->iv_state == IEEE80211_S_CSA) { + /* + * A Channel Switch is pending; assume we missed the + * beacon that would've completed the process and just + * force the switch. If we made a mistake we'll not + * find the AP on the new channel and fall back to a + * normal scan. + */ + ieee80211_csa_completeswitch(ic); + return; + } if (++vap->iv_bmiss_count < vap->iv_bmiss_max) { /* * Send a directed probe req before falling back to a @@ -359,6 +372,7 @@ sta_newstate(struct ieee80211vap *vap, e } switch (ostate) { case IEEE80211_S_RUN: + case IEEE80211_S_CSA: break; case IEEE80211_S_AUTH: /* when join is done in fw */ case IEEE80211_S_ASSOC: @@ -412,6 +426,10 @@ sta_newstate(struct ieee80211vap *vap, e if (ic->ic_newassoc != NULL) ic->ic_newassoc(vap->iv_bss, ostate != IEEE80211_S_RUN); break; + case IEEE80211_S_CSA: + if (ostate != IEEE80211_S_RUN) + goto invalid; + break; case IEEE80211_S_SLEEP: ieee80211_sta_pwrsave(vap, 0); break; @@ -1080,6 +1098,112 @@ ieee80211_parse_wmeparams(struct ieee802 } /* + * Process 11h Channel Switch Announcement (CSA) ie. If this + * is the first CSA then initiate the switch. Otherwise we + * track state and trigger completion and/or cancel of the switch. + * XXX should be public for IBSS use + */ +static void +ieee80211_parse_csaparams(struct ieee80211vap *vap, uint8_t *frm, + const struct ieee80211_frame *wh) +{ + struct ieee80211com *ic = vap->iv_ic; + const struct ieee80211_csa_ie *csa = + (const struct ieee80211_csa_ie *) frm; + + KASSERT(vap->iv_state >= IEEE80211_S_RUN, + ("state %s", ieee80211_state_name[vap->iv_state])); + + if (csa->csa_mode > 1) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_DOTH, + wh, "CSA", "invalid mode %u", csa->csa_mode); + return; + } + IEEE80211_LOCK(ic); + if ((ic->ic_flags & IEEE80211_F_CSAPENDING) == 0) { + /* + * Convert the channel number to a channel reference. We + * try first to preserve turbo attribute of the current + * channel then fallback. Note this will not work if the + * CSA specifies a channel that requires a band switch (e.g. + * 11a => 11g). This is intentional as 11h is defined only + * for 5GHz/11a and because the switch does not involve a + * reassociation, protocol state (capabilities, negotated + * rates, etc) may/will be wrong. + */ + struct ieee80211_channel *c = + ieee80211_find_channel_byieee(ic, csa->csa_newchan, + (ic->ic_bsschan->ic_flags & IEEE80211_CHAN_ALLTURBO)); + if (c == NULL) { + c = ieee80211_find_channel_byieee(ic, + csa->csa_newchan, + (ic->ic_bsschan->ic_flags & IEEE80211_CHAN_ALL)); + if (c == NULL) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_DOTH, + wh, "CSA", "invalid channel %u", + csa->csa_newchan); + goto done; + } + } +#if IEEE80211_CSA_COUNT_MIN > 0 + if (csa->csa_count < IEEE80211_CSA_COUNT_MIN) { + /* + * Require at least IEEE80211_CSA_COUNT_MIN count to + * reduce the risk of being redirected by a fabricated + * CSA. If a valid CSA is dropped we'll still get a + * beacon miss when the AP leaves the channel so we'll + * eventually follow to the new channel. + * + * NOTE: this violates the 11h spec that states that + * count may be any value and if 0 then a switch + * should happen asap. + */ + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_DOTH, + wh, "CSA", "count %u too small, must be >= %u", + csa->csa_count, IEEE80211_CSA_COUNT_MIN); + goto done; + } +#endif + ieee80211_csa_startswitch(ic, c, csa->csa_mode, csa->csa_count); + } else { + /* + * Validate this ie against the initial CSA. We require + * mode and channel not change and the count must be + * monotonically decreasing. This may be pointless and + * canceling the switch as a result may be too paranoid but + * in the worst case if we drop out of CSA because of this + * and the AP does move then we'll just end up taking a + * beacon miss and scan to find the AP. + * + * XXX may want <= on count as we also process ProbeResp + * frames and those may come in w/ the same count as the + * previous beacon; but doing so leaves us open to a stuck + * count until we add a dead-man timer + */ + if (!(csa->csa_count < ic->ic_csa_count && + csa->csa_mode == ic->ic_csa_mode && + csa->csa_newchan == ieee80211_chan2ieee(ic, ic->ic_csa_newchan))) { + IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_DOTH, wh, + "CSA ie mismatch, initial ie <%d,%d,%d>, " + "this ie <%d,%d,%d>", ic->ic_csa_mode, + ic->ic_csa_newchan, ic->ic_csa_count, + csa->csa_mode, csa->csa_newchan, csa->csa_count); + ieee80211_csa_cancelswitch(ic); + } else { + if (csa->csa_count <= 1) + ieee80211_csa_completeswitch(ic); + else + ic->ic_csa_count = csa->csa_count; + } + } +done: + IEEE80211_UNLOCK(ic); +} + +/* * Return non-zero if a background scan may be continued: * o bg scan is active * o no channel switch is pending @@ -1245,6 +1369,20 @@ sta_recv_mgmt(struct ieee80211_node *ni, ni->ni_dtim_count = tim->tim_count; ni->ni_dtim_period = tim->tim_period; } + if (scan.csa != NULL && + (vap->iv_flags & IEEE80211_F_DOTH)) + ieee80211_parse_csaparams(vap, scan.csa, wh); + else if (ic->ic_flags & IEEE80211_F_CSAPENDING) { + /* + * No CSA ie or 11h disabled, but a channel + * switch is pending; drop out so we aren't + * stuck in CSA state. If the AP really is + * moving we'll get a beacon miss and scan. + */ + IEEE80211_LOCK(ic); + ieee80211_csa_cancelswitch(ic); + IEEE80211_UNLOCK(ic); + } /* * If scanning, pass the info to the scan module. * Otherwise, check if it's the right time to do Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_var.h Thu Jun 4 15:57:38 2009 (r193439) @@ -181,7 +181,8 @@ struct ieee80211com { /* 802.11h/DFS state */ struct ieee80211_channel *ic_csa_newchan;/* channel for doing CSA */ - int ic_csa_count; /* count for doing CSA */ + short ic_csa_mode; /* mode for doing CSA */ + short ic_csa_count; /* count for doing CSA */ struct ieee80211_dfs_state ic_dfs; /* DFS state */ struct ieee80211_scan_state *ic_scan; /* scan state */ From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 15:58:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A4A7106570E for ; Thu, 4 Jun 2009 15:58:18 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outO.internet-mail-service.net (outo.internet-mail-service.net [216.240.47.238]) by mx1.freebsd.org (Postfix) with ESMTP id 09D778FC20 for ; Thu, 4 Jun 2009 15:58:17 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id B4CE7B9840; Thu, 4 Jun 2009 08:58:40 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 356A72D6026; Thu, 4 Jun 2009 08:58:17 -0700 (PDT) Message-ID: <4A27EF19.6050606@elischer.org> Date: Thu, 04 Jun 2009 08:58:17 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Doug Rabson References: <200906041122.n54BMrIP089508@svn.freebsd.org> <7bed97456290a8e2454188cadae2ff36@mail.rabson.org> In-Reply-To: <7bed97456290a8e2454188cadae2ff36@mail.rabson.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r193434 - head/sys/nlm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 15:58:19 -0000 Doug Rabson wrote: > On Thu, 4 Jun 2009 11:22:53 +0000 (UTC), Ed Schouten > wrote: >> Author: ed >> Date: Thu Jun 4 11:22:53 2009 >> New Revision: 193434 >> URL: http://svn.freebsd.org/changeset/base/193434 >> >> Log: >> Correct typo; errno => error. > > Thanks Ed. Now where did I leave that pointy hat :( look up From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 16:18:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 682AD1065670; Thu, 4 Jun 2009 16:18:08 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 556EC8FC17; Thu, 4 Jun 2009 16:18:08 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54GI8Np097008; Thu, 4 Jun 2009 16:18:08 GMT (envelope-from ps@svn.freebsd.org) Received: (from ps@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54GI851097005; Thu, 4 Jun 2009 16:18:08 GMT (envelope-from ps@svn.freebsd.org) Message-Id: <200906041618.n54GI851097005@svn.freebsd.org> From: Paul Saab Date: Thu, 4 Jun 2009 16:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193440 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 16:18:09 -0000 Author: ps Date: Thu Jun 4 16:18:07 2009 New Revision: 193440 URL: http://svn.freebsd.org/changeset/base/193440 Log: Support shared vnode locks for write operations when the offset is provided on filesystems that support it. This really improves mysql + innodb performance on ZFS. Reviewed by: jhb, kmacy, jeffr Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/kern/vfs_vnops.c head/sys/sys/mount.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jun 4 15:57:38 2009 (r193439) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jun 4 16:18:07 2009 (r193440) @@ -573,6 +573,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->mnt_flag |= MNT_LOCAL; vfsp->mnt_kern_flag |= MNTK_MPSAFE; vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; + vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; if (error = dsl_prop_get_integer(osname, "readonly", &readonly, NULL)) goto out; Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jun 4 15:57:38 2009 (r193439) +++ head/sys/kern/vfs_vnops.c Thu Jun 4 16:18:07 2009 (r193440) @@ -367,7 +367,7 @@ vn_rdwr(rw, vp, base, len, offset, segfl struct iovec aiov; struct mount *mp; struct ucred *cred; - int error; + int error, lock_flags; VFS_ASSERT_GIANT(vp->v_mount); @@ -378,7 +378,13 @@ vn_rdwr(rw, vp, base, len, offset, segfl (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) return (error); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if (mp != NULL && + (mp->mnt_kern_flag & MNTK_SHARED_WRITES)) { + lock_flags = LK_SHARED; + } else { + lock_flags = LK_EXCLUSIVE; + } + vn_lock(vp, lock_flags | LK_RETRY); } else vn_lock(vp, LK_SHARED | LK_RETRY); @@ -564,7 +570,7 @@ vn_write(fp, uio, active_cred, flags, td { struct vnode *vp; struct mount *mp; - int error, ioflag; + int error, ioflag, lock_flags; int vfslocked; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", @@ -587,7 +593,16 @@ vn_write(fp, uio, active_cred, flags, td if (vp->v_type != VCHR && (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto unlock; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + + if (vp->v_mount != NULL && + (vp->v_mount->mnt_kern_flag & MNTK_SHARED_WRITES) && + (flags & FOF_OFFSET) != 0) { + lock_flags = LK_SHARED; + } else { + lock_flags = LK_EXCLUSIVE; + } + + vn_lock(vp, lock_flags | LK_RETRY); if ((flags & FOF_OFFSET) == 0) uio->uio_offset = fp->f_offset; ioflag |= sequential_heuristic(uio, fp); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Thu Jun 4 15:57:38 2009 (r193439) +++ head/sys/sys/mount.h Thu Jun 4 16:18:07 2009 (r193440) @@ -326,6 +326,7 @@ void __mnt_vnode_markerfree(str #define MNTK_DRAINING 0x00000010 /* lock draining is happening */ #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ #define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ +#define MNTK_SHARED_WRITES 0x00000080 /* Allow shared locking for writes */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ #define MNTK_SUSPEND 0x08000000 /* request write suspension */ From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 16:19:54 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CFC91065670; Thu, 4 Jun 2009 16:19:54 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1CA798FC15; Thu, 4 Jun 2009 16:19:54 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n54GHfoE058438; Thu, 4 Jun 2009 10:17:41 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 04 Jun 2009 10:17:55 -0600 (MDT) Message-Id: <20090604.101755.1493773383.imp@bsdimp.com> To: das@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20090604151959.GA26524@zim.MIT.EDU> References: <200906011807.n51I7ccW086812@svn.freebsd.org> <1243880140.25229.23.camel@bauer.cse.buffalo.edu> <20090604151959.GA26524@zim.MIT.EDU> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, kensmith@cse.Buffalo.EDU, bz@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193241 - in head: . sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 16:19:54 -0000 In message: <20090604151959.GA26524@zim.MIT.EDU> David Schultz writes: : On Mon, Jun 01, 2009, Ken Smith wrote: : > It was noted we're close to running out of numbers we can use before we : > hit code freeze and the branch for the release. Since we're entering : > code slush at the end of today in theory all changes that would warrant : > a bump in __FreeBSD_version are supposed to be done. But it wouldn't : > surprise me if we have one or two or so things that come along between : > now and when we hit code freeze and the branch. So we need to be a bit : > conservative with this. Please be sure to coordinate anything that : > might require a bump in __FreeBSD_version with re@ from now on. If it : > turns out things do come along that require bumps we'll need to "batch : > them up" having one bump represent several changes. : : To avoid this sort of problem in the future, how about adding a : digit to __FreeBSD_version in 9-CURRENT? Admittedly, a lot of the : bumps in 8.X were probably unnecessary, but it's good that people : are being cautious and documenting their incompatible changes. We can avoid this problem by not being so bump-happy. Adding an extra digit was painful when we did it before. A number of subtle things broke (like the output of file). Part of the problem here is that we want to ship FreeBSD 8.0 as '800100' which is just historical convention: * scheme is: Rxx * 'R' is 0 if release branch or x.0-CURRENT before RELENG_*_0 * is created, otherwise 1. We could easily up that to '5' for the release so we have 499 entries. There aren't so many things that depend on this convention in the tree (I couldn't find any in a quick, informal survey). * scheme is: Rxx * 'R' is less than 5 if release branch or x.0-CURRENT * before RELENG_*_0 is created, otherwise 5 or greater. I think is the only change we really need to make. : Better yet, we could automate the process somewhat and use : something like the major version of FreeBSD concatenated with the : SVN revision in lieu of __FreeBSD_version. I think this would be worse. First, external trackers would have difficulty updating this. Second, __FreeBSD_version is used to indicate kernel ABI points (at least recently, this is lame and should be reverted for the RELENG branch, but I digress). Third, ports use it to determine where we are and build things differently. I think this would complicate their lives and make documenting the points more difficult. This is one of those things that I don't think should be totally automated. Warner From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 16:28:30 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56AF7106567B; Thu, 4 Jun 2009 16:28:30 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 0E9B68FC0C; Thu, 4 Jun 2009 16:28:29 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n54GUvIC027128; Thu, 4 Jun 2009 12:30:57 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n54GUvJH027127; Thu, 4 Jun 2009 12:30:57 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Thu, 4 Jun 2009 12:30:57 -0400 From: David Schultz To: "M. Warner Losh" Message-ID: <20090604163057.GA27090@zim.MIT.EDU> Mail-Followup-To: "M. Warner Losh" , kensmith@cse.Buffalo.EDU, bz@FreeBSD.ORG, src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <200906011807.n51I7ccW086812@svn.freebsd.org> <1243880140.25229.23.camel@bauer.cse.buffalo.edu> <20090604151959.GA26524@zim.MIT.EDU> <20090604.101755.1493773383.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090604.101755.1493773383.imp@bsdimp.com> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, kensmith@cse.Buffalo.EDU, src-committers@FreeBSD.ORG, bz@FreeBSD.ORG Subject: Re: svn commit: r193241 - in head: . sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 16:28:30 -0000 On Thu, Jun 04, 2009, M. Warner Losh wrote: > In message: <20090604151959.GA26524@zim.MIT.EDU> > David Schultz writes: > : On Mon, Jun 01, 2009, Ken Smith wrote: > : > It was noted we're close to running out of numbers we can use before we > : > hit code freeze and the branch for the release. Since we're entering > : > code slush at the end of today in theory all changes that would warrant > : > a bump in __FreeBSD_version are supposed to be done. But it wouldn't > : > surprise me if we have one or two or so things that come along between > : > now and when we hit code freeze and the branch. So we need to be a bit > : > conservative with this. Please be sure to coordinate anything that > : > might require a bump in __FreeBSD_version with re@ from now on. If it > : > turns out things do come along that require bumps we'll need to "batch > : > them up" having one bump represent several changes. > : > : To avoid this sort of problem in the future, how about adding a > : digit to __FreeBSD_version in 9-CURRENT? Admittedly, a lot of the > : bumps in 8.X were probably unnecessary, but it's good that people > : are being cautious and documenting their incompatible changes. > > We can avoid this problem by not being so bump-happy. > > Adding an extra digit was painful when we did it before. A number of > subtle things broke (like the output of file). > > Part of the problem here is that we want to ship FreeBSD 8.0 as > '800100' which is just historical convention: > > * scheme is: Rxx > * 'R' is 0 if release branch or x.0-CURRENT before RELENG_*_0 > * is created, otherwise 1. > > We could easily up that to '5' for the release so we have 499 > entries. There aren't so many things that depend on this convention in > the tree (I couldn't find any in a quick, informal survey). Sounds good. We might want to use 7 or 8 instead of 5 to account for the fact that changes requiring a bump are more frequent in CURRENT than in STABLE. From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 16:31:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19BAA106572D; Thu, 4 Jun 2009 16:31:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4BA8FC15; Thu, 4 Jun 2009 16:31:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1MCFqG-0006I8-4o; Thu, 04 Jun 2009 19:31:00 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n54GUup6070992 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Jun 2009 19:30:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n54GUuwt067771; Thu, 4 Jun 2009 19:30:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n54GUuBa067766; Thu, 4 Jun 2009 19:30:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 4 Jun 2009 19:30:56 +0300 From: Kostik Belousov To: Paul Saab Message-ID: <20090604163056.GW1927@deviant.kiev.zoral.com.ua> References: <200906041618.n54GI851097005@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qEtvru/posgxJ0S3" Content-Disposition: inline In-Reply-To: <200906041618.n54GI851097005@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.1 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1MCFqG-0006I8-4o 2e9e4e42ef29065eeb11ce9910c78272 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193440 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 16:31:03 -0000 --qEtvru/posgxJ0S3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 04, 2009 at 04:18:08PM +0000, Paul Saab wrote: > Author: ps > Date: Thu Jun 4 16:18:07 2009 > New Revision: 193440 > URL: http://svn.freebsd.org/changeset/base/193440 >=20 > Log: > Support shared vnode locks for write operations when the offset is > provided on filesystems that support it. This really improves mysql > + innodb performance on ZFS. > =20 > Reviewed by: jhb, kmacy, jeffr >=20 > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > head/sys/kern/vfs_vnops.c > head/sys/sys/mount.h >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu = Jun 4 15:57:38 2009 (r193439) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu = Jun 4 16:18:07 2009 (r193440) > @@ -573,6 +573,7 @@ zfs_domount(vfs_t *vfsp, char *osname) > vfsp->mnt_flag |=3D MNT_LOCAL; > vfsp->mnt_kern_flag |=3D MNTK_MPSAFE; > vfsp->mnt_kern_flag |=3D MNTK_LOOKUP_SHARED; > + vfsp->mnt_kern_flag |=3D MNTK_SHARED_WRITES; > =20 > if (error =3D dsl_prop_get_integer(osname, "readonly", &readonly, NULL)) > goto out; >=20 > Modified: head/sys/kern/vfs_vnops.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/vfs_vnops.c Thu Jun 4 15:57:38 2009 (r193439) > +++ head/sys/kern/vfs_vnops.c Thu Jun 4 16:18:07 2009 (r193440) > @@ -367,7 +367,7 @@ vn_rdwr(rw, vp, base, len, offset, segfl > struct iovec aiov; > struct mount *mp; > struct ucred *cred; > - int error; > + int error, lock_flags; > =20 > VFS_ASSERT_GIANT(vp->v_mount); > =20 > @@ -378,7 +378,13 @@ vn_rdwr(rw, vp, base, len, offset, segfl > (error =3D vn_start_write(vp, &mp, V_WAIT | PCATCH)) > !=3D 0) > return (error); > - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > + if (mp !=3D NULL && > + (mp->mnt_kern_flag & MNTK_SHARED_WRITES)) { > + lock_flags =3D LK_SHARED; > + } else { > + lock_flags =3D LK_EXCLUSIVE; > + } > + vn_lock(vp, lock_flags | LK_RETRY); > } else > vn_lock(vp, LK_SHARED | LK_RETRY); > =20 > @@ -564,7 +570,7 @@ vn_write(fp, uio, active_cred, flags, td > { > struct vnode *vp; > struct mount *mp; > - int error, ioflag; > + int error, ioflag, lock_flags; > int vfslocked; > =20 > KASSERT(uio->uio_td =3D=3D td, ("uio_td %p is not td %p", > @@ -587,7 +593,16 @@ vn_write(fp, uio, active_cred, flags, td > if (vp->v_type !=3D VCHR && > (error =3D vn_start_write(vp, &mp, V_WAIT | PCATCH)) !=3D 0) > goto unlock; > - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > +=20 > + if (vp->v_mount !=3D NULL && > + (vp->v_mount->mnt_kern_flag & MNTK_SHARED_WRITES) && > + (flags & FOF_OFFSET) !=3D 0) { > + lock_flags =3D LK_SHARED; > + } else { > + lock_flags =3D LK_EXCLUSIVE; > + } > + > + vn_lock(vp, lock_flags | LK_RETRY); > if ((flags & FOF_OFFSET) =3D=3D 0) > uio->uio_offset =3D fp->f_offset; > ioflag |=3D sequential_heuristic(uio, fp); Why do you check for vnode v_mount flags in vn_write, while performing the check on the vop_getwritemount(vp) result for vn_rdwr ? --qEtvru/posgxJ0S3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkon9r8ACgkQC3+MBN1Mb4gPQgCg8DPGr3LwncSOOjHAWuCSjjLM y84Anjy/sfJxO6pgpt+TAdjgJag5qLYo =Bf4f -----END PGP SIGNATURE----- --qEtvru/posgxJ0S3-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 16:50:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E087010656C6; Thu, 4 Jun 2009 16:50:04 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEBB98FC1A; Thu, 4 Jun 2009 16:50:04 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54Go4FY097783; Thu, 4 Jun 2009 16:50:04 GMT (envelope-from ps@svn.freebsd.org) Received: (from ps@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54Go34d097782; Thu, 4 Jun 2009 16:50:03 GMT (envelope-from ps@svn.freebsd.org) Message-Id: <200906041650.n54Go34d097782@svn.freebsd.org> From: Paul Saab Date: Thu, 4 Jun 2009 16:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193442 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 16:50:05 -0000 Author: ps Date: Thu Jun 4 16:50:03 2009 New Revision: 193442 URL: http://svn.freebsd.org/changeset/base/193442 Log: When checking for shared writes, use the struct mount returned from vn_start_write. Reviewed by: jhb Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jun 4 16:20:19 2009 (r193441) +++ head/sys/kern/vfs_vnops.c Thu Jun 4 16:50:03 2009 (r193442) @@ -594,8 +594,7 @@ vn_write(fp, uio, active_cred, flags, td (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto unlock; - if (vp->v_mount != NULL && - (vp->v_mount->mnt_kern_flag & MNTK_SHARED_WRITES) && + if (mp != NULL && (mp->mnt_kern_flag & MNTK_SHARED_WRITES) && (flags & FOF_OFFSET) != 0) { lock_flags = LK_SHARED; } else { From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 18:22:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71C7106571E; Thu, 4 Jun 2009 18:22:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D70948FC16; Thu, 4 Jun 2009 18:22:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54IMLL7000212; Thu, 4 Jun 2009 18:22:21 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54IML6o000211; Thu, 4 Jun 2009 18:22:21 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906041822.n54IML6o000211@svn.freebsd.org> From: Sam Leffler Date: Thu, 4 Jun 2009 18:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193447 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 18:22:22 -0000 Author: sam Date: Thu Jun 4 18:22:21 2009 New Revision: 193447 URL: http://svn.freebsd.org/changeset/base/193447 Log: track rename of CSA ie Submitted by: wxs Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Thu Jun 4 18:03:13 2009 (r193446) +++ head/sbin/ifconfig/ifieee80211.c Thu Jun 4 18:22:21 2009 (r193447) @@ -2888,7 +2888,7 @@ iename(int elemid) case IEEE80211_ELEMID_TPCREQ: return " TPCREQ"; case IEEE80211_ELEMID_TPCREP: return " TPCREP"; case IEEE80211_ELEMID_SUPPCHAN: return " SUPPCHAN"; - case IEEE80211_ELEMID_CHANSWITCHANN:return " CSA"; + case IEEE80211_ELEMID_CSA: return " CSA"; case IEEE80211_ELEMID_MEASREQ: return " MEASREQ"; case IEEE80211_ELEMID_MEASREP: return " MEASREP"; case IEEE80211_ELEMID_QUIET: return " QUIET"; From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 19:07:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0FA41065672; Thu, 4 Jun 2009 19:07:14 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206192061.chello.pl [87.206.192.61]) by mx1.freebsd.org (Postfix) with ESMTP id 7F8808FC19; Thu, 4 Jun 2009 19:07:14 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 8668945C98; Thu, 4 Jun 2009 21:07:12 +0200 (CEST) Received: from localhost (chello087206192061.chello.pl [87.206.192.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id C027145B36; Thu, 4 Jun 2009 21:07:06 +0200 (CEST) Date: Thu, 4 Jun 2009 21:07:09 +0200 From: Pawel Jakub Dawidek To: Robert Watson Message-ID: <20090604190709.GA1705@garage.freebsd.pl> References: <200906041030.n54AUIh4084623@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline In-Reply-To: <200906041030.n54AUIh4084623@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193433 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 19:07:15 -0000 --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 04, 2009 at 10:30:18AM +0000, Robert Watson wrote: > Author: rwatson > Date: Thu Jun 4 10:30:18 2009 > New Revision: 193433 > URL: http://svn.freebsd.org/changeset/base/193433 >=20 > Log: > Re-add opt_mac.h include, which is required in order for MNT_MULTILABEL > to be set properly on devfs. Otherwise, it isn't possible to set labels > on /dev nodes. > =20 > Reported by: Sergio Rodriguez > MFC after: 3 days I'm afraid that's not the only case: http://people.freebsd.org/~pjd/patches/opt_mac.patch --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --fUYQa+Pmc3FrFX/N Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKKBtdForvXbEpPzQRAuj9AKDGG94I13JS3MdSydVMXHJnYQyjSwCfQrUO Bi6hrflOW+jhiIbqaEGlaXY= =TgfA -----END PGP SIGNATURE----- --fUYQa+Pmc3FrFX/N-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 19:09:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 910251065673; Thu, 4 Jun 2009 19:09:16 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206192061.chello.pl [87.206.192.61]) by mx1.freebsd.org (Postfix) with ESMTP id C8C728FC17; Thu, 4 Jun 2009 19:09:15 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 6203745B26; Thu, 4 Jun 2009 21:09:14 +0200 (CEST) Received: from localhost (chello087206192061.chello.pl [87.206.192.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id F00E04569A; Thu, 4 Jun 2009 21:09:08 +0200 (CEST) Date: Thu, 4 Jun 2009 21:09:12 +0200 From: Pawel Jakub Dawidek To: Robert Watson Message-ID: <20090604190912.GB1705@garage.freebsd.pl> References: <200906041030.n54AUIh4084623@svn.freebsd.org> <20090604190709.GA1705@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V0207lvV8h4k8FAm" Content-Disposition: inline In-Reply-To: <20090604190709.GA1705@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193433 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 19:09:17 -0000 --V0207lvV8h4k8FAm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 04, 2009 at 09:07:09PM +0200, Pawel Jakub Dawidek wrote: > On Thu, Jun 04, 2009 at 10:30:18AM +0000, Robert Watson wrote: > > Author: rwatson > > Date: Thu Jun 4 10:30:18 2009 > > New Revision: 193433 > > URL: http://svn.freebsd.org/changeset/base/193433 > >=20 > > Log: > > Re-add opt_mac.h include, which is required in order for MNT_MULTILAB= EL > > to be set properly on devfs. Otherwise, it isn't possible to set lab= els > > on /dev nodes. > > =20 > > Reported by: Sergio Rodriguez > > MFC after: 3 days >=20 > I'm afraid that's not the only case: >=20 > http://people.freebsd.org/~pjd/patches/opt_mac.patch I forgot to mention that even a compile test wasn't made and for dev/cxgb/ulp/tom/cxgb_cpl_io.c including opt_mac.h will trigger this: #ifdef MAC #error "no MAC support" #endif --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --V0207lvV8h4k8FAm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKKBvXForvXbEpPzQRAnMPAJ9VdvjtbDPYP6I/yjMJ4Im5NuEIGwCeOzTA A5kTbUH03kX3qcWku5dIYG4= =OXBh -----END PGP SIGNATURE----- --V0207lvV8h4k8FAm-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 21:48:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0D561065673; Thu, 4 Jun 2009 21:48:04 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE6E88FC13; Thu, 4 Jun 2009 21:48:04 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54Lm435005167; Thu, 4 Jun 2009 21:48:04 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54Lm4UM005166; Thu, 4 Jun 2009 21:48:04 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906042148.n54Lm4UM005166@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 4 Jun 2009 21:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193462 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 21:48:05 -0000 Author: edwin Date: Thu Jun 4 21:48:04 2009 New Revision: 193462 URL: http://svn.freebsd.org/changeset/base/193462 Log: [patch] calendar.music: Chuck Berry was born in St. Louis, Missouri, not California The /usr/bin/calendar program reports that Chuck Berry was born in San Jose California but he was not born in California. Chuck Berry was born in St. Louis, Missouri in 1926 on October 18. http://www.chuckberry.com/about/bio.htm http://www.khaldea.com/charts/chuckberry.shtml http://en.wikipedia.org/wiki/Chuck_Berry PR: conf/128215 Submitted by: comet--berkeley (aka Pablo Picasso) MFC after: 2 days Modified: head/usr.bin/calendar/calendars/calendar.music Modified: head/usr.bin/calendar/calendars/calendar.music ============================================================================== --- head/usr.bin/calendar/calendars/calendar.music Thu Jun 4 21:45:16 2009 (r193461) +++ head/usr.bin/calendar/calendars/calendar.music Thu Jun 4 21:48:04 2009 (r193462) @@ -182,7 +182,7 @@ 10/16 Bob Weir (Grateful Dead) is born in San Francisco, 1947 10/17 "Hair" opens at New York's Public Theater, 1967 10/17 Frederic Chopin dies in Paris, France, 1849 -10/18 Chuck Berry is born in San Jose, California, 1926 +10/18 Chuck Berry is born in St. Louis, Missouri, 1926 10/20 Three members of Lynyrd Skynyrd die in a plane crash, 1977 10/21 Jesus Christ Super Star debuted on Broadway, 1971 10/22 Franz Liszt born, 1811 From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 21:55:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A8FC1065670; Thu, 4 Jun 2009 21:55:08 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58A8C8FC1F; Thu, 4 Jun 2009 21:55:08 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54Lt8Co005391; Thu, 4 Jun 2009 21:55:08 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54Lt7Mv005389; Thu, 4 Jun 2009 21:55:07 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906042155.n54Lt7Mv005389@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 4 Jun 2009 21:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193464 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 21:55:09 -0000 Author: edwin Date: Thu Jun 4 21:55:07 2009 New Revision: 193464 URL: http://svn.freebsd.org/changeset/base/193464 Log: [patch] fortune(6): file not Y2.01K compliant Update the time in the fortune to make the joke a little bit more realistic again: Bump year from 2009 to 2039. PR: conf/129860 Submitted by: Alan Amesbury MFC after: 2 days Modified: head/games/fortune/datfiles/fortunes-o.real Modified: head/games/fortune/datfiles/fortunes-o.real ============================================================================== --- head/games/fortune/datfiles/fortunes-o.real Thu Jun 4 21:48:17 2009 (r193463) +++ head/games/fortune/datfiles/fortunes-o.real Thu Jun 4 21:55:07 2009 (r193464) @@ -4242,7 +4242,7 @@ Apple owners do it with mice! APPOINTMENT BOOK: The reference of last resort when trying to duck undesired invitations ("Gee, the soonest I can pencil you in is - December, 2009"), or when trying to figure out what the hell + December, 2039"), or when trying to figure out what the hell it was you did during the past year. % Approximately 80% of our air pollution stems from hydrocarbons From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 21:59:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FD8E10656A3; Thu, 4 Jun 2009 21:59:28 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DE788FC17; Thu, 4 Jun 2009 21:59:28 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54LxSLR005514; Thu, 4 Jun 2009 21:59:28 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54LxS2Q005513; Thu, 4 Jun 2009 21:59:28 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906042159.n54LxS2Q005513@svn.freebsd.org> From: Andrew Thompson Date: Thu, 4 Jun 2009 21:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193465 - head/sys/dev/sound/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 21:59:28 -0000 Author: thompsa Date: Thu Jun 4 21:59:28 2009 New Revision: 193465 URL: http://svn.freebsd.org/changeset/base/193465 Log: revert r162516. We only support 1 or 2 channels per stream which reflects mono and stereo. Submitted by: Hans Petter Selasky Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Jun 4 21:55:07 2009 (r193464) +++ head/sys/dev/sound/usb/uaudio.c Thu Jun 4 21:59:28 2009 (r193465) @@ -97,7 +97,7 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) -#define UAUDIO_MAX_CHAN(x) (((x) < 2) ? (x) : 2) /* XXX fixme later */ +#define UAUDIO_MAX_CHAN(x) (x) struct uaudio_mixer_node { int32_t minval; @@ -940,6 +940,8 @@ uaudio_chan_fill_info_sub(struct uaudio_ bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); bBitResolution = asf1d->bBitResolution; + DPRINTFN(9, "bChannels=%u\n", bChannels); + if (asf1d->bSamFreqType == 0) { DPRINTFN(16, "Sample rate: %d-%dHz\n", UA_SAMP_LO(asf1d), UA_SAMP_HI(asf1d)); From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 22:00:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3561C1065697; Thu, 4 Jun 2009 22:00:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21D238FC1E; Thu, 4 Jun 2009 22:00:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54M0nbS005607; Thu, 4 Jun 2009 22:00:49 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54M0nTl005606; Thu, 4 Jun 2009 22:00:49 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906042200.n54M0nTl005606@svn.freebsd.org> From: Andrew Thompson Date: Thu, 4 Jun 2009 22:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193466 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 22:00:50 -0000 Author: thompsa Date: Thu Jun 4 22:00:48 2009 New Revision: 193466 URL: http://svn.freebsd.org/changeset/base/193466 Log: Remove duplicate variable setting. Spotted by: Sylvestre Gallon Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Thu Jun 4 21:59:28 2009 (r193465) +++ head/sys/dev/usb/input/ukbd.c Thu Jun 4 22:00:48 2009 (r193466) @@ -706,7 +706,6 @@ ukbd_attach(device_t dev) sc->sc_iface_index = uaa->info.bIfaceIndex; sc->sc_iface_no = uaa->info.bIfaceNum; sc->sc_mode = K_XLATE; - sc->sc_iface = uaa->iface; usb2_callout_init_mtx(&sc->sc_callout, &Giant, 0); From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 22:01:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 101EC106570A; Thu, 4 Jun 2009 22:01:52 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F09848FC0A; Thu, 4 Jun 2009 22:01:51 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54M1ptI005677; Thu, 4 Jun 2009 22:01:51 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54M1onU005674; Thu, 4 Jun 2009 22:01:50 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906042201.n54M1onU005674@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 4 Jun 2009 22:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193467 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 22:01:53 -0000 Author: edwin Date: Thu Jun 4 22:01:50 2009 New Revision: 193467 URL: http://svn.freebsd.org/changeset/base/193467 Log: [patch] fortune(6): George Bernard Shaw quote fix From the original PR: s/milestones/millstones/ and less important.. s/man/Man/ Not every source I've seen capitalizes 'Man', but it seems right. Uncapitalized 'man' would usually be preceded by an 'a'. But I haven't seen any reference cite the orignal source yet, so I can't say for sure. http://quotationsbook.com/quote/31568/ PR: conf/131469 Submitted by: John Hein MFC after: 2 days Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Thu Jun 4 22:00:48 2009 (r193466) +++ head/games/fortune/datfiles/fortunes Thu Jun 4 22:01:50 2009 (r193467) @@ -48262,9 +48262,9 @@ beat their head on the keyboard. After -- Harry Skelton % The seven deadly sins ... Food, clothing, firing, rent, taxes, -respectability and children. Nothing can lift those seven milestones -from man's neck but money; and the spirit cannot soar until the -milestones are lifted. +respectability and children. Nothing can lift those seven millstones +from Man's neck but money; and the spirit cannot soar until the +millstones are lifted. -- George Bernard Shaw % The seven eyes of Ningauble the Wizard floated back to his hood as he From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 23:31:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E927B1065672; Thu, 4 Jun 2009 23:31:05 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCD328FC16; Thu, 4 Jun 2009 23:31:05 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54NV5mA007854; Thu, 4 Jun 2009 23:31:05 GMT (envelope-from benno@svn.freebsd.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54NV5DH007853; Thu, 4 Jun 2009 23:31:05 GMT (envelope-from benno@svn.freebsd.org) Message-Id: <200906042331.n54NV5DH007853@svn.freebsd.org> From: Benno Rice Date: Thu, 4 Jun 2009 23:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193473 - head/sbin/kldload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 23:31:06 -0000 Author: benno Date: Thu Jun 4 23:31:05 2009 New Revision: 193473 URL: http://svn.freebsd.org/changeset/base/193473 Log: style(9) pass prior to further changes. Sponsored by: Redacted Consulting Modified: head/sbin/kldload/kldload.c Modified: head/sbin/kldload/kldload.c ============================================================================== --- head/sbin/kldload/kldload.c Thu Jun 4 22:41:36 2009 (r193472) +++ head/sbin/kldload/kldload.c Thu Jun 4 23:31:05 2009 (r193473) @@ -27,55 +27,60 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include #include -#include -#include + +static void usage(void); static void usage(void) { - fprintf(stderr, "usage: kldload [-v] file ...\n"); - exit(1); + fprintf(stderr, "usage: kldload [-v] file ...\n"); + exit(1); } int main(int argc, char** argv) { - int c; - int errors; - int fileid; - int verbose; - - errors = 0; - verbose = 0; - - while ((c = getopt(argc, argv, "v")) != -1) - switch (c) { - case 'v': - verbose = 1; - break; - default: - usage(); + int c; + int errors; + int fileid; + int verbose; + + errors = 0; + verbose = 0; + + while ((c = getopt(argc, argv, "v")) != -1) { + switch (c) { + case 'v': + verbose = 1; + break; + default: + usage(); + } } - argc -= optind; - argv += optind; + argc -= optind; + argv += optind; - if (argc == 0) - usage(); + if (argc == 0) + usage(); - while (argc-- != 0) { - fileid = kldload(argv[0]); - if (fileid < 0) { - warn("can't load %s", argv[0]); - errors++; - } else - if (verbose) - printf("Loaded %s, id=%d\n", argv[0], fileid); - argv++; - } + while (argc-- != 0) { + fileid = kldload(argv[0]); + if (fileid < 0) { + warn("can't load %s", argv[0]); + errors++; + } else { + if (verbose) { + printf("Loaded %s, id=%d\n", argv[0], fileid); + } + } + argv++; + } - return errors ? 1 : 0; + return (errors ? 1 : 0); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 23:43:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8166E106566B; Thu, 4 Jun 2009 23:43:08 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F3C98FC15; Thu, 4 Jun 2009 23:43:08 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n54Nh8r0008166; Thu, 4 Jun 2009 23:43:08 GMT (envelope-from benno@svn.freebsd.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54Nh8c5008164; Thu, 4 Jun 2009 23:43:08 GMT (envelope-from benno@svn.freebsd.org) Message-Id: <200906042343.n54Nh8c5008164@svn.freebsd.org> From: Benno Rice Date: Thu, 4 Jun 2009 23:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193475 - head/sbin/kldload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 23:43:09 -0000 Author: benno Date: Thu Jun 4 23:43:08 2009 New Revision: 193475 URL: http://svn.freebsd.org/changeset/base/193475 Log: Perform some checking on the requested list of modules to warn people if they try to load modules by filename out of the current directory where the module in question may be further up the module path or not in the module path at all. Also add some text to the man page to help explain what's going on. Sponsored by: Redacted Consulting Modified: head/sbin/kldload/kldload.8 head/sbin/kldload/kldload.c Modified: head/sbin/kldload/kldload.8 ============================================================================== --- head/sbin/kldload/kldload.8 Thu Jun 4 23:31:41 2009 (r193474) +++ head/sbin/kldload/kldload.8 Thu Jun 4 23:43:08 2009 (r193475) @@ -50,10 +50,22 @@ using .Nm . It does not hurt to specify it though. .Pp +If a bare filename is requested it will only be loaded if it is found within +the module path as defined by the sysctl +.Va kern.module_path . +To load a module from the current directory it must be specified as a full or +relative path. +The +.Nm +utility will warn if a module is requested as a bare filename and is present +in the current directory. +.Pp The following option is available: .Bl -tag -width indent .It Fl v Be more verbose. +.It Fl q +Silence any extraneous warnings. .El .Sh FILES .Bl -tag -width /boot/kernel -compact @@ -64,6 +76,26 @@ Modules must have an extension of .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +To load by module name: +.Bd -literal -offset indent +\*[Gt] kldload foo +.Ed +.Pp +To load by file name within the module path: +.Bd -literal -offset indent +\*[Gt] kldload foo.ko +.Ed +.Pp +To load by relative path: +.Bd -literal -offset indent +\*[Gt] kldload ./foo.ko +.Ed +.Pp +To load by full path: +.Bd -literal -offset indent +\*[Gt] kldload /boot/kernel/foo.ko +.Ed .Sh AUTOMATICALLY LOADING MODULES Some modules (pf, ipfw, ipf, etc.) may be automatically loaded at boot time when the corresponding Modified: head/sbin/kldload/kldload.c ============================================================================== --- head/sbin/kldload/kldload.c Thu Jun 4 23:31:41 2009 (r193474) +++ head/sbin/kldload/kldload.c Thu Jun 4 23:43:08 2009 (r193475) @@ -27,15 +27,105 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include +#include +#include #include #include #include +#include #include +#define PATHCTL "kern.module_path" + +static int path_check(const char *, int); static void usage(void); +/* + * Check to see if the requested module is specified as a filename with no + * path. If so and if a file by the same name exists in the module path, + * warn the user that the module in the path will be used in preference. + */ +static int +path_check(const char *kldname, int quiet) +{ + int mib[5], found; + size_t miblen, pathlen; + char kldpath[MAXPATHLEN]; + char *path, *tmppath, *element; + struct stat sb; + dev_t dev; + ino_t ino; + + if (strchr(kldname, '/') != NULL) { + return (0); + } + if (strstr(kldname, ".ko") == NULL) { + return (0); + } + if (stat(kldname, &sb) != 0) { + return (0); + } + + found = 0; + dev = sb.st_dev; + ino = sb.st_ino; + + miblen = sizeof(mib) / sizeof(mib[0]); + if (sysctlnametomib(PATHCTL, mib, &miblen) != 0) { + err(1, "sysctlnametomib(%s)", PATHCTL); + } + if (sysctl(mib, miblen, NULL, &pathlen, NULL, 0) == -1) { + err(1, "getting path: sysctl(%s) - size only", PATHCTL); + } + path = malloc(pathlen + 1); + if (path == NULL) { + err(1, "allocating %lu bytes for the path", + (unsigned long)pathlen + 1); + } + if (sysctl(mib, miblen, path, &pathlen, NULL, 0) == -1) { + err(1, "getting path: sysctl(%s)", PATHCTL); + } + tmppath = path; + + while ((element = strsep(&tmppath, ";")) != NULL) { + strlcpy(kldpath, element, MAXPATHLEN); + if (kldpath[strlen(kldpath) - 1] != '/') { + strlcat(kldpath, "/", MAXPATHLEN); + } + strlcat(kldpath, kldname, MAXPATHLEN); + + if (stat(kldpath, &sb) == -1) { + continue; + } + + found = 1; + + if (sb.st_dev != dev || sb.st_ino != ino) { + if (!quiet) { + warnx("%s will be loaded from %s, not the " + "current directory", kldname, element); + } + break; + } else if (sb.st_dev == dev && sb.st_ino == ino) { + break; + } + } + + free(path); + + if (!found) { + if (!quiet) { + warnx("%s is not in the module path", kldname); + } + return (-1); + } + + return (0); +} + static void usage(void) { @@ -50,14 +140,21 @@ main(int argc, char** argv) int errors; int fileid; int verbose; + int quiet; errors = 0; verbose = 0; - - while ((c = getopt(argc, argv, "v")) != -1) { + quiet = 0; + + while ((c = getopt(argc, argv, "qv")) != -1) { switch (c) { + case 'q': + quiet = 1; + verbose = 0; + break; case 'v': verbose = 1; + quiet = 0; break; default: usage(); @@ -70,14 +167,18 @@ main(int argc, char** argv) usage(); while (argc-- != 0) { - fileid = kldload(argv[0]); - if (fileid < 0) { - warn("can't load %s", argv[0]); - errors++; - } else { - if (verbose) { - printf("Loaded %s, id=%d\n", argv[0], fileid); + if (path_check(argv[0], quiet) == 0) { + fileid = kldload(argv[0]); + if (fileid < 0) { + warn("can't load %s", argv[0]); + errors++; + } else { + if (verbose) + printf("Loaded %s, id=%d\n", argv[0], + fileid); } + } else { + errors++; } argv++; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 03:06:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2B531065679; Fri, 5 Jun 2009 03:06:24 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6C398FC22; Fri, 5 Jun 2009 03:06:24 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5536OLl012591; Fri, 5 Jun 2009 03:06:24 GMT (envelope-from benno@svn.freebsd.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5536OUZ012590; Fri, 5 Jun 2009 03:06:24 GMT (envelope-from benno@svn.freebsd.org) Message-Id: <200906050306.n5536OUZ012590@svn.freebsd.org> From: Benno Rice Date: Fri, 5 Jun 2009 03:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193480 - head/sbin/kldload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 03:06:25 -0000 Author: benno Date: Fri Jun 5 03:06:24 2009 New Revision: 193480 URL: http://svn.freebsd.org/changeset/base/193480 Log: Bump document date. Pointed out by: trhodes Modified: head/sbin/kldload/kldload.8 Modified: head/sbin/kldload/kldload.8 ============================================================================== --- head/sbin/kldload/kldload.8 Fri Jun 5 01:18:12 2009 (r193479) +++ head/sbin/kldload/kldload.8 Fri Jun 5 03:06:24 2009 (r193480) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 13, 2006 +.Dd June 5, 2009 .Dt KLDLOAD 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 06:23:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 750721065672; Fri, 5 Jun 2009 06:23:33 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 29ABC8FC1D; Fri, 5 Jun 2009 06:23:33 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id 7EE588FC27; Fri, 5 Jun 2009 10:23:31 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 8B36A39C25; Fri, 5 Jun 2009 10:24:31 +0400 (MSD) Date: Fri, 5 Jun 2009 10:24:31 +0400 From: Stanislav Sedov To: Benno Rice Message-Id: <20090605102431.4769115f.stas@FreeBSD.org> In-Reply-To: <200906042343.n54Nh8c5008164@svn.freebsd.org> References: <200906042343.n54Nh8c5008164@svn.freebsd.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-Mailer: carrier-pigeon X-PGP-Fingerprint: B83A B15D 929A 364A D8BC B3F9 BF25 A231 092F D9F0 Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Fri__5_Jun_2009_10_24_31_+0400_HLu=XRsZkM+87Tc/" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193475 - head/sbin/kldload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 06:23:34 -0000 --Signature=_Fri__5_Jun_2009_10_24_31_+0400_HLu=XRsZkM+87Tc/ Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 4 Jun 2009 23:43:08 +0000 (UTC) Benno Rice mentioned: > + if (path =3D=3D NULL) { > + err(1, "allocating %lu bytes for the path", > + (unsigned long)pathlen + 1); ^^^^^^^^^^^^^^^^^^^^^^ Why convert pathlen to unsigned long here? The pathlen variable is of size_t type which is already unsigned and we have the special 'z' prefix in printf(3) to print those. --=20 Stanislav Sedov ST4096-RIPE --Signature=_Fri__5_Jun_2009_10_24_31_+0400_HLu=XRsZkM+87Tc/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJKKLofAAoJEKN82nOYvCd04AwQAK1jmNo+1B8kYedEyHpLgfWY ygHUgNOTuTRxBAByEhv8usOPr8kYo0eWg6wBGjfhaqoxf3Au8qZnhFtF37DqYLVE Fzoy1JIuJrAtKpcFhiKUkZ9Hi8PYSJOhuAI+KzKbGb7GgYB3UssKchBWNcXUI4fV L7Mmy3EMh4FEFJ9vHZpF6WTze5J/05aZs0Z6cPAk9rQNDOoGZ2NloqVVNQixGzPg fUruoY0CbZoniWodr5Icswqx+C5cBy/5Nev5ZksFAQROJhv9xIWuTNlmz+BJwdja I0ByYLcDmhXA3XqvdnDVaydJhEiwXH82MFsygFH6IT9CgGGxZ95WFRDJbf7GGvkw rnmmPb1Si8pFW3hIkNSZPR9Sl0vFxx8pAUmF0l9Yh6Xn7fkDezL6NmSpjqRamjd7 1FwxOqGZiPcEdohTqn3Br+1rgDtyMdc6IASmDAgbUg8uffGemKAQQ5bBjbeemEOb /61wq6vqpLXcmh0u45lFkEKuKHY+nMI5tyam7SJdG4/ys/WyOhwYYfxQs4EmvOf/ P05Za+UxyHXBS40S8UAT1M69lqURilUjXYcK/sGV+ABWNbxP0fRs81XswP7108NQ VlBd9Fn9d4tOIh1fjcLptlO4qvjaDToIYD36BCjjFxBdIKsFDAHT4gbGB+1Hn12W LaABYjRA7gxManMudROL =ww/W -----END PGP SIGNATURE----- --Signature=_Fri__5_Jun_2009_10_24_31_+0400_HLu=XRsZkM+87Tc/-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 07:57:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7821D1065672; Fri, 5 Jun 2009 07:57:13 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E97B8FC21; Fri, 5 Jun 2009 07:57:13 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n557vD0b018344; Fri, 5 Jun 2009 07:57:13 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n557vBpJ018340; Fri, 5 Jun 2009 07:57:11 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906050757.n557vBpJ018340@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 5 Jun 2009 07:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193486 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 07:57:14 -0000 Author: edwin Date: Fri Jun 5 07:57:10 2009 New Revision: 193486 URL: http://svn.freebsd.org/changeset/base/193486 Log: Misc fixed to fortunes PR: conf/112024 Submitted by: Niclas Zeising MFC after: 2 days Modified: head/games/fortune/datfiles/fortunes head/games/fortune/datfiles/fortunes-o.real Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Fri Jun 5 06:09:55 2009 (r193485) +++ head/games/fortune/datfiles/fortunes Fri Jun 5 07:57:10 2009 (r193486) @@ -674,8 +674,9 @@ Liza Minnelli. % ... with liberty and justice for all who can afford it. % - 12 + 144 + 20 + 3(4) 2 - ---------------------- + 5(11) = 9 + 0 + 1/2 + 12 + 144 + 20 + 3*4 2 + ---------------------- + 5 * 11 = 9 + 0 7 A dozen, a gross and a score, @@ -758,7 +759,7 @@ his honeymoon a chastened man. He'd bec A farm in the country side had several turkeys, it was known as the house of seven gobbles. % - A father gave his teen-age daughter an untrained pedigreed pup for + A father gave his teenage daughter an untrained pedigreed pup for her birthday. An hour later, when wandered through the house, he found her looking at a puddle in the center of the kitchen. "My pup," she murmured sadly, "runneth over." @@ -2547,7 +2548,7 @@ library and I'm half way through the sec should find what I'm looking for by mid May. I hope I can remember what it was by the time I find it. I had this idea for a new horror film, "VMS Manuals from Hell" or maybe -"The Paper Chase : IBM vs. DEC". It's based on Hitchcock's "The Birds", except +"The Paper Chase: IBM vs. DEC". It's based on Hitchcock's "The Birds", except that it's centered around a programmer who is attacked by a swarm of binder pages with an index number and the single line "This page intentionally left blank." @@ -2941,7 +2942,7 @@ Esther and hustle them off to prison. They can't prove who they are because they've left their passports in their hotel room. For three weeks they're tortured day and night to get them to name their contacts in the liberation -movement.. Finally they're hauled in front of a military court, +movement. Finally they're hauled in front of a military court, charged with espionage, and sentenced to death. The next morning they're lined up in front of the wall where they'll be shot. The sergeant in charge of the firing squad asks them @@ -2998,7 +2999,7 @@ a girl should not do before twenty." "Your mother is right," said the executive, "I don't like a large audience, either." % - NEW YORK-- Kraft Foods, Inc. announced today that its board of + NEW YORK -- Kraft Foods, Inc. announced today that its board of directors unanimously rejected the $11 billion takeover bid by Philip Morris and Co. A Kraft spokesman stated in a press conference that the offer was rejected because the $90-per-share bid did not reflect the @@ -4083,7 +4084,7 @@ right! Can I have a dollar?" % The master programmer moves from program to program without fear. No change in management can harm him. He will not be fired, even if the project -is canceled. Why is this? He is filled with the Tao. +is canceled. Why is this? He is filled with the Tao. -- Geoffrey James, "The Tao of Programming" % The Minnesota Board of Education voted to consider requiring all @@ -4248,7 +4249,7 @@ With a lot of these folks you'd have to make sure that they are Earthlings. Then there's the police. In Portland, when some guy goes bananas, the cops rope off a sixteen block area around him and call a shrink from the medical school who stands atop a patrol car -with a megaphone and shouts, "OK! THIS! ALL! STARTED! WHEN! YOU! WERE! +with a megaphone and shouts, "OK! THIS! ALL! STARTED! WHEN! YOU! WERE! THREE! YEARS! OLD! ON! ACCOUNT! OF! YOUR MOTHER! RIGHT? SO! LET'S! TALK! ABOUT! IT!" Down here they don't waste that kind of time. The LAPD has SWAT teams composed of guys who make Darth Vader look like Mr. Peepers. @@ -4383,7 +4384,7 @@ against a wall, and this was inscribed o warlord Wu. The warlord asked the programmer: "Which is easier to design: an accounting package or an operating system?" "An operating system," replied the programmer. - The warlord uttered an exclamation of disbelief. "Surely an + The warlord uttered an exclamation of disbelief. "Surely an accounting package is trivial next to the complexity of an operating system," he said. "Not so," said the programmer, "when designing an accounting package, @@ -4393,7 +4394,7 @@ tax laws. By contrast, an operating sys appearances. When designing an operating system, the programmer seeks the simplest harmony between machine and ideas. This is why an operating system is easier to design." - The warlord of Wu nodded and smiled. "That is all good and well," + The warlord of Wu nodded and smiled. "That is all good and well," he said, "but which is easier to debug?" The programmer made no reply. -- Geoffrey James, "The Tao of Programming" @@ -4834,7 +4835,7 @@ invariably he can't speak English, and i sure, little lady, it's eleven-thirty. Wanna get high? Don't bother thinking that instant lust will turn into the real thing. It may, but then you may also wake up one morning to find you're the Queen of -Rumania. +Romania. -- Cynthia Hemiel, "Sex Tips for Girls" % "When you wake up in the morning, Pooh," said Piglet at last, @@ -5276,9 +5277,9 @@ marked "450 volts", react as you would n For those who have had too much of Esalen, Topanga, and Kairos. Tired of being genuine all the time? Would you like to learn how to be a little phony again? Have you disclosed so much that you're -beginning to avoid people? Have you touched so many people that -they're all beginning to feel the same? Like to be a little dependent? -Are perfect orgasms beginning to bore you? Would you like, for once, +beginning to avoid people? Have you touched so many people that +they're all beginning to feel the same? Like to be a little dependent? +Are perfect orgasms beginning to bore you? Would you like, for once, not to express a feeling? Or better yet, not be in touch with it at all? Come to us. We promise to relieve you of the burden of your great potential. @@ -6578,7 +6579,7 @@ A critic is a bundle of biases held loos -- Whitney Balliett % A "critic" is a man who creates nothing and thereby feels -qualified to judge the work of creative men. There is logic +qualified to judge the work of creative men. There is logic in this; he is unbiased -- he hates all creative people equally. % A cynic is a person searching for an honest man, with a stolen lantern. @@ -7270,7 +7271,7 @@ A little inaccuracy sometimes saves tons % A little kid went up to Santa and asked him, "Santa, you know when I'm bad right?" And Santa says, "Yes, I do." The little kid then asks, "And you -know when I'm sleeping?" To which Santa replies, "Every minute." So the +know when I'm sleeping?" To which Santa replies, "Every minute." So the little kid then says, "Well, if you know when I'm bad and when I'm good, then how come you don't know what I want for Christmas?" % Modified: head/games/fortune/datfiles/fortunes-o.real ============================================================================== --- head/games/fortune/datfiles/fortunes-o.real Fri Jun 5 06:09:55 2009 (r193485) +++ head/games/fortune/datfiles/fortunes-o.real Fri Jun 5 07:57:10 2009 (r193486) @@ -1636,7 +1636,7 @@ Jerry Falwell, would get upset about see claim," he jeered, "that my client came at you with a broken bottle in his hand. But is it not true, that you had something in YOUR hand?" - "Yes," he admitted, "his wife. Very charming, of course, but + "Yes," he admitted, "his wife. Very charming, of course, but not much good in a fight." % The devout Jew was beside himself because his son had been dating From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 08:52:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8789106564A; Fri, 5 Jun 2009 08:52:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 60A0F8FC0C; Fri, 5 Jun 2009 08:52:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-151-9.carlnfd1.nsw.optusnet.com.au (c122-106-151-9.carlnfd1.nsw.optusnet.com.au [122.106.151.9]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n558q7Ze012649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Jun 2009 18:52:08 +1000 Date: Fri, 5 Jun 2009 18:52:07 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Stanislav Sedov In-Reply-To: <20090605102431.4769115f.stas@FreeBSD.org> Message-ID: <20090605182104.S15688@delplex.bde.org> References: <200906042343.n54Nh8c5008164@svn.freebsd.org> <20090605102431.4769115f.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Benno Rice Subject: Re: svn commit: r193475 - head/sbin/kldload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 08:52:12 -0000 On Fri, 5 Jun 2009, Stanislav Sedov wrote: > On Thu, 4 Jun 2009 23:43:08 +0000 (UTC) > Benno Rice mentioned: >> [... not quoted] The broken pathname lookup and broken path separator should be in the BUGS section (also in kld syscall manpages). The namespace for the `file' parameter of kldload(2) is completely undocumented in kldload.2. It seems to be the same as the usual namespace for files, except for large complications and undocumentations from having the pathname search and the file extension magic in the kernel. >> + if (path == NULL) { >> + err(1, "allocating %lu bytes for the path", >> + (unsigned long)pathlen + 1); > ^^^^^^^^^^^^^^^^^^^^^^ > Why convert pathlen to unsigned long here? The pathlen variable is > of size_t type which is already unsigned and we have the special 'z' prefix > in printf(3) to print those. Well, %z might be wrong since only the pathlen variable is of type size_t. The expression `pathlen + 1' has type: __binarypromoteof(__typeof(pathlen), int)), so if size_t is smaller than int then the promotions are non-null and give a type larger than size_t, and %z is wrong. To use %z, the expression should be written as (size_t)(pathlen + 1). OTOH, the committed version has no type mismatch, since __binarypromoteof(unsigned long, int)) = unsigned long, and all versions should have no problems with overflow in the addition or in the cast since pathlen should be small (even if unsigned long is smaller than size_t, pathlen should be < ULONG_MAX - 1 so that everything fits). Bruce From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 09:08:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DA2E106564A; Fri, 5 Jun 2009 09:08:54 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59F3D8FC12; Fri, 5 Jun 2009 09:08:54 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5598sjg019829; Fri, 5 Jun 2009 09:08:54 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5598stI019822; Fri, 5 Jun 2009 09:08:54 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200906050908.n5598stI019822@svn.freebsd.org> From: Brian Somers Date: Fri, 5 Jun 2009 09:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193488 - head/usr.bin/tail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 09:08:55 -0000 Author: brian Date: Fri Jun 5 09:08:53 2009 New Revision: 193488 URL: http://svn.freebsd.org/changeset/base/193488 Log: Change the behaviour of -F slightly; it now persists (forever) in trying to open files rather than giving up when it encounters an error. ENOENT errors are not reported. As a result, files that are moved away then recreated are not at risk of being 'lost' to tail. Files that are recreated and temporarily have unreadable permissions will be shown when they are fixed. This behaviour is consistent with the GNU version of tail but without the verbiage that goes with the GNU version. This change also fixes error messages accompanying -f and -F. They no longer report problems with (null)! MFC after: 3 weeks Modified: head/usr.bin/tail/extern.h head/usr.bin/tail/forward.c head/usr.bin/tail/misc.c head/usr.bin/tail/read.c head/usr.bin/tail/reverse.c head/usr.bin/tail/tail.1 head/usr.bin/tail/tail.c Modified: head/usr.bin/tail/extern.h ============================================================================== --- head/usr.bin/tail/extern.h Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/extern.h Fri Jun 5 09:08:53 2009 (r193488) @@ -61,16 +61,15 @@ typedef struct file_info file_info_t; enum STYLE { NOTSET = 0, FBYTES, FLINES, RBYTES, RLINES, REVERSE }; void follow(file_info_t *, enum STYLE, off_t); -void forward(FILE *, enum STYLE, off_t, struct stat *); -void reverse(FILE *, enum STYLE, off_t, struct stat *); +void forward(FILE *, const char *, enum STYLE, off_t, struct stat *); +void reverse(FILE *, const char *, enum STYLE, off_t, struct stat *); -int bytes(FILE *, off_t); -int lines(FILE *, off_t); +int bytes(FILE *, const char *, off_t); +int lines(FILE *, const char *, off_t); -void ierr(void); +void ierr(const char *); void oerr(void); int mapprint(struct mapinfo *, off_t, off_t); int maparound(struct mapinfo *, off_t); extern int Fflag, fflag, qflag, rflag, rval, no_files; -extern const char *fname; Modified: head/usr.bin/tail/forward.c ============================================================================== --- head/usr.bin/tail/forward.c Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/forward.c Fri Jun 5 09:08:53 2009 (r193488) @@ -61,8 +61,8 @@ static const char sccsid[] = "@(#)forwar #include "extern.h" -static void rlines(FILE *, off_t, struct stat *); -static void show(file_info_t *); +static void rlines(FILE *, const char *fn, off_t, struct stat *); +static int show(file_info_t *); static void set_events(file_info_t *files); /* defines for inner loop actions */ @@ -99,7 +99,7 @@ static const file_info_t *last; * NOREG cyclically read lines into a wrap-around array of buffers */ void -forward(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) +forward(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) { int ch; @@ -111,13 +111,13 @@ forward(FILE *fp, enum STYLE style, off_ if (sbp->st_size < off) off = sbp->st_size; if (fseeko(fp, off, SEEK_SET) == -1) { - ierr(); + ierr(fn); return; } } else while (off--) if ((ch = getc(fp)) == EOF) { if (ferror(fp)) { - ierr(); + ierr(fn); return; } break; @@ -129,7 +129,7 @@ forward(FILE *fp, enum STYLE style, off_ for (;;) { if ((ch = getc(fp)) == EOF) { if (ferror(fp)) { - ierr(); + ierr(fn); return; } break; @@ -142,36 +142,36 @@ forward(FILE *fp, enum STYLE style, off_ if (S_ISREG(sbp->st_mode)) { if (sbp->st_size >= off && fseeko(fp, -off, SEEK_END) == -1) { - ierr(); + ierr(fn); return; } } else if (off == 0) { while (getc(fp) != EOF); if (ferror(fp)) { - ierr(); + ierr(fn); return; } } else - if (bytes(fp, off)) + if (bytes(fp, fn, off)) return; break; case RLINES: if (S_ISREG(sbp->st_mode)) if (!off) { if (fseeko(fp, (off_t)0, SEEK_END) == -1) { - ierr(); + ierr(fn); return; } } else - rlines(fp, off, sbp); + rlines(fp, fn, off, sbp); else if (off == 0) { while (getc(fp) != EOF); if (ferror(fp)) { - ierr(); + ierr(fn); return; } } else - if (lines(fp, off)) + if (lines(fp, fn, off)) return; break; default: @@ -182,7 +182,7 @@ forward(FILE *fp, enum STYLE style, off_ if (putchar(ch) == EOF) oerr(); if (ferror(fp)) { - ierr(); + ierr(fn); return; } (void)fflush(stdout); @@ -192,10 +192,7 @@ forward(FILE *fp, enum STYLE style, off_ * rlines -- display the last offset lines of the file. */ static void -rlines(fp, off, sbp) - FILE *fp; - off_t off; - struct stat *sbp; +rlines(FILE *fp, const char *fn, off_t off, struct stat *sbp) { struct mapinfo map; off_t curoff, size; @@ -214,7 +211,7 @@ rlines(fp, off, sbp) curoff = size - 2; while (curoff >= 0) { if (curoff < map.mapoff && maparound(&map, curoff) != 0) { - ierr(); + ierr(fn); return; } for (i = curoff - map.mapoff; i >= 0; i--) @@ -227,41 +224,44 @@ rlines(fp, off, sbp) } curoff++; if (mapprint(&map, curoff, size - curoff) != 0) { - ierr(); + ierr(fn); exit(1); } /* Set the file pointer to reflect the length displayed. */ if (fseeko(fp, sbp->st_size, SEEK_SET) == -1) { - ierr(); + ierr(fn); return; } if (map.start != NULL && munmap(map.start, map.maplen)) { - ierr(); + ierr(fn); return; } } -static void +static int show(file_info_t *file) { - int ch; + int ch; - while ((ch = getc(file->fp)) != EOF) { - if (last != file && no_files > 1) { - if (!qflag) - (void)printf("\n==> %s <==\n", file->file_name); - last = file; - } - if (putchar(ch) == EOF) - oerr(); - } - (void)fflush(stdout); - if (ferror(file->fp)) { - file->fp = NULL; - ierr(); - } else - clearerr(file->fp); + while ((ch = getc(file->fp)) != EOF) { + if (last != file && no_files > 1) { + if (!qflag) + (void)printf("\n==> %s <==\n", file->file_name); + last = file; + } + if (putchar(ch) == EOF) + oerr(); + } + (void)fflush(stdout); + if (ferror(file->fp)) { + fclose(file->fp); + file->fp = NULL; + ierr(file->file_name); + return 0; + } + clearerr(file->fp); + return 1; } static void @@ -309,7 +309,7 @@ set_events(file_info_t *files) void follow(file_info_t *files, enum STYLE style, off_t off) { - int active, i, n = -1; + int active, ev_change, i, n = -1; struct stat sb2; file_info_t *file; struct timespec ts; @@ -325,12 +325,12 @@ follow(file_info_t *files, enum STYLE st n++; if (no_files > 1 && !qflag) (void)printf("\n==> %s <==\n", file->file_name); - forward(file->fp, style, off, &file->st); + forward(file->fp, file->file_name, style, off, &file->st); if (Fflag && fileno(file->fp) != STDIN_FILENO) - n++; + n++; } } - if (! active) + if (!Fflag && !active) return; last = --file; @@ -344,28 +344,56 @@ follow(file_info_t *files, enum STYLE st set_events(files); for (;;) { - for (i = 0, file = files; i < no_files; i++, file++) { - if (! file->fp) - continue; - if (Fflag && file->fp && fileno(file->fp) != STDIN_FILENO) { - if (stat(file->file_name, &sb2) == 0 && - (sb2.st_ino != file->st.st_ino || - sb2.st_dev != file->st.st_dev || - sb2.st_nlink == 0)) { - show(file); - file->fp = freopen(file->file_name, "r", file->fp); - if (file->fp == NULL) { - ierr(); - continue; - } else { - memcpy(&file->st, &sb2, sizeof(struct stat)); - set_events(files); + ev_change = 0; + if (Fflag) { + for (i = 0, file = files; i < no_files; i++, file++) { + if (!file->fp) { + file->fp = fopen(file->file_name, "r"); + if (file->fp != NULL && + fstat(fileno(file->fp), &file->st) + == -1) { + fclose(file->fp); + file->fp = NULL; } + if (file->fp != NULL) + ev_change++; + continue; + } + if (fileno(file->fp) == STDIN_FILENO) + continue; + if (stat(file->file_name, &sb2) == -1) { + if (errno != ENOENT) + ierr(file->file_name); + show(file); + fclose(file->fp); + file->fp = NULL; + ev_change++; + continue; + } + + if (sb2.st_ino != file->st.st_ino || + sb2.st_dev != file->st.st_dev || + sb2.st_nlink == 0) { + show(file); + file->fp = freopen(file->file_name, "r", + file->fp); + if (file->fp != NULL) + memcpy(&file->st, &sb2, + sizeof(struct stat)); + else if (errno != ENOENT) + ierr(file->file_name); + ev_change++; } } - show(file); } + for (i = 0, file = files; i < no_files; i++, file++) + if (file->fp && !show(file)) + ev_change++; + + if (ev_change) + set_events(files); + switch (action) { case USE_KQUEUE: ts.tv_sec = 1; @@ -381,9 +409,9 @@ follow(file_info_t *files, enum STYLE st /* timeout */ break; } else if (ev->filter == EVFILT_READ && ev->data < 0) { - /* file shrank, reposition to end */ + /* file shrank, reposition to end */ if (lseek(ev->ident, (off_t)0, SEEK_END) == -1) { - ierr(); + ierr(file->file_name); continue; } } Modified: head/usr.bin/tail/misc.c ============================================================================== --- head/usr.bin/tail/misc.c Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/misc.c Fri Jun 5 09:08:53 2009 (r193488) @@ -56,7 +56,7 @@ static const char sccsid[] = "@(#)misc.c #include "extern.h" void -ierr() +ierr(const char *fname) { warn("%s", fname); rval = 1; Modified: head/usr.bin/tail/read.c ============================================================================== --- head/usr.bin/tail/read.c Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/read.c Fri Jun 5 09:08:53 2009 (r193488) @@ -66,7 +66,7 @@ static const char sccsid[] = "@(#)read.c * the end. */ int -bytes(FILE *fp, off_t off) +bytes(FILE *fp, const char *fn, off_t off) { int ch, len, tlen; char *ep, *p, *t; @@ -84,7 +84,7 @@ bytes(FILE *fp, off_t off) } } if (ferror(fp)) { - ierr(); + ierr(fn); free(sp); return 1; } @@ -136,7 +136,7 @@ bytes(FILE *fp, off_t off) * the end. */ int -lines(FILE *fp, off_t off) +lines(FILE *fp, const char *fn, off_t off) { struct { int blen; @@ -178,7 +178,7 @@ lines(FILE *fp, off_t off) } } if (ferror(fp)) { - ierr(); + ierr(fn); rc = 1; goto done; } Modified: head/usr.bin/tail/reverse.c ============================================================================== --- head/usr.bin/tail/reverse.c Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/reverse.c Fri Jun 5 09:08:53 2009 (r193488) @@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -static void r_buf(FILE *); -static void r_reg(FILE *, enum STYLE, off_t, struct stat *); +static void r_buf(FILE *, const char *); +static void r_reg(FILE *, const char *, enum STYLE, off_t, struct stat *); /* * reverse -- display input in reverse order by line. @@ -80,25 +80,25 @@ static void r_reg(FILE *, enum STYLE, of * NOREG cyclically read input into a linked list of buffers */ void -reverse(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) +reverse(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) { if (style != REVERSE && off == 0) return; if (S_ISREG(sbp->st_mode)) - r_reg(fp, style, off, sbp); + r_reg(fp, fn, style, off, sbp); else switch(style) { case FBYTES: case RBYTES: - bytes(fp, off); + bytes(fp, fn, off); break; case FLINES: case RLINES: - lines(fp, off); + lines(fp, fn, off); break; case REVERSE: - r_buf(fp); + r_buf(fp, fn); break; default: break; @@ -109,7 +109,7 @@ reverse(FILE *fp, enum STYLE style, off_ * r_reg -- display a regular file in reverse order by line. */ static void -r_reg(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) +r_reg(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) { struct mapinfo map; off_t curoff, size, lineend; @@ -132,7 +132,7 @@ r_reg(FILE *fp, enum STYLE style, off_t if (curoff < map.mapoff || curoff >= map.mapoff + (off_t)map.maplen) { if (maparound(&map, curoff) != 0) { - ierr(); + ierr(fn); return; } } @@ -149,7 +149,7 @@ r_reg(FILE *fp, enum STYLE style, off_t /* Print the line and update offsets. */ if (mapprint(&map, curoff + 1, lineend - curoff - 1) != 0) { - ierr(); + ierr(fn); return; } lineend = curoff + 1; @@ -165,11 +165,11 @@ r_reg(FILE *fp, enum STYLE style, off_t } } if (curoff < 0 && mapprint(&map, 0, lineend) != 0) { - ierr(); + ierr(fn); return; } if (map.start != NULL && munmap(map.start, map.maplen)) - ierr(); + ierr(fn); } typedef struct bf { @@ -190,7 +190,7 @@ typedef struct bf { * user warned). */ static void -r_buf(FILE *fp) +r_buf(FILE *fp, const char *fn) { BF *mark, *tl, *tr; int ch, len, llen; @@ -227,7 +227,7 @@ r_buf(FILE *fp) *p++ = ch; if (ferror(fp)) { - ierr(); + ierr(fn); return; } Modified: head/usr.bin/tail/tail.1 ============================================================================== --- head/usr.bin/tail/tail.1 Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/tail.1 Fri Jun 5 09:08:53 2009 (r193488) @@ -35,7 +35,7 @@ .\" @(#)tail.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 29, 2006 +.Dd June 05, 2009 .Dt TAIL 1 .Os .Sh NAME @@ -106,9 +106,16 @@ will also check to see if the file being The file is closed and reopened when .Nm detects that the filename being read from has a new inode number. +.Pp +If the file being followed does not (yet) exist or if it is removed, tail +will keep looking and will display the file from the beginning if and when +it is created. +.Pp The .Fl F -option is ignored if reading from standard input rather than a file. +option is the same as the +.Fl f +option if reading from standard input rather than a file. .It Fl n Ar number The location is .Ar number Modified: head/usr.bin/tail/tail.c ============================================================================== --- head/usr.bin/tail/tail.c Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/tail.c Fri Jun 5 09:08:53 2009 (r193488) @@ -61,7 +61,6 @@ static const char sccsid[] = "@(#)tail.c #include "extern.h" int Fflag, fflag, qflag, rflag, rval, no_files; -const char *fname; file_info_t *files; @@ -72,6 +71,7 @@ int main(int argc, char *argv[]) { struct stat sb; + const char *fn; FILE *fp; off_t off; enum STYLE style; @@ -175,20 +175,23 @@ main(int argc, char *argv[]) } if (*argv && fflag) { - files = (struct file_info *) malloc(no_files * sizeof(struct file_info)); - if (! files) + files = (struct file_info *) malloc(no_files * + sizeof(struct file_info)); + if (!files) err(1, "Couldn't malloc space for file descriptors."); - for (file = files; (fname = *argv++); file++) { - file->file_name = malloc(strlen(fname)+1); + for (file = files; (fn = *argv++); file++) { + file->file_name = strdup(fn); if (! file->file_name) errx(1, "Couldn't malloc space for file name."); - strncpy(file->file_name, fname, strlen(fname)+1); if ((file->fp = fopen(file->file_name, "r")) == NULL || fstat(fileno(file->fp), &file->st)) { - file->fp = NULL; - ierr(); - continue; + if (file->fp != NULL) { + fclose(file->fp); + file->fp = NULL; + } + if (!Fflag || errno != ENOENT) + ierr(file->file_name); } } follow(files, style, off); @@ -197,29 +200,29 @@ main(int argc, char *argv[]) } free(files); } else if (*argv) { - for (first = 1; (fname = *argv++);) { - if ((fp = fopen(fname, "r")) == NULL || + for (first = 1; (fn = *argv++);) { + if ((fp = fopen(fn, "r")) == NULL || fstat(fileno(fp), &sb)) { - ierr(); + ierr(fn); continue; } if (argc > 1 && !qflag) { (void)printf("%s==> %s <==\n", - first ? "" : "\n", fname); + first ? "" : "\n", fn); first = 0; (void)fflush(stdout); } if (rflag) - reverse(fp, style, off, &sb); + reverse(fp, fn, style, off, &sb); else - forward(fp, style, off, &sb); + forward(fp, fn, style, off, &sb); } } else { - fname = "stdin"; + fn = "stdin"; if (fstat(fileno(stdin), &sb)) { - ierr(); + ierr(fn); exit(1); } @@ -234,9 +237,9 @@ main(int argc, char *argv[]) } if (rflag) - reverse(stdin, style, off, &sb); + reverse(stdin, fn, style, off, &sb); else - forward(stdin, style, off, &sb); + forward(stdin, fn, style, off, &sb); } exit(rval); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 09:09:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DD2F1065672; Fri, 5 Jun 2009 09:09:46 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BD3B8FC1D; Fri, 5 Jun 2009 09:09:46 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5599kNa019893; Fri, 5 Jun 2009 09:09:46 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5599kOe019892; Fri, 5 Jun 2009 09:09:46 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200906050909.n5599kOe019892@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 5 Jun 2009 09:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193489 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 09:09:47 -0000 Author: raj Date: Fri Jun 5 09:09:46 2009 New Revision: 193489 URL: http://svn.freebsd.org/changeset/base/193489 Log: Fill PTEs covering kernel code and data. Without this fix pte_vatopa() was not able to retrieve physical address of data structures inside kernel, for example EFAULT was reported while acessing /dev/kmem ('netstat -nr'). Submitted by: Piotr Ziecik Obtained from: Semihalf Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Jun 5 09:08:53 2009 (r193488) +++ head/sys/powerpc/booke/pmap.c Fri Jun 5 09:09:46 2009 (r193489) @@ -966,8 +966,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset u_int s, e, sz; u_int phys_avail_count; vm_size_t physsz, hwphyssz, kstack0_sz; - vm_offset_t kernel_pdir, kstack0; + vm_offset_t kernel_pdir, kstack0, va; vm_paddr_t kstack0_phys; + pte_t *pte; debugf("mmu_booke_bootstrap: entered\n"); @@ -1216,6 +1217,19 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /* Initialize each CPU's tidbusy entry 0 with kernel_pmap */ tidbusy[i][0] = kernel_pmap; } + + /* + * Fill in PTEs covering kernel code and data. They are not required + * for address translation, as this area is covered by static TLB1 + * entries, but for pte_vatopa() to work correctly with kernel area + * addresses. + */ + for (va = KERNBASE; va < data_end; va += PAGE_SIZE) { + pte = &(kernel_pmap->pm_pdir[PDIR_IDX(va)][PTBL_IDX(va)]); + pte->rpn = kernload + (va - KERNBASE); + pte->flags = PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | + PTE_VALID; + } /* Mark kernel_pmap active on all CPUs */ kernel_pmap->pm_active = ~0; From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 09:16:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ECE4106566B; Fri, 5 Jun 2009 09:16:52 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CD4D8FC14; Fri, 5 Jun 2009 09:16:52 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n559GqgD020096; Fri, 5 Jun 2009 09:16:52 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n559Gqr8020095; Fri, 5 Jun 2009 09:16:52 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200906050916.n559Gqr8020095@svn.freebsd.org> From: Brian Somers Date: Fri, 5 Jun 2009 09:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193490 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 09:16:52 -0000 Author: brian Date: Fri Jun 5 09:16:52 2009 New Revision: 193490 URL: http://svn.freebsd.org/changeset/base/193490 Log: If we're passed garbage in malloc_init(), panic() rather than expecting a KASSERT to handle it. People are likely to turn off INVARIANTS RSN and loading an old module can cause garbage-in here. I saw the issue with an older nvidia driver (x11/nvidia-driver) loading into a new kernel - a crash wasn't seen 'till sysctl_kern_malloc_stats(). I was lucky that mtp->ks_shortdesc was NULL and not something horrible. While I'm here, KASSERT that malloc_uninit() isn't passed something that's not in kmemstatistics. MFC after: 3 weeks Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Fri Jun 5 09:09:46 2009 (r193489) +++ head/sys/kern/kern_malloc.c Fri Jun 5 09:16:52 2009 (r193490) @@ -675,8 +675,8 @@ malloc_init(void *data) KASSERT(cnt.v_page_count != 0, ("malloc_register before vm_init")); mtp = data; - KASSERT(mtp->ks_magic == M_MAGIC, - ("malloc_init: bad malloc type magic")); + if (mtp->ks_magic != M_MAGIC) + panic("malloc_init: bad malloc type magic"); mtip = uma_zalloc(mt_zone, M_WAITOK | M_ZERO); mtp->ks_handle = mtip; @@ -709,9 +709,13 @@ malloc_uninit(void *data) if (mtp != kmemstatistics) { for (temp = kmemstatistics; temp != NULL; temp = temp->ks_next) { - if (temp->ks_next == mtp) + if (temp->ks_next == mtp) { temp->ks_next = mtp->ks_next; + break; + } } + KASSERT(temp, + ("malloc_uninit: type '%s' not found", mtp->ks_shortdesc)); } else kmemstatistics = mtp->ks_next; kmemcount--; From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 09:46:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A96541065670; Fri, 5 Jun 2009 09:46:00 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 973338FC17; Fri, 5 Jun 2009 09:46:00 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n559k0SN020725; Fri, 5 Jun 2009 09:46:00 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n559k0xD020724; Fri, 5 Jun 2009 09:46:00 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200906050946.n559k0xD020724@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 5 Jun 2009 09:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193492 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 09:46:01 -0000 Author: raj Date: Fri Jun 5 09:46:00 2009 New Revision: 193492 URL: http://svn.freebsd.org/changeset/base/193492 Log: Discover and handle the number of E500 CPUs in run time. Modified: head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Fri Jun 5 09:21:03 2009 (r193491) +++ head/sys/powerpc/booke/platform_bare.c Fri Jun 5 09:46:00 2009 (r193492) @@ -56,7 +56,7 @@ extern uint8_t __boot_page[]; /* Boot p extern uint32_t kernload; /* Kernel physical load address */ #endif -static int cpu; +static int cpu, maxcpu; static int bare_probe(platform_t); static void bare_mem_regions(platform_t, struct mem_region **phys, int *physsz, @@ -91,6 +91,13 @@ PLATFORM_DEF(bare_platform); static int bare_probe(platform_t plat) { + uint32_t ver; + + ver = SVR_VER(mfspr(SPR_SVR)); + if (ver == SVR_MPC8572E || ver == SVR_MPC8572) + maxcpu = 2; + else + maxcpu = 1; return (BUS_PROBE_GENERIC); } @@ -161,7 +168,7 @@ static int bare_smp_next_cpu(platform_t plat, struct cpuref *cpuref) { - if (cpu >= MAXCPU) + if (cpu >= maxcpu) return (ENOENT); cpuref->cr_cpuid = cpu++; From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 12:49:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AA3F106564A; Fri, 5 Jun 2009 12:49:55 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED4478FC2B; Fri, 5 Jun 2009 12:49:54 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55Cnsxw025901; Fri, 5 Jun 2009 12:49:54 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55CnsYk025900; Fri, 5 Jun 2009 12:49:54 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906051249.n55CnsYk025900@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 5 Jun 2009 12:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193497 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 12:49:55 -0000 Author: luigi Date: Fri Jun 5 12:49:54 2009 New Revision: 193497 URL: http://svn.freebsd.org/changeset/base/193497 Log: Small changes (no actual code changes) in preparation of moving ipfw-related stuff to its own directory, and cleaning headers and dependencies: In this commit: + remove one use of a typedef; + document dn_rule_delete(); + replace one usage of the DUMMYNET_LOADED macro with its value; No MFC planned until the cleanup is complete. Modified: head/sys/netinet/ip_dummynet.c Modified: head/sys/netinet/ip_dummynet.c ============================================================================== --- head/sys/netinet/ip_dummynet.c Fri Jun 5 12:35:56 2009 (r193496) +++ head/sys/netinet/ip_dummynet.c Fri Jun 5 12:49:54 2009 (r193497) @@ -242,7 +242,7 @@ static void dummynet(void *); static void dummynet_flush(void); static void dummynet_send(struct mbuf *); void dummynet_drain(void); -static ip_dn_io_t dummynet_io; +static int dummynet_io(struct mbuf **, int , struct ip_fw_args *); static void dn_rule_delete(void *); /* @@ -1638,9 +1638,11 @@ dn_rule_delete_fs(struct dn_flow_set *fs pkt->rule = ip_fw_default_rule ; } } + /* - * when a firewall rule is deleted, scan all queues and remove the flow-id - * from packets matching this rule. + * When a firewall rule is deleted, scan all queues and remove the pointer + * to the rule from matching packets, making them point to the default rule. + * The pointer is used to reinject packets in case one_pass = 0. */ void dn_rule_delete(void *r) @@ -2337,7 +2339,7 @@ dummynet_modevent(module_t mod, int type switch (type) { case MOD_LOAD: - if (DUMMYNET_LOADED) { + if (ip_dn_io_ptr) { printf("DUMMYNET already loaded\n"); return EEXIST ; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 13:05:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82C21106564A; Fri, 5 Jun 2009 13:05:14 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5683D8FC1B; Fri, 5 Jun 2009 13:05:14 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55D5E8o026284; Fri, 5 Jun 2009 13:05:14 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55D5Eu8026282; Fri, 5 Jun 2009 13:05:14 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906051305.n55D5Eu8026282@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 5 Jun 2009 13:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193498 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 13:05:14 -0000 Author: edwin Date: Fri Jun 5 13:05:14 2009 New Revision: 193498 URL: http://svn.freebsd.org/changeset/base/193498 Log: [patch] Portuguese timedef In Portuguese, the names of the days of the week are not capitalized. Also there is always a dash before "feira" in the names of the days. For example: "segunda-feira" and not "segunda feira" (which has a completely different meaning). x_fmt is not correct either. The date separator should not be a dot but a slash. Example: 31/12/2005 if far more used in Portugal than 31.12.2005. References: - a Portuguese online dictionary http://priberam.pt/dlpo/dlpo.aspx - http://answers.com/days_of_the_week (there are translations to various languages, including Portuguese, at the bottom of the page) - http://en.wikipedia.org/wiki/Week-day_names (there are translations to various languages, including Portuguese, at the bottom of the page) - a Portuguese style guide http://www.publico.clix.pt/nos/livro_estilo/16d-palavras.html ("datas" section) PR: conf/58595 Submitted by: Chris Stenton MFC after: 1 week Modified: head/share/timedef/pt_PT.ISO8859-1.src head/share/timedef/pt_PT.UTF-8.src Modified: head/share/timedef/pt_PT.ISO8859-1.src ============================================================================== --- head/share/timedef/pt_PT.ISO8859-1.src Fri Jun 5 12:49:54 2009 (r193497) +++ head/share/timedef/pt_PT.ISO8859-1.src Fri Jun 5 13:05:14 2009 (r193498) @@ -36,23 +36,23 @@ Dezembro # # Short weekday names # -Dom -Seg -Ter -Qua -Qui -Sex -Sáb +dom +seg +ter +qua +qui +sex +sáb # # Long weekday names # -Domingo -Segunda Feira -Terça Feira -Quarta Feira -Quinta Feira -Sexta Feira -Sábado +domingo +segunda-feira +terça-feira +quarta-feira +quinta-feira +sexta-feira +sábado # # X_fmt # @@ -60,7 +60,7 @@ Sábado # # x_fmt # -%d.%m.%Y +%d/%m/%Y # # c_fmt # Modified: head/share/timedef/pt_PT.UTF-8.src ============================================================================== --- head/share/timedef/pt_PT.UTF-8.src Fri Jun 5 12:49:54 2009 (r193497) +++ head/share/timedef/pt_PT.UTF-8.src Fri Jun 5 13:05:14 2009 (r193498) @@ -36,23 +36,23 @@ Dezembro # # Short weekday names # -Dom -Seg -Ter -Qua -Qui -Sex -Sáb +dom +seg +ter +qua +qui +sex +sáb # # Long weekday names # -Domingo -Segunda Feira -Terça Feira -Quarta Feira -Quinta Feira -Sexta Feira -Sábado +domingo +segunda-feira +terça-feira +quarta-feira +quinta-feira +sexta-feira +sábado # # X_fmt # @@ -60,7 +60,7 @@ Sábado # # x_fmt # -%d.%m.%Y +%d/%m/%Y # # c_fmt # From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 13:11:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE1C91065686; Fri, 5 Jun 2009 13:11:34 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C4BB8FC1C; Fri, 5 Jun 2009 13:11:34 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55DBYhT026496; Fri, 5 Jun 2009 13:11:34 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55DBYAR026495; Fri, 5 Jun 2009 13:11:34 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906051311.n55DBYAR026495@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 5 Jun 2009 13:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193500 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 13:11:35 -0000 Author: luigi Date: Fri Jun 5 13:11:34 2009 New Revision: 193500 URL: http://svn.freebsd.org/changeset/base/193500 Log: remove a printf that was only useful for debugging. MFC after: 3 days Modified: head/sbin/ipfw/dummynet.c Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Fri Jun 5 13:07:36 2009 (r193499) +++ head/sbin/ipfw/dummynet.c Fri Jun 5 13:11:34 2009 (r193500) @@ -314,8 +314,6 @@ ipfw_list_pipes(void *data, uint nbytes, print_extra_delay_parms(p, prefix); print_flowset_parms(&(p->fs), prefix); - if (co.verbose) - printf(" V %20llu\n", align_uint64(&p->V) >> MY_M); q = (struct dn_flow_queue *)(p+1); list_queues(&(p->fs), q); From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 13:25:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FA071065673; Fri, 5 Jun 2009 13:25:35 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 18AA68FC14; Fri, 5 Jun 2009 13:25:35 +0000 (UTC) (envelope-from jilles@stack.nl) Received: by mx1.stack.nl (Postfix, from userid 65534) id 2A4ED359960; Fri, 5 Jun 2009 15:25:34 +0200 (CEST) X-Spam-DCC: dcc.uncw.edu: scanner01.stack.nl 1201; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on scanner01.stack.nl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Relay-Country: _RELAYCOUNTRY_ Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 431DC359956; Fri, 5 Jun 2009 15:25:32 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 97A2A228CB; Fri, 5 Jun 2009 15:25:19 +0200 (CEST) Date: Fri, 5 Jun 2009 15:25:19 +0200 From: Jilles Tjoelker To: Bruce Evans Message-ID: <20090605132519.GA4091@stack.nl> References: <200906042343.n54Nh8c5008164@svn.freebsd.org> <20090605102431.4769115f.stas@FreeBSD.org> <20090605182104.S15688@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090605182104.S15688@delplex.bde.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Benno Rice Subject: Re: svn commit: r193475 - head/sbin/kldload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 13:25:36 -0000 On Fri, Jun 05, 2009 at 06:52:07PM +1000, Bruce Evans wrote: > Well, %z might be wrong since only the pathlen variable is of type size_t. > The expression `pathlen + 1' has type: > __binarypromoteof(__typeof(pathlen), int)), > so if size_t is smaller than int then the promotions are non-null and give > a type larger than size_t, and %z is wrong. To use %z, the expression > should be written as (size_t)(pathlen + 1). The promotion is not a problem because it would happen anyway, as it is an unprototyped parameter. printf and the like know this. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 13:44:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4BCA10656E9; Fri, 5 Jun 2009 13:44:30 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0D668FC13; Fri, 5 Jun 2009 13:44:30 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55DiUZk027236; Fri, 5 Jun 2009 13:44:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55DiUdT027226; Fri, 5 Jun 2009 13:44:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906051344.n55DiUdT027226@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 5 Jun 2009 13:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193502 - in head/sys: net netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 13:44:31 -0000 Author: luigi Date: Fri Jun 5 13:44:30 2009 New Revision: 193502 URL: http://svn.freebsd.org/changeset/base/193502 Log: More cleanup in preparation of ipfw relocation (no actual code change): + move ipfw and dummynet hooks declarations to raw_ip.c (definitions in ip_var.h) same as for most other global variables. This removes some dependencies from ip_input.c; + remove the IPFW_LOADED macro, just test ip_fw_chk_ptr directly; + remove the DUMMYNET_LOADED macro, just test ip_dn_io_ptr directly; + move ip_dn_ruledel_ptr to ip_fw2.c which is the only file using it; To be merged together with rev 193497 MFC after: 5 days Modified: head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c head/sys/netinet/ip_dummynet.h head/sys/netinet/ip_fw.h head/sys/netinet/ip_fw2.c head/sys/netinet/ip_fw_pfil.c head/sys/netinet/ip_input.c head/sys/netinet/ip_var.h head/sys/netinet/raw_ip.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/net/if_bridge.c Fri Jun 5 13:44:30 2009 (r193502) @@ -3039,7 +3039,7 @@ bridge_pfil(struct mbuf **mp, struct ifn goto bad; } - if (IPFW_LOADED && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { + if (ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { INIT_VNET_INET(curvnet); error = -1; @@ -3058,7 +3058,7 @@ bridge_pfil(struct mbuf **mp, struct ifn if (*mp == NULL) return (error); - if (DUMMYNET_LOADED && (i == IP_FW_DUMMYNET)) { + if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { /* put the Ethernet header back on */ M_PREPEND(*mp, ETHER_HDR_LEN, M_DONTWAIT); Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/net/if_ethersubr.c Fri Jun 5 13:44:30 2009 (r193502) @@ -432,7 +432,7 @@ ether_output_frame(struct ifnet *ifp, st INIT_VNET_NET(ifp->if_vnet); struct ip_fw *rule = ip_dn_claim_rule(m); - if (IPFW_LOADED && V_ether_ipfw != 0) { + if (ip_fw_chk_ptr && V_ether_ipfw != 0) { if (ether_ipfw_chk(&m, ifp, &rule, 0) == 0) { if (m) { m_freem(m); @@ -520,7 +520,7 @@ ether_ipfw_chk(struct mbuf **m0, struct if (i == IP_FW_PASS) /* a PASS rule. */ return 1; - if (DUMMYNET_LOADED && (i == IP_FW_DUMMYNET)) { + if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { /* * Pass the pkt to dummynet, which consumes it. * If shared, make a copy and keep the original. @@ -766,7 +766,7 @@ ether_demux(struct ifnet *ifp, struct mb * Allow dummynet and/or ipfw to claim the frame. * Do not do this for PROMISC frames in case we are re-entered. */ - if (IPFW_LOADED && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { + if (ip_fw_chk_ptr && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { struct ip_fw *rule = ip_dn_claim_rule(m); if (ether_ipfw_chk(&m, NULL, &rule, 0) == 0) { Modified: head/sys/netinet/ip_dummynet.h ============================================================================== --- head/sys/netinet/ip_dummynet.h Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_dummynet.h Fri Jun 5 13:44:30 2009 (r193502) @@ -373,13 +373,6 @@ struct dn_pipe_max { SLIST_HEAD(dn_pipe_head, dn_pipe); #ifdef _KERNEL -typedef int ip_dn_ctl_t(struct sockopt *); /* raw_ip.c */ -typedef void ip_dn_ruledel_t(void *); /* ip_fw.c */ -typedef int ip_dn_io_t(struct mbuf **m, int dir, struct ip_fw_args *fwa); -extern ip_dn_ctl_t *ip_dn_ctl_ptr; -extern ip_dn_ruledel_t *ip_dn_ruledel_ptr; -extern ip_dn_io_t *ip_dn_io_ptr; -#define DUMMYNET_LOADED (ip_dn_io_ptr != NULL) /* * Return the IPFW rule associated with the dummynet tag; if any. Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_fw.h Fri Jun 5 13:44:30 2009 (r193502) @@ -636,9 +636,6 @@ void ipfw_destroy(void); void ipfw_nat_destroy(void); #endif -typedef int ip_fw_ctl_t(struct sockopt *); -extern ip_fw_ctl_t *ip_fw_ctl_ptr; - #ifdef VIMAGE_GLOBALS extern int fw_one_pass; extern int fw_enable; @@ -647,11 +644,6 @@ extern int fw6_enable; #endif #endif -/* For kernel ipfw_ether and ipfw_bridge. */ -typedef int ip_fw_chk_t(struct ip_fw_args *args); -extern ip_fw_chk_t *ip_fw_chk_ptr; -#define IPFW_LOADED (ip_fw_chk_ptr != NULL) - struct ip_fw_chain { struct ip_fw *rules; /* list of rules */ struct ip_fw *reap; /* list of rules to reap */ Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_fw2.c Fri Jun 5 13:44:30 2009 (r193502) @@ -3603,6 +3603,12 @@ remove_rule(struct ip_fw_chain *chain, s return n; } +/* + * Hook for cleaning up dummynet when an ipfw rule is deleted. + * Set/cleared when dummynet module is loaded/unloaded. + */ +void (*ip_dn_ruledel_ptr)(void *) = NULL; + /** * Reclaim storage associated with a list of rules. This is * typically the list created using remove_rule. @@ -3614,7 +3620,7 @@ reap_rules(struct ip_fw *head) while ((rule = head) != NULL) { head = head->next; - if (DUMMYNET_LOADED) + if (ip_dn_ruledel_ptr) ip_dn_ruledel_ptr(rule); free(rule, M_IPFW); } Modified: head/sys/netinet/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ip_fw_pfil.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_fw_pfil.c Fri Jun 5 13:44:30 2009 (r193502) @@ -77,9 +77,6 @@ int fw6_enable = 1; int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); -/* Dummynet hooks. */ -ip_dn_ruledel_t *ip_dn_ruledel_ptr = NULL; - /* Divert hooks. */ ip_divert_packet_t *ip_divert_ptr = NULL; @@ -167,7 +164,7 @@ again: break; /* not reached */ case IP_FW_DUMMYNET: - if (!DUMMYNET_LOADED) + if (ip_dn_io_ptr == NULL) goto drop; if (mtod(*m0, struct ip *)->ip_v == 4) ip_dn_io_ptr(m0, DN_TO_IP_IN, &args); @@ -302,7 +299,7 @@ again: break; /* not reached */ case IP_FW_DUMMYNET: - if (!DUMMYNET_LOADED) + if (ip_dn_io_ptr == NULL) break; if (mtod(*m0, struct ip *)->ip_v == 4) ip_dn_io_ptr(m0, DN_TO_IP_OUT, &args); Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_input.c Fri Jun 5 13:44:30 2009 (r193502) @@ -85,10 +85,6 @@ __FBSDID("$FreeBSD$"); #include -/* XXX: Temporary until ipfw_ether and ipfw_bridge are converted. */ -#include -#include - #include #ifdef CTASSERT @@ -217,12 +213,6 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet CTLFLAG_RDTUN, ip_output_flowtable_size, 2048, "number of entries in the per-cpu output flow caches"); -/* - * ipfw_ether and ipfw_bridge hooks. - * XXX: Temporary until those are converted to pfil_hooks as well. - */ -ip_fw_chk_t *ip_fw_chk_ptr = NULL; -ip_dn_io_t *ip_dn_io_ptr = NULL; #ifdef VIMAGE_GLOBALS int fw_one_pass; #endif Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_var.h Fri Jun 5 13:44:30 2009 (r193502) @@ -173,7 +173,8 @@ extern int ipstealth; /* stealth forwar extern int rsvp_on; extern struct socket *ip_rsvpd; /* reservation protocol daemon */ extern struct socket *ip_mrouter; /* multicast routing daemon */ -#endif +#endif /* VIMAGE_GLOBALS */ + extern u_char ip_protox[]; extern int (*legal_vif_num)(int); extern u_long (*ip_mcast_src)(int); @@ -223,6 +224,13 @@ extern struct pfil_head inet_pfil_hook; void in_delayed_cksum(struct mbuf *m); +/* ipfw and dummynet hooks. Most are declared in raw_ip.c */ +struct ip_fw_args; +extern int (*ip_fw_chk_ptr)(struct ip_fw_args *args); +extern int (*ip_fw_ctl_ptr)(struct sockopt *); +extern int (*ip_dn_ctl_ptr)(struct sockopt *); +extern int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa); +extern void (*ip_dn_ruledel_ptr)(void *); /* in ip_fw2.c */ #endif /* _KERNEL */ #endif /* !_NETINET_IP_VAR_H_ */ Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/raw_ip.c Fri Jun 5 13:44:30 2009 (r193502) @@ -70,8 +70,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #ifdef IPSEC @@ -85,9 +83,15 @@ struct inpcbhead ripcb; struct inpcbinfo ripcbinfo; #endif -/* control hooks for ipfw and dummynet */ -ip_fw_ctl_t *ip_fw_ctl_ptr = NULL; -ip_dn_ctl_t *ip_dn_ctl_ptr = NULL; +/* + * Control and data hooks for ipfw and dummynet. + * The data hooks are not used here but it is convenient + * to keep them all in one place. + */ +int (*ip_fw_ctl_ptr)(struct sockopt *) = NULL; +int (*ip_dn_ctl_ptr)(struct sockopt *) = NULL; +int (*ip_fw_chk_ptr)(struct ip_fw_args *args) = NULL; +int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa) = NULL; /* * Hooks for multicast routing. They all default to NULL, so leave them not From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 13:55:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 378BB1065713; Fri, 5 Jun 2009 13:55:34 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24A6D8FC08; Fri, 5 Jun 2009 13:55:34 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55DtYKZ027564; Fri, 5 Jun 2009 13:55:34 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55DtYWP027563; Fri, 5 Jun 2009 13:55:34 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906051355.n55DtYWP027563@svn.freebsd.org> From: Robert Watson Date: Fri, 5 Jun 2009 13:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193504 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 13:55:35 -0000 Author: rwatson Date: Fri Jun 5 13:55:33 2009 New Revision: 193504 URL: http://svn.freebsd.org/changeset/base/193504 Log: Fix spelling of MAC check for 8.x version of MAC Framework, not noticed due to a lack of an opt_mac.h include, which I won't add for now as options MAC will soon move to opt_global.h. Spotted by: pjd Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Jun 5 13:50:19 2009 (r193503) +++ head/sys/net80211/ieee80211_output.c Fri Jun 5 13:55:33 2009 (r193504) @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include + #define ETHER_HEADER_COPY(dst, src) \ memcpy(dst, src, sizeof(struct ether_header)) @@ -354,7 +356,7 @@ ieee80211_output(struct ifnet *ifp, stru if (dst->sa_family != AF_IEEE80211) return vap->iv_output(ifp, m, dst, ro); #ifdef MAC - error = mac_check_ifnet_transmit(ifp, m); + error = mac_ifnet_check_transmit(ifp, m); if (error) senderr(error); #endif From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 14:07:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93CB6106566B; Fri, 5 Jun 2009 14:07:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82B9E8FC1D; Fri, 5 Jun 2009 14:07:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55E70MK027868; Fri, 5 Jun 2009 14:07:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55E70EA027867; Fri, 5 Jun 2009 14:07:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906051407.n55E70EA027867@svn.freebsd.org> From: John Baldwin Date: Fri, 5 Jun 2009 14:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193506 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 14:07:01 -0000 Author: jhb Date: Fri Jun 5 14:07:00 2009 New Revision: 193506 URL: http://svn.freebsd.org/changeset/base/193506 Log: Trim old remnants of per-CPU KTR buffers. Submitted by: Eygene Ryabinkin Modified: head/sys/sys/pcpu.h Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Fri Jun 5 14:04:36 2009 (r193505) +++ head/sys/sys/pcpu.h Fri Jun 5 14:07:00 2009 (r193506) @@ -76,10 +76,6 @@ struct pcpu { cpumask_t pc_other_cpus; /* Mask of all other cpus */ SLIST_ENTRY(pcpu) pc_allcpu; struct lock_list_entry *pc_spinlocks; -#ifdef KTR_PERCPU - int pc_ktr_idx; /* Index into trace table */ - char *pc_ktr_buf; -#endif #ifdef KTR char pc_name[PCPU_NAME_LEN]; /* String name for KTR. */ #endif From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 14:08:30 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77F891065678; Fri, 5 Jun 2009 14:08:30 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw2.york.ac.uk (mail-gw2.york.ac.uk [144.32.128.247]) by mx1.freebsd.org (Postfix) with ESMTP id E43E38FC0C; Fri, 5 Jun 2009 14:08:29 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw6.york.ac.uk (mail-gw6.york.ac.uk [144.32.129.26]) by mail-gw2.york.ac.uk (8.13.6/8.13.6) with ESMTP id n55Dc40c002775; Fri, 5 Jun 2009 14:38:04 +0100 (BST) Received: from buffy-128.york.ac.uk ([144.32.128.160] helo=buffy.york.ac.uk) by mail-gw6.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1MCZcS-0001CA-QZ; Fri, 05 Jun 2009 14:38:04 +0100 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.3/8.14.3) with ESMTP id n55Dc43w051016; Fri, 5 Jun 2009 14:38:04 +0100 (BST) (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.3/8.14.3/Submit) id n55Dc4aL051015; Fri, 5 Jun 2009 14:38:04 +0100 (BST) (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: Edwin Groothuis In-Reply-To: <200906051305.n55D5Eu8026282@svn.freebsd.org> References: <200906051305.n55D5Eu8026282@svn.freebsd.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 05 Jun 2009 14:38:04 +0100 Message-Id: <1244209084.48730.10.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 FreeBSD GNOME Team Port X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin@freebsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193498 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 14:08:30 -0000 On Fri, 2009-06-05 at 13:05 +0000, Edwin Groothuis wrote: > Author: edwin > Date: Fri Jun 5 13:05:14 2009 > New Revision: 193498 > URL: http://svn.freebsd.org/changeset/base/193498 > > Log: > [patch] Portuguese timedef > > In Portuguese, the names of the days of the week are not capitalized. > Also there is always a dash before "feira" in the names of the days. > For example: "segunda-feira" and not "segunda feira" (which has a > completely different meaning). > > x_fmt is not correct either. The date separator should not be a dot > but a slash. Example: 31/12/2005 if far more used in Portugal than > 31.12.2005. > > References: > - a Portuguese online dictionary http://priberam.pt/dlpo/dlpo.aspx > - http://answers.com/days_of_the_week (there are translations to > various languages, including Portuguese, at the bottom of the > page) > - http://en.wikipedia.org/wiki/Week-day_names (there are translations > to various languages, including Portuguese, at the bottom of the > page) > - a Portuguese style guide > http://www.publico.clix.pt/nos/livro_estilo/16d-palavras.html > ("datas" section) > > PR: conf/58595 > Submitted by: Chris Stenton > MFC after: 1 week Actually, PR: conf/95754 Submitted by: Miguel Saturnino It's great to see somebody touching the locale PRs, there are quite a few of them [1] and most of them have supplied patches that seem "obviously" correct. Thanks! [1] http://people.freebsd.org/~linimon/studies/prs/prs_for_tag_locale.html Gavin From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 14:15:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FCBC1065687; Fri, 5 Jun 2009 14:15:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18F248FC12; Fri, 5 Jun 2009 14:15:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55EF0PO028117; Fri, 5 Jun 2009 14:15:00 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55EF072028116; Fri, 5 Jun 2009 14:15:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906051415.n55EF072028116@svn.freebsd.org> From: Robert Watson Date: Fri, 5 Jun 2009 14:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193507 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 14:15:02 -0000 Author: rwatson Date: Fri Jun 5 14:15:00 2009 New Revision: 193507 URL: http://svn.freebsd.org/changeset/base/193507 Log: Don't check MAC in the NFS server ACL set path, right now we aren't enforcing MAC for NFS clients. Modified: head/sys/fs/nfs/nfs_commonacl.c Modified: head/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- head/sys/fs/nfs/nfs_commonacl.c Fri Jun 5 14:07:00 2009 (r193506) +++ head/sys/fs/nfs/nfs_commonacl.c Fri Jun 5 14:15:00 2009 (r193507) @@ -703,10 +703,6 @@ nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, if (aclp->acl_cnt > (ACL_MAX_ENTRIES - 6) / 2) return (NFSERR_ATTRNOTSUPP); error = VOP_ACLCHECK(vp, ACL_TYPE_NFS4, aclp, cred, p); -#ifdef MAC - if (!error) - error = mac_check_vnode_setacl(cred, vp, ACL_TYPE_NFS4, aclp); -#endif if (!error) error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); return (error); From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 14:23:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 205B51065670; Fri, 5 Jun 2009 14:23:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F32F8FC1A; Fri, 5 Jun 2009 14:23:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55ENOCt028335; Fri, 5 Jun 2009 14:23:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55ENOqx028334; Fri, 5 Jun 2009 14:23:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906051423.n55ENOqx028334@svn.freebsd.org> From: Robert Watson Date: Fri, 5 Jun 2009 14:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193508 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 14:23:25 -0000 Author: rwatson Date: Fri Jun 5 14:23:24 2009 New Revision: 193508 URL: http://svn.freebsd.org/changeset/base/193508 Log: Add mac_framework.h include missed when MAC code was (presumably) copied from another file. Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Fri Jun 5 14:15:00 2009 (r193507) +++ head/sys/kern/vfs_default.c Fri Jun 5 14:23:24 2009 (r193508) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 14:29:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 024921065677; Fri, 5 Jun 2009 14:29:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4A3D8FC1C; Fri, 5 Jun 2009 14:29:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55ETnNi028474; Fri, 5 Jun 2009 14:29:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55ETnZ0028473; Fri, 5 Jun 2009 14:29:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906051429.n55ETnZ0028473@svn.freebsd.org> From: Robert Watson Date: Fri, 5 Jun 2009 14:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193509 - head/sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 14:29:50 -0000 Author: rwatson Date: Fri Jun 5 14:29:49 2009 New Revision: 193509 URL: http://svn.freebsd.org/changeset/base/193509 Log: Correct MAC compile problems resulting from the new RPC code copying and pasting code from the general socket code without also bringing along required opt_mac.h includes. Modified: head/sys/rpc/svc_vc.c Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Fri Jun 5 14:23:24 2009 (r193508) +++ head/sys/rpc/svc_vc.c Fri Jun 5 14:29:49 2009 (r193509) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include +#include + static bool_t svc_vc_rendezvous_recv(SVCXPRT *, struct rpc_msg *, struct sockaddr **, struct mbuf **); static enum xprt_stat svc_vc_rendezvous_stat(SVCXPRT *); @@ -273,7 +276,7 @@ svc_vc_accept(struct socket *head, struc goto done; } #ifdef MAC - error = mac_socket_check_accept(td->td_ucred, head); + error = mac_socket_check_accept(curthread->td_ucred, head); if (error != 0) goto done; #endif From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 14:31:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E1E21065676; Fri, 5 Jun 2009 14:31:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3AC8FC1B; Fri, 5 Jun 2009 14:31:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55EV3jM028548; Fri, 5 Jun 2009 14:31:03 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55EV3uE028547; Fri, 5 Jun 2009 14:31:03 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906051431.n55EV3uE028547@svn.freebsd.org> From: Robert Watson Date: Fri, 5 Jun 2009 14:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193510 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 14:31:04 -0000 Author: rwatson Date: Fri Jun 5 14:31:03 2009 New Revision: 193510 URL: http://svn.freebsd.org/changeset/base/193510 Log: Unifdef MAC label pointer in syncache entries -- in general, ifdef'd structure contents are a bad idea in the kernel for binary compatibility reasons, and this is a single pointer that is now included in compiles by default anyway due to options MAC being in GENERIC. Modified: head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Fri Jun 5 14:29:49 2009 (r193509) +++ head/sys/netinet/tcp_syncache.h Fri Jun 5 14:31:03 2009 (r193510) @@ -74,9 +74,7 @@ struct syncache { struct toe_usrreqs *sc_tu; /* TOE operations */ void *sc_toepcb; /* TOE protocol block */ #endif -#ifdef MAC struct label *sc_label; /* MAC label reference */ -#endif struct ucred *sc_cred; /* cred cache for jail checks */ }; From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 14:55:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1717B106564A; Fri, 5 Jun 2009 14:55:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00B268FC14; Fri, 5 Jun 2009 14:55:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55EtQlc029185; Fri, 5 Jun 2009 14:55:26 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55EtMBc029090; Fri, 5 Jun 2009 14:55:22 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906051455.n55EtMBc029090@svn.freebsd.org> From: Robert Watson Date: Fri, 5 Jun 2009 14:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193511 - in head/sys: compat/linux compat/svr4 conf contrib/pf/net fs/devfs fs/nfsserver fs/unionfs i386/i386 i386/ibcs2 kern net netatalk netinet netinet6 nfsserver security/audit ufs... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 14:55:27 -0000 Author: rwatson Date: Fri Jun 5 14:55:22 2009 New Revision: 193511 URL: http://svn.freebsd.org/changeset/base/193511 Log: Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC and used in a large number of files, but also because an increasing number of incorrect uses of MAC calls were sneaking in due to copy-and-paste of MAC-aware code without the associated opt_mac.h include. Discussed with: pjd Modified: head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_getcwd.c head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_stats.c head/sys/compat/svr4/svr4_fcntl.c head/sys/compat/svr4/svr4_misc.c head/sys/conf/options head/sys/contrib/pf/net/pf.c head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_vfsops.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/fs/unionfs/union_subr.c head/sys/i386/i386/sys_machdep.c head/sys/i386/ibcs2/ibcs2_misc.c head/sys/kern/init_main.c head/sys/kern/kern_acct.c head/sys/kern/kern_alq.c head/sys/kern/kern_environment.c head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_jail.c head/sys/kern/kern_ktrace.c head/sys/kern/kern_linker.c head/sys/kern/kern_mbuf.c head/sys/kern/kern_priv.c head/sys/kern/kern_prot.c head/sys/kern/kern_shutdown.c head/sys/kern/kern_sysctl.c head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c head/sys/kern/subr_trap.c head/sys/kern/sys_pipe.c head/sys/kern/sys_socket.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_mbuf2.c head/sys/kern/uipc_sem.c head/sys/kern/uipc_shm.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_acl.c head/sys/kern/vfs_extattr.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/net/bpf.c head/sys/net/if.c head/sys/net/if_atmsubr.c head/sys/net/if_ethersubr.c head/sys/net/if_fddisubr.c head/sys/net/if_fwsubr.c head/sys/net/if_gif.c head/sys/net/if_iso88025subr.c head/sys/net/if_loop.c head/sys/net/if_stf.c head/sys/net/if_tun.c head/sys/netatalk/aarp.c head/sys/netatalk/ddp_input.c head/sys/netatalk/ddp_output.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_fw2.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_input.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_options.c head/sys/netinet/ip_output.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/frag6.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/nd6.c head/sys/netinet6/udp6_usrreq.c head/sys/nfsserver/nfs_srvkrpc.c head/sys/nfsserver/nfs_srvsock.c head/sys/security/audit/audit_syscalls.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufs_vnops.c head/sys/vm/swap_pager.c head/sys/vm/vm_mmap.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/linux/linux_file.c Fri Jun 5 14:55:22 2009 (r193511) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include #include Modified: head/sys/compat/linux/linux_getcwd.c ============================================================================== --- head/sys/compat/linux/linux_getcwd.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/linux/linux_getcwd.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include #include Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/linux/linux_misc.c Fri Jun 5 14:55:22 2009 (r193511) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include #include Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/linux/linux_stats.c Fri Jun 5 14:55:22 2009 (r193511) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include #include Modified: head/sys/compat/svr4/svr4_fcntl.c ============================================================================== --- head/sys/compat/svr4/svr4_fcntl.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/svr4/svr4_fcntl.c Fri Jun 5 14:55:22 2009 (r193511) @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/svr4/svr4_misc.c Fri Jun 5 14:55:22 2009 (r193511) @@ -35,8 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/conf/options Fri Jun 5 14:55:22 2009 (r193511) @@ -112,7 +112,7 @@ KSTACK_PAGES KTRACE KTRACE_REQUEST_POOL opt_ktrace.h LIBICONV -MAC +MAC opt_global.h MAC_BIBA opt_dontuse.h MAC_BSDEXTENDED opt_dontuse.h MAC_IFOFF opt_dontuse.h Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/contrib/pf/net/pf.c Fri Jun 5 14:55:22 2009 (r193511) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #endif #ifdef __FreeBSD__ -#include "opt_mac.h" #include "opt_bpf.h" #include "opt_pf.h" Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/fs/devfs/devfs_devs.c Fri Jun 5 14:55:22 2009 (r193511) @@ -28,8 +28,6 @@ * $FreeBSD$ */ -#include "opt_mac.h" - #include #include #include Modified: head/sys/fs/devfs/devfs_vfsops.c ============================================================================== --- head/sys/fs/devfs/devfs_vfsops.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/fs/devfs/devfs_vfsops.c Fri Jun 5 14:55:22 2009 (r193511) @@ -34,8 +34,6 @@ * $FreeBSD$ */ -#include "opt_mac.h" /* To set MNT_MULTILABEL. */ - #include #include #include Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/fs/devfs/devfs_vnops.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,8 +40,6 @@ * mkdir: want it ? */ -#include "opt_mac.h" - #include #include #include Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri Jun 5 14:55:22 2009 (r193511) @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + NFSDLOCKMUTEX; /* Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/fs/unionfs/union_subr.c Fri Jun 5 14:55:22 2009 (r193511) @@ -52,9 +52,7 @@ #include #include -#ifdef MAC -#include -#endif +#include #include Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/i386/i386/sys_machdep.c Fri Jun 5 14:55:22 2009 (r193511) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" -#include "opt_mac.h" #include #include Modified: head/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_misc.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/i386/ibcs2/ibcs2_misc.c Fri Jun 5 14:55:22 2009 (r193511) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); * IBCS2 system calls that are implemented differently in BSD are * handled here. */ -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/init_main.c Fri Jun 5 14:55:22 2009 (r193511) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_init_path.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_acct.c Fri Jun 5 14:55:22 2009 (r193511) @@ -70,8 +70,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/kern_alq.c ============================================================================== --- head/sys/kern/kern_alq.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_alq.c Fri Jun 5 14:55:22 2009 (r193511) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_environment.c Fri Jun 5 14:55:22 2009 (r193511) @@ -37,8 +37,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_exec.c Fri Jun 5 14:55:22 2009 (r193511) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include "opt_vm.h" #include Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_exit.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_fork.c Fri Jun 5 14:55:22 2009 (r193511) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_jail.c Fri Jun 5 14:55:22 2009 (r193511) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_ktrace.c Fri Jun 5 14:55:22 2009 (r193511) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_linker.c Fri Jun 5 14:55:22 2009 (r193511) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_hwpmc_hooks.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_mbuf.c Fri Jun 5 14:55:22 2009 (r193511) @@ -28,7 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_param.h" #include Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_priv.c Fri Jun 5 14:55:22 2009 (r193511) @@ -29,7 +29,6 @@ */ #include "opt_kdtrace.h" -#include "opt_mac.h" #include __FBSDID("$FreeBSD$"); Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_prot.c Fri Jun 5 14:55:22 2009 (r193511) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_shutdown.c Fri Jun 5 14:55:22 2009 (r193511) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_kdb.h" -#include "opt_mac.h" #include "opt_panic.h" #include "opt_show_busybufs.h" #include "opt_sched.h" Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_sysctl.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/link_elf.c Fri Jun 5 14:55:22 2009 (r193511) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_gdb.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/link_elf_obj.c Fri Jun 5 14:55:22 2009 (r193511) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/subr_trap.c Fri Jun 5 14:55:22 2009 (r193511) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" -#include "opt_mac.h" #ifdef __i386__ #include "opt_npx.h" #endif Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/sys_pipe.c Fri Jun 5 14:55:22 2009 (r193511) @@ -91,8 +91,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/sys_socket.c Fri Jun 5 14:55:22 2009 (r193511) @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/sysv_msg.c Fri Jun 5 14:55:22 2009 (r193511) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include "opt_sysvipc.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/sysv_sem.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_sysvipc.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/sysv_shm.c Fri Jun 5 14:55:22 2009 (r193511) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_sysvipc.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/uipc_mbuf.c Fri Jun 5 14:55:22 2009 (r193511) @@ -32,7 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_param.h" #include "opt_mbuf_stress_test.h" #include "opt_mbuf_profiling.h" Modified: head/sys/kern/uipc_mbuf2.c ============================================================================== --- head/sys/kern/uipc_mbuf2.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/uipc_mbuf2.c Fri Jun 5 14:55:22 2009 (r193511) @@ -65,8 +65,6 @@ __FBSDID("$FreeBSD$"); /*#define PULLDOWN_DEBUG*/ -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/uipc_sem.c Fri Jun 5 14:55:22 2009 (r193511) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_posix.h" #include Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/uipc_shm.c Fri Jun 5 14:55:22 2009 (r193511) @@ -55,8 +55,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/uipc_socket.c Fri Jun 5 14:55:22 2009 (r193511) @@ -99,7 +99,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include "opt_zero.h" #include "opt_compat.h" Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/uipc_syscalls.c Fri Jun 5 14:55:22 2009 (r193511) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include "opt_sctp.h" #include "opt_compat.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/uipc_usrreq.c Fri Jun 5 14:55:22 2009 (r193511) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/vfs_acl.c Fri Jun 5 14:55:22 2009 (r193511) @@ -35,8 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/vfs_extattr.c Fri Jun 5 14:55:22 2009 (r193511) @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/vfs_lookup.c Fri Jun 5 14:55:22 2009 (r193511) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/vfs_mount.c Fri Jun 5 14:55:22 2009 (r193511) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include "opt_rootdevname.h" -#include "opt_mac.h" #define ROOTNAME "root_device" #define VFS_MOUNTARG_SIZE_MAX (1024 * 64) Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/vfs_subr.c Fri Jun 5 14:55:22 2009 (r193511) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/vfs_syscalls.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/vfs_vnops.c Fri Jun 5 14:55:22 2009 (r193511) @@ -37,8 +37,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/bpf.c Fri Jun 5 14:55:22 2009 (r193511) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include "opt_bpf.h" -#include "opt_mac.h" #include "opt_netgraph.h" #include Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/if.c Fri Jun 5 14:55:22 2009 (r193511) @@ -34,7 +34,6 @@ #include "opt_inet6.h" #include "opt_inet.h" #include "opt_route.h" -#include "opt_mac.h" #include "opt_carp.h" #include Modified: head/sys/net/if_atmsubr.c ============================================================================== --- head/sys/net/if_atmsubr.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/if_atmsubr.c Fri Jun 5 14:55:22 2009 (r193511) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include "opt_natm.h" #include Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/if_ethersubr.c Fri Jun 5 14:55:22 2009 (r193511) @@ -35,7 +35,6 @@ #include "opt_inet6.h" #include "opt_ipx.h" #include "opt_route.h" -#include "opt_mac.h" #include "opt_netgraph.h" #include "opt_carp.h" #include "opt_mbuf_profiling.h" Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/if_fddisubr.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipx.h" -#include "opt_mac.h" #include #include Modified: head/sys/net/if_fwsubr.c ============================================================================== --- head/sys/net/if_fwsubr.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/if_fwsubr.c Fri Jun 5 14:55:22 2009 (r193511) @@ -32,7 +32,6 @@ #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include #include Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/if_gif.c Fri Jun 5 14:55:22 2009 (r193511) @@ -32,7 +32,6 @@ #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include #include Modified: head/sys/net/if_iso88025subr.c ============================================================================== --- head/sys/net/if_iso88025subr.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/if_iso88025subr.c Fri Jun 5 14:55:22 2009 (r193511) @@ -43,7 +43,6 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipx.h" -#include "opt_mac.h" #include #include Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/if_loop.c Fri Jun 5 14:55:22 2009 (r193511) @@ -39,7 +39,6 @@ #include "opt_inet6.h" #include "opt_ipx.h" #include "opt_route.h" -#include "opt_mac.h" #include #include Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/if_stf.c Fri Jun 5 14:55:22 2009 (r193511) @@ -76,7 +76,6 @@ #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include #include Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/net/if_tun.c Fri Jun 5 14:55:22 2009 (r193511) @@ -20,7 +20,6 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipx.h" -#include "opt_mac.h" #include #include Modified: head/sys/netatalk/aarp.c ============================================================================== --- head/sys/netatalk/aarp.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netatalk/aarp.c Fri Jun 5 14:55:22 2009 (r193511) @@ -51,7 +51,6 @@ */ #include "opt_atalk.h" -#include "opt_mac.h" #include #include Modified: head/sys/netatalk/ddp_input.c ============================================================================== --- head/sys/netatalk/ddp_input.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netatalk/ddp_input.c Fri Jun 5 14:55:22 2009 (r193511) @@ -49,8 +49,6 @@ * $FreeBSD$ */ -#include "opt_mac.h" - #include #include #include Modified: head/sys/netatalk/ddp_output.c ============================================================================== --- head/sys/netatalk/ddp_output.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netatalk/ddp_output.c Fri Jun 5 14:55:22 2009 (r193511) @@ -23,8 +23,6 @@ /* $FreeBSD$ */ -#include "opt_mac.h" - #include #include #include Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/if_ether.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_route.h" -#include "opt_mac.h" #include "opt_carp.h" #include Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/igmp.c Fri Jun 5 14:55:22 2009 (r193511) @@ -50,7 +50,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_route.h" #include Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/in_pcb.c Fri Jun 5 14:55:22 2009 (r193511) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_ipsec.h" #include "opt_inet6.h" -#include "opt_mac.h" #include #include Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/ip_divert.c Fri Jun 5 14:55:22 2009 (r193511) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #if !defined(KLD_MODULE) #include "opt_inet.h" #include "opt_ipfw.h" -#include "opt_mac.h" #include "opt_sctp.h" #ifndef INET #error "IPDIVERT requires INET." Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/ip_fw2.c Fri Jun 5 14:55:22 2009 (r193511) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #endif #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include "opt_route.h" #include Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/ip_icmp.c Fri Jun 5 14:55:22 2009 (r193511) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipsec.h" -#include "opt_mac.h" #include #include Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/ip_input.c Fri Jun 5 14:55:22 2009 (r193511) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipstealth.h" #include "opt_ipsec.h" #include "opt_route.h" -#include "opt_mac.h" #include "opt_carp.h" #include Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/ip_mroute.c Fri Jun 5 14:55:22 2009 (r193511) @@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" -#include "opt_mac.h" #include "opt_mrouting.h" #define _PIM_VT 1 Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/ip_options.c Fri Jun 5 14:55:22 2009 (r193511) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipstealth.h" -#include "opt_mac.h" #include #include Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/ip_output.c Fri Jun 5 14:55:22 2009 (r193511) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipfw.h" #include "opt_ipsec.h" #include "opt_route.h" -#include "opt_mac.h" #include "opt_mbuf_stress_test.h" #include "opt_mpath.h" #include "opt_sctp.h" Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/raw_ip.c Fri Jun 5 14:55:22 2009 (r193511) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_ipsec.h" #include "opt_route.h" -#include "opt_mac.h" #include #include Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/tcp_input.c Fri Jun 5 14:55:22 2009 (r193511) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include "opt_tcpdebug.h" #include Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/tcp_output.c Fri Jun 5 14:55:22 2009 (r193511) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include "opt_tcpdebug.h" #include Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/tcp_subr.c Fri Jun 5 14:55:22 2009 (r193511) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include "opt_tcpdebug.h" #include Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/tcp_syncache.c Fri Jun 5 14:55:22 2009 (r193511) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include #include Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/tcp_timewait.c Fri Jun 5 14:55:22 2009 (r193511) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include "opt_tcpdebug.h" #include Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet/udp_usrreq.c Fri Jun 5 14:55:22 2009 (r193511) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipfw.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include #include Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet6/frag6.c Fri Jun 5 14:55:22 2009 (r193511) @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet6/in6_pcb.c Fri Jun 5 14:55:22 2009 (r193511) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include #include Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet6/nd6.c Fri Jun 5 14:55:22 2009 (r193511) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include "opt_route.h" #include Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/netinet6/udp6_usrreq.c Fri Jun 5 14:55:22 2009 (r193511) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include #include Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/nfsserver/nfs_srvkrpc.c Fri Jun 5 14:55:22 2009 (r193511) @@ -81,6 +81,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #ifndef NFS_LEGACYRPC static MALLOC_DEFINE(M_NFSSVC, "nfss_srvsock", "Nfs server structure"); Modified: head/sys/nfsserver/nfs_srvsock.c ============================================================================== --- head/sys/nfsserver/nfs_srvsock.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/nfsserver/nfs_srvsock.c Fri Jun 5 14:55:22 2009 (r193511) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); * Socket operations for use by nfs */ -#include "opt_mac.h" - #include #include #include Modified: head/sys/security/audit/audit_syscalls.c ============================================================================== --- head/sys/security/audit/audit_syscalls.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/security/audit/audit_syscalls.c Fri Jun 5 14:55:22 2009 (r193511) @@ -30,8 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Jun 5 14:55:22 2009 (r193511) @@ -32,7 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_quota.h" #include "opt_ufs.h" #include "opt_ffs.h" Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/ufs/ufs/ufs_vnops.c Fri Jun 5 14:55:22 2009 (r193511) @@ -37,7 +37,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_quota.h" #include "opt_suiddir.h" #include "opt_ufs.h" Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/vm/swap_pager.c Fri Jun 5 14:55:22 2009 (r193511) @@ -69,7 +69,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_swap.h" #include "opt_vm.h" Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/vm/vm_mmap.c Fri Jun 5 14:55:22 2009 (r193511) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_hwpmc_hooks.h" -#include "opt_mac.h" #include #include From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 15:19:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 097C8106566B; Fri, 5 Jun 2009 15:19:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB4388FC1C; Fri, 5 Jun 2009 15:19:05 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55FJ5ML029669; Fri, 5 Jun 2009 15:19:05 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55FJ5lV029667; Fri, 5 Jun 2009 15:19:05 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906051519.n55FJ5lV029667@svn.freebsd.org> From: Ed Schouten Date: Fri, 5 Jun 2009 15:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193512 - in head/sys/dev: kbd kbdmux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 15:19:06 -0000 Author: ed Date: Fri Jun 5 15:19:05 2009 New Revision: 193512 URL: http://svn.freebsd.org/changeset/base/193512 Log: Move buffer management into kbd and kbdmux drivers. These two drivers seem to be the last consumers of clists. clists are quite overengineered for simple circular buffers, so I'm adding similar buffer management routines to the kbd and kbdmux drivers. The input buffer is now part of the softc structures, instead of having dynamically allocated cblocks. Modified: head/sys/dev/kbd/kbd.c head/sys/dev/kbdmux/kbdmux.c Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Fri Jun 5 14:55:22 2009 (r193511) +++ head/sys/dev/kbd/kbd.c Fri Jun 5 15:19:05 2009 (r193512) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -50,11 +49,16 @@ __FBSDID("$FreeBSD$"); #define KBD_INDEX(dev) dev2unit(dev) +#define KB_QSIZE 512 +#define KB_BUFSIZE 64 + typedef struct genkbd_softc { int gkb_flags; /* flag/status bits */ #define KB_ASLEEP (1 << 0) - struct clist gkb_q; /* input queue */ struct selinfo gkb_rsel; + char gkb_q[KB_QSIZE]; /* input queue */ + unsigned int gkb_q_start; + unsigned int gkb_q_length; } genkbd_softc_t; static SLIST_HEAD(, keyboard_driver) keyboard_drivers = @@ -521,8 +525,38 @@ kbd_detach(keyboard_t *kbd) * driver functions. */ -#define KB_QSIZE 512 -#define KB_BUFSIZE 64 +static void +genkbd_putc(genkbd_softc_t *sc, char c) +{ + unsigned int p; + + if (sc->gkb_q_length == KB_QSIZE) + return; + + p = (sc->gkb_q_start + sc->gkb_q_length) % KB_QSIZE; + sc->gkb_q[p] = c; + sc->gkb_q_length++; +} + +static size_t +genkbd_getc(genkbd_softc_t *sc, char *buf, size_t len) +{ + + /* Determine copy size. */ + if (sc->gkb_q_length == 0) + return (0); + if (len >= sc->gkb_q_length) + len = sc->gkb_q_length; + if (len >= KB_QSIZE - sc->gkb_q_start) + len = KB_QSIZE - sc->gkb_q_start; + + /* Copy out data and progress offset. */ + memcpy(buf, sc->gkb_q + sc->gkb_q_start, len); + sc->gkb_q_start = (sc->gkb_q_start + len) % KB_QSIZE; + sc->gkb_q_length -= len; + + return (len); +} static kbd_callback_func_t genkbd_event; @@ -555,10 +589,7 @@ genkbdopen(struct cdev *dev, int mode, i * the device may still be missing (!KBD_HAS_DEVICE(kbd)). */ -#if 0 - bzero(&sc->gkb_q, sizeof(sc->gkb_q)); -#endif - clist_alloc_cblocks(&sc->gkb_q, KB_QSIZE, KB_QSIZE/2); /* XXX */ + sc->gkb_q_length = 0; splx(s); return (0); @@ -582,9 +613,6 @@ genkbdclose(struct cdev *dev, int mode, /* XXX: we shall be forgiving and don't report error... */ } else { kbd_release(kbd, (void *)sc); -#if 0 - clist_free_cblocks(&sc->gkb_q); -#endif } splx(s); return (0); @@ -608,7 +636,7 @@ genkbdread(struct cdev *dev, struct uio splx(s); return (ENXIO); } - while (sc->gkb_q.c_cc == 0) { + while (sc->gkb_q_length == 0) { if (flag & O_NONBLOCK) { splx(s); return (EWOULDBLOCK); @@ -632,7 +660,7 @@ genkbdread(struct cdev *dev, struct uio error = 0; while (uio->uio_resid > 0) { len = imin(uio->uio_resid, sizeof(buffer)); - len = q_to_b(&sc->gkb_q, buffer, len); + len = genkbd_getc(sc, buffer, len); if (len <= 0) break; error = uiomove(buffer, len, uio); @@ -684,7 +712,7 @@ genkbdpoll(struct cdev *dev, int events, if ((sc == NULL) || (kbd == NULL) || !KBD_IS_VALID(kbd)) { revents = POLLHUP; /* the keyboard has gone */ } else if (events & (POLLIN | POLLRDNORM)) { - if (sc->gkb_q.c_cc > 0) + if (sc->gkb_q_length > 0) revents = events & (POLLIN | POLLRDNORM); else selrecord(td, &sc->gkb_rsel); @@ -738,7 +766,7 @@ genkbd_event(keyboard_t *kbd, int event, /* store the byte as is for K_RAW and K_CODE modes */ if (mode != K_XLATE) { - putc(KEYCHAR(c), &sc->gkb_q); + genkbd_putc(sc, KEYCHAR(c)); continue; } @@ -753,9 +781,9 @@ genkbd_event(keyboard_t *kbd, int event, /* ignore them... */ continue; case BTAB: /* a backtab: ESC [ Z */ - putc(0x1b, &sc->gkb_q); - putc('[', &sc->gkb_q); - putc('Z', &sc->gkb_q); + genkbd_putc(sc, 0x1b); + genkbd_putc(sc, '['); + genkbd_putc(sc, 'Z'); continue; } } @@ -763,24 +791,24 @@ genkbd_event(keyboard_t *kbd, int event, /* normal chars, normal chars with the META, function keys */ switch (KEYFLAGS(c)) { case 0: /* a normal char */ - putc(KEYCHAR(c), &sc->gkb_q); + genkbd_putc(sc, KEYCHAR(c)); break; case MKEY: /* the META flag: prepend ESC */ - putc(0x1b, &sc->gkb_q); - putc(KEYCHAR(c), &sc->gkb_q); + genkbd_putc(sc, 0x1b); + genkbd_putc(sc, KEYCHAR(c)); break; case FKEY | SPCLKEY: /* a function key, return string */ cp = kbdd_get_fkeystr(kbd, KEYCHAR(c), &len); if (cp != NULL) { while (len-- > 0) - putc(*cp++, &sc->gkb_q); + genkbd_putc(sc, *cp++); } break; } } /* wake up sleeping/polling processes */ - if (sc->gkb_q.c_cc > 0) { + if (sc->gkb_q_length > 0) { if (sc->gkb_flags & KB_ASLEEP) { sc->gkb_flags &= ~KB_ASLEEP; wakeup(sc); Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Fri Jun 5 14:55:22 2009 (r193511) +++ head/sys/dev/kbdmux/kbdmux.c Fri Jun 5 15:19:05 2009 (r193512) @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -134,7 +133,9 @@ typedef struct kbdmux_kbd kbdmux_kbd_t; */ struct kbdmux_state { - struct clist ks_inq; /* input chars queue */ + char ks_inq[KBDMUX_Q_SIZE]; /* input chars queue */ + unsigned int ks_inq_start; + unsigned int ks_inq_length; struct task ks_task; /* interrupt task */ struct callout ks_timo; /* timeout handler */ #define TICKS (hz) /* rate */ @@ -167,6 +168,34 @@ static task_fn_t kbdmux_kbd_intr; static timeout_t kbdmux_kbd_intr_timo; static kbd_callback_func_t kbdmux_kbd_event; +static void +kbdmux_kbd_putc(kbdmux_state_t *state, char c) +{ + unsigned int p; + + if (state->ks_inq_length == KBDMUX_Q_SIZE) + return; + + p = (state->ks_inq_start + state->ks_inq_length) % KBDMUX_Q_SIZE; + state->ks_inq[p] = c; + state->ks_inq_length++; +} + +static char +kbdmux_kbd_getc(kbdmux_state_t *state) +{ + char c; + + if (state->ks_inq_length == 0) + return (-1); + + c = state->ks_inq[state->ks_inq_start]; + state->ks_inq_start = (state->ks_inq_start + 1) % KBDMUX_Q_SIZE; + state->ks_inq_length--; + + return (c); +} + /* * Interrupt handler task */ @@ -205,7 +234,7 @@ kbdmux_kbd_intr_timo(void *xstate) callout_deactivate(&state->ks_timo); /* queue interrupt task if needed */ - if (state->ks_inq.c_cc > 0 && !(state->ks_flags & TASK) && + if (state->ks_inq_length > 0 && !(state->ks_flags & TASK) && KBDMUX_QUEUE_INTR(state) == 0) state->ks_flags |= TASK; @@ -246,11 +275,11 @@ kbdmux_kbd_event(keyboard_t *kbd, int ev if (!KBD_IS_BUSY(kbd)) continue; /* not open - discard the input */ - putc(c, &state->ks_inq); + kbdmux_kbd_putc(state, c); } /* queue interrupt task if needed */ - if (state->ks_inq.c_cc > 0 && !(state->ks_flags & TASK) && + if (state->ks_inq_length > 0 && !(state->ks_flags & TASK) && KBDMUX_QUEUE_INTR(state) == 0) state->ks_flags |= TASK; @@ -384,8 +413,6 @@ kbdmux_init(int unit, keyboard_t **kbdp, } KBDMUX_LOCK_INIT(state); - clist_alloc_cblocks(&state->ks_inq, - KBDMUX_Q_SIZE, KBDMUX_Q_SIZE / 2); TASK_INIT(&state->ks_task, 0, kbdmux_kbd_intr, (void *) kbd); KBDMUX_CALLOUT_INIT(state); SLIST_INIT(&state->ks_kbds); @@ -448,10 +475,8 @@ kbdmux_init(int unit, keyboard_t **kbdp, return (0); bad: if (needfree) { - if (state != NULL) { - clist_free_cblocks(&state->ks_inq); + if (state != NULL) free(state, M_KBDMUX); - } if (keymap != NULL) free(keymap, M_KBDMUX); if (accmap != NULL) @@ -495,10 +520,6 @@ kbdmux_term(keyboard_t *kbd) free(k, M_KBDMUX); } - /* flush input queue */ - ndflush(&state->ks_inq, state->ks_inq.c_cc); - clist_free_cblocks(&state->ks_inq); - KBDMUX_UNLOCK(state); kbd_unregister(kbd); @@ -577,7 +598,7 @@ kbdmux_read(keyboard_t *kbd, int wait) int c; KBDMUX_LOCK(state); - c = getc(&state->ks_inq); + c = kbdmux_kbd_getc(state); KBDMUX_UNLOCK(state); if (c != -1) @@ -599,7 +620,7 @@ kbdmux_check(keyboard_t *kbd) return (FALSE); KBDMUX_LOCK(state); - ready = (state->ks_inq.c_cc > 0)? TRUE : FALSE; + ready = (state->ks_inq_length > 0) ? TRUE : FALSE; KBDMUX_UNLOCK(state); return (ready); @@ -635,7 +656,7 @@ next_code: } /* see if there is something in the keyboard queue */ - scancode = getc(&state->ks_inq); + scancode = kbdmux_kbd_getc(state); if (scancode == -1) { if (state->ks_flags & POLLING) { kbdmux_kbd_t *k; @@ -650,11 +671,11 @@ next_code: if (!KBD_IS_BUSY(k->kbd)) continue; - putc(scancode, &state->ks_inq); + kbdmux_kbd_putc(state, scancode); } } - if (state->ks_inq.c_cc > 0) + if (state->ks_inq_length > 0) goto next_code; } @@ -895,7 +916,7 @@ kbdmux_check_char(keyboard_t *kbd) if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char != 0)) ready = TRUE; else - ready = (state->ks_inq.c_cc > 0)? TRUE : FALSE; + ready = (state->ks_inq_length > 0) ? TRUE : FALSE; KBDMUX_UNLOCK(state); @@ -1219,8 +1240,7 @@ kbdmux_clear_state_locked(kbdmux_state_t state->ks_accents = 0; state->ks_composed_char = 0; /* state->ks_prefix = 0; XXX */ - - ndflush(&state->ks_inq, state->ks_inq.c_cc); + state->ks_inq_length = 0; } static void From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 15:31:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EB7910656ED; Fri, 5 Jun 2009 15:31:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CE3B8FC1D; Fri, 5 Jun 2009 15:31:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55FVcen029960; Fri, 5 Jun 2009 15:31:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55FVcf1029956; Fri, 5 Jun 2009 15:31:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906051531.n55FVcf1029956@svn.freebsd.org> From: Ed Schouten Date: Fri, 5 Jun 2009 15:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193513 - in head: . sys/conf sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 15:31:39 -0000 Author: ed Date: Fri Jun 5 15:31:38 2009 New Revision: 193513 URL: http://svn.freebsd.org/changeset/base/193513 Log: Remove clists from the kernel. Clists were originally used by the TTY layer as a text buffer interface. The advantage of clists were that it would allocate a small set of additional buffers that could be shared between TTYs when needed. In the modern days we can just allocate some more KBs of memory to keep the TTYs satisfied. The global cfreelist also requires synchronisation, which may not be useful when trying to improve scalability. The MPSAFE TTY layer uses its own text buffers (ttyinq and ttyoutq). We had a small amount of drivers in the tree that still uses clists, like the old USB stack and some keyboard drivers. With the old USB stack gone and the keyboard drivers changed to use a circular buffer, we can safely remove clists from the kernel. Deleted: head/sys/kern/subr_clist.c head/sys/sys/clist.h Modified: head/ObsoleteFiles.inc head/sys/conf/files head/sys/sys/param.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Jun 5 15:19:05 2009 (r193512) +++ head/ObsoleteFiles.inc Fri Jun 5 15:31:38 2009 (r193513) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090605: removal of clists +OLD_FILES+=usr/include/sys/clist.h # 20090602: removal of window(1) OLD_FILES+=usr/bin/window OLD_FILES+=usr/share/man/man1/window.1.gz Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jun 5 15:19:05 2009 (r193512) +++ head/sys/conf/files Fri Jun 5 15:31:38 2009 (r193513) @@ -1969,7 +1969,6 @@ kern/subr_autoconf.c standard kern/subr_blist.c standard kern/subr_bus.c standard kern/subr_bufring.c standard -kern/subr_clist.c standard kern/subr_clock.c standard kern/subr_devstat.c standard kern/subr_disk.c standard Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jun 5 15:19:05 2009 (r193512) +++ head/sys/sys/param.h Fri Jun 5 15:31:38 2009 (r193513) @@ -196,11 +196,6 @@ #define NODEV (dev_t)(-1) /* non-existent device */ -#define CBLOCK 128 /* Clist block size, must be a power of 2. */ - /* Data chars/clist. */ -#define CBSIZE (CBLOCK - sizeof(struct cblock *)) -#define CROUND (CBLOCK - 1) /* Clist rounding. */ - /* * File system parameters and macros. * From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 15:36:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4685F10656CA; Fri, 5 Jun 2009 15:36:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 0BD4E8FC15; Fri, 5 Jun 2009 15:36:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 6EFE01CC2E; Fri, 5 Jun 2009 17:36:00 +0200 (CEST) Date: Fri, 5 Jun 2009 17:36:00 +0200 From: Ed Schouten To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20090605153600.GM48776@hoeg.nl> References: <200906051531.n55FVcf1029956@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="w5xl9Cr7DZZ9WNrn" Content-Disposition: inline In-Reply-To: <200906051531.n55FVcf1029956@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: Subject: Re: svn commit: r193513 - in head: . sys/conf sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 15:36:02 -0000 --w5xl9Cr7DZZ9WNrn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > Remove clists from the kernel. Just an interesting fact to mention: clists were rewritten by David Greenman back in 1994, as a result of the AT&T <-> BSD lawsuit. If you look in our SVN/CVS history, you'll see that the first revision of tty_subr.c only has "Body deleted." comments inside. --=20 Ed Schouten WWW: http://80386.nl/ --w5xl9Cr7DZZ9WNrn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkopO2AACgkQ52SDGA2eCwVd5ACeMFSCtsLb73dtEmG87wi4u8u/ vaEAn3GUM2zCdqLFdu/hqo58HSf6YZg0 =pFnq -----END PGP SIGNATURE----- --w5xl9Cr7DZZ9WNrn-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 16:16:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78B5D106566B; Fri, 5 Jun 2009 16:16:08 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 664088FC1B; Fri, 5 Jun 2009 16:16:08 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55GG8RI030935; Fri, 5 Jun 2009 16:16:08 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55GG8i8030933; Fri, 5 Jun 2009 16:16:08 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906051616.n55GG8i8030933@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 5 Jun 2009 16:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193516 - in head: sbin/ipfw sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 16:16:08 -0000 Author: luigi Date: Fri Jun 5 16:16:07 2009 New Revision: 193516 URL: http://svn.freebsd.org/changeset/base/193516 Log: Several ipfw options and actions use a 16-bit argument to indicate pipes, queues, tags, rule numbers and so on. These are all different namespaces, and the only thing they have in common is the fact they use a 16-bit slot to represent the argument. There is some confusion in the code, mostly for historical reasons, on how the values 0 and 65535 should be used. At the moment, 0 is forbidden almost everywhere, while 65535 is used to represent a 'tablearg' argument, i.e. the result of the most recent table() lookup. For now, try to use explicit constants for the min and max allowed values, and do not overload the default rule number for that. Also, make the MTAG_IPFW declaration only visible to the kernel. NOTE: I think the issue needs to be revisited before 8.0 is out: the 2^16 namespace limit for rule numbers and pipe/queue is annoying, and we can easily bump the limit to 2^32 which gives a lot more flexibility in partitioning the namespace. MFC after: 5 days Modified: head/sbin/ipfw/ipfw2.c head/sys/netinet/ip_fw.h Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Fri Jun 5 15:57:07 2009 (r193515) +++ head/sbin/ipfw/ipfw2.c Fri Jun 5 16:16:07 2009 (r193516) @@ -2859,7 +2859,7 @@ chkarg: if (have_tag) errx(EX_USAGE, "tag and untag cannot be " "specified more than once"); - GET_UINT_ARG(tag, 1, IPFW_DEFAULT_RULE - 1, i, + GET_UINT_ARG(tag, IPFW_ARG_MIN, IPFW_ARG_MAX, i, rule_action_params); have_tag = cmd; fill_cmd(cmd, O_TAG, (i == TOK_TAG) ? 0: F_NOT, tag); @@ -3336,7 +3336,7 @@ read_options: if (c->limit_mask == 0) errx(EX_USAGE, "limit: missing limit mask"); - GET_UINT_ARG(c->conn_limit, 1, IPFW_DEFAULT_RULE - 1, + GET_UINT_ARG(c->conn_limit, IPFW_ARG_MIN, IPFW_ARG_MAX, TOK_LIMIT, rule_options); ac--; av++; @@ -3464,7 +3464,7 @@ read_options: else { uint16_t tag; - GET_UINT_ARG(tag, 1, IPFW_DEFAULT_RULE - 1, + GET_UINT_ARG(tag, IPFW_ARG_MIN, IPFW_ARG_MAX, TOK_TAGGED, rule_options); fill_cmd(cmd, O_TAGGED, 0, tag); } Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Fri Jun 5 15:57:07 2009 (r193515) +++ head/sys/netinet/ip_fw.h Fri Jun 5 16:16:07 2009 (r193516) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa + * Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,6 +43,20 @@ #define IPFW_TABLES_MAX 128 /* + * Most commands (queue, pipe, tag, untag, limit...) can have a 16-bit + * argument between 1 and 65534. The value 0 is unused, the value + * 65535 (IP_FW_TABLEARG) is used to represent 'tablearg', i.e. the + * can be 1..65534, or 65535 to indicate the use of a 'tablearg' + * result of the most recent table() lookup. + * Note that 16bit is only a historical limit, resulting from + * the use of a 16-bit fields for that value. In reality, we can have + * 2^32 pipes, queues, tag values and so on, and use 0 as a tablearg. + */ +#define IPFW_ARG_MIN 1 +#define IPFW_ARG_MAX 65534 +#define IP_FW_TABLEARG 65535 /* XXX should use 0 */ + +/* * The kernel representation of ipfw rules is made of a list of * 'instructions' (for all practical purposes equivalent to BPF * instructions), which specify which fields of the packet @@ -239,8 +253,6 @@ typedef struct _ipfw_insn { /* template */ #define F_INSN_SIZE(t) ((sizeof (t))/sizeof(u_int32_t)) -#define MTAG_IPFW 1148380143 /* IPFW-tagged cookie */ - /* * This is used to store an array of 16-bit entries (ports etc.) */ @@ -558,13 +570,13 @@ typedef struct _ipfw_table { ipfw_table_entry ent[0]; /* entries */ } ipfw_table; -#define IP_FW_TABLEARG 65535 - /* * Main firewall chains definitions and global var's definitions. */ #ifdef _KERNEL +#define MTAG_IPFW 1148380143 /* IPFW-tagged cookie */ + /* Return values from ipfw_chk() */ enum { IP_FW_PASS = 0, From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 16:44:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A54941065672; Fri, 5 Jun 2009 16:44:42 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93D398FC22; Fri, 5 Jun 2009 16:44:42 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55GigHO031501; Fri, 5 Jun 2009 16:44:42 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55Gigtw031500; Fri, 5 Jun 2009 16:44:42 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200906051644.n55Gigtw031500@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 5 Jun 2009 16:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193518 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 16:44:43 -0000 Author: marcus (doc,ports committer) Date: Fri Jun 5 16:44:42 2009 New Revision: 193518 URL: http://svn.freebsd.org/changeset/base/193518 Log: Unlock the cache lock before returning when we run out of buffer space trying to fill in the full path name. Reported by: David Naylor Approved by: kib Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Jun 5 16:43:47 2009 (r193517) +++ head/sys/kern/vfs_cache.c Fri Jun 5 16:44:42 2009 (r193518) @@ -1140,8 +1140,10 @@ vn_fullpath1(struct thread *td, struct v error = vn_vptocnp_locked(&vp, buf, &buflen); if (error) return (error); - if (buflen == 0) + if (buflen == 0) { + CACHE_RUNLOCK(); return (ENOMEM); + } buf[--buflen] = '/'; slash_prefixed = 1; } @@ -1169,6 +1171,7 @@ vn_fullpath1(struct thread *td, struct v if (error) break; if (buflen == 0) { + CACHE_RUNLOCK(); error = ENOMEM; SDT_PROBE(vfs, namecache, fullpath, return, error, startvp, NULL, 0, 0); From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 16:55:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1515B1065705; Fri, 5 Jun 2009 16:55:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 034F28FC26; Fri, 5 Jun 2009 16:55:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55GtA6C031889; Fri, 5 Jun 2009 16:55:10 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55GtAid031888; Fri, 5 Jun 2009 16:55:10 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906051655.n55GtAid031888@svn.freebsd.org> From: Alan Cox Date: Fri, 5 Jun 2009 16:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193521 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 16:55:11 -0000 Author: alc Date: Fri Jun 5 16:55:10 2009 New Revision: 193521 URL: http://svn.freebsd.org/changeset/base/193521 Log: Simplify contigfree(). Modified: head/sys/vm/vm_contig.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Fri Jun 5 16:47:35 2009 (r193520) +++ head/sys/vm/vm_contig.c Fri Jun 5 16:55:10 2009 (r193521) @@ -281,9 +281,7 @@ again: void contigfree(void *addr, unsigned long size, struct malloc_type *type) { - vm_pindex_t npgs; - npgs = round_page(size) >> PAGE_SHIFT; kmem_free(kernel_map, (vm_offset_t)addr, size); - malloc_type_freed(type, npgs << PAGE_SHIFT); + malloc_type_freed(type, round_page(size)); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 17:06:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B877C1065675; Fri, 5 Jun 2009 17:06:20 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A734B8FC1F; Fri, 5 Jun 2009 17:06:20 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55H6K5A032165; Fri, 5 Jun 2009 17:06:20 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55H6KsG032164; Fri, 5 Jun 2009 17:06:20 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906051706.n55H6KsG032164@svn.freebsd.org> From: Alan Cox Date: Fri, 5 Jun 2009 17:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193522 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 17:06:21 -0000 Author: alc Date: Fri Jun 5 17:06:20 2009 New Revision: 193522 URL: http://svn.freebsd.org/changeset/base/193522 Log: vm_thread_swapin() needn't validate any pages. The pages are already validated by vm_pager_get_pages(). Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Fri Jun 5 16:55:10 2009 (r193521) +++ head/sys/vm/vm_glue.c Fri Jun 5 17:06:20 2009 (r193522) @@ -455,7 +455,6 @@ vm_thread_swapin(struct thread *td) if (rv != VM_PAGER_OK) panic("vm_thread_swapin: cannot get kstack for proc: %d", td->td_proc->p_pid); m = vm_page_lookup(ksobj, i); - m->valid = VM_PAGE_BITS_ALL; } ma[i] = m; vm_page_lock_queues(); From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 17:19:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 854B5106568D; Fri, 5 Jun 2009 17:19:55 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73F428FC12; Fri, 5 Jun 2009 17:19:55 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55HJtmB032497; Fri, 5 Jun 2009 17:19:55 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55HJtIc032496; Fri, 5 Jun 2009 17:19:55 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906051719.n55HJtIc032496@svn.freebsd.org> From: Sam Leffler Date: Fri, 5 Jun 2009 17:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193524 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 17:19:56 -0000 Author: sam Date: Fri Jun 5 17:19:55 2009 New Revision: 193524 URL: http://svn.freebsd.org/changeset/base/193524 Log: Do not force the mtu to 2290; this was done to insure large EAPOL frames could be handled w/o fragmentation but clobbers user-specified values such as those required when the interface is bridged. Submitted by: jim@netgate.com Reviewed by: Jouni Malinen MFC after: 3 days Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Fri Jun 5 17:06:27 2009 (r193523) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Fri Jun 5 17:19:55 2009 (r193524) @@ -161,18 +161,6 @@ bsd_set_iface_flags(void *priv, int flag perror("ioctl[SIOCSIFFLAGS]"); return -1; } - - if (flags > 0) { - memset(&ifr, 0, sizeof(ifr)); - snprintf(ifr.ifr_name, IFNAMSIZ, "%s", drv->iface); - ifr.ifr_mtu = HOSTAPD_MTU; - if (ioctl(drv->ioctl_sock, SIOCSIFMTU, &ifr) != 0) { - perror("ioctl[SIOCSIFMTU]"); - printf("Setting MTU failed - trying to survive with " - "current value\n"); - } - } - return 0; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 17:26:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BC441065673; Fri, 5 Jun 2009 17:26:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A14D8FC1D; Fri, 5 Jun 2009 17:26:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55HQFU0032776; Fri, 5 Jun 2009 17:26:15 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55HQF0n032773; Fri, 5 Jun 2009 17:26:15 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906051726.n55HQF0n032773@svn.freebsd.org> From: Sam Leffler Date: Fri, 5 Jun 2009 17:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193526 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 17:26:16 -0000 Author: sam Date: Fri Jun 5 17:26:15 2009 New Revision: 193526 URL: http://svn.freebsd.org/changeset/base/193526 Log: note lack of power save support in ap mode Submitted by: "Paul B. Mahol" Modified: head/share/man/man4/ral.4 head/share/man/man4/rum.4 head/share/man/man4/ural.4 Modified: head/share/man/man4/ral.4 ============================================================================== --- head/share/man/man4/ral.4 Fri Jun 5 17:20:19 2009 (r193525) +++ head/share/man/man4/ral.4 Fri Jun 5 17:26:15 2009 (r193526) @@ -251,3 +251,7 @@ The original .Nm driver was written by .An Damien Bergamini Aq damien@FreeBSD.org . +.Sh CAVEATS +Host AP mode doesn't support power saving. +Clients attempting to use power saving mode may experience significant +packet loss (disabling power saving on the client will fix this). Modified: head/share/man/man4/rum.4 ============================================================================== --- head/share/man/man4/rum.4 Fri Jun 5 17:20:19 2009 (r193525) +++ head/share/man/man4/rum.4 Fri Jun 5 17:26:15 2009 (r193526) @@ -181,3 +181,7 @@ driver was written by .An Niall O'Higgins Aq niallo@openbsd.org and .An Damien Bergamini Aq damien@openbsd.org . +.Sh CAVEATS +Host AP mode doesn't support power saving. +Clients attempting to use power saving mode may experience significant +packet loss (disabling power saving on the client will fix this). Modified: head/share/man/man4/ural.4 ============================================================================== --- head/share/man/man4/ural.4 Fri Jun 5 17:20:19 2009 (r193525) +++ head/share/man/man4/ural.4 Fri Jun 5 17:26:15 2009 (r193526) @@ -160,3 +160,7 @@ The original .Nm driver was written by .An Damien Bergamini Aq damien.bergamini@free.fr +.Sh CAVEATS +Host AP mode doesn't support power saving. +Clients attempting to use power saving mode may experience significant +packet loss (disabling power saving on the client will fix this). From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 17:44:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12ABC106566B; Fri, 5 Jun 2009 17:44:44 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DADC38FC08; Fri, 5 Jun 2009 17:44:43 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55HihQQ033234; Fri, 5 Jun 2009 17:44:43 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55HihOh033231; Fri, 5 Jun 2009 17:44:43 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906051744.n55HihOh033231@svn.freebsd.org> From: Sam Leffler Date: Fri, 5 Jun 2009 17:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193527 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 17:44:44 -0000 Author: sam Date: Fri Jun 5 17:44:43 2009 New Revision: 193527 URL: http://svn.freebsd.org/changeset/base/193527 Log: lack of power save violates 802.11 and is a bug, not a "caveat" Modified: head/share/man/man4/ral.4 head/share/man/man4/rum.4 head/share/man/man4/ural.4 Modified: head/share/man/man4/ral.4 ============================================================================== --- head/share/man/man4/ral.4 Fri Jun 5 17:26:15 2009 (r193526) +++ head/share/man/man4/ral.4 Fri Jun 5 17:44:43 2009 (r193527) @@ -251,7 +251,7 @@ The original .Nm driver was written by .An Damien Bergamini Aq damien@FreeBSD.org . -.Sh CAVEATS -Host AP mode doesn't support power saving. -Clients attempting to use power saving mode may experience significant +.Sh BUGS +Host AP mode doesn't support client power save. +Clients using power save mode will experience packet loss (disabling power saving on the client will fix this). Modified: head/share/man/man4/rum.4 ============================================================================== --- head/share/man/man4/rum.4 Fri Jun 5 17:26:15 2009 (r193526) +++ head/share/man/man4/rum.4 Fri Jun 5 17:44:43 2009 (r193527) @@ -181,7 +181,7 @@ driver was written by .An Niall O'Higgins Aq niallo@openbsd.org and .An Damien Bergamini Aq damien@openbsd.org . -.Sh CAVEATS -Host AP mode doesn't support power saving. -Clients attempting to use power saving mode may experience significant +.Sh BUGS +Host AP mode doesn't support client power save. +Clients using power save mode will experience packet loss (disabling power saving on the client will fix this). Modified: head/share/man/man4/ural.4 ============================================================================== --- head/share/man/man4/ural.4 Fri Jun 5 17:26:15 2009 (r193526) +++ head/share/man/man4/ural.4 Fri Jun 5 17:44:43 2009 (r193527) @@ -160,7 +160,7 @@ The original .Nm driver was written by .An Damien Bergamini Aq damien.bergamini@free.fr -.Sh CAVEATS -Host AP mode doesn't support power saving. -Clients attempting to use power saving mode may experience significant +.Sh BUGS +Host AP mode doesn't support client power save. +Clients using power save mode will experience packet loss (disabling power saving on the client will fix this). From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 18:43:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C2DE106564A; Fri, 5 Jun 2009 18:43:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 563BF8FC17; Fri, 5 Jun 2009 18:43:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55IhEOg034587; Fri, 5 Jun 2009 18:43:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55IhEgT034583; Fri, 5 Jun 2009 18:43:14 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906051843.n55IhEgT034583@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 5 Jun 2009 18:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193529 - in head/sys/contrib/dev/acpica: . common compiler debugger disassembler dispatcher events executer hardware include namespace parser resources tables tools utilities X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 18:43:14 -0000 Author: jkim Date: Fri Jun 5 18:43:13 2009 New Revision: 193529 URL: http://svn.freebsd.org/changeset/base/193529 Log: Import ACPICA 20090521. Added: head/sys/contrib/dev/acpica/changes.txt - copied unchanged from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/compiler/aslstartup.c - copied unchanged from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/debugger/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/debugger/ head/sys/contrib/dev/acpica/disassembler/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/disassembler/ head/sys/contrib/dev/acpica/dispatcher/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/dispatcher/ head/sys/contrib/dev/acpica/events/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/events/ head/sys/contrib/dev/acpica/executer/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/executer/ head/sys/contrib/dev/acpica/hardware/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/hardware/ head/sys/contrib/dev/acpica/include/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/include/ head/sys/contrib/dev/acpica/namespace/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/namespace/ head/sys/contrib/dev/acpica/parser/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/parser/ head/sys/contrib/dev/acpica/resources/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/resources/ head/sys/contrib/dev/acpica/tables/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/tables/ head/sys/contrib/dev/acpica/tools/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/tools/ head/sys/contrib/dev/acpica/utilities/ - copied from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/utilities/ Deleted: head/sys/contrib/dev/acpica/CHANGES.txt head/sys/contrib/dev/acpica/acapps.h head/sys/contrib/dev/acpica/acconfig.h head/sys/contrib/dev/acpica/acdebug.h head/sys/contrib/dev/acpica/acdisasm.h head/sys/contrib/dev/acpica/acdispat.h head/sys/contrib/dev/acpica/acefi.h head/sys/contrib/dev/acpica/acenv.h head/sys/contrib/dev/acpica/acevents.h head/sys/contrib/dev/acpica/acexcep.h head/sys/contrib/dev/acpica/acfreebsd.h head/sys/contrib/dev/acpica/acgcc.h head/sys/contrib/dev/acpica/acglobal.h head/sys/contrib/dev/acpica/achware.h head/sys/contrib/dev/acpica/acinterp.h head/sys/contrib/dev/acpica/aclocal.h head/sys/contrib/dev/acpica/acmacros.h head/sys/contrib/dev/acpica/acnames.h head/sys/contrib/dev/acpica/acnamesp.h head/sys/contrib/dev/acpica/acobject.h head/sys/contrib/dev/acpica/acopcode.h head/sys/contrib/dev/acpica/acoutput.h head/sys/contrib/dev/acpica/acparser.h head/sys/contrib/dev/acpica/acpi.h head/sys/contrib/dev/acpica/acpiosxf.h head/sys/contrib/dev/acpica/acpixf.h head/sys/contrib/dev/acpica/acresrc.h head/sys/contrib/dev/acpica/acstruct.h head/sys/contrib/dev/acpica/actables.h head/sys/contrib/dev/acpica/actbl.h head/sys/contrib/dev/acpica/actbl1.h head/sys/contrib/dev/acpica/actbl2.h head/sys/contrib/dev/acpica/actypes.h head/sys/contrib/dev/acpica/acutils.h head/sys/contrib/dev/acpica/aecommon.h head/sys/contrib/dev/acpica/amlcode.h head/sys/contrib/dev/acpica/amlresrc.h head/sys/contrib/dev/acpica/dbcmds.c head/sys/contrib/dev/acpica/dbdisply.c head/sys/contrib/dev/acpica/dbexec.c head/sys/contrib/dev/acpica/dbfileio.c head/sys/contrib/dev/acpica/dbhistry.c head/sys/contrib/dev/acpica/dbinput.c head/sys/contrib/dev/acpica/dbstats.c head/sys/contrib/dev/acpica/dbutils.c head/sys/contrib/dev/acpica/dbxface.c head/sys/contrib/dev/acpica/dmbuffer.c head/sys/contrib/dev/acpica/dmnames.c head/sys/contrib/dev/acpica/dmobject.c head/sys/contrib/dev/acpica/dmopcode.c head/sys/contrib/dev/acpica/dmresrc.c head/sys/contrib/dev/acpica/dmresrcl.c head/sys/contrib/dev/acpica/dmresrcs.c head/sys/contrib/dev/acpica/dmutils.c head/sys/contrib/dev/acpica/dmwalk.c head/sys/contrib/dev/acpica/dsfield.c head/sys/contrib/dev/acpica/dsinit.c head/sys/contrib/dev/acpica/dsmethod.c head/sys/contrib/dev/acpica/dsmthdat.c head/sys/contrib/dev/acpica/dsobject.c head/sys/contrib/dev/acpica/dsopcode.c head/sys/contrib/dev/acpica/dsutils.c head/sys/contrib/dev/acpica/dswexec.c head/sys/contrib/dev/acpica/dswload.c head/sys/contrib/dev/acpica/dswscope.c head/sys/contrib/dev/acpica/dswstate.c head/sys/contrib/dev/acpica/evevent.c head/sys/contrib/dev/acpica/evgpe.c head/sys/contrib/dev/acpica/evgpeblk.c head/sys/contrib/dev/acpica/evmisc.c head/sys/contrib/dev/acpica/evregion.c head/sys/contrib/dev/acpica/evrgnini.c head/sys/contrib/dev/acpica/evsci.c head/sys/contrib/dev/acpica/evxface.c head/sys/contrib/dev/acpica/evxfevnt.c head/sys/contrib/dev/acpica/evxfregn.c head/sys/contrib/dev/acpica/exconfig.c head/sys/contrib/dev/acpica/exconvrt.c head/sys/contrib/dev/acpica/excreate.c head/sys/contrib/dev/acpica/exdump.c head/sys/contrib/dev/acpica/exfield.c head/sys/contrib/dev/acpica/exfldio.c head/sys/contrib/dev/acpica/exmisc.c head/sys/contrib/dev/acpica/exmutex.c head/sys/contrib/dev/acpica/exnames.c head/sys/contrib/dev/acpica/exoparg1.c head/sys/contrib/dev/acpica/exoparg2.c head/sys/contrib/dev/acpica/exoparg3.c head/sys/contrib/dev/acpica/exoparg6.c head/sys/contrib/dev/acpica/exprep.c head/sys/contrib/dev/acpica/exregion.c head/sys/contrib/dev/acpica/exresnte.c head/sys/contrib/dev/acpica/exresolv.c head/sys/contrib/dev/acpica/exresop.c head/sys/contrib/dev/acpica/exstore.c head/sys/contrib/dev/acpica/exstoren.c head/sys/contrib/dev/acpica/exstorob.c head/sys/contrib/dev/acpica/exsystem.c head/sys/contrib/dev/acpica/exutils.c head/sys/contrib/dev/acpica/hwacpi.c head/sys/contrib/dev/acpica/hwgpe.c head/sys/contrib/dev/acpica/hwregs.c head/sys/contrib/dev/acpica/hwsleep.c head/sys/contrib/dev/acpica/hwtimer.c head/sys/contrib/dev/acpica/nsaccess.c head/sys/contrib/dev/acpica/nsalloc.c head/sys/contrib/dev/acpica/nsdump.c head/sys/contrib/dev/acpica/nsdumpdv.c head/sys/contrib/dev/acpica/nseval.c head/sys/contrib/dev/acpica/nsinit.c head/sys/contrib/dev/acpica/nsload.c head/sys/contrib/dev/acpica/nsnames.c head/sys/contrib/dev/acpica/nsobject.c head/sys/contrib/dev/acpica/nsparse.c head/sys/contrib/dev/acpica/nssearch.c head/sys/contrib/dev/acpica/nsutils.c head/sys/contrib/dev/acpica/nswalk.c head/sys/contrib/dev/acpica/nsxfeval.c head/sys/contrib/dev/acpica/nsxfname.c head/sys/contrib/dev/acpica/nsxfobj.c head/sys/contrib/dev/acpica/psargs.c head/sys/contrib/dev/acpica/psloop.c head/sys/contrib/dev/acpica/psopcode.c head/sys/contrib/dev/acpica/psparse.c head/sys/contrib/dev/acpica/psscope.c head/sys/contrib/dev/acpica/pstree.c head/sys/contrib/dev/acpica/psutils.c head/sys/contrib/dev/acpica/pswalk.c head/sys/contrib/dev/acpica/psxface.c head/sys/contrib/dev/acpica/rsaddr.c head/sys/contrib/dev/acpica/rscalc.c head/sys/contrib/dev/acpica/rscreate.c head/sys/contrib/dev/acpica/rsdump.c head/sys/contrib/dev/acpica/rsinfo.c head/sys/contrib/dev/acpica/rsio.c head/sys/contrib/dev/acpica/rsirq.c head/sys/contrib/dev/acpica/rslist.c head/sys/contrib/dev/acpica/rsmemory.c head/sys/contrib/dev/acpica/rsmisc.c head/sys/contrib/dev/acpica/rsutils.c head/sys/contrib/dev/acpica/rsxface.c head/sys/contrib/dev/acpica/tbfadt.c head/sys/contrib/dev/acpica/tbfind.c head/sys/contrib/dev/acpica/tbinstal.c head/sys/contrib/dev/acpica/tbutils.c head/sys/contrib/dev/acpica/tbxface.c head/sys/contrib/dev/acpica/tbxfroot.c head/sys/contrib/dev/acpica/utalloc.c head/sys/contrib/dev/acpica/utcache.c head/sys/contrib/dev/acpica/utclib.c head/sys/contrib/dev/acpica/utcopy.c head/sys/contrib/dev/acpica/utdebug.c head/sys/contrib/dev/acpica/utdelete.c head/sys/contrib/dev/acpica/uteval.c head/sys/contrib/dev/acpica/utglobal.c head/sys/contrib/dev/acpica/utinit.c head/sys/contrib/dev/acpica/utmath.c head/sys/contrib/dev/acpica/utmisc.c head/sys/contrib/dev/acpica/utmutex.c head/sys/contrib/dev/acpica/utobject.c head/sys/contrib/dev/acpica/utresrc.c head/sys/contrib/dev/acpica/utstate.c head/sys/contrib/dev/acpica/uttrack.c head/sys/contrib/dev/acpica/utxface.c Modified: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslcompiler.y head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/asllength.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype2.c head/sys/contrib/dev/acpica/compiler/aslstubs.c head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/osunixxf.c Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Fri Jun 5 18:14:51 2009 (r193528) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Fri Jun 5 18:43:13 2009 (r193529) @@ -10,33 +10,35 @@ if [ ! $# -eq 1 ]; then fi src=$1 -wrk=./_acpi_ca_unpack -dst=./acpi_ca_destination +wrk=`realpath ./_acpi_ca_unpack` +dst=`realpath ./acpi_ca_destination` # files that should keep their full directory path -fulldirs="common compiler" +fulldirs="common compiler debugger disassembler dispatcher events \ + executer hardware include namespace parser resources tables \ + tools utilities" + # files to remove -stripdirs="generate acpisrc" -stripfiles="16bit.h Makefile README a16find.c a16utils.asm a16utils.obj \ - acdos16.h acintel.h aclinux.h acmsvc.h acnetbsd.h acpixtract.c \ - acwin.h acwin64.h aeexec.c aemain.c osdosxf.c osunixdir.c \ - oswindir.c oswinxf.c readme.txt" +stripdirs="acpisrc acpixtract examples generate os_specific" +stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h \ + acos2.h accygwin.h acefi.h actbl2.h acwin.h acwin64.h aeexec.c \ + aehandlers.c aemain.c aetables.c osunixdir.c readme.txt \ + utclib.c" + # include files to canonify -src_headers="acapps.h acconfig.h acdebug.h acdisasm.h acdispat.h \ - acenv.h acevents.h acexcep.h acfreebsd.h acgcc.h acglobal.h \ - achware.h acinterp.h aclocal.h acmacros.h acnames.h acnamesp.h \ - acobject.h acopcode.h acoutput.h acparser.h acpi.h acpiosxf.h \ - acpixf.h acresrc.h acstruct.h actables.h actbl.h actbl1.h \ - actbl2.h actypes.h acutils.h aecommon.h amlcode.h amlresrc.h" +src_headers="acapps.h accommon.h acconfig.h acdebug.h acdisasm.h \ + acdispat.h acevents.h acexcep.h acglobal.h achware.h acinterp.h \ + aclocal.h acmacros.h acnames.h acnamesp.h acobject.h acopcode.h \ + acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h acpredef.h \ + acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \ + actypes.h acutils.h amlcode.h amlresrc.h platform/acenv.h \ + platform/acfreebsd.h platform/acgcc.h" comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h" - -# files to update paths in -src_update_files="acpi.h acpiosxf.h" +platform_headers="acfreebsd.h acgcc.h" # pre-clean echo pre-clean -rm -rf ${wrk} -rm -rf ${dst} +rm -rf ${wrk} ${dst} mkdir -p ${wrk} mkdir -p ${dst} @@ -53,32 +55,27 @@ for i in ${stripfiles}; do find ${wrk} -name ${i} -type f -delete done +# copy files echo copying full dirs for i in ${fulldirs}; do find ${wrk} -name ${i} -type d | xargs -J % mv % ${dst} done - -# move files to destination -echo copying flat dirs +echo copying remaining files find ${wrk} -type f | xargs -J % mv % ${dst} -mv ${dst}/changes.txt ${dst}/CHANGES.txt - -# update src/headers for appropriate paths -echo updating paths -for i in ${src_update_files}; do - i=${dst}/$i - sed -e 's/platform\///' $i > $i.new && mv $i.new $i -done # canonify include paths for H in ${src_headers}; do find ${dst} -name "*.[chy]" -type f | \ - xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" + xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done for H in ${comp_headers}; do find ${dst}/compiler -name "*.[chly]" -type f | \ xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done +for H in ${platform_headers}; do + find ${dst}/include/platform -name "*.h" -type f | \ + xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" +done # post-clean echo post-clean Copied: head/sys/contrib/dev/acpica/changes.txt (from r193525, projects/acpica_20090521/sys/contrib/dev/acpica/changes.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/acpica/changes.txt Fri Jun 5 18:43:13 2009 (r193529, copy of r193525, projects/acpica_20090521/sys/contrib/dev/acpica/changes.txt) @@ -0,0 +1,9235 @@ +---------------------------------------- +21 May 2009. Summary of changes for version 20090521: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Disabled the preservation of the SCI enable bit in the PM1 control register. +The SCI enable bit (bit 0, SCI_EN) is defined by the ACPI specification to be +a "preserved" bit - "OSPM always preserves this bit position", section +4.7.3.2.1. However, some machines fail if this bit is in fact preserved +because the bit needs to be explicitly set by the OS as a workaround. No +machines fail if the bit is not preserved. Therefore, ACPICA no longer +attempts to preserve this bit. + +Fixed a problem in AcpiRsGetPciRoutingTableLength where an invalid or +incorrectly formed _PRT package could cause a fault. Added validation to +ensure that each package element is actually a sub-package. + +Implemented a new interface to install or override a single control method, +AcpiInstallMethod. This interface is useful when debugging in order to repair +an existing method or to install a missing method without having to override +the entire ACPI table. See the ACPICA Programmer Reference for use and +examples. Lin Ming, Bob Moore. + +Fixed several reference count issues with the DdbHandle object that is +created from a Load or LoadTable operator. Prevent premature deletion of the +object. Also, mark the object as invalid once the table has been unloaded. +This is needed because the handle itself may not be deleted after the table +unload, depending on whether it has been stored in a named object by the +caller. Lin Ming. + +Fixed a problem with Mutex Sync Levels. Fixed a problem where if multiple +mutexes of the same sync level are acquired but then not released in strict +opposite order, the internally maintained Current Sync Level becomes confused +and can cause subsequent execution errors. ACPICA BZ 471. + +Changed the allowable release order for ASL mutex objects. The ACPI 4.0 +specification has been changed to make the SyncLevel for mutex objects more +useful. When releasing a mutex, the SyncLevel of the mutex must now be the +same as the current sync level. This makes more sense than the previous rule +(SyncLevel less than or equal). This change updates the code to match the +specification. + +Fixed a problem with the local version of the AcpiOsPurgeCache function. The +(local) cache must be locked during all cache object deletions. Andrew +Baumann. + +Updated the Load operator to use operation region interfaces. This replaces +direct memory mapping with region access calls. Now, all region accesses go +through the installed region handler as they should. + +Simplified and optimized the NsGetNextNode function. Reduced parameter count +and reduced code for this frequently used function. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 82.8K Code, 17.5K Data, 100.3K Total + Debug Version: 158.0K Code, 49.9K Data, 207.9K Total + Current Release: + Non-Debug Version: 83.4K Code, 17.5K Data, 100.9K Total + Debug Version: 158.9K Code, 50.0K Data, 208.9K Total + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed some issues with DMAR, HEST, MADT tables. Some problems +with sub-table disassembly and handling invalid sub-tables. Attempt recovery +after an invalid sub-table ID. + +---------------------------------------- +22 April 2009. Summary of changes for version 20090422: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Fixed a compatibility issue with the recently released I/O port protection +mechanism. For windows compatibility, 1) On a port protection violation, +simply ignore the request and do not return an exception (allow the control +method to continue execution.) 2) If only part of the request overlaps a +protected port, read/write the individual ports that are not protected. Linux +BZ 13036. Lin Ming + +Enhanced the execution of the ASL/AML BreakPoint operator so that it actually +breaks into the AML debugger if the debugger is present. This matches the +ACPI-defined behavior. + +Fixed several possible warnings related to the use of the configurable +ACPI_THREAD_ID. This type can now be configured as either an integer or a +pointer with no warnings. Also fixes several warnings in printf-like +statements for the 64-bit build when the type is configured as a pointer. +ACPICA BZ 766, 767. + +Fixed a number of possible warnings when compiling with gcc 4+ (depending on +warning options.) Examples include printf formats, aliasing, unused globals, +missing prototypes, missing switch default statements, use of non-ANSI +library functions, use of non-ANSI constructs. See generate/unix/Makefile for +a list of warning options used with gcc 3 and 4. ACPICA BZ 735. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 82.6K Code, 17.6K Data, 100.2K Total + Debug Version: 157.7K Code, 49.9K Data, 207.6K Total + Current Release: + Non-Debug Version: 82.8K Code, 17.5K Data, 100.3K Total + Debug Version: 158.0K Code, 49.9K Data, 207.9K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a generation warning from Bison 2.3 and fixed several warnings on +the 64-bit build. + +iASL: Fixed a problem where the Unix/Linux versions of the compiler could not +correctly digest Windows/DOS formatted files (with CR/LF). + +iASL: Added a new option for "quiet mode" (-va) that produces only the +compilation summary, not individual errors and warnings. Useful for large +batch compilations. + +AcpiExec: Implemented a new option (-z) to enable a forced semaphore/mutex +timeout that can be used to detect hang conditions during execution of AML +code (includes both internal semaphores and AML-defined mutexes and events.) + +Added new makefiles for the generation of acpica in a generic unix-like +environment. These makefiles are intended to generate the acpica tools and +utilities from the original acpica git source tree structure. + +Test Suites: Updated and cleaned up the documentation files. Updated the +copyrights to 2009, affecting all source files. Use the new version of iASL +with quiet mode. Increased the number of available semaphores in the Windows +OSL, allowing the aslts to execute fully on Windows. For the Unix OSL, added +an alternate implementation of the semaphore timeout to allow aslts to +execute fully on Cygwin. + +---------------------------------------- +20 March 2009. Summary of changes for version 20090320: + +1) ACPI CA Core Subsystem: + +Fixed a possible race condition between AcpiWalkNamespace and dynamic table +unloads. Added a reader/writer locking mechanism to allow multiple concurrent +namespace walks (readers), but block a dynamic table unload until it can gain +exclusive write access to the namespace. This fixes a problem where a table +unload could (possibly catastrophically) delete the portion of the namespace +that is currently being examined by a walk. Adds a new file, utlock.c, that +implements the reader/writer lock mechanism. ACPICA BZ 749. + +Fixed a regression introduced in version 20090220 where a change to the FADT +handling could cause the ACPICA subsystem to access non-existent I/O ports. + +Modified the handling of FADT register and table (FACS/DSDT) addresses. The +FADT can contain both 32-bit and 64-bit versions of these addresses. +Previously, the 64-bit versions were favored, meaning that if both 32 and 64 +versions were valid, but not equal, the 64-bit version was used. This was +found to cause some machines to fail. Now, in this case, the 32-bit version +is used instead. This now matches the Windows behavior. + +Implemented a new mechanism to protect certain I/O ports. Provides Microsoft +compatibility and protects the standard PC I/O ports from access via AML +code. Adds a new file, hwvalid.c + +Fixed a possible extraneous warning message from the FADT support. The +message warns of a 32/64 length mismatch between the legacy and GAS +definitions for a register. + +Removed the obsolete AcpiOsValidateAddress OSL interface. This interface is +made obsolete by the port protection mechanism above. It was previously used +to validate the entire address range of an operation region, which could be +incorrect if the range included illegal ports, but fields within the +operation region did not actually access those ports. Validation is now +performed on a per-field basis instead of the entire region. + +Modified the handling of the PM1 Status Register ignored bit (bit 11.) +Ignored bits must be "preserved" according to the ACPI spec. Usually, this +means a read/modify/write when writing to the register. However, for status +registers, writing a one means clear the event. Writing a zero means preserve +the event (do not clear.) This behavior is clarified in the ACPI 4.0 spec, +and the ACPICA code now simply always writes a zero to the ignored bit. + +Modified the handling of ignored bits for the PM1 A/B Control Registers. As +per the ACPI specification, for the control registers, preserve +(read/modify/write) all bits that are defined as either reserved or ignored. + +Updated the handling of write-only bits in the PM1 A/B Control Registers. +When reading the register, zero the write-only bits as per the ACPI spec. +ACPICA BZ 443. Lin Ming. + +Removed "Linux" from the list of supported _OSI strings. Linux no longer +wants to reply true to this request. The Windows strings are the only paths +through the AML that are tested and known to work properly. + + Previous Release: + Non-Debug Version: 82.0K Code, 17.5K Data, 99.5K Total + Debug Version: 156.9K Code, 49.8K Data, 206.7K Total + Current Release: + Non-Debug Version: 82.6K Code, 17.6K Data, 100.2K Total + Debug Version: 157.7K Code, 49.9K Data, 207.6K Total + +2) iASL Compiler/Disassembler and Tools: + +Acpiexec: Split the large aeexec.c file into two new files, aehandlers.c and +aetables.c + +---------------------------------------- +20 February 2009. Summary of changes for version 20090220: + +1) ACPI CA Core Subsystem: + +Optimized the ACPI register locking. Removed locking for reads from the ACPI +bit registers in PM1 Status, Enable, Control, and PM2 Control. The lock is +not required when reading the single-bit registers. The +AcpiGetRegisterUnlocked function is no longer needed and has been removed. +This will improve performance for reads on these registers. ACPICA BZ 760. + +Fixed the parameter validation for AcpiRead/Write. Now return +AE_BAD_PARAMETER if the input register pointer is null, and AE_BAD_ADDRESS if +the register has an address of zero. Previously, these cases simply returned +AE_OK. For optional registers such as PM1B status/enable/control, the caller +should check for a valid register address before calling. ACPICA BZ 748. + +Renamed the external ACPI bit register access functions. Renamed +AcpiGetRegister and AcpiSetRegister to clarify the purpose of these +functions. The new names are AcpiReadBitRegister and AcpiWriteBitRegister. +Also, restructured the code for these functions by simplifying the code path +and condensing duplicate code to reduce code size. + +Added new functions to transparently handle the possibly split PM1 A/B +registers. AcpiHwReadMultiple and AcpiHwWriteMultiple. These two functions +now handle the split registers for PM1 Status, Enable, and Control. ACPICA BZ +746. + +Added a function to handle the PM1 control registers, AcpiHwWritePm1Control. +This function writes both of the PM1 control registers (A/B). These registers +are different than the PM1 A/B status and enable registers in that different +values can be written to the A/B registers. Most notably, the SLP_TYP bits +can be different, as per the values returned from the _Sx predefined methods. + +Removed an extra register write within AcpiHwClearAcpiStatus. This function +was writing an optional PM1B status register twice. The existing call to the +low-level AcpiHwRegisterWrite automatically handles a possibly split PM1 A/B +register. ACPICA BZ 751. + +Split out the PM1 Status registers from the FADT. Added new globals for these +registers (A/B), similar to the way the PM1 Enable registers are handled. +Instead of overloading the FADT Event Register blocks. This makes the code +clearer and less prone to error. + +Fixed the warning message for when the platform contains too many ACPI tables +for the default size of the global root table data structure. The calculation +for the truncation value was incorrect. + +Removed the ACPI_GET_OBJECT_TYPE macro. Removed all instances of this +obsolete macro, since it is now a simple reference to ->common.type. There +were about 150 invocations of the macro across 41 files. ACPICA BZ 755. + +Removed the redundant ACPI_BITREG_SLEEP_TYPE_B. This type is the same as +TYPE_A. Removed this and all related instances. Renamed SLEEP_TYPE_A to +simply SLEEP_TYPE. ACPICA BZ 754. + +Conditionally compile the AcpiSetFirmwareWakingVector64 function. This +function is only needed on 64-bit host operating systems and is thus not +included for 32-bit hosts. + +Debug output: print the input and result for invocations of the _OSI reserved +control method via the ACPI_LV_INFO debug level. Also, reduced some of the +verbosity of this debug level. Len Brown. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 82.3K Code, 17.5K Data, 99.8K Total + Debug Version: 157.3K Code, 49.8K Data, 207.1K Total + Current Release: + Non-Debug Version: 82.0K Code, 17.5K Data, 99.5K Total + Debug Version: 156.9K Code, 49.8K Data, 206.7K Total + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Decode the FADT PM_Profile field. Emit ascii names for the +various legal performance profiles. + +---------------------------------------- +23 January 2009. Summary of changes for version 20090123: + +1) ACPI CA Core Subsystem: + +Added the 2009 copyright to all module headers and signons. This affects +virtually every file in the ACPICA core subsystem, the iASL compiler, and +the tools/utilities. + +Implemented a change to allow the host to override any ACPI table, including +dynamically loaded tables. Previously, only the DSDT could be replaced by the +host. With this change, the AcpiOsTableOverride interface is called for each +table found in the RSDT/XSDT during ACPICA initialization, and also whenever +a table is dynamically loaded via the AML Load operator. + +Updated FADT flag definitions, especially the Boot Architecture flags. + +Debugger: For the Find command, automatically pad the input ACPI name with +underscores if the name is shorter than 4 characters. This enables a match +with the actual namespace entry which is itself padded with underscores. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 82.3K Code, 17.4K Data, 99.7K Total + Debug Version: 157.1K Code, 49.7K Data, 206.8K Total + Current Release: + Non-Debug Version: 82.3K Code, 17.5K Data, 99.8K Total + Debug Version: 157.3K Code, 49.8K Data, 207.1K Total + +2) iASL Compiler/Disassembler and Tools: + +Fix build error under Bison-2.4. + +Dissasembler: Enhanced FADT support. Added decoding of the Boot Architecture +flags. Now decode all flags, regardless of the FADT version. Flag output +includes the FADT version which first defined each flag. + +The iASL -g option now dumps the RSDT to a file (in addition to the FADT and +DSDT). Windows only. + +---------------------------------------- +04 December 2008. Summary of changes for version 20081204: + +1) ACPI CA Core Subsystem: + +The ACPICA Programmer Reference has been completely updated and revamped for +this release. This includes updates to the external interfaces, OSL +interfaces, the overview sections, and the debugger reference. + +Several new ACPICA interfaces have been implemented and documented in the +programmer reference: +AcpiReset - Writes the reset value to the FADT-defined reset register. +AcpiDisableAllGpes - Disable all available GPEs. +AcpiEnableAllRuntimeGpes - Enable all available runtime GPEs. +AcpiGetGpeDevice - Get the GPE block device associated with a GPE. +AcpiGbl_CurrentGpeCount - Tracks the current number of available GPEs. +AcpiRead - Low-level read ACPI register (was HwLowLevelRead.) +AcpiWrite - Low-level write ACPI register (was HwLowLevelWrite.) + +Most of the public ACPI hardware-related interfaces have been moved to a new +file, components/hardware/hwxface.c + +Enhanced the FADT parsing and low-level ACPI register access: The ACPI +register lengths within the FADT are now used, and the low level ACPI +register access no longer hardcodes the ACPI register lengths. Given that +there may be some risk in actually trusting the FADT register lengths, a run- +time option was added to fall back to the default hardcoded lengths if the +FADT proves to contain incorrect values - UseDefaultRegisterWidths. This +option is set to true for now, and a warning is issued if a suspicious FADT +register length is overridden with the default value. + +Fixed a reference count issue in NsRepairObject. This problem was introduced +in version 20081031 as part of a fix to repair Buffer objects within +Packages. Lin Ming. + +Added semaphore support to the Linux/Unix application OS-services layer +(OSL). ACPICA BZ 448. Lin Ming. + +Added the ACPI_MUTEX_TYPE configuration option to select whether mutexes will +be implemented in the OSL, or will binary semaphores be used instead. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 81.7K Code, 17.3K Data, 99.0K Total + Debug Version: 156.4K Code, 49.4K Data, 205.8K Total + Current Release: + Non-Debug Version: 82.3K Code, 17.4K Data, 99.7K Total + Debug Version: 157.1K Code, 49.7K Data, 206.8K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Completed the '-e' option to include additional ACPI tables in order to +aid with disassembly and External statement generation. ACPICA BZ 742. Lin +Ming. + +iASL: Removed the "named object in while loop" error. The compiler cannot +determine how many times a loop will execute. ACPICA BZ 730. + +Disassembler: Implemented support for FADT revision 2 (MS extension). ACPICA +BZ 743. + +Disassembler: Updates for several ACPI data tables (HEST, EINJ, and MCFG). + +---------------------------------------- +31 October 2008. Summary of changes for version 20081031: + +1) ACPI CA Core Subsystem: + +Restructured the ACPICA header files into public/private. acpi.h now includes +only the "public" acpica headers. All other acpica headers are "private" and +should not be included by acpica users. One new file, accommon.h is used to +include the commonly used private headers for acpica code generation. Future +plans include moving all private headers to a new subdirectory. + +Implemented an automatic Buffer->String return value conversion for +predefined ACPI methods. For these methods (such as _BIF), added automatic +conversion for return objects that are required to be a String, but a Buffer +was found instead. This can happen when reading string battery data from an +operation region, because it used to be difficult to convert the data from +buffer to string from within the ASL. Ensures that the host OS is provided +with a valid null-terminated string. Linux BZ 11822. + +Updated the FACS waking vector interfaces. Split AcpiSetFirmwareWakingVector +into two: one for the 32-bit vector, another for the 64-bit vector. This is +required because the host OS must setup the wake much differently for each +vector (real vs. protected mode, etc.) and the interface itself should not be +deciding which vector to use. Also, eliminated the GetFirmwareWakingVector +interface, as it served no purpose (only the firmware reads the vector, OS +only writes the vector.) ACPICA BZ 731. + +Implemented a mechanism to escape infinite AML While() loops. Added a loop +counter to force exit from AML While loops if the count becomes too large. +This can occur in poorly written AML when the hardware does not respond +within a while loop and the loop does not implement a timeout. The maximum +loop count is configurable. A new exception code is returned when a loop is +broken, AE_AML_INFINITE_LOOP. Alexey Starikovskiy, Bob Moore. + +Optimized the execution of AML While loops. Previously, a control state +object was allocated and freed for each execution of the loop. The +optimization is to simply reuse the control state for each iteration. This +speeds up the raw loop execution time by about 5%. + +Enhanced the implicit return mechanism. For Windows compatibility, return an +implicit integer of value zero for methods that contain no executable code. +Such methods are seen in the field as stubs (presumably), and can cause +drivers to fail if they expect a return value. Lin Ming. + +Allow multiple backslashes as root prefixes in namepaths. In a fully +qualified namepath, allow multiple backslash prefixes. This can happen (and +is seen in the field) because of the use of a double-backslash in strings +(since backslash is the escape character) causing confusion. ACPICA BZ 739 +Lin Ming. + +Emit a warning if two different FACS or DSDT tables are discovered in the +FADT. Checks if there are two valid but different addresses for the FACS and +DSDT within the FADT (mismatch between the 32-bit and 64-bit fields.) + +Consolidated the method argument count validation code. Merged the code that +validates control method argument counts into the predefined validation +module. Eliminates possible multiple warnings for incorrect argument counts. + +Implemented ACPICA example code. Includes code for ACPICA initialization, +handler installation, and calling a control method. Available at +source/tools/examples. + +Added a global pointer for FACS table to simplify internal FACS access. Use +the global pointer instead of using AcpiGetTableByIndex for each FACS access. +This simplifies the code for the Global Lock and the Firmware Waking +Vector(s). + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 81.2K Code, 17.0K Data, 98.2K Total + Debug Version: 155.8K Code, 49.1K Data, 204.9K Total + Current Release: + Non-Debug Version: 81.7K Code, 17.3K Data, 99.0K Total + Debug Version: 156.4K Code, 49.4K Data, 205.8K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Improved disassembly of external method calls. Added the -e option to +allow the inclusion of additional ACPI tables to help with the disassembly of +method invocations and the generation of external declarations during the +disassembly. Certain external method invocations cannot be disassembled +properly without the actual declaration of the method. Use the -e option to +include the table where the external method(s) are actually declared. Most +useful for disassembling SSDTs that make method calls back to the master +DSDT. Lin Ming. Example: To disassemble an SSDT with calls to DSDT: iasl -d +-e dsdt.aml ssdt1.aml + +iASL: Fix to allow references to aliases within ASL namepaths. Fixes a +problem where the use of an alias within a namepath would result in a not +found error or cause the compiler to fault. Also now allows forward +references from the Alias operator itself. ACPICA BZ 738. + +---------------------------------------- +26 September 2008. Summary of changes for version 20080926: + +1) ACPI CA Core Subsystem: + +Designed and implemented a mechanism to validate predefined ACPI methods and +objects. This code validates the predefined ACPI objects (objects whose names +start with underscore) that appear in the namespace, at the time they are +evaluated. The argument count and the type of the returned object are +validated against the ACPI specification. The purpose of this validation is +to detect problems with the BIOS-implemented predefined ACPI objects before +the results are returned to the ACPI-related drivers. Future enhancements may +include actual repair of incorrect return objects where possible. Two new +files are nspredef.c and acpredef.h. + +Fixed a fault in the AML parser if a memory allocation fails during the Op +completion routine AcpiPsCompleteThisOp. Lin Ming. ACPICA BZ 492. + +Fixed an issue with implicit return compatibility. This change improves the +implicit return mechanism to be more compatible with the MS interpreter. Lin +Ming, ACPICA BZ 349. + +Implemented support for zero-length buffer-to-string conversions. Allow zero +length strings during interpreter buffer-to-string conversions. For example, +during the ToDecimalString and ToHexString operators, as well as implicit +conversions. Fiodor Suietov, ACPICA BZ 585. + +Fixed two possible memory leaks in the error exit paths of +AcpiUtUpdateObjectReference and AcpiUtWalkPackageTree. These functions are +similar in that they use a stack of state objects in order to eliminate +recursion. The stack must be fully unwound and deallocated if an error +occurs. Lin Ming. ACPICA BZ 383. + +Removed the unused ACPI_BITREG_WAKE_ENABLE definition and entry in the global +ACPI register table. This bit does not exist and is unused. Lin Ming, Bob +Moore ACPICA BZ 442. + +Removed the obsolete version number in module headers. Removed the +"$Revision" number that appeared in each module header. This version number +was useful under SourceSafe and CVS, but has no meaning under git. It is not +only incorrect, it could also be misleading. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 79.7K Code, 16.4K Data, 96.1K Total + Debug Version: 153.7K Code, 48.2K Data, 201.9K Total + Current Release: + Non-Debug Version: 81.2K Code, 17.0K Data, 98.2K Total + Debug Version: 155.8K Code, 49.1K Data, 204.9K Total + +---------------------------------------- +29 August 2008. Summary of changes for version 20080829: + +1) ACPI CA Core Subsystem: + +Completed a major cleanup of the internal ACPI_OPERAND_OBJECT of type +Reference. Changes include the elimination of cheating on the Object field +for the DdbHandle subtype, addition of a reference class field to +differentiate the various reference types (instead of an AML opcode), and the +cleanup of debug output for this object. Lin Ming, Bob Moore. BZ 723 + +Reduce an error to a warning for an incorrect method argument count. +Previously aborted with an error if too few arguments were passed to a +control method via the external ACPICA interface. Now issue a warning instead +and continue. Handles the case where the method inadvertently declares too +many arguments, but does not actually use the extra ones. Applies mainly to +the predefined methods. Lin Ming. Linux BZ 11032. + +Disallow the evaluation of named object types with no intrinsic value. Return +AE_TYPE for objects that have no value and therefore evaluation is undefined: +Device, Event, Mutex, Region, Thermal, and Scope. Previously, evaluation of +these types were allowed, but an exception would be generated at some point +during the evaluation. Now, the error is generated up front. + +Fixed a possible memory leak in the AcpiNsGetExternalPathname function +(nsnames.c). Fixes a leak in the error exit path. + +Removed the obsolete debug levels ACPI_DB_WARN and ACPI_DB_ERROR. These debug +levels were made obsolete by the ACPI_WARNING, ACPI_ERROR, and ACPI_EXCEPTION +interfaces. Also added ACPI_DB_EVENTS to correspond with the existing +ACPI_LV_EVENTS. + +Removed obsolete and/or unused exception codes from the acexcep.h header. +There is the possibility that certain device drivers may be affected if they +use any of these exceptions. + +The ACPICA documentation has been added to the public git source tree, under +acpica/documents. Included are the ACPICA programmer reference, the iASL +compiler reference, and the changes.txt release logfile. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 79.7K Code, 16.4K Data, 96.1K Total + Debug Version: 153.9K Code, 48.4K Data, 202.3K Total + Current Release: + Non-Debug Version: 79.7K Code, 16.4K Data, 96.1K Total + Debug Version: 153.7K Code, 48.2K Data, 201.9K Total + +2) iASL Compiler/Disassembler and Tools: + +Allow multiple argument counts for the predefined _SCP method. ACPI 3.0 +defines _SCP with 3 arguments. Previous versions defined it with only 1 +argument. iASL now allows both definitions. + +iASL/disassembler: avoid infinite loop on bad ACPI tables. Check for zero- +length subtables when disassembling ACPI tables. Also fixed a couple of +errors where a full 16-bit table type field was not extracted from the input +properly. + +acpisrc: Improve comment counting mechanism for generating source code +statistics. Count first and last lines of multi-line comments as whitespace, +not comment lines. Handle Linux legal header in addition to standard acpica +header. + +---------------------------------------- + +29 July 2008. Summary of changes for version 20080729: + +This release is available at http://acpica.org/downloads +Direct git access via http://www.acpica.org/repos/acpica.git + +1) ACPI CA Core Subsystem: + +Fix a possible deadlock in the GPE dispatch. Remove call to +AcpiHwDisableAllGpes during wake in AcpiEvGpeDispatch. This call will attempt +to acquire the GPE lock but can deadlock since the GPE lock is already held +at dispatch time. This code was introduced in version 20060831 as a response +to Linux BZ 6881 and has since been removed from Linux. + +Add a function to dereference returned reference objects. Examines the return +object from a call to AcpiEvaluateObject. Any Index or RefOf references are +automatically dereferenced in an attempt to return something useful (these +reference types cannot be converted into an external ACPI_OBJECT.) Provides +MS compatibility. Lin Ming, Bob Moore. Linux BZ 11105 + +x2APIC support: changes for MADT and SRAT ACPI tables. There are 2 new +subtables for the MADT and one new subtable for the SRAT. Includes +disassembler and AcpiSrc support. Data from the Intel 64 Architecture x2APIC +Specification, June 2008. + +Additional error checking for pathname utilities. Add error check after all +calls to AcpiNsGetPathnameLength. Add status return from +AcpiNsBuildExternalPath and check after all calls. Add parameter validation +to AcpiUtInitializeBuffer. Reported by and initial patch by Ingo Molnar. + +Return status from the global init function AcpiUtGlobalInitialize. This is +used by both the kernel subsystem and the utilities such as iASL compiler. +The function could possibly fail when the caches are initialized. Yang Yi. + +Add a function to decode reference object types to strings. Created for +improved error messages. + +Improve object conversion error messages. Better error messages during object +conversion from internal to the external ACPI_OBJECT. Used for external calls +to AcpiEvaluateObject. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 79.6K Code, 16.2K Data, 95.8K Total + Debug Version: 153.5K Code, 48.2K Data, 201.7K Total + Current Release: + Non-Debug Version: 79.7K Code, 16.4K Data, 96.1K Total + Debug Version: 153.9K Code, 48.4K Data, 202.3K Total + +2) iASL Compiler/Disassembler and Tools: + +Debugger: fix a possible hang when evaluating non-methods. Fixes a problem +introduced in version 20080701. If the object being evaluated (via execute +command) is not a method, the debugger can hang while trying to obtain non- +existent parameters. + +iASL: relax error for using reserved "_T_x" identifiers. These names can +appear in a disassembled ASL file if they were emitted by the original +compiler. Instead of issuing an error or warning and forcing the user to +manually change these names, issue a remark instead. + +iASL: error if named object created in while loop. Emit an error if any named +object is created within a While loop. If allowed, this code will generate a +run-time error on the second iteration of the loop when an attempt is made to +create the same named object twice. ACPICA bugzilla 730. + +iASL: Support absolute pathnames for include files. Add support for absolute +pathnames within the Include operator. previously, only relative pathnames +were supported. + +iASL: Enforce minimum 1 interrupt in interrupt macro and Resource Descriptor. +The ACPI spec requires one interrupt minimum. BZ 423 + +iASL: Handle a missing ResourceSource arg, with a present SourceIndex. +Handles the case for the Interrupt Resource Descriptor where +the ResourceSource argument is omitted but ResourceSourceIndex +is present. Now leave room for the Index. BZ 426 + +iASL: Prevent error message if CondRefOf target does not exist. Fixes cases +where an error message is emitted if the target does not exist. BZ 516 + +iASL: Fix broken -g option (get Windows ACPI tables). Fixes the -g option +(get ACPI tables on Windows). This was apparently broken in version 20070919. + +AcpiXtract: Handle EOF while extracting data. Correctly handle the case where +the EOF happens immediately after the last table in the input file. Print +completion message. Previously, no message was displayed in this case. + +---------------------------------------- +01 July 2008. Summary of changes for version 20080701: + +This release is available at http://acpica.org/downloads +Direct git access via http://www.acpica.org/repos/acpica.git + +0) Git source tree / acpica.org + +Fixed a problem where a git-clone from http would not transfer the entire +source tree. + +1) ACPI CA Core Subsystem: + +Implemented a "careful" GPE disable in AcpiEvDisableGpe, only modify one +enable bit. Now performs a read-change-write of the enable register instead +of simply writing out the cached enable mask. This will prevent inadvertent +enabling of GPEs if a rogue GPE is received during initialization (before GPE +handlers are installed.) + +Implemented a copy for dynamically loaded tables. Previously, dynamically +loaded tables were simply mapped - but on some machines this memory is +corrupted after suspend. Now copy the table to a local buffer. For the +OpRegion case, added checksum verify. Use the table length from the table +header, not the region length. For the Buffer case, use the table length +also. Dennis Noordsij, Bob Moore. BZ 10734 + +Fixed a problem where the same ACPI table could not be dynamically loaded and +unloaded more than once. Without this change, a table cannot be loaded again +once it has been loaded/unloaded one time. The current mechanism does not +unregister a table upon an unload. During a load, if the same table is found, +this no longer returns an exception. BZ 722 + +Fixed a problem where the wrong descriptor length was calculated for the +EndTag descriptor in 64-bit mode. The "minimal" descriptors such as EndTag +are calculated as 12 bytes long, but the actual length in the internal +descriptor is 16 because of the round-up to 8 on the 64-bit build. Reported +by Linn Crosetto. BZ 728 + +Fixed a possible memory leak in the Unload operator. The DdbHandle returned +by Load() did not have its reference count decremented during unload, leading +to a memory leak. Lin Ming. BZ 727 + +Fixed a possible memory leak when deleting thermal/processor objects. Any +associated notify handlers (and objects) were not being deleted. Fiodor +Suietov. BZ 506 + +Fixed the ordering of the ASCII names in the global mutex table to match the +actual mutex IDs. Used by AcpiUtGetMutexName, a function used for debug only. +Vegard Nossum. BZ 726 + +Enhanced the AcpiGetObjectInfo interface to return the number of required +arguments if the object is a control method. Added this call to the debugger +so the proper number of default arguments are passed to a method. This +prevents a warning when executing methods from AcpiExec. + +Added a check for an invalid handle in AcpiGetObjectInfo. Return +AE_BAD_PARAMETER if input handle is invalid. BZ 474 + +Fixed an extraneous warning from exconfig.c on the 64-bit build. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 79.3K Code, 16.2K Data, 95.5K Total + Debug Version: 153.0K Code, 48.2K Data, 201.2K Total + Current Release: + Non-Debug Version: 79.6K Code, 16.2K Data, 95.8K Total + Debug Version: 153.5K Code, 48.2K Data, 201.7K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Added two missing ACPI reserved names. Added _MTP and _ASZ, both +resource descriptor names. + +iASL: Detect invalid ASCII characters in input (windows version). Removed the +"-CF" flag from the flex compile, enables correct detection of non-ASCII +characters in the input. BZ 441 + +iASL: Eliminate warning when result of LoadTable is not used. Eliminate the +"result of operation not used" warning when the DDB handle returned from +LoadTable is not used. The warning is not needed. BZ 590 + +AcpiExec: Add support for dynamic table load/unload. Now calls _CFG method to +pass address of table to the AML. Added option to disable OpRegion simulation +to allow creation of an OpRegion with a real address that was passed to _CFG. +All of this allows testing of the Load and Unload operators from AcpiExec. + +Debugger: update tables command for unloaded tables. Handle unloaded tables +and use the standard table header output routine. + +---------------------------------------- +09 June 2008. Summary of changes for version 20080609: + +1) ACPI CA Core Subsystem: + +Implemented a workaround for reversed _PRT entries. A significant number of +BIOSs erroneously reverse the _PRT SourceName and the SourceIndex. This +change dynamically detects and repairs this problem. Provides compatibility +with MS ACPI. BZ 6859 + +Simplified the internal ACPI hardware interfaces to eliminate the locking +flag parameter from Register Read/Write. Added a new external interface, +AcpiGetRegisterUnlocked. + +Fixed a problem where the invocation of a GPE control method could hang. This +was a regression introduced in 20080514. The new method argument count +validation mechanism can enter an infinite loop when a GPE method is +dispatched. Problem fixed by removing the obsolete code that passed GPE block +information to the notify handler via the control method parameter pointer. + +Fixed a problem where the _SST execution status was incorrectly returned to +the caller of AcpiEnterSleepStatePrep. This was a regression introduced in +20080514. _SST is optional and a NOT_FOUND exception should never be +returned. BZ 716 + +Fixed a problem where a deleted object could be accessed from within the AML +parser. This was a regression introduced in version 20080123 as a fix for the +Unload operator. Lin Ming. BZ 10669 + +Cleaned up the debug operand dump mechanism. Eliminated unnecessary operands +and eliminated the use of a negative index in a loop. Operands are now +displayed in the correct order, not backwards. This also fixes a regression +introduced in 20080514 on 64-bit systems where the elimination of +ACPI_NATIVE_UINT caused the negative index to go large and positive. BZ 715 + +Fixed a possible memory leak in EvPciConfigRegionSetup where the error exit +path did not delete a locally allocated structure. + +Updated definitions for the DMAR and SRAT tables to synchronize with the +current specifications. Includes disassembler support. + +Fixed a problem in the mutex debug code (in utmutex.c) where an incorrect +loop termination value was used. Loop terminated on iteration early, missing +one mutex. Linn Crosetto + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 79.5K Code, 16.2K Data, 95.7K Total + Debug Version: 153.3K Code, 48.3K Data, 201.6K Total + Current Release: + Non-Debug Version: 79.3K Code, 16.2K Data, 95.5K Total + Debug Version: 153.0K Code, 48.2K Data, 201.2K Total + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Implemented support for EisaId() within _CID objects. Now +disassemble integer _CID objects back to EisaId invocations, including +multiple integers within _CID packages. Includes single-step support for +debugger also. + +Disassembler: Added support for DMAR and SRAT table definition changes. + +---------------------------------------- +14 May 2008. Summary of changes for version 20080514: + +1) ACPI CA Core Subsystem: + +Fixed a problem where GPEs were enabled too early during the ACPICA +initialization. This could lead to "handler not installed" errors on some +machines. Moved GPE enable until after _REG/_STA/_INI methods are run. This +ensures that all operation regions and devices throughout the namespace have +been initialized before GPEs are enabled. Alexey Starikovskiy, BZ 9916. + +Implemented a change to the enter sleep code. Moved execution of the _GTS +method to just before setting sleep enable bit. The execution was moved from +AcpiEnterSleepStatePrep to AcpiEnterSleepState. _GTS is now executed +immediately before the SLP_EN bit is set, as per the ACPI specification. +Luming Yu, BZ 1653. + +Implemented a fix to disable unknown GPEs (2nd version). Now always disable +the GPE, even if ACPICA thinks that that it is already disabled. It is +possible that the AML or some other code has enabled the GPE unbeknownst to +the ACPICA code. + +Fixed a problem with the Field operator where zero-length fields would return +an AE_AML_NO_OPERAND exception during table load. Fix enables zero-length ASL +field declarations in Field(), BankField(), and IndexField(). BZ 10606. + +Implemented a fix for the Load operator, now load the table at the namespace *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 18:44:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E043106566B; Fri, 5 Jun 2009 18:44:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 381528FC13; Fri, 5 Jun 2009 18:44:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55IicAf034698; Fri, 5 Jun 2009 18:44:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55IiahT034660; Fri, 5 Jun 2009 18:44:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906051844.n55IiahT034660@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 5 Jun 2009 18:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193530 - in head/sys: amd64/acpica boot/i386/libi386 boot/ia64/ski conf dev/acpi_support dev/acpica dev/acpica/Osd dev/asmc dev/fdc dev/ipmi dev/pci i386/acpica i386/cpufreq ia64/acpic... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 18:44:38 -0000 Author: jkim Date: Fri Jun 5 18:44:36 2009 New Revision: 193530 URL: http://svn.freebsd.org/changeset/base/193530 Log: Import ACPICA 20090521. Modified: head/sys/amd64/acpica/OsdEnvironment.c head/sys/amd64/acpica/acpi_machdep.c head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/acpica/madt.c head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/libi386/biosacpi.c head/sys/boot/ia64/ski/acpi_stub.c head/sys/conf/files head/sys/dev/acpi_support/acpi_aiboost.c head/sys/dev/acpi_support/acpi_asus.c head/sys/dev/acpi_support/acpi_fujitsu.c head/sys/dev/acpi_support/acpi_ibm.c head/sys/dev/acpi_support/acpi_panasonic.c head/sys/dev/acpi_support/acpi_sony.c head/sys/dev/acpi_support/acpi_toshiba.c head/sys/dev/acpica/Osd/OsdDebug.c head/sys/dev/acpica/Osd/OsdHardware.c head/sys/dev/acpica/Osd/OsdInterrupt.c head/sys/dev/acpica/Osd/OsdMemory.c head/sys/dev/acpica/Osd/OsdSchedule.c head/sys/dev/acpica/Osd/OsdStream.c head/sys/dev/acpica/Osd/OsdSynch.c head/sys/dev/acpica/Osd/OsdTable.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_acad.c head/sys/dev/acpica/acpi_battery.c head/sys/dev/acpica/acpi_button.c head/sys/dev/acpica/acpi_cmbat.c head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpi_dock.c head/sys/dev/acpica/acpi_ec.c head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_if.m head/sys/dev/acpica/acpi_isab.c head/sys/dev/acpica/acpi_lid.c head/sys/dev/acpica/acpi_package.c head/sys/dev/acpica/acpi_pci.c head/sys/dev/acpica/acpi_pci_link.c head/sys/dev/acpica/acpi_pcib.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/acpica/acpi_pcib_pci.c head/sys/dev/acpica/acpi_perf.c head/sys/dev/acpica/acpi_powerres.c head/sys/dev/acpica/acpi_quirk.c head/sys/dev/acpica/acpi_resource.c head/sys/dev/acpica/acpi_smbat.c head/sys/dev/acpica/acpi_thermal.c head/sys/dev/acpica/acpi_throttle.c head/sys/dev/acpica/acpi_timer.c head/sys/dev/acpica/acpi_video.c head/sys/dev/asmc/asmc.c head/sys/dev/fdc/fdc_acpi.c head/sys/dev/ipmi/ipmi_acpi.c head/sys/dev/pci/pci.c head/sys/i386/acpica/OsdEnvironment.c head/sys/i386/acpica/acpi_machdep.c head/sys/i386/acpica/acpi_wakeup.c head/sys/i386/acpica/madt.c head/sys/i386/cpufreq/est.c head/sys/i386/cpufreq/hwpstate.c head/sys/i386/cpufreq/p4tcc.c head/sys/ia64/acpica/OsdEnvironment.c head/sys/ia64/acpica/acpi_machdep.c head/sys/ia64/acpica/acpi_wakeup.c head/sys/ia64/acpica/madt.c head/sys/ia64/ia64/nexus.c head/sys/modules/acpi/acpi/Makefile head/sys/modules/acpi/acpi_aiboost/Makefile head/sys/modules/acpi/acpi_asus/Makefile head/sys/modules/acpi/acpi_dock/Makefile head/sys/modules/acpi/acpi_fujitsu/Makefile head/sys/modules/acpi/acpi_ibm/Makefile head/sys/modules/acpi/acpi_panasonic/Makefile head/sys/modules/acpi/acpi_sony/Makefile head/sys/modules/acpi/acpi_toshiba/Makefile head/sys/modules/acpi/acpi_video/Makefile head/sys/modules/cpufreq/Makefile head/sys/modules/fdc/Makefile Modified: head/sys/amd64/acpica/OsdEnvironment.c ============================================================================== --- head/sys/amd64/acpica/OsdEnvironment.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/amd64/acpica/OsdEnvironment.c Fri Jun 5 18:44:36 2009 (r193530) @@ -36,8 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include static u_long amd64_acpi_root; @@ -63,7 +63,7 @@ AcpiOsGetRootPointer(void) if (amd64_acpi_root == 0 && (resource_long_value("acpi", 0, "rsdp", (long *)&ptr) == 0 || - AcpiFindRootPointer((ACPI_NATIVE_UINT *)&ptr) == AE_OK) && + AcpiFindRootPointer((ACPI_SIZE *)&ptr) == AE_OK) && ptr != 0) amd64_acpi_root = ptr; Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/amd64/acpica/acpi_machdep.c Fri Jun 5 18:44:36 2009 (r193530) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + #include #include Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/amd64/acpica/acpi_wakeup.c Fri Jun 5 18:44:36 2009 (r193530) @@ -53,7 +53,8 @@ __FBSDID("$FreeBSD$"); #include #endif -#include +#include + #include #include "acpi_wakecode.h" Modified: head/sys/amd64/acpica/madt.c ============================================================================== --- head/sys/amd64/acpica/madt.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/amd64/acpica/madt.c Fri Jun 5 18:44:36 2009 (r193530) @@ -48,8 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include +#include + #include #include Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/boot/i386/libi386/Makefile Fri Jun 5 18:44:36 2009 (r193530) @@ -48,7 +48,7 @@ CFLAGS+= -DTERM_EMU CFLAGS+= -Dalloca=__builtin_alloca CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ - -I${.CURDIR}/../../../contrib/dev/acpica \ + -I${.CURDIR}/../../../contrib/dev/acpica/include \ -I${.CURDIR}/../../.. -I. # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ Modified: head/sys/boot/i386/libi386/biosacpi.c ============================================================================== --- head/sys/boot/i386/libi386/biosacpi.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/boot/i386/libi386/biosacpi.c Fri Jun 5 18:44:36 2009 (r193530) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include "libi386.h" -#include "acfreebsd.h" +#include "platform/acfreebsd.h" #include "acconfig.h" #define ACPI_SYSTEM_XFACE #include "actypes.h" Modified: head/sys/boot/ia64/ski/acpi_stub.c ============================================================================== --- head/sys/boot/ia64/ski/acpi_stub.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/boot/ia64/ski/acpi_stub.c Fri Jun 5 18:44:36 2009 (r193530) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #define APIC_IO_SAPIC 6 #define APIC_LOCAL_SAPIC 7 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/conf/files Fri Jun 5 18:44:36 2009 (r193530) @@ -122,131 +122,134 @@ contrib/altq/altq/altq_rio.c optional al contrib/altq/altq/altq_rmclass.c optional altq contrib/altq/altq/altq_subr.c optional altq \ compile-with "${NORMAL_C} -I$S/contrib/pf" -contrib/dev/acpica/dbcmds.c optional acpi acpi_debug -contrib/dev/acpica/dbdisply.c optional acpi acpi_debug -contrib/dev/acpica/dbexec.c optional acpi acpi_debug -contrib/dev/acpica/dbfileio.c optional acpi acpi_debug -contrib/dev/acpica/dbhistry.c optional acpi acpi_debug -contrib/dev/acpica/dbinput.c optional acpi acpi_debug -contrib/dev/acpica/dbstats.c optional acpi acpi_debug -contrib/dev/acpica/dbutils.c optional acpi acpi_debug -contrib/dev/acpica/dbxface.c optional acpi acpi_debug -contrib/dev/acpica/dmbuffer.c optional acpi acpi_debug -contrib/dev/acpica/dmnames.c optional acpi acpi_debug -contrib/dev/acpica/dmopcode.c optional acpi acpi_debug -contrib/dev/acpica/dmobject.c optional acpi acpi_debug -contrib/dev/acpica/dmresrc.c optional acpi acpi_debug -contrib/dev/acpica/dmresrcl.c optional acpi acpi_debug -contrib/dev/acpica/dmresrcs.c optional acpi acpi_debug -contrib/dev/acpica/dmutils.c optional acpi acpi_debug -contrib/dev/acpica/dmwalk.c optional acpi acpi_debug -contrib/dev/acpica/dsfield.c optional acpi -contrib/dev/acpica/dsinit.c optional acpi -contrib/dev/acpica/dsmethod.c optional acpi -contrib/dev/acpica/dsmthdat.c optional acpi -contrib/dev/acpica/dsobject.c optional acpi -contrib/dev/acpica/dsopcode.c optional acpi -contrib/dev/acpica/dsutils.c optional acpi -contrib/dev/acpica/dswexec.c optional acpi -contrib/dev/acpica/dswload.c optional acpi -contrib/dev/acpica/dswscope.c optional acpi -contrib/dev/acpica/dswstate.c optional acpi -contrib/dev/acpica/evevent.c optional acpi -contrib/dev/acpica/evgpe.c optional acpi -contrib/dev/acpica/evgpeblk.c optional acpi -contrib/dev/acpica/evmisc.c optional acpi -contrib/dev/acpica/evregion.c optional acpi -contrib/dev/acpica/evrgnini.c optional acpi -contrib/dev/acpica/evsci.c optional acpi -contrib/dev/acpica/evxface.c optional acpi -contrib/dev/acpica/evxfevnt.c optional acpi -contrib/dev/acpica/evxfregn.c optional acpi -contrib/dev/acpica/exconfig.c optional acpi -contrib/dev/acpica/exconvrt.c optional acpi -contrib/dev/acpica/excreate.c optional acpi -contrib/dev/acpica/exdump.c optional acpi -contrib/dev/acpica/exfield.c optional acpi -contrib/dev/acpica/exfldio.c optional acpi -contrib/dev/acpica/exmisc.c optional acpi -contrib/dev/acpica/exmutex.c optional acpi -contrib/dev/acpica/exnames.c optional acpi -contrib/dev/acpica/exoparg1.c optional acpi -contrib/dev/acpica/exoparg2.c optional acpi -contrib/dev/acpica/exoparg3.c optional acpi -contrib/dev/acpica/exoparg6.c optional acpi -contrib/dev/acpica/exprep.c optional acpi -contrib/dev/acpica/exregion.c optional acpi -contrib/dev/acpica/exresnte.c optional acpi -contrib/dev/acpica/exresolv.c optional acpi -contrib/dev/acpica/exresop.c optional acpi -contrib/dev/acpica/exstore.c optional acpi -contrib/dev/acpica/exstoren.c optional acpi -contrib/dev/acpica/exstorob.c optional acpi -contrib/dev/acpica/exsystem.c optional acpi -contrib/dev/acpica/exutils.c optional acpi -contrib/dev/acpica/hwacpi.c optional acpi -contrib/dev/acpica/hwgpe.c optional acpi -contrib/dev/acpica/hwregs.c optional acpi -contrib/dev/acpica/hwsleep.c optional acpi -contrib/dev/acpica/hwtimer.c optional acpi -contrib/dev/acpica/nsaccess.c optional acpi -contrib/dev/acpica/nsalloc.c optional acpi -contrib/dev/acpica/nsdump.c optional acpi -contrib/dev/acpica/nseval.c optional acpi -contrib/dev/acpica/nsinit.c optional acpi -contrib/dev/acpica/nsload.c optional acpi -contrib/dev/acpica/nsnames.c optional acpi -contrib/dev/acpica/nsobject.c optional acpi -contrib/dev/acpica/nsparse.c optional acpi -contrib/dev/acpica/nssearch.c optional acpi -contrib/dev/acpica/nsutils.c optional acpi -contrib/dev/acpica/nswalk.c optional acpi -contrib/dev/acpica/nsxfeval.c optional acpi -contrib/dev/acpica/nsxfname.c optional acpi -contrib/dev/acpica/nsxfobj.c optional acpi -contrib/dev/acpica/psargs.c optional acpi -contrib/dev/acpica/psloop.c optional acpi -contrib/dev/acpica/psopcode.c optional acpi -contrib/dev/acpica/psparse.c optional acpi -contrib/dev/acpica/psscope.c optional acpi -contrib/dev/acpica/pstree.c optional acpi -contrib/dev/acpica/psutils.c optional acpi -contrib/dev/acpica/pswalk.c optional acpi -contrib/dev/acpica/psxface.c optional acpi -contrib/dev/acpica/rsaddr.c optional acpi -contrib/dev/acpica/rscalc.c optional acpi -contrib/dev/acpica/rscreate.c optional acpi -contrib/dev/acpica/rsdump.c optional acpi -contrib/dev/acpica/rsinfo.c optional acpi -contrib/dev/acpica/rsio.c optional acpi -contrib/dev/acpica/rsirq.c optional acpi -contrib/dev/acpica/rslist.c optional acpi -contrib/dev/acpica/rsmemory.c optional acpi -contrib/dev/acpica/rsmisc.c optional acpi -contrib/dev/acpica/rsutils.c optional acpi -contrib/dev/acpica/rsxface.c optional acpi -contrib/dev/acpica/tbfadt.c optional acpi -contrib/dev/acpica/tbfind.c optional acpi -contrib/dev/acpica/tbinstal.c optional acpi -contrib/dev/acpica/tbutils.c optional acpi -contrib/dev/acpica/tbxface.c optional acpi -contrib/dev/acpica/tbxfroot.c optional acpi -contrib/dev/acpica/utalloc.c optional acpi -contrib/dev/acpica/utcache.c optional acpi -contrib/dev/acpica/utclib.c optional acpi -contrib/dev/acpica/utcopy.c optional acpi -contrib/dev/acpica/utdebug.c optional acpi -contrib/dev/acpica/utdelete.c optional acpi -contrib/dev/acpica/uteval.c optional acpi -contrib/dev/acpica/utglobal.c optional acpi -contrib/dev/acpica/utinit.c optional acpi -contrib/dev/acpica/utmath.c optional acpi -contrib/dev/acpica/utmisc.c optional acpi -contrib/dev/acpica/utmutex.c optional acpi -contrib/dev/acpica/utobject.c optional acpi -contrib/dev/acpica/utresrc.c optional acpi -contrib/dev/acpica/utstate.c optional acpi -contrib/dev/acpica/utxface.c optional acpi +contrib/dev/acpica/debugger/dbcmds.c optional acpi acpi_debug +contrib/dev/acpica/debugger/dbdisply.c optional acpi acpi_debug +contrib/dev/acpica/debugger/dbexec.c optional acpi acpi_debug +contrib/dev/acpica/debugger/dbfileio.c optional acpi acpi_debug +contrib/dev/acpica/debugger/dbhistry.c optional acpi acpi_debug +contrib/dev/acpica/debugger/dbinput.c optional acpi acpi_debug +contrib/dev/acpica/debugger/dbstats.c optional acpi acpi_debug +contrib/dev/acpica/debugger/dbutils.c optional acpi acpi_debug +contrib/dev/acpica/debugger/dbxface.c optional acpi acpi_debug +contrib/dev/acpica/disassembler/dmbuffer.c optional acpi acpi_debug +contrib/dev/acpica/disassembler/dmnames.c optional acpi acpi_debug +contrib/dev/acpica/disassembler/dmopcode.c optional acpi acpi_debug +contrib/dev/acpica/disassembler/dmobject.c optional acpi acpi_debug +contrib/dev/acpica/disassembler/dmresrc.c optional acpi acpi_debug +contrib/dev/acpica/disassembler/dmresrcl.c optional acpi acpi_debug +contrib/dev/acpica/disassembler/dmresrcs.c optional acpi acpi_debug +contrib/dev/acpica/disassembler/dmutils.c optional acpi acpi_debug +contrib/dev/acpica/disassembler/dmwalk.c optional acpi acpi_debug +contrib/dev/acpica/dispatcher/dsfield.c optional acpi +contrib/dev/acpica/dispatcher/dsinit.c optional acpi +contrib/dev/acpica/dispatcher/dsmethod.c optional acpi +contrib/dev/acpica/dispatcher/dsmthdat.c optional acpi +contrib/dev/acpica/dispatcher/dsobject.c optional acpi +contrib/dev/acpica/dispatcher/dsopcode.c optional acpi +contrib/dev/acpica/dispatcher/dsutils.c optional acpi +contrib/dev/acpica/dispatcher/dswexec.c optional acpi +contrib/dev/acpica/dispatcher/dswload.c optional acpi +contrib/dev/acpica/dispatcher/dswscope.c optional acpi +contrib/dev/acpica/dispatcher/dswstate.c optional acpi +contrib/dev/acpica/events/evevent.c optional acpi +contrib/dev/acpica/events/evgpe.c optional acpi +contrib/dev/acpica/events/evgpeblk.c optional acpi +contrib/dev/acpica/events/evmisc.c optional acpi +contrib/dev/acpica/events/evregion.c optional acpi +contrib/dev/acpica/events/evrgnini.c optional acpi +contrib/dev/acpica/events/evsci.c optional acpi +contrib/dev/acpica/events/evxface.c optional acpi +contrib/dev/acpica/events/evxfevnt.c optional acpi +contrib/dev/acpica/events/evxfregn.c optional acpi +contrib/dev/acpica/executer/exconfig.c optional acpi +contrib/dev/acpica/executer/exconvrt.c optional acpi +contrib/dev/acpica/executer/excreate.c optional acpi +contrib/dev/acpica/executer/exdump.c optional acpi +contrib/dev/acpica/executer/exfield.c optional acpi +contrib/dev/acpica/executer/exfldio.c optional acpi +contrib/dev/acpica/executer/exmisc.c optional acpi +contrib/dev/acpica/executer/exmutex.c optional acpi +contrib/dev/acpica/executer/exnames.c optional acpi +contrib/dev/acpica/executer/exoparg1.c optional acpi +contrib/dev/acpica/executer/exoparg2.c optional acpi +contrib/dev/acpica/executer/exoparg3.c optional acpi +contrib/dev/acpica/executer/exoparg6.c optional acpi +contrib/dev/acpica/executer/exprep.c optional acpi +contrib/dev/acpica/executer/exregion.c optional acpi +contrib/dev/acpica/executer/exresnte.c optional acpi +contrib/dev/acpica/executer/exresolv.c optional acpi +contrib/dev/acpica/executer/exresop.c optional acpi +contrib/dev/acpica/executer/exstore.c optional acpi +contrib/dev/acpica/executer/exstoren.c optional acpi +contrib/dev/acpica/executer/exstorob.c optional acpi +contrib/dev/acpica/executer/exsystem.c optional acpi +contrib/dev/acpica/executer/exutils.c optional acpi +contrib/dev/acpica/hardware/hwacpi.c optional acpi +contrib/dev/acpica/hardware/hwgpe.c optional acpi +contrib/dev/acpica/hardware/hwregs.c optional acpi +contrib/dev/acpica/hardware/hwsleep.c optional acpi +contrib/dev/acpica/hardware/hwtimer.c optional acpi +contrib/dev/acpica/hardware/hwvalid.c optional acpi +contrib/dev/acpica/hardware/hwxface.c optional acpi +contrib/dev/acpica/namespace/nsaccess.c optional acpi +contrib/dev/acpica/namespace/nsalloc.c optional acpi +contrib/dev/acpica/namespace/nsdump.c optional acpi +contrib/dev/acpica/namespace/nseval.c optional acpi +contrib/dev/acpica/namespace/nsinit.c optional acpi +contrib/dev/acpica/namespace/nsload.c optional acpi +contrib/dev/acpica/namespace/nsnames.c optional acpi +contrib/dev/acpica/namespace/nsobject.c optional acpi +contrib/dev/acpica/namespace/nsparse.c optional acpi +contrib/dev/acpica/namespace/nspredef.c optional acpi +contrib/dev/acpica/namespace/nssearch.c optional acpi +contrib/dev/acpica/namespace/nsutils.c optional acpi +contrib/dev/acpica/namespace/nswalk.c optional acpi +contrib/dev/acpica/namespace/nsxfeval.c optional acpi +contrib/dev/acpica/namespace/nsxfname.c optional acpi +contrib/dev/acpica/namespace/nsxfobj.c optional acpi +contrib/dev/acpica/parser/psargs.c optional acpi +contrib/dev/acpica/parser/psloop.c optional acpi +contrib/dev/acpica/parser/psopcode.c optional acpi +contrib/dev/acpica/parser/psparse.c optional acpi +contrib/dev/acpica/parser/psscope.c optional acpi +contrib/dev/acpica/parser/pstree.c optional acpi +contrib/dev/acpica/parser/psutils.c optional acpi +contrib/dev/acpica/parser/pswalk.c optional acpi +contrib/dev/acpica/parser/psxface.c optional acpi +contrib/dev/acpica/resources/rsaddr.c optional acpi +contrib/dev/acpica/resources/rscalc.c optional acpi +contrib/dev/acpica/resources/rscreate.c optional acpi +contrib/dev/acpica/resources/rsdump.c optional acpi +contrib/dev/acpica/resources/rsinfo.c optional acpi +contrib/dev/acpica/resources/rsio.c optional acpi +contrib/dev/acpica/resources/rsirq.c optional acpi +contrib/dev/acpica/resources/rslist.c optional acpi +contrib/dev/acpica/resources/rsmemory.c optional acpi +contrib/dev/acpica/resources/rsmisc.c optional acpi +contrib/dev/acpica/resources/rsutils.c optional acpi +contrib/dev/acpica/resources/rsxface.c optional acpi +contrib/dev/acpica/tables/tbfadt.c optional acpi +contrib/dev/acpica/tables/tbfind.c optional acpi +contrib/dev/acpica/tables/tbinstal.c optional acpi +contrib/dev/acpica/tables/tbutils.c optional acpi +contrib/dev/acpica/tables/tbxface.c optional acpi +contrib/dev/acpica/tables/tbxfroot.c optional acpi +contrib/dev/acpica/utilities/utalloc.c optional acpi +contrib/dev/acpica/utilities/utcache.c optional acpi +contrib/dev/acpica/utilities/utcopy.c optional acpi +contrib/dev/acpica/utilities/utdebug.c optional acpi +contrib/dev/acpica/utilities/utdelete.c optional acpi +contrib/dev/acpica/utilities/uteval.c optional acpi +contrib/dev/acpica/utilities/utglobal.c optional acpi +contrib/dev/acpica/utilities/utinit.c optional acpi +contrib/dev/acpica/utilities/utlock.c optional acpi +contrib/dev/acpica/utilities/utmath.c optional acpi +contrib/dev/acpica/utilities/utmisc.c optional acpi +contrib/dev/acpica/utilities/utmutex.c optional acpi +contrib/dev/acpica/utilities/utobject.c optional acpi +contrib/dev/acpica/utilities/utresrc.c optional acpi +contrib/dev/acpica/utilities/utstate.c optional acpi +contrib/dev/acpica/utilities/utxface.c optional acpi contrib/ipfilter/netinet/fil.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \ Modified: head/sys/dev/acpi_support/acpi_aiboost.c ============================================================================== --- head/sys/dev/acpi_support/acpi_aiboost.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpi_support/acpi_aiboost.c Fri Jun 5 18:44:36 2009 (r193530) @@ -31,7 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + +#include + #include "acpi_if.h" #include #include Modified: head/sys/dev/acpi_support/acpi_asus.c ============================================================================== --- head/sys/dev/acpi_support/acpi_asus.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpi_support/acpi_asus.c Fri Jun 5 18:44:36 2009 (r193530) @@ -47,7 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include #include Modified: head/sys/dev/acpi_support/acpi_fujitsu.c ============================================================================== --- head/sys/dev/acpi_support/acpi_fujitsu.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpi_support/acpi_fujitsu.c Fri Jun 5 18:44:36 2009 (r193530) @@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include /* Hooks for the ACPI CA debugging infrastructure */ Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpi_support/acpi_ibm.c Fri Jun 5 18:44:36 2009 (r193530) @@ -42,7 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + +#include +#include + #include "acpi_if.h" #include #include Modified: head/sys/dev/acpi_support/acpi_panasonic.c ============================================================================== --- head/sys/dev/acpi_support/acpi_panasonic.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpi_support/acpi_panasonic.c Fri Jun 5 18:44:36 2009 (r193530) @@ -37,7 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + #include #define _COMPONENT ACPI_OEM Modified: head/sys/dev/acpi_support/acpi_sony.c ============================================================================== --- head/sys/dev/acpi_support/acpi_sony.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpi_support/acpi_sony.c Fri Jun 5 18:44:36 2009 (r193530) @@ -31,7 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + +#include + #include "acpi_if.h" #include #include Modified: head/sys/dev/acpi_support/acpi_toshiba.c ============================================================================== --- head/sys/dev/acpi_support/acpi_toshiba.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpi_support/acpi_toshiba.c Fri Jun 5 18:44:36 2009 (r193530) @@ -34,7 +34,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + #include #define _COMPONENT ACPI_OEM Modified: head/sys/dev/acpica/Osd/OsdDebug.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdDebug.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/Osd/OsdDebug.c Fri Jun 5 18:44:36 2009 (r193530) @@ -41,8 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include +#include + #include UINT32 Modified: head/sys/dev/acpica/Osd/OsdHardware.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdHardware.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/Osd/OsdHardware.c Fri Jun 5 18:44:36 2009 (r193530) @@ -32,7 +32,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include @@ -65,75 +65,9 @@ __FBSDID("$FreeBSD$"); #define ACPI_BUS_HANDLE 0 #endif -/* - * Some BIOS vendors use AML to read/write directly to IO space. This - * can cause a problem if such accesses interfere with the OS's access to - * the same ports. Windows XP and newer systems block accesses to certain - * IO ports. We print a message or block accesses based on a tunable. - */ -static int illegal_bios_ports[] = { - 0x000, 0x00f, /* DMA controller 1 */ - 0x020, 0x021, /* PIC */ - 0x040, 0x043, /* Timer 1 */ - 0x048, 0x04b, /* Timer 2 failsafe */ - 0x070, 0x071, /* CMOS and RTC */ - 0x074, 0x076, /* Extended CMOS */ - 0x081, 0x083, /* DMA1 page registers */ - 0x087, 0x087, /* DMA1 ch0 low page */ - 0x089, 0x08b, /* DMA2 ch2 (0x89), ch3 low page (0x8a, 0x8b) */ - 0x08f, 0x091, /* DMA2 low page refresh (0x8f) */ - /* Arb ctrl port, card select feedback (0x90, 0x91) */ - 0x093, 0x094, /* System board setup */ - 0x096, 0x097, /* POS channel select */ - 0x0a0, 0x0a1, /* PIC (cascaded) */ - 0x0c0, 0x0df, /* ISA DMA */ - 0x4d0, 0x4d1, /* PIC ELCR (edge/level control) */ - 0xcf8, 0xcff, /* PCI config space. Microsoft adds 0xd00 also but - that seems incorrect. */ - -1, -1 -}; - -/* Block accesses to bad IO port addresses or just print a warning. */ -static int block_bad_io; -TUNABLE_INT("debug.acpi.block_bad_io", &block_bad_io); - -/* - * Look up bad ports in our table. Returns 0 if ok, 1 if marked bad but - * access is still allowed, or -1 to deny access. - */ -static int -acpi_os_check_port(UINT32 addr, UINT32 width) -{ - int error, *port; - - error = 0; - for (port = illegal_bios_ports; *port != -1; port += 2) { - if ((addr >= port[0] && addr <= port[1]) || - (addr < port[0] && addr + (width / 8) > port[0])) { - if (block_bad_io) - error = -1; - else - error = 1; - break; - } - } - - return (error); -} - ACPI_STATUS AcpiOsReadPort(ACPI_IO_ADDRESS InPort, UINT32 *Value, UINT32 Width) { - int error; - - error = acpi_os_check_port(InPort, Width); - if (error != 0) { - if (bootverbose) - printf("acpi: bad read from port 0x%03x (%d)\n", - (int)InPort, Width); - if (error == -1) - return (AE_BAD_PARAMETER); - } switch (Width) { case 8: @@ -159,16 +93,6 @@ AcpiOsReadPort(ACPI_IO_ADDRESS InPort, U ACPI_STATUS AcpiOsWritePort(ACPI_IO_ADDRESS OutPort, UINT32 Value, UINT32 Width) { - int error; - - error = acpi_os_check_port(OutPort, Width); - if (error != 0) { - if (bootverbose) - printf("acpi: bad write to port 0x%03x (%d), val %#x\n", - (int)OutPort, Width, Value); - if (error == -1) - return (AE_BAD_PARAMETER); - } switch (Width) { case 8: Modified: head/sys/dev/acpica/Osd/OsdInterrupt.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdInterrupt.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/Osd/OsdInterrupt.c Fri Jun 5 18:44:36 2009 (r193530) @@ -39,7 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include #define _COMPONENT ACPI_OS_SERVICES Modified: head/sys/dev/acpica/Osd/OsdMemory.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdMemory.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/Osd/OsdMemory.c Fri Jun 5 18:44:36 2009 (r193530) @@ -33,7 +33,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include @@ -55,7 +55,7 @@ AcpiOsFree(void *Memory) } void * -AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_NATIVE_UINT Length) +AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_SIZE Length) { return (pmap_mapbios((vm_offset_t)PhysicalAddress, Length)); } @@ -80,17 +80,6 @@ AcpiOsValidateInterface (char *Interface return (AE_SUPPORT); } -/* - * There is no clean way to do this. We make the charitable assumption - * that callers will not pass garbage to us. - */ -ACPI_STATUS -AcpiOsValidateAddress (UINT8 SpaceId, ACPI_PHYSICAL_ADDRESS Address, - ACPI_SIZE Length) -{ - return (AE_OK); -} - BOOLEAN AcpiOsReadable (void *Pointer, ACPI_SIZE Length) { Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Fri Jun 5 18:44:36 2009 (r193530) @@ -43,7 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include #define _COMPONENT ACPI_OS_SERVICES Modified: head/sys/dev/acpica/Osd/OsdStream.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdStream.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/Osd/OsdStream.c Fri Jun 5 18:44:36 2009 (r193530) @@ -32,7 +32,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include void AcpiOsPrintf(const char *Format, ...) Modified: head/sys/dev/acpica/Osd/OsdSynch.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSynch.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/Osd/OsdSynch.c Fri Jun 5 18:44:36 2009 (r193530) @@ -32,7 +32,8 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include #include "opt_acpi.h" #include @@ -367,7 +368,7 @@ AcpiOsDeleteLock (ACPI_SPINLOCK Handle) * (and thus can't block) but since we have ithreads, we don't worry * about potentially blocking. */ -ACPI_NATIVE_UINT +ACPI_CPU_FLAGS AcpiOsAcquireLock (ACPI_SPINLOCK Handle) { struct acpi_spinlock *h = (struct acpi_spinlock *)Handle; Modified: head/sys/dev/acpica/Osd/OsdTable.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdTable.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/Osd/OsdTable.c Fri Jun 5 18:44:36 2009 (r193530) @@ -36,8 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #undef _COMPONENT #define _COMPONENT ACPI_TABLES @@ -67,17 +67,30 @@ ACPI_STATUS AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable) { - caddr_t acpi_dsdt, p; + char modname[] = "acpi_dsdt"; + caddr_t acpi_table, p, s; if (ExistingTable == NULL || NewTable == NULL) return (AE_BAD_PARAMETER); +#ifdef notyet + for (int i = 0; i < ACPI_NAME_SIZE; i++) + modname[i + 5] = tolower(ExistingTable->Signature[i]); +#else /* If we're not overriding the DSDT, just return. */ - if ((acpi_dsdt = preload_search_by_type("acpi_dsdt")) == NULL || - (p = preload_search_info(acpi_dsdt, MODINFO_ADDR)) == NULL) { + if (strncmp(ExistingTable->Signature, ACPI_SIG_DSDT, ACPI_NAME_SIZE) != 0) { *NewTable = NULL; - } else + return (AE_OK); + } +#endif + + if ((acpi_table = preload_search_by_type(modname)) != NULL && + (p = preload_search_info(acpi_table, MODINFO_ADDR)) != NULL && + (s = preload_search_info(acpi_table, MODINFO_SIZE)) != NULL && + *(size_t *)s != 0) *NewTable = *(ACPI_TABLE_HEADER **)p; + else + *NewTable = NULL; return (AE_OK); } Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi.c Fri Jun 5 18:44:36 2009 (r193530) @@ -61,11 +61,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include +#include + #include #include -#include -#include #include "pci_if.h" #include @@ -416,7 +417,6 @@ static int acpi_attach(device_t dev) { struct acpi_softc *sc; - ACPI_TABLE_FACS *facs; ACPI_STATUS status; int error, state; UINT32 flags; @@ -593,14 +593,7 @@ acpi_attach(device_t dev) } /* Only enable S4BIOS by default if the FACS says it is available. */ - status = AcpiGetTable(ACPI_SIG_FACS, 0, (ACPI_TABLE_HEADER **)&facs); - if (ACPI_FAILURE(status)) { - device_printf(dev, "couldn't get FACS: %s\n", - AcpiFormatException(status)); - error = ENXIO; - goto out; - } - if (facs->Flags & ACPI_FACS_S4_BIOS_PRESENT) + if (AcpiGbl_FACS->Flags & ACPI_FACS_S4_BIOS_PRESENT) sc->acpi_s4bios = 1; /* Probe all supported sleep states. */ @@ -1848,8 +1841,7 @@ acpi_shutdown_final(void *arg, int howto (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) && sc->acpi_handle_reboot) { /* Reboot using the reset register. */ - status = AcpiHwLowLevelWrite( - AcpiGbl_FADT.ResetRegister.BitWidth, + status = AcpiWrite( AcpiGbl_FADT.ResetValue, &AcpiGbl_FADT.ResetRegister); if (ACPI_FAILURE(status)) device_printf(sc->acpi_dev, "reset failed - %s\n", @@ -3391,8 +3383,6 @@ static struct debugtag dbg_layer[] = { }; static struct debugtag dbg_level[] = { - {"ACPI_LV_ERROR", ACPI_LV_ERROR}, - {"ACPI_LV_WARN", ACPI_LV_WARN}, {"ACPI_LV_INIT", ACPI_LV_INIT}, {"ACPI_LV_DEBUG_OBJECT", ACPI_LV_DEBUG_OBJECT}, {"ACPI_LV_INFO", ACPI_LV_INFO}, Modified: head/sys/dev/acpica/acpi_acad.c ============================================================================== --- head/sys/dev/acpica/acpi_acad.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_acad.c Fri Jun 5 18:44:36 2009 (r193530) @@ -40,7 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + #include #include #include Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_battery.c Fri Jun 5 18:44:36 2009 (r193530) @@ -36,7 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + #include #include Modified: head/sys/dev/acpica/acpi_button.c ============================================================================== --- head/sys/dev/acpica/acpi_button.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_button.c Fri Jun 5 18:44:36 2009 (r193530) @@ -35,7 +35,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include /* Hooks for the ACPI CA debugging infrastructure */ Modified: head/sys/dev/acpica/acpi_cmbat.c ============================================================================== --- head/sys/dev/acpica/acpi_cmbat.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_cmbat.c Fri Jun 5 18:44:36 2009 (r193530) @@ -41,7 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + #include #include Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_cpu.c Fri Jun 5 18:44:36 2009 (r193530) @@ -46,7 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include /* @@ -897,9 +899,9 @@ acpi_cpu_idle() * time if USB is loaded. */ if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { - AcpiGetRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active); + AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active); if (bm_active != 0) { - AcpiSetRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1); + AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1); cx_next_idx = min(cx_next_idx, sc->cpu_non_c3); } } @@ -926,8 +928,8 @@ acpi_cpu_idle() */ if (cx_next->type == ACPI_STATE_C3) { if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { - AcpiSetRegister(ACPI_BITREG_ARB_DISABLE, 1); - AcpiSetRegister(ACPI_BITREG_BUS_MASTER_RLD, 1); + AcpiWriteBitRegister(ACPI_BITREG_ARB_DISABLE, 1); + AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 1); } else ACPI_FLUSH_CPU_CACHE(); } @@ -938,7 +940,7 @@ acpi_cpu_idle() * get the time very close to the CPU start/stop clock logic, this * is the only reliable time source. */ - AcpiHwLowLevelRead(32, &start_time, &AcpiGbl_FADT.XPmTimerBlock); + AcpiRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); CPU_GET_REG(cx_next->p_lvlx, 1); /* @@ -947,14 +949,14 @@ acpi_cpu_idle() * the processor has stopped. Doing it again provides enough * margin that we are certain to have a correct value. */ - AcpiHwLowLevelRead(32, &end_time, &AcpiGbl_FADT.XPmTimerBlock); - AcpiHwLowLevelRead(32, &end_time, &AcpiGbl_FADT.XPmTimerBlock); + AcpiRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + AcpiRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); /* Enable bus master arbitration and disable bus master wakeup. */ if (cx_next->type == ACPI_STATE_C3 && (cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { - AcpiSetRegister(ACPI_BITREG_ARB_DISABLE, 0); - AcpiSetRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); + AcpiWriteBitRegister(ACPI_BITREG_ARB_DISABLE, 0); + AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); } ACPI_ENABLE_IRQS(); @@ -1069,11 +1071,11 @@ acpi_cpu_quirks(void) val |= PIIX4_STOP_BREAK_MASK; pci_write_config(acpi_dev, PIIX4_DEVACTB_REG, val, 4); } - AcpiGetRegister(ACPI_BITREG_BUS_MASTER_RLD, &val); + AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_RLD, &val); if (val) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "acpi_cpu: PIIX4: reset BRLD_EN_BM\n")); - AcpiSetRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); + AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); } break; default: Modified: head/sys/dev/acpica/acpi_dock.c ============================================================================== --- head/sys/dev/acpica/acpi_dock.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_dock.c Fri Jun 5 18:44:36 2009 (r193530) @@ -32,8 +32,9 @@ #include #include -#include -#include +#include +#include + #include #include Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_ec.c Fri Jun 5 18:44:36 2009 (r193530) @@ -42,7 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include /* Hooks for the ACPI CA debugging infrastructure */ Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_hpet.c Fri Jun 5 18:44:36 2009 (r193530) @@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include #include Modified: head/sys/dev/acpica/acpi_if.m ============================================================================== --- head/sys/dev/acpica/acpi_if.m Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_if.m Fri Jun 5 18:44:36 2009 (r193530) @@ -28,7 +28,8 @@ #include #include -#include + +#include INTERFACE acpi; Modified: head/sys/dev/acpica/acpi_isab.c ============================================================================== --- head/sys/dev/acpica/acpi_isab.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_isab.c Fri Jun 5 18:44:36 2009 (r193530) @@ -39,7 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include #include Modified: head/sys/dev/acpica/acpi_lid.c ============================================================================== --- head/sys/dev/acpica/acpi_lid.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_lid.c Fri Jun 5 18:44:36 2009 (r193530) @@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include /* Hooks for the ACPI CA debugging infrastructure */ Modified: head/sys/dev/acpica/acpi_package.c ============================================================================== --- head/sys/dev/acpica/acpi_package.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_package.c Fri Jun 5 18:44:36 2009 (r193530) @@ -36,7 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + #include /* Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Fri Jun 5 18:43:13 2009 (r193529) +++ head/sys/dev/acpica/acpi_pci.c Fri Jun 5 18:44:36 2009 (r193530) @@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include + #include #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 18:50:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60FC11065672; Fri, 5 Jun 2009 18:50:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DD7B8FC15; Fri, 5 Jun 2009 18:50:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55IojeL034934; Fri, 5 Jun 2009 18:50:45 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55Ioj0Q034928; Fri, 5 Jun 2009 18:50:45 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906051850.n55Ioj0Q034928@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 5 Jun 2009 18:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193531 - in head/usr.sbin/acpi: . acpiconf acpidb acpidump iasl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 18:50:46 -0000 Author: jkim Date: Fri Jun 5 18:50:45 2009 New Revision: 193531 URL: http://svn.freebsd.org/changeset/base/193531 Log: Import ACPICA 20090521. Modified: head/usr.sbin/acpi/Makefile.inc head/usr.sbin/acpi/acpiconf/acpiconf.c head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/acpidb/acpidb.c head/usr.sbin/acpi/acpidump/acpi.c head/usr.sbin/acpi/iasl/Makefile Modified: head/usr.sbin/acpi/Makefile.inc ============================================================================== --- head/usr.sbin/acpi/Makefile.inc Fri Jun 5 18:44:36 2009 (r193530) +++ head/usr.sbin/acpi/Makefile.inc Fri Jun 5 18:50:45 2009 (r193531) @@ -8,4 +8,17 @@ CFLAGS+= -I${.CURDIR}/../../../sys .include "${.CURDIR}/../../Makefile.inc" .endif -.PATH: ${ACPICA_DIR} ${ACPICA_DIR}/compiler ${ACPICA_DIR}/common +.PATH: ${ACPICA_DIR} \ + ${ACPICA_DIR}/common \ + ${ACPICA_DIR}/compiler \ + ${ACPICA_DIR}/debugger \ + ${ACPICA_DIR}/disassembler \ + ${ACPICA_DIR}/dispatcher \ + ${ACPICA_DIR}/events \ + ${ACPICA_DIR}/executer \ + ${ACPICA_DIR}/hardware \ + ${ACPICA_DIR}/namespace \ + ${ACPICA_DIR}/parser \ + ${ACPICA_DIR}/resources \ + ${ACPICA_DIR}/tables \ + ${ACPICA_DIR}/utilities Modified: head/usr.sbin/acpi/acpiconf/acpiconf.c ============================================================================== --- head/usr.sbin/acpi/acpiconf/acpiconf.c Fri Jun 5 18:44:36 2009 (r193530) +++ head/usr.sbin/acpi/acpiconf/acpiconf.c Fri Jun 5 18:50:45 2009 (r193531) @@ -37,7 +37,8 @@ #include #include -#include + +#include #define ACPIDEV "/dev/acpi" Modified: head/usr.sbin/acpi/acpidb/Makefile ============================================================================== --- head/usr.sbin/acpi/acpidb/Makefile Fri Jun 5 18:44:36 2009 (r193530) +++ head/usr.sbin/acpi/acpidb/Makefile Fri Jun 5 18:50:45 2009 (r193531) @@ -17,7 +17,7 @@ SRCS+= evevent.c evgpe.c evgpeblk.c evmi evrgnini.c evsci.c evxface.c evxfevnt.c evxfregn.c # hardware -SRCS+= hwacpi.c hwgpe.c hwregs.c hwsleep.c +SRCS+= hwacpi.c hwgpe.c hwregs.c hwsleep.c hwvalid.c hwxface.c # interpreter/dispatcher SRCS+= dsfield.c dsinit.c dsmethod.c dsmthdat.c dsobject.c \ @@ -37,8 +37,9 @@ SRCS+= psargs.c psloop.c psopcode.c pspa # namespace SRCS+= nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c \ - nsload.c nsnames.c nsobject.c nsparse.c nssearch.c \ - nsutils.c nswalk.c nsxfeval.c nsxfname.c nsxfobj.c + nsload.c nsnames.c nsobject.c nsparse.c nspredef.c \ + nssearch.c nsutils.c nswalk.c nsxfeval.c nsxfname.c \ + nsxfobj.c # resources SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c \ @@ -51,14 +52,15 @@ SRCS+= tbfadt.c tbfind.c tbinstal.c tbut # utilities SRCS+= utalloc.c utcache.c utcopy.c utdebug.c utdelete.c \ - uteval.c utglobal.c utinit.c utmath.c utmisc.c \ + uteval.c utglobal.c utinit.c utlock.c utmath.c utmisc.c \ utmutex.c utobject.c utresrc.c utstate.c uttrack.c \ utxface.c MAN= acpidb.8 WARNS?= 2 -CFLAGS+= -DACPI_EXEC_APP -CFLAGS+=-fno-strict-aliasing +CFLAGS+= -DACPI_EXEC_APP -fno-strict-aliasing +DPADD= ${LIBPTHREAD} +LDADD= -lpthread .include Modified: head/usr.sbin/acpi/acpidb/acpidb.c ============================================================================== --- head/usr.sbin/acpi/acpidb/acpidb.c Fri Jun 5 18:44:36 2009 (r193530) +++ head/usr.sbin/acpi/acpidb/acpidb.c Fri Jun 5 18:50:45 2009 (r193531) @@ -42,9 +42,8 @@ #include #include -#include -#include -#include +#include +#include /* * Dummy DSDT Table Header @@ -90,7 +89,13 @@ static void aml_simulation_regdump(con ACPI_STATUS AeLocalGetRootPointer(void) { - return AE_ERROR; + + return (AE_ERROR); +} + +void +AeTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable) +{ } static void Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Fri Jun 5 18:44:36 2009 (r193530) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri Jun 5 18:50:45 2009 (r193531) @@ -34,7 +34,9 @@ #include #include #include +#include #include +#include #include #include @@ -803,11 +805,26 @@ dsdt_save_file(char *outfile, struct ACP void aml_disassemble(struct ACPIsdt *rsdt, struct ACPIsdt *dsdp) { - char tmpstr[32], buf[256]; + char buf[PATH_MAX], tmpstr[PATH_MAX]; + const char *tmpdir; + char *tmpext; FILE *fp; - int fd, len; + size_t len; + int fd; - strcpy(tmpstr, "/tmp/acpidump.XXXXXX"); + tmpdir = getenv("TMPDIR"); + if (tmpdir == NULL) + tmpdir = _PATH_TMP; + strncpy(tmpstr, tmpdir, sizeof(tmpstr)); + strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(tmpdir)); + if (realpath(tmpstr, buf) == NULL) { + perror("realpath tmp file"); + return; + } + strncpy(tmpstr, buf, sizeof(tmpstr)); + len = strlen(buf); + tmpext = tmpstr + len; + strncpy(tmpext, "XXXXXX", sizeof(tmpstr) - len); fd = mkstemp(tmpstr); if (fd < 0) { perror("iasl tmp file"); @@ -821,7 +838,7 @@ aml_disassemble(struct ACPIsdt *rsdt, st close(STDOUT_FILENO); if (vflag == 0) close(STDERR_FILENO); - execl("/usr/sbin/iasl", "iasl", "-d", tmpstr, (char *) 0); + execl("/usr/sbin/iasl", "iasl", "-d", tmpstr, NULL); err(1, "exec"); } @@ -829,8 +846,9 @@ aml_disassemble(struct ACPIsdt *rsdt, st unlink(tmpstr); /* Dump iasl's output to stdout */ - fp = fopen("acpidump.dsl", "r"); - unlink("acpidump.dsl"); + strncpy(tmpext, "dsl", sizeof(tmpstr) - len); + fp = fopen(tmpstr, "r"); + unlink(tmpstr); if (fp == NULL) { perror("iasl tmp file (read)"); return; Modified: head/usr.sbin/acpi/iasl/Makefile ============================================================================== --- head/usr.sbin/acpi/iasl/Makefile Fri Jun 5 18:44:36 2009 (r193530) +++ head/usr.sbin/acpi/iasl/Makefile Fri Jun 5 18:50:45 2009 (r193531) @@ -13,8 +13,8 @@ SRCS+= aslanalyze.c aslcodegen.c aslcomp aslfiles.c aslfold.c asllength.c asllisting.c \ aslload.c asllookup.c aslmain.c aslmap.c aslopcodes.c \ asloperands.c aslopt.c aslresource.c aslrestype1.c \ - aslrestype2.c aslstubs.c asltransform.c asltree.c \ - aslutils.c + aslrestype2.c aslstartup.c aslstubs.c asltransform.c \ + asltree.c aslutils.c # debugger SRCS+= dbfileio.c @@ -46,8 +46,8 @@ SRCS+= tbfadt.c tbinstal.c tbutils.c tbx # utilities SRCS+= utalloc.c utcache.c utcopy.c utdebug.c utdelete.c \ - utglobal.c utmath.c utmisc.c utmutex.c utobject.c \ - utresrc.c utstate.c + utglobal.c utinit.c utlock.c utmath.c utmisc.c \ + utmutex.c utobject.c utresrc.c utstate.c utxface.c MAN= iasl.8 @@ -55,6 +55,8 @@ CFLAGS+= -DACPI_ASL_COMPILER -I. CFLAGS+= -D_USE_BERKELEY_YACC LFLAGS= -i -PAslCompiler YFLAGS= -d -pAslCompiler +DPADD= ${LIBPTHREAD} +LDADD= -lpthread CLEANFILES= aslcompiler.y.h aslcompilerlex.l aslcompilerparse.y From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 19:22:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23369106566B; Fri, 5 Jun 2009 19:22:48 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EEF88FC0A; Fri, 5 Jun 2009 19:22:48 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55JMm7Y035706; Fri, 5 Jun 2009 19:22:48 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55JMlsj035701; Fri, 5 Jun 2009 19:22:47 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906051922.n55JMlsj035701@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 5 Jun 2009 19:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193532 - in head/sys: conf modules/dummynet modules/ipfw modules/ipfw_nat netinet netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 19:22:48 -0000 Author: luigi Date: Fri Jun 5 19:22:47 2009 New Revision: 193532 URL: http://svn.freebsd.org/changeset/base/193532 Log: move kernel ipfw-related sources to a separate directory, adjust conf/files and modules' Makefiles accordingly. No code or ABI changes so this and most of previous related changes can be easily MFC'ed MFC after: 5 days Added: head/sys/netinet/ipfw/ head/sys/netinet/ipfw/ip_dummynet.c (props changed) - copied unchanged from r193497, head/sys/netinet/ip_dummynet.c head/sys/netinet/ipfw/ip_fw2.c (contents, props changed) - copied, changed from r193502, head/sys/netinet/ip_fw2.c head/sys/netinet/ipfw/ip_fw_nat.c (props changed) - copied unchanged from r193492, head/sys/netinet/ip_fw_nat.c head/sys/netinet/ipfw/ip_fw_pfil.c (props changed) - copied unchanged from r193502, head/sys/netinet/ip_fw_pfil.c Deleted: head/sys/netinet/ip_dummynet.c head/sys/netinet/ip_fw2.c head/sys/netinet/ip_fw_nat.c head/sys/netinet/ip_fw_pfil.c Modified: head/sys/conf/files head/sys/modules/dummynet/Makefile head/sys/modules/ipfw/Makefile head/sys/modules/ipfw_nat/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jun 5 18:50:45 2009 (r193531) +++ head/sys/conf/files Fri Jun 5 19:22:47 2009 (r193532) @@ -2334,14 +2334,14 @@ netinet/in_proto.c optional inet \ compile-with "${NORMAL_C} -I$S/contrib/pf" netinet/in_rmx.c optional inet netinet/ip_divert.c optional ipdivert -netinet/ip_dummynet.c optional dummynet +netinet/ipfw/ip_dummynet.c optional dummynet netinet/ip_ecn.c optional inet | inet6 netinet/ip_encap.c optional inet | inet6 netinet/ip_fastfwd.c optional inet -netinet/ip_fw2.c optional ipfirewall \ +netinet/ipfw/ip_fw2.c optional ipfirewall \ compile-with "${NORMAL_C} -I$S/contrib/pf" -netinet/ip_fw_pfil.c optional ipfirewall -netinet/ip_fw_nat.c optional ipfirewall_nat +netinet/ipfw/ip_fw_pfil.c optional ipfirewall +netinet/ipfw/ip_fw_nat.c optional ipfirewall_nat netinet/ip_icmp.c optional inet netinet/ip_input.c optional inet netinet/ip_ipsec.c optional ipsec Modified: head/sys/modules/dummynet/Makefile ============================================================================== --- head/sys/modules/dummynet/Makefile Fri Jun 5 18:50:45 2009 (r193531) +++ head/sys/modules/dummynet/Makefile Fri Jun 5 19:22:47 2009 (r193532) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../netinet +.PATH: ${.CURDIR}/../../netinet/ipfw KMOD= dummynet SRCS= ip_dummynet.c SRCS+= opt_inet6.h Modified: head/sys/modules/ipfw/Makefile ============================================================================== --- head/sys/modules/ipfw/Makefile Fri Jun 5 18:50:45 2009 (r193531) +++ head/sys/modules/ipfw/Makefile Fri Jun 5 19:22:47 2009 (r193532) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../netinet +.PATH: ${.CURDIR}/../../netinet/ipfw KMOD= ipfw SRCS= ip_fw2.c ip_fw_pfil.c Modified: head/sys/modules/ipfw_nat/Makefile ============================================================================== --- head/sys/modules/ipfw_nat/Makefile Fri Jun 5 18:50:45 2009 (r193531) +++ head/sys/modules/ipfw_nat/Makefile Fri Jun 5 19:22:47 2009 (r193532) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../netinet +.PATH: ${.CURDIR}/../../netinet/ipfw KMOD= ipfw_nat SRCS= ip_fw_nat.c Copied: head/sys/netinet/ipfw/ip_dummynet.c (from r193497, head/sys/netinet/ip_dummynet.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/ipfw/ip_dummynet.c Fri Jun 5 19:22:47 2009 (r193532, copy of r193497, head/sys/netinet/ip_dummynet.c) @@ -0,0 +1,2371 @@ +/*- + * Copyright (c) 1998-2002 Luigi Rizzo, Universita` di Pisa + * Portions Copyright (c) 2000 Akamba Corp. + * All rights reserved + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#define DUMMYNET_DEBUG + +#include "opt_inet6.h" + +/* + * This module implements IP dummynet, a bandwidth limiter/delay emulator + * used in conjunction with the ipfw package. + * Description of the data structures used is in ip_dummynet.h + * Here you mainly find the following blocks of code: + * + variable declarations; + * + heap management functions; + * + scheduler and dummynet functions; + * + configuration and initialization. + * + * NOTA BENE: critical sections are protected by the "dummynet lock". + * + * Most important Changes: + * + * 011004: KLDable + * 010124: Fixed WF2Q behaviour + * 010122: Fixed spl protection. + * 000601: WF2Q support + * 000106: large rewrite, use heaps to handle very many pipes. + * 980513: initial release + * + * include files marked with XXX are probably not needed + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */ +#include +#include +#include /* ip_len, ip_off */ +#include +#include +#include /* ip_output(), IP_FORWARDING */ + +#include /* various ether_* routines */ + +#include /* for ip6_input, ip6_output prototypes */ +#include + +/* + * We keep a private variable for the simulation time, but we could + * probably use an existing one ("softticks" in sys/kern/kern_timeout.c) + */ +static dn_key curr_time = 0 ; /* current simulation time */ + +static int dn_hash_size = 64 ; /* default hash size */ + +/* statistics on number of queue searches and search steps */ +static long searches, search_steps ; +static int pipe_expire = 1 ; /* expire queue if empty */ +static int dn_max_ratio = 16 ; /* max queues/buckets ratio */ + +static long pipe_slot_limit = 100; /* Foot shooting limit for pipe queues. */ +static long pipe_byte_limit = 1024 * 1024; + +static int red_lookup_depth = 256; /* RED - default lookup table depth */ +static int red_avg_pkt_size = 512; /* RED - default medium packet size */ +static int red_max_pkt_size = 1500; /* RED - default max packet size */ + +static struct timeval prev_t, t; +static long tick_last; /* Last tick duration (usec). */ +static long tick_delta; /* Last vs standard tick diff (usec). */ +static long tick_delta_sum; /* Accumulated tick difference (usec).*/ +static long tick_adjustment; /* Tick adjustments done. */ +static long tick_lost; /* Lost(coalesced) ticks number. */ +/* Adjusted vs non-adjusted curr_time difference (ticks). */ +static long tick_diff; + +static int io_fast; +static unsigned long io_pkt; +static unsigned long io_pkt_fast; +static unsigned long io_pkt_drop; + +/* + * Three heaps contain queues and pipes that the scheduler handles: + * + * ready_heap contains all dn_flow_queue related to fixed-rate pipes. + * + * wfq_ready_heap contains the pipes associated with WF2Q flows + * + * extract_heap contains pipes associated with delay lines. + * + */ + +MALLOC_DEFINE(M_DUMMYNET, "dummynet", "dummynet heap"); + +static struct dn_heap ready_heap, extract_heap, wfq_ready_heap ; + +static int heap_init(struct dn_heap *h, int size); +static int heap_insert (struct dn_heap *h, dn_key key1, void *p); +static void heap_extract(struct dn_heap *h, void *obj); +static void transmit_event(struct dn_pipe *pipe, struct mbuf **head, + struct mbuf **tail); +static void ready_event(struct dn_flow_queue *q, struct mbuf **head, + struct mbuf **tail); +static void ready_event_wfq(struct dn_pipe *p, struct mbuf **head, + struct mbuf **tail); + +#define HASHSIZE 16 +#define HASH(num) ((((num) >> 8) ^ ((num) >> 4) ^ (num)) & 0x0f) +static struct dn_pipe_head pipehash[HASHSIZE]; /* all pipes */ +static struct dn_flow_set_head flowsethash[HASHSIZE]; /* all flowsets */ + +static struct callout dn_timeout; + +extern void (*bridge_dn_p)(struct mbuf *, struct ifnet *); + +#ifdef SYSCTL_NODE +SYSCTL_DECL(_net_inet); +SYSCTL_DECL(_net_inet_ip); + +SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet"); +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, hash_size, + CTLFLAG_RW, &dn_hash_size, 0, "Default hash table size"); +#if 0 /* curr_time is 64 bit */ +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, curr_time, + CTLFLAG_RD, &curr_time, 0, "Current tick"); +#endif +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, ready_heap, + CTLFLAG_RD, &ready_heap.size, 0, "Size of ready heap"); +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, extract_heap, + CTLFLAG_RD, &extract_heap.size, 0, "Size of extract heap"); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, searches, + CTLFLAG_RD, &searches, 0, "Number of queue searches"); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, search_steps, + CTLFLAG_RD, &search_steps, 0, "Number of queue search steps"); +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, expire, + CTLFLAG_RW, &pipe_expire, 0, "Expire queue if empty"); +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, max_chain_len, + CTLFLAG_RW, &dn_max_ratio, 0, + "Max ratio between dynamic queues and buckets"); +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, red_lookup_depth, + CTLFLAG_RD, &red_lookup_depth, 0, "Depth of RED lookup table"); +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, red_avg_pkt_size, + CTLFLAG_RD, &red_avg_pkt_size, 0, "RED Medium packet size"); +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, red_max_pkt_size, + CTLFLAG_RD, &red_max_pkt_size, 0, "RED Max packet size"); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_delta, + CTLFLAG_RD, &tick_delta, 0, "Last vs standard tick difference (usec)."); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_delta_sum, + CTLFLAG_RD, &tick_delta_sum, 0, "Accumulated tick difference (usec)."); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_adjustment, + CTLFLAG_RD, &tick_adjustment, 0, "Tick adjustments done."); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_diff, + CTLFLAG_RD, &tick_diff, 0, + "Adjusted vs non-adjusted curr_time difference (ticks)."); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_lost, + CTLFLAG_RD, &tick_lost, 0, + "Number of ticks coalesced by dummynet taskqueue."); +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, io_fast, + CTLFLAG_RW, &io_fast, 0, "Enable fast dummynet io."); +SYSCTL_ULONG(_net_inet_ip_dummynet, OID_AUTO, io_pkt, + CTLFLAG_RD, &io_pkt, 0, + "Number of packets passed to dummynet."); +SYSCTL_ULONG(_net_inet_ip_dummynet, OID_AUTO, io_pkt_fast, + CTLFLAG_RD, &io_pkt_fast, 0, + "Number of packets bypassed dummynet scheduler."); +SYSCTL_ULONG(_net_inet_ip_dummynet, OID_AUTO, io_pkt_drop, + CTLFLAG_RD, &io_pkt_drop, 0, + "Number of packets dropped by dummynet."); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, pipe_slot_limit, + CTLFLAG_RW, &pipe_slot_limit, 0, "Upper limit in slots for pipe queue."); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, pipe_byte_limit, + CTLFLAG_RW, &pipe_byte_limit, 0, "Upper limit in bytes for pipe queue."); +#endif + +#ifdef DUMMYNET_DEBUG +int dummynet_debug = 0; +#ifdef SYSCTL_NODE +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, debug, CTLFLAG_RW, &dummynet_debug, + 0, "control debugging printfs"); +#endif +#define DPRINTF(X) if (dummynet_debug) printf X +#else +#define DPRINTF(X) +#endif + +static struct task dn_task; +static struct taskqueue *dn_tq = NULL; +static void dummynet_task(void *, int); + +static struct mtx dummynet_mtx; +#define DUMMYNET_LOCK_INIT() \ + mtx_init(&dummynet_mtx, "dummynet", NULL, MTX_DEF) +#define DUMMYNET_LOCK_DESTROY() mtx_destroy(&dummynet_mtx) +#define DUMMYNET_LOCK() mtx_lock(&dummynet_mtx) +#define DUMMYNET_UNLOCK() mtx_unlock(&dummynet_mtx) +#define DUMMYNET_LOCK_ASSERT() mtx_assert(&dummynet_mtx, MA_OWNED) + +static int config_pipe(struct dn_pipe *p); +static int ip_dn_ctl(struct sockopt *sopt); + +static void dummynet(void *); +static void dummynet_flush(void); +static void dummynet_send(struct mbuf *); +void dummynet_drain(void); +static int dummynet_io(struct mbuf **, int , struct ip_fw_args *); +static void dn_rule_delete(void *); + +/* + * Heap management functions. + * + * In the heap, first node is element 0. Children of i are 2i+1 and 2i+2. + * Some macros help finding parent/children so we can optimize them. + * + * heap_init() is called to expand the heap when needed. + * Increment size in blocks of 16 entries. + * XXX failure to allocate a new element is a pretty bad failure + * as we basically stall a whole queue forever!! + * Returns 1 on error, 0 on success + */ +#define HEAP_FATHER(x) ( ( (x) - 1 ) / 2 ) +#define HEAP_LEFT(x) ( 2*(x) + 1 ) +#define HEAP_IS_LEFT(x) ( (x) & 1 ) +#define HEAP_RIGHT(x) ( 2*(x) + 2 ) +#define HEAP_SWAP(a, b, buffer) { buffer = a ; a = b ; b = buffer ; } +#define HEAP_INCREMENT 15 + +static int +heap_init(struct dn_heap *h, int new_size) +{ + struct dn_heap_entry *p; + + if (h->size >= new_size ) { + printf("dummynet: %s, Bogus call, have %d want %d\n", __func__, + h->size, new_size); + return 0 ; + } + new_size = (new_size + HEAP_INCREMENT ) & ~HEAP_INCREMENT ; + p = malloc(new_size * sizeof(*p), M_DUMMYNET, M_NOWAIT); + if (p == NULL) { + printf("dummynet: %s, resize %d failed\n", __func__, new_size ); + return 1 ; /* error */ + } + if (h->size > 0) { + bcopy(h->p, p, h->size * sizeof(*p) ); + free(h->p, M_DUMMYNET); + } + h->p = p ; + h->size = new_size ; + return 0 ; +} + +/* + * Insert element in heap. Normally, p != NULL, we insert p in + * a new position and bubble up. If p == NULL, then the element is + * already in place, and key is the position where to start the + * bubble-up. + * Returns 1 on failure (cannot allocate new heap entry) + * + * If offset > 0 the position (index, int) of the element in the heap is + * also stored in the element itself at the given offset in bytes. + */ +#define SET_OFFSET(heap, node) \ + if (heap->offset > 0) \ + *((int *)((char *)(heap->p[node].object) + heap->offset)) = node ; +/* + * RESET_OFFSET is used for sanity checks. It sets offset to an invalid value. + */ +#define RESET_OFFSET(heap, node) \ + if (heap->offset > 0) \ + *((int *)((char *)(heap->p[node].object) + heap->offset)) = -1 ; +static int +heap_insert(struct dn_heap *h, dn_key key1, void *p) +{ + int son = h->elements ; + + if (p == NULL) /* data already there, set starting point */ + son = key1 ; + else { /* insert new element at the end, possibly resize */ + son = h->elements ; + if (son == h->size) /* need resize... */ + if (heap_init(h, h->elements+1) ) + return 1 ; /* failure... */ + h->p[son].object = p ; + h->p[son].key = key1 ; + h->elements++ ; + } + while (son > 0) { /* bubble up */ + int father = HEAP_FATHER(son) ; + struct dn_heap_entry tmp ; + + if (DN_KEY_LT( h->p[father].key, h->p[son].key ) ) + break ; /* found right position */ + /* son smaller than father, swap and repeat */ + HEAP_SWAP(h->p[son], h->p[father], tmp) ; + SET_OFFSET(h, son); + son = father ; + } + SET_OFFSET(h, son); + return 0 ; +} + +/* + * remove top element from heap, or obj if obj != NULL + */ +static void +heap_extract(struct dn_heap *h, void *obj) +{ + int child, father, max = h->elements - 1 ; + + if (max < 0) { + printf("dummynet: warning, extract from empty heap 0x%p\n", h); + return ; + } + father = 0 ; /* default: move up smallest child */ + if (obj != NULL) { /* extract specific element, index is at offset */ + if (h->offset <= 0) + panic("dummynet: heap_extract from middle not supported on this heap!!!\n"); + father = *((int *)((char *)obj + h->offset)) ; + if (father < 0 || father >= h->elements) { + printf("dummynet: heap_extract, father %d out of bound 0..%d\n", + father, h->elements); + panic("dummynet: heap_extract"); + } + } + RESET_OFFSET(h, father); + child = HEAP_LEFT(father) ; /* left child */ + while (child <= max) { /* valid entry */ + if (child != max && DN_KEY_LT(h->p[child+1].key, h->p[child].key) ) + child = child+1 ; /* take right child, otherwise left */ + h->p[father] = h->p[child] ; + SET_OFFSET(h, father); + father = child ; + child = HEAP_LEFT(child) ; /* left child for next loop */ + } + h->elements-- ; + if (father != max) { + /* + * Fill hole with last entry and bubble up, reusing the insert code + */ + h->p[father] = h->p[max] ; + heap_insert(h, father, NULL); /* this one cannot fail */ + } +} + +#if 0 +/* + * change object position and update references + * XXX this one is never used! + */ +static void +heap_move(struct dn_heap *h, dn_key new_key, void *object) +{ + int temp; + int i ; + int max = h->elements-1 ; + struct dn_heap_entry buf ; + + if (h->offset <= 0) + panic("cannot move items on this heap"); + + i = *((int *)((char *)object + h->offset)); + if (DN_KEY_LT(new_key, h->p[i].key) ) { /* must move up */ + h->p[i].key = new_key ; + for (; i>0 && DN_KEY_LT(new_key, h->p[(temp = HEAP_FATHER(i))].key) ; + i = temp ) { /* bubble up */ + HEAP_SWAP(h->p[i], h->p[temp], buf) ; + SET_OFFSET(h, i); + } + } else { /* must move down */ + h->p[i].key = new_key ; + while ( (temp = HEAP_LEFT(i)) <= max ) { /* found left child */ + if ((temp != max) && DN_KEY_GT(h->p[temp].key, h->p[temp+1].key)) + temp++ ; /* select child with min key */ + if (DN_KEY_GT(new_key, h->p[temp].key)) { /* go down */ + HEAP_SWAP(h->p[i], h->p[temp], buf) ; + SET_OFFSET(h, i); + } else + break ; + i = temp ; + } + } + SET_OFFSET(h, i); +} +#endif /* heap_move, unused */ + +/* + * heapify() will reorganize data inside an array to maintain the + * heap property. It is needed when we delete a bunch of entries. + */ +static void +heapify(struct dn_heap *h) +{ + int i ; + + for (i = 0 ; i < h->elements ; i++ ) + heap_insert(h, i , NULL) ; +} + +/* + * cleanup the heap and free data structure + */ +static void +heap_free(struct dn_heap *h) +{ + if (h->size >0 ) + free(h->p, M_DUMMYNET); + bzero(h, sizeof(*h) ); +} + +/* + * --- end of heap management functions --- + */ + +/* + * Return the mbuf tag holding the dummynet state. As an optimization + * this is assumed to be the first tag on the list. If this turns out + * wrong we'll need to search the list. + */ +static struct dn_pkt_tag * +dn_tag_get(struct mbuf *m) +{ + struct m_tag *mtag = m_tag_first(m); + KASSERT(mtag != NULL && + mtag->m_tag_cookie == MTAG_ABI_COMPAT && + mtag->m_tag_id == PACKET_TAG_DUMMYNET, + ("packet on dummynet queue w/o dummynet tag!")); + return (struct dn_pkt_tag *)(mtag+1); +} + +/* + * Scheduler functions: + * + * transmit_event() is called when the delay-line needs to enter + * the scheduler, either because of existing pkts getting ready, + * or new packets entering the queue. The event handled is the delivery + * time of the packet. + * + * ready_event() does something similar with fixed-rate queues, and the + * event handled is the finish time of the head pkt. + * + * wfq_ready_event() does something similar with WF2Q queues, and the + * event handled is the start time of the head pkt. + * + * In all cases, we make sure that the data structures are consistent + * before passing pkts out, because this might trigger recursive + * invocations of the procedures. + */ +static void +transmit_event(struct dn_pipe *pipe, struct mbuf **head, struct mbuf **tail) +{ + struct mbuf *m; + struct dn_pkt_tag *pkt; + + DUMMYNET_LOCK_ASSERT(); + + while ((m = pipe->head) != NULL) { + pkt = dn_tag_get(m); + if (!DN_KEY_LEQ(pkt->output_time, curr_time)) + break; + + pipe->head = m->m_nextpkt; + if (*tail != NULL) + (*tail)->m_nextpkt = m; + else + *head = m; + *tail = m; + } + if (*tail != NULL) + (*tail)->m_nextpkt = NULL; + + /* If there are leftover packets, put into the heap for next event. */ + if ((m = pipe->head) != NULL) { + pkt = dn_tag_get(m); + /* + * XXX Should check errors on heap_insert, by draining the + * whole pipe p and hoping in the future we are more successful. + */ + heap_insert(&extract_heap, pkt->output_time, pipe); + } +} + +#define div64(a, b) ((int64_t)(a) / (int64_t)(b)) +#define DN_TO_DROP 0xffff +/* + * Compute how many ticks we have to wait before being able to send + * a packet. This is computed as the "wire time" for the packet + * (length + extra bits), minus the credit available, scaled to ticks. + * Check that the result is not be negative (it could be if we have + * too much leftover credit in q->numbytes). + */ +static inline dn_key +set_ticks(struct mbuf *m, struct dn_flow_queue *q, struct dn_pipe *p) +{ + int64_t ret; + + ret = div64( (m->m_pkthdr.len * 8 + q->extra_bits) * hz + - q->numbytes + p->bandwidth - 1 , p->bandwidth); +#if 0 + printf("%s %d extra_bits %d numb %d ret %d\n", + __FUNCTION__, __LINE__, + (int)(q->extra_bits & 0xffffffff), + (int)(q->numbytes & 0xffffffff), + (int)(ret & 0xffffffff)); +#endif + if (ret < 0) + ret = 0; + return ret; +} + +/* + * Convert the additional MAC overheads/delays into an equivalent + * number of bits for the given data rate. The samples are in milliseconds + * so we need to divide by 1000. + */ +static dn_key +compute_extra_bits(struct mbuf *pkt, struct dn_pipe *p) +{ + int index; + dn_key extra_bits; + + if (!p->samples || p->samples_no == 0) + return 0; + index = random() % p->samples_no; + extra_bits = ((dn_key)p->samples[index] * p->bandwidth) / 1000; + if (index >= p->loss_level) { + struct dn_pkt_tag *dt = dn_tag_get(pkt); + if (dt) + dt->dn_dir = DN_TO_DROP; + } + return extra_bits; +} + +static void +free_pipe(struct dn_pipe *p) +{ + if (p->samples) + free(p->samples, M_DUMMYNET); + free(p, M_DUMMYNET); +} + +/* + * extract pkt from queue, compute output time (could be now) + * and put into delay line (p_queue) + */ +static void +move_pkt(struct mbuf *pkt, struct dn_flow_queue *q, struct dn_pipe *p, + int len) +{ + struct dn_pkt_tag *dt = dn_tag_get(pkt); + + q->head = pkt->m_nextpkt ; + q->len-- ; + q->len_bytes -= len ; + + dt->output_time = curr_time + p->delay ; + + if (p->head == NULL) + p->head = pkt; + else + p->tail->m_nextpkt = pkt; + p->tail = pkt; + p->tail->m_nextpkt = NULL; +} + +/* + * ready_event() is invoked every time the queue must enter the + * scheduler, either because the first packet arrives, or because + * a previously scheduled event fired. + * On invokation, drain as many pkts as possible (could be 0) and then + * if there are leftover packets reinsert the pkt in the scheduler. + */ +static void +ready_event(struct dn_flow_queue *q, struct mbuf **head, struct mbuf **tail) +{ + struct mbuf *pkt; + struct dn_pipe *p = q->fs->pipe; + int p_was_empty; + + DUMMYNET_LOCK_ASSERT(); + + if (p == NULL) { + printf("dummynet: ready_event- pipe is gone\n"); + return; + } + p_was_empty = (p->head == NULL); + + /* + * Schedule fixed-rate queues linked to this pipe: + * account for the bw accumulated since last scheduling, then + * drain as many pkts as allowed by q->numbytes and move to + * the delay line (in p) computing output time. + * bandwidth==0 (no limit) means we can drain the whole queue, + * setting len_scaled = 0 does the job. + */ + q->numbytes += (curr_time - q->sched_time) * p->bandwidth; + while ((pkt = q->head) != NULL) { + int len = pkt->m_pkthdr.len; + dn_key len_scaled = p->bandwidth ? len*8*hz + + q->extra_bits*hz + : 0; + + if (DN_KEY_GT(len_scaled, q->numbytes)) + break; + q->numbytes -= len_scaled; + move_pkt(pkt, q, p, len); + if (q->head) + q->extra_bits = compute_extra_bits(q->head, p); + } + /* + * If we have more packets queued, schedule next ready event + * (can only occur when bandwidth != 0, otherwise we would have + * flushed the whole queue in the previous loop). + * To this purpose we record the current time and compute how many + * ticks to go for the finish time of the packet. + */ + if ((pkt = q->head) != NULL) { /* this implies bandwidth != 0 */ + dn_key t = set_ticks(pkt, q, p); /* ticks i have to wait */ + + q->sched_time = curr_time; + heap_insert(&ready_heap, curr_time + t, (void *)q); + /* + * XXX Should check errors on heap_insert, and drain the whole + * queue on error hoping next time we are luckier. + */ + } else /* RED needs to know when the queue becomes empty. */ + q->q_time = curr_time; + + /* + * If the delay line was empty call transmit_event() now. + * Otherwise, the scheduler will take care of it. + */ + if (p_was_empty) + transmit_event(p, head, tail); +} + +/* + * Called when we can transmit packets on WF2Q queues. Take pkts out of + * the queues at their start time, and enqueue into the delay line. + * Packets are drained until p->numbytes < 0. As long as + * len_scaled >= p->numbytes, the packet goes into the delay line + * with a deadline p->delay. For the last packet, if p->numbytes < 0, + * there is an additional delay. + */ +static void +ready_event_wfq(struct dn_pipe *p, struct mbuf **head, struct mbuf **tail) +{ + int p_was_empty = (p->head == NULL); + struct dn_heap *sch = &(p->scheduler_heap); + struct dn_heap *neh = &(p->not_eligible_heap); + int64_t p_numbytes = p->numbytes; + + DUMMYNET_LOCK_ASSERT(); + + if (p->if_name[0] == 0) /* tx clock is simulated */ + /* + * Since result may not fit into p->numbytes (32bit) we + * are using 64bit var here. + */ + p_numbytes += (curr_time - p->sched_time) * p->bandwidth; + else { /* + * tx clock is for real, + * the ifq must be empty or this is a NOP. + */ + if (p->ifp && p->ifp->if_snd.ifq_head != NULL) + return; + else { + DPRINTF(("dummynet: pipe %d ready from %s --\n", + p->pipe_nr, p->if_name)); + } + } + + /* + * While we have backlogged traffic AND credit, we need to do + * something on the queue. + */ + while (p_numbytes >= 0 && (sch->elements > 0 || neh->elements > 0)) { + if (sch->elements > 0) { + /* Have some eligible pkts to send out. */ + struct dn_flow_queue *q = sch->p[0].object; + struct mbuf *pkt = q->head; + struct dn_flow_set *fs = q->fs; + uint64_t len = pkt->m_pkthdr.len; + int len_scaled = p->bandwidth ? len * 8 * hz : 0; + + heap_extract(sch, NULL); /* Remove queue from heap. */ + p_numbytes -= len_scaled; + move_pkt(pkt, q, p, len); + + p->V += (len << MY_M) / p->sum; /* Update V. */ + q->S = q->F; /* Update start time. */ + if (q->len == 0) { + /* Flow not backlogged any more. */ + fs->backlogged--; + heap_insert(&(p->idle_heap), q->F, q); + } else { + /* Still backlogged. */ + + /* + * Update F and position in backlogged queue, + * then put flow in not_eligible_heap + * (we will fix this later). + */ + len = (q->head)->m_pkthdr.len; + q->F += (len << MY_M) / (uint64_t)fs->weight; + if (DN_KEY_LEQ(q->S, p->V)) + heap_insert(neh, q->S, q); + else + heap_insert(sch, q->F, q); + } + } + /* + * Now compute V = max(V, min(S_i)). Remember that all elements + * in sch have by definition S_i <= V so if sch is not empty, + * V is surely the max and we must not update it. Conversely, + * if sch is empty we only need to look at neh. + */ + if (sch->elements == 0 && neh->elements > 0) + p->V = MAX64(p->V, neh->p[0].key); + /* Move from neh to sch any packets that have become eligible */ + while (neh->elements > 0 && DN_KEY_LEQ(neh->p[0].key, p->V)) { + struct dn_flow_queue *q = neh->p[0].object; + heap_extract(neh, NULL); + heap_insert(sch, q->F, q); + } + + if (p->if_name[0] != '\0') { /* Tx clock is from a real thing */ + p_numbytes = -1; /* Mark not ready for I/O. */ + break; + } + } + if (sch->elements == 0 && neh->elements == 0 && p_numbytes >= 0 && + p->idle_heap.elements > 0) { + /* + * No traffic and no events scheduled. + * We can get rid of idle-heap. + */ + int i; + + for (i = 0; i < p->idle_heap.elements; i++) { + struct dn_flow_queue *q = p->idle_heap.p[i].object; + + q->F = 0; + q->S = q->F + 1; + } + p->sum = 0; + p->V = 0; + p->idle_heap.elements = 0; + } + /* + * If we are getting clocks from dummynet (not a real interface) and + * If we are under credit, schedule the next ready event. + * Also fix the delivery time of the last packet. + */ + if (p->if_name[0]==0 && p_numbytes < 0) { /* This implies bw > 0. */ + dn_key t = 0; /* Number of ticks i have to wait. */ + + if (p->bandwidth > 0) + t = (p->bandwidth - 1 - p_numbytes) / p->bandwidth; + dn_tag_get(p->tail)->output_time += t; + p->sched_time = curr_time; + heap_insert(&wfq_ready_heap, curr_time + t, (void *)p); + /* + * XXX Should check errors on heap_insert, and drain the whole + * queue on error hoping next time we are luckier. + */ + } + + /* Fit (adjust if necessary) 64bit result into 32bit variable. */ + if (p_numbytes > INT_MAX) + p->numbytes = INT_MAX; + else if (p_numbytes < INT_MIN) + p->numbytes = INT_MIN; + else + p->numbytes = p_numbytes; + + /* + * If the delay line was empty call transmit_event() now. + * Otherwise, the scheduler will take care of it. + */ + if (p_was_empty) + transmit_event(p, head, tail); +} + +/* + * This is called one tick, after previous run. It is used to + * schedule next run. + */ +static void +dummynet(void * __unused unused) +{ + + taskqueue_enqueue(dn_tq, &dn_task); +} + +/* + * The main dummynet processing function. + */ +static void +dummynet_task(void *context, int pending) +{ + struct mbuf *head = NULL, *tail = NULL; + struct dn_pipe *pipe; + struct dn_heap *heaps[3]; + struct dn_heap *h; + void *p; /* generic parameter to handler */ + int i; + + DUMMYNET_LOCK(); + + heaps[0] = &ready_heap; /* fixed-rate queues */ + heaps[1] = &wfq_ready_heap; /* wfq queues */ + heaps[2] = &extract_heap; /* delay line */ + + /* Update number of lost(coalesced) ticks. */ + tick_lost += pending - 1; + + getmicrouptime(&t); + /* Last tick duration (usec). */ + tick_last = (t.tv_sec - prev_t.tv_sec) * 1000000 + + (t.tv_usec - prev_t.tv_usec); + /* Last tick vs standard tick difference (usec). */ + tick_delta = (tick_last * hz - 1000000) / hz; + /* Accumulated tick difference (usec). */ + tick_delta_sum += tick_delta; + + prev_t = t; + + /* + * Adjust curr_time if accumulated tick difference greater than + * 'standard' tick. Since curr_time should be monotonically increasing, + * we do positive adjustment as required and throttle curr_time in + * case of negative adjustment. + */ + curr_time++; + if (tick_delta_sum - tick >= 0) { + int diff = tick_delta_sum / tick; + + curr_time += diff; + tick_diff += diff; + tick_delta_sum %= tick; + tick_adjustment++; + } else if (tick_delta_sum + tick <= 0) { + curr_time--; + tick_diff--; + tick_delta_sum += tick; + tick_adjustment++; + } + + for (i = 0; i < 3; i++) { + h = heaps[i]; + while (h->elements > 0 && DN_KEY_LEQ(h->p[0].key, curr_time)) { + if (h->p[0].key > curr_time) + printf("dummynet: warning, " + "heap %d is %d ticks late\n", + i, (int)(curr_time - h->p[0].key)); + /* store a copy before heap_extract */ + p = h->p[0].object; + /* need to extract before processing */ + heap_extract(h, NULL); + if (i == 0) + ready_event(p, &head, &tail); + else if (i == 1) { + struct dn_pipe *pipe = p; + if (pipe->if_name[0] != '\0') + printf("dummynet: bad ready_event_wfq " + "for pipe %s\n", pipe->if_name); + else + ready_event_wfq(p, &head, &tail); + } else + transmit_event(p, &head, &tail); + } + } + + /* Sweep pipes trying to expire idle flow_queues. */ + for (i = 0; i < HASHSIZE; i++) + SLIST_FOREACH(pipe, &pipehash[i], next) + if (pipe->idle_heap.elements > 0 && + DN_KEY_LT(pipe->idle_heap.p[0].key, pipe->V)) { + struct dn_flow_queue *q = + pipe->idle_heap.p[0].object; + + heap_extract(&(pipe->idle_heap), NULL); + /* Mark timestamp as invalid. */ + q->S = q->F + 1; + pipe->sum -= q->fs->weight; + } + + DUMMYNET_UNLOCK(); + + if (head != NULL) + dummynet_send(head); + + callout_reset(&dn_timeout, 1, dummynet, NULL); +} + +static void +dummynet_send(struct mbuf *m) +{ + struct dn_pkt_tag *pkt; + struct mbuf *n; + struct ip *ip; + + for (; m != NULL; m = n) { + n = m->m_nextpkt; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 20:23:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A05F106564A; Fri, 5 Jun 2009 20:23:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 288658FC0C; Fri, 5 Jun 2009 20:23:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55KNUSA037160; Fri, 5 Jun 2009 20:23:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55KNUcn037159; Fri, 5 Jun 2009 20:23:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906052023.n55KNUcn037159@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 5 Jun 2009 20:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193535 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 20:23:30 -0000 Author: kib Date: Fri Jun 5 20:23:29 2009 New Revision: 193535 URL: http://svn.freebsd.org/changeset/base/193535 Log: Put intrcnt, eintrcnt, intrnames and eintrnames into the .data section. Noted by: "Tseng, Kuo-Lang" , bde MFC after: 3 days Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Fri Jun 5 20:23:22 2009 (r193534) +++ head/sys/amd64/amd64/support.S Fri Jun 5 20:23:29 2009 (r193535) @@ -38,6 +38,7 @@ #include "assym.s" + .data ALIGN_DATA .globl intrcnt, eintrcnt intrcnt: From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 21:22:09 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46DDB106572A; Fri, 5 Jun 2009 21:22:09 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from k7.mavetju.org (ppp113-58.static.internode.on.net [150.101.113.58]) by mx1.freebsd.org (Postfix) with ESMTP id E409D8FC1D; Fri, 5 Jun 2009 21:22:08 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by k7.mavetju.org (Postfix, from userid 1001) id 9116645093; Sat, 6 Jun 2009 07:20:28 +1000 (EST) Date: Sat, 6 Jun 2009 07:20:28 +1000 From: Edwin Groothuis To: Gavin Atkinson Message-ID: <20090605212028.GA3212@mavetju.org> References: <200906051305.n55D5Eu8026282@svn.freebsd.org> <1244209084.48730.10.camel@buffy.york.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1244209084.48730.10.camel@buffy.york.ac.uk> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193498 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 21:22:09 -0000 On Fri, Jun 05, 2009 at 02:38:04PM +0100, Gavin Atkinson wrote: > > Date: Fri Jun 5 13:05:14 2009 > > New Revision: 193498 > > URL: http://svn.freebsd.org/changeset/base/193498 > > > > Log: > > [patch] Portuguese timedef > > > > PR: conf/58595 > > Submitted by: Chris Stenton > > MFC after: 1 week > > Actually, PR: conf/95754 > Submitted by: Miguel Saturnino You are right, that one from Chris was an ntp-related thingie. My apologies to Miguel for the absence of credit where credit due. Edwin -- Edwin Groothuis Website: http://www.mavetju.org/ edwin@mavetju.org Weblog: http://www.mavetju.org/weblog/ From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:10:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F19541065696; Fri, 5 Jun 2009 23:10:30 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFA2B8FC1C; Fri, 5 Jun 2009 23:10:30 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55NAUOm040846; Fri, 5 Jun 2009 23:10:30 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55NAUow040842; Fri, 5 Jun 2009 23:10:30 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906052310.n55NAUow040842@svn.freebsd.org> From: Sam Leffler Date: Fri, 5 Jun 2009 23:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193541 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 23:10:32 -0000 Author: sam Date: Fri Jun 5 23:10:30 2009 New Revision: 193541 URL: http://svn.freebsd.org/changeset/base/193541 Log: add tid param to ieee80211_notify_replay_failure to get the correct rsc Modified: head/sys/net80211/ieee80211_crypto.h head/sys/net80211/ieee80211_crypto_ccmp.c head/sys/net80211/ieee80211_crypto_tkip.c head/sys/net80211/ieee80211_freebsd.c Modified: head/sys/net80211/ieee80211_crypto.h ============================================================================== --- head/sys/net80211/ieee80211_crypto.h Fri Jun 5 22:36:17 2009 (r193540) +++ head/sys/net80211/ieee80211_crypto.h Fri Jun 5 23:10:30 2009 (r193541) @@ -236,7 +236,7 @@ ieee80211_crypto_resetkey(struct ieee802 */ void ieee80211_notify_replay_failure(struct ieee80211vap *, const struct ieee80211_frame *, const struct ieee80211_key *, - uint64_t rsc); + uint64_t rsc, int tid); void ieee80211_notify_michael_failure(struct ieee80211vap *, const struct ieee80211_frame *, u_int keyix); #endif /* defined(__KERNEL__) || defined(_KERNEL) */ Modified: head/sys/net80211/ieee80211_crypto_ccmp.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_ccmp.c Fri Jun 5 22:36:17 2009 (r193540) +++ head/sys/net80211/ieee80211_crypto_ccmp.c Fri Jun 5 23:10:30 2009 (r193541) @@ -230,7 +230,7 @@ ccmp_decap(struct ieee80211_key *k, stru /* * Replay violation. */ - ieee80211_notify_replay_failure(vap, wh, k, pn); + ieee80211_notify_replay_failure(vap, wh, k, pn, tid); vap->iv_stats.is_rx_ccmpreplay++; return 0; } Modified: head/sys/net80211/ieee80211_crypto_tkip.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_tkip.c Fri Jun 5 22:36:17 2009 (r193540) +++ head/sys/net80211/ieee80211_crypto_tkip.c Fri Jun 5 23:10:30 2009 (r193541) @@ -284,7 +284,7 @@ tkip_decap(struct ieee80211_key *k, stru /* * Replay violation; notify upper layer. */ - ieee80211_notify_replay_failure(vap, wh, k, ctx->rx_rsc); + ieee80211_notify_replay_failure(vap, wh, k, ctx->rx_rsc, tid); vap->iv_stats.is_rx_tkipreplay++; return 0; } Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Fri Jun 5 22:36:17 2009 (r193540) +++ head/sys/net80211/ieee80211_freebsd.c Fri Jun 5 23:10:30 2009 (r193541) @@ -528,14 +528,14 @@ ieee80211_notify_scan_done(struct ieee80 void ieee80211_notify_replay_failure(struct ieee80211vap *vap, const struct ieee80211_frame *wh, const struct ieee80211_key *k, - u_int64_t rsc) + u_int64_t rsc, int tid) { struct ifnet *ifp = vap->iv_ifp; IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, "%s replay detected ", k->wk_cipher->ic_name, (intmax_t) rsc, - (intmax_t) k->wk_keyrsc[IEEE80211_NONQOS_TID], + (intmax_t) k->wk_keyrsc[tid], k->wk_keyix, k->wk_rxkeyix); if (ifp != NULL) { /* NB: for cipher test modules */ @@ -548,7 +548,7 @@ ieee80211_notify_replay_failure(struct i iev.iev_keyix = k->wk_rxkeyix; else iev.iev_keyix = k->wk_keyix; - iev.iev_keyrsc = k->wk_keyrsc[0]; /* XXX need tid */ + iev.iev_keyrsc = k->wk_keyrsc[tid]; iev.iev_rsc = rsc; CURVNET_SET(ifp->if_vnet); rt_ieee80211msg(ifp, RTM_IEEE80211_REPLAY, &iev, sizeof(iev)); From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:20:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFD9A106564A; Fri, 5 Jun 2009 23:20:41 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E6FE8FC0A; Fri, 5 Jun 2009 23:20:41 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55NKf9r041078; Fri, 5 Jun 2009 23:20:41 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55NKfU9041077; Fri, 5 Jun 2009 23:20:41 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906052320.n55NKfU9041077@svn.freebsd.org> From: Sam Leffler Date: Fri, 5 Jun 2009 23:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193542 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 23:20:43 -0000 Author: sam Date: Fri Jun 5 23:20:41 2009 New Revision: 193542 URL: http://svn.freebsd.org/changeset/base/193542 Log: o correct/add action frame categories o add IEEE80211_STATUS_MISSING_HT_CAPS, added in 11n D3.0 spec Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Fri Jun 5 23:10:30 2009 (r193541) +++ head/sys/net80211/ieee80211.h Fri Jun 5 23:20:41 2009 (r193542) @@ -315,9 +315,12 @@ struct ieee80211_action { uint8_t ia_action; } __packed; -#define IEEE80211_ACTION_CAT_QOS 0 /* QoS */ +#define IEEE80211_ACTION_CAT_SM 0 /* Spectrum Management */ +#define IEEE80211_ACTION_CAT_QOS 1 /* QoS */ +#define IEEE80211_ACTION_CAT_DLS 2 /* DLS */ #define IEEE80211_ACTION_CAT_BA 3 /* BA */ #define IEEE80211_ACTION_CAT_HT 7 /* HT */ +#define IEEE80211_ACTION_CAT_VENDOR 127 /* Vendor Specific */ #define IEEE80211_ACTION_HT_TXCHWIDTH 0 /* recommended xmit chan width*/ #define IEEE80211_ACTION_HT_MIMOPWRSAVE 1 /* MIMO power save */ @@ -903,6 +906,7 @@ enum { IEEE80211_STATUS_SUPCHAN_REQUIRED = 24, /* 11h */ IEEE80211_STATUS_SHORTSLOT_REQUIRED = 25, /* 11g */ IEEE80211_STATUS_DSSSOFDM_REQUIRED = 26, /* 11g */ + IEEE80211_STATUS_MISSING_HT_CAPS = 27, /* 11n D3.0 */ IEEE80211_STATUS_INVALID_IE = 40, /* 11i */ IEEE80211_STATUS_GROUP_CIPHER_INVALID = 41, /* 11i */ IEEE80211_STATUS_PAIRWISE_CIPHER_INVALID = 42, /* 11i */ From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:21:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 806691065670; Fri, 5 Jun 2009 23:21:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4298FC13; Fri, 5 Jun 2009 23:21:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55NLTSh041130; Fri, 5 Jun 2009 23:21:29 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55NLTct041129; Fri, 5 Jun 2009 23:21:29 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906052321.n55NLTct041129@svn.freebsd.org> From: Sam Leffler Date: Fri, 5 Jun 2009 23:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193543 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 23:21:30 -0000 Author: sam Date: Fri Jun 5 23:21:29 2009 New Revision: 193543 URL: http://svn.freebsd.org/changeset/base/193543 Log: correct status code returned for ht capability mismatch on assoc/reassoc Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Fri Jun 5 23:20:41 2009 (r193542) +++ head/sys/net80211/ieee80211_hostap.c Fri Jun 5 23:21:29 2009 (r193543) @@ -1628,7 +1628,7 @@ htcapmismatch(struct ieee80211_node *ni, IEEE80211_NOTE_MAC(ni->ni_vap, IEEE80211_MSG_ANY, wh->i_addr2, "deny %s request, %s missing HT ie", reassoc ? "reassoc" : "assoc"); /* XXX no better code */ - IEEE80211_SEND_MGMT(ni, resp, IEEE80211_STATUS_OTHER); + IEEE80211_SEND_MGMT(ni, resp, IEEE80211_STATUS_MISSING_HT_CAPS); ieee80211_node_leave(ni); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:21:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B9DF1065744; Fri, 5 Jun 2009 23:21:53 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206192061.chello.pl [87.206.192.61]) by mx1.freebsd.org (Postfix) with ESMTP id D59D48FC23; Fri, 5 Jun 2009 23:21:52 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 47B4E45B36; Sat, 6 Jun 2009 01:21:51 +0200 (CEST) Received: from localhost (chello087206192061.chello.pl [87.206.192.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id F122645684; Sat, 6 Jun 2009 01:21:45 +0200 (CEST) Date: Sat, 6 Jun 2009 01:21:49 +0200 From: Pawel Jakub Dawidek To: Robert Watson Message-ID: <20090605232149.GB2313@garage.freebsd.pl> References: <200906051455.n55EtMBc029090@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GRPZ8SYKNexpdSJ7" Content-Disposition: inline In-Reply-To: <200906051455.n55EtMBc029090@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193511 - in head/sys: compat/linux compat/svr4 conf contrib/pf/net fs/devfs fs/nfsserver fs/unionfs i386/i386 i386/ibcs2 kern net netatalk netinet netinet6 nfsserver security/audit ufs... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 23:21:54 -0000 --GRPZ8SYKNexpdSJ7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 05, 2009 at 02:55:22PM +0000, Robert Watson wrote: > Author: rwatson > Date: Fri Jun 5 14:55:22 2009 > New Revision: 193511 > URL: http://svn.freebsd.org/changeset/base/193511 >=20 > Log: > Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENER= IC > and used in a large number of files, but also because an increasing num= ber > of incorrect uses of MAC calls were sneaking in due to copy-and-paste of > MAC-aware code without the associated opt_mac.h include. Note that fs/udf/osta.c uses '#ifdef MAC' to detect Apple Mac, not Mandatory Access Control. It's worth investigating if defining MAC won't break something in there. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --GRPZ8SYKNexpdSJ7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKKaiNForvXbEpPzQRAgehAKCtIVFQUGBvFlXMtiAc1lTjLr4R3QCeMHBW 0ff5YTMhm6HzvBfma/7leHY= =zwzR -----END PGP SIGNATURE----- --GRPZ8SYKNexpdSJ7-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:35:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E2F8106564A; Fri, 5 Jun 2009 23:35:44 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8998FC13; Fri, 5 Jun 2009 23:35:44 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55NZiIm041592; Fri, 5 Jun 2009 23:35:44 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55NZiAk041591; Fri, 5 Jun 2009 23:35:44 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200906052335.n55NZiAk041591@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 5 Jun 2009 23:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193547 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 23:35:44 -0000 Author: pjd Date: Fri Jun 5 23:35:43 2009 New Revision: 193547 URL: http://svn.freebsd.org/changeset/base/193547 Log: Simplify. Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Fri Jun 5 23:27:27 2009 (r193546) +++ head/sys/geom/geom_subr.c Fri Jun 5 23:35:43 2009 (r193547) @@ -522,7 +522,6 @@ g_new_provider_event(void *arg, int flag struct g_class *mp; struct g_provider *pp; struct g_consumer *cp; - int i; g_topology_assert(); if (flag == EV_CANCEL) @@ -536,11 +535,10 @@ g_new_provider_event(void *arg, int flag LIST_FOREACH(mp, &g_classes, class) { if (mp->taste == NULL) continue; - i = 1; LIST_FOREACH(cp, &pp->consumers, consumers) if (cp->geom->class == mp) - i = 0; - if (!i) + break; + if (cp != NULL) continue; mp->taste(mp, pp, 0); g_topology_assert(); From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:36:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 910C61065673; Fri, 5 Jun 2009 23:36:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FAB28FC15; Fri, 5 Jun 2009 23:36:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55NamFN041643; Fri, 5 Jun 2009 23:36:48 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55Namb4041642; Fri, 5 Jun 2009 23:36:48 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906052336.n55Namb4041642@svn.freebsd.org> From: Sam Leffler Date: Fri, 5 Jun 2009 23:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193548 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 23:36:49 -0000 Author: sam Date: Fri Jun 5 23:36:48 2009 New Revision: 193548 URL: http://svn.freebsd.org/changeset/base/193548 Log: reserve ioc's for Greenfield and STBC Modified: head/sys/net80211/ieee80211_ioctl.h Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Fri Jun 5 23:35:43 2009 (r193547) +++ head/sys/net80211/ieee80211_ioctl.h Fri Jun 5 23:36:48 2009 (r193548) @@ -633,6 +633,8 @@ struct ieee80211req { #define IEEE80211_IOC_STA_VLAN 109 /* per-station vlan tag */ #define IEEE80211_IOC_SMPS 110 /* MIMO power save */ #define IEEE80211_IOC_RIFS 111 /* RIFS config (on, off) */ +#define IEEE80211_IOC_GREENFIELD 112 /* Greenfield (on, off) */ +#define IEEE80211_IOC_STBC 113 /* STBC Tx/RX (on, off) */ #define IEEE80211_IOC_TDMA_SLOT 201 /* TDMA: assigned slot */ #define IEEE80211_IOC_TDMA_SLOTCNT 202 /* TDMA: slots in bss */ From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:37:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E651106566C; Fri, 5 Jun 2009 23:37:57 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D2C58FC14; Fri, 5 Jun 2009 23:37:57 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55NbvVw041698; Fri, 5 Jun 2009 23:37:57 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55NbvSO041697; Fri, 5 Jun 2009 23:37:57 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906052337.n55NbvSO041697@svn.freebsd.org> From: Sam Leffler Date: Fri, 5 Jun 2009 23:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193549 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 23:37:58 -0000 Author: sam Date: Fri Jun 5 23:37:57 2009 New Revision: 193549 URL: http://svn.freebsd.org/changeset/base/193549 Log: reserve node flag bits for a-msdu tx/rx Modified: head/sys/net80211/ieee80211_node.h Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Fri Jun 5 23:36:48 2009 (r193548) +++ head/sys/net80211/ieee80211_node.h Fri Jun 5 23:37:57 2009 (r193549) @@ -120,6 +120,8 @@ struct ieee80211_node { #define IEEE80211_NODE_SGI20 0x008000 /* Short GI in HT20 enabled */ #define IEEE80211_NODE_SGI40 0x010000 /* Short GI in HT40 enabled */ #define IEEE80211_NODE_ASSOCID 0x020000 /* xmit requires associd */ +#define IEEE80211_NODE_AMSDU_RX 0x040000 /* AMSDU rx enabled */ +#define IEEE80211_NODE_AMSDU_TX 0x080000 /* AMSDU tx enabled */ uint16_t ni_associd; /* association ID */ uint16_t ni_vlan; /* vlan tag */ uint16_t ni_txpower; /* current transmit power */ @@ -201,11 +203,13 @@ MALLOC_DECLARE(M_80211_NODE_IE); #define IEEE80211_NODE_ATH (IEEE80211_NODE_FF | IEEE80211_NODE_TURBOP) #define IEEE80211_NODE_AMPDU \ (IEEE80211_NODE_AMPDU_RX | IEEE80211_NODE_AMPDU_TX) +#define IEEE80211_NODE_AMSDU \ + (IEEE80211_NODE_AMSDU_RX | IEEE80211_NODE_AMSDU_TX) #define IEEE80211_NODE_HT_ALL \ (IEEE80211_NODE_HT | IEEE80211_NODE_HTCOMPAT | \ - IEEE80211_NODE_AMPDU | IEEE80211_NODE_MIMO_PS | \ - IEEE80211_NODE_MIMO_RTS | IEEE80211_NODE_RIFS | \ - IEEE80211_NODE_SGI20 | IEEE80211_NODE_SGI40) + IEEE80211_NODE_AMPDU | IEEE80211_NODE_AMSDU | \ + IEEE80211_NODE_MIMO_PS | IEEE80211_NODE_MIMO_RTS | \ + IEEE80211_NODE_RIFS | IEEE80211_NODE_SGI20 | IEEE80211_NODE_SGI40) #define IEEE80211_NODE_BITS \ "\20\1AUTH\2QOS\3ERP\5PWR_MGT\6AREF\7HT\10HTCOMPAT\11WPS\12TSN" \ From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:46:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 792C5106566B; Fri, 5 Jun 2009 23:46:10 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206192061.chello.pl [87.206.192.61]) by mx1.freebsd.org (Postfix) with ESMTP id B42CE8FC0A; Fri, 5 Jun 2009 23:46:09 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 12B844569A; Sat, 6 Jun 2009 01:46:08 +0200 (CEST) Received: from localhost (chello087206192061.chello.pl [87.206.192.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E269E45683; Sat, 6 Jun 2009 01:46:02 +0200 (CEST) Date: Sat, 6 Jun 2009 01:46:06 +0200 From: Pawel Jakub Dawidek To: Robert Watson Message-ID: <20090605234606.GC2313@garage.freebsd.pl> References: <200906051455.n55EtMBc029090@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eRtJSFbw+EEWtPj3" Content-Disposition: inline In-Reply-To: <200906051455.n55EtMBc029090@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193511 - in head/sys: compat/linux compat/svr4 conf contrib/pf/net fs/devfs fs/nfsserver fs/unionfs i386/i386 i386/ibcs2 kern net netatalk netinet netinet6 nfsserver security/audit ufs... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 23:46:11 -0000 --eRtJSFbw+EEWtPj3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 05, 2009 at 02:55:22PM +0000, Robert Watson wrote: > Author: rwatson > Date: Fri Jun 5 14:55:22 2009 > New Revision: 193511 > URL: http://svn.freebsd.org/changeset/base/193511 >=20 > Log: > Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENER= IC > and used in a large number of files, but also because an increasing num= ber > of incorrect uses of MAC calls were sneaking in due to copy-and-paste of > MAC-aware code without the associated opt_mac.h include. How about Makefiles in sys/modules/? I don't think we now need opt_mac.h there. The files below include security/mac/mac_framework.h, but I think it is redundant: sys/netinet/ip_mroute.c sys/netinet/ip_options.c sys/compat/linux/linux_stats.c sys/netinet6/in6_pcb.c --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --eRtJSFbw+EEWtPj3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKKa4+ForvXbEpPzQRAjmMAKClMy7sXlPFwOKk4c4mlL4jZUWfmACdHH+N oWTU3Xis8LfBAU/y1X1IFf4= =04w1 -----END PGP SIGNATURE----- --eRtJSFbw+EEWtPj3-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:53:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AB3F1065706; Fri, 5 Jun 2009 23:53:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E89C8FC14; Fri, 5 Jun 2009 23:53:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n55NrHtY042007; Fri, 5 Jun 2009 23:53:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n55NrHvF042004; Fri, 5 Jun 2009 23:53:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200906052353.n55NrHvF042004@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 5 Jun 2009 23:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193550 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 23:53:17 -0000 Author: pjd Date: Fri Jun 5 23:53:17 2009 New Revision: 193550 URL: http://svn.freebsd.org/changeset/base/193550 Log: Only four out of nine arguments for ip_ipsec_output() are actually used. Kill unused arguments except for 'ifp' as it might be used in the future for detecting IPsec-capable interfaces. Modified: head/sys/netinet/ip_ipsec.c head/sys/netinet/ip_ipsec.h head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Fri Jun 5 23:37:57 2009 (r193549) +++ head/sys/netinet/ip_ipsec.c Fri Jun 5 23:53:17 2009 (r193550) @@ -256,8 +256,7 @@ ip_ipsec_mtu(struct mbuf *m, int mtu) */ int ip_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error, - struct route **ro, struct route *iproute, struct sockaddr_in **dst, - struct in_ifaddr **ia, struct ifnet **ifp) + struct ifnet **ifp) { #ifdef IPSEC struct secpolicy *sp = NULL; Modified: head/sys/netinet/ip_ipsec.h ============================================================================== --- head/sys/netinet/ip_ipsec.h Fri Jun 5 23:37:57 2009 (r193549) +++ head/sys/netinet/ip_ipsec.h Fri Jun 5 23:53:17 2009 (r193550) @@ -37,6 +37,5 @@ int ip_ipsec_fwd(struct mbuf *); int ip_ipsec_input(struct mbuf *); int ip_ipsec_mtu(struct mbuf *, int); int ip_ipsec_output(struct mbuf **, struct inpcb *, int *, int *, - struct route **, struct route *, struct sockaddr_in **, - struct in_ifaddr **, struct ifnet **); + struct ifnet **); #endif Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Jun 5 23:37:57 2009 (r193549) +++ head/sys/netinet/ip_output.c Fri Jun 5 23:53:17 2009 (r193550) @@ -467,7 +467,7 @@ again: sendit: #ifdef IPSEC - switch(ip_ipsec_output(&m, inp, &flags, &error, &ro, &iproute, &dst, &ia, &ifp)) { + switch(ip_ipsec_output(&m, inp, &flags, &error, &ifp)) { case 1: goto bad; case -1: From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 00:32:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 357BF106566C; Sat, 6 Jun 2009 00:32:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 098808FC14; Sat, 6 Jun 2009 00:32:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n560WFa9042931; Sat, 6 Jun 2009 00:32:15 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n560WFsT042930; Sat, 6 Jun 2009 00:32:15 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906060032.n560WFsT042930@svn.freebsd.org> From: Sam Leffler Date: Sat, 6 Jun 2009 00:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193554 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 00:32:16 -0000 Author: sam Date: Sat Jun 6 00:32:15 2009 New Revision: 193554 URL: http://svn.freebsd.org/changeset/base/193554 Log: o add bits for STBC and Greenfield o fix some comments Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat Jun 6 00:26:49 2009 (r193553) +++ head/sys/net80211/ieee80211_var.h Sat Jun 6 00:32:15 2009 (r193554) @@ -536,24 +536,27 @@ MALLOC_DECLARE(M_80211_VAP); /* NB: immutable: should be set only when creating a vap */ #define IEEE80211_FEXT_WDSLEGACY 0x00010000 /* CONF: legacy WDS operation */ #define IEEE80211_FEXT_PROBECHAN 0x00020000 /* CONF: probe passive channel*/ +#define IEEE80211_FEXT_GF 0x00040000 /* CONF: Greenfield enabled */ #define IEEE80211_FEXT_HT 0x00080000 /* CONF: HT supported */ #define IEEE80211_FEXT_AMPDU_TX 0x00100000 /* CONF: A-MPDU tx supported */ -#define IEEE80211_FEXT_AMPDU_RX 0x00200000 /* CONF: A-MPDU tx supported */ +#define IEEE80211_FEXT_AMPDU_RX 0x00200000 /* CONF: A-MPDU rx supported */ #define IEEE80211_FEXT_AMSDU_TX 0x00400000 /* CONF: A-MSDU tx supported */ -#define IEEE80211_FEXT_AMSDU_RX 0x00800000 /* CONF: A-MSDU tx supported */ +#define IEEE80211_FEXT_AMSDU_RX 0x00800000 /* CONF: A-MSDU rx supported */ #define IEEE80211_FEXT_USEHT40 0x01000000 /* CONF: 20/40 use enabled */ #define IEEE80211_FEXT_PUREN 0x02000000 /* CONF: 11n w/o legacy sta's */ #define IEEE80211_FEXT_SHORTGI20 0x04000000 /* CONF: short GI in HT20 */ #define IEEE80211_FEXT_SHORTGI40 0x08000000 /* CONF: short GI in HT40 */ #define IEEE80211_FEXT_HTCOMPAT 0x10000000 /* CONF: HT vendor OUI's */ #define IEEE80211_FEXT_RIFS 0x20000000 /* CONF: RIFS enabled */ +#define IEEE80211_FEXT_STBC_TX 0x40000000 /* CONF: STBC tx enabled */ +#define IEEE80211_FEXT_STBC_RX 0x80000000 /* CONF: STBC rx enabled */ #define IEEE80211_FEXT_BITS \ "\20\1NONHT_PR\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \ "\0114ADDR\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\16STATEWAIT\17REINIT" \ - "\20BPF\21WDSLEGACY\22PROBECHAN\24HT\25AMDPU_TX\26AMPDU_TX\27AMSDU_TX" \ - "\30AMSDU_RX\31USEHT40\32PUREN\33SHORTGI20\34SHORTGI40\35HTCOMPAT" \ - "\36RIFS" + "\20BPF\21WDSLEGACY\22PROBECHAN\23GF\24HT\25AMDPU_TX\26AMPDU_TX" \ + "\27AMSDU_TX\30AMSDU_RX\31USEHT40\32PUREN\33SHORTGI20\34SHORTGI40" \ + "\35HTCOMPAT\36RIFS\37STBC_TX\40STBC_RX" #define IEEE80211_FVEN_BITS "\20" From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 00:44:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DBC7106564A; Sat, 6 Jun 2009 00:44:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B7058FC16; Sat, 6 Jun 2009 00:44:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n560iEvc043226; Sat, 6 Jun 2009 00:44:14 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n560iEeh043225; Sat, 6 Jun 2009 00:44:14 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906060044.n560iEeh043225@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 6 Jun 2009 00:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193556 - head/sys/fs/pseudofs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 00:44:14 -0000 Author: des Date: Sat Jun 6 00:44:13 2009 New Revision: 193556 URL: http://svn.freebsd.org/changeset/base/193556 Log: Drop Giant. MFC after: 1 week Modified: head/sys/fs/pseudofs/pseudofs_vncache.c Modified: head/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vncache.c Sat Jun 6 00:38:15 2009 (r193555) +++ head/sys/fs/pseudofs/pseudofs_vncache.c Sat Jun 6 00:44:13 2009 (r193556) @@ -270,13 +270,13 @@ pfs_vncache_free(struct vnode *vp) * The only way to improve this situation is to change the data structure * used to implement the cache. */ -void -pfs_purge(struct pfs_node *pn) +static void +pfs_purge_locked(struct pfs_node *pn) { struct pfs_vdata *pvd; struct vnode *vnp; - mtx_lock(&pfs_vncache_mutex); + mtx_assert(&pfs_vncache_mutex, MA_OWNED); pvd = pfs_vncache; while (pvd != NULL) { if (pvd->pvd_dead || (pn != NULL && pvd->pvd_pn == pn)) { @@ -286,22 +286,26 @@ pfs_purge(struct pfs_node *pn) VOP_LOCK(vnp, LK_EXCLUSIVE); vgone(vnp); VOP_UNLOCK(vnp, 0); - vdrop(vnp); mtx_lock(&pfs_vncache_mutex); + vdrop(vnp); pvd = pfs_vncache; } else { pvd = pvd->pvd_next; } } +} + +void +pfs_purge(struct pfs_node *pn) +{ + + mtx_lock(&pfs_vncache_mutex); + pfs_purge_locked(pn); mtx_unlock(&pfs_vncache_mutex); } /* * Free all vnodes associated with a defunct process - * - * XXXRW: It is unfortunate that pfs_exit() always acquires and releases two - * mutexes (one of which is Giant) for every process exit, even if procfs - * isn't mounted. */ static void pfs_exit(void *arg, struct proc *p) @@ -311,13 +315,11 @@ pfs_exit(void *arg, struct proc *p) if (pfs_vncache == NULL) return; - mtx_lock(&Giant); mtx_lock(&pfs_vncache_mutex); for (pvd = pfs_vncache, dead = 0; pvd != NULL; pvd = pvd->pvd_next) if (pvd->pvd_pid == p->p_pid) dead = pvd->pvd_dead = 1; - mtx_unlock(&pfs_vncache_mutex); if (dead) - pfs_purge(NULL); - mtx_unlock(&Giant); + pfs_purge_locked(NULL); + mtx_unlock(&pfs_vncache_mutex); } From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 00:49:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C9BE106564A; Sat, 6 Jun 2009 00:49:49 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A44E8FC14; Sat, 6 Jun 2009 00:49:49 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n560nn69043379; Sat, 6 Jun 2009 00:49:49 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n560nnjb043378; Sat, 6 Jun 2009 00:49:49 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906060049.n560nnjb043378@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 6 Jun 2009 00:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193557 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 00:49:50 -0000 Author: des Date: Sat Jun 6 00:49:49 2009 New Revision: 193557 URL: http://svn.freebsd.org/changeset/base/193557 Log: Eliminate trailing_slash, which was made redundant in r193028. Remove a couple of 4-year-old "temporary" KASSERTs. Improve comments. MFC after: 1 week Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Jun 6 00:44:13 2009 (r193556) +++ head/sys/kern/vfs_lookup.c Sat Jun 6 00:49:49 2009 (r193557) @@ -453,7 +453,6 @@ lookup(struct nameidata *ndp) int docache; /* == 0 do not cache last component */ int wantparent; /* 1 => wantparent or lockparent flag */ int rdonly; /* lookup read-only flag bit */ - int trailing_slash; int error = 0; int dpunlocked = 0; /* dp has already been unlocked */ struct componentname *cnp = &ndp->ni_cnd; @@ -528,13 +527,11 @@ dirloop: * trailing slashes to handle symlinks, existing non-directories * and non-existing files that won't be directories specially later. */ - trailing_slash = 0; while (*cp == '/' && (cp[1] == '/' || cp[1] == '\0')) { cp++; ndp->ni_pathlen--; if (*cp == '\0') { - trailing_slash = 1; - *ndp->ni_next = '\0'; /* XXX for direnter() ... */ + *ndp->ni_next = '\0'; cnp->cn_flags |= TRAILINGSLASH; } } @@ -703,27 +700,24 @@ unionlookup: if (error != EJUSTRETURN) goto bad; /* - * If creating and at end of pathname, then can consider - * allowing file to be created. + * At this point, we know we're at the end of the + * pathname. If creating / renaming, we can consider + * allowing the file or directory to be created / renamed, + * provided we're not on a read-only filesystem. */ if (rdonly) { error = EROFS; goto bad; } - if (*cp == '\0' && trailing_slash && - !(cnp->cn_flags & WILLBEDIR)) { + /* trailing slash only allowed for directories */ + if ((cnp->cn_flags & TRAILINGSLASH) && + !(cnp->cn_flags & WILLBEDIR)) { error = ENOENT; goto bad; } if ((cnp->cn_flags & LOCKPARENT) == 0) VOP_UNLOCK(dp, 0); /* - * This is a temporary assert to make sure I know what the - * behavior here was. - */ - KASSERT((cnp->cn_flags & (WANTPARENT|LOCKPARENT)) != 0, - ("lookup: Unhandled case.")); - /* * We return with ni_vp NULL to indicate that the entry * doesn't currently exist, leaving a pointer to the * (possibly locked) directory vnode in ndp->ni_dvp. @@ -787,7 +781,7 @@ unionlookup: * Check for symbolic link */ if ((dp->v_type == VLNK) && - ((cnp->cn_flags & FOLLOW) || trailing_slash || + ((cnp->cn_flags & FOLLOW) || (cnp->cn_flags & TRAILINGSLASH) || *ndp->ni_next == '/')) { cnp->cn_flags |= ISSYMLINK; if (dp->v_iflag & VI_DOOMED) { @@ -812,8 +806,8 @@ unionlookup: nextname: /* - * Not a symbolic link. If more pathname, - * continue at next component, else return. + * Not a symbolic link that we will follow. Continue with the + * next component if there is any; otherwise, we're done. */ KASSERT((cnp->cn_flags & ISLASTCN) || *ndp->ni_next == '/', ("lookup: invalid path state.")); @@ -990,12 +984,6 @@ relookup(struct vnode *dvp, struct vnode if ((cnp->cn_flags & LOCKPARENT) == 0) VOP_UNLOCK(dp, 0); /* - * This is a temporary assert to make sure I know what the - * behavior here was. - */ - KASSERT((cnp->cn_flags & (WANTPARENT|LOCKPARENT)) != 0, - ("relookup: Unhandled case.")); - /* * We return with ni_vp NULL to indicate that the entry * doesn't currently exist, leaving a pointer to the * (possibly locked) directory vnode in ndp->ni_dvp. From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 07:13:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2B4F1065695; Sat, 6 Jun 2009 07:13:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C062E8FC19; Sat, 6 Jun 2009 07:13:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n567DvR1051741; Sat, 6 Jun 2009 07:13:57 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n567DvVF051740; Sat, 6 Jun 2009 07:13:57 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906060713.n567DvVF051740@svn.freebsd.org> From: Robert Watson Date: Sat, 6 Jun 2009 07:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193571 - head/sys/fs/udf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 07:13:58 -0000 Author: rwatson Date: Sat Jun 6 07:13:57 2009 New Revision: 193571 URL: http://svn.freebsd.org/changeset/base/193571 Log: Use #ifdef APPLE_MAC instead of #ifdef MAC to conditionalize Apple-specific behavior for unicode support in UDF so as not to conflict with the MAC Framework. Note that Apple's XNU kernel also uses #ifdef MAC for the MAC Framework. Suggested by: pjd MFC after: 3 days Modified: head/sys/fs/udf/osta.c Modified: head/sys/fs/udf/osta.c ============================================================================== --- head/sys/fs/udf/osta.c Sat Jun 6 06:44:13 2009 (r193570) +++ head/sys/fs/udf/osta.c Sat Jun 6 07:13:57 2009 (r193571) @@ -280,7 +280,7 @@ main() * Define MAXLEN = 255 * * Macintosh: - * Define MAC. + * Define APPLE_MAC. * Define MAXLEN = 31. * * UNIX @@ -484,7 +484,7 @@ int UnicodeInString( */ int IsIllegal(unicode_t ch) { -#ifdef MAC +#ifdef APPLE_MAC /* Only illegal character on the MAC is the colon. */ if (ch == 0x003A) { return(1); From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 09:20:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ECCB1065670; Sat, 6 Jun 2009 09:20:02 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id CEFD38FC1A; Sat, 6 Jun 2009 09:20:01 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from a91-153-125-115.elisa-laajakaista.fi (a91-153-125-115.elisa-laajakaista.fi [91.153.125.115]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id EA694139712; Sat, 6 Jun 2009 12:01:41 +0300 (EEST) Date: Sat, 6 Jun 2009 12:01:41 +0300 From: Jaakko Heinonen To: Paul Saab Message-ID: <20090606090141.GA805@a91-153-125-115.elisa-laajakaista.fi> References: <200906041618.n54GI851097005@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906041618.n54GI851097005@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193440 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 09:20:02 -0000 Hi, On 2009-06-04, Paul Saab wrote: > Support shared vnode locks for write operations when the offset is > provided on filesystems that support it. This really improves mysql > + innodb performance on ZFS. The panic below looks related to this commit. I think the assert is only enabled when DEBUG_VFS_LOCKS is defined. VOP_WRITE: 0xc3b89218 is not exclusive locked but should be KDB: enter: lock violation [thread pid 163 tid 100079 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> bt Tracing pid 163 tid 100079 td 0xc3ba4d80 kdb_enter(c0c460df,c0c460d0,c3b89218,c0c46a4a,c3b89218,...) at kdb_enter+0x3a vfs_badlock(c3a4d7e0,e84025d0,c0d55220,c3b89218) at vfs_badlock+0x61 assert_vop_elocked(c3b89218,c0c7419a,200400,c3b89270,c3b89218,...) at assert_vop_elocked+0x55 VOP_WRITE_APV(c3a4d7e0,e84026b4,c0c47289,183,0,...) at VOP_WRITE_APV+0x98 vn_rdwr(1,c3b89218,c3f3e0c0,2ff4,0,...) at vn_rdwr+0x18e zfs_replay_write(c38ba800,c3f3e000,0,80090502,0,...) at zfs_replay_write+0xf2 zil_replay_log_record(c3e2d800,c3dd9070,e84028e8,2fe0,0,...) at zil_replay_log_record+0x136 zil_parse(c3e2d800,c39c6eb0,c39c7260,e84028e8,2fe0,...) at zil_parse+0x1f7 zil_replay(c3b880b0,c38ba800,c38ba824,c3a4d3c0,c39d76e0,...) at zil_replay+0x184 zfsvfs_setup(c3b880b0,e84029fc,2,c38ba808,c3ba4d80,...) at zfsvfs_setup+0xec zfs_mount(c38bd78c,0,c0c45694,3d3,0,...) at zfs_mount+0x791 vfs_donmount(c3ba4d80,0,c38c5880,c38c5880,280c8f70,...) at vfs_donmount+0x100b nmount(c3ba4d80,e8402cf8,c,c0c3f440,c0d1ed78,...) at nmount+0x72 syscall(e8402d38) at syscall+0x2a3 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (378, FreeBSD ELF32, nmount), eip = 0x28173c2b, esp = 0xbfbfd00c, ebp = 0xbfbfd048 --- db> show vnode 0xc3b89218 vnode 0xc3b89218: tag zfs, type VREG usecount 1, writecount 0, refcount 1 mountedhere 0 flags () lock type zfs: SHARED (count 1) -- Jaakko From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 09:33:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B43B71065670; Sat, 6 Jun 2009 09:33:32 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1B2E8FC2A; Sat, 6 Jun 2009 09:33:32 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n569XWZ0054747; Sat, 6 Jun 2009 09:33:32 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n569XWEu054745; Sat, 6 Jun 2009 09:33:32 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200906060933.n569XWEu054745@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 6 Jun 2009 09:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193578 - in head/sys/powerpc: include powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 09:33:33 -0000 Author: raj Date: Sat Jun 6 09:33:32 2009 New Revision: 193578 URL: http://svn.freebsd.org/changeset/base/193578 Log: Provide 64-bit big endian bus space operations for PowerPC. They are required for the upcoming sec(4) driver. Submitted by: Piotr Ziecik Obtained from: Semihalf Modified: head/sys/powerpc/include/pio.h head/sys/powerpc/powerpc/bus_machdep.c Modified: head/sys/powerpc/include/pio.h ============================================================================== --- head/sys/powerpc/include/pio.h Sat Jun 6 08:22:12 2009 (r193577) +++ head/sys/powerpc/include/pio.h Sat Jun 6 09:33:32 2009 (r193578) @@ -61,6 +61,13 @@ __outl(volatile u_int32_t *a, u_int32_t } static __inline void +__outll(volatile u_int64_t *a, u_int64_t v) +{ + *a = v; + __asm__ volatile("eieio; sync"); +} + +static __inline void __outwrb(volatile u_int16_t *a, u_int16_t v) { __asm__ volatile("sthbrx %0, 0, %1" :: "r"(v), "r"(a)); @@ -104,6 +111,16 @@ __inl(volatile u_int32_t *a) return _v_; } +static __inline u_int64_t +__inll(volatile u_int64_t *a) +{ + u_int64_t _v_; + + _v_ = *a; + __asm__ volatile("eieio; sync"); + return _v_; +} + static __inline u_int16_t __inwrb(volatile u_int16_t *a) { @@ -130,12 +147,16 @@ __inlrb(volatile u_int32_t *a) #define out16(a,v) outw(a,v) #define outl(a,v) (__outl((volatile u_int32_t *)(a), v)) #define out32(a,v) outl(a,v) +#define outll(a,v) (__outll((volatile u_int64_t *)(a), v)) +#define out64(a,v) outll(a,v) #define inb(a) (__inb((volatile u_int8_t *)(a))) #define in8(a) inb(a) #define inw(a) (__inw((volatile u_int16_t *)(a))) #define in16(a) inw(a) #define inl(a) (__inl((volatile u_int32_t *)(a))) #define in32(a) inl(a) +#define inll(a) (__inll((volatile u_int64_t *)(a))) +#define in64(a) inll(a) #define out8rb(a,v) outb(a,v) #define outwrb(a,v) (__outwrb((volatile u_int16_t *)(a), v)) @@ -174,6 +195,14 @@ __outsl(volatile u_int32_t *a, const u_i } static __inline void +__outsll(volatile u_int64_t *a, const u_int64_t *s, size_t c) +{ + while (c--) + *a = *s++; + __asm__ volatile("eieio; sync"); +} + +static __inline void __outswrb(volatile u_int16_t *a, const u_int16_t *s, size_t c) { while (c--) @@ -214,6 +243,14 @@ __insl(volatile u_int32_t *a, u_int32_t } static __inline void +__insll(volatile u_int64_t *a, u_int64_t *d, size_t c) +{ + while (c--) + *d++ = *a; + __asm__ volatile("eieio; sync"); +} + +static __inline void __inswrb(volatile u_int16_t *a, u_int16_t *d, size_t c) { while (c--) @@ -235,12 +272,16 @@ __inslrb(volatile u_int32_t *a, u_int32_ #define outs16(a,s,c) outsw(a,s,c) #define outsl(a,s,c) (__outsl((volatile u_int32_t *)(a), s, c)) #define outs32(a,s,c) outsl(a,s,c) +#define outsll(a,s,c) (__outsll((volatile u_int64_t *)(a), s, c)) +#define outs64(a,s,c) outsll(a,s,c) #define insb(a,d,c) (__insb((volatile u_int8_t *)(a), d, c)) #define ins8(a,d,c) insb(a,d,c) #define insw(a,d,c) (__insw((volatile u_int16_t *)(a), d, c)) #define ins16(a,d,c) insw(a,d,c) #define insl(a,d,c) (__insl((volatile u_int32_t *)(a), d, c)) #define ins32(a,d,c) insl(a,d,c) +#define insll(a,d,c) (__insll((volatile u_int64_t *)(a), d, c)) +#define ins64(a,d,c) insll(a,d,c) #define outs8rb(a,s,c) outsb(a,s,c) #define outswrb(a,s,c) (__outswrb((volatile u_int16_t *)(a), s, c)) Modified: head/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/bus_machdep.c Sat Jun 6 08:22:12 2009 (r193577) +++ head/sys/powerpc/powerpc/bus_machdep.c Sat Jun 6 09:33:32 2009 (r193578) @@ -190,7 +190,12 @@ bs_be_rs_4(bus_space_handle_t bsh, bus_s static uint64_t bs_be_rs_8(bus_space_handle_t bsh, bus_size_t ofs) { - TODO; + volatile uint64_t *addr; + uint64_t res; + + addr = __ppc_ba(bsh, ofs); + res = *addr; + return (res); } static void @@ -212,9 +217,9 @@ bs_be_rm_4(bus_space_handle_t bsh, bus_s } static void -bs_be_rm_8(bus_space_handle_t bshh, bus_size_t ofs, uint64_t *addr, size_t cnt) +bs_be_rm_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) { - TODO; + ins64(__ppc_ba(bsh, ofs), addr, cnt); } static void @@ -250,7 +255,11 @@ bs_be_rr_4(bus_space_handle_t bsh, bus_s static void bs_be_rr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) { - TODO; + volatile uint64_t *s = __ppc_ba(bsh, ofs); + + while (cnt--) + *addr++ = *s++; + __asm __volatile("eieio; sync"); } static void @@ -286,7 +295,10 @@ bs_be_ws_4(bus_space_handle_t bsh, bus_s static void bs_be_ws_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val) { - TODO; + volatile uint64_t *addr; + + addr = __ppc_ba(bsh, ofs); + *addr = val; } static void @@ -314,7 +326,7 @@ static void bs_be_wm_8(bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *addr, bus_size_t cnt) { - TODO; + outsll(__ppc_ba(bsh, ofs), addr, cnt); } static void @@ -354,7 +366,11 @@ static void bs_be_wr_8(bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *addr, size_t cnt) { - TODO; + volatile uint64_t *d = __ppc_ba(bsh, ofs); + + while (cnt--) + *d++ = *addr++; + __asm __volatile("eieio; sync"); } static void @@ -390,7 +406,11 @@ bs_be_sm_4(bus_space_handle_t bsh, bus_s static void bs_be_sm_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t cnt) { - TODO; + volatile uint64_t *d = __ppc_ba(bsh, ofs); + + while (cnt--) + *d = val; + __asm __volatile("eieio; sync"); } static void @@ -426,7 +446,11 @@ bs_be_sr_4(bus_space_handle_t bsh, bus_s static void bs_be_sr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t cnt) { - TODO; + volatile uint64_t *d = __ppc_ba(bsh, ofs); + + while (cnt--) + *d++ = val; + __asm __volatile("eieio; sync"); } /* From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 09:37:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8588310656A8; Sat, 6 Jun 2009 09:37:56 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70E5A8FC1E; Sat, 6 Jun 2009 09:37:56 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n569bt9K054861; Sat, 6 Jun 2009 09:37:55 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n569btBr054858; Sat, 6 Jun 2009 09:37:55 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200906060937.n569btBr054858@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 6 Jun 2009 09:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193579 - in head/sys: conf dev/sec powerpc/conf powerpc/include powerpc/mpc85xx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 09:37:57 -0000 Author: raj Date: Sat Jun 6 09:37:55 2009 New Revision: 193579 URL: http://svn.freebsd.org/changeset/base/193579 Log: Initial version of the sec(4) driver for the integrated security engine found in Freescale system-on-chip devices. The following algorithms and schemes are currently supported: - 3DES, AES, DES - MD5, SHA1, SHA256, SHA384, SHA512 Reviewed by: philip Obtained from: Freescale, Semihalf Added: head/sys/dev/sec/ head/sys/dev/sec/sec.c (contents, props changed) head/sys/dev/sec/sec.h (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/conf/MPC85XX head/sys/powerpc/include/ocpbus.h head/sys/powerpc/mpc85xx/ocpbus.c head/sys/powerpc/mpc85xx/ocpbus.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Jun 6 09:33:32 2009 (r193578) +++ head/sys/conf/files.powerpc Sat Jun 6 09:37:55 2009 (r193579) @@ -39,6 +39,7 @@ dev/ofw/ofw_standard.c optional aim dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_ocp.c optional quicc mpc85xx dev/scc/scc_bfe_macio.c optional scc powermac +dev/sec/sec.c optional sec mpc85xx dev/sound/macio/aoa.c optional snd_davbus | snd_ai2s powermac dev/sound/macio/davbus.c optional snd_davbus powermac dev/sound/macio/i2s.c optional snd_ai2s powermac Added: head/sys/dev/sec/sec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sec/sec.c Sat Jun 6 09:37:55 2009 (r193579) @@ -0,0 +1,1875 @@ +/*- + * Copyright (C) 2008-2009 Semihalf, Piotr Ziecik + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Freescale integrated Security Engine (SEC) driver. Currently SEC 2.0 and + * 3.0 are supported. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include "cryptodev_if.h" + +#include + +static int sec_probe(device_t dev); +static int sec_attach(device_t dev); +static int sec_detach(device_t dev); +static int sec_suspend(device_t dev); +static int sec_resume(device_t dev); +static void sec_shutdown(device_t dev); +static void sec_primary_intr(void *arg); +static void sec_secondary_intr(void *arg); +static int sec_setup_intr(struct sec_softc *sc, struct resource **ires, + void **ihand, int *irid, driver_intr_t handler, const char *iname); +static void sec_release_intr(struct sec_softc *sc, struct resource *ires, + void *ihand, int irid, const char *iname); +static int sec_controller_reset(struct sec_softc *sc); +static int sec_channel_reset(struct sec_softc *sc, int channel, int full); +static int sec_init(struct sec_softc *sc); +static int sec_alloc_dma_mem(struct sec_softc *sc, + struct sec_dma_mem *dma_mem, bus_size_t size); +static int sec_desc_map_dma(struct sec_softc *sc, + struct sec_dma_mem *dma_mem, void *mem, bus_size_t size, int type, + struct sec_desc_map_info *sdmi); +static void sec_free_dma_mem(struct sec_dma_mem *dma_mem); +static void sec_enqueue(struct sec_softc *sc); +static int sec_enqueue_desc(struct sec_softc *sc, struct sec_desc *desc, + int channel); +static int sec_eu_channel(struct sec_softc *sc, int eu); +static int sec_make_pointer(struct sec_softc *sc, struct sec_desc *desc, + u_int n, void *data, bus_size_t doffset, bus_size_t dsize, int dtype); +static int sec_make_pointer_direct(struct sec_softc *sc, + struct sec_desc *desc, u_int n, bus_addr_t data, bus_size_t dsize); +static int sec_alloc_session(struct sec_softc *sc); +static int sec_newsession(device_t dev, u_int32_t *sidp, + struct cryptoini *cri); +static int sec_freesession(device_t dev, uint64_t tid); +static int sec_process(device_t dev, struct cryptop *crp, int hint); +static int sec_split_cri(struct cryptoini *cri, struct cryptoini **enc, + struct cryptoini **mac); +static int sec_split_crp(struct cryptop *crp, struct cryptodesc **enc, + struct cryptodesc **mac); +static int sec_build_common_ns_desc(struct sec_softc *sc, + struct sec_desc *desc, struct sec_session *ses, struct cryptop *crp, + struct cryptodesc *enc, int buftype); +static int sec_build_common_s_desc(struct sec_softc *sc, + struct sec_desc *desc, struct sec_session *ses, struct cryptop *crp, + struct cryptodesc *enc, struct cryptodesc *mac, int buftype); + +static struct sec_session *sec_get_session(struct sec_softc *sc, u_int sid); +static struct sec_desc *sec_find_desc(struct sec_softc *sc, bus_addr_t paddr); + +/* AESU */ +static int sec_aesu_newsession(struct sec_softc *sc, + struct sec_session *ses, struct cryptoini *enc, struct cryptoini *mac); +static int sec_aesu_make_desc(struct sec_softc *sc, + struct sec_session *ses, struct sec_desc *desc, struct cryptop *crp, + int buftype); + +/* DEU */ +static int sec_deu_newsession(struct sec_softc *sc, + struct sec_session *ses, struct cryptoini *enc, struct cryptoini *mac); +static int sec_deu_make_desc(struct sec_softc *sc, + struct sec_session *ses, struct sec_desc *desc, struct cryptop *crp, + int buftype); + +/* MDEU */ +static int sec_mdeu_can_handle(u_int alg); +static int sec_mdeu_config(struct cryptodesc *crd, + u_int *eu, u_int *mode, u_int *hashlen); +static int sec_mdeu_newsession(struct sec_softc *sc, + struct sec_session *ses, struct cryptoini *enc, struct cryptoini *mac); +static int sec_mdeu_make_desc(struct sec_softc *sc, + struct sec_session *ses, struct sec_desc *desc, struct cryptop *crp, + int buftype); + +static device_method_t sec_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, sec_probe), + DEVMETHOD(device_attach, sec_attach), + DEVMETHOD(device_detach, sec_detach), + + DEVMETHOD(device_suspend, sec_suspend), + DEVMETHOD(device_resume, sec_resume), + DEVMETHOD(device_shutdown, sec_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_driver_added, bus_generic_driver_added), + + /* Crypto methods */ + DEVMETHOD(cryptodev_newsession, sec_newsession), + DEVMETHOD(cryptodev_freesession,sec_freesession), + DEVMETHOD(cryptodev_process, sec_process), + + { 0, 0 } +}; +static driver_t sec_driver = { + "sec", + sec_methods, + sizeof(struct sec_softc), +}; + +static devclass_t sec_devclass; +DRIVER_MODULE(sec, ocpbus, sec_driver, sec_devclass, 0, 0); +MODULE_DEPEND(sec, crypto, 1, 1, 1); + +static struct sec_eu_methods sec_eus[] = { + { + sec_aesu_newsession, + sec_aesu_make_desc, + }, + { + sec_deu_newsession, + sec_deu_make_desc, + }, + { + sec_mdeu_newsession, + sec_mdeu_make_desc, + }, + { NULL, NULL } +}; + +static inline void +sec_sync_dma_mem(struct sec_dma_mem *dma_mem, bus_dmasync_op_t op) +{ + + /* Sync only if dma memory is valid */ + if (dma_mem->dma_vaddr != NULL) + bus_dmamap_sync(dma_mem->dma_tag, dma_mem->dma_map, op); +} + +static inline void +sec_free_session(struct sec_softc *sc, struct sec_session *ses) +{ + + SEC_LOCK(sc, sessions); + ses->ss_used = 0; + SEC_UNLOCK(sc, sessions); +} + +static inline void * +sec_get_pointer_data(struct sec_desc *desc, u_int n) +{ + + return (desc->sd_ptr_dmem[n].dma_vaddr); +} + +static int +sec_probe(device_t dev) +{ + struct sec_softc *sc; + device_t parent; + uintptr_t devtype; + uint64_t id; + int error; + + parent = device_get_parent(dev); + error = BUS_READ_IVAR(parent, dev, OCPBUS_IVAR_DEVTYPE, &devtype); + if (error) + return (error); + + if (devtype != OCPBUS_DEVTYPE_SEC) + return (ENXIO); + + sc = device_get_softc(dev); + + sc->sc_rrid = 0; + sc->sc_rres = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->sc_rrid, + 0ul, ~0ul, SEC_IO_SIZE, RF_ACTIVE); + + if (sc->sc_rres == NULL) + return (ENXIO); + + sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres); + sc->sc_bas.bst = rman_get_bustag(sc->sc_rres); + + id = SEC_READ(sc, SEC_ID); + + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rrid, sc->sc_rres); + + switch (id) { + case SEC_20_ID: + device_set_desc(dev, "Freescale Security Engine 2.0"); + sc->sc_version = 2; + break; + case SEC_30_ID: + device_set_desc(dev, "Freescale Security Engine 3.0"); + sc->sc_version = 3; + break; + default: + device_printf(dev, "unknown SEC ID 0x%016llx!\n", id); + return (ENXIO); + } + + return (0); +} + +static int +sec_attach(device_t dev) +{ + struct sec_softc *sc; + struct sec_hw_lt *lt; + int error = 0; + int i; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_blocked = 0; + sc->sc_shutdown = 0; + + sc->sc_cid = crypto_get_driverid(dev, CRYPTOCAP_F_HARDWARE); + if (sc->sc_cid < 0) { + device_printf(dev, "could not get crypto driver ID!\n"); + return (ENXIO); + } + + /* Init locks */ + mtx_init(&sc->sc_controller_lock, device_get_nameunit(dev), + "SEC Controller lock", MTX_DEF); + mtx_init(&sc->sc_descriptors_lock, device_get_nameunit(dev), + "SEC Descriptors lock", MTX_DEF); + mtx_init(&sc->sc_sessions_lock, device_get_nameunit(dev), + "SEC Sessions lock", MTX_DEF); + + /* Allocate I/O memory for SEC registers */ + sc->sc_rrid = 0; + sc->sc_rres = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->sc_rrid, + 0ul, ~0ul, SEC_IO_SIZE, RF_ACTIVE); + + if (sc->sc_rres == NULL) { + device_printf(dev, "could not allocate I/O memory!\n"); + goto fail1; + } + + sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres); + sc->sc_bas.bst = rman_get_bustag(sc->sc_rres); + + /* Setup interrupts */ + sc->sc_pri_irid = 0; + error = sec_setup_intr(sc, &sc->sc_pri_ires, &sc->sc_pri_ihand, + &sc->sc_pri_irid, sec_primary_intr, "primary"); + + if (error) + goto fail2; + + sc->sc_sec_irid = 1; + error = sec_setup_intr(sc, &sc->sc_sec_ires, &sc->sc_sec_ihand, + &sc->sc_sec_irid, sec_secondary_intr, "secondary"); + + if (error) + goto fail3; + + /* Alloc DMA memory for descriptors and link tables */ + error = sec_alloc_dma_mem(sc, &(sc->sc_desc_dmem), + SEC_DESCRIPTORS * sizeof(struct sec_hw_desc)); + + if (error) + goto fail4; + + error = sec_alloc_dma_mem(sc, &(sc->sc_lt_dmem), + (SEC_LT_ENTRIES + 1) * sizeof(struct sec_hw_lt)); + + if (error) + goto fail5; + + /* Fill in descriptors and link tables */ + for (i = 0; i < SEC_DESCRIPTORS; i++) { + sc->sc_desc[i].sd_desc = + (struct sec_hw_desc*)(sc->sc_desc_dmem.dma_vaddr) + i; + sc->sc_desc[i].sd_desc_paddr = sc->sc_desc_dmem.dma_paddr + + (i * sizeof(struct sec_hw_desc)); + } + + for (i = 0; i < SEC_LT_ENTRIES + 1; i++) { + sc->sc_lt[i].sl_lt = + (struct sec_hw_lt*)(sc->sc_lt_dmem.dma_vaddr) + i; + sc->sc_lt[i].sl_lt_paddr = sc->sc_lt_dmem.dma_paddr + + (i * sizeof(struct sec_hw_lt)); + } + + /* Last entry in link table is used to create a circle */ + lt = sc->sc_lt[SEC_LT_ENTRIES].sl_lt; + lt->shl_length = 0; + lt->shl_r = 0; + lt->shl_n = 1; + lt->shl_ptr = sc->sc_lt[0].sl_lt_paddr; + + /* Init descriptor and link table queues pointers */ + SEC_CNT_INIT(sc, sc_free_desc_get_cnt, SEC_DESCRIPTORS); + SEC_CNT_INIT(sc, sc_free_desc_put_cnt, SEC_DESCRIPTORS); + SEC_CNT_INIT(sc, sc_ready_desc_get_cnt, SEC_DESCRIPTORS); + SEC_CNT_INIT(sc, sc_ready_desc_put_cnt, SEC_DESCRIPTORS); + SEC_CNT_INIT(sc, sc_queued_desc_get_cnt, SEC_DESCRIPTORS); + SEC_CNT_INIT(sc, sc_queued_desc_put_cnt, SEC_DESCRIPTORS); + SEC_CNT_INIT(sc, sc_lt_alloc_cnt, SEC_LT_ENTRIES); + SEC_CNT_INIT(sc, sc_lt_free_cnt, SEC_LT_ENTRIES); + + /* Create masks for fast checks */ + sc->sc_int_error_mask = 0; + for (i = 0; i < SEC_CHANNELS; i++) + sc->sc_int_error_mask |= (~0ULL & SEC_INT_CH_ERR(i)); + + switch (sc->sc_version) { + case 2: + sc->sc_channel_idle_mask = + (SEC_CHAN_CSR2_FFLVL_M << SEC_CHAN_CSR2_FFLVL_S) | + (SEC_CHAN_CSR2_MSTATE_M << SEC_CHAN_CSR2_MSTATE_S) | + (SEC_CHAN_CSR2_PSTATE_M << SEC_CHAN_CSR2_PSTATE_S) | + (SEC_CHAN_CSR2_GSTATE_M << SEC_CHAN_CSR2_GSTATE_S); + break; + case 3: + sc->sc_channel_idle_mask = + (SEC_CHAN_CSR3_FFLVL_M << SEC_CHAN_CSR3_FFLVL_S) | + (SEC_CHAN_CSR3_MSTATE_M << SEC_CHAN_CSR3_MSTATE_S) | + (SEC_CHAN_CSR3_PSTATE_M << SEC_CHAN_CSR3_PSTATE_S) | + (SEC_CHAN_CSR3_GSTATE_M << SEC_CHAN_CSR3_GSTATE_S); + break; + } + + /* Init hardware */ + error = sec_init(sc); + + if (error) + goto fail6; + + /* Register in OCF (AESU) */ + crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0); + + /* Register in OCF (DEU) */ + crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0); + crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0); + + /* Register in OCF (MDEU) */ + crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0); + crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0); + crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0); + crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0); + crypto_register(sc->sc_cid, CRYPTO_SHA2_256_HMAC, 0, 0); + if (sc->sc_version >= 3) { + crypto_register(sc->sc_cid, CRYPTO_SHA2_384_HMAC, 0, 0); + crypto_register(sc->sc_cid, CRYPTO_SHA2_512_HMAC, 0, 0); + } + + return (0); + +fail6: + sec_free_dma_mem(&(sc->sc_lt_dmem)); +fail5: + sec_free_dma_mem(&(sc->sc_desc_dmem)); +fail4: + sec_release_intr(sc, sc->sc_sec_ires, sc->sc_sec_ihand, + sc->sc_sec_irid, "secondary"); +fail3: + sec_release_intr(sc, sc->sc_pri_ires, sc->sc_pri_ihand, + sc->sc_pri_irid, "primary"); +fail2: + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rrid, sc->sc_rres); +fail1: + mtx_destroy(&sc->sc_controller_lock); + mtx_destroy(&sc->sc_descriptors_lock); + mtx_destroy(&sc->sc_sessions_lock); + + return (ENXIO); +} + +static int +sec_detach(device_t dev) +{ + struct sec_softc *sc = device_get_softc(dev); + int i, error, timeout = SEC_TIMEOUT; + + /* Prepare driver to shutdown */ + SEC_LOCK(sc, descriptors); + sc->sc_shutdown = 1; + SEC_UNLOCK(sc, descriptors); + + /* Wait until all queued processing finishes */ + while (1) { + SEC_LOCK(sc, descriptors); + i = SEC_READY_DESC_CNT(sc) + SEC_QUEUED_DESC_CNT(sc); + SEC_UNLOCK(sc, descriptors); + + if (i == 0) + break; + + if (timeout < 0) { + device_printf(dev, "queue flush timeout!\n"); + + /* DMA can be still active - stop it */ + for (i = 0; i < SEC_CHANNELS; i++) + sec_channel_reset(sc, i, 1); + + break; + } + + timeout -= 1000; + DELAY(1000); + } + + /* Disable interrupts */ + SEC_WRITE(sc, SEC_IER, 0); + + /* Unregister from OCF */ + crypto_unregister_all(sc->sc_cid); + + /* Free DMA memory */ + for (i = 0; i < SEC_DESCRIPTORS; i++) + SEC_DESC_FREE_POINTERS(&(sc->sc_desc[i])); + + sec_free_dma_mem(&(sc->sc_lt_dmem)); + sec_free_dma_mem(&(sc->sc_desc_dmem)); + + /* Release interrupts */ + sec_release_intr(sc, sc->sc_pri_ires, sc->sc_pri_ihand, + sc->sc_pri_irid, "primary"); + sec_release_intr(sc, sc->sc_sec_ires, sc->sc_sec_ihand, + sc->sc_sec_irid, "secondary"); + + /* Release memory */ + if (sc->sc_rres) { + error = bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rrid, + sc->sc_rres); + if (error) + device_printf(dev, "bus_release_resource() failed for" + " I/O memory, error %d\n", error); + + sc->sc_rres = NULL; + } + + mtx_destroy(&sc->sc_controller_lock); + mtx_destroy(&sc->sc_descriptors_lock); + mtx_destroy(&sc->sc_sessions_lock); + + return (0); +} + +static int +sec_suspend(device_t dev) +{ + + return (0); +} + +static int +sec_resume(device_t dev) +{ + + return (0); +} + +static void +sec_shutdown(device_t dev) +{ +} + +static int +sec_setup_intr(struct sec_softc *sc, struct resource **ires, void **ihand, + int *irid, driver_intr_t handler, const char *iname) +{ + int error; + + (*ires) = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, irid, + RF_ACTIVE); + + if ((*ires) == NULL) { + device_printf(sc->sc_dev, "could not allocate %s IRQ\n", iname); + return (ENXIO); + } + + error = bus_setup_intr(sc->sc_dev, *ires, INTR_MPSAFE | INTR_TYPE_NET, + NULL, handler, sc, ihand); + + if (error) { + device_printf(sc->sc_dev, "failed to set up %s IRQ\n", iname); + if (bus_release_resource(sc->sc_dev, SYS_RES_IRQ, *irid, *ires)) + device_printf(sc->sc_dev, "could not release %s IRQ\n", + iname); + + (*ires) = NULL; + return (error); + } + + return (0); +} + +static void +sec_release_intr(struct sec_softc *sc, struct resource *ires, void *ihand, + int irid, const char *iname) +{ + int error; + + if (ires == NULL) + return; + + error = bus_teardown_intr(sc->sc_dev, ires, ihand); + if (error) + device_printf(sc->sc_dev, "bus_teardown_intr() failed for %s" + " IRQ, error %d\n", iname, error); + + error = bus_release_resource(sc->sc_dev, SYS_RES_IRQ, irid, ires); + if (error) + device_printf(sc->sc_dev, "bus_release_resource() failed for %s" + " IRQ, error %d\n", iname, error); +} + +static void +sec_primary_intr(void *arg) +{ + struct sec_softc *sc = arg; + struct sec_desc *desc; + uint64_t isr; + int i, wakeup = 0; + + SEC_LOCK(sc, controller); + + /* Check for errors */ + isr = SEC_READ(sc, SEC_ISR); + if (isr & sc->sc_int_error_mask) { + /* Check each channel for error */ + for (i = 0; i < SEC_CHANNELS; i++) { + if ((isr & SEC_INT_CH_ERR(i)) == 0) + continue; + + device_printf(sc->sc_dev, + "I/O error on channel %i!\n", i); + + /* Find and mark problematic descriptor */ + desc = sec_find_desc(sc, SEC_READ(sc, + SEC_CHAN_CDPR(i))); + + if (desc != NULL) + desc->sd_error = EIO; + + /* Do partial channel reset */ + sec_channel_reset(sc, i, 0); + } + } + + /* ACK interrupt */ + SEC_WRITE(sc, SEC_ICR, 0xFFFFFFFFFFFFFFFFULL); + + SEC_UNLOCK(sc, controller); + SEC_LOCK(sc, descriptors); + + /* Handle processed descriptors */ + SEC_DESC_SYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + while (SEC_QUEUED_DESC_CNT(sc) > 0) { + desc = SEC_GET_QUEUED_DESC(sc); + + if (desc->sd_desc->shd_done != 0xFF && desc->sd_error == 0) { + SEC_PUT_BACK_QUEUED_DESC(sc); + break; + } + + SEC_DESC_SYNC_POINTERS(desc, BUS_DMASYNC_PREREAD | + BUS_DMASYNC_PREWRITE); + + desc->sd_crp->crp_etype = desc->sd_error; + crypto_done(desc->sd_crp); + + SEC_DESC_FREE_POINTERS(desc); + SEC_DESC_FREE_LT(sc, desc); + SEC_DESC_QUEUED2FREE(sc); + } + + SEC_DESC_SYNC(sc, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + if (!sc->sc_shutdown) { + wakeup = sc->sc_blocked; + sc->sc_blocked = 0; + } + + SEC_UNLOCK(sc, descriptors); + + /* Enqueue ready descriptors in hardware */ + sec_enqueue(sc); + + if (wakeup) + crypto_unblock(sc->sc_cid, wakeup); +} + +static void +sec_secondary_intr(void *arg) +{ + struct sec_softc *sc = arg; + + device_printf(sc->sc_dev, "spurious secondary interrupt!\n"); + sec_primary_intr(arg); +} + +static int +sec_controller_reset(struct sec_softc *sc) +{ + int timeout = SEC_TIMEOUT; + + /* Reset Controller */ + SEC_WRITE(sc, SEC_MCR, SEC_MCR_SWR); + + while (SEC_READ(sc, SEC_MCR) & SEC_MCR_SWR) { + DELAY(1000); + timeout -= 1000; + + if (timeout < 0) { + device_printf(sc->sc_dev, "timeout while waiting for " + "device reset!\n"); + return (ETIMEDOUT); + } + } + + return (0); +} + +static int +sec_channel_reset(struct sec_softc *sc, int channel, int full) +{ + int timeout = SEC_TIMEOUT; + uint64_t bit = (full) ? SEC_CHAN_CCR_R : SEC_CHAN_CCR_CON; + uint64_t reg; + + /* Reset Channel */ + reg = SEC_READ(sc, SEC_CHAN_CCR(channel)); + SEC_WRITE(sc, SEC_CHAN_CCR(channel), reg | bit); + + while (SEC_READ(sc, SEC_CHAN_CCR(channel)) & bit) { + DELAY(1000); + timeout -= 1000; + + if (timeout < 0) { + device_printf(sc->sc_dev, "timeout while waiting for " + "channel reset!\n"); + return (ETIMEDOUT); + } + } + + if (full) { + reg = SEC_CHAN_CCR_CDIE | SEC_CHAN_CCR_NT | SEC_CHAN_CCR_BS; + + switch(sc->sc_version) { + case 2: + reg |= SEC_CHAN_CCR_CDWE; + break; + case 3: + reg |= SEC_CHAN_CCR_AWSE | SEC_CHAN_CCR_WGN; + break; + } + + SEC_WRITE(sc, SEC_CHAN_CCR(channel), reg); + } + + return (0); +} + +static int +sec_init(struct sec_softc *sc) +{ + uint64_t reg; + int error, i; + + /* Reset controller twice to clear all pending interrupts */ + error = sec_controller_reset(sc); + if (error) + return (error); + + error = sec_controller_reset(sc); + if (error) + return (error); + + /* Reset channels */ + for (i = 0; i < SEC_CHANNELS; i++) { + error = sec_channel_reset(sc, i, 1); + if (error) + return (error); + } + + /* Enable Interrupts */ + reg = SEC_INT_ITO; + for (i = 0; i < SEC_CHANNELS; i++) + reg |= SEC_INT_CH_DN(i) | SEC_INT_CH_ERR(i); + + SEC_WRITE(sc, SEC_IER, reg); + + return (error); +} + +static void +sec_alloc_dma_mem_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + struct sec_dma_mem *dma_mem = arg; + + if (error) + return; + + KASSERT(nseg == 1, ("Wrong number of segments, should be 1")); + dma_mem->dma_paddr = segs->ds_addr; +} + +static void +sec_dma_map_desc_cb(void *arg, bus_dma_segment_t *segs, int nseg, + int error) +{ + struct sec_desc_map_info *sdmi = arg; + struct sec_softc *sc = sdmi->sdmi_sc; + struct sec_lt *lt = NULL; + bus_addr_t addr; + bus_size_t size; + int i; + + SEC_LOCK_ASSERT(sc, descriptors); + + if (error) + return; + + for (i = 0; i < nseg; i++) { + addr = segs[i].ds_addr; + size = segs[i].ds_len; + + /* Skip requested offset */ + if (sdmi->sdmi_offset >= size) { + sdmi->sdmi_offset -= size; + continue; + } + + addr += sdmi->sdmi_offset; + size -= sdmi->sdmi_offset; + sdmi->sdmi_offset = 0; + + /* Do not link more than requested */ + if (sdmi->sdmi_size < size) + size = sdmi->sdmi_size; + + lt = SEC_ALLOC_LT_ENTRY(sc); + lt->sl_lt->shl_length = size; + lt->sl_lt->shl_r = 0; + lt->sl_lt->shl_n = 0; + lt->sl_lt->shl_ptr = addr; + + if (sdmi->sdmi_lt_first == NULL) + sdmi->sdmi_lt_first = lt; + + sdmi->sdmi_lt_used += 1; + + if ((sdmi->sdmi_size -= size) == 0) + break; + } + + sdmi->sdmi_lt_last = lt; +} + +static void +sec_dma_map_desc_cb2(void *arg, bus_dma_segment_t *segs, int nseg, + bus_size_t size, int error) +{ + + sec_dma_map_desc_cb(arg, segs, nseg, error); +} + +static int +sec_alloc_dma_mem(struct sec_softc *sc, struct sec_dma_mem *dma_mem, + bus_size_t size) +{ + int error; + + if (dma_mem->dma_vaddr != NULL) + return (EBUSY); + + error = bus_dma_tag_create(NULL, /* parent */ + SEC_DMA_ALIGNMENT, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + size, 1, /* maxsize, nsegments */ + size, 0, /* maxsegsz, flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &(dma_mem->dma_tag)); /* dmat */ + + if (error) { + device_printf(sc->sc_dev, "failed to allocate busdma tag, error" + " %i!\n", error); + goto err1; + } + + error = bus_dmamem_alloc(dma_mem->dma_tag, &(dma_mem->dma_vaddr), + BUS_DMA_NOWAIT | BUS_DMA_ZERO, &(dma_mem->dma_map)); + + if (error) { + device_printf(sc->sc_dev, "failed to allocate DMA safe" + " memory, error %i!\n", error); + goto err2; + } + + error = bus_dmamap_load(dma_mem->dma_tag, dma_mem->dma_map, + dma_mem->dma_vaddr, size, sec_alloc_dma_mem_cb, dma_mem, + BUS_DMA_NOWAIT); + + if (error) { + device_printf(sc->sc_dev, "cannot get address of the DMA" + " memory, error %i\n", error); + goto err3; + } + + dma_mem->dma_is_map = 0; + return (0); + +err3: + bus_dmamem_free(dma_mem->dma_tag, dma_mem->dma_vaddr, dma_mem->dma_map); +err2: + bus_dma_tag_destroy(dma_mem->dma_tag); +err1: + dma_mem->dma_vaddr = NULL; + return(error); +} + +static int +sec_desc_map_dma(struct sec_softc *sc, struct sec_dma_mem *dma_mem, void *mem, + bus_size_t size, int type, struct sec_desc_map_info *sdmi) +{ + int error; + + if (dma_mem->dma_vaddr != NULL) + return (EBUSY); + + switch (type) { + case SEC_MEMORY: + break; + case SEC_UIO: + size = SEC_FREE_LT_CNT(sc) * SEC_MAX_DMA_BLOCK_SIZE; + break; + case SEC_MBUF: + size = m_length((struct mbuf*)mem, NULL); + break; + default: + return (EINVAL); + } + + error = bus_dma_tag_create(NULL, /* parent */ + SEC_DMA_ALIGNMENT, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + size, /* maxsize */ + SEC_FREE_LT_CNT(sc), /* nsegments */ + SEC_MAX_DMA_BLOCK_SIZE, 0, /* maxsegsz, flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &(dma_mem->dma_tag)); /* dmat */ + + if (error) { + device_printf(sc->sc_dev, "failed to allocate busdma tag, error" + " %i!\n", error); + dma_mem->dma_vaddr = NULL; + return (error); + } + + error = bus_dmamap_create(dma_mem->dma_tag, 0, &(dma_mem->dma_map)); + + if (error) { + device_printf(sc->sc_dev, "failed to create DMA map, error %i!" + "\n", error); + bus_dma_tag_destroy(dma_mem->dma_tag); + return (error); + } + + switch (type) { + case SEC_MEMORY: + error = bus_dmamap_load(dma_mem->dma_tag, dma_mem->dma_map, + mem, size, sec_dma_map_desc_cb, sdmi, BUS_DMA_NOWAIT); + break; + case SEC_UIO: + error = bus_dmamap_load_uio(dma_mem->dma_tag, dma_mem->dma_map, + mem, sec_dma_map_desc_cb2, sdmi, BUS_DMA_NOWAIT); + break; + case SEC_MBUF: + error = bus_dmamap_load_mbuf(dma_mem->dma_tag, dma_mem->dma_map, + mem, sec_dma_map_desc_cb2, sdmi, BUS_DMA_NOWAIT); + break; + } + + if (error) { + device_printf(sc->sc_dev, "cannot get address of the DMA" + " memory, error %i!\n", error); + bus_dmamap_destroy(dma_mem->dma_tag, dma_mem->dma_map); + bus_dma_tag_destroy(dma_mem->dma_tag); + return (error); + } + + dma_mem->dma_is_map = 1; + dma_mem->dma_vaddr = mem; + + return (0); +} + +static void +sec_free_dma_mem(struct sec_dma_mem *dma_mem) +{ + + /* Check for double free */ + if (dma_mem->dma_vaddr == NULL) + return; + + bus_dmamap_unload(dma_mem->dma_tag, dma_mem->dma_map); + + if (dma_mem->dma_is_map) + bus_dmamap_destroy(dma_mem->dma_tag, dma_mem->dma_map); + else + bus_dmamem_free(dma_mem->dma_tag, dma_mem->dma_vaddr, + dma_mem->dma_map); + + bus_dma_tag_destroy(dma_mem->dma_tag); + dma_mem->dma_vaddr = NULL; +} + +static int +sec_eu_channel(struct sec_softc *sc, int eu) +{ + uint64_t reg; + int channel = 0; + + SEC_LOCK_ASSERT(sc, controller); + + reg = SEC_READ(sc, SEC_EUASR); + + switch (eu) { + case SEC_EU_AFEU: + channel = SEC_EUASR_AFEU(reg); + break; + case SEC_EU_DEU: + channel = SEC_EUASR_DEU(reg); + break; + case SEC_EU_MDEU_A: + case SEC_EU_MDEU_B: + channel = SEC_EUASR_MDEU(reg); + break; + case SEC_EU_RNGU: + channel = SEC_EUASR_RNGU(reg); + break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:43:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21A18106568C; Sat, 6 Jun 2009 12:43:14 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10DC58FC17; Sat, 6 Jun 2009 12:43:14 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56ChDoG061482; Sat, 6 Jun 2009 12:43:13 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56ChDOi061481; Sat, 6 Jun 2009 12:43:13 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200906061243.n56ChDOi061481@svn.freebsd.org> From: Marko Zec Date: Sat, 6 Jun 2009 12:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193582 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 12:43:14 -0000 Author: zec Date: Sat Jun 6 12:43:13 2009 New Revision: 193582 URL: http://svn.freebsd.org/changeset/base/193582 Log: Unbreak options VIMAGE build. Submitted by: julian (mentor) Approved by: julian (mentor) Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Sat Jun 6 10:59:36 2009 (r193581) +++ head/sys/netinet/igmp.c Sat Jun 6 12:43:13 2009 (r193582) @@ -1992,7 +1992,6 @@ igmp_set_version(struct igmp_ifinfo *igi static void igmp_v3_cancel_link_timers(struct igmp_ifinfo *igi) { - INIT_VNET_INET(curvnet); struct ifmultiaddr *ifma; struct ifnet *ifp; struct in_multi *inm; From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:50:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99D05106564A; Sat, 6 Jun 2009 12:50:10 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F3588FC15; Sat, 6 Jun 2009 12:50:10 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56CoA3A061654; Sat, 6 Jun 2009 12:50:10 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56CoATY061650; Sat, 6 Jun 2009 12:50:10 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200906061250.n56CoATY061650@svn.freebsd.org> From: Marko Zec Date: Sat, 6 Jun 2009 12:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193583 - in head/tools/tools: . vimage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 12:50:11 -0000 Author: zec Date: Sat Jun 6 12:50:10 2009 New Revision: 193583 URL: http://svn.freebsd.org/changeset/base/193583 Log: Add an interim userland utility for managing vimages / virtualized network stack infrastructure. Requested by: julian (mentor) Approved by: julian (mentor) Added: head/tools/tools/vimage/ head/tools/tools/vimage/Makefile (contents, props changed) head/tools/tools/vimage/vimage.8 (contents, props changed) head/tools/tools/vimage/vimage.c (contents, props changed) Modified: head/tools/tools/README Modified: head/tools/tools/README ============================================================================== --- head/tools/tools/README Sat Jun 6 12:43:13 2009 (r193582) +++ head/tools/tools/README Sat Jun 6 12:50:10 2009 (r193583) @@ -61,6 +61,8 @@ sysdoc Build a manual page with availab kernel configuration. tinybsd Script to build FreeBSD embedded systems. track Track the progress of a world / kernel build +vimage An interim utility for managing the virtualized network + stack infrastructure. vop_table Generates a HTML document that shows all the VOP's in the kernel. whereintheworld Summarizes "make world" output. Added: head/tools/tools/vimage/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vimage/Makefile Sat Jun 6 12:50:10 2009 (r193583) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +PROG= vimage + +WARNS?= 2 +CFLAGS+= -I../../../sys + +MAN= vimage.8 + +BINDIR?= /usr/sbin +NO_SHARED?= YES + +.include Added: head/tools/tools/vimage/vimage.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vimage/vimage.8 Sat Jun 6 12:50:10 2009 (r193583) @@ -0,0 +1,164 @@ +.\" Copyright (c) 2002, 2003 Marko Zec +.\" Copyright (c) 2009 University of Zagreb +.\" Copyright (c) 2009 FreeBSD Foundation +.\" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 6, 2009 +.Dt VIMAGE 8 +.Os +.Sh NAME +.Nm vimage +.Nd manage virtual network stacks +.Sh SYNOPSIS +.Nm +.Ar vi_name +.Op command +.Nm +.Fl c +.Ar vi_name +.Nm +.Fl d +.Ar vi_name +.Nm +.Fl l +.Op Ar vi_name +.Nm +.Fl i +.Ar vi_name interface +.Sh DESCRIPTION +.Nm +command is an interm user interface for controlling the virtual network +stacks in FreeBSD. +.Ss Overview +A virtual image reprepresents an isolated operating environment with its +own independent network stack instance. Every process, socket and network +interface present in the system is always attached to one, and only one, +virtual image i.e. virtual network stack instance. +During the system bootup sequence default virtual image is created to +which all the configured interfaces and user processes are initially +assigned. +Assuming that enough system resources and per virtual image privileges +are provided, the super-user can create and manage a hierarchy of +subordinated virtual images. The +.Nm +command allows for creation, deletion and monitoring of virtual images, +as well as for execution of arbitrary processes in a targeted virtual +image. +.Ss Invocation +If invoked with no modifiers, the +.Nm +command spawns a new shell process in virtual image +.Ar vi_name . +If provided, the optional arguments following the virtual image name +.Ar vi_name +are interpreted as a standard command line issued at a shell, +otherwise an interactive shell is started in the target virtual image. +.Pp +The following parameters are available: +.Bl -tag -width indent +.It Fl c +Create a new virtual image named +.So +.Ar vi_name +.Sc . +.It Fl d +Delete the virtual image +.Ar vi_name . +No processes and/or sockets should exist in the target virtual image +in order for the delete request to succeed. Non-loopback interfaces +residing in the target virtual image will be reassigned to the virtual +image's parent. +.It Fl l +List the properties and statistics for virtual images one level +below the current one in the hierarchy. If an optional argument +.Ar vi_name +is provided, only the information regarding the target virtual image +.Ar vi_name +is displayed. +.It Fl lr +List the properties and statistics for all virtual images in +the hierarchy of subordinated vimages. If an optional argument +.Ar vi_name +is provided, the hierarchy will be traversed at and below the +.Ar vi_name +level. +.It Fl i +Move the interface +.Ar interface +to the target virtual image +.Ar vi_name . +If the value of +.Ar vi_name +argument is +.So .. +.Sc , +the interface is returned to the parent of the current virtual image. +.El +.Sh EXAMPLES +Create a new virtual image named +.So v1 +.Sc : +.Pp +.Dl vimage -c v1 +.Pp +Execute the +.So ifconfig +.Sc command in the virtual image +.So v1 +.Sc : +.Pp +.Dl vimage v1 ifconfig +.Pp +Move the interface +.So vlan0 +.Sc to the virtual image +.So v1 +.Sc : +.Pp +.Dl vimage -i v1 vlan0 +.Pp +Show the status information for virtual image +.So v1 +.Sc : +.Pp +.Dl vimage -l v1 +.Sh DIAGNOSTICS +The +.Nm +command exits 0 on success, and >0 if an error occurs. +.Sh SEE ALSO +.Xr jail 8 +.Sh BUGS +If memory allocation failure occurs during the vimage creation, it will remain +undetected/ignored in the current implementation, thus latently scheduling +an almost imminent system crash in the future. +.Sh AUTHOR +.An "Marko Zec" Aq zec@fer.hr +.Sh HISTORY +The +.Nm +facility first appeared as a patch against FreeBSD 4.7-RELEASE in 2002. Added: head/tools/tools/vimage/vimage.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/vimage/vimage.c Sat Jun 6 12:50:10 2009 (r193583) @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2002-2004 Marko Zec + * Copyright (c) 2009 University of Zagreb + * Copyright (c) 2009 FreeBSD Foundation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +void +vi_print(struct vi_req *vi_req) +{ + + printf("\"%s\":\n", vi_req->vi_name); + printf(" %d sockets, %d ifnets, %d processes\n", + vi_req->vi_sock_count, vi_req->vi_if_count, vi_req->vi_proc_count); +} + +int +main(int argc, char **argv) +{ + int s; + char *shell; + int cmd = VI_SWITCHTO; + struct vi_req vi_req; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s == -1) + goto abort; + + bzero(&vi_req, sizeof(vi_req)); + strcpy(vi_req.vi_name, "."); /* . = this vimage. */ + + if (argc == 1) + cmd = VI_GET; + + if (argc == 2 && strcmp(argv[1], "-l") == 0) + cmd = VI_GETNEXT; + + if (argc == 2 && strcmp(argv[1], "-lr") == 0) + cmd = VI_GETNEXT_RECURSE; + + if (argc == 3) { + strcpy(vi_req.vi_name, argv[2]); + if (strcmp(argv[1], "-l") == 0) + cmd = VI_GET; + if (strcmp(argv[1], "-c") == 0) + cmd = VI_CREATE; + if (strcmp(argv[1], "-d") == 0) + cmd = VI_DESTROY; + } + + if (argc >= 3) { + strcpy(vi_req.vi_name, argv[2]); + if (strcmp(argv[1], "-c") == 0) + cmd = VI_CREATE; + if (strcmp(argv[1], "-i") == 0) + cmd = VI_IFACE; + } + + vi_req.vi_api_cookie = VI_API_COOKIE; + vi_req.vi_req_action = cmd; + switch (cmd) { + + case VI_GET: + if (ioctl(s, SIOCGPVIMAGE, (caddr_t)&vi_req) < 0) + goto abort; + if (argc == 1) + printf("%s\n", vi_req.vi_name); + else + vi_print(&vi_req); + exit(0); + + case VI_GETNEXT: + case VI_GETNEXT_RECURSE: + vi_req.vi_req_action = VI_GET; + if (ioctl(s, SIOCGPVIMAGE, (caddr_t)&vi_req) < 0) + goto abort; + vi_print(&vi_req); + vi_req.vi_req_action = VI_GETNEXT_RECURSE; + while (ioctl(s, SIOCGPVIMAGE, (caddr_t)&vi_req) == 0) { + vi_print(&vi_req); + vi_req.vi_req_action = cmd; + } + exit(0); + + case VI_IFACE: + strncpy(vi_req.vi_if_xname, argv[3], + sizeof(vi_req.vi_if_xname)); + if (ioctl(s, SIOCSIFVIMAGE, (caddr_t)&vi_req) < 0) + goto abort; + printf("%s@%s\n", vi_req.vi_if_xname, vi_req.vi_name); + exit(0); + + case VI_CREATE: + if (ioctl(s, SIOCSPVIMAGE, (caddr_t)&vi_req) < 0) + goto abort; + exit(0); + + case VI_SWITCHTO: + strcpy(vi_req.vi_name, argv[1]); + if (ioctl(s, SIOCSPVIMAGE, (caddr_t)&vi_req) < 0) + goto abort; + + vi_req.vi_req_action = VI_GET; + strcpy(vi_req.vi_name, "."); + if (ioctl(s, SIOCGPVIMAGE, (caddr_t)&vi_req) < 0) { + printf("XXX this should have not happened!\n"); + goto abort; + } + close(s); + + if (argc == 2) { + printf("Switched to vimage %s\n", argv[1]); + if ((shell = getenv("SHELL")) == NULL) + execlp("/bin/sh", argv[0], NULL); + else + execlp(shell, argv[0], NULL); + } else + execvp(argv[2], &argv[2]); + break; + + case VI_DESTROY: + if (ioctl(s, SIOCSPVIMAGE, (caddr_t)&vi_req) < 0) + goto abort; + exit(0); + + default: + fprintf(stderr, "usage: %s [-cdilr] vi_name [args]\n", + argv[0]); + exit(1); + } + +abort: + perror("Error"); + exit(1); +} From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:53:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B666A106564A; Sat, 6 Jun 2009 12:53:54 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A49518FC0C; Sat, 6 Jun 2009 12:53:54 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56Crs3g061750; Sat, 6 Jun 2009 12:53:54 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56Crs3K061749; Sat, 6 Jun 2009 12:53:54 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906061253.n56Crs3K061749@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 6 Jun 2009 12:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193584 - head/tools/tools/pciid X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 12:53:55 -0000 Author: edwin Date: Sat Jun 6 12:53:54 2009 New Revision: 193584 URL: http://svn.freebsd.org/changeset/base/193584 Log: When trying to see if we could update the share/misc/pci_vendors, I found out that the input format of the Boemler list was different than what the code expected: The last two fields were interpreted as one. Checking the csv version of the list it showed that there was sometimes a chipset number in the column before the card description. This is a rewrite to use the CSV format of the Boemler list. The output is differently formatted: Instead of the "chip description", it is now "description (chip)" Modified: head/tools/tools/pciid/mk_pci_vendors.pl Modified: head/tools/tools/pciid/mk_pci_vendors.pl ============================================================================== --- head/tools/tools/pciid/mk_pci_vendors.pl Sat Jun 6 12:50:10 2009 (r193583) +++ head/tools/tools/pciid/mk_pci_vendors.pl Sat Jun 6 12:53:54 2009 (r193584) @@ -30,7 +30,7 @@ # Generate src/share/misc/pci_vendors from the Hart and Boemler lists, # currently available at: # -# Boemler: http://www.pcidatabase.com/reports.php?type=tab-delimeted +# Boemler: http://www.pcidatabase.com/reports.php?type=csv # Hart: http://members.datafast.net.au/dft0802/downloads/pcidevs.txt # # -l Where an entry is found in both input lists, use the entry with @@ -42,26 +42,28 @@ # use strict; use Getopt::Std; +use Data::Dumper; my $PROGNAME = 'mk_pci_vendors'; my $VENDORS_FILE = 'vendors.txt'; my $PCIDEVS_FILE = 'pcidevs.txt'; -my $cur_vendor; +my ($cur_vendor, $vendorid, $pciid, $vendor); my %opts; -my %vendors; +my %pciids = (); +my %vendors = (); my ($descr, $existing, $id, $line, $rv, $winner, $optlused); my $IS_VENDOR = 1; my $IS_DEVICE = 2; my $V_DESCR = 0; my $V_DEVSL = 1; -my $W_NOCONTEST = 0; +my $W_FINAL = 0; my $W_VENDORS = 1; my $W_PCIDEVS = 2; sub clean_descr($); -sub vendors_parse($\$\$); +sub vendors_parse($\$\$\$\$); sub pcidevs_parse($\$\$); if (not getopts('lp:qv:', \%opts) or @ARGV > 0) { @@ -87,15 +89,14 @@ open(VENDORS, "< $opts{v}") or die "$PROGNAME: $opts{v}: $!\n"; while ($line = ) { chomp($line); - $rv = vendors_parse($line, $id, $descr); - if ($rv == $IS_VENDOR) { - if (exists($vendors{$id})) { - die "$PROGNAME: $id: duplicate vendor ID\n"; + $rv = vendors_parse($line, $vendorid, $pciid, $vendor, $descr); + if ($rv != 0) { + if (defined $vendors{$vendorid} + && $vendors{$vendorid}[$W_VENDORS] ne $vendor) { + die "$PROGNAME: $vendorid: duplicate vendor ID\n"; } - $vendors{$id} = [$descr, {}]; - $cur_vendor = $id; - } elsif ($rv == $IS_DEVICE) { - ${$vendors{$cur_vendor}->[$V_DEVSL]}{$id} = $descr; + $vendors{$vendorid}[$W_VENDORS] = $vendor; + $pciids{$vendorid}{$pciid}[$W_VENDORS] = $descr; } } close(VENDORS); @@ -106,52 +107,57 @@ while ($line = ) { chomp($line); $rv = pcidevs_parse($line, $id, $descr); if ($rv == $IS_VENDOR) { - if (not exists($vendors{$id})) { - $vendors{$id} = [$descr, {}]; - $winner = $W_NOCONTEST; - } elsif ($opts{l}) { - $existing = $vendors{$id}->[$V_DESCR]; - if (length($existing) < length($descr)) { - $vendors{$id}->[$V_DESCR] = $descr; - $winner = $W_PCIDEVS; - } else { - $winner = $W_VENDORS; - } + $vendorid = $id; + $vendors{$vendorid}[$W_PCIDEVS] = $descr; + } elsif ($rv == $IS_DEVICE) { + $pciids{$vendorid}{$id}[$W_PCIDEVS] = $descr; + } +} +close(PCIDEVS); + +foreach my $vid (keys(%vendors)) { + if (!defined $vendors{$vid}[$W_VENDORS] + && defined $vendors{$vid}[$W_PCIDEVS]) { + $vendors{$vid}[$W_FINAL] = $vendors{$vid}[$W_PCIDEVS]; + } elsif (defined $vendors{$vid}[$W_VENDORS] + && !defined $vendors{$vid}[$W_PCIDEVS]) { + $vendors{$vid}[$W_FINAL] = $vendors{$vid}[$W_VENDORS]; + } elsif (!$opts{l}) { + $vendors{$vid}[$W_FINAL] = $vendors{$vid}[$W_VENDORS]; + } else { + if (length($vendors{$vid}[$W_VENDORS]) > + length($vendors{$vid}[$W_PCIDEVS])) { + $vendors{$vid}[$W_FINAL] = $vendors{$vid}[$W_VENDORS]; } else { - $winner = $W_VENDORS; + $vendors{$vid}[$W_FINAL] = $vendors{$vid}[$W_PCIDEVS]; } - $cur_vendor = $id; - if (not $opts{q} and $winner != $W_NOCONTEST) { - $existing = $vendors{$id}->[$V_DESCR]; - print STDERR "$PROGNAME: ", - $winner == $W_VENDORS ? "Boemler" : "Hart", - " vendor wins: $id\t$existing\n"; - } - } elsif ($rv == $IS_DEVICE) { - if (not exists(${$vendors{$cur_vendor}->[$V_DEVSL]}{$id})) { - ${$vendors{$cur_vendor}->[$V_DEVSL]}{$id} = $descr; - $winner = $W_NOCONTEST; - } elsif ($opts{l}) { - $existing = ${$vendors{$cur_vendor}->[$V_DEVSL]}{$id}; - if (length($existing) < length($descr)) { - ${$vendors{$cur_vendor}->[$V_DEVSL]}{$id} = - $descr; - $winner = $W_PCIDEVS; + } + + foreach my $pciid (keys(%{$pciids{$vid}})) { + if (!defined $pciids{$vid}{$pciid}[$W_VENDORS] + && defined $pciids{$vid}{$pciid}[$W_PCIDEVS]) { + $pciids{$vid}{$pciid}[$W_FINAL] = + $pciids{$vid}{$pciid}[$W_PCIDEVS]; + } elsif (defined $pciids{$vid}{$pciid}[$W_VENDORS] + && !defined $pciids{$vid}{$pciid}[$W_PCIDEVS]) { + $pciids{$vid}{$pciid}[$W_FINAL] = + $pciids{$vid}{$pciid}[$W_VENDORS]; + } elsif (!$opts{l}) { + $pciids{$vid}{$pciid}[$W_FINAL] = + $pciids{$vid}{$pciid}[$W_VENDORS]; + } else { + if (length($pciids{$vid}{$pciid}[$W_VENDORS]) > + length($pciids{$vid}{$pciid}[$W_PCIDEVS])) { + $pciids{$vid}{$pciid}[$W_FINAL] = + $pciids{$vid}{$pciid}[$W_VENDORS]; } else { - $winner = $W_VENDORS; + $pciids{$vid}{$pciid}[$W_FINAL] = + $pciids{$vid}{$pciid}[$W_PCIDEVS]; } - } else { - $winner = $W_VENDORS; - } - if (not $opts{q} and $winner != $W_NOCONTEST) { - $existing = ${$vendors{$cur_vendor}->[$V_DEVSL]}{$id}; - print STDERR "$PROGNAME: ", - $winner == $W_VENDORS ? "Boemler" : "Hart", - " device wins: $id\t$existing\n"; } } + } -close(PCIDEVS); $optlused = $opts{l} ? "with" : "without"; print <[$V_DESCR]; - print "$id\t$descr\n"; - foreach $id (sort keys %{$vendors{$cur_vendor}->[$V_DEVSL]}) { - $descr = ${$vendors{$cur_vendor}->[$V_DEVSL]}{$id}; - print "\t$id\t$descr\n"; +foreach my $vid (sort keys %vendors) { + $descr = $vendors{$vid}[0]; + print "$vid\t$descr\n"; + foreach $pciid (sort keys %{$pciids{$vid}}) { + $descr = $pciids{$vid}{$pciid}[0]; + print "\t$pciid\t$descr\n"; } } exit 0; -# Parse a line from the Boemler file and place the ID and description -# in the scalars referenced by $id_ref and $descr_ref. +# Parse a line from the Boemler file and place the vendor id, pciid, +# vendor description and description in the scalars. # -# On success, returns $IS_VENDOR if the line represents a vendor entity -# or $IS_DEVICE if the line represents a device entity. +# Returns 0 if there is a problem. # -# Returns 0 on failure. -# -sub vendors_parse($\$\$) +sub vendors_parse($\$\$\$\$) { - my ($line, $id_ref, $descr_ref) = @_; + my ($line, $vendorid_ref, $pciid_ref, $vendor_ref, $descr_ref) = @_; - if ($line =~ /^([A-Fa-f0-9]{4})\t([^\t].+?)\s*$/) { - ($$id_ref, $$descr_ref) = (uc($1), clean_descr($2)); - return $IS_VENDOR; - } elsif ($line =~ /^\t([A-Fa-f0-9]{4})\t([^\t].+?)\s*$/) { - ($$id_ref, $$descr_ref) = (uc($1), clean_descr($2)); - return $IS_DEVICE; - } elsif (not $opts{q} and - $line !~ /^\s*$/ and $line !~ /^;/) { - chomp($line); - print STDERR "$PROGNAME: ignored Boemler: $line\n"; + my @a = split(/","/, $line); + $a[0] =~ s/0x//; + $a[1] =~ s/0x//; + + $a[0] =~ s/^"//; + $a[4] =~ s/"$//; + + $a[0] = uc($a[0]); + $a[1] = uc($a[1]); + + return 0 if (length($a[0]) != 4 || length($a[1]) != 4); + + if ($a[4] eq "") { + if ($a[3] ne "") { + $a[4] = $a[3]; + $a[3] = ""; + } else { + $a[4] = "?"; + } } - return 0; + $$vendorid_ref = $a[0]; + $$pciid_ref = $a[1]; + $$vendor_ref = $a[2]; + $$descr_ref = clean_descr($a[4]); + if ($a[3] =~ /[a-zA-Z0-0]/) { + $$descr_ref .= clean_descr(" ($a[3])"); + } + return 1; } # Parse a line from the Hart file and place the ID and description @@ -237,5 +255,7 @@ sub clean_descr($) { my ($descr) = @_; + $descr =~ s/[^[:print:]]//g; + return $descr; } From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 13:33:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE8E9106566B; Sat, 6 Jun 2009 13:33:11 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2E5E8FC19; Sat, 6 Jun 2009 13:33:11 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56DXBGV062551; Sat, 6 Jun 2009 13:33:11 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56DXBEO062550; Sat, 6 Jun 2009 13:33:11 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906061333.n56DXBEO062550@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 6 Jun 2009 13:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193585 - head/tools/tools/pciid X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 13:33:12 -0000 Author: edwin Date: Sat Jun 6 13:33:11 2009 New Revision: 193585 URL: http://svn.freebsd.org/changeset/base/193585 Log: pciconf(8) removes characters after an #, therefor remove them. Also remove \s used to escape 's. Modified: head/tools/tools/pciid/mk_pci_vendors.pl Modified: head/tools/tools/pciid/mk_pci_vendors.pl ============================================================================== --- head/tools/tools/pciid/mk_pci_vendors.pl Sat Jun 6 12:53:54 2009 (r193584) +++ head/tools/tools/pciid/mk_pci_vendors.pl Sat Jun 6 13:33:11 2009 (r193585) @@ -184,7 +184,7 @@ foreach my $vid (sort keys %vendors) { exit 0; -# Parse a line from the Boemler file and place the vendor id, pciid, +# Parse a line from the Boemler CSV file and place the vendor id, pciid, # vendor description and description in the scalars. # # Returns 0 if there is a problem. @@ -194,17 +194,19 @@ sub vendors_parse($\$\$\$\$) my ($line, $vendorid_ref, $pciid_ref, $vendor_ref, $descr_ref) = @_; my @a = split(/","/, $line); - $a[0] =~ s/0x//; + $a[0] =~ s/0x//; # 0x1234 -> 1234 $a[1] =~ s/0x//; - $a[0] =~ s/^"//; + $a[0] =~ s/^"//; # Remove starting or trailing " $a[4] =~ s/"$//; - $a[0] = uc($a[0]); + $a[0] = uc($a[0]); # Some are lowercase hex-digits $a[1] = uc($a[1]); + # Length of the Vendor ID or PCI ID is not four hex-digits, ignore it return 0 if (length($a[0]) != 4 || length($a[1]) != 4); + # If there is no description, see if the chip data exists and use that if ($a[4] eq "") { if ($a[3] ne "") { $a[4] = $a[3]; @@ -218,9 +220,7 @@ sub vendors_parse($\$\$\$\$) $$pciid_ref = $a[1]; $$vendor_ref = $a[2]; $$descr_ref = clean_descr($a[4]); - if ($a[3] =~ /[a-zA-Z0-0]/) { - $$descr_ref .= clean_descr(" ($a[3])"); - } + $$descr_ref .= clean_descr(" ($a[3])") if ($a[3] =~ /[a-zA-Z0-0]/); return 1; } @@ -255,7 +255,9 @@ sub clean_descr($) { my ($descr) = @_; - $descr =~ s/[^[:print:]]//g; + $descr =~ s/[^[:print:]]//g; # non-printable + $descr =~ s/\\//g; # escape of 's + $descr =~ s/\#/*/g; # pciconf(8) ignores data after this return $descr; } From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 13:37:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B08801065673; Sat, 6 Jun 2009 13:37:53 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DDF38FC12; Sat, 6 Jun 2009 13:37:53 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56DbrY1062669; Sat, 6 Jun 2009 13:37:53 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56DbrX4062667; Sat, 6 Jun 2009 13:37:53 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906061337.n56DbrX4062667@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 6 Jun 2009 13:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193586 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 13:37:54 -0000 Author: edwin Date: Sat Jun 6 13:37:53 2009 New Revision: 193586 URL: http://svn.freebsd.org/changeset/base/193586 Log: Regen: * Hart: rev 671 of pcidevs.txt; 22-01-2008 (D-M-Y). * Boemler: vendors.txt (2008-06-06) Initiated by conf/121219 by Yousif Hassan MFC after: 1 week Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Sat Jun 6 13:33:11 2009 (r193585) +++ head/share/misc/pci_vendors Sat Jun 6 13:37:53 2009 (r193586) @@ -3,14 +3,14 @@ ; Automatically generated by src/tools/tools/pciid/mk_pci_vendors.pl ; (with the -l option), using the following source lists: ; -; http://www.pcidatabase.com/reports.php?type=tab-delimeted +; http://www.pcidatabase.com/reports.php?type=csv ; http://members.datafast.net.au/dft0802/downloads/pcidevs.txt ; ; Manual edits on this file will be lost! ; 0000 Gammagraphx Inc 001A Ascend Communications Inc -0033 Paradyne Corp. +0033 Paradyne Corp 003D Real 3D (Was: Lockheed Martin-Marietta Corp) 00D1 i740 PCI Graphics Accelerator 0070 Hauppauge Computer Works Inc. @@ -18,11 +18,12 @@ 4001 WinTV PVR-250 (v1) 4009 WinTV PVR-250 4801 WinTV PVR-250 MCE + 6800 Hauppage Nova -TD-500 DVB-T Tuner Device 0071 Nebula Electronics Ltd -0100 Ncipher Corp. Ltd +0100 Ncipher Corp Ltd 0123 General Dynamics 0246 Addtron(??) -0315 SK - Electronics Co., Ltd. +0315 SK - Electronics Co Ltd 0357 TTTech AG 000A TTP-Monitoring Card V2.0 0403 Future Technology Devices International Ltd @@ -68,7 +69,64 @@ FFA8 Scitel Quadro 09C1 Arris 0704 CM 200E Cable Modem -0A89 BREA Technologies Inc. +0A5C Broadcom Corporation + 0201 Broadcom USB iLine10(tm) Network Adapter + 2000 Broadcom Bluetooth Firmware Upgrade Device + 2009 Broadcom Bluetooth Controller + 200A Broadcom Bluetooth Controller + 200F Broadcom Bluetooth Controller + 201D BROADCOM Bluetooth Device + 201E IBM Integrated Bluetooth IV + 2020 Broadcom Bluetooth Dongle + 2021 BCM2035B3 ROM Adapter Generic + 2033 Broadcom Blutonium Device Firmware Downloader + 2035 BCM2035 Bluetooth + 2038 Broadcom Blutonium Device Firmware Downloader (BCM2038) + 2039 BROADCOM Bluetooth Device + 2045 Broadcom Bluetooth Controller + 2046 Broadcom USB Bluetooth Device + 2047 Broadcom USB Bluetooth Device + 205E Broadcom Bluetooth Firmware Upgrade Device + 2100 Broadcom Bluetooth 2.0+eDR USB dongle + 2101 Broadcom Bluetooth 2.0+EDR USB dongle + 2102 ANYCOM Blue USB-200/250 + 2110 Broadcom Bluetooth Controller + 2111 ANYCOM Blue USB-UHE 200/250 + 2120 Broadcom 2045 Bluetooth 2.0 USB-UHE Device with trace filter ( 2045) + 2121 Broadcom 2045 Bluetooth 2.0 USB Device with trace filter + 2122 Broadcom Bluetooth 2.0+EDR USB dongle + 2124 2045B3ROM Bluetooth Dongle + 2130 Broadcom 2045 Bluetooth 2.0 USB-UHE Device with trace filter + 2131 Broadcom 2045 Bluetooth 2.0 USB Device with trace filter + 2140 2046 Flash UHE Class 2 + 2141 2046 Flash non UHE Class 2 + 2142 2046 Flash non UHE Class 1 + 2143 2046 Flash non UHE Class 1 + 2144 2046 Flash non UHE module Class 2 + 2145 Broadcom BCM9204MD LENO Module + 2146 Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2147 Broadcom 2046 Bluetooth 2.1 USB Dongle + 2148 Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2149 Broadcom 2046 Bluetooth 2.1 USB Dongle + 214A Broadcom 2046 Bluetooth 2.1 USB Module + 214B Broadcom 2046 Bluetooth 2.1 USB Module + 214C Broadcom 2046 Bluetooth 2.1 USB Module + 214D Broadcom Bluetooth 2.1 UHE Module + 214E Thinkpad Bluetooth with Enhanced Data Rate II + 214F Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2150 Broadcom 2046 Bluetooth 2.1 USB Dongle + 2151 Broadcom 2046 Bluetooth 2.1 USB Dongle + 2152 Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2153 Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2154 Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2155 Broadcom Bluetooth USB Dongle + 2157 BCM2046 B1 USB 500 + 2158 Broadcom 2046 Bluetooth 2.1 Device + 4502 USB Human Interface Device + 4503 USB Human Interface Device + 5800 Unified Security Hub + 6300 Pirelli ISB Remote NDIS Device +0A89 BREA Technologies Inc 0B0B Rhino Equiment Corp. 0105 Rhino R1T1 0205 Rhino R4FXO @@ -88,12 +146,12 @@ 064F Trance Vibrator 0E11 Compaq Computer Corp (Now owned by Hewlett-Packard) 0001 PCI to EISA Bridge - 0002 PCI to ISA Bridge - 000F CPQB1A9 StorageWorks Library Adapter (HVD) - 0012 686P7 686P7 - 0046 Smart Array 64xx Controller - 0049 NC7132 Gigabit Upgrade Module - 004A NC6136 Gigabit Server Adapter + 0002 [URL=http://bjlsgpvs.com]zyqdruqt[/URL] pkooxpbn http://khmycdty.com znrqsyvm syeowswq Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D53B106566C; Sat, 6 Jun 2009 13:58:53 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from k7.mavetju.org (ppp113-58.static.internode.on.net [150.101.113.58]) by mx1.freebsd.org (Postfix) with ESMTP id B996C8FC0A; Sat, 6 Jun 2009 13:58:52 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by k7.mavetju.org (Postfix, from userid 1001) id 05B9F450A8; Sat, 6 Jun 2009 23:58:52 +1000 (EST) Date: Sat, 6 Jun 2009 23:58:51 +1000 From: Edwin Groothuis To: Gavin Atkinson Message-ID: <20090606135851.GD3212@mavetju.org> References: <200906051305.n55D5Eu8026282@svn.freebsd.org> <1244209084.48730.10.camel@buffy.york.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1244209084.48730.10.camel@buffy.york.ac.uk> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193498 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 13:58:53 -0000 On Fri, Jun 05, 2009 at 02:38:04PM +0100, Gavin Atkinson wrote: > It's great to see somebody touching the locale PRs, there are quite a > few of them [1] and most of them have supplied patches that seem > "obviously" correct. Thanks! I've asked on -i18n who is in charge for further processing of them. Edwin -- Edwin Groothuis Website: http://www.mavetju.org/ edwin@mavetju.org Weblog: http://www.mavetju.org/weblog/ From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 17:01:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A60310656F2; Sat, 6 Jun 2009 17:01:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64B2E8FC23; Sat, 6 Jun 2009 17:01:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56H1kwJ066690; Sat, 6 Jun 2009 17:01:46 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56H1jvr066669; Sat, 6 Jun 2009 17:01:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906061701.n56H1jvr066669@svn.freebsd.org> From: Robert Watson Date: Sat, 6 Jun 2009 17:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193588 - in head/sys/modules: cxgb/tom firewire/fwip ibcs2 if_gif if_ppp if_stf if_tun ip6_mroute_mod ip_mroute_mod ipfw linux mac_lomac nfsserver pf pseudofs sem svr4 sysvipc/sysvmsg ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 17:01:47 -0000 Author: rwatson Date: Sat Jun 6 17:01:44 2009 New Revision: 193588 URL: http://svn.freebsd.org/changeset/base/193588 Log: Remove opt_mac.h generation for various kernel modules that no longer require it. Submitted by: pjd Modified: head/sys/modules/cxgb/tom/Makefile head/sys/modules/firewire/fwip/Makefile head/sys/modules/ibcs2/Makefile head/sys/modules/if_gif/Makefile head/sys/modules/if_ppp/Makefile head/sys/modules/if_stf/Makefile head/sys/modules/if_tun/Makefile head/sys/modules/ip6_mroute_mod/Makefile head/sys/modules/ip_mroute_mod/Makefile head/sys/modules/ipfw/Makefile head/sys/modules/linux/Makefile head/sys/modules/mac_lomac/Makefile head/sys/modules/nfsserver/Makefile head/sys/modules/pf/Makefile head/sys/modules/pseudofs/Makefile head/sys/modules/sem/Makefile head/sys/modules/svr4/Makefile head/sys/modules/sysvipc/sysvmsg/Makefile head/sys/modules/sysvipc/sysvsem/Makefile head/sys/modules/sysvipc/sysvshm/Makefile head/sys/modules/ufs/Makefile Modified: head/sys/modules/cxgb/tom/Makefile ============================================================================== --- head/sys/modules/cxgb/tom/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/cxgb/tom/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -6,7 +6,7 @@ CXGB = ${.CURDIR}/../../../dev/cxgb KMOD= tom SRCS= cxgb_tom.c cxgb_cpl_io.c cxgb_listen.c cxgb_tom_sysctl.c cxgb_cpl_socket.c SRCS+= cxgb_ddp.c cxgb_vm.c cxgb_l2t.c cxgb_tcp_offload.c -SRCS+= opt_compat.h opt_inet.h opt_inet6.h opt_ipsec.h opt_mac.h +SRCS+= opt_compat.h opt_inet.h opt_inet6.h opt_ipsec.h SRCS+= opt_tcpdebug.h opt_ddb.h opt_sched.h opt_global.h opt_ktr.h SRCS+= device_if.h bus_if.h pci_if.h CFLAGS+= -g -I${CXGB} Modified: head/sys/modules/firewire/fwip/Makefile ============================================================================== --- head/sys/modules/firewire/fwip/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/firewire/fwip/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -6,7 +6,7 @@ KMOD = if_fwip SRCS = bus_if.h device_if.h \ - opt_inet.h opt_inet6.h opt_mac.h \ + opt_inet.h opt_inet6.h \ if_fwip.c if_fwipvar.h \ firewire.h firewirereg.h \ if_fwsubr.c Modified: head/sys/modules/ibcs2/Makefile ============================================================================== --- head/sys/modules/ibcs2/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/ibcs2/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -8,7 +8,7 @@ SRCS= ibcs2_errno.c ibcs2_ipc.c ibcs2_st ibcs2_socksys.c ibcs2_util.c ibcs2_xenix.c ibcs2_xenix_sysent.c \ ibcs2_isc.c ibcs2_isc_sysent.c \ ibcs2_msg.c ibcs2_other.c ibcs2_sysi86.c ibcs2_sysvec.c \ - vnode_if.h opt_mac.h opt_spx_hack.h + vnode_if.h opt_spx_hack.h CFLAGS+= -DCOMPAT_IBCS2 Modified: head/sys/modules/if_gif/Makefile ============================================================================== --- head/sys/modules/if_gif/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/if_gif/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -5,8 +5,7 @@ .PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6 KMOD= if_gif -SRCS= if_gif.c in_gif.c opt_inet.h opt_inet6.h opt_mac.h \ - opt_mrouting.h +SRCS= if_gif.c in_gif.c opt_inet.h opt_inet6.h opt_mrouting.h .if !defined(KERNBUILDDIR) opt_inet.h: Modified: head/sys/modules/if_ppp/Makefile ============================================================================== --- head/sys/modules/if_ppp/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/if_ppp/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -4,7 +4,7 @@ KMOD= if_ppp SRCS= if_ppp.c ppp_tty.c slcompress.c \ - opt_inet.h opt_inet6.h opt_ipx.h opt_mac.h opt_ppp.h + opt_inet.h opt_inet6.h opt_ipx.h opt_ppp.h PPP_BSDCOMP?= 1 # 0/1 PPP_DEFLATE?= 1 # 0/1 Modified: head/sys/modules/if_stf/Makefile ============================================================================== --- head/sys/modules/if_stf/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/if_stf/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../net KMOD= if_stf -SRCS= if_stf.c opt_inet.h opt_inet6.h opt_mac.h +SRCS= if_stf.c opt_inet.h opt_inet6.h .if !defined(KERNBUILDDIR) opt_inet.h: Modified: head/sys/modules/if_tun/Makefile ============================================================================== --- head/sys/modules/if_tun/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/if_tun/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../net KMOD= if_tun -SRCS= if_tun.c opt_atalk.h opt_inet.h opt_inet6.h opt_ipx.h opt_mac.h +SRCS= if_tun.c opt_atalk.h opt_inet.h opt_inet6.h opt_ipx.h .if !defined(KERNBUILDDIR) opt_atalk.h: Modified: head/sys/modules/ip6_mroute_mod/Makefile ============================================================================== --- head/sys/modules/ip6_mroute_mod/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/ip6_mroute_mod/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -7,7 +7,7 @@ KMOD= ip6_mroute SRCS= ip6_mroute.c -SRCS+= opt_inet6.h opt_mac.h opt_mrouting.h +SRCS+= opt_inet6.h opt_mrouting.h .if !defined(KERNBUILDDIR) opt_inet6.h: Modified: head/sys/modules/ip_mroute_mod/Makefile ============================================================================== --- head/sys/modules/ip_mroute_mod/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/ip_mroute_mod/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -7,7 +7,7 @@ KMOD= ip_mroute SRCS= ip_mroute.c -SRCS+= opt_inet.h opt_mac.h opt_mrouting.h opt_route.h +SRCS+= opt_inet.h opt_mrouting.h opt_route.h .if !defined(KERNBUILDDIR) opt_inet.h: Modified: head/sys/modules/ipfw/Makefile ============================================================================== --- head/sys/modules/ipfw/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/ipfw/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -6,7 +6,7 @@ KMOD= ipfw SRCS= ip_fw2.c ip_fw_pfil.c -SRCS+= opt_inet6.h opt_ipsec.h opt_mac.h opt_route.h +SRCS+= opt_inet6.h opt_ipsec.h opt_route.h CFLAGS+= -DIPFIREWALL CFLAGS+= -I${.CURDIR}/../../contrib/pf Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/linux/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -13,7 +13,7 @@ SRCS= linux${SFX}_dummy.c linux_emul.c l linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ - opt_inet6.h opt_route.h opt_mac.h opt_compat.h opt_posix.h vnode_if.h \ + opt_inet6.h opt_route.h opt_compat.h opt_posix.h vnode_if.h \ device_if.h bus_if.h assym.s # XXX: for assym.s Modified: head/sys/modules/mac_lomac/Makefile ============================================================================== --- head/sys/modules/mac_lomac/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/mac_lomac/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -4,7 +4,6 @@ KMOD= mac_lomac SRCS= vnode_if.h \ - opt_mac.h \ mac_lomac.c .include Modified: head/sys/modules/nfsserver/Makefile ============================================================================== --- head/sys/modules/nfsserver/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/nfsserver/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -5,7 +5,6 @@ KMOD= nfsserver SRCS= vnode_if.h \ nfs_fha.c nfs_serv.c nfs_srvkrpc.c nfs_srvsock.c nfs_srvcache.c \ nfs_srvsubs.c nfs_syscalls.c nfs_common.c \ - opt_mac.h \ opt_kgssapi.h \ opt_nfs.h SRCS+= opt_inet6.h Modified: head/sys/modules/pf/Makefile ============================================================================== --- head/sys/modules/pf/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/pf/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -9,7 +9,7 @@ KMOD= pf SRCS = pf.c pf_if.c pf_subr.c pf_osfp.c pf_ioctl.c pf_norm.c pf_table.c \ pf_ruleset.c \ in4_cksum.c \ - opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_mac.h opt_route.h + opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_route.h CFLAGS+= -I${.CURDIR}/../../contrib/pf Modified: head/sys/modules/pseudofs/Makefile ============================================================================== --- head/sys/modules/pseudofs/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/pseudofs/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -3,8 +3,7 @@ .PATH: ${.CURDIR}/../../fs/pseudofs KMOD= pseudofs -SRCS= opt_mac.h \ - opt_pseudofs.h \ +SRCS= opt_pseudofs.h \ vnode_if.h \ pseudofs.c \ pseudofs_fileno.c \ Modified: head/sys/modules/sem/Makefile ============================================================================== --- head/sys/modules/sem/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/sem/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../kern KMOD= sem -SRCS= uipc_sem.c opt_mac.h opt_posix.h vnode_if.h +SRCS= uipc_sem.c opt_posix.h vnode_if.h .include Modified: head/sys/modules/svr4/Makefile ============================================================================== --- head/sys/modules/svr4/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/svr4/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../${MACHINE_ARCH}/svr4 ${.CURDIR}/../../compat/svr4 KMOD= svr4 -SRCS= svr4_sysent.c svr4_sysvec.c opt_compat.h opt_mac.h opt_svr4.h \ +SRCS= svr4_sysent.c svr4_sysvec.c opt_compat.h opt_svr4.h \ vnode_if.h imgact_svr4.c svr4_signal.c svr4_fcntl.c \ svr4_misc.c svr4_ioctl.c svr4_stat.c svr4_filio.c \ svr4_termios.c svr4_stream.c svr4_socket.c svr4_sockio.c \ Modified: head/sys/modules/sysvipc/sysvmsg/Makefile ============================================================================== --- head/sys/modules/sysvipc/sysvmsg/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/sysvipc/sysvmsg/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../../kern KMOD= sysvmsg -SRCS= sysv_msg.c opt_mac.h opt_sysvipc.h +SRCS= sysv_msg.c opt_sysvipc.h .include Modified: head/sys/modules/sysvipc/sysvsem/Makefile ============================================================================== --- head/sys/modules/sysvipc/sysvsem/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/sysvipc/sysvsem/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../../kern KMOD= sysvsem -SRCS= sysv_sem.c opt_mac.h opt_sysvipc.h +SRCS= sysv_sem.c opt_sysvipc.h .include Modified: head/sys/modules/sysvipc/sysvshm/Makefile ============================================================================== --- head/sys/modules/sysvipc/sysvshm/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/sysvipc/sysvshm/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../../kern KMOD= sysvshm -SRCS= sysv_shm.c opt_mac.h opt_sysvipc.h opt_compat.h +SRCS= sysv_shm.c opt_sysvipc.h opt_compat.h .include Modified: head/sys/modules/ufs/Makefile ============================================================================== --- head/sys/modules/ufs/Makefile Sat Jun 6 15:44:07 2009 (r193587) +++ head/sys/modules/ufs/Makefile Sat Jun 6 17:01:44 2009 (r193588) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../ufs/ufs ${.CURDIR}/../../ufs/ffs KMOD= ufs -SRCS= opt_ddb.h opt_directio.h opt_ffs.h opt_ffs_broken_fixme.h opt_mac.h \ +SRCS= opt_ddb.h opt_directio.h opt_ffs.h opt_ffs_broken_fixme.h \ opt_quota.h opt_suiddir.h opt_ufs.h \ vnode_if.h ufs_acl.c ufs_bmap.c ufs_dirhash.c ufs_extattr.c \ ufs_gjournal.c ufs_inode.c ufs_lookup.c ufs_quota.c ufs_vfsops.c \ From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 17:34:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0E52106566C; Sat, 6 Jun 2009 17:34:49 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEAAA8FC08; Sat, 6 Jun 2009 17:34:49 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56HYnnu067344; Sat, 6 Jun 2009 17:34:49 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56HYnD7067343; Sat, 6 Jun 2009 17:34:49 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906061734.n56HYnD7067343@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 6 Jun 2009 17:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193589 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 17:34:50 -0000 Author: des Date: Sat Jun 6 17:34:49 2009 New Revision: 193589 URL: http://svn.freebsd.org/changeset/base/193589 Log: Add missing .Pp Modified: head/lib/libutil/pidfile.3 Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Sat Jun 6 17:01:44 2009 (r193588) +++ head/lib/libutil/pidfile.3 Sat Jun 6 17:34:49 2009 (r193589) @@ -100,6 +100,7 @@ if an error occurs. If an error occurs, .Va errno will be set. +.Pp .Rv -std pidfile_write pidfile_close pidfile_remove .Sh EXAMPLES The following example shows in which order these functions should be used. From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 18:14:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22FC51065674; Sat, 6 Jun 2009 18:14:10 +0000 (UTC) (envelope-from snb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0ECBB8FC2F; Sat, 6 Jun 2009 18:14:10 +0000 (UTC) (envelope-from snb@freebsd.org) Received: from ebi.local (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n56IE7Sm086261; Sat, 6 Jun 2009 18:14:07 GMT (envelope-from snb@freebsd.org) Date: Sat, 6 Jun 2009 20:14:07 +0200 From: Nick Barkas To: Pawel Jakub Dawidek Message-ID: <20090606181405.GA2928@ebi.local> References: <200906030944.n539iM2K045164@svn.freebsd.org> <20090603210652.GD3821@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090603210652.GD3821@garage.freebsd.pl> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, dwmalone@maths.tcd.ie, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193375 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 18:14:10 -0000 On Wed, Jun 03, 2009 at 11:06:52PM +0200, Pawel Jakub Dawidek wrote: > On Wed, Jun 03, 2009 at 09:44:22AM +0000, Sean Nicholas Barkas wrote: > > Author: snb > > Date: Wed Jun 3 09:44:22 2009 > > New Revision: 193375 > > URL: http://svn.freebsd.org/changeset/base/193375 > > > > Log: > > Add vm_lowmem event handler for dirhash. This will cause dirhashes to be > > deleted when the system is low on memory. This ought to allow an increase to > > vfs.ufs.dirhash_maxmem on machines that have lots of memory, without > > degrading performance by having too much memory reserved for dirhash when > > other things need it. The default value for dirhash_maxmem is being kept at > > 2MB for now, though. > > > > This work was mostly done during the 2008 Google Summer of Code. > > > > Approved by: dwmalone (mentor), re > > MFC after: 3 months > [...] > > +static int > > +ufsdirhash_destroy(struct dirhash *dh) > > +{ > [...] > > + /* Remove it from the list and detach its memory. */ > > + TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); > [...] > > +static void > > +ufsdirhash_lowmem() > > +{ > [...] > > + /* > > + * Delete dirhashes not used for more than ufs_dirhashreclaimage > > + * seconds. If we can't get a lock on the dirhash, it will be skipped. > > + */ > > + for (dh = TAILQ_FIRST(&ufsdirhash_list); dh != NULL; dh = > > + TAILQ_NEXT(dh, dh_list)) { > > + if (!sx_try_xlock(&dh->dh_lock)) > > + continue; > > + if (time_second - dh->dh_lastused > ufs_dirhashreclaimage) > > + memfreed += ufsdirhash_destroy(dh); > > + /* Unlock if we didn't delete the dirhash */ > > + else > > + ufsdirhash_release(dh); > > + } > > + > > + /* > > + * If not enough memory was freed, keep deleting hashes from the head > > + * of the dirhash list. The ones closest to the head should be the > > + * oldest. > > + */ > > + for (dh = TAILQ_FIRST(&ufsdirhash_list); memfreed < memwanted && > > + dh !=NULL; dh = TAILQ_NEXT(dh, dh_list)) { > > + if (!sx_try_xlock(&dh->dh_lock)) > > + continue; > > + memfreed += ufsdirhash_destroy(dh); > > + } > > + DIRHASHLIST_UNLOCK(); > > +} > > I don't see how that works. If you remove dh from the tailq in > ufsdirhash_destroy(), you can't do 'dh = TAILQ_NEXT(dh, dh_list)' at the > end of the loop. > > You should use TAILQ_FOREACH_SAFE(3). In the second case you also need to > move this extra check into the loop, probably. Yes, I think you are right. Thanks for catching that. I think that, as written, both loops will only try to delete the first hash they can lock in ufsdirhash_list. I'll try to correct that. > In addition you drop DIRHASHLIST lock in ufsdirhash_destroy() during the > loop. Can't the tailq be modified from elsewhere? Or even from parallel > call to ufsdirhash_lowmem() (I don't think we serialize those)? The lock is held on the tailq while we are doing TAILQ_REMOVE(). It is only released for freeing data structures contained in dirhashes that have been removed from the tailq. I don't see how this would be a problem, but I certainly could be missing something. But, I don't really understand why the lock is dropped within ufsdirhash_destroy(), anyway. Perhaps it is not necessary to do so. I mostly just copied the code needed out of ufsdirhash_recycle() to write ufsdirhash_destroy(). ufsdirhash_recycle() I think could be concurrently called (by ufsdirhash_build()) previously, with the lock on ufsdirhash_list lock dropped in the same place, and I don't think this caused any problems. Nick From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 18:47:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56C641065689; Sat, 6 Jun 2009 18:47:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29CC68FC13; Sat, 6 Jun 2009 18:47:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56Il4ok068852; Sat, 6 Jun 2009 18:47:04 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56Il4l9068850; Sat, 6 Jun 2009 18:47:04 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906061847.n56Il4l9068850@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 6 Jun 2009 18:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193591 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 18:47:04 -0000 Author: des Date: Sat Jun 6 18:47:03 2009 New Revision: 193591 URL: http://svn.freebsd.org/changeset/base/193591 Log: Revert (once again, and hopefully for the last time) to flock(2) locks. The problem with fcntl(2) locks is that they are not inherited by child processes. This breaks pidfile(3), where the common idiom is to open and lock the PID file before daemonizing. Modified: head/lib/libutil/flopen.3 head/lib/libutil/flopen.c Modified: head/lib/libutil/flopen.3 ============================================================================== --- head/lib/libutil/flopen.3 Sat Jun 6 17:55:54 2009 (r193590) +++ head/lib/libutil/flopen.3 Sat Jun 6 18:47:03 2009 (r193591) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2007 +.Dd June 6, 2009 .Dt FLOPEN 3 .Os .Sh NAME @@ -46,13 +46,12 @@ The function opens or creates a file and acquires an exclusive lock on it. It is essentially equivalent with calling .Fn open -with the same parameters followed by an -.Fn fcntl -.Dv F_SETLK -or -.Dv F_SETLKW -operation with lock type -.Dv F_WRLCK , +with the same parameters followed by +.Fn flock +with an +.Va operation +argument of +.Dv LOCK_EX , except that .Fn flopen will attempt to detect and handle races that may occur between opening @@ -87,18 +86,13 @@ returns a valid file descriptor. Otherwise, it returns -1, and sets .Va errno as described in -.Xr fcntl 2 +.Xr flock 2 and .Xr open 2 . .Sh SEE ALSO .Xr errno 2 , -.Xr fcntl 2 , +.Xr flock 2 , .Xr open 2 -.Sh HISTORY -The -.Fn flopen -function first appeared in -.Fx 6.3 . .Sh AUTHORS .An -nosplit The Modified: head/lib/libutil/flopen.c ============================================================================== --- head/lib/libutil/flopen.c Sat Jun 6 17:55:54 2009 (r193590) +++ head/lib/libutil/flopen.c Sat Jun 6 18:47:03 2009 (r193591) @@ -28,12 +28,11 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include -#include #include -#include #include #include @@ -42,7 +41,6 @@ int flopen(const char *path, int flags, ...) { int fd, operation, serrno, trunc; - struct flock lock; struct stat sb, fsb; mode_t mode; @@ -59,10 +57,9 @@ flopen(const char *path, int flags, ...) va_end(ap); } - memset(&lock, 0, sizeof lock); - lock.l_type = ((flags & O_ACCMODE) == O_RDONLY) ? F_RDLCK : F_WRLCK; - lock.l_whence = SEEK_SET; - operation = (flags & O_NONBLOCK) ? F_SETLK : F_SETLKW; + operation = LOCK_EX; + if (flags & O_NONBLOCK) + operation |= LOCK_NB; trunc = (flags & O_TRUNC); flags &= ~O_TRUNC; @@ -71,7 +68,7 @@ flopen(const char *path, int flags, ...) if ((fd = open(path, flags, mode)) == -1) /* non-existent or no access */ return (-1); - if (fcntl(fd, operation, &lock) == -1) { + if (flock(fd, operation) == -1) { /* unsupported or interrupted */ serrno = errno; (void)close(fd); From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 19:07:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E921A106566C; Sat, 6 Jun 2009 19:07:15 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCBFC8FC12; Sat, 6 Jun 2009 19:07:15 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56J7Fqf069362; Sat, 6 Jun 2009 19:07:15 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56J7FI6069361; Sat, 6 Jun 2009 19:07:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906061907.n56J7FI6069361@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 6 Jun 2009 19:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193592 - head/tools/regression/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 19:07:16 -0000 Author: des Date: Sat Jun 6 19:07:15 2009 New Revision: 193592 URL: http://svn.freebsd.org/changeset/base/193592 Log: Check that flopen() can lock against self and that children inherit the lock. Modified: head/tools/regression/lib/libutil/test-flopen.c Modified: head/tools/regression/lib/libutil/test-flopen.c ============================================================================== --- head/tools/regression/lib/libutil/test-flopen.c Sat Jun 6 18:47:03 2009 (r193591) +++ head/tools/regression/lib/libutil/test-flopen.c Sat Jun 6 19:07:15 2009 (r193592) @@ -30,6 +30,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -89,14 +90,13 @@ test_flopen_open(void) return (result); } -#if FLOPEN_CAN_LOCK_AGAINST_SELF /* * Test that flopen() can lock against itself */ const char * test_flopen_lock_self(void) { - const char *fn = "test_flopen_lock"; + const char *fn = "test_flopen_lock_self"; const char *result = NULL; int fd1, fd2; @@ -115,7 +115,6 @@ test_flopen_lock_self(void) unlink(fn); return (result); } -#endif /* * Test that flopen() can lock against other processes @@ -123,7 +122,7 @@ test_flopen_lock_self(void) const char * test_flopen_lock_other(void) { - const char *fn = "test_flopen_lock"; + const char *fn = "test_flopen_lock_other"; const char *result = NULL; volatile int fd1, fd2; @@ -148,16 +147,52 @@ test_flopen_lock_other(void) return (result); } +/* + * Test that child processes inherit the lock + */ +const char * +test_flopen_lock_child(void) +{ + const char *fn = "test_flopen_lock_child"; + const char *result = NULL; + pid_t pid; + volatile int fd1, fd2; + + unlink(fn); + fd1 = flopen(fn, O_RDWR|O_CREAT, 0640); + if (fd1 < 0) { + result = strerror(errno); + } else { + if ((pid = fork()) == 0) { + select(0, 0, 0, 0, 0); + _exit(0); + } + close(fd1); + fd2 = -42; + if (vfork() == 0) { + fd2 = flopen(fn, O_RDWR|O_NONBLOCK); + close(fd2); + _exit(0); + } + if (fd2 == -42) + result = "vfork() doesn't work as expected"; + if (fd2 >= 0) + result = "second open succeeded"; + kill(pid, SIGINT); + } + unlink(fn); + return (result); +} + static struct test { const char *name; const char *(*func)(void); } t[] = { { "flopen_create", test_flopen_create }, { "flopen_open", test_flopen_open }, -#if FLOPEN_CAN_LOCK_AGAINST_SELF { "flopen_lock_self", test_flopen_lock_self }, -#endif { "flopen_lock_other", test_flopen_lock_other }, + { "flopen_lock_child", test_flopen_lock_child }, }; int From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 20:13:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B48C106566B; Sat, 6 Jun 2009 20:13:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 296B48FC0C; Sat, 6 Jun 2009 20:13:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56KDEft070718; Sat, 6 Jun 2009 20:13:14 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56KDEgU070716; Sat, 6 Jun 2009 20:13:14 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906062013.n56KDEgU070716@svn.freebsd.org> From: Alan Cox Date: Sat, 6 Jun 2009 20:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193593 - in head/sys: kern vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 20:13:15 -0000 Author: alc Date: Sat Jun 6 20:13:14 2009 New Revision: 193593 URL: http://svn.freebsd.org/changeset/base/193593 Log: If vm_pager_get_pages() returns VM_PAGER_OK, then there is no need to check the page's valid bits. The page is guaranteed to be fully valid. (For the record, this is documented in vm/vm_pager.h's comments.) Modified: head/sys/kern/kern_exec.c head/sys/vm/vm_glue.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sat Jun 6 19:07:15 2009 (r193592) +++ head/sys/kern/kern_exec.c Sat Jun 6 20:13:14 2009 (r193593) @@ -948,8 +948,7 @@ exec_map_first_page(imgp) initial_pagein = i; rv = vm_pager_get_pages(object, ma, initial_pagein, 0); ma[0] = vm_page_lookup(object, 0); - if ((rv != VM_PAGER_OK) || (ma[0] == NULL) || - (ma[0]->valid == 0)) { + if ((rv != VM_PAGER_OK) || (ma[0] == NULL)) { if (ma[0]) { vm_page_lock_queues(); vm_page_free(ma[0]); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sat Jun 6 19:07:15 2009 (r193592) +++ head/sys/vm/vm_glue.c Sat Jun 6 20:13:14 2009 (r193593) @@ -259,7 +259,7 @@ vm_imgact_hold_page(vm_object_t object, m = vm_page_lookup(object, pindex); if (m == NULL) goto out; - if (m->valid == 0 || rv != VM_PAGER_OK) { + if (rv != VM_PAGER_OK) { vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 21:22:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30C251065687; Sat, 6 Jun 2009 21:22:36 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206192061.chello.pl [87.206.192.61]) by mx1.freebsd.org (Postfix) with ESMTP id 9E5668FC1C; Sat, 6 Jun 2009 21:22:35 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 284F445685; Sat, 6 Jun 2009 23:22:33 +0200 (CEST) Received: from localhost (chello087206192061.chello.pl [87.206.192.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 37F024569A; Sat, 6 Jun 2009 23:22:27 +0200 (CEST) Date: Sat, 6 Jun 2009 23:22:30 +0200 From: Pawel Jakub Dawidek To: Nick Barkas Message-ID: <20090606212229.GD2313@garage.freebsd.pl> References: <200906030944.n539iM2K045164@svn.freebsd.org> <20090603210652.GD3821@garage.freebsd.pl> <20090606181405.GA2928@ebi.local> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d01dLTUuW90fS44H" Content-Disposition: inline In-Reply-To: <20090606181405.GA2928@ebi.local> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, dwmalone@maths.tcd.ie, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193375 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 21:22:36 -0000 --d01dLTUuW90fS44H Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 06, 2009 at 08:14:07PM +0200, Nick Barkas wrote: > On Wed, Jun 03, 2009 at 11:06:52PM +0200, Pawel Jakub Dawidek wrote: > > On Wed, Jun 03, 2009 at 09:44:22AM +0000, Sean Nicholas Barkas wrote: > > > Author: snb > > > Date: Wed Jun 3 09:44:22 2009 > > > New Revision: 193375 > > > URL: http://svn.freebsd.org/changeset/base/193375 > > >=20 > > > Log: > > > Add vm_lowmem event handler for dirhash. This will cause dirhashes = to be > > > deleted when the system is low on memory. This ought to allow an in= crease to > > > vfs.ufs.dirhash_maxmem on machines that have lots of memory, without > > > degrading performance by having too much memory reserved for dirhas= h when > > > other things need it. The default value for dirhash_maxmem is being= kept at > > > 2MB for now, though. > > > =20 > > > This work was mostly done during the 2008 Google Summer of Code. > > > =20 > > > Approved by: dwmalone (mentor), re > > > MFC after: 3 months > > [...] > > > +static int > > > +ufsdirhash_destroy(struct dirhash *dh) > > > +{ > > [...] > > > + /* Remove it from the list and detach its memory. */ > > > + TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); > > [...] > > > +static void > > > +ufsdirhash_lowmem() > > > +{ > > [...] > > > + /*=20 > > > + * Delete dirhashes not used for more than ufs_dirhashreclaimage=20 > > > + * seconds. If we can't get a lock on the dirhash, it will be skipp= ed. > > > + */ > > > + for (dh =3D TAILQ_FIRST(&ufsdirhash_list); dh !=3D NULL; dh =3D=20 > > > + TAILQ_NEXT(dh, dh_list)) { > > > + if (!sx_try_xlock(&dh->dh_lock)) > > > + continue; > > > + if (time_second - dh->dh_lastused > ufs_dirhashreclaimage) > > > + memfreed +=3D ufsdirhash_destroy(dh); > > > + /* Unlock if we didn't delete the dirhash */ > > > + else > > > + ufsdirhash_release(dh); > > > + } > > > + > > > + /*=20 > > > + * If not enough memory was freed, keep deleting hashes from the he= ad=20 > > > + * of the dirhash list. The ones closest to the head should be the= =20 > > > + * oldest.=20 > > > + */ > > > + for (dh =3D TAILQ_FIRST(&ufsdirhash_list); memfreed < memwanted && > > > + dh !=3DNULL; dh =3D TAILQ_NEXT(dh, dh_list)) { > > > + if (!sx_try_xlock(&dh->dh_lock)) > > > + continue; > > > + memfreed +=3D ufsdirhash_destroy(dh); > > > + } > > > + DIRHASHLIST_UNLOCK(); > > > +} > >=20 > > I don't see how that works. If you remove dh from the tailq in > > ufsdirhash_destroy(), you can't do 'dh =3D TAILQ_NEXT(dh, dh_list)' at = the > > end of the loop. > >=20 > > You should use TAILQ_FOREACH_SAFE(3). In the second case you also need = to > > move this extra check into the loop, probably. >=20 > Yes, I think you are right. Thanks for catching that. I think that, as > written, both loops will only try to delete the first hash they can lock > in ufsdirhash_list. I'll try to correct that.=20 >=20 > > In addition you drop DIRHASHLIST lock in ufsdirhash_destroy() during the > > loop. Can't the tailq be modified from elsewhere? Or even from parallel > > call to ufsdirhash_lowmem() (I don't think we serialize those)? >=20 > The lock is held on the tailq while we are doing TAILQ_REMOVE(). It is > only released for freeing data structures contained in dirhashes that > have been removed from the tailq. I don't see how this would be a > problem, but I certainly could be missing something. [...] The ufsdirhash_destroy() function does this: TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); Once you return from ufsdirhash_destroy(), dh is no longer on the queue, so how this is suppose to work: dh =3D TAILQ_NEXT(dh, dh_list)? TAILQ_NEXT() should panic on you when called for element which is not on the queue, but we don't have such strict checks compiled-in by default. Try to define QUEUE_MACRO_DEBUG somewhere in sys/queue.h to get the debug. All in all, if you traverse the queue and want to remove current element from inside the loop, TAILQ_FOREACH_SAFE() is for you. > [...] But, I don't really > understand why the lock is dropped within ufsdirhash_destroy(), anyway. > Perhaps it is not necessary to do so.=20 >=20 > I mostly just copied the code needed out of ufsdirhash_recycle() to > write ufsdirhash_destroy(). ufsdirhash_recycle() I think could be > concurrently called (by ufsdirhash_build()) previously, with the lock on > ufsdirhash_list lock dropped in the same place, and I don't think this > caused any problems. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --d01dLTUuW90fS44H Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKKt4VForvXbEpPzQRAjvPAJwIhUY1dVZSYbHPmadaG7JXtp5qdACePeeS Zj1fgRN4QPs0K0jGmqbcMRQ= =RG7Z -----END PGP SIGNATURE----- --d01dLTUuW90fS44H-- From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 21:23:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B195A10656A3; Sat, 6 Jun 2009 21:23:32 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E4F38FC1E; Sat, 6 Jun 2009 21:23:29 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56LNTMe072184; Sat, 6 Jun 2009 21:23:29 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56LNTe5072183; Sat, 6 Jun 2009 21:23:29 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906062123.n56LNTe5072183@svn.freebsd.org> From: Alan Cox Date: Sat, 6 Jun 2009 21:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193594 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 21:23:33 -0000 Author: alc Date: Sat Jun 6 21:23:29 2009 New Revision: 193594 URL: http://svn.freebsd.org/changeset/base/193594 Log: Eliminate an unneeded forward declaration. (This should have been removed in revision 1.42.) Modified: head/sys/vm/vm_pager.h Modified: head/sys/vm/vm_pager.h ============================================================================== --- head/sys/vm/vm_pager.h Sat Jun 6 20:13:14 2009 (r193593) +++ head/sys/vm/vm_pager.h Sat Jun 6 21:23:29 2009 (r193594) @@ -46,8 +46,6 @@ TAILQ_HEAD(pagerlst, vm_object); -struct bio; - typedef void pgo_init_t(void); typedef vm_object_t pgo_alloc_t(void *, vm_ooffset_t, vm_prot_t, vm_ooffset_t); typedef void pgo_dealloc_t(vm_object_t);