From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 00:38:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0DF3106566B; Sun, 7 Feb 2010 00:38:31 +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 DE4818FC0A; Sun, 7 Feb 2010 00:38:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o170cV87086241; Sun, 7 Feb 2010 00:38:31 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o170cVVA086239; Sun, 7 Feb 2010 00:38:31 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002070038.o170cVVA086239@svn.freebsd.org> From: Xin LI Date: Sun, 7 Feb 2010 00:38: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: r203584 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 00:38:32 -0000 Author: delphij Date: Sun Feb 7 00:38:31 2010 New Revision: 203584 URL: http://svn.freebsd.org/changeset/base/203584 Log: Add files for NO_MAIL, NO_SENDMAIL and NO_MAILWRAPPER. MFC after: 2 weeks Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Feb 7 00:26:47 2010 (r203583) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Feb 7 00:38:31 2010 (r203584) @@ -1536,9 +1536,33 @@ OLD_FILES+=usr/share/man/man8/lpd.8.gz OLD_FILES+=usr/share/man/man8/pac.8.gz .endif -#.if ${MK_MAILWRAPPER} == no -# to be filled in -#.endif +.if ${MK_MAIL} == no +OLD_FILES+=usr/bin/Mail +OLD_FILES+=usr/bin/biff +OLD_FILES+=usr/bin/fmt +OLD_FILES+=usr/bin/from +OLD_FILES+=usr/bin/mail +OLD_FILES+=usr/bin/mailx +OLD_FILES+=usr/bin/msgs +OLD_FILES+=usr/libexec/comsat +OLD_FILES+=usr/share/examples/etc/mail.rc +OLD_FILES+=usr/share/man/man1/Mail.1.gz +OLD_FILES+=usr/share/man/man1/biff.1.gz +OLD_FILES+=usr/share/man/man1/fmt.1.gz +OLD_FILES+=usr/share/man/man1/from.1.gz +OLD_FILES+=usr/share/man/man1/mail.1.gz +OLD_FILES+=usr/share/man/man1/mailx.1.gz +OLD_FILES+=usr/share/man/man1/msgs.1.gz +OLD_FILES+=usr/share/man/man8/comsat.8.gz +OLD_FILES+=usr/share/misc/mail.help +OLD_FILES+=usr/share/misc/mail.tildehelp +.endif + +.if ${MK_MAILWRAPPER} == no +OLD_FILES+=etc/mail/mailer.conf +OLD_FILES+=usr/sbin/mailwrapper +OLD_FILES+=usr/share/man/man8/mailwrapper.8.gz +.endif #.if ${MK_MAN} == no # This should add a dependency to a special target which removes all man pages. @@ -1750,9 +1774,220 @@ OLD_FILES+=usr/share/man/man8/rshd.8.gz # to be filled in or replaced with a special target #.endif -#.if ${MK_SENDMAIL} == no -# to be filled in -#.endif +.if ${MK_SENDMAIL} == no +OLD_FILES+=bin/rmail +OLD_FILES+=usr/bin/vacation +OLD_FILES+=usr/include/libmilter/mfapi.h +OLD_FILES+=usr/include/libmilter/mfdef.h +OLD_FILES+=usr/lib/libmilter.a +OLD_LIBS+=usr/lib/libmilter.so.5 +OLD_FILES+=usr/lib/libmilter_p.a +.if ${TARGET_ARCH} == "amd64" +OLD_FILES+=usr/lib32/libmilter.a +OLD_LIBS+=usr/lib32/libmilter.so.5 +OLD_FILES+=usr/lib32/libmilter_p.a +.endif +OLD_FILES+=usr/libexec/mail.local +OLD_FILES+=usr/libexec/sendmail/sendmail +OLD_FILES+=usr/libexec/smrsh +OLD_FILES+=usr/sbin/editmap +OLD_FILES+=usr/sbin/mailstats +OLD_FILES+=usr/sbin/makemap +OLD_FILES+=usr/sbin/praliases +OLD_FILES+=usr/share/doc/smm/08.sendmailop/paper.ascii.gz +OLD_FILES+=usr/share/man/man1/mailq.1.gz +OLD_FILES+=usr/share/man/man1/newaliases.1.gz +OLD_FILES+=usr/share/man/man1/vacation.1.gz +OLD_FILES+=usr/share/man/man5/aliases.5.gz +OLD_FILES+=usr/share/man/man8/editmap.8.gz +OLD_FILES+=usr/share/man/man8/hoststat.8.gz +OLD_FILES+=usr/share/man/man8/mail.local.8.gz +OLD_FILES+=usr/share/man/man8/mailstats.8.gz +OLD_FILES+=usr/share/man/man8/makemap.8.gz +OLD_FILES+=usr/share/man/man8/praliases.8.gz +OLD_FILES+=usr/share/man/man8/purgestat.8.gz +OLD_FILES+=usr/share/man/man8/rmail.8.gz +OLD_FILES+=usr/share/man/man8/sendmail.8.gz +OLD_FILES+=usr/share/man/man8/smrsh.8.gz +OLD_FILES+=usr/share/sendmail/cf/README +OLD_FILES+=usr/share/sendmail/cf/cf/Makefile +OLD_FILES+=usr/share/sendmail/cf/cf/README +OLD_FILES+=usr/share/sendmail/cf/cf/chez.cs.mc +OLD_FILES+=usr/share/sendmail/cf/cf/clientproto.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-hpux10.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-hpux9.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-osf1.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-solaris2.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-sunos4.1.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cs-ultrix4.mc +OLD_FILES+=usr/share/sendmail/cf/cf/cyrusproto.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-bsd4.4.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-hpux10.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-hpux9.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-linux.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-mpeix.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-nextstep3.3.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-osf1.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-solaris.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-sunos4.1.mc +OLD_FILES+=usr/share/sendmail/cf/cf/generic-ultrix4.mc +OLD_FILES+=usr/share/sendmail/cf/cf/huginn.cs.mc +OLD_FILES+=usr/share/sendmail/cf/cf/knecht.mc +OLD_FILES+=usr/share/sendmail/cf/cf/mail.cs.mc +OLD_FILES+=usr/share/sendmail/cf/cf/mail.eecs.mc +OLD_FILES+=usr/share/sendmail/cf/cf/mailspool.cs.mc +OLD_FILES+=usr/share/sendmail/cf/cf/python.cs.mc +OLD_FILES+=usr/share/sendmail/cf/cf/s2k-osf1.mc +OLD_FILES+=usr/share/sendmail/cf/cf/s2k-ultrix4.mc +OLD_FILES+=usr/share/sendmail/cf/cf/submit.cf +OLD_FILES+=usr/share/sendmail/cf/cf/submit.mc +OLD_FILES+=usr/share/sendmail/cf/cf/tcpproto.mc +OLD_FILES+=usr/share/sendmail/cf/cf/ucbarpa.mc +OLD_FILES+=usr/share/sendmail/cf/cf/ucbvax.mc +OLD_FILES+=usr/share/sendmail/cf/cf/uucpproto.mc +OLD_FILES+=usr/share/sendmail/cf/cf/vangogh.cs.mc +OLD_FILES+=usr/share/sendmail/cf/domain/Berkeley.EDU.m4 +OLD_FILES+=usr/share/sendmail/cf/domain/CS.Berkeley.EDU.m4 +OLD_FILES+=usr/share/sendmail/cf/domain/EECS.Berkeley.EDU.m4 +OLD_FILES+=usr/share/sendmail/cf/domain/S2K.Berkeley.EDU.m4 +OLD_FILES+=usr/share/sendmail/cf/domain/berkeley-only.m4 +OLD_FILES+=usr/share/sendmail/cf/domain/generic.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/accept_unqualified_senders.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/accept_unresolvable_domains.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/access_db.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/allmasquerade.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/always_add_domain.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/authinfo.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/badmx.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/bestmx_is_local.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/bitdomain.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/blacklist_recipients.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/block_bad_helo.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/compat_check.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/conncontrol.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/delay_checks.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/dnsbl.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/domaintable.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/enhdnsbl.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/generics_entire_domain.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/genericstable.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/greet_pause.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/ldap_routing.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/limited_masquerade.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/local_lmtp.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/local_no_masquerade.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/local_procmail.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/lookupdotdomain.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/loose_relay_check.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/mailertable.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/masquerade_entire_domain.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/masquerade_envelope.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/msp.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/mtamark.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/no_default_msa.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/nocanonify.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/notsticky.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/nouucp.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/nullclient.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/preserve_local_plus_detail.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/preserve_luser_host.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/promiscuous_relay.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/queuegroup.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/ratecontrol.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/redirect.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/relay_based_on_MX.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/relay_entire_domain.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/relay_hosts_only.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/relay_local_from.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/relay_mail_from.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/require_rdns.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/smrsh.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/stickyhost.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/use_client_ptr.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/use_ct_file.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/use_cw_file.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/uucpdomain.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/virtuser_entire_domain.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/virtusertable.m4 +OLD_FILES+=usr/share/sendmail/cf/hack/cssubdomain.m4 +OLD_FILES+=usr/share/sendmail/cf/m4/cf.m4 +OLD_FILES+=usr/share/sendmail/cf/m4/cfhead.m4 +OLD_FILES+=usr/share/sendmail/cf/m4/proto.m4 +OLD_FILES+=usr/share/sendmail/cf/m4/version.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/cyrus.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/cyrusv2.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/fax.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/local.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/mail11.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/phquery.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/pop.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/procmail.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/qpage.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/smtp.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/usenet.m4 +OLD_FILES+=usr/share/sendmail/cf/mailer/uucp.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/a-ux.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/aix3.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/aix4.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/aix5.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/altos.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/amdahl-uts.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/bsd4.3.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/bsd4.4.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/bsdi.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/bsdi1.0.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/bsdi2.0.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/darwin.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/dgux.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/domainos.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/dragonfly.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/dynix3.2.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/freebsd4.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/freebsd5.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/freebsd6.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/gnu.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/hpux10.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/hpux11.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/hpux9.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/irix4.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/irix5.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/irix6.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/isc4.1.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/linux.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/maxion.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/mklinux.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/mpeix.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/nextstep.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/openbsd.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/osf1.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/powerux.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/ptx2.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/qnx.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/riscos4.5.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/sco-uw-2.1.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/sco3.2.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/sinix.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/solaris2.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/solaris2.ml.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/solaris2.pre5.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/solaris8.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/sunos3.5.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/sunos4.1.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/svr4.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/ultrix4.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/unicos.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/unicosmk.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/unicosmp.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/unixware7.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/unknown.m4 +OLD_FILES+=usr/share/sendmail/cf/ostype/uxpds.m4 +OLD_FILES+=usr/share/sendmail/cf/sendmail.schema +OLD_FILES+=usr/share/sendmail/cf/sh/makeinfo.sh +OLD_FILES+=usr/share/sendmail/cf/siteconfig/uucp.cogsci.m4 +OLD_FILES+=usr/share/sendmail/cf/siteconfig/uucp.old.arpa.m4 +OLD_FILES+=usr/share/sendmail/cf/siteconfig/uucp.ucbarpa.m4 +OLD_FILES+=usr/share/sendmail/cf/siteconfig/uucp.ucbvax.m4 +.endif #.if ${MK_SHAREDOCS} == no # to be filled in From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 01:07:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDDA2106566C; Sun, 7 Feb 2010 01:07:58 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDF228FC12; Sun, 7 Feb 2010 01:07:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1717w6d092708; Sun, 7 Feb 2010 01:07:58 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1717wPI092703; Sun, 7 Feb 2010 01:07:58 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201002070107.o1717wPI092703@svn.freebsd.org> From: Tim Kientzle Date: Sun, 7 Feb 2010 01:07: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: r203586 - head/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 01:07:59 -0000 Author: kientzle Date: Sun Feb 7 01:07:58 2010 New Revision: 203586 URL: http://svn.freebsd.org/changeset/base/203586 Log: Trim out some unused configuration variables, remove some unused headers, etc. Modified: head/usr.bin/tar/bsdtar.c head/usr.bin/tar/bsdtar_platform.h head/usr.bin/tar/config_freebsd.h head/usr.bin/tar/write.c Modified: head/usr.bin/tar/bsdtar.c ============================================================================== --- head/usr.bin/tar/bsdtar.c Sun Feb 7 00:46:17 2010 (r203585) +++ head/usr.bin/tar/bsdtar.c Sun Feb 7 01:07:58 2010 (r203586) @@ -63,9 +63,6 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_UNISTD_H #include #endif -#if HAVE_ZLIB_H -#include -#endif #include "bsdtar.h" #include "err.h" Modified: head/usr.bin/tar/bsdtar_platform.h ============================================================================== --- head/usr.bin/tar/bsdtar_platform.h Sun Feb 7 00:46:17 2010 (r203585) +++ head/usr.bin/tar/bsdtar_platform.h Sun Feb 7 01:07:58 2010 (r203586) @@ -64,29 +64,6 @@ #endif /* - * Does this platform have complete-looking POSIX-style ACL support, - * including some variant of the acl_get_perm() function (which was - * omitted from the POSIX.1e draft)? - */ -#if HAVE_SYS_ACL_H && HAVE_ACL_PERMSET_T && HAVE_ACL_USER -#if HAVE_ACL_GET_PERM || HAVE_ACL_GET_PERM_NP -#define HAVE_POSIX_ACL 1 -#endif -#endif - -#ifdef HAVE_LIBACL -#include -#endif - -#if HAVE_ACL_GET_PERM -#define ACL_GET_PERM acl_get_perm -#else -#if HAVE_ACL_GET_PERM_NP -#define ACL_GET_PERM acl_get_perm_np -#endif -#endif - -/* * Include "dirent.h" (or it's equivalent on several different platforms). * * This is slightly modified from the GNU autoconf recipe. Modified: head/usr.bin/tar/config_freebsd.h ============================================================================== --- head/usr.bin/tar/config_freebsd.h Sun Feb 7 00:46:17 2010 (r203585) +++ head/usr.bin/tar/config_freebsd.h Sun Feb 7 01:07:58 2010 (r203586) @@ -26,21 +26,10 @@ */ /* A default configuration for FreeBSD, used if there is no config.h. */ - #include /* __FreeBSD_version */ -#if __FreeBSD__ > 4 -#define HAVE_ACL_GET_PERM 0 -#define HAVE_ACL_GET_PERM_NP 1 -#define HAVE_ACL_PERMSET_T 1 -#define HAVE_ACL_USER 1 -#endif #undef HAVE_ATTR_XATTR_H -#define HAVE_BZLIB_H 1 -#define HAVE_CHFLAGS 1 #define HAVE_CHROOT 1 -#define HAVE_DECL_OPTARG 1 -#define HAVE_DECL_OPTIND 1 #define HAVE_DIRENT_D_NAMLEN 1 #define HAVE_DIRENT_H 1 #define HAVE_D_MD_ORDER 1 @@ -51,26 +40,13 @@ #define HAVE_FNMATCH 1 #define HAVE_FNMATCH_H 1 #define HAVE_FNM_LEADING_DIR 1 -#define HAVE_FTRUNCATE 1 -#undef HAVE_GETXATTR #define HAVE_GRP_H 1 -#define HAVE_INTTYPES_H 1 #define HAVE_LANGINFO_H 1 -#undef HAVE_LGETXATTR -#undef HAVE_LIBACL #define HAVE_LIBARCHIVE 1 -#define HAVE_LIBBZ2 1 -#define HAVE_LIBZ 1 #define HAVE_LIMITS_H 1 #undef HAVE_LINUX_EXT2_FS_H #undef HAVE_LINUX_FS_H -#undef HAVE_LISTXATTR -#undef HAVE_LLISTXATTR #define HAVE_LOCALE_H 1 -#define HAVE_MALLOC 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMORY_H 1 -#define HAVE_MEMSET 1 #if __FreeBSD_version >= 450002 /* nl_langinfo introduced */ #define HAVE_NL_LANGINFO 1 #endif @@ -79,19 +55,11 @@ #define HAVE_REGEX_H 1 #define HAVE_SETLOCALE 1 #define HAVE_STDARG_H 1 -#define HAVE_STDINT_H 1 #define HAVE_STDLIB_H 1 -#define HAVE_STRCHR 1 -#define HAVE_STRDUP 1 -#define HAVE_STRERROR 1 -#define HAVE_STRFTIME 1 -#define HAVE_STRINGS_H 1 #define HAVE_STRING_H 1 -#define HAVE_STRRCHR 1 #define HAVE_STRUCT_STAT_ST_FLAGS 1 #undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC #define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1 -#define HAVE_SYS_ACL_H 1 #define HAVE_SYS_IOCTL_H 1 #define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_STAT_H 1 @@ -100,9 +68,5 @@ #define HAVE_UINTMAX_T 1 #define HAVE_UNISTD_H 1 #define HAVE_UNSIGNED_LONG_LONG -#define HAVE_VPRINTF 1 #define HAVE_WCTYPE_H 1 -#define HAVE_ZLIB_H 1 #undef MAJOR_IN_MKDEV -#define STDC_HEADERS 1 - Modified: head/usr.bin/tar/write.c ============================================================================== --- head/usr.bin/tar/write.c Sun Feb 7 00:46:17 2010 (r203585) +++ head/usr.bin/tar/write.c Sun Feb 7 01:07:58 2010 (r203586) @@ -29,9 +29,6 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_SYS_ACL_H -#include -#endif #ifdef HAVE_SYS_IOCTL_H #include #endif From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 01:16:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F2B3106566B; Sun, 7 Feb 2010 01:16:06 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 661008FC17; Sun, 7 Feb 2010 01:16:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o171G6jM094553; Sun, 7 Feb 2010 01:16:06 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o171G696094551; Sun, 7 Feb 2010 01:16:06 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201002070116.o171G696094551@svn.freebsd.org> From: Tim Kientzle Date: Sun, 7 Feb 2010 01:16: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: r203587 - head/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 01:16:06 -0000 Author: kientzle Date: Sun Feb 7 01:16:05 2010 New Revision: 203587 URL: http://svn.freebsd.org/changeset/base/203587 Log: Minor code rework. Modified: head/usr.bin/tar/getdate.c Modified: head/usr.bin/tar/getdate.c ============================================================================== --- head/usr.bin/tar/getdate.c Sun Feb 7 01:07:58 2010 (r203586) +++ head/usr.bin/tar/getdate.c Sun Feb 7 01:16:05 2010 (r203587) @@ -219,7 +219,8 @@ datephrase(struct gdstate *gds) gds->Year = gds->tokenp[0].value; gds->Month = gds->tokenp[2].value; gds->Day = gds->tokenp[4].value; - } else if ((gds->tokenp[4].value >= 13) || (gds->tokenp[2].value >= 13)) { + } else if ((gds->tokenp[4].value >= 13) + || (gds->tokenp[2].value >= 13)) { /* Last number is big: 01/07/98 */ /* Middle number is big: 01/29/04 */ gds->Month = gds->tokenp[0].value; @@ -681,20 +682,6 @@ static struct LEXICON { }; /* - * Convert hour/minute/second to count of seconds. - */ -static time_t -ToSeconds(time_t Hours, time_t Minutes, time_t Seconds) -{ - if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59) - return -1; - if (Hours < 0 || Hours > 23) - return -1; - return Hours * HOUR + Minutes * MINUTE + Seconds; -} - - -/* * Year is either: * = A number from 0 to 99, which means a year from 1970 to 2069, or * = The actual year (>=100). @@ -707,7 +694,6 @@ Convert(time_t Month, time_t Day, time_t static int DaysInMonth[12] = { 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - time_t tod; time_t Julian; int i; @@ -722,7 +708,10 @@ Convert(time_t Month, time_t Day, time_t if (Year < EPOCH || Year > 2038 || Month < 1 || Month > 12 /* Lint fluff: "conversion from long may lose accuracy" */ - || Day < 1 || Day > DaysInMonth[(int)--Month]) + || Day < 1 || Day > DaysInMonth[(int)--Month] + || Hours < 0 || Hours > 23 + || Minutes < 0 || Minutes > 59 + || Seconds < 0 || Seconds > 59) return -1; Julian = Day - 1; @@ -732,9 +721,7 @@ Convert(time_t Month, time_t Day, time_t Julian += 365 + (i % 4 == 0); Julian *= DAY; Julian += Timezone; - if ((tod = ToSeconds(Hours, Minutes, Seconds)) < 0) - return -1; - Julian += tod; + Julian += Hours * HOUR + Minutes * MINUTE + Seconds; if (DSTmode == DSTon || (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst)) Julian -= HOUR; @@ -838,7 +825,7 @@ nexttoken(char **in, time_t *value) } src++; } - buff[i++] = '\0'; + buff[i] = '\0'; /* * Find the first match. If the word can be From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 01:22:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AA9F106566C; Sun, 7 Feb 2010 01:22:56 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5C2F8FC12; Sun, 7 Feb 2010 01:22:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o171MtHq096119; Sun, 7 Feb 2010 01:22:55 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o171Mt43096117; Sun, 7 Feb 2010 01:22:55 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201002070122.o171Mt43096117@svn.freebsd.org> From: Tim Kientzle Date: Sun, 7 Feb 2010 01:22: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: r203588 - head/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 01:22:56 -0000 Author: kientzle Date: Sun Feb 7 01:22:55 2010 New Revision: 203588 URL: http://svn.freebsd.org/changeset/base/203588 Log: Restructure the logic that determines when we're crossing a mount point. In particular, this carves out a place for detecting and excluding synthetic or network filesystems. Modified: head/usr.bin/tar/write.c Modified: head/usr.bin/tar/write.c ============================================================================== --- head/usr.bin/tar/write.c Sun Feb 7 01:16:05 2010 (r203587) +++ head/usr.bin/tar/write.c Sun Feb 7 01:22:55 2010 (r203588) @@ -82,8 +82,8 @@ __FBSDID("$FreeBSD$"); #endif #include "bsdtar.h" -#include "tree.h" #include "err.h" +#include "tree.h" /* Size of buffer for holding file data prior to writing. */ #define FILEDATABUFLEN 65536 @@ -733,17 +733,38 @@ write_hierarchy(struct bsdtar *bsdtar, s } /* - * If user has asked us not to cross mount points, - * then don't descend into into a dir on a different - * device. + * Are we about to cross to a new filesystem? */ if (!dev_recorded) { + /* This is the initial file system. */ first_dev = lst->st_dev; dev_recorded = 1; - } - if (bsdtar->option_dont_traverse_mounts) { - if (lst->st_dev != first_dev) - descend = 0; + } else if (lst->st_dev == first_dev) { + /* The starting file system is always acceptable. */ + } else if (descend == 0) { + /* We're not descending, so no need to check. */ + } else if (bsdtar->option_dont_traverse_mounts) { + /* User has asked us not to cross mount points. */ + descend = 0; + } else { + /* We're prepared to cross a mount point. */ + + /* XXX TODO: check whether this filesystem is + * synthetic and/or local. Add a new + * --local-only option to skip non-local + * filesystems. Skip synthetic filesystems + * regardless. + * + * The results should be cached, since + * tree.c doesn't usually visit a directory + * and the directory contents together. A simple + * move-to-front list should perform quite well. + * + * This is going to be heavily OS dependent: + * FreeBSD's statfs() in conjunction with getvfsbyname() + * provides all of this; NetBSD's statvfs() does + * most of it; other systems will vary. + */ } /* From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 01:26:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CDC31065694; Sun, 7 Feb 2010 01:26:45 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82E188FC08; Sun, 7 Feb 2010 01:26:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o171Qj4O096980; Sun, 7 Feb 2010 01:26:45 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o171Qj6u096977; Sun, 7 Feb 2010 01:26:45 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201002070126.o171Qj6u096977@svn.freebsd.org> From: Tim Kientzle Date: Sun, 7 Feb 2010 01:26: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: r203589 - head/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 01:26:45 -0000 Author: kientzle Date: Sun Feb 7 01:26:45 2010 New Revision: 203589 URL: http://svn.freebsd.org/changeset/base/203589 Log: Various portability workarounds for non-FreeBSD platforms. Modified: head/usr.bin/tar/bsdtar.c head/usr.bin/tar/write.c Modified: head/usr.bin/tar/bsdtar.c ============================================================================== --- head/usr.bin/tar/bsdtar.c Sun Feb 7 01:22:55 2010 (r203588) +++ head/usr.bin/tar/bsdtar.c Sun Feb 7 01:26:45 2010 (r203589) @@ -82,6 +82,10 @@ __FBSDID("$FreeBSD$"); #define _PATH_DEFTAPE "/dev/tape" #endif +#ifdef __MINGW32__ +int _CRT_glob = 0; /* Disable broken CRT globbing. */ +#endif + #if defined(HAVE_SIGACTION) && (defined(SIGINFO) || defined(SIGUSR1)) static volatile int siginfo_occurred; Modified: head/usr.bin/tar/write.c ============================================================================== --- head/usr.bin/tar/write.c Sun Feb 7 01:22:55 2010 (r203588) +++ head/usr.bin/tar/write.c Sun Feb 7 01:26:45 2010 (r203589) @@ -139,6 +139,23 @@ static int write_file_data(struct bsdt static void write_hierarchy(struct bsdtar *, struct archive *, const char *); +#if defined(_WIN32) && !defined(__CYGWIN__) +/* Not a full lseek() emulation, but enough for our needs here. */ +static int +seek_file(int fd, int64_t offset, int whence) +{ + LARGE_INTEGER distance; + (void)whence; /* UNUSED */ + distance.QuadPart = offset; + return (SetFilePointerEx((HANDLE)_get_osfhandle(fd), + distance, NULL, FILE_BEGIN) ? 1 : -1); +} +#define open _open +#define close _close +#define read _read +#define lseek seek_file +#endif + void tar_mode_c(struct bsdtar *bsdtar) { @@ -236,7 +253,11 @@ tar_mode_r(struct bsdtar *bsdtar) format = ARCHIVE_FORMAT_TAR_PAX_RESTRICTED; +#if defined(__BORLANDC__) + bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT); +#else bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT, 0666); +#endif if (bsdtar->fd < 0) bsdtar_errc(1, errno, "Cannot open %s", bsdtar->filename); @@ -451,12 +472,7 @@ write_archive(struct archive *a, struct arg + 1) != 0) break; } else -#if defined(_WIN32) && !defined(__CYGWIN__) - write_hierarchy_win(bsdtar, a, arg, - write_hierarchy); -#else write_hierarchy(bsdtar, a, arg); -#endif } bsdtar->argv++; } @@ -786,6 +802,22 @@ write_hierarchy(struct bsdtar *bsdtar, s * calling this so we can pass in an fd and shorten * the race to query metadata. The linkify dance * makes this more complex than it might sound. */ +#if defined(_WIN32) && !defined(__CYGWIN__) + /* TODO: tree.c uses stat(), which is badly broken + * on Windows. To fix this, we should + * deprecate tree_current_stat() and provide a new + * call tree_populate_entry(t, entry). This call + * would use stat() internally on POSIX and + * GetInfoByFileHandle() internally on Windows. + * This would be another step towards a tree-walker + * that can be integrated deep into libarchive. + * For now, just set st to NULL on Windows; + * archive_read_disk_entry_from_file() should + * be smart enough to use platform-appropriate + * ways to probe file information. + */ + st = NULL; +#endif r = archive_read_disk_entry_from_file(bsdtar->diskreader, entry, -1, st); if (r != ARCHIVE_OK) @@ -801,7 +833,7 @@ write_hierarchy(struct bsdtar *bsdtar, s * If this file/dir is flagged "nodump" and we're * honoring such flags, skip this file/dir. */ -#ifdef HAVE_STRUCT_STAT_ST_FLAGS +#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP) /* BSD systems store flags in struct stat */ if (bsdtar->option_honor_nodump && (lst->st_flags & UF_NODUMP)) @@ -1092,4 +1124,11 @@ test_for_append(struct bsdtar *bsdtar) bsdtar_errc(1, 0, "Cannot append to %s: not a regular file.", bsdtar->filename); + +/* Is this an appropriate check here on Windows? */ +/* + if (GetFileType(handle) != FILE_TYPE_DISK) + bsdtar_errc(1, 0, "Cannot append"); +*/ + } From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 01:35:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C8E4106566C; Sun, 7 Feb 2010 01:35:28 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CA798FC18; Sun, 7 Feb 2010 01:35:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o171ZSD7098928; Sun, 7 Feb 2010 01:35:28 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o171ZSrM098925; Sun, 7 Feb 2010 01:35:28 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201002070135.o171ZSrM098925@svn.freebsd.org> From: Tim Kientzle Date: Sun, 7 Feb 2010 01:35: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: r203590 - head/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 01:35:28 -0000 Author: kientzle Date: Sun Feb 7 01:35:28 2010 New Revision: 203590 URL: http://svn.freebsd.org/changeset/base/203590 Log: Style & Portability: Use archive_entry methods to examine file information, change some functions to static, remove some unused headers. Modified: head/usr.bin/tar/read.c head/usr.bin/tar/write.c Modified: head/usr.bin/tar/read.c ============================================================================== --- head/usr.bin/tar/read.c Sun Feb 7 01:26:45 2010 (r203589) +++ head/usr.bin/tar/read.c Sun Feb 7 01:35:28 2010 (r203590) @@ -29,11 +29,6 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef MAJOR_IN_MKDEV -#include -#elif defined(MAJOR_IN_SYSMACROS) -#include -#endif #ifdef HAVE_SYS_PARAM_H #include #endif @@ -346,7 +341,6 @@ read_archive(struct bsdtar *bsdtar, char static void list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry) { - const struct stat *st; char tmp[100]; size_t w; const char *p; @@ -354,8 +348,6 @@ list_item_verbose(struct bsdtar *bsdtar, time_t tim; static time_t now; - st = archive_entry_stat(entry); - /* * We avoid collecting the entire list in memory at once by * listing things as we see them. However, that also means we can't @@ -371,12 +363,13 @@ list_item_verbose(struct bsdtar *bsdtar, time(&now); fprintf(out, "%s %d ", archive_entry_strmode(entry), - (int)(st->st_nlink)); + archive_entry_nlink(entry)); /* Use uname if it's present, else uid. */ p = archive_entry_uname(entry); if ((p == NULL) || (*p == '\0')) { - sprintf(tmp, "%lu ", (unsigned long)st->st_uid); + sprintf(tmp, "%lu ", + (unsigned long)archive_entry_uid(entry)); p = tmp; } w = strlen(p); @@ -390,7 +383,8 @@ list_item_verbose(struct bsdtar *bsdtar, fprintf(out, "%s", p); w = strlen(p); } else { - sprintf(tmp, "%lu", (unsigned long)st->st_gid); + sprintf(tmp, "%lu", + (unsigned long)archive_entry_gid(entry)); w = strlen(tmp); fprintf(out, "%s", tmp); } @@ -400,37 +394,30 @@ list_item_verbose(struct bsdtar *bsdtar, * total width of group and devnum/filesize fields be gs_width. * If gs_width is too small, grow it. */ - if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) { + if (archive_entry_filetype(entry) == AE_IFCHR + || archive_entry_filetype(entry) == AE_IFBLK) { sprintf(tmp, "%lu,%lu", - (unsigned long)major(st->st_rdev), - (unsigned long)minor(st->st_rdev)); /* ls(1) also casts here. */ + (unsigned long)archive_entry_rdevmajor(entry), + (unsigned long)archive_entry_rdevminor(entry)); } else { - /* - * Note the use of platform-dependent macros to format - * the filesize here. We need the format string and the - * corresponding type for the cast. - */ - sprintf(tmp, BSDTAR_FILESIZE_PRINTF, - (BSDTAR_FILESIZE_TYPE)st->st_size); + strcpy(tmp, tar_i64toa(archive_entry_size(entry))); } if (w + strlen(tmp) >= bsdtar->gs_width) bsdtar->gs_width = w+strlen(tmp)+1; fprintf(out, "%*s", (int)(bsdtar->gs_width - w), tmp); /* Format the time using 'ls -l' conventions. */ - tim = (time_t)st->st_mtime; + tim = archive_entry_mtime(entry); +#define HALF_YEAR (time_t)365 * 86400 / 2 #if defined(_WIN32) && !defined(__CYGWIN__) - /* Windows' strftime function does not support %e format. */ - if (abs(tim - now) > (365/2)*86400) - fmt = bsdtar->day_first ? "%d %b %Y" : "%b %d %Y"; - else - fmt = bsdtar->day_first ? "%d %b %H:%M" : "%b %d %H:%M"; +#define DAY_FMT "%d" /* Windows' strftime function does not support %e format. */ #else - if (abs(tim - now) > (365/2)*86400) - fmt = bsdtar->day_first ? "%e %b %Y" : "%b %e %Y"; - else - fmt = bsdtar->day_first ? "%e %b %H:%M" : "%b %e %H:%M"; +#define DAY_FMT "%e" /* Day number without leading zeros */ #endif + if (tim < now - HALF_YEAR || tim > now + HALF_YEAR) + fmt = bsdtar->day_first ? DAY_FMT " %b %Y" : "%b " DAY_FMT " %Y"; + else + fmt = bsdtar->day_first ? DAY_FMT " %b %H:%M" : "%b " DAY_FMT " %H:%M"; strftime(tmp, sizeof(tmp), fmt, localtime(&tim)); fprintf(out, " %s ", tmp); safe_fprintf(out, "%s", archive_entry_pathname(entry)); @@ -439,6 +426,6 @@ list_item_verbose(struct bsdtar *bsdtar, if (archive_entry_hardlink(entry)) /* Hard link */ safe_fprintf(out, " link to %s", archive_entry_hardlink(entry)); - else if (S_ISLNK(st->st_mode)) /* Symbolic link */ + else if (archive_entry_symlink(entry)) /* Symbolic link */ safe_fprintf(out, " -> %s", archive_entry_symlink(entry)); } Modified: head/usr.bin/tar/write.c ============================================================================== --- head/usr.bin/tar/write.c Sun Feb 7 01:26:45 2010 (r203589) +++ head/usr.bin/tar/write.c Sun Feb 7 01:35:28 2010 (r203590) @@ -44,9 +44,6 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_FCNTL_H #include #endif -#ifdef HAVE_FNMATCH_H -#include -#endif #ifdef HAVE_GRP_H #include #endif @@ -514,7 +511,7 @@ cleanup: * cause the next line to be a directory to pass to chdir(). If * --null is specified, then a line "-C" is just another filename. */ -void +static void archive_names_from_file(struct bsdtar *bsdtar, struct archive *a) { bsdtar->archive = a; @@ -679,7 +676,7 @@ write_hierarchy(struct bsdtar *bsdtar, s return; } - while ((tree_ret = tree_next(tree))) { + while ((tree_ret = tree_next(tree)) != 0) { int r; const char *name = tree_current_path(tree); const struct stat *st = NULL; /* info to use for this entry */ @@ -882,7 +879,7 @@ write_hierarchy(struct bsdtar *bsdtar, s archive_entry_pathname(entry)); /* Non-regular files get archived with zero size. */ - if (!S_ISREG(st->st_mode)) + if (archive_entry_filetype(entry) != AE_IFREG) archive_entry_set_size(entry, 0); archive_entry_linkify(bsdtar->resolver, &entry, &spare_entry); @@ -1016,7 +1013,7 @@ write_file_data(struct bsdtar *bsdtar, s /* * Test if the specified file is new enough to include in the archive. */ -int +static int new_enough(struct bsdtar *bsdtar, const char *path, const struct stat *st) { struct archive_dir_entry *p; @@ -1103,7 +1100,7 @@ add_dir_list(struct bsdtar *bsdtar, cons } } -void +static void test_for_append(struct bsdtar *bsdtar) { struct stat s; From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 02:00:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70AD5106566B; Sun, 7 Feb 2010 02:00:26 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F3318FC0C; Sun, 7 Feb 2010 02:00:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1720QmL004685; Sun, 7 Feb 2010 02:00:26 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1720QPj004674; Sun, 7 Feb 2010 02:00:26 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201002070200.o1720QPj004674@svn.freebsd.org> From: Tim Kientzle Date: Sun, 7 Feb 2010 02:00: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: r203593 - head/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 02:00:26 -0000 Author: kientzle Date: Sun Feb 7 02:00:26 2010 New Revision: 203593 URL: http://svn.freebsd.org/changeset/base/203593 Log: Merge a bunch of refactoring from Joerg Sonnenberger to isolate common code used by tar and cpio (and useful to other libarchive clients). The functions here are prefixed with "lafe" (libarchive front-end) to indicate their use. Added: head/usr.bin/tar/line_reader.c (contents, props changed) head/usr.bin/tar/line_reader.h (contents, props changed) head/usr.bin/tar/matching.h (contents, props changed) head/usr.bin/tar/pathmatch.c (contents, props changed) head/usr.bin/tar/pathmatch.h (contents, props changed) Modified: head/usr.bin/tar/Makefile head/usr.bin/tar/bsdtar.c head/usr.bin/tar/bsdtar.h head/usr.bin/tar/config_freebsd.h head/usr.bin/tar/matching.c head/usr.bin/tar/read.c head/usr.bin/tar/util.c head/usr.bin/tar/write.c Modified: head/usr.bin/tar/Makefile ============================================================================== --- head/usr.bin/tar/Makefile Sun Feb 7 01:54:14 2010 (r203592) +++ head/usr.bin/tar/Makefile Sun Feb 7 02:00:26 2010 (r203593) @@ -7,7 +7,9 @@ SRCS= bsdtar.c \ cmdline.c \ err.c \ getdate.c \ + line_reader.c \ matching.c \ + pathmatch.c \ read.c \ subst.c \ tree.c \ Modified: head/usr.bin/tar/bsdtar.c ============================================================================== --- head/usr.bin/tar/bsdtar.c Sun Feb 7 01:54:14 2010 (r203592) +++ head/usr.bin/tar/bsdtar.c Sun Feb 7 02:00:26 2010 (r203593) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include "bsdtar.h" #include "err.h" +#include "matching.h" /* * Per POSIX.1-1988, tar defaults to reading/writing archives to/from @@ -248,7 +249,7 @@ main(int argc, char **argv) bsdtar->option_chroot = 1; break; case OPTION_EXCLUDE: /* GNU tar */ - if (exclude(bsdtar, bsdtar->optarg)) + if (lafe_exclude(&bsdtar->matching, bsdtar->optarg)) bsdtar_errc(1, 0, "Couldn't exclude %s\n", bsdtar->optarg); break; @@ -294,7 +295,7 @@ main(int argc, char **argv) * noone else needs this to filter entries * when transforming archives. */ - if (include(bsdtar, bsdtar->optarg)) + if (lafe_include(&bsdtar->matching, bsdtar->optarg)) bsdtar_errc(1, 0, "Failed to add %s to inclusion list", bsdtar->optarg); @@ -484,7 +485,7 @@ main(int argc, char **argv) bsdtar->option_interactive = 1; break; case 'X': /* GNU tar */ - if (exclude_from_file(bsdtar, bsdtar->optarg)) + if (lafe_exclude_from_file(&bsdtar->matching, bsdtar->optarg)) bsdtar_errc(1, 0, "failed to process exclusions from file %s", bsdtar->optarg); @@ -607,7 +608,7 @@ main(int argc, char **argv) break; } - cleanup_exclusions(bsdtar); + lafe_cleanup_exclusions(&bsdtar->matching); #if HAVE_REGEX_H cleanup_substitution(bsdtar); #endif Modified: head/usr.bin/tar/bsdtar.h ============================================================================== --- head/usr.bin/tar/bsdtar.h Sun Feb 7 01:54:14 2010 (r203592) +++ head/usr.bin/tar/bsdtar.h Sun Feb 7 02:00:26 2010 (r203593) @@ -28,6 +28,8 @@ #include "bsdtar_platform.h" #include +#include "matching.h" + #define DEFAULT_BYTES_PER_BLOCK (20*512) /* @@ -77,7 +79,6 @@ struct bsdtar { int fd; /* Miscellaneous state information */ - struct archive *archive; int argc; char **argv; const char *optarg; @@ -97,7 +98,7 @@ struct bsdtar { struct archive_dir *archive_dir; /* for write.c */ struct name_cache *gname_cache; /* for write.c */ char *buff; /* for write.c */ - struct matching *matching; /* for matching.c */ + struct lafe_matching *matching; /* for matching.c */ struct security *security; /* for read.c */ struct name_cache *uname_cache; /* for write.c */ struct siginfo_data *siginfo; /* for siginfo.c */ @@ -134,18 +135,10 @@ enum { }; int bsdtar_getopt(struct bsdtar *); -void cleanup_exclusions(struct bsdtar *); void do_chdir(struct bsdtar *); int edit_pathname(struct bsdtar *, struct archive_entry *); -int exclude(struct bsdtar *, const char *pattern); -int exclude_from_file(struct bsdtar *, const char *pathname); -int excluded(struct bsdtar *, const char *pathname); -int include(struct bsdtar *, const char *pattern); -int include_from_file(struct bsdtar *, const char *pathname); int need_report(void); int pathcmp(const char *a, const char *b); -int process_lines(struct bsdtar *bsdtar, const char *pathname, - int (*process)(struct bsdtar *, const char *)); void safe_fprintf(FILE *, const char *fmt, ...); void set_chdir(struct bsdtar *, const char *newdir); const char *tar_i64toa(int64_t); @@ -154,8 +147,6 @@ void tar_mode_r(struct bsdtar *bsdtar); void tar_mode_t(struct bsdtar *bsdtar); void tar_mode_u(struct bsdtar *bsdtar); void tar_mode_x(struct bsdtar *bsdtar); -int unmatched_inclusions(struct bsdtar *bsdtar); -int unmatched_inclusions_warn(struct bsdtar *bsdtar, const char *msg); void usage(void); int yes(const char *fmt, ...); Modified: head/usr.bin/tar/config_freebsd.h ============================================================================== --- head/usr.bin/tar/config_freebsd.h Sun Feb 7 01:54:14 2010 (r203592) +++ head/usr.bin/tar/config_freebsd.h Sun Feb 7 02:00:26 2010 (r203593) @@ -37,9 +37,6 @@ #undef HAVE_EXT2FS_EXT2_FS_H #define HAVE_FCHDIR 1 #define HAVE_FCNTL_H 1 -#define HAVE_FNMATCH 1 -#define HAVE_FNMATCH_H 1 -#define HAVE_FNM_LEADING_DIR 1 #define HAVE_GRP_H 1 #define HAVE_LANGINFO_H 1 #define HAVE_LIBARCHIVE 1 Added: head/usr.bin/tar/line_reader.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/tar/line_reader.c Sun Feb 7 02:00:26 2010 (r203593) @@ -0,0 +1,171 @@ +/*- + * Copyright (c) 2008 Tim Kientzle + * 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 + * in this position and unchanged. + * 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(S) ``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(S) 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 "bsdtar_platform.h" +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include "err.h" +#include "line_reader.h" + +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) +#define strdup _strdup +#endif + +/* + * Read lines from file and do something with each one. If option_null + * is set, lines are terminated with zero bytes; otherwise, they're + * terminated with newlines. + * + * This uses a self-sizing buffer to handle arbitrarily-long lines. + */ +struct lafe_line_reader { + FILE *f; + char *buff, *buff_end, *line_start, *line_end, *p; + char *pathname; + size_t buff_length; + int nullSeparator; /* Lines separated by null, not CR/CRLF/etc. */ + int ret; +}; + +struct lafe_line_reader * +lafe_line_reader(const char *pathname, int nullSeparator) +{ + struct lafe_line_reader *lr; + + lr = calloc(1, sizeof(*lr)); + if (lr == NULL) + bsdtar_errc(1, ENOMEM, "Can't open %s", pathname); + + lr->nullSeparator = nullSeparator; + lr->pathname = strdup(pathname); + + if (strcmp(pathname, "-") == 0) + lr->f = stdin; + else + lr->f = fopen(pathname, "r"); + if (lr->f == NULL) + bsdtar_errc(1, errno, "Couldn't open %s", pathname); + lr->buff_length = 8192; + lr->buff = malloc(lr->buff_length); + if (lr->buff == NULL) + bsdtar_errc(1, ENOMEM, "Can't read %s", pathname); + lr->line_start = lr->line_end = lr->buff_end = lr->buff; + + return (lr); +} + +const char * +lafe_line_reader_next(struct lafe_line_reader *lr) +{ + size_t bytes_wanted, bytes_read, new_buff_size; + char *line_start, *p; + + for (;;) { + /* If there's a line in the buffer, return it immediately. */ + while (lr->line_end < lr->buff_end) { + if (lr->nullSeparator) { + if (*lr->line_end == '\0') { + line_start = lr->line_start; + lr->line_start = lr->line_end + 1; + lr->line_end = lr->line_start; + return (line_start); + } + } else if (*lr->line_end == '\x0a' || *lr->line_end == '\x0d') { + *lr->line_end = '\0'; + line_start = lr->line_start; + lr->line_start = lr->line_end + 1; + lr->line_end = lr->line_start; + if (line_start[0] != '\0') + return (line_start); + } + lr->line_end++; + } + + /* If we're at end-of-file, process the final data. */ + if (lr->f == NULL) { + /* If there's more text, return one last line. */ + if (lr->line_end > lr->line_start) { + *lr->line_end = '\0'; + line_start = lr->line_start; + lr->line_start = lr->line_end + 1; + lr->line_end = lr->line_start; + return (line_start); + } + /* Otherwise, we're done. */ + return (NULL); + } + + /* Buffer only has part of a line. */ + if (lr->line_start > lr->buff) { + /* Move a leftover fractional line to the beginning. */ + memmove(lr->buff, lr->line_start, + lr->buff_end - lr->line_start); + lr->buff_end -= lr->line_start - lr->buff; + lr->line_end -= lr->line_start - lr->buff; + lr->line_start = lr->buff; + } else { + /* Line is too big; enlarge the buffer. */ + new_buff_size = lr->buff_length * 2; + if (new_buff_size <= lr->buff_length) + bsdtar_errc(1, ENOMEM, + "Line too long in %s", lr->pathname); + lr->buff_length = new_buff_size; + p = realloc(lr->buff, new_buff_size); + if (p == NULL) + bsdtar_errc(1, ENOMEM, + "Line too long in %s", lr->pathname); + lr->buff_end = p + (lr->buff_end - lr->buff); + lr->line_end = p + (lr->line_end - lr->buff); + lr->line_start = lr->buff = p; + } + + /* Get some more data into the buffer. */ + bytes_wanted = lr->buff + lr->buff_length - lr->buff_end; + bytes_read = fread(lr->buff_end, 1, bytes_wanted, lr->f); + lr->buff_end += bytes_read; + + if (ferror(lr->f)) + bsdtar_errc(1, errno, "Can't read %s", lr->pathname); + if (feof(lr->f)) { + if (lr->f != stdin) + fclose(lr->f); + lr->f = NULL; + } + } +} + +void +lafe_line_reader_free(struct lafe_line_reader *lr) +{ + free(lr->buff); + free(lr->pathname); + free(lr); +} Added: head/usr.bin/tar/line_reader.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/tar/line_reader.h Sun Feb 7 02:00:26 2010 (r203593) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2009 Joerg Sonnenberger + * 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(S) ``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(S) 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$ + */ + +#ifndef LAFE_LINE_READER_H +#define LAFE_LINE_READER_H + +struct lafe_line_reader; + +struct lafe_line_reader *lafe_line_reader(const char *, int nullSeparator); +const char *lafe_line_reader_next(struct lafe_line_reader *); +void lafe_line_reader_free(struct lafe_line_reader *); + +#endif Modified: head/usr.bin/tar/matching.c ============================================================================== --- head/usr.bin/tar/matching.c Sun Feb 7 01:54:14 2010 (r203592) +++ head/usr.bin/tar/matching.c Sun Feb 7 02:00:26 2010 (r203593) @@ -36,8 +36,10 @@ __FBSDID("$FreeBSD$"); #include #endif -#include "bsdtar.h" #include "err.h" +#include "line_reader.h" +#include "matching.h" +#include "pathmatch.h" struct match { struct match *next; @@ -45,7 +47,7 @@ struct match { char pattern[1]; }; -struct matching { +struct lafe_matching { struct match *exclusions; int exclusions_count; struct match *inclusions; @@ -53,14 +55,10 @@ struct matching { int inclusions_unmatched_count; }; - -static void add_pattern(struct match **list, - const char *pattern); -static int bsdtar_fnmatch(const char *p, const char *s); -static void initialize_matching(struct bsdtar *); +static void add_pattern(struct match **list, const char *pattern); +static void initialize_matching(struct lafe_matching **); static int match_exclusion(struct match *, const char *pathname); static int match_inclusion(struct match *, const char *pathname); -static int pathmatch(const char *p, const char *s); /* * The matching logic here needs to be re-thought. I started out to @@ -74,55 +72,74 @@ static int pathmatch(const char *p, cons */ int -exclude(struct bsdtar *bsdtar, const char *pattern) +lafe_exclude(struct lafe_matching **matching, const char *pattern) { - struct matching *matching; - if (bsdtar->matching == NULL) - initialize_matching(bsdtar); - matching = bsdtar->matching; - add_pattern(&(matching->exclusions), pattern); - matching->exclusions_count++; + if (*matching == NULL) + initialize_matching(matching); + add_pattern(&((*matching)->exclusions), pattern); + (*matching)->exclusions_count++; return (0); } int -exclude_from_file(struct bsdtar *bsdtar, const char *pathname) +lafe_exclude_from_file(struct lafe_matching **matching, const char *pathname) { - return (process_lines(bsdtar, pathname, &exclude)); + struct lafe_line_reader *lr; + const char *p; + int ret = 0; + + lr = lafe_line_reader(pathname, '\n'); + while ((p = lafe_line_reader_next(lr)) != NULL) { + if (lafe_exclude(matching, p) != 0) + ret = -1; + } + lafe_line_reader_free(lr); + return (ret); } int -include(struct bsdtar *bsdtar, const char *pattern) +lafe_include(struct lafe_matching **matching, const char *pattern) { - struct matching *matching; - if (bsdtar->matching == NULL) - initialize_matching(bsdtar); - matching = bsdtar->matching; - add_pattern(&(matching->inclusions), pattern); - matching->inclusions_count++; - matching->inclusions_unmatched_count++; + if (*matching == NULL) + initialize_matching(matching); + add_pattern(&((*matching)->inclusions), pattern); + (*matching)->inclusions_count++; + (*matching)->inclusions_unmatched_count++; return (0); } int -include_from_file(struct bsdtar *bsdtar, const char *pathname) +lafe_include_from_file(struct lafe_matching **matching, const char *pathname, + int nullSeparator) { - return (process_lines(bsdtar, pathname, &include)); + struct lafe_line_reader *lr; + const char *p; + int ret = 0; + + lr = lafe_line_reader(pathname, nullSeparator); + while ((p = lafe_line_reader_next(lr)) != NULL) { + if (lafe_include(matching, p) != 0) + ret = -1; + } + lafe_line_reader_free(lr); + return (ret); } static void add_pattern(struct match **list, const char *pattern) { struct match *match; + size_t len; - match = malloc(sizeof(*match) + strlen(pattern) + 1); + len = strlen(pattern); + match = malloc(sizeof(*match) + len + 1); if (match == NULL) bsdtar_errc(1, errno, "Out of memory"); strcpy(match->pattern, pattern); /* Both "foo/" and "foo" should match "foo/bar". */ - if (match->pattern[strlen(match->pattern)-1] == '/') + if (len && match->pattern[len - 1] == '/') match->pattern[strlen(match->pattern)-1] = '\0'; match->next = *list; *list = match; @@ -131,13 +148,11 @@ add_pattern(struct match **list, const c int -excluded(struct bsdtar *bsdtar, const char *pathname) +lafe_excluded(struct lafe_matching *matching, const char *pathname) { - struct matching *matching; struct match *match; struct match *matched; - matching = bsdtar->matching; if (matching == NULL) return (0); @@ -192,288 +207,74 @@ excluded(struct bsdtar *bsdtar, const ch static int match_exclusion(struct match *match, const char *pathname) { - const char *p; - - if (*match->pattern == '*' || *match->pattern == '/') - return (pathmatch(match->pattern, pathname) == 0); - - for (p = pathname; p != NULL; p = strchr(p, '/')) { - if (*p == '/') - p++; - if (pathmatch(match->pattern, p) == 0) - return (1); - } - return (0); + return (lafe_pathmatch(match->pattern, + pathname, + PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END)); } /* * Again, mimic gtar: inclusions are always anchored (have to match * the beginning of the path) even though exclusions are not anchored. */ -int +static int match_inclusion(struct match *match, const char *pathname) { - return (pathmatch(match->pattern, pathname) == 0); + return (lafe_pathmatch(match->pattern, pathname, PATHMATCH_NO_ANCHOR_END)); } void -cleanup_exclusions(struct bsdtar *bsdtar) +lafe_cleanup_exclusions(struct lafe_matching **matching) { struct match *p, *q; - if (bsdtar->matching) { - p = bsdtar->matching->inclusions; - while (p != NULL) { - q = p; - p = p->next; - free(q); - } - p = bsdtar->matching->exclusions; - while (p != NULL) { - q = p; - p = p->next; - free(q); - } - free(bsdtar->matching); + if (*matching == NULL) + return; + + for (p = (*matching)->inclusions; p != NULL; ) { + q = p; + p = p->next; + free(q); } + + for (p = (*matching)->exclusions; p != NULL; ) { + q = p; + p = p->next; + free(q); + } + + free(*matching); + *matching = NULL; } static void -initialize_matching(struct bsdtar *bsdtar) +initialize_matching(struct lafe_matching **matching) { - bsdtar->matching = malloc(sizeof(*bsdtar->matching)); - if (bsdtar->matching == NULL) + *matching = calloc(sizeof(**matching), 1); + if (*matching == NULL) bsdtar_errc(1, errno, "No memory"); - memset(bsdtar->matching, 0, sizeof(*bsdtar->matching)); } int -unmatched_inclusions(struct bsdtar *bsdtar) +lafe_unmatched_inclusions(struct lafe_matching *matching) { - struct matching *matching; - matching = bsdtar->matching; if (matching == NULL) return (0); return (matching->inclusions_unmatched_count); } - int -unmatched_inclusions_warn(struct bsdtar *bsdtar, const char *msg) +lafe_unmatched_inclusions_warn(struct lafe_matching *matching, const char *msg) { - struct matching *matching; struct match *p; - matching = bsdtar->matching; if (matching == NULL) return (0); - p = matching->inclusions; - while (p != NULL) { - if (p->matches == 0) { - bsdtar->return_value = 1; - bsdtar_warnc(0, "%s: %s", - p->pattern, msg); - } - p = p->next; + for (p = matching->inclusions; p != NULL; p = p->next) { + if (p->matches == 0) + bsdtar_warnc(0, "%s: %s", p->pattern, msg); } - return (matching->inclusions_unmatched_count); -} -/* - * TODO: Extend this so that the following matches work: - * "foo//bar" == "foo/bar" - * "foo/./bar" == "foo/bar" - * "./foo" == "foo" - * - * The POSIX fnmatch() function doesn't handle any of these, but - * all are common situations that arise when paths are generated within - * large scripts. E.g., the following is quite common: - * MYPATH=foo/ TARGET=$MYPATH/bar - * It may be worthwhile to edit such paths at write time as well, - * especially when such editing may avoid the need for long pathname - * extensions. - */ -static int -pathmatch(const char *pattern, const char *string) -{ - /* - * Strip leading "./" or ".//" so that, e.g., - * "foo" matches "./foo". In particular, this - * opens up an optimization for the writer to - * elide leading "./". - */ - if (pattern[0] == '.' && pattern[1] == '/') { - pattern += 2; - while (pattern[0] == '/') - ++pattern; - } - if (string[0] == '.' && string[1] == '/') { - string += 2; - while (string[0] == '/') - ++string; - } - return (bsdtar_fnmatch(pattern, string)); -} - - -#if defined(HAVE_FNMATCH) && defined(HAVE_FNM_LEADING_DIR) - -/* Use system fnmatch() if it suits our needs. */ -/* On Linux, _GNU_SOURCE must be defined to get FNM_LEADING_DIR. */ -#define _GNU_SOURCE -#include -static int -bsdtar_fnmatch(const char *pattern, const char *string) -{ - return (fnmatch(pattern, string, FNM_LEADING_DIR)); -} - -#else -/* - * The following was hacked from BSD C library - * code: src/lib/libc/gen/fnmatch.c,v 1.15 2002/02/01 - * - * In particular, most of the flags were ripped out: this always - * behaves like FNM_LEADING_DIR is set and other flags specified - * by POSIX are unset. - * - * Normally, I would not conditionally compile something like this: If - * I have to support it anyway, everyone may as well use it. ;-) - * However, the full POSIX spec for fnmatch() includes a lot of - * advanced character handling that I'm not ready to put in here, so - * it's probably best if people use a local version when it's available. - */ - -/* - * Copyright (c) 1989, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Guido van Rossum. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - */ - -static int -bsdtar_fnmatch(const char *pattern, const char *string) -{ - const char *saved_pattern; - int negate, matched; - char c; - - for (;;) { - switch (c = *pattern++) { - case '\0': - if (*string == '/' || *string == '\0') - return (0); - return (1); - case '?': - if (*string == '\0') - return (1); - ++string; - break; - case '*': - c = *pattern; - /* Collapse multiple stars. */ - while (c == '*') - c = *++pattern; - - /* Optimize for pattern with * at end. */ - if (c == '\0') - return (0); - - /* General case, use recursion. */ - while (*string != '\0') { - if (!bsdtar_fnmatch(pattern, string)) - return (0); - ++string; - } - return (1); - case '[': - if (*string == '\0') - return (1); - saved_pattern = pattern; - if (*pattern == '!' || *pattern == '^') { - negate = 1; - ++pattern; - } else - negate = 0; - matched = 0; - c = *pattern++; - do { - if (c == '\\') - c = *pattern++; - if (c == '\0') { - pattern = saved_pattern; - c = '['; - goto norm; - } - if (*pattern == '-') { - char c2 = *(pattern + 1); - if (c2 == '\0') { - pattern = saved_pattern; - c = '['; - goto norm; - } - if (c2 == ']') { - /* [a-] is not a range. */ - if (c == *string - || '-' == *string) - matched = 1; - pattern ++; - } else { - if (c <= *string - && *string <= c2) - matched = 1; - pattern += 2; - } - } else if (c == *string) - matched = 1; - c = *pattern++; - } while (c != ']'); - if (matched == negate) - return (1); - ++string; - break; - case '\\': - if ((c = *pattern++) == '\0') { - c = '\\'; - --pattern; - } - /* FALLTHROUGH */ - default: - norm: - if (c != *string) - return (1); - string++; - break; - } - } - /* NOTREACHED */ + return (matching->inclusions_unmatched_count); } - -#endif Added: head/usr.bin/tar/matching.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/tar/matching.h Sun Feb 7 02:00:26 2010 (r203593) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * 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 + * in this position and unchanged. + * 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(S) ``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(S) 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$ + */ + +#ifndef MATCHING_H +#define MATCHING_H + +struct lafe_matching; + +int lafe_exclude(struct lafe_matching **matching, const char *pattern); +int lafe_exclude_from_file(struct lafe_matching **matching, + const char *pathname); +int lafe_include(struct lafe_matching **matching, const char *pattern); +int lafe_include_from_file(struct lafe_matching **matching, + const char *pathname, int nullSeparator); + +int lafe_excluded(struct lafe_matching *, const char *pathname); +void lafe_cleanup_exclusions(struct lafe_matching **); +int lafe_unmatched_inclusions(struct lafe_matching *); +int lafe_unmatched_inclusions_warn(struct lafe_matching *, const char *msg); + +#endif Added: head/usr.bin/tar/pathmatch.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/tar/pathmatch.c Sun Feb 7 02:00:26 2010 (r203593) @@ -0,0 +1,255 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * 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 + * in this position and unchanged. + * 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(S) ``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(S) 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 "bsdtar_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_STRING_H +#include +#endif + +#include "pathmatch.h" + +/* + * Check whether a character 'c' is matched by a list specification [...]: + * * Leading '!' negates the class. + * * - is a range of characters + * * \ removes any special meaning for + * + * Some interesting boundary cases: + * a-d-e is one range (a-d) followed by two single characters - and e. + * \a-\d is same as a-d + * a\-d is three single characters: a, d, - + * Trailing - is not special (so [a-] is two characters a and -). + * Initial - is not special ([a-] is same as [-a] is same as [\\-a]) + * This function never sees a trailing \. + * [] always fails + * [!] always succeeds + */ +static int +pm_list(const char *start, const char *end, const char c, int flags) +{ + const char *p = start; + char rangeStart = '\0', nextRangeStart; + int match = 1, nomatch = 0; + + /* This will be used soon... */ + (void)flags; /* UNUSED */ + + /* If this is a negated class, return success for nomatch. */ + if (*p == '!' && p < end) { + match = 0; + nomatch = 1; + ++p; + } + + while (p < end) { + nextRangeStart = '\0'; + switch (*p) { + case '-': + /* Trailing or initial '-' is not special. */ + if ((rangeStart == '\0') || (p == end - 1)) { + if (*p == c) + return (match); + } else { + char rangeEnd = *++p; + if (rangeEnd == '\\') + rangeEnd = *++p; + if ((rangeStart <= c) && (c <= rangeEnd)) + return (match); + } + break; + case '\\': + ++p; + /* Fall through */ + default: + if (*p == c) + return (match); + nextRangeStart = *p; /* Possible start of range. */ + } + rangeStart = nextRangeStart; + ++p; + } + return (nomatch); +} + +/* + * If s is pointing to "./", ".//", "./././" or the like, skip it. + */ +static const char * +pm_slashskip(const char *s) { + while ((*s == '/') + || (s[0] == '.' && s[1] == '/') + || (s[0] == '.' && s[1] == '\0')) + ++s; + return (s); +} + +static int +pm(const char *p, const char *s, int flags) +{ + const char *end; + + /* + * Ignore leading './', './/', '././', etc. + */ + if (s[0] == '.' && s[1] == '/') + s = pm_slashskip(s + 1); + if (p[0] == '.' && p[1] == '/') + p = pm_slashskip(p + 1); + + for (;;) { + switch (*p) { + case '\0': + if (s[0] == '/') { + if (flags & PATHMATCH_NO_ANCHOR_END) + return (1); + /* "dir" == "dir/" == "dir/." */ + s = pm_slashskip(s); + } + return (*s == '\0'); + case '?': + /* ? always succeds, unless we hit end of 's' */ + if (*s == '\0') + return (0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 02:04:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C040106566B; Sun, 7 Feb 2010 02:04:59 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12FE68FC08; Sun, 7 Feb 2010 02:04:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1724wKe005699; Sun, 7 Feb 2010 02:04:58 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1724w5G005697; Sun, 7 Feb 2010 02:04:58 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201002070204.o1724w5G005697@svn.freebsd.org> From: Tim Kientzle Date: Sun, 7 Feb 2010 02:04: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: r203594 - head/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 02:04:59 -0000 Author: kientzle Date: Sun Feb 7 02:04:58 2010 New Revision: 203594 URL: http://svn.freebsd.org/changeset/base/203594 Log: Simplify, remove unnecessary code. Modified: head/usr.bin/tar/bsdtar_platform.h Modified: head/usr.bin/tar/bsdtar_platform.h ============================================================================== --- head/usr.bin/tar/bsdtar_platform.h Sun Feb 7 02:00:26 2010 (r203593) +++ head/usr.bin/tar/bsdtar_platform.h Sun Feb 7 02:04:58 2010 (r203594) @@ -37,19 +37,18 @@ #if defined(PLATFORM_CONFIG_H) /* Use hand-built config.h in environments that need it. */ #include PLATFORM_CONFIG_H -#elif defined(HAVE_CONFIG_H) -/* Most POSIX platforms use the 'configure' script to build config.h */ -#include "config.h" -#else -/* Warn if bsdtar hasn't been (automatically or manually) configured. */ -#error Oops: No config.h and no built-in configuration in bsdtar_platform.h. -#endif /* !HAVE_CONFIG_H */ - -/* No non-FreeBSD platform will have __FBSDID, so just define it here. */ -#ifdef __FreeBSD__ -#include /* For __FBSDID */ #else -/* Just leaving this macro replacement empty leads to a dangling semicolon. */ +/* Not having a config.h of some sort is a serious problem. */ +#include "config.h" +#endif + +/* Get a real definition for __FBSDID if we can */ +#if HAVE_SYS_CDEFS_H +#include +#endif + +/* If not, define it so as to avoid dangling semicolons. */ +#ifndef __FBSDID #define __FBSDID(a) struct _undefined_hack #endif @@ -92,25 +91,6 @@ # endif #endif - -/* - * We need to be able to display a filesize using printf(). The type - * and format string here must be compatible with one another and - * large enough for any file. - */ -#if HAVE_UINTMAX_T -#define BSDTAR_FILESIZE_TYPE uintmax_t -#define BSDTAR_FILESIZE_PRINTF "%ju" -#else -#if HAVE_UNSIGNED_LONG_LONG -#define BSDTAR_FILESIZE_TYPE unsigned long long -#define BSDTAR_FILESIZE_PRINTF "%llu" -#else -#define BSDTAR_FILESIZE_TYPE unsigned long -#define BSDTAR_FILESIZE_PRINTF "%lu" -#endif -#endif - #if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC #define ARCHIVE_STAT_CTIME_NANOS(st) (st)->st_ctimespec.tv_nsec #define ARCHIVE_STAT_MTIME_NANOS(st) (st)->st_mtimespec.tv_nsec From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 04:27:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FF771065679; Sun, 7 Feb 2010 04:27:18 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7428C8FC0A; Sun, 7 Feb 2010 04:27:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o174RIp7037280; Sun, 7 Feb 2010 04:27:18 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o174RITV037278; Sun, 7 Feb 2010 04:27:18 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201002070427.o174RITV037278@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 7 Feb 2010 04:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203598 - stable/8/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 04:27:18 -0000 Author: ume Date: Sun Feb 7 04:27:18 2010 New Revision: 203598 URL: http://svn.freebsd.org/changeset/base/203598 Log: MFC r202916: Make strsignal(3) thread-safe. Modified: stable/8/lib/libc/string/strsignal.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/string/strsignal.c ============================================================================== --- stable/8/lib/libc/string/strsignal.c Sun Feb 7 04:24:10 2010 (r203597) +++ stable/8/lib/libc/string/strsignal.c Sun Feb 7 04:27:18 2010 (r203598) @@ -33,22 +33,64 @@ static char sccsid[] = "@(#)strerror.c 8 #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #if defined(NLS) #include #endif - #include #include +#include #include #include +#include "reentrant.h" +#include "un-namespace.h" #define UPREFIX "Unknown signal" +static char sig_ebuf[NL_TEXTMAX]; +static char sig_ebuf_err[NL_TEXTMAX]; +static once_t sig_init_once = ONCE_INITIALIZER; +static thread_key_t sig_key; +static int sig_keycreated = 0; + +static void +sig_keycreate(void) +{ + sig_keycreated = (thr_keycreate(&sig_key, free) == 0); +} + +static char * +sig_tlsalloc(void) +{ + char *ebuf = NULL; + + if (thr_main() != 0) + ebuf = sig_ebuf; + else { + if (thr_once(&sig_init_once, sig_keycreate) != 0 || + !sig_keycreated) + goto thr_err; + if ((ebuf = thr_getspecific(sig_key)) == NULL) { + if ((ebuf = malloc(sizeof(sig_ebuf))) == NULL) + goto thr_err; + if (thr_setspecific(sig_key, ebuf) != 0) { + free(ebuf); + ebuf = NULL; + goto thr_err; + } + } + } +thr_err: + if (ebuf == NULL) + ebuf = sig_ebuf_err; + return (ebuf); +} + /* XXX: negative 'num' ? (REGR) */ char * strsignal(int num) { - static char ebuf[NL_TEXTMAX]; + char *ebuf; char tmp[20]; size_t n; int signum; @@ -60,6 +102,8 @@ strsignal(int num) catd = catopen("libc", NL_CAT_LOCALE); #endif + ebuf = sig_tlsalloc(); + if (num > 0 && num < sys_nsig) { n = strlcpy(ebuf, #if defined(NLS) @@ -67,7 +111,7 @@ strsignal(int num) #else sys_siglist[num], #endif - sizeof(ebuf)); + sizeof(sig_ebuf)); } else { n = strlcpy(ebuf, #if defined(NLS) @@ -75,7 +119,7 @@ strsignal(int num) #else UPREFIX, #endif - sizeof(ebuf)); + sizeof(sig_ebuf)); } signum = num; From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 04:38:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D496D106566C for ; Sun, 7 Feb 2010 04:38:12 +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 661098FC15 for ; Sun, 7 Feb 2010 04:38:11 +0000 (UTC) Received: (qmail 8426 invoked by uid 399); 7 Feb 2010 04:38:10 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 7 Feb 2010 04:38:10 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B6E43C0.3060302@FreeBSD.org> Date: Sat, 06 Feb 2010 20:38:24 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.7) Gecko/20100123 Thunderbird/3.0.1 MIME-Version: 1.0 To: Bruce M Simpson References: <201002062122.o16LM1eS042778@svn.freebsd.org> In-Reply-To: <201002062122.o16LM1eS042778@svn.freebsd.org> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB 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: r203574 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 04:38:12 -0000 On 02/06/10 13:22, Bruce M Simpson wrote: > Author: bms > Date: Sat Feb 6 21:22:01 2010 > New Revision: 203574 > URL: http://svn.freebsd.org/changeset/base/203574 > > Log: > Add sane-port (Scanner Access Now Easy) as port 6566. Are all the port numbers that have been added recently things that have been requested by users? IIUC there is a cost "albeit small" for parsing the /etc/services file each time it's read, so traditionally we've tried to keep it as small as possible while still meeting the needs of our users. I'm not calling for a backout, just curious. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 04:55:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B3F11065670; Sun, 7 Feb 2010 04:55:41 +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 219618FC0A; Sun, 7 Feb 2010 04:55:40 +0000 (UTC) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 56ECDDD3B5; Sat, 6 Feb 2010 23:55:40 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 06 Feb 2010 23:55:40 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=tUqGguHamYcXt3t9Hpga3H6EbPw=; b=JMWbfUtEtWEys8O1kyZZXODDtxS030HP8OBZ+gcmGtM+e7ype5oKdvsaawJIquDBt7BmKOg3UXWuaPSW1GgrJtGwhO7904CyFupOVbcFja3zSBHjx40DH5Q+//TWyJLzolJxYHqYDcHooueLCMKK/VCgAb+5knvdcuoarAsDH2w= X-Sasl-enc: bcb6mVYyeXbkl6Z9bHf/1zuBtemhrifoRhxRuLyAd1TC 1265518540 Received: from [192.168.123.18] (cpc2-dals7-0-0-cust253.hari.cable.virginmedia.com [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 896CD4A92F1; Sat, 6 Feb 2010 23:55:39 -0500 (EST) Message-ID: <4B6E47CA.7020506@incunabulum.net> Date: Sun, 07 Feb 2010 04:55:38 +0000 From: Bruce Simpson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: Doug Barton References: <201002062122.o16LM1eS042778@svn.freebsd.org> <4B6E43C0.3060302@FreeBSD.org> In-Reply-To: <4B6E43C0.3060302@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, Bruce M Simpson Subject: Re: svn commit: r203574 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 04:55:41 -0000 On 07/02/2010 04:38, Doug Barton wrote: > > Are all the port numbers that have been added recently things that > have been requested by users? IIUC there is a cost "albeit small" for > parsing the /etc/services file each time it's read, so traditionally > we've tried to keep it as small as possible while still meeting the > needs of our users. I've been running sane-backends with this mod locally on all my FreeBSD desktop clients for some time. Given that it's been given an official allocation by IANA it seemed reasonable to add it to our own /etc/services to support this use. It's pretty essential for day-to-day office use of FreeBSD as a desktop system. The intention is to be able to use pfSense as a lightweight appliance platform for scan/print, to reduce my power bill, and get rid of noisy old boxes. I have a diff to add an RC script to the existing graphics/sane-backends port here, and it requires that saned-port be present in /etc/services: http://people.freebsd.org/~bms/dump/sane-backends-saned.diff Note well the comments about devd.conf configuration being a bit of a pain for USB endpoints. What could use further care and attention is the configuration of sane itself. Just using scanimage -L with the default out-of-box configuration causes a coredump; if I reduce dll.conf to the bare minimum required, it's fine. Others have commented that AHCI in HEAD accepting arbitrary SCSI commands can cause the driver to hang briefly, I observed this earlier; commenting out the SCSI backends worked around this, and I know mav@ has a patch for it which hasn't been MFCed just yet. thanks, Bruce From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 06:22:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AAF91065672; Sun, 7 Feb 2010 06:22:29 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184DA8FC15; Sun, 7 Feb 2010 06:22:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o176MSX1063098; Sun, 7 Feb 2010 06:22:28 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o176MSJP063096; Sun, 7 Feb 2010 06:22:28 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002070622.o176MSJP063096@svn.freebsd.org> From: Ruslan Ermilov Date: Sun, 7 Feb 2010 06:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203603 - stable/8/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 06:22:29 -0000 Author: ru Date: Sun Feb 7 06:22:28 2010 New Revision: 203603 URL: http://svn.freebsd.org/changeset/base/203603 Log: MFC: r203486: Shortening a passphrase caused wrong authentication key to be used. Modified: stable/8/sbin/ifconfig/ifcarp.c Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/ifcarp.c ============================================================================== --- stable/8/sbin/ifconfig/ifcarp.c Sun Feb 7 05:50:00 2010 (r203602) +++ stable/8/sbin/ifconfig/ifcarp.c Sun Feb 7 06:22:28 2010 (r203603) @@ -96,6 +96,7 @@ setcarp_passwd(const char *val, int d, i if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1) err(1, "SIOCGVH"); + memset(carpr.carpr_key, 0, sizeof(carpr.carpr_key)); /* XXX Should hash the password into the key here, perhaps? */ strlcpy(carpr.carpr_key, val, CARP_KEY_LEN); From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 07:50:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06697106568B; Sun, 7 Feb 2010 07:50:42 +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 EB1EC8FC1A; Sun, 7 Feb 2010 07:50:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o177ofOq082391; Sun, 7 Feb 2010 07:50:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o177of7H082389; Sun, 7 Feb 2010 07:50:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002070750.o177of7H082389@svn.freebsd.org> From: Warner Losh Date: Sun, 7 Feb 2010 07:50: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: r203604 - head/usr.sbin/rpcbind X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 07:50:42 -0000 Author: imp Date: Sun Feb 7 07:50:41 2010 New Revision: 203604 URL: http://svn.freebsd.org/changeset/base/203604 Log: Initialize fromlen before calling recvfrom to avoid passing in random stack garbage. Obtained from: NetBSD 1.13 Modified: head/usr.sbin/rpcbind/rpcb_svc_com.c Modified: head/usr.sbin/rpcbind/rpcb_svc_com.c ============================================================================== --- head/usr.sbin/rpcbind/rpcb_svc_com.c Sun Feb 7 06:22:28 2010 (r203603) +++ head/usr.sbin/rpcbind/rpcb_svc_com.c Sun Feb 7 07:50:41 2010 (r203604) @@ -1224,6 +1224,7 @@ handle_reply(int fd, SVCXPRT *xprt) goto done; do { + fromlen = sizeof(ss); inlen = recvfrom(fd, buffer, RPC_BUF_MAX, 0, (struct sockaddr *)&ss, &fromlen); } while (inlen < 0 && errno == EINTR); From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 09:00:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA63A10656C5; Sun, 7 Feb 2010 09:00:22 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9914B8FC13; Sun, 7 Feb 2010 09:00:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1790M6k097690; Sun, 7 Feb 2010 09:00:22 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1790MER097673; Sun, 7 Feb 2010 09:00:22 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201002070900.o1790MER097673@svn.freebsd.org> From: Julian Elischer Date: Sun, 7 Feb 2010 09:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203605 - in stable/8/sys: net netgraph netinet netinet/ipfw netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 09:00:22 -0000 Author: julian Date: Sun Feb 7 09:00:22 2010 New Revision: 203605 URL: http://svn.freebsd.org/changeset/base/203605 Log: MFC of 197952 and 198075 Virtualize the pfil hooks so that different jails may chose different packet filters. ALso allows ipfw to be enabled on on ejail and disabled on another. In 8.0 it's a global setting. and Unbreak the VIMAGE build with IPSEC, broken with r197952 by virtualizing the pfil hooks. For consistency add the V_ to virtualize the pfil hooks in here as well. Modified: stable/8/sys/net/if_bridge.c stable/8/sys/net/if_enc.c stable/8/sys/net/if_ethersubr.c stable/8/sys/net/pfil.c stable/8/sys/netgraph/ng_bridge.c stable/8/sys/netinet/ip_fastfwd.c stable/8/sys/netinet/ip_input.c stable/8/sys/netinet/ip_output.c stable/8/sys/netinet/ip_var.h stable/8/sys/netinet/ipfw/ip_fw2.c stable/8/sys/netinet/ipfw/ip_fw_pfil.c stable/8/sys/netinet/raw_ip.c stable/8/sys/netinet6/ip6_forward.c stable/8/sys/netinet6/ip6_input.c stable/8/sys/netinet6/ip6_output.c stable/8/sys/netinet6/ip6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/if_bridge.c ============================================================================== --- stable/8/sys/net/if_bridge.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/net/if_bridge.c Sun Feb 7 09:00:22 2010 (r203605) @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* for struct arpcom */ #include @@ -1800,9 +1801,9 @@ bridge_dummynet(struct mbuf *m, struct i return; } - if (PFIL_HOOKED(&inet_pfil_hook) + if (PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif ) { if (bridge_pfil(&m, sc->sc_ifp, ifp, PFIL_OUT) != 0) @@ -2062,9 +2063,9 @@ bridge_forward(struct bridge_softc *sc, ETHER_BPF_MTAP(ifp, m); /* run the packet filter */ - if (PFIL_HOOKED(&inet_pfil_hook) + if (PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif ) { BRIDGE_UNLOCK(sc); @@ -2102,9 +2103,9 @@ bridge_forward(struct bridge_softc *sc, BRIDGE_UNLOCK(sc); - if (PFIL_HOOKED(&inet_pfil_hook) + if (PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif ) { if (bridge_pfil(&m, ifp, dst_if, PFIL_OUT) != 0) @@ -2243,7 +2244,7 @@ bridge_input(struct ifnet *ifp, struct m #ifdef INET6 # define OR_PFIL_HOOKED_INET6 \ - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #else # define OR_PFIL_HOOKED_INET6 #endif @@ -2260,7 +2261,7 @@ bridge_input(struct ifnet *ifp, struct m iface->if_ipackets++; \ /* Filter on the physical interface. */ \ if (pfil_local_phys && \ - (PFIL_HOOKED(&inet_pfil_hook) \ + (PFIL_HOOKED(&V_inet_pfil_hook) \ OR_PFIL_HOOKED_INET6)) { \ if (bridge_pfil(&m, NULL, ifp, \ PFIL_IN) != 0 || m == NULL) { \ @@ -2349,9 +2350,9 @@ bridge_broadcast(struct bridge_softc *sc } /* Filter on the bridge interface before broadcasting */ - if (runfilt && (PFIL_HOOKED(&inet_pfil_hook) + if (runfilt && (PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif )) { if (bridge_pfil(&m, sc->sc_ifp, NULL, PFIL_OUT) != 0) @@ -2396,9 +2397,9 @@ bridge_broadcast(struct bridge_softc *sc * pointer so we do not redundantly filter on the bridge for * each interface we broadcast on. */ - if (runfilt && (PFIL_HOOKED(&inet_pfil_hook) + if (runfilt && (PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif )) { if (used == 0) { @@ -3037,7 +3038,7 @@ bridge_pfil(struct mbuf **mp, struct ifn goto bad; } - if (ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { + if (V_ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { struct dn_pkt_tag *dn_tag; error = -1; @@ -3057,7 +3058,7 @@ bridge_pfil(struct mbuf **mp, struct ifn args.next_hop = NULL; args.eh = &eh2; args.inp = NULL; /* used by ipfw uid/gid/jail rules */ - i = ip_fw_chk_ptr(&args); + i = V_ip_fw_chk_ptr(&args); *mp = args.m; if (*mp == NULL) @@ -3109,21 +3110,21 @@ ipfwpass: * in_if -> bridge_if -> out_if */ if (pfil_bridge && dir == PFIL_OUT && bifp != NULL) - error = pfil_run_hooks(&inet_pfil_hook, mp, bifp, + error = pfil_run_hooks(&V_inet_pfil_hook, mp, bifp, dir, NULL); if (*mp == NULL || error != 0) /* filter may consume */ break; if (pfil_member && ifp != NULL) - error = pfil_run_hooks(&inet_pfil_hook, mp, ifp, + error = pfil_run_hooks(&V_inet_pfil_hook, mp, ifp, dir, NULL); if (*mp == NULL || error != 0) /* filter may consume */ break; if (pfil_bridge && dir == PFIL_IN && bifp != NULL) - error = pfil_run_hooks(&inet_pfil_hook, mp, bifp, + error = pfil_run_hooks(&V_inet_pfil_hook, mp, bifp, dir, NULL); if (*mp == NULL || error != 0) /* filter may consume */ @@ -3163,21 +3164,21 @@ ipfwpass: #ifdef INET6 case ETHERTYPE_IPV6: if (pfil_bridge && dir == PFIL_OUT && bifp != NULL) - error = pfil_run_hooks(&inet6_pfil_hook, mp, bifp, + error = pfil_run_hooks(&V_inet6_pfil_hook, mp, bifp, dir, NULL); if (*mp == NULL || error != 0) /* filter may consume */ break; if (pfil_member && ifp != NULL) - error = pfil_run_hooks(&inet6_pfil_hook, mp, ifp, + error = pfil_run_hooks(&V_inet6_pfil_hook, mp, ifp, dir, NULL); if (*mp == NULL || error != 0) /* filter may consume */ break; if (pfil_bridge && dir == PFIL_IN && bifp != NULL) - error = pfil_run_hooks(&inet6_pfil_hook, mp, bifp, + error = pfil_run_hooks(&V_inet6_pfil_hook, mp, bifp, dir, NULL); break; #endif Modified: stable/8/sys/net/if_enc.c ============================================================================== --- stable/8/sys/net/if_enc.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/net/if_enc.c Sun Feb 7 09:00:22 2010 (r203605) @@ -243,9 +243,9 @@ ipsec_filter(struct mbuf **mp, int dir, } /* Skip pfil(9) if no filters are loaded */ - if (!(PFIL_HOOKED(&inet_pfil_hook) + if (!(PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif )) { return (0); @@ -271,7 +271,7 @@ ipsec_filter(struct mbuf **mp, int dir, ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); - error = pfil_run_hooks(&inet_pfil_hook, mp, + error = pfil_run_hooks(&V_inet_pfil_hook, mp, encif, dir, NULL); if (*mp == NULL || error != 0) @@ -285,7 +285,7 @@ ipsec_filter(struct mbuf **mp, int dir, #ifdef INET6 case 6: - error = pfil_run_hooks(&inet6_pfil_hook, mp, + error = pfil_run_hooks(&V_inet6_pfil_hook, mp, encif, dir, NULL); break; #endif Modified: stable/8/sys/net/if_ethersubr.c ============================================================================== --- stable/8/sys/net/if_ethersubr.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/net/if_ethersubr.c Sun Feb 7 09:00:22 2010 (r203605) @@ -434,7 +434,7 @@ ether_output_frame(struct ifnet *ifp, st { #if defined(INET) || defined(INET6) - if (ip_fw_chk_ptr && V_ether_ipfw != 0) { + if (V_ip_fw_chk_ptr && V_ether_ipfw != 0) { if (ether_ipfw_chk(&m, ifp, 0) == 0) { if (m) { m_freem(m); @@ -502,7 +502,7 @@ ether_ipfw_chk(struct mbuf **m0, struct args.next_hop = NULL; /* we do not support forward yet */ args.eh = &save_eh; /* MAC header for bridged/MAC packets */ args.inp = NULL; /* used by ipfw uid/gid/jail rules */ - i = ip_fw_chk_ptr(&args); + i = V_ip_fw_chk_ptr(&args); m = args.m; if (m != NULL) { /* @@ -775,7 +775,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 (ip_fw_chk_ptr && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { + if (V_ip_fw_chk_ptr && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { if (ether_ipfw_chk(&m, NULL, 0) == 0) { if (m) m_freem(m); /* dropped; free mbuf chain */ Modified: stable/8/sys/net/pfil.c ============================================================================== --- stable/8/sys/net/pfil.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/net/pfil.c Sun Feb 7 09:00:22 2010 (r203605) @@ -58,8 +58,9 @@ static int pfil_list_remove(pfil_list_t int (*)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), void *); -LIST_HEAD(, pfil_head) pfil_head_list = - LIST_HEAD_INITIALIZER(&pfil_head_list); +LIST_HEAD(pfilheadhead, pfil_head); +VNET_DEFINE(struct pfilheadhead, pfil_head_list); +#define V_pfil_head_list VNET(pfil_head_list) /* * pfil_run_hooks() runs the specified packet filter hooks. @@ -99,7 +100,7 @@ pfil_head_register(struct pfil_head *ph) struct pfil_head *lph; PFIL_LIST_LOCK(); - LIST_FOREACH(lph, &pfil_head_list, ph_list) { + LIST_FOREACH(lph, &V_pfil_head_list, ph_list) { if (ph->ph_type == lph->ph_type && ph->ph_un.phu_val == lph->ph_un.phu_val) { PFIL_LIST_UNLOCK(); @@ -110,7 +111,7 @@ pfil_head_register(struct pfil_head *ph) ph->ph_nhooks = 0; TAILQ_INIT(&ph->ph_in); TAILQ_INIT(&ph->ph_out); - LIST_INSERT_HEAD(&pfil_head_list, ph, ph_list); + LIST_INSERT_HEAD(&V_pfil_head_list, ph, ph_list); PFIL_LIST_UNLOCK(); return (0); } @@ -145,7 +146,7 @@ pfil_head_get(int type, u_long val) struct pfil_head *ph; PFIL_LIST_LOCK(); - LIST_FOREACH(ph, &pfil_head_list, ph_list) + LIST_FOREACH(ph, &V_pfil_head_list, ph_list) if (ph->ph_type == type && ph->ph_un.phu_val == val) break; PFIL_LIST_UNLOCK(); @@ -284,3 +285,45 @@ pfil_list_remove(pfil_list_t *list, } return (ENOENT); } + +/**************** + * Stuff that must be initialized for every instance + * (including the first of course). + */ +static int +vnet_pfil_init(const void *unused) +{ + LIST_INIT(&V_pfil_head_list); + return (0); +} + +/*********************** + * Called for the removal of each instance. + */ +static int +vnet_pfil_uninit(const void *unused) +{ + /* XXX should panic if list is not empty */ + return 0; +} + +/* Define startup order. */ +#define PFIL_SYSINIT_ORDER SI_SUB_PROTO_BEGIN +#define PFIL_MODEVENT_ORDER (SI_ORDER_FIRST) /* On boot slot in here. */ +#define PFIL_VNET_ORDER (PFIL_MODEVENT_ORDER + 2) /* Later still. */ + +/* + * Starting up. + * VNET_SYSINIT is called for each existing vnet and each new vnet. + */ +VNET_SYSINIT(vnet_pfil_init, PFIL_SYSINIT_ORDER, PFIL_VNET_ORDER, + vnet_pfil_init, NULL); + +/* + * Closing up shop. These are done in REVERSE ORDER, + * Not called on reboot. + * VNET_SYSUNINIT is called for each exiting vnet as it exits. + */ +VNET_SYSUNINIT(vnet_pfil_uninit, PFIL_SYSINIT_ORDER, PFIL_VNET_ORDER, + vnet_pfil_uninit, NULL); + Modified: stable/8/sys/netgraph/ng_bridge.c ============================================================================== --- stable/8/sys/netgraph/ng_bridge.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netgraph/ng_bridge.c Sun Feb 7 09:00:22 2010 (r203605) @@ -634,7 +634,7 @@ ng_bridge_rcvdata(hook_p hook, item_p it /* Run packet through ipfw processing, if enabled */ #if 0 - if (priv->conf.ipfw[linkNum] && V_fw_enable && ip_fw_chk_ptr != NULL) { + if (priv->conf.ipfw[linkNum] && V_fw_enable && V_ip_fw_chk_ptr != NULL) { /* XXX not implemented yet */ } #endif Modified: stable/8/sys/netinet/ip_fastfwd.c ============================================================================== --- stable/8/sys/netinet/ip_fastfwd.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ip_fastfwd.c Sun Feb 7 09:00:22 2010 (r203605) @@ -351,10 +351,11 @@ ip_fastforward(struct mbuf *m) /* * Run through list of ipfilter hooks for input packets */ - if (!PFIL_HOOKED(&inet_pfil_hook)) + if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passin; - if (pfil_run_hooks(&inet_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN, NULL) || + if (pfil_run_hooks( + &V_inet_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN, NULL) || m == NULL) goto drop; @@ -438,10 +439,10 @@ passin: /* * Run through list of hooks for output packets. */ - if (!PFIL_HOOKED(&inet_pfil_hook)) + if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passout; - if (pfil_run_hooks(&inet_pfil_hook, &m, ifp, PFIL_OUT, NULL) || m == NULL) { + if (pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, NULL) || m == NULL) { goto drop; } Modified: stable/8/sys/netinet/ip_input.c ============================================================================== --- stable/8/sys/netinet/ip_input.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ip_input.c Sun Feb 7 09:00:22 2010 (r203605) @@ -170,7 +170,7 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, &VNET_NAME(ip_checkinterface), 0, "Verify packet arrives on correct interface"); -struct pfil_head inet_pfil_hook; /* Packet filter hooks */ +VNET_DEFINE(struct pfil_head, inet_pfil_hook); /* Packet filter hooks */ static struct netisr_handler ip_nh = { .nh_name = "ip", @@ -318,6 +318,13 @@ ip_init(void) NULL, UMA_ALIGN_PTR, 0); maxnipq_update(); + /* Initialize packet filter hooks. */ + V_inet_pfil_hook.ph_type = PFIL_TYPE_AF; + V_inet_pfil_hook.ph_af = AF_INET; + if ((i = pfil_head_register(&V_inet_pfil_hook)) != 0) + printf("%s: WARNING: unable to register pfil hook, " + "error %d\n", __func__, i); + #ifdef FLOWTABLE TUNABLE_INT_FETCH("net.inet.ip.output_flowtable_size", &V_ip_output_flowtable_size); @@ -348,13 +355,6 @@ ip_init(void) ip_protox[pr->pr_protocol] = pr - inetsw; } - /* Initialize packet filter hooks. */ - inet_pfil_hook.ph_type = PFIL_TYPE_AF; - inet_pfil_hook.ph_af = AF_INET; - if ((i = pfil_head_register(&inet_pfil_hook)) != 0) - printf("%s: WARNING: unable to register pfil hook, " - "error %d\n", __func__, i); - /* Start ipport_tick. */ callout_init(&ipport_tick_callout, CALLOUT_MPSAFE); callout_reset(&ipport_tick_callout, 1, ipport_tick, NULL); @@ -510,11 +510,11 @@ tooshort: */ /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED(&inet_pfil_hook)) + if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passin; odst = ip->ip_dst; - if (pfil_run_hooks(&inet_pfil_hook, &m, ifp, PFIL_IN, NULL) != 0) + if (pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_IN, NULL) != 0) return; if (m == NULL) /* consumed by filter */ return; Modified: stable/8/sys/netinet/ip_output.c ============================================================================== --- stable/8/sys/netinet/ip_output.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ip_output.c Sun Feb 7 09:00:22 2010 (r203605) @@ -489,12 +489,12 @@ sendit: #endif /* IPSEC */ /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED(&inet_pfil_hook)) + if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passout; /* Run through list of hooks for output packets. */ odst.s_addr = ip->ip_dst.s_addr; - error = pfil_run_hooks(&inet_pfil_hook, &m, ifp, PFIL_OUT, inp); + error = pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, inp); if (error != 0 || m == NULL) goto done; Modified: stable/8/sys/netinet/ip_var.h ============================================================================== --- stable/8/sys/netinet/ip_var.h Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ip_var.h Sun Feb 7 09:00:22 2010 (r203605) @@ -244,14 +244,20 @@ extern int (*ip_rsvp_vif)(struct socket extern void (*ip_rsvp_force_done)(struct socket *); extern void (*rsvp_input_p)(struct mbuf *m, int off); -extern struct pfil_head inet_pfil_hook; /* packet filter hooks */ +VNET_DECLARE(struct pfil_head, inet_pfil_hook); /* packet filter hooks */ +#define V_inet_pfil_hook VNET(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 *); +typedef int (*ip_fw_chk_ptr_t)(struct ip_fw_args *args); +typedef int (*ip_fw_ctl_ptr_t)(struct sockopt *); +VNET_DECLARE(ip_fw_chk_ptr_t, ip_fw_chk_ptr); +VNET_DECLARE(ip_fw_ctl_ptr_t, ip_fw_ctl_ptr); +#define V_ip_fw_chk_ptr VNET(ip_fw_chk_ptr) +#define V_ip_fw_ctl_ptr VNET(ip_fw_ctl_ptr) + 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 */ Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Sun Feb 7 09:00:22 2010 (r203605) @@ -2581,6 +2581,10 @@ do { \ } IPFW_RLOCK(chain); + if (! V_ipfw_vnet_ready) { /* shutting down, leave NOW. */ + IPFW_RUNLOCK(chain); + return (IP_FW_PASS); /* accept */ + } mtag = m_tag_find(m, PACKET_TAG_DIVERT, NULL); if (args->rule) { /* @@ -4760,29 +4764,21 @@ ipfw_init(void) printf("limited to %d packets/entry by default\n", V_verbose_limit); - /* - * Hook us up to pfil. - * Eventually pfil will be per vnet. - */ - if ((error = ipfw_hook()) != 0) { - printf("ipfw_hook() error\n"); - return (error); - } -#ifdef INET6 - if ((error = ipfw6_hook()) != 0) { - printf("ipfw6_hook() error\n"); - return (error); - } -#endif - /* - * Other things that are only done the first time. - * (now that we a re cuaranteed of success). - */ - ip_fw_ctl_ptr = ipfw_ctl; - ip_fw_chk_ptr = ipfw_chk; return (error); } +/********************** + * Called for the removal of the last instance only on module unload. + */ +static void +ipfw_destroy(void) +{ + + uma_zdestroy(ipfw_dyn_rule_zone); + IPFW_DYN_LOCK_DESTROY(); + printf("IP firewall unloaded\n"); +} + /**************** * Stuff that must be initialized for every instance * (including the first of course). @@ -4866,19 +4862,30 @@ vnet_ipfw_init(const void *unused) /* First set up some values that are compile time options */ V_ipfw_vnet_ready = 1; /* Open for business */ - return (0); -} -/********************** - * Called for the removal of the last instance only on module unload. - */ -static void -ipfw_destroy(void) -{ + /* Hook up the raw inputs */ + V_ip_fw_ctl_ptr = ipfw_ctl; + V_ip_fw_chk_ptr = ipfw_chk; - uma_zdestroy(ipfw_dyn_rule_zone); - IPFW_DYN_LOCK_DESTROY(); - printf("IP firewall unloaded\n"); + /* + * Hook us up to pfil. + */ + if (V_fw_enable) { + if ((error = ipfw_hook()) != 0) { + printf("ipfw_hook() error\n"); + return (error); + } + } +#ifdef INET6 + if (V_fw6_enable) { + if ((error = ipfw6_hook()) != 0) { + printf("ipfw6_hook() error\n"); + /* XXX should we unhook everything else? */ + return (error); + } + } +#endif + return (0); } /*********************** @@ -4890,9 +4897,18 @@ vnet_ipfw_uninit(const void *unused) struct ip_fw *reap; V_ipfw_vnet_ready = 0; /* tell new callers to go away */ - callout_drain(&V_ipfw_timeout); + ipfw_unhook(); +#ifdef INET6 + ipfw6_unhook(); +#endif + /* layer2 and other entrypoints still come in this way. */ + V_ip_fw_chk_ptr = NULL; + V_ip_fw_ctl_ptr = NULL; + IPFW_WLOCK(&V_layer3_chain); /* We wait on the wlock here until the last user leaves */ + IPFW_WUNLOCK(&V_layer3_chain); IPFW_WLOCK(&V_layer3_chain); + callout_drain(&V_ipfw_timeout); flush_tables(&V_layer3_chain); V_layer3_chain.reap = NULL; free_chain(&V_layer3_chain, 1 /* kill default rule */); @@ -4926,21 +4942,10 @@ ipfw_modevent(module_t mod, int type, vo /* Called once at module load or * system boot if compiled in. */ break; - case MOD_UNLOAD: - break; case MOD_QUIESCE: - /* Yes, the unhooks can return errors, we can safely ignore - * them. Eventually these will be done per jail as they - * shut down. We will wait on each vnet's l3 lock as existing - * callers go away. - */ - ipfw_unhook(); -#ifdef INET6 - ipfw6_unhook(); -#endif - /* layer2 and other entrypoints still come in this way. */ - ip_fw_chk_ptr = NULL; - ip_fw_ctl_ptr = NULL; + /* Called before unload. May veto unloading. */ + break; + case MOD_UNLOAD: /* Called during unload. */ break; case MOD_SHUTDOWN: @@ -4989,4 +4994,3 @@ SYSUNINIT(ipfw_destroy, IPFW_SI_SUB_FIRE VNET_SYSUNINIT(vnet_ipfw_uninit, IPFW_SI_SUB_FIREWALL, IPFW_VNET_ORDER, vnet_ipfw_uninit, NULL); - Modified: stable/8/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_pfil.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ipfw/ip_fw_pfil.c Sun Feb 7 09:00:22 2010 (r203605) @@ -515,42 +515,54 @@ ipfw6_unhook(void) int ipfw_chg_hook(SYSCTL_HANDLER_ARGS) { - int enable = *(int *)arg1; + int enable; + int oldenable; int error; -#ifdef VIMAGE /* Since enabling is global, only let base do it. */ - if (! IS_DEFAULT_VNET(curvnet)) - return (EPERM); + if (arg1 == &VNET_NAME(fw_enable)) { + enable = V_fw_enable; + } +#ifdef INET6 + else if (arg1 == &VNET_NAME(fw6_enable)) { + enable = V_fw6_enable; + } #endif + else + return (EINVAL); + + oldenable = enable; + error = sysctl_handle_int(oidp, &enable, 0, req); + if (error) return (error); enable = (enable) ? 1 : 0; - if (enable == *(int *)arg1) + if (enable == oldenable) return (0); - if (arg1 == &V_fw_enable) { + if (arg1 == &VNET_NAME(fw_enable)) { if (enable) error = ipfw_hook(); else error = ipfw_unhook(); + if (error) + return (error); + V_fw_enable = enable; } #ifdef INET6 - if (arg1 == &V_fw6_enable) { + else if (arg1 == &VNET_NAME(fw6_enable)) { if (enable) error = ipfw6_hook(); else error = ipfw6_unhook(); + if (error) + return (error); + V_fw6_enable = enable; } #endif - if (error) - return (error); - - *(int *)arg1 = enable; - return (0); } Modified: stable/8/sys/netinet/raw_ip.c ============================================================================== --- stable/8/sys/netinet/raw_ip.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/raw_ip.c Sun Feb 7 09:00:22 2010 (r203605) @@ -84,9 +84,9 @@ VNET_DEFINE(struct inpcbinfo, ripcbinfo) * 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; +VNET_DEFINE(ip_fw_chk_ptr_t, ip_fw_chk_ptr) = NULL; +VNET_DEFINE(ip_fw_ctl_ptr_t, ip_fw_ctl_ptr) = 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; /* @@ -542,8 +542,8 @@ rip_ctloutput(struct socket *so, struct case IP_FW_TABLE_LIST: case IP_FW_NAT_GET_CONFIG: case IP_FW_NAT_GET_LOG: - if (ip_fw_ctl_ptr != NULL) - error = ip_fw_ctl_ptr(sopt); + if (V_ip_fw_ctl_ptr != NULL) + error = V_ip_fw_ctl_ptr(sopt); else error = ENOPROTOOPT; break; @@ -605,8 +605,8 @@ rip_ctloutput(struct socket *so, struct case IP_FW_TABLE_FLUSH: case IP_FW_NAT_CFG: case IP_FW_NAT_DEL: - if (ip_fw_ctl_ptr != NULL) - error = ip_fw_ctl_ptr(sopt); + if (V_ip_fw_ctl_ptr != NULL) + error = V_ip_fw_ctl_ptr(sopt); else error = ENOPROTOOPT; break; Modified: stable/8/sys/netinet6/ip6_forward.c ============================================================================== --- stable/8/sys/netinet6/ip6_forward.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet6/ip6_forward.c Sun Feb 7 09:00:22 2010 (r203605) @@ -551,11 +551,11 @@ skip_routing: in6_clearscope(&ip6->ip6_dst); /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED(&inet6_pfil_hook)) + if (!PFIL_HOOKED(&V_inet6_pfil_hook)) goto pass; /* Run through list of hooks for output packets. */ - error = pfil_run_hooks(&inet6_pfil_hook, &m, rt->rt_ifp, PFIL_OUT, NULL); + error = pfil_run_hooks(&V_inet6_pfil_hook, &m, rt->rt_ifp, PFIL_OUT, NULL); if (error != 0) goto senderr; if (m == NULL) Modified: stable/8/sys/netinet6/ip6_input.c ============================================================================== --- stable/8/sys/netinet6/ip6_input.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet6/ip6_input.c Sun Feb 7 09:00:22 2010 (r203605) @@ -152,7 +152,7 @@ VNET_DECLARE(int, udp6_recvspace); struct rwlock in6_ifaddr_lock; RW_SYSINIT(in6_ifaddr_lock, &in6_ifaddr_lock, "in6_ifaddr_lock"); -struct pfil_head inet6_pfil_hook; +VNET_DEFINE (struct pfil_head, inet6_pfil_hook); static void ip6_init2(void *); static struct ip6aux *ip6_setdstifaddr(struct mbuf *, struct in6_ifaddr *); @@ -247,6 +247,13 @@ ip6_init(void) V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR; + /* Initialize packet filter hooks. */ + V_inet6_pfil_hook.ph_type = PFIL_TYPE_AF; + V_inet6_pfil_hook.ph_af = AF_INET6; + if ((i = pfil_head_register(&V_inet6_pfil_hook)) != 0) + printf("%s: WARNING: unable to register pfil hook, " + "error %d\n", __func__, i); + /* Skip global initialization stuff for non-default instances. */ if (!IS_DEFAULT_VNET(curvnet)) return; @@ -275,13 +282,6 @@ ip6_init(void) ip6_protox[pr->pr_protocol] = pr - inet6sw; } - /* Initialize packet filter hooks. */ - inet6_pfil_hook.ph_type = PFIL_TYPE_AF; - inet6_pfil_hook.ph_af = AF_INET6; - if ((i = pfil_head_register(&inet6_pfil_hook)) != 0) - printf("%s: WARNING: unable to register pfil hook, " - "error %d\n", __func__, i); - netisr_register(&ip6_nh); } @@ -515,10 +515,11 @@ ip6_input(struct mbuf *m) odst = ip6->ip6_dst; /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED(&inet6_pfil_hook)) + if (!PFIL_HOOKED(&V_inet6_pfil_hook)) goto passin; - if (pfil_run_hooks(&inet6_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN, NULL)) + if (pfil_run_hooks(&V_inet6_pfil_hook, &m, + m->m_pkthdr.rcvif, PFIL_IN, NULL)) return; if (m == NULL) /* consumed by filter */ return; Modified: stable/8/sys/netinet6/ip6_output.c ============================================================================== --- stable/8/sys/netinet6/ip6_output.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet6/ip6_output.c Sun Feb 7 09:00:22 2010 (r203605) @@ -805,12 +805,12 @@ again: } /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED(&inet6_pfil_hook)) + if (!PFIL_HOOKED(&V_inet6_pfil_hook)) goto passout; odst = ip6->ip6_dst; /* Run through list of hooks for output packets. */ - error = pfil_run_hooks(&inet6_pfil_hook, &m, ifp, PFIL_OUT, inp); + error = pfil_run_hooks(&V_inet6_pfil_hook, &m, ifp, PFIL_OUT, inp); if (error != 0 || m == NULL) goto done; ip6 = mtod(m, struct ip6_hdr *); Modified: stable/8/sys/netinet6/ip6_var.h ============================================================================== --- stable/8/sys/netinet6/ip6_var.h Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet6/ip6_var.h Sun Feb 7 09:00:22 2010 (r203605) @@ -358,7 +358,8 @@ VNET_DECLARE(int, ip6_use_defzone); /* W #endif #define V_ip6_use_defzone VNET(ip6_use_defzone) -extern struct pfil_head inet6_pfil_hook; /* packet filter hooks */ +VNET_DECLARE (struct pfil_head, inet6_pfil_hook); /* packet filter hooks */ +#define V_inet6_pfil_hook VNET(inet6_pfil_hook) extern struct pr_usrreqs rip6_usrreqs; struct sockopt; From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 10:44:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AD81106566B; Sun, 7 Feb 2010 10:44:45 +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 F030D8FC12; Sun, 7 Feb 2010 10:44:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17AiiQM046034; Sun, 7 Feb 2010 10:44:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17AiiDE045959; Sun, 7 Feb 2010 10:44:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002071044.o17AiiDE045959@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 7 Feb 2010 10:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203606 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 10:44:45 -0000 Author: kib Date: Sun Feb 7 10:44:44 2010 New Revision: 203606 URL: http://svn.freebsd.org/changeset/base/203606 Log: MFC r202528: Add vunref(9). Modified: stable/8/sys/kern/vfs_subr.c stable/8/sys/sys/vnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Sun Feb 7 09:00:22 2010 (r203605) +++ stable/8/sys/kern/vfs_subr.c Sun Feb 7 10:44:44 2010 (r203606) @@ -2149,37 +2149,44 @@ vrefcnt(struct vnode *vp) return (usecnt); } +#define VPUTX_VRELE 1 +#define VPUTX_VPUT 2 +#define VPUTX_VUNREF 3 -/* - * Vnode put/release. - * If count drops to zero, call inactive routine and return to freelist. - */ -void -vrele(struct vnode *vp) +static void +vputx(struct vnode *vp, int func) { - struct thread *td = curthread; /* XXX */ + int error; - KASSERT(vp != NULL, ("vrele: null vp")); + KASSERT(vp != NULL, ("vputx: null vp")); + if (func == VPUTX_VUNREF) + ASSERT_VOP_ELOCKED(vp, "vunref"); + else if (func == VPUTX_VPUT) + ASSERT_VOP_LOCKED(vp, "vput"); + else + KASSERT(func == VPUTX_VRELE, ("vputx: wrong func")); VFS_ASSERT_GIANT(vp->v_mount); - + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); VI_LOCK(vp); /* Skip this v_writecount check if we're going to panic below. */ VNASSERT(vp->v_writecount < vp->v_usecount || vp->v_usecount < 1, vp, - ("vrele: missed vn_close")); - CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + ("vputx: missed vn_close")); + error = 0; if (vp->v_usecount > 1 || ((vp->v_iflag & VI_DOINGINACT) && vp->v_usecount == 1)) { + if (func == VPUTX_VPUT) + VOP_UNLOCK(vp, 0); v_decr_usecount(vp); return; } + if (vp->v_usecount != 1) { #ifdef DIAGNOSTIC - vprint("vrele: negative ref count", vp); + vprint("vputx: negative ref count", vp); #endif - VI_UNLOCK(vp); - panic("vrele: negative ref cnt"); + panic("vputx: negative ref cnt"); } CTR2(KTR_VFS, "%s: return vnode %p to the freelist", __func__, vp); /* @@ -2193,22 +2200,36 @@ vrele(struct vnode *vp) * as VI_DOINGINACT to avoid recursion. */ vp->v_iflag |= VI_OWEINACT; - if (vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK) == 0) { + if (func == VPUTX_VRELE) { + error = vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK); VI_LOCK(vp); - if (vp->v_usecount > 0) - vp->v_iflag &= ~VI_OWEINACT; - if (vp->v_iflag & VI_OWEINACT) - vinactive(vp, td); - VOP_UNLOCK(vp, 0); - } else { + } else if (func == VPUTX_VPUT && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + error = VOP_LOCK(vp, LK_UPGRADE | LK_INTERLOCK | LK_NOWAIT); VI_LOCK(vp); - if (vp->v_usecount > 0) - vp->v_iflag &= ~VI_OWEINACT; + } + if (vp->v_usecount > 0) + vp->v_iflag &= ~VI_OWEINACT; + if (error == 0) { + if (vp->v_iflag & VI_OWEINACT) + vinactive(vp, curthread); + if (func != VPUTX_VUNREF) + VOP_UNLOCK(vp, 0); } vdropl(vp); } /* + * Vnode put/release. + * If count drops to zero, call inactive routine and return to freelist. + */ +void +vrele(struct vnode *vp) +{ + + vputx(vp, VPUTX_VRELE); +} + +/* * Release an already locked vnode. This give the same effects as * unlock+vrele(), but takes less time and avoids releasing and * re-aquiring the lock (as vrele() acquires the lock internally.) @@ -2216,56 +2237,18 @@ vrele(struct vnode *vp) void vput(struct vnode *vp) { - struct thread *td = curthread; /* XXX */ - int error; - KASSERT(vp != NULL, ("vput: null vp")); - ASSERT_VOP_LOCKED(vp, "vput"); - VFS_ASSERT_GIANT(vp->v_mount); - CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - VI_LOCK(vp); - /* Skip this v_writecount check if we're going to panic below. */ - VNASSERT(vp->v_writecount < vp->v_usecount || vp->v_usecount < 1, vp, - ("vput: missed vn_close")); - error = 0; + vputx(vp, VPUTX_VPUT); +} - if (vp->v_usecount > 1 || ((vp->v_iflag & VI_DOINGINACT) && - vp->v_usecount == 1)) { - VOP_UNLOCK(vp, 0); - v_decr_usecount(vp); - return; - } +/* + * Release an exclusively locked vnode. Do not unlock the vnode lock. + */ +void +vunref(struct vnode *vp) +{ - if (vp->v_usecount != 1) { -#ifdef DIAGNOSTIC - vprint("vput: negative ref count", vp); -#endif - panic("vput: negative ref cnt"); - } - CTR2(KTR_VFS, "%s: return to freelist the vnode %p", __func__, vp); - /* - * We want to hold the vnode until the inactive finishes to - * prevent vgone() races. We drop the use count here and the - * hold count below when we're done. - */ - v_decr_useonly(vp); - vp->v_iflag |= VI_OWEINACT; - if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { - error = VOP_LOCK(vp, LK_UPGRADE|LK_INTERLOCK|LK_NOWAIT); - VI_LOCK(vp); - if (error) { - if (vp->v_usecount > 0) - vp->v_iflag &= ~VI_OWEINACT; - goto done; - } - } - if (vp->v_usecount > 0) - vp->v_iflag &= ~VI_OWEINACT; - if (vp->v_iflag & VI_OWEINACT) - vinactive(vp, td); - VOP_UNLOCK(vp, 0); -done: - vdropl(vp); + vputx(vp, VPUTX_VUNREF); } /* Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Sun Feb 7 09:00:22 2010 (r203605) +++ stable/8/sys/sys/vnode.h Sun Feb 7 10:44:44 2010 (r203606) @@ -629,6 +629,7 @@ void vholdl(struct vnode *); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); int vtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td, off_t length, int blksize); +void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); #define vprint(label, vp) vn_printf((vp), "%s\n", (label)) int vrecycle(struct vnode *vp, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 10:51:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA565106566C; Sun, 7 Feb 2010 10:51:17 +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 938828FC1B; Sun, 7 Feb 2010 10:51:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17ApHcX098147; Sun, 7 Feb 2010 10:51:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17ApHJK098144; Sun, 7 Feb 2010 10:51:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002071051.o17ApHJK098144@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 7 Feb 2010 10:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203607 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 10:51:17 -0000 Author: kib Date: Sun Feb 7 10:51:17 2010 New Revision: 203607 URL: http://svn.freebsd.org/changeset/base/203607 Log: MFC r202529: vunref() the vnode in vm object deallocation code for OBJT_VNODE appropriate number of times to prevent possible vnode reference leak. Modified: stable/8/sys/vm/vm_pageout.c stable/8/sys/vm/vnode_pager.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/vm/vm_pageout.c ============================================================================== --- stable/8/sys/vm/vm_pageout.c Sun Feb 7 10:44:44 2010 (r203606) +++ stable/8/sys/vm/vm_pageout.c Sun Feb 7 10:51:17 2010 (r203607) @@ -951,6 +951,8 @@ rescan0: vnodes_skipped++; goto unlock_and_continue; } + KASSERT(mp != NULL, + ("vp %p with NULL v_mount", vp)); vm_page_unlock_queues(); vm_object_reference_locked(object); VM_OBJECT_UNLOCK(object); Modified: stable/8/sys/vm/vnode_pager.c ============================================================================== --- stable/8/sys/vm/vnode_pager.c Sun Feb 7 10:44:44 2010 (r203606) +++ stable/8/sys/vm/vnode_pager.c Sun Feb 7 10:51:17 2010 (r203607) @@ -250,13 +250,16 @@ static void vnode_pager_dealloc(object) vm_object_t object; { - struct vnode *vp = object->handle; + struct vnode *vp; + int refs; + vp = object->handle; if (vp == NULL) panic("vnode_pager_dealloc: pager already dealloced"); VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); vm_object_pip_wait(object, "vnpdea"); + refs = object->ref_count; object->handle = NULL; object->type = OBJT_DEAD; @@ -267,6 +270,8 @@ vnode_pager_dealloc(object) ASSERT_VOP_ELOCKED(vp, "vnode_pager_dealloc"); vp->v_object = NULL; vp->v_vflag &= ~VV_TEXT; + while (refs-- > 0) + vunref(vp); } static boolean_t From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 11:37:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1754C106566B; Sun, 7 Feb 2010 11:37:39 +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 076DB8FC08; Sun, 7 Feb 2010 11:37:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17BbdOk008537; Sun, 7 Feb 2010 11:37:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17BbcxP008531; Sun, 7 Feb 2010 11:37:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002071137.o17BbcxP008531@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 7 Feb 2010 11:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203608 - in stable/8/sys: amd64/amd64 amd64/ia32 i386/i386 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 11:37:39 -0000 Author: kib Date: Sun Feb 7 11:37:38 2010 New Revision: 203608 URL: http://svn.freebsd.org/changeset/base/203608 Log: MFC r202882: For i386, amd64 and ia32 on amd64 MD syscall(), reread syscall number and arguments after ptracestop(), if debugger modified anything in the process environment. Modified: stable/8/sys/amd64/amd64/trap.c stable/8/sys/amd64/ia32/ia32_syscall.c stable/8/sys/i386/i386/trap.c stable/8/sys/kern/sys_process.c stable/8/sys/sys/proc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/trap.c ============================================================================== --- stable/8/sys/amd64/amd64/trap.c Sun Feb 7 10:51:17 2010 (r203607) +++ stable/8/sys/amd64/amd64/trap.c Sun Feb 7 11:37:38 2010 (r203608) @@ -884,95 +884,131 @@ dblfault_handler(struct trapframe *frame panic("double fault"); } -/* - * syscall - system call request C handler - * - * A system call is essentially treated as a trap. - */ -void -syscall(struct trapframe *frame) -{ - caddr_t params; +struct syscall_args { + u_int code; struct sysent *callp; - struct thread *td = curthread; - struct proc *p = td->td_proc; - register_t orig_tf_rflags; - int error; - int narg; register_t args[8]; register_t *argp; - u_int code; - int reg, regcnt; - ksiginfo_t ksi; - - PCPU_INC(cnt.v_syscall); + int narg; +}; -#ifdef DIAGNOSTIC - if (ISPL(frame->tf_cs) != SEL_UPL) { - panic("syscall"); - /* NOT REACHED */ - } -#endif +static int +fetch_syscall_args(struct thread *td, struct syscall_args *sa) +{ + struct proc *p; + struct trapframe *frame; + caddr_t params; + int reg, regcnt, error; + p = td->td_proc; + frame = td->td_frame; reg = 0; regcnt = 6; - td->td_pticks = 0; - td->td_frame = frame; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); + params = (caddr_t)frame->tf_rsp + sizeof(register_t); - code = frame->tf_rax; - orig_tf_rflags = frame->tf_rflags; + sa->code = frame->tf_rax; if (p->p_sysent->sv_prepsyscall) { - (*p->p_sysent->sv_prepsyscall)(frame, (int *)args, &code, ¶ms); + (*p->p_sysent->sv_prepsyscall)(frame, (int *)sa->args, + &sa->code, ¶ms); } else { - if (code == SYS_syscall || code == SYS___syscall) { - code = frame->tf_rdi; + if (sa->code == SYS_syscall || sa->code == SYS___syscall) { + sa->code = frame->tf_rdi; reg++; regcnt--; } } - if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; + sa->code &= p->p_sysent->sv_mask; - if (code >= p->p_sysent->sv_size) - callp = &p->p_sysent->sv_table[0]; + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; else - callp = &p->p_sysent->sv_table[code]; + sa->callp = &p->p_sysent->sv_table[sa->code]; - narg = callp->sy_narg; - KASSERT(narg <= sizeof(args) / sizeof(args[0]), + sa->narg = sa->callp->sy_narg; + KASSERT(sa->narg <= sizeof(sa->args) / sizeof(sa->args[0]), ("Too many syscall arguments!")); error = 0; - argp = &frame->tf_rdi; - argp += reg; - bcopy(argp, args, sizeof(args[0]) * regcnt); - if (narg > regcnt) { + sa->argp = &frame->tf_rdi; + sa->argp += reg; + bcopy(sa->argp, sa->args, sizeof(sa->args[0]) * regcnt); + if (sa->narg > regcnt) { KASSERT(params != NULL, ("copyin args with no params!")); - error = copyin(params, &args[regcnt], - (narg - regcnt) * sizeof(args[0])); + error = copyin(params, &sa->args[regcnt], + (sa->narg - regcnt) * sizeof(sa->args[0])); } - argp = &args[0]; + sa->argp = &sa->args[0]; + /* + * This may result in two records if debugger modified + * registers or memory during sleep at stop/ptrace point. + */ #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(code, narg, argp); + ktrsyscall(sa->code, sa->narg, sa->argp); #endif + return (error); +} - CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, code); +/* + * syscall - system call request C handler + * + * A system call is essentially treated as a trap. + */ +void +syscall(struct trapframe *frame) +{ + struct thread *td; + struct proc *p; + struct syscall_args sa; + register_t orig_tf_rflags; + int error; + ksiginfo_t ksi; + PCPU_INC(cnt.v_syscall); + td = curthread; + p = td->td_proc; td->td_syscalls++; +#ifdef DIAGNOSTIC + if (ISPL(frame->tf_cs) != SEL_UPL) { + panic("syscall"); + /* NOT REACHED */ + } +#endif + + td->td_pticks = 0; + td->td_frame = frame; + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); + orig_tf_rflags = frame->tf_rflags; + if (p->p_flag & P_TRACED) { + PROC_LOCK(p); + td->td_dbgflags &= ~TDB_USERWR; + PROC_UNLOCK(p); + } + error = fetch_syscall_args(td, &sa); + + CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, + td->td_proc->p_pid, td->td_name, sa.code); + if (error == 0) { td->td_retval[0] = 0; td->td_retval[1] = frame->tf_rdx; - STOPEVENT(p, S_SCE, narg); - + STOPEVENT(p, S_SCE, sa.narg); PTRACESTOP_SC(p, td, S_PT_SCE); + if (td->td_dbgflags & TDB_USERWR) { + /* + * Reread syscall number and arguments if + * debugger modified registers or memory. + */ + error = fetch_syscall_args(td, &sa); + if (error != 0) + goto retval; + td->td_retval[1] = frame->tf_rdx; + } #ifdef KDTRACE_HOOKS /* @@ -980,13 +1016,13 @@ syscall(struct trapframe *frame) * callback and if there is a probe active for the * syscall 'entry', process the probe. */ - if (systrace_probe_func != NULL && callp->sy_entry != 0) - (*systrace_probe_func)(callp->sy_entry, code, callp, - args); + if (systrace_probe_func != NULL && sa.callp->sy_entry != 0) + (*systrace_probe_func)(sa.callp->sy_entry, sa.code, + sa.callp, sa.args); #endif - AUDIT_SYSCALL_ENTER(code, td); - error = (*callp->sy_call)(td, argp); + AUDIT_SYSCALL_ENTER(sa.code, td); + error = (*sa.callp->sy_call)(td, sa.argp); AUDIT_SYSCALL_EXIT(error, td); /* Save the latest error return value. */ @@ -998,12 +1034,12 @@ syscall(struct trapframe *frame) * callback and if there is a probe active for the * syscall 'return', process the probe. */ - if (systrace_probe_func != NULL && callp->sy_return != 0) - (*systrace_probe_func)(callp->sy_return, code, callp, - args); + if (systrace_probe_func != NULL && sa.callp->sy_return != 0) + (*systrace_probe_func)(sa.callp->sy_return, sa.code, + sa.callp, sa.args); #endif } - + retval: cpu_set_syscall_retval(td, error); /* @@ -1022,14 +1058,16 @@ syscall(struct trapframe *frame) * Check for misbehavior. */ WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???"); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???"); KASSERT(td->td_critnest == 0, ("System call %s returning in a critical section", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???")); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???")); KASSERT(td->td_locks == 0, ("System call %s returning with %d locks held", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???", - td->td_locks)); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???", td->td_locks)); /* * Handle reschedule and other end-of-syscall issues @@ -1037,11 +1075,11 @@ syscall(struct trapframe *frame) userret(td, frame); CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, code); + td->td_proc->p_pid, td->td_name, sa.code); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(code, error, td->td_retval[0]); + ktrsysret(sa.code, error, td->td_retval[0]); #endif /* @@ -1049,7 +1087,7 @@ syscall(struct trapframe *frame) * register set. If we ever support an emulation where this * is not the case, this code will need to be revisited. */ - STOPEVENT(p, S_SCX, code); + STOPEVENT(p, S_SCX, sa.code); PTRACESTOP_SC(p, td, S_PT_SCX); } Modified: stable/8/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_syscall.c Sun Feb 7 10:51:17 2010 (r203607) +++ stable/8/sys/amd64/ia32/ia32_syscall.c Sun Feb 7 11:37:38 2010 (r203608) @@ -88,101 +88,136 @@ extern const char *freebsd32_syscallname void ia32_syscall(struct trapframe *frame); /* Called from asm code */ -void -ia32_syscall(struct trapframe *frame) -{ +struct ia32_syscall_args { + u_int code; caddr_t params; - int i; struct sysent *callp; - struct thread *td = curthread; - struct proc *p = td->td_proc; - register_t orig_tf_rflags; - int error; + u_int64_t args64[8]; int narg; +}; + +static int +fetch_ia32_syscall_args(struct thread *td, struct ia32_syscall_args *sa) +{ + struct proc *p; + struct trapframe *frame; u_int32_t args[8]; - u_int64_t args64[8]; - u_int code; - ksiginfo_t ksi; + int error, i; - PCPU_INC(cnt.v_syscall); - td->td_pticks = 0; - td->td_frame = frame; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); - params = (caddr_t)frame->tf_rsp + sizeof(u_int32_t); - code = frame->tf_rax; - orig_tf_rflags = frame->tf_rflags; + p = td->td_proc; + frame = td->td_frame; + + sa->params = (caddr_t)frame->tf_rsp + sizeof(u_int32_t); + sa->code = frame->tf_rax; if (p->p_sysent->sv_prepsyscall) { /* * The prep code is MP aware. */ - (*p->p_sysent->sv_prepsyscall)(frame, args, &code, ¶ms); + (*p->p_sysent->sv_prepsyscall)(frame, args, &sa->code, + &sa->params); } else { /* * Need to check if this is a 32 bit or 64 bit syscall. * fuword is MP aware. */ - if (code == SYS_syscall) { + if (sa->code == SYS_syscall) { /* * Code is first argument, followed by actual args. */ - code = fuword32(params); - params += sizeof(int); - } else if (code == SYS___syscall) { + sa->code = fuword32(sa->params); + sa->params += sizeof(int); + } else if (sa->code == SYS___syscall) { /* * Like syscall, but code is a quad, so as to maintain * quad alignment for the rest of the arguments. * We use a 32-bit fetch in case params is not * aligned. */ - code = fuword32(params); - params += sizeof(quad_t); + sa->code = fuword32(sa->params); + sa->params += sizeof(quad_t); } } - if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; - - if (code >= p->p_sysent->sv_size) - callp = &p->p_sysent->sv_table[0]; + sa->code &= p->p_sysent->sv_mask; + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; else - callp = &p->p_sysent->sv_table[code]; - - narg = callp->sy_narg; + sa->callp = &p->p_sysent->sv_table[sa->code]; + sa->narg = sa->callp->sy_narg; - /* - * copyin and the ktrsyscall()/ktrsysret() code is MP-aware - */ - if (params != NULL && narg != 0) - error = copyin(params, (caddr_t)args, - (u_int)(narg * sizeof(int))); + if (sa->params != NULL && sa->narg != 0) + error = copyin(sa->params, (caddr_t)args, + (u_int)(sa->narg * sizeof(int))); else error = 0; - for (i = 0; i < narg; i++) - args64[i] = args[i]; + for (i = 0; i < sa->narg; i++) + sa->args64[i] = args[i]; #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(code, narg, args64); + ktrsyscall(sa->code, sa->narg, sa->args64); #endif + + return (error); +} + +void +ia32_syscall(struct trapframe *frame) +{ + struct thread *td; + struct proc *p; + struct ia32_syscall_args sa; + register_t orig_tf_rflags; + int error; + ksiginfo_t ksi; + + PCPU_INC(cnt.v_syscall); + td = curthread; + p = td->td_proc; + td->td_syscalls++; + + td->td_pticks = 0; + td->td_frame = frame; + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); + orig_tf_rflags = frame->tf_rflags; + if (p->p_flag & P_TRACED) { + PROC_LOCK(p); + td->td_dbgflags &= ~TDB_USERWR; + PROC_UNLOCK(p); + } + error = fetch_ia32_syscall_args(td, &sa); + CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_proc->p_comm, code); + td->td_proc->p_pid, td->td_name, sa.code); if (error == 0) { td->td_retval[0] = 0; td->td_retval[1] = frame->tf_rdx; - STOPEVENT(p, S_SCE, narg); - + STOPEVENT(p, S_SCE, sa.narg); PTRACESTOP_SC(p, td, S_PT_SCE); + if (td->td_dbgflags & TDB_USERWR) { + /* + * Reread syscall number and arguments if + * debugger modified registers or memory. + */ + error = fetch_ia32_syscall_args(td, &sa); + if (error != 0) + goto retval; + td->td_retval[1] = frame->tf_rdx; + } - AUDIT_SYSCALL_ENTER(code, td); - error = (*callp->sy_call)(td, args64); + AUDIT_SYSCALL_ENTER(sa.code, td); + error = (*sa.callp->sy_call)(td, sa.args64); AUDIT_SYSCALL_EXIT(error, td); - } + /* Save the latest error return value. */ + td->td_errno = error; + } + retval: cpu_set_syscall_retval(td, error); /* @@ -201,14 +236,16 @@ ia32_syscall(struct trapframe *frame) * Check for misbehavior. */ WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (code >= 0 && code < SYS_MAXSYSCALL) ? freebsd32_syscallnames[code] : "???"); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + freebsd32_syscallnames[sa.code] : "???"); KASSERT(td->td_critnest == 0, ("System call %s returning in a critical section", - (code >= 0 && code < SYS_MAXSYSCALL) ? freebsd32_syscallnames[code] : "???")); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + freebsd32_syscallnames[sa.code] : "???")); KASSERT(td->td_locks == 0, ("System call %s returning with %d locks held", - (code >= 0 && code < SYS_MAXSYSCALL) ? freebsd32_syscallnames[code] : "???", - td->td_locks)); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + freebsd32_syscallnames[sa.code] : "???", td->td_locks)); /* * Handle reschedule and other end-of-syscall issues @@ -216,10 +253,10 @@ ia32_syscall(struct trapframe *frame) userret(td, frame); CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_proc->p_comm, code); + td->td_proc->p_pid, td->td_proc->p_comm, sa.code); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(code, error, td->td_retval[0]); + ktrsysret(sa.code, error, td->td_retval[0]); #endif /* @@ -227,7 +264,7 @@ ia32_syscall(struct trapframe *frame) * register set. If we ever support an emulation where this * is not the case, this code will need to be revisited. */ - STOPEVENT(p, S_SCX, code); + STOPEVENT(p, S_SCX, sa.code); PTRACESTOP_SC(p, td, S_PT_SCX); } Modified: stable/8/sys/i386/i386/trap.c ============================================================================== --- stable/8/sys/i386/i386/trap.c Sun Feb 7 10:51:17 2010 (r203607) +++ stable/8/sys/i386/i386/trap.c Sun Feb 7 11:37:38 2010 (r203608) @@ -971,97 +971,130 @@ dblfault_handler() panic("double fault"); } -/* - * syscall - system call request C handler - * - * A system call is essentially treated as a trap. - */ -void -syscall(struct trapframe *frame) -{ - caddr_t params; +struct syscall_args { + u_int code; struct sysent *callp; - struct thread *td = curthread; - struct proc *p = td->td_proc; - register_t orig_tf_eflags; - int error; - int narg; int args[8]; - u_int code; - ksiginfo_t ksi; + register_t *argp; + int narg; +}; - PCPU_INC(cnt.v_syscall); +static int +fetch_syscall_args(struct thread *td, struct syscall_args *sa) +{ + struct proc *p; + struct trapframe *frame; + caddr_t params; + int error; -#ifdef DIAGNOSTIC - if (ISPL(frame->tf_cs) != SEL_UPL) { - panic("syscall"); - /* NOT REACHED */ - } -#endif + p = td->td_proc; + frame = td->td_frame; - td->td_pticks = 0; - td->td_frame = frame; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); params = (caddr_t)frame->tf_esp + sizeof(int); - code = frame->tf_eax; - orig_tf_eflags = frame->tf_eflags; + sa->code = frame->tf_eax; if (p->p_sysent->sv_prepsyscall) { - (*p->p_sysent->sv_prepsyscall)(frame, args, &code, ¶ms); + (*p->p_sysent->sv_prepsyscall)(frame, sa->args, &sa->code, + ¶ms); } else { /* * Need to check if this is a 32 bit or 64 bit syscall. */ - if (code == SYS_syscall) { + if (sa->code == SYS_syscall) { /* * Code is first argument, followed by actual args. */ - code = fuword(params); + sa->code = fuword(params); params += sizeof(int); - } else if (code == SYS___syscall) { + } else if (sa->code == SYS___syscall) { /* * Like syscall, but code is a quad, so as to maintain * quad alignment for the rest of the arguments. */ - code = fuword(params); + sa->code = fuword(params); params += sizeof(quad_t); } } if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; - - if (code >= p->p_sysent->sv_size) - callp = &p->p_sysent->sv_table[0]; + sa->code &= p->p_sysent->sv_mask; + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; else - callp = &p->p_sysent->sv_table[code]; + sa->callp = &p->p_sysent->sv_table[sa->code]; + sa->narg = sa->callp->sy_narg; - narg = callp->sy_narg; - - if (params != NULL && narg != 0) - error = copyin(params, (caddr_t)args, - (u_int)(narg * sizeof(int))); + if (params != NULL && sa->narg != 0) + error = copyin(params, (caddr_t)sa->args, + (u_int)(sa->narg * sizeof(int))); else error = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(code, narg, args); + ktrsyscall(sa->code, sa->narg, sa->args); #endif + return (error); +} - CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, code); +/* + * syscall - system call request C handler + * + * A system call is essentially treated as a trap. + */ +void +syscall(struct trapframe *frame) +{ + struct thread *td; + struct proc *p; + struct syscall_args sa; + register_t orig_tf_eflags; + int error; + ksiginfo_t ksi; + PCPU_INC(cnt.v_syscall); + td = curthread; + p = td->td_proc; td->td_syscalls++; +#ifdef DIAGNOSTIC + if (ISPL(frame->tf_cs) != SEL_UPL) { + panic("syscall"); + /* NOT REACHED */ + } +#endif + + td->td_pticks = 0; + td->td_frame = frame; + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); + orig_tf_eflags = frame->tf_eflags; + if (p->p_flag & P_TRACED) { + PROC_LOCK(p); + td->td_dbgflags &= ~TDB_USERWR; + PROC_UNLOCK(p); + } + error = fetch_syscall_args(td, &sa); + + CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, + td->td_proc->p_pid, td->td_name, sa.code); + if (error == 0) { td->td_retval[0] = 0; td->td_retval[1] = frame->tf_edx; - STOPEVENT(p, S_SCE, narg); - + STOPEVENT(p, S_SCE, sa.narg); PTRACESTOP_SC(p, td, S_PT_SCE); + if (td->td_dbgflags & TDB_USERWR) { + /* + * Reread syscall number and arguments if + * debugger modified registers or memory. + */ + error = fetch_syscall_args(td, &sa); + if (error != 0) + goto retval; + td->td_retval[1] = frame->tf_edx; + } #ifdef KDTRACE_HOOKS /* @@ -1069,13 +1102,13 @@ syscall(struct trapframe *frame) * callback and if there is a probe active for the * syscall 'entry', process the probe. */ - if (systrace_probe_func != NULL && callp->sy_entry != 0) - (*systrace_probe_func)(callp->sy_entry, code, callp, - args); + if (systrace_probe_func != NULL && sa.callp->sy_entry != 0) + (*systrace_probe_func)(sa.callp->sy_entry, sa.code, + sa.callp, sa.args); #endif - AUDIT_SYSCALL_ENTER(code, td); - error = (*callp->sy_call)(td, args); + AUDIT_SYSCALL_ENTER(sa.code, td); + error = (*sa.callp->sy_call)(td, sa.args); AUDIT_SYSCALL_EXIT(error, td); /* Save the latest error return value. */ @@ -1087,12 +1120,12 @@ syscall(struct trapframe *frame) * callback and if there is a probe active for the * syscall 'return', process the probe. */ - if (systrace_probe_func != NULL && callp->sy_return != 0) - (*systrace_probe_func)(callp->sy_return, code, callp, - args); + if (systrace_probe_func != NULL && sa.callp->sy_return != 0) + (*systrace_probe_func)(sa.callp->sy_return, sa.code, + sa.callp, sa.args); #endif } - + retval: cpu_set_syscall_retval(td, error); /* @@ -1111,14 +1144,16 @@ syscall(struct trapframe *frame) * Check for misbehavior. */ WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???"); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???"); KASSERT(td->td_critnest == 0, ("System call %s returning in a critical section", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???")); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???")); KASSERT(td->td_locks == 0, ("System call %s returning with %d locks held", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???", - td->td_locks)); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???", td->td_locks)); /* * Handle reschedule and other end-of-syscall issues @@ -1126,11 +1161,11 @@ syscall(struct trapframe *frame) userret(td, frame); CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, code); + td->td_proc->p_pid, td->td_name, sa.code); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(code, error, td->td_retval[0]); + ktrsysret(sa.code, error, td->td_retval[0]); #endif /* @@ -1138,7 +1173,7 @@ syscall(struct trapframe *frame) * register set. If we ever support an emulation where this * is not the case, this code will need to be revisited. */ - STOPEVENT(p, S_SCX, code); + STOPEVENT(p, S_SCX, sa.code); PTRACESTOP_SC(p, td, S_PT_SCX); } Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Sun Feb 7 10:51:17 2010 (r203607) +++ stable/8/sys/kern/sys_process.c Sun Feb 7 11:37:38 2010 (r203608) @@ -809,6 +809,7 @@ kern_ptrace(struct thread *td, int req, case PT_WRITE_I: case PT_WRITE_D: + td2->td_dbgflags |= TDB_USERWR; write = 1; /* FALLTHROUGH */ case PT_READ_I: @@ -877,6 +878,7 @@ kern_ptrace(struct thread *td, int req, break; case PIOD_WRITE_D: case PIOD_WRITE_I: + td2->td_dbgflags |= TDB_USERWR; uio.uio_rw = UIO_WRITE; break; default: @@ -899,6 +901,7 @@ kern_ptrace(struct thread *td, int req, goto sendsig; /* in PT_CONTINUE above */ case PT_SETREGS: + td2->td_dbgflags |= TDB_USERWR; error = PROC_WRITE(regs, td2, addr); break; @@ -907,6 +910,7 @@ kern_ptrace(struct thread *td, int req, break; case PT_SETFPREGS: + td2->td_dbgflags |= TDB_USERWR; error = PROC_WRITE(fpregs, td2, addr); break; @@ -915,6 +919,7 @@ kern_ptrace(struct thread *td, int req, break; case PT_SETDBREGS: + td2->td_dbgflags |= TDB_USERWR; error = PROC_WRITE(dbregs, td2, addr); break; Modified: stable/8/sys/sys/proc.h ============================================================================== --- stable/8/sys/sys/proc.h Sun Feb 7 10:51:17 2010 (r203607) +++ stable/8/sys/sys/proc.h Sun Feb 7 11:37:38 2010 (r203608) @@ -343,6 +343,7 @@ do { \ /* Userland debug flags */ #define TDB_SUSPEND 0x00000001 /* Thread is suspended by debugger */ #define TDB_XSIG 0x00000002 /* Thread is exchanging signal under trace */ +#define TDB_USERWR 0x00000004 /* Debugger modified memory or registers */ /* * "Private" flags kept in td_pflags: From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 11:59:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD6E6106566B; Sun, 7 Feb 2010 11:59:55 +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 CD28D8FC08; Sun, 7 Feb 2010 11:59:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17BxtcW013470; Sun, 7 Feb 2010 11:59:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17BxtZF013468; Sun, 7 Feb 2010 11:59:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002071159.o17BxtZF013468@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Feb 2010 11:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203609 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 11:59:56 -0000 Author: marius Date: Sun Feb 7 11:59:55 2010 New Revision: 203609 URL: http://svn.freebsd.org/changeset/base/203609 Log: MFC: r202900 Merge r203608 from amd64/i386: In syscall(), reread syscall number and arguments after ptracestop(), if debugger modified anything in the process environment. Modified: stable/8/sys/sparc64/sparc64/trap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/trap.c Sun Feb 7 11:37:38 2010 (r203608) +++ stable/8/sys/sparc64/sparc64/trap.c Sun Feb 7 11:59:55 2010 (r203609) @@ -93,9 +93,18 @@ __FBSDID("$FreeBSD$"); #include #include +struct syscall_args { + u_long code; + struct sysent *callp; + register_t args[8]; + register_t *argp; + int narg; +}; + void trap(struct trapframe *tf); void syscall(struct trapframe *tf); +static int fetch_syscall_args(struct thread *td, struct syscall_args *sa); static int trap_pfault(struct thread *td, struct trapframe *tf); extern char copy_fault[]; @@ -525,137 +534,163 @@ trap_pfault(struct thread *td, struct tr /* Maximum number of arguments that can be passed via the out registers. */ #define REG_MAXARGS 6 -/* - * Syscall handler. The arguments to the syscall are passed in the o registers - * by the caller, and are saved in the trap frame. The syscall number is passed - * in %g1 (and also saved in the trap frame). - */ -void -syscall(struct trapframe *tf) +static int +fetch_syscall_args(struct thread *td, struct syscall_args *sa) { - struct sysent *callp; - struct thread *td; - register_t args[8]; - register_t *argp; + struct trapframe *tf; struct proc *p; - u_long code; int reg; int regcnt; - int narg; int error; - td = curthread; - KASSERT(td != NULL, ("trap: curthread NULL")); - KASSERT(td->td_proc != NULL, ("trap: curproc NULL")); - p = td->td_proc; - - PCPU_INC(cnt.v_syscall); - - td->td_pticks = 0; - td->td_frame = tf; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); - code = tf->tf_global[1]; - - /* - * For syscalls, we don't want to retry the faulting instruction - * (usually), instead we need to advance one instruction. - */ - td->td_pcb->pcb_tpc = tf->tf_tpc; - TF_DONE(tf); - + tf = td->td_frame; reg = 0; regcnt = REG_MAXARGS; + + sa->code = tf->tf_global[1]; + if (p->p_sysent->sv_prepsyscall) { - /* - * The prep code is MP aware. - */ #if 0 - (*p->p_sysent->sv_prepsyscall)(tf, args, &code, ¶ms); + (*p->p_sysent->sv_prepsyscall)(tf, sa->args, &sa->code, + ¶ms); #endif - } else if (code == SYS_syscall || code == SYS___syscall) { - code = tf->tf_out[reg++]; + } else if (sa->code == SYS_syscall || sa->code == SYS___syscall) { + sa->code = tf->tf_out[reg++]; regcnt--; } if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; + sa->code &= p->p_sysent->sv_mask; - if (code >= p->p_sysent->sv_size) - callp = &p->p_sysent->sv_table[0]; + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; else - callp = &p->p_sysent->sv_table[code]; - - narg = callp->sy_narg; + sa->callp = &p->p_sysent->sv_table[sa->code]; - KASSERT(narg <= sizeof(args) / sizeof(args[0]), + sa->narg = sa->callp->sy_narg; + KASSERT(sa->narg <= sizeof(sa->args) / sizeof(sa->args[0]), ("Too many syscall arguments!")); error = 0; - argp = args; - bcopy(&tf->tf_out[reg], args, sizeof(args[0]) * regcnt); - if (narg > regcnt) + sa->argp = sa->args; + bcopy(&tf->tf_out[reg], sa->args, sizeof(sa->args[0]) * regcnt); + if (sa->narg > regcnt) error = copyin((void *)(tf->tf_out[6] + SPOFF + - offsetof(struct frame, fr_pad[6])), - &args[regcnt], (narg - regcnt) * sizeof(args[0])); - - CTR5(KTR_SYSC, "syscall: td=%p %s(%#lx, %#lx, %#lx)", td, - syscallnames[code], argp[0], argp[1], argp[2]); + offsetof(struct frame, fr_pad[6])), &sa->args[regcnt], + (sa->narg - regcnt) * sizeof(sa->args[0])); + /* + * This may result in two records if debugger modified + * registers or memory during sleep at stop/ptrace point. + */ #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(code, narg, argp); + ktrsyscall(sa->code, sa->narg, sa->argp); #endif + return (error); +} +/* + * Syscall handler + * The arguments to the syscall are passed in the out registers by the caller, + * and are saved in the trap frame. The syscall number is passed in %g1 (and + * also saved in the trap frame). + */ +void +syscall(struct trapframe *tf) +{ + struct syscall_args sa; + struct thread *td; + struct proc *p; + int error; + + td = curthread; + KASSERT(td != NULL, ("trap: curthread NULL")); + KASSERT(td->td_proc != NULL, ("trap: curproc NULL")); + + PCPU_INC(cnt.v_syscall); + p = td->td_proc; td->td_syscalls++; + td->td_pticks = 0; + td->td_frame = tf; + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); + if ((p->p_flag & P_TRACED) != 0) { + PROC_LOCK(p); + td->td_dbgflags &= ~TDB_USERWR; + PROC_UNLOCK(p); + } + + /* + * For syscalls, we don't want to retry the faulting instruction + * (usually), instead we need to advance one instruction. + */ + td->td_pcb->pcb_tpc = tf->tf_tpc; + TF_DONE(tf); + + error = fetch_syscall_args(td, &sa); + CTR5(KTR_SYSC, "syscall: td=%p %s(%#lx, %#lx, %#lx)", td, + syscallnames[sa.code], sa.argp[0], sa.argp[1], sa.argp[2]); + if (error == 0) { td->td_retval[0] = 0; td->td_retval[1] = 0; - STOPEVENT(p, S_SCE, narg); /* MP aware */ - + STOPEVENT(p, S_SCE, sa.narg); PTRACESTOP_SC(p, td, S_PT_SCE); + if ((td->td_dbgflags & TDB_USERWR) != 0) { + /* + * Reread syscall number and arguments if + * debugger modified registers or memory. + */ + error = fetch_syscall_args(td, &sa); + if (error != 0) + goto retval; + td->td_retval[1] = 0; + } - AUDIT_SYSCALL_ENTER(code, td); - error = (*callp->sy_call)(td, argp); + AUDIT_SYSCALL_ENTER(sa.code, td); + error = (*sa.callp->sy_call)(td, sa.argp); AUDIT_SYSCALL_EXIT(error, td); - CTR5(KTR_SYSC, "syscall: p=%p error=%d %s return %#lx %#lx ", p, - error, syscallnames[code], td->td_retval[0], + CTR5(KTR_SYSC, "syscall: p=%p error=%d %s return %#lx %#lx", + p, error, syscallnames[sa.code], td->td_retval[0], td->td_retval[1]); } - + retval: cpu_set_syscall_retval(td, error); /* * Check for misbehavior. */ WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???"); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???"); KASSERT(td->td_critnest == 0, ("System call %s returning in a critical section", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???")); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???")); KASSERT(td->td_locks == 0, ("System call %s returning with %d locks held", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???", - td->td_locks)); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???", td->td_locks)); /* - * Handle reschedule and other end-of-syscall issues + * Handle reschedule and other end-of-syscall issues. */ userret(td, tf); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(code, error, td->td_retval[0]); + ktrsysret(sa.code, error, td->td_retval[0]); #endif /* * This works because errno is findable through the * register set. If we ever support an emulation where this * is not the case, this code will need to be revisited. */ - STOPEVENT(p, S_SCX, code); + STOPEVENT(p, S_SCX, sa.code); PTRACESTOP_SC(p, td, S_PT_SCX); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 13:59:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69FCB10656A4; Sun, 7 Feb 2010 13:59:03 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A33E8FC1C; Sun, 7 Feb 2010 13:59:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17Dx3Se039613; Sun, 7 Feb 2010 13:59:03 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17Dx396039611; Sun, 7 Feb 2010 13:59:03 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201002071359.o17Dx396039611@svn.freebsd.org> From: Christian Brueffer Date: Sun, 7 Feb 2010 13:59: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: r203610 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 13:59:03 -0000 Author: brueffer Date: Sun Feb 7 13:59:03 2010 New Revision: 203610 URL: http://svn.freebsd.org/changeset/base/203610 Log: Fix whitespace in pho's entry, results in nicer output files. PR: 143613 Submitted by: pluknet Committed from: Debian/kFreeBSD talk at FOSDEM Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Feb 7 11:59:55 2010 (r203609) +++ head/share/misc/committers-src.dot Sun Feb 7 13:59:03 2010 (r203610) @@ -156,7 +156,7 @@ peadar [label="Peter Edwards\npeadar@Fre peter [label="Peter Wemm\npeter@FreeBSD.org\n????/??/??"] philip [label="Philip Paeps\nphilip@FreBSD.org\n2004/01/21"] phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] -pho [label="Peter Holm \npho@FreeBSD.org\n2008/11/16"] +pho [label="Peter Holm\npho@FreeBSD.org\n2008/11/16"] pjd [label="Pawel Jakub Dawidek\npjd@FreeBSD.org\n2004/02/02"] ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"] qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"] From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 15:42:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2E791065670; Sun, 7 Feb 2010 15:42:15 +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 A95908FC14; Sun, 7 Feb 2010 15:42:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17FgFmq062255; Sun, 7 Feb 2010 15:42:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17FgFIV062252; Sun, 7 Feb 2010 15:42:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002071542.o17FgFIV062252@svn.freebsd.org> From: Ed Schouten Date: Sun, 7 Feb 2010 15:42: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: r203611 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 15:42:16 -0000 Author: ed Date: Sun Feb 7 15:42:15 2010 New Revision: 203611 URL: http://svn.freebsd.org/changeset/base/203611 Log: Remove statistics from the TTY queues. I added counters to see how often fast copying to userspace was actually performed, which was only useful during development. Remove these statistics now we know it to be effective. Modified: head/sys/kern/tty_inq.c head/sys/kern/tty_outq.c Modified: head/sys/kern/tty_inq.c ============================================================================== --- head/sys/kern/tty_inq.c Sun Feb 7 13:59:03 2010 (r203610) +++ head/sys/kern/tty_inq.c Sun Feb 7 15:42:15 2010 (r203611) @@ -61,13 +61,6 @@ __FBSDID("$FreeBSD$"); * the outq, we'll stick to 128 byte blocks here. */ -/* Statistics. */ -static unsigned long ttyinq_nfast = 0; -SYSCTL_ULONG(_kern, OID_AUTO, tty_inq_nfast, CTLFLAG_RD, - &ttyinq_nfast, 0, "Unbuffered reads to userspace on input"); -static unsigned long ttyinq_nslow = 0; -SYSCTL_ULONG(_kern, OID_AUTO, tty_inq_nslow, CTLFLAG_RD, - &ttyinq_nslow, 0, "Buffered reads to userspace on input"); static int ttyinq_flush_secure = 1; SYSCTL_INT(_kern, OID_AUTO, tty_inq_flush_secure, CTLFLAG_RW, &ttyinq_flush_secure, 0, "Zero buffers while flushing"); @@ -201,8 +194,6 @@ ttyinq_read_uio(struct ttyinq *ti, struc * the write pointer to a new block. */ if (cend == TTYINQ_DATASIZE || cend == ti->ti_end) { - atomic_add_long(&ttyinq_nfast, 1); - /* * Fast path: zero copy. Remove the first block, * so we can unlock the TTY temporarily. @@ -239,7 +230,6 @@ ttyinq_read_uio(struct ttyinq *ti, struc TTYINQ_RECYCLE(ti, tib); } else { char ob[TTYINQ_DATASIZE - 1]; - atomic_add_long(&ttyinq_nslow, 1); /* * Slow path: store data in a temporary buffer. Modified: head/sys/kern/tty_outq.c ============================================================================== --- head/sys/kern/tty_outq.c Sun Feb 7 13:59:03 2010 (r203610) +++ head/sys/kern/tty_outq.c Sun Feb 7 15:42:15 2010 (r203611) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -52,14 +51,6 @@ __FBSDID("$FreeBSD$"); * output. */ -/* Statistics. */ -static unsigned long ttyoutq_nfast = 0; -SYSCTL_ULONG(_kern, OID_AUTO, tty_outq_nfast, CTLFLAG_RD, - &ttyoutq_nfast, 0, "Unbuffered reads to userspace on output"); -static unsigned long ttyoutq_nslow = 0; -SYSCTL_ULONG(_kern, OID_AUTO, tty_outq_nslow, CTLFLAG_RD, - &ttyoutq_nslow, 0, "Buffered reads to userspace on output"); - struct ttyoutq_block { struct ttyoutq_block *tob_next; char tob_data[TTYOUTQ_DATASIZE]; @@ -236,8 +227,6 @@ ttyoutq_read_uio(struct ttyoutq *to, str * the write pointer to a new block. */ if (cend == TTYOUTQ_DATASIZE || cend == to->to_end) { - atomic_add_long(&ttyoutq_nfast, 1); - /* * Fast path: zero copy. Remove the first block, * so we can unlock the TTY temporarily. @@ -258,7 +247,6 @@ ttyoutq_read_uio(struct ttyoutq *to, str TTYOUTQ_RECYCLE(to, tob); } else { char ob[TTYOUTQ_DATASIZE - 1]; - atomic_add_long(&ttyoutq_nslow, 1); /* * Slow path: store data in a temporary buffer. From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 16:55:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D03C6106566C; Sun, 7 Feb 2010 16:55:45 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C068B8FC08; Sun, 7 Feb 2010 16:55:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17GtjWW078414; Sun, 7 Feb 2010 16:55:45 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17GtjWr078412; Sun, 7 Feb 2010 16:55:45 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002071655.o17GtjWr078412@svn.freebsd.org> From: Ruslan Ermilov Date: Sun, 7 Feb 2010 16:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203612 - stable/7/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 16:55:45 -0000 Author: ru Date: Sun Feb 7 16:55:45 2010 New Revision: 203612 URL: http://svn.freebsd.org/changeset/base/203612 Log: MFC: r203486: Shortening a passphrase caused wrong authentication key to be used. Approved by: re (kib) Modified: stable/7/sbin/ifconfig/ifcarp.c Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifcarp.c ============================================================================== --- stable/7/sbin/ifconfig/ifcarp.c Sun Feb 7 15:42:15 2010 (r203611) +++ stable/7/sbin/ifconfig/ifcarp.c Sun Feb 7 16:55:45 2010 (r203612) @@ -96,6 +96,7 @@ setcarp_passwd(const char *val, int d, i if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1) err(1, "SIOCGVH"); + memset(carpr.carpr_key, 0, sizeof(carpr.carpr_key)); /* XXX Should hash the password into the key here, perhaps? */ strlcpy(carpr.carpr_key, val, CARP_KEY_LEN); From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 17:05:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25DCA106566C; Sun, 7 Feb 2010 17:05:23 +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 F19A08FC0C; Sun, 7 Feb 2010 17:05:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17H5MxH080580; Sun, 7 Feb 2010 17:05:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17H5Mdt080576; Sun, 7 Feb 2010 17:05:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002071705.o17H5Mdt080576@svn.freebsd.org> From: Warner Losh Date: Sun, 7 Feb 2010 17:05: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: r203613 - head/bin/pax X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 17:05:23 -0000 Author: imp Date: Sun Feb 7 17:05:22 2010 New Revision: 203613 URL: http://svn.freebsd.org/changeset/base/203613 Log: Tell the compiler these structures are aligned to a byte boundary. All the elements of these structs are char anyway, so it won't hurt performance. Bump warns back up to the default. # we likely should have CTASSERTS to make sure they are the right size. # but with libarchive based tar maybe we shouldn't bother. Modified: head/bin/pax/Makefile head/bin/pax/cpio.h head/bin/pax/tar.h Modified: head/bin/pax/Makefile ============================================================================== --- head/bin/pax/Makefile Sun Feb 7 16:55:45 2010 (r203612) +++ head/bin/pax/Makefile Sun Feb 7 17:05:22 2010 (r203613) @@ -33,6 +33,4 @@ SRCS= ar_io.c ar_subs.c buf_subs.c cache #MAN= pax.1 tar.1 cpio.1 #LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio -WARNS?= 3 - .include Modified: head/bin/pax/cpio.h ============================================================================== --- head/bin/pax/cpio.h Sun Feb 7 16:55:45 2010 (r203612) +++ head/bin/pax/cpio.h Sun Feb 7 17:05:22 2010 (r203613) @@ -67,7 +67,7 @@ typedef struct { char c_mtime[11]; /* modification time */ char c_namesize[6]; /* length of pathname */ char c_filesize[11]; /* length of file in bytes */ -} HD_CPIO; +} HD_CPIO __aligned(1); #define MAGIC 070707 /* transportable archive id */ @@ -98,7 +98,7 @@ typedef struct { u_char h_namesize[2]; u_char h_filesize_1[2]; u_char h_filesize_2[2]; -} HD_BCPIO; +} HD_BCPIO __aligned(1); #ifdef _PAX_ /* @@ -136,7 +136,7 @@ typedef struct { char c_rmin[8]; /* special file minor # */ char c_namesize[8]; /* length of pathname */ char c_chksum[8]; /* 0 OR CRC of bytes of FILE data */ -} HD_VCPIO; +} HD_VCPIO __aligned(1); #define VMAGIC 070701 /* sVr4 new portable archive id */ #define VCMAGIC 070702 /* sVr4 new portable archive id CRC */ Modified: head/bin/pax/tar.h ============================================================================== --- head/bin/pax/tar.h Sun Feb 7 16:55:45 2010 (r203612) +++ head/bin/pax/tar.h Sun Feb 7 17:05:22 2010 (r203613) @@ -96,7 +96,7 @@ typedef struct { char chksum[CHK_LEN]; /* checksum */ char linkflag; /* norm, hard, or sym. */ char linkname[TNMSZ]; /* linked to name */ -} HD_TAR; +} HD_TAR __aligned(1); #ifdef _PAX_ /* @@ -142,4 +142,4 @@ typedef struct { char devmajor[8]; /* major device number */ char devminor[8]; /* minor device number */ char prefix[TPFSZ]; /* linked to name */ -} HD_USTAR; +} HD_USTAR __aligned(1); From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 18:00:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2C64106566C; Sun, 7 Feb 2010 18:00:13 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D38878FC0C; Sun, 7 Feb 2010 18:00:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17I0DV2092711; Sun, 7 Feb 2010 18:00:13 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17I0D1v092709; Sun, 7 Feb 2010 18:00:13 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002071800.o17I0D1v092709@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 7 Feb 2010 18:00: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: r203618 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 18:00:14 -0000 Author: gavin Date: Sun Feb 7 18:00:13 2010 New Revision: 203618 URL: http://svn.freebsd.org/changeset/base/203618 Log: Spelling nit Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Feb 7 17:53:10 2010 (r203617) +++ head/sys/kern/subr_bus.c Sun Feb 7 18:00:13 2010 (r203618) @@ -739,7 +739,7 @@ fail: * the first time that no match happens, so we don't keep getting this * message. Should that prove to be undesirable, we can change it. * This is called when all drivers that can attach to a given bus - * decline to accept this device. Other errrors may not be detected. + * decline to accept this device. Other errors may not be detected. */ static void devnomatch(device_t dev) From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 18:05:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C45B21065672; Sun, 7 Feb 2010 18:05:12 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4DC58FC12; Sun, 7 Feb 2010 18:05:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17I5C1K093866; Sun, 7 Feb 2010 18:05:12 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17I5CMv093863; Sun, 7 Feb 2010 18:05:12 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002071805.o17I5CMv093863@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 7 Feb 2010 18:05: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: r203620 - in head: share/man/man4 sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 18:05:12 -0000 Author: gavin Date: Sun Feb 7 18:05:12 2010 New Revision: 203620 URL: http://svn.freebsd.org/changeset/base/203620 Log: Document support for the D-Link DFE520-TX card (supported with the vr(4) driver) PR: kern/135989 Submitted by: "Rashid N. Achilov" citycat4 ngs.ru Modified: head/share/man/man4/vr.4 head/sys/conf/NOTES Modified: head/share/man/man4/vr.4 ============================================================================== --- head/share/man/man4/vr.4 Sun Feb 7 18:01:19 2010 (r203619) +++ head/share/man/man4/vr.4 Sun Feb 7 18:05:12 2010 (r203620) @@ -130,6 +130,8 @@ Fast Ethernet adapters including: .It AOpen/Acer ALN-320 .It +D-Link DFE520-TX +.It D-Link DFE530-TX .It Hawking Technologies PN102TX Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Feb 7 18:01:19 2010 (r203619) +++ head/sys/conf/NOTES Sun Feb 7 18:05:12 2010 (r203620) @@ -1974,8 +1974,8 @@ device xmphy # XaQti XMAC II # txp: Support for 3Com 3cR990 cards with the "Typhoon" chipset # vr: Support for various fast ethernet adapters based on the VIA # Technologies VT3043 `Rhine I' and VT86C100A `Rhine II' chips, -# including the D-Link DFE530TX (see 'rl' for DFE530TX+), the Hawking -# Technologies PN102TX, and the AOpen/Acer ALN-320. +# including the D-Link DFE520TX and D-Link DFE530TX (see 'rl' for +# DFE530TX+), the Hawking Technologies PN102TX, and the AOpen/Acer ALN-320. # vx: 3Com 3C590 and 3C595 # wb: Support for fast ethernet adapters based on the Winbond W89C840F chip. # Note: this is not the same as the Winbond W89C940F, which is a From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 18:06:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FFCB106566B; Sun, 7 Feb 2010 18:06:55 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 579778FC14; Sun, 7 Feb 2010 18:06:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17I6tJN094262; Sun, 7 Feb 2010 18:06:55 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17I6t0p094260; Sun, 7 Feb 2010 18:06:55 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002071806.o17I6t0p094260@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 7 Feb 2010 18:06: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: r203621 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 18:06:55 -0000 Author: gavin Date: Sun Feb 7 18:06:55 2010 New Revision: 203621 URL: http://svn.freebsd.org/changeset/base/203621 Log: Bump .Dd for r203620 MFC after: 1 week Modified: head/share/man/man4/vr.4 Modified: head/share/man/man4/vr.4 ============================================================================== --- head/share/man/man4/vr.4 Sun Feb 7 18:05:12 2010 (r203620) +++ head/share/man/man4/vr.4 Sun Feb 7 18:06:55 2010 (r203621) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2008 +.Dd February 7, 2010 .Dt VR 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 18:36:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3B9F1065679; Sun, 7 Feb 2010 18:36:30 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C34D88FC16; Sun, 7 Feb 2010 18:36:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17IaUWi001017; Sun, 7 Feb 2010 18:36:30 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17IaUaa001014; Sun, 7 Feb 2010 18:36:30 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002071836.o17IaUaa001014@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 7 Feb 2010 18:36: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: r203622 - in head: share/man/man4 sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 18:36:31 -0000 Author: gavin Date: Sun Feb 7 18:36:30 2010 New Revision: 203622 URL: http://svn.freebsd.org/changeset/base/203622 Log: Add support for a few more Sony-specific ACPI features (default display brightness, wired LAN power and bass gain), and update the description of one previously unknown feature (display contrast). While here, expand on a comment and remove two defines left over from an old version of the code. Also update man page to document the above changes, and correct grammar. PR: kern/127581 Modified: head/share/man/man4/acpi_sony.4 head/sys/dev/acpi_support/acpi_sony.c Modified: head/share/man/man4/acpi_sony.4 ============================================================================== --- head/share/man/man4/acpi_sony.4 Sun Feb 7 18:06:55 2010 (r203621) +++ head/share/man/man4/acpi_sony.4 Sun Feb 7 18:36:30 2010 (r203622) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2005 +.Dd February 7, 2010 .Dt ACPI_SONY 4 i386 .Os .Sh NAME @@ -48,15 +48,24 @@ acpi_sony_load="YES" The .Nm driver provides support for the notebook controller in Sony laptops. +Note that not all features will work on all laptop models. .Sh SYSCTLS -The following sysctl is currently implemented: +The following sysctl nodes are currently implemented: .Bl -tag -width indent .It Va dev.acpi_sony.0.brightness Current brightness level of the display. +.It Va dev.acpi_sony.0.brightness_default +Default brightness level of the display (survives reboot). +.It Va dev.acpi_sony.0.contrast +Current contrast level of the display. +.It Va dev.acpi_sony.0.bass_gain +Enable or disable the Bass Gain feature. .It Va dev.acpi_sony.0.cdp Turns the CD power on or off. .It Va dev.acpi_sony.0.azp Turns the audio power on or off. +.It Va dev.acpi_sony.0.lnp +Turns the wired network interface power on or off. .El .Sh SEE ALSO .Xr acpi 4 , Modified: head/sys/dev/acpi_support/acpi_sony.c ============================================================================== --- head/sys/dev/acpi_support/acpi_sony.c Sun Feb 7 18:06:55 2010 (r203621) +++ head/sys/dev/acpi_support/acpi_sony.c Sun Feb 7 18:36:30 2010 (r203622) @@ -42,14 +42,21 @@ __FBSDID("$FreeBSD$"); #define _COMPONENT ACPI_OEM ACPI_MODULE_NAME("Sony") -#define ACPI_SONY_GET_BRIGHTNESS "GBRT" -#define ACPI_SONY_SET_BRIGHTNESS "SBRT" #define ACPI_SONY_GET_PID "GPID" /* * SNY5001 + * This is the ACPI handle for the "Sony Notebook Control" driver under + * Windows. + * It provides several methods within the ACPI namespace, including: * [GS]BRT [GS]PBR [GS]CTR [GS]PCR [GS]CMI [CDPW GCDP]? GWDP PWAK PWRN * + * SNY6001 + * This is the ACPI handle for the "Sony Programmable I/O" driver under + * Windows. + * It is not yet supported by this driver, but provides control over the + * power to the bluetooth, built-in camera and HSDPA modem devices in some + * laptops, and also allows some control of the fan speed. */ struct acpi_sony_softc { @@ -63,14 +70,17 @@ static struct acpi_sony_name_list char *comment; } acpi_sony_oids[] = { { "brightness", "GBRT", "SBRT", "Display Brightness"}, - { "ctr", "GCTR", "SCTR", "??"}, + { "brightness_default", "GPBR", "SPBR", "Default Display Brightness"}, + { "contrast", "GCTR", "SCTR", "Display Contrast"}, + { "bass_gain", "GMGB", "SMGB", "Multimedia Bass Gain"}, { "pcr", "GPCR", "SPCR", "???"}, #if 0 - { "cmi", "GCMI", "SCMI", "????"}, + { "cmi", "GCMI", "SCMI", "???"}, #endif - { "wdp", "GWDP", NULL, "?????"}, + { "wdp", "GWDP", NULL, "???"}, { "cdp", "GCDP", "CDPW", "CD Power"}, /*shares [\GL03]&0x8 flag*/ { "azp", "GAZP", "AZPW", "Audio Power"}, + { "lnp", "GLNP", "LNPW", "LAN Power"}, { NULL, NULL, NULL } }; From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 19:41:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE05A106566C for ; Sun, 7 Feb 2010 19:41: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 300C88FC16 for ; Sun, 7 Feb 2010 19:41:29 +0000 (UTC) Received: (qmail 4306 invoked by uid 399); 7 Feb 2010 19:41:29 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 7 Feb 2010 19:41:29 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B6F1778.4020703@FreeBSD.org> Date: Sun, 07 Feb 2010 11:41:44 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.7) Gecko/20100123 Thunderbird/3.0.1 MIME-Version: 1.0 To: Bruce Simpson References: <201002062122.o16LM1eS042778@svn.freebsd.org> <4B6E43C0.3060302@FreeBSD.org> <4B6E47CA.7020506@incunabulum.net> In-Reply-To: <4B6E47CA.7020506@incunabulum.net> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB Content-Type: multipart/mixed; boundary="------------070105070009020101050600" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce M Simpson Subject: Re: svn commit: r203574 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 19:41:32 -0000 This is a multi-part message in MIME format. --------------070105070009020101050600 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 02/06/10 20:55, Bruce Simpson wrote: > On 07/02/2010 04:38, Doug Barton wrote: >> >> Are all the port numbers that have been added recently things that >> have been requested by users? IIUC there is a cost "albeit small" for >> parsing the /etc/services file each time it's read, so traditionally >> we've tried to keep it as small as possible while still meeting the >> needs of our users. > > I've been running sane-backends with this mod locally on all my FreeBSD > desktop clients for some time. Given that it's been given an official > allocation by IANA it seemed reasonable to add it to our own > /etc/services to support this use. It's pretty essential for day-to-day > office use of FreeBSD as a desktop system. I'm taking from your message that you have a defined, limited goal in mind for adding certain ports, which I have no objection to. After all, developers are users too. :) > I have a diff to add an RC script to the existing graphics/sane-backends > port here, Ok, a couple of comments. Overall it looks good. Although it's not critical you can s#%%RC_SUBR%%#/etc/rc.subr#. The first "saned_uid=saned" line is not needed, your default variable assignment is fine. However the default empty variable assignment for _flags is not necessary or desirable. It's better to put that information in the comments. See http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html for examples. There are a few other issues, like not doing the _flags warning unconditionally, etc. The attached version should work for you, test it of course, caveat emptor, one per person, etc. hth, Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso --------------070105070009020101050600 Content-Type: text/plain; name="saned.in" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="saned.in" IyEvYmluL3NoCiMKIyAkRnJlZUJTRCQKIwojIFBST1ZJREU6IHNhbmVkCiMgUkVRVUlSRTog bmV0aWYgcm91dGluZyBtb3VudGNyaXRsb2NhbAojIEJFRk9SRTogIE5FVFdPUktJTkcKIwoj IEEgc2FtcGxlIHNhbmVkIHN0YXJ0dXAgc2NyaXB0LgojCiMgQWRkIHRoZSBmb2xsb3dpbmcg bGluZSB0byAvZXRjL3JjLmNvbmYgdG8gZW5hYmxlIHNhbmVkOgojCXNhbmVkX2VuYWJsZT0i WUVTIgojCiMgQkxBSCBCTEFIIEJMQUggQkxBSCBCTEFIIEJMQUggQkxBSAojCXNhbmVkX2Zs YWdzPSIiCiMKCi4gL2V0Yy9yYy5zdWJyCgpuYW1lPSJzYW5lZCIKcmN2YXI9YHNldF9yY3Zh cmAKY29tbWFuZD0iJSVQUkVGSVglJS9zYmluLyR7bmFtZX0iCgpzdGFydF9wcmVjbWQ9JHtu YW1lfV9wcmVzdGFydAoKc2FuZWRfcHJlc3RhcnQoKQp7CgljYXNlICIke3NhbmVkX2ZsYWdz fSIgaW4KCSotYVwgKikgZXJyICJzYW5lZF9mbGFncyBpbmNsdWRlcyB0aGUgLWEgb3B0aW9u LiBQbGVhc2UgdXNlIHNhbmVkX3VpZCBpbnN0ZWFkLiIgOzsKCWVzYWMKfQoKbG9hZF9yY19j b25maWcgJG5hbWUKCjogJHtzYW5lZF9lbmFibGU9Ik5PIn0KOiAke3NhbmVkX3VpZD0ic2Fu ZWQifQoKY29tbWFuZF9hcmdzPSItYSAkc2FuZWRfdWlkIgoKcnVuX3JjX2NvbW1hbmQgIiQx IgoK --------------070105070009020101050600-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 19:49:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB15F106566C; Sun, 7 Feb 2010 19:49: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 AAD988FC15; Sun, 7 Feb 2010 19:49:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17Jn1FO017130; Sun, 7 Feb 2010 19:49:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17Jn16s017128; Sun, 7 Feb 2010 19:49:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002071949.o17Jn16s017128@svn.freebsd.org> From: Warner Losh Date: Sun, 7 Feb 2010 19:49: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: r203629 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 19:49:01 -0000 Author: imp Date: Sun Feb 7 19:49:01 2010 New Revision: 203629 URL: http://svn.freebsd.org/changeset/base/203629 Log: merge from my tbemd branch: cmpdi2 and ucmpdi2 are genereated when the inline limit is pushed to a very low level. Include them here until we can find a better way to optionally include them. They are small... Modified: head/sys/conf/files.mips Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Sun Feb 7 19:46:03 2010 (r203628) +++ head/sys/conf/files.mips Sun Feb 7 19:49:01 2010 (r203629) @@ -71,6 +71,7 @@ geom/geom_mbr.c optional geom_mbr geom/geom_mbr_enc.c optional geom_mbr libkern/ashldi3.c standard libkern/ashrdi3.c standard +libkern/cmpdi2.c standard libkern/divdi3.c optional isa_mips32 libkern/ffsl.c standard libkern/fls.c standard @@ -79,6 +80,7 @@ libkern/lshrdi3.c standard libkern/memmove.c standard libkern/moddi3.c optional isa_mips32 libkern/qdivrem.c optional isa_mips32 +libkern/ucmpdi2.c standard libkern/udivdi3.c optional isa_mips32 libkern/umoddi3.c optional isa_mips32 From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 20:26:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18F99106566C; Sun, 7 Feb 2010 20:26: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 E27138FC12; Sun, 7 Feb 2010 20:26:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17KQjpu025809; Sun, 7 Feb 2010 20:26:45 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17KQj8h025804; Sun, 7 Feb 2010 20:26:45 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201002072026.o17KQj8h025804@svn.freebsd.org> From: Doug Barton Date: Sun, 7 Feb 2010 20:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203634 - in stable/8/lib/bind/dns: . dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 20:26:46 -0000 Author: dougb Date: Sun Feb 7 20:26:45 2010 New Revision: 203634 URL: http://svn.freebsd.org/changeset/base/203634 Log: MFC 202960: Copyright-only changes to generated files as part of the 9.6.1-P3 update Modified: stable/8/lib/bind/dns/code.h stable/8/lib/bind/dns/dns/enumclass.h stable/8/lib/bind/dns/dns/enumtype.h stable/8/lib/bind/dns/dns/rdatastruct.h Directory Properties: stable/8/lib/bind/ (props changed) Modified: stable/8/lib/bind/dns/code.h ============================================================================== --- stable/8/lib/bind/dns/code.h Sun Feb 7 20:01:52 2010 (r203633) +++ stable/8/lib/bind/dns/code.h Sun Feb 7 20:26:45 2010 (r203634) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any Modified: stable/8/lib/bind/dns/dns/enumclass.h ============================================================================== --- stable/8/lib/bind/dns/dns/enumclass.h Sun Feb 7 20:01:52 2010 (r203633) +++ stable/8/lib/bind/dns/dns/enumclass.h Sun Feb 7 20:26:45 2010 (r203634) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any Modified: stable/8/lib/bind/dns/dns/enumtype.h ============================================================================== --- stable/8/lib/bind/dns/dns/enumtype.h Sun Feb 7 20:01:52 2010 (r203633) +++ stable/8/lib/bind/dns/dns/enumtype.h Sun Feb 7 20:26:45 2010 (r203634) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any Modified: stable/8/lib/bind/dns/dns/rdatastruct.h ============================================================================== --- stable/8/lib/bind/dns/dns/rdatastruct.h Sun Feb 7 20:01:52 2010 (r203633) +++ stable/8/lib/bind/dns/dns/rdatastruct.h Sun Feb 7 20:26:45 2010 (r203634) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 20:28:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 788431065679; Sun, 7 Feb 2010 20:28:25 +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 650C88FC1C; Sun, 7 Feb 2010 20:28:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17KSPYU026226; Sun, 7 Feb 2010 20:28:25 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17KSPVN026213; Sun, 7 Feb 2010 20:28:25 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201002072028.o17KSPVN026213@svn.freebsd.org> From: Doug Barton Date: Sun, 7 Feb 2010 20:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203635 - in stable/8/contrib/bind9: . bin/dnssec bin/named doc/arm lib/dns lib/dns/include/dns lib/lwres/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 20:28:25 -0000 Author: dougb Date: Sun Feb 7 20:28:24 2010 New Revision: 203635 URL: http://svn.freebsd.org/changeset/base/203635 Log: MFC 202961: Upgrade to BIND 9.6.1-P3. This version address the following vulnerabilities: BIND 9 Cache Update from Additional Section https://www.isc.org/advisories/CVE-2009-4022v6 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-4022 A nameserver with DNSSEC validation enabled may incorrectly add unauthenticated records to its cache that are received during the resolution of a recursive client query BIND 9 DNSSEC validation code could cause bogus NXDOMAIN responses https://www.isc.org/advisories/CVE-2010-0097 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-0097 There was an error in the DNSSEC NSEC/NSEC3 validation code that could cause bogus NXDOMAIN responses (that is, NXDOMAIN responses for records proven by NSEC or NSEC3 to exist) to be cached as if they had validated correctly These issues only affect systems with DNSSEC validation enabled. Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/FAQ stable/8/contrib/bind9/FAQ.xml stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.8 stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.html stable/8/contrib/bind9/bin/named/query.c stable/8/contrib/bind9/doc/arm/Bv9ARM.pdf stable/8/contrib/bind9/doc/arm/man.dnssec-signzone.html stable/8/contrib/bind9/doc/arm/man.named-checkconf.html stable/8/contrib/bind9/doc/arm/man.named-checkzone.html stable/8/contrib/bind9/doc/arm/man.named.html stable/8/contrib/bind9/doc/arm/man.nsupdate.html stable/8/contrib/bind9/doc/arm/man.rndc-confgen.html stable/8/contrib/bind9/doc/arm/man.rndc.conf.html stable/8/contrib/bind9/doc/arm/man.rndc.html stable/8/contrib/bind9/lib/dns/include/dns/db.h stable/8/contrib/bind9/lib/dns/include/dns/ncache.h stable/8/contrib/bind9/lib/dns/include/dns/types.h stable/8/contrib/bind9/lib/dns/rbtdb.c stable/8/contrib/bind9/lib/dns/resolver.c stable/8/contrib/bind9/lib/dns/validator.c stable/8/contrib/bind9/lib/lwres/man/lwres.html stable/8/contrib/bind9/lib/lwres/man/lwres_buffer.html stable/8/contrib/bind9/lib/lwres/man/lwres_config.html stable/8/contrib/bind9/lib/lwres/man/lwres_context.html stable/8/contrib/bind9/lib/lwres/man/lwres_gabn.html stable/8/contrib/bind9/lib/lwres/man/lwres_gai_strerror.html stable/8/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.html stable/8/contrib/bind9/lib/lwres/man/lwres_gethostent.html stable/8/contrib/bind9/lib/lwres/man/lwres_getipnode.html stable/8/contrib/bind9/lib/lwres/man/lwres_getnameinfo.html stable/8/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.html stable/8/contrib/bind9/lib/lwres/man/lwres_gnba.html stable/8/contrib/bind9/lib/lwres/man/lwres_hstrerror.html stable/8/contrib/bind9/lib/lwres/man/lwres_inetntop.html stable/8/contrib/bind9/lib/lwres/man/lwres_noop.html stable/8/contrib/bind9/lib/lwres/man/lwres_packet.html stable/8/contrib/bind9/lib/lwres/man/lwres_resutil.html stable/8/contrib/bind9/version Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/CHANGES Sun Feb 7 20:28:24 2010 (r203635) @@ -1,3 +1,15 @@ + --- 9.6.1-P3 released --- + +2831. [security] Do not attempt to validate or cache + out-of-bailiwick data returned with a secure + answer; it must be re-fetched from its original + source and validated in that context. [RT #20819] + +2828. [security] Cached CNAME or DNAME RR could be returned to clients + without DNSSEC validation. [RT #20737] + +2827. [security] Bogus NXDOMAIN could be cached as if valid. [RT #20712] + --- 9.6.1-P2 released --- 2772. [security] When validating, track whether pending data was from Modified: stable/8/contrib/bind9/FAQ ============================================================================== --- stable/8/contrib/bind9/FAQ Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/FAQ Sun Feb 7 20:28:24 2010 (r203635) @@ -153,24 +153,29 @@ A: BIND 9.3 and later: Use TSIG to selec Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { - match-clients { !key external; 10.0.1/24; }; + match-clients { !key external; // reject message ment for the + // external view. + 10.0.1/24; }; // accept from these addresses. ... }; view "external" { match-clients { key external; any; }; - server 10.0.1.2 { keys external; }; + server 10.0.1.2 { keys external; }; // tag messages from the + // external view to the + // other servers for the + // view. recursion no; ... }; Slave 10.0.1.2: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { match-clients { !key external; 10.0.1/24; }; @@ -220,13 +225,13 @@ A: You choose one view to be master and Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; key "mykey" { - algorithm hmac-md5; - secret "yyyyyyyy"; + algorithm hmac-sha256; + secret "yyyyyyyyyyyyyyyyyyyyyyyy"; }; view "internal" { @@ -239,7 +244,7 @@ A: You choose one view to be master and type master; file "internal/example.db"; allow-update { key mykey; }; - notify-also { 10.0.1.1; }; + also-notify { 10.0.1.1; }; }; }; @@ -249,7 +254,7 @@ A: You choose one view to be master and type slave; file "external/example.db"; masters { 10.0.1.1; }; - transfer-source { 10.0.1.1; }; + transfer-source 10.0.1.1; // allow-update-forwarding { any; }; // allow-notify { ... }; }; Modified: stable/8/contrib/bind9/FAQ.xml ============================================================================== --- stable/8/contrib/bind9/FAQ.xml Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/FAQ.xml Sun Feb 7 20:28:24 2010 (r203635) @@ -17,7 +17,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> - +
Frequently Asked Questions about BIND 9 @@ -319,24 +319,29 @@ Slave: 10.0.1.3 (internal), 10.0.1.4 (ex Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { - match-clients { !key external; 10.0.1/24; }; + match-clients { !key external; // reject message ment for the + // external view. + 10.0.1/24; }; // accept from these addresses. ... }; view "external" { match-clients { key external; any; }; - server 10.0.1.2 { keys external; }; + server 10.0.1.2 { keys external; }; // tag messages from the + // external view to the + // other servers for the + // view. recursion no; ... }; Slave 10.0.1.2: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { match-clients { !key external; 10.0.1/24; }; @@ -424,13 +429,13 @@ named-checkzone example.com tmp Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; key "mykey" { - algorithm hmac-md5; - secret "yyyyyyyy"; + algorithm hmac-sha256; + secret "yyyyyyyyyyyyyyyyyyyyyyyy"; }; view "internal" { @@ -443,7 +448,7 @@ Master 10.0.1.1: type master; file "internal/example.db"; allow-update { key mykey; }; - notify-also { 10.0.1.1; }; + also-notify { 10.0.1.1; }; }; }; @@ -453,7 +458,7 @@ Master 10.0.1.1: type slave; file "external/example.db"; masters { 10.0.1.1; }; - transfer-source { 10.0.1.1; }; + transfer-source 10.0.1.1; // allow-update-forwarding { any; }; // allow-notify { ... }; }; Modified: stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.8 ============================================================================== --- stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.8 Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.8 Sun Feb 7 20:28:24 2010 (r203635) @@ -13,163 +13,287 @@ .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" -.\" $Id: dnssec-signzone.8,v 1.47.44.4 2009/06/09 01:47:19 each Exp $ +.\" $Id: dnssec-signzone.8,v 1.47.44.4.8.1 2009/12/31 23:17:46 tbox Exp $ .\" .hy 0 .ad l -.\"Generated by db2man.xsl. Don't modify this, modify the source. -.de Sh \" Subsection -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Ip \" List item -.br -.ie \\n(.$>=3 .ne \\$3 -.el .ne 3 -.IP "\\$1" \\$2 -.. -.TH "DNSSEC-SIGNZONE" 8 "June 08, 2009" "" "" -.SH NAME -dnssec-signzone \- DNSSEC zone signing tool +.\" Title: dnssec\-signzone +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.71.1 +.\" Date: June 08, 2009 +.\" Manual: BIND9 +.\" Source: BIND9 +.\" +.TH "DNSSEC\-SIGNZONE" "8" "June 08, 2009" "BIND9" "BIND9" +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.SH "NAME" +dnssec\-signzone \- DNSSEC zone signing tool .SH "SYNOPSIS" .HP 16 -\fBdnssec\-signzone\fR [\fB\-a\fR] [\fB\-c\ \fIclass\fR\fR] [\fB\-d\ \fIdirectory\fR\fR] [\fB\-e\ \fIend\-time\fR\fR] [\fB\-f\ \fIoutput\-file\fR\fR] [\fB\-g\fR] [\fB\-h\fR] [\fB\-k\ \fIkey\fR\fR] [\fB\-l\ \fIdomain\fR\fR] [\fB\-i\ \fIinterval\fR\fR] [\fB\-I\ \fIinput\-format\fR\fR] [\fB\-j\ \fIjitter\fR\fR] [\fB\-N\ \fIsoa\-serial\-format\fR\fR] [\fB\-o\ \fIorigin\fR\fR] [\fB\-O\ \fIoutput\-format\fR\fR] [\fB\-p\fR] [\fB\-r\ \fIrandomdev\fR\fR] [\fB\-s\ \fIstart\-time\fR\fR] [\fB\-t\fR] [\fB\-v\ \fIlevel\fR\fR] [\fB\-z\fR] [\fB\-3\ \fIsalt\fR\fR] [\fB\-H\ \fIiterations\fR\fR] [\fB\-A\fR] {zonefile} [key...] +\fBdnssec\-signzone\fR [\fB\-a\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-d\ \fR\fB\fIdirectory\fR\fR] [\fB\-e\ \fR\fB\fIend\-time\fR\fR] [\fB\-f\ \fR\fB\fIoutput\-file\fR\fR] [\fB\-g\fR] [\fB\-h\fR] [\fB\-k\ \fR\fB\fIkey\fR\fR] [\fB\-l\ \fR\fB\fIdomain\fR\fR] [\fB\-i\ \fR\fB\fIinterval\fR\fR] [\fB\-I\ \fR\fB\fIinput\-format\fR\fR] [\fB\-j\ \fR\fB\fIjitter\fR\fR] [\fB\-N\ \fR\fB\fIsoa\-serial\-format\fR\fR] [\fB\-o\ \fR\fB\fIorigin\fR\fR] [\fB\-O\ \fR\fB\fIoutput\-format\fR\fR] [\fB\-p\fR] [\fB\-r\ \fR\fB\fIrandomdev\fR\fR] [\fB\-s\ \fR\fB\fIstart\-time\fR\fR] [\fB\-t\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-z\fR] [\fB\-3\ \fR\fB\fIsalt\fR\fR] [\fB\-H\ \fR\fB\fIiterations\fR\fR] [\fB\-A\fR] {zonefile} [key...] .SH "DESCRIPTION" .PP -\fBdnssec\-signzone\fR signs a zone\&. It generates NSEC and RRSIG records and produces a signed version of the zone\&. The security status of delegations from the signed zone (that is, whether the child zones are secure or not) is determined by the presence or absence of a \fIkeyset\fR file for each child zone\&. +\fBdnssec\-signzone\fR +signs a zone. It generates NSEC and RRSIG records and produces a signed version of the zone. The security status of delegations from the signed zone (that is, whether the child zones are secure or not) is determined by the presence or absence of a +\fIkeyset\fR +file for each child zone. .SH "OPTIONS" -.TP +.PP \-a -Verify all generated signatures\&. -.TP +.RS 4 +Verify all generated signatures. +.RE +.PP \-c \fIclass\fR -Specifies the DNS class of the zone\&. -.TP +.RS 4 +Specifies the DNS class of the zone. +.RE +.PP \-k \fIkey\fR -Treat specified key as a key signing key ignoring any key flags\&. This option may be specified multiple times\&. -.TP +.RS 4 +Treat specified key as a key signing key ignoring any key flags. This option may be specified multiple times. +.RE +.PP \-l \fIdomain\fR -Generate a DLV set in addition to the key (DNSKEY) and DS sets\&. The domain is appended to the name of the records\&. -.TP +.RS 4 +Generate a DLV set in addition to the key (DNSKEY) and DS sets. The domain is appended to the name of the records. +.RE +.PP \-d \fIdirectory\fR -Look for \fIkeyset\fR files in \fBdirectory\fR as the directory -.TP +.RS 4 +Look for +\fIkeyset\fR +files in +\fBdirectory\fR +as the directory +.RE +.PP \-g -Generate DS records for child zones from keyset files\&. Existing DS records will be removed\&. -.TP +.RS 4 +Generate DS records for child zones from keyset files. Existing DS records will be removed. +.RE +.PP \-s \fIstart\-time\fR -Specify the date and time when the generated RRSIG records become valid\&. This can be either an absolute or relative time\&. An absolute start time is indicated by a number in YYYYMMDDHHMMSS notation; 20000530144500 denotes 14:45:00 UTC on May 30th, 2000\&. A relative start time is indicated by +N, which is N seconds from the current time\&. If no \fBstart\-time\fR is specified, the current time minus 1 hour (to allow for clock skew) is used\&. -.TP +.RS 4 +Specify the date and time when the generated RRSIG records become valid. This can be either an absolute or relative time. An absolute start time is indicated by a number in YYYYMMDDHHMMSS notation; 20000530144500 denotes 14:45:00 UTC on May 30th, 2000. A relative start time is indicated by +N, which is N seconds from the current time. If no +\fBstart\-time\fR +is specified, the current time minus 1 hour (to allow for clock skew) is used. +.RE +.PP \-e \fIend\-time\fR -Specify the date and time when the generated RRSIG records expire\&. As with \fBstart\-time\fR, an absolute time is indicated in YYYYMMDDHHMMSS notation\&. A time relative to the start time is indicated with +N, which is N seconds from the start time\&. A time relative to the current time is indicated with now+N\&. If no \fBend\-time\fR is specified, 30 days from the start time is used as a default\&. -.TP +.RS 4 +Specify the date and time when the generated RRSIG records expire. As with +\fBstart\-time\fR, an absolute time is indicated in YYYYMMDDHHMMSS notation. A time relative to the start time is indicated with +N, which is N seconds from the start time. A time relative to the current time is indicated with now+N. If no +\fBend\-time\fR +is specified, 30 days from the start time is used as a default. +.RE +.PP \-f \fIoutput\-file\fR -The name of the output file containing the signed zone\&. The default is to append \fI\&.signed\fR to the input filename\&. -.TP +.RS 4 +The name of the output file containing the signed zone. The default is to append +\fI.signed\fR +to the input filename. +.RE +.PP \-h -Prints a short summary of the options and arguments to \fBdnssec\-signzone\fR\&. -.TP +.RS 4 +Prints a short summary of the options and arguments to +\fBdnssec\-signzone\fR. +.RE +.PP \-i \fIinterval\fR -When a previously\-signed zone is passed as input, records may be resigned\&. The \fBinterval\fR option specifies the cycle interval as an offset from the current time (in seconds)\&. If a RRSIG record expires after the cycle interval, it is retained\&. Otherwise, it is considered to be expiring soon, and it will be replaced\&. -The default cycle interval is one quarter of the difference between the signature end and start times\&. So if neither \fBend\-time\fR or \fBstart\-time\fR are specified, \fBdnssec\-signzone\fR generates signatures that are valid for 30 days, with a cycle interval of 7\&.5 days\&. Therefore, if any existing RRSIG records are due to expire in less than 7\&.5 days, they would be replaced\&. -.TP +.RS 4 +When a previously\-signed zone is passed as input, records may be resigned. The +\fBinterval\fR +option specifies the cycle interval as an offset from the current time (in seconds). If a RRSIG record expires after the cycle interval, it is retained. Otherwise, it is considered to be expiring soon, and it will be replaced. +.sp +The default cycle interval is one quarter of the difference between the signature end and start times. So if neither +\fBend\-time\fR +or +\fBstart\-time\fR +are specified, +\fBdnssec\-signzone\fR +generates signatures that are valid for 30 days, with a cycle interval of 7.5 days. Therefore, if any existing RRSIG records are due to expire in less than 7.5 days, they would be replaced. +.RE +.PP \-I \fIinput\-format\fR -The format of the input zone file\&. Possible formats are \fB"text"\fR (default) and \fB"raw"\fR\&. This option is primarily intended to be used for dynamic signed zones so that the dumped zone file in a non\-text format containing updates can be signed directly\&. The use of this option does not make much sense for non\-dynamic zones\&. -.TP +.RS 4 +The format of the input zone file. Possible formats are +\fB"text"\fR +(default) and +\fB"raw"\fR. This option is primarily intended to be used for dynamic signed zones so that the dumped zone file in a non\-text format containing updates can be signed directly. The use of this option does not make much sense for non\-dynamic zones. +.RE +.PP \-j \fIjitter\fR -When signing a zone with a fixed signature lifetime, all RRSIG records issued at the time of signing expires simultaneously\&. If the zone is incrementally signed, i\&.e\&. a previously\-signed zone is passed as input to the signer, all expired signatures have to be regenerated at about the same time\&. The \fBjitter\fR option specifies a jitter window that will be used to randomize the signature expire time, thus spreading incremental signature regeneration over time\&. -Signature lifetime jitter also to some extent benefits validators and servers by spreading out cache expiration, i\&.e\&. if large numbers of RRSIGs don't expire at the same time from all caches there will be less congestion than if all validators need to refetch at mostly the same time\&. -.TP +.RS 4 +When signing a zone with a fixed signature lifetime, all RRSIG records issued at the time of signing expires simultaneously. If the zone is incrementally signed, i.e. a previously\-signed zone is passed as input to the signer, all expired signatures have to be regenerated at about the same time. The +\fBjitter\fR +option specifies a jitter window that will be used to randomize the signature expire time, thus spreading incremental signature regeneration over time. +.sp +Signature lifetime jitter also to some extent benefits validators and servers by spreading out cache expiration, i.e. if large numbers of RRSIGs don't expire at the same time from all caches there will be less congestion than if all validators need to refetch at mostly the same time. +.RE +.PP \-n \fIncpus\fR -Specifies the number of threads to use\&. By default, one thread is started for each detected CPU\&. -.TP +.RS 4 +Specifies the number of threads to use. By default, one thread is started for each detected CPU. +.RE +.PP \-N \fIsoa\-serial\-format\fR -The SOA serial number format of the signed zone\&. Possible formats are \fB"keep"\fR (default), \fB"increment"\fR and \fB"unixtime"\fR\&. -.RS -.TP +.RS 4 +The SOA serial number format of the signed zone. Possible formats are +\fB"keep"\fR +(default), +\fB"increment"\fR +and +\fB"unixtime"\fR. +.RS 4 +.PP \fB"keep"\fR -Do not modify the SOA serial number\&. -.TP +.RS 4 +Do not modify the SOA serial number. +.RE +.PP \fB"increment"\fR -Increment the SOA serial number using RFC 1982 arithmetics\&. -.TP +.RS 4 +Increment the SOA serial number using RFC 1982 arithmetics. +.RE +.PP \fB"unixtime"\fR -Set the SOA serial number to the number of seconds since epoch\&. +.RS 4 +Set the SOA serial number to the number of seconds since epoch. .RE -.IP -.TP +.RE +.RE +.PP \-o \fIorigin\fR -The zone origin\&. If not specified, the name of the zone file is assumed to be the origin\&. -.TP +.RS 4 +The zone origin. If not specified, the name of the zone file is assumed to be the origin. +.RE +.PP \-O \fIoutput\-format\fR -The format of the output file containing the signed zone\&. Possible formats are \fB"text"\fR (default) and \fB"raw"\fR\&. -.TP +.RS 4 +The format of the output file containing the signed zone. Possible formats are +\fB"text"\fR +(default) and +\fB"raw"\fR. +.RE +.PP \-p -Use pseudo\-random data when signing the zone\&. This is faster, but less secure, than using real random data\&. This option may be useful when signing large zones or when the entropy source is limited\&. -.TP +.RS 4 +Use pseudo\-random data when signing the zone. This is faster, but less secure, than using real random data. This option may be useful when signing large zones or when the entropy source is limited. +.RE +.PP \-r \fIrandomdev\fR -Specifies the source of randomness\&. If the operating system does not provide a \fI/dev/random\fR or equivalent device, the default source of randomness is keyboard input\&. \fIrandomdev\fR specifies the name of a character device or file containing random data to be used instead of the default\&. The special value \fIkeyboard\fR indicates that keyboard input should be used\&. -.TP +.RS 4 +Specifies the source of randomness. If the operating system does not provide a +\fI/dev/random\fR +or equivalent device, the default source of randomness is keyboard input. +\fIrandomdev\fR +specifies the name of a character device or file containing random data to be used instead of the default. The special value +\fIkeyboard\fR +indicates that keyboard input should be used. +.RE +.PP \-t -Print statistics at completion\&. -.TP +.RS 4 +Print statistics at completion. +.RE +.PP \-v \fIlevel\fR -Sets the debugging level\&. -.TP +.RS 4 +Sets the debugging level. +.RE +.PP \-z -Ignore KSK flag on key when determining what to sign\&. -.TP +.RS 4 +Ignore KSK flag on key when determining what to sign. +.RE +.PP \-3 \fIsalt\fR -Generate a NSEC3 chain with the given hex encoded salt\&. A dash (\fIsalt\fR) can be used to indicate that no salt is to be used when generating the NSEC3 chain\&. -.TP +.RS 4 +Generate a NSEC3 chain with the given hex encoded salt. A dash (\fIsalt\fR) can be used to indicate that no salt is to be used when generating the NSEC3 chain. +.RE +.PP \-H \fIiterations\fR -When generating a NSEC3 chain use this many interations\&. The default is 100\&. -.TP +.RS 4 +When generating a NSEC3 chain use this many interations. The default is 100. +.RE +.PP \-A -When generating a NSEC3 chain set the OPTOUT flag on all NSEC3 records and do not generate NSEC3 records for insecure delegations\&. -.TP +.RS 4 +When generating a NSEC3 chain set the OPTOUT flag on all NSEC3 records and do not generate NSEC3 records for insecure delegations. +.RE +.PP zonefile -The file containing the zone to be signed\&. -.TP +.RS 4 +The file containing the zone to be signed. +.RE +.PP key -Specify which keys should be used to sign the zone\&. If no keys are specified, then the zone will be examined for DNSKEY records at the zone apex\&. If these are found and there are matching private keys, in the current directory, then these will be used for signing\&. +.RS 4 +Specify which keys should be used to sign the zone. If no keys are specified, then the zone will be examined for DNSKEY records at the zone apex. If these are found and there are matching private keys, in the current directory, then these will be used for signing. +.RE .SH "EXAMPLE" .PP -The following command signs the \fBexample\&.com\fR zone with the DSA key generated by \fBdnssec\-keygen\fR (Kexample\&.com\&.+003+17247)\&. The zone's keys must be in the master file (\fIdb\&.example\&.com\fR)\&. This invocation looks for \fIkeyset\fR files, in the current directory, so that DS records can be generated from them (\fB\-g\fR)\&. +The following command signs the +\fBexample.com\fR +zone with the DSA key generated by +\fBdnssec\-keygen\fR +(Kexample.com.+003+17247). The zone's keys must be in the master file (\fIdb.example.com\fR). This invocation looks for +\fIkeyset\fR +files, in the current directory, so that DS records can be generated from them (\fB\-g\fR). +.sp +.RS 4 .nf -% dnssec\-signzone \-g \-o example\&.com db\&.example\&.com \\ -Kexample\&.com\&.+003+17247 -db\&.example\&.com\&.signed +% dnssec\-signzone \-g \-o example.com db.example.com \\ +Kexample.com.+003+17247 +db.example.com.signed % .fi +.RE .PP -In the above example, \fBdnssec\-signzone\fR creates the file \fIdb\&.example\&.com\&.signed\fR\&. This file should be referenced in a zone statement in a \fInamed\&.conf\fR file\&. -.PP -This example re\-signs a previously signed zone with default parameters\&. The private keys are assumed to be in the current directory\&. +In the above example, +\fBdnssec\-signzone\fR +creates the file +\fIdb.example.com.signed\fR. This file should be referenced in a zone statement in a +\fInamed.conf\fR +file. +.PP +This example re\-signs a previously signed zone with default parameters. The private keys are assumed to be in the current directory. +.sp +.RS 4 .nf -% cp db\&.example\&.com\&.signed db\&.example\&.com -% dnssec\-signzone \-o example\&.com db\&.example\&.com -db\&.example\&.com\&.signed +% cp db.example.com.signed db.example.com +% dnssec\-signzone \-o example.com db.example.com +db.example.com.signed % .fi +.RE .SH "KNOWN BUGS" .PP - \fBdnssec\-signzone\fR was designed so that it could sign a zone partially, using only a subset of the DNSSEC keys needed to produce a fully\-signed zone\&. This permits a zone administrator, for example, to sign a zone with one key on one machine, move the resulting partially\-signed zone to a second machine, and sign it again with a second key\&. -.PP -An unfortunate side\-effect of this flexibility is that \fBdnssec\-signzone\fR does not check to make sure it's signing a zone with any valid keys at all\&. An attempt to sign a zone without any keys will appear to succeed, producing a "signed" zone with no signatures\&. There is no warning issued when a zone is not fully signed\&. +\fBdnssec\-signzone\fR +was designed so that it could sign a zone partially, using only a subset of the DNSSEC keys needed to produce a fully\-signed zone. This permits a zone administrator, for example, to sign a zone with one key on one machine, move the resulting partially\-signed zone to a second machine, and sign it again with a second key. .PP -This will be corrected in a future release\&. In the meantime, ISC recommends examining the output of \fBdnssec\-signzone\fR to confirm that the zone is properly signed by all keys before using it\&. +An unfortunate side\-effect of this flexibility is that +\fBdnssec\-signzone\fR +does not check to make sure it's signing a zone with any valid keys at all. An attempt to sign a zone without any keys will appear to succeed, producing a "signed" zone with no signatures. There is no warning issued when a zone is not fully signed. +.PP +This will be corrected in a future release. In the meantime, ISC recommends examining the output of +\fBdnssec\-signzone\fR +to confirm that the zone is properly signed by all keys before using it. .SH "SEE ALSO" .PP -\fBdnssec\-keygen\fR(8), BIND 9 Administrator Reference Manual, RFC 4033\&. +\fBdnssec\-keygen\fR(8), +BIND 9 Administrator Reference Manual, +RFC 4033. .SH "AUTHOR" .PP -Internet Systems Consortium +Internet Systems Consortium +.SH "COPYRIGHT" +Copyright \(co 2004\-2009 Internet Systems Consortium, Inc. ("ISC") +.br +Copyright \(co 2000\-2003 Internet Software Consortium. +.br Modified: stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.html ============================================================================== --- stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,12 +14,12 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + dnssec-signzone - +
@@ -32,7 +32,7 @@

dnssec-signzone [-a] [-c class] [-d directory] [-e end-time] [-f output-file] [-g] [-h] [-k key] [-l domain] [-i interval] [-I input-format] [-j jitter] [-N soa-seria l-format] [-o origin] [-O output-format] [-p] [-r randomdev] [-s start-time] [-t] [-v level] [-z] [-3 salt] [-H iterations] [-A] {zonefile} [key...]

-

DESCRIPTION

+

DESCRIPTION

dnssec-signzone signs a zone. It generates NSEC and RRSIG records and produces a signed version of the @@ -43,7 +43,7 @@

-

OPTIONS

+

OPTIONS

-a

@@ -258,7 +258,7 @@

-

EXAMPLE

+

EXAMPLE

The following command signs the example.com zone with the DSA key generated by dnssec-keygen @@ -287,7 +287,7 @@ db.example.com.signed %

-

KNOWN BUGS

+

KNOWN BUGS

dnssec-signzone was designed so that it could sign a zone partially, using only a subset of the DNSSEC keys @@ -312,14 +312,14 @@ db.example.com.signed

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), BIND 9 Administrator Reference Manual, RFC 4033.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: stable/8/contrib/bind9/bin/named/query.c ============================================================================== --- stable/8/contrib/bind9/bin/named/query.c Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/bin/named/query.c Sun Feb 7 20:28:24 2010 (r203635) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.313.20.7.12.1 2009/11/18 23:58:04 marka Exp $ */ +/* $Id: query.c,v 1.313.20.7.12.4 2009/12/31 22:53:03 each Exp $ */ /*! \file */ @@ -1160,7 +1160,8 @@ query_addadditional(void *arg, dns_name_ goto cleanup; } result = dns_db_find(db, name, version, type, - client->query.dboptions | DNS_DBFIND_GLUEOK, + client->query.dboptions | + DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK, client->now, &node, fname, rdataset, sigrdataset); if (result == DNS_R_GLUE && @@ -1645,7 +1646,8 @@ query_addadditional2(void *arg, dns_name goto try_glue; result = dns_db_find(db, name, version, type, - client->query.dboptions | DNS_DBFIND_GLUEOK, + client->query.dboptions | + DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK, client->now, &node, fname, NULL, NULL); if (result == ISC_R_SUCCESS) goto found; @@ -3718,8 +3720,6 @@ query_find(ns_client_t *client, dns_fetc dns_rdataset_t *noqname; isc_boolean_t resuming; int line = -1; - dns_rdataset_t tmprdataset; - unsigned int dboptions; CTRACE("query_find"); @@ -3937,49 +3937,9 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ - dboptions = client->query.dboptions; - if (sigrdataset == NULL && client->view->enablednssec) { - /* - * If the client doesn't want DNSSEC we still want to - * look for any data pending validation to save a remote - * lookup if possible. - */ - dns_rdataset_init(&tmprdataset); - sigrdataset = &tmprdataset; - dboptions |= DNS_DBFIND_PENDINGOK; - } - refind: result = dns_db_find(db, client->query.qname, version, type, - dboptions, client->now, &node, fname, - rdataset, sigrdataset); - /* - * If we have found pending data try to validate it. - * If the data does not validate as secure and we can't - * use the unvalidated data requery the database with - * pending disabled to prevent infinite looping. - */ - if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) - goto validation_done; - if (validate(client, db, fname, rdataset, sigrdataset)) - goto validation_done; - if (rdataset->trust != dns_trust_pending_answer || - !PENDINGOK(client->query.dboptions)) { - dns_rdataset_disassociate(rdataset); - if (sigrdataset != NULL && - dns_rdataset_isassociated(sigrdataset)) - dns_rdataset_disassociate(sigrdataset); - if (sigrdataset == &tmprdataset) - sigrdataset = NULL; - dns_db_detachnode(db, &node); - dboptions &= ~DNS_DBFIND_PENDINGOK; - goto refind; - } - validation_done: - if (sigrdataset == &tmprdataset) { - if (dns_rdataset_isassociated(sigrdataset)) - dns_rdataset_disassociate(sigrdataset); - sigrdataset = NULL; - } + client->query.dboptions, client->now, + &node, fname, rdataset, sigrdataset); resume: CTRACE("query_find: resume"); Modified: stable/8/contrib/bind9/doc/arm/Bv9ARM.pdf ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/8/contrib/bind9/doc/arm/man.dnssec-signzone.html ============================================================================== --- stable/8/contrib/bind9/doc/arm/man.dnssec-signzone.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/doc/arm/man.dnssec-signzone.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,12 +14,12 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + dnssec-signzone - + @@ -50,7 +50,7 @@

dnssec-signzone [-a] [-c class] [-d directory] [-e end-time] [-f output-file] [-g] [-h] [-k key] [-l domain] [-i interval] [-I input-format] [-j jitter] [-N soa-seria l-format] [-o origin] [-O output-format] [-p] [-r randomdev] [-s start-time] [-t] [-v level] [-z] [-3 salt] [-H iterations] [-A] {zonefile} [key...]

-

DESCRIPTION

+

DESCRIPTION

dnssec-signzone signs a zone. It generates NSEC and RRSIG records and produces a signed version of the @@ -61,7 +61,7 @@

-

OPTIONS

+

OPTIONS

-a

@@ -276,7 +276,7 @@

-

EXAMPLE

+

EXAMPLE

The following command signs the example.com zone with the DSA key generated by dnssec-keygen @@ -305,7 +305,7 @@ db.example.com.signed %

-

KNOWN BUGS

+

KNOWN BUGS

dnssec-signzone was designed so that it could sign a zone partially, using only a subset of the DNSSEC keys @@ -330,14 +330,14 @@ db.example.com.signed

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), BIND 9 Administrator Reference Manual, RFC 4033.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: stable/8/contrib/bind9/doc/arm/man.named-checkconf.html ============================================================================== --- stable/8/contrib/bind9/doc/arm/man.named-checkconf.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/doc/arm/man.named-checkconf.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -50,14 +50,14 @@

named-checkconf [-h] [-v] [-j] [-t directory] {filename} [-z]

-

DESCRIPTION

+

DESCRIPTION

named-checkconf checks the syntax, but not the semantics, of a named configuration file.

-

OPTIONS

+

OPTIONS

-h

@@ -92,21 +92,21 @@

-

RETURN VALUES

+

RETURN VALUES

named-checkconf returns an exit status of 1 if errors were detected and 0 otherwise.

-

SEE ALSO

+

SEE ALSO

named(8), named-checkzone(8), BIND 9 Administrator Reference Manual.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: stable/8/contrib/bind9/doc/arm/man.named-checkzone.html ============================================================================== --- stable/8/contrib/bind9/doc/arm/man.named-checkzone.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/doc/arm/man.named-checkzone.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -51,7 +51,7 @@

named-compilezone [-d] [-j] [-q] [-v] [-c class] [-C mode] [-f format] [-F format] [-i mode] [-k mode] [-m mode] [-n mode] [-o filename] [-s style] [-t directory] [-w directory] [-D] [-W mode] {zonename} {filename}

-

DESCRIPTION

+

DESCRIPTION

named-checkzone checks the syntax and integrity of a zone file. It performs the same checks as named does when loading a @@ -71,7 +71,7 @@

-

OPTIONS

+

OPTIONS

-d

@@ -257,14 +257,14 @@

-

RETURN VALUES

+

RETURN VALUES

named-checkzone returns an exit status of 1 if errors were detected and 0 otherwise.

-

SEE ALSO

+

SEE ALSO

named(8), named-checkconf(8), RFC 1035, @@ -272,7 +272,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: stable/8/contrib/bind9/doc/arm/man.named.html ============================================================================== --- stable/8/contrib/bind9/doc/arm/man.named.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/doc/arm/man.named.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -50,7 +50,7 @@

named [-4] [-6] [-c config-file] [-d debug-level] [-f] [-g] [-m flag] [-n #cpus] [-p port] [-s] [-S #max-socks] [-t directory] [-u user] [-v] [-V] [-x cache-file]

-

DESCRIPTION

+

DESCRIPTION

named is a Domain Name System (DNS) server, part of the BIND 9 distribution from ISC. For more @@ -65,7 +65,7 @@

-

OPTIONS

+

OPTIONS

-4

@@ -238,7 +238,7 @@

-

SIGNALS

+

SIGNALS

In routine operation, signals should not be used to control the nameserver; rndc should be used @@ -259,7 +259,7 @@

-

CONFIGURATION

+

CONFIGURATION

The named configuration file is too complex to describe in detail here. A complete description is provided @@ -268,7 +268,7 @@

-

FILES

+

FILES

/etc/named.conf

@@ -281,7 +281,7 @@

-

SEE ALSO

+

SEE ALSO

RFC 1033, RFC 1034, RFC 1035, @@ -294,7 +294,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: stable/8/contrib/bind9/doc/arm/man.nsupdate.html ============================================================================== --- stable/8/contrib/bind9/doc/arm/man.nsupdate.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/doc/arm/man.nsupdate.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -50,7 +50,7 @@

nsupdate [-d] [-D] [[-g] | [-o] | [-y [hmac:]keyname:secret] | [-k keyfile]] [-t timeout] [-u udptimeout] [-r udpretries] [-R randomdev] [-v] [filename]

-

DESCRIPTION

*** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 20:36:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AAD51065672; Sun, 7 Feb 2010 20:36:24 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEDB88FC14; Sun, 7 Feb 2010 20:36:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17KaN6I028029; Sun, 7 Feb 2010 20:36:23 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17KaNLK028027; Sun, 7 Feb 2010 20:36:23 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002072036.o17KaNLK028027@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 7 Feb 2010 20:36: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: r203636 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 20:36:24 -0000 Author: gavin Date: Sun Feb 7 20:36:23 2010 New Revision: 203636 URL: http://svn.freebsd.org/changeset/base/203636 Log: Correct arguments to free_unr(), "item" was missing. MFC after: 1 week Modified: head/share/man/man9/alloc_unr.9 Modified: head/share/man/man9/alloc_unr.9 ============================================================================== --- head/share/man/man9/alloc_unr.9 Sun Feb 7 20:28:24 2010 (r203635) +++ head/share/man/man9/alloc_unr.9 Sun Feb 7 20:36:23 2010 (r203636) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2005 +.Dd February 7, 2010 .Dt ALLOC_UNR 9 .Os .Sh NAME @@ -81,7 +81,7 @@ is returned. Same as .Fn alloc_unr except that mutex is assumed to be already locked and thus is not used. -.It Fn free_unr uh +.It Fn free_unr uh item Free a previously allocated unit number. This function may require allocating memory, and thus it can sleep. There is no pre-locked variant. From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 20:48:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34EE91065676; Sun, 7 Feb 2010 20:48:58 +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 242858FC13; Sun, 7 Feb 2010 20:48:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17KmwZq030851; Sun, 7 Feb 2010 20:48:58 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17Kmw7B030849; Sun, 7 Feb 2010 20:48:58 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201002072048.o17Kmw7B030849@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 7 Feb 2010 20:48: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: r203637 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 20:48:58 -0000 Author: raj Date: Sun Feb 7 20:48:57 2010 New Revision: 203637 URL: http://svn.freebsd.org/changeset/base/203637 Log: Improve checking whether an ARM VA has a valid mapping before performing cache sync. VIPT/PIPT caches need valid VA-PA mapping in PTE for a cache operation to succeed (unlike VIVT). Prior to this fix pmap was using l2pte_valid() for that check, but this is not sufficient as the function merely checks if a PTE exists (there can be existing but _invalid_ entries in the table). A new pmap_has_valid_mapping() routine is introduced to do this job right by checking proper PTE flags. Among other potential problems this cures coherency issues with L2 caches on MV-78100. Submitted by: Grzegorz Bernacki, Piotr Ziecik Reviewed, tested by: marcel Obtained from: Semihalf MFC after: 1 week Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Sun Feb 7 20:36:23 2010 (r203636) +++ head/sys/arm/arm/pmap.c Sun Feb 7 20:48:57 2010 (r203637) @@ -1157,79 +1157,38 @@ pmap_tlb_flushD(pmap_t pm) cpu_tlb_flushD(); } -static PMAP_INLINE void -pmap_l2cache_wbinv_range(pmap_t pm, vm_offset_t va, vm_size_t len) +static int +pmap_has_valid_mapping(pmap_t pm, vm_offset_t va) { - vm_size_t rest; pd_entry_t *pde; pt_entry_t *ptep; - rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); - - while (len > 0) { - CTR4(KTR_PMAP, "pmap_l2cache_wbinv_range: pmap %p is_kernel %d " - "va 0x%08x len 0x%x ", pm, pm == pmap_kernel(), va, rest); - if (pmap_get_pde_pte(pm, va, &pde, &ptep) && l2pte_valid(*ptep)) - cpu_l2cache_wbinv_range(va, rest); - - len -= rest; - va += rest; + if (pmap_get_pde_pte(pm, va, &pde, &ptep) && + ptep && ((*ptep & L2_TYPE_MASK) != L2_TYPE_INV)) + return (1); - rest = MIN(PAGE_SIZE, len); - } + return (0); } static PMAP_INLINE void pmap_idcache_wbinv_range(pmap_t pm, vm_offset_t va, vm_size_t len) { - - if (pmap_is_current(pm)) { - cpu_idcache_wbinv_range(va, len); - pmap_l2cache_wbinv_range(pm, va, len); - } -} - -static PMAP_INLINE void -pmap_l2cache_wb_range(pmap_t pm, vm_offset_t va, vm_size_t len) -{ - vm_size_t rest; - pd_entry_t *pde; - pt_entry_t *ptep; - - rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); - - while (len > 0) { - CTR4(KTR_PMAP, "pmap_l2cache_wb_range: pmap %p is_kernel %d " - "va 0x%08x len 0x%x ", pm, pm == pmap_kernel(), va, rest); - if (pmap_get_pde_pte(pm, va, &pde, &ptep) && l2pte_valid(*ptep)) - cpu_l2cache_wb_range(va, rest); - - len -= rest; - va += rest; - - rest = MIN(PAGE_SIZE, len); - } -} - -static PMAP_INLINE void -pmap_l2cache_inv_range(pmap_t pm, vm_offset_t va, vm_size_t len) -{ vm_size_t rest; - pd_entry_t *pde; - pt_entry_t *ptep; - - rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); - while (len > 0) { - CTR4(KTR_PMAP, "pmap_l2cache_wb_range: pmap %p is_kernel %d " - "va 0x%08x len 0x%x ", pm, pm == pmap_kernel(), va, rest); - if (pmap_get_pde_pte(pm, va, &pde, &ptep) && l2pte_valid(*ptep)) - cpu_l2cache_inv_range(va, rest); + CTR4(KTR_PMAP, "pmap_dcache_wbinv_range: pmap %p is_kernel %d va 0x%08x" + " len 0x%x ", pm, pm == pmap_kernel(), va, len); - len -= rest; - va += rest; - - rest = MIN(PAGE_SIZE, len); + if (pmap_is_current(pm) || pm == pmap_kernel()) { + rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); + while (len > 0) { + if (pmap_has_valid_mapping(pm, va)) { + cpu_idcache_wbinv_range(va, rest); + cpu_l2cache_wbinv_range(va, rest); + } + len -= rest; + va += rest; + rest = MIN(PAGE_SIZE, len); + } } } @@ -1237,24 +1196,31 @@ static PMAP_INLINE void pmap_dcache_wb_range(pmap_t pm, vm_offset_t va, vm_size_t len, boolean_t do_inv, boolean_t rd_only) { + vm_size_t rest; CTR4(KTR_PMAP, "pmap_dcache_wb_range: pmap %p is_kernel %d va 0x%08x " "len 0x%x ", pm, pm == pmap_kernel(), va, len); CTR2(KTR_PMAP, " do_inv %d rd_only %d", do_inv, rd_only); if (pmap_is_current(pm)) { - if (do_inv) { - if (rd_only) { - cpu_dcache_inv_range(va, len); - pmap_l2cache_inv_range(pm, va, len); - } - else { - cpu_dcache_wbinv_range(va, len); - pmap_l2cache_wbinv_range(pm, va, len); - } - } else if (!rd_only) { - cpu_dcache_wb_range(va, len); - pmap_l2cache_wb_range(pm, va, len); + rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); + while (len > 0) { + if (pmap_has_valid_mapping(pm, va)) { + if (do_inv && rd_only) { + cpu_dcache_inv_range(va, rest); + cpu_l2cache_inv_range(va, rest); + } else if (do_inv) { + cpu_dcache_wbinv_range(va, rest); + cpu_l2cache_wbinv_range(va, rest); + } else if (!rd_only) { + cpu_dcache_wb_range(va, rest); + cpu_l2cache_wb_range(va, rest); + } + } + len -= rest; + va += rest; + + rest = MIN(PAGE_SIZE, len); } } } @@ -3185,7 +3151,8 @@ pmap_remove_all(vm_page_t m) */ if (pmap_is_current(pv->pv_pmap)) { cpu_dcache_inv_range(pv->pv_va, PAGE_SIZE); - cpu_l2cache_inv_range(pv->pv_va, PAGE_SIZE); + if (pmap_has_valid_mapping(pv->pv_pmap, pv->pv_va)) + cpu_l2cache_inv_range(pv->pv_va, PAGE_SIZE); } if (pv->pv_flags & PVF_UNMAN) { @@ -3472,9 +3439,10 @@ do_l2b_alloc: if (pmap_is_current(pmap) && (oflags & PVF_NC) == 0 && (opte & L2_S_PROT_W) != 0 && - (prot & VM_PROT_WRITE) == 0) { + (prot & VM_PROT_WRITE) == 0 && + (opte & L2_TYPE_MASK) != L2_TYPE_INV) { cpu_dcache_wb_range(va, PAGE_SIZE); - pmap_l2cache_wb_range(pmap, va, PAGE_SIZE); + cpu_l2cache_wb_range(va, PAGE_SIZE); } } else { /* From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 21:04:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1D3C106566C; Sun, 7 Feb 2010 21:04:26 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C101E8FC08; Sun, 7 Feb 2010 21:04:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17L4Qwt034304; Sun, 7 Feb 2010 21:04:26 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17L4Qo9034302; Sun, 7 Feb 2010 21:04:26 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002072104.o17L4Qo9034302@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 7 Feb 2010 21:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203638 - stable/8/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 21:04:26 -0000 Author: gavin Date: Sun Feb 7 21:04:26 2010 New Revision: 203638 URL: http://svn.freebsd.org/changeset/base/203638 Log: Merge r202115 from head: Our standard "xterm" termcap entry supports colour, so this tip is redundant. As it happens, "xterm-color" has just been an alias for "xterm" since src/share/termcap/termcap.src 1.131 in September 2002. PR: docs/132959 Modified: stable/8/games/fortune/datfiles/freebsd-tips Directory Properties: stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) Modified: stable/8/games/fortune/datfiles/freebsd-tips ============================================================================== --- stable/8/games/fortune/datfiles/freebsd-tips Sun Feb 7 20:48:57 2010 (r203637) +++ stable/8/games/fortune/datfiles/freebsd-tips Sun Feb 7 21:04:26 2010 (r203638) @@ -50,18 +50,6 @@ If you are in the C shell and have just be able to run it unless you first type "rehash". -- Dru % -If you are running xterm, the default TERM variable will be 'xterm'. If you -set this environment variable to 'xterm-color' instead, a lot of programs will -use colors. You can do this by - - TERM=xterm-color; export TERM - -in Bourne-derived shells, and - - setenv TERM xterm-color - -in csh-derived shells. -% If you do not want to get beeps in X11 (X Windows), you can turn them off with xset b off From owner-svn-src-all@FreeBSD.ORG Sun Feb 7 22:14:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA6E31065670; Sun, 7 Feb 2010 22:14:11 +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 957EC8FC0A; Sun, 7 Feb 2010 22:14:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17MEBGu049721; Sun, 7 Feb 2010 22:14:11 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17MEBGc049675; Sun, 7 Feb 2010 22:14:11 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201002072214.o17MEBGc049675@svn.freebsd.org> From: Doug Barton Date: Sun, 7 Feb 2010 22:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203639 - in vendor/bind9/dist-9.4: . bin/check bin/dig bin/dig/include/dig bin/dnssec bin/named bin/named/include/named bin/named/unix bin/nsupdate bin/rndc bin/rndc/include/rndc doc/a... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 22:14:11 -0000 Author: dougb Date: Sun Feb 7 22:14:10 2010 New Revision: 203639 URL: http://svn.freebsd.org/changeset/base/203639 Log: Vendor import of BIND 9.4-ESV Added: vendor/bind9/dist-9.4/doc/draft/draft-ietf-6man-text-addr-representation-01.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-behave-dns64-01.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-axfr-clarify-12.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dns-tcp-requirements-02.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dnssec-bis-updates-09.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dnssec-gost-05.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-rfc2671bis-edns0-02.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-rfc2672bis-dname-18.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-rfc3597-bis-00.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-tsig-md5-deprecated-03.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-default-local-zones-09.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-name-server-management-reqs-02.txt (contents, props changed) vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-respsize-06.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc1912.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc3755.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc4294.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc4339.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc4471.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc4472.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc4509.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc4635.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc4697.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc4892.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc4955.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc4956.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc5001.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc5011.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc5205.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc5452.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc5507.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc5625.txt (contents, props changed) vendor/bind9/dist-9.4/doc/rfc/rfc5702.txt (contents, props changed) Deleted: vendor/bind9/dist-9.4/doc/draft/draft-baba-dnsext-acl-reqts-01.txt vendor/bind9/dist-9.4/doc/draft/draft-daigle-napstr-04.txt vendor/bind9/dist-9.4/doc/draft/draft-danisch-dns-rr-smtp-03.txt vendor/bind9/dist-9.4/doc/draft/draft-dnsext-opcode-discover-02.txt vendor/bind9/dist-9.4/doc/draft/draft-durand-dnsop-dynreverse-00.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-2929bis-01.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-axfr-clarify-05.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dhcid-rr-12.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dns-name-p-s-00.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dnssec-2535typecode-change-06.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dnssec-bis-updates-01.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dnssec-experiments-01.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dnssec-online-signing-02.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dnssec-opt-in-07.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dnssec-rsasha256-00.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-dnssec-trans-02.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-ds-sha256-05.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-keyrr-key-signing-flag-12.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-mdns-43.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-nsec3-04.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-nsid-01.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-rfc2536bis-dsa-06.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-rfc2538bis-04.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-rfc2539bis-dhk-06.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-signed-nonexistence-requirements-01.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-tkey-renewal-mode-05.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-trustupdate-threshold-00.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-trustupdate-timers-02.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-tsig-sha-06.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsext-wcard-clarify-10.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-dnssec-operational-practices-08.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-ipv6-dns-configuration-06.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-ipv6-dns-issues-11.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-ipv6-transport-guidelines-01.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-key-rollover-requirements-02.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-respsize-02.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-dnsop-serverid-06.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-enum-e164-gstn-np-05.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-ipv6-node-requirements-08.txt vendor/bind9/dist-9.4/doc/draft/draft-ietf-secsh-dns-05.txt vendor/bind9/dist-9.4/doc/draft/draft-ihren-dnsext-threshold-validation-00.txt vendor/bind9/dist-9.4/doc/draft/draft-park-ipv6-extensions-dns-pnp-00.txt Modified: vendor/bind9/dist-9.4/CHANGES vendor/bind9/dist-9.4/COPYRIGHT vendor/bind9/dist-9.4/FAQ vendor/bind9/dist-9.4/FAQ.xml vendor/bind9/dist-9.4/Makefile.in vendor/bind9/dist-9.4/README vendor/bind9/dist-9.4/README.idnkit vendor/bind9/dist-9.4/acconfig.h vendor/bind9/dist-9.4/bin/check/check-tool.c vendor/bind9/dist-9.4/bin/check/named-checkconf.8 vendor/bind9/dist-9.4/bin/check/named-checkconf.c vendor/bind9/dist-9.4/bin/check/named-checkconf.html vendor/bind9/dist-9.4/bin/check/named-checkzone.8 vendor/bind9/dist-9.4/bin/check/named-checkzone.c vendor/bind9/dist-9.4/bin/check/named-checkzone.docbook vendor/bind9/dist-9.4/bin/check/named-checkzone.html vendor/bind9/dist-9.4/bin/dig/dig.1 vendor/bind9/dist-9.4/bin/dig/dig.c vendor/bind9/dist-9.4/bin/dig/dig.docbook vendor/bind9/dist-9.4/bin/dig/dig.html vendor/bind9/dist-9.4/bin/dig/dighost.c vendor/bind9/dist-9.4/bin/dig/host.1 vendor/bind9/dist-9.4/bin/dig/host.c vendor/bind9/dist-9.4/bin/dig/host.docbook vendor/bind9/dist-9.4/bin/dig/host.html vendor/bind9/dist-9.4/bin/dig/include/dig/dig.h vendor/bind9/dist-9.4/bin/dig/nslookup.1 vendor/bind9/dist-9.4/bin/dig/nslookup.c vendor/bind9/dist-9.4/bin/dig/nslookup.html vendor/bind9/dist-9.4/bin/dnssec/dnssec-keygen.8 vendor/bind9/dist-9.4/bin/dnssec/dnssec-keygen.html vendor/bind9/dist-9.4/bin/dnssec/dnssec-signzone.8 vendor/bind9/dist-9.4/bin/dnssec/dnssec-signzone.c vendor/bind9/dist-9.4/bin/dnssec/dnssec-signzone.html vendor/bind9/dist-9.4/bin/named/client.c vendor/bind9/dist-9.4/bin/named/control.c vendor/bind9/dist-9.4/bin/named/include/named/client.h vendor/bind9/dist-9.4/bin/named/include/named/log.h vendor/bind9/dist-9.4/bin/named/include/named/lwdclient.h vendor/bind9/dist-9.4/bin/named/include/named/notify.h vendor/bind9/dist-9.4/bin/named/include/named/server.h vendor/bind9/dist-9.4/bin/named/interfacemgr.c vendor/bind9/dist-9.4/bin/named/log.c vendor/bind9/dist-9.4/bin/named/lwresd.8 vendor/bind9/dist-9.4/bin/named/lwresd.docbook vendor/bind9/dist-9.4/bin/named/lwresd.html vendor/bind9/dist-9.4/bin/named/main.c vendor/bind9/dist-9.4/bin/named/named.8 vendor/bind9/dist-9.4/bin/named/named.conf.5 vendor/bind9/dist-9.4/bin/named/named.conf.html vendor/bind9/dist-9.4/bin/named/named.html vendor/bind9/dist-9.4/bin/named/query.c vendor/bind9/dist-9.4/bin/named/server.c vendor/bind9/dist-9.4/bin/named/unix/os.c vendor/bind9/dist-9.4/bin/named/update.c vendor/bind9/dist-9.4/bin/named/xfrout.c vendor/bind9/dist-9.4/bin/nsupdate/nsupdate.1 vendor/bind9/dist-9.4/bin/nsupdate/nsupdate.c vendor/bind9/dist-9.4/bin/nsupdate/nsupdate.docbook vendor/bind9/dist-9.4/bin/nsupdate/nsupdate.html vendor/bind9/dist-9.4/bin/rndc/include/rndc/os.h vendor/bind9/dist-9.4/bin/rndc/rndc-confgen.8 vendor/bind9/dist-9.4/bin/rndc/rndc-confgen.html vendor/bind9/dist-9.4/bin/rndc/rndc.8 vendor/bind9/dist-9.4/bin/rndc/rndc.c vendor/bind9/dist-9.4/bin/rndc/rndc.conf.5 vendor/bind9/dist-9.4/bin/rndc/rndc.conf.html vendor/bind9/dist-9.4/bin/rndc/rndc.html vendor/bind9/dist-9.4/config.guess vendor/bind9/dist-9.4/config.h.in vendor/bind9/dist-9.4/configure.in vendor/bind9/dist-9.4/doc/arm/Bv9ARM-book.xml vendor/bind9/dist-9.4/doc/arm/Bv9ARM.ch01.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.ch02.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.ch03.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.ch04.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.ch05.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.ch06.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.ch07.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.ch08.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.ch09.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.ch10.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.html vendor/bind9/dist-9.4/doc/arm/Bv9ARM.pdf vendor/bind9/dist-9.4/doc/arm/Makefile.in vendor/bind9/dist-9.4/doc/arm/man.dig.html vendor/bind9/dist-9.4/doc/arm/man.dnssec-keygen.html vendor/bind9/dist-9.4/doc/arm/man.dnssec-signzone.html vendor/bind9/dist-9.4/doc/arm/man.host.html vendor/bind9/dist-9.4/doc/arm/man.named-checkconf.html vendor/bind9/dist-9.4/doc/arm/man.named-checkzone.html vendor/bind9/dist-9.4/doc/arm/man.named.html vendor/bind9/dist-9.4/doc/arm/man.rndc-confgen.html vendor/bind9/dist-9.4/doc/arm/man.rndc.conf.html vendor/bind9/dist-9.4/doc/arm/man.rndc.html vendor/bind9/dist-9.4/doc/misc/Makefile.in vendor/bind9/dist-9.4/doc/rfc/index vendor/bind9/dist-9.4/lib/bind/configure.in vendor/bind9/dist-9.4/lib/bind9/api vendor/bind9/dist-9.4/lib/bind9/check.c vendor/bind9/dist-9.4/lib/bind9/include/bind9/getaddresses.h vendor/bind9/dist-9.4/lib/dns/adb.c vendor/bind9/dist-9.4/lib/dns/cache.c vendor/bind9/dist-9.4/lib/dns/db.c vendor/bind9/dist-9.4/lib/dns/diff.c vendor/bind9/dist-9.4/lib/dns/dispatch.c vendor/bind9/dist-9.4/lib/dns/dlz.c vendor/bind9/dist-9.4/lib/dns/dnssec.c vendor/bind9/dist-9.4/lib/dns/dst_api.c vendor/bind9/dist-9.4/lib/dns/dst_parse.c vendor/bind9/dist-9.4/lib/dns/gen-unix.h vendor/bind9/dist-9.4/lib/dns/include/dns/Makefile.in vendor/bind9/dist-9.4/lib/dns/include/dns/acl.h vendor/bind9/dist-9.4/lib/dns/include/dns/compress.h vendor/bind9/dist-9.4/lib/dns/include/dns/db.h vendor/bind9/dist-9.4/lib/dns/include/dns/diff.h vendor/bind9/dist-9.4/lib/dns/include/dns/dlz.h vendor/bind9/dist-9.4/lib/dns/include/dns/journal.h vendor/bind9/dist-9.4/lib/dns/include/dns/log.h vendor/bind9/dist-9.4/lib/dns/include/dns/lookup.h vendor/bind9/dist-9.4/lib/dns/include/dns/message.h vendor/bind9/dist-9.4/lib/dns/include/dns/name.h vendor/bind9/dist-9.4/lib/dns/include/dns/peer.h vendor/bind9/dist-9.4/lib/dns/include/dns/rbt.h vendor/bind9/dist-9.4/lib/dns/include/dns/rdata.h vendor/bind9/dist-9.4/lib/dns/include/dns/rdataset.h vendor/bind9/dist-9.4/lib/dns/include/dns/request.h vendor/bind9/dist-9.4/lib/dns/include/dns/resolver.h vendor/bind9/dist-9.4/lib/dns/include/dns/sdb.h vendor/bind9/dist-9.4/lib/dns/include/dns/sdlz.h vendor/bind9/dist-9.4/lib/dns/include/dns/tkey.h vendor/bind9/dist-9.4/lib/dns/include/dns/types.h vendor/bind9/dist-9.4/lib/dns/include/dns/validator.h vendor/bind9/dist-9.4/lib/dns/include/dns/view.h vendor/bind9/dist-9.4/lib/dns/include/dns/xfrin.h vendor/bind9/dist-9.4/lib/dns/include/dns/zone.h vendor/bind9/dist-9.4/lib/dns/journal.c vendor/bind9/dist-9.4/lib/dns/master.c vendor/bind9/dist-9.4/lib/dns/masterdump.c vendor/bind9/dist-9.4/lib/dns/message.c vendor/bind9/dist-9.4/lib/dns/nsec.c vendor/bind9/dist-9.4/lib/dns/openssl_link.c vendor/bind9/dist-9.4/lib/dns/openssldsa_link.c vendor/bind9/dist-9.4/lib/dns/opensslrsa_link.c vendor/bind9/dist-9.4/lib/dns/rbt.c vendor/bind9/dist-9.4/lib/dns/rbtdb.c vendor/bind9/dist-9.4/lib/dns/rdata.c vendor/bind9/dist-9.4/lib/dns/rdata/generic/ipseckey_45.c vendor/bind9/dist-9.4/lib/dns/rdata/generic/loc_29.c vendor/bind9/dist-9.4/lib/dns/rdata/generic/soa_6.c vendor/bind9/dist-9.4/lib/dns/rdata/in_1/wks_11.c vendor/bind9/dist-9.4/lib/dns/rdataset.c vendor/bind9/dist-9.4/lib/dns/rdataslab.c vendor/bind9/dist-9.4/lib/dns/request.c vendor/bind9/dist-9.4/lib/dns/resolver.c vendor/bind9/dist-9.4/lib/dns/sdb.c vendor/bind9/dist-9.4/lib/dns/sdlz.c vendor/bind9/dist-9.4/lib/dns/time.c vendor/bind9/dist-9.4/lib/dns/validator.c vendor/bind9/dist-9.4/lib/dns/zone.c vendor/bind9/dist-9.4/lib/isc/Makefile.in vendor/bind9/dist-9.4/lib/isc/alpha/include/isc/atomic.h vendor/bind9/dist-9.4/lib/isc/api vendor/bind9/dist-9.4/lib/isc/entropy.c vendor/bind9/dist-9.4/lib/isc/ia64/include/isc/atomic.h vendor/bind9/dist-9.4/lib/isc/include/isc/entropy.h vendor/bind9/dist-9.4/lib/isc/include/isc/file.h vendor/bind9/dist-9.4/lib/isc/include/isc/fsaccess.h vendor/bind9/dist-9.4/lib/isc/include/isc/hash.h vendor/bind9/dist-9.4/lib/isc/include/isc/heap.h vendor/bind9/dist-9.4/lib/isc/include/isc/log.h vendor/bind9/dist-9.4/lib/isc/include/isc/mem.h vendor/bind9/dist-9.4/lib/isc/include/isc/netaddr.h vendor/bind9/dist-9.4/lib/isc/include/isc/netscope.h vendor/bind9/dist-9.4/lib/isc/include/isc/platform.h.in vendor/bind9/dist-9.4/lib/isc/include/isc/portset.h vendor/bind9/dist-9.4/lib/isc/include/isc/random.h vendor/bind9/dist-9.4/lib/isc/include/isc/ratelimiter.h vendor/bind9/dist-9.4/lib/isc/include/isc/serial.h vendor/bind9/dist-9.4/lib/isc/include/isc/sockaddr.h vendor/bind9/dist-9.4/lib/isc/include/isc/socket.h vendor/bind9/dist-9.4/lib/isc/include/isc/symtab.h vendor/bind9/dist-9.4/lib/isc/include/isc/task.h vendor/bind9/dist-9.4/lib/isc/inet_aton.c vendor/bind9/dist-9.4/lib/isc/inet_ntop.c vendor/bind9/dist-9.4/lib/isc/log.c vendor/bind9/dist-9.4/lib/isc/mem.c vendor/bind9/dist-9.4/lib/isc/random.c vendor/bind9/dist-9.4/lib/isc/rwlock.c vendor/bind9/dist-9.4/lib/isc/sha2.c vendor/bind9/dist-9.4/lib/isc/timer.c vendor/bind9/dist-9.4/lib/isc/unix/dir.c vendor/bind9/dist-9.4/lib/isc/unix/entropy.c vendor/bind9/dist-9.4/lib/isc/unix/file.c vendor/bind9/dist-9.4/lib/isc/unix/ifiter_getifaddrs.c vendor/bind9/dist-9.4/lib/isc/unix/ifiter_ioctl.c vendor/bind9/dist-9.4/lib/isc/unix/include/isc/net.h vendor/bind9/dist-9.4/lib/isc/unix/include/isc/offset.h vendor/bind9/dist-9.4/lib/isc/unix/include/isc/strerror.h vendor/bind9/dist-9.4/lib/isc/unix/include/isc/time.h vendor/bind9/dist-9.4/lib/isc/unix/resource.c vendor/bind9/dist-9.4/lib/isc/unix/socket.c vendor/bind9/dist-9.4/lib/isc/unix/strerror.c vendor/bind9/dist-9.4/lib/isc/x86_32/include/isc/atomic.h vendor/bind9/dist-9.4/lib/isccfg/include/isccfg/log.h vendor/bind9/dist-9.4/lib/isccfg/include/isccfg/namedconf.h vendor/bind9/dist-9.4/lib/lwres/api vendor/bind9/dist-9.4/lib/lwres/context.c vendor/bind9/dist-9.4/lib/lwres/context_p.h vendor/bind9/dist-9.4/lib/lwres/getaddrinfo.c vendor/bind9/dist-9.4/lib/lwres/getipnode.c vendor/bind9/dist-9.4/lib/lwres/include/lwres/context.h vendor/bind9/dist-9.4/lib/lwres/include/lwres/netdb.h.in vendor/bind9/dist-9.4/lib/lwres/lwconfig.c vendor/bind9/dist-9.4/lib/lwres/man/lwres.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_buffer.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_buffer.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_config.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_config.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_context.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_context.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_gabn.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_gabn.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_gai_strerror.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_gai_strerror.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_getaddrinfo.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_getaddrinfo.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_gethostent.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_gethostent.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_getipnode.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_getipnode.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_getnameinfo.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_getnameinfo.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_getrrsetbyname.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_getrrsetbyname.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_gnba.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_gnba.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_hstrerror.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_hstrerror.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_inetntop.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_inetntop.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_noop.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_noop.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_packet.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_packet.html vendor/bind9/dist-9.4/lib/lwres/man/lwres_resutil.3 vendor/bind9/dist-9.4/lib/lwres/man/lwres_resutil.html vendor/bind9/dist-9.4/libtool.m4 vendor/bind9/dist-9.4/ltmain.sh vendor/bind9/dist-9.4/make/rules.in vendor/bind9/dist-9.4/version Modified: vendor/bind9/dist-9.4/CHANGES ============================================================================== --- vendor/bind9/dist-9.4/CHANGES Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/CHANGES Sun Feb 7 22:14:10 2010 (r203639) @@ -1,28 +1,295 @@ - --- 9.4.3-P4 released --- + --- 9.4-ESV released --- + +2831. [security] Do not attempt to validate or cache + out-of-bailiwick data returned with a secure + answer; it must be re-fetched from its original + source and validated in that context. [RT #20819] + +2828. [security] Cached CNAME or DNAME RR could be returned to clients + without DNSSEC validation. [RT #20737] + +2827. [security] Bogus NXDOMAIN could be cached as if valid. [RT #20712] + +2797. [bug] Don't decrement the dispatch manager's maxbuffers. + [RT #20613] + +2790. [bug] Handle DS queries to stub zones. [RT #20440] 2772. [security] When validating, track whether pending data was from the additional section or not and only return it if validates as secure. [RT #20438] - --- 9.4.3-P3 released --- + --- 9.4-ESVb1 released --- + +2698. [cleanup] configure --enable-libbind is deprecated. [RT #20090] + +2697. [port] win32: ensure that S_IFMT, S_IFDIR, S_IFCHR and + S_IFREG are defined after including . + [RT #20309] + +2690. [bug] win32: fix isc_thread_key_getspecific() prototype. + [RT #20315] + +2689. [bug] Correctly handle snprintf result. [RT #20306] + +2688. [bug] Use INTERFACE_F_POINTTOPOINT, not IFF_POINTOPOINT, + to decide to fetch the destination address. [RT #20305] + +2681. [bug] IPSECKEY RR of gateway type 3 was not correctly + decoded. [RT #20269] + +2672. [bug] Don't enable searching in 'host' when doing reverse + lookups. [RT #20218] + +2525. [experimental] New logging category "query-errors" to provide detailed + internal information about query failures, especially + about server failures. (backported as a special + exception to the general policy) [RT #19027] + +2670. [bug] Unexpected connect failures failed to log enough + information to be useful. [RT #20205] + +2649. [bug] Set the domain for forward only zones. [RT #19944] + +2648. [port] win32: isc_time_seconds() was broken. [RT #19900] + +2646. [bug] Incorrect cleanup on error in socket.c. [RT #19987] + +2642. [bug] nsupdate could dump core on solaris when reading + improperly formatted key files. [RT #20015] 2640. [security] A specially crafted update packet will cause named to exit. [RT #20000] - --- 9.4.3-P2 released --- +2637. [func] Rationalize dnssec-signzone's signwithkey() calling. + [RT #19959] + +2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses. + [RT #19716] + +2633. [bug] Handle 15 bit rand() functions. [RT #19783] + +2632. [func] util/kit.sh: warn if documentation appears to be out of + date. [RT #19922] + +2623. [bug] Named started seaches for DS non-optimally. [RT #19915] + +2621. [doc] Made copyright boilterplate consistent. [RT #19833] + +2920. [bug] Delay thawing the zone until the reload of it has + completed successfully. [RT #19750] + +2618. [bug] The sdb and sdlz db_interator_seek() methods could + loop infinitely. [RT #19847] + +2617. [bug] ifconfig.sh failed to emit an error message when + run from the wrong location. [RT #19375] + +2616. [bug] 'host' used the nameservers from resolv.conf even + when a explicit nameserver was specified. [RT #19852] + +2615. [bug] "__attribute__((unused))" was in the wrong place + for ia64 gcc builds. [RT #19854] + +2614. [port] win32: 'named -v' should automatically be executed + in the foreground. [RT #19844] + +2610. [port] sunos: Change #2363 was not complete. [RT #19796] + +2606. [bug] "delegation-only" was not being accepted in + delegation-only type zones. [RT #19717] + +2605. [bug] Accept DS responses from delegation only zones. + [RT # 19296] + +2603. [port] win32: handle .exe extension of named-checkzone and + named-comilezone argv[0] names under windows. + [RT #19767] + +2602. [port] win32: fix debugging command line build of libisccfg. + [RT #19767] + +2599. [bug] Address rapid memory growth when validation fails. + [RT #19654] + +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] + +2589. [bug] dns_db_unregister() failed to clear '*dbimp'. + [RT #19626] + +2586. [bug] Missing cleanup of SIG rdataset in searching a DLZ DB + or SDB. [RT #19577] + +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] + +2581. [contrib] dlz/mysql set MYSQL_OPT_RECONNECT option on connection. + Requires MySQL 5.0.19 or later. [RT #19084] 2579. [bug] DNSSEC lookaside validation failed to handle unknown algorithms. [RT #19479] - --- 9.4.3-P1 released --- +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. + [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] + +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. + +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] + +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] + +2542. [doc] Update the description of dig +adflag. [RT #19290] + +2539. [security] Update the interaction between recursion, allow-query, + allow-query-cache and allow-recursion. [RT #19198] + +2536. [cleanup] Silence some warnings when -Werror=format-security is + specified. [RT #19083] + +2535. [bug] dig +showsearch 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] + +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] + +2523. [bug] Random type rdata freed by dns_nsec_typepresent(). + [RT #19112] 2522. [security] Handle -1 from DSA_do_verify(). +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 type. + [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] + +2510. [bug] "dig +sigchase" could trigger REQUIRE failures. + [RT #19033] + +2509. [bug] Specifying a fixed query source port was broken. + [RT #19051] + +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] + +2504. [bug] Address race condition in the socket code. [RT #18899] + +2503. [port] linux: improve compatibility with Linux Standard + Base. [RT #18793] + +2500. [contrib] contrib/sdb/pgsql/zonetodb.c called non-existent + function. [RT #18582] + +2499. [port] solaris: lib/lwres/getaddrinfo.c namespace clash. + [RT #18837] + 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] +2495. [bug] Tighten RRSIG checks. [RT #18795] + +2494. [bug] dns/sdlz.h and dns/dlz.h were not being installed. + [RT #18826] + +2487. [bug] Give TCP connections longer to complete. [RT #18675] + +2485. [bug] Change update's the handling of obscured RRSIG + records. Not all orphand DS records were being + removed. [RT #18828] + +2479. [bug] xfrout:covers was not properly initalized. [RT #18801] + +2478. [bug] 'addresses' could be used uninitalized in + configure_forward(). [RT #18800] + +2476. [doc] ARM: improve documentation for max-journal-size and + ixfr-from-differences. [RT #15909] [RT #18541] + +2400. [bug] Log if kqueue()/epoll_create()/open(/dev/poll) fails. + [RT #18297] + --- 9.4.3 released --- 2490. [port] aix: work around a kernel bug where IPV6_RECVPKTINFO @@ -38,7 +305,7 @@ 2473. [port] linux: raise the limit on open files to the possible maximum value before spawning threads; 'files' - specified in named.conf doesn't seem to work with + specified in named.conf doesn't seem to work with threads as expected. [RT #18784] 2472. [port] linux: check the number of available cpu's before @@ -61,10 +328,11 @@ 2465. [bug] Adb's handling of lame addresses was different for IPv4 and IPv6. [RT #18738] -2463. [port] linux: POSIX doesn't include the IPv6 Advanced Socket +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] @@ -170,6 +438,10 @@ 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] 2408. [bug] A duplicate TCP dispatch event could be sent, which @@ -241,7 +513,7 @@ 2380. [bug] dns_view_find() was not returning NXDOMAIN/NXRRSET proofs which, in turn, caused validation failures for insecure zones immediately below a secure zone - the server was authoritative for. [RT #18112] + the server was authoritative for. [RT #18112] 2379. [contrib] queryperf/gen-data-queryperf.py: removed redundant TLDs and supported RRs with TTLs [RT #17972] Modified: vendor/bind9/dist-9.4/COPYRIGHT ============================================================================== --- vendor/bind9/dist-9.4/COPYRIGHT Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/COPYRIGHT Sun Feb 7 22:14:10 2010 (r203639) @@ -1,4 +1,4 @@ -Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") +Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") Copyright (C) 1996-2003 Internet Software Consortium. Permission to use, copy, modify, and/or distribute this software for any @@ -13,7 +13,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -$Id: COPYRIGHT,v 1.9.18.5 2008/01/02 23:46:02 tbox Exp $ +$Id: COPYRIGHT,v 1.9.18.7 2010/01/07 23:46:07 tbox Exp $ Portions Copyright (C) 1996-2001 Nominum, Inc. Modified: vendor/bind9/dist-9.4/FAQ ============================================================================== --- vendor/bind9/dist-9.4/FAQ Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/FAQ Sun Feb 7 22:14:10 2010 (r203639) @@ -1,6 +1,6 @@ Frequently Asked Questions about BIND 9 -Copyright © 2004-2008 Internet Systems Consortium, Inc. ("ISC") +Copyright © 2004-2009 Internet Systems Consortium, Inc. ("ISC") Copyright © 2000-2003 Internet Software Consortium. @@ -153,24 +153,29 @@ A: BIND 9.3 and later: Use TSIG to selec Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { - match-clients { !key external; 10.0.1/24; }; + match-clients { !key external; // reject message ment for the + // external view. + 10.0.1/24; }; // accept from these addresses. ... }; view "external" { match-clients { key external; any; }; - server 10.0.1.2 { keys external; }; + server 10.0.1.2 { keys external; }; // tag messages from the + // external view to the + // other servers for the + // view. recursion no; ... }; Slave 10.0.1.2: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { match-clients { !key external; 10.0.1/24; }; @@ -220,13 +225,13 @@ A: You choose one view to be master and Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; key "mykey" { - algorithm hmac-md5; - secret "yyyyyyyy"; + algorithm hmac-sha256; + secret "yyyyyyyyyyyyyyyyyyyyyyyy"; }; view "internal" { @@ -600,7 +605,7 @@ Q: Why do queries for NSEC3 records fail A: NSEC3 records are strictly meta data and can only be returned in the authority section. This is done so that signing the zone using NSEC3 - records does not bring names into existance that do not exist in the + records does not bring names into existence that do not exist in the unsigned version of the zone. 5. Operating-System Specific Questions @@ -825,7 +830,6 @@ A: /dev/random is not configured. Use rn use certain interrupts as a source of random events. You can make this permanent by setting rand_irqs in /etc/rc.conf. - /etc/rc.conf rand_irqs="3 14 15" See also . Modified: vendor/bind9/dist-9.4/FAQ.xml ============================================================================== --- vendor/bind9/dist-9.4/FAQ.xml Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/FAQ.xml Sun Feb 7 22:14:10 2010 (r203639) @@ -1,7 +1,7 @@ - +
Frequently Asked Questions about BIND 9 @@ -28,6 +28,7 @@ 2006 2007 2008 + 2009 Internet Systems Consortium, Inc. ("ISC") @@ -318,24 +319,29 @@ Slave: 10.0.1.3 (internal), 10.0.1.4 (ex Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { - match-clients { !key external; 10.0.1/24; }; + match-clients { !key external; // reject message ment for the + // external view. + 10.0.1/24; }; // accept from these addresses. ... }; view "external" { match-clients { key external; any; }; - server 10.0.1.2 { keys external; }; + server 10.0.1.2 { keys external; }; // tag messages from the + // external view to the + // other servers for the + // view. recursion no; ... }; Slave 10.0.1.2: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { match-clients { !key external; 10.0.1/24; }; @@ -423,13 +429,13 @@ named-checkzone example.com tmp Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; key "mykey" { - algorithm hmac-md5; - secret "yyyyyyyy"; + algorithm hmac-sha256; + secret "yyyyyyyyyyyyyyyyyyyyyyyy"; }; view "internal" { @@ -1067,7 +1073,7 @@ empty: NSEC3 records are strictly meta data and can only be returned in the authority section. This is done so that signing the zone using NSEC3 records does not bring names - into existance that do not exist in the unsigned version + into existence that do not exist in the unsigned version of the zone. @@ -1470,7 +1476,6 @@ options { -/etc/rc.conf rand_irqs="3 14 15" Modified: vendor/bind9/dist-9.4/Makefile.in ============================================================================== --- vendor/bind9/dist-9.4/Makefile.in Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/Makefile.in Sun Feb 7 22:14:10 2010 (r203639) @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 1998-2002 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.43.18.6 2007/09/03 23:46:21 tbox Exp $ +# $Id: Makefile.in,v 1.43.18.8 2009/02/20 23:46:01 tbox Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -24,6 +24,12 @@ top_srcdir = @top_srcdir@ SUBDIRS = make lib bin doc @LIBBIND@ TARGETS = +MANPAGES = isc-config.sh.1 + +HTMLPAGES = isc-config.sh.html + +MANOBJS = ${MANPAGES} ${HTMLPAGES} + @BIND9_MAKE_RULES@ distclean:: @@ -43,12 +49,19 @@ distclean:: maintainer-clean:: rm -f configure +docclean manclean maintainer-clean:: + rm -f ${MANOBJS} + +doc man:: ${MANOBJS} + installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir} \ ${DESTDIR}${localstatedir}/run ${DESTDIR}${sysconfdir} + $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1 install:: isc-config.sh installdirs ${INSTALL_SCRIPT} isc-config.sh ${DESTDIR}${bindir} + ${INSTALL_DATA} ${srcdir}/isc-config.sh.1 ${DESTDIR}${mandir}/man1 tags: rm -f TAGS Modified: vendor/bind9/dist-9.4/README ============================================================================== --- vendor/bind9/dist-9.4/README Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/README Sun Feb 7 22:14:10 2010 (r203639) @@ -27,8 +27,8 @@ BIND 9 - Improved Portability Architecture - BIND version 9 development has been underwritten by the following - organizations: + BIND version 9 development has been under written by the following + organisations: Sun Microsystems, Inc. Hewlett Packard @@ -42,6 +42,16 @@ BIND 9 Stichting NLnet - NLnet Foundation Nominum, Inc. +BIND 9.4-ESV (Extended Support Version) + + BIND 9.4-ESV is the Extended Support Version of BIND 9.4 + and incorporates the final maintenance release fixing bugs + in BIND 9.4.3. + + BIND 9.4-ESV will be supported until December 31, 2010, at + which time you will need to upgrade to the current release + of BIND. + BIND 9.4.3 BIND 9.4.3 is a maintenance release, fixing bugs in 9.4.2. @@ -67,7 +77,7 @@ BIND 9.4.0 Implemented "additional section caching" (or "acache"), an internal cache framework for additional section content to improve response performance. Several configuration options - were provided to control the behavior. + were provided to control the behaviour. New notify type 'master-only'. Enable notify for master zones only. @@ -76,13 +86,14 @@ BIND 9.4.0 rndc now allows addresses to be set in the server clauses. - New option "allow-query-cache". This lets allow-query be - used to specify the default zone access level rather than - having to have every zone override the global value. - allow-query-cache can be set at both the options and view - levels. If allow-query-cache is not set then allow-recursion - is used if set, otherwise allow-query is used if set, otherwise - the default (localhost; localnets;) is used. + New option "allow-query-cache". This lets "allow-query" + be used to specify the default zone access level rather + than having to have every zone override the global value. + "allow-query-cache" can be set at both the options and view + levels. If "allow-query-cache" is not set then "allow-recursion" + is used if set, otherwise "allow-query" is used if set + unless "recursion no;" is set in which case "none;" is used, + otherwise the default (localhost; localnets;) is used. rndc: the source address can now be specified. @@ -150,12 +161,12 @@ BIND 9.4.0 options for dnssec-signzone specify the input and output formats. - dnssec-signzone can now randomize signature end times + dnssec-signzone can now randomise signature end times (dnssec-signzone -j jitter). Add support for CH A record. - Add additional zone data consistancy checks. named-checkzone + Add additional zone data consistency checks. named-checkzone has extended checking of NS, MX and SRV record and the hosts they reference. named has extended post zone load checks. New zone options: check-mx and integrity-check. Modified: vendor/bind9/dist-9.4/README.idnkit ============================================================================== --- vendor/bind9/dist-9.4/README.idnkit Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/README.idnkit Sun Feb 7 22:14:10 2010 (r203639) @@ -55,7 +55,7 @@ at least specify `--with-idn' option to `--with-libiconv' assumes that your C compiler has `-R' option, and that the option adds the specified run-time path - to an exacutable binary. If `-R' option of your compiler has + to an executable binary. If `-R' option of your compiler has different meaning, or your compiler lacks the option, you should use `--with-iconv' option instead. Binary command without run-time path information might be unexecutable. @@ -68,7 +68,7 @@ at least specify `--with-idn' option to specified, `--with-iconv' is prior to `--with-libiconv'. --with-iconv=ICONV_LIBSPEC - If your libc doens't provide iconv(), you need to specify the + If your libc doesn't provide iconv(), you need to specify the library containing iconv() with this option. `ICONV_LIBSPEC' is the argument(s) to `cc' or `ld' to link the library, for example, `--with-iconv="-L/usr/local/lib -liconv"'. @@ -82,7 +82,7 @@ at least specify `--with-idn' option to this option is not specified, `-L${PREFIX}/lib -lidnkit' is assumed, where ${PREFIX} is the installation prefix specified with `--with-idn' option above. You may need to use this - option to specify extra argments, for example, + option to specify extra arguments, for example, `--with-idnlib="-L/usr/local/lib -R/usr/local/lib -lidnkit"'. Please consult `README' for other configuration options. @@ -109,4 +109,4 @@ about idnkit and this patch. Bug reports and comments on this kit should be sent to mdnkit-bugs@nic.ad.jp and idn-cmt@nic.ad.jp, respectively. -; $Id: README.idnkit,v 1.2.2.2 2005/09/12 02:12:08 marka Exp $ +; $Id: README.idnkit,v 1.2.2.3 2009/01/19 00:36:25 marka Exp $ Modified: vendor/bind9/dist-9.4/acconfig.h ============================================================================== --- vendor/bind9/dist-9.4/acconfig.h Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/acconfig.h Sun Feb 7 22:14:10 2010 (r203639) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: acconfig.h,v 1.44.18.5 2005/04/29 00:15:20 marka Exp $ */ +/* $Id: acconfig.h,v 1.44.18.7 2008/12/01 23:45:56 tbox Exp $ */ /*! \file */ @@ -25,9 +25,6 @@ ***/ @TOP@ -/** define to `int' if doesn't define. */ -#undef ssize_t - /** define on DEC OSF to enable 4.4BSD style sa_len support */ #undef _SOCKADDR_LEN @@ -61,9 +58,6 @@ /** define if you have the NET_RT_IFLIST sysctl variable and sys/sysctl.h */ #undef HAVE_IFLIST_SYSCTL -/** define if chroot() is available */ -#undef HAVE_CHROOT - /** define if tzset() is available */ #undef HAVE_TZSET @@ -115,7 +109,7 @@ int sigwait(const unsigned int *set, int * The silly continuation line is to keep configure from * commenting out the #undef. */ - + #undef \ va_start #define va_start(ap, last) \ Modified: vendor/bind9/dist-9.4/bin/check/check-tool.c ============================================================================== --- vendor/bind9/dist-9.4/bin/check/check-tool.c Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/bin/check/check-tool.c Sun Feb 7 22:14:10 2010 (r203639) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: check-tool.c,v 1.10.18.20 2008/10/24 01:43:17 tbox Exp $ */ +/* $Id: check-tool.c,v 1.10.18.23 2009/09/24 21:38:50 jinmei Exp $ */ /*! \file */ @@ -105,6 +105,7 @@ static isc_logcategory_t categories[] = { "queries", 0 }, { "unmatched", 0 }, { "update-security", 0 }, + { "query-errors", 0 }, { NULL, 0 } }; @@ -156,7 +157,7 @@ checkns(dns_zone_t *zone, dns_name_t *na cur->ai_next != NULL) cur = cur->ai_next; if (cur != NULL && cur->ai_canonname != NULL && - strcasecmp(ai->ai_canonname, namebuf) != 0) { + strcasecmp(cur->ai_canonname, namebuf) != 0) { dns_zone_log(zone, ISC_LOG_ERROR, "%s/NS '%s' (out of zone) " "is a CNAME (illegal)", Modified: vendor/bind9/dist-9.4/bin/check/named-checkconf.8 ============================================================================== --- vendor/bind9/dist-9.4/bin/check/named-checkconf.8 Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/bin/check/named-checkconf.8 Sun Feb 7 22:14:10 2010 (r203639) @@ -1,7 +1,7 @@ .\" Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") .\" Copyright (C) 2000-2002 Internet Software Consortium. .\" -.\" Permission to use, copy, modify, and distribute this software for any +.\" 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. .\" @@ -13,7 +13,7 @@ .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" -.\" $Id: named-checkconf.8,v 1.16.18.13 2007/06/20 02:26:58 marka Exp $ +.\" $Id: named-checkconf.8,v 1.16.18.14 2009/07/11 01:31:43 tbox Exp $ .\" .hy 0 .ad l Modified: vendor/bind9/dist-9.4/bin/check/named-checkconf.c ============================================================================== --- vendor/bind9/dist-9.4/bin/check/named-checkconf.c Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/bin/check/named-checkconf.c Sun Feb 7 22:14:10 2010 (r203639) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named-checkconf.c,v 1.28.18.16 2007/11/26 23:46:18 tbox Exp $ */ +/* $Id: named-checkconf.c,v 1.28.18.18 2009/02/16 23:46:03 tbox Exp $ */ /*! \file */ @@ -59,9 +59,9 @@ isc_log_t *logc = NULL; /*% usage */ static void usage(void) { - fprintf(stderr, "usage: named-checkconf [-j] [-v] [-z] [-t directory] " + fprintf(stderr, "usage: named-checkconf [-j] [-v] [-z] [-t directory] " "[named.conf]\n"); - exit(1); + exit(1); } /*% directory callback */ @@ -171,9 +171,9 @@ configure_zone(const char *vclass, const zname = cfg_obj_asstring(cfg_tuple_get(zconfig, "name")); classobj = cfg_tuple_get(zconfig, "class"); - if (!cfg_obj_isstring(classobj)) - zclass = vclass; - else + if (!cfg_obj_isstring(classobj)) + zclass = vclass; + else zclass = cfg_obj_asstring(classobj); zoptions = cfg_tuple_get(zconfig, "options"); @@ -192,9 +192,9 @@ configure_zone(const char *vclass, const return (ISC_R_FAILURE); if (strcasecmp(cfg_obj_asstring(typeobj), "master") != 0) return (ISC_R_SUCCESS); - cfg_map_get(zoptions, "database", &dbobj); - if (dbobj != NULL) - return (ISC_R_SUCCESS); + cfg_map_get(zoptions, "database", &dbobj); + if (dbobj != NULL) + return (ISC_R_SUCCESS); cfg_map_get(zoptions, "file", &fileobj); if (fileobj == NULL) return (ISC_R_FAILURE); @@ -285,8 +285,8 @@ configure_zone(const char *vclass, const } else INSIST(0); } else { - zone_options |= DNS_ZONEOPT_CHECKNAMES; - zone_options |= DNS_ZONEOPT_CHECKNAMESFAIL; + zone_options |= DNS_ZONEOPT_CHECKNAMES; + zone_options |= DNS_ZONEOPT_CHECKNAMESFAIL; } masterformat = dns_masterformat_text; @@ -397,7 +397,7 @@ main(int argc, char **argv) { int exit_status = 0; isc_entropy_t *ectx = NULL; isc_boolean_t load_zones = ISC_FALSE; - + while ((c = isc_commandline_parse(argc, argv, "djt:vz")) != EOF) { switch (c) { case 'd': @@ -415,12 +415,6 @@ main(int argc, char **argv) { isc_result_totext(result)); exit(1); } - result = isc_dir_chdir("/"); - if (result != ISC_R_SUCCESS) { - fprintf(stderr, "isc_dir_chdir: %s\n", - isc_result_totext(result)); - exit(1); - } break; case 'v': Modified: vendor/bind9/dist-9.4/bin/check/named-checkconf.html ============================================================================== --- vendor/bind9/dist-9.4/bin/check/named-checkconf.html Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/bin/check/named-checkconf.html Sun Feb 7 22:14:10 2010 (r203639) @@ -2,7 +2,7 @@ - Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - Copyright (C) 2000-2002 Internet Software Consortium. - - - Permission to use, copy, modify, and distribute this software for any + - 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. - @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: vendor/bind9/dist-9.4/bin/check/named-checkzone.8 ============================================================================== --- vendor/bind9/dist-9.4/bin/check/named-checkzone.8 Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/bin/check/named-checkzone.8 Sun Feb 7 22:14:10 2010 (r203639) @@ -1,7 +1,7 @@ -.\" Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") +.\" Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") .\" Copyright (C) 2000-2002 Internet Software Consortium. .\" -.\" Permission to use, copy, modify, and distribute this software for any +.\" 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. .\" @@ -13,7 +13,7 @@ .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" -.\" $Id: named-checkzone.8,v 1.18.18.23 2007/06/20 02:26:58 marka Exp $ +.\" $Id: named-checkzone.8,v 1.18.18.25 2009/07/11 01:31:43 tbox Exp $ .\" .hy 0 .ad l @@ -77,7 +77,7 @@ When loading the zone file read the jour .PP \-c \fIclass\fR .RS 4 -Specify the class of the zone. If not specified "IN" is assumed. +Specify the class of the zone. If not specified, "IN" is assumed. .RE .PP \-i \fImode\fR @@ -263,7 +263,7 @@ BIND 9 Administrator Reference Manual. .PP Internet Systems Consortium .SH "COPYRIGHT" -Copyright \(co 2004\-2007 Internet Systems Consortium, Inc. ("ISC") +Copyright \(co 2004\-2007, 2009 Internet Systems Consortium, Inc. ("ISC") .br Copyright \(co 2000\-2002 Internet Software Consortium. .br Modified: vendor/bind9/dist-9.4/bin/check/named-checkzone.c ============================================================================== --- vendor/bind9/dist-9.4/bin/check/named-checkzone.c Sun Feb 7 21:04:26 2010 (r203638) +++ vendor/bind9/dist-9.4/bin/check/named-checkzone.c Sun Feb 7 22:14:10 2010 (r203639) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named-checkzone.c,v 1.29.18.21 2008/10/24 01:43:17 tbox Exp $ */ +/* $Id: named-checkzone.c,v 1.29.18.24 2009/05/29 02:19:20 marka Exp $ */ /*! \file */ @@ -122,9 +122,13 @@ main(int argc, char **argv) { */ if (strncmp(prog_name, "lt-", 3) == 0) prog_name += 3; - if (strcmp(prog_name, "named-checkzone") == 0) + +#define PROGCMP(X) \ + (strcasecmp(prog_name, X) == 0 || strcasecmp(prog_name, X ".exe") == 0) + + if (PROGCMP("named-checkzone")) progmode = progmode_check; - else if (strcmp(prog_name, "named-compilezone") == 0) + else if (PROGCMP("named-compilezone")) progmode = progmode_compile; else INSIST(0); @@ -265,12 +269,6 @@ main(int argc, char **argv) { isc_result_totext(result)); exit(1); } - result = isc_dir_chdir("/"); - if (result != ISC_R_SUCCESS) { - fprintf(stderr, "isc_dir_chdir: %s\n", - isc_result_totext(result)); - exit(1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 03:11:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D1BD1065679; Mon, 8 Feb 2010 03:11:55 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BAB58FC1B; Mon, 8 Feb 2010 03:11:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o183BtFk015423; Mon, 8 Feb 2010 03:11:55 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o183BtL6015421; Mon, 8 Feb 2010 03:11:55 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201002080311.o183BtL6015421@svn.freebsd.org> From: David Xu Date: Mon, 8 Feb 2010 03:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203645 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 03:11:55 -0000 Author: davidxu Date: Mon Feb 8 03:11:55 2010 New Revision: 203645 URL: http://svn.freebsd.org/changeset/base/203645 Log: MFC r203414: After busied the lock, re-read state word before checking waiters flag, otherwise, the waiters bit may not be set and a wakeup is lost. Modified: stable/8/sys/kern/kern_umtx.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_umtx.c ============================================================================== --- stable/8/sys/kern/kern_umtx.c Mon Feb 8 00:57:57 2010 (r203644) +++ stable/8/sys/kern/kern_umtx.c Mon Feb 8 03:11:55 2010 (r203645) @@ -2463,6 +2463,12 @@ do_rw_rdlock(struct thread *td, struct u umtxq_busy(&uq->uq_key); umtxq_unlock(&uq->uq_key); + /* + * re-read the state, in case it changed between the try-lock above + * and the check below + */ + state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + /* set read contention bit */ while ((state & wrflags) && !(state & URWLOCK_READ_WAITERS)) { oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_READ_WAITERS); @@ -2595,6 +2601,12 @@ do_rw_wrlock(struct thread *td, struct u umtxq_busy(&uq->uq_key); umtxq_unlock(&uq->uq_key); + /* + * re-read the state, in case it changed between the try-lock above + * and the check below + */ + state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + while (((state & URWLOCK_WRITE_OWNER) || URWLOCK_READER_COUNT(state) != 0) && (state & URWLOCK_WRITE_WAITERS) == 0) { oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_WRITE_WAITERS); From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 07:31:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E4A7106566C; Mon, 8 Feb 2010 07:31:06 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0528FC15; Mon, 8 Feb 2010 07:31:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o187V6E8072518; Mon, 8 Feb 2010 07:31:06 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o187V5Pk072517; Mon, 8 Feb 2010 07:31:05 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201002080731.o187V5Pk072517@svn.freebsd.org> From: David Xu Date: Mon, 8 Feb 2010 07: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: r203657 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 07:31:06 -0000 Author: davidxu Date: Mon Feb 8 07:31:05 2010 New Revision: 203657 URL: http://svn.freebsd.org/changeset/base/203657 Log: Set waiters flag before checking semaphore's counter, otherwise we might lose a wakeup. Tested on postgresql database server. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Feb 8 06:28:33 2010 (r203656) +++ head/sys/kern/kern_umtx.c Mon Feb 8 07:31:05 2010 (r203657) @@ -2853,6 +2853,8 @@ do_sem_wait(struct thread *td, struct _u umtxq_insert(uq); umtxq_unlock(&uq->uq_key); + suword32(__DEVOLATILE(uint32_t *, &sem->_has_waiters), 1); + count = fuword32(__DEVOLATILE(uint32_t *, &sem->_count)); if (count != 0) { umtxq_lock(&uq->uq_key); @@ -2863,11 +2865,6 @@ do_sem_wait(struct thread *td, struct _u return (0); } - /* - * set waiters byte and sleep. - */ - suword32(__DEVOLATILE(uint32_t *, &sem->_has_waiters), 1); - umtxq_lock(&uq->uq_key); umtxq_unbusy(&uq->uq_key); umtxq_unlock(&uq->uq_key); From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 09:16:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EAC31065670; Mon, 8 Feb 2010 09:16:59 +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 7FC2B8FC0A; Mon, 8 Feb 2010 09:16:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o189GxdY095941; Mon, 8 Feb 2010 09:16:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o189Gxj7095939; Mon, 8 Feb 2010 09:16:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002080916.o189Gxj7095939@svn.freebsd.org> From: Ed Schouten Date: Mon, 8 Feb 2010 09:16: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: r203659 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 09:16:59 -0000 Author: ed Date: Mon Feb 8 09:16:59 2010 New Revision: 203659 URL: http://svn.freebsd.org/changeset/base/203659 Log: Fall back to ASCII codepoints for box drawing. Even though the default VGA font provides box drawing fonts, there is no guarantee any font will provide these as well (i.e. ISO-8859-*, KOI8-R). Just use ASCII characters for box drawing. PR: kern/141633 Modified: head/sys/teken/teken_scs.h Modified: head/sys/teken/teken_scs.h ============================================================================== --- head/sys/teken/teken_scs.h Mon Feb 8 07:38:25 2010 (r203658) +++ head/sys/teken/teken_scs.h Mon Feb 8 09:16:59 2010 (r203659) @@ -41,12 +41,12 @@ static const uint16_t teken_boxdrawing_u 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7 }; -/* CP437 points for VT100 box drawing. */ +/* ASCII points for VT100 box drawing. */ static const uint8_t teken_boxdrawing_8bit[31] = { - 0x04, 0xb1, 0x48, 0x46, 0x43, 0x4c, 0xf8, 0xf1, - 0x4e, 0x56, 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0xc4, - 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0xb4, 0xc1, 0xc2, - 0xb3, 0xf3, 0xf2, 0xe3, 0xd8, 0x9c, 0xfa, + '?', '?', 'H', 'F', 'C', 'L', '?', '?', + 'N', 'V', '+', '+', '+', '+', '+', '-', + '-', '-', '-', '-', '+', '+', '+', '+', + '|', '?', '?', '?', '?', '?', '?', }; static teken_char_t From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 10:02:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7C60106566B; Mon, 8 Feb 2010 10:02:01 +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 D74AA8FC0A; Mon, 8 Feb 2010 10:02:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18A21fC005995; Mon, 8 Feb 2010 10:02:01 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18A21rE005989; Mon, 8 Feb 2010 10:02:01 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002081002.o18A21rE005989@svn.freebsd.org> From: Ed Schouten Date: Mon, 8 Feb 2010 10:02: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: r203660 - in head/sys: compat/freebsd32 compat/svr4 i386/ibcs2 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 10:02:02 -0000 Author: ed Date: Mon Feb 8 10:02:01 2010 New Revision: 203660 URL: http://svn.freebsd.org/changeset/base/203660 Log: Remove unused LIBCOMPAT keyword from syscalls.master. Modified: head/sys/compat/freebsd32/syscalls.master head/sys/compat/svr4/syscalls.master head/sys/i386/ibcs2/syscalls.master head/sys/kern/makesyscalls.sh head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Feb 8 09:16:59 2010 (r203659) +++ head/sys/compat/freebsd32/syscalls.master Mon Feb 8 10:02:01 2010 (r203660) @@ -13,7 +13,7 @@ ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. ; type one of STD, OBSOL, UNIMPL, COMPAT, COMPAT4, COMPAT6, -; COMPAT7, LIBCOMPAT, NODEF, NOARGS, NOPROTO, NOSTD +; COMPAT7, NODEF, NOARGS, NOPROTO, NOSTD ; The COMPAT* options may be combined with one or more NO* ; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) ; name psuedo-prototype of syscall routine @@ -29,7 +29,6 @@ ; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) ; COMPAT6 included on COMPAT6 #ifdef (FreeBSD 6 compat) ; COMPAT7 included on COMPAT7 #ifdef (FreeBSD 7 compat) -; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically Modified: head/sys/compat/svr4/syscalls.master ============================================================================== --- head/sys/compat/svr4/syscalls.master Mon Feb 8 09:16:59 2010 (r203659) +++ head/sys/compat/svr4/syscalls.master Mon Feb 8 10:02:01 2010 (r203660) @@ -22,7 +22,6 @@ ; types: ; STD always included ; COMPAT included on COMPAT #ifdef -; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only Modified: head/sys/i386/ibcs2/syscalls.master ============================================================================== --- head/sys/i386/ibcs2/syscalls.master Mon Feb 8 09:16:59 2010 (r203659) +++ head/sys/i386/ibcs2/syscalls.master Mon Feb 8 10:02:01 2010 (r203660) @@ -22,7 +22,6 @@ ; types: ; STD always included ; COMPAT included on COMPAT #ifdef -; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Mon Feb 8 09:16:59 2010 (r203659) +++ head/sys/kern/makesyscalls.sh Mon Feb 8 10:02:01 2010 (r203660) @@ -497,23 +497,6 @@ s/\$//g syscall++ next } - type("LIBCOMPAT") { - ncompat++ - parseline() - printf("%s\to%s();\n", rettype, funcname) > syscompatdcl - 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) + 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 - printf("#define\t%s%s\t%d\t/* compatibility; still used by libc */\n", - syscallprefix, funcalias, syscall) > syshdr - printf(" \\\n\t%s.o", funcalias) > sysmk - syscall++ - next - } type("OBSOL") { printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },") > sysent align_sysent_comment(34) Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Feb 8 09:16:59 2010 (r203659) +++ head/sys/kern/syscalls.master Mon Feb 8 10:02:01 2010 (r203660) @@ -12,7 +12,7 @@ ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. ; type one of STD, OBSOL, UNIMPL, COMPAT, COMPAT4, COMPAT6, -; COMPAT7, LIBCOMPAT, NODEF, NOARGS, NOPROTO, NOSTD +; COMPAT7, NODEF, NOARGS, NOPROTO, NOSTD ; The COMPAT* options may be combined with one or more NO* ; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) ; name psuedo-prototype of syscall routine @@ -28,7 +28,6 @@ ; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) ; COMPAT6 included on COMPAT6 #ifdef (FreeBSD 6 compat) ; COMPAT7 included on COMPAT7 #ifdef (FreeBSD 7 compat) -; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 14:08:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A156B106568F; Mon, 8 Feb 2010 14:08:52 +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 907828FC1E; Mon, 8 Feb 2010 14:08:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18E8qJ0064382; Mon, 8 Feb 2010 14:08:52 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18E8qfK064378; Mon, 8 Feb 2010 14:08:52 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002081408.o18E8qfK064378@svn.freebsd.org> From: Attilio Rao Date: Mon, 8 Feb 2010 14:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203662 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 14:08:52 -0000 Author: attilio Date: Mon Feb 8 14:08:52 2010 New Revision: 203662 URL: http://svn.freebsd.org/changeset/base/203662 Log: MC r202889, r202940: - Fix a race in sched_switch() of sched_4bsd. Block the td_lock when acquiring explicitly sched_lock in order to prevent races with other td_lock contenders. - Merge the ULE's internal function thread_block_switch() into the global thread_lock_block() and make the former semantic as the default for thread_lock_block(). - Split out an invariant in order to have better checks. Modified: stable/8/sys/kern/kern_mutex.c stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_mutex.c ============================================================================== --- stable/8/sys/kern/kern_mutex.c Mon Feb 8 14:04:32 2010 (r203661) +++ stable/8/sys/kern/kern_mutex.c Mon Feb 8 14:08:52 2010 (r203662) @@ -616,7 +616,6 @@ thread_lock_block(struct thread *td) { struct mtx *lock; - spinlock_enter(); THREAD_LOCK_ASSERT(td, MA_OWNED); lock = td->td_lock; td->td_lock = &blocked_lock; @@ -631,7 +630,6 @@ thread_lock_unblock(struct thread *td, s mtx_assert(new, MA_OWNED); MPASS(td->td_lock == &blocked_lock); atomic_store_rel_ptr((volatile void *)&td->td_lock, (uintptr_t)new); - spinlock_exit(); } void Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Mon Feb 8 14:04:32 2010 (r203661) +++ stable/8/sys/kern/sched_4bsd.c Mon Feb 8 14:08:52 2010 (r203662) @@ -920,9 +920,11 @@ sched_sleep(struct thread *td, int pri) void sched_switch(struct thread *td, struct thread *newtd, int flags) { + struct mtx *tmtx; struct td_sched *ts; struct proc *p; + tmtx = NULL; ts = td->td_sched; p = td->td_proc; @@ -931,17 +933,20 @@ sched_switch(struct thread *td, struct t /* * Switch to the sched lock to fix things up and pick * a new thread. + * Block the td_lock in order to avoid breaking the critical path. */ if (td->td_lock != &sched_lock) { mtx_lock_spin(&sched_lock); - thread_unlock(td); + tmtx = thread_lock_block(td); } if ((p->p_flag & P_NOLOAD) == 0) sched_load_rem(); - if (newtd) + if (newtd) { + MPASS(newtd->td_lock == &sched_lock); newtd->td_flags |= (td->td_flags & TDF_NEEDRESCHED); + } td->td_lastcpu = td->td_oncpu; td->td_flags &= ~TDF_NEEDRESCHED; @@ -984,8 +989,8 @@ sched_switch(struct thread *td, struct t sched_load_add(); } else { newtd = choosethread(); + MPASS(newtd->td_lock == &sched_lock); } - MPASS(newtd->td_lock == &sched_lock); if (td != newtd) { #ifdef HWPMC_HOOKS @@ -1004,7 +1009,7 @@ sched_switch(struct thread *td, struct t (*dtrace_vtime_switch_func)(newtd); #endif - cpu_switch(td, newtd, td->td_lock); + cpu_switch(td, newtd, tmtx != NULL ? tmtx : td->td_lock); lock_profile_obtain_lock_success(&sched_lock.lock_object, 0, 0, __FILE__, __LINE__); /* Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Mon Feb 8 14:04:32 2010 (r203661) +++ stable/8/sys/kern/sched_ule.c Mon Feb 8 14:08:52 2010 (r203662) @@ -301,7 +301,6 @@ static int sched_pickcpu(struct thread * static void sched_balance(void); static int sched_balance_pair(struct tdq *, struct tdq *); static inline struct tdq *sched_setcpu(struct thread *, int, int); -static inline struct mtx *thread_block_switch(struct thread *); static inline void thread_unblock_switch(struct thread *, struct mtx *); static struct mtx *sched_switch_migrate(struct tdq *, struct thread *, int); static int sysctl_kern_sched_topology_spec(SYSCTL_HANDLER_ARGS); @@ -1106,9 +1105,11 @@ sched_setcpu(struct thread *td, int cpu, * The hard case, migration, we need to block the thread first to * prevent order reversals with other cpus locks. */ + spinlock_enter(); thread_lock_block(td); TDQ_LOCK(tdq); thread_lock_unblock(td, TDQ_LOCKPTR(tdq)); + spinlock_exit(); return (tdq); } @@ -1715,23 +1716,6 @@ sched_unlend_user_prio(struct thread *td } /* - * Block a thread for switching. Similar to thread_block() but does not - * bump the spin count. - */ -static inline struct mtx * -thread_block_switch(struct thread *td) -{ - struct mtx *lock; - - THREAD_LOCK_ASSERT(td, MA_OWNED); - lock = td->td_lock; - td->td_lock = &blocked_lock; - mtx_unlock_spin(lock); - - return (lock); -} - -/* * Handle migration from sched_switch(). This happens only for * cpu binding. */ @@ -1749,7 +1733,7 @@ sched_switch_migrate(struct tdq *tdq, st * not holding either run-queue lock. */ spinlock_enter(); - thread_block_switch(td); /* This releases the lock on tdq. */ + thread_lock_block(td); /* This releases the lock on tdq. */ /* * Acquire both run-queue locks before placing the thread on the new @@ -1769,7 +1753,8 @@ sched_switch_migrate(struct tdq *tdq, st } /* - * Release a thread that was blocked with thread_block_switch(). + * Variadic version of thread_lock_unblock() that does not assume td_lock + * is blocked. */ static inline void thread_unblock_switch(struct thread *td, struct mtx *mtx) @@ -1825,7 +1810,7 @@ sched_switch(struct thread *td, struct t } else { /* This thread must be going to sleep. */ TDQ_LOCK(tdq); - mtx = thread_block_switch(td); + mtx = thread_lock_block(td); tdq_load_rem(tdq, td); } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 15:42:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B7431065672; Mon, 8 Feb 2010 15:42:56 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22A878FC22; Mon, 8 Feb 2010 15:42:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18Fgusq085223; Mon, 8 Feb 2010 15:42:56 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18FguQs085221; Mon, 8 Feb 2010 15:42:56 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002081542.o18FguQs085221@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 8 Feb 2010 15:42: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: r203665 - head/bin/ls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 15:42:56 -0000 Author: jh Date: Mon Feb 8 15:42:55 2010 New Revision: 203665 URL: http://svn.freebsd.org/changeset/base/203665 Log: Make sure that FTS_COMFOLLOW is not set when the -P option is in effect. Otherwise the -i option will show the inode number of the referenced file for symbolic links given on the command line. Similarly, the file color was printed according to the link target in colorized output. PR: bin/102394 Reviewed by: jilles MFC after: 2 weeks Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Mon Feb 8 15:39:48 2010 (r203664) +++ head/bin/ls/ls.c Mon Feb 8 15:42:55 2010 (r203665) @@ -113,6 +113,7 @@ static int f_listdir; /* list actual di static int f_listdot; /* list files beginning with . */ static int f_noautodot; /* do not automatically enable -A for root */ int f_longform; /* long listing format */ +static int f_nofollow; /* don't follow symbolic link arguments */ int f_nonprint; /* show unprintables as ? */ static int f_nosort; /* don't sort output */ int f_notabs; /* don't use tab-separated multi-col output */ @@ -234,6 +235,7 @@ main(int argc, char *argv[]) break; case 'H': fts_options |= FTS_COMFOLLOW; + f_nofollow = 0; break; case 'G': setenv("CLICOLOR", "", 1); @@ -241,11 +243,13 @@ main(int argc, char *argv[]) case 'L': fts_options &= ~FTS_PHYSICAL; fts_options |= FTS_LOGICAL; + f_nofollow = 0; break; case 'P': fts_options &= ~FTS_COMFOLLOW; fts_options &= ~FTS_LOGICAL; fts_options |= FTS_PHYSICAL; + f_nofollow = 1; break; case 'R': f_recursive = 1; @@ -396,10 +400,10 @@ main(int argc, char *argv[]) fts_options |= FTS_NOSTAT; /* - * If not -F, -d or -l options, follow any symbolic links listed on + * If not -F, -P, -d or -l options, follow any symbolic links listed on * the command line. */ - if (!f_longform && !f_listdir && (!f_type || f_slash)) + if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash)) fts_options |= FTS_COMFOLLOW; /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 15:48:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D91CE106566B; Mon, 8 Feb 2010 15:48:18 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C87998FC08; Mon, 8 Feb 2010 15:48:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18FmIF9086459; Mon, 8 Feb 2010 15:48:18 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18FmIMQ086457; Mon, 8 Feb 2010 15:48:18 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002081548.o18FmIMQ086457@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 8 Feb 2010 15:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203666 - stable/8/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 15:48:19 -0000 Author: jh Date: Mon Feb 8 15:48:18 2010 New Revision: 203666 URL: http://svn.freebsd.org/changeset/base/203666 Log: MFC r200751: Add fork(2), getegid(2), geteuid(2), getgid(2), getpid(2), getpgid(2), getpgrp(2), getppid(2), getsid(2) and getuid(2) to syscall table to decode their arguments correctly. Modified: stable/8/usr.bin/truss/syscalls.c Directory Properties: stable/8/usr.bin/truss/ (props changed) Modified: stable/8/usr.bin/truss/syscalls.c ============================================================================== --- stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:42:55 2010 (r203665) +++ stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:48:18 2010 (r203666) @@ -92,6 +92,18 @@ static const char rcsid[] = struct syscall syscalls[] = { { .name = "fcntl", .ret_type = 1, .nargs = 3, .args = { { Int, 0 } , { Fcntl, 1 }, { Fcntlflag | OUT, 2 } } }, + { .name = "fork", .ret_type = 1, .nargs = 0 }, + { .name = "getegid", .ret_type = 1, .nargs = 0 }, + { .name = "geteuid", .ret_type = 1, .nargs = 0 }, + { .name = "getgid", .ret_type = 1, .nargs = 0 }, + { .name = "getpid", .ret_type = 1, .nargs = 0 }, + { .name = "getpgid", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, + { .name = "getpgrp", .ret_type = 1, .nargs = 0 }, + { .name = "getppid", .ret_type = 1, .nargs = 0 }, + { .name = "getsid", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, + { .name = "getuid", .ret_type = 1, .nargs = 0 }, { .name = "readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 } , { Readlinkres | OUT, 1 }, { Int, 2 } } }, { .name = "lseek", .ret_type = 2, .nargs = 3, From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 15:50:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDDA8106566B; Mon, 8 Feb 2010 15:50:51 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDBCA8FC12; Mon, 8 Feb 2010 15:50:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18Fopgi087063; Mon, 8 Feb 2010 15:50:51 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18FopI0087061; Mon, 8 Feb 2010 15:50:51 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002081550.o18FopI0087061@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 8 Feb 2010 15:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203667 - stable/8/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 15:50:52 -0000 Author: jh Date: Mon Feb 8 15:50:51 2010 New Revision: 203667 URL: http://svn.freebsd.org/changeset/base/203667 Log: MFC r200752: Avoid sharing the file descriptor of the output file with traced processes by setting the FD_CLOEXEC flag for the output file. PR: bin/140493 Modified: stable/8/usr.bin/truss/main.c Directory Properties: stable/8/usr.bin/truss/ (props changed) Modified: stable/8/usr.bin/truss/main.c ============================================================================== --- stable/8/usr.bin/truss/main.c Mon Feb 8 15:48:18 2010 (r203666) +++ stable/8/usr.bin/truss/main.c Mon Feb 8 15:50:51 2010 (r203667) @@ -239,6 +239,12 @@ main(int ac, char **av) if ((trussinfo->outfile = fopen(fname, "w")) == NULL) errx(1, "cannot open %s", fname); } + /* + * Set FD_CLOEXEC, so that the output file is not shared with + * the traced process. + */ + if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == -1) + warn("fcntl()"); /* * If truss starts the process itself, it will ignore some signals -- From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 15:53:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B92B1065672; Mon, 8 Feb 2010 15:53:28 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B0788FC33; Mon, 8 Feb 2010 15:53:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18FrSf1087671; Mon, 8 Feb 2010 15:53:28 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18FrSMk087667; Mon, 8 Feb 2010 15:53:28 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002081553.o18FrSMk087667@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 8 Feb 2010 15:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203668 - stable/8/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 15:53:28 -0000 Author: jh Date: Mon Feb 8 15:53:28 2010 New Revision: 203668 URL: http://svn.freebsd.org/changeset/base/203668 Log: MFC r200780: Remove non-working special case for pipe(2) from amd64-fbsd32.c and i386-fbsd.c. Add pipe(2) to syscall table to decode it's pointer argument properly and re-add special handling for pipe(2) return value to print_syscall_ret(). PR: bin/120870 Modified: stable/8/usr.bin/truss/amd64-fbsd32.c stable/8/usr.bin/truss/i386-fbsd.c stable/8/usr.bin/truss/syscalls.c Directory Properties: stable/8/usr.bin/truss/ (props changed) Modified: stable/8/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- stable/8/usr.bin/truss/amd64-fbsd32.c Mon Feb 8 15:50:51 2010 (r203667) +++ stable/8/usr.bin/truss/amd64-fbsd32.c Mon Feb 8 15:53:28 2010 (r203668) @@ -315,19 +315,6 @@ amd64_fbsd32_syscall_exit(struct trussin } } - /* - * The pipe syscall returns its fds in two registers and has assembly glue - * to provide the libc API, so it cannot be handled like regular syscalls. - * The nargs check is so we don't have to do yet another strcmp on every - * syscall. - */ - if (!errorp && fsc.nargs == 0 && fsc.name && strcmp(fsc.name, "pipe") == 0) { - fsc.nargs = 1; - fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*)); - asprintf(&fsc.s_args[0], "[%d,%d]", (int)retval, (int)regs.r_rdx); - retval = 0; - } - if (fsc.name != NULL && (!strcmp(fsc.name, "freebsd32_execve") || !strcmp(fsc.name, "exit"))) { trussinfo->curthread->in_syscall = 1; Modified: stable/8/usr.bin/truss/i386-fbsd.c ============================================================================== --- stable/8/usr.bin/truss/i386-fbsd.c Mon Feb 8 15:50:51 2010 (r203667) +++ stable/8/usr.bin/truss/i386-fbsd.c Mon Feb 8 15:53:28 2010 (r203668) @@ -305,19 +305,6 @@ i386_syscall_exit(struct trussinfo *trus } } - /* - * The pipe syscall returns its fds in two registers and has assembly glue - * to provide the libc API, so it cannot be handled like regular syscalls. - * The nargs check is so we don't have to do yet another strcmp on every - * syscall. - */ - if (!errorp && fsc.nargs == 0 && fsc.name && strcmp(fsc.name, "pipe") == 0) { - fsc.nargs = 1; - fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*)); - asprintf(&fsc.s_args[0], "[%d,%d]", (int)retval, regs.r_edx); - retval = 0; - } - if (fsc.name != NULL && (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit"))) { trussinfo->curthread->in_syscall = 1; Modified: stable/8/usr.bin/truss/syscalls.c ============================================================================== --- stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:50:51 2010 (r203667) +++ stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:53:28 2010 (r203668) @@ -242,6 +242,8 @@ struct syscall syscalls[] = { .args = { { Name | IN, 0 }, { Hex, 1 } } }, { .name = "pathconf", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Pathconf, 1 } } }, + { .name = "pipe", .ret_type = 1, .nargs = 1, + .args = { { Ptr, 0 } } }, { .name = "truncate", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { Int | IN, 1 }, { Quad | IN, 2 } } }, { .name = "ftruncate", .ret_type = 1, .nargs = 3, @@ -1137,6 +1139,12 @@ print_syscall_ret(struct trussinfo *trus if (errorp) { fprintf(trussinfo->outfile, " ERR#%ld '%s'\n", retval, strerror(retval)); } else { + /* + * Because pipe(2) has a special assembly glue to provide the + * libc API, we have to adjust retval. + */ + if (name != NULL && !strcmp(name, "pipe")) + retval = 0; fprintf(trussinfo->outfile, " = %ld (0x%lx)\n", retval, retval); } } From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 15:55:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDB831065676; Mon, 8 Feb 2010 15:55:01 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD4B78FC1F; Mon, 8 Feb 2010 15:55:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18Ft1gj088093; Mon, 8 Feb 2010 15:55:01 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18Ft1Ia088091; Mon, 8 Feb 2010 15:55:01 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002081555.o18Ft1Ia088091@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 8 Feb 2010 15:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203669 - stable/8/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 15:55:01 -0000 Author: jh Date: Mon Feb 8 15:55:01 2010 New Revision: 203669 URL: http://svn.freebsd.org/changeset/base/203669 Log: MFC r200781: Cast time_t values to intmax_t and use %jd with printf. Modified: stable/8/usr.bin/truss/syscalls.c Directory Properties: stable/8/usr.bin/truss/ (props changed) Modified: stable/8/usr.bin/truss/syscalls.c ============================================================================== --- stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:53:28 2010 (r203668) +++ stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:55:01 2010 (r203669) @@ -1161,15 +1161,15 @@ print_summary(struct trussinfo *trussinf ncall = nerror = 0; for (sc = syscalls; sc->name != NULL; sc++) if (sc->ncalls) { - fprintf(trussinfo->outfile, "%-20s%5d.%09ld%8d%8d\n", - sc->name, sc->time.tv_sec, sc->time.tv_nsec, - sc->ncalls, sc->nerror); + fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n", + sc->name, (intmax_t)sc->time.tv_sec, + sc->time.tv_nsec, sc->ncalls, sc->nerror); timespecadd(&total, &sc->time, &total); ncall += sc->ncalls; nerror += sc->nerror; } fprintf(trussinfo->outfile, "%20s%15s%8s%8s\n", "", "-------------", "-------", "-------"); - fprintf(trussinfo->outfile, "%-20s%5d.%09ld%8d%8d\n", - "", total.tv_sec, total.tv_nsec, ncall, nerror); + fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n", + "", (intmax_t)total.tv_sec, total.tv_nsec, ncall, nerror); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 18:16:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBDE010656AC; Mon, 8 Feb 2010 18:16:59 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB7F88FC0A; Mon, 8 Feb 2010 18:16:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18IGxZj019441; Mon, 8 Feb 2010 18:16:59 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18IGx2B019439; Mon, 8 Feb 2010 18:16:59 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201002081816.o18IGx2B019439@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 8 Feb 2010 18:16: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: r203673 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 18:16:59 -0000 Author: bschmidt Date: Mon Feb 8 18:16:59 2010 New Revision: 203673 URL: http://svn.freebsd.org/changeset/base/203673 Log: Ensure that tkip_mixing_phase1() is called after a rekeying event when useing plain s/w crypto. Approved by: rpaulo (mentor) Reviewed by: sam Modified: head/sys/net80211/ieee80211_crypto_tkip.c Modified: head/sys/net80211/ieee80211_crypto_tkip.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_tkip.c Mon Feb 8 17:38:39 2010 (r203672) +++ head/sys/net80211/ieee80211_crypto_tkip.c Mon Feb 8 18:16:59 2010 (r203673) @@ -144,6 +144,7 @@ tkip_setkey(struct ieee80211_key *k) return 0; } k->wk_keytsc = 1; /* TSC starts at 1 */ + ctx->rx_phase1_done = 0; return 1; } From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 18:37:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47D66106566B; Mon, 8 Feb 2010 18:37:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36EB58FC18; Mon, 8 Feb 2010 18:37:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18IbAoQ023990; Mon, 8 Feb 2010 18:37:10 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18IbAY1023988; Mon, 8 Feb 2010 18:37:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002081837.o18IbAY1023988@svn.freebsd.org> From: Ed Maste Date: Mon, 8 Feb 2010 18:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203674 - stable/6/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 18:37:11 -0000 Author: emaste Date: Mon Feb 8 18:37:10 2010 New Revision: 203674 URL: http://svn.freebsd.org/changeset/base/203674 Log: MFC r162488: Use __builtin_offsetof for GCC 4.1. Submitted by: Ryan Stone Modified: stable/6/sys/sys/cdefs.h Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/sys/cdefs.h ============================================================================== --- stable/6/sys/sys/cdefs.h Mon Feb 8 18:16:59 2010 (r203673) +++ stable/6/sys/sys/cdefs.h Mon Feb 8 18:37:10 2010 (r203674) @@ -304,6 +304,9 @@ * We define this here since , , and * require it. */ +#if __GNUC_PREREQ__(4, 1) +#define __offsetof(type, field) __builtin_offsetof(type, field) +#else #ifndef __cplusplus #define __offsetof(type, field) ((size_t)(&((type *)0)->field)) #else @@ -312,6 +315,7 @@ (&reinterpret_cast \ (static_cast (0)->field)))) #endif +#endif #define __rangeof(type, start, end) \ (__offsetof(type, end) - __offsetof(type, start)) From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 18:51:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C52B106566C; Mon, 8 Feb 2010 18:51:24 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BA498FC13; Mon, 8 Feb 2010 18:51:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18IpO8i027259; Mon, 8 Feb 2010 18:51:24 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18IpO8m027255; Mon, 8 Feb 2010 18:51:24 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201002081851.o18IpO8m027255@svn.freebsd.org> From: Maksim Yevmenkin Date: Mon, 8 Feb 2010 18:51: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: r203676 - in head: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 18:51:24 -0000 Author: emax Date: Mon Feb 8 18:51:24 2010 New Revision: 203676 URL: http://svn.freebsd.org/changeset/base/203676 Log: Introduce new rc.conf variable firewall_coscripts. It can be used to specify list of executables and/or rc scripts that should be executed after firewall starts/stops. Submitted by: Yuri Kurenkov Reviewed by: rhodes, rc@ MFC after: 1 week Modified: head/etc/defaults/rc.conf head/etc/rc.d/ipfw head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Feb 8 18:49:50 2010 (r203675) +++ head/etc/defaults/rc.conf Mon Feb 8 18:51:24 2010 (r203676) @@ -118,6 +118,8 @@ firewall_type="UNKNOWN" # Firewall type firewall_quiet="NO" # Set to YES to suppress rule display firewall_logging="NO" # Set to YES to enable events logging firewall_flags="" # Flags passed to ipfw when type is a file +firewall_coscripts="" # List of executables/scripts to run after + # firewall starts/stops firewall_client_net="192.0.2.0/24" # IPv4 Network address for "client" # firewall. #firewall_client_net_ipv6="2001:db8:2:1::/64" # IPv6 network prefix for Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Mon Feb 8 18:49:50 2010 (r203675) +++ head/etc/rc.d/ipfw Mon Feb 8 18:51:24 2010 (r203676) @@ -14,6 +14,7 @@ name="ipfw" rcvar="firewall_enable" start_cmd="ipfw_start" start_precmd="ipfw_prestart" +start_postcmd="ipfw_poststart" stop_cmd="ipfw_stop" required_modules="ipfw" @@ -42,9 +43,6 @@ ipfw_start() [ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall if [ -r "${firewall_script}" ]; then - if [ -f /etc/rc.d/natd ] ; then - /etc/rc.d/natd quietstart - fi /bin/sh "${firewall_script}" "${_firewall_type}" echo 'Firewall rules loaded.' elif [ "`ipfw list 65535`" = "65535 deny ip from any to any" ]; then @@ -59,6 +57,19 @@ ipfw_start() echo 'Firewall logging enabled.' sysctl net.inet.ip.fw.verbose=1 >/dev/null fi +} + +ipfw_poststart() +{ + local _coscript + + # Start firewall coscripts + # + for _coscript in ${firewall_coscripts} ; do + if [ -f "${_coscript}" ]; then + ${_coscript} quietstart + fi + done # Enable the firewall # @@ -75,16 +86,25 @@ ipfw_start() ipfw_stop() { + local _coscript + # Disable the firewall # ${SYSCTL_W} net.inet.ip.fw.enable=0 if afexists inet6; then ${SYSCTL_W} net.inet6.ip6.fw.enable=0 fi - if [ -f /etc/rc.d/natd ] ; then - /etc/rc.d/natd quietstop - fi + + # Stop firewall coscripts + # + for _coscript in `reverse_list ${firewall_coscripts}` ; do + if [ -f "${_coscript}" ]; then + ${_coscript} quietstop + fi + done } load_rc_config $name +firewall_coscripts="/etc/rc.d/natd ${firewall_coscripts}" + run_rc_command $* Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Feb 8 18:49:50 2010 (r203675) +++ head/share/man/man5/rc.conf.5 Mon Feb 8 18:51:24 2010 (r203676) @@ -507,6 +507,10 @@ specifies a filename. .Pq Vt str The IPv6 equivalent of .Va firewall_flags . +.It Va firewall_coscripts +.Pq Vt str +List of executables and/or rc scripts to run after firewall starts/stops. +Default is empty. .\" ----- firewall_nat_enable setting -------------------------------- .It Va firewall_nat_enable .Pq Vt bool From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 18:57:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 324541065670; Mon, 8 Feb 2010 18:57:19 +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 21F568FC14; Mon, 8 Feb 2010 18:57:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18IvJw3028574; Mon, 8 Feb 2010 18:57:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18IvJlD028572; Mon, 8 Feb 2010 18:57:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201002081857.o18IvJlD028572@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 8 Feb 2010 18:57:19 +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: r203677 - head/tools/regression/bin/sh/parameters X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 18:57:19 -0000 Author: jilles Date: Mon Feb 8 18:57:18 2010 New Revision: 203677 URL: http://svn.freebsd.org/changeset/base/203677 Log: sh: Make sure the mail2.0 test can actually fail if $MAIL is not touched. Modified: head/tools/regression/bin/sh/parameters/mail2.0 Modified: head/tools/regression/bin/sh/parameters/mail2.0 ============================================================================== --- head/tools/regression/bin/sh/parameters/mail2.0 Mon Feb 8 18:51:24 2010 (r203676) +++ head/tools/regression/bin/sh/parameters/mail2.0 Mon Feb 8 18:57:18 2010 (r203677) @@ -4,7 +4,7 @@ goodfile=/var/empty/sh-test-goodfile mailfile=/var/empty/sh-test-mailfile T=$(mktemp sh-test.XXXXXX) || exit -MAIL=$mailfile ktrace -i -f "$T" sh +m -i /dev/null 2>&1 +ENV=$goodfile MAIL=$mailfile ktrace -i -f "$T" sh +m -i /dev/null 2>&1 if ! grep -q $goodfile "$T"; then # ktrace problem rc=0 From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 19:44:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC240106568B; Mon, 8 Feb 2010 19:44:09 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB2028FC20; Mon, 8 Feb 2010 19:44:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18Ji9d5038849; Mon, 8 Feb 2010 19:44:09 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18Ji9F7038846; Mon, 8 Feb 2010 19:44:09 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002081944.o18Ji9F7038846@svn.freebsd.org> From: Bruce Cran Date: Mon, 8 Feb 2010 19:44: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: r203678 - head/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 19:44:10 -0000 Author: brucec Date: Mon Feb 8 19:44:09 2010 New Revision: 203678 URL: http://svn.freebsd.org/changeset/base/203678 Log: Rename usb2_ structures and variables to usb_. Approved by: rrs (mentor) Discussed with: hps Modified: head/sys/dev/sound/usb/uaudio.c head/sys/dev/sound/usb/uaudioreg.h Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Mon Feb 8 18:57:18 2010 (r203677) +++ head/sys/dev/sound/usb/uaudio.c Mon Feb 8 19:44:09 2010 (r203678) @@ -155,16 +155,16 @@ struct uaudio_chan { struct pcmchan_caps pcm_cap; /* capabilities */ struct snd_dbuf *pcm_buf; - const struct usb_config *usb2_cfg; + const struct usb_config *usb_cfg; struct mtx *pcm_mtx; /* lock protecting this structure */ struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; - const struct usb2_audio_streaming_interface_descriptor *p_asid; - const struct usb2_audio_streaming_type1_descriptor *p_asf1d; - const struct usb2_audio_streaming_endpoint_descriptor *p_sed; - const usb2_endpoint_descriptor_audio_t *p_ed1; - const usb2_endpoint_descriptor_audio_t *p_ed2; + const struct usb_audio_streaming_interface_descriptor *p_asid; + const struct usb_audio_streaming_type1_descriptor *p_asf1d; + const struct usb_audio_streaming_endpoint_descriptor *p_sed; + const usb_endpoint_descriptor_audio_t *p_ed1; + const usb_endpoint_descriptor_audio_t *p_ed2; const struct uaudio_format *p_fmt; uint8_t *buf; /* pointer to buffer */ @@ -278,13 +278,13 @@ struct uaudio_search_result { struct uaudio_terminal_node { union { const struct usb_descriptor *desc; - const struct usb2_audio_input_terminal *it; - const struct usb2_audio_output_terminal *ot; - const struct usb2_audio_mixer_unit_0 *mu; - const struct usb2_audio_selector_unit *su; - const struct usb2_audio_feature_unit *fu; - const struct usb2_audio_processing_unit_0 *pu; - const struct usb2_audio_extension_unit_0 *eu; + const struct usb_audio_input_terminal *it; + const struct usb_audio_output_terminal *ot; + const struct usb_audio_mixer_unit_0 *mu; + const struct usb_audio_selector_unit *su; + const struct usb_audio_feature_unit *fu; + const struct usb_audio_processing_unit_0 *pu; + const struct usb_audio_extension_unit_0 *eu; } u; struct uaudio_search_result usr; struct uaudio_terminal_node *root; @@ -359,7 +359,7 @@ static void uaudio_mixer_add_mixer(struc static void uaudio_mixer_add_selector(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static uint32_t uaudio_mixer_feature_get_bmaControls( - const struct usb2_audio_feature_unit *, uint8_t); + const struct usb_audio_feature_unit *, uint8_t); static void uaudio_mixer_add_feature(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_processing_updown(struct uaudio_softc *, @@ -368,7 +368,7 @@ static void uaudio_mixer_add_processing( const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_extension(struct uaudio_softc *, const struct uaudio_terminal_node *, int); -static struct usb2_audio_cluster uaudio_mixer_get_cluster(uint8_t, +static struct usb_audio_cluster uaudio_mixer_get_cluster(uint8_t, const struct uaudio_terminal_node *); static uint16_t uaudio_mixer_determine_class(const struct uaudio_terminal_node *, struct uaudio_mixer_node *); @@ -408,7 +408,7 @@ static int32_t umidi_detach(device_t dev #if USB_DEBUG static void uaudio_chan_dump_ep_desc( - const usb2_endpoint_descriptor_audio_t *); + const usb_endpoint_descriptor_audio_t *); static void uaudio_mixer_dump_cluster(uint8_t, const struct uaudio_terminal_node *); static const char *uaudio_mixer_get_terminal_name(uint16_t); @@ -782,7 +782,7 @@ uaudio_detach(device_t dev) #if USB_DEBUG static void -uaudio_chan_dump_ep_desc(const usb2_endpoint_descriptor_audio_t *ed) +uaudio_chan_dump_ep_desc(const usb_endpoint_descriptor_audio_t *ed) { if (ed) { DPRINTF("endpoint=%p bLength=%d bDescriptorType=%d \n" @@ -803,11 +803,11 @@ uaudio_chan_fill_info_sub(struct uaudio_ uint32_t rate, uint8_t channels, uint8_t bit_resolution) { struct usb_descriptor *desc = NULL; - const struct usb2_audio_streaming_interface_descriptor *asid = NULL; - const struct usb2_audio_streaming_type1_descriptor *asf1d = NULL; - const struct usb2_audio_streaming_endpoint_descriptor *sed = NULL; - const usb2_endpoint_descriptor_audio_t *ed1 = NULL; - const usb2_endpoint_descriptor_audio_t *ed2 = NULL; + const struct usb_audio_streaming_interface_descriptor *asid = NULL; + const struct usb_audio_streaming_type1_descriptor *asf1d = NULL; + const struct usb_audio_streaming_endpoint_descriptor *sed = NULL; + const usb_endpoint_descriptor_audio_t *ed1 = NULL; + const usb_endpoint_descriptor_audio_t *ed2 = NULL; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); struct usb_interface_descriptor *id; const struct uaudio_format *p_fmt; @@ -1045,10 +1045,10 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan->iface_alt_index = alt_index; if (ep_dir == UE_DIR_IN) - chan->usb2_cfg = + chan->usb_cfg = uaudio_cfg_record; else - chan->usb2_cfg = + chan->usb_cfg = uaudio_cfg_play; chan->sample_size = (( @@ -1429,7 +1429,7 @@ uaudio_chan_init(struct uaudio_softc *sc } } if (usbd_transfer_setup(sc->sc_udev, &iface_index, ch->xfer, - ch->usb2_cfg, UAUDIO_NCHANBUFS, ch, ch->pcm_mtx)) { + ch->usb_cfg, UAUDIO_NCHANBUFS, ch, ch->pcm_mtx)) { DPRINTF("could not allocate USB transfers!\n"); goto error; } @@ -1709,7 +1709,7 @@ uaudio_mixer_add_input(struct uaudio_sof const struct uaudio_terminal_node *iot, int id) { #if USB_DEBUG - const struct usb2_audio_input_terminal *d = iot[id].u.it; + const struct usb_audio_input_terminal *d = iot[id].u.it; DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " "bAssocTerminal=%d bNrChannels=%d wChannelConfig=%d " @@ -1725,7 +1725,7 @@ uaudio_mixer_add_output(struct uaudio_so const struct uaudio_terminal_node *iot, int id) { #if USB_DEBUG - const struct usb2_audio_output_terminal *d = iot[id].u.ot; + const struct usb_audio_output_terminal *d = iot[id].u.ot; DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " "bAssocTerminal=%d bSourceId=%d iTerminal=%d\n", @@ -1740,8 +1740,8 @@ uaudio_mixer_add_mixer(struct uaudio_sof { struct uaudio_mixer_node mix; - const struct usb2_audio_mixer_unit_0 *d0 = iot[id].u.mu; - const struct usb2_audio_mixer_unit_1 *d1; + const struct usb_audio_mixer_unit_0 *d0 = iot[id].u.mu; + const struct usb_audio_mixer_unit_1 *d1; uint32_t bno; /* bit number */ uint32_t p; /* bit number accumulator */ @@ -1823,7 +1823,7 @@ static void uaudio_mixer_add_selector(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb2_audio_selector_unit *d = iot[id].u.su; + const struct usb_audio_selector_unit *d = iot[id].u.su; struct uaudio_mixer_node mix; uint16_t i; @@ -1864,7 +1864,7 @@ uaudio_mixer_add_selector(struct uaudio_ } static uint32_t -uaudio_mixer_feature_get_bmaControls(const struct usb2_audio_feature_unit *d, +uaudio_mixer_feature_get_bmaControls(const struct usb_audio_feature_unit *d, uint8_t index) { uint32_t temp = 0; @@ -1889,7 +1889,7 @@ static void uaudio_mixer_add_feature(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb2_audio_feature_unit *d = iot[id].u.fu; + const struct usb_audio_feature_unit *d = iot[id].u.fu; struct uaudio_mixer_node mix; uint32_t fumask; uint32_t mmask; @@ -2015,10 +2015,10 @@ static void uaudio_mixer_add_processing_updown(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb2_audio_processing_unit_0 *d0 = iot[id].u.pu; - const struct usb2_audio_processing_unit_1 *d1 = + const struct usb_audio_processing_unit_0 *d0 = iot[id].u.pu; + const struct usb_audio_processing_unit_1 *d1 = (const void *)(d0->baSourceId + d0->bNrInPins); - const struct usb2_audio_processing_unit_updown *ud = + const struct usb_audio_processing_unit_updown *ud = (const void *)(d1->bmControls + d1->bControlSize); struct uaudio_mixer_node mix; uint8_t i; @@ -2057,8 +2057,8 @@ static void uaudio_mixer_add_processing(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb2_audio_processing_unit_0 *d0 = iot[id].u.pu; - const struct usb2_audio_processing_unit_1 *d1 = + const struct usb_audio_processing_unit_0 *d0 = iot[id].u.pu; + const struct usb_audio_processing_unit_1 *d1 = (const void *)(d0->baSourceId + d0->bNrInPins); struct uaudio_mixer_node mix; uint16_t ptype; @@ -2102,8 +2102,8 @@ static void uaudio_mixer_add_extension(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb2_audio_extension_unit_0 *d0 = iot[id].u.eu; - const struct usb2_audio_extension_unit_1 *d1 = + const struct usb_audio_extension_unit_0 *d0 = iot[id].u.eu; + const struct usb_audio_extension_unit_1 *d1 = (const void *)(d0->baSourceId + d0->bNrInPins); struct uaudio_mixer_node mix; @@ -2133,19 +2133,19 @@ uaudio_mixer_add_extension(struct uaudio static const void * uaudio_mixer_verify_desc(const void *arg, uint32_t len) { - const struct usb2_audio_mixer_unit_1 *d1; - const struct usb2_audio_extension_unit_1 *e1; - const struct usb2_audio_processing_unit_1 *u1; + const struct usb_audio_mixer_unit_1 *d1; + const struct usb_audio_extension_unit_1 *e1; + const struct usb_audio_processing_unit_1 *u1; union { const struct usb_descriptor *desc; - const struct usb2_audio_input_terminal *it; - const struct usb2_audio_output_terminal *ot; - const struct usb2_audio_mixer_unit_0 *mu; - const struct usb2_audio_selector_unit *su; - const struct usb2_audio_feature_unit *fu; - const struct usb2_audio_processing_unit_0 *pu; - const struct usb2_audio_extension_unit_0 *eu; + const struct usb_audio_input_terminal *it; + const struct usb_audio_output_terminal *ot; + const struct usb_audio_mixer_unit_0 *mu; + const struct usb_audio_selector_unit *su; + const struct usb_audio_feature_unit *fu; + const struct usb_audio_processing_unit_0 *pu; + const struct usb_audio_extension_unit_0 *eu; } u; u.desc = arg; @@ -2269,7 +2269,7 @@ uaudio_mixer_dump_cluster(uint8_t id, co }; uint16_t cc; uint8_t i; - const struct usb2_audio_cluster cl = uaudio_mixer_get_cluster(id, iot); + const struct usb_audio_cluster cl = uaudio_mixer_get_cluster(id, iot); cc = UGETW(cl.wChannelConfig); @@ -2286,10 +2286,10 @@ uaudio_mixer_dump_cluster(uint8_t id, co #endif -static struct usb2_audio_cluster +static struct usb_audio_cluster uaudio_mixer_get_cluster(uint8_t id, const struct uaudio_terminal_node *iot) { - struct usb2_audio_cluster r; + struct usb_audio_cluster r; const struct usb_descriptor *dp; uint8_t i; @@ -2311,7 +2311,7 @@ uaudio_mixer_get_cluster(uint8_t id, con break; case UDESCSUB_AC_MIXER: - r = *(const struct usb2_audio_cluster *) + r = *(const struct usb_audio_cluster *) &iot[id].u.mu->baSourceId[iot[id].u.mu-> bNrInPins]; goto done; @@ -2328,13 +2328,13 @@ uaudio_mixer_get_cluster(uint8_t id, con break; case UDESCSUB_AC_PROCESSING: - r = *((const struct usb2_audio_cluster *) + r = *((const struct usb_audio_cluster *) &iot[id].u.pu->baSourceId[iot[id].u.pu-> bNrInPins]); goto done; case UDESCSUB_AC_EXTENSION: - r = *((const struct usb2_audio_cluster *) + r = *((const struct usb_audio_cluster *) &iot[id].u.eu->baSourceId[iot[id].u.eu-> bNrInPins]); goto done; @@ -2760,10 +2760,10 @@ static void uaudio_mixer_fill_info(struct uaudio_softc *sc, struct usb_device *udev, void *desc) { - const struct usb2_audio_control_descriptor *acdp; + const struct usb_audio_control_descriptor *acdp; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); const struct usb_descriptor *dp; - const struct usb2_audio_unit *au; + const struct usb_audio_unit *au; struct uaudio_terminal_node *iot = NULL; uint16_t wTotalLen; uint8_t ID_max = 0; /* inclusive */ Modified: head/sys/dev/sound/usb/uaudioreg.h ============================================================================== --- head/sys/dev/sound/usb/uaudioreg.h Mon Feb 8 18:57:18 2010 (r203677) +++ head/sys/dev/sound/usb/uaudioreg.h Mon Feb 8 19:44:09 2010 (r203678) @@ -64,9 +64,9 @@ typedef struct { */ uByte bRefresh; uByte bSynchAddress; -} __packed usb2_endpoint_descriptor_audio_t; +} __packed usb_endpoint_descriptor_audio_t; -struct usb2_audio_control_descriptor { +struct usb_audio_control_descriptor { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -76,7 +76,7 @@ struct usb2_audio_control_descriptor { uByte baInterfaceNr[1]; } __packed; -struct usb2_audio_streaming_interface_descriptor { +struct usb_audio_streaming_interface_descriptor { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -85,7 +85,7 @@ struct usb2_audio_streaming_interface_de uWord wFormatTag; } __packed; -struct usb2_audio_streaming_endpoint_descriptor { +struct usb_audio_streaming_endpoint_descriptor { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -97,7 +97,7 @@ struct usb2_audio_streaming_endpoint_des uWord wLockDelay; } __packed; -struct usb2_audio_streaming_type1_descriptor { +struct usb_audio_streaming_type1_descriptor { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -115,7 +115,7 @@ struct usb2_audio_streaming_type1_descri #define UA_SAMP_HI(p) UA_GETSAMP(p, 1) } __packed; -struct usb2_audio_cluster { +struct usb_audio_cluster { uByte bNrChannels; uWord wChannelConfig; #define UA_CHANNEL_LEFT 0x0001 @@ -134,7 +134,7 @@ struct usb2_audio_cluster { } __packed; /* Shared by all units and terminals */ -struct usb2_audio_unit { +struct usb_audio_unit { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -142,7 +142,7 @@ struct usb2_audio_unit { }; /* UDESCSUB_AC_INPUT */ -struct usb2_audio_input_terminal { +struct usb_audio_input_terminal { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -156,7 +156,7 @@ struct usb2_audio_input_terminal { } __packed; /* UDESCSUB_AC_OUTPUT */ -struct usb2_audio_output_terminal { +struct usb_audio_output_terminal { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -168,16 +168,16 @@ struct usb2_audio_output_terminal { } __packed; /* UDESCSUB_AC_MIXER */ -struct usb2_audio_mixer_unit_0 { +struct usb_audio_mixer_unit_0 { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; uByte bUnitId; uByte bNrInPins; uByte baSourceId[0]; /* [bNrInPins] */ - /* struct usb2_audio_mixer_unit_1 */ + /* struct usb_audio_mixer_unit_1 */ } __packed; -struct usb2_audio_mixer_unit_1 { +struct usb_audio_mixer_unit_1 { uByte bNrChannels; uWord wChannelConfig; uByte iChannelNames; @@ -186,7 +186,7 @@ struct usb2_audio_mixer_unit_1 { } __packed; /* UDESCSUB_AC_SELECTOR */ -struct usb2_audio_selector_unit { +struct usb_audio_selector_unit { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -197,7 +197,7 @@ struct usb2_audio_selector_unit { } __packed; /* UDESCSUB_AC_FEATURE */ -struct usb2_audio_feature_unit { +struct usb_audio_feature_unit { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -209,7 +209,7 @@ struct usb2_audio_feature_unit { } __packed; /* UDESCSUB_AC_PROCESSING */ -struct usb2_audio_processing_unit_0 { +struct usb_audio_processing_unit_0 { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -217,9 +217,9 @@ struct usb2_audio_processing_unit_0 { uWord wProcessType; uByte bNrInPins; uByte baSourceId[0]; /* [bNrInPins] */ - /* struct usb2_audio_processing_unit_1 */ + /* struct usb_audio_processing_unit_1 */ } __packed; -struct usb2_audio_processing_unit_1 { +struct usb_audio_processing_unit_1 { uByte bNrChannels; uWord wChannelConfig; uByte iChannelNames; @@ -228,14 +228,14 @@ struct usb2_audio_processing_unit_1 { #define UA_PROC_ENABLE_MASK 1 } __packed; -struct usb2_audio_processing_unit_updown { +struct usb_audio_processing_unit_updown { uByte iProcessing; uByte bNrModes; uWord waModes[0]; /* [bNrModes] */ } __packed; /* UDESCSUB_AC_EXTENSION */ -struct usb2_audio_extension_unit_0 { +struct usb_audio_extension_unit_0 { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -243,9 +243,9 @@ struct usb2_audio_extension_unit_0 { uWord wExtensionCode; uByte bNrInPins; uByte baSourceId[0]; /* [bNrInPins] */ - /* struct usb2_audio_extension_unit_1 */ + /* struct usb_audio_extension_unit_1 */ } __packed; -struct usb2_audio_extension_unit_1 { +struct usb_audio_extension_unit_1 { uByte bNrChannels; uWord wChannelConfig; uByte iChannelNames; From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 19:48:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 053C21065692; Mon, 8 Feb 2010 19:48:34 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8E588FC1C; Mon, 8 Feb 2010 19:48:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18JmXSu039851; Mon, 8 Feb 2010 19:48:33 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18JmXKh039845; Mon, 8 Feb 2010 19:48:33 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002081948.o18JmXKh039845@svn.freebsd.org> From: Bruce Cran Date: Mon, 8 Feb 2010 19:48: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: r203679 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 19:48:34 -0000 Author: brucec Date: Mon Feb 8 19:48:33 2010 New Revision: 203679 URL: http://svn.freebsd.org/changeset/base/203679 Log: Remove the usb2_input_kbd directive that was missed during the renaming of the drivers in the usb2 stack. Approved by: rrs (mentor) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.ia64 head/sys/conf/files.pc98 head/sys/conf/files.sparc64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Feb 8 19:44:09 2010 (r203678) +++ head/sys/conf/files.amd64 Mon Feb 8 19:48:33 2010 (r203679) @@ -208,7 +208,7 @@ dev/hwpmc/hwpmc_core.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc -dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd +dev/kbd/kbd.c optional atkbd | sc | ukbd dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Feb 8 19:44:09 2010 (r203678) +++ head/sys/conf/files.i386 Mon Feb 8 19:48:33 2010 (r203679) @@ -200,7 +200,7 @@ dev/ipmi/ipmi_smbios.c optional ipmi dev/ipmi/ipmi_ssif.c optional ipmi smbus dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux -dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd +dev/kbd/kbd.c optional atkbd | sc | ukbd dev/le/if_le_isa.c optional le isa dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev Modified: head/sys/conf/files.ia64 ============================================================================== --- head/sys/conf/files.ia64 Mon Feb 8 19:44:09 2010 (r203678) +++ head/sys/conf/files.ia64 Mon Feb 8 19:48:33 2010 (r203679) @@ -55,7 +55,7 @@ dev/fb/fb.c optional fb | vga dev/fb/vga.c optional vga dev/hwpmc/hwpmc_ia64.c optional hwpmc dev/io/iodev.c optional io -dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd +dev/kbd/kbd.c optional atkbd | sc | ukbd dev/syscons/scterm-teken.c optional sc dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Mon Feb 8 19:44:09 2010 (r203678) +++ head/sys/conf/files.pc98 Mon Feb 8 19:48:33 2010 (r203679) @@ -105,7 +105,7 @@ dev/hwpmc/hwpmc_ppro.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io -dev/kbd/kbd.c optional pckbd | sc | ukbd | usb2_input_kbd +dev/kbd/kbd.c optional pckbd | sc | ukbd dev/le/if_le_cbus.c optional le isa dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Mon Feb 8 19:44:09 2010 (r203678) +++ head/sys/conf/files.sparc64 Mon Feb 8 19:48:33 2010 (r203679) @@ -38,7 +38,7 @@ dev/fb/fb.c optional sc dev/fb/gallant12x22.c optional sc dev/fb/machfb.c optional machfb sc dev/hwpmc/hwpmc_sparc64.c optional hwpmc -dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd +dev/kbd/kbd.c optional atkbd | sc | ukbd dev/le/if_le_lebuffer.c optional le sbus dev/le/if_le_ledma.c optional le sbus dev/le/lebuffer_sbus.c optional le sbus From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 20:04:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E914A106568D; Mon, 8 Feb 2010 20:04:02 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8F748FC20; Mon, 8 Feb 2010 20:04:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18K42Au043367; Mon, 8 Feb 2010 20:04:02 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18K425Q043365; Mon, 8 Feb 2010 20:04:02 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002082004.o18K425Q043365@svn.freebsd.org> From: Rui Paulo Date: Mon, 8 Feb 2010 20:04: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: r203680 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 20:04:03 -0000 Author: rpaulo Date: Mon Feb 8 20:04:02 2010 New Revision: 203680 URL: http://svn.freebsd.org/changeset/base/203680 Log: Fix typo in comment. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Mon Feb 8 19:48:33 2010 (r203679) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Mon Feb 8 20:04:02 2010 (r203680) @@ -30,7 +30,7 @@ #include "ar5416/ar5416phy.h" /* - * Return the wireless modes (a,b,g,t) supported by hardware. + * Return the wireless modes (a,b,g,n) supported by hardware. * * This value is what is actually supported by the hardware * and is unaffected by regulatory/country code settings. From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 20:04:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B23F2106568B; Mon, 8 Feb 2010 20:04:16 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A23538FC08; Mon, 8 Feb 2010 20:04:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18K4GPW043467; Mon, 8 Feb 2010 20:04:16 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18K4GP3043465; Mon, 8 Feb 2010 20:04:16 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002082004.o18K4GP3043465@svn.freebsd.org> From: Bruce Cran Date: Mon, 8 Feb 2010 20:04: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: r203681 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 20:04:16 -0000 Author: brucec Date: Mon Feb 8 20:04:16 2010 New Revision: 203681 URL: http://svn.freebsd.org/changeset/base/203681 Log: Fix typo and remove extra spaces. Approved by: rrs (mentor) MFC after: 3 days Modified: head/share/man/man4/sctp.4 Modified: head/share/man/man4/sctp.4 ============================================================================== --- head/share/man/man4/sctp.4 Mon Feb 8 20:04:02 2010 (r203680) +++ head/share/man/man4/sctp.4 Mon Feb 8 20:04:16 2010 (r203681) @@ -154,8 +154,8 @@ also supports the following extensions: This extension allows one to have message be skipped and not delivered based on some user specified parameters. .It "sctp dynamic addressing" - This extension allows addresses to be added and deleted -dynammically from an existing association. +This extension allows addresses to be added and deleted +dynamically from an existing association. .It "sctp authentication" This extension allows the user to authenticate specific peer chunks (including data) to validate that the peer @@ -164,7 +164,7 @@ association. A shared key option is also provided for so that two stacks can pre-share keys. .It "packet drop" - Some routers support a special satellite protocol that +Some routers support a special satellite protocol that will report losses due to corruption. This allows retransmissions without subsequent loss in bandwidth utilization. From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 20:12:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBD8C106566B; Mon, 8 Feb 2010 20:12:01 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA4A78FC1B; Mon, 8 Feb 2010 20:12:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18KC1Yi045201; Mon, 8 Feb 2010 20:12:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18KC1cu045193; Mon, 8 Feb 2010 20:12:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002082012.o18KC1cu045193@svn.freebsd.org> From: Rui Paulo Date: Mon, 8 Feb 2010 20:12: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: r203682 - in head/sys/dev/ath/ath_hal: . ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 20:12:01 -0000 Author: rpaulo Date: Mon Feb 8 20:12:01 2010 New Revision: 203682 URL: http://svn.freebsd.org/changeset/base/203682 Log: Fix TX power problems with AR9285. Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.h head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h head/sys/dev/ath/ath_hal/ar5416/ar9280.c head/sys/dev/ath/ath_hal/ar5416/ar9280.h head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Mon Feb 8 20:04:16 2010 (r203681) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Mon Feb 8 20:12:01 2010 (r203682) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v14.h,v 1.3 2008/11/10 04:08:00 sam Exp $ + * $FreeBSD$ */ #ifndef _AH_EEPROM_V14_H_ #define _AH_EEPROM_V14_H_ @@ -76,6 +76,7 @@ #define AR5416_EEPMISC_BIG_ENDIAN 0x01 #define FREQ2FBIN(x,y) ((y) ? ((x) - 2300) : (((x) - 4800) / 5)) #define AR5416_MAX_CHAINS 3 +#define AR5416_PWR_TABLE_OFFSET_DB -5 #define AR5416_ANT_16S 25 #define AR5416_NUM_ANT_CHAIN_FIELDS 7 Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Mon Feb 8 20:04:16 2010 (r203681) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Mon Feb 8 20:12:01 2010 (r203682) @@ -172,12 +172,11 @@ ar5416InitCal(struct ath_hal *ah, const ichan = ath_hal_checkchannel(ah, chan); HALASSERT(ichan != AH_NULL); - if (AR_SREV_KITE_12_OR_LATER(ah)) { - /* Clear the carrier leak cal bit */ OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); - if (IEEE80211_IS_CHAN_HT20(chan)) { + OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, + AR_PHY_CL_CAL_ENABLE); OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_PARALLEL_CAL_ENABLE); OS_REG_SET_BIT(ah, AR_PHY_TURBO, AR_PHY_FC_DYN2040_EN); @@ -191,7 +190,7 @@ ar5416InitCal(struct ath_hal *ah, const if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) { HALDEBUG(ah, HAL_DEBUG_ANY, - "%s: offset calibration failed to " + "%s: HT offset calibration failed to " "complete in 1ms; noisy environment?\n", __func__); return AH_FALSE; @@ -201,14 +200,10 @@ ar5416InitCal(struct ath_hal *ah, const AR_PHY_PARALLEL_CAL_ENABLE); } OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); - - /* Enable Rx Filter Cal */ OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_FLTR_CAL); OS_REG_SET_BIT(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_CAL_ENABLE); - - /* kick off the cal */ OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL); /* Poll for offset calibration complete */ @@ -219,8 +214,6 @@ ar5416InitCal(struct ath_hal *ah, const "noisy environment?\n", __func__); return AH_FALSE; } - /* Set the cl cal bit and rerun the cal a 2nd time */ - /* Enable Rx Filter Cal */ OS_REG_SET_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, @@ -258,9 +251,10 @@ ar5416InitCal(struct ath_hal *ah, const OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL); /* Poll for offset calibration complete */ - if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) { + if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_CAL, 0)) { HALDEBUG(ah, HAL_DEBUG_ANY, - "%s: offset calibration did not complete in 1ms; " + "%s: AGC offset calibration did not complete in 1ms; " "noisy environment?\n", __func__); return AH_FALSE; } Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Feb 8 20:04:16 2010 (r203681) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Feb 8 20:12:01 2010 (r203682) @@ -898,6 +898,8 @@ ar5416SetTransmitPower(struct ath_hal *a ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]); if (ratesArray[i] > AR5416_MAX_RATE_POWER) ratesArray[i] = AR5416_MAX_RATE_POWER; + if (AR_SREV_MERLIN_10_OR_LATER(ah)) + ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2; } #ifdef AH_EEPROM_DUMP @@ -1225,7 +1227,7 @@ ar5416SetBoardValues(struct ath_hal *ah, const struct ar5416eeprom_4k *eep4k; const MODAL_EEP_HEADER *pModal; const MODAL_EEP4K_HEADER *pModal4k; - int i, regChainOffset; + int i, regChainOffset = 0; uint8_t txRxAttenLocal; /* workaround for eeprom versions <= 14.2 */ HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); @@ -1253,9 +1255,9 @@ ar5416SetBoardValues(struct ath_hal *ah, (pModal) ? pModal->antCtrlCommon : pModal4k->antCtrlCommon); for (i = 0; i < AR5416_MAX_CHAINS; i++) { - if (AR_SREV_KITE(ah) && i >= 1) break; - if (AR_SREV_MERLIN(ah) && i >= 2) break; - if (AR_SREV_OWL_20_OR_LATER(ah) && +// if (AR_SREV_KITE(ah) && i >= 2) break; + if (AR_SREV_MERLIN(ah) && i >= 2) break; + if (AR_SREV_OWL_20_OR_LATER(ah) && (AH5416(ah)->ah_rx_chainmask == 0x5 || AH5416(ah)->ah_tx_chainmask == 0x5) && i != 0) { /* Regs are swapped from chain 2 to 1 for 5416 2_0 with @@ -1289,15 +1291,23 @@ ar5416SetBoardValues(struct ath_hal *ah, } else txRxAtten = txRxAttenLocal; - OS_REG_WRITE(ah, AR_PHY_RXGAIN + regChainOffset, - (OS_REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & ~AR_PHY_RXGAIN_TXRX_ATTEN) | - SM(txRxAtten, AR_PHY_RXGAIN_TXRX_ATTEN)); - - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | - SM((pModal) ? pModal->rxTxMarginCh[i]: - pModal4k->rxTxMarginCh[i], - AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset, + AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAtten); + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset, + AR9280_PHY_RXGAIN_TXRX_MARGIN, + (pModal) ? pModal->rxTxMarginCh[i] : pModal4k->rxTxMarginCh[i]); + } else { + OS_REG_WRITE(ah, AR_PHY_RXGAIN + regChainOffset, + (OS_REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & ~AR_PHY_RXGAIN_TXRX_ATTEN) | + SM(txRxAtten, AR_PHY_RXGAIN_TXRX_ATTEN)); + + OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, + (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | + SM((pModal) ? pModal->rxTxMarginCh[i]: + pModal4k->rxTxMarginCh[i], + AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); + } } } @@ -1360,6 +1370,20 @@ ar5416SetBoardValues(struct ath_hal *ah, OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | SM(pModal->bswAtten[1], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); } else { + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, + AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, + (pModal) ? pModal->bswMargin[i] : pModal4k->bswMargin[i]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, + AR_PHY_GAIN_2GHZ_XATTEN1_DB, + (pModal) ? pModal->bswAtten[i] : pModal4k->bswAtten[i]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, + AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, + (pModal) ? pModal->xatten2Margin[i] : pModal4k->xatten2Margin[i]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, + AR_PHY_GAIN_2GHZ_XATTEN2_DB, + (pModal) ? pModal->xatten2Db[i] : pModal4k->xatten2Db[i]); + } else { OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | SM((pModal) ? pModal->bswMargin[1] : pModal4k->bswMargin[1], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); @@ -1372,6 +1396,7 @@ ar5416SetBoardValues(struct ath_hal *ah, OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | SM((pModal) ? pModal->bswAtten[2] : pModal4k->bswAtten[2], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); + } } OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_BSW_MARGIN, (pModal) ? pModal->bswMargin[0] : pModal4k->bswMargin[0]); @@ -1440,10 +1465,7 @@ ar5416SetPowerPerRateTable(struct ath_ha pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].antennaGainCh[1]), pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].antennaGainCh[2]); else - twiceLargestAntenna = AH_MAX(AH_MAX( - pEepData4k->modalHeader.antennaGainCh[0], - pEepData4k->modalHeader.antennaGainCh[1]), - pEepData4k->modalHeader.antennaGainCh[2]); + twiceLargestAntenna = pEepData4k->modalHeader.antennaGainCh[0]; #if 0 /* Turn it back on if we need to calculate per chain antenna gain reduction */ /* Use only if the expected gain > 6dbi */ @@ -1577,15 +1599,15 @@ ar5416SetPowerPerRateTable(struct ath_ha freq = centers.ctl_center; } - ctlIndex = (pEepData) ? pEepData->ctlIndex[0] : - pEepData4k->ctlIndex[0]; /* walk through each CTL index stored in EEPROM */ - for (i = 0; (i < numctls) && ctlIndex; i++) { + for (i = 0; i < numctls; i++) { uint16_t twiceMinEdgePower; CAL_CTL_EDGES *ctlEdge; ctlIndex = (pEepData) ? pEepData->ctlIndex[i] : pEepData4k->ctlIndex[i]; + if (!ctlIndex) + break; /* compare test group from regulatory channel list with test mode from pCtlMode list */ if ((((cfgCtl & ~CTL_MODE_M) | (pCtlMode[ctlMode] & CTL_MODE_M)) == ctlIndex) || @@ -1943,7 +1965,7 @@ ar5416SetPowerCalTable(struct ath_hal *a SM(xpdGainValues[1], AR_PHY_TPCRG1_PD_GAIN_2) | SM(xpdGainValues[2], AR_PHY_TPCRG1_PD_GAIN_3)); for (i = 0; i < AR5416_MAX_CHAINS; i++) { - if (AR_SREV_KITE(ah) && i >= AR5416_4K_MAX_CHAINS) break; +// if (AR_SREV_KITE(ah) && i >= AR5416_4K_MAX_CHAINS) break; if (AR_SREV_OWL_20_OR_LATER(ah) && ( AH5416(ah)->ah_rx_chainmask == 0x5 || AH5416(ah)->ah_tx_chainmask == 0x5) && (i != 0)) { /* Regs are swapped from chain 2 to 1 for 5416 2_0 with @@ -1981,7 +2003,6 @@ ar5416SetPowerCalTable(struct ath_hal *a * negative or greater than 0. Need to offset the power * values by the amount of minPower for griffin */ - OS_REG_WRITE(ah, AR_PHY_TPCRG5 + regChainOffset, SM(pdGainOverlap_t2, AR_PHY_TPCRG5_PD_GAIN_OVERLAP) | SM(gainBoundaries[0], AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1) | @@ -2149,7 +2170,10 @@ ar5416GetGainBoundariesAndPdadcs(struct /* Find starting index for this pdGain */ if (i == 0) { - ss = 0; /* for the first pdGain, start from index 0 */ + if (AR_SREV_MERLIN_10_OR_LATER(ah)) + ss = (int16_t)(0 - (minPwrT4[i] / 2)); + else + ss = 0; /* for the first pdGain, start from index 0 */ } else { /* need overlap entries extrapolated below. */ ss = (int16_t)((pPdGainBoundaries[i-1] - (minPwrT4[i] / 2)) - tPdGainOverlap + 1 + minDelta); @@ -2165,7 +2189,7 @@ ar5416GetGainBoundariesAndPdadcs(struct ss++; } - sizeCurrVpdTable = (uint8_t)((maxPwrT4[i] - minPwrT4[i]) / 2 +1); + sizeCurrVpdTable = (uint8_t)((maxPwrT4[i] - minPwrT4[i]) / 2 + 1); tgtIndex = (uint8_t)(pPdGainBoundaries[i] + tPdGainOverlap - (minPwrT4[i] / 2)); maxIndex = (tgtIndex < sizeCurrVpdTable) ? tgtIndex : sizeCurrVpdTable; @@ -2314,13 +2338,20 @@ ar5416Set11nRegs(struct ath_hal *ah, con { uint32_t phymode; HAL_HT_MACMODE macmode; /* MAC - 20/40 mode */ + uint32_t dacFifo; if (!IEEE80211_IS_CHAN_HT(chan)) return; + if (AR_SREV_KITE_10_OR_LATER(ah)) + dacFifo = OS_REG_READ(ah, AR_PHY_TURBO) + & AR_PHY_FC_ENABLE_DAC_FIFO; + else + dacFifo = 0; + /* Enable 11n HT, 20 MHz */ phymode = AR_PHY_FC_HT_EN | AR_PHY_FC_SHORT_GI_40 - | AR_PHY_FC_SINGLE_HT_LTF1 | AR_PHY_FC_WALSH; + | AR_PHY_FC_SINGLE_HT_LTF1 | AR_PHY_FC_WALSH | dacFifo; /* Configure baseband for dynamic 20/40 operation */ if (IEEE80211_IS_CHAN_HT40(chan)) { Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Mon Feb 8 20:04:16 2010 (r203681) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Mon Feb 8 20:12:01 2010 (r203682) @@ -48,6 +48,7 @@ #define AR_PHY_FC_SHORT_GI_40 0x00000080 /* allow short GI for HT 40 */ #define AR_PHY_FC_WALSH 0x00000100 /* walsh spatial spreading for 2 chains,2 streams TX */ #define AR_PHY_FC_SINGLE_HT_LTF1 0x00000200 /* single length (4us) 1st HT long training symbol */ +#define AR_PHY_FC_ENABLE_DAC_FIFO 0x00000800 #define AR_PHY_TIMING2 0x9810 /* Timing Control 2 */ #define AR_PHY_TIMING2_USE_FORCE 0x00001000 @@ -78,6 +79,20 @@ #define AR_PHY_GAIN_2GHZ_BSW_ATTEN 0x0000001F #define AR_PHY_GAIN_2GHZ_BSW_ATTEN_S 0 +#define AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN 0x003E0000 +#define AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN_S 17 +#define AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN 0x0001F000 +#define AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN_S 12 +#define AR_PHY_GAIN_2GHZ_XATTEN2_DB 0x00000FC0 +#define AR_PHY_GAIN_2GHZ_XATTEN2_DB_S 6 +#define AR_PHY_GAIN_2GHZ_XATTEN1_DB 0x0000003F +#define AR_PHY_GAIN_2GHZ_XATTEN1_DB_S 0 + +#define AR9280_PHY_RXGAIN_TXRX_ATTEN 0x00003F80 +#define AR9280_PHY_RXGAIN_TXRX_ATTEN_S 7 +#define AR9280_PHY_RXGAIN_TXRX_MARGIN 0x001FC000 +#define AR9280_PHY_RXGAIN_TXRX_MARGIN_S 14 + #define AR_PHY_EXT_CCA 0x99bc #define AR_PHY_EXT_CCA_CYCPWR_THR1 0x0000FE00 #define AR_PHY_EXT_CCA_CYCPWR_THR1_S 9 Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9280.c Mon Feb 8 20:04:16 2010 (r203681) +++ head/sys/dev/ath/ath_hal/ar5416/ar9280.c Mon Feb 8 20:12:01 2010 (r203682) @@ -277,12 +277,15 @@ ar9280GetNoiseFloor(struct ath_hal *ah, "NF calibrated [ctl] [chain 0] is %d\n", nf); nfarray[0] = nf; - nf = MS(OS_REG_READ(ah, AR_PHY_CH1_CCA), AR9280_PHY_CH1_MINCCA_PWR); - if (nf & 0x100) - nf = 0 - ((nf ^ 0x1ff) + 1); - HALDEBUG(ah, HAL_DEBUG_NFCAL, - "NF calibrated [ctl] [chain 1] is %d\n", nf); - nfarray[1] = nf; + if (!AR_SREV_KITE(ah)) { + nf = MS(OS_REG_READ(ah, AR_PHY_CH1_CCA), + AR9280_PHY_CH1_MINCCA_PWR); + if (nf & 0x100) + nf = 0 - ((nf ^ 0x1ff) + 1); + HALDEBUG(ah, HAL_DEBUG_NFCAL, + "NF calibrated [ctl] [chain 1] is %d\n", nf); + nfarray[1] = nf; + } nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR9280_PHY_EXT_MINCCA_PWR); if (nf & 0x100) @@ -291,12 +294,15 @@ ar9280GetNoiseFloor(struct ath_hal *ah, "NF calibrated [ext] [chain 0] is %d\n", nf); nfarray[3] = nf; - nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR9280_PHY_CH1_EXT_MINCCA_PWR); - if (nf & 0x100) + if (AR_SREV_KITE(ah)) { + nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), + AR9280_PHY_CH1_EXT_MINCCA_PWR); + if (nf & 0x100) nf = 0 - ((nf ^ 0x1ff) + 1); - HALDEBUG(ah, HAL_DEBUG_NFCAL, - "NF calibrated [ext] [chain 1] is %d\n", nf); - nfarray[4] = nf; + HALDEBUG(ah, HAL_DEBUG_NFCAL, + "NF calibrated [ext] [chain 1] is %d\n", nf); + nfarray[4] = nf; + } } /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9280.h Mon Feb 8 20:04:16 2010 (r203681) +++ head/sys/dev/ath/ath_hal/ar5416/ar9280.h Mon Feb 8 20:12:01 2010 (r203682) @@ -30,7 +30,9 @@ struct ath_hal_9280 { #define AH9280(_ah) ((struct ath_hal_9280 *)(_ah)) #define AR9280_DEFAULT_RXCHAINMASK 3 +#define AR9285_DEFAULT_RXCHAINMASK 1 #define AR9280_DEFAULT_TXCHAINMASK 1 +#define AR9285_DEFAULT_TXCHAINMASK 1 HAL_BOOL ar9280RfAttach(struct ath_hal *, HAL_STATUS *); Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Mon Feb 8 20:04:16 2010 (r203681) +++ head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Mon Feb 8 20:12:01 2010 (r203682) @@ -123,6 +123,10 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_writeIni = ar9280WriteIni; AH5416(ah)->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9280_DEFAULT_TXCHAINMASK; + if (AR_SREV_KITE(ah)) { + AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK; + AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK; + } if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { /* reset chip */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 20:23:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9157210656AA; Mon, 8 Feb 2010 20:23:20 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 808D18FC27; Mon, 8 Feb 2010 20:23:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18KNK9o047708; Mon, 8 Feb 2010 20:23:20 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18KNKTx047705; Mon, 8 Feb 2010 20:23:20 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002082023.o18KNKTx047705@svn.freebsd.org> From: Rui Paulo Date: Mon, 8 Feb 2010 20:23: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: r203683 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 20:23:20 -0000 Author: rpaulo Date: Mon Feb 8 20:23:20 2010 New Revision: 203683 URL: http://svn.freebsd.org/changeset/base/203683 Log: Add multicast key search support. This fixes corrupted mcast packets when we have more than one hostap vap. Submitted by: Russell Yount MFC after: 2 weeks Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Feb 8 20:12:01 2010 (r203682) +++ head/sys/dev/ath/if_ath.c Mon Feb 8 20:23:20 2010 (r203683) @@ -620,6 +620,13 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_wmetkipmic = 1; } sc->sc_hasclrkey = ath_hal_ciphersupported(ah, HAL_CIPHER_CLR); + /* + * Check for multicast key sarch support. + */ + if (ath_hal_hasmcastkeysearch(sc->sc_ah) && + !ath_hal_getmcastkeysearch(sc->sc_ah)) { + ath_hal_setmcastkeysearch(sc->sc_ah, 1); + } sc->sc_mcastkey = ath_hal_getmcastkeysearch(ah); /* * Mark key cache slots associated with global keys @@ -2038,7 +2045,7 @@ ath_keyset(struct ath_softc *sc, const s if ((k->wk_flags & IEEE80211_KEY_GROUP) && sc->sc_mcastkey) { /* * Group keys on hardware that supports multicast frame - * key search use a mac that is the sender's address with + * key search use a MAC that is the sender's address with * the high bit set instead of the app-specified address. */ IEEE80211_ADDR_COPY(gmac, bss->ni_macaddr); @@ -2218,8 +2225,10 @@ ath_key_alloc(struct ieee80211vap *vap, * it permits us to support multiple users for adhoc and/or * multi-station operation. */ - if (k->wk_keyix != IEEE80211_KEYIX_NONE || /* global key */ - ((k->wk_flags & IEEE80211_KEY_GROUP) && !sc->sc_mcastkey)) { + if (k->wk_keyix != IEEE80211_KEYIX_NONE) { + /* + * Only global keys should have key index assigned. + */ if (!(&vap->iv_nw_keys[0] <= k && k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) { /* should not happen */ @@ -2227,12 +2236,22 @@ ath_key_alloc(struct ieee80211vap *vap, "%s: bogus group key\n", __func__); return 0; } + */ + if (vap->iv_opmode != IEEE80211_M_HOSTAP || + !(k->wk_flags & IEEE80211_KEY_GROUP) || + !sc->sc_mcastkey) { + /* + * XXX we pre-allocate the global keys so + * have no way to check if they've already + * been allocated. + */ + *keyix = *rxkeyix = k - vap->iv_nw_keys; + return 1; + } /* - * XXX we pre-allocate the global keys so - * have no way to check if they've already been allocated. + * Group key and device supports multicast key search. */ - *keyix = *rxkeyix = k - vap->iv_nw_keys; - return 1; + k->wk_keyix = IEEE80211_KEYIX_NONE; } /* @@ -6944,6 +6963,8 @@ ath_announce(struct ath_softc *sc) if_printf(ifp, "using %u rx buffers\n", ath_rxbuf); if (ath_txbuf != ATH_TXBUF) if_printf(ifp, "using %u tx buffers\n", ath_txbuf); + if (sc->sc_mcastkey && bootverbose) + if_printf(ifp, "using multicast key search\n"); } #ifdef IEEE80211_SUPPORT_TDMA Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Feb 8 20:12:01 2010 (r203682) +++ head/sys/dev/ath/if_athvar.h Mon Feb 8 20:23:20 2010 (r203683) @@ -580,14 +580,12 @@ void ath_intr(void *); ath_hal_setcapability(_ah, HAL_CAP_TPC, 1, _v, NULL) #define ath_hal_hasbursting(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_BURST, 0, NULL) == HAL_OK) -#ifdef notyet +#define ath_hal_setmcastkeysearch(_ah, _v) \ + ath_hal_setcapability(_ah, HAL_CAP_MCAST_KEYSRCH, 0, _v, NULL) #define ath_hal_hasmcastkeysearch(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_MCAST_KEYSRCH, 0, NULL) == HAL_OK) #define ath_hal_getmcastkeysearch(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_MCAST_KEYSRCH, 1, NULL) == HAL_OK) -#else -#define ath_hal_getmcastkeysearch(_ah) 0 -#endif #define ath_hal_hasfastframes(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK) #define ath_hal_hasbssidmask(_ah) \ From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 20:53:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CD601065670; Mon, 8 Feb 2010 20:53:30 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C2AA8FC0A; Mon, 8 Feb 2010 20:53:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18KrUiN054418; Mon, 8 Feb 2010 20:53:30 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18KrUVI054416; Mon, 8 Feb 2010 20:53:30 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002082053.o18KrUVI054416@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 8 Feb 2010 20:53: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: r203684 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 20:53:30 -0000 Author: gavin Date: Mon Feb 8 20:53:29 2010 New Revision: 203684 URL: http://svn.freebsd.org/changeset/base/203684 Log: Update .Dt on these man pages: the kernel modules and corresponding man pages are installed on more platforms than just i386. Modified: head/share/man/man4/io.4 head/share/man/man4/linux.4 head/share/man/man4/ndis.4 head/share/man/man4/nvram.4 Modified: head/share/man/man4/io.4 ============================================================================== --- head/share/man/man4/io.4 Mon Feb 8 20:23:20 2010 (r203683) +++ head/share/man/man4/io.4 Mon Feb 8 20:53:29 2010 (r203684) @@ -27,8 +27,8 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2004 -.Dt IO 4 i386 +.Dd February 8, 2010 +.Dt IO 4 .Os .Sh NAME .Nm io Modified: head/share/man/man4/linux.4 ============================================================================== --- head/share/man/man4/linux.4 Mon Feb 8 20:23:20 2010 (r203683) +++ head/share/man/man4/linux.4 Mon Feb 8 20:53:29 2010 (r203684) @@ -24,8 +24,8 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2008 -.Dt LINUX 4 i386 +.Dd February 8, 2010 +.Dt LINUX 4 .Os .Sh NAME .Nm linux Modified: head/share/man/man4/ndis.4 ============================================================================== --- head/share/man/man4/ndis.4 Mon Feb 8 20:23:20 2010 (r203683) +++ head/share/man/man4/ndis.4 Mon Feb 8 20:53:29 2010 (r203684) @@ -30,8 +30,8 @@ .\" .\" $FreeBSD$ .\" -.Dd October 13, 2006 -.Dt NDIS 4 i386 +.Dd February 8, 2010 +.Dt NDIS 4 .Os .Sh NAME .Nm ndis Modified: head/share/man/man4/nvram.4 ============================================================================== --- head/share/man/man4/nvram.4 Mon Feb 8 20:23:20 2010 (r203683) +++ head/share/man/man4/nvram.4 Mon Feb 8 20:53:29 2010 (r203684) @@ -26,8 +26,8 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2010 -.Dt NVRAM 4 i386 +.Dd February 8, 2010 +.Dt NVRAM 4 .Os .Sh NAME .Nm nvram From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 20:57:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92CFD106568B; Mon, 8 Feb 2010 20:57:42 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 697DE8FC08; Mon, 8 Feb 2010 20:57:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18KvglS055442; Mon, 8 Feb 2010 20:57:42 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18Kvg9p055439; Mon, 8 Feb 2010 20:57:42 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002082057.o18Kvg9p055439@svn.freebsd.org> From: Bruce Cran Date: Mon, 8 Feb 2010 20:57: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: r203685 - in head/sys: conf dev/aic7xxx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 20:57:42 -0000 Author: brucec Date: Mon Feb 8 20:57:42 2010 New Revision: 203685 URL: http://svn.freebsd.org/changeset/base/203685 Log: Document the usfs driver and the NO_SYSCTL_DESCR option, and update the comment for umass. Don't include the sysctl description variables in aic7xxx when NO_SYSCTL_DESCR is used. Approved by: rrs (mentor) Modified: head/sys/conf/NOTES head/sys/dev/aic7xxx/aic79xx_osm.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Feb 8 20:53:29 2010 (r203684) +++ head/sys/conf/NOTES Mon Feb 8 20:57:42 2010 (r203685) @@ -386,6 +386,11 @@ options KDTRACE_HOOKS options SYSCTL_DEBUG # +# NO_SYSCTL_DESCR omits the sysctl node descriptions to save space in the +# resulting kernel. +options NO_SYSCTL_DESCR + +# # DEBUG_MEMGUARD builds and enables memguard(9), a replacement allocator # for the kernel used to detect modify-after-free scenarios. See the # memguard(9) man page for more information on usage. @@ -2596,8 +2601,10 @@ device uhid device ukbd # USB printer device ulpt -# USB Iomega Zip 100 Drive (Requires scbus and da) +# USB mass storage driver (Requires scbus and da) device umass +# USB mass storage driver for device-side mode +device usfs # USB support for Belkin F5U109 and Magic Control Technology serial adapters device umct # USB modem support Modified: head/sys/dev/aic7xxx/aic79xx_osm.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx_osm.c Mon Feb 8 20:53:29 2010 (r203684) +++ head/sys/dev/aic7xxx/aic79xx_osm.c Mon Feb 8 20:57:42 2010 (r203685) @@ -83,11 +83,13 @@ static const char *ahd_sysctl_node_eleme "debug" }; +#ifndef NO_SYSCTL_DESCR static const char *ahd_sysctl_node_descriptions[] = { "root error collection for aic79xx controllers", "summary collection for aic79xx controllers", "debug collection for aic79xx controllers" }; +#endif static const char *ahd_sysctl_errors_elements[] = { "Cerrors", @@ -95,11 +97,13 @@ static const char *ahd_sysctl_errors_ele "Ferrors" }; +#ifndef NO_SYSCTL_DESCR static const char *ahd_sysctl_errors_descriptions[] = { "Correctable errors", "Uncorrectable errors", "Fatal errors" }; +#endif static int ahd_set_debugcounters(SYSCTL_HANDLER_ARGS) From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 20:57:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 863DB106577B; Mon, 8 Feb 2010 20:57:50 +0000 (UTC) (envelope-from mbr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 025D08FC13; Mon, 8 Feb 2010 20:57:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18KvnSM055523; Mon, 8 Feb 2010 20:57:49 GMT (envelope-from mbr@svn.freebsd.org) Received: (from mbr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18KvnI6055520; Mon, 8 Feb 2010 20:57:49 GMT (envelope-from mbr@svn.freebsd.org) Message-Id: <201002082057.o18KvnI6055520@svn.freebsd.org> From: Martin Blapp Date: Mon, 8 Feb 2010 20:57: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: r203686 - head/usr.sbin/wake X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 20:57:50 -0000 Author: mbr Date: Mon Feb 8 20:57:49 2010 New Revision: 203686 URL: http://svn.freebsd.org/changeset/base/203686 Log: If there is only one NIC in the system that is up and running, the interface specifier on the command line can be ommited. Besides of this, the bpf is being reused for each machine that has to be woken up. Submitted by: Marc Balmer Modified: head/usr.sbin/wake/wake.8 head/usr.sbin/wake/wake.c Modified: head/usr.sbin/wake/wake.8 ============================================================================== --- head/usr.sbin/wake/wake.8 Mon Feb 8 20:57:42 2010 (r203685) +++ head/usr.sbin/wake/wake.8 Mon Feb 8 20:57:49 2010 (r203686) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.\" Copyright (c) 2009 Marc Balmer +.\" Copyright (c) 2009, 2010 Marc Balmer .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -23,7 +23,7 @@ .Nd send Wake on LAN frames to hosts on a local Ethernet network .Sh SYNOPSIS .Nm -.Ar interface +.Op Ar interface .Ar lladdr .Op Ar lladdr ... .Sh DESCRIPTION @@ -37,21 +37,27 @@ and can be used to power on machines fro having physical access to them. .Pp .Ar interface -is a network interface of the local machine. +is an Ethernet interface of the local machine and is used to send the +Wake on LAN frames over it. +If there is only one Ethernet device available that is up and running, then the +.Ar interface +argument can be omitted. .Ar lladdr -are the link layer addresses of the remote machines -and can be specified as the actual hardware address +is the link layer address of the remote machine. +This can be specified as the actual hardware address (six hexadecimal numbers separated by colons) -or a hostname entry in +or as a hostname entry in .Pa /etc/ethers . -Link layer addresses can be determined and set on -.Fx -machines using +.Nm +accepts multiple +.Ar lladdr +addresses. +Link layer addresses can be determined and set using .Xr ifconfig 8 . .Sh FILES .Bl -tag -width "/etc/ethers" -compact .It /etc/ethers -Ethernet host name database. +Ethernet host name data base. .El .Sh SEE ALSO .Xr ethers 5 , Modified: head/usr.sbin/wake/wake.c ============================================================================== --- head/usr.sbin/wake/wake.c Mon Feb 8 20:57:42 2010 (r203685) +++ head/usr.sbin/wake/wake.c Mon Feb 8 20:57:49 2010 (r203686) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008, 2009 Marc Balmer + * Copyright (C) 2006, 2007, 2008, 2009, 2010 Marc Balmer * Copyright (C) 2000 Eugene M. Kim. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,11 +32,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include +#include #include #include #include @@ -53,38 +56,29 @@ __FBSDID("$FreeBSD$"); #endif static int bind_if_to_bpf(char const *ifname, int bpf); +static int find_ether(char *dst, size_t len); static int get_ether(char const *text, struct ether_addr *addr); static int send_wakeup(int bpf, struct ether_addr const *addr); static void usage(void); -static int wake(const char *iface, const char *host); +static int wake(int bpf, const char *host); static void usage(void) { - (void)fprintf(stderr, "usage: wake interface lladdr [lladdr ...]\n"); + (void)fprintf(stderr, "usage: wake [interface] lladdr [lladdr ...]\n"); exit(1); } static int -wake(const char *iface, const char *host) +wake(int bpf, const char *host) { struct ether_addr macaddr; - int bpf, res; - bpf = open(_PATH_BPF, O_RDWR); - if (bpf == -1) { - warn("no bpf"); + if (get_ether(host, &macaddr) == -1) return (-1); - } - if (bind_if_to_bpf(iface, bpf) == -1 || - get_ether(host, &macaddr) == -1) { - (void)close(bpf); - return (-1); - } - res = send_wakeup(bpf, &macaddr); - (void)close(bpf); - return (res); + + return send_wakeup(bpf, &macaddr); } static int @@ -94,26 +88,50 @@ bind_if_to_bpf(char const *ifname, int b u_int dlt; if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= - sizeof(ifr.ifr_name)) { - warnx("interface name too long: %s", ifname); + sizeof(ifr.ifr_name)) return (-1); - } - if (ioctl(bpf, BIOCSETIF, &ifr) == -1) { - warn("ioctl(%s)", "BIOCSETIF"); + + if (ioctl(bpf, BIOCSETIF, &ifr) == -1) return (-1); - } - if (ioctl(bpf, BIOCGDLT, &dlt) == -1) { - warn("ioctl(%s)", "BIOCGDLT"); + + if (ioctl(bpf, BIOCGDLT, &dlt) == -1) return (-1); - } - if (dlt != DLT_EN10MB) { - warnx("incompatible media"); + + if (dlt != DLT_EN10MB) return (-1); - } + return (0); } static int +find_ether(char *dst, size_t len) +{ + struct ifaddrs *ifap, *ifa; + struct sockaddr_dl *sdl = NULL; + int nifs; + + if (dst == NULL || len == 0) + return 0; + + if (getifaddrs(&ifap) != 0) + return -1; + + /* XXX also check the link state */ + for (nifs = 0, ifa = ifap; ifa; ifa = ifa->ifa_next) + if (ifa->ifa_addr->sa_family == AF_LINK && + ifa->ifa_flags & IFF_UP && ifa->ifa_flags & IFF_RUNNING) { + sdl = (struct sockaddr_dl *)ifa->ifa_addr; + if (sdl->sdl_type == IFT_ETHER) { + strlcpy(dst, ifa->ifa_name, len); + nifs++; + } + } + + freeifaddrs(ifap); + return nifs == 1 ? 0 : -1; +} + +static int get_ether(char const *text, struct ether_addr *addr) { struct ether_addr *paddr; @@ -165,14 +183,31 @@ send_wakeup(int bpf, struct ether_addr c int main(int argc, char *argv[]) { - int n; + int bpf, n; + char ifname[IF_NAMESIZE]; + + if (argc < 2) + usage(); + + if ((bpf = open(_PATH_BPF, O_RDWR)) == -1) + err(1, "Cannot open bpf interface"); + + n = 2; + if (bind_if_to_bpf(argv[1], bpf) == -1) { + if (find_ether(ifname, sizeof(ifname))) + err(1, "Failed to determine ethernet interface"); + if (bind_if_to_bpf(ifname, bpf) == -1) + err(1, "Cannot bind to interface `%s'", ifname); + --n; + } else + strlcpy(ifname, argv[1], sizeof(ifname)); - if (argc < 3) + if (n >= argc) usage(); + for (; n < argc; n++) + if (wake(bpf, argv[n])) + warn("Cannot send Wake on LAN frame over `%s' to `%s'", + ifname, argv[n]); - for (n = 2; n < argc; n++) - if (wake(argv[1], argv[n])) - warnx("error sending Wake on LAN frame over %s to %s", - argv[1], argv[n]); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 21:01:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95A66106566B; Mon, 8 Feb 2010 21:01:41 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 852B98FC12; Mon, 8 Feb 2010 21:01:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18L1fiN056412; Mon, 8 Feb 2010 21:01:41 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18L1fYW056403; Mon, 8 Feb 2010 21:01:41 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002082101.o18L1fYW056403@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 8 Feb 2010 21:01: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: r203687 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 21:01:41 -0000 Author: gavin Date: Mon Feb 8 21:01:41 2010 New Revision: 203687 URL: http://svn.freebsd.org/changeset/base/203687 Log: Update .Dt to reflect the fact that these drivers and man pages are installed on more than just i386. Modified: head/share/man/man4/acpi_asus.4 head/share/man/man4/acpi_fujitsu.4 head/share/man/man4/acpi_hp.4 head/share/man/man4/acpi_ibm.4 head/share/man/man4/acpi_panasonic.4 head/share/man/man4/acpi_sony.4 head/share/man/man4/acpi_toshiba.4 head/share/man/man4/acpi_wmi.4 Modified: head/share/man/man4/acpi_asus.4 ============================================================================== --- head/share/man/man4/acpi_asus.4 Mon Feb 8 20:57:49 2010 (r203686) +++ head/share/man/man4/acpi_asus.4 Mon Feb 8 21:01:41 2010 (r203687) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .\" -.Dd December 17, 2008 -.Dt ACPI_ASUS 4 i386 +.Dd February 8, 2010 +.Dt ACPI_ASUS 4 .Os .Sh NAME .Nm acpi_asus Modified: head/share/man/man4/acpi_fujitsu.4 ============================================================================== --- head/share/man/man4/acpi_fujitsu.4 Mon Feb 8 20:57:49 2010 (r203686) +++ head/share/man/man4/acpi_fujitsu.4 Mon Feb 8 21:01:41 2010 (r203687) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2005 -.Dt ACPI_FUJITSU 4 i386 +.Dd February 8, 2010 +.Dt ACPI_FUJITSU 4 .Os .Sh NAME .Nm acpi_fujitsu Modified: head/share/man/man4/acpi_hp.4 ============================================================================== --- head/share/man/man4/acpi_hp.4 Mon Feb 8 20:57:49 2010 (r203686) +++ head/share/man/man4/acpi_hp.4 Mon Feb 8 21:01:41 2010 (r203687) @@ -24,8 +24,8 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 2009 -.Dt ACPI_HP 4 i386 +.Dd February 8, 2010 +.Dt ACPI_HP 4 .Os .Sh NAME .Nm acpi_hp Modified: head/share/man/man4/acpi_ibm.4 ============================================================================== --- head/share/man/man4/acpi_ibm.4 Mon Feb 8 20:57:49 2010 (r203686) +++ head/share/man/man4/acpi_ibm.4 Mon Feb 8 21:01:41 2010 (r203687) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2006 -.Dt ACPI_IBM 4 i386 +.Dd February 8, 2010 +.Dt ACPI_IBM 4 .Os .Sh NAME .Nm acpi_ibm Modified: head/share/man/man4/acpi_panasonic.4 ============================================================================== --- head/share/man/man4/acpi_panasonic.4 Mon Feb 8 20:57:49 2010 (r203686) +++ head/share/man/man4/acpi_panasonic.4 Mon Feb 8 21:01:41 2010 (r203687) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2009 -.Dt ACPI_PANASONIC 4 i386 +.Dd February 8, 2010 +.Dt ACPI_PANASONIC 4 .Os .Sh NAME .Nm acpi_panasonic Modified: head/share/man/man4/acpi_sony.4 ============================================================================== --- head/share/man/man4/acpi_sony.4 Mon Feb 8 20:57:49 2010 (r203686) +++ head/share/man/man4/acpi_sony.4 Mon Feb 8 21:01:41 2010 (r203687) @@ -24,8 +24,8 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2010 -.Dt ACPI_SONY 4 i386 +.Dd February 8, 2010 +.Dt ACPI_SONY 4 .Os .Sh NAME .Nm acpi_sony Modified: head/share/man/man4/acpi_toshiba.4 ============================================================================== --- head/share/man/man4/acpi_toshiba.4 Mon Feb 8 20:57:49 2010 (r203686) +++ head/share/man/man4/acpi_toshiba.4 Mon Feb 8 21:01:41 2010 (r203687) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2004 -.Dt ACPI_TOSHIBA 4 i386 +.Dd February 8, 2010 +.Dt ACPI_TOSHIBA 4 .Os .Sh NAME .Nm acpi_toshiba Modified: head/share/man/man4/acpi_wmi.4 ============================================================================== --- head/share/man/man4/acpi_wmi.4 Mon Feb 8 20:57:49 2010 (r203686) +++ head/share/man/man4/acpi_wmi.4 Mon Feb 8 21:01:41 2010 (r203687) @@ -24,8 +24,8 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 2009 -.Dt ACPI_WMI 4 i386 +.Dd February 8, 2010 +.Dt ACPI_WMI 4 .Os .Sh NAME .Nm acpi_wmi From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 21:23:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA4CC106566C; Mon, 8 Feb 2010 21:23:48 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9C4C8FC08; Mon, 8 Feb 2010 21:23:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18LNm1T061300; Mon, 8 Feb 2010 21:23:48 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18LNmeQ061296; Mon, 8 Feb 2010 21:23:48 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002082123.o18LNmeQ061296@svn.freebsd.org> From: Bruce Cran Date: Mon, 8 Feb 2010 21:23: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: r203688 - in head: bin/pkill bin/ps usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 21:23:49 -0000 Author: brucec Date: Mon Feb 8 21:23:48 2010 New Revision: 203688 URL: http://svn.freebsd.org/changeset/base/203688 Log: Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows the -M option to be used without specifying -N. PR: bin/138146 Approved by: rrs (mentor) MFC after: 3 days Modified: head/bin/pkill/pkill.c head/bin/ps/ps.c head/usr.bin/w/w.c Modified: head/bin/pkill/pkill.c ============================================================================== --- head/bin/pkill/pkill.c Mon Feb 8 21:01:41 2010 (r203687) +++ head/bin/pkill/pkill.c Mon Feb 8 21:23:48 2010 (r203688) @@ -180,7 +180,8 @@ main(int argc, char **argv) debug_opt = 0; pidfile = NULL; pidfilelock = 0; - execf = coref = _PATH_DEVNULL; + execf = NULL; + coref = _PATH_DEVNULL; while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1) switch (ch) { Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Mon Feb 8 21:01:41 2010 (r203687) +++ head/bin/ps/ps.c Mon Feb 8 21:23:48 2010 (r203688) @@ -212,7 +212,8 @@ main(int argc, char *argv[]) init_list(&sesslist, addelem_pid, sizeof(pid_t), "session id"); init_list(&ttylist, addelem_tty, sizeof(dev_t), "tty"); init_list(&uidlist, addelem_uid, sizeof(uid_t), "user"); - memf = nlistf = _PATH_DEVNULL; + memf = _PATH_DEVNULL; + nlistf = NULL; while ((ch = getopt(argc, argv, PS_ARGS)) != -1) switch (ch) { case 'A': Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Mon Feb 8 21:01:41 2010 (r203687) +++ head/usr.bin/w/w.c Mon Feb 8 21:23:48 2010 (r203688) @@ -158,7 +158,8 @@ main(int argc, char *argv[]) } dropgid = 0; - memf = nlistf = _PATH_DEVNULL; + memf = _PATH_DEVNULL; + nlistf = NULL; while ((ch = getopt(argc, argv, p)) != -1) switch (ch) { case 'd': From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 21:24:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAAC1106568F; Mon, 8 Feb 2010 21:24:12 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA5E38FC25; Mon, 8 Feb 2010 21:24:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18LOCrm061437; Mon, 8 Feb 2010 21:24:12 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18LOC9j061433; Mon, 8 Feb 2010 21:24:12 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002082124.o18LOC9j061433@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 8 Feb 2010 21:24: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: r203689 - in head/share/man/man4: . man4.i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 21:24:12 -0000 Author: gavin Date: Mon Feb 8 21:24:12 2010 New Revision: 203689 URL: http://svn.freebsd.org/changeset/base/203689 Log: Install the padlock(4) man page on amd64 as well as i386, to match the platforms where the driver itself is compiled and installed. PR: docs/130895 Reported by: George Hartzell MFC after: 1 week Added: head/share/man/man4/padlock.4 - copied, changed from r203610, head/share/man/man4/man4.i386/padlock.4 Deleted: head/share/man/man4/man4.i386/padlock.4 Modified: head/share/man/man4/Makefile head/share/man/man4/man4.i386/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Feb 8 21:23:48 2010 (r203688) +++ head/share/man/man4/Makefile Mon Feb 8 21:24:12 2010 (r203689) @@ -297,6 +297,7 @@ MAN= aac.4 \ ${_nxge.4} \ ohci.4 \ orm.4 \ + ${_padlock.4} \ pass.4 \ patm.4 \ pccard.4 \ @@ -649,6 +650,7 @@ _nfsmb.4= nfsmb.4 _nve.4= nve.4 _nvram.4= nvram.4 _nxge.4= nxge.4 +_padlock.4= padlock.4 _rr232x.4= rr232x.4 _speaker.4= speaker.4 _spkr.4= spkr.4 Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Mon Feb 8 21:23:48 2010 (r203688) +++ head/share/man/man4/man4.i386/Makefile Mon Feb 8 21:24:12 2010 (r203689) @@ -20,7 +20,6 @@ MAN= aic.4 \ mcd.4 \ mse.4 \ npx.4 \ - padlock.4 \ pae.4 \ pbio.4 \ pcf.4 \ Copied and modified: head/share/man/man4/padlock.4 (from r203610, head/share/man/man4/man4.i386/padlock.4) ============================================================================== --- head/share/man/man4/man4.i386/padlock.4 Sun Feb 7 13:59:03 2010 (r203610, copy source) +++ head/share/man/man4/padlock.4 Mon Feb 8 21:24:12 2010 (r203689) @@ -24,8 +24,8 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2007 -.Dt PADLOCK 4 i386 +.Dd February 8, 2010 +.Dt PADLOCK 4 .Os .Sh NAME .Nm padlock From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 21:29:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92D881065670; Mon, 8 Feb 2010 21:29:34 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82B2A8FC13; Mon, 8 Feb 2010 21:29:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18LTYBR062658; Mon, 8 Feb 2010 21:29:34 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18LTYrE062656; Mon, 8 Feb 2010 21:29:34 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002082129.o18LTYrE062656@svn.freebsd.org> From: Bruce Cran Date: Mon, 8 Feb 2010 21:29: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: r203690 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 21:29:34 -0000 Author: brucec Date: Mon Feb 8 21:29:34 2010 New Revision: 203690 URL: http://svn.freebsd.org/changeset/base/203690 Log: Xorg isn't treated as a distribution, so /usr/X11R6/lib shouldn't be configured when running ldconfig. PR: bin/138945 Approved by: rrs (mentor) MFC after: 3 days Modified: head/usr.sbin/sysinstall/package.c Modified: head/usr.sbin/sysinstall/package.c ============================================================================== --- head/usr.sbin/sysinstall/package.c Mon Feb 8 21:24:12 2010 (r203689) +++ head/usr.sbin/sysinstall/package.c Mon Feb 8 21:29:34 2010 (r203690) @@ -139,7 +139,7 @@ package_extract(Device *dev, char *name, /* If necessary, initialize the ldconfig hints */ if (!file_readable("/var/run/ld-elf.so.hints")) - vsystem("ldconfig /usr/lib /usr/lib/compat /usr/local/lib /usr/X11R6/lib"); + vsystem("ldconfig /usr/lib /usr/lib/compat /usr/local/lib"); /* Be initially optimistic */ ret = DITEM_SUCCESS; From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 21:38:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55B301065679; Mon, 8 Feb 2010 21:38:43 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 427F78FC18; Mon, 8 Feb 2010 21:38:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18LchvL064691; Mon, 8 Feb 2010 21:38:43 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18LchGZ064686; Mon, 8 Feb 2010 21:38:43 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002082138.o18LchGZ064686@svn.freebsd.org> From: Bruce Cran Date: Mon, 8 Feb 2010 21:38: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: r203691 - in head: share/man/man4 sys/amd64/conf sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 21:38:43 -0000 Author: brucec Date: Mon Feb 8 21:38:42 2010 New Revision: 203691 URL: http://svn.freebsd.org/changeset/base/203691 Log: Update documentation for the iwn and iwnfw drivers: they support the 1000, 5150, 6000 and 6050 devices too, with firmware modules for the 4965, 1000, 5000, 5150 and 6000. Add documentation for mwl and all the wireless firmware drivers. Approved by: rrs (mentor) Modified: head/share/man/man4/iwn.4 head/share/man/man4/iwnfw.4 head/sys/amd64/conf/NOTES head/sys/i386/conf/NOTES Modified: head/share/man/man4/iwn.4 ============================================================================== --- head/share/man/man4/iwn.4 Mon Feb 8 21:29:34 2010 (r203690) +++ head/share/man/man4/iwn.4 Mon Feb 8 21:38:42 2010 (r203691) @@ -25,12 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2009 +.Dd February 8, 2010 .Os .Dt IWN 4 .Sh NAME .Nm iwn -.Nd "Intel Wireless WiFi Link 4965/5000 IEEE 802.11n driver" +.Nd Intel Wireless WiFi Link 4965/1000/5000/5150/5300/6000/6050 +IEEE 802.11n driver .Sh SYNOPSIS To compile this driver into the kernel, include the following lines in your @@ -46,8 +47,10 @@ You also need to select a firmware for y Choose one from: .Bd -ragged -offset indent .Cd "device iwn4965fw" +.Cd "device iwn1000fw" .Cd "device iwn5000fw" -.Cd "device iwn5100fw" +.Cd "device iwn5150fw" +.Cd "device iwn6000fw" .Ed .Pp Or you can use @@ -63,15 +66,18 @@ module at boot time, place the following .Bd -literal -offset indent if_iwn_load="YES" iwn4965fw_load="YES" +iwn1000fw_load="YES" iwn5000fw_load="YES" -iwn5100fw_load="YES" +iwn5150fw_load="YES" +iwn6000fw_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for .Tn Intel -Wireless WiFi Link 4965 and 5000 series of PCI-Express network adapters. +Wireless WiFi Link 4965, 1000, 5000 and 6000 series of +PCI-Express network adapters. .Nm supports .Cm station , Modified: head/share/man/man4/iwnfw.4 ============================================================================== --- head/share/man/man4/iwnfw.4 Mon Feb 8 21:29:34 2010 (r203690) +++ head/share/man/man4/iwnfw.4 Mon Feb 8 21:38:42 2010 (r203691) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2009 +.Dd February 7, 2010 .Dt IWNFW 4 .Os .Sh NAME @@ -41,8 +41,10 @@ If you want to pick only the firmware im of the following: .Bd -ragged -offset indent .Cd "device iwn4965fw" +.Cd "device iwn1000fw" .Cd "device iwn5000fw" -.Cd "device iwn5100fw" +.Cd "device iwn5150fw" +.Cd "device iwn6000fw" .Ed .Pp Alternatively, to load the driver as a @@ -50,12 +52,15 @@ module at boot time, place the following .Xr loader.conf 5 : .Bd -literal -offset indent iwn4965fw_load="YES" +iwn1000fw_load="YES" iwn5000fw_load="YES" -iwn5100fw_load="YES" +iwn5150fw_load="YES" +iwn6000fw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the -Intel Wireless WiFi Link 4965 and 5000 series of IEEE 802.11n adapters. +Intel Wireless WiFi Link 4965, 1000, 5000 and 6000 series of +IEEE 802.11n adapters. It may be statically linked into the kernel, or loaded as a module. .Sh SEE ALSO Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Feb 8 21:29:34 2010 (r203690) +++ head/sys/amd64/conf/NOTES Mon Feb 8 21:38:42 2010 (r203691) @@ -274,23 +274,69 @@ options DRM_DEBUG # Include debug print # HP PC Lan+, various PC Card devices # (requires miibus) # ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter +# Requires the ipw firmware module # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters -# iwn: Intel Wireless WiFi Link 4965AGN 802.11 network adapters +# Requires the iwi firmware module +# iwn: Intel Wireless WiFi Link 4965/1000/5000/6000 802.11 network adapters +# Requires the iwn firmware module +# mwl: Marvell 88W8363 IEEE 802.11 adapter +# Requires the mwl firmware module # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking # wpi: Intel 3945ABG Wireless LAN controller +# Requires the wpi firmware module device ed options ED_3C503 options ED_HPP options ED_SIC +device ipw device iwi device iwn -device ipw +device mwl device nfe device nve device wpi +# IEEE 802.11 adapter firmware modules + +# Intel PRO/Wireless 2100 firmware: +# ipwfw: BSS/IBSS/monitor mode firmware +# ipwbssfw: BSS mode firmware +# ipwibssfw: IBSS mode firmware +# ipwmonitorfw: Monitor mode firmware +# Intel PRO/Wireless 2200BG/2225BG/2915ABG firmware: +# iwifw: BSS/IBSS/monitor mode firmware +# iwibssfw: BSS mode firmware +# iwiibssfw: IBSS mode firmware +# iwimonitorfw: Monitor mode firmware +# Intel Wireless WiFi Link 4965/1000/5000/6000 series firmware: +# iwnfw: Single module to support the 4965/1000/5000/5150/6000 +# iwn4965fw: Specific module for the 4965 only +# iwn1000fw: Specific module for the 1000 only +# iwn5000fw: Specific module for the 5000 only +# iwn5150fw: Specific module for the 5150 only +# iwn6000fw: Specific module for the 6000 only +# mwlfw: Marvell 88W8363 firmware +# wpifw: Intel 3945ABG Wireless LAN Controller firmware + +device iwifw +device iwibssfw +device iwiibssfw +device iwimonitorfw +device ipwfw +device ipwbssfw +device ipwibssfw +device ipwmonitorfw +device iwnfw +device iwn4965fw +device iwn1000fw +device iwn5000fw +device iwn5150fw +device iwn6000fw +device mwlfw +device wpifw + # #XXX this stores pointers in a 32bit field that is defined by the hardware #device pst Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Feb 8 21:29:34 2010 (r203690) +++ head/sys/i386/conf/NOTES Mon Feb 8 21:38:42 2010 (r203691) @@ -552,12 +552,17 @@ hint.mse.0.irq="5" # Intel EtherExpress # ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters +# Requires the iwi firmware module # iwn: Intel Wireless WiFi Link 4965AGN 802.11 network adapters +# Requires the iwn firmware module +# mwl: Marvell 88W8363 IEEE 802.11 adapter +# Requires the mwl firmware module # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking # sbni: Granch SBNI12-xx ISA and PCI adapters # wl: Lucent Wavelan (ISA card only). # wpi: Intel 3945ABG Wireless LAN controller +# Requires the wpi firmware module # Order for ISA/EISA devices is important here @@ -585,14 +590,15 @@ hint.ie.2.at="isa" hint.ie.2.port="0x300" hint.ie.2.irq="5" hint.ie.2.maddr="0xd0000" +device ipw device iwi device iwn -device ipw # Hint for the i386-only ISA front-end of le(4). hint.le.0.at="isa" hint.le.0.port="0x280" hint.le.0.irq="10" hint.le.0.drq="0" +device mwl device nfe # nVidia nForce MCP on-board Ethernet Networking device nve # nVidia nForce MCP on-board Ethernet Networking device sbni @@ -607,6 +613,45 @@ options WLCACHE # enables the signal-s options WLDEBUG # enables verbose debugging output device wpi +# IEEE 802.11 adapter firmware modules + +# Intel PRO/Wireless 2100 firmware: +# ipwfw: BSS/IBSS/monitor mode firmware +# ipwbssfw: BSS mode firmware +# ipwibssfw: IBSS mode firmware +# ipwmonitorfw: Monitor mode firmware +# Intel PRO/Wireless 2200BG/2225BG/2915ABG firmware: +# iwifw: BSS/IBSS/monitor mode firmware +# iwibssfw: BSS mode firmware +# iwiibssfw: IBSS mode firmware +# iwimonitorfw: Monitor mode firmware +# Intel Wireless WiFi Link 4965/1000/5000/6000 series firmware: +# iwnfw: Single module to support the 4965/1000/5000/5150/6000 +# iwn4965fw: Specific module for the 4965 only +# iwn1000fw: Specific module for the 1000 only +# iwn5000fw: Specific module for the 5000 only +# iwn5150fw: Specific module for the 5150 only +# iwn6000fw: Specific module for the 6000 only +# mwlfw: Marvell 88W8363 firmware +# wpifw: Intel 3945ABG Wireless LAN Controller firmware + +device iwifw +device iwibssfw +device iwiibssfw +device iwimonitorfw +device ipwfw +device ipwbssfw +device ipwibssfw +device ipwmonitorfw +device iwnfw +device iwn4965fw +device iwn1000fw +device iwn5000fw +device iwn5150fw +device iwn6000fw +device mwlfw +device wpifw + # # ATA raid adapters # From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 23:30:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7C53106566C; Mon, 8 Feb 2010 23:30:28 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B69848FC19; Mon, 8 Feb 2010 23:30:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18NUSDJ089364; Mon, 8 Feb 2010 23:30:28 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18NUS1B089355; Mon, 8 Feb 2010 23:30:28 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002082330.o18NUS1B089355@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 8 Feb 2010 23:30: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: r203692 - in head/share/man/man4: . man4.i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 23:30:29 -0000 Author: gavin Date: Mon Feb 8 23:30:28 2010 New Revision: 203692 URL: http://svn.freebsd.org/changeset/base/203692 Log: Kernel modules for these drivers are installed on all platforms, so install the man pages on all platforms too. Added: head/share/man/man4/alpm.4 - copied, changed from r203690, head/share/man/man4/man4.i386/alpm.4 head/share/man/man4/amdpm.4 - copied, changed from r203690, head/share/man/man4/man4.i386/amdpm.4 head/share/man/man4/mcd.4 - copied, changed from r203690, head/share/man/man4/man4.i386/mcd.4 head/share/man/man4/pcf.4 - copied, changed from r203690, head/share/man/man4/man4.i386/pcf.4 head/share/man/man4/scd.4 - copied, changed from r203690, head/share/man/man4/man4.i386/scd.4 head/share/man/man4/viapm.4 - copied, changed from r203690, head/share/man/man4/man4.i386/viapm.4 Deleted: head/share/man/man4/man4.i386/alpm.4 head/share/man/man4/man4.i386/amdpm.4 head/share/man/man4/man4.i386/mcd.4 head/share/man/man4/man4.i386/pcf.4 head/share/man/man4/man4.i386/scd.4 head/share/man/man4/man4.i386/viapm.4 Modified: head/share/man/man4/Makefile head/share/man/man4/man4.i386/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Feb 8 21:38:42 2010 (r203691) +++ head/share/man/man4/Makefile Mon Feb 8 23:30:28 2010 (r203692) @@ -29,8 +29,10 @@ MAN= aac.4 \ aio.4 \ alc.4 \ ale.4 \ + alpm.4 \ altq.4 \ amd.4 \ + amdpm.4 \ ${_amdsbwd.4} \ ${_amdsmb.4} \ ${_amdtemp.4} \ @@ -199,6 +201,7 @@ MAN= aac.4 \ mac_stub.4 \ mac_test.4 \ malo.4 \ + mcd.4 \ md.4 \ mem.4 \ meteor.4 \ @@ -302,6 +305,7 @@ MAN= aac.4 \ patm.4 \ pccard.4 \ pccbb.4 \ + pcf.4 \ pci.4 \ pcib.4 \ pcic.4 \ @@ -335,6 +339,7 @@ MAN= aac.4 \ sbp.4 \ sbp_targ.4 \ scc.4 \ + scd.4 \ sched_4bsd.4 \ sched_ule.4 \ screen.4 \ @@ -454,6 +459,7 @@ MAN= aac.4 \ uvscom.4 \ vga.4 \ vge.4 \ + viapm.4 \ vinum.4 \ vkbd.4 \ vlan.4 \ Copied and modified: head/share/man/man4/alpm.4 (from r203690, head/share/man/man4/man4.i386/alpm.4) ============================================================================== --- head/share/man/man4/man4.i386/alpm.4 Mon Feb 8 21:29:34 2010 (r203690, copy source) +++ head/share/man/man4/alpm.4 Mon Feb 8 23:30:28 2010 (r203692) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd February 13, 1999 -.Dt ALPM 4 i386 +.Dt ALPM 4 .Os .Sh NAME .Nm alpm Copied and modified: head/share/man/man4/amdpm.4 (from r203690, head/share/man/man4/man4.i386/amdpm.4) ============================================================================== --- head/share/man/man4/man4.i386/amdpm.4 Mon Feb 8 21:29:34 2010 (r203690, copy source) +++ head/share/man/man4/amdpm.4 Mon Feb 8 23:30:28 2010 (r203692) @@ -26,7 +26,7 @@ .\" $FreeBSD$ .\" .Dd December 31, 2005 -.Dt AMDPM 4 i386 +.Dt AMDPM 4 .Os .Sh NAME .Nm amdpm Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Mon Feb 8 21:38:42 2010 (r203691) +++ head/share/man/man4/man4.i386/Makefile Mon Feb 8 23:30:28 2010 (r203692) @@ -1,8 +1,6 @@ # $FreeBSD$ MAN= aic.4 \ - alpm.4 \ - amdpm.4 \ apm.4 \ ce.4 \ cp.4 \ @@ -17,22 +15,18 @@ MAN= aic.4 \ glxsb.4 \ ie.4 \ longrun.4 \ - mcd.4 \ mse.4 \ npx.4 \ pae.4 \ pbio.4 \ - pcf.4 \ perfmon.4 \ pnp.4 \ pnpbios.4 \ sbni.4 \ - scd.4 \ smapi.4 \ snc.4 \ streams.4 \ svr4.4 \ - viapm.4 \ vpd.4 \ vx.4 \ wl.4 Copied and modified: head/share/man/man4/mcd.4 (from r203690, head/share/man/man4/man4.i386/mcd.4) ============================================================================== --- head/share/man/man4/man4.i386/mcd.4 Mon Feb 8 21:29:34 2010 (r203690, copy source) +++ head/share/man/man4/mcd.4 Mon Feb 8 23:30:28 2010 (r203692) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .Dd December 8, 1994 -.Dt MCD 4 i386 +.Dt MCD 4 .Os .Sh NAME .Nm mcd Copied and modified: head/share/man/man4/pcf.4 (from r203690, head/share/man/man4/man4.i386/pcf.4) ============================================================================== --- head/share/man/man4/man4.i386/pcf.4 Mon Feb 8 21:29:34 2010 (r203690, copy source) +++ head/share/man/man4/pcf.4 Mon Feb 8 23:30:28 2010 (r203692) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd August 6, 1998 -.Dt PCF 4 i386 +.Dt PCF 4 .Os .Sh NAME .Nm pcf Copied and modified: head/share/man/man4/scd.4 (from r203690, head/share/man/man4/man4.i386/scd.4) ============================================================================== --- head/share/man/man4/man4.i386/scd.4 Mon Feb 8 21:29:34 2010 (r203690, copy source) +++ head/share/man/man4/scd.4 Mon Feb 8 23:30:28 2010 (r203692) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .Dd March 17, 2008 -.Dt SCD 4 i386 +.Dt SCD 4 .Os .Sh NAME .Nm scd Copied and modified: head/share/man/man4/viapm.4 (from r203690, head/share/man/man4/man4.i386/viapm.4) ============================================================================== --- head/share/man/man4/man4.i386/viapm.4 Mon Feb 8 21:29:34 2010 (r203690, copy source) +++ head/share/man/man4/viapm.4 Mon Feb 8 23:30:28 2010 (r203692) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd April 20, 2002 -.Dt VIAPM 4 i386 +.Dt VIAPM 4 .Os .Sh NAME .Nm viapm From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 00:25:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E95F31065672 for ; Tue, 9 Feb 2010 00:25:48 +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 8AA268FC17 for ; Tue, 9 Feb 2010 00:25:48 +0000 (UTC) Received: (qmail 2858 invoked by uid 399); 9 Feb 2010 00:25:47 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 9 Feb 2010 00:25:47 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B70AB9B.7050205@FreeBSD.org> Date: Mon, 08 Feb 2010 16:26:03 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.7) Gecko/20100123 Thunderbird/3.0.1 MIME-Version: 1.0 To: Rui Paulo References: <201002082012.o18KC1cu045193@svn.freebsd.org> In-Reply-To: <201002082012.o18KC1cu045193@svn.freebsd.org> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB 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: r203682 - in head/sys/dev/ath/ath_hal: . ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 00:25:49 -0000 cc -O2 -pipe -g -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I/usr/local/src/sys/modules/ath/../../dev/ath -I/usr/local/src/sys/modules/ath/../../dev/ath/ath_hal -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -g -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -c /usr/local/src/sys/modules/ath/../../dev/ath/if_ath.c /usr/local/src/sys/modules/ath/../../dev/ath/if_ath.c: In function 'ath_key_alloc': /usr/local/src/sys/modules/ath/../../dev/ath/if_ath.c:2239: error: expected expression before '/' token *** Error code 1 On 02/08/10 12:12, Rui Paulo wrote: > Author: rpaulo > Date: Mon Feb 8 20:12:01 2010 > New Revision: 203682 > URL: http://svn.freebsd.org/changeset/base/203682 > > Log: > Fix TX power problems with AR9285. > > Modified: > head/sys/dev/ath/ath_hal/ah_eeprom_v14.h > head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c > head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c > head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h > head/sys/dev/ath/ath_hal/ar5416/ar9280.c > head/sys/dev/ath/ath_hal/ar5416/ar9280.h > head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c > > Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.h > ============================================================================== > --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Mon Feb 8 20:04:16 2010 (r203681) > +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Mon Feb 8 20:12:01 2010 (r203682) > @@ -14,7 +14,7 @@ > * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF > * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. > * > - * $Id: ah_eeprom_v14.h,v 1.3 2008/11/10 04:08:00 sam Exp $ > + * $FreeBSD$ > */ > #ifndef _AH_EEPROM_V14_H_ > #define _AH_EEPROM_V14_H_ > @@ -76,6 +76,7 @@ > #define AR5416_EEPMISC_BIG_ENDIAN 0x01 > #define FREQ2FBIN(x,y) ((y) ? ((x) - 2300) : (((x) - 4800) / 5)) > #define AR5416_MAX_CHAINS 3 > +#define AR5416_PWR_TABLE_OFFSET_DB -5 > #define AR5416_ANT_16S 25 > > #define AR5416_NUM_ANT_CHAIN_FIELDS 7 > > Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c > ============================================================================== > --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Mon Feb 8 20:04:16 2010 (r203681) > +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Mon Feb 8 20:12:01 2010 (r203682) > @@ -172,12 +172,11 @@ ar5416InitCal(struct ath_hal *ah, const > > ichan = ath_hal_checkchannel(ah, chan); > HALASSERT(ichan != AH_NULL); > - > if (AR_SREV_KITE_12_OR_LATER(ah)) { > - /* Clear the carrier leak cal bit */ > OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); > - > if (IEEE80211_IS_CHAN_HT20(chan)) { > + OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, > + AR_PHY_CL_CAL_ENABLE); > OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, > AR_PHY_PARALLEL_CAL_ENABLE); > OS_REG_SET_BIT(ah, AR_PHY_TURBO, AR_PHY_FC_DYN2040_EN); > @@ -191,7 +190,7 @@ ar5416InitCal(struct ath_hal *ah, const > if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, > AR_PHY_AGC_CONTROL_CAL, 0)) { > HALDEBUG(ah, HAL_DEBUG_ANY, > - "%s: offset calibration failed to " > + "%s: HT offset calibration failed to " > "complete in 1ms; noisy environment?\n", > __func__); > return AH_FALSE; > @@ -201,14 +200,10 @@ ar5416InitCal(struct ath_hal *ah, const > AR_PHY_PARALLEL_CAL_ENABLE); > } > OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); > - > - /* Enable Rx Filter Cal */ > OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); > OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, > AR_PHY_AGC_CONTROL_FLTR_CAL); > OS_REG_SET_BIT(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_CAL_ENABLE); > - > - /* kick off the cal */ > OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL); > > /* Poll for offset calibration complete */ > @@ -219,8 +214,6 @@ ar5416InitCal(struct ath_hal *ah, const > "noisy environment?\n", __func__); > return AH_FALSE; > } > - /* Set the cl cal bit and rerun the cal a 2nd time */ > - /* Enable Rx Filter Cal */ > OS_REG_SET_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); > OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); > OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, > @@ -258,9 +251,10 @@ ar5416InitCal(struct ath_hal *ah, const > OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL); > > /* Poll for offset calibration complete */ > - if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) { > + if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, > + AR_PHY_AGC_CONTROL_CAL, 0)) { > HALDEBUG(ah, HAL_DEBUG_ANY, > - "%s: offset calibration did not complete in 1ms; " > + "%s: AGC offset calibration did not complete in 1ms; " > "noisy environment?\n", __func__); > return AH_FALSE; > } > > Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c > ============================================================================== > --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Feb 8 20:04:16 2010 (r203681) > +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Feb 8 20:12:01 2010 (r203682) > @@ -898,6 +898,8 @@ ar5416SetTransmitPower(struct ath_hal *a > ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]); > if (ratesArray[i]> AR5416_MAX_RATE_POWER) > ratesArray[i] = AR5416_MAX_RATE_POWER; > + if (AR_SREV_MERLIN_10_OR_LATER(ah)) > + ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2; > } > > #ifdef AH_EEPROM_DUMP > @@ -1225,7 +1227,7 @@ ar5416SetBoardValues(struct ath_hal *ah, > const struct ar5416eeprom_4k *eep4k; > const MODAL_EEP_HEADER *pModal; > const MODAL_EEP4K_HEADER *pModal4k; > - int i, regChainOffset; > + int i, regChainOffset = 0; > uint8_t txRxAttenLocal; /* workaround for eeprom versions<= 14.2 */ > > HALASSERT(AH_PRIVATE(ah)->ah_eeversion>= AR_EEPROM_VER14_1); > @@ -1253,9 +1255,9 @@ ar5416SetBoardValues(struct ath_hal *ah, > (pModal) ? pModal->antCtrlCommon : > pModal4k->antCtrlCommon); > for (i = 0; i< AR5416_MAX_CHAINS; i++) { > - if (AR_SREV_KITE(ah)&& i>= 1) break; > - if (AR_SREV_MERLIN(ah)&& i>= 2) break; > - if (AR_SREV_OWL_20_OR_LATER(ah)&& > +// if (AR_SREV_KITE(ah)&& i>= 2) break; > + if (AR_SREV_MERLIN(ah)&& i>= 2) break; > + if (AR_SREV_OWL_20_OR_LATER(ah)&& > (AH5416(ah)->ah_rx_chainmask == 0x5 || > AH5416(ah)->ah_tx_chainmask == 0x5)&& i != 0) { > /* Regs are swapped from chain 2 to 1 for 5416 2_0 with > @@ -1289,15 +1291,23 @@ ar5416SetBoardValues(struct ath_hal *ah, > } else > txRxAtten = txRxAttenLocal; > > - OS_REG_WRITE(ah, AR_PHY_RXGAIN + regChainOffset, > - (OS_REG_READ(ah, AR_PHY_RXGAIN + regChainOffset)& ~AR_PHY_RXGAIN_TXRX_ATTEN) | > - SM(txRxAtten, AR_PHY_RXGAIN_TXRX_ATTEN)); > - > - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, > - (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset)& ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | > - SM((pModal) ? pModal->rxTxMarginCh[i]: > - pModal4k->rxTxMarginCh[i], > - AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); > + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { > + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset, > + AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAtten); > + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset, > + AR9280_PHY_RXGAIN_TXRX_MARGIN, > + (pModal) ? pModal->rxTxMarginCh[i] : pModal4k->rxTxMarginCh[i]); > + } else { > + OS_REG_WRITE(ah, AR_PHY_RXGAIN + regChainOffset, > + (OS_REG_READ(ah, AR_PHY_RXGAIN + regChainOffset)& ~AR_PHY_RXGAIN_TXRX_ATTEN) | > + SM(txRxAtten, AR_PHY_RXGAIN_TXRX_ATTEN)); > + > + OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, > + (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset)& ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | > + SM((pModal) ? pModal->rxTxMarginCh[i]: > + pModal4k->rxTxMarginCh[i], > + AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); > + } > } > } > > @@ -1360,6 +1370,20 @@ ar5416SetBoardValues(struct ath_hal *ah, > OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000)& ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | > SM(pModal->bswAtten[1], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); > } else { > + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { > + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, > + AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, > + (pModal) ? pModal->bswMargin[i] : pModal4k->bswMargin[i]); > + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, > + AR_PHY_GAIN_2GHZ_XATTEN1_DB, > + (pModal) ? pModal->bswAtten[i] : pModal4k->bswAtten[i]); > + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, > + AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, > + (pModal) ? pModal->xatten2Margin[i] : pModal4k->xatten2Margin[i]); > + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, > + AR_PHY_GAIN_2GHZ_XATTEN2_DB, > + (pModal) ? pModal->xatten2Db[i] : pModal4k->xatten2Db[i]); > + } else { > OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000)& ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | > SM((pModal) ? pModal->bswMargin[1] : > pModal4k->bswMargin[1], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); > @@ -1372,6 +1396,7 @@ ar5416SetBoardValues(struct ath_hal *ah, > OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000)& ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | > SM((pModal) ? pModal->bswAtten[2] : > pModal4k->bswAtten[2], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); > + } > } > OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_BSW_MARGIN, > (pModal) ? pModal->bswMargin[0] : pModal4k->bswMargin[0]); > @@ -1440,10 +1465,7 @@ ar5416SetPowerPerRateTable(struct ath_ha > pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].antennaGainCh[1]), > pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].antennaGainCh[2]); > else > - twiceLargestAntenna = AH_MAX(AH_MAX( > - pEepData4k->modalHeader.antennaGainCh[0], > - pEepData4k->modalHeader.antennaGainCh[1]), > - pEepData4k->modalHeader.antennaGainCh[2]); > + twiceLargestAntenna = pEepData4k->modalHeader.antennaGainCh[0]; > #if 0 > /* Turn it back on if we need to calculate per chain antenna gain reduction */ > /* Use only if the expected gain> 6dbi */ > @@ -1577,15 +1599,15 @@ ar5416SetPowerPerRateTable(struct ath_ha > freq = centers.ctl_center; > } > > - ctlIndex = (pEepData) ? pEepData->ctlIndex[0] : > - pEepData4k->ctlIndex[0]; > /* walk through each CTL index stored in EEPROM */ > - for (i = 0; (i< numctls)&& ctlIndex; i++) { > + for (i = 0; i< numctls; i++) { > uint16_t twiceMinEdgePower; > CAL_CTL_EDGES *ctlEdge; > > ctlIndex = (pEepData) ? pEepData->ctlIndex[i] : > pEepData4k->ctlIndex[i]; > + if (!ctlIndex) > + break; > > /* compare test group from regulatory channel list with test mode from pCtlMode list */ > if ((((cfgCtl& ~CTL_MODE_M) | (pCtlMode[ctlMode]& CTL_MODE_M)) == ctlIndex) || > @@ -1943,7 +1965,7 @@ ar5416SetPowerCalTable(struct ath_hal *a > SM(xpdGainValues[1], AR_PHY_TPCRG1_PD_GAIN_2) | SM(xpdGainValues[2], AR_PHY_TPCRG1_PD_GAIN_3)); > > for (i = 0; i< AR5416_MAX_CHAINS; i++) { > - if (AR_SREV_KITE(ah)&& i>= AR5416_4K_MAX_CHAINS) break; > +// if (AR_SREV_KITE(ah)&& i>= AR5416_4K_MAX_CHAINS) break; > if (AR_SREV_OWL_20_OR_LATER(ah)&& > ( AH5416(ah)->ah_rx_chainmask == 0x5 || AH5416(ah)->ah_tx_chainmask == 0x5)&& (i != 0)) { > /* Regs are swapped from chain 2 to 1 for 5416 2_0 with > @@ -1981,7 +2003,6 @@ ar5416SetPowerCalTable(struct ath_hal *a > * negative or greater than 0. Need to offset the power > * values by the amount of minPower for griffin > */ > - > OS_REG_WRITE(ah, AR_PHY_TPCRG5 + regChainOffset, > SM(pdGainOverlap_t2, AR_PHY_TPCRG5_PD_GAIN_OVERLAP) | > SM(gainBoundaries[0], AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1) | > @@ -2149,7 +2170,10 @@ ar5416GetGainBoundariesAndPdadcs(struct > > /* Find starting index for this pdGain */ > if (i == 0) { > - ss = 0; /* for the first pdGain, start from index 0 */ > + if (AR_SREV_MERLIN_10_OR_LATER(ah)) > + ss = (int16_t)(0 - (minPwrT4[i] / 2)); > + else > + ss = 0; /* for the first pdGain, start from index 0 */ > } else { > /* need overlap entries extrapolated below. */ > ss = (int16_t)((pPdGainBoundaries[i-1] - (minPwrT4[i] / 2)) - tPdGainOverlap + 1 + minDelta); > @@ -2165,7 +2189,7 @@ ar5416GetGainBoundariesAndPdadcs(struct > ss++; > } > > - sizeCurrVpdTable = (uint8_t)((maxPwrT4[i] - minPwrT4[i]) / 2 +1); > + sizeCurrVpdTable = (uint8_t)((maxPwrT4[i] - minPwrT4[i]) / 2 + 1); > tgtIndex = (uint8_t)(pPdGainBoundaries[i] + tPdGainOverlap - (minPwrT4[i] / 2)); > maxIndex = (tgtIndex< sizeCurrVpdTable) ? tgtIndex : sizeCurrVpdTable; > > @@ -2314,13 +2338,20 @@ ar5416Set11nRegs(struct ath_hal *ah, con > { > uint32_t phymode; > HAL_HT_MACMODE macmode; /* MAC - 20/40 mode */ > + uint32_t dacFifo; > > if (!IEEE80211_IS_CHAN_HT(chan)) > return; > > + if (AR_SREV_KITE_10_OR_LATER(ah)) > + dacFifo = OS_REG_READ(ah, AR_PHY_TURBO) > + & AR_PHY_FC_ENABLE_DAC_FIFO; > + else > + dacFifo = 0; > + > /* Enable 11n HT, 20 MHz */ > phymode = AR_PHY_FC_HT_EN | AR_PHY_FC_SHORT_GI_40 > - | AR_PHY_FC_SINGLE_HT_LTF1 | AR_PHY_FC_WALSH; > + | AR_PHY_FC_SINGLE_HT_LTF1 | AR_PHY_FC_WALSH | dacFifo; > > /* Configure baseband for dynamic 20/40 operation */ > if (IEEE80211_IS_CHAN_HT40(chan)) { > > Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h > ============================================================================== > --- head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Mon Feb 8 20:04:16 2010 (r203681) > +++ head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Mon Feb 8 20:12:01 2010 (r203682) > @@ -48,6 +48,7 @@ > #define AR_PHY_FC_SHORT_GI_40 0x00000080 /* allow short GI for HT 40 */ > #define AR_PHY_FC_WALSH 0x00000100 /* walsh spatial spreading for 2 chains,2 streams TX */ > #define AR_PHY_FC_SINGLE_HT_LTF1 0x00000200 /* single length (4us) 1st HT long training symbol */ > +#define AR_PHY_FC_ENABLE_DAC_FIFO 0x00000800 > > #define AR_PHY_TIMING2 0x9810 /* Timing Control 2 */ > #define AR_PHY_TIMING2_USE_FORCE 0x00001000 > @@ -78,6 +79,20 @@ > #define AR_PHY_GAIN_2GHZ_BSW_ATTEN 0x0000001F > #define AR_PHY_GAIN_2GHZ_BSW_ATTEN_S 0 > > +#define AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN 0x003E0000 > +#define AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN_S 17 > +#define AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN 0x0001F000 > +#define AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN_S 12 > +#define AR_PHY_GAIN_2GHZ_XATTEN2_DB 0x00000FC0 > +#define AR_PHY_GAIN_2GHZ_XATTEN2_DB_S 6 > +#define AR_PHY_GAIN_2GHZ_XATTEN1_DB 0x0000003F > +#define AR_PHY_GAIN_2GHZ_XATTEN1_DB_S 0 > + > +#define AR9280_PHY_RXGAIN_TXRX_ATTEN 0x00003F80 > +#define AR9280_PHY_RXGAIN_TXRX_ATTEN_S 7 > +#define AR9280_PHY_RXGAIN_TXRX_MARGIN 0x001FC000 > +#define AR9280_PHY_RXGAIN_TXRX_MARGIN_S 14 > + > #define AR_PHY_EXT_CCA 0x99bc > #define AR_PHY_EXT_CCA_CYCPWR_THR1 0x0000FE00 > #define AR_PHY_EXT_CCA_CYCPWR_THR1_S 9 > > Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280.c > ============================================================================== > --- head/sys/dev/ath/ath_hal/ar5416/ar9280.c Mon Feb 8 20:04:16 2010 (r203681) > +++ head/sys/dev/ath/ath_hal/ar5416/ar9280.c Mon Feb 8 20:12:01 2010 (r203682) > @@ -277,12 +277,15 @@ ar9280GetNoiseFloor(struct ath_hal *ah, > "NF calibrated [ctl] [chain 0] is %d\n", nf); > nfarray[0] = nf; > > - nf = MS(OS_REG_READ(ah, AR_PHY_CH1_CCA), AR9280_PHY_CH1_MINCCA_PWR); > - if (nf& 0x100) > - nf = 0 - ((nf ^ 0x1ff) + 1); > - HALDEBUG(ah, HAL_DEBUG_NFCAL, > - "NF calibrated [ctl] [chain 1] is %d\n", nf); > - nfarray[1] = nf; > + if (!AR_SREV_KITE(ah)) { > + nf = MS(OS_REG_READ(ah, AR_PHY_CH1_CCA), > + AR9280_PHY_CH1_MINCCA_PWR); > + if (nf& 0x100) > + nf = 0 - ((nf ^ 0x1ff) + 1); > + HALDEBUG(ah, HAL_DEBUG_NFCAL, > + "NF calibrated [ctl] [chain 1] is %d\n", nf); > + nfarray[1] = nf; > + } > > nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR9280_PHY_EXT_MINCCA_PWR); > if (nf& 0x100) > @@ -291,12 +294,15 @@ ar9280GetNoiseFloor(struct ath_hal *ah, > "NF calibrated [ext] [chain 0] is %d\n", nf); > nfarray[3] = nf; > > - nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR9280_PHY_CH1_EXT_MINCCA_PWR); > - if (nf& 0x100) > + if (AR_SREV_KITE(ah)) { > + nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), > + AR9280_PHY_CH1_EXT_MINCCA_PWR); > + if (nf& 0x100) > nf = 0 - ((nf ^ 0x1ff) + 1); > - HALDEBUG(ah, HAL_DEBUG_NFCAL, > - "NF calibrated [ext] [chain 1] is %d\n", nf); > - nfarray[4] = nf; > + HALDEBUG(ah, HAL_DEBUG_NFCAL, > + "NF calibrated [ext] [chain 1] is %d\n", nf); > + nfarray[4] = nf; > + } > } > > /* > > Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280.h > ============================================================================== > --- head/sys/dev/ath/ath_hal/ar5416/ar9280.h Mon Feb 8 20:04:16 2010 (r203681) > +++ head/sys/dev/ath/ath_hal/ar5416/ar9280.h Mon Feb 8 20:12:01 2010 (r203682) > @@ -30,7 +30,9 @@ struct ath_hal_9280 { > #define AH9280(_ah) ((struct ath_hal_9280 *)(_ah)) > > #define AR9280_DEFAULT_RXCHAINMASK 3 > +#define AR9285_DEFAULT_RXCHAINMASK 1 > #define AR9280_DEFAULT_TXCHAINMASK 1 > +#define AR9285_DEFAULT_TXCHAINMASK 1 > > HAL_BOOL ar9280RfAttach(struct ath_hal *, HAL_STATUS *); > > > Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c > ============================================================================== > --- head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Mon Feb 8 20:04:16 2010 (r203681) > +++ head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Mon Feb 8 20:12:01 2010 (r203682) > @@ -123,6 +123,10 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s > AH5416(ah)->ah_writeIni = ar9280WriteIni; > AH5416(ah)->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK; > AH5416(ah)->ah_tx_chainmask = AR9280_DEFAULT_TXCHAINMASK; > + if (AR_SREV_KITE(ah)) { > + AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK; > + AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK; > + } > > if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { > /* reset chip */ > -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 00:38:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A220106566C; Tue, 9 Feb 2010 00:38:40 +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 79B5A8FC0A; Tue, 9 Feb 2010 00:38:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o190ceUR004532; Tue, 9 Feb 2010 00:38:40 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o190ceuT004528; Tue, 9 Feb 2010 00:38:40 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201002090038.o190ceuT004528@svn.freebsd.org> From: Andrew Thompson Date: Tue, 9 Feb 2010 00:38: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: r203693 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 00:38:40 -0000 Author: thompsa Date: Tue Feb 9 00:38:40 2010 New Revision: 203693 URL: http://svn.freebsd.org/changeset/base/203693 Log: Disable the use of the IAAD usb doorbell on NVidia controllers as it can cause the hardware to stall. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci.h head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon Feb 8 23:30:28 2010 (r203692) +++ head/sys/dev/usb/controller/ehci.c Tue Feb 9 00:38:40 2010 (r203693) @@ -92,15 +92,23 @@ __FBSDID("$FreeBSD$"); #if USB_DEBUG static int ehcidebug = 0; static int ehcinohighspeed = 0; +static int ehciiaadbug = 0; +static int ehcilostintrbug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW, &ehcidebug, 0, "Debug level"); SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW, &ehcinohighspeed, 0, "Disable High Speed USB"); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW, + &ehciiaadbug, 0, "Enable doorbell bug workaround"); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW, + &ehcilostintrbug, 0, "Enable lost interrupt bug workaround"); TUNABLE_INT("hw.usb.ehci.debug", &ehcidebug); TUNABLE_INT("hw.usb.ehci.no_hs", &ehcinohighspeed); +TUNABLE_INT("hw.usb.ehci.iaadbug", &ehciiaadbug); +TUNABLE_INT("hw.usb.ehci.lostintrbug", &ehcilostintrbug); static void ehci_dump_regs(ehci_softc_t *sc); static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh); @@ -251,6 +259,10 @@ ehci_init(ehci_softc_t *sc) usb_callout_init_mtx(&sc->sc_tmo_poll, &sc->sc_bus.bus_mtx, 0); #if USB_DEBUG + if (ehciiaadbug) + sc->sc_flags |= EHCI_SCFLG_IAADBUG; + if (ehcilostintrbug) + sc->sc_flags |= EHCI_SCFLG_LOSTINTRBUG; if (ehcidebug > 2) { ehci_dump_regs(sc); } @@ -2280,6 +2292,13 @@ ehci_device_bulk_start(struct usb_xfer * /* put transfer on interrupt queue */ ehci_transfer_intr_enqueue(xfer); + /* + * XXX Certain nVidia chipsets choke when using the IAAD + * feature too frequently. + */ + if (sc->sc_flags & EHCI_SCFLG_IAADBUG) + return; + /* XXX Performance quirk: Some Host Controllers have a too low * interrupt rate. Issue an IAAD to stimulate the Host * Controller after queueing the BULK transfer. Modified: head/sys/dev/usb/controller/ehci.h ============================================================================== --- head/sys/dev/usb/controller/ehci.h Mon Feb 8 23:30:28 2010 (r203692) +++ head/sys/dev/usb/controller/ehci.h Tue Feb 9 00:38:40 2010 (r203693) @@ -350,6 +350,7 @@ typedef struct ehci_softc { #define EHCI_SCFLG_BIGEMMIO 0x0010 /* big-endian byte order MMIO */ #define EHCI_SCFLG_TT 0x0020 /* transaction translator present */ #define EHCI_SCFLG_LOSTINTRBUG 0x0040 /* workaround for VIA / ATI chipsets */ +#define EHCI_SCFLG_IAADBUG 0x0080 /* workaround for nVidia chipsets */ uint8_t sc_offs; /* offset to operational registers */ uint8_t sc_doorbell_disable; /* set on doorbell failure */ Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Mon Feb 8 23:30:28 2010 (r203692) +++ head/sys/dev/usb/controller/ehci_pci.c Tue Feb 9 00:38:40 2010 (r203693) @@ -466,6 +466,19 @@ ehci_pci_attach(device_t self) break; } + /* Doorbell feature workaround */ + switch (pci_get_vendor(self)) { + case PCI_EHCI_VENDORID_NVIDIA: + case PCI_EHCI_VENDORID_NVIDIA2: + sc->sc_flags |= EHCI_SCFLG_IAADBUG; + if (bootverbose) + device_printf(self, + "Doorbell workaround enabled\n"); + break; + default: + break; + } + err = ehci_init(sc); if (!err) { err = device_probe_and_attach(sc->sc_bus.bdev); From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 01:19:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5F9B106566B; Tue, 9 Feb 2010 01:19:10 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C54CC8FC1B; Tue, 9 Feb 2010 01:19:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o191JADa013462; Tue, 9 Feb 2010 01:19:10 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o191JAj4013460; Tue, 9 Feb 2010 01:19:10 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201002090119.o191JAj4013460@svn.freebsd.org> From: David Xu Date: Tue, 9 Feb 2010 01:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203694 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 01:19:10 -0000 Author: davidxu Date: Tue Feb 9 01:19:10 2010 New Revision: 203694 URL: http://svn.freebsd.org/changeset/base/203694 Log: MFC r203414: After busied the lock, re-read state word before checking waiters flag, otherwise, the waiters bit may not be set and a wakeup is lost. Approved by: re (kib) Modified: stable/7/sys/kern/kern_umtx.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_umtx.c ============================================================================== --- stable/7/sys/kern/kern_umtx.c Tue Feb 9 00:38:40 2010 (r203693) +++ stable/7/sys/kern/kern_umtx.c Tue Feb 9 01:19:10 2010 (r203694) @@ -2463,6 +2463,12 @@ do_rw_rdlock(struct thread *td, struct u umtxq_busy(&uq->uq_key); umtxq_unlock(&uq->uq_key); + /* + * re-read the state, in case it changed between the try-lock above + * and the check below + */ + state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + /* set read contention bit */ while ((state & wrflags) && !(state & URWLOCK_READ_WAITERS)) { oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_READ_WAITERS); @@ -2595,6 +2601,12 @@ do_rw_wrlock(struct thread *td, struct u umtxq_busy(&uq->uq_key); umtxq_unlock(&uq->uq_key); + /* + * re-read the state, in case it changed between the try-lock above + * and the check below + */ + state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + while (((state & URWLOCK_WRITE_OWNER) || URWLOCK_READER_COUNT(state) != 0) && (state & URWLOCK_WRITE_WAITERS) == 0) { oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_WRITE_WAITERS); From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 04:07:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB42C1065670; Tue, 9 Feb 2010 04:07:39 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBCC58FC15; Tue, 9 Feb 2010 04:07:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1947dSj051561; Tue, 9 Feb 2010 04:07:39 GMT (envelope-from avatar@svn.freebsd.org) Received: (from avatar@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1947dX6051559; Tue, 9 Feb 2010 04:07:39 GMT (envelope-from avatar@svn.freebsd.org) Message-Id: <201002090407.o1947dX6051559@svn.freebsd.org> From: Tai-hwa Liang Date: Tue, 9 Feb 2010 04:07: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: r203695 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 04:07:40 -0000 Author: avatar Date: Tue Feb 9 04:07:39 2010 New Revision: 203695 URL: http://svn.freebsd.org/changeset/base/203695 Log: Fixing compilation bustage by removing a stray comment fragment. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Feb 9 01:19:10 2010 (r203694) +++ head/sys/dev/ath/if_ath.c Tue Feb 9 04:07:39 2010 (r203695) @@ -2236,7 +2236,6 @@ ath_key_alloc(struct ieee80211vap *vap, "%s: bogus group key\n", __func__); return 0; } - */ if (vap->iv_opmode != IEEE80211_M_HOSTAP || !(k->wk_flags & IEEE80211_KEY_GROUP) || !sc->sc_mcastkey) { From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 05:52:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA783106566C; Tue, 9 Feb 2010 05:52:35 +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 D995B8FC18; Tue, 9 Feb 2010 05:52:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o195qZLq074585; Tue, 9 Feb 2010 05:52:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o195qZcD074581; Tue, 9 Feb 2010 05:52:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002090552.o195qZcD074581@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 9 Feb 2010 05:52: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: r203696 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 05:52:36 -0000 Author: marcel Date: Tue Feb 9 05:52:35 2010 New Revision: 203696 URL: http://svn.freebsd.org/changeset/base/203696 Log: Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can obtain the memory map of the traced process. PT_VM_TIMESTAMP can be used to check if the memory map changed since the last time to avoid iterating over all the VM entries unnecesarily. MFC after: 1 month Modified: head/lib/libc/sys/ptrace.2 head/sys/kern/sys_process.c head/sys/sys/ptrace.h Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Tue Feb 9 04:07:39 2010 (r203695) +++ head/lib/libc/sys/ptrace.2 Tue Feb 9 05:52:35 2010 (r203696) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd March 27, 2009 +.Dd February 8, 2010 .Dt PTRACE 2 .Os .Sh NAME @@ -327,6 +327,61 @@ This request will trace the specified pr .It PT_SYSCALL This request will trace the specified process on each system call entry and exit. +.It PT_VM_TIMESTAMP +This request returns the generation number or timestamp of the memory map of +the traced process as the return value from +.Fn ptrace . +This provides a low-cost way for the tracing process to determine if the +VM map changed since the last time this request was made. +.It PT_VM_ENTRY +This request is used to iterate over the entries of the VM map of the traced +process. +The +.Fa addr +argument specifies a pointer to a +.Vt "struct ptrace_vm_entry" , +which is defined as follows: +.Bd -literal +struct ptrace_vm_entry { + void *pve_cookie; + u_long pve_start; + u_long pve_end; + u_long pve_offset; + u_int pve_prot; + u_int pve_pathlen; + char *pve_path; +}; +.Ed +.Pp +The first entry is returned by setting +.Va pve_cookie +to +.Dv NULL . +Subsequent entries are returned by leaving +.Va pve_cookie +unmodified from the value returned by previous requests. +By setting +.Va pve_pathlen +to a non-zero value on entry, the pathname of the backing object is returned +in the buffer pointed to by +.Va pve_path , +provided the entry is backed by a vnode. +The +.Va pve_pathlen +field is updated with the actual length of the pathname (including the +terminating null character). +The +.Va pve_offset +field is the offset within the backing object at which the range starts. +The range is located in the VM space at +.Va pve_start +and extends up to +.Va pve_end +(inclusive). +.Pp +The +.Fa data +argument is ignored. .El .Pp Additionally, machine-specific requests can exist. @@ -376,6 +431,10 @@ or .Dv PT_SETDBREGS was attempted on a process with no valid register set. (This is normally true only of system processes.) +.It +.Dv PT_VM_ENTRY +was given an invalid value for +.Fa pve_cookie . .El .It Bq Er EBUSY .Bl -bullet -compact @@ -405,6 +464,22 @@ on a process in violation of the require .Dv PT_ATTACH above. .El +.It Bq Er ENOENT +.Bl -bullet -compact +.It +.Dv PT_VM_ENTRY +previously returned the last entry of the memory map. +No more entries exist. +.El +.It Bq Er ENAMETOOLONG +.Bl -bullet -compact +.It +.Dv PT_VM_ENTRY +cannot return the pathname of the backing object because the buffer is not big +enough. +.Fa pve_pathlen +holds the minimum buffer size required on return. +.El .El .Sh SEE ALSO .Xr execve 2 , Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Tue Feb 9 04:07:39 2010 (r203695) +++ head/sys/kern/sys_process.c Tue Feb 9 05:52:35 2010 (r203696) @@ -346,6 +346,92 @@ proc_rwmem(struct proc *p, struct uio *u return (error); } +static int +ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) +{ + vm_map_t map; + vm_map_entry_t entry; + vm_object_t obj, tobj, lobj; + struct vnode *vp; + char *freepath, *fullpath; + u_int pathlen; + int error, vfslocked; + + map = &p->p_vmspace->vm_map; + entry = map->header.next; + if (pve->pve_cookie != NULL) { + while (entry != &map->header && entry != pve->pve_cookie) + entry = entry->next; + if (entry != pve->pve_cookie) + return (EINVAL); + entry = entry->next; + } + while (entry != &map->header && (entry->eflags & MAP_ENTRY_IS_SUB_MAP)) + entry = entry->next; + if (entry == &map->header) + return (ENOENT); + + /* We got an entry. */ + pve->pve_cookie = entry; + pve->pve_start = entry->start; + pve->pve_end = entry->end - 1; + pve->pve_offset = entry->offset; + pve->pve_prot = entry->protection; + + /* Backing object's path needed? */ + if (pve->pve_pathlen == 0) + return (0); + + pathlen = pve->pve_pathlen; + pve->pve_pathlen = 0; + + obj = entry->object.vm_object; + if (obj == NULL) + return (0); + + VM_OBJECT_LOCK(obj); + for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { + if (tobj != obj) + VM_OBJECT_LOCK(tobj); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + lobj = tobj; + pve->pve_offset += tobj->backing_object_offset; + } + if (lobj != NULL) { + vp = (lobj->type == OBJT_VNODE) ? lobj->handle : NULL; + if (vp != NULL) + vref(vp); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_UNLOCK(obj); + } else + vp = NULL; + + if (vp == NULL) + return (0); + + freepath = NULL; + fullpath = NULL; + vn_fullpath(td, vp, &fullpath, &freepath); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); + + error = 0; + if (fullpath != NULL) { + pve->pve_pathlen = strlen(fullpath) + 1; + if (pve->pve_pathlen <= pathlen) { + error = copyout(fullpath, pve->pve_path, + pve->pve_pathlen); + } else + error = ENAMETOOLONG; + } + if (freepath != NULL) + free(freepath, M_TEMP); + return (error); +} + /* * Process debugging system call. */ @@ -389,6 +475,7 @@ ptrace(struct thread *td, struct ptrace_ union { struct ptrace_io_desc piod; struct ptrace_lwpinfo pl; + struct ptrace_vm_entry pve; struct dbreg dbreg; struct fpreg fpreg; struct reg reg; @@ -429,6 +516,9 @@ ptrace(struct thread *td, struct ptrace_ case PT_IO: error = COPYIN(uap->addr, &r.piod, sizeof r.piod); break; + case PT_VM_ENTRY: + error = COPYIN(uap->addr, &r.pve, sizeof r.pve); + break; default: addr = uap->addr; break; @@ -441,6 +531,9 @@ ptrace(struct thread *td, struct ptrace_ return (error); switch (uap->req) { + case PT_VM_ENTRY: + error = COPYOUT(&r.pve, uap->addr, sizeof r.pve); + break; case PT_IO: error = COPYOUT(&r.piod, uap->addr, sizeof r.piod); break; @@ -977,6 +1070,16 @@ kern_ptrace(struct thread *td, int req, PROC_LOCK(p); break; + case PT_VM_TIMESTAMP: + td->td_retval[0] = p->p_vmspace->vm_map.timestamp; + break; + + case PT_VM_ENTRY: + PROC_UNLOCK(p); + error = ptrace_vm_entry(td, p, addr); + PROC_LOCK(p); + break; + default: #ifdef __HAVE_PTRACE_MACHDEP if (req >= PT_FIRSTMACH) { Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Tue Feb 9 04:07:39 2010 (r203695) +++ head/sys/sys/ptrace.h Tue Feb 9 05:52:35 2010 (r203696) @@ -67,6 +67,10 @@ #define PT_SETFPREGS 36 /* set floating-point registers */ #define PT_GETDBREGS 37 /* get debugging registers */ #define PT_SETDBREGS 38 /* set debugging registers */ + +#define PT_VM_TIMESTAMP 40 /* Get VM version (timestamp) */ +#define PT_VM_ENTRY 41 /* Get VM map (entry) */ + #define PT_FIRSTMACH 64 /* for machine-specific requests */ #include /* machine-specific requests, if any */ @@ -98,6 +102,17 @@ struct ptrace_lwpinfo { sigset_t pl_siglist; /* LWP pending signal */ }; +/* Argument structure for PT_VM_ENTRY. */ +struct ptrace_vm_entry { + void *pve_cookie; /* Token used to iterate. */ + u_long pve_start; /* Start VA of range. */ + u_long pve_end; /* End VA of range (incl). */ + u_long pve_offset; /* Offset in backing object. */ + u_int pve_prot; /* Protection of memory range. */ + u_int pve_pathlen; /* Size of path. */ + char *pve_path; /* Path name of object. */ +}; + #ifdef _KERNEL #define PTRACESTOP_SC(p, td, flag) \ From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 06:24:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 649231065679; Tue, 9 Feb 2010 06:24:44 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52E578FC1E; Tue, 9 Feb 2010 06:24:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o196OiqD081741; Tue, 9 Feb 2010 06:24:44 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o196OiMP081724; Tue, 9 Feb 2010 06:24:44 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002090624.o196OiMP081724@svn.freebsd.org> From: Neel Natu Date: Tue, 9 Feb 2010 06:24: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: r203697 - in head/sys: conf mips/conf mips/include mips/mips mips/sibyte X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 06:24:44 -0000 Author: neel Date: Tue Feb 9 06:24:43 2010 New Revision: 203697 URL: http://svn.freebsd.org/changeset/base/203697 Log: SMP support for the mips port. The platform that supports SMP currently is a SWARM with a dual-core Sibyte processor. The kernel config file to use is SWARM_SMP. Reviewed by: imp, rrs Added: head/sys/mips/conf/SWARM_SMP (contents, props changed) head/sys/mips/mips/mpboot.S (contents, props changed) Modified: head/sys/conf/files.mips head/sys/mips/include/asm.h head/sys/mips/include/cpu.h head/sys/mips/include/hwfunc.h head/sys/mips/include/intr_machdep.h head/sys/mips/include/pcpu.h head/sys/mips/include/smp.h head/sys/mips/mips/intr_machdep.c head/sys/mips/mips/machdep.c head/sys/mips/mips/mp_machdep.c head/sys/mips/mips/pmap.c head/sys/mips/sibyte/sb_asm.S head/sys/mips/sibyte/sb_machdep.c head/sys/mips/sibyte/sb_scd.c head/sys/mips/sibyte/sb_scd.h head/sys/mips/sibyte/sb_zbbus.c Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/conf/files.mips Tue Feb 9 06:24:43 2010 (r203697) @@ -21,6 +21,7 @@ # ---------------------------------------------------------------------- mips/mips/machdep.c standard mips/mips/mp_machdep.c optional smp +mips/mips/mpboot.S optional smp mips/mips/psraccess.S standard # ---------------------------------------------------------------------- # Phase 3 Added: head/sys/mips/conf/SWARM_SMP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/SWARM_SMP Tue Feb 9 06:24:43 2010 (r203697) @@ -0,0 +1,7 @@ +# +# $FreeBSD$ +# +options SMP +options PRINTF_BUFR_SIZE=128 + +include SWARM Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/include/asm.h Tue Feb 9 06:24:43 2010 (r203697) @@ -497,17 +497,8 @@ _C_LABEL(x): #define DYNAMIC_STATUS_MASK_TOUSER(sr,scratch1) #endif -#ifdef SMP - /* - * FREEBSD_DEVELOPERS_FIXME - * In multiprocessor case, store/retrieve the pcpu structure - * address for current CPU in scratch register for fast access. - */ -#error "Write GET_CPU_PCPU for SMP" -#else #define GET_CPU_PCPU(reg) \ lw reg, _C_LABEL(pcpup); -#endif /* * Description of the setjmp buffer Modified: head/sys/mips/include/cpu.h ============================================================================== --- head/sys/mips/include/cpu.h Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/include/cpu.h Tue Feb 9 06:24:43 2010 (r203697) @@ -122,6 +122,8 @@ #define SOFT_INT_MASK (SOFT_INT_MASK_0 | SOFT_INT_MASK_1) #define HW_INT_MASK (ALL_INT_MASK & ~SOFT_INT_MASK) +#define soft_int_mask(softintr) (1 << ((softintr) + 8)) +#define hard_int_mask(hardintr) (1 << ((hardintr) + 10)) /* * The bits in the cause register. Modified: head/sys/mips/include/hwfunc.h ============================================================================== --- head/sys/mips/include/hwfunc.h Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/include/hwfunc.h Tue Feb 9 06:24:43 2010 (r203697) @@ -47,4 +47,51 @@ unsigned platform_get_timecount(struct t /* For hardware specific CPU initialization */ void platform_cpu_init(void); void platform_secondary_init(void); + +#ifdef SMP + +/* + * Spin up the AP so that it starts executing MP bootstrap entry point: mpentry + * + * Returns 0 on sucess and non-zero on failure. + */ +int platform_start_ap(int processor_id); + +/* + * Platform-specific initialization that needs to be done when an AP starts + * running. This function is called from the MP bootstrap code in mpboot.S + */ +void platform_init_ap(int processor_id); + +/* + * Return a plaform-specific interrrupt number that is used to deliver IPIs. + * + * This hardware interrupt is used to deliver IPIs exclusively and must + * not be used for any other interrupt source. + */ +int platform_ipi_intrnum(void); + +/* + * Trigger a IPI interrupt on 'cpuid'. + */ +void platform_ipi_send(int cpuid); + +/* + * Quiesce the IPI interrupt source on the current cpu. + */ +void platform_ipi_clear(void); + +/* + * Return the processor id. + * + * Note that this function is called in early boot when stack is not available. + */ +extern int platform_processor_id(void); + +/* + * Return the number of processors available on this platform. + */ +extern int platform_num_processors(void); + +#endif /* SMP */ #endif /* !_MACHINE_HWFUNC_H_ */ Modified: head/sys/mips/include/intr_machdep.h ============================================================================== --- head/sys/mips/include/intr_machdep.h Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/include/intr_machdep.h Tue Feb 9 06:24:43 2010 (r203697) @@ -60,6 +60,16 @@ void cpu_establish_softintr(const char * void cpu_intr(struct trapframe *); /* + * Allow a platform to override the default hard interrupt mask and unmask + * functions. The 'arg' can be cast safely to an 'int' and holds the mips + * hard interrupt number to mask or unmask. + */ +typedef void (*cpu_intr_mask_t)(void *arg); +typedef void (*cpu_intr_unmask_t)(void *arg); +void cpu_set_hardintr_mask_func(cpu_intr_mask_t func); +void cpu_set_hardintr_unmask_func(cpu_intr_unmask_t func); + +/* * Opaque datatype that represents intr counter */ typedef unsigned long* mips_intrcnt_t; Modified: head/sys/mips/include/pcpu.h ============================================================================== --- head/sys/mips/include/pcpu.h Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/include/pcpu.h Tue Feb 9 06:24:43 2010 (r203697) @@ -55,6 +55,13 @@ extern struct pcpu *pcpup; #define PCPU_SET(member,value) (PCPUP->pc_ ## member = (value)) #define PCPU_LAZY_INC(member) (++PCPUP->pc_ ## member) +#ifdef SMP +/* + * Instantiate the wired TLB entry at PCPU_TLB_ENTRY to map 'pcpu' at 'pcpup'. + */ +void mips_pcpu_tlb_init(struct pcpu *pcpu); +#endif + #endif /* _KERNEL */ #endif /* !_MACHINE_PCPU_H_ */ Modified: head/sys/mips/include/smp.h ============================================================================== --- head/sys/mips/include/smp.h Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/include/smp.h Tue Feb 9 06:24:43 2010 (r203697) @@ -20,7 +20,6 @@ /* * Interprocessor interrupts for SMP. */ -#define IPI_INVLTLB 0x0001 #define IPI_RENDEZVOUS 0x0002 #define IPI_AST 0x0004 #define IPI_STOP 0x0008 @@ -28,13 +27,9 @@ #ifndef LOCORE -extern u_int32_t boot_cpu_id; - -void ipi_selected(u_int cpus, u_int32_t ipi); -void ipi_all_but_self(u_int32_t ipi); -intrmask_t smp_handle_ipi(struct trapframe *frame); +void ipi_selected(cpumask_t cpus, int ipi); void smp_init_secondary(u_int32_t cpuid); -void mips_ipi_send(int thread_id); +void mpentry(void); #endif /* !LOCORE */ #endif /* _KERNEL */ Modified: head/sys/mips/mips/intr_machdep.c ============================================================================== --- head/sys/mips/mips/intr_machdep.c Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/mips/intr_machdep.c Tue Feb 9 06:24:43 2010 (r203697) @@ -50,6 +50,9 @@ static mips_intrcnt_t mips_intr_counters static int intrcnt_index; +static cpu_intr_mask_t hardintr_mask_func; +static cpu_intr_unmask_t hardintr_unmask_func; + mips_intrcnt_t mips_intrcnt_create(const char* name) { @@ -128,38 +131,54 @@ cpu_init_interrupts() } void +cpu_set_hardintr_mask_func(cpu_intr_mask_t func) +{ + + hardintr_mask_func = func; +} + +void +cpu_set_hardintr_unmask_func(cpu_intr_unmask_t func) +{ + + hardintr_unmask_func = func; +} + +void cpu_establish_hardintr(const char *name, driver_filter_t *filt, void (*handler)(void*), void *arg, int irq, int flags, void **cookiep) { struct intr_event *event; int error; -#if 0 - printf("Establish HARD IRQ %d: filt %p handler %p arg %p\n", - irq, filt, handler, arg); -#endif /* * We have 6 levels, but thats 0 - 5 (not including 6) */ if (irq < 0 || irq >= NHARD_IRQS) panic("%s called for unknown hard intr %d", __func__, irq); + if (hardintr_mask_func == NULL) + hardintr_mask_func = mips_mask_hard_irq; + + if (hardintr_unmask_func == NULL) + hardintr_unmask_func = mips_unmask_hard_irq; + event = hardintr_events[irq]; if (event == NULL) { error = intr_event_create(&event, (void *)(uintptr_t)irq, 0, - irq, mips_mask_hard_irq, mips_unmask_hard_irq, + irq, hardintr_mask_func, hardintr_unmask_func, NULL, NULL, "int%d", irq); if (error) return; hardintr_events[irq] = event; + mips_unmask_hard_irq((void*)(uintptr_t)irq); } intr_event_add_handler(event, name, filt, handler, arg, intr_priority(flags), flags, cookiep); - mips_intrcnt_setname(mips_intr_counters[NSOFT_IRQS + irq], event->ie_fullname); - - mips_unmask_hard_irq((void*)(uintptr_t)irq); + mips_intrcnt_setname(mips_intr_counters[NSOFT_IRQS + irq], + event->ie_fullname); } void @@ -185,14 +204,13 @@ cpu_establish_softintr(const char *name, if (error) return; softintr_events[irq] = event; + mips_unmask_soft_irq((void*)(uintptr_t)irq); } intr_event_add_handler(event, name, filt, handler, arg, intr_priority(flags), flags, cookiep); mips_intrcnt_setname(mips_intr_counters[irq], event->ie_fullname); - - mips_unmask_soft_irq((void*)(uintptr_t)irq); } void Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/mips/machdep.c Tue Feb 9 06:24:43 2010 (r203697) @@ -133,11 +133,7 @@ vm_offset_t kstack0; char pcpu_space[MAXCPU][PAGE_SIZE * 2] \ __aligned(PAGE_SIZE * 2) __section(".data"); -#ifdef SMP -struct pcpu *pcpup = 0; /* initialized in pmap_bootstrap() */ -#else struct pcpu *pcpup = (struct pcpu *)pcpu_space; -#endif vm_offset_t phys_avail[PHYS_AVAIL_ENTRIES + 2]; vm_offset_t physmem_desc[PHYS_AVAIL_ENTRIES + 2]; @@ -419,22 +415,14 @@ mips_generic_reset() ((void(*)(void))(intptr_t)MIPS_VEC_RESET)(); } -/* - * Initialise a struct pcpu. - */ +#ifdef SMP void -cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size) +mips_pcpu_tlb_init(struct pcpu *pcpu) { -#ifdef SMP vm_paddr_t pa; struct tlb tlb; int lobits; -#endif - - pcpu->pc_next_asid = 1; - pcpu->pc_asid_generation = 1; -#ifdef SMP /* * Map the pcpu structure at the virtual address 'pcpup'. * We use a wired tlb index to do this one-time mapping. @@ -446,6 +434,21 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu tlb.tlb_lo0 = mips_paddr_to_tlbpfn(pa) | lobits; tlb.tlb_lo1 = mips_paddr_to_tlbpfn(pa + PAGE_SIZE) | lobits; Mips_TLBWriteIndexed(PCPU_TLB_ENTRY, &tlb); +} +#endif + +/* + * Initialise a struct pcpu. + */ +void +cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size) +{ + + pcpu->pc_next_asid = 1; + pcpu->pc_asid_generation = 1; +#ifdef SMP + if ((vm_offset_t)pcpup >= VM_MIN_KERNEL_ADDRESS) + mips_pcpu_tlb_init(pcpu); #endif } Modified: head/sys/mips/mips/mp_machdep.c ============================================================================== --- head/sys/mips/mips/mp_machdep.c Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/mips/mp_machdep.c Tue Feb 9 06:24:43 2010 (r203697) @@ -1,124 +1,110 @@ +/*- + * Copyright (c) 2009 Neelkanth Natu + * 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$"); -#include "opt_kstack_pages.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 +static void *dpcpu; static struct mtx ap_boot_mtx; -extern struct pcpu __pcpu[]; -extern int num_tlbentries; -void mips_start_timer(void); -static volatile int aps_ready = 0; - -u_int32_t boot_cpu_id; +static volatile int aps_ready; +static volatile int mp_naps; -void -cpu_mp_announce(void) +static void +ipi_send(struct pcpu *pc, int ipi) { -} -/* - * To implement IPIs on MIPS CPU, we use the Interrupt Line 2 ( bit 4 of cause - * register) and a bitmap to avoid redundant IPI interrupts. To interrupt a - * set of CPUs, the sender routine runs in a ' loop ' sending interrupts to - * all the specified CPUs. A single Mutex (smp_ipi_mtx) is used for all IPIs - * that spinwait for delivery. This includes the following IPIs - * IPI_RENDEZVOUS - * IPI_INVLPG - * IPI_INVLTLB - * IPI_INVLRNG - */ - -/* - * send an IPI to a set of cpus. - */ -void -ipi_selected(u_int32_t cpus, u_int ipi) -{ - struct pcpu *pcpu; - u_int cpuid, new_pending, old_pending; + CTR3(KTR_SMP, "%s: cpu=%d, ipi=%x", __func__, pc->pc_cpuid, ipi); - CTR3(KTR_SMP, "%s: cpus: %x, ipi: %x\n", __func__, cpus, ipi); + atomic_set_32(&pc->pc_pending_ipis, ipi); + platform_ipi_send(pc->pc_cpuid); - while ((cpuid = ffs(cpus)) != 0) { - cpuid--; - cpus &= ~(1 << cpuid); - pcpu = pcpu_find(cpuid); - - if (pcpu) { - do { - old_pending = pcpu->pc_pending_ipis; - new_pending = old_pending | ipi; - } while (!atomic_cmpset_int(&pcpu->pc_pending_ipis, - old_pending, new_pending)); - - if (old_pending) - continue; - - mips_ipi_send (cpuid); - } - } + CTR1(KTR_SMP, "%s: sent", __func__); } -/* - * send an IPI to all CPUs EXCEPT myself - */ +/* Send an IPI to a set of cpus. */ void -ipi_all_but_self(u_int ipi) +ipi_selected(cpumask_t cpus, int ipi) { + struct pcpu *pc; + + CTR3(KTR_SMP, "%s: cpus: %x, ipi: %x\n", __func__, cpus, ipi); - ipi_selected(PCPU_GET(other_cpus), ipi); + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { + if ((cpus & pc->pc_cpumask) != 0) + ipi_send(pc, ipi); + } } /* * Handle an IPI sent to this processor. */ -intrmask_t -smp_handle_ipi(struct trapframe *frame) +static int +mips_ipi_handler(void *arg) { - cpumask_t cpumask; /* This cpu mask */ + cpumask_t cpumask; u_int ipi, ipi_bitmap; + int bit; + + platform_ipi_clear(); /* quiesce the pending ipi interrupt */ ipi_bitmap = atomic_readandclear_int(PCPU_PTR(pending_ipis)); - cpumask = PCPU_GET(cpumask); + if (ipi_bitmap == 0) + return (FILTER_STRAY); CTR1(KTR_SMP, "smp_handle_ipi(), ipi_bitmap=%x", ipi_bitmap); - while (ipi_bitmap) { - /* - * Find the lowest set bit. - */ - ipi = ipi_bitmap & ~(ipi_bitmap - 1); + + while ((bit = ffs(ipi_bitmap))) { + bit = bit - 1; + ipi = 1 << bit; ipi_bitmap &= ~ipi; switch (ipi) { - case IPI_INVLTLB: - CTR0(KTR_SMP, "IPI_INVLTLB"); - break; - case IPI_RENDEZVOUS: CTR0(KTR_SMP, "IPI_RENDEZVOUS"); smp_rendezvous_action(); @@ -129,51 +115,136 @@ smp_handle_ipi(struct trapframe *frame) break; case IPI_STOP: - /* * IPI_STOP_HARD is mapped to IPI_STOP so it is not * necessary to add it in the switch. */ CTR0(KTR_SMP, "IPI_STOP or IPI_STOP_HARD"); + cpumask = PCPU_GET(cpumask); atomic_set_int(&stopped_cpus, cpumask); - while ((started_cpus & cpumask) == 0) - ; + cpu_spinwait(); atomic_clear_int(&started_cpus, cpumask); atomic_clear_int(&stopped_cpus, cpumask); + CTR0(KTR_SMP, "IPI_STOP (restart)"); break; + default: + panic("Unknown IPI 0x%0x on cpu %d", ipi, curcpu); } } - return CR_INT_IPI; + + return (FILTER_HANDLED); +} + +static int +start_ap(int cpuid) +{ + int cpus, ms; + + cpus = mp_naps; + dpcpu = (void *)kmem_alloc(kernel_map, DPCPU_SIZE); + + if (platform_start_ap(cpuid) != 0) + return (-1); /* could not start AP */ + + for (ms = 0; ms < 5000; ++ms) { + if (mp_naps > cpus) + return (0); /* success */ + else + DELAY(1000); + } + + return (-2); /* timeout initializing AP */ } void cpu_mp_setmaxid(void) { - mp_maxid = MAXCPU - 1; + mp_ncpus = platform_num_processors(); + if (mp_ncpus <= 0) + mp_ncpus = 1; + + mp_maxid = min(mp_ncpus, MAXCPU) - 1; +} + +void +cpu_mp_announce(void) +{ + /* NOTHING */ +} + +struct cpu_group * +cpu_topo(void) +{ + + return (smp_topo_none()); +} + +int +cpu_mp_probe(void) +{ + + return (mp_ncpus > 1); +} + +void +cpu_mp_start(void) +{ + int error, cpuid; + + mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); + + all_cpus = 1; /* BSP */ + for (cpuid = 1; cpuid < platform_num_processors(); ++cpuid) { + if (cpuid >= MAXCPU) { + printf("cpu_mp_start: ignoring AP #%d.\n", cpuid); + continue; + } + + if ((error = start_ap(cpuid)) != 0) { + printf("AP #%d failed to start: %d\n", cpuid, error); + continue; + } + + if (bootverbose) + printf("AP #%d started!\n", cpuid); + + all_cpus |= 1 << cpuid; + } + + PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask)); } void smp_init_secondary(u_int32_t cpuid) { + int ipi_int_mask, clock_int_mask; - if (cpuid >= MAXCPU) - panic ("cpu id exceeds MAXCPU\n"); + /* TLB */ + Mips_SetWIRED(0); + Mips_TLBFlush(num_tlbentries); + Mips_SetWIRED(VMWIRED_ENTRIES); + + /* + * We assume that the L1 cache on the APs is identical to the one + * on the BSP. + */ + mips_dcache_wbinv_all(); + mips_icache_sync_all(); - /* tlb init */ - R4K_SetWIRED(0); - R4K_TLBFlush(num_tlbentries); - R4K_SetWIRED(VMWIRED_ENTRIES); MachSetPID(0); - Mips_SyncCache(); + pcpu_init(PCPU_ADDR(cpuid), cpuid, sizeof(struct pcpu)); + dpcpu_init(dpcpu, cpuid); + + /* The AP has initialized successfully - allow the BSP to proceed */ + ++mp_naps; - mips_cp0_status_write(0); + /* Spin until the BSP is ready to release the APs */ while (!aps_ready) ; - mips_sync(); mips_sync(); /* Initialize curthread. */ KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread")); PCPU_SET(curthread, PCPU_GET(idlethread)); @@ -182,15 +253,16 @@ smp_init_secondary(u_int32_t cpuid) smp_cpus++; - CTR1(KTR_SMP, "SMP: AP CPU #%d Launched", PCPU_GET(cpuid)); + CTR1(KTR_SMP, "SMP: AP CPU #%d launched", PCPU_GET(cpuid)); /* Build our map of 'other' CPUs. */ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask)); - printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid)); + if (bootverbose) + printf("SMP: AP CPU #%d launched.\n", PCPU_GET(cpuid)); if (smp_cpus == mp_ncpus) { - smp_started = 1; + atomic_store_rel_int(&smp_started, 1); smp_active = 1; } @@ -198,103 +270,46 @@ smp_init_secondary(u_int32_t cpuid) while (smp_started == 0) ; /* nothing */ - /* Enable Interrupt */ - mips_cp0_status_write(SR_INT_ENAB); - /* ok, now grab sched_lock and enter the scheduler */ - mtx_lock_spin(&sched_lock); /* - * Correct spinlock nesting. The idle thread context that we are - * borrowing was created so that it would start out with a single - * spin lock (sched_lock) held in fork_trampoline(). Since we've - * explicitly acquired locks in this function, the nesting count - * is now 2 rather than 1. Since we are nested, calling - * spinlock_exit() will simply adjust the counts without allowing - * spin lock using code to interrupt us. + * Unmask the clock and ipi interrupts. */ - spinlock_exit(); - KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); - - binuptime(PCPU_PTR(switchtime)); - PCPU_SET(switchticks, ticks); - - /* kick off the clock on this cpu */ - mips_start_timer(); - cpu_throw(NULL, choosethread()); /* doesn't return */ - - panic("scheduler returned us to %s", __func__); -} - -static int -smp_start_secondary(int cpuid) -{ - struct pcpu *pcpu; - void *dpcpu; - int i; - - if (bootverbose) - printf("smp_start_secondary: starting cpu %d\n", cpuid); + clock_int_mask = hard_int_mask(5); + ipi_int_mask = hard_int_mask(platform_ipi_intrnum()); + set_intr_mask(ALL_INT_MASK & ~(ipi_int_mask | clock_int_mask)); - dpcpu = (void *)kmem_alloc(kernel_map, DPCPU_SIZE); - pcpu_init(&__pcpu[cpuid], cpuid, sizeof(struct pcpu)); - dpcpu_init(dpcpu, cpuid); + /* + * Bootstrap the compare register. + */ + mips_wr_compare(mips_rd_count() + counter_freq / hz); - if (bootverbose) - printf("smp_start_secondary: cpu %d started\n", cpuid); + enableintr(); - return 1; -} + /* enter the scheduler */ + sched_throw(NULL); -int -cpu_mp_probe(void) -{ - int i, cpus; - - /* XXX: Need to check for valid platforms here. */ - - boot_cpu_id = PCPU_GET(cpuid); - KASSERT(boot_cpu_id == 0, ("cpu_mp_probe() called on non-primary CPU")); - all_cpus = PCPU_GET(cpumask); - mp_ncpus = 1; - - /* Make sure we have at least one secondary CPU. */ - cpus = 0; - for (i = 0; i < MAXCPU; i++) { - cpus++; - } - return (cpus); + panic("scheduler returned us to %s", __func__); + /* NOTREACHED */ } -void -cpu_mp_start(void) +static void +release_aps(void *dummy __unused) { - int i, cpuid; - - mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); + int ipi_irq; - cpuid = 1; - for (i = 0; i < MAXCPU; i++) { + if (mp_ncpus == 1) + return; - if (i == boot_cpu_id) - continue; - if (smp_start_secondary(i)) { - all_cpus |= (1 << cpuid); - mp_ncpus++; - cpuid++; - } - } - idle_mask |= CR_INT_IPI; - PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask)); -} + /* + * IPI handler + */ + ipi_irq = platform_ipi_intrnum(); + cpu_establish_hardintr("ipi", mips_ipi_handler, NULL, NULL, ipi_irq, + INTR_TYPE_MISC | INTR_EXCL | INTR_FAST, NULL); -static void -release_aps(void *dummy __unused) -{ - if (bootverbose && mp_ncpus > 1) - printf("%s: releasing secondary CPUs\n", __func__); atomic_store_rel_int(&aps_ready, 1); - while (mp_ncpus > 1 && smp_started == 0) + while (smp_started == 0) ; /* nothing */ } Added: head/sys/mips/mips/mpboot.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/mpboot.S Tue Feb 9 06:24:43 2010 (r203697) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2010 Neelkanth Natu + * 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$ + */ + +#include +#include +#include + +#include "assym.s" + + .text + .set noat + .set noreorder + +GLOBAL(mpentry) + mtc0 zero, COP_0_STATUS_REG /* disable interrupts */ + + mtc0 zero, COP_0_CAUSE_REG /* clear soft interrupts */ + + li t0, CFG_K0_CACHED /* make sure kseg0 is cached */ + mtc0 t0, MIPS_COP_0_CONFIG + COP0_SYNC + + jal platform_processor_id /* get the processor number */ + nop + move s0, v0 + + /* + * Initialize stack and call machine startup + */ + PTR_LA sp, _C_LABEL(pcpu_space) + addiu sp, (NBPG * 2) - START_FRAME + sll t0, s0, PAGE_SHIFT + 1 + addu sp, sp, t0 + + /* Zero out old ra and old fp for debugger */ + sw zero, START_FRAME - 4(sp) + sw zero, START_FRAME - 8(sp) + + PTR_LA gp, _C_LABEL(_gp) + + jal platform_init_ap + move a0, s0 + + jal smp_init_secondary + move a0, s0 + + PANIC("AP startup failed!") Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/mips/pmap.c Tue Feb 9 06:24:43 2010 (r203697) @@ -362,6 +362,15 @@ again: virtual_avail = roundup2(virtual_avail, PAGE_SIZE * 2); pcpup = (struct pcpu *)virtual_avail; virtual_avail += PAGE_SIZE * 2; + + /* + * Initialize the wired TLB entry mapping the pcpu region for + * the BSP at 'pcpup'. Up until this point we were operating + * with the 'pcpup' for the BSP pointing to a virtual address + * in KSEG0 so there was no need for a TLB mapping. + */ + mips_pcpu_tlb_init(PCPU_ADDR(0)); + if (bootverbose) printf("pcpu is available at virtual address %p.\n", pcpup); #endif Modified: head/sys/mips/sibyte/sb_asm.S ============================================================================== --- head/sys/mips/sibyte/sb_asm.S Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/sibyte/sb_asm.S Tue Feb 9 06:24:43 2010 (r203697) @@ -27,6 +27,7 @@ */ #include +#include /* * We compile a 32-bit kernel to run on the SB-1 processor which is a 64-bit @@ -80,3 +81,20 @@ LEAF(sb_store64) jr ra sd t0, 0(a0) END(sb_store64) + +#ifdef SMP +/* + * This function must be implemented in assembly because it is called early + * in AP boot without a valid stack. + * + * This cpu number is available in bits 25 to 27 of the coprocessor 0 PRID + * register. This is not documented in the BCM1250 user manual but can be + * gleaned from the CFE source code - see sb1250_altcpu.S + */ +LEAF(platform_processor_id) + mfc0 v0, MIPS_COP_0_PRID + srl v0, v0, 25 + jr ra + and v0, v0, 7 +END(platform_processor_id) +#endif /* SMP */ Modified: head/sys/mips/sibyte/sb_machdep.c ============================================================================== --- head/sys/mips/sibyte/sb_machdep.c Tue Feb 9 05:52:35 2010 (r203696) +++ head/sys/mips/sibyte/sb_machdep.c Tue Feb 9 06:24:43 2010 (r203697) @@ -74,6 +74,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef SMP +#include +#endif + #ifdef CFE #include #endif @@ -114,6 +118,19 @@ sb_intr_init(int cpuid) intrnum = sb_route_intsrc(intsrc); sb_disable_intsrc(cpuid, intsrc); sb_write_intmap(cpuid, intsrc, intrnum); +#ifdef SMP + /* + * Set up the mailbox interrupt mapping. + * + * The mailbox interrupt is "special" in that it is not shared + * with any other interrupt source. + */ + if (intsrc == INTSRC_MAILBOX3) { + intrnum = platform_ipi_intrnum(); + sb_write_intmap(cpuid, INTSRC_MAILBOX3, intrnum); + sb_enable_intsrc(cpuid, INTSRC_MAILBOX3); + } +#endif } } @@ -282,6 +299,64 @@ kseg0_map_coherent(void) mips_wr_config(config); } +#ifdef SMP +void +platform_ipi_send(int cpuid) +{ + KASSERT(cpuid == 0 || cpuid == 1, + ("platform_ipi_send: invalid cpuid %d", cpuid)); + + sb_set_mailbox(cpuid, 1ULL); +} + +void +platform_ipi_clear(void) +{ + int cpuid; + + cpuid = PCPU_GET(cpuid); + sb_clear_mailbox(cpuid, 1ULL); +} + +int +platform_ipi_intrnum(void) +{ + + return (4); +} + +void +platform_init_ap(int cpuid) +{ + + KASSERT(cpuid == 1, ("AP has an invalid cpu id %d", cpuid)); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 07:35:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38614106568D; Tue, 9 Feb 2010 07:35:13 +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 2873B8FC18; Tue, 9 Feb 2010 07:35:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o197ZDvM097172; Tue, 9 Feb 2010 07:35:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o197ZDGb097170; Tue, 9 Feb 2010 07:35:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002090735.o197ZDGb097170@svn.freebsd.org> From: Ed Schouten Date: Tue, 9 Feb 2010 07:35: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: r203698 - head/libexec/ftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 07:35:13 -0000 Author: ed Date: Tue Feb 9 07:35:12 2010 New Revision: 203698 URL: http://svn.freebsd.org/changeset/base/203698 Log: Set ut_line to "ftpd" for ftpd. This makes it a little easier to figure out which application was responsible for this log entry. Ideally we should add an ut_process or something similar. Suggested by: Vincent Poy Modified: head/libexec/ftpd/logwtmp.c Modified: head/libexec/ftpd/logwtmp.c ============================================================================== --- head/libexec/ftpd/logwtmp.c Tue Feb 9 06:24:43 2010 (r203697) +++ head/libexec/ftpd/logwtmp.c Tue Feb 9 07:35:12 2010 (r203698) @@ -75,6 +75,7 @@ ftpd_logwtmp(char *id, char *user, struc ut.ut_pid = getpid(); gettimeofday(&ut.ut_tv, NULL); (void)strncpy(ut.ut_id, id, sizeof(ut.ut_id)); + (void)strncpy(ut.ut_line, "ftpd", sizeof(ut.ut_line)); pututxline(&ut); } From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 09:57:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6FD2106566C; Tue, 9 Feb 2010 09:57:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 3DC4E8FC08; Tue, 9 Feb 2010 09:57:27 +0000 (UTC) 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 o199vNuu013275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Feb 2010 11:57:23 +0200 (EET) (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 o199vMJC080918; Tue, 9 Feb 2010 11:57:22 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o199vM1V080917; Tue, 9 Feb 2010 11:57:22 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 9 Feb 2010 11:57:22 +0200 From: Kostik Belousov To: Marcel Moolenaar Message-ID: <20100209095722.GQ9991@deviant.kiev.zoral.com.ua> References: <201002090552.o195qZcD074581@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SvyA5ywaG/v2A5dH" Content-Disposition: inline In-Reply-To: <201002090552.o195qZcD074581@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 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 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 09:57:28 -0000 --SvyA5ywaG/v2A5dH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 09, 2010 at 05:52:35AM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Tue Feb 9 05:52:35 2010 > New Revision: 203696 > URL: http://svn.freebsd.org/changeset/base/203696 >=20 > Log: > Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can > obtain the memory map of the traced process. PT_VM_TIMESTAMP can be > used to check if the memory map changed since the last time to avoid > iterating over all the VM entries unnecesarily. > =20 > MFC after: 1 month >=20 =2E.. > +static int > +ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entr= y *pve) > +{ > + vm_map_t map; > + vm_map_entry_t entry; > + vm_object_t obj, tobj, lobj; > + struct vnode *vp; > + char *freepath, *fullpath; > + u_int pathlen; > + int error, vfslocked; > + > + map =3D &p->p_vmspace->vm_map; I think this place lacks two safety measures: - vmspace should be referenced by vmspace_acquire_ref() - vm_map should be read-locked before iterating the map entries. Vmspace may be shared between stopped debugee and other process using rfork(2), thus modified despite the fact that traced process is stopped. > + entry =3D map->header.next; > + if (pve->pve_cookie !=3D NULL) { > + while (entry !=3D &map->header && entry !=3D pve->pve_cookie) > + entry =3D entry->next; Could the entry pointed by pve_cookie be reused between ptrace(PT_VM_ENTRY) invocations ? I think the debugger should be informed about this situation, otherwise interface is too unreliable. --SvyA5ywaG/v2A5dH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktxMYIACgkQC3+MBN1Mb4g9HwCdFsQObkursJJXS765f2p7ATI8 xCUAnjGm+G1dpuXNQy2PoSfeYyPxCzDd =3LyT -----END PGP SIGNATURE----- --SvyA5ywaG/v2A5dH-- From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 10:47:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60BEF1065670; Tue, 9 Feb 2010 10:47:44 +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 4EEDD8FC15; Tue, 9 Feb 2010 10:47:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19Alipu041813; Tue, 9 Feb 2010 10:47:44 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19Alibh041810; Tue, 9 Feb 2010 10:47:44 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201002091047.o19Alibh041810@svn.freebsd.org> From: Gabor Kovesdan Date: Tue, 9 Feb 2010 10:47: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: r203699 - in head/usr.bin/ee: . nls/pt_BR.ISO8859-1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 10:47:44 -0000 Author: gabor Date: Tue Feb 9 10:47:44 2010 New Revision: 203699 URL: http://svn.freebsd.org/changeset/base/203699 Log: - pt_BR.ISO8859-1 catalog - Add link to pt_PT.ISO8859-1 Submitted by: sylvio Approved by: delphij (mentor) Added: head/usr.bin/ee/nls/pt_BR.ISO8859-1/ head/usr.bin/ee/nls/pt_BR.ISO8859-1/ee.msg (contents, props changed) Modified: head/usr.bin/ee/Makefile Modified: head/usr.bin/ee/Makefile ============================================================================== --- head/usr.bin/ee/Makefile Tue Feb 9 07:35:12 2010 (r203698) +++ head/usr.bin/ee/Makefile Tue Feb 9 10:47:44 2010 (r203699) @@ -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 hu_HU.ISO8859-2 + uk_UA.KOI8-U pt_BR.ISO8859-1 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 \ @@ -22,6 +22,7 @@ NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859- fr_FR.ISO8859-15 NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \ de_CH.ISO8859-15 de_DE.ISO8859-15 +NLSLINKS_pt_BR.ISO8859-1= pt_PT.ISO8859-1 NLSSRCFILES=ee.msg .for lang in ${NLS} Added: head/usr.bin/ee/nls/pt_BR.ISO8859-1/ee.msg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ee/nls/pt_BR.ISO8859-1/ee.msg Tue Feb 9 10:47:44 2010 (r203699) @@ -0,0 +1,186 @@ +$ This file contains the messages for ee ("easy editor"). See the file +$ ee.i18n.guide for more information +$ +$ For ee patchlevel 3 +$ +$ $Header: /home/hugh/sources/old_ae/RCS/ee.msg,v 1.8 1996/11/30 03:23:40 hugh Exp $ +$ $FreeBSD$ +$ +$ +$set 1 +$quote " +1 "modo menu" +2 "tabs para espaços " +3 "busca com case sensitive " +4 "observar margens " +5 "formatação de auto-parágrafo" +6 "caracteres de oito bits " +7 "informação da janela " +8 "margem direita " +9 "deixar o menu" +10 "salvar mudanças" +11 "sem salvar" +12 "menu arquivo" +13 "ler um arquivo" +14 "escrever uma arquivo" +15 "salvar arquivo" +16 "editar conteúdo de impressão" +17 "menu localizar" +18 "localizar por ..." +19 "localizar" +20 "menu dicionário" +21 "usar 'spell'" +22 "usar 'ispell'" +23 "menu diversos" +24 "formatação de parágrafo" +25 "comando shell" +26 "checar dicionário" +27 "menu principal" +28 "deixar editor" +29 "ajuda" +30 "operações com arquivos" +31 "redesenhar tela" +32 "configurações" +33 "localizar" +34 "diversos" +35 "Teclas de controle: " +36 "^a código ascii ^i tab ^r direita " +37 "^b botão de texto ^j nova linha ^t início do texto " +38 "^c comando ^k deletar caracter ^u para acima " +39 "^d para baixo ^l esquerda ^v restaurar palavra " +40 "^e localizar prompt ^m nova linha ^w deletar palavra " +41 "^f restaurar caracter ^n próxima página ^x localizar " +42 "^g início da linha ^o fim da linha ^y deletar linha " +43 "^h backspace ^p página anterior ^z restaurar linha " +44 "^[ (escape) menu " +45 " " +46 "Comandos: " +47 "help : obter esta informação file : imprimir nome do arquivo " +48 "read : ler um arquivo char : código ascii de caracter " +49 "write : escrever a arquivo case : localizar com case sensitive " +50 "exit : salva e sair nocase : localizar sem case insensitive " +51 "quit : sair, sem salvar !cmd : executar \"cmd\" no shell " +52 "line : visualizar linhas # 0-9 : ir para linha \"#\" " +53 "expand : expandir tabs noexpand: não expande tabs " +54 " " +55 " ee [+#] [-i] [-e] [-h] [arquivos(s)] " +56 "+# :ir para linha # -i :sem informação da janela -e : não expandir tabs -h :sem destaque " +57 "^[ (escape) menu ^e prompt localizar ^y deletar linha ^u para cima ^p página anterior " +58 "^a código ascii ^x localizar ^z restaurar linha ^d para baixo ^n próxima página " +59 "^b botão de texto ^g início da linha ^w deletar palavra ^l esquerda " +60 "^t início do texto ^o fim da linha ^v restaurar palavra ^r direita " +61 "^c comando ^k deletar caracter ^f restaurar caracter " +62 "help : obter ajuda |file : imprimir nome do arquivo |line : imprimir linha # " +63 "read : ler um arquivo |char : código ascii de caracter |0-9 : ir para linha \"#\"" +64 "write: escrever um arquivo |case : localizar com case sensitive |exit : salvar e sair " +65 "!cmd : shell \"cmd\" |nocase: ignorar case na busca |quit : sair, sem salvar" +66 "expand: expandir tabs |noexpand: não expandir tabs " +67 " pressione Escape (^[) para menu" +68 "sem arquivo" +69 "código ascii: " +70 "enviar conteúdo do buffer para \"%s\" " +71 "comando: " +72 "nome do arquivo para escrever: " +73 "nome do arquivo para leitura: " +74 "caracter = %d" +75 "comando desconhecido \"%s\"" +76 "mais de um comando digitado" +77 "linha %d " +78 "comprimento = %d" +79 "arquivo atual \"%s\" " +80 "uso: %s [-i] [-e] [-h] [+número_da_linha] [arquivo(s)]\n" +81 " -i desligar informações da janela\n" +82 " -e não converter tabs para espaços\n" +83 " -h não usar destaque\n" +84 "arquivo \"%s\" é um diretório" +85 "novo arquivo \"%s\"" +86 "não posso abrir \"%s\"" +87 "arquivos \"%s\", %d linhas" +88 "finalizar leitura de arquivo \"%s\"" +89 "lendo arquivo \"%s\"" +90 ", somente leitura" +91 "arquivo \"%s\", %d linhas" +92 "digite o nome do arquivo: " +93 "nenhum arquivo digitado: arquivo não foi salvo" +94 "Foram feitas alterações, você tem certeza? (y/n [n]) " +95 "y" +96 "arquivo já existe, sobrescrever? (y/n) [n] " +97 "impossível criar arquivo \"%s\"" +98 "escrevendo arquivo \"%s\"" +99 "\"%s\" %d linhas, %d caracteres" +100 " ...localizando" +101 "string \"%s\" não encontrada" +102 "localizar por: " +103 "execução não permitida %s\n" +104 "pressione enter para continuar " +105 "pressione Esc para cancelar" +106 "menu muito grande para a janela" +107 "pressione qualquer tecla para continuar " +108 "comando shell: " +109 "...formatando parágrafo..." +110 " Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25D05106568F; Tue, 9 Feb 2010 12:20:49 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14B868FC1B; Tue, 9 Feb 2010 12:20:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19CKmci062300; Tue, 9 Feb 2010 12:20:48 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19CKmbr062298; Tue, 9 Feb 2010 12:20:48 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002091220.o19CKmbr062298@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 9 Feb 2010 12:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203700 - stable/8/sbin/dumpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 12:20:49 -0000 Author: ru Date: Tue Feb 9 12:20:48 2010 New Revision: 203700 URL: http://svn.freebsd.org/changeset/base/203700 Log: MFC: r198231: Properly re-create "-s size" argument to newfs(8). Modified: stable/8/sbin/dumpfs/dumpfs.c Directory Properties: stable/8/sbin/dumpfs/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.c Tue Feb 9 10:47:44 2010 (r203699) +++ stable/8/sbin/dumpfs/dumpfs.c Tue Feb 9 12:20:48 2010 (r203700) @@ -413,7 +413,7 @@ marshal(const char *name) break; } /* -p..r unimplemented */ - printf("-s %jd ", (intmax_t)fs->fs_size); + printf("-s %jd ", (intmax_t)fsbtodb(fs, fs->fs_size)); printf("%s ", disk.d_name); printf("\n"); From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 13:07:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2966106566B; Tue, 9 Feb 2010 13:07:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A15C38FC12; Tue, 9 Feb 2010 13:07:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19D7WkA072636; Tue, 9 Feb 2010 13:07:32 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19D7WAP072635; Tue, 9 Feb 2010 13:07:32 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002091307.o19D7WAP072635@svn.freebsd.org> From: Ed Maste Date: Tue, 9 Feb 2010 13:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203701 - stable/8/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 13:07:32 -0000 Author: emaste Date: Tue Feb 9 13:07:32 2010 New Revision: 203701 URL: http://svn.freebsd.org/changeset/base/203701 Log: MFC r203077: Add missing return, in a rare case where we can't allocate memory in deallocate. Submitted by: Ryan Stone (rysto32 at gmail dot com) Approved by: jasone Modified: stable/8/lib/libc/stdlib/malloc.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/stdlib/malloc.c ============================================================================== --- stable/8/lib/libc/stdlib/malloc.c Tue Feb 9 12:20:48 2010 (r203700) +++ stable/8/lib/libc/stdlib/malloc.c Tue Feb 9 13:07:32 2010 (r203701) @@ -3861,6 +3861,7 @@ arena_dalloc(arena_t *arena, arena_chunk arena_dalloc_small(arena, chunk, ptr, mapelm); malloc_spin_unlock(&arena->lock); + return; } mag_rack = rack; } From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 14:51:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B967D1065670; Tue, 9 Feb 2010 14:51:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8E348FC1D; Tue, 9 Feb 2010 14:51:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19EpfZp098359; Tue, 9 Feb 2010 14:51:41 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19EpeMX098357; Tue, 9 Feb 2010 14:51:40 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201002091451.o19EpeMX098357@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 9 Feb 2010 14:51: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: r203703 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 14:51:41 -0000 Author: gnn Date: Tue Feb 9 14:51:39 2010 New Revision: 203703 URL: http://svn.freebsd.org/changeset/base/203703 Log: Add the definition of Mistakeholder Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Tue Feb 9 14:31:02 2010 (r203702) +++ head/games/fortune/datfiles/fortunes Tue Feb 9 14:51:39 2010 (r203703) @@ -33335,6 +33335,12 @@ Miss, n.: % Mistakes are often the stepping stones to utter failure. % +Mistakeholder, n.: + A person who depends on accidental features or + implementation errors and so now has a vested + interest in keeping things from being fixed. + -- Chip Morningstar +% Mistrust first impulses; they are always right. % MIT: From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 14:56:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE080106568B; Tue, 9 Feb 2010 14:56:10 +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 9C9158FC1D; Tue, 9 Feb 2010 14:56:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19EuAek099392; Tue, 9 Feb 2010 14:56:10 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19EuA4w099388; Tue, 9 Feb 2010 14:56:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002091456.o19EuA4w099388@svn.freebsd.org> From: Attilio Rao Date: Tue, 9 Feb 2010 14:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203704 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 14:56:10 -0000 Author: attilio Date: Tue Feb 9 14:56:10 2010 New Revision: 203704 URL: http://svn.freebsd.org/changeset/base/203704 Log: MFC r202889, r202940: - Fix a race in sched_switch() of sched_4bsd. Block the td_lock when acquiring explicitly sched_lock in order to prevent races with other td_lock contenders. - Merge the ULE's internal function thread_block_switch() into the global thread_lock_block() and make the former semantic as the default for thread_lock_block(). - Split out an invariant in order to have better checks. Tested by: Giovanni Trematerra Approved by: re (kib) Modified: stable/7/sys/kern/kern_mutex.c stable/7/sys/kern/sched_4bsd.c stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_mutex.c ============================================================================== --- stable/7/sys/kern/kern_mutex.c Tue Feb 9 14:51:39 2010 (r203703) +++ stable/7/sys/kern/kern_mutex.c Tue Feb 9 14:56:10 2010 (r203704) @@ -557,7 +557,6 @@ thread_lock_block(struct thread *td) { struct mtx *lock; - spinlock_enter(); THREAD_LOCK_ASSERT(td, MA_OWNED); lock = td->td_lock; td->td_lock = &blocked_lock; @@ -572,7 +571,6 @@ thread_lock_unblock(struct thread *td, s mtx_assert(new, MA_OWNED); MPASS(td->td_lock == &blocked_lock); atomic_store_rel_ptr((volatile void *)&td->td_lock, (uintptr_t)new); - spinlock_exit(); } void Modified: stable/7/sys/kern/sched_4bsd.c ============================================================================== --- stable/7/sys/kern/sched_4bsd.c Tue Feb 9 14:51:39 2010 (r203703) +++ stable/7/sys/kern/sched_4bsd.c Tue Feb 9 14:56:10 2010 (r203704) @@ -824,9 +824,11 @@ sched_sleep(struct thread *td) void sched_switch(struct thread *td, struct thread *newtd, int flags) { + struct mtx *tmtx; struct td_sched *ts; struct proc *p; + tmtx = NULL; ts = td->td_sched; p = td->td_proc; @@ -835,17 +837,20 @@ sched_switch(struct thread *td, struct t /* * Switch to the sched lock to fix things up and pick * a new thread. + * Block the td_lock in order to avoid breaking the critical path. */ if (td->td_lock != &sched_lock) { mtx_lock_spin(&sched_lock); - thread_unlock(td); + tmtx = thread_lock_block(td); } if ((p->p_flag & P_NOLOAD) == 0) sched_load_rem(); - if (newtd) + if (newtd) { + MPASS(newtd->td_lock == &sched_lock); newtd->td_flags |= (td->td_flags & TDF_NEEDRESCHED); + } td->td_lastcpu = td->td_oncpu; td->td_flags &= ~TDF_NEEDRESCHED; @@ -888,8 +893,8 @@ sched_switch(struct thread *td, struct t sched_load_add(); } else { newtd = choosethread(); + MPASS(newtd->td_lock == &sched_lock); } - MPASS(newtd->td_lock == &sched_lock); if (td != newtd) { #ifdef HWPMC_HOOKS @@ -907,7 +912,7 @@ sched_switch(struct thread *td, struct t (*dtrace_vtime_switch_func)(newtd); #endif /* I feel sleepy */ - cpu_switch(td, newtd, td->td_lock); + cpu_switch(td, newtd, tmtx != NULL ? tmtx : td->td_lock); /* * Where am I? What year is it? * We are in the same thread that went to sleep above, Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Tue Feb 9 14:51:39 2010 (r203703) +++ stable/7/sys/kern/sched_ule.c Tue Feb 9 14:56:10 2010 (r203704) @@ -318,7 +318,6 @@ static void sched_balance_groups(void); static void sched_balance_group(struct tdq_group *); static void sched_balance_pair(struct tdq *, struct tdq *); static inline struct tdq *sched_setcpu(struct td_sched *, int, int); -static inline struct mtx *thread_block_switch(struct thread *); static inline void thread_unblock_switch(struct thread *, struct mtx *); static struct mtx *sched_switch_migrate(struct tdq *, struct thread *, int); #endif @@ -989,9 +988,11 @@ sched_setcpu(struct td_sched *ts, int cp * The hard case, migration, we need to block the thread first to * prevent order reversals with other cpus locks. */ + spinlock_enter(); thread_lock_block(td); TDQ_LOCK(tdq); thread_lock_unblock(td, TDQ_LOCKPTR(tdq)); + spinlock_exit(); return (tdq); } @@ -1789,23 +1790,6 @@ sched_switchin(struct tdq *tdq, struct t } /* - * Block a thread for switching. Similar to thread_block() but does not - * bump the spin count. - */ -static inline struct mtx * -thread_block_switch(struct thread *td) -{ - struct mtx *lock; - - THREAD_LOCK_ASSERT(td, MA_OWNED); - lock = td->td_lock; - td->td_lock = &blocked_lock; - mtx_unlock_spin(lock); - - return (lock); -} - -/* * Handle migration from sched_switch(). This happens only for * cpu binding. */ @@ -1822,7 +1806,7 @@ sched_switch_migrate(struct tdq *tdq, st * not holding either run-queue lock. */ spinlock_enter(); - thread_block_switch(td); /* This releases the lock on tdq. */ + thread_lock_block(td); /* This releases the lock on tdq. */ /* * Acquire both run-queue locks before placing the thread on the new @@ -1848,7 +1832,8 @@ sched_switch_migrate(struct tdq *tdq, st } /* - * Release a thread that was blocked with thread_block_switch(). + * Variadic version of thread_lock_unblock() that does not assume td_lock + * is blocked. */ static inline void thread_unblock_switch(struct thread *td, struct mtx *mtx) @@ -1907,7 +1892,7 @@ sched_switch(struct thread *td, struct t } else { /* This thread must be going to sleep. */ TDQ_LOCK(tdq); - mtx = thread_block_switch(td); + mtx = thread_lock_block(td); tdq_load_rem(tdq, ts); } /* From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 15:07:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0244F1065670; Tue, 9 Feb 2010 15:07:30 +0000 (UTC) (envelope-from rbgarga@gmail.com) Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54]) by mx1.freebsd.org (Postfix) with ESMTP id 471208FC19; Tue, 9 Feb 2010 15:07:28 +0000 (UTC) Received: by wwj40 with SMTP id 40so2255718wwj.13 for ; Tue, 09 Feb 2010 07:07:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=htuv38ZFPp+RmVanTLT4eIAp7DlnAgOKRGvdJGCztlU=; b=vnWdybNVX8+VGM67AFgjQY9EiXju6Mto7vwagunOVYOCbOnPoHe5zd69qTfy0qcZ0l Qzzjr7SXnpetW2GPNTFxwNTwQX2jruNmidvSv9voTQoOwyh/SwPRHAkx26aZSLoOAHp4 IvCpae+k76z71JAbNp0dCu6C/jviUljKr/66M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=njHUWC3hWOAuOCt4XQGsve2jsmJREFASkdEQ+4LFzUX7nEEJ86IbRq/kc9ntnd2HVP e3sxOIPdkoSmq0p3DUpGg7iQQ4r1pjARKoqtkxehsgzXU7kHg2XV/9Na+sAdmbKnaxxr uNCjaPm7h1qz0pjhL6t0uE1eR+hddHomCflC4= MIME-Version: 1.0 Received: by 10.216.90.18 with SMTP id d18mr2191419wef.225.1265728047959; Tue, 09 Feb 2010 07:07:27 -0800 (PST) In-Reply-To: <201002090552.o195qZcD074581@svn.freebsd.org> References: <201002090552.o195qZcD074581@svn.freebsd.org> From: Renato Botelho Date: Tue, 9 Feb 2010 13:07:07 -0200 Message-ID: <747dc8f31002090707p5734d7ci9d1477c38e59441f@mail.gmail.com> To: Marcel Moolenaar 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: r203696 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 15:07:30 -0000 On Tue, Feb 9, 2010 at 3:52 AM, Marcel Moolenaar wrote= : > Author: marcel > Date: Tue Feb =A09 05:52:35 2010 > New Revision: 203696 > URL: http://svn.freebsd.org/changeset/base/203696 > > Log: > =A0Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can > =A0obtain the memory map of the traced process. PT_VM_TIMESTAMP can be > =A0used to check if the memory map changed since the last time to avoid > =A0iterating over all the VM entries unnecesarily. > > =A0MFC after: =A0 =A01 month After this commit i couldn't build amd64 kernel anymore. I got this: -------------------------------------------------------------- >>> stage 3.2: building everything -------------------------------------------------------------- cd /usr/obj/usr/src/sys/GARGA; MAKEOBJDIRPREFIX=3D/usr/obj MACHINE_ARCH=3Damd64 MACHINE=3Damd64 CPUTYPE=3D GROFF_BIN_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/bin GROFF_FONT_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/share/groff_font GROFF_TMAC_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/share/tmac _SHLIBDIRPREFIX=3D/usr/obj/usr/src/tmp VERSION=3D"FreeBSD 9.0-CURRENT amd64 900009" INSTALL=3D"sh /usr/src/tools/install.sh" PATH=3D/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr= /bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/u= sr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/s= bin:/usr/bin NO_CTF=3D1 /usr/obj/usr/src/make.amd64/make KERNEL=3Dkernel all -DNO_MODULES_OBJ cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=3D8000 --param inline-unit-growth=3D100 --param large-function-growth=3D1000 -fno-omit-frame-pointer -mcmodel=3Dkernel -mno-red-zone -mfpmath=3D387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/src/sys/kern/sys_process.c /usr/src/sys/kern/sys_process.c: In function 'ptrace': /usr/src/sys/kern/sys_process.c:520: error: 'union ' has no member named 'pve32' /usr/src/sys/kern/sys_process.c:520: error: 'union ' has no member named 'pve32' /usr/src/sys/kern/sys_process.c:535: error: 'union ' has no member named 'pve32' /usr/src/sys/kern/sys_process.c:535: error: 'union ' has no member named 'pve32' --=20 Renato Botelho From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 16:18:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9059106566B; Tue, 9 Feb 2010 16:18:44 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C85B18FC1A; Tue, 9 Feb 2010 16:18:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19GIi0n017626; Tue, 9 Feb 2010 16:18:44 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19GIi1V017624; Tue, 9 Feb 2010 16:18:44 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002091618.o19GIi1V017624@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 9 Feb 2010 16:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203706 - stable/7/sbin/dumpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 16:18:44 -0000 Author: ru Date: Tue Feb 9 16:18:44 2010 New Revision: 203706 URL: http://svn.freebsd.org/changeset/base/203706 Log: MFC: r198231: Properly re-create "-s size" argument to newfs(8). Approved by: re (kib) Modified: stable/7/sbin/dumpfs/dumpfs.c Directory Properties: stable/7/sbin/dumpfs/ (props changed) Modified: stable/7/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/7/sbin/dumpfs/dumpfs.c Tue Feb 9 15:23:15 2010 (r203705) +++ stable/7/sbin/dumpfs/dumpfs.c Tue Feb 9 16:18:44 2010 (r203706) @@ -413,7 +413,7 @@ marshal(const char *name) break; } /* -p..r unimplemented */ - printf("-s %jd ", (intmax_t)fs->fs_size); + printf("-s %jd ", (intmax_t)fsbtodb(fs, fs->fs_size)); printf("%s ", disk.d_name); printf("\n"); From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 16:43:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E281106566B; Tue, 9 Feb 2010 16:43:27 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id CE5DE8FC0C; Tue, 9 Feb 2010 16:43:26 +0000 (UTC) Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NetBN-000P1e-RM; Tue, 09 Feb 2010 19:43:25 +0300 Date: Tue, 9 Feb 2010 19:43:20 +0300 From: Ruslan Ermilov To: Gavin Atkinson Message-ID: <20100209164320.GG72929@edoofus.dev.vega.ru> References: <201002061339.o16Dd82m039449@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201002061339.o16Dd82m039449@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203547 - head/sbin/sysctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 16:43:27 -0000 On Sat, Feb 06, 2010 at 01:39:08PM +0000, Gavin Atkinson wrote: > Author: gavin > Date: Sat Feb 6 13:39:08 2010 > New Revision: 203547 > URL: http://svn.freebsd.org/changeset/base/203547 > > Log: > Add the -i option to the synopsis. > > Submitted by: dhw > MFC after: 1 week (with r203310) > > Modified: > head/sbin/sysctl/sysctl.8 Please also add it to the program's usage(). Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 17:16:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 653C51065698; Tue, 9 Feb 2010 17:16: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 554218FC17; Tue, 9 Feb 2010 17:16:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19HGD9h030345; Tue, 9 Feb 2010 17:16:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19HGDD2030343; Tue, 9 Feb 2010 17:16:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002091716.o19HGDD2030343@svn.freebsd.org> From: Warner Losh Date: Tue, 9 Feb 2010 17:16: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: r203707 - head/usr.sbin/wake X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 17:16:13 -0000 Author: imp Date: Tue Feb 9 17:16:13 2010 New Revision: 203707 URL: http://svn.freebsd.org/changeset/base/203707 Log: Anything that casts struct sockaddr * to struct sockaddr_foo is safe due to careful design. We've not yet figured out how to properly annotate the sockaddr structs to communicate this to the compiler and there's a number of constructs in the tree that make this annotation challenging. As such, reduce warns to 3 here because this code really isn't warns 6 safe, even if it kinda sorta appears to be on intel (which has no such alignment restrictions). Warns 4 adds the -Wcast-align warning. # fixes the mips tinderbox build Modified: head/usr.sbin/wake/Makefile Modified: head/usr.sbin/wake/Makefile ============================================================================== --- head/usr.sbin/wake/Makefile Tue Feb 9 16:18:44 2010 (r203706) +++ head/usr.sbin/wake/Makefile Tue Feb 9 17:16:13 2010 (r203707) @@ -3,4 +3,6 @@ PROG= wake MAN= wake.8 +WARNS?= 3 + .include From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 17:20:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 652AD106568D; Tue, 9 Feb 2010 17:20:00 +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 54C1C8FC24; Tue, 9 Feb 2010 17:20:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19HK0bE031208; Tue, 9 Feb 2010 17:20:00 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19HK0F7031206; Tue, 9 Feb 2010 17:20:00 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002091720.o19HK0F7031206@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 9 Feb 2010 17:20: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: r203708 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 17:20:00 -0000 Author: marcel Date: Tue Feb 9 17:20:00 2010 New Revision: 203708 URL: http://svn.freebsd.org/changeset/base/203708 Log: Unbreak building kernels with COMPAT_32 enabled. The actual support for the PT_VM_ENTRY request from 32-bit processes will follow. Pointy hat: marcel Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Tue Feb 9 17:16:13 2010 (r203707) +++ head/sys/kern/sys_process.c Tue Feb 9 17:20:00 2010 (r203708) @@ -73,6 +73,17 @@ struct ptrace_io_desc32 { u_int32_t piod_addr; u_int32_t piod_len; }; + +struct ptrace_vm_entry32 { + uint32_t pve_cookie; + uint32_t pve_start; + uint32_t pve_end; + uint32_t pve_offset; + u_int pve_prot; + u_int pve_pathlen; + uint32_t pve_path; +}; + #endif /* @@ -484,6 +495,7 @@ ptrace(struct thread *td, struct ptrace_ struct fpreg32 fpreg32; struct reg32 reg32; struct ptrace_io_desc32 piod32; + struct ptrace_vm_entry32 pve32; #endif } r; void *addr; @@ -1075,6 +1087,13 @@ kern_ptrace(struct thread *td, int req, break; case PT_VM_ENTRY: +#ifdef COMPAT_IA32 + /* XXX to be implemented. */ + if (wrap32) { + error = EDOOFUS; + break; + } +#endif PROC_UNLOCK(p); error = ptrace_vm_entry(td, p, addr); PROC_LOCK(p); From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 17:30:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AECF1106566C; Tue, 9 Feb 2010 17:30:53 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id 90FA18FC08; Tue, 9 Feb 2010 17:30:53 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KXL00IJG4NFRJ90@asmtp029.mac.com>; Tue, 09 Feb 2010 09:30:53 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1002090152 From: Marcel Moolenaar In-reply-to: <20100209095722.GQ9991@deviant.kiev.zoral.com.ua> Date: Tue, 09 Feb 2010 09:30:51 -0800 Message-id: <65DCE552-7EFD-48F2-85A4-EA0F1F0638EE@mac.com> References: <201002090552.o195qZcD074581@svn.freebsd.org> <20100209095722.GQ9991@deviant.kiev.zoral.com.ua> To: Kostik Belousov X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 17:30:53 -0000 On Feb 9, 2010, at 1:57 AM, Kostik Belousov wrote: >> + map = &p->p_vmspace->vm_map; > I think this place lacks two safety measures: > - vmspace should be referenced by vmspace_acquire_ref() > - vm_map should be read-locked before iterating the map entries. > Vmspace may be shared between stopped debugee and other process using > rfork(2), thus modified despite the fact that traced process is stopped. Will do. I considered it, but thought it wouldn't be necessary because the process has stopped. I didn't consider the rfork(2) case with RFMEM. Good catch! >> + entry = map->header.next; >> + if (pve->pve_cookie != NULL) { >> + while (entry != &map->header && entry != pve->pve_cookie) >> + entry = entry->next; > Could the entry pointed by pve_cookie be reused between ptrace(PT_VM_ENTRY) > invocations ? I think the debugger should be informed about this situation, > otherwise interface is too unreliable. I didn't think so, but I also didn't consider rfork :-) We can always put the timestamp in the structure. Either (1) the tracing process fills it on request or (2) the request returns it on completion. (1) the kernel checks the timestamp with the one in the map and returns an appropriate error. If the request has a timestamp of 0, no checking is performed. (2) the tracing process can check the timestamp returned by each request and compare that with the return value of the PT_VM_TIMESTAMP and restart the iteration. Either way, if the entry is reused, the timestamp will have changed and either the kernel or the tracing process can take appropriate action. Thoughts? BTW: I prefer 2. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 17:55:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 257B9106566B; Tue, 9 Feb 2010 17:55:57 +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 EAC3D8FC1E; Tue, 9 Feb 2010 17:55:56 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 84D6446B49; Tue, 9 Feb 2010 12:55:56 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E103F8A01F; Tue, 9 Feb 2010 12:55:55 -0500 (EST) From: John Baldwin To: Attilio Rao Date: Tue, 9 Feb 2010 12:54:09 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <201002091456.o19EuA4w099388@svn.freebsd.org> In-Reply-To: <201002091456.o19EuA4w099388@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201002091254.09935.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 09 Feb 2010 12:55:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r203704 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 17:55:57 -0000 On Tuesday 09 February 2010 9:56:10 am Attilio Rao wrote: > Author: attilio > Date: Tue Feb 9 14:56:10 2010 > New Revision: 203704 > URL: http://svn.freebsd.org/changeset/base/203704 > > Log: > MFC r202889, r202940: > - Fix a race in sched_switch() of sched_4bsd. > Block the td_lock when acquiring explicitly sched_lock in order to prevent > races with other td_lock contenders. > - Merge the ULE's internal function thread_block_switch() into the global > thread_lock_block() and make the former semantic as the default for > thread_lock_block(). > - Split out an invariant in order to have better checks. Does this require an MFC of a change to cpu_switch() for sparc64? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 17:58:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92451106566B; Tue, 9 Feb 2010 17:58:59 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.223.172]) by mx1.freebsd.org (Postfix) with ESMTP id 2B9338FC15; Tue, 9 Feb 2010 17:58:58 +0000 (UTC) Received: by iwn2 with SMTP id 2so77113iwn.8 for ; Tue, 09 Feb 2010 09:58:58 -0800 (PST) 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=MAUIWO7CjyuOOyoXCbc6XtcbnIiSqU15muK4QkOA+3c=; b=b/0n1PLCyvz6oS6YbJdHAozjVXUd/5aejuZRT9ElJC1ph4fwI2E0uuGIcdwSlS2naS 8Bi8cBxl/qjRKI5hniH2G6mBMN9vxmqBlWByt0VA+82vPTze9nqHXrQ8BrD2MILB2rur 1aEud9AVnlY53SmxC+a25l6mN9gTI31TbJ2Zo= 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=m56SUzGiaK85r9eZ70RiBmUFRlSo53MXcI98iTwjOclio/HpcR7V2KSSFUSQLml1Ax 1YFUx7YMP4WsIqjKAJmDW0yQmlQRAKzqOzfzU8jOUfChV2EG8b+sCUL0j/a4FdmbZpQV AgZLD1d8pQ8mc+3U1s3SCpOo3+Um0LVDMRv3g= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.168.136 with SMTP id u8mr748040iby.56.1265738336256; Tue, 09 Feb 2010 09:58:56 -0800 (PST) In-Reply-To: <201002091254.09935.jhb@freebsd.org> References: <201002091456.o19EuA4w099388@svn.freebsd.org> <201002091254.09935.jhb@freebsd.org> Date: Tue, 9 Feb 2010 18:58:56 +0100 X-Google-Sender-Auth: a5629e27620976ce Message-ID: <3bbf2fe11002090958i850d50bt404998c3aefc5bfb@mail.gmail.com> From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r203704 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 17:58:59 -0000 2010/2/9 John Baldwin : > On Tuesday 09 February 2010 9:56:10 am Attilio Rao wrote: >> Author: attilio >> Date: Tue Feb =C2=A09 14:56:10 2010 >> New Revision: 203704 >> URL: http://svn.freebsd.org/changeset/base/203704 >> >> Log: >> =C2=A0 MFC r202889, r202940: >> =C2=A0 - Fix a race in sched_switch() of sched_4bsd. >> =C2=A0 =C2=A0 Block the td_lock when acquiring explicitly sched_lock in = order to prevent >> =C2=A0 =C2=A0 races with other td_lock contenders. >> =C2=A0 - Merge the ULE's internal function thread_block_switch() into th= e global >> =C2=A0 =C2=A0 thread_lock_block() and make the former semantic as the de= fault for >> =C2=A0 =C2=A0 thread_lock_block(). >> =C2=A0 - Split out an invariant in order to have better checks. > > Does this require an MFC of a change to cpu_switch() for sparc64? It is already done by marius. (I waited for his work before to let this go in). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 18:10:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D702106568D; Tue, 9 Feb 2010 18:10:56 +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 8C5AE8FC1B; Tue, 9 Feb 2010 18:10:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19IAuiR042483; Tue, 9 Feb 2010 18:10:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19IAuiw042479; Tue, 9 Feb 2010 18:10:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002091810.o19IAuiw042479@svn.freebsd.org> From: Warner Losh Date: Tue, 9 Feb 2010 18:10: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: r203710 - head/usr.sbin/rpcbind X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 18:10:56 -0000 Author: imp Date: Tue Feb 9 18:10:56 2010 New Revision: 203710 URL: http://svn.freebsd.org/changeset/base/203710 Log: When you have multiple addresses on the same network on different interfaces (such as when you are part of a carp pool), and you run rpcbind -h to restrict which interfaces have rpc services, rpcbind can none-the-less return addresses that aren't in the -h list. This patch enforces the rule that when you specify -h on the command line, then services returned from rpcbind must be to one of the addresses listed in -h, or be a loopback address (since localhost is implicit when running -h). The root cause of this is the assumption in addrmerge that there can be only one interface that matches a given network IP address. This turns out not to be the case. To retain historical behavior, I didn't try to fix the routine to prefer the address that the request came into, since I didn't know the side effects that might cause in the normal case. My quick analysis suggests that it wouldn't be a problem, but since this code is tricky I opted for the more conservative patch of only restricting the reply when -h is in effect. Hence, this change will have no effect when you are running rpcbind without -h. Reviewed by: alfred@ Sponsored by: iX Systems MFC after: 2 weeks Modified: head/usr.sbin/rpcbind/rpcbind.c head/usr.sbin/rpcbind/rpcbind.h head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.c Tue Feb 9 17:29:04 2010 (r203709) +++ head/usr.sbin/rpcbind/rpcbind.c Tue Feb 9 18:10:56 2010 (r203710) @@ -92,6 +92,7 @@ int oldstyle_local = 0; int verboselog = 0; char **hosts = NULL; +struct sockaddr **bound_sa; int ipv6_only = 0; int nhosts = 0; int on = 1; @@ -119,6 +120,7 @@ static void rbllist_add(rpcprog_t, rpcve struct netbuf *); static void terminate(int); static void parseargs(int, char *[]); +static void update_bound_sa(void); int main(int argc, char *argv[]) @@ -130,6 +132,8 @@ main(int argc, char *argv[]) parseargs(argc, argv); + update_bound_sa(); + /* Check that another rpcbind isn't already running. */ if ((rpcbindlockfd = (open(RPCBINDDLOCK, O_RDONLY|O_CREAT, 0444))) == -1) @@ -323,8 +327,7 @@ init_transport(struct netconfig *nconf) * If no hosts were specified, just bind to INADDR_ANY. * Otherwise make sure 127.0.0.1 is added to the list. */ - nhostsbak = nhosts; - nhostsbak++; + nhostsbak = nhosts + 1; hosts = realloc(hosts, nhostsbak * sizeof(char *)); if (nhostsbak == 1) hosts[0] = "*"; @@ -657,6 +660,75 @@ error: return (1); } +/* + * Create the list of addresses that we're bound to. Normally, this + * list is empty because we're listening on the wildcard address + * (nhost == 0). If -h is specified on the command line, then + * bound_sa will have a list of the addresses that the program binds + * to specifically. This function takes that list and converts them to + * struct sockaddr * and stores them in bound_sa. + */ +static void +update_bound_sa(void) +{ + struct addrinfo hints, *res = NULL; + int i; + + if (nhosts == 0) + return; + bound_sa = malloc(sizeof(*bound_sa) * nhosts); + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + for (i = 0; i < nhosts; i++) { + if (getaddrinfo(hosts[i], NULL, &hints, &res) != 0) + continue; + bound_sa[i] = malloc(res->ai_addrlen); + memcpy(bound_sa[i], res->ai_addr, res->ai_addrlen); + } +} + +/* + * Match the sa against the list of addresses we've bound to. If + * we've not specifically bound to anything, we match everything. + * Otherwise, if the IPv4 or IPv6 address matches one of the addresses + * in bound_sa, we return true. If not, we return false. + */ +int +listen_addr(const struct sockaddr *sa) +{ + int i; + + /* + * If nhosts == 0, then there were no -h options on the + * command line, so all addresses are addresses we're + * listening to. + */ + if (nhosts == 0) + return 1; + for (i = 0; i < nhosts; i++) { + if (bound_sa[i] == NULL || + sa->sa_family != bound_sa[i]->sa_family) + continue; + switch (sa->sa_family) { + case AF_INET: + if (memcmp(&SA2SINADDR(sa), &SA2SINADDR(bound_sa[i]), + sizeof(struct in_addr)) == 0) + return (1); + break; +#ifdef INET6 + case AF_INET6: + if (memcmp(&SA2SIN6ADDR(sa), &SA2SIN6ADDR(bound_sa[i]), + sizeof(struct in6_addr)) == 0) + return (1); + break; +#endif + default: + break; + } + } + return (0); +} + static void rbllist_add(rpcprog_t prog, rpcvers_t vers, struct netconfig *nconf, struct netbuf *addr) Modified: head/usr.sbin/rpcbind/rpcbind.h ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.h Tue Feb 9 17:29:04 2010 (r203709) +++ head/usr.sbin/rpcbind/rpcbind.h Tue Feb 9 18:10:56 2010 (r203710) @@ -134,6 +134,7 @@ void read_warmstart(void); char *addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr, char *netid); +int listen_addr(const struct sockaddr *sa); void network_init(void); struct sockaddr *local_sa(int); @@ -141,4 +142,12 @@ struct sockaddr *local_sa(int); #define RPCB_ALLVERS 0 #define RPCB_ONEVERS 1 +/* To convert a struct sockaddr to IPv4 or IPv6 address */ +#define SA2SIN(sa) ((struct sockaddr_in *)(sa)) +#define SA2SINADDR(sa) (SA2SIN(sa)->sin_addr) +#ifdef INET6 +#define SA2SIN6(sa) ((struct sockaddr_in6 *)(sa)) +#define SA2SIN6ADDR(sa) (SA2SIN6(sa)->sin6_addr) +#endif + #endif /* rpcbind_h */ Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Tue Feb 9 17:29:04 2010 (r203709) +++ head/usr.sbin/rpcbind/util.c Tue Feb 9 18:10:56 2010 (r203710) @@ -58,13 +58,6 @@ #include "rpcbind.h" -#define SA2SIN(sa) ((struct sockaddr_in *)(sa)) -#define SA2SINADDR(sa) (SA2SIN(sa)->sin_addr) -#ifdef INET6 -#define SA2SIN6(sa) ((struct sockaddr_in6 *)(sa)) -#define SA2SIN6ADDR(sa) (SA2SIN6(sa)->sin6_addr) -#endif - static struct sockaddr_in *local_in4; #ifdef INET6 static struct sockaddr_in6 *local_in6; @@ -176,9 +169,13 @@ addrmerge(struct netbuf *caller, char *s goto freeit; /* - * Loop through all interfaces. For each interface, see if the - * network portion of its address is equal to that of the client. - * If so, we have found the interface that we want to use. + * Loop through all interfaces. For each interface, see if it + * is either the loopback interface (which we always listen + * on) or is one of the addresses the program bound to (the + * wildcard by default, or a subset if -h is specified) and + * the network portion of its address is equal to that of the + * client. If so, we have found the interface that we want to + * use. */ bestif = NULL; for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) { @@ -189,6 +186,9 @@ addrmerge(struct netbuf *caller, char *s !(ifap->ifa_flags & IFF_UP)) continue; + if (!(ifap->ifa_flags & IFF_LOOPBACK) && !listen_addr(ifsa)) + continue; + switch (hint_sa->sa_family) { case AF_INET: /* From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 18:22:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6324C106568F; Tue, 9 Feb 2010 18:22:26 +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 52B818FC21; Tue, 9 Feb 2010 18:22:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19IMQl4045063; Tue, 9 Feb 2010 18:22:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19IMQtM045060; Tue, 9 Feb 2010 18:22:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002091822.o19IMQtM045060@svn.freebsd.org> From: Xin LI Date: Tue, 9 Feb 2010 18:22: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: r203711 - in head: tools/build/mk usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 18:22:26 -0000 Author: delphij Date: Tue Feb 9 18:22:26 2010 New Revision: 203711 URL: http://svn.freebsd.org/changeset/base/203711 Log: As it turns out, fmt(1) is being used by the base system as well as the ports tree extensively and it is probably a good idea to keep it regardless of NO_MAIL setting. Reported by: Alexander Best Reviewed by: antoine X-MFC-With: r203584 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/Makefile Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 9 18:10:56 2010 (r203710) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 9 18:22:26 2010 (r203711) @@ -1539,7 +1539,6 @@ OLD_FILES+=usr/share/man/man8/pac.8.gz .if ${MK_MAIL} == no OLD_FILES+=usr/bin/Mail OLD_FILES+=usr/bin/biff -OLD_FILES+=usr/bin/fmt OLD_FILES+=usr/bin/from OLD_FILES+=usr/bin/mail OLD_FILES+=usr/bin/mailx Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Tue Feb 9 18:10:56 2010 (r203710) +++ head/usr.bin/Makefile Tue Feb 9 18:22:26 2010 (r203711) @@ -66,7 +66,7 @@ SUBDIR= alias \ ${_file2c} \ find \ finger \ - ${_fmt} \ + fmt \ fold \ ${_from} \ fstat \ @@ -296,7 +296,6 @@ _locate= locate # XXX msgs? .if ${MK_MAIL} != "no" _biff= biff -_fmt= fmt _from= from _mail= mail _msgs= msgs From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 18:40:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64AB51065672; Tue, 9 Feb 2010 18:40:40 +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 53E088FC14; Tue, 9 Feb 2010 18:40:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19IeeHm049079; Tue, 9 Feb 2010 18:40:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19Ieetr049077; Tue, 9 Feb 2010 18:40:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002091840.o19Ieetr049077@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 9 Feb 2010 18:40: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: r203713 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 18:40:40 -0000 Author: marcel Date: Tue Feb 9 18:40:40 2010 New Revision: 203713 URL: http://svn.freebsd.org/changeset/base/203713 Log: Add description for libefi. Pointed out by: ru Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Tue Feb 9 18:34:42 2010 (r203712) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Tue Feb 9 18:40:40 2010 (r203713) @@ -43,6 +43,7 @@ .ds doc-str-Lb-libdevstat Device Statistics Library (libdevstat, \-ldevstat) .ds doc-str-Lb-libdisk Interface to Slice and Partition Labels Library (libdisk, \-ldisk) .ds doc-str-Lb-libedit Line Editor and History Library (libedit, \-ledit) +.ds doc-str-Lb-libefi EFI Runtime Services Library (libefi, \-lefi) .ds doc-str-Lb-libelf ELF Parsing Library (libelf, \-lelf) .ds doc-str-Lb-libfetch File Transfer Library (libfetch, \-lfetch) .ds doc-str-Lb-libgeom Userland API Library for kernel GEOM subsystem (libgeom, \-lgeom) From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 18:41:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C2451065698; Tue, 9 Feb 2010 18:41:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 77F458FC15; Tue, 9 Feb 2010 18:41:00 +0000 (UTC) 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 o19IejAb063433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Feb 2010 20:40:45 +0200 (EET) (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 o19Iejrl058885; Tue, 9 Feb 2010 20:40:45 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o19Iej3g058883; Tue, 9 Feb 2010 20:40:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 9 Feb 2010 20:40:43 +0200 From: Kostik Belousov To: Marcel Moolenaar Message-ID: <20100209184043.GV9991@deviant.kiev.zoral.com.ua> References: <201002090552.o195qZcD074581@svn.freebsd.org> <20100209095722.GQ9991@deviant.kiev.zoral.com.ua> <65DCE552-7EFD-48F2-85A4-EA0F1F0638EE@mac.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NBQMqqtZQBFxm+aD" Content-Disposition: inline In-Reply-To: <65DCE552-7EFD-48F2-85A4-EA0F1F0638EE@mac.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 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 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 18:41:04 -0000 --NBQMqqtZQBFxm+aD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 09, 2010 at 09:30:51AM -0800, Marcel Moolenaar wrote: >=20 > On Feb 9, 2010, at 1:57 AM, Kostik Belousov wrote: > >> + map =3D &p->p_vmspace->vm_map; > > I think this place lacks two safety measures: > > - vmspace should be referenced by vmspace_acquire_ref() > > - vm_map should be read-locked before iterating the map entries. >=20 > > Vmspace may be shared between stopped debugee and other process using > > rfork(2), thus modified despite the fact that traced process is stopped. >=20 > Will do. I considered it, but thought it wouldn't be necessary > because the process has stopped. I didn't consider the rfork(2) > case with RFMEM. >=20 > Good catch! >=20 >=20 > >> + entry =3D map->header.next; > >> + if (pve->pve_cookie !=3D NULL) { > >> + while (entry !=3D &map->header && entry !=3D pve->pve_cookie) > >> + entry =3D entry->next; > > Could the entry pointed by pve_cookie be reused between ptrace(PT_VM_EN= TRY) > > invocations ? I think the debugger should be informed about this situat= ion, > > otherwise interface is too unreliable. >=20 > I didn't think so, but I also didn't consider rfork :-) >=20 > We can always put the timestamp in the structure. Either (1) the > tracing process fills it on request or (2) the request returns > it on completion. >=20 > (1) the kernel checks the timestamp with the one in the map and > returns an appropriate error. If the request has a timestamp > of 0, no checking is performed. > (2) the tracing process can check the timestamp returned by each > request and compare that with the return value of the > PT_VM_TIMESTAMP and restart the iteration. >=20 > Either way, if the entry is reused, the timestamp will have changed > and either the kernel or the tracing process can take appropriate > action. >=20 > Thoughts? >=20 > BTW: I prefer 2. I agree that #2 looks preferably, except that I consider it more convenient when libc syscall wrapper return value is 0/-1 instead of -1/some data. This means that timestamp might be added to the existing struct ptrace_vm_entry. --NBQMqqtZQBFxm+aD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktxrCoACgkQC3+MBN1Mb4igLwCePYaasI0o2JtA0cOLSJONSbL3 w6YAoK7sPE73mRd5o0z+rJrbszMaXWBB =zEHG -----END PGP SIGNATURE----- --NBQMqqtZQBFxm+aD-- From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 18:43:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 600241065679; Tue, 9 Feb 2010 18:43:20 +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 4F8B08FC15; Tue, 9 Feb 2010 18:43:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19IhK1I049720; Tue, 9 Feb 2010 18:43:20 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19IhK4a049718; Tue, 9 Feb 2010 18:43:20 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002091843.o19IhK4a049718@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 9 Feb 2010 18:43: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: r203714 - head/lib/libefi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 18:43:20 -0000 Author: marcel Date: Tue Feb 9 18:43:20 2010 New Revision: 203714 URL: http://svn.freebsd.org/changeset/base/203714 Log: Various fixes like spelling, style and syntax. Submitted by: ru (thanks!) Modified: head/lib/libefi/libefi.3 Modified: head/lib/libefi/libefi.3 ============================================================================== --- head/lib/libefi/libefi.3 Tue Feb 9 18:40:40 2010 (r203713) +++ head/lib/libefi/libefi.3 Tue Feb 9 18:43:20 2010 (r203714) @@ -25,24 +25,28 @@ .\" .\" $FreeBSD$ .\" -.Dd Januari 29, 2010 +.Dd January 29, 2010 .Dt LIBEFI 3 .Os .Sh NAME .Nm efi_getvar , efi_nextvarname , efi_setvar -.Nd Interface for accessing the EFI variable services +.Nd "interface for accessing the EFI variable services" .Sh LIBRARY .Lb libefi .Sh SYNOPSIS .In libefi.h .Ft int -.Fn efi_getvar "char *name" "uuid_t *vendor" "uint32_t *attrib" \ - "size_t *datasize" "void *data" +.Fo efi_getvar +.Fa "char *name" "uuid_t *vendor" "uint32_t *attrib" +.Fa "size_t *datasize" "void *data" +.Fc .Ft int .Fn efi_nextvarname "size_t *namesize" "char *name" "uuid_t *vendor" .Ft int -.Fn efi_setvar "char *name" "uuid_t *vendor" "uint32_t attrib" \ - "size_t datasize" "void *data" +.Fo efi_setvar +.Fa "char *name" "uuid_t *vendor" "uint32_t attrib" +.Fa "size_t datasize" "void *data" +.Fc .Sh DESCRIPTION The .Nm libefi @@ -53,18 +57,19 @@ The .Fn efi_nextvarname function is used to enumerate the variables. The -.Nm namesize +.Fa namesize parameter needs to be set to the size of the buffer pointed to by -.Nm name . +.Fa name . On return, -.Nm namesize -is set to the length of the variable name (including the terminating '\\0') +.Fa namesize +is set to the length of the variable name (including the terminating +.Ql \e0 ) irrespective of whether the buffer was big enough. The buffer pointed to by -.Nm name +.Fa name contains the full or partial variable name on return. Only on successful completion of the request is the -.Nm vendor +.Fa vendor updated. The values returned should be passed to successive calls to .Fn efi_nextvarname @@ -76,11 +81,11 @@ can be passed to .Fn efi_getvar to obtain the value and attribute of the variable. The buffer that is to contain the value is specified by -.Nm data +.Fa data and the size of the buffer is given by -.Nm datasize . +.Fa datasize . The attribute pointed to by -.Nm attrib +.Fa attrib consists of the bit values defined by the EFI specification. .Pp Variables can be created, modified and deleted using the @@ -91,15 +96,17 @@ order for the request to succeed. Note that for runtime accessable variables the boottime accessable bit must be set as well. To delete a variable, set -.Nm datasize +.Fa datasize to 0. .Pp The vendor UUID is used to avoid collisions between variable names of different vendors. -Variables created for use by FreeBSD should use the -.Nm EFI_FREEBSD_VARIABLE +Variables created for use by +.Fx +should use the +.Dv EFI_FREEBSD_VARIABLE UUID as defined in the -.Nm libefi +.In libefi.h header file. .Sh RETURN VALUES Upon successful completion, these functions return 0. @@ -127,10 +134,10 @@ the buffer provided. The .Nm libefi library first appeared in -.Fx 9 +.Fx 9.0 for the ia64 architecture. .Sh AUTHORS The .Nm libefi -library and corresponding manual page were written by +library and this manual page were written by .An Marcel Moolenaar Aq marcel@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 18:43:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4F54106566C; Tue, 9 Feb 2010 18:43:50 +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 B433B8FC19; Tue, 9 Feb 2010 18:43:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19Ihof0049853; Tue, 9 Feb 2010 18:43:50 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19IhoTH049851; Tue, 9 Feb 2010 18:43:50 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201002091843.o19IhoTH049851@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 9 Feb 2010 18:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203715 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 18:43:50 -0000 Author: bms Date: Tue Feb 9 18:43:50 2010 New Revision: 203715 URL: http://svn.freebsd.org/changeset/base/203715 Log: MFC Revision: 203574 Add sane-port (Scanner Access Now Easy) as port 6566. Obtained from: http://www.iana.org/assignments/port-numbers Modified: stable/8/etc/services (contents, props changed) Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/services ============================================================================== --- stable/8/etc/services Tue Feb 9 18:43:20 2010 (r203714) +++ stable/8/etc/services Tue Feb 9 18:43:50 2010 (r203715) @@ -2338,6 +2338,8 @@ sge_execd 6445/tcp #Grid Engine Execut sge_execd 6445/udp #Grid Engine Execution Service xdsxdm 6558/tcp xdsxdm 6558/udp +sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port +sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port ircd 6667/tcp #Internet Relay Chat (unoffical) acmsoda 6969/tcp acmsoda 6969/udp From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 19:12:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63BA6106568D; Tue, 9 Feb 2010 19:12:07 +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 3F01E8FC1C; Tue, 9 Feb 2010 19:12:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19JC7JH056105; Tue, 9 Feb 2010 19:12:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19JC7Ug056104; Tue, 9 Feb 2010 19:12:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002091912.o19JC7Ug056104@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 9 Feb 2010 19: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: r203716 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 19:12:07 -0000 Author: yongari Date: Tue Feb 9 19:12:06 2010 New Revision: 203716 URL: http://svn.freebsd.org/changeset/base/203716 Log: Move device specific flag configuration to attach routine. The softc obtained in device probe wouldn't be the same one used in device attach. Drivers should not assume any values stored in softc structure in probe routine will be available for its attach routine. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Feb 9 18:43:50 2010 (r203715) +++ head/sys/dev/bge/if_bge.c Tue Feb 9 19:12:06 2010 (r203716) @@ -1993,10 +1993,6 @@ bge_probe(device_t dev) snprintf(buf, 96, "%s, %sASIC rev. %#08x", model, br != NULL ? "" : "unknown ", id); device_set_desc_copy(dev, buf); - if (pci_get_subvendor(dev) == DELL_VENDORID) - sc->bge_flags |= BGE_FLAG_NO_3LED; - if (did == BCOM_DEVICEID_BCM5755M) - sc->bge_flags |= BGE_FLAG_ADJUST_TRIM; return (0); } t++; @@ -2607,6 +2603,10 @@ bge_attach(device_t dev) sc->bge_flags |= BGE_FLAG_ADC_BUG; if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0) sc->bge_flags |= BGE_FLAG_5704_A0_BUG; + if (pci_get_subvendor(dev) == DELL_VENDORID) + sc->bge_flags |= BGE_FLAG_NO_3LED; + if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) + sc->bge_flags |= BGE_FLAG_ADJUST_TRIM; if (BGE_IS_5705_PLUS(sc) && !(sc->bge_flags & BGE_FLAG_ADJUST_TRIM)) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 19:13:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44766106566C; Tue, 9 Feb 2010 19:13:46 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 341158FC19; Tue, 9 Feb 2010 19:13:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19JDkt6056497; Tue, 9 Feb 2010 19:13:46 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19JDkVs056495; Tue, 9 Feb 2010 19:13:46 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002091913.o19JDkVs056495@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 9 Feb 2010 19:13: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: r203717 - head/sbin/sysctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 19:13:46 -0000 Author: gavin Date: Tue Feb 9 19:13:45 2010 New Revision: 203717 URL: http://svn.freebsd.org/changeset/base/203717 Log: Add -i to usage() Noticed by: ru MFC after: 5 days Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Tue Feb 9 19:12:06 2010 (r203716) +++ head/sbin/sysctl/sysctl.c Tue Feb 9 19:13:45 2010 (r203717) @@ -75,7 +75,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehNnoqx] name[=value] ...", + "usage: sysctl [-bdehiNnoqx] name[=value] ...", " sysctl [-bdehNnoqx] -a"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 19:18:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 371421065676; Tue, 9 Feb 2010 19:18:10 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout023.mac.com (asmtpout023.mac.com [17.148.16.98]) by mx1.freebsd.org (Postfix) with ESMTP id 1CC2A8FC19; Tue, 9 Feb 2010 19:18:09 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp023.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KXL00BRQ9LNP390@asmtp023.mac.com>; Tue, 09 Feb 2010 11:17:48 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1002090179 From: Marcel Moolenaar In-reply-to: <20100209184043.GV9991@deviant.kiev.zoral.com.ua> Date: Tue, 09 Feb 2010 11:17:47 -0800 Message-id: <896B58E6-12EA-48AB-86C2-5BA9F0C59512@mac.com> References: <201002090552.o195qZcD074581@svn.freebsd.org> <20100209095722.GQ9991@deviant.kiev.zoral.com.ua> <65DCE552-7EFD-48F2-85A4-EA0F1F0638EE@mac.com> <20100209184043.GV9991@deviant.kiev.zoral.com.ua> To: Kostik Belousov X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 19:18:10 -0000 On Feb 9, 2010, at 10:40 AM, Kostik Belousov wrote: *snip* Action items: >>> - vmspace should be referenced by vmspace_acquire_ref() >>> - vm_map should be read-locked before iterating the map entries. *snip* >> We can always put the timestamp in the structure. *snip* >> (2) the tracing process can check the timestamp returned by each >> request and compare that with the return value of the >> PT_VM_TIMESTAMP and restart the iteration. *snip* > I agree that #2 looks preferably, except that I consider it more > convenient when libc syscall wrapper return value is 0/-1 instead > of -1/some data. This means that timestamp might be added to > the existing struct ptrace_vm_entry. Of course. When I said returned, I didn't mean returned as the return value from ptrace. I used return to convey origin and direction of the information flow (see also the first sentence of my response :-) I'll implement it and send a patch for review to avoid unnecessary repository churn... Thanks! -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 19:27:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FD6A106568D; Tue, 9 Feb 2010 19:27:54 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EE6F8FC2B; Tue, 9 Feb 2010 19:27:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19JRsqR059667; Tue, 9 Feb 2010 19:27:54 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19JRsQY059665; Tue, 9 Feb 2010 19:27:54 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201002091927.o19JRsQY059665@svn.freebsd.org> From: Qing Li Date: Tue, 9 Feb 2010 19:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203718 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 19:27:54 -0000 Author: qingli Date: Tue Feb 9 19:27:54 2010 New Revision: 203718 URL: http://svn.freebsd.org/changeset/base/203718 Log: MFC r203401 Some of the existing ppp and vpn related scripts create and set the IP addresses of the tunnel end points to the same value. In these cases the loopback route is not installed for the local end. Modified: stable/8/sys/netinet/in.c Directory Properties: stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Feb 9 19:13:45 2010 (r203717) +++ stable/8/sys/netinet/in.c Tue Feb 9 19:27:54 2010 (r203718) @@ -921,6 +921,12 @@ in_ifinit(struct ifnet *ifp, struct in_i if (ia->ia_addr.sin_addr.s_addr == INADDR_ANY) return (0); + if (ifp->if_flags & IFF_POINTOPOINT) { + if (ia->ia_dstaddr.sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr) + return (0); + } + + /* * add a loopback route to self */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 19:37:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62CA6106566B; Tue, 9 Feb 2010 19:37:12 +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 51AA08FC0A; Tue, 9 Feb 2010 19:37:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19JbCGc061780; Tue, 9 Feb 2010 19:37:12 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19JbCm6061778; Tue, 9 Feb 2010 19:37:12 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201002091937.o19JbCm6061778@svn.freebsd.org> From: Gabor Kovesdan Date: Tue, 9 Feb 2010 19:37: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: r203719 - head/lib/libc/nls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 19:37:12 -0000 Author: gabor Date: Tue Feb 9 19:37:12 2010 New Revision: 203719 URL: http://svn.freebsd.org/changeset/base/203719 Log: - Deal with some special cases [1] - style(9) nits Pointed out by: jilles [1] Approved by: delphij (mentor) Modified: head/lib/libc/nls/msgcat.c Modified: head/lib/libc/nls/msgcat.c ============================================================================== --- head/lib/libc/nls/msgcat.c Tue Feb 9 19:27:54 2010 (r203718) +++ head/lib/libc/nls/msgcat.c Tue Feb 9 19:37:12 2010 (r203719) @@ -77,19 +77,22 @@ __FBSDID("$FreeBSD$"); #define NLERR ((nl_catd) -1) #define NLRETERR(errc) { errno = errc; return (NLERR); } -#define SAVEFAIL(n, e) { WLOCK(NLERR); \ - np = malloc(sizeof(struct catentry)); \ - if (np != NULL) { \ - np->name = strdup(n); \ - np->caterrno = e; \ - SLIST_INSERT_HEAD(&cache, np, list); \ - } \ - UNLOCK; \ - } +#define SAVEFAIL(n, l, e) { WLOCK(NLERR); \ + np = malloc(sizeof(struct catentry)); \ + if (np != NULL) { \ + np->name = strdup(n); \ + np->path = NULL; \ + np->lang = (l == NULL) ? NULL : strdup(l); \ + np->caterrno = e; \ + SLIST_INSERT_HEAD(&cache, np, list); \ + } \ + UNLOCK; \ + errno = e; \ + } static nl_catd load_msgcat(const char *, const char *, const char *); -static pthread_rwlock_t rwlock; +static pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER; struct catentry { SLIST_ENTRY(catentry) list; @@ -114,10 +117,12 @@ catopen(const char *name, int type) int saverr, spcleft; char path[PATH_MAX]; + /* sanity checking */ if (name == NULL || *name == '\0') NLRETERR(EINVAL); if (strchr(name, '/') != NULL) + /* have a pathname */ lang = NULL; else { if (type == NL_CAT_LOCALE) @@ -135,12 +140,14 @@ catopen(const char *name, int type) /* Try to get it from the cache first */ RLOCK(NLERR); SLIST_FOREACH(np, &cache, list) { - if (strcmp(np->name, name) == 0) { + if ((strcmp(np->name, name) == 0) && + ((lang != NULL && np->lang != NULL && + strcmp(np->lang, lang) == 0) || (np->lang == lang))) { if (np->caterrno != 0) { /* Found cached failing entry */ UNLOCK; NLRETERR(np->caterrno); - } else if (strcmp(np->lang, lang) == 0) { + } else { /* Found cached successful entry */ np->refcount++; UNLOCK; @@ -154,6 +161,7 @@ catopen(const char *name, int type) if (strchr(name, '/') != NULL) return (load_msgcat(name, name, lang)); + /* sanity checking */ if ((plang = cptr1 = strdup(lang)) == NULL) return (NLERR); if ((cptr = strchr(cptr1, '@')) != NULL) @@ -218,6 +226,7 @@ catopen(const char *name, int type) too_long: free(plang); free(base); + SAVEFAIL(name, lang, ENAMETOOLONG); NLRETERR(ENAMETOOLONG); } pathP += strlen(tmpptr); @@ -241,6 +250,7 @@ catopen(const char *name, int type) } free(plang); free(base); + SAVEFAIL(name, lang, ENOENT); NLRETERR(ENOENT); } @@ -317,6 +327,7 @@ catclose(nl_catd catd) { struct catentry *np; + /* sanity checking */ if (catd == NULL || catd == NLERR) { errno = EBADF; return (-1); @@ -325,13 +336,15 @@ catclose(nl_catd catd) /* Remove from cache if not referenced any more */ WLOCK(-1); SLIST_FOREACH(np, &cache, list) { - if ((np->catd->__size == catd->__size) && - memcmp((const void *)np->catd, (const void *)catd, np->catd->__size) == 0) { + if (catd == np->catd) { np->refcount--; if (np->refcount == 0) { munmap(catd->__data, (size_t)catd->__size); free(catd); SLIST_REMOVE(&cache, np, catentry, list); + free(np->name); + free(np->path); + free(np->lang); free(np); } break; @@ -357,10 +370,11 @@ load_msgcat(const char *path, const char /* path/name will never be NULL here */ /* One more try in cache; if it was not found by name, - it might still be found by absolute path. */ + * it might still be found by absolute path. + */ RLOCK(NLERR); SLIST_FOREACH(np, &cache, list) { - if (strcmp(np->path, path) == 0) { + if ((np->path != NULL) && (strcmp(np->path, path) == 0)) { np->refcount++; UNLOCK; return (np->catd); @@ -369,36 +383,46 @@ load_msgcat(const char *path, const char UNLOCK; if ((fd = _open(path, O_RDONLY)) == -1) { - SAVEFAIL(name, errno); - return (NLERR); + SAVEFAIL(name, lang, errno); + NLRETERR(errno); } if (_fstat(fd, &st) != 0) { - SAVEFAIL(name, errno); _close(fd); - return (NLERR); + SAVEFAIL(name, lang, EFTYPE); + NLRETERR(EFTYPE); } - data = mmap(0, (size_t)st.st_size, PROT_READ, MAP_FILE|MAP_SHARED, fd, - (off_t)0); - _close(fd); + /* If the file size cannot be held in size_t we cannot mmap() + * it to the memory. Probably, this will not be a problem given + * that catalog files are usually small. + */ + if (st.st_size > SIZE_T_MAX) { + _close(fd); + SAVEFAIL(name, lang, EFBIG); + NLRETERR(EFBIG); + } - if (data == MAP_FAILED) { - SAVEFAIL(name, errno); - return (NLERR); + if ((data = mmap(0, (size_t)st.st_size, PROT_READ, + MAP_FILE|MAP_SHARED, fd, (off_t)0)) == MAP_FAILED) { + int saved_errno = errno; + _close(fd); + SAVEFAIL(name, lang, saved_errno); + NLRETERR(saved_errno); } + _close(fd); if (ntohl((u_int32_t)((struct _nls_cat_hdr *)data)->__magic) != _NLS_MAGIC) { - SAVEFAIL(name, errno); munmap(data, (size_t)st.st_size); - NLRETERR(EINVAL); + SAVEFAIL(name, lang, EFTYPE); + NLRETERR(EFTYPE); } if ((catd = malloc(sizeof (*catd))) == NULL) { - SAVEFAIL(name, errno); munmap(data, (size_t)st.st_size); - return (NLERR); + SAVEFAIL(name, lang, ENOMEM); + NLRETERR(ENOMEM); } catd->__data = data; From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 20:58:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6E01106566B; Tue, 9 Feb 2010 20:58:39 +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 B60F58FC1E; Tue, 9 Feb 2010 20:58:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19Kwd8l079946; Tue, 9 Feb 2010 20:58:39 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19Kwdut079944; Tue, 9 Feb 2010 20:58:39 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201002092058.o19Kwdut079944@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 9 Feb 2010 20:58: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: r203721 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 20:58:39 -0000 Author: trasz Date: Tue Feb 9 20:58:39 2010 New Revision: 203721 URL: http://svn.freebsd.org/changeset/base/203721 Log: Add references to VOP_* man pages to vnode(9). Modified: head/share/man/man9/vnode.9 Modified: head/share/man/man9/vnode.9 ============================================================================== --- head/share/man/man9/vnode.9 Tue Feb 9 20:18:14 2010 (r203720) +++ head/share/man/man9/vnode.9 Tue Feb 9 20:58:39 2010 (r203721) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2003 +.Dd February 9, 2010 .Os .Dt VNODE 9 .Sh NAME @@ -161,6 +161,38 @@ interlock, will cause a LOR (Lock Order intertwining of VM Objects and Vnodes. .Sh SEE ALSO .Xr malloc 9 , +.Xr VOP_ACCESS 9 , +.Xr VOP_ACLCHECK 9 , +.Xr VOP_ADVLOCK 9 , +.Xr VOP_ATTRIB 9 , +.Xr VOP_BWRITE 9 , +.Xr VOP_CREATE 9 , +.Xr VOP_FSYNC 9 , +.Xr VOP_GETACL 9 , +.Xr VOP_GETEXTATTR 9 , +.Xr VOP_GETPAGES 9 , +.Xr VOP_GETVOBJECT 9 , +.Xr VOP_INACTIVE 9 , +.Xr VOP_IOCTL 9 , +.Xr VOP_LINK 9 , +.Xr VOP_LISTEXTATTR 9 , +.Xr VOP_LOCK 9 , +.Xr VOP_LOOKUP 9 , +.Xr VOP_OPENCLOSE 9 , +.Xr VOP_PATHCONF 9 , +.Xr VOP_PRINT 9 , +.Xr VOP_RDWR 9 , +.Xr VOP_READDIR 9 , +.Xr VOP_READLINK 9 , +.Xr VOP_REALLOCBLKS 9 , +.Xr VOP_REMOVE 9 , +.Xr VOP_RENAME 9 , +.Xr VOP_REVOKE 9 , +.Xr VOP_SETACL 9 , +.Xr VOP_SETEXTATTR 9 , +.Xr VOP_STRATEGY 9 , +.Xr VOP_VPTOCNP 9 , +.Xr VOP_VPTOFH 9 , .Xr VFS 9 .Sh AUTHORS This manual page was written by From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 21:01:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC5FA106566B; Tue, 9 Feb 2010 21:01:18 +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 BB7A88FC13; Tue, 9 Feb 2010 21:01:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19L1IG6080596; Tue, 9 Feb 2010 21:01:18 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19L1IQt080594; Tue, 9 Feb 2010 21:01:18 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201002092101.o19L1IQt080594@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 9 Feb 2010 21:01: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: r203722 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 21:01:18 -0000 Author: trasz Date: Tue Feb 9 21:01:18 2010 New Revision: 203722 URL: http://svn.freebsd.org/changeset/base/203722 Log: Remove VOP_VPTOFH(9) from references in VFS(9), as it's a VOP, not VFS operation. Modified: head/share/man/man9/VFS.9 Modified: head/share/man/man9/VFS.9 ============================================================================== --- head/share/man/man9/VFS.9 Tue Feb 9 20:58:39 2010 (r203721) +++ head/share/man/man9/VFS.9 Tue Feb 9 21:01:18 2010 (r203722) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 4, 2010 +.Dd February 9, 2010 .Os .Dt VFS 9 .Sh NAME @@ -53,7 +53,6 @@ rather than implementing empty functions .Xr VFS_SYNC 9 , .Xr VFS_UNMOUNT 9 , .Xr VFS_VGET 9 , -.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 21:24:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E9861065679; Tue, 9 Feb 2010 21:24:42 +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 5D60C8FC1A; Tue, 9 Feb 2010 21:24:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19LOglX085744; Tue, 9 Feb 2010 21:24:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19LOgnb085740; Tue, 9 Feb 2010 21:24:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002092124.o19LOgnb085740@svn.freebsd.org> From: Ed Schouten Date: Tue, 9 Feb 2010 21:24: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: r203723 - head/usr.bin/find X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 21:24:42 -0000 Author: ed Date: Tue Feb 9 21:24:41 2010 New Revision: 203723 URL: http://svn.freebsd.org/changeset/base/203723 Log: Don't let find(1) depend on struct timeb. This structure is deprecated and only used by ftime(2), which is part of libcompat. The second argument of get_date() is unused, which means we can just remove it entirely. Modified: head/usr.bin/find/extern.h head/usr.bin/find/function.c head/usr.bin/find/getdate.y Modified: head/usr.bin/find/extern.h ============================================================================== --- head/usr.bin/find/extern.h Tue Feb 9 21:01:18 2010 (r203722) +++ head/usr.bin/find/extern.h Tue Feb 9 21:24:41 2010 (r203723) @@ -43,8 +43,7 @@ PLAN *find_formplan(char **); PLAN *not_squish(PLAN *); PLAN *or_squish(PLAN *); PLAN *paren_squish(PLAN *); -struct timeb; -time_t get_date(char *, struct timeb *); +time_t get_date(char *); struct stat; void printlong(char *, char *, struct stat *); int queryuser(char **); Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Tue Feb 9 21:01:18 2010 (r203722) +++ head/usr.bin/find/function.c Tue Feb 9 21:24:41 2010 (r203723) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -1155,7 +1154,7 @@ c_newer(OPTION *option, char ***argvp) new = palloc(option); /* compare against what */ if (option->flags & F_TIME2_T) { - new->t_data = get_date(fn_or_tspec, (struct timeb *) 0); + new->t_data = get_date(fn_or_tspec); if (new->t_data == (time_t) -1) errx(1, "Can't parse date/time: %s", fn_or_tspec); } else { Modified: head/usr.bin/find/getdate.y ============================================================================== --- head/usr.bin/find/getdate.y Tue Feb 9 21:01:18 2010 (r203722) +++ head/usr.bin/find/getdate.y Tue Feb 9 21:24:41 2010 (r203723) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #else /* defined(vms) */ # include # include -# include #endif /* !defined(vms) */ #if defined (__STDC__) || defined (USG) @@ -69,7 +68,7 @@ static int yyparse(void); static int yylex(void); static int yyerror(const char *); -time_t get_date(char *, struct timeb *); +time_t get_date(char *); #define EPOCH 1970 #define HOUR(x) ((time_t)(x) * 60) @@ -849,58 +848,50 @@ difftm (struct tm *a, struct tm *b) } time_t -get_date(char *p, struct timeb *now) +get_date(char *p) { - struct tm *tm, gmt; - struct timeb ftz; + struct tm *tm, *gmt_ptr, gmt; + int tzoff; time_t Start; time_t tod; time_t nowtime; bzero (&gmt, sizeof(struct tm)); yyInput = p; - if (now == NULL) { - struct tm *gmt_ptr; - now = &ftz; - (void)time (&nowtime); + (void)time (&nowtime); - gmt_ptr = gmtime (&nowtime); - if (gmt_ptr != NULL) - { - /* Make a copy, in case localtime modifies *tm (I think - that comment now applies to *gmt_ptr, but I am too - lazy to dig into how gmtime and locatime allocate the - structures they return pointers to). */ - gmt = *gmt_ptr; - } - - if (! (tm = localtime (&nowtime))) - return -1; + gmt_ptr = gmtime (&nowtime); + if (gmt_ptr != NULL) + { + /* Make a copy, in case localtime modifies *tm (I think + that comment now applies to *gmt_ptr, but I am too + lazy to dig into how gmtime and locatime allocate the + structures they return pointers to). */ + gmt = *gmt_ptr; + } - if (gmt_ptr != NULL) - ftz.timezone = difftm (&gmt, tm) / 60; - else - /* We are on a system like VMS, where the system clock is - in local time and the system has no concept of timezones. - Hopefully we can fake this out (for the case in which the - user specifies no timezone) by just saying the timezone - is zero. */ - ftz.timezone = 0; + if (! (tm = localtime (&nowtime))) + return -1; - if(tm->tm_isdst) - ftz.timezone += 60; - } + if (gmt_ptr != NULL) + tzoff = difftm (&gmt, tm) / 60; else - { - nowtime = now->time; - } + /* We are on a system like VMS, where the system clock is + in local time and the system has no concept of timezones. + Hopefully we can fake this out (for the case in which the + user specifies no timezone) by just saying the timezone + is zero. */ + tzoff = 0; + + if(tm->tm_isdst) + tzoff += 60; tm = localtime(&nowtime); yyYear = tm->tm_year + 1900; yyMonth = tm->tm_mon + 1; yyDay = tm->tm_mday; - yyTimezone = now->timezone; + yyTimezone = tzoff; yyDSTmode = DSTmaybe; yyHour = 0; yyMinutes = 0; @@ -956,7 +947,7 @@ main(int ac, char *av[]) (void)printf("Enter date, or blank line to exit.\n\t> "); (void)fflush(stdout); while (gets(buff) && buff[0]) { - d = get_date(buff, (struct timeb *)NULL); + d = get_date(buff); if (d == -1) (void)printf("Bad format - couldn't convert.\n"); else From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 21:31:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E98821065670; Tue, 9 Feb 2010 21:31:53 +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 BF90E8FC17; Tue, 9 Feb 2010 21:31:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19LVrJx087350; Tue, 9 Feb 2010 21:31:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19LVrYQ087348; Tue, 9 Feb 2010 21:31:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002092131.o19LVrYQ087348@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 9 Feb 2010 21:31: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: r203724 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 21:31:54 -0000 Author: bz Date: Tue Feb 9 21:31:53 2010 New Revision: 203724 URL: http://svn.freebsd.org/changeset/base/203724 Log: Properly free resources when destroying the TCP hostcache while tearing down a network stack (in the VIMAGE jail+vnet case). For that break out the logic from tcp_hc_purge() into an internal function we can call from both, the sysctl handler and the tcp_hc_destroy(). Sponsored by: ISPsystem Reviewed by: silby, lstewart MFC After: 8 days Modified: head/sys/netinet/tcp_hostcache.c Modified: head/sys/netinet/tcp_hostcache.c ============================================================================== --- head/sys/netinet/tcp_hostcache.c Tue Feb 9 21:24:41 2010 (r203723) +++ head/sys/netinet/tcp_hostcache.c Tue Feb 9 21:31:53 2010 (r203724) @@ -115,6 +115,7 @@ static VNET_DEFINE(struct callout, tcp_h static struct hc_metrics *tcp_hc_lookup(struct in_conninfo *); static struct hc_metrics *tcp_hc_insert(struct in_conninfo *); static int sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS); +static void tcp_hc_purge_internal(int); static void tcp_hc_purge(void *); SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hostcache, CTLFLAG_RW, 0, @@ -235,10 +236,19 @@ tcp_hc_init(void) void tcp_hc_destroy(void) { - - /* XXX TODO walk the hashtable and free all entries */ + int i; callout_drain(&V_tcp_hc_callout); + + /* Purge all hc entries. */ + tcp_hc_purge_internal(1); + + /* Free the uma zone and the allocated hash table. */ + uma_zdestroy(V_tcp_hostcache.zone); + + for (i = 0; i < V_tcp_hostcache.hashsize; i++) + mtx_destroy(&V_tcp_hostcache.hashbase[i].hch_mtx); + free(V_tcp_hostcache.hashbase, M_HOSTCACHE); } #endif @@ -633,22 +643,14 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) } /* - * Expire and purge (old|all) entries in the tcp_hostcache. Runs - * periodically from the callout. + * Caller has to make sure the curvnet is set properly. */ static void -tcp_hc_purge(void *arg) +tcp_hc_purge_internal(int all) { - CURVNET_SET((struct vnet *) arg); struct hc_metrics *hc_entry, *hc_next; - int all = 0; int i; - if (V_tcp_hostcache.purgeall) { - all = 1; - V_tcp_hostcache.purgeall = 0; - } - for (i = 0; i < V_tcp_hostcache.hashsize; i++) { THC_LOCK(&V_tcp_hostcache.hashbase[i].hch_mtx); TAILQ_FOREACH_SAFE(hc_entry, @@ -664,6 +666,24 @@ tcp_hc_purge(void *arg) } THC_UNLOCK(&V_tcp_hostcache.hashbase[i].hch_mtx); } +} + +/* + * Expire and purge (old|all) entries in the tcp_hostcache. Runs + * periodically from the callout. + */ +static void +tcp_hc_purge(void *arg) +{ + CURVNET_SET((struct vnet *) arg); + int all = 0; + + if (V_tcp_hostcache.purgeall) { + all = 1; + V_tcp_hostcache.purgeall = 0; + } + + tcp_hc_purge_internal(all); callout_reset(&V_tcp_hc_callout, V_tcp_hostcache.prune * hz, tcp_hc_purge, arg); From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 22:05:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82A151065679; Tue, 9 Feb 2010 22:05:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 578408FC15; Tue, 9 Feb 2010 22:05:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19M5U9P094909; Tue, 9 Feb 2010 22:05:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19M5UAm094906; Tue, 9 Feb 2010 22:05:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002092205.o19M5UAm094906@svn.freebsd.org> From: Ed Maste Date: Tue, 9 Feb 2010 22:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203726 - stable/8/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 22:05:30 -0000 Author: emaste Date: Tue Feb 9 22:05:30 2010 New Revision: 203726 URL: http://svn.freebsd.org/changeset/base/203726 Log: MFC r198593: Rename aac_fast_intr to aac_filter to reflect its current use. Eliminate the fallback of using the filter as an interrupt handler, as it is no longer needed. Discussed with: scottl, jhb Modified: stable/8/sys/dev/aac/aac.c stable/8/sys/dev/aac/aacvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Tue Feb 9 22:01:42 2010 (r203725) +++ stable/8/sys/dev/aac/aac.c Tue Feb 9 22:05:30 2010 (r203726) @@ -909,8 +909,11 @@ aac_new_intr(void *arg) mtx_unlock(&sc->aac_io_lock); } +/* + * Interrupt filter for !NEW_COMM interface. + */ int -aac_fast_intr(void *arg) +aac_filter(void *arg) { struct aac_softc *sc; u_int16_t reason; @@ -2032,18 +2035,11 @@ aac_setup_intr(struct aac_softc *sc) } } else { if (bus_setup_intr(sc->aac_dev, sc->aac_irq, - INTR_TYPE_BIO, aac_fast_intr, NULL, + INTR_TYPE_BIO, aac_filter, NULL, sc, &sc->aac_intr)) { device_printf(sc->aac_dev, - "can't set up FAST interrupt\n"); - if (bus_setup_intr(sc->aac_dev, sc->aac_irq, - INTR_MPSAFE|INTR_TYPE_BIO, - NULL, (driver_intr_t *)aac_fast_intr, - sc, &sc->aac_intr)) { - device_printf(sc->aac_dev, - "can't set up MPSAFE interrupt\n"); - return (EINVAL); - } + "can't set up interrupt filter\n"); + return (EINVAL); } } return (0); Modified: stable/8/sys/dev/aac/aacvar.h ============================================================================== --- stable/8/sys/dev/aac/aacvar.h Tue Feb 9 22:01:42 2010 (r203725) +++ stable/8/sys/dev/aac/aacvar.h Tue Feb 9 22:05:30 2010 (r203726) @@ -441,7 +441,7 @@ extern int aac_shutdown(device_t dev); extern int aac_suspend(device_t dev); extern int aac_resume(device_t dev); extern void aac_new_intr(void *arg); -extern int aac_fast_intr(void *arg); +extern int aac_filter(void *arg); extern void aac_submit_bio(struct bio *bp); extern void aac_biodone(struct bio *bp); extern void aac_startio(struct aac_softc *sc); From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 22:15:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B8A7106566B; Tue, 9 Feb 2010 22:15:59 +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 5155C8FC08; Tue, 9 Feb 2010 22:15:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19MFxw4097266; Tue, 9 Feb 2010 22:15:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19MFxEu097264; Tue, 9 Feb 2010 22:15:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002092215.o19MFxEu097264@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 9 Feb 2010 22:15: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: r203727 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 22:15:59 -0000 Author: bz Date: Tue Feb 9 22:15:59 2010 New Revision: 203727 URL: http://svn.freebsd.org/changeset/base/203727 Log: Add an SDT provider for "vnet"s along with probes for vnet_alloc and vnet_destroy. Use the line number rather than NULL as dummy argument. Note: the fbt provider does not reliably provide :return probes (depending on optimization levels used at compile time) making it unusable for scripts to generate complete call-traces with well defined boundaries over allocations or destructions of virtual network stacks. Sponsored by: ISPsystem MFC After: 8 days Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Tue Feb 9 22:05:30 2010 (r203726) +++ head/sys/net/vnet.c Tue Feb 9 22:15:59 2010 (r203727) @@ -38,11 +38,13 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_kdb.h" +#include "opt_kdtrace.h" #include #include #include #include +#include #include #include #include @@ -210,6 +212,13 @@ static TAILQ_HEAD(, vnet_data_free) vnet TAILQ_HEAD_INITIALIZER(vnet_data_free_head); static struct sx vnet_data_free_lock; +SDT_PROVIDER_DEFINE(vnet); +SDT_PROBE_DEFINE1(vnet, functions, vnet_alloc, entry, "int"); +SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, alloc, "int", "struct vnet *"); +SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, return, "int", "struct vnet *"); +SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, "int", "struct vnet *"); +SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, "int"); + /* * Allocate a virtual network stack. */ @@ -218,8 +227,10 @@ vnet_alloc(void) { struct vnet *vnet; + SDT_PROBE1(vnet, functions, vnet_alloc, entry, __LINE__); vnet = malloc(sizeof(struct vnet), M_VNET, M_WAITOK | M_ZERO); vnet->vnet_magic_n = VNET_MAGIC_N; + SDT_PROBE2(vnet, functions, vnet_alloc, alloc, __LINE__, vnet); /* * Allocate storage for virtualized global variables and copy in @@ -244,6 +255,7 @@ vnet_alloc(void) LIST_INSERT_HEAD(&vnet_head, vnet, vnet_le); VNET_LIST_WUNLOCK(); + SDT_PROBE2(vnet, functions, vnet_alloc, return, __LINE__, vnet); return (vnet); } @@ -255,6 +267,7 @@ vnet_destroy(struct vnet *vnet) { struct ifnet *ifp, *nifp; + SDT_PROBE2(vnet, functions, vnet_destroy, entry, __LINE__, vnet); KASSERT(vnet->vnet_sockcnt == 0, ("%s: vnet still has sockets", __func__)); @@ -281,6 +294,7 @@ vnet_destroy(struct vnet *vnet) vnet->vnet_data_base = 0; vnet->vnet_magic_n = 0xdeadbeef; free(vnet, M_VNET); + SDT_PROBE1(vnet, functions, vnet_destroy, return, __LINE__); } /* From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 22:23:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64B9D106566B; Tue, 9 Feb 2010 22:23:54 +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 35F7B8FC19; Tue, 9 Feb 2010 22:23:54 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D9E9646B0C; Tue, 9 Feb 2010 17:23:53 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 3268B8A021; Tue, 9 Feb 2010 17:23:53 -0500 (EST) From: John Baldwin To: Edward Tomasz Napierala Date: Tue, 9 Feb 2010 16:16:50 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <201002092058.o19Kwdut079944@svn.freebsd.org> In-Reply-To: <201002092058.o19Kwdut079944@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201002091616.50087.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 09 Feb 2010 17:23:53 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=AWL,BAYES_00 autolearn=ham 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: r203721 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 22:23:54 -0000 On Tuesday 09 February 2010 3:58:39 pm Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue Feb 9 20:58:39 2010 > New Revision: 203721 > URL: http://svn.freebsd.org/changeset/base/203721 > > Log: > Add references to VOP_* man pages to vnode(9). Hmm, it seems VOP_MARKATIME.9 is missing, probably because the actual manpage for that is missing. :-P -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 22:30:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67F4F106568D; Tue, 9 Feb 2010 22:30:51 +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 56FDB8FC17; Tue, 9 Feb 2010 22:30:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19MUpS6000678; Tue, 9 Feb 2010 22:30:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19MUpKw000676; Tue, 9 Feb 2010 22:30:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002092230.o19MUpKw000676@svn.freebsd.org> From: Xin LI Date: Tue, 9 Feb 2010 22:30: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: r203728 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 22:30:51 -0000 Author: delphij Date: Tue Feb 9 22:30:51 2010 New Revision: 203728 URL: http://svn.freebsd.org/changeset/base/203728 Log: - Return EAFNOSUPPORT instead of EINVAL for unsupported address family, this matches the Linux behavior. - Check if we have sufficient space allocated for socket structure, which fixes a buffer overflow when wrong length is being passed into the emulation layer. [1] PR: kern/138860 Submitted by: Mateusz Guzik Reported by: Alexander Best [1] MFC after: 2 weeks Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue Feb 9 22:15:59 2010 (r203727) +++ head/sys/compat/linux/linux_socket.c Tue Feb 9 22:30:51 2010 (r203728) @@ -128,7 +128,7 @@ do_sa_get(struct sockaddr **sap, const s bdom = linux_to_bsd_domain(kosa->sa_family); if (bdom == -1) { - error = EINVAL; + error = EAFNOSUPPORT; goto out; } @@ -157,8 +157,13 @@ do_sa_get(struct sockaddr **sap, const s } } else #endif - if (bdom == AF_INET) + if (bdom == AF_INET) { alloclen = sizeof(struct sockaddr_in); + if (*osalen < alloclen) { + error = EINVAL; + goto out; + } + } sa = (struct sockaddr *) kosa; sa->sa_family = bdom; From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 22:39:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDBD910656E9; Tue, 9 Feb 2010 22:39:34 +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 B2FA28FC12; Tue, 9 Feb 2010 22:39:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19MdY5g002687; Tue, 9 Feb 2010 22:39:34 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19MdYLX002683; Tue, 9 Feb 2010 22:39:34 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002092239.o19MdYLX002683@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 9 Feb 2010 22:39: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: r203729 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 22:39:35 -0000 Author: bz Date: Tue Feb 9 22:39:34 2010 New Revision: 203729 URL: http://svn.freebsd.org/changeset/base/203729 Log: Add DDB support for printing vnet_sysinit and vnet_sysuninit ordered call lists. Try to lookup function/symbol names and print those in addition to the pointers, along with the constants for subsystem and order. This is useful for debugging vnet teardown ordering issues. Make it possible to call the actual printing frunction from normal code at runtime, ie. from vnet_sysuninit(), if DDB support is there. Sponsored by: ISPsystem MFC After: 8 days Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Tue Feb 9 22:30:51 2010 (r203728) +++ head/sys/net/vnet.c Tue Feb 9 22:39:34 2010 (r203729) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #ifdef DDB #include +#include #endif #include @@ -219,6 +220,10 @@ SDT_PROBE_DEFINE2(vnet, functions, vnet_ SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, "int", "struct vnet *"); SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, "int"); +#ifdef DDB +static void db_show_vnet_print_vs(struct vnet_sysinit *, int); +#endif + /* * Allocate a virtual network stack. */ @@ -713,6 +718,64 @@ DB_SHOW_COMMAND(vnets, db_show_vnets) } } +static void +db_show_vnet_print_vs(struct vnet_sysinit *vs, int ddb) +{ + const char *vsname, *funcname; + c_db_sym_t sym; + db_expr_t offset; + +#define xprint(...) \ + if (ddb) \ + db_printf(__VA_ARGS__); \ + else \ + printf(__VA_ARGS__) + + if (vs == NULL) { + xprint("%s: no vnet_sysinit * given\n", __func__); + return; + } + + sym = db_search_symbol((vm_offset_t)vs, DB_STGY_ANY, &offset); + db_symbol_values(sym, &vsname, NULL); + sym = db_search_symbol((vm_offset_t)vs->func, DB_STGY_PROC, &offset); + db_symbol_values(sym, &funcname, NULL); + xprint("%s(%p)\n", (vsname != NULL) ? vsname : "", vs); + xprint(" 0x%08x 0x%08x\n", vs->subsystem, vs->order); + xprint(" %p(%s)(%p)\n", + vs->func, (funcname != NULL) ? funcname : "", vs->arg); +#undef xprint +} + +DB_SHOW_COMMAND(vnet_sysinit, db_show_vnet_sysinit) +{ + struct vnet_sysinit *vs; + + db_printf("VNET_SYSINIT vs Name(Ptr)\n"); + db_printf(" Subsystem Order\n"); + db_printf(" Function(Name)(Arg)\n"); + TAILQ_FOREACH(vs, &vnet_constructors, link) { + db_show_vnet_print_vs(vs, 1); + if (db_pager_quit) + break; + } +} + +DB_SHOW_COMMAND(vnet_sysuninit, db_show_vnet_sysuninit) +{ + struct vnet_sysinit *vs; + + db_printf("VNET_SYSUNINIT vs Name(Ptr)\n"); + db_printf(" Subsystem Order\n"); + db_printf(" Function(Name)(Arg)\n"); + TAILQ_FOREACH_REVERSE(vs, &vnet_destructors, vnet_sysuninit_head, + link) { + db_show_vnet_print_vs(vs, 1); + if (db_pager_quit) + break; + } +} + #ifdef VNET_DEBUG DB_SHOW_COMMAND(vnetrcrs, db_show_vnetrcrs) { From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 23:40:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6AB41065693; Tue, 9 Feb 2010 23:40:07 +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 A453C8FC0A; Tue, 9 Feb 2010 23:40:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19Ne76o016161; Tue, 9 Feb 2010 23:40:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19Ne7FY016157; Tue, 9 Feb 2010 23:40:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002092340.o19Ne7FY016157@svn.freebsd.org> From: Marius Strobl Date: Tue, 9 Feb 2010 23:40: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: r203731 - in head/sys: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 23:40:07 -0000 Author: marius Date: Tue Feb 9 23:40:07 2010 New Revision: 203731 URL: http://svn.freebsd.org/changeset/base/203731 Log: Some style(9) fixes Modified: head/sys/nfs/nfs_common.c head/sys/nfs/nfs_common.h head/sys/nfsclient/nfs_krpc.c Modified: head/sys/nfs/nfs_common.c ============================================================================== --- head/sys/nfs/nfs_common.c Tue Feb 9 22:41:00 2010 (r203730) +++ head/sys/nfs/nfs_common.c Tue Feb 9 23:40:07 2010 (r203731) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); /* * These functions support the macros and help fiddle mbuf chains for - * the nfs op functions. They do things like create the rpc header and + * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ @@ -75,10 +75,11 @@ nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK, NFFIFO, NFNON }; -static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, int how); +static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, + int how); u_quad_t -nfs_curusec(void) +nfs_curusec(void) { struct timeval tv; @@ -176,7 +177,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d while (left == 0) { *mdp = mp = mp->m_next; if (mp == NULL) - return NULL; + return (NULL); left = mp->m_len; *dposp = mtod(mp, caddr_t); } @@ -184,13 +185,13 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d ret = *dposp; *dposp += siz; } else if (mp->m_next == NULL) { - return NULL; + return (NULL); } else if (siz > MHLEN) { panic("nfs S too big"); } else { MGET(mp2, how, MT_DATA); if (mp2 == NULL) - return NULL; + return (NULL); mp2->m_len = siz; mp2->m_next = mp->m_next; mp->m_next = mp2; @@ -206,7 +207,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d /* Loop around copying up the siz2 bytes */ while (siz2 > 0) { if (mp2 == NULL) - return NULL; + return (NULL); xfer = (siz2 > mp2->m_len) ? mp2->m_len : siz2; if (xfer > 0) { bcopy(mtod(mp2, caddr_t), ptr, xfer); @@ -229,7 +230,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d *dposp = npos; } } - return ret; + return (ret); } /* @@ -273,19 +274,21 @@ nfsm_build_xx(int s, struct mbuf **mb, c ret = *bpos; (*mb)->m_len += s; *bpos += s; - return ret; + return (ret); } void * nfsm_dissect_xx(int s, struct mbuf **md, caddr_t *dpos) { - return nfsm_dissect_xx_sub(s, md, dpos, M_WAIT); + + return (nfsm_dissect_xx_sub(s, md, dpos, M_WAIT)); } void * nfsm_dissect_xx_nonblock(int s, struct mbuf **md, caddr_t *dpos) { - return nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT); + + return (nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT)); } static void * @@ -299,10 +302,10 @@ nfsm_dissect_xx_sub(int s, struct mbuf * if (t1 >= s) { ret = *dpos; *dpos += s; - return ret; + return (ret); } - cp2 = nfsm_disct(md, dpos, s, t1, how); - return cp2; + cp2 = nfsm_disct(md, dpos, s, t1, how); + return (cp2); } int @@ -312,11 +315,11 @@ nfsm_strsiz_xx(int *s, int m, struct mbu tl = nfsm_dissect_xx(NFSX_UNSIGNED, mb, bpos); if (tl == NULL) - return EBADRPC; + return (EBADRPC); *s = fxdr_unsigned(int32_t, *tl); if (*s > m) - return EBADRPC; - return 0; + return (EBADRPC); + return (0); } int @@ -327,10 +330,10 @@ nfsm_adv_xx(int s, struct mbuf **md, cad t1 = mtod(*md, caddr_t) + (*md)->m_len - *dpos; if (t1 >= s) { *dpos += s; - return 0; + return (0); } t1 = nfs_adv(md, dpos, s, t1); if (t1) - return t1; - return 0; + return (t1); + return (0); } Modified: head/sys/nfs/nfs_common.h ============================================================================== --- head/sys/nfs/nfs_common.h Tue Feb 9 22:41:00 2010 (r203730) +++ head/sys/nfs/nfs_common.h Tue Feb 9 23:40:07 2010 (r203731) @@ -33,7 +33,6 @@ * $FreeBSD$ */ - #ifndef _NFS_NFS_COMMON_H_ #define _NFS_NFS_COMMON_H_ @@ -86,7 +85,7 @@ do { \ goto nfsmout; \ } \ } while (0) - + #define nfsm_dissect(c, s) \ ({ \ void *ret; \ Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Tue Feb 9 22:41:00 2010 (r203730) +++ head/sys/nfsclient/nfs_krpc.c Tue Feb 9 23:40:07 2010 (r203731) @@ -105,9 +105,11 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpacket "Buffer reservation size 2 < x < 64"); SYSCTL_INT(_vfs_nfs, OID_AUTO, reconnects, CTLFLAG_RD, &nfs_reconnects, 0, "Number of times the nfs client has had to reconnect"); -SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, &nfs3_jukebox_delay, 0, +SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, + &nfs3_jukebox_delay, 0, "Number of seconds to delay a retry after receiving EJUKEBOX"); -SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0, +SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, + &nfs_skip_wcc_data_onerr, 0, "Disable weak cache consistency checking when server returns an error"); static void nfs_down(struct nfsmount *, struct thread *, const char *, @@ -160,7 +162,8 @@ static enum nfs_rto_timer_t nfs_proct[NF static inline enum nfs_rto_timer_t nfs_rto_timer(u_int32_t procnum) { - return nfs_proct[procnum]; + + return (nfs_proct[procnum]); } /* @@ -225,7 +228,7 @@ nfs_connect(struct nfsmount *nmp) nconf = getnetconfigent("udp6"); else nconf = getnetconfigent("tcp6"); - + /* * Get buffer reservation size from sysctl, but impose reasonable * limits. @@ -273,9 +276,8 @@ nfs_connect(struct nfsmount *nmp) * Someone else already connected. */ CLNT_RELEASE(client); - } else { + } else nmp->nm_client = client; - } /* * Protocols that do not require connections may be optionally left @@ -284,22 +286,21 @@ nfs_connect(struct nfsmount *nmp) if (!(nmp->nm_flag & NFSMNT_NOCONN)) { mtx_unlock(&nmp->nm_mtx); CLNT_CONTROL(client, CLSET_CONNECT, &one); - } else { + } else mtx_unlock(&nmp->nm_mtx); - } /* Restore current thread's credentials. */ td->td_ucred = origcred; mtx_lock(&nmp->nm_mtx); - /* Initialize other non-zero congestion variables */ + /* Initialize other non-zero congestion variables. */ nfs_init_rtt(nmp); mtx_unlock(&nmp->nm_mtx); return (0); } /* - * NFS disconnect. Clean up and unlink. + * NFS disconnect. Clean up and unlink. */ void nfs_disconnect(struct nfsmount *nmp) @@ -316,9 +317,8 @@ nfs_disconnect(struct nfsmount *nmp) #endif CLNT_CLOSE(client); CLNT_RELEASE(client); - } else { + } else mtx_unlock(&nmp->nm_mtx); - } } void @@ -341,11 +341,10 @@ nfs_getauth(struct nfsmount *nmp, struct case RPCSEC_GSS_KRB5: case RPCSEC_GSS_KRB5I: case RPCSEC_GSS_KRB5P: - if (!nmp->nm_mech_oid) { + if (!nmp->nm_mech_oid) if (!rpc_gss_mech_to_oid("kerberosv5", - &nmp->nm_mech_oid)) + &nmp->nm_mech_oid)) return (NULL); - } if (nmp->nm_secflavor == RPCSEC_GSS_KRB5) svc = rpc_gss_svc_none; else if (nmp->nm_secflavor == RPCSEC_GSS_KRB5I) @@ -503,10 +502,10 @@ nfs_request(struct vnode *vp, struct mbu nf.nf_td = td; getmicrouptime(&now); nf.nf_lastmsg = now.tv_sec - - ((nmp->nm_tprintf_delay) - (nmp->nm_tprintf_initial_delay)); + ((nmp->nm_tprintf_delay) - (nmp->nm_tprintf_initial_delay)); /* - * XXX if not already connected call nfs_connect now. Longer + * XXX if not already connected call nfs_connect now. Longer * term, change nfs_mount to call nfs_connect unconditionally * and let clnt_reconnect_create handle reconnects. */ @@ -526,18 +525,17 @@ nfs_request(struct vnode *vp, struct mbu /* * Use a conservative timeout for RPCs other than getattr, - * lookup, read or write. The justification for doing "other" + * lookup, read or write. The justification for doing "other" * this way is that these RPCs happen so infrequently that * timer est. would probably be stale. Also, since many of * these RPCs are non-idempotent, a conservative timeout is * desired. */ timer = nfs_rto_timer(procnum); - if (timer != NFS_DEFAULT_TIMER) { + if (timer != NFS_DEFAULT_TIMER) ext.rc_timers = &nmp->nm_timers[timer - 1]; - } else { + else ext.rc_timers = NULL; - } #ifdef KDTRACE_HOOKS if (dtrace_nfsclient_nfs23_start_probe != NULL) { @@ -570,17 +568,16 @@ tryagain: * If there was a successful reply and a tprintf msg. * tprintf a response. */ - if (stat == RPC_SUCCESS) { + if (stat == RPC_SUCCESS) error = 0; - } else if (stat == RPC_TIMEDOUT) { + else if (stat == RPC_TIMEDOUT) error = ETIMEDOUT; - } else if (stat == RPC_VERSMISMATCH) { + else if (stat == RPC_VERSMISMATCH) error = EOPNOTSUPP; - } else if (stat == RPC_PROGVERSMISMATCH) { + else if (stat == RPC_PROGVERSMISMATCH) error = EPROTONOSUPPORT; - } else { + else error = EACCES; - } if (error) goto nfsmout; @@ -609,9 +606,9 @@ tryagain: m_freem(mrep); error = 0; waituntil = time_second + nfs3_jukebox_delay; - while (time_second < waituntil) { - (void) tsleep(&fake_wchan, PSOCK, "nqnfstry", hz); - } + while (time_second < waituntil) + (void)tsleep(&fake_wchan, PSOCK, "nqnfstry", + hz); goto tryagain; } @@ -622,12 +619,13 @@ tryagain: if (error == ESTALE) nfs_purgecache(vp); /* - * Skip wcc data on NFS errors for now. NetApp filers + * Skip wcc data on NFS errors for now. NetApp filers * return corrupt postop attrs in the wcc data for NFS - * err EROFS. Not sure if they could return corrupt + * err EROFS. Not sure if they could return corrupt * postop attrs for others errors. */ - if ((nmp->nm_flag & NFSMNT_NFSV3) && !nfs_skip_wcc_data_onerr) { + if ((nmp->nm_flag & NFSMNT_NFSV3) && + !nfs_skip_wcc_data_onerr) { *mrp = mrep; *mdp = md; *dposp = dpos; @@ -689,7 +687,7 @@ nfsmout: /* * Mark all of an nfs mount's outstanding requests with R_SOFTTERM and - * wait for all requests to complete. This is used by forced unmounts + * wait for all requests to complete. This is used by forced unmounts * to terminate any outstanding RPCs. */ int @@ -703,7 +701,7 @@ nfs_nmcancelreqs(struct nfsmount *nmp) /* * Any signal that can interrupt an NFS operation in an intr mount - * should be added to this set. SIGSTOP and SIGKILL cannot be masked. + * should be added to this set. SIGSTOP and SIGKILL cannot be masked. */ int nfs_sig_set[] = { SIGINT, @@ -722,16 +720,16 @@ static int nfs_sig_pending(sigset_t set) { int i; - + for (i = 0 ; i < sizeof(nfs_sig_set)/sizeof(int) ; i++) if (SIGISMEMBER(set, nfs_sig_set[i])) return (1); return (0); } - + /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the process p_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -740,18 +738,18 @@ nfs_set_sigmask(struct thread *td, sigse sigset_t newset; int i; struct proc *p; - + SIGFILLSET(newset); if (td == NULL) td = curthread; /* XXX */ p = td->td_proc; - /* Remove the NFS set of signals from newset */ + /* Remove the NFS set of signals from newset. */ PROC_LOCK(p); mtx_lock(&p->p_sigacts->ps_mtx); for (i = 0 ; i < sizeof(nfs_sig_set)/sizeof(int) ; i++) { /* * But make sure we leave the ones already masked - * by the process, ie. remove the signal from the + * by the process, i.e. remove the signal from the * temporary signalmask only if it wasn't already * in p_sigmask. */ @@ -777,12 +775,13 @@ nfs_restore_sigmask(struct thread *td, s * old one after msleep() returns. */ int -nfs_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, char *wmesg, int timo) +nfs_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, + char *wmesg, int timo) { sigset_t oldset; int error; struct proc *p; - + if ((priority & PCATCH) == 0) return msleep(ident, mtx, priority, wmesg, timo); if (td == NULL) @@ -803,7 +802,7 @@ nfs_sigintr(struct nfsmount *nmp, struct { struct proc *p; sigset_t tmpset; - + /* Terminate all requests while attempting a forced unmount. */ if (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) return (EIO); @@ -834,12 +833,11 @@ nfs_msg(struct thread *td, const char *s struct proc *p; p = td ? td->td_proc : NULL; - if (error) { + if (error) tprintf(p, LOG_INFO, "nfs server %s: %s, error %d\n", server, msg, error); - } else { + else tprintf(p, LOG_INFO, "nfs server %s: %s\n", server, msg); - } return (0); } @@ -858,7 +856,8 @@ nfs_down(struct nfsmount *nmp, struct th } else mtx_unlock(&nmp->nm_mtx); mtx_lock(&nmp->nm_mtx); - if ((flags & NFSSTA_LOCKTIMEO) && !(nmp->nm_state & NFSSTA_LOCKTIMEO)) { + if ((flags & NFSSTA_LOCKTIMEO) && + !(nmp->nm_state & NFSSTA_LOCKTIMEO)) { nmp->nm_state |= NFSSTA_LOCKTIMEO; mtx_unlock(&nmp->nm_mtx); vfs_event_signal(&nmp->nm_mountp->mnt_stat.f_fsid, @@ -874,9 +873,8 @@ nfs_up(struct nfsmount *nmp, struct thre { if (nmp == NULL) return; - if (tprintfmsg) { + if (tprintfmsg) nfs_msg(td, nmp->nm_mountp->mnt_stat.f_mntfromname, msg, 0); - } mtx_lock(&nmp->nm_mtx); if ((flags & NFSSTA_TIMEO) && (nmp->nm_state & NFSSTA_TIMEO)) { @@ -886,9 +884,10 @@ nfs_up(struct nfsmount *nmp, struct thre VQ_NOTRESP, 1); } else mtx_unlock(&nmp->nm_mtx); - + mtx_lock(&nmp->nm_mtx); - if ((flags & NFSSTA_LOCKTIMEO) && (nmp->nm_state & NFSSTA_LOCKTIMEO)) { + if ((flags & NFSSTA_LOCKTIMEO) && + (nmp->nm_state & NFSSTA_LOCKTIMEO)) { nmp->nm_state &= ~NFSSTA_LOCKTIMEO; mtx_unlock(&nmp->nm_mtx); vfs_event_signal(&nmp->nm_mountp->mnt_stat.f_fsid, From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 23:40:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 665721065672; Tue, 9 Feb 2010 23:40:43 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id D8D188FC1F; Tue, 9 Feb 2010 23:40:42 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so1081623qwd.7 for ; Tue, 09 Feb 2010 15:40:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.65.81 with SMTP id h17mr3490834qai.112.1265758841996; Tue, 09 Feb 2010 15:40:41 -0800 (PST) X-Originating-IP: [128.95.133.71] In-Reply-To: <201002070038.o170cVVA086239@svn.freebsd.org> References: <201002070038.o170cVVA086239@svn.freebsd.org> Date: Tue, 9 Feb 2010 15:40:41 -0800 Message-ID: From: Rob Farmer To: Xin LI 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: r203584 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 23:40:43 -0000 On Sat, Feb 6, 2010 at 4:38 PM, Xin LI wrote: > Author: delphij > Date: Sun Feb =A07 00:38:31 2010 > New Revision: 203584 > URL: http://svn.freebsd.org/changeset/base/203584 > > Log: > =A0Add files for NO_MAIL, NO_SENDMAIL and NO_MAILWRAPPER. > > =A0MFC after: =A0 =A02 weeks > > Modified: > =A0head/tools/build/mk/OptionalObsoleteFiles.inc > > Modified: head/tools/build/mk/OptionalObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/tools/build/mk/OptionalObsoleteFiles.inc =A0 =A0 =A0 Sun Feb =A0= 7 00:26:47 2010 =A0 =A0 =A0 =A0(r203583) > +++ head/tools/build/mk/OptionalObsoleteFiles.inc =A0 =A0 =A0 Sun Feb =A0= 7 00:38:31 2010 =A0 =A0 =A0 =A0(r203584) > @@ -1536,9 +1536,33 @@ OLD_FILES+=3Dusr/share/man/man8/lpd.8.gz > =A0OLD_FILES+=3Dusr/share/man/man8/pac.8.gz > =A0.endif > > -#.if ${MK_MAILWRAPPER} =3D=3D no > -# to be filled in > -#.endif > +.if ${MK_MAIL} =3D=3D no > +OLD_FILES+=3Dusr/bin/Mail > +OLD_FILES+=3Dusr/bin/biff > +OLD_FILES+=3Dusr/bin/fmt > +OLD_FILES+=3Dusr/bin/from > +OLD_FILES+=3Dusr/bin/mail > +OLD_FILES+=3Dusr/bin/mailx > +OLD_FILES+=3Dusr/bin/msgs > +OLD_FILES+=3Dusr/libexec/comsat > +OLD_FILES+=3Dusr/share/examples/etc/mail.rc > +OLD_FILES+=3Dusr/share/man/man1/Mail.1.gz > +OLD_FILES+=3Dusr/share/man/man1/biff.1.gz > +OLD_FILES+=3Dusr/share/man/man1/fmt.1.gz > +OLD_FILES+=3Dusr/share/man/man1/from.1.gz > +OLD_FILES+=3Dusr/share/man/man1/mail.1.gz > +OLD_FILES+=3Dusr/share/man/man1/mailx.1.gz > +OLD_FILES+=3Dusr/share/man/man1/msgs.1.gz > +OLD_FILES+=3Dusr/share/man/man8/comsat.8.gz > +OLD_FILES+=3Dusr/share/misc/mail.help > +OLD_FILES+=3Dusr/share/misc/mail.tildehelp > +.endif > + > +.if ${MK_MAILWRAPPER} =3D=3D no > +OLD_FILES+=3Detc/mail/mailer.conf > +OLD_FILES+=3Dusr/sbin/mailwrapper > +OLD_FILES+=3Dusr/share/man/man8/mailwrapper.8.gz > +.endif Hi, Thanks for fixing this. Do you think that usr/sbin/sendmail should be added here in the mailwrapper section, since it is a symlink to /usr/sbin/mailwrapper? --=20 Rob Farmer > > =A0#.if ${MK_MAN} =3D=3D no > =A0# This should add a dependency to a special target which removes all m= an pages. > @@ -1750,9 +1774,220 @@ OLD_FILES+=3Dusr/share/man/man8/rshd.8.gz > =A0# to be filled in or replaced with a special target > =A0#.endif > > -#.if ${MK_SENDMAIL} =3D=3D no > -# to be filled in > -#.endif > +.if ${MK_SENDMAIL} =3D=3D no > +OLD_FILES+=3Dbin/rmail > +OLD_FILES+=3Dusr/bin/vacation > +OLD_FILES+=3Dusr/include/libmilter/mfapi.h > +OLD_FILES+=3Dusr/include/libmilter/mfdef.h > +OLD_FILES+=3Dusr/lib/libmilter.a > +OLD_LIBS+=3Dusr/lib/libmilter.so.5 > +OLD_FILES+=3Dusr/lib/libmilter_p.a > +.if ${TARGET_ARCH} =3D=3D "amd64" > +OLD_FILES+=3Dusr/lib32/libmilter.a > +OLD_LIBS+=3Dusr/lib32/libmilter.so.5 > +OLD_FILES+=3Dusr/lib32/libmilter_p.a > +.endif > +OLD_FILES+=3Dusr/libexec/mail.local > +OLD_FILES+=3Dusr/libexec/sendmail/sendmail > +OLD_FILES+=3Dusr/libexec/smrsh > +OLD_FILES+=3Dusr/sbin/editmap > +OLD_FILES+=3Dusr/sbin/mailstats > +OLD_FILES+=3Dusr/sbin/makemap > +OLD_FILES+=3Dusr/sbin/praliases > +OLD_FILES+=3Dusr/share/doc/smm/08.sendmailop/paper.ascii.gz > +OLD_FILES+=3Dusr/share/man/man1/mailq.1.gz > +OLD_FILES+=3Dusr/share/man/man1/newaliases.1.gz > +OLD_FILES+=3Dusr/share/man/man1/vacation.1.gz > +OLD_FILES+=3Dusr/share/man/man5/aliases.5.gz > +OLD_FILES+=3Dusr/share/man/man8/editmap.8.gz > +OLD_FILES+=3Dusr/share/man/man8/hoststat.8.gz > +OLD_FILES+=3Dusr/share/man/man8/mail.local.8.gz > +OLD_FILES+=3Dusr/share/man/man8/mailstats.8.gz > +OLD_FILES+=3Dusr/share/man/man8/makemap.8.gz > +OLD_FILES+=3Dusr/share/man/man8/praliases.8.gz > +OLD_FILES+=3Dusr/share/man/man8/purgestat.8.gz > +OLD_FILES+=3Dusr/share/man/man8/rmail.8.gz > +OLD_FILES+=3Dusr/share/man/man8/sendmail.8.gz > +OLD_FILES+=3Dusr/share/man/man8/smrsh.8.gz > +OLD_FILES+=3Dusr/share/sendmail/cf/README > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/Makefile > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/README > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/chez.cs.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/clientproto.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/cs-hpux10.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/cs-hpux9.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/cs-osf1.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/cs-solaris2.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/cs-sunos4.1.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/cs-ultrix4.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/cyrusproto.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/generic-bsd4.4.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/generic-hpux10.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/generic-hpux9.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/generic-linux.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/generic-mpeix.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/generic-nextstep3.3.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/generic-osf1.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/generic-solaris.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/generic-sunos4.1.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/generic-ultrix4.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/huginn.cs.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/knecht.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/mail.cs.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/mail.eecs.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/mailspool.cs.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/python.cs.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/s2k-osf1.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/s2k-ultrix4.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/submit.cf > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/submit.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/tcpproto.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/ucbarpa.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/ucbvax.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/uucpproto.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/cf/vangogh.cs.mc > +OLD_FILES+=3Dusr/share/sendmail/cf/domain/Berkeley.EDU.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/domain/CS.Berkeley.EDU.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/domain/EECS.Berkeley.EDU.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/domain/S2K.Berkeley.EDU.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/domain/berkeley-only.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/domain/generic.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/accept_unqualified_senders.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/accept_unresolvable_domains.m= 4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/access_db.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/allmasquerade.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/always_add_domain.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/authinfo.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/badmx.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/bestmx_is_local.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/bitdomain.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/blacklist_recipients.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/block_bad_helo.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/compat_check.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/conncontrol.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/delay_checks.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/dnsbl.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/domaintable.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/enhdnsbl.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/generics_entire_domain.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/genericstable.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/greet_pause.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/ldap_routing.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/limited_masquerade.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/local_lmtp.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/local_no_masquerade.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/local_procmail.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/lookupdotdomain.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/loose_relay_check.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/mailertable.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/masquerade_entire_domain.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/masquerade_envelope.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/msp.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/mtamark.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/no_default_msa.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/nocanonify.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/notsticky.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/nouucp.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/nullclient.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/preserve_local_plus_detail.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/preserve_luser_host.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/promiscuous_relay.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/queuegroup.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/ratecontrol.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/redirect.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/relay_based_on_MX.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/relay_entire_domain.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/relay_hosts_only.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/relay_local_from.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/relay_mail_from.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/require_rdns.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/smrsh.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/stickyhost.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/use_client_ptr.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/use_ct_file.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/use_cw_file.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/uucpdomain.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/virtuser_entire_domain.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/feature/virtusertable.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/hack/cssubdomain.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/m4/cf.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/m4/cfhead.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/m4/proto.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/m4/version.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/cyrus.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/cyrusv2.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/fax.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/local.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/mail11.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/phquery.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/pop.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/procmail.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/qpage.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/smtp.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/usenet.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/mailer/uucp.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/a-ux.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/aix3.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/aix4.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/aix5.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/altos.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/amdahl-uts.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/bsd4.3.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/bsd4.4.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/bsdi.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/bsdi1.0.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/bsdi2.0.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/darwin.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/dgux.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/domainos.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/dragonfly.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/dynix3.2.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/freebsd4.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/freebsd5.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/freebsd6.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/gnu.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/hpux10.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/hpux11.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/hpux9.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/irix4.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/irix5.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/irix6.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/isc4.1.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/linux.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/maxion.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/mklinux.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/mpeix.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/nextstep.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/openbsd.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/osf1.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/powerux.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/ptx2.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/qnx.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/riscos4.5.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/sco-uw-2.1.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/sco3.2.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/sinix.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/solaris2.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/solaris2.ml.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/solaris2.pre5.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/solaris8.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/sunos3.5.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/sunos4.1.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/svr4.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/ultrix4.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/unicos.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/unicosmk.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/unicosmp.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/unixware7.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/unknown.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/ostype/uxpds.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/sendmail.schema > +OLD_FILES+=3Dusr/share/sendmail/cf/sh/makeinfo.sh > +OLD_FILES+=3Dusr/share/sendmail/cf/siteconfig/uucp.cogsci.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/siteconfig/uucp.old.arpa.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/siteconfig/uucp.ucbarpa.m4 > +OLD_FILES+=3Dusr/share/sendmail/cf/siteconfig/uucp.ucbvax.m4 > +.endif > > =A0#.if ${MK_SHAREDOCS} =3D=3D no > =A0# to be filled in > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Tue Feb 9 23:45:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF4411065670; Tue, 9 Feb 2010 23:45:15 +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 BCE278FC0A; Tue, 9 Feb 2010 23:45:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19NjFbi017374; Tue, 9 Feb 2010 23:45:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19NjFoW017367; Tue, 9 Feb 2010 23:45:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002092345.o19NjFoW017367@svn.freebsd.org> From: Marius Strobl Date: Tue, 9 Feb 2010 23:45: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: r203732 - in head/sys: nfs nfsclient nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 23:45:15 -0000 Author: marius Date: Tue Feb 9 23:45:14 2010 New Revision: 203732 URL: http://svn.freebsd.org/changeset/base/203732 Log: - Move nfs_realign() from the NFS client to the shared NFS code and remove the NFS server version in order to reduce code duplication. The shared version now uses a second parameter how, which is passed on to m_get(9) and m_getcl(9) as the server used M_WAIT while the client requires M_DONTWAIT, and replaces the the previously unused parameter hsiz. - Change nfs_realign() to use nfsm_aligned() so as with other NFS code the alignment check isn't actually performed on platforms without strict alignment requirements for performance reasons because as the comment suggests unaligned data only occasionally occurs with TCP. - Change fha_extract_info() to use nfs_realign() with M_DONTWAIT rather than M_WAIT because it's called with the RPC sp_lock held. Reviewed by: jhb, rmacklem MFC after: 1 week Modified: head/sys/nfs/nfs_common.c head/sys/nfs/nfs_common.h head/sys/nfsclient/nfs_krpc.c head/sys/nfsserver/nfs.h head/sys/nfsserver/nfs_fha.c head/sys/nfsserver/nfs_srvkrpc.c Modified: head/sys/nfs/nfs_common.c ============================================================================== --- head/sys/nfs/nfs_common.c Tue Feb 9 23:40:07 2010 (r203731) +++ head/sys/nfs/nfs_common.c Tue Feb 9 23:45:14 2010 (r203732) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -78,6 +79,16 @@ nfstype nfsv3_type[9] = { static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, int how); +SYSCTL_DECL(_vfs_nfs); + +static int nfs_realign_test; +SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RD, &nfs_realign_test, + 0, "Number of realign tests done"); + +static int nfs_realign_count; +SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RD, &nfs_realign_count, + 0, "Number of mbuf realignments done"); + u_quad_t nfs_curusec(void) { @@ -337,3 +348,59 @@ nfsm_adv_xx(int s, struct mbuf **md, cad return (t1); return (0); } + +/* + * Check for badly aligned mbuf data and realign by copying the unaligned + * portion of the data into a new mbuf chain and freeing the portions of the + * old chain that were replaced. + * + * We cannot simply realign the data within the existing mbuf chain because + * the underlying buffers may contain other rpc commands and we cannot afford + * to overwrite them. + * + * We would prefer to avoid this situation entirely. The situation does not + * occur with NFS/UDP and is supposed to only occassionally occur with TCP. + * Use vfs.nfs.realign_count and realign_test to check this. + */ +int +nfs_realign(struct mbuf **pm, int how) +{ + struct mbuf *m, *n; + int off; + + ++nfs_realign_test; + while ((m = *pm) != NULL) { + if (!nfsm_aligned(m->m_len, u_int32_t) || + !nfsm_aligned(mtod(m, intptr_t), u_int32_t)) { + /* + * NB: we can't depend on m_pkthdr.len to help us + * decide what to do here. May not be worth doing + * the m_length calculation as m_copyback will + * expand the mbuf chain below as needed. + */ + if (m_length(m, NULL) >= MINCLSIZE) { + /* NB: m_copyback handles space > MCLBYTES */ + n = m_getcl(how, MT_DATA, 0); + } else + n = m_get(how, MT_DATA); + if (n == NULL) + return (ENOMEM); + /* + * Align the remainder of the mbuf chain. + */ + n->m_len = 0; + off = 0; + while (m != NULL) { + m_copyback(n, off, m->m_len, mtod(m, caddr_t)); + off += m->m_len; + m = m->m_next; + } + m_freem(*pm); + *pm = n; + ++nfs_realign_count; + break; + } + pm = &m->m_next; + } + return (0); +} Modified: head/sys/nfs/nfs_common.h ============================================================================== --- head/sys/nfs/nfs_common.h Tue Feb 9 23:40:07 2010 (r203731) +++ head/sys/nfs/nfs_common.h Tue Feb 9 23:45:14 2010 (r203732) @@ -48,6 +48,7 @@ extern nfstype nfsv3_type[]; int nfs_adv(struct mbuf **, caddr_t *, int, int); u_quad_t nfs_curusec(void); void *nfsm_disct(struct mbuf **, caddr_t *, int, int, int); +int nfs_realign(struct mbuf **, int); /* ****************************** */ /* Build request/reply phase macros */ Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Tue Feb 9 23:40:07 2010 (r203731) +++ head/sys/nfsclient/nfs_krpc.c Tue Feb 9 23:45:14 2010 (r203732) @@ -87,8 +87,6 @@ uint32_t nfsclient_nfs3_start_probes[NFS uint32_t nfsclient_nfs3_done_probes[NFS_NPROCS]; #endif -static int nfs_realign_test; -static int nfs_realign_count; static int nfs_bufpackets = 4; static int nfs_reconnects; static int nfs3_jukebox_delay = 10; @@ -97,10 +95,6 @@ static int fake_wchan; SYSCTL_DECL(_vfs_nfs); -SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, 0, - "Number of realign tests done"); -SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RW, &nfs_realign_count, 0, - "Number of mbuf realignments done"); SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpackets, CTLFLAG_RW, &nfs_bufpackets, 0, "Buffer reservation size 2 < x < 64"); SYSCTL_INT(_vfs_nfs, OID_AUTO, reconnects, CTLFLAG_RD, &nfs_reconnects, 0, @@ -403,65 +397,6 @@ nfs_feedback(int type, int proc, void *a } /* - * nfs_realign: - * - * Check for badly aligned mbuf data and realign by copying the unaligned - * portion of the data into a new mbuf chain and freeing the portions - * of the old chain that were replaced. - * - * We cannot simply realign the data within the existing mbuf chain - * because the underlying buffers may contain other rpc commands and - * we cannot afford to overwrite them. - * - * We would prefer to avoid this situation entirely. The situation does - * not occur with NFS/UDP and is supposed to only occassionally occur - * with TCP. Use vfs.nfs.realign_count and realign_test to check this. - * - */ -static int -nfs_realign(struct mbuf **pm, int hsiz) -{ - struct mbuf *m, *n; - int off, space; - - ++nfs_realign_test; - while ((m = *pm) != NULL) { - if ((m->m_len & 0x3) || (mtod(m, intptr_t) & 0x3)) { - /* - * NB: we can't depend on m_pkthdr.len to help us - * decide what to do here. May not be worth doing - * the m_length calculation as m_copyback will - * expand the mbuf chain below as needed. - */ - space = m_length(m, NULL); - if (space >= MINCLSIZE) { - /* NB: m_copyback handles space > MCLBYTES */ - n = m_getcl(M_DONTWAIT, MT_DATA, 0); - } else - n = m_get(M_DONTWAIT, MT_DATA); - if (n == NULL) - return (ENOMEM); - /* - * Align the remainder of the mbuf chain. - */ - n->m_len = 0; - off = 0; - while (m != NULL) { - m_copyback(n, off, m->m_len, mtod(m, caddr_t)); - off += m->m_len; - m = m->m_next; - } - m_freem(*pm); - *pm = n; - ++nfs_realign_count; - break; - } - pm = &m->m_next; - } - return (0); -} - -/* * nfs_request - goes something like this * - fill in request struct * - links it into list @@ -589,7 +524,7 @@ tryagain: * These could cause pointer alignment problems, so copy them to * well aligned mbufs. */ - error = nfs_realign(&mrep, 2 * NFSX_UNSIGNED); + error = nfs_realign(&mrep, M_DONTWAIT); if (error == ENOMEM) { m_freem(mrep); AUTH_DESTROY(auth); Modified: head/sys/nfsserver/nfs.h ============================================================================== --- head/sys/nfsserver/nfs.h Tue Feb 9 23:40:07 2010 (r203731) +++ head/sys/nfsserver/nfs.h Tue Feb 9 23:45:14 2010 (r203732) @@ -239,7 +239,6 @@ extern int nfs_debug; #endif -void nfs_realign(struct mbuf **); struct mbuf *nfs_rephead(int, struct nfsrv_descript *, int, struct mbuf **, caddr_t *); void nfsm_srvfattr(struct nfsrv_descript *, struct vattr *, Modified: head/sys/nfsserver/nfs_fha.c ============================================================================== --- head/sys/nfsserver/nfs_fha.c Tue Feb 9 23:40:07 2010 (r203731) +++ head/sys/nfsserver/nfs_fha.c Tue Feb 9 23:45:14 2010 (r203732) @@ -202,7 +202,9 @@ fha_extract_info(struct svc_req *req, st procnum == NFSPROC_NULL) goto out; - nfs_realign(&req->rq_args); + error = nfs_realign(&req->rq_args, M_DONTWAIT); + if (error) + goto out; md = req->rq_args; dpos = mtod(md, caddr_t); Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Tue Feb 9 23:40:07 2010 (r203731) +++ head/sys/nfsserver/nfs_srvkrpc.c Tue Feb 9 23:45:14 2010 (r203732) @@ -96,8 +96,6 @@ SYSCTL_DECL(_vfs_nfsrv); SVCPOOL *nfsrv_pool; int nfsd_waiting = 0; int nfsrv_numnfsd = 0; -static int nfs_realign_test; -static int nfs_realign_count; struct callout nfsrv_callout; static eventhandler_tag nfsrv_nmbclusters_tag; @@ -111,10 +109,6 @@ SYSCTL_INT(_vfs_nfsrv, OID_AUTO, gatherd SYSCTL_INT(_vfs_nfsrv, OID_AUTO, gatherdelay_v3, CTLFLAG_RW, &nfsrvw_procrastinate_v3, 0, "Delay in seconds for NFSv3 write gathering"); -SYSCTL_INT(_vfs_nfsrv, OID_AUTO, realign_test, CTLFLAG_RW, - &nfs_realign_test, 0, ""); -SYSCTL_INT(_vfs_nfsrv, OID_AUTO, realign_count, CTLFLAG_RW, - &nfs_realign_count, 0, ""); static int nfssvc_addsock(struct file *, struct thread *); static int nfssvc_nfsd(struct thread *, struct nfsd_nfsd_args *); @@ -250,57 +244,6 @@ nfs_rephead(int siz, struct nfsrv_descri return (mreq); } -/* - * nfs_realign: - * - * Check for badly aligned mbuf data and realign by copying the unaligned - * portion of the data into a new mbuf chain and freeing the portions - * of the old chain that were replaced. - * - * We cannot simply realign the data within the existing mbuf chain - * because the underlying buffers may contain other rpc commands and - * we cannot afford to overwrite them. - * - * We would prefer to avoid this situation entirely. The situation does - * not occur with NFS/UDP and is supposed to only occassionally occur - * with TCP. Use vfs.nfs.realign_count and realign_test to check this. - */ -void -nfs_realign(struct mbuf **pm) /* XXX COMMON */ -{ - struct mbuf *m; - struct mbuf *n = NULL; - int off = 0; - - ++nfs_realign_test; - while ((m = *pm) != NULL) { - if ((m->m_len & 0x3) || (mtod(m, intptr_t) & 0x3)) { - MGET(n, M_WAIT, MT_DATA); - if (m->m_len >= MINCLSIZE) { - MCLGET(n, M_WAIT); - } - n->m_len = 0; - break; - } - pm = &m->m_next; - } - - /* - * If n is non-NULL, loop on m copying data, then replace the - * portion of the chain that had to be realigned. - */ - if (n != NULL) { - ++nfs_realign_count; - while (m) { - m_copyback(n, off, m->m_len, mtod(m, caddr_t)); - off += m->m_len; - m = m->m_next; - } - m_freem(*pm); - *pm = n; - } -} - static void nfssvc_program(struct svc_req *rqst, SVCXPRT *xprt) { @@ -334,7 +277,7 @@ nfssvc_program(struct svc_req *rqst, SVC mreq = mrep = NULL; mreq = rqst->rq_args; rqst->rq_args = NULL; - nfs_realign(&mreq); + (void)nfs_realign(&mreq, M_WAIT); /* * Note: we want rq_addr, not svc_getrpccaller for nd_nam2 - From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 00:01:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B89D410656C2; Wed, 10 Feb 2010 00:01:35 +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 A7B078FC1F; Wed, 10 Feb 2010 00:01:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A01ZWM021008; Wed, 10 Feb 2010 00:01:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A01Z7P021006; Wed, 10 Feb 2010 00:01:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002100001.o1A01Z7P021006@svn.freebsd.org> From: Xin LI Date: Wed, 10 Feb 2010 00:01: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: r203733 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 00:01:35 -0000 Author: delphij Date: Wed Feb 10 00:01:35 2010 New Revision: 203733 URL: http://svn.freebsd.org/changeset/base/203733 Log: Symbolic link to mailwrapper should only be removed if both MK_MAILWRAPPER and MK_SENDMAIL is "no". Reported by: Rob Farmer Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 9 23:45:14 2010 (r203732) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 10 00:01:35 2010 (r203733) @@ -1559,7 +1559,9 @@ OLD_FILES+=usr/share/misc/mail.tildehelp .if ${MK_MAILWRAPPER} == no OLD_FILES+=etc/mail/mailer.conf +.if ${MK_SENDMAIL} == no OLD_FILES+=usr/sbin/mailwrapper +.endif OLD_FILES+=usr/share/man/man8/mailwrapper.8.gz .endif From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 00:02:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81F0410656B2; Wed, 10 Feb 2010 00:02:09 +0000 (UTC) (envelope-from cracauer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70C028FC31; Wed, 10 Feb 2010 00:02:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A029gg021182; Wed, 10 Feb 2010 00:02:09 GMT (envelope-from cracauer@svn.freebsd.org) Received: (from cracauer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A029eS021180; Wed, 10 Feb 2010 00:02:09 GMT (envelope-from cracauer@svn.freebsd.org) Message-Id: <201002100002.o1A029eS021180@svn.freebsd.org> From: Martin Cracauer Date: Wed, 10 Feb 2010 00:02: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: r203734 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 00:02:09 -0000 Author: cracauer Date: Wed Feb 10 00:02:09 2010 New Revision: 203734 URL: http://svn.freebsd.org/changeset/base/203734 Log: Fix PR http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/143350 Empty string test gone wrong. Testing this requires that you have a locale that has the sign string unset but has int_n_sign_posn set (the default locale falls through to use "()" around negative numbers which is probably another bug). I created that setup by hand and indeed without this fix negative numbers are put out as positive numbers (doesn't fall through to use "-" as default indicator). Unfixed example in nl_NL.ISO8859-1 with lc->negative_sign set to empty string: strfmon(buf, sizeof(buf), "%-8i", -42.0); ==> example2: 'EUR 42,00' 'Eu 42,00' Fixed: example2: 'EUR 42,00-' 'Eu 42,00-' This file and suggested fix are identical in at least freebsd-8. Backport might be appropriate but some expert on locales should probably have a look at us defaulting to negative numbers in parenthesis when LC_* is default. That doesn't look right and is not what other OSes are doing. PR: 143350 Submitted by: Corinna Vinschen Reviewed by: bug reporter submitted, tested by me Modified: head/lib/libc/stdlib/strfmon.c Modified: head/lib/libc/stdlib/strfmon.c ============================================================================== --- head/lib/libc/stdlib/strfmon.c Wed Feb 10 00:01:35 2010 (r203733) +++ head/lib/libc/stdlib/strfmon.c Wed Feb 10 00:02:09 2010 (r203734) @@ -413,7 +413,7 @@ __setup_vars(int flags, char *cs_precede *cs_precedes = lc->int_n_cs_precedes; *sep_by_space = lc->int_n_sep_by_space; *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_n_sign_posn; - *signstr = (lc->negative_sign == '\0') ? "-" + *signstr = (lc->negative_sign[0] == '\0') ? "-" : lc->negative_sign; } else if (flags & USE_INTL_CURRENCY) { *cs_precedes = lc->int_p_cs_precedes; @@ -424,7 +424,7 @@ __setup_vars(int flags, char *cs_precede *cs_precedes = lc->n_cs_precedes; *sep_by_space = lc->n_sep_by_space; *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->n_sign_posn; - *signstr = (lc->negative_sign == '\0') ? "-" + *signstr = (lc->negative_sign[0] == '\0') ? "-" : lc->negative_sign; } else { *cs_precedes = lc->p_cs_precedes; From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 00:02:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64BAC10656A5; Wed, 10 Feb 2010 00:02:38 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-pz0-f202.google.com (mail-pz0-f202.google.com [209.85.222.202]) by mx1.freebsd.org (Postfix) with ESMTP id 13D6B8FC20; Wed, 10 Feb 2010 00:02:37 +0000 (UTC) Received: by pzk40 with SMTP id 40so9099169pzk.7 for ; Tue, 09 Feb 2010 16:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=YwA9JGD2Wuly8Gfsyl+cHw+1FplemJX4ni4u/dmjjmc=; b=PdC7IRSgXqtPFjxFCI7JTIdb3+xfms1KorA7Zp9t9HoHbpe/FVcOmlhQ+J7dkckItf ZZUSnhWF8oRR7amd8Kq+7Fa8RO/dImTONS3JIMs1jTqseZcZ43zflegcCUNpVaBVDH+Z Mz1VYQNnZRWzTPKwS7Gx8/Eml58AB+olX1KOg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=FPhTCPBk5GljUfQbU5wioW77/aO0av0XYm7KMPd6/D5dTQ1D0tX9CWMYdQudjVvj9T Ijy0+oxVLrlqf6bUiL/afuReQxvBd+KbZ//SMggMeuGmmptuaM5iXX/2BPQ7lXgOzFoZ 7zmV8k1ywAnmFJwegEhqkQ/B0aM0Wz4nvtnMM= MIME-Version: 1.0 Received: by 10.114.164.11 with SMTP id m11mr3815739wae.225.1265760157265; Tue, 09 Feb 2010 16:02:37 -0800 (PST) In-Reply-To: References: <201002070038.o170cVVA086239@svn.freebsd.org> Date: Tue, 9 Feb 2010 16:02:37 -0800 Message-ID: From: Xin LI To: Rob Farmer Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r203584 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 00:02:38 -0000 Hi, Rob, On Tue, Feb 9, 2010 at 3:40 PM, Rob Farmer wrote: > Hi, > > Thanks for fixing this. Do you think that usr/sbin/sendmail should be > added here in the mailwrapper section, since it is a symlink to > /usr/sbin/mailwrapper? I think I have overlooked this case unfortunately. It's not the usr/sbin/sendmail should be removed, but usr/sbin/mailwrapper should NOT be removed if sendmail is still there. I have committed a patch to fix that and thanks for reporting the problem. Cheers, -- Xin LI http://www.delphij.net From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 00:11:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 819461065693; Wed, 10 Feb 2010 00:11:59 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id 6205A8FC13; Wed, 10 Feb 2010 00:11:59 +0000 (UTC) MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_n1FZHhxZlAiiO2ipDJ1qwg)" Received: from [172.24.241.171] (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KXL00C2KN7JFI70@asmtp029.mac.com>; Tue, 09 Feb 2010 16:11:47 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1002090247 From: Marcel Moolenaar In-reply-to: <896B58E6-12EA-48AB-86C2-5BA9F0C59512@mac.com> Date: Tue, 09 Feb 2010 16:11:43 -0800 Message-id: <86989446-64EF-411F-8E25-173DB6AEE10B@mac.com> References: <201002090552.o195qZcD074581@svn.freebsd.org> <20100209095722.GQ9991@deviant.kiev.zoral.com.ua> <65DCE552-7EFD-48F2-85A4-EA0F1F0638EE@mac.com> <20100209184043.GV9991@deviant.kiev.zoral.com.ua> <896B58E6-12EA-48AB-86C2-5BA9F0C59512@mac.com> To: Kostik Belousov X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 00:11:59 -0000 --Boundary_(ID_n1FZHhxZlAiiO2ipDJ1qwg) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT On Feb 9, 2010, at 11:17 AM, Marcel Moolenaar wrote: > Action items: > >>>> - vmspace should be referenced by vmspace_acquire_ref() >>>> - vm_map should be read-locked before iterating the map entries. > > I'll implement it and send a patch for review to avoid unnecessary > repository churn... Please review attached patch. I have a sample session of how a debugger can use the information (see XXX lines): hob% /usr/obj/nfs/bsddbg/trunk/bdb/bdb images/abort/abort [cursor=0x2000000000000560:0] bdb> run process 1539 created process 1539 stopped with signal 5 XXX: 1: 0x2000000000000000-0x2000000000001fff, 5, 0 37 `/nfs/bsddbg/trunk/images/abort/abort` XXX: 2: 0x2000000000010000-0x2000000000011fff, 3, 0 0 `` XXX: 3: 0x2000000040010000-0x2000000040077fff, 5, 0 21 `/libexec/ld-elf.so.1` XXX: 4: 0x2000000040086000-0x2000000040089fff, 3, 0x66000 21 `/libexec/ld-elf.so.1` XXX: 5: 0x200000004008a000-0x2000000040091fff, 3, 0 0 `` XXX: 6: 0x8000000000000000-0x800000000001ffff, 3, 0 0 `` XXX: 7: 0x9ffffffffffe0000-0x9fffffffffffffff, 3, 0 0 `` 0x200000004001c560: { // MFB; > alloc r2 = ar.pfs, 0x0, 0x3, 0x3, 0x0 nop.f 0x0 nop.b 0x0 ;; } [cursor=0x200000004001c560:0] bdb> step process 1575 stopped with signal 5 0x200000004001c560: { // MFB; alloc r2 = ar.pfs, 0x0, 0x3, 0x3, 0x0 > nop.f 0x0 nop.b 0x0 ;; } [cursor=0x200000004001c560:1] bdb> continue process 1539 stopped with signal 6 XXX: 1: 0x2000000000000000-0x2000000000001fff, 5, 0 37 `/nfs/bsddbg/trunk/images/abort/abort` XXX: 2: 0x2000000000010000-0x2000000000011fff, 3, 0 0 `` XXX: 3: 0x2000000040010000-0x2000000040077fff, 5, 0 21 `/libexec/ld-elf.so.1` XXX: 4: 0x200000004007e000-0x2000000040085fff, 3, 0x6000 0 `` XXX: 5: 0x2000000040086000-0x2000000040089fff, 3, 0x66000 21 `/libexec/ld-elf.so.1` XXX: 6: 0x200000004008a000-0x2000000040099fff, 3, 0 0 `` XXX: 7: 0x200000004009c000-0x20000000402e1fff, 5, 0 15 `/lib/libc.so.7` XXX: 8: 0x20000000402e2000-0x20000000402effff, 0, 0x246000 0 `` XXX: 9: 0x20000000402f0000-0x20000000402fdfff, 3, 0x244000 15 `/lib/libc.so.7` XXX: 10: 0x20000000402fe000-0x2000000040319fff, 3, 0x262000 0 `` XXX: 11: 0x2000000040328000-0x2000000040339fff, 3, 0xe000 0 `` XXX: 12: 0x8000000000000000-0x800000000001ffff, 3, 0 0 `` XXX: 13: 0x9ffffffffffe0000-0x9fffffffffffffff, 3, 0 0 `` 0x20000000402a0c40: { // MBB; > cmp.eq p0, p6 = r0, r10 (p6) br.sptk.few 20000000400ded00 br.ret.sptk.few rp ;; } [cursor=0x20000000402a0c40:0] bdb> -- Marcel Moolenaar xcllnt@mac.com --Boundary_(ID_n1FZHhxZlAiiO2ipDJ1qwg) Content-type: application/octet-stream; name=ptrace.diff Content-transfer-encoding: 7bit Content-disposition: attachment; filename=ptrace.diff Index: kern/sys_process.c =================================================================== --- kern/sys_process.c (revision 203724) +++ kern/sys_process.c (working copy) @@ -75,7 +75,8 @@ }; struct ptrace_vm_entry32 { - uint32_t pve_cookie; + int pve_entry; + int pve_timestamp; uint32_t pve_start; uint32_t pve_end; uint32_t pve_offset; @@ -363,42 +364,56 @@ vm_map_t map; vm_map_entry_t entry; vm_object_t obj, tobj, lobj; + struct vmspace *vm; struct vnode *vp; char *freepath, *fullpath; u_int pathlen; - int error, vfslocked; + int error, index, vfslocked; - map = &p->p_vmspace->vm_map; + vm = vmspace_acquire_ref(p); + map = &vm->vm_map; + vm_map_lock_read(map); + entry = map->header.next; - if (pve->pve_cookie != NULL) { - while (entry != &map->header && entry != pve->pve_cookie) - entry = entry->next; - if (entry != pve->pve_cookie) - return (EINVAL); + index = 0; + while (index < pve->pve_entry && entry != &map->header) { entry = entry->next; + index++; } - while (entry != &map->header && (entry->eflags & MAP_ENTRY_IS_SUB_MAP)) + if (index != pve->pve_entry) { + error = EINVAL; + goto out; + } + while (entry != &map->header && + (entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { entry = entry->next; - if (entry == &map->header) - return (ENOENT); + index++; + } + if (entry == &map->header) { + error = ENOENT; + goto out; + } /* We got an entry. */ - pve->pve_cookie = entry; + pve->pve_entry = index + 1; + pve->pve_timestamp = map->timestamp; pve->pve_start = entry->start; pve->pve_end = entry->end - 1; pve->pve_offset = entry->offset; pve->pve_prot = entry->protection; + error = 0; + /* Backing object's path needed? */ if (pve->pve_pathlen == 0) - return (0); + goto out; pathlen = pve->pve_pathlen; pve->pve_pathlen = 0; obj = entry->object.vm_object; if (obj == NULL) - return (0); + goto out; VM_OBJECT_LOCK(obj); for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { @@ -420,7 +435,7 @@ vp = NULL; if (vp == NULL) - return (0); + goto out; freepath = NULL; fullpath = NULL; @@ -429,7 +444,6 @@ vrele(vp); VFS_UNLOCK_GIANT(vfslocked); - error = 0; if (fullpath != NULL) { pve->pve_pathlen = strlen(fullpath) + 1; if (pve->pve_pathlen <= pathlen) { @@ -440,9 +454,40 @@ } if (freepath != NULL) free(freepath, M_TEMP); + + out: + vm_map_unlock_read(map); + vmspace_free(vm); return (error); } +#ifdef COMPAT_IA32 +static int +ptrace_vm_entry32(struct thread *td, struct proc *p, + struct ptrace_vm_entry32 *pve32) +{ + struct ptrace_vm_entry pve; + int error; + + pve.pve_entry = pve32->pve_entry; + pve.pve_pathlen = pve32->pve_pathlen; + pve.pve_path = (void *)(uintptr_t)pve32->pve_path; + + error = ptrace_vm_entry(td, p, &pve); + if (error == 0) { + pve32->pve_entry = pve.pve_entry; + pve32->pve_timestamp = pve.pve_timestamp; + pve32->pve_start = pve.pve_start; + pve32->pve_end = pve.pve_end; + pve32->pve_offset = pve.pve_offset; + pve32->pve_prot = pve.pve_prot; + } + + pve32->pve_pathlen = pve.pve_pathlen; + return (error); +} +#endif /* COMPAT_IA32 */ + /* * Process debugging system call. */ @@ -1087,14 +1132,12 @@ break; case PT_VM_ENTRY: + PROC_UNLOCK(p); #ifdef COMPAT_IA32 - /* XXX to be implemented. */ - if (wrap32) { - error = EDOOFUS; - break; - } + if (wrap32) + error = ptrace_vm_entry32(td, p, addr); + else #endif - PROC_UNLOCK(p); error = ptrace_vm_entry(td, p, addr); PROC_LOCK(p); break; Index: sys/ptrace.h =================================================================== --- sys/ptrace.h (revision 203724) +++ sys/ptrace.h (working copy) @@ -104,7 +104,8 @@ /* Argument structure for PT_VM_ENTRY. */ struct ptrace_vm_entry { - void *pve_cookie; /* Token used to iterate. */ + int pve_entry; /* Entry number used for iteration. */ + int pve_timestamp; /* Generation number of VM map. */ u_long pve_start; /* Start VA of range. */ u_long pve_end; /* End VA of range (incl). */ u_long pve_offset; /* Offset in backing object. */ --Boundary_(ID_n1FZHhxZlAiiO2ipDJ1qwg)-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 00:18:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BABE1065672; Wed, 10 Feb 2010 00:18:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC818FC1A; Wed, 10 Feb 2010 00:18:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A0IGIU024828; Wed, 10 Feb 2010 00:18:16 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A0IGff024825; Wed, 10 Feb 2010 00:18:16 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002100018.o1A0IGff024825@svn.freebsd.org> From: Ed Maste Date: Wed, 10 Feb 2010 00:18: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: r203735 - head/usr.bin/uname X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 00:18:16 -0000 Author: emaste Date: Wed Feb 10 00:18:15 2010 New Revision: 203735 URL: http://svn.freebsd.org/changeset/base/203735 Log: Add new -o option (r203042) to manpage synopsis and usage(). Submitted by: ru Modified: head/usr.bin/uname/uname.1 head/usr.bin/uname/uname.c Modified: head/usr.bin/uname/uname.1 ============================================================================== --- head/usr.bin/uname/uname.1 Wed Feb 10 00:02:09 2010 (r203734) +++ head/usr.bin/uname/uname.1 Wed Feb 10 00:18:15 2010 (r203735) @@ -40,7 +40,7 @@ .Nd display information about the system .Sh SYNOPSIS .Nm -.Op Fl aimnprsv +.Op Fl aimnoprsv .Sh DESCRIPTION The .Nm Modified: head/usr.bin/uname/uname.c ============================================================================== --- head/usr.bin/uname/uname.c Wed Feb 10 00:02:09 2010 (r203734) +++ head/usr.bin/uname/uname.c Wed Feb 10 00:18:15 2010 (r203735) @@ -245,6 +245,6 @@ NATIVE_SYSCTLNAME_GET(ident, "kern.ident void usage(void) { - fprintf(stderr, "usage: uname [-aimnprsv]\n"); + fprintf(stderr, "usage: uname [-aimnoprsv]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 00:26:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B10641065670; Wed, 10 Feb 2010 00:26:20 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 871688FC15; Wed, 10 Feb 2010 00:26:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A0QKwe026626; Wed, 10 Feb 2010 00:26:20 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A0QKiw026625; Wed, 10 Feb 2010 00:26:20 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201002100026.o1A0QKiw026625@svn.freebsd.org> From: Ken Smith Date: Wed, 10 Feb 2010 00:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203736 - releng/7.3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 00:26:20 -0000 Author: kensmith Date: Wed Feb 10 00:26:20 2010 New Revision: 203736 URL: http://svn.freebsd.org/changeset/base/203736 Log: Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process. Approved by: re (implicit) Added: releng/7.3/ - copied from r203735, stable/7/ From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 00:34:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B0B81065670; Wed, 10 Feb 2010 00:34:14 +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 333F08FC16; Wed, 10 Feb 2010 00:34:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A0YEhV028381; Wed, 10 Feb 2010 00:34:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A0YEIv028376; Wed, 10 Feb 2010 00:34:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002100034.o1A0YEIv028376@svn.freebsd.org> From: Xin LI Date: Wed, 10 Feb 2010 00:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203737 - stable/8/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 00:34:14 -0000 Author: delphij Date: Wed Feb 10 00:34:13 2010 New Revision: 203737 URL: http://svn.freebsd.org/changeset/base/203737 Log: MFC r202060: Add a new option, -q howmany, which when used in conjuction with -w, exits netstat after _howmany_ outputs. Requested by: thomasa Reviewed by: freebsd-net (bms, old version in early 2007) Modified: stable/8/usr.bin/netstat/if.c stable/8/usr.bin/netstat/main.c stable/8/usr.bin/netstat/netstat.1 stable/8/usr.bin/netstat/netstat.h Directory Properties: stable/8/usr.bin/netstat/ (props changed) Modified: stable/8/usr.bin/netstat/if.c ============================================================================== --- stable/8/usr.bin/netstat/if.c Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/if.c Wed Feb 10 00:34:13 2010 (r203737) @@ -685,6 +685,8 @@ loop: if (!first) putchar('\n'); fflush(stdout); + if ((noutputs != 0) && (--noutputs == 0)) + exit(0); oldmask = sigblock(sigmask(SIGALRM)); while (!signalled) sigpause(0); Modified: stable/8/usr.bin/netstat/main.c ============================================================================== --- stable/8/usr.bin/netstat/main.c Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/main.c Wed Feb 10 00:34:13 2010 (r203737) @@ -332,6 +332,7 @@ int hflag; /* show counters in human re int iflag; /* show interfaces */ int Lflag; /* show size of listen queues */ int mflag; /* show memory stats */ +int noutputs = 0; /* how much outputs before we exit */ int numeric_addr; /* show addresses numerically */ int numeric_port; /* show ports numerically */ static int pflag; /* show given protocol */ @@ -358,7 +359,7 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:rSstuWw:xz")) != -1) + while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:q:rSstuWw:xz")) != -1) switch(ch) { case 'A': Aflag = 1; @@ -444,6 +445,11 @@ main(int argc, char *argv[]) } pflag = 1; break; + case 'q': + noutputs = atoi(optarg); + if (noutputs != 0) + noutputs++; + break; case 'r': rflag = 1; break; @@ -780,7 +786,7 @@ usage(void) " [-M core] [-N system]", " netstat -i | -I interface [-abdhntW] [-f address_family]\n" " [-M core] [-N system]", -" netstat -w wait [-I interface] [-d] [-M core] [-N system]", +" netstat -w wait [-I interface] [-d] [-M core] [-N system] [-q howmany]", " netstat -s [-s] [-z] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -i | -I interface -s [-f protocol_family | -p protocol]\n" Modified: stable/8/usr.bin/netstat/netstat.1 ============================================================================== --- stable/8/usr.bin/netstat/netstat.1 Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/netstat.1 Wed Feb 10 00:34:13 2010 (r203737) @@ -32,7 +32,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 9, 2009 +.Dd January 10, 2010 .Dt NETSTAT 1 .Os .Sh NAME @@ -136,6 +136,7 @@ is also present, print interface names u .Op Fl d .Op Fl M Ar core .Op Fl N Ar system +.Op Fl q Ar howmany .Ek .Xc At intervals of @@ -146,6 +147,11 @@ traffic on all configured network interf or a single .Ar interface . If +.Fl q +is also present, exit after +.Ar howmany +outputs. +If .Fl d is also present, show the number of dropped packets. .It Xo Modified: stable/8/usr.bin/netstat/netstat.h ============================================================================== --- stable/8/usr.bin/netstat/netstat.h Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/netstat.h Wed Feb 10 00:34:13 2010 (r203737) @@ -45,6 +45,7 @@ extern int hflag; /* show counters in hu extern int iflag; /* show interfaces */ extern int Lflag; /* show size of listen queues */ extern int mflag; /* show memory stats */ +extern int noutputs; /* how much outputs before we exit */ extern int numeric_addr; /* show addresses numerically */ extern int numeric_port; /* show ports numerically */ extern int rflag; /* show routing tables (or routing stats) */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 04:01:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1E3B106568B; Wed, 10 Feb 2010 04:01:45 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0F1A8FC14; Wed, 10 Feb 2010 04:01:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A41jti074179; Wed, 10 Feb 2010 04:01:45 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A41jeU074177; Wed, 10 Feb 2010 04:01:45 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201002100401.o1A41jeU074177@svn.freebsd.org> From: Ken Smith Date: Wed, 10 Feb 2010 04:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203738 - releng/7.3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 04:01:46 -0000 Author: kensmith Date: Wed Feb 10 04:01:45 2010 New Revision: 203738 URL: http://svn.freebsd.org/changeset/base/203738 Log: Update branch tag for 'make update'. Approved by: re (implicit) Modified: releng/7.3/Makefile.inc1 Modified: releng/7.3/Makefile.inc1 ============================================================================== --- releng/7.3/Makefile.inc1 Wed Feb 10 00:34:13 2010 (r203737) +++ releng/7.3/Makefile.inc1 Wed Feb 10 04:01:45 2010 (r203738) @@ -88,7 +88,7 @@ CLEANDIR= cleandir .endif CVS?= cvs -CVSFLAGS?= -r RELENG_7 -P -d -I! +CVSFLAGS?= -r RELENG_7_3 -P -d -I! SUP?= /usr/bin/csup SUPFLAGS?= -g -L 2 .if defined(SUPHOST) From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 04:06:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D71D91065672; Wed, 10 Feb 2010 04:06:29 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5D248FC14; Wed, 10 Feb 2010 04:06:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A46TwX075249; Wed, 10 Feb 2010 04:06:29 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A46Txg075247; Wed, 10 Feb 2010 04:06:29 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201002100406.o1A46Txg075247@svn.freebsd.org> From: Ken Smith Date: Wed, 10 Feb 2010 04:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203739 - releng/7.3/share/examples/cvsup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 04:06:29 -0000 Author: kensmith Date: Wed Feb 10 04:06:29 2010 New Revision: 203739 URL: http://svn.freebsd.org/changeset/base/203739 Log: Update branch tag. Approved by: re (implicit) Modified: releng/7.3/share/examples/cvsup/standard-supfile Modified: releng/7.3/share/examples/cvsup/standard-supfile ============================================================================== --- releng/7.3/share/examples/cvsup/standard-supfile Wed Feb 10 04:01:45 2010 (r203738) +++ releng/7.3/share/examples/cvsup/standard-supfile Wed Feb 10 04:06:29 2010 (r203739) @@ -49,7 +49,7 @@ *default host=CHANGE_THIS.FreeBSD.org *default base=/var/db *default prefix=/usr -*default release=cvs tag=RELENG_7 +*default release=cvs tag=RELENG_7_3 *default delete use-rel-suffix # If you seem to be limited by CPU rather than network or disk bandwidth, try From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 04:09:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4403E1065676; Wed, 10 Feb 2010 04:09:34 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 330D98FC18; Wed, 10 Feb 2010 04:09:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A49Y8o075995; Wed, 10 Feb 2010 04:09:34 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A49Yuj075992; Wed, 10 Feb 2010 04:09:34 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201002100409.o1A49Yuj075992@svn.freebsd.org> From: Ken Smith Date: Wed, 10 Feb 2010 04:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203740 - releng/7.3/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 04:09:34 -0000 Author: kensmith Date: Wed Feb 10 04:09:33 2010 New Revision: 203740 URL: http://svn.freebsd.org/changeset/base/203740 Log: Adjust __FreeBSD_version for this being the 7.3-RELEASE release branch. Approved by: re (implicit) Modified: releng/7.3/sys/sys/param.h Modified: releng/7.3/sys/sys/param.h ============================================================================== --- releng/7.3/sys/sys/param.h Wed Feb 10 04:06:29 2010 (r203739) +++ releng/7.3/sys/sys/param.h Wed Feb 10 04:09:33 2010 (r203740) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 702106 /* Master, propagated to newvers */ +#define __FreeBSD_version 703000 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 04:10:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B14C1065693; Wed, 10 Feb 2010 04:10:37 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A1088FC15; Wed, 10 Feb 2010 04:10:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A4AaqK076270; Wed, 10 Feb 2010 04:10:36 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A4Aajl076268; Wed, 10 Feb 2010 04:10:36 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201002100410.o1A4Aajl076268@svn.freebsd.org> From: Ken Smith Date: Wed, 10 Feb 2010 04:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203741 - releng/7.3/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 04:10:37 -0000 Author: kensmith Date: Wed Feb 10 04:10:36 2010 New Revision: 203741 URL: http://svn.freebsd.org/changeset/base/203741 Log: Ready for 7.3-RC1. Approved by: re (implicit) Modified: releng/7.3/sys/conf/newvers.sh Modified: releng/7.3/sys/conf/newvers.sh ============================================================================== --- releng/7.3/sys/conf/newvers.sh Wed Feb 10 04:09:33 2010 (r203740) +++ releng/7.3/sys/conf/newvers.sh Wed Feb 10 04:10:36 2010 (r203741) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.3" -BRANCH="PRERELEASE" +BRANCH="RC1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 04:12:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD8261065670; Wed, 10 Feb 2010 04:12:55 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB7978FC16; Wed, 10 Feb 2010 04:12:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A4CtGL076841; Wed, 10 Feb 2010 04:12:55 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A4CtV9076839; Wed, 10 Feb 2010 04:12:55 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201002100412.o1A4CtV9076839@svn.freebsd.org> From: Ken Smith Date: Wed, 10 Feb 2010 04:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203742 - stable/7/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 04:12:56 -0000 Author: kensmith Date: Wed Feb 10 04:12:55 2010 New Revision: 203742 URL: http://svn.freebsd.org/changeset/base/203742 Log: Bump __FreeBSD_version to reflect that releng/7.3 has been branched. Approved by: re (implicit) Modified: stable/7/sys/sys/param.h Modified: stable/7/sys/sys/param.h ============================================================================== --- stable/7/sys/sys/param.h Wed Feb 10 04:10:36 2010 (r203741) +++ stable/7/sys/sys/param.h Wed Feb 10 04:12:55 2010 (r203742) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 702106 /* Master, propagated to newvers */ +#define __FreeBSD_version 703100 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 05:43:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 591C11065672; Wed, 10 Feb 2010 05:43:32 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 484598FC16; Wed, 10 Feb 2010 05:43:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A5hWu0097234; Wed, 10 Feb 2010 05:43:32 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A5hWMp097233; Wed, 10 Feb 2010 05:43:32 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002100543.o1A5hWMp097233@svn.freebsd.org> From: Neel Natu Date: Wed, 10 Feb 2010 05:43: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: r203743 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 05:43:32 -0000 Author: neel Date: Wed Feb 10 05:43:31 2010 New Revision: 203743 URL: http://svn.freebsd.org/changeset/base/203743 Log: Enable interrupts before doing AST processing to avoid a deadlock. Specifically on an SMP kernel it was observed that if both the processors are doing an exit1() via ast()->postsig()->sigexit() then we will deadlock. This happens because exit1() calls vmspace_exit() that in turn calls pmap_invalidate_all(). This function tries to do a smp_rendezvous() which blocks because the other processor is not responding to IPIs - because it too is doing AST processing with interrupts disabled. Modified: head/sys/mips/mips/exception.S Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Wed Feb 10 04:12:55 2010 (r203742) +++ head/sys/mips/mips/exception.S Wed Feb 10 05:43:31 2010 (r203743) @@ -728,6 +728,18 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE sw a3, STAND_RA_OFFSET(sp) # for debugging /* + * Enable interrupts before doing ast(). + * + * On SMP kernels the AST processing might trigger IPI to other processors. + * If that processor is also doing AST processing with interrupts disabled + * then we may deadlock. + */ + mfc0 a0, COP_0_STATUS_REG + or a0, a0, SR_INT_ENAB + mtc0 a0, COP_0_STATUS_REG + ITLBNOPFIX + +/* * DO_AST enabled interrupts */ DO_AST From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 05:47:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B99B91065679; Wed, 10 Feb 2010 05:47:34 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8EF28FC13; Wed, 10 Feb 2010 05:47:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A5lYXK098169; Wed, 10 Feb 2010 05:47:34 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A5lYfq098167; Wed, 10 Feb 2010 05:47:34 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201002100547.o1A5lYfq098167@svn.freebsd.org> From: David Xu Date: Wed, 10 Feb 2010 05:47: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: r203744 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 05:47:34 -0000 Author: davidxu Date: Wed Feb 10 05:47:34 2010 New Revision: 203744 URL: http://svn.freebsd.org/changeset/base/203744 Log: In function umtxq_insert_queue, use parameter q (shared/exclusive queue) instead of hard coded constant. This does not affect RELENG_8 and previous, because the code only exists in the HEAD. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Wed Feb 10 05:43:31 2010 (r203743) +++ head/sys/kern/kern_umtx.c Wed Feb 10 05:47:34 2010 (r203744) @@ -420,7 +420,7 @@ umtxq_insert_queue(struct umtx_q *uq, in uc = umtxq_getchain(&uq->uq_key); UMTXQ_LOCKED_ASSERT(uc); KASSERT((uq->uq_flags & UQF_UMTXQ) == 0, ("umtx_q is already on queue")); - uh = umtxq_queue_lookup(&uq->uq_key, UMTX_SHARED_QUEUE); + uh = umtxq_queue_lookup(&uq->uq_key, q); if (uh != NULL) { LIST_INSERT_HEAD(&uc->uc_spare_queue, uq->uq_spare_queue, link); } else { From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 06:29:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CADD31065672; Wed, 10 Feb 2010 06:29:43 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0C768FC13; Wed, 10 Feb 2010 06:29:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A6ThLU007645; Wed, 10 Feb 2010 06:29:43 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A6Th9V007643; Wed, 10 Feb 2010 06:29:43 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002100629.o1A6Th9V007643@svn.freebsd.org> From: Neel Natu Date: Wed, 10 Feb 2010 06:29: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: r203745 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 06:29:43 -0000 Author: neel Date: Wed Feb 10 06:29:43 2010 New Revision: 203745 URL: http://svn.freebsd.org/changeset/base/203745 Log: Call profclock() and statclock() explicitly on all cpus. Prior to this change these functions were called only on the BSP indirectly via hardclock(). top -P now shows usage statistics of all cpus. Modified: head/sys/mips/mips/tick.c Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Wed Feb 10 05:47:34 2010 (r203744) +++ head/sys/mips/mips/tick.c Wed Feb 10 06:29:43 2010 (r203745) @@ -55,7 +55,7 @@ uint64_t counter_freq; uint64_t cycles_per_tick; uint64_t cycles_per_usec; uint64_t cycles_per_sec; -uint64_t cycles_per_hz; +uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz; u_int32_t counter_upper = 0; u_int32_t counter_lower_last = 0; @@ -136,6 +136,9 @@ void mips_timer_init_params(uint64_t platform_counter_freq, int double_count) { + stathz = hz; + profhz = hz; + /* * XXX: Do not use printf here: uart code 8250 may use DELAY so this * function should be called before cninit. @@ -151,18 +154,23 @@ mips_timer_init_params(uint64_t platform cycles_per_tick = counter_freq / 1000; cycles_per_hz = counter_freq / hz; + cycles_per_stathz = counter_freq / stathz; + cycles_per_profhz = counter_freq / profhz; cycles_per_usec = counter_freq / (1 * 1000 * 1000); cycles_per_sec = counter_freq ; counter_timecounter.tc_frequency = counter_freq; - printf("hz=%d cyl_per_hz:%jd cyl_per_usec:%jd freq:%jd cyl_per_hz:%jd cyl_per_sec:%jd\n", + printf("hz=%d cyl_per_tick:%jd cyl_per_usec:%jd freq:%jd " + "cyl_per_hz:%jd cyl_per_stathz:%jd cyl_per_profhz:%jd " + "cyl_per_sec:%jd\n", hz, cycles_per_tick, cycles_per_usec, counter_freq, cycles_per_hz, - cycles_per_sec - ); + cycles_per_stathz, + cycles_per_profhz, + cycles_per_sec); set_cputicker(tick_ticker, counter_freq, 1); } @@ -280,17 +288,18 @@ clock_intr(void *arg) else hardclock_cpu(USERMODE(tf->sr)); } + /* Fire statclock at stathz. */ - cpu_ticks->stat_ticks += stathz; - if (cpu_ticks->stat_ticks >= cycles_per_hz) { - cpu_ticks->stat_ticks -= cycles_per_hz; + cpu_ticks->stat_ticks += cycles_per_tick; + if (cpu_ticks->stat_ticks >= cycles_per_stathz) { + cpu_ticks->stat_ticks -= cycles_per_stathz; statclock(USERMODE(tf->sr)); } /* Fire profclock at profhz, but only when needed. */ - cpu_ticks->prof_ticks += profhz; - if (cpu_ticks->prof_ticks >= cycles_per_hz) { - cpu_ticks->prof_ticks -= cycles_per_hz; + cpu_ticks->prof_ticks += cycles_per_tick; + if (cpu_ticks->prof_ticks >= cycles_per_profhz) { + cpu_ticks->prof_ticks -= cycles_per_profhz; if (profprocs != 0) profclock(USERMODE(tf->sr), tf->pc); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 06:57:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B942106566C; Wed, 10 Feb 2010 06:57:06 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 118BB8FC12; Wed, 10 Feb 2010 06:57:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A6v5p6013710; Wed, 10 Feb 2010 06:57:05 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A6v5Wn013708; Wed, 10 Feb 2010 06:57:05 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002100657.o1A6v5Wn013708@svn.freebsd.org> From: Neel Natu Date: Wed, 10 Feb 2010 06:57: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: r203746 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 06:57:06 -0000 Author: neel Date: Wed Feb 10 06:57:05 2010 New Revision: 203746 URL: http://svn.freebsd.org/changeset/base/203746 Log: Code cleanup: - make some variables static - remove unused variables. Modified: head/sys/mips/mips/tick.c Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Wed Feb 10 06:29:43 2010 (r203745) +++ head/sys/mips/mips/tick.c Wed Feb 10 06:57:05 2010 (r203746) @@ -47,21 +47,19 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include uint64_t counter_freq; -uint64_t cycles_per_tick; -uint64_t cycles_per_usec; -uint64_t cycles_per_sec; -uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz; - -u_int32_t counter_upper = 0; -u_int32_t counter_lower_last = 0; -int tick_started = 0; -void platform_initclocks(void); +static uint64_t cycles_per_tick; +static uint64_t cycles_per_usec; +static uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz; + +static u_int32_t counter_upper = 0; +static u_int32_t counter_lower_last = 0; struct clk_ticks { @@ -103,10 +101,8 @@ mips_timer_early_init(uint64_t clock_hz) void platform_initclocks(void) { - if (!tick_started) { - tc_init(&counter_timecounter); - tick_started++; - } + + tc_init(&counter_timecounter); } static uint64_t @@ -157,20 +153,17 @@ mips_timer_init_params(uint64_t platform cycles_per_stathz = counter_freq / stathz; cycles_per_profhz = counter_freq / profhz; cycles_per_usec = counter_freq / (1 * 1000 * 1000); - cycles_per_sec = counter_freq ; counter_timecounter.tc_frequency = counter_freq; printf("hz=%d cyl_per_tick:%jd cyl_per_usec:%jd freq:%jd " - "cyl_per_hz:%jd cyl_per_stathz:%jd cyl_per_profhz:%jd " - "cyl_per_sec:%jd\n", + "cyl_per_hz:%jd cyl_per_stathz:%jd cyl_per_profhz:%jd\n", hz, cycles_per_tick, cycles_per_usec, counter_freq, cycles_per_hz, cycles_per_stathz, - cycles_per_profhz, - cycles_per_sec); + cycles_per_profhz); set_cputicker(tick_ticker, counter_freq, 1); } @@ -307,7 +300,7 @@ clock_intr(void *arg) #if 0 /* TARGET_OCTEON */ /* Run the FreeBSD display once every hz ticks */ wheel_run += cycles_per_tick; - if (wheel_run >= cycles_per_sec) { + if (wheel_run >= cycles_per_usec * 1000000ULL) { wheel_run = 0; octeon_led_run_wheel(); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 07:15:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 382291065670; Wed, 10 Feb 2010 07:15:22 +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 0E61A8FC12; Wed, 10 Feb 2010 07:15:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A7FLPm017776; Wed, 10 Feb 2010 07:15:21 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A7FL1V017774; Wed, 10 Feb 2010 07:15:21 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002100715.o1A7FL1V017774@svn.freebsd.org> From: Ed Schouten Date: Wed, 10 Feb 2010 07:15: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: r203747 - head/usr.bin/find X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 07:15:22 -0000 Author: ed Date: Wed Feb 10 07:15:21 2010 New Revision: 203747 URL: http://svn.freebsd.org/changeset/base/203747 Log: Remove unneeded CFLAGS. Modified: head/usr.bin/find/Makefile Modified: head/usr.bin/find/Makefile ============================================================================== --- head/usr.bin/find/Makefile Wed Feb 10 06:57:05 2010 (r203746) +++ head/usr.bin/find/Makefile Wed Feb 10 07:15:21 2010 (r203747) @@ -4,7 +4,6 @@ PROG= find SRCS= find.c function.c ls.c main.c misc.c operator.c option.c \ getdate.y -CFLAGS+= -DHAVE_SYS_TIMEB_H -I${.CURDIR} YFLAGS= .include From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 08:50:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E72E4106566B; Wed, 10 Feb 2010 08:50:06 +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 994278FC12; Wed, 10 Feb 2010 08:50:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A8o6c8038845; Wed, 10 Feb 2010 08:50:06 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A8o6tD038842; Wed, 10 Feb 2010 08:50:06 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201002100850.o1A8o6tD038842@svn.freebsd.org> From: Marko Zec Date: Wed, 10 Feb 2010 08:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203748 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 08:50:07 -0000 Author: zec Date: Wed Feb 10 08:50:06 2010 New Revision: 203748 URL: http://svn.freebsd.org/changeset/base/203748 Log: MFC r203483: Instead of spamming the console on each curvnet recursion event, print out each such call graph only once, along with a stack backtrace. This should make kernels built with VNET_DEBUG reasonably usable again in busy / production environments. Introduce a new DDB command "show vnetrcrs" which dumps the whole log of distinctive curvnet recursion events. This might be useful when recursion reports get burried / lost too deep in the message buffer. In the later case stack backtraces are not available. Reviewed by: bz Modified: stable/8/sys/net/vnet.c stable/8/sys/net/vnet.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/net/vnet.c ============================================================================== --- stable/8/sys/net/vnet.c Wed Feb 10 07:15:21 2010 (r203747) +++ stable/8/sys/net/vnet.c Wed Feb 10 08:50:06 2010 (r203748) @@ -37,8 +37,10 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_kdb.h" #include +#include #include #include #include @@ -616,6 +618,65 @@ vnet_sysuninit(void) VNET_SYSINIT_RUNLOCK(); } +#ifdef VNET_DEBUG +struct vnet_recursion { + SLIST_ENTRY(vnet_recursion) vnr_le; + const char *prev_fn; + const char *where_fn; + int where_line; + struct vnet *old_vnet; + struct vnet *new_vnet; +}; + +static SLIST_HEAD(, vnet_recursion) vnet_recursions = + SLIST_HEAD_INITIALIZER(vnet_recursions); + +static void +vnet_print_recursion(struct vnet_recursion *vnr, int brief) +{ + + if (!brief) + printf("CURVNET_SET() recursion in "); + printf("%s() line %d, prev in %s()", vnr->where_fn, vnr->where_line, + vnr->prev_fn); + if (brief) + printf(", "); + else + printf("\n "); + printf("%p -> %p\n", vnr->old_vnet, vnr->new_vnet); +} + +void +vnet_log_recursion(struct vnet *old_vnet, const char *old_fn, int line) +{ + struct vnet_recursion *vnr; + + /* Skip already logged recursion events. */ + SLIST_FOREACH(vnr, &vnet_recursions, vnr_le) + if (vnr->prev_fn == old_fn && + vnr->where_fn == curthread->td_vnet_lpush && + vnr->where_line == line && + (vnr->old_vnet == vnr->new_vnet) == (curvnet == old_vnet)) + return; + + vnr = malloc(sizeof(*vnr), M_VNET, M_NOWAIT | M_ZERO); + if (vnr == NULL) + panic("%s: malloc failed", __func__); + vnr->prev_fn = old_fn; + vnr->where_fn = curthread->td_vnet_lpush; + vnr->where_line = line; + vnr->old_vnet = old_vnet; + vnr->new_vnet = curvnet; + + SLIST_INSERT_HEAD(&vnet_recursions, vnr, vnr_le); + + vnet_print_recursion(vnr, 0); +#ifdef KDB + kdb_backtrace(); +#endif +} +#endif /* VNET_DEBUG */ + #ifdef DDB DB_SHOW_COMMAND(vnets, db_show_vnets) { @@ -637,4 +698,14 @@ DB_SHOW_COMMAND(vnets, db_show_vnets) break; } } + +#ifdef VNET_DEBUG +DB_SHOW_COMMAND(vnetrcrs, db_show_vnetrcrs) +{ + struct vnet_recursion *vnr; + + SLIST_FOREACH(vnr, &vnet_recursions, vnr_le) + vnet_print_recursion(vnr, 1); +} #endif +#endif /* DDB */ Modified: stable/8/sys/net/vnet.h ============================================================================== --- stable/8/sys/net/vnet.h Wed Feb 10 07:15:21 2010 (r203747) +++ stable/8/sys/net/vnet.h Wed Feb 10 08:50:06 2010 (r203748) @@ -108,6 +108,8 @@ void vnet_destroy(struct vnet *vnet); * assertions. */ #ifdef VNET_DEBUG +void vnet_log_recursion(struct vnet *, const char *, int); + #define VNET_ASSERT(condition) \ if (!(condition)) { \ printf("VNET_ASSERT @ %s:%d %s():\n", \ @@ -125,9 +127,7 @@ void vnet_destroy(struct vnet *vnet); #define CURVNET_SET_VERBOSE(arg) \ CURVNET_SET_QUIET(arg) \ if (saved_vnet) \ - printf("CURVNET_SET(%p) in %s() on cpu %d, prev %p in %s()\n", \ - curvnet, curthread->td_vnet_lpush, curcpu, \ - saved_vnet, saved_vnet_lpush); + vnet_log_recursion(saved_vnet, saved_vnet_lpush, __LINE__); #define CURVNET_SET(arg) CURVNET_SET_VERBOSE(arg) From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 09:14:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 177FB1065672; Wed, 10 Feb 2010 09:14:12 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from mx1.wheel.pl (grom.wheel.pl [91.121.70.66]) by mx1.freebsd.org (Postfix) with ESMTP id BD4938FC0A; Wed, 10 Feb 2010 09:14:11 +0000 (UTC) Received: from localhost (unknown [10.10.2.1]) by mx1.wheel.pl (Postfix) with ESMTP id 22722ADA7; Wed, 10 Feb 2010 10:15:25 +0100 (CET) X-Virus-Scanned: amavisd-new at mx1.wheel.pl Received: from mx1.wheel.pl ([10.10.2.1]) by localhost (mx1.wheel.pl [10.10.2.1]) (amavisd-new, port 10024) with ESMTP id lE-8FU7Zzi4R; Wed, 10 Feb 2010 10:15:24 +0100 (CET) Received: from mail.wheel.pl (ghf58.internetdsl.tpnet.pl [83.12.187.58]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.wheel.pl (Postfix) with ESMTPS id 9F0F3ADA3; Wed, 10 Feb 2010 10:15:23 +0100 (CET) Received: from localhost (unknown [10.0.2.3]) by mail.wheel.pl (Postfix) with ESMTP id 3BD8547B14; Wed, 10 Feb 2010 10:14:07 +0100 (CET) Received: from mail.wheel.pl ([10.0.2.3]) by localhost (mx2.wheel.pl [10.0.2.3]) (amavisd-new, port 10024) with ESMTP id 2ZHatdiGlocr; Wed, 10 Feb 2010 10:14:06 +0100 (CET) Received: from enapierala.wheel.pl (enapierala.wheel.pl [10.0.1.6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.wheel.pl (Postfix) with ESMTPSA id 6753F47B11; Wed, 10 Feb 2010 10:14:06 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <201002091616.50087.jhb@freebsd.org> Date: Wed, 10 Feb 2010 10:14:06 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <5E89BB4D-5391-426C-B819-668FCC83736F@freebsd.org> References: <201002092058.o19Kwdut079944@svn.freebsd.org> <201002091616.50087.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203721 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 09:14:12 -0000 Wiadomo=B6=E6 napisana przez John Baldwin w dniu 2010-02-09, o godz. = 22:16: > On Tuesday 09 February 2010 3:58:39 pm Edward Tomasz Napierala wrote: >> Author: trasz >> Date: Tue Feb 9 20:58:39 2010 >> New Revision: 203721 >> URL: http://svn.freebsd.org/changeset/base/203721 >>=20 >> Log: >> Add references to VOP_* man pages to vnode(9). >=20 > Hmm, it seems VOP_MARKATIME.9 is missing, probably because the actual = manpage=20 > for that is missing. :-P Same situation with VOP_CACHEDLOOKUP, VOP_WHITEOUT, VOP_MARKATIME, = VOP_POLL, VOP_KQFILTER, VOP_BMAP, VOP_GETWRITEMOUNT, VOP_ADVLOCKASYNC and = VOP_SETLABEL. -- If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 09:15:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 886A71065670; Wed, 10 Feb 2010 09:15:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id F24638FC19; Wed, 10 Feb 2010 09:15:28 +0000 (UTC) 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 o1A9FMXx029299 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 10 Feb 2010 11:15:22 +0200 (EET) (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 o1A9FMOF066212; Wed, 10 Feb 2010 11:15:22 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o1A9FMSW066211; Wed, 10 Feb 2010 11:15:22 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 10 Feb 2010 11:15:22 +0200 From: Kostik Belousov To: Marcel Moolenaar Message-ID: <20100210091522.GW9991@deviant.kiev.zoral.com.ua> References: <201002090552.o195qZcD074581@svn.freebsd.org> <20100209095722.GQ9991@deviant.kiev.zoral.com.ua> <65DCE552-7EFD-48F2-85A4-EA0F1F0638EE@mac.com> <20100209184043.GV9991@deviant.kiev.zoral.com.ua> <896B58E6-12EA-48AB-86C2-5BA9F0C59512@mac.com> <86989446-64EF-411F-8E25-173DB6AEE10B@mac.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9+ohdFDUqiMJzwPo" Content-Disposition: inline In-Reply-To: <86989446-64EF-411F-8E25-173DB6AEE10B@mac.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 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 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 09:15:29 -0000 --9+ohdFDUqiMJzwPo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 09, 2010 at 04:11:43PM -0800, Marcel Moolenaar wrote: >=20 > On Feb 9, 2010, at 11:17 AM, Marcel Moolenaar wrote: >=20 > > Action items: > >=20 > >>>> - vmspace should be referenced by vmspace_acquire_ref() > >>>> - vm_map should be read-locked before iterating the map entries. > >=20 > > I'll implement it and send a patch for review to avoid unnecessary > > repository churn... >=20 > Please review attached patch. I have a sample session of how > a debugger can use the information (see XXX lines): >=20 > hob% /usr/obj/nfs/bsddbg/trunk/bdb/bdb images/abort/abort > [cursor=3D0x2000000000000560:0] > bdb> run > process 1539 created > process 1539 stopped with signal 5 > XXX: 1: 0x2000000000000000-0x2000000000001fff, 5, 0 37 `/nfs/bsddbg/trunk= /images/abort/abort` > XXX: 2: 0x2000000000010000-0x2000000000011fff, 3, 0 0 `` > XXX: 3: 0x2000000040010000-0x2000000040077fff, 5, 0 21 `/libexec/ld-elf.s= o.1` > XXX: 4: 0x2000000040086000-0x2000000040089fff, 3, 0x66000 21 `/libexec/ld= -elf.so.1` > XXX: 5: 0x200000004008a000-0x2000000040091fff, 3, 0 0 `` > XXX: 6: 0x8000000000000000-0x800000000001ffff, 3, 0 0 `` > XXX: 7: 0x9ffffffffffe0000-0x9fffffffffffffff, 3, 0 0 `` > 0x200000004001c560: { // MFB; > > alloc r2 =3D ar.pfs, 0x0, 0x3, 0x3, 0x0 > nop.f 0x0 > nop.b 0x0 ;; > } > [cursor=3D0x200000004001c560:0] > bdb> step > process 1575 stopped with signal 5 > 0x200000004001c560: { // MFB; > alloc r2 =3D ar.pfs, 0x0, 0x3, 0x3, 0x0 > > nop.f 0x0 > nop.b 0x0 ;; > } > [cursor=3D0x200000004001c560:1] > bdb> continue > process 1539 stopped with signal 6 > XXX: 1: 0x2000000000000000-0x2000000000001fff, 5, 0 37 `/nfs/bsddbg/trunk= /images/abort/abort` > XXX: 2: 0x2000000000010000-0x2000000000011fff, 3, 0 0 `` > XXX: 3: 0x2000000040010000-0x2000000040077fff, 5, 0 21 `/libexec/ld-elf.s= o.1` > XXX: 4: 0x200000004007e000-0x2000000040085fff, 3, 0x6000 0 `` > XXX: 5: 0x2000000040086000-0x2000000040089fff, 3, 0x66000 21 `/libexec/ld= -elf.so.1` > XXX: 6: 0x200000004008a000-0x2000000040099fff, 3, 0 0 `` > XXX: 7: 0x200000004009c000-0x20000000402e1fff, 5, 0 15 `/lib/libc.so.7` > XXX: 8: 0x20000000402e2000-0x20000000402effff, 0, 0x246000 0 `` > XXX: 9: 0x20000000402f0000-0x20000000402fdfff, 3, 0x244000 15 `/lib/libc.= so.7` > XXX: 10: 0x20000000402fe000-0x2000000040319fff, 3, 0x262000 0 `` > XXX: 11: 0x2000000040328000-0x2000000040339fff, 3, 0xe000 0 `` > XXX: 12: 0x8000000000000000-0x800000000001ffff, 3, 0 0 `` > XXX: 13: 0x9ffffffffffe0000-0x9fffffffffffffff, 3, 0 0 `` > 0x20000000402a0c40: { // MBB; > > cmp.eq p0, p6 =3D r0, r10 > (p6) br.sptk.few 20000000400ded00 > br.ret.sptk.few rp ;; > } > [cursor=3D0x20000000402a0c40:0] > bdb>=20 Vnode locks are before vm map locks in global lock order. vn_fullpath() may need to lock vnodes to call VOP_VPTOCNP(). I think you should (and can) drop both vm map lock and vmspace reference much earlier. Would it be cleaner to use explicitely sized types for compat32 structure members ? Comparing ptrace_vm_entry with kinfo_vmentry, I think that it might be good idea to add fsid and inode number to ptrace_vm_entry, to give at least some information when vn_fullpath failed. --9+ohdFDUqiMJzwPo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktyeSoACgkQC3+MBN1Mb4hpNQCfZznT84jUVPvxedAC5ho2rrWV AKIAoNpmf7HEP6/ZSCALTDz1cmmU1zvb =YVn5 -----END PGP SIGNATURE----- --9+ohdFDUqiMJzwPo-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 09:46:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDFA41065670; Wed, 10 Feb 2010 09:46:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2DF58FC15; Wed, 10 Feb 2010 09:46:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A9kVjO051261; Wed, 10 Feb 2010 09:46:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A9kVUL051259; Wed, 10 Feb 2010 09:46:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201002100946.o1A9kVUL051259@svn.freebsd.org> From: Andriy Gapon Date: Wed, 10 Feb 2010 09:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203749 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 09:46:32 -0000 Author: avg Date: Wed Feb 10 09:46:31 2010 New Revision: 203749 URL: http://svn.freebsd.org/changeset/base/203749 Log: MFC r203062: acpi_hpet: correctly get number of timers in a timer block Modified: stable/8/sys/dev/acpica/acpi_hpet.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_hpet.c Wed Feb 10 08:50:06 2010 (r203748) +++ stable/8/sys/dev/acpica/acpi_hpet.c Wed Feb 10 09:46:31 2010 (r203749) @@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include +#define HPET_VENDID_AMD 0x4353 +#define HPET_VENDID_INTEL 0x8086 + ACPI_SERIAL_DECL(hpet, "ACPI HPET support"); static devclass_t acpi_hpet_devclass; @@ -155,9 +158,10 @@ static int acpi_hpet_attach(device_t dev) { struct acpi_hpet_softc *sc; - int rid; + int rid, num_timers; uint32_t val, val2; uintmax_t freq; + uint16_t vendor; ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); @@ -194,10 +198,21 @@ acpi_hpet_attach(device_t dev) freq = (1000000000000000LL + val / 2) / val; if (bootverbose) { val = bus_read_4(sc->mem_res, HPET_CAPABILITIES); + + /* + * ATI/AMD violates IA-PC HPET (High Precision Event Timers) + * Specification and provides an off by one number + * of timers/comparators. + * Additionally, they use unregistered value in VENDOR_ID field. + */ + num_timers = 1 + ((val & HPET_CAP_NUM_TIM) >> 8); + vendor = val >> 16; + if (vendor == HPET_VENDID_AMD && num_timers > 0) + num_timers--; device_printf(dev, "vend: 0x%x rev: 0x%x num: %d hz: %jd opts:%s%s\n", - val >> 16, val & HPET_CAP_REV_ID, - (val & HPET_CAP_NUM_TIM) >> 8, freq, + vendor, val & HPET_CAP_REV_ID, + num_timers, freq, (val & HPET_CAP_LEG_RT) ? " legacy_route" : "", (val & HPET_CAP_COUNT_SIZE) ? " 64-bit" : ""); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 10:09:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0686D106568F; Wed, 10 Feb 2010 10:09: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 51B228FC19; Wed, 10 Feb 2010 10:09:01 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA29445; Wed, 10 Feb 2010 12:09:00 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Nf9VE-0005S6-5F; Wed, 10 Feb 2010 12:09:00 +0200 Message-ID: <4B7285BA.3050000@freebsd.org> Date: Wed, 10 Feb 2010 12:08:58 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20091128) MIME-Version: 1.0 To: Marko Zec References: <201002100850.o1A8o6tD038842@svn.freebsd.org> In-Reply-To: <201002100850.o1A8o6tD038842@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r203748 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 10:09:04 -0000 on 10/02/2010 10:50 Marko Zec said the following: > Author: zec > Date: Wed Feb 10 08:50:06 2010 > New Revision: 203748 > URL: http://svn.freebsd.org/changeset/base/203748 > > Log: > MFC r203483: > Instead of spamming the console on each curvnet recursion event, print > out each such call graph only once, along with a stack backtrace. This > should make kernels built with VNET_DEBUG reasonably usable again in > busy / production environments. > > Introduce a new DDB command "show vnetrcrs" which dumps the whole log > of distinctive curvnet recursion events. This might be useful when > recursion reports get burried / lost too deep in the message buffer. > In the later case stack backtraces are not available. > > Reviewed by: bz > > Modified: > stable/8/sys/net/vnet.c > stable/8/sys/net/vnet.h > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/dev/xen/xenpci/ (props changed) > stable/8/sys/netinet/ (props changed) It looks like after this commit we started to have mergeinfo on stable/8/sys/netinet. Not sure if this is correct or not. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 10:54:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DA3E106568D; Wed, 10 Feb 2010 10:54:18 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id D0FEE8FC23; Wed, 10 Feb 2010 10:54:17 +0000 (UTC) Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NfAD2-00073O-NV; Wed, 10 Feb 2010 13:54:16 +0300 Date: Wed, 10 Feb 2010 13:54:11 +0300 From: Ruslan Ermilov To: Andriy Gapon Message-ID: <20100210105411.GB85373@edoofus.dev.vega.ru> References: <201002100850.o1A8o6tD038842@svn.freebsd.org> <4B7285BA.3050000@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B7285BA.3050000@freebsd.org> Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Marko Zec , Qing Li , svn-src-stable-8@freebsd.org Subject: Re: svn commit: r203748 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 10:54:18 -0000 On Wed, Feb 10, 2010 at 12:08:58PM +0200, Andriy Gapon wrote: > on 10/02/2010 10:50 Marko Zec said the following: > > Author: zec > > Date: Wed Feb 10 08:50:06 2010 > > New Revision: 203748 > > URL: http://svn.freebsd.org/changeset/base/203748 > > > > Log: > > MFC r203483: > > Instead of spamming the console on each curvnet recursion event, print > > out each such call graph only once, along with a stack backtrace. This > > should make kernels built with VNET_DEBUG reasonably usable again in > > busy / production environments. > > > > Introduce a new DDB command "show vnetrcrs" which dumps the whole log > > of distinctive curvnet recursion events. This might be useful when > > recursion reports get burried / lost too deep in the message buffer. > > In the later case stack backtraces are not available. > > > > Reviewed by: bz > > > > Modified: > > stable/8/sys/net/vnet.c > > stable/8/sys/net/vnet.h > > Directory Properties: > > stable/8/sys/ (props changed) > > stable/8/sys/amd64/include/xen/ (props changed) > > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > > stable/8/sys/contrib/dev/acpica/ (props changed) > > stable/8/sys/contrib/pf/ (props changed) > > stable/8/sys/dev/xen/xenpci/ (props changed) > > stable/8/sys/netinet/ (props changed) > > It looks like after this commit we started to have mergeinfo on > stable/8/sys/netinet. Not sure if this is correct or not. Actually svn:mergeinfo was brought in previous commit by Qing Li, who merged directly to sys/netinet/ instead of sys/. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 11:11:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B34D106566B; Wed, 10 Feb 2010 11:11:37 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59B758FC1B; Wed, 10 Feb 2010 11:11:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1ABBbe7071522; Wed, 10 Feb 2010 11:11:37 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ABBbPV071520; Wed, 10 Feb 2010 11:11:37 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002101111.o1ABBbPV071520@svn.freebsd.org> From: Rui Paulo Date: Wed, 10 Feb 2010 11:11: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: r203750 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 11:11:37 -0000 Author: rpaulo Date: Wed Feb 10 11:11:37 2010 New Revision: 203750 URL: http://svn.freebsd.org/changeset/base/203750 Log: 't' stands for Turbo and is a valid mode, so fix previous commit. Pointed out by: sam Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Wed Feb 10 09:46:31 2010 (r203749) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Wed Feb 10 11:11:37 2010 (r203750) @@ -30,7 +30,7 @@ #include "ar5416/ar5416phy.h" /* - * Return the wireless modes (a,b,g,n) supported by hardware. + * Return the wireless modes (a,b,g,n,t) supported by hardware. * * This value is what is actually supported by the hardware * and is unaffected by regulatory/country code settings. From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 11:12:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BF76106566B; Wed, 10 Feb 2010 11:12:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ADB78FC1B; Wed, 10 Feb 2010 11:12:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1ABCeIn071795; Wed, 10 Feb 2010 11:12:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ABCepg071793; Wed, 10 Feb 2010 11:12:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002101112.o1ABCepg071793@svn.freebsd.org> From: Rui Paulo Date: Wed, 10 Feb 2010 11:12: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: r203751 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 11:12:40 -0000 Author: rpaulo Date: Wed Feb 10 11:12:39 2010 New Revision: 203751 URL: http://svn.freebsd.org/changeset/base/203751 Log: Fix typo in comment. Pointed out by: danfe Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Feb 10 11:11:37 2010 (r203750) +++ head/sys/dev/ath/if_ath.c Wed Feb 10 11:12:39 2010 (r203751) @@ -621,7 +621,7 @@ ath_attach(u_int16_t devid, struct ath_s } sc->sc_hasclrkey = ath_hal_ciphersupported(ah, HAL_CIPHER_CLR); /* - * Check for multicast key sarch support. + * Check for multicast key search support. */ if (ath_hal_hasmcastkeysearch(sc->sc_ah) && !ath_hal_getmcastkeysearch(sc->sc_ah)) { From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 11:40:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4B2E1065670; Wed, 10 Feb 2010 11:40:18 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C35B48FC16; Wed, 10 Feb 2010 11:40:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1ABeIeQ077979; Wed, 10 Feb 2010 11:40:18 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ABeIlf077977; Wed, 10 Feb 2010 11:40:18 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002101140.o1ABeIlf077977@svn.freebsd.org> From: Rui Paulo Date: Wed, 10 Feb 2010 11:40: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: r203752 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 11:40:18 -0000 Author: rpaulo Date: Wed Feb 10 11:40:18 2010 New Revision: 203752 URL: http://svn.freebsd.org/changeset/base/203752 Log: Turn on the front LED at boot time like we do with the Avila. Modified: head/sys/arm/xscale/ixp425/cambria_fled.c Modified: head/sys/arm/xscale/ixp425/cambria_fled.c ============================================================================== --- head/sys/arm/xscale/ixp425/cambria_fled.c Wed Feb 10 11:12:39 2010 (r203751) +++ head/sys/arm/xscale/ixp425/cambria_fled.c Wed Feb 10 11:40:18 2010 (r203752) @@ -74,6 +74,8 @@ fled_attach(device_t dev) sc->sc_led = led_create(fled_cb, dev, "front"); + led_func(sc, 1); /* Turn on LED */ + return 0; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 12:20:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4165B1065676; Wed, 10 Feb 2010 12:20:09 +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 0EA768FC28; Wed, 10 Feb 2010 12:20:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1ACK8Ap086694; Wed, 10 Feb 2010 12:20:08 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ACK81o086693; Wed, 10 Feb 2010 12:20:08 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002101220.o1ACK81o086693@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 10 Feb 2010 12:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203753 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 12:20:09 -0000 Author: bz Date: Wed Feb 10 12:20:08 2010 New Revision: 203753 URL: http://svn.freebsd.org/changeset/base/203753 Log: Cleanup mergeinfo after r203718. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 13:48:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F406106566C; Wed, 10 Feb 2010 13:48:34 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EACF8FC08; Wed, 10 Feb 2010 13:48:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1ADmYE6006255; Wed, 10 Feb 2010 13:48:34 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ADmYHx006253; Wed, 10 Feb 2010 13:48:34 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201002101348.o1ADmYHx006253@svn.freebsd.org> From: Randall Stewart Date: Wed, 10 Feb 2010 13:48: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: r203754 - head/sys/mips/rmi/dev/xlr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 13:48:34 -0000 Author: rrs Date: Wed Feb 10 13:48:34 2010 New Revision: 203754 URL: http://svn.freebsd.org/changeset/base/203754 Log: If a mbuf is split across two pages, we have code that detects this and makes two transmit descriptors. However its possible that the algorithm detects when the second page is not used (when the data aligns perfectly to the bottom of the page). This caused a 0 len descriptor to be added which locks up the rge device. Skip such things with a continue. JC provided this patch... Thanks JC :-) Obtained from: JC (c.jayachandran@gmail.com) Modified: head/sys/mips/rmi/dev/xlr/rge.c Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Wed Feb 10 12:20:08 2010 (r203753) +++ head/sys/mips/rmi/dev/xlr/rge.c Wed Feb 10 13:48:34 2010 (r203754) @@ -577,6 +577,8 @@ build_frag_list(struct mbuf *m_head, str taddr = (vm_offset_t)m->m_data + len1; p2 = vtophys(taddr); len2 = m->m_len - len1; + if (len2 == 0) + continue; if (nfrag >= XLR_MAX_TX_FRAGS) panic("TX frags exceeded"); From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 13:54:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD863106566B; Wed, 10 Feb 2010 13:54:05 +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 7C6958FC1A; Wed, 10 Feb 2010 13:54:05 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2D8B646B51; Wed, 10 Feb 2010 08:54:05 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 540E88A027; Wed, 10 Feb 2010 08:54:04 -0500 (EST) From: John Baldwin To: Edward Tomasz =?iso-8859-2?q?Napiera=B3a?= Date: Wed, 10 Feb 2010 08:46:44 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <201002092058.o19Kwdut079944@svn.freebsd.org> <201002091616.50087.jhb@freebsd.org> <5E89BB4D-5391-426C-B819-668FCC83736F@freebsd.org> In-Reply-To: <5E89BB4D-5391-426C-B819-668FCC83736F@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Message-Id: <201002100846.44256.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 10 Feb 2010 08:54:04 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=AWL,BAYES_00 autolearn=ham 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: r203721 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 13:54:05 -0000 On Wednesday 10 February 2010 4:14:06 am Edward Tomasz Napiera=B3a wrote: > Wiadomo=B6=E6 napisana przez John Baldwin w dniu 2010-02-09, o godz. 22:1= 6: > > On Tuesday 09 February 2010 3:58:39 pm Edward Tomasz Napierala wrote: > >> Author: trasz > >> Date: Tue Feb 9 20:58:39 2010 > >> New Revision: 203721 > >> URL: http://svn.freebsd.org/changeset/base/203721 > >>=20 > >> Log: > >> Add references to VOP_* man pages to vnode(9). > >=20 > > Hmm, it seems VOP_MARKATIME.9 is missing, probably because the actual m= anpage=20 > > for that is missing. :-P >=20 > Same situation with VOP_CACHEDLOOKUP, VOP_WHITEOUT, VOP_MARKATIME, VOP_PO= LL, > VOP_KQFILTER, VOP_BMAP, VOP_GETWRITEMOUNT, VOP_ADVLOCKASYNC and VOP_SETLA= BEL. Ahh, I knew to check for VOP_MARKATIME because it was added in a patch I committed. It would probably be useful to fill in the missing manpages. I will put VOP_MARKATIME on my list, but I probably won't get to it anytime s= oon. =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 15:52:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ECF71065670; Wed, 10 Feb 2010 15:52:25 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 161C68FC13; Wed, 10 Feb 2010 15:52:24 +0000 (UTC) Received: from outgoing.leidinger.net (pD954FA02.dip.t-dialin.net [217.84.250.2]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 1514084411B; Wed, 10 Feb 2010 16:52:17 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id B3FB47DAFF; Wed, 10 Feb 2010 16:52:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1265817133; bh=pgRbgK5XNOBj6oCMC5REMFEYmah0r7QIwdisFaGsfck=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=FL7SDWF/ame54bMNCbnZklt95WBRTNf/K+Hczcbe9yjYhuO9MN8nYconsMnW0PAoC 3LYD8iVlp+qrayIbMpB5uK1TgKuQSPSB+PsLjS3tWmKlITWXgcO8gJ4Zcm9qKQNJzZ z3VjDUpYbdZhGQPq+vjDZccHb4tAJ1TezgAT+mBTH9ZglxBUdNGgzH1pm31EgBK4d9 Gf7PwKgb1QT/qk5/yyl1f1+GCt2NTSBRnstqMH9Ls6Wgo6ZGFMHNs6uvoosMIUXBKK iG4m3hxGTLe4lglHtvK3385DPenKTZ+4/4RFCg+lJENa1uzyrWC9PmRaivdc+Ha8mn 265v62stDsKFg== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id o1AFqDml036744; Wed, 10 Feb 2010 16:52:13 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Wed, 10 Feb 2010 16:52:13 +0100 Message-ID: <20100210165213.95990l8r0b7latrk@webmail.leidinger.net> Date: Wed, 10 Feb 2010 16:52:13 +0100 From: Alexander Leidinger To: David Xu References: <201002080731.o187V5Pk072517@svn.freebsd.org> In-Reply-To: <201002080731.o187V5Pk072517@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 1514084411B.84140 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.286, required 6, autolearn=disabled, ALL_TRUSTED -1.44, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, TW_DX 0.08, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1266421939.74212@PsWoDoDqnpmsvEPA1OaDaQ X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, mono@FreeBSD.org Subject: Re: svn commit: r203657 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 15:52:25 -0000 Quoting David Xu (from Mon, 8 Feb 2010 07:31:05 +0000 (UTC)): > Author: davidxu > Date: Mon Feb 8 07:31:05 2010 > New Revision: 203657 > URL: http://svn.freebsd.org/changeset/base/203657 > > Log: > Set waiters flag before checking semaphore's counter, > otherwise we might lose a wakeup. Tested on postgresql database server. Uhm... if I ktrace a hanging process and I see some semop()s (I assume it is waiting on some event to happen), where on Linux this process is working correctly, then I would like to test this patch to see if the process still has the same problem? Or differently asked: this affects the operation of semop(2)? Bye, Alexander. -- We only acknowledge small faults in order to make it appear that we are free from great ones. -- LaRouchefoucauld http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 16:16:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80004106568B; Wed, 10 Feb 2010 16:16:50 +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 6C8EF8FC1B; Wed, 10 Feb 2010 16:16:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AGGocv039918; Wed, 10 Feb 2010 16:16:50 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AGGo4f039911; Wed, 10 Feb 2010 16:16:50 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201002101616.o1AGGo4f039911@svn.freebsd.org> From: Rick Macklem Date: Wed, 10 Feb 2010 16:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203756 - stable/8/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 16:16:50 -0000 Author: rmacklem Date: Wed Feb 10 16:16:50 2010 New Revision: 203756 URL: http://svn.freebsd.org/changeset/base/203756 Log: MFC: r203072 Fix a race that can occur when nfs nfsiod threads are being created. Without this patch it was possible for a different thread that calls nfs_asyncio() to snitch a newly created nfsiod thread that was intended for another caller of nfs_asyncio(), because the nfs_iod_mtx mutex was unlocked while the new nfsiod thread was created. This patch labels the newly created nfsiod, so that it is not taken by another caller of nfs_asyncio(). This is believed to fix the problem reported on the freebsd-stable email list under the subject: FreeBSD NFS client/Linux NFS server issue. Tested by: to DOT my DOT trociny AT gmail DOT com Reviewed by: jhb Modified: stable/8/sys/nfsclient/nfs.h stable/8/sys/nfsclient/nfs_bio.c stable/8/sys/nfsclient/nfs_nfsiod.c stable/8/sys/nfsclient/nfs_subs.c stable/8/sys/nfsclient/nfs_vnops.c stable/8/sys/nfsclient/nfsnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/nfsclient/nfs.h ============================================================================== --- stable/8/sys/nfsclient/nfs.h Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfs.h Wed Feb 10 16:16:50 2010 (r203756) @@ -252,7 +252,7 @@ int nfs_writerpc(struct vnode *, struct int nfs_commit(struct vnode *vp, u_quad_t offset, int cnt, struct ucred *cred, struct thread *td); int nfs_readdirrpc(struct vnode *, struct uio *, struct ucred *); -int nfs_nfsiodnew(void); +int nfs_nfsiodnew(int); int nfs_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *); int nfs_doio(struct vnode *, struct buf *, struct ucred *, struct thread *); void nfs_doio_directwrite (struct buf *); Modified: stable/8/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/8/sys/nfsclient/nfs_bio.c Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfs_bio.c Wed Feb 10 16:16:50 2010 (r203756) @@ -1377,7 +1377,7 @@ again: * Find a free iod to process this request. */ for (iod = 0; iod < nfs_numasync; iod++) - if (nfs_iodwant[iod]) { + if (nfs_iodwant[iod] == NFSIOD_AVAILABLE) { gotiod = TRUE; break; } @@ -1386,7 +1386,7 @@ again: * Try to create one if none are free. */ if (!gotiod) { - iod = nfs_nfsiodnew(); + iod = nfs_nfsiodnew(1); if (iod != -1) gotiod = TRUE; } @@ -1398,7 +1398,7 @@ again: */ NFS_DPF(ASYNCIO, ("nfs_asyncio: waking iod %d for mount %p\n", iod, nmp)); - nfs_iodwant[iod] = NULL; + nfs_iodwant[iod] = NFSIOD_NOT_AVAILABLE; nfs_iodmount[iod] = nmp; nmp->nm_bufqiods++; wakeup(&nfs_iodwant[iod]); Modified: stable/8/sys/nfsclient/nfs_nfsiod.c ============================================================================== --- stable/8/sys/nfsclient/nfs_nfsiod.c Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfs_nfsiod.c Wed Feb 10 16:16:50 2010 (r203756) @@ -113,7 +113,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) * than the new minimum, create some more. */ for (i = nfs_iodmin - nfs_numasync; i > 0; i--) - nfs_nfsiodnew(); + nfs_nfsiodnew(0); out: mtx_unlock(&nfs_iod_mtx); return (0); @@ -147,7 +147,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) */ iod = nfs_numasync - 1; for (i = 0; i < nfs_numasync - nfs_iodmax; i++) { - if (nfs_iodwant[iod]) + if (nfs_iodwant[iod] == NFSIOD_AVAILABLE) wakeup(&nfs_iodwant[iod]); iod--; } @@ -160,7 +160,7 @@ SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, "Max number of nfsiod kthreads"); int -nfs_nfsiodnew(void) +nfs_nfsiodnew(int set_iodwant) { int error, i; int newiod; @@ -176,12 +176,17 @@ nfs_nfsiodnew(void) } if (newiod == -1) return (-1); + if (set_iodwant > 0) + nfs_iodwant[i] = NFSIOD_CREATED_FOR_NFS_ASYNCIO; mtx_unlock(&nfs_iod_mtx); error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID, 0, "nfsiod %d", newiod); mtx_lock(&nfs_iod_mtx); - if (error) + if (error) { + if (set_iodwant > 0) + nfs_iodwant[i] = NFSIOD_NOT_AVAILABLE; return (-1); + } nfs_numasync++; return (newiod); } @@ -199,7 +204,7 @@ nfsiod_setup(void *dummy) nfs_iodmin = NFS_MAXASYNCDAEMON; for (i = 0; i < nfs_iodmin; i++) { - error = nfs_nfsiodnew(); + error = nfs_nfsiodnew(0); if (error == -1) panic("nfsiod_setup: nfs_nfsiodnew failed"); } @@ -236,7 +241,8 @@ nfssvc_iod(void *instance) goto finish; if (nmp) nmp->nm_bufqiods--; - nfs_iodwant[myiod] = curthread->td_proc; + if (nfs_iodwant[myiod] == NFSIOD_NOT_AVAILABLE) + nfs_iodwant[myiod] = NFSIOD_AVAILABLE; nfs_iodmount[myiod] = NULL; /* * Always keep at least nfs_iodmin kthreads. @@ -303,7 +309,7 @@ finish: nfs_asyncdaemon[myiod] = 0; if (nmp) nmp->nm_bufqiods--; - nfs_iodwant[myiod] = NULL; + nfs_iodwant[myiod] = NFSIOD_NOT_AVAILABLE; nfs_iodmount[myiod] = NULL; /* Someone may be waiting for the last nfsiod to terminate. */ if (--nfs_numasync == 0) Modified: stable/8/sys/nfsclient/nfs_subs.c ============================================================================== --- stable/8/sys/nfsclient/nfs_subs.c Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfs_subs.c Wed Feb 10 16:16:50 2010 (r203756) @@ -347,7 +347,7 @@ nfs_init(struct vfsconf *vfsp) nfs_ticks = 1; /* Ensure async daemons disabled */ for (i = 0; i < NFS_MAXASYNCDAEMON; i++) { - nfs_iodwant[i] = NULL; + nfs_iodwant[i] = NFSIOD_NOT_AVAILABLE; nfs_iodmount[i] = NULL; } nfs_nhinit(); /* Init the nfsnode table */ @@ -375,7 +375,7 @@ nfs_uninit(struct vfsconf *vfsp) mtx_lock(&nfs_iod_mtx); nfs_iodmax = 0; for (i = 0; i < nfs_numasync; i++) - if (nfs_iodwant[i]) + if (nfs_iodwant[i] == NFSIOD_AVAILABLE) wakeup(&nfs_iodwant[i]); /* The last nfsiod to exit will wake us up when nfs_numasync hits 0 */ while (nfs_numasync) Modified: stable/8/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vnops.c Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfs_vnops.c Wed Feb 10 16:16:50 2010 (r203756) @@ -212,7 +212,7 @@ static int nfs_renameit(struct vnode *sd * Global variables */ struct mtx nfs_iod_mtx; -struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON]; +enum nfsiod_state nfs_iodwant[NFS_MAXASYNCDAEMON]; struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON]; int nfs_numasync = 0; vop_advlock_t *nfs_advlock_p = nfs_dolock; Modified: stable/8/sys/nfsclient/nfsnode.h ============================================================================== --- stable/8/sys/nfsclient/nfsnode.h Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfsnode.h Wed Feb 10 16:16:50 2010 (r203756) @@ -177,10 +177,23 @@ struct nfsnode { #define NFS_TIMESPEC_COMPARE(T1, T2) (((T1)->tv_sec != (T2)->tv_sec) || ((T1)->tv_nsec != (T2)->tv_nsec)) /* + * NFS iod threads can be in one of these three states once spawned. + * NFSIOD_NOT_AVAILABLE - Cannot be assigned an I/O operation at this time. + * NFSIOD_AVAILABLE - Available to be assigned an I/O operation. + * NFSIOD_CREATED_FOR_NFS_ASYNCIO - Newly created for nfs_asyncio() and + * will be used by the thread that called nfs_asyncio(). + */ +enum nfsiod_state { + NFSIOD_NOT_AVAILABLE = 0, + NFSIOD_AVAILABLE = 1, + NFSIOD_CREATED_FOR_NFS_ASYNCIO = 2, +}; + +/* * Queue head for nfsiod's */ extern TAILQ_HEAD(nfs_bufq, buf) nfs_bufq; -extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON]; +extern enum nfsiod_state nfs_iodwant[NFS_MAXASYNCDAEMON]; extern struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON]; #if defined(_KERNEL) From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 16:18:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BA4C1065679; Wed, 10 Feb 2010 16:18:28 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD4C8FC18; Wed, 10 Feb 2010 16:18:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AGISJm040459; Wed, 10 Feb 2010 16:18:28 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AGISkI040457; Wed, 10 Feb 2010 16:18:28 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002101618.o1AGISkI040457@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 10 Feb 2010 16:18: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: r203757 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 16:18:28 -0000 Author: jh Date: Wed Feb 10 16:18:28 2010 New Revision: 203757 URL: http://svn.freebsd.org/changeset/base/203757 Log: - Remove reference to nfs4. mount_nfs4(8) was removed in r192578. - Add newnfs. Modified: head/sbin/mount/mount.8 Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Wed Feb 10 16:16:50 2010 (r203756) +++ head/sbin/mount/mount.8 Wed Feb 10 16:18:28 2010 (r203757) @@ -28,7 +28,7 @@ .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" $FreeBSD$ .\" -.Dd March 11, 2008 +.Dd February 10, 2010 .Dt MOUNT 8 .Os .Sh NAME @@ -433,8 +433,8 @@ However, for the following file system t .Cm cd9660 , .Cm mfs , .Cm msdosfs , +.Cm newnfs , .Cm nfs , -.Cm nfs4 , .Cm ntfs , .Cm nwfs , .Cm nullfs , From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 16:30:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E411F106568B; Wed, 10 Feb 2010 16:30:04 +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 D209D8FC15; Wed, 10 Feb 2010 16:30:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AGU4EN043777; Wed, 10 Feb 2010 16:30:04 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AGU4kn043737; Wed, 10 Feb 2010 16:30:04 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002101630.o1AGU4kn043737@svn.freebsd.org> From: Attilio Rao Date: Wed, 10 Feb 2010 16:30: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: r203758 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 16:30:05 -0000 Author: attilio Date: Wed Feb 10 16:30:04 2010 New Revision: 203758 URL: http://svn.freebsd.org/changeset/base/203758 Log: Add the options DEADLKRES (introducing the deadlock resolver thread) in the 'debugging' section of any HEAD kernel and enable for the mainstream ones, excluding the embedded architectures. It may, of course, enabled on a case-by-case basis. Sponsored by: Sandvine Incorporated Requested by: emaste Discussed with: kib Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/XENHVM head/sys/arm/conf/AVILA head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/EP80219 head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/NSLU head/sys/arm/conf/SIMICS head/sys/arm/conf/SKYEYE head/sys/i386/conf/GENERIC head/sys/i386/conf/XEN head/sys/ia64/conf/GENERIC head/sys/mips/conf/ADM5120 head/sys/mips/conf/ALCHEMY head/sys/mips/conf/AR71XX head/sys/mips/conf/IDT head/sys/mips/conf/MALTA head/sys/mips/conf/MALTA64 head/sys/mips/conf/OCTEON1 head/sys/mips/conf/OCTEON1-32 head/sys/mips/conf/QEMU head/sys/mips/conf/SENTRY5 head/sys/mips/conf/SWARM head/sys/mips/conf/XLR head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/MPC85XX head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/amd64/conf/GENERIC Wed Feb 10 16:30:04 2010 (r203758) @@ -72,6 +72,7 @@ options INCLUDE_CONFIG_FILE # Inclu options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/amd64/conf/XENHVM ============================================================================== --- head/sys/amd64/conf/XENHVM Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/amd64/conf/XENHVM Wed Feb 10 16:30:04 2010 (r203758) @@ -70,6 +70,7 @@ options NO_ADAPTIVE_RWLOCKS options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/AVILA Wed Feb 10 16:30:04 2010 (r203758) @@ -39,6 +39,7 @@ options DEVICE_POLLING options KDB #options GDB options DDB #Enable the kernel debugger +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/BWCT Wed Feb 10 16:30:04 2010 (r203758) @@ -79,6 +79,7 @@ device mii device rlswitch # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/CAMBRIA Wed Feb 10 16:30:04 2010 (r203758) @@ -39,6 +39,7 @@ options DEVICE_POLLING options KDB #options GDB options DDB #Enable the kernel debugger +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/CNS11XXNAS Wed Feb 10 16:30:04 2010 (r203758) @@ -39,6 +39,7 @@ options DEVICE_POLLING options KDB #options GDB options DDB #Enable the kernel debugger +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/CRB Wed Feb 10 16:30:04 2010 (r203758) @@ -93,6 +93,7 @@ device pty # Debugging for use in -current options KDB options DDB #Enable the kernel debugger +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/DB-78XXX Wed Feb 10 16:30:04 2010 (r203758) @@ -39,6 +39,7 @@ options NO_SWAPPING # Debugging options ALT_BREAK_TO_DEBUGGER options DDB +#options DEADLKRES #Enable the deadlock resolver options DIAGNOSTIC #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/DB-88F5XXX Wed Feb 10 16:30:04 2010 (r203758) @@ -39,6 +39,7 @@ options NO_SWAPPING # Debugging options ALT_BREAK_TO_DEBUGGER options DDB +#options DEADLKRES #Enable the deadlock resolver options DIAGNOSTIC #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/DB-88F6XXX Wed Feb 10 16:30:04 2010 (r203758) @@ -39,6 +39,7 @@ options NO_SWAPPING # Debugging options ALT_BREAK_TO_DEBUGGER options DDB +#options DEADLKRES #Enable the deadlock resolver options DIAGNOSTIC #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/EP80219 Wed Feb 10 16:30:04 2010 (r203758) @@ -89,6 +89,7 @@ device dma # I80321 DMA Controller # Debugging for use in -current options KDB options DDB #Enable the kernel debugger +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/GUMSTIX Wed Feb 10 16:30:04 2010 (r203758) @@ -80,6 +80,7 @@ device pty # Debugging for use in -current options KDB options DDB #Enable the kernel debugger +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/HL200 Wed Feb 10 16:30:04 2010 (r203758) @@ -74,6 +74,7 @@ device mii device lxtphy # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/IQ31244 Wed Feb 10 16:30:04 2010 (r203758) @@ -94,6 +94,7 @@ device "iq31244_7seg" # IQ31244 7 seg # Debugging for use in -current options KDB options DDB #Enable the kernel debugger +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/KB920X Wed Feb 10 16:30:04 2010 (r203758) @@ -75,6 +75,7 @@ device mii device lxtphy # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/NSLU Wed Feb 10 16:30:04 2010 (r203758) @@ -44,6 +44,7 @@ options DEVICE_POLLING options KDB #options GDB options DDB #Enable the kernel debugger +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/SIMICS ============================================================================== --- head/sys/arm/conf/SIMICS Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/SIMICS Wed Feb 10 16:30:04 2010 (r203758) @@ -61,6 +61,7 @@ device rl device uart # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/SKYEYE ============================================================================== --- head/sys/arm/conf/SKYEYE Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/arm/conf/SKYEYE Wed Feb 10 16:30:04 2010 (r203758) @@ -68,6 +68,7 @@ device uart # output. Adds ~215k to driver. # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/i386/conf/GENERIC Wed Feb 10 16:30:04 2010 (r203758) @@ -72,6 +72,7 @@ options INCLUDE_CONFIG_FILE # Inclu options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/i386/conf/XEN Wed Feb 10 16:30:04 2010 (r203758) @@ -49,6 +49,7 @@ options AUDIT # Security event auditi options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/ia64/conf/GENERIC Wed Feb 10 16:30:04 2010 (r203758) @@ -31,6 +31,7 @@ options COMPAT_43TTY # BSD 4.3 TTY comp options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options DDB # Support DDB +options DEADLKRES # Enable the deadlock resolver options FFS # Berkeley Fast Filesystem options GDB # Support remote GDB options GEOM_LABEL # Provides labelization Modified: head/sys/mips/conf/ADM5120 ============================================================================== --- head/sys/mips/conf/ADM5120 Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/ADM5120 Wed Feb 10 16:30:04 2010 (r203758) @@ -55,6 +55,7 @@ options BOOTP_COMPAT options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\" # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/ALCHEMY ============================================================================== --- head/sys/mips/conf/ALCHEMY Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/ALCHEMY Wed Feb 10 16:30:04 2010 (r203758) @@ -55,6 +55,7 @@ options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/AR71XX ============================================================================== --- head/sys/mips/conf/AR71XX Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/AR71XX Wed Feb 10 16:30:04 2010 (r203758) @@ -29,6 +29,7 @@ options _KPOSIX_PRIORITY_SCHEDULING #Po # options NFS_LEGACYRPC # Debugging for use in -current +# options DEADLKRES # options INVARIANTS # options INVARIANT_SUPPORT # options WITNESS Modified: head/sys/mips/conf/IDT ============================================================================== --- head/sys/mips/conf/IDT Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/IDT Wed Feb 10 16:30:04 2010 (r203758) @@ -27,6 +27,7 @@ options BOOTP_WIRED_TO=kr0 options BOOTP_COMPAT # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS Modified: head/sys/mips/conf/MALTA ============================================================================== --- head/sys/mips/conf/MALTA Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/MALTA Wed Feb 10 16:30:04 2010 (r203758) @@ -58,6 +58,7 @@ options ROOTDEVNAME=\"ufs:ad0s1a\" # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/MALTA64 Wed Feb 10 16:30:04 2010 (r203758) @@ -59,6 +59,7 @@ options ROOTDEVNAME=\"ufs:ad0s1a\" # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/OCTEON1 Wed Feb 10 16:30:04 2010 (r203758) @@ -67,6 +67,7 @@ options UFS_DIRHASH # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/OCTEON1-32 ============================================================================== --- head/sys/mips/conf/OCTEON1-32 Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/OCTEON1-32 Wed Feb 10 16:30:04 2010 (r203758) @@ -56,6 +56,7 @@ options UFS_DIRHASH # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/QEMU ============================================================================== --- head/sys/mips/conf/QEMU Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/QEMU Wed Feb 10 16:30:04 2010 (r203758) @@ -43,6 +43,7 @@ options PSEUDOFS #Pseudo-filesystem fr options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions # Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/SENTRY5 Wed Feb 10 16:30:04 2010 (r203758) @@ -56,6 +56,7 @@ options PSEUDOFS #Pseudo-filesystem fr options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions # Debugging for use in -current +#options DEADLKRES options INVARIANTS options INVARIANT_SUPPORT Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/SWARM Wed Feb 10 16:30:04 2010 (r203758) @@ -50,6 +50,7 @@ options PSEUDOFS #Pseudo-filesystem fr options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions # Debugging for use in -current +#options DEADLKRES options INVARIANTS options INVARIANT_SUPPORT options WITNESS Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/mips/conf/XLR Wed Feb 10 16:30:04 2010 (r203758) @@ -96,6 +96,7 @@ options DDB options KDB options GDB options ALT_BREAK_TO_DEBUGGER +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/pc98/conf/GENERIC Wed Feb 10 16:30:04 2010 (r203758) @@ -72,6 +72,7 @@ options INCLUDE_CONFIG_FILE # Inclu options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/powerpc/conf/GENERIC Wed Feb 10 16:30:04 2010 (r203758) @@ -68,6 +68,7 @@ options INCLUDE_CONFIG_FILE # Inclu # Debugging for use in -current options KDB #Enable the kernel debugger options DDB #Support DDB +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/powerpc/conf/MPC85XX Wed Feb 10 16:30:04 2010 (r203758) @@ -22,6 +22,7 @@ options BOOTP_WIRED_TO=tsec0 options CD9660 options COMPAT_43 options DDB +#options DEADLKRES options DEVICE_POLLING options HZ=1000 #options DIAGNOSTIC Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/sparc64/conf/GENERIC Wed Feb 10 16:30:04 2010 (r203758) @@ -69,6 +69,7 @@ options INCLUDE_CONFIG_FILE # Inclu options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/sun4v/conf/GENERIC ============================================================================== --- head/sys/sun4v/conf/GENERIC Wed Feb 10 16:18:28 2010 (r203757) +++ head/sys/sun4v/conf/GENERIC Wed Feb 10 16:30:04 2010 (r203758) @@ -75,6 +75,7 @@ options DDB # Support DDB. #options TRAP_TRACING # Enable trap tracing. #options TRAP_TRACE_ENTRIES=256 # Trap trace buffer entries. #options GDB # Support remote GDB. +#options DEADLKRES # Enable the deadlock resolver #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 17:02:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D63E4106566C; Wed, 10 Feb 2010 17:02:06 +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 C5EF18FC0A; Wed, 10 Feb 2010 17:02:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AH26Ve052467; Wed, 10 Feb 2010 17:02:06 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AH26HA052465; Wed, 10 Feb 2010 17:02:06 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201002101702.o1AH26HA052465@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 10 Feb 2010 17:02: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: r203759 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 17:02:06 -0000 Author: trasz Date: Wed Feb 10 17:02:06 2010 New Revision: 203759 URL: http://svn.freebsd.org/changeset/base/203759 Log: Improve description for Giant and mention blocking inside interrupt threads. Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Wed Feb 10 16:30:04 2010 (r203758) +++ head/share/man/man9/locking.9 Wed Feb 10 17:02:06 2010 (r203759) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2010 +.Dd February 10, 2010 .Dt LOCKING 9 .Os .Sh NAME @@ -191,13 +191,16 @@ Giant is an instance of a mutex, with so .It It is recursive. .It -Drivers can request that Giant be locked around them, but this is -going away. -.It -You can sleep while it has recursed, but other recursive locks cannot. +Drivers and filesystems can request that Giant be locked around them +by not marking themselves MPSAFE. Note that infrastructure to do this +is slowly going away as non-MPSAFE drivers either became properly locked +or disappear. .It Giant must be locked first before other locks. .It +It is OK to hold Giant while performing unbounded sleep; in such case, +Giant will be dropped before sleeping and picked up after wakeup. +.It There are places in the kernel that drop Giant and pick it back up again. Sleep locks will do this before sleeping. @@ -315,6 +318,9 @@ If any caller above you has any mutex or rwlock, your sleep, will cause a panic. If the sleep only happens rarely it may be years before the bad code path is found. +.Pp +It is an error to do any operation that could result in unbounded sleep when +running inside an interrupt thread. .Ss Interaction table The following table shows what you can and can not do if you hold one of the synchronization primitives discussed here: From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 18:20:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D56A31065670; Wed, 10 Feb 2010 18:20:20 +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 C4C028FC0A; Wed, 10 Feb 2010 18:20:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AIKKvW071568; Wed, 10 Feb 2010 18:20:20 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AIKKeR071566; Wed, 10 Feb 2010 18:20:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002101820.o1AIKKeR071566@svn.freebsd.org> From: Xin LI Date: Wed, 10 Feb 2010 18:20: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: r203760 - head/games/grdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 18:20:20 -0000 Author: delphij Date: Wed Feb 10 18:20:20 2010 New Revision: 203760 URL: http://svn.freebsd.org/changeset/base/203760 Log: Improve time precision for grdc(6): Traditionally, grdc would obtain time through time(3) which in turn gets only the second part of clock (CLOCK_SECOND), and sleep for 1 second after each screen refresh. This approach would have two problems. First, we are not guaranteed to be waken up at the beginning of a whole second, which will typically exhibit as a "lag" on second number. Second, because we sleep for whole second, and the refresh process would take some time, the error would accumulate from time to time, making the lag variable. Make grdc(6) to use time(3) to get time only at the beginning, and sample time in CLOCK_REALTIME_FAST granularity after refreshing, and use the nanosecond part to caculate how much time we want to sleep. PR: bin/120813 MFC after: 1 month Modified: head/games/grdc/grdc.c Modified: head/games/grdc/grdc.c ============================================================================== --- head/games/grdc/grdc.c Wed Feb 10 17:02:06 2010 (r203759) +++ head/games/grdc/grdc.c Wed Feb 10 18:20:20 2010 (r203760) @@ -59,6 +59,7 @@ main(argc, argv) int argc; char **argv; { +struct timespec ts; long t, a; int i, j, s, k; int n; @@ -136,9 +137,9 @@ int t12; attrset(COLOR_PAIR(2)); } + time(&now); do { mask = 0; - time(&now); tm = localtime(&now); set(tm->tm_sec%10, 0); set(tm->tm_sec/10, 4); @@ -193,7 +194,19 @@ int t12; } movto(6, 0); refresh(); - sleep(1); + clock_gettime(CLOCK_REALTIME_FAST, &ts); + if (ts.tv_sec == now) { + if (ts.tv_nsec > 0) { + ts.tv_sec = 0; + ts.tv_nsec = 1000000000 - ts.tv_nsec; + } else { + ts.tv_sec = 1; + ts.tv_nsec = 0; + } + nanosleep(&ts, NULL); + now = ts.tv_sec + 1; + } else + now = ts.tv_sec; if (sigtermed) { standend(); clear(); From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 18:56:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E605106568B; Wed, 10 Feb 2010 18:56:49 +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 6D7268FC08; Wed, 10 Feb 2010 18:56:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AIunWb079609; Wed, 10 Feb 2010 18:56:49 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AIunuL079607; Wed, 10 Feb 2010 18:56:49 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201002101856.o1AIunuL079607@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 10 Feb 2010 18:56: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: r203761 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 18:56:49 -0000 Author: trasz Date: Wed Feb 10 18:56:49 2010 New Revision: 203761 URL: http://svn.freebsd.org/changeset/base/203761 Log: Remove unused variable. Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Wed Feb 10 18:20:20 2010 (r203760) +++ head/sys/ufs/ffs/ffs_vfsops.c Wed Feb 10 18:56:49 2010 (r203761) @@ -138,7 +138,7 @@ ffs_mount(struct mount *mp) struct ufsmount *ump = 0; struct fs *fs; int error, flags; - u_int mntorflags, mntandnotflags; + u_int mntorflags; accmode_t accmode; struct nameidata ndp; char *fspec; @@ -163,7 +163,6 @@ ffs_mount(struct mount *mp) return (error); mntorflags = 0; - mntandnotflags = 0; if (vfs_getopt(mp->mnt_optnew, "acls", NULL, NULL) == 0) mntorflags |= MNT_ACLS; @@ -187,7 +186,7 @@ ffs_mount(struct mount *mp) } MNT_ILOCK(mp); - mp->mnt_flag = (mp->mnt_flag | mntorflags) & ~mntandnotflags; + mp->mnt_flag |= mntorflags; MNT_IUNLOCK(mp); /* * If updating, check whether changing from read-only to From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 19:03:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1614106566B; Wed, 10 Feb 2010 19:03:48 +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 B096B8FC0A; Wed, 10 Feb 2010 19:03:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AJ3m0E081157; Wed, 10 Feb 2010 19:03:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AJ3mrc081155; Wed, 10 Feb 2010 19:03:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201002101903.o1AJ3mrc081155@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 10 Feb 2010 19:03: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: r203762 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 19:03:48 -0000 Author: trasz Date: Wed Feb 10 19:03:48 2010 New Revision: 203762 URL: http://svn.freebsd.org/changeset/base/203762 Log: Start sentences with a new line. Submitted by: brueffer Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Wed Feb 10 18:56:49 2010 (r203761) +++ head/share/man/man9/locking.9 Wed Feb 10 19:03:48 2010 (r203762) @@ -152,7 +152,8 @@ Shared/exclusive locks are similar to re between them is that shared/exclusive locks may be held during unbounded sleep (and may thus perform an unbounded sleep). They are inherently less efficient than mutexes, reader/writer locks -and read-mostly locks. They don't support priority propagation. +and read-mostly locks. +They don't support priority propagation. They should be considered to be closely related to .Xr sleep 9 . In fact it could in some cases be @@ -192,9 +193,9 @@ Giant is an instance of a mutex, with so It is recursive. .It Drivers and filesystems can request that Giant be locked around them -by not marking themselves MPSAFE. Note that infrastructure to do this -is slowly going away as non-MPSAFE drivers either became properly locked -or disappear. +by not marking themselves MPSAFE. +Note that infrastructure to do this is slowly going away as non-MPSAFE +drivers either became properly locked or disappear. .It Giant must be locked first before other locks. .It From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 20:10:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E6F21065676; Wed, 10 Feb 2010 20:10:35 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BEF88FC08; Wed, 10 Feb 2010 20:10:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AKAZ1s095808; Wed, 10 Feb 2010 20:10:35 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AKAZP5095805; Wed, 10 Feb 2010 20:10:35 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201002102010.o1AKAZP5095805@svn.freebsd.org> From: Kirk McKusick Date: Wed, 10 Feb 2010 20:10: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: r203763 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 20:10:35 -0000 Author: mckusick Date: Wed Feb 10 20:10:35 2010 New Revision: 203763 URL: http://svn.freebsd.org/changeset/base/203763 Log: This fix corrects a problem in the file system that treats large inode numbers as negative rather than unsigned. For a default (16K block) file system, this bug began to show up at a file system size above about 16Tb. To fully handle this problem, newfs must be updated to ensure that it will never create a filesystem with more than 2^32 inodes. That patch will be forthcoming soon. Reported by: Scott Burns, John Kilburg, Bruce Evans Followup by: Jeff Roberson PR: 133980 MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/fs.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Wed Feb 10 19:03:48 2010 (r203762) +++ head/sys/ufs/ffs/ffs_alloc.c Wed Feb 10 20:10:35 2010 (r203763) @@ -93,24 +93,25 @@ __FBSDID("$FreeBSD$"); #include #include -typedef ufs2_daddr_t allocfcn_t(struct inode *ip, int cg, ufs2_daddr_t bpref, +typedef ufs2_daddr_t allocfcn_t(struct inode *ip, u_int cg, ufs2_daddr_t bpref, int size); -static ufs2_daddr_t ffs_alloccg(struct inode *, int, ufs2_daddr_t, int); +static ufs2_daddr_t ffs_alloccg(struct inode *, u_int, ufs2_daddr_t, int); static ufs2_daddr_t ffs_alloccgblk(struct inode *, struct buf *, ufs2_daddr_t); #ifdef INVARIANTS static int ffs_checkblk(struct inode *, ufs2_daddr_t, long); #endif -static ufs2_daddr_t ffs_clusteralloc(struct inode *, int, ufs2_daddr_t, int); +static ufs2_daddr_t ffs_clusteralloc(struct inode *, u_int, ufs2_daddr_t, int); static void ffs_clusteracct(struct ufsmount *, struct fs *, struct cg *, ufs1_daddr_t, int); static ino_t ffs_dirpref(struct inode *); -static ufs2_daddr_t ffs_fragextend(struct inode *, int, ufs2_daddr_t, int, int); +static ufs2_daddr_t ffs_fragextend(struct inode *, u_int, ufs2_daddr_t, + int, int); static void ffs_fserr(struct fs *, ino_t, char *); static ufs2_daddr_t ffs_hashalloc - (struct inode *, int, ufs2_daddr_t, int, allocfcn_t *); -static ufs2_daddr_t ffs_nodealloccg(struct inode *, int, ufs2_daddr_t, int); + (struct inode *, u_int, ufs2_daddr_t, int, allocfcn_t *); +static ufs2_daddr_t ffs_nodealloccg(struct inode *, u_int, ufs2_daddr_t, int); static ufs1_daddr_t ffs_mapsearch(struct fs *, struct cg *, ufs2_daddr_t, int); static int ffs_reallocblks_ufs1(struct vop_reallocblks_args *); static int ffs_reallocblks_ufs2(struct vop_reallocblks_args *); @@ -145,7 +146,7 @@ ffs_alloc(ip, lbn, bpref, size, flags, c struct fs *fs; struct ufsmount *ump; ufs2_daddr_t bno; - int cg, reclaimed; + u_int cg, reclaimed; static struct timeval lastfail; static int curfail; int64_t delta; @@ -248,7 +249,8 @@ ffs_realloccg(ip, lbprev, bprev, bpref, struct fs *fs; struct buf *bp; struct ufsmount *ump; - int cg, request, error, reclaimed; + u_int cg, request, reclaimed; + int error; ufs2_daddr_t bno; static struct timeval lastfail; static int curfail; @@ -933,7 +935,8 @@ ffs_valloc(pvp, mode, cred, vpp) struct timespec ts; struct ufsmount *ump; ino_t ino, ipref; - int cg, error, error1; + u_int cg; + int error, error1; static struct timeval lastfail; static int curfail; @@ -1043,11 +1046,11 @@ ffs_dirpref(pip) struct inode *pip; { struct fs *fs; - int cg, prefcg, dirsize, cgsize; - int avgifree, avgbfree, avgndir, curdirsize; - int minifree, minbfree, maxndir; - int mincg, minndir; - int maxcontigdirs; + u_int cg, prefcg, dirsize, cgsize; + u_int avgifree, avgbfree, avgndir, curdirsize; + u_int minifree, minbfree, maxndir; + u_int mincg, minndir; + u_int maxcontigdirs; mtx_assert(UFS_MTX(pip->i_ump), MA_OWNED); fs = pip->i_fs; @@ -1171,8 +1174,8 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap) ufs1_daddr_t *bap; { struct fs *fs; - int cg; - int avgbfree, startcg; + u_int cg; + u_int avgbfree, startcg; mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); fs = ip->i_fs; @@ -1221,8 +1224,8 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap) ufs2_daddr_t *bap; { struct fs *fs; - int cg; - int avgbfree, startcg; + u_int cg; + u_int avgbfree, startcg; mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); fs = ip->i_fs; @@ -1275,14 +1278,14 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap) static ufs2_daddr_t ffs_hashalloc(ip, cg, pref, size, allocator) struct inode *ip; - int cg; + u_int cg; ufs2_daddr_t pref; int size; /* size for data blocks, mode for inodes */ allocfcn_t *allocator; { struct fs *fs; ufs2_daddr_t result; - int i, icg = cg; + u_int i, icg = cg; mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); #ifdef INVARIANTS @@ -1333,7 +1336,7 @@ ffs_hashalloc(ip, cg, pref, size, alloca static ufs2_daddr_t ffs_fragextend(ip, cg, bprev, osize, nsize) struct inode *ip; - int cg; + u_int cg; ufs2_daddr_t bprev; int osize, nsize; { @@ -1416,7 +1419,7 @@ fail: static ufs2_daddr_t ffs_alloccg(ip, cg, bpref, size) struct inode *ip; - int cg; + u_int cg; ufs2_daddr_t bpref; int size; { @@ -1586,7 +1589,7 @@ gotit: static ufs2_daddr_t ffs_clusteralloc(ip, cg, bpref, len) struct inode *ip; - int cg; + u_int cg; ufs2_daddr_t bpref; int len; { @@ -1710,7 +1713,7 @@ fail: static ufs2_daddr_t ffs_nodealloccg(ip, cg, ipref, mode) struct inode *ip; - int cg; + u_int cg; ufs2_daddr_t ipref; int mode; { @@ -1811,7 +1814,7 @@ gotit: bdwrite(bp); if (ibp != NULL) bawrite(ibp); - return (cg * fs->fs_ipg + ipref); + return ((ino_t)(cg * fs->fs_ipg + ipref)); } /* @@ -1856,7 +1859,8 @@ ffs_blkfree(ump, fs, devvp, bno, size, i struct buf *bp; ufs1_daddr_t fragno, cgbno; ufs2_daddr_t cgblkno; - int i, cg, blk, frags, bbase; + int i, blk, frags, bbase; + u_int cg; u_int8_t *blksfree; struct cdev *dev; @@ -2054,7 +2058,8 @@ ffs_freefile(ump, fs, devvp, ino, mode) struct cg *cgp; struct buf *bp; ufs2_daddr_t cgbno; - int error, cg; + int error; + u_int cg; u_int8_t *inosused; struct cdev *dev; @@ -2068,7 +2073,7 @@ ffs_freefile(ump, fs, devvp, ino, mode) dev = devvp->v_rdev; cgbno = fsbtodb(fs, cgtod(fs, cg)); } - if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg) + if (ino >= fs->fs_ipg * fs->fs_ncg) panic("ffs_freefile: range: dev = %s, ino = %lu, fs = %s", devtoname(dev), (u_long)ino, fs->fs_fsmnt); if ((error = bread(devvp, cgbno, (int)fs->fs_cgsize, NOCRED, &bp))) { @@ -2085,8 +2090,8 @@ ffs_freefile(ump, fs, devvp, ino, mode) inosused = cg_inosused(cgp); ino %= fs->fs_ipg; if (isclr(inosused, ino)) { - printf("dev = %s, ino = %lu, fs = %s\n", devtoname(dev), - (u_long)ino + cg * fs->fs_ipg, fs->fs_fsmnt); + printf("dev = %s, ino = %u, fs = %s\n", devtoname(dev), + ino + cg * fs->fs_ipg, fs->fs_fsmnt); if (fs->fs_ronly == 0) panic("ffs_freefile: freeing free inode"); } @@ -2121,7 +2126,8 @@ ffs_checkfreefile(fs, devvp, ino) struct cg *cgp; struct buf *bp; ufs2_daddr_t cgbno; - int ret, cg; + int ret; + u_int cg; u_int8_t *inosused; cg = ino_to_cg(fs, ino); @@ -2132,7 +2138,7 @@ ffs_checkfreefile(fs, devvp, ino) /* devvp is a normal disk device */ cgbno = fsbtodb(fs, cgtod(fs, cg)); } - if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg) + if (ino >= fs->fs_ipg * fs->fs_ncg) return (1); if (bread(devvp, cgbno, (int)fs->fs_cgsize, NOCRED, &bp)) { brelse(bp); Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Wed Feb 10 19:03:48 2010 (r203762) +++ head/sys/ufs/ffs/fs.h Wed Feb 10 20:10:35 2010 (r203763) @@ -264,7 +264,7 @@ struct fs { int32_t fs_old_time; /* last time written */ int32_t fs_old_size; /* number of blocks in fs */ int32_t fs_old_dsize; /* number of data blocks in fs */ - int32_t fs_ncg; /* number of cylinder groups */ + u_int32_t fs_ncg; /* number of cylinder groups */ int32_t fs_bsize; /* size of basic blocks in fs */ int32_t fs_fsize; /* size of frag blocks in fs */ int32_t fs_frag; /* number of frags in a block in fs */ @@ -304,7 +304,7 @@ struct fs { int32_t fs_old_spc; /* sectors per cylinder */ int32_t fs_old_ncyl; /* cylinders in filesystem */ int32_t fs_old_cpg; /* cylinders per group */ - int32_t fs_ipg; /* inodes per group */ + u_int32_t fs_ipg; /* inodes per group */ int32_t fs_fpg; /* blocks per group * fs_frag */ /* this data must be re-computed after crashes */ struct csum fs_old_cstotal; /* cylinder summary information */ @@ -335,10 +335,10 @@ struct fs { int64_t fs_dsize; /* number of data blocks in fs */ ufs2_daddr_t fs_csaddr; /* blk addr of cyl grp summary area */ int64_t fs_pendingblocks; /* (u) blocks being freed */ - int32_t fs_pendinginodes; /* (u) inodes being freed */ - int32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */ - int32_t fs_avgfilesize; /* expected average file size */ - int32_t fs_avgfpdir; /* expected # of files per directory */ + u_int32_t fs_pendinginodes; /* (u) inodes being freed */ + ino_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */ + u_int32_t fs_avgfilesize; /* expected average file size */ + u_int32_t fs_avgfpdir; /* expected # of files per directory */ int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */ int32_t fs_sparecon32[26]; /* reserved for future constants */ int32_t fs_flags; /* see FS_ flags below */ @@ -463,26 +463,26 @@ struct cg { int32_t cg_firstfield; /* historic cyl groups linked list */ int32_t cg_magic; /* magic number */ int32_t cg_old_time; /* time last written */ - int32_t cg_cgx; /* we are the cgx'th cylinder group */ + u_int32_t cg_cgx; /* we are the cgx'th cylinder group */ int16_t cg_old_ncyl; /* number of cyl's this cg */ int16_t cg_old_niblk; /* number of inode blocks this cg */ - int32_t cg_ndblk; /* number of data blocks this cg */ - struct csum cg_cs; /* cylinder summary information */ - int32_t cg_rotor; /* position of last used block */ - int32_t cg_frotor; /* position of last used frag */ - int32_t cg_irotor; /* position of last used inode */ - int32_t cg_frsum[MAXFRAG]; /* counts of available frags */ + u_int32_t cg_ndblk; /* number of data blocks this cg */ + struct csum cg_cs; /* cylinder summary information */ + u_int32_t cg_rotor; /* position of last used block */ + u_int32_t cg_frotor; /* position of last used frag */ + u_int32_t cg_irotor; /* position of last used inode */ + u_int32_t cg_frsum[MAXFRAG]; /* counts of available frags */ int32_t cg_old_btotoff; /* (int32) block totals per cylinder */ int32_t cg_old_boff; /* (u_int16) free block positions */ - int32_t cg_iusedoff; /* (u_int8) used inode map */ - int32_t cg_freeoff; /* (u_int8) free block map */ - int32_t cg_nextfreeoff; /* (u_int8) next available space */ - int32_t cg_clustersumoff; /* (u_int32) counts of avail clusters */ - int32_t cg_clusteroff; /* (u_int8) free cluster map */ - int32_t cg_nclusterblks; /* number of clusters this cg */ - int32_t cg_niblk; /* number of inode blocks this cg */ - int32_t cg_initediblk; /* last initialized inode */ - int32_t cg_unrefs; /* number of unreferenced inodes */ + u_int32_t cg_iusedoff; /* (u_int8) used inode map */ + u_int32_t cg_freeoff; /* (u_int8) free block map */ + u_int32_t cg_nextfreeoff; /* (u_int8) next available space */ + u_int32_t cg_clustersumoff; /* (u_int32) counts of avail clusters */ + u_int32_t cg_clusteroff; /* (u_int8) free cluster map */ + u_int32_t cg_nclusterblks; /* number of clusters this cg */ + u_int32_t cg_niblk; /* number of inode blocks this cg */ + u_int32_t cg_initediblk; /* last initialized inode */ + u_int32_t cg_unrefs; /* number of unreferenced inodes */ int32_t cg_sparecon32[2]; /* reserved for future use */ ufs_time_t cg_time; /* time last written */ int64_t cg_sparecon64[3]; /* reserved for future use */ @@ -529,11 +529,11 @@ struct cg { * inode number to cylinder group number. * inode number to filesystem block address. */ -#define ino_to_cg(fs, x) ((x) / (fs)->fs_ipg) +#define ino_to_cg(fs, x) (((ino_t)(x)) / (fs)->fs_ipg) #define ino_to_fsba(fs, x) \ - ((ufs2_daddr_t)(cgimin(fs, ino_to_cg(fs, x)) + \ - (blkstofrags((fs), (((x) % (fs)->fs_ipg) / INOPB(fs)))))) -#define ino_to_fsbo(fs, x) ((x) % INOPB(fs)) + ((ufs2_daddr_t)(cgimin(fs, ino_to_cg(fs, (ino_t)(x))) + \ + (blkstofrags((fs), ((((ino_t)(x)) % (fs)->fs_ipg) / INOPB(fs)))))) +#define ino_to_fsbo(fs, x) (((ino_t)(x)) % INOPB(fs)) /* * Give cylinder group number for a filesystem block. From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 20:17:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 937AE1065679; Wed, 10 Feb 2010 20:17:46 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 816E68FC1D; Wed, 10 Feb 2010 20:17:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AKHkVH097464; Wed, 10 Feb 2010 20:17:46 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AKHkrp097460; Wed, 10 Feb 2010 20:17:46 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201002102017.o1AKHkrp097460@svn.freebsd.org> From: Kirk McKusick Date: Wed, 10 Feb 2010 20:17: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: r203764 - head/sbin/newfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 20:17:46 -0000 Author: mckusick Date: Wed Feb 10 20:17:46 2010 New Revision: 203764 URL: http://svn.freebsd.org/changeset/base/203764 Log: Ensure that newfs will never create a filesystem with more than 2^32 inodes by cutting back on the number of inodes per cylinder group if necessary to stay under the limit. For a default (16K block) file system, this limit begins to take effect for file systems above 32Tb. This fix is in addition to -r203763 which corrected a problem in the kernel that treated large inode numbers as negative rather than unsigned. For a default (16K block) file system, this bug began to show up at a file system size above about 16Tb. Reported by: Scott Burns, John Kilburg, Bruce Evans Followup by: Jeff Roberson PR: 133980 MFC after: 2 weeks Modified: head/sbin/newfs/mkfs.c head/sbin/newfs/newfs.c head/sbin/newfs/newfs.h Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Wed Feb 10 20:10:35 2010 (r203763) +++ head/sbin/newfs/mkfs.c Wed Feb 10 20:17:46 2010 (r203764) @@ -118,6 +118,8 @@ mkfs(struct partition *pp, char *fsys) time_t utime; quad_t sizepb; int width; + ino_t maxinum; + int minfragsperinode; /* minimum ratio of frags to inodes */ char tmpbuf[100]; /* XXX this will break in about 2,500 years */ union { struct fs fdummy; @@ -170,6 +172,8 @@ mkfs(struct partition *pp, char *fsys) if (sblock.fs_avgfpdir <= 0) printf("illegal expected number of files per directory %d\n", sblock.fs_avgfpdir), exit(15); + +restart: /* * collect and verify the block and fragment sizes */ @@ -216,6 +220,8 @@ mkfs(struct partition *pp, char *fsys) sblock.fs_fsize, MAXFRAG, sblock.fs_bsize / MAXFRAG); sblock.fs_fsize = sblock.fs_bsize / MAXFRAG; } + if (maxbsize == 0) + maxbsize = bsize; if (maxbsize < bsize || !POWEROF2(maxbsize)) { sblock.fs_maxbsize = sblock.fs_bsize; printf("Extent size set to %d\n", sblock.fs_maxbsize); @@ -225,6 +231,14 @@ mkfs(struct partition *pp, char *fsys) } else { sblock.fs_maxbsize = maxbsize; } + /* + * Maxcontig sets the default for the maximum number of blocks + * that may be allocated sequentially. With file system clustering + * it is possible to allocate contiguous blocks up to the maximum + * transfer size permitted by the controller or buffering. + */ + if (maxcontig == 0) + maxcontig = MAX(1, MAXPHYS / bsize); sblock.fs_maxcontig = maxcontig; if (sblock.fs_maxcontig < sblock.fs_maxbsize / sblock.fs_bsize) { sblock.fs_maxcontig = sblock.fs_maxbsize / sblock.fs_bsize; @@ -315,9 +329,26 @@ mkfs(struct partition *pp, char *fsys) * can put into each cylinder group. If this is too big, we reduce * the density until it fits. */ + maxinum = (((int64_t)(1)) << 32) - INOPB(&sblock); + minfragsperinode = 1 + fssize / maxinum; + if (density == 0) { + density = MAX(NFPI, minfragsperinode) * fsize; + } else if (density < minfragsperinode * fsize) { + origdensity = density; + density = minfragsperinode * fsize; + fprintf(stderr, "density increased from %d to %d\n", + origdensity, density); + } origdensity = density; for (;;) { fragsperinode = MAX(numfrags(&sblock, density), 1); + if (fragsperinode < minfragsperinode) { + bsize <<= 1; + fsize <<= 1; + printf("Block size too small for a file system %s %d\n", + "of this size. Increasing blocksize to", bsize); + goto restart; + } minfpg = fragsperinode * INOPB(&sblock); if (minfpg > sblock.fs_size) minfpg = sblock.fs_size; @@ -406,7 +437,10 @@ mkfs(struct partition *pp, char *fsys) if (sblock.fs_sbsize > SBLOCKSIZE) sblock.fs_sbsize = SBLOCKSIZE; sblock.fs_minfree = minfree; - sblock.fs_maxbpg = maxbpg; + if (maxbpg == 0) + sblock.fs_maxbpg = MAXBLKPG(sblock.fs_bsize); + else + sblock.fs_maxbpg = maxbpg; sblock.fs_optim = opt; sblock.fs_cgrotor = 0; sblock.fs_pendingblocks = 0; Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Wed Feb 10 20:10:35 2010 (r203763) +++ head/sbin/newfs/newfs.c Wed Feb 10 20:17:46 2010 (r203764) @@ -79,38 +79,6 @@ __FBSDID("$FreeBSD$"); #include "newfs.h" -/* - * The following two constants set the default block and fragment sizes. - * Both constants must be a power of 2 and meet the following constraints: - * MINBSIZE <= DESBLKSIZE <= MAXBSIZE - * sectorsize <= DESFRAGSIZE <= DESBLKSIZE - * DESBLKSIZE / DESFRAGSIZE <= 8 - */ -#define DFL_FRAGSIZE 2048 -#define DFL_BLKSIZE 16384 - -/* - * Cylinder groups may have up to MAXBLKSPERCG blocks. The actual - * number used depends upon how much information can be stored - * in a cylinder group map which must fit in a single file system - * block. The default is to use as many as possible blocks per group. - */ -#define MAXBLKSPERCG 0x7fffffff /* desired fs_fpg ("infinity") */ - -/* - * MAXBLKPG determines the maximum number of data blocks which are - * placed in a single cylinder group. The default is one indirect - * block worth of data blocks. - */ -#define MAXBLKPG(bsize) ((bsize) / sizeof(ufs2_daddr_t)) - -/* - * Each file system has a number of inodes statically allocated. - * We allocate one inode slot per NFPI fragments, expecting this - * to be far more than we will ever need. - */ -#define NFPI 4 - int Eflag; /* Erase previous disk contents */ int Lflag; /* add a volume label */ int Nflag; /* run without writing file system */ @@ -387,25 +355,11 @@ main(int argc, char *argv[]) fsize = MAX(DFL_FRAGSIZE, sectorsize); if (bsize <= 0) bsize = MIN(DFL_BLKSIZE, 8 * fsize); - if (maxbsize == 0) - maxbsize = bsize; - /* - * Maxcontig sets the default for the maximum number of blocks - * that may be allocated sequentially. With file system clustering - * it is possible to allocate contiguous blocks up to the maximum - * transfer size permitted by the controller or buffering. - */ - if (maxcontig == 0) - maxcontig = MAX(1, MAXPHYS / bsize); - if (density == 0) - density = NFPI * fsize; if (minfree < MINFREE && opt != FS_OPTSPACE) { fprintf(stderr, "Warning: changing optimization to space "); fprintf(stderr, "because minfree is less than %d%%\n", MINFREE); opt = FS_OPTSPACE; } - if (maxbpg == 0) - maxbpg = MAXBLKPG(bsize); realsectorsize = sectorsize; if (sectorsize != DEV_BSIZE) { /* XXX */ int secperblk = sectorsize / DEV_BSIZE; Modified: head/sbin/newfs/newfs.h ============================================================================== --- head/sbin/newfs/newfs.h Wed Feb 10 20:10:35 2010 (r203763) +++ head/sbin/newfs/newfs.h Wed Feb 10 20:17:46 2010 (r203764) @@ -41,6 +41,38 @@ #include /* + * The following two constants set the default block and fragment sizes. + * Both constants must be a power of 2 and meet the following constraints: + * MINBSIZE <= DESBLKSIZE <= MAXBSIZE + * sectorsize <= DESFRAGSIZE <= DESBLKSIZE + * DESBLKSIZE / DESFRAGSIZE <= 8 + */ +#define DFL_FRAGSIZE 2048 +#define DFL_BLKSIZE 16384 + +/* + * Cylinder groups may have up to MAXBLKSPERCG blocks. The actual + * number used depends upon how much information can be stored + * in a cylinder group map which must fit in a single file system + * block. The default is to use as many as possible blocks per group. + */ +#define MAXBLKSPERCG 0x7fffffff /* desired fs_fpg ("infinity") */ + +/* + * MAXBLKPG determines the maximum number of data blocks which are + * placed in a single cylinder group. The default is one indirect + * block worth of data blocks. + */ +#define MAXBLKPG(bsize) ((bsize) / sizeof(ufs2_daddr_t)) + +/* + * Each file system has a number of inodes statically allocated. + * We allocate one inode slot per NFPI fragments, expecting this + * to be far more than we will ever need. + */ +#define NFPI 4 + +/* * variables set up by front end. */ extern int Eflag; /* Erase previous disk contents */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 20:35:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 89E6A1065679; Wed, 10 Feb 2010 20:35:19 +0000 (UTC) Date: Wed, 10 Feb 2010 20:35:19 +0000 From: Alexey Dokuchaev To: Attilio Rao Message-ID: <20100210203519.GA44831@FreeBSD.org> References: <201002101630.o1AGU4kn043737@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201002101630.o1AGU4kn043737@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: r203758 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 20:35:19 -0000 On Wed, Feb 10, 2010 at 04:30:04PM +0000, Attilio Rao wrote: > Author: attilio > Date: Wed Feb 10 16:30:04 2010 > New Revision: 203758 > URL: http://svn.freebsd.org/changeset/base/203758 > > Log: > Add the options DEADLKRES (introducing the deadlock resolver thread) in > the 'debugging' section of any HEAD kernel and enable for the mainstream > ones, excluding the embedded architectures. > It may, of course, enabled on a case-by-case basis. > > Sponsored by: Sandvine Incorporated > Requested by: emaste > Discussed with: kib > > @@ -72,6 +72,7 @@ options INCLUDE_CONFIG_FILE # Inclu > options KDB # Enable kernel debugger support. > options DDB # Support DDB. > options GDB # Support remote GDB. > +options DEADLKRES # Enable the deadlock resolver > options INVARIANTS # Enable calls of extra sanity checking Garbled indentation suggests you've put after "options" instead of space. If you decide to fix it, you can take care of the similar error with FLOWTABLE option at least in amd64/conf/GENERIC. ./danfe From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 20:35:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 288FA106566C; Wed, 10 Feb 2010 20:35:21 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 165C88FC13; Wed, 10 Feb 2010 20:35:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AKZKTb001497; Wed, 10 Feb 2010 20:35:20 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AKZK0G001495; Wed, 10 Feb 2010 20:35:20 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201002102035.o1AKZK0G001495@svn.freebsd.org> From: Kirk McKusick Date: Wed, 10 Feb 2010 20:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203765 - stable/8/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 20:35:21 -0000 Author: mckusick Date: Wed Feb 10 20:35:20 2010 New Revision: 203765 URL: http://svn.freebsd.org/changeset/base/203765 Log: MFC of r201700 | mckusick | 2010-01-06 This corrects a bug that manifested itself as identifying the last cylinder group of a UFS1 filesystem as bad. The error was in the check and not in the cylinder group itself. So even though fsck fixed the cylinder group correctly, it was still endlessly reported as bad. This bug first appeared in 8.0 so does not apply to earlier releases. PR: 141992 Reported by: Dan Strick Modified: stable/8/sbin/fsck_ffs/fsutil.c Directory Properties: stable/8/sbin/fsck_ffs/ (props changed) Modified: stable/8/sbin/fsck_ffs/fsutil.c ============================================================================== --- stable/8/sbin/fsck_ffs/fsutil.c Wed Feb 10 20:17:46 2010 (r203764) +++ stable/8/sbin/fsck_ffs/fsutil.c Wed Feb 10 20:35:20 2010 (r203765) @@ -436,7 +436,7 @@ check_cgmagic(int cg, struct cg *cgp) ((sblock.fs_magic == FS_UFS1_MAGIC && cgp->cg_old_niblk == sblock.fs_ipg && cgp->cg_ndblk <= sblock.fs_fpg && - cgp->cg_old_ncyl == sblock.fs_old_cpg) || + cgp->cg_old_ncyl <= sblock.fs_old_cpg) || (sblock.fs_magic == FS_UFS2_MAGIC && cgp->cg_niblk == sblock.fs_ipg && cgp->cg_ndblk <= sblock.fs_fpg && From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 04:20:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F1701065672; Thu, 11 Feb 2010 04:20:39 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99]) by mx1.freebsd.org (Postfix) with ESMTP id 396838FC13; Thu, 11 Feb 2010 04:20:38 +0000 (UTC) MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_UnsDNPARCItTutJo6OmNpw)" Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp024.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KXN009Y9TED1Q30@asmtp024.mac.com>; Wed, 10 Feb 2010 20:20:38 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1002100279 From: Marcel Moolenaar In-reply-to: <20100210091522.GW9991@deviant.kiev.zoral.com.ua> Date: Wed, 10 Feb 2010 20:20:37 -0800 Message-id: References: <201002090552.o195qZcD074581@svn.freebsd.org> <20100209095722.GQ9991@deviant.kiev.zoral.com.ua> <65DCE552-7EFD-48F2-85A4-EA0F1F0638EE@mac.com> <20100209184043.GV9991@deviant.kiev.zoral.com.ua> <896B58E6-12EA-48AB-86C2-5BA9F0C59512@mac.com> <86989446-64EF-411F-8E25-173DB6AEE10B@mac.com> <20100210091522.GW9991@deviant.kiev.zoral.com.ua> To: Kostik Belousov X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 04:20:39 -0000 --Boundary_(ID_UnsDNPARCItTutJo6OmNpw) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT On Feb 10, 2010, at 1:15 AM, Kostik Belousov wrote: > > Vnode locks are before vm map locks in global lock order. vn_fullpath() > may need to lock vnodes to call VOP_VPTOCNP(). I think you should (and > can) drop both vm map lock and vmspace reference much earlier. > > Would it be cleaner to use explicitely sized types for compat32 > structure members ? I don't know. I prefer to keep them identical for as much as that's possible. > Comparing ptrace_vm_entry with kinfo_vmentry, I think that it might > be good idea to add fsid and inode number to ptrace_vm_entry, to > give at least some information when vn_fullpath failed. How about the attached new path (includes man page as well)? -- Marcel Moolenaar xcllnt@mac.com --Boundary_(ID_UnsDNPARCItTutJo6OmNpw) Content-type: application/octet-stream; x-unix-mode=0644; name=ptrace.diff Content-transfer-encoding: 7bit Content-disposition: attachment; filename=ptrace.diff Index: lib/libc/sys/ptrace.2 =================================================================== --- lib/libc/sys/ptrace.2 (revision 203696) +++ lib/libc/sys/ptrace.2 (working copy) @@ -343,23 +343,30 @@ which is defined as follows: .Bd -literal struct ptrace_vm_entry { - void *pve_cookie; - u_long pve_start; - u_long pve_end; - u_long pve_offset; - u_int pve_prot; - u_int pve_pathlen; - char *pve_path; + int pve_entry; + int pve_timestamp; + u_long pve_start; + u_long pve_end; + u_long pve_offset; + u_int pve_prot; + u_int pve_pathlen; + long pve_fileid; + uint32_t pve_fsid; + char *pve_path; }; .Ed .Pp The first entry is returned by setting -.Va pve_cookie -to -.Dv NULL . +.Va pve_entry +to zero. Subsequent entries are returned by leaving -.Va pve_cookie +.Va pve_entry unmodified from the value returned by previous requests. +The +.Va pve_timestamp +field can be used to detect changes to the VM map while iterating over the +entries. +The tracing process can then take appropriate action, such as restarting. By setting .Va pve_pathlen to a non-zero value on entry, the pathname of the backing object is returned @@ -434,7 +441,8 @@ .It .Dv PT_VM_ENTRY was given an invalid value for -.Fa pve_cookie . +.Fa pve_entry . +This can also be caused by changes to the VM map of the process. .El .It Bq Er EBUSY .Bl -bullet -compact Index: sys/kern/sys_process.c =================================================================== --- sys/kern/sys_process.c (revision 203724) +++ sys/kern/sys_process.c (working copy) @@ -75,12 +75,15 @@ }; struct ptrace_vm_entry32 { - uint32_t pve_cookie; + int pve_entry; + int pve_timestamp; uint32_t pve_start; uint32_t pve_end; uint32_t pve_offset; u_int pve_prot; u_int pve_pathlen; + int32_t pve_fileid; + u_int pve_fsid; uint32_t pve_path; }; @@ -360,88 +363,141 @@ static int ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) { + struct vattr vattr; vm_map_t map; vm_map_entry_t entry; vm_object_t obj, tobj, lobj; + struct vmspace *vm; struct vnode *vp; char *freepath, *fullpath; u_int pathlen; - int error, vfslocked; + int error, index, vfslocked; - map = &p->p_vmspace->vm_map; - entry = map->header.next; - if (pve->pve_cookie != NULL) { - while (entry != &map->header && entry != pve->pve_cookie) + error = 0; + obj = NULL; + + vm = vmspace_acquire_ref(p); + map = &vm->vm_map; + vm_map_lock_read(map); + + do { + entry = map->header.next; + index = 0; + while (index < pve->pve_entry && entry != &map->header) { entry = entry->next; - if (entry != pve->pve_cookie) - return (EINVAL); - entry = entry->next; - } - while (entry != &map->header && (entry->eflags & MAP_ENTRY_IS_SUB_MAP)) - entry = entry->next; - if (entry == &map->header) - return (ENOENT); + index++; + } + if (index != pve->pve_entry) { + error = EINVAL; + break; + } + while (entry != &map->header && + (entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { + entry = entry->next; + index++; + } + if (entry == &map->header) { + error = ENOENT; + break; + } - /* We got an entry. */ - pve->pve_cookie = entry; - pve->pve_start = entry->start; - pve->pve_end = entry->end - 1; - pve->pve_offset = entry->offset; - pve->pve_prot = entry->protection; + /* We got an entry. */ + pve->pve_entry = index + 1; + pve->pve_timestamp = map->timestamp; + pve->pve_start = entry->start; + pve->pve_end = entry->end - 1; + pve->pve_offset = entry->offset; + pve->pve_prot = entry->protection; - /* Backing object's path needed? */ - if (pve->pve_pathlen == 0) - return (0); + /* Backing object's path needed? */ + if (pve->pve_pathlen == 0) + break; - pathlen = pve->pve_pathlen; - pve->pve_pathlen = 0; + pathlen = pve->pve_pathlen; + pve->pve_pathlen = 0; - obj = entry->object.vm_object; - if (obj == NULL) - return (0); + obj = entry->object.vm_object; + if (obj != NULL) + VM_OBJECT_LOCK(obj); + } while (0); - VM_OBJECT_LOCK(obj); - for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { - if (tobj != obj) - VM_OBJECT_LOCK(tobj); - if (lobj != obj) - VM_OBJECT_UNLOCK(lobj); - lobj = tobj; - pve->pve_offset += tobj->backing_object_offset; - } - if (lobj != NULL) { + vm_map_unlock_read(map); + vmspace_free(vm); + + if (error == 0 && obj != NULL) { + lobj = obj; + for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { + if (tobj != obj) + VM_OBJECT_LOCK(tobj); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + lobj = tobj; + pve->pve_offset += tobj->backing_object_offset; + } vp = (lobj->type == OBJT_VNODE) ? lobj->handle : NULL; if (vp != NULL) vref(vp); if (lobj != obj) VM_OBJECT_UNLOCK(lobj); VM_OBJECT_UNLOCK(obj); - } else - vp = NULL; - if (vp == NULL) - return (0); + if (vp != NULL) { + freepath = NULL; + fullpath = NULL; + vn_fullpath(td, vp, &fullpath, &freepath); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_lock(vp, LK_SHARED | LK_RETRY); + if (VOP_GETATTR(vp, &vattr, td->td_ucred) == 0) { + pve->pve_fileid = vattr.va_fileid; + pve->pve_fsid = vattr.va_fsid; + } + vput(vp); + VFS_UNLOCK_GIANT(vfslocked); - freepath = NULL; - fullpath = NULL; - vn_fullpath(td, vp, &fullpath, &freepath); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); + if (fullpath != NULL) { + pve->pve_pathlen = strlen(fullpath) + 1; + if (pve->pve_pathlen <= pathlen) { + error = copyout(fullpath, pve->pve_path, + pve->pve_pathlen); + } else + error = ENAMETOOLONG; + } + if (freepath != NULL) + free(freepath, M_TEMP); + } + } - error = 0; - if (fullpath != NULL) { - pve->pve_pathlen = strlen(fullpath) + 1; - if (pve->pve_pathlen <= pathlen) { - error = copyout(fullpath, pve->pve_path, - pve->pve_pathlen); - } else - error = ENAMETOOLONG; + return (error); +} + +#ifdef COMPAT_IA32 +static int +ptrace_vm_entry32(struct thread *td, struct proc *p, + struct ptrace_vm_entry32 *pve32) +{ + struct ptrace_vm_entry pve; + int error; + + pve.pve_entry = pve32->pve_entry; + pve.pve_pathlen = pve32->pve_pathlen; + pve.pve_path = (void *)(uintptr_t)pve32->pve_path; + + error = ptrace_vm_entry(td, p, &pve); + if (error == 0) { + pve32->pve_entry = pve.pve_entry; + pve32->pve_timestamp = pve.pve_timestamp; + pve32->pve_start = pve.pve_start; + pve32->pve_end = pve.pve_end; + pve32->pve_offset = pve.pve_offset; + pve32->pve_prot = pve.pve_prot; + pve32->pve_fileid = pve.pve_fileid; + pve32->pve_fsid = pve.pve_fsid; } - if (freepath != NULL) - free(freepath, M_TEMP); + + pve32->pve_pathlen = pve.pve_pathlen; return (error); } +#endif /* COMPAT_IA32 */ /* * Process debugging system call. @@ -1087,14 +1143,12 @@ break; case PT_VM_ENTRY: + PROC_UNLOCK(p); #ifdef COMPAT_IA32 - /* XXX to be implemented. */ - if (wrap32) { - error = EDOOFUS; - break; - } + if (wrap32) + error = ptrace_vm_entry32(td, p, addr); + else #endif - PROC_UNLOCK(p); error = ptrace_vm_entry(td, p, addr); PROC_LOCK(p); break; Index: sys/sys/ptrace.h =================================================================== --- sys/sys/ptrace.h (revision 203724) +++ sys/sys/ptrace.h (working copy) @@ -104,13 +104,16 @@ /* Argument structure for PT_VM_ENTRY. */ struct ptrace_vm_entry { - void *pve_cookie; /* Token used to iterate. */ - u_long pve_start; /* Start VA of range. */ - u_long pve_end; /* End VA of range (incl). */ - u_long pve_offset; /* Offset in backing object. */ - u_int pve_prot; /* Protection of memory range. */ - u_int pve_pathlen; /* Size of path. */ - char *pve_path; /* Path name of object. */ + int pve_entry; /* Entry number used for iteration. */ + int pve_timestamp; /* Generation number of VM map. */ + u_long pve_start; /* Start VA of range. */ + u_long pve_end; /* End VA of range (incl). */ + u_long pve_offset; /* Offset in backing object. */ + u_int pve_prot; /* Protection of memory range. */ + u_int pve_pathlen; /* Size of path. */ + long pve_fileid; /* File ID. */ + uint32_t pve_fsid; /* File system ID. */ + char *pve_path; /* Path name of object. */ }; #ifdef _KERNEL --Boundary_(ID_UnsDNPARCItTutJo6OmNpw) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT --Boundary_(ID_UnsDNPARCItTutJo6OmNpw)-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 04:22:40 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from alona.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 47858106566B; Thu, 11 Feb 2010 04:22:39 +0000 (UTC) (envelope-from davidxu@freebsd.org) Message-ID: <4B73860D.1010808@freebsd.org> Date: Thu, 11 Feb 2010 12:22:37 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.21 (X11/20090522) MIME-Version: 1.0 To: Alexander Leidinger References: <201002080731.o187V5Pk072517@svn.freebsd.org> <20100210165213.95990l8r0b7latrk@webmail.leidinger.net> In-Reply-To: <20100210165213.95990l8r0b7latrk@webmail.leidinger.net> 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, mono@FreeBSD.org Subject: Re: svn commit: r203657 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 04:22:40 -0000 Alexander Leidinger wrote: > Quoting David Xu (from Mon, 8 Feb 2010 07:31:05 > +0000 (UTC)): > >> Author: davidxu >> Date: Mon Feb 8 07:31:05 2010 >> New Revision: 203657 >> URL: http://svn.freebsd.org/changeset/base/203657 >> >> Log: >> Set waiters flag before checking semaphore's counter, >> otherwise we might lose a wakeup. Tested on postgresql database >> server. > > Uhm... if I ktrace a hanging process and I see some semop()s (I assume > it is waiting on some event to happen), where on Linux this process is > working correctly, then I would like to test this patch to see if the > process still has the same problem? > > Or differently asked: this affects the operation of semop(2)? > > Bye, > Alexander. > This implementation uses umtx, the one in RELENG_8 uses semop() syscall. They are unrelated. From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 04:45:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B83071065672; Thu, 11 Feb 2010 04:45:08 +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 A86818FC13; Thu, 11 Feb 2010 04:45:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1B4j8EX070155; Thu, 11 Feb 2010 04:45:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1B4j8Lc070154; Thu, 11 Feb 2010 04:45:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002110445.o1B4j8Lc070154@svn.freebsd.org> From: Warner Losh Date: Thu, 11 Feb 2010 04:45: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: r203767 - head/lib/libufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 04:45:08 -0000 Author: imp Date: Thu Feb 11 04:45:08 2010 New Revision: 203767 URL: http://svn.freebsd.org/changeset/base/203767 Log: Increased warnings weren't tested on ARM. Bump warnings back down to 0 until it can be properly tested by those raising the warnings. Remember: make universe is required when changing the WARNS level. Modified: head/lib/libufs/Makefile Modified: head/lib/libufs/Makefile ============================================================================== --- head/lib/libufs/Makefile Thu Feb 11 02:56:05 2010 (r203766) +++ head/lib/libufs/Makefile Thu Feb 11 04:45:08 2010 (r203767) @@ -16,7 +16,7 @@ MLINKS+= ufs_disk_close.3 ufs_disk_fillo MLINKS+= ufs_disk_close.3 ufs_disk_fillout_blank.3 MLINKS+= ufs_disk_close.3 ufs_disk_write.3 -WARNS?= 3 +WARNS?= 0 CFLAGS+= -D_LIBUFS .if defined(LIBUFS_DEBUG) From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 06:22:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88DC7106568B; Thu, 11 Feb 2010 06:22:38 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76BF08FC15; Thu, 11 Feb 2010 06:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1B6Mc1r091474; Thu, 11 Feb 2010 06:22:38 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1B6Mc97091472; Thu, 11 Feb 2010 06:22:38 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201002110622.o1B6Mc97091472@svn.freebsd.org> From: Kirk McKusick Date: Thu, 11 Feb 2010 06:22: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: r203768 - head/lib/libufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 06:22:38 -0000 Author: mckusick Date: Thu Feb 11 06:22:38 2010 New Revision: 203768 URL: http://svn.freebsd.org/changeset/base/203768 Log: Keep Tinderbox happy. Modified: head/lib/libufs/cgroup.c Modified: head/lib/libufs/cgroup.c ============================================================================== --- head/lib/libufs/cgroup.c Thu Feb 11 04:45:08 2010 (r203767) +++ head/lib/libufs/cgroup.c Thu Feb 11 06:22:38 2010 (r203768) @@ -59,7 +59,7 @@ cgread1(struct uufsd *disk, int c) fs = &disk->d_fs; - if (c >= fs->fs_ncg) { + if ((unsigned)c >= fs->fs_ncg) { return (0); } ccg = fsbtodb(fs, cgtod(fs, c)) * disk->d_bsize; From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 06:26:05 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 8FD65106566C; Thu, 11 Feb 2010 06:26:04 +0000 (UTC) (envelope-from nork@FreeBSD.org) Date: Thu, 11 Feb 2010 15:26:03 +0900 From: Norikatsu Shigemura To: Warner Losh Message-Id: <20100211152603.388bf80d.nork@FreeBSD.org> In-Reply-To: <201002110445.o1B4j8Lc070154@svn.freebsd.org> References: <201002110445.o1B4j8Lc070154@svn.freebsd.org> X-Mailer: Sylpheed 2.7.1 (GTK+ 2.18.5; 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, src-committers@FreeBSD.org, Norikatsu Shigemura Subject: Re: svn commit: r203767 - head/lib/libufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 06:26:05 -0000 Hi Warner-san. On Thu, 11 Feb 2010 04:45:08 +0000 (UTC) Warner Losh wrote: > Author: imp > Date: Thu Feb 11 04:45:08 2010 > New Revision: 203767 > URL: http://svn.freebsd.org/changeset/base/203767 > Log: > Increased warnings weren't tested on ARM. Bump warnings back down to > 0 until it can be properly tested by those raising the warnings. > Remember: make universe is required when changing the WARNS level. I found same issues on following: /usr/src/sbin/newfs /usr/src/sbin/tunefs /usr/src/sbin/growfs May I fix this OK? From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 06:33:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13230106566C; Thu, 11 Feb 2010 06:33:36 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 024248FC13; Thu, 11 Feb 2010 06:33:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1B6XZHf093933; Thu, 11 Feb 2010 06:33:35 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1B6XZQx093931; Thu, 11 Feb 2010 06:33:35 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201002110633.o1B6XZQx093931@svn.freebsd.org> From: Kirk McKusick Date: Thu, 11 Feb 2010 06:33: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: r203769 - head/sbin/tunefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 06:33:36 -0000 Author: mckusick Date: Thu Feb 11 06:33:35 2010 New Revision: 203769 URL: http://svn.freebsd.org/changeset/base/203769 Log: Quiet spurious warnings. Modified: head/sbin/tunefs/tunefs.c Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Thu Feb 11 06:22:38 2010 (r203768) +++ head/sbin/tunefs/tunefs.c Thu Feb 11 06:33:35 2010 (r203769) @@ -301,7 +301,7 @@ main(int argc, char *argv[]) } if (fflag) { name = "average file size"; - if (sblock.fs_avgfilesize == fvalue) { + if (sblock.fs_avgfilesize == (unsigned)fvalue) { warnx("%s remains unchanged as %d", name, fvalue); } else { @@ -427,7 +427,7 @@ main(int argc, char *argv[]) } if (sflag) { name = "expected number of files per directory"; - if (sblock.fs_avgfpdir == svalue) { + if (sblock.fs_avgfpdir == (unsigned)svalue) { warnx("%s remains unchanged as %d", name, svalue); } else { From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 06:42:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A333106566C; Thu, 11 Feb 2010 06:42:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 591238FC0A; Thu, 11 Feb 2010 06:42:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1B6g8Gk095849; Thu, 11 Feb 2010 06:42:08 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1B6g8oi095847; Thu, 11 Feb 2010 06:42:08 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201002110642.o1B6g8oi095847@svn.freebsd.org> From: Kirk McKusick Date: Thu, 11 Feb 2010 06:42: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: r203770 - head/sbin/growfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 06:42:08 -0000 Author: mckusick Date: Thu Feb 11 06:42:08 2010 New Revision: 203770 URL: http://svn.freebsd.org/changeset/base/203770 Log: Quiet spurious warnings. Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Thu Feb 11 06:33:35 2010 (r203769) +++ head/sbin/growfs/growfs.c Thu Feb 11 06:42:08 2010 (r203770) @@ -174,10 +174,9 @@ static void growfs(int fsi, int fso, unsigned int Nflag) { DBG_FUNC("growfs") - int i; - int cylno, j; time_t utime; - int width; + uint cylno; + int i, j, width; char tmpbuf[100]; #ifdef FSIRAND static int randinit=0; @@ -373,10 +372,11 @@ initcg(int cylno, time_t utime, int fso, { DBG_FUNC("initcg") static void *iobuf; - long d, dlower, dupper, blkno, start; + long blkno, start; ufs2_daddr_t i, cbase, dmax; struct ufs1_dinode *dp1; struct csum *cs; + uint d, dupper, dlower; if (iobuf == NULL && (iobuf = malloc(sblock.fs_bsize)) == NULL) { errx(37, "panic: cannot allocate I/O buffer"); @@ -436,7 +436,7 @@ initcg(int cylno, time_t utime, int fso, acg.cg_nextfreeoff = acg.cg_clusteroff + howmany(fragstoblks(&sblock, sblock.fs_fpg), CHAR_BIT); } - if (acg.cg_nextfreeoff > sblock.fs_cgsize) { + if (acg.cg_nextfreeoff > (unsigned)sblock.fs_cgsize) { /* * This should never happen as we would have had that panic * already on file system creation @@ -751,7 +751,7 @@ updjcg(int cylno, time_t utime, int fsi, * needed, update the free space in the superblock. */ acg.cg_time = utime; - if (cylno == sblock.fs_ncg - 1) { + if ((unsigned)cylno == sblock.fs_ncg - 1) { /* * This is still the last cylinder group. */ @@ -945,8 +945,8 @@ updcsloc(time_t utime, int fsi, int fso, int ocscg, ncscg; int blocks; ufs2_daddr_t cbase, dupper, odupper, d, f, g; - int ind; - int cylno, inc; + int ind, inc; + uint cylno; struct gfs_bpp *bp; int i, l; int lcs=0; From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 06:47:11 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FAC0106566C; Thu, 11 Feb 2010 06:47:11 +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 24D598FC0C; Thu, 11 Feb 2010 06:47:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o1B6gFSi022339; Wed, 10 Feb 2010 23:42:15 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 10 Feb 2010 23:42:19 -0700 (MST) Message-Id: <20100210.234219.926703890659143628.imp@bsdimp.com> To: nork@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20100211152603.388bf80d.nork@FreeBSD.org> References: <201002110445.o1B4j8Lc070154@svn.freebsd.org> <20100211152603.388bf80d.nork@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.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: r203767 - head/lib/libufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 06:47:11 -0000 In message: <20100211152603.388bf80d.nork@FreeBSD.org> Norikatsu Shigemura writes: : Hi Warner-san. : : On Thu, 11 Feb 2010 04:45:08 +0000 (UTC) : Warner Losh wrote: : > Author: imp : > Date: Thu Feb 11 04:45:08 2010 : > New Revision: 203767 : > URL: http://svn.freebsd.org/changeset/base/203767 : > Log: : > Increased warnings weren't tested on ARM. Bump warnings back down to : > 0 until it can be properly tested by those raising the warnings. : > Remember: make universe is required when changing the WARNS level. : : I found same issues on following: : /usr/src/sbin/newfs : /usr/src/sbin/tunefs : /usr/src/sbin/growfs : : May I fix this OK? I think that Kirk is fixing these. Warner From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 07:09:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2CEF1065676; Thu, 11 Feb 2010 07:09: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 D1EF18FC0C; Thu, 11 Feb 2010 07:09:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1B794p2001982; Thu, 11 Feb 2010 07:09:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1B7940i001980; Thu, 11 Feb 2010 07:09:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002110709.o1B7940i001980@svn.freebsd.org> From: Warner Losh Date: Thu, 11 Feb 2010 07:09: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: r203772 - head/lib/libufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 07:09:05 -0000 Author: imp Date: Thu Feb 11 07:09:04 2010 New Revision: 203772 URL: http://svn.freebsd.org/changeset/base/203772 Log: Back to WARNS=3. The breakage wasn't what I thought it was :( Modified: head/lib/libufs/Makefile Modified: head/lib/libufs/Makefile ============================================================================== --- head/lib/libufs/Makefile Thu Feb 11 07:00:21 2010 (r203771) +++ head/lib/libufs/Makefile Thu Feb 11 07:09:04 2010 (r203772) @@ -16,7 +16,7 @@ MLINKS+= ufs_disk_close.3 ufs_disk_fillo MLINKS+= ufs_disk_close.3 ufs_disk_fillout_blank.3 MLINKS+= ufs_disk_close.3 ufs_disk_write.3 -WARNS?= 0 +WARNS?= 3 CFLAGS+= -D_LIBUFS .if defined(LIBUFS_DEBUG) From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 08:24:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BC94106566B; Thu, 11 Feb 2010 08:24:36 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE5B58FC0A; Thu, 11 Feb 2010 08:24:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1B8OZcG018580; Thu, 11 Feb 2010 08:24:35 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1B8OZbo018578; Thu, 11 Feb 2010 08:24:35 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201002110824.o1B8OZbo018578@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Thu, 11 Feb 2010 08:24: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: r203773 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 08:24:36 -0000 Author: wkoszek Date: Thu Feb 11 08:24:35 2010 New Revision: 203773 URL: http://svn.freebsd.org/changeset/base/203773 Log: Within libusb 0.1 API, bus number is always faked to 0. Device numbers, however, are possitive and seem to be reverse sorted in the list. Conform device numbering and bring a result that is consistent with the libusb 0.1 API. It is now possible to distinguish a device based on its (bus, dev) numbers. There shouldn't be any negative change in behavior after this commit. Tested with: scanimage (sane) http://freebsd.czest.pl/~wkoszek/qemu/l.c Reviewed by: hps@ Modified: head/lib/libusb/libusb20_compat01.c Modified: head/lib/libusb/libusb20_compat01.c ============================================================================== --- head/lib/libusb/libusb20_compat01.c Thu Feb 11 07:09:04 2010 (r203772) +++ head/lib/libusb/libusb20_compat01.c Thu Feb 11 08:24:35 2010 (r203773) @@ -829,6 +829,7 @@ usb_find_devices(void) struct libusb20_device *pdev; struct usb_device *udev; struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; + int devnum; int err; /* cleanup after last device search */ @@ -855,6 +856,7 @@ usb_find_devices(void) } /* iterate all devices */ + devnum = 1; pdev = NULL; while ((pdev = libusb20_be_device_foreach(usb_backend, pdev))) { udev = malloc(sizeof(*udev)); @@ -891,6 +893,7 @@ usb_find_devices(void) /* truncate number of configurations */ udev->descriptor.bNumConfigurations = USB_MAXCONFIG; } + udev->devnum = devnum++; /* link together the two structures */ udev->dev = pdev; pdev->privLuData = udev; From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 08:30:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78E45106566C; Thu, 11 Feb 2010 08:30:43 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 674F08FC0C; Thu, 11 Feb 2010 08:30:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1B8UhYq019948; Thu, 11 Feb 2010 08:30:43 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1B8UhIL019946; Thu, 11 Feb 2010 08:30:43 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201002110830.o1B8UhIL019946@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Thu, 11 Feb 2010 08:30: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: r203774 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 08:30:43 -0000 Author: wkoszek Date: Thu Feb 11 08:30:43 2010 New Revision: 203774 URL: http://svn.freebsd.org/changeset/base/203774 Log: Use more standard way for setting nonblocking flag for a filedescriptor. This makes libusb porting a bit easier. There shouldn't by any negative change in behaviour after this commit. Remove redundant headers. Reviewed by: hps@ Modified: head/lib/libusb/libusb10.c Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Thu Feb 11 08:24:35 2010 (r203773) +++ head/lib/libusb/libusb10.c Thu Feb 11 08:30:43 2010 (r203774) @@ -25,17 +25,16 @@ * SUCH DAMAGE. */ +#include #include #include #include #include #include -#include #include #include -#include +#include #include -#include #include "libusb20.h" #include "libusb20_desc.h" @@ -73,6 +72,7 @@ libusb_init(libusb_context **context) { struct libusb_context *ctx; char *debug; + int flag; int ret; ctx = malloc(sizeof(*ctx)); @@ -103,10 +103,12 @@ libusb_init(libusb_context **context) return (LIBUSB_ERROR_OTHER); } /* set non-blocking mode on the control pipe to avoid deadlock */ - ret = 1; - ioctl(ctx->ctrl_pipe[0], FIONBIO, &ret); - ret = 1; - ioctl(ctx->ctrl_pipe[1], FIONBIO, &ret); + flag = 1; + ret = fcntl(ctx->ctrl_pipe[0], O_NONBLOCK, &flag); + assert(ret != -1 && "Couldn't set O_NONBLOCK for ctx->ctrl_pipe[0]"); + flag = 1; + ret = fcntl(ctx->ctrl_pipe[1], O_NONBLOCK, &flag); + assert(ret != -1 && "Couldn't set O_NONBLOCK for ctx->ctrl_pipe[1]"); libusb10_add_pollfd(ctx, &ctx->ctx_poll, NULL, ctx->ctrl_pipe[0], POLLIN); From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 08:34:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86B6E106566B; Thu, 11 Feb 2010 08:34:41 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B6648FC14; Thu, 11 Feb 2010 08:34:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1B8Yf2g020844; Thu, 11 Feb 2010 08:34:41 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1B8YfQh020837; Thu, 11 Feb 2010 08:34:41 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201002110834.o1B8YfQh020837@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Thu, 11 Feb 2010 08:34: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: r203775 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 08:34:41 -0000 Author: wkoszek Date: Thu Feb 11 08:34:41 2010 New Revision: 203775 URL: http://svn.freebsd.org/changeset/base/203775 Log: Remove redundand headers and use more standard ones where necessary. Reviewed by: hps@ Modified: head/lib/libusb/libusb.h head/lib/libusb/libusb10_desc.c head/lib/libusb/libusb10_io.c head/lib/libusb/libusb20_desc.c head/lib/libusb/libusb20_ugen20.c head/lib/libusb/usb.h Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Thu Feb 11 08:30:43 2010 (r203774) +++ head/lib/libusb/libusb.h Thu Feb 11 08:34:41 2010 (r203775) @@ -29,12 +29,7 @@ #include #include -#include -#include -#include -#include -#include #ifdef __cplusplus Modified: head/lib/libusb/libusb10_desc.c ============================================================================== --- head/lib/libusb/libusb10_desc.c Thu Feb 11 08:30:43 2010 (r203774) +++ head/lib/libusb/libusb10_desc.c Thu Feb 11 08:34:41 2010 (r203775) @@ -26,7 +26,6 @@ #include #include -#include #include #include "libusb20.h" Modified: head/lib/libusb/libusb10_io.c ============================================================================== --- head/lib/libusb/libusb10_io.c Thu Feb 11 08:30:43 2010 (r203774) +++ head/lib/libusb/libusb10_io.c Thu Feb 11 08:34:41 2010 (r203775) @@ -32,7 +32,6 @@ #include #include #include -#include #include "libusb20.h" #include "libusb20_desc.h" Modified: head/lib/libusb/libusb20_desc.c ============================================================================== --- head/lib/libusb/libusb20_desc.c Thu Feb 11 08:30:43 2010 (r203774) +++ head/lib/libusb/libusb20_desc.c Thu Feb 11 08:34:41 2010 (r203775) @@ -27,7 +27,6 @@ #include #include #include -#include #include #include "libusb20.h" Modified: head/lib/libusb/libusb20_ugen20.c ============================================================================== --- head/lib/libusb/libusb20_ugen20.c Thu Feb 11 08:30:43 2010 (r203774) +++ head/lib/libusb/libusb20_ugen20.c Thu Feb 11 08:34:41 2010 (r203775) @@ -31,7 +31,6 @@ #include #include #include -#include #include #include Modified: head/lib/libusb/usb.h ============================================================================== --- head/lib/libusb/usb.h Thu Feb 11 08:30:43 2010 (r203774) +++ head/lib/libusb/usb.h Thu Feb 11 08:34:41 2010 (r203775) @@ -27,8 +27,7 @@ #ifndef _LIBUSB20_COMPAT_01_H_ #define _LIBUSB20_COMPAT_01_H_ -#include -#include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 08:50:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86279106566B; Thu, 11 Feb 2010 08:50:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 749438FC15; Thu, 11 Feb 2010 08:50:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1B8oL2G024284; Thu, 11 Feb 2010 08:50:21 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1B8oLeQ024281; Thu, 11 Feb 2010 08:50:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201002110850.o1B8oLeQ024281@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Feb 2010 08:50: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: r203776 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 08:50:21 -0000 Author: avg Date: Thu Feb 11 08:50:21 2010 New Revision: 203776 URL: http://svn.freebsd.org/changeset/base/203776 Log: acpi cpu: probe+attach before all other enumerated children on acpi bus Some current systems dynamically load SSDT(s) when _PDC/_OSC method of Processor is evaluated. Other devices in ACPI namespace may access objects defined in the dynamic SSDT. Drivers for such devices might have to have a rather high priority, because of other dependencies. Good example is acpi_ec driver for EC. Thus we attach to Processors as early as possible to load the SSDTs before any other drivers may try to evaluate control methods. It also seems to be a natural order for a processor in a device hierarchy. On the other hand, some child devices on acpi cpu bus need to access other system resources like PCI configuration space of chipset devices, so they need to be probed and attached rather late. For this reason we probe and attach the cpu bus at SI_SUB_CONFIGURE:SI_ORDER_MIDDLE SYSINIT level. In the future this could be done more elegantly via multipass. Please note that acpi drivers that might access ACPI namespace from device_identify will do that before _PDC/_OSC of Processors are evaluated. Legacy cpu driver is not affected by this change. PR: kern/142561 (in part) Reviewed by: jhb Silence from: acpi@ MFC after: 5 weeks Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Thu Feb 11 08:34:41 2010 (r203775) +++ head/sys/dev/acpica/acpi.c Thu Feb 11 08:50:21 2010 (r203776) @@ -1685,14 +1685,14 @@ acpi_probe_order(ACPI_HANDLE handle, int * 100000. CPUs */ AcpiGetType(handle, &type); - if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02")) + if (type == ACPI_TYPE_PROCESSOR) *order = 1; - else if (acpi_MatchHid(handle, "PNP0C09")) + else if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02")) *order = 2; - else if (acpi_MatchHid(handle, "PNP0C0F")) + else if (acpi_MatchHid(handle, "PNP0C09")) *order = 3; - else if (type == ACPI_TYPE_PROCESSOR) - *order = 100000; + else if (acpi_MatchHid(handle, "PNP0C0F")) + *order = 4; } /* Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Thu Feb 11 08:34:41 2010 (r203775) +++ head/sys/dev/acpica/acpi_cpu.c Thu Feb 11 08:50:21 2010 (r203776) @@ -384,13 +384,31 @@ acpi_cpu_attach(device_t dev) /* Probe for Cx state support. */ acpi_cpu_cx_probe(sc); - /* Finally, call identify and probe/attach for child devices. */ - bus_generic_probe(dev); - bus_generic_attach(dev); - return (0); } +static void +acpi_cpu_postattach(void *unused __unused) +{ + device_t *devices; + int err; + int i, n; + + err = devclass_get_devices(acpi_cpu_devclass, &devices, &n); + if (err != 0) { + printf("devclass_get_devices(acpi_cpu_devclass) failed\n"); + return; + } + for (i = 0; i < n; i++) + bus_generic_probe(devices[i]); + for (i = 0; i < n; i++) + bus_generic_attach(devices[i]); + free(devices, M_TEMP); +} + +SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, + acpi_cpu_postattach, NULL); + /* * Disable any entry to the idle function during suspend and re-enable it * during resume. From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 11:18:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 431F51065672; Thu, 11 Feb 2010 11:18:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A383C8FC0C; Thu, 11 Feb 2010 11:18:00 +0000 (UTC) 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 o1BBHsDP057991 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Feb 2010 13:17:54 +0200 (EET) (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 o1BBHsI8052895; Thu, 11 Feb 2010 13:17:54 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o1BBHsCg052894; Thu, 11 Feb 2010 13:17:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 11 Feb 2010 13:17:54 +0200 From: Kostik Belousov To: Marcel Moolenaar Message-ID: <20100211111754.GZ9991@deviant.kiev.zoral.com.ua> References: <201002090552.o195qZcD074581@svn.freebsd.org> <20100209095722.GQ9991@deviant.kiev.zoral.com.ua> <65DCE552-7EFD-48F2-85A4-EA0F1F0638EE@mac.com> <20100209184043.GV9991@deviant.kiev.zoral.com.ua> <896B58E6-12EA-48AB-86C2-5BA9F0C59512@mac.com> <86989446-64EF-411F-8E25-173DB6AEE10B@mac.com> <20100210091522.GW9991@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GXk5ufetu984H6pr" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 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 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 11:18:02 -0000 --GXk5ufetu984H6pr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 10, 2010 at 08:20:37PM -0800, Marcel Moolenaar wrote: >=20 > On Feb 10, 2010, at 1:15 AM, Kostik Belousov wrote: > >=20 > > Vnode locks are before vm map locks in global lock order. vn_fullpath() > > may need to lock vnodes to call VOP_VPTOCNP(). I think you should (and > > can) drop both vm map lock and vmspace reference much earlier. > >=20 > > Would it be cleaner to use explicitely sized types for compat32 > > structure members ? >=20 > I don't know. I prefer to keep them identical for as much as > that's possible. >=20 > > Comparing ptrace_vm_entry with kinfo_vmentry, I think that it might > > be good idea to add fsid and inode number to ptrace_vm_entry, to > > give at least some information when vn_fullpath failed. >=20 > How about the attached new path (includes man page as well)? >=20 Looks good to me. --GXk5ufetu984H6pr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktz52IACgkQC3+MBN1Mb4hUSgCgkJIIx61PSQafWrU7KsZ6tVqz BAQAn3bOAhoCD9lsFtrke+tBdPibkbek =pxMv -----END PGP SIGNATURE----- --GXk5ufetu984H6pr-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 14:45:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECEA9106568B; Thu, 11 Feb 2010 14:45:00 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB37C8FC16; Thu, 11 Feb 2010 14:45:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BEj0gN003763; Thu, 11 Feb 2010 14:45:00 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BEj0s3003762; Thu, 11 Feb 2010 14:45:00 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <201002111445.o1BEj0s3003762@svn.freebsd.org> From: Tom Rhodes Date: Thu, 11 Feb 2010 14:45: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: r203778 - head/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 14:45:01 -0000 Author: trhodes Date: Thu Feb 11 14:45:00 2010 New Revision: 203778 URL: http://svn.freebsd.org/changeset/base/203778 Log: Correct two typoes. Submitted by: Matthew Seaman Modified: head/lib/libc/posix1e/mac.3 Modified: head/lib/libc/posix1e/mac.3 ============================================================================== --- head/lib/libc/posix1e/mac.3 Thu Feb 11 09:55:45 2010 (r203777) +++ head/lib/libc/posix1e/mac.3 Thu Feb 11 14:45:00 2010 (r203778) @@ -155,7 +155,7 @@ system objects, but without policy-speci These APIs are loosely based on the APIs described in POSIX.1e, as described in IEEE POSIX.1e draft 17. However, the resemblence of these APIS to the POSIX APIs is loose, as the -PSOXI APIS were unable to express some notinos required for flexible and +POSIX APIS were unable to express some notions required for flexible and extensible access control. .Sh HISTORY Support for Mandatory Access Control was introduced in From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 15:34:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C3941065670; Thu, 11 Feb 2010 15:34:54 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BDB48FC13; Thu, 11 Feb 2010 15:34:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BFYsnR014809; Thu, 11 Feb 2010 15:34:54 GMT (envelope-from nork@svn.freebsd.org) Received: (from nork@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BFYsBB014807; Thu, 11 Feb 2010 15:34:54 GMT (envelope-from nork@svn.freebsd.org) Message-Id: <201002111534.o1BFYsBB014807@svn.freebsd.org> From: Norikatsu Shigemura Date: Thu, 11 Feb 2010 15:34: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: r203780 - head/share/zoneinfo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 15:34:54 -0000 Author: nork Date: Thu Feb 11 15:34:54 2010 New Revision: 203780 URL: http://svn.freebsd.org/changeset/base/203780 Log: Fix a installation issue with $DESTDIR. Approved by: imp (mentor) Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Thu Feb 11 15:03:56 2010 (r203779) +++ head/share/zoneinfo/Makefile Thu Feb 11 15:34:54 2010 (r203780) @@ -68,7 +68,7 @@ afterinstall: optC="-C ${DESTDIR}"; \ fi; \ echo "Updating /etc/localtime"; \ - tzsetup ${optC} -r; \ + tzsetup $${optC} -r; \ fi; \ else \ echo "Run tzsetup(8) manually to update /etc/localtime."; \ From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 17:30:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99FC01065676; Thu, 11 Feb 2010 17:30:30 +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 6FEBF8FC08; Thu, 11 Feb 2010 17:30:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BHUUd3040180; Thu, 11 Feb 2010 17:30:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BHUUG5040178; Thu, 11 Feb 2010 17:30:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002111730.o1BHUUG5040178@svn.freebsd.org> From: Warner Losh Date: Thu, 11 Feb 2010 17:30: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: r203782 - head/lib/libufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 17:30:30 -0000 Author: imp Date: Thu Feb 11 17:30:30 2010 New Revision: 203782 URL: http://svn.freebsd.org/changeset/base/203782 Log: i doesn't need to be signed here, make it unsigned. Modified: head/lib/libufs/sblock.c Modified: head/lib/libufs/sblock.c ============================================================================== --- head/lib/libufs/sblock.c Thu Feb 11 15:36:39 2010 (r203781) +++ head/lib/libufs/sblock.c Thu Feb 11 17:30:30 2010 (r203782) @@ -93,7 +93,7 @@ int sbwrite(struct uufsd *disk, int all) { struct fs *fs; - int i; + unsigned i; ERROR(disk, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 18:00:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BE641065672; Thu, 11 Feb 2010 18:00:54 +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 398618FC15; Thu, 11 Feb 2010 18:00:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BI0sDn046893; Thu, 11 Feb 2010 18:00:54 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BI0s9k046889; Thu, 11 Feb 2010 18:00:54 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002111800.o1BI0s9k046889@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 11 Feb 2010 18:00: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: r203783 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 18:00:54 -0000 Author: marcel Date: Thu Feb 11 18:00:53 2010 New Revision: 203783 URL: http://svn.freebsd.org/changeset/base/203783 Log: o Add support for COMPAT_IA32. o Incorporate review comments: - Properly reference and lock the map - Take into account that the VM map can change inbetween requests - Add the fileid and fsid attributes Credits: kib@ Reviewed by: kib@ Modified: head/lib/libc/sys/ptrace.2 head/sys/kern/sys_process.c head/sys/sys/ptrace.h Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Thu Feb 11 17:30:30 2010 (r203782) +++ head/lib/libc/sys/ptrace.2 Thu Feb 11 18:00:53 2010 (r203783) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd February 8, 2010 +.Dd February 11, 2010 .Dt PTRACE 2 .Os .Sh NAME @@ -343,23 +343,30 @@ argument specifies a pointer to a which is defined as follows: .Bd -literal struct ptrace_vm_entry { - void *pve_cookie; - u_long pve_start; - u_long pve_end; - u_long pve_offset; - u_int pve_prot; - u_int pve_pathlen; - char *pve_path; + int pve_entry; + int pve_timestamp; + u_long pve_start; + u_long pve_end; + u_long pve_offset; + u_int pve_prot; + u_int pve_pathlen; + long pve_fileid; + uint32_t pve_fsid; + char *pve_path; }; .Ed .Pp The first entry is returned by setting -.Va pve_cookie -to -.Dv NULL . +.Va pve_entry +to zero. Subsequent entries are returned by leaving -.Va pve_cookie +.Va pve_entry unmodified from the value returned by previous requests. +The +.Va pve_timestamp +field can be used to detect changes to the VM map while iterating over the +entries. +The tracing process can then take appropriate action, such as restarting. By setting .Va pve_pathlen to a non-zero value on entry, the pathname of the backing object is returned @@ -434,7 +441,8 @@ was attempted on a process with no valid .It .Dv PT_VM_ENTRY was given an invalid value for -.Fa pve_cookie . +.Fa pve_entry . +This can also be caused by changes to the VM map of the process. .El .It Bq Er EBUSY .Bl -bullet -compact Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Feb 11 17:30:30 2010 (r203782) +++ head/sys/kern/sys_process.c Thu Feb 11 18:00:53 2010 (r203783) @@ -75,12 +75,15 @@ struct ptrace_io_desc32 { }; struct ptrace_vm_entry32 { - uint32_t pve_cookie; + int pve_entry; + int pve_timestamp; uint32_t pve_start; uint32_t pve_end; uint32_t pve_offset; u_int pve_prot; u_int pve_pathlen; + int32_t pve_fileid; + u_int pve_fsid; uint32_t pve_path; }; @@ -360,88 +363,141 @@ proc_rwmem(struct proc *p, struct uio *u static int ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) { + struct vattr vattr; vm_map_t map; vm_map_entry_t entry; vm_object_t obj, tobj, lobj; + struct vmspace *vm; struct vnode *vp; char *freepath, *fullpath; u_int pathlen; - int error, vfslocked; + int error, index, vfslocked; - map = &p->p_vmspace->vm_map; - entry = map->header.next; - if (pve->pve_cookie != NULL) { - while (entry != &map->header && entry != pve->pve_cookie) + error = 0; + obj = NULL; + + vm = vmspace_acquire_ref(p); + map = &vm->vm_map; + vm_map_lock_read(map); + + do { + entry = map->header.next; + index = 0; + while (index < pve->pve_entry && entry != &map->header) { entry = entry->next; - if (entry != pve->pve_cookie) - return (EINVAL); - entry = entry->next; - } - while (entry != &map->header && (entry->eflags & MAP_ENTRY_IS_SUB_MAP)) - entry = entry->next; - if (entry == &map->header) - return (ENOENT); - - /* We got an entry. */ - pve->pve_cookie = entry; - pve->pve_start = entry->start; - pve->pve_end = entry->end - 1; - pve->pve_offset = entry->offset; - pve->pve_prot = entry->protection; - - /* Backing object's path needed? */ - if (pve->pve_pathlen == 0) - return (0); - - pathlen = pve->pve_pathlen; - pve->pve_pathlen = 0; - - obj = entry->object.vm_object; - if (obj == NULL) - return (0); - - VM_OBJECT_LOCK(obj); - for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { - if (tobj != obj) - VM_OBJECT_LOCK(tobj); - if (lobj != obj) - VM_OBJECT_UNLOCK(lobj); - lobj = tobj; - pve->pve_offset += tobj->backing_object_offset; - } - if (lobj != NULL) { + index++; + } + if (index != pve->pve_entry) { + error = EINVAL; + break; + } + while (entry != &map->header && + (entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { + entry = entry->next; + index++; + } + if (entry == &map->header) { + error = ENOENT; + break; + } + + /* We got an entry. */ + pve->pve_entry = index + 1; + pve->pve_timestamp = map->timestamp; + pve->pve_start = entry->start; + pve->pve_end = entry->end - 1; + pve->pve_offset = entry->offset; + pve->pve_prot = entry->protection; + + /* Backing object's path needed? */ + if (pve->pve_pathlen == 0) + break; + + pathlen = pve->pve_pathlen; + pve->pve_pathlen = 0; + + obj = entry->object.vm_object; + if (obj != NULL) + VM_OBJECT_LOCK(obj); + } while (0); + + vm_map_unlock_read(map); + vmspace_free(vm); + + if (error == 0 && obj != NULL) { + lobj = obj; + for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { + if (tobj != obj) + VM_OBJECT_LOCK(tobj); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + lobj = tobj; + pve->pve_offset += tobj->backing_object_offset; + } vp = (lobj->type == OBJT_VNODE) ? lobj->handle : NULL; if (vp != NULL) vref(vp); if (lobj != obj) VM_OBJECT_UNLOCK(lobj); VM_OBJECT_UNLOCK(obj); - } else - vp = NULL; - if (vp == NULL) - return (0); + if (vp != NULL) { + freepath = NULL; + fullpath = NULL; + vn_fullpath(td, vp, &fullpath, &freepath); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_lock(vp, LK_SHARED | LK_RETRY); + if (VOP_GETATTR(vp, &vattr, td->td_ucred) == 0) { + pve->pve_fileid = vattr.va_fileid; + pve->pve_fsid = vattr.va_fsid; + } + vput(vp); + VFS_UNLOCK_GIANT(vfslocked); - freepath = NULL; - fullpath = NULL; - vn_fullpath(td, vp, &fullpath, &freepath); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); + if (fullpath != NULL) { + pve->pve_pathlen = strlen(fullpath) + 1; + if (pve->pve_pathlen <= pathlen) { + error = copyout(fullpath, pve->pve_path, + pve->pve_pathlen); + } else + error = ENAMETOOLONG; + } + if (freepath != NULL) + free(freepath, M_TEMP); + } + } - error = 0; - if (fullpath != NULL) { - pve->pve_pathlen = strlen(fullpath) + 1; - if (pve->pve_pathlen <= pathlen) { - error = copyout(fullpath, pve->pve_path, - pve->pve_pathlen); - } else - error = ENAMETOOLONG; + return (error); +} + +#ifdef COMPAT_IA32 +static int +ptrace_vm_entry32(struct thread *td, struct proc *p, + struct ptrace_vm_entry32 *pve32) +{ + struct ptrace_vm_entry pve; + int error; + + pve.pve_entry = pve32->pve_entry; + pve.pve_pathlen = pve32->pve_pathlen; + pve.pve_path = (void *)(uintptr_t)pve32->pve_path; + + error = ptrace_vm_entry(td, p, &pve); + if (error == 0) { + pve32->pve_entry = pve.pve_entry; + pve32->pve_timestamp = pve.pve_timestamp; + pve32->pve_start = pve.pve_start; + pve32->pve_end = pve.pve_end; + pve32->pve_offset = pve.pve_offset; + pve32->pve_prot = pve.pve_prot; + pve32->pve_fileid = pve.pve_fileid; + pve32->pve_fsid = pve.pve_fsid; } - if (freepath != NULL) - free(freepath, M_TEMP); + + pve32->pve_pathlen = pve.pve_pathlen; return (error); } +#endif /* COMPAT_IA32 */ /* * Process debugging system call. @@ -1087,14 +1143,12 @@ kern_ptrace(struct thread *td, int req, break; case PT_VM_ENTRY: + PROC_UNLOCK(p); #ifdef COMPAT_IA32 - /* XXX to be implemented. */ - if (wrap32) { - error = EDOOFUS; - break; - } + if (wrap32) + error = ptrace_vm_entry32(td, p, addr); + else #endif - PROC_UNLOCK(p); error = ptrace_vm_entry(td, p, addr); PROC_LOCK(p); break; Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Thu Feb 11 17:30:30 2010 (r203782) +++ head/sys/sys/ptrace.h Thu Feb 11 18:00:53 2010 (r203783) @@ -104,13 +104,16 @@ struct ptrace_lwpinfo { /* Argument structure for PT_VM_ENTRY. */ struct ptrace_vm_entry { - void *pve_cookie; /* Token used to iterate. */ - u_long pve_start; /* Start VA of range. */ - u_long pve_end; /* End VA of range (incl). */ - u_long pve_offset; /* Offset in backing object. */ - u_int pve_prot; /* Protection of memory range. */ - u_int pve_pathlen; /* Size of path. */ - char *pve_path; /* Path name of object. */ + int pve_entry; /* Entry number used for iteration. */ + int pve_timestamp; /* Generation number of VM map. */ + u_long pve_start; /* Start VA of range. */ + u_long pve_end; /* End VA of range (incl). */ + u_long pve_offset; /* Offset in backing object. */ + u_int pve_prot; /* Protection of memory range. */ + u_int pve_pathlen; /* Size of path. */ + long pve_fileid; /* File ID. */ + uint32_t pve_fsid; /* File system ID. */ + char *pve_path; /* Path name of object. */ }; #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 18:14:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E916106566C; Thu, 11 Feb 2010 18:14:54 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1F48FC16; Thu, 11 Feb 2010 18:14:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BIEsI4049974; Thu, 11 Feb 2010 18:14:54 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BIEsiR049971; Thu, 11 Feb 2010 18:14:54 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201002111814.o1BIEsiR049971@svn.freebsd.org> From: Kirk McKusick Date: Thu, 11 Feb 2010 18:14: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: r203784 - in head: sbin/newfs sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 18:14:54 -0000 Author: mckusick Date: Thu Feb 11 18:14:53 2010 New Revision: 203784 URL: http://svn.freebsd.org/changeset/base/203784 Log: One last pass to get all the unsigned comparisons correct. Modified: head/sbin/newfs/mkfs.c head/sys/ufs/ffs/fs.h Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Thu Feb 11 18:00:53 2010 (r203783) +++ head/sbin/newfs/mkfs.c Thu Feb 11 18:14:53 2010 (r203784) @@ -114,7 +114,8 @@ void mkfs(struct partition *pp, char *fsys) { int fragsperinode, optimalfpg, origdensity, minfpg, lastminfpg; - long i, j, cylno, csfrags; + long i, j, csfrags; + uint cg; time_t utime; quad_t sizepb; int width; @@ -510,9 +511,9 @@ restart: fsdummy.fs_magic = 0; bwrite(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize, chdummy, SBLOCKSIZE); - for (i = 0; i < fsdummy.fs_ncg; i++) + for (cg = 0; cg < fsdummy.fs_ncg; cg++) bwrite(&disk, part_ofs + fsbtodb(&fsdummy, - cgsblock(&fsdummy, i)), chdummy, SBLOCKSIZE); + cgsblock(&fsdummy, cg)), chdummy, SBLOCKSIZE); } } if (!Nflag) @@ -550,11 +551,11 @@ restart: * writing out in each cylinder group. */ bcopy((char *)&sblock, iobuf, SBLOCKSIZE); - for (cylno = 0; cylno < sblock.fs_ncg; cylno++) { - initcg(cylno, utime); + for (cg = 0; cg < sblock.fs_ncg; cg++) { + initcg(cg, utime); j = snprintf(tmpbuf, sizeof(tmpbuf), " %jd%s", - (intmax_t)fsbtodb(&sblock, cgsblock(&sblock, cylno)), - cylno < (sblock.fs_ncg-1) ? "," : ""); + (intmax_t)fsbtodb(&sblock, cgsblock(&sblock, cg)), + cg < (sblock.fs_ncg-1) ? "," : ""); if (j < 0) tmpbuf[j = 0] = '\0'; if (i + j >= width) { @@ -608,7 +609,8 @@ restart: void initcg(int cylno, time_t utime) { - long i, j, d, dlower, dupper, blkno, start; + long blkno, start; + uint i, j, d, dlower, dupper; ufs2_daddr_t cbase, dmax; struct ufs1_dinode *dp1; struct ufs2_dinode *dp2; @@ -665,7 +667,7 @@ initcg(int cylno, time_t utime) acg.cg_nextfreeoff = acg.cg_clusteroff + howmany(fragstoblks(&sblock, sblock.fs_fpg), CHAR_BIT); } - if (acg.cg_nextfreeoff > sblock.fs_cgsize) { + if (acg.cg_nextfreeoff > (unsigned)sblock.fs_cgsize) { printf("Panic: cylinder group too big\n"); exit(37); } @@ -914,7 +916,8 @@ makedir(struct direct *protodir, int ent ufs2_daddr_t alloc(int size, int mode) { - int i, d, blkno, frag; + int i, blkno, frag; + uint d; bread(&disk, part_ofs + fsbtodb(&sblock, cgtod(&sblock, 0)), (char *)&acg, sblock.fs_cgsize); Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Thu Feb 11 18:00:53 2010 (r203783) +++ head/sys/ufs/ffs/fs.h Thu Feb 11 18:14:53 2010 (r203784) @@ -287,7 +287,7 @@ struct fs { int32_t fs_spare1[2]; /* old fs_csmask */ /* old fs_csshift */ int32_t fs_nindir; /* value of NINDIR */ - int32_t fs_inopb; /* value of INOPB */ + u_int32_t fs_inopb; /* value of INOPB */ int32_t fs_old_nspf; /* value of NSPF */ /* yet another configuration parameter */ int32_t fs_optim; /* optimization preference, see below */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 18:24:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29F33106566C; Thu, 11 Feb 2010 18:24:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 192088FC16; Thu, 11 Feb 2010 18:24:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BIO0wp052043; Thu, 11 Feb 2010 18:24:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BIO058052040; Thu, 11 Feb 2010 18:24:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201002111824.o1BIO058052040@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Feb 2010 18:24: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: r203785 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 18:24:01 -0000 Author: avg Date: Thu Feb 11 18:24:00 2010 New Revision: 203785 URL: http://svn.freebsd.org/changeset/base/203785 Log: acpi: drop the second bus_generic_attach pass It is belived that that pass s not needed anymore. Specifically it is not required now for the reasons that were given in the removed comment. Discussed with: jhb MFC after: 4 weeks Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Thu Feb 11 18:14:53 2010 (r203784) +++ head/sys/dev/acpica/acpi.c Thu Feb 11 18:24:00 2010 (r203785) @@ -1653,14 +1653,7 @@ acpi_probe_children(device_t bus) bus_generic_probe(bus); /* Probe/attach all children, created staticly and from the namespace. */ - ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "first bus_generic_attach\n")); - bus_generic_attach(bus); - - /* - * Some of these children may have attached others as part of their attach - * process (eg. the root PCI bus driver), so rescan. - */ - ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "second bus_generic_attach\n")); + ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "acpi bus_generic_attach\n")); bus_generic_attach(bus); /* Attach wake sysctls. */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 18:34:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 875601065676; Thu, 11 Feb 2010 18:34:08 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 713558FC08; Thu, 11 Feb 2010 18:34:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BIY8SC054327; Thu, 11 Feb 2010 18:34:08 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BIY71Y054300; Thu, 11 Feb 2010 18:34:07 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002111834.o1BIY71Y054300@svn.freebsd.org> From: Matt Jacob Date: Thu, 11 Feb 2010 18:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203786 - in stable/8/sys: cam/scsi compat/linux dev/aac dev/agp dev/amd dev/amr dev/arcmsr dev/ata dev/ata/chipsets dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5416... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 18:34:08 -0000 Author: mjacob Date: Thu Feb 11 18:34:06 2010 New Revision: 203786 URL: http://svn.freebsd.org/changeset/base/203786 Log: MFC a number of changes from head for ISP (203478,203463,203444,202418,201758, 201408,201325,200089,198822,197373,197372,197214,196162). Since one of those changes was a semicolon cleanup from somebody else, this touches a lot more. Deleted: stable/8/sys/dev/isp/isp_tpublic.h Modified: stable/8/sys/cam/scsi/scsi_ses.c stable/8/sys/cam/scsi/scsi_targ_bh.c stable/8/sys/compat/linux/linux_futex.c stable/8/sys/dev/aac/aac.c stable/8/sys/dev/agp/agp.c stable/8/sys/dev/amd/amd.c stable/8/sys/dev/amr/amr.c stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/ata/ata-raid.c stable/8/sys/dev/ata/chipsets/ata-ahci.c stable/8/sys/dev/ata/chipsets/ata-siliconimage.c stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c stable/8/sys/dev/bktr/bktr_i2c.c stable/8/sys/dev/cs/if_cs.c stable/8/sys/dev/cxgb/cxgb_sge.c stable/8/sys/dev/de/if_de.c stable/8/sys/dev/e1000/if_em.c stable/8/sys/dev/fatm/if_fatm.c stable/8/sys/dev/firewire/sbp.c stable/8/sys/dev/hatm/if_hatm.c stable/8/sys/dev/hptmv/entry.c stable/8/sys/dev/if_ndis/if_ndis_usb.c stable/8/sys/dev/iscsi/initiator/isc_sm.c stable/8/sys/dev/isp/isp.c stable/8/sys/dev/isp/isp_freebsd.c stable/8/sys/dev/isp/isp_freebsd.h stable/8/sys/dev/isp/isp_library.c stable/8/sys/dev/isp/isp_library.h stable/8/sys/dev/isp/isp_pci.c stable/8/sys/dev/isp/isp_sbus.c stable/8/sys/dev/isp/isp_stds.h stable/8/sys/dev/isp/ispmbox.h stable/8/sys/dev/isp/ispvar.h stable/8/sys/dev/ixgbe/ixgbe.c stable/8/sys/dev/malo/if_malo.c stable/8/sys/dev/mge/if_mge.c stable/8/sys/dev/mxge/if_mxge.c stable/8/sys/dev/patm/if_patm_intr.c stable/8/sys/dev/pdq/if_fea.c stable/8/sys/dev/safe/safe.c stable/8/sys/dev/sound/pci/maestro3.c stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/trm/trm.c stable/8/sys/dev/usb/controller/musb_otg.c stable/8/sys/dev/usb/storage/umass.c stable/8/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c stable/8/sys/isa/pnp.c stable/8/sys/kern/kern_fail.c stable/8/sys/kern/subr_firmware.c stable/8/sys/mips/adm5120/if_admsw.c stable/8/sys/mips/mips/elf_machdep.c stable/8/sys/net/flowtable.c stable/8/sys/net80211/ieee80211_node.c stable/8/sys/netinet/libalias/alias_db.c stable/8/sys/netinet/libalias/alias_mod.c stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctputil.c stable/8/sys/nfsclient/bootp_subr.c stable/8/sys/pci/ncr.c stable/8/sys/powerpc/aim/mmu_oea.c stable/8/sys/powerpc/aim/mmu_oea64.c stable/8/sys/powerpc/booke/pmap.c stable/8/sys/rpc/clnt_dg.c stable/8/sys/ufs/ffs/ffs_snapshot.c stable/8/sys/xen/xenbus/xenbus_probe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_ses.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_ses.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/cam/scsi/scsi_ses.c Thu Feb 11 18:34:06 2010 (r203786) @@ -1555,7 +1555,7 @@ ses_encode(char *b, int amt, uint8_t *ep */ static int safte_getconfig(ses_softc_t *); -static int safte_rdstat(ses_softc_t *, int);; +static int safte_rdstat(ses_softc_t *, int); static int set_objstat_sel(ses_softc_t *, ses_objstat *, int); static int wrbuf16(ses_softc_t *, uint8_t, uint8_t, uint8_t, uint8_t, int); static void wrslot_stat(ses_softc_t *, int); @@ -2257,7 +2257,7 @@ safte_rdstat(ses_softc_t *ssc, int slpfl ssc->ses_objmap[oid].encstat[0] = SES_OBJSTAT_NOTAVAIL; ssc->ses_objmap[oid].encstat[1] = 0; ssc->ses_objmap[oid].encstat[2] = sdata[r]; - ssc->ses_objmap[oid].encstat[3] = 0;; + ssc->ses_objmap[oid].encstat[3] = 0; ssc->ses_objmap[oid++].svalid = 1; r++; } Modified: stable/8/sys/cam/scsi/scsi_targ_bh.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_targ_bh.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/cam/scsi/scsi_targ_bh.c Thu Feb 11 18:34:06 2010 (r203786) @@ -429,7 +429,7 @@ targbhdtor(struct cam_periph *periph) switch (softc->init_level) { case 0: - panic("targdtor - impossible init level");; + panic("targdtor - impossible init level"); case 1: /* FALLTHROUGH */ default: Modified: stable/8/sys/compat/linux/linux_futex.c ============================================================================== --- stable/8/sys/compat/linux/linux_futex.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/compat/linux/linux_futex.c Thu Feb 11 18:34:06 2010 (r203786) @@ -493,7 +493,7 @@ linux_sys_futex(struct thread *td, struc return (error); if (f == NULL) { td->td_retval[0] = 0; - return (error);; + return (error); } td->td_retval[0] = futex_wake(f, args->val); futex_put(f, NULL); Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/aac/aac.c Thu Feb 11 18:34:06 2010 (r203786) @@ -553,7 +553,7 @@ aac_alloc(struct aac_softc *sc) 0, /* flags */ NULL, NULL, /* No locking needed */ &sc->aac_fib_dmat)) { - device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n");; + device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n"); return (ENOMEM); } Modified: stable/8/sys/dev/agp/agp.c ============================================================================== --- stable/8/sys/dev/agp/agp.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/agp/agp.c Thu Feb 11 18:34:06 2010 (r203786) @@ -763,7 +763,7 @@ agp_allocate_user(device_t dev, agp_allo static int agp_deallocate_user(device_t dev, int id) { - struct agp_memory *mem = agp_find_memory(dev, id);; + struct agp_memory *mem = agp_find_memory(dev, id); if (mem) { AGP_FREE_MEMORY(dev, mem); Modified: stable/8/sys/dev/amd/amd.c ============================================================================== --- stable/8/sys/dev/amd/amd.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/amd/amd.c Thu Feb 11 18:34:06 2010 (r203786) @@ -1657,7 +1657,7 @@ amdhandlemsgreject(struct amd_softc *amd tinfo_sync_period[pDCB->SyncPeriod - 4]; pDCB->tinfo.goal.offset = pDCB->SyncOffset; pDCB->tinfo.current.period = - tinfo_sync_period[pDCB->SyncPeriod - 4];; + tinfo_sync_period[pDCB->SyncPeriod - 4]; pDCB->tinfo.current.offset = pDCB->SyncOffset; /* Modified: stable/8/sys/dev/amr/amr.c ============================================================================== --- stable/8/sys/dev/amr/amr.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/amr/amr.c Thu Feb 11 18:34:06 2010 (r203786) @@ -221,7 +221,7 @@ amr_attach(struct amr_softc *sc) sc->amr_submit_command = amr_std_submit_command; sc->amr_get_work = amr_std_get_work; sc->amr_poll_command = amr_std_poll_command; - amr_std_attach_mailbox(sc);; + amr_std_attach_mailbox(sc); } #ifdef AMR_BOARD_INIT Modified: stable/8/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/arcmsr/arcmsr.c Thu Feb 11 18:34:06 2010 (r203786) @@ -1940,7 +1940,7 @@ static void arcmsr_handle_virtual_comman switch (pccb->csio.cdb_io.cdb_bytes[0]) { case INQUIRY: { unsigned char inqdata[36]; - char *buffer=pccb->csio.data_ptr;; + char *buffer=pccb->csio.data_ptr; if (pccb->ccb_h.target_lun) { pccb->ccb_h.status |= CAM_SEL_TIMEOUT; Modified: stable/8/sys/dev/ata/ata-raid.c ============================================================================== --- stable/8/sys/dev/ata/ata-raid.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ata/ata-raid.c Thu Feb 11 18:34:06 2010 (r203786) @@ -407,7 +407,7 @@ ata_raid_strategy(struct bio *bp) if (rdp->status & AR_S_REBUILDING) blk = ((lba / rdp->interleave) * rdp->width) * rdp->interleave + (rdp->interleave * (drv % rdp->width)) + - lba % rdp->interleave;; + lba % rdp->interleave; if (bp->bio_cmd == BIO_READ) { int src_online = Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ahci.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ata/chipsets/ata-ahci.c Thu Feb 11 18:34:06 2010 (r203786) @@ -656,9 +656,9 @@ ata_ahci_pm_write(device_t dev, int port ctp->cfis[3] = reg; ctp->cfis[7] = port | ATA_D_LBA; ctp->cfis[12] = value & 0xff; - ctp->cfis[4] = (value >> 8) & 0xff;; - ctp->cfis[5] = (value >> 16) & 0xff;; - ctp->cfis[6] = (value >> 24) & 0xff;; + ctp->cfis[4] = (value >> 8) & 0xff; + ctp->cfis[5] = (value >> 16) & 0xff; + ctp->cfis[6] = (value >> 24) & 0xff; ctp->cfis[15] = ATA_A_4BIT; if (ata_ahci_issue_cmd(dev, 0, 100)) { Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Thu Feb 11 18:34:06 2010 (r203786) @@ -716,9 +716,9 @@ ata_siiprb_pm_write(device_t dev, int po prb->fis[3] = reg; prb->fis[7] = port; prb->fis[12] = value & 0xff; - prb->fis[4] = (value >> 8) & 0xff;; - prb->fis[5] = (value >> 16) & 0xff;; - prb->fis[6] = (value >> 24) & 0xff;; + prb->fis[4] = (value >> 8) & 0xff; + prb->fis[5] = (value >> 16) & 0xff; + prb->fis[6] = (value >> 24) & 0xff; if (ata_siiprb_issue_cmd(dev)) { device_printf(dev, "error writing PM port\n"); return ATA_E_ABORT; Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Thu Feb 11 18:34:06 2010 (r203786) @@ -136,7 +136,7 @@ static void ar5211GetLowerUpperPcdacs(ui uint16_t channel, const PCDACS_EEPROM *pSrcStruct, uint16_t *pLowerPcdac, uint16_t *pUpperPcdac); -static void ar5211SetRfgain(struct ath_hal *, const GAIN_VALUES *);; +static void ar5211SetRfgain(struct ath_hal *, const GAIN_VALUES *); static void ar5211RequestRfgain(struct ath_hal *); static HAL_BOOL ar5211InvalidGainReadback(struct ath_hal *, GAIN_VALUES *); static HAL_BOOL ar5211IsGainAdjustNeeded(struct ath_hal *, const GAIN_VALUES *); Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c Thu Feb 11 18:34:06 2010 (r203786) @@ -76,7 +76,7 @@ ar5212GetPendingInterrupts(struct ath_ha isr = OS_REG_READ(ah, AR_ISR_RAC); if (isr == 0xffffffff) { *masked = 0; - return AH_FALSE;; + return AH_FALSE; } *masked = isr & HAL_INT_COMMON; Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Feb 11 18:34:06 2010 (r203786) @@ -104,7 +104,7 @@ ar5416GetPendingInterrupts(struct ath_ha isr = OS_REG_READ(ah, AR_ISR_RAC); if (isr == 0xffffffff) { *masked = 0; - return AH_FALSE;; + return AH_FALSE; } *masked = isr & HAL_INT_COMMON; Modified: stable/8/sys/dev/bktr/bktr_i2c.c ============================================================================== --- stable/8/sys/dev/bktr/bktr_i2c.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/bktr/bktr_i2c.c Thu Feb 11 18:34:06 2010 (r203786) @@ -331,7 +331,7 @@ bti2c_smb_readb(device_t dev, u_char sla /* clear status bits */ OUTL(sc,BKTR_INT_STAT, (BT848_INT_RACK | BT848_INT_I2CDONE)); - OUTL(sc,BKTR_I2C_DATA_CTL, ((slave & 0xff) << 24) | (u_char)cmd);; + OUTL(sc,BKTR_I2C_DATA_CTL, ((slave & 0xff) << 24) | (u_char)cmd); BTI2C_DEBUG(printf("r%lx/", (u_long)(((slave & 0xff) << 24) | (u_char)cmd))); Modified: stable/8/sys/dev/cs/if_cs.c ============================================================================== --- stable/8/sys/dev/cs/if_cs.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/cs/if_cs.c Thu Feb 11 18:34:06 2010 (r203786) @@ -475,7 +475,7 @@ int cs_attach(device_t dev) { int error, media=0; - struct cs_softc *sc = device_get_softc(dev);; + struct cs_softc *sc = device_get_softc(dev); struct ifnet *ifp; sc->dev = dev; Modified: stable/8/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_sge.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/cxgb/cxgb_sge.c Thu Feb 11 18:34:06 2010 (r203786) @@ -152,7 +152,7 @@ struct rx_desc { uint32_t len_gen; uint32_t gen2; uint32_t addr_hi; -} __packed;; +} __packed; struct rsp_desc { /* response queue descriptor */ struct rss_header rss_hdr; Modified: stable/8/sys/dev/de/if_de.c ============================================================================== --- stable/8/sys/dev/de/if_de.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/de/if_de.c Thu Feb 11 18:34:06 2010 (r203786) @@ -2289,7 +2289,7 @@ tulip_identify_asante_nic(tulip_softc_t mi->mi_gpr_length = 0; mi->mi_gpr_offset = 0; mi->mi_reset_length = 0; - mi->mi_reset_offset = 0;; + mi->mi_reset_offset = 0; mi->mi_phyaddr = TULIP_MII_NOPHY; for (idx = 20; idx > 0 && mi->mi_phyaddr == TULIP_MII_NOPHY; idx--) { Modified: stable/8/sys/dev/e1000/if_em.c ============================================================================== --- stable/8/sys/dev/e1000/if_em.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/e1000/if_em.c Thu Feb 11 18:34:06 2010 (r203786) @@ -4446,7 +4446,7 @@ em_free_receive_structures(struct adapte static int em_rxeof(struct adapter *adapter, int count) { - struct ifnet *ifp = adapter->ifp;; + struct ifnet *ifp = adapter->ifp; struct mbuf *mp; u8 status, accept_frame = 0, eop = 0; u16 len, desc_len, prev_len_adj; Modified: stable/8/sys/dev/fatm/if_fatm.c ============================================================================== --- stable/8/sys/dev/fatm/if_fatm.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/fatm/if_fatm.c Thu Feb 11 18:34:06 2010 (r203786) @@ -860,7 +860,7 @@ fatm_getprom(struct fatm_softc *sc) NEXT_QUEUE_ENTRY(sc->cmdqueue.head, FATM_CMD_QLEN); q->error = 0; - q->cb = NULL;; + q->cb = NULL; H_SETSTAT(q->q.statp, FATM_STAT_PENDING); H_SYNCSTAT_PREWRITE(sc, q->q.statp); Modified: stable/8/sys/dev/firewire/sbp.c ============================================================================== --- stable/8/sys/dev/firewire/sbp.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/firewire/sbp.c Thu Feb 11 18:34:06 2010 (r203786) @@ -1573,7 +1573,7 @@ END_DEBUG bcopy(&sbp_cmd_status->s_keydep[0], &sense->sense_key_spec[0], 3); - ocb->ccb->csio.scsi_status = sbp_cmd_status->status;; + ocb->ccb->csio.scsi_status = sbp_cmd_status->status; ocb->ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; /* @@ -2148,7 +2148,7 @@ sbp_free_target(struct sbp_target *targe } STAILQ_INIT(&target->xferlist); free(target->luns, M_SBP); - target->num_lun = 0;; + target->num_lun = 0; target->luns = NULL; target->fwdev = NULL; } @@ -2318,7 +2318,7 @@ sbp_timeout(void *arg) sbp_cam_detach_target(target); if (target->luns != NULL) free(target->luns, M_SBP); - target->num_lun = 0;; + target->num_lun = 0; target->luns = NULL; target->fwdev = NULL; #endif Modified: stable/8/sys/dev/hatm/if_hatm.c ============================================================================== --- stable/8/sys/dev/hatm/if_hatm.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/hatm/if_hatm.c Thu Feb 11 18:34:06 2010 (r203786) @@ -836,7 +836,7 @@ hatm_init_rx_buffer_pool(struct hatm_sof uint32_t lbuf_addr; /* address of current buffer */ u_int i; - row_size = sc->bytes_per_row;; + row_size = sc->bytes_per_row; row_addr = start * row_size; lbuf_size = sc->cells_per_lbuf * 48; lbufs_per_row = sc->cells_per_row / sc->cells_per_lbuf; @@ -889,7 +889,7 @@ hatm_init_tx_buffer_pool(struct hatm_sof uint32_t lbuf_addr; /* address of current buffer */ u_int i; - row_size = sc->bytes_per_row;; + row_size = sc->bytes_per_row; row_addr = start * row_size; lbuf_size = sc->cells_per_lbuf * 48; lbufs_per_row = sc->cells_per_row / sc->cells_per_lbuf; Modified: stable/8/sys/dev/hptmv/entry.c ============================================================================== --- stable/8/sys/dev/hptmv/entry.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/hptmv/entry.c Thu Feb 11 18:34:06 2010 (r203786) @@ -1341,7 +1341,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter) #endif &pAdapter->io_dma_parent /* tag */)) { - return ENXIO;; + return ENXIO; } Modified: stable/8/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis_usb.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/if_ndis/if_ndis_usb.c Thu Feb 11 18:34:06 2010 (r203786) @@ -204,7 +204,7 @@ ndisusb_detach(device_t self) { int i; struct ndis_softc *sc = device_get_softc(self); - struct ndisusb_ep *ne;; + struct ndisusb_ep *ne; sc->ndisusb_status |= NDISUSB_STATUS_DETACH; Modified: stable/8/sys/dev/iscsi/initiator/isc_sm.c ============================================================================== --- stable/8/sys/dev/iscsi/initiator/isc_sm.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/iscsi/initiator/isc_sm.c Thu Feb 11 18:34:06 2010 (r203786) @@ -399,7 +399,7 @@ ism_recv(isc_session_t *sp, pduq_t *pq) if(sp->flags & ISC_STALLED) { sdebug(4, "window opened: max=0x%x exp=0x%x opcode=0x%x cmd=0x%x cws=%d.", sn->maxCmd, sn->expCmd, bhs->opcode, sn->cmd, sp->cws); - sp->flags &= ~ISC_STALLED;; + sp->flags &= ~ISC_STALLED; } } } Modified: stable/8/sys/dev/isp/isp.c ============================================================================== --- stable/8/sys/dev/isp/isp.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/isp/isp.c Thu Feb 11 18:34:06 2010 (r203786) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); /* * General defines */ - #define MBOX_DELAY_COUNT 1000000 / 100 #define ISP_MARK_PORTDB(a, b, c) \ isp_prt(isp, ISP_LOGSANCFG, \ @@ -695,7 +694,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d mbs.logval = MBLOGALL; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, "NOP ommand failed (%x)", mbs.param[0]); + isp_prt(isp, ISP_LOGERR, "NOP command failed (%x)", mbs.param[0]); ISP_RESET0(isp); return; } @@ -1547,24 +1546,18 @@ isp_fibre_init(ispsoftc_t *isp) } icbp->icb_maxfrmlen = DEFAULT_FRAMESIZE(isp); - if (icbp->icb_maxfrmlen < ICB_MIN_FRMLEN || - icbp->icb_maxfrmlen > ICB_MAX_FRMLEN) { - isp_prt(isp, ISP_LOGERR, - "bad frame length (%d) from NVRAM- using %d", - DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN); + if (icbp->icb_maxfrmlen < ICB_MIN_FRMLEN || icbp->icb_maxfrmlen > ICB_MAX_FRMLEN) { + isp_prt(isp, ISP_LOGERR, "bad frame length (%d) from NVRAM- using %d", DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN); icbp->icb_maxfrmlen = ICB_DFLT_FRMLEN; } icbp->icb_maxalloc = fcp->isp_maxalloc; if (icbp->icb_maxalloc < 1) { - isp_prt(isp, ISP_LOGERR, - "bad maximum allocation (%d)- using 16", fcp->isp_maxalloc); + isp_prt(isp, ISP_LOGERR, "bad maximum allocation (%d)- using 16", fcp->isp_maxalloc); icbp->icb_maxalloc = 16; } icbp->icb_execthrottle = DEFAULT_EXEC_THROTTLE(isp); if (icbp->icb_execthrottle < 1) { - isp_prt(isp, ISP_LOGERR, - "bad execution throttle of %d- using %d", - DEFAULT_EXEC_THROTTLE(isp), ICB_DFLT_THROTTLE); + isp_prt(isp, ISP_LOGERR, "bad execution throttle of %d- using %d", DEFAULT_EXEC_THROTTLE(isp), ICB_DFLT_THROTTLE); icbp->icb_execthrottle = ICB_DFLT_THROTTLE; } icbp->icb_retry_delay = fcp->isp_retry_delay; @@ -1658,18 +1651,18 @@ isp_fibre_init(ispsoftc_t *isp) /* * For 22XX > 2.1.26 && 23XX, set some options. - * XXX: Probably okay for newer 2100 f/w too. */ if (ISP_FW_NEWER_THAN(isp, 2, 26, 0)) { - /* - * Turn on LIP F8 async event (1) - * Turn on generate AE 8013 on all LIP Resets (2) - * Disable LIP F7 switching (8) - */ MBSINIT(&mbs, MBOX_SET_FIRMWARE_OPTIONS, MBLOGALL, 0); - mbs.param[1] = 0xb; + mbs.param[1] = IFCOPT1_DISF7SWTCH|IFCOPT1_LIPASYNC|IFCOPT1_LIPF8; mbs.param[2] = 0; mbs.param[3] = 0; + if (ISP_FW_NEWER_THAN(isp, 3, 16, 0)) { + mbs.param[1] |= IFCOPT1_EQFQASYNC|IFCOPT1_CTIO_RETRY; + if (fcp->role & ISP_ROLE_TARGET) { + mbs.param[3] = IFCOPT3_NOPRLI; + } + } isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { return; @@ -2093,8 +2086,7 @@ isp_mark_portdb(ispsoftc_t *isp, int cha * or via FABRIC LOGIN/FABRIC LOGOUT for other cards. */ static int -isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, - int flags, int gs) +isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, int flags, int gs) { mbreg_t mbs; uint8_t q[QENTRY_LEN]; @@ -2771,21 +2763,15 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) /* * Make sure we're okay for doing this right now. */ - if (fcp->isp_loopstate != LOOP_PDB_RCVD && - fcp->isp_loopstate != LOOP_FSCAN_DONE && - fcp->isp_loopstate != LOOP_LSCAN_DONE) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", - fcp->isp_loopstate); + if (fcp->isp_loopstate != LOOP_PDB_RCVD && fcp->isp_loopstate != LOOP_FSCAN_DONE && fcp->isp_loopstate != LOOP_LSCAN_DONE) { + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", fcp->isp_loopstate); return (-1); } - if (fcp->isp_topo == TOPO_FL_PORT || - fcp->isp_topo == TOPO_NL_PORT || - fcp->isp_topo == TOPO_N_PORT) { + if (fcp->isp_topo == TOPO_FL_PORT || fcp->isp_topo == TOPO_NL_PORT || fcp->isp_topo == TOPO_N_PORT) { if (fcp->isp_loopstate < LOOP_LSCAN_DONE) { if (isp_scan_loop(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, - "isp_pdb_sync: isp_scan_loop failed"); + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_loop failed"); return (-1); } } @@ -2794,15 +2780,13 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) if (fcp->isp_topo == TOPO_F_PORT || fcp->isp_topo == TOPO_FL_PORT) { if (fcp->isp_loopstate < LOOP_FSCAN_DONE) { if (isp_scan_fabric(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, - "isp_pdb_sync: isp_scan_fabric failed"); + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_fabric failed"); return (-1); } } } - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Synchronizing PDBs", chan); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Synchronizing PDBs", chan); fcp->isp_loopstate = LOOP_SYNCING_PDB; @@ -2831,11 +2815,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) lp->state = FC_PORTDB_STATE_NIL; isp_async(isp, ISPASYNC_DEV_GONE, chan, lp); if (lp->autologin == 0) { - (void) isp_plogx(isp, chan, lp->handle, - lp->portid, - PLOGX_FLG_CMD_LOGO | - PLOGX_FLG_IMPLICIT | - PLOGX_FLG_FREE_NPHDL, 0); + (void) isp_plogx(isp, chan, lp->handle, lp->portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 0); } else { lp->autologin = 0; } @@ -3081,8 +3061,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) for (i = 0; i < MAX_FC_TARG; i++) { lp = &fcp->portdb[i]; - if (lp->state == FC_PORTDB_STATE_NIL || - lp->target_mode) { + if (lp->state == FC_PORTDB_STATE_NIL || lp->target_mode) { continue; } if (lp->node_wwn != tmp.node_wwn) { @@ -3600,8 +3579,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) { lp = &fcp->portdb[dbidx]; - if (lp->state != FC_PORTDB_STATE_PROBATIONAL || - lp->target_mode) { + if (lp->state != FC_PORTDB_STATE_PROBATIONAL || lp->target_mode) { continue; } if (lp->portid == portid) { @@ -3838,8 +3816,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha if (fcp->portdb[dbidx].target_mode) { continue; } - if (fcp->portdb[dbidx].node_wwn == wwnn && - fcp->portdb[dbidx].port_wwn == wwpn) { + if (fcp->portdb[dbidx].node_wwn == wwnn && fcp->portdb[dbidx].port_wwn == wwpn) { break; } } @@ -4425,7 +4402,7 @@ isp_start(XS_T *xs) *tptr = 0x1999; } - if (isp_save_xs(isp, xs, &handle)) { + if (isp_allocate_xs(isp, xs, &handle)) { isp_prt(isp, ISP_LOGDEBUG0, "out of xflist pointers"); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); @@ -5171,8 +5148,8 @@ again: } } - if ((sp->req_handle != ISP_SPCL_HANDLE) && (sp->req_handle > isp->isp_maxcmds || sp->req_handle < 1)) { - isp_prt(isp, ISP_LOGERR, "bad request handle %d (type 0x%x)", sp->req_handle, etype); + if (!ISP_VALID_HANDLE(isp, sp->req_handle)) { + isp_prt(isp, ISP_LOGERR, "bad request handle 0x%x (iocb type 0x%x)", sp->req_handle, etype); ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ ISP_WRITE(isp, isp->isp_respoutrp, optr); continue; @@ -5186,14 +5163,13 @@ again: */ if (etype != RQSTYPE_RESPONSE) { isp_prt(isp, ISP_LOGERR, "cannot find handle 0x%x (type 0x%x)", sp->req_handle, etype); - } else if (ts != RQCS_ABORTED && ts != RQCS_RESET_OCCURRED && sp->req_handle != ISP_SPCL_HANDLE) { + } else if (ts != RQCS_ABORTED && ts != RQCS_RESET_OCCURRED) { isp_prt(isp, ISP_LOGERR, "cannot find handle 0x%x (status 0x%x)", sp->req_handle, ts); } ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ ISP_WRITE(isp, isp->isp_respoutrp, optr); continue; } - isp_destroy_handle(isp, sp->req_handle); if (req_status_flags & RQSTF_BUS_RESET) { XS_SETERR(xs, HBA_BUSRESET); ISP_SET_SENDMARKER(isp, XS_CHANNEL(xs), 1); @@ -5329,6 +5305,7 @@ again: if (XS_XFRLEN(xs)) { ISP_DMAFREE(isp, xs, sp->req_handle); } + isp_destroy_handle(isp, sp->req_handle); if (((isp->isp_dblev & (ISP_LOGDEBUG1|ISP_LOGDEBUG2|ISP_LOGDEBUG3))) || ((isp->isp_dblev & ISP_LOGDEBUG0) && ((!XS_NOERR(xs)) || @@ -5689,16 +5666,19 @@ isp_parse_async(ispsoftc_t *isp, uint16_ * commands that complete (with no apparent error) after * we receive a LIP. This has been observed mostly on * Local Loop topologies. To be safe, let's just mark - * all active commands as dead. + * all active initiator commands as dead. */ if (topo == TOPO_NL_PORT || topo == TOPO_FL_PORT) { int i, j; for (i = j = 0; i < isp->isp_maxcmds; i++) { XS_T *xs; - xs = isp->isp_xflist[i]; - if (xs == NULL) { + isp_hdl_t *hdp; + + hdp = &isp->isp_xflist[i]; + if (ISP_H2HT(hdp->handle) != ISP_HANDLE_INITIATOR) { continue; } + xs = hdp->cmd; if (XS_CHANNEL(xs) != chan) { continue; } @@ -6666,8 +6646,8 @@ isp_mbox_continue(ispsoftc_t *isp) ptr = isp->isp_mbxworkp; switch (isp->isp_lastmbxcmd) { case MBOX_WRITE_RAM_WORD: - mbs.param[1] = isp->isp_mbxwrk1++;; - mbs.param[2] = *ptr++;; + mbs.param[1] = isp->isp_mbxwrk1++; + mbs.param[2] = *ptr++; break; case MBOX_READ_RAM_WORD: *ptr++ = isp->isp_mboxtmp[2]; @@ -6677,7 +6657,7 @@ isp_mbox_continue(ispsoftc_t *isp) offset = isp->isp_mbxwrk1; offset |= isp->isp_mbxwrk8 << 16; - mbs.param[2] = *ptr++;; + mbs.param[2] = *ptr++; mbs.param[1] = offset; mbs.param[8] = offset >> 16; isp->isp_mbxwrk1 = ++offset; @@ -8293,6 +8273,8 @@ isp_parse_nvram_2100(ispsoftc_t *isp, ui if ((wwn >> 60) == 0) { wwn |= (((uint64_t) 2)<< 60); } + } else { + wwn = fcp->isp_wwpn_nvram & ~((uint64_t) 0xfff << 48); } } else { wwn &= ~((uint64_t) 0xfff << 48); @@ -8358,11 +8340,6 @@ isp_parse_nvram_2400(ispsoftc_t *isp, ui ISP2400_NVRAM_FIRMWARE_OPTIONS3(nvram_data)); wwn = ISP2400_NVRAM_PORT_NAME(nvram_data); - if (wwn) { - if ((wwn >> 60) != 2 && (wwn >> 60) != 5) { - wwn = 0; - } - } fcp->isp_wwpn_nvram = wwn; wwn = ISP2400_NVRAM_NODE_NAME(nvram_data); @@ -8371,6 +8348,10 @@ isp_parse_nvram_2400(ispsoftc_t *isp, ui wwn = 0; } } + if (wwn == 0 && (fcp->isp_wwpn_nvram >> 60) == 2) { + wwn = fcp->isp_wwpn_nvram; + wwn &= ~((uint64_t) 0xfff << 48); + } fcp->isp_wwnn_nvram = wwn; if (ISP2400_NVRAM_EXCHANGE_COUNT(nvram_data)) { Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/isp/isp_freebsd.c Thu Feb 11 18:34:06 2010 (r203786) @@ -133,33 +133,37 @@ isp_attach_chan(ispsoftc_t *isp, struct } #endif } else { + fcparam *fcp = FCPARAM(isp, chan); struct isp_fc *fc = ISP_FC_PC(isp, chan); + ISP_LOCK(isp); fc->sim = sim; fc->path = path; fc->isp = isp; + fc->ready = 1; callout_init_mtx(&fc->ldt, &isp->isp_osinfo.lock, 0); callout_init_mtx(&fc->gdt, &isp->isp_osinfo.lock, 0); - - if (THREAD_CREATE(isp_kthread, fc, &fc->kproc, 0, 0, "%s: fc_thrd%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { - xpt_free_path(fc->path); - ISP_LOCK(isp); - xpt_bus_deregister(cam_sim_path(fc->sim)); - ISP_UNLOCK(isp); - cam_sim_free(fc->sim, FALSE); - } /* * We start by being "loop down" if we have an initiator role */ - ISP_LOCK(isp); - if ((FCPARAM(isp, chan)->role & ISP_ROLE_INITIATOR) && fc->ldt_running == 0) { + if (fcp->role & ISP_ROLE_INITIATOR) { isp_freeze_loopdown(isp, chan, "isp_attach"); - fc->ldt_running = 1; callout_reset(&fc->ldt, isp_quickboot_time * hz, isp_ldt, fc); isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Starting Initial Loop Down Timer @ %lu", (unsigned long) time_uptime); } ISP_UNLOCK(isp); + if (THREAD_CREATE(isp_kthread, fc, &fc->kproc, 0, 0, "%s: fc_thrd%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { + xpt_free_path(fc->path); + ISP_LOCK(isp); + if (callout_active(&fc->ldt)) { + callout_stop(&fc->ldt); + } + xpt_bus_deregister(cam_sim_path(fc->sim)); + ISP_UNLOCK(isp); + cam_sim_free(fc->sim, FALSE); + return (ENOMEM); + } #ifdef ISP_INTERNAL_TARGET ISP_SET_PC(isp, chan, proc_active, 1); if (THREAD_CREATE(isp_target_thread_fc, fc, &fc->target_proc, 0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { @@ -343,6 +347,17 @@ ispioctl(struct cdev *dev, u_long c, cad break; } if (IS_FC(isp)) { + /* + * We don't really support dual role at present on FC cards. + * + * We should, but a bunch of things are currently broken, + * so don't allow it. + */ + if (nr == ISP_ROLE_BOTH) { + isp_prt(isp, ISP_LOGERR, "cannot support dual role at present"); + retval = EINVAL; + break; + } *(int *)addr = FCPARAM(isp, chan)->role; #ifdef ISP_INTERNAL_TARGET ISP_LOCK(isp); @@ -1638,7 +1653,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u cto->ct_timeout = 10; } - if (isp_save_xs_tgt(isp, ccb, &handle)) { + if (isp_allocate_xs_tgt(isp, ccb, &handle)) { xpt_print(ccb->ccb_h.path, "No XFLIST pointers for %s\n", __func__); ccb->ccb_h.status = CAM_REQUEUE_REQ; goto out; @@ -2943,8 +2958,8 @@ isp_target_mark_aborted_early(ispsoftc_t #ifdef ISP_INTERNAL_TARGET // #define ISP_FORCE_TIMEOUT 1 -#define ISP_TEST_WWNS 1 -#define ISP_TEST_SEPARATE_STATUS 1 +// #define ISP_TEST_WWNS 1 +// #define ISP_TEST_SEPARATE_STATUS 1 #define ccb_data_offset ppriv_field0 #define ccb_atio ppriv_ptr1 @@ -3819,21 +3834,41 @@ isp_watchdog(void *arg) isp = XS_ISP(xs); handle = isp_find_handle(isp, xs); - if (handle) { + if (handle != ISP_HANDLE_FREE) { + /* + * Try and make sure the command is really dead before + * we release the handle (and DMA resources) for reuse. + * + * If we are successful in aborting the command then + * we're done here because we'll get the command returned + * back separately. + */ + if (isp_control(isp, ISPCTL_ABORT_CMD, xs) == 0) { + return; + } + + /* + * Note that after calling the above, the command may in + * fact have been completed. + */ + xs = isp_find_xs(isp, handle); + /* - * Make sure the command is *really* dead before we - * release the handle (and DMA resources) for reuse. + * If the command no longer exists, then we won't + * be able to find the xs again with this handle. */ - (void) isp_control(isp, ISPCTL_ABORT_CMD, xs); + if (xs == NULL) { + return; + } /* - * After this point, the comamnd is really dead. + * After this point, the command is really dead. */ if (XS_XFRLEN(xs)) { ISP_DMAFREE(isp, xs, handle); } isp_destroy_handle(isp, handle); - xpt_print(xs->ccb_h.path, "watchdog timeout for handle 0x%x\n", handle); + isp_prt(isp, ISP_LOGERR, "%s: timeout for handle 0x%x", __func__, handle); XS_SETERR(xs, CAM_CMD_TIMEOUT); isp_done(xs); } @@ -3924,12 +3959,12 @@ isp_gdt(void *arg) isp_prt(isp, ISP_LOGCONFIG, prom3, chan, lp->portid, tgt, "Gone Device Timeout"); isp_make_gone(isp, chan, tgt); } - if (more_to_do) { - fc->gdt_running = 1; - callout_reset(&fc->gdt, hz, isp_gdt, fc); - } else { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d stopping Gone Device Timer", chan); - fc->gdt_running = 0; + if (fc->ready) { + if (more_to_do) { + callout_reset(&fc->gdt, hz, isp_gdt, fc); + } else { + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d stopping Gone Device Timer", chan); + } } } @@ -4006,6 +4041,7 @@ isp_kthread(void *arg) ispsoftc_t *isp = fc->isp; int chan = fc - isp->isp_osinfo.pc.fc; int slp = 0; + mtx_lock(&isp->isp_osinfo.lock); for (;;) { @@ -4238,6 +4274,7 @@ isp_action(struct cam_sim *sim, union cc isp_disable_lun(isp, ccb); } break; + case XPT_IMMED_NOTIFY: case XPT_IMMEDIATE_NOTIFY: /* Add Immediate Notify Resource */ case XPT_ACCEPT_TARGET_IO: /* Add Accept Target IO Resource */ { @@ -4287,11 +4324,19 @@ isp_action(struct cam_sim *sim, union cc SLIST_INSERT_HEAD(&tptr->inots, &ccb->ccb_h, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "Put FREE INOT, (seq id 0x%x) count now %d\n", ((struct ccb_immediate_notify *)ccb)->seq_id, tptr->inot_count); + } else if (ccb->ccb_h.func_code == XPT_IMMED_NOTIFY) { + tptr->inot_count++; + SLIST_INSERT_HEAD(&tptr->inots, &ccb->ccb_h, sim_links.sle); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "Put FREE INOT, (seq id 0x%x) count now %d\n", + ((struct ccb_immediate_notify *)ccb)->seq_id, tptr->inot_count); } rls_lun_statep(isp, tptr); ccb->ccb_h.status = CAM_REQ_INPROG; break; } + case XPT_NOTIFY_ACK: + ccb->ccb_h.status = CAM_REQ_CMP_ERR; + break; case XPT_NOTIFY_ACKNOWLEDGE: /* notify ack */ { tstate_t *tptr; @@ -4601,10 +4646,21 @@ isp_prt(isp, ISP_LOGALL, "Setting Channe } break; case KNOB_ROLE_BOTH: +#if 0 if (fcp->role != ISP_ROLE_BOTH) { rchange = 1; newrole = ISP_ROLE_BOTH; } +#else + /* + * We don't really support dual role at present on FC cards. + * + * We should, but a bunch of things are currently broken, + * so don't allow it. + */ + isp_prt(isp, ISP_LOGERR, "cannot support dual role at present"); + ccb->ccb_h.status = CAM_REQ_INVALID; +#endif break; } if (rchange) { @@ -4771,6 +4827,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm char *msg = NULL; target_id_t tgt; fcportdb_t *lp; + struct isp_fc *fc; struct cam_path *tmppath; va_list ap; @@ -4855,7 +4912,6 @@ isp_async(ispsoftc_t *isp, ispasync_t cm /* FALLTHROUGH */ case ISPASYNC_LOOP_DOWN: { - struct isp_fc *fc; if (msg == NULL) { msg = "LOOP Down"; } @@ -4863,20 +4919,21 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); va_end(ap); - FCPARAM(isp, bus)->link_active = 1; + FCPARAM(isp, bus)->link_active = 0; fc = ISP_FC_PC(isp, bus); - /* - * We don't do any simq freezing if we are only in target mode - */ - if (fc->role & ISP_ROLE_INITIATOR) { - if (fc->path) { - isp_freeze_loopdown(isp, bus, msg); - } - if (fc->ldt_running == 0) { - fc->ldt_running = 1; - callout_reset(&fc->ldt, fc->loop_down_limit * hz, isp_ldt, fc); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "starting Loop Down Timer @ %lu", (unsigned long) time_uptime); + if (cmd == ISPASYNC_LOOP_DOWN && fc->ready) { + /* + * We don't do any simq freezing if we are only in target mode + */ + if (fc->role & ISP_ROLE_INITIATOR) { + if (fc->path) { + isp_freeze_loopdown(isp, bus, msg); + } + if (!callout_active(&fc->ldt)) { + callout_reset(&fc->ldt, fc->loop_down_limit * hz, isp_ldt, fc); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "starting Loop Down Timer @ %lu", (unsigned long) time_uptime); + } } } isp_prt(isp, ISP_LOGINFO, "Chan %d: %s", bus, msg); @@ -4886,6 +4943,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm va_start(ap, cmd); bus = va_arg(ap, int); va_end(ap); + fc = ISP_FC_PC(isp, bus); /* * Now we just note that Loop has come up. We don't * actually do anything because we're waiting for a @@ -4893,8 +4951,8 @@ isp_async(ispsoftc_t *isp, ispasync_t cm * thread to look at the state of the loop again. */ FCPARAM(isp, bus)->link_active = 1; - ISP_FC_PC(isp, bus)->loop_dead = 0; - ISP_FC_PC(isp, bus)->loop_down_time = 0; + fc->loop_dead = 0; + fc->loop_down_time = 0; isp_prt(isp, ISP_LOGINFO, "Chan %d Loop UP", bus); break; case ISPASYNC_DEV_ARRIVED: @@ -4902,8 +4960,9 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); lp = va_arg(ap, fcportdb_t *); va_end(ap); + fc = ISP_FC_PC(isp, bus); lp->reserved = 0; - if ((ISP_FC_PC(isp, bus)->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) { + if ((fc->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) { int dbidx = lp - FCPARAM(isp, bus)->portdb; int i; @@ -4936,6 +4995,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); lp = va_arg(ap, fcportdb_t *); va_end(ap); + fc = ISP_FC_PC(isp, bus); lp->reserved = 0; if (isp_change_is_bad) { lp->state = FC_PORTDB_STATE_NIL; @@ -4982,6 +5042,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); lp = va_arg(ap, fcportdb_t *); va_end(ap); + fc = ISP_FC_PC(isp, bus); /* * If this has a virtual target and we haven't marked it * that we're going to have isp_gdt tell the OS it's gone, @@ -4994,10 +5055,9 @@ isp_async(ispsoftc_t *isp, ispasync_t cm lp->reserved = 1; lp->new_reserved = ISP_FC_PC(isp, bus)->gone_device_time; lp->state = FC_PORTDB_STATE_ZOMBIE; - if (ISP_FC_PC(isp, bus)->gdt_running == 0) { + if (fc->ready && !callout_active(&fc->gdt)) { isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d starting Gone Device Timer", bus); - ISP_FC_PC(isp, bus)->gdt_running = 1; - callout_reset(&ISP_FC_PC(isp, bus)->gdt, hz, isp_gdt, ISP_FC_PC(isp, bus)); + callout_reset(&fc->gdt, hz, isp_gdt, fc); } tgt = lp->dev_map_idx - 1; isp_prt(isp, ISP_LOGCONFIG, prom2, bus, lp->portid, lp->handle, roles[lp->roles], "gone zombie at", tgt, (uint32_t) (lp->port_wwn >> 32), (uint32_t) lp->port_wwn); @@ -5022,6 +5082,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm nlstate = reason = 0; } va_end(ap); + fc = ISP_FC_PC(isp, bus); if (evt == ISPASYNC_CHANGE_PDB) { msg = "Chan %d Port Database Changed"; @@ -5034,16 +5095,15 @@ isp_async(ispsoftc_t *isp, ispasync_t cm /* * If the loop down timer is running, cancel it. */ - if (ISP_FC_PC(isp, bus)->ldt_running) { + if (fc->ready && callout_active(&fc->ldt)) { isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Stopping Loop Down Timer @ %lu", (unsigned long) time_uptime); - ISP_FC_PC(isp, bus)->ldt_running = 0; - callout_stop(&ISP_FC_PC(isp, bus)->ldt); + callout_stop(&fc->ldt); } isp_prt(isp, ISP_LOGINFO, msg, bus); - if (ISP_FC_PC(isp, bus)->role & ISP_ROLE_INITIATOR) { + if (fc->role & ISP_ROLE_INITIATOR) { isp_freeze_loopdown(isp, bus, msg); } - wakeup(ISP_FC_PC(isp, bus)); + wakeup(fc); break; } #ifdef ISP_TARGET_MODE Modified: stable/8/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.h Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/isp/isp_freebsd.h Thu Feb 11 18:34:06 2010 (r203786) @@ -177,9 +177,9 @@ struct isp_fc { hysteresis : 8, role : 2, gdt_running : 1, - ldt_running : 1, loop_dead : 1, - fcbsy : 1; + fcbsy : 1, + ready : 1; struct callout ldt; /* loop down timer */ struct callout gdt; /* gone device timer */ #ifdef ISP_TARGET_MODE Modified: stable/8/sys/dev/isp/isp_library.c ============================================================================== --- stable/8/sys/dev/isp/isp_library.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/isp/isp_library.c Thu Feb 11 18:34:06 2010 (r203786) @@ -246,65 +246,70 @@ copy_and_sync: } int -isp_save_xs(ispsoftc_t *isp, XS_T *xs, uint32_t *handlep) +isp_allocate_xs(ispsoftc_t *isp, XS_T *xs, uint32_t *handlep) { - uint16_t i, j; + isp_hdl_t *hdp; - for (j = isp->isp_lasthdls, i = 0; i < isp->isp_maxcmds; i++) { - if (isp->isp_xflist[j] == NULL) { - break; - } - if (++j == isp->isp_maxcmds) { - j = 0; - } - } - if (i == isp->isp_maxcmds) { + hdp = isp->isp_xffree; + if (hdp == NULL) { return (-1); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 19:20:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8564210656A9; Thu, 11 Feb 2010 19:20:07 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7458E8FC23; Thu, 11 Feb 2010 19:20:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BJK7Za064606; Thu, 11 Feb 2010 19:20:07 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BJK7ja064605; Thu, 11 Feb 2010 19:20:07 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <201002111920.o1BJK7ja064605@svn.freebsd.org> From: Tom Rhodes Date: Thu, 11 Feb 2010 19:20: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: r203787 - head/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 19:20:07 -0000 Author: trhodes Date: Thu Feb 11 19:20:06 2010 New Revision: 203787 URL: http://svn.freebsd.org/changeset/base/203787 Log: s/APIS/APIs - not part of the original submission. Modified: head/lib/libc/posix1e/mac.3 Modified: head/lib/libc/posix1e/mac.3 ============================================================================== --- head/lib/libc/posix1e/mac.3 Thu Feb 11 18:34:06 2010 (r203786) +++ head/lib/libc/posix1e/mac.3 Thu Feb 11 19:20:06 2010 (r203787) @@ -154,8 +154,8 @@ system objects, but without policy-speci .Sh STANDARDS These APIs are loosely based on the APIs described in POSIX.1e, as described in IEEE POSIX.1e draft 17. -However, the resemblence of these APIS to the POSIX APIs is loose, as the -POSIX APIS were unable to express some notions required for flexible and +However, the resemblence of these APIs to the POSIX APIs is loose, as the +POSIX APIs were unable to express some notions required for flexible and extensible access control. .Sh HISTORY Support for Mandatory Access Control was introduced in From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 20:05:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 252BE106566C; Thu, 11 Feb 2010 20:05:21 +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 EA8D88FC0A; Thu, 11 Feb 2010 20:05:20 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9E3C446B06; Thu, 11 Feb 2010 15:05:20 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id D07628A021; Thu, 11 Feb 2010 15:05:19 -0500 (EST) From: John Baldwin To: Andriy Gapon Date: Thu, 11 Feb 2010 15:05:12 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <201002111824.o1BIO058052040@svn.freebsd.org> In-Reply-To: <201002111824.o1BIO058052040@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201002111505.12589.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 11 Feb 2010 15:05:19 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=AWL,BAYES_00 autolearn=ham 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: r203785 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 20:05:21 -0000 On Thursday 11 February 2010 1:24:00 pm Andriy Gapon wrote: > Author: avg > Date: Thu Feb 11 18:24:00 2010 > New Revision: 203785 > URL: http://svn.freebsd.org/changeset/base/203785 > > Log: > acpi: drop the second bus_generic_attach pass > > It is belived that that pass s not needed anymore. > Specifically it is not required now for the reasons that were given > in the removed comment. > > Discussed with: jhb > MFC after: 4 weeks I suspect it was in fact never required in the version of acpi that was in the FreeBSD source tree. It may have been required at some point in the early stages of acpi development when the drivers were not yet part of the base system. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 21:10:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A81C31065670; Thu, 11 Feb 2010 21:10:56 +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 96B328FC13; Thu, 11 Feb 2010 21:10:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BLAugF089127; Thu, 11 Feb 2010 21:10:56 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BLAutg089126; Thu, 11 Feb 2010 21:10:56 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002112110.o1BLAutg089126@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 11 Feb 2010 21:10: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: r203788 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 21:10:56 -0000 Author: marcel Date: Thu Feb 11 21:10:56 2010 New Revision: 203788 URL: http://svn.freebsd.org/changeset/base/203788 Log: Initialize pve_fsid and pve_fileid to VNOVAL. Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Feb 11 19:20:06 2010 (r203787) +++ head/sys/kern/sys_process.c Thu Feb 11 21:10:56 2010 (r203788) @@ -424,6 +424,9 @@ ptrace_vm_entry(struct thread *td, struc vm_map_unlock_read(map); vmspace_free(vm); + pve->pve_fsid = VNOVAL; + pve->pve_fileid = VNOVAL; + if (error == 0 && obj != NULL) { lobj = obj; for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 21:25:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF73E106566C; Thu, 11 Feb 2010 21:25: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 CD8B58FC0C; Thu, 11 Feb 2010 21:25:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BLPm0o092473; Thu, 11 Feb 2010 21:25:48 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BLPmeF092467; Thu, 11 Feb 2010 21:25:48 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201002112125.o1BLPmeF092467@svn.freebsd.org> From: Rick Macklem Date: Thu, 11 Feb 2010 21:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203789 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 21:25:49 -0000 Author: rmacklem Date: Thu Feb 11 21:25:48 2010 New Revision: 203789 URL: http://svn.freebsd.org/changeset/base/203789 Log: MFC: r203119 Patch the experimental NFS client in a manner analogous to r203072 for the regular NFS client. Also, delete two fields of struct nfsmount that are not used by the FreeBSD port of the client. Modified: stable/8/sys/fs/nfsclient/nfs.h stable/8/sys/fs/nfsclient/nfs_clbio.c stable/8/sys/fs/nfsclient/nfs_clnfsiod.c stable/8/sys/fs/nfsclient/nfs_clsubs.c stable/8/sys/fs/nfsclient/nfsmount.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfs.h Thu Feb 11 21:10:56 2010 (r203788) +++ stable/8/sys/fs/nfsclient/nfs.h Thu Feb 11 21:25:48 2010 (r203789) @@ -56,6 +56,19 @@ (VFSTONFS((v)->v_mount)->nm_flag & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) /* + * NFS iod threads can be in one of these three states once spawned. + * NFSIOD_NOT_AVAILABLE - Cannot be assigned an I/O operation at this time. + * NFSIOD_AVAILABLE - Available to be assigned an I/O operation. + * NFSIOD_CREATED_FOR_NFS_ASYNCIO - Newly created for nfs_asyncio() and + * will be used by the thread that called nfs_asyncio(). + */ +enum nfsiod_state { + NFSIOD_NOT_AVAILABLE = 0, + NFSIOD_AVAILABLE = 1, + NFSIOD_CREATED_FOR_NFS_ASYNCIO = 2, +}; + +/* * Function prototypes. */ int ncl_meta_setsize(struct vnode *, struct ucred *, struct thread *, @@ -87,7 +100,7 @@ int ncl_fsinfo(struct nfsmount *, struct int ncl_init(struct vfsconf *); int ncl_uninit(struct vfsconf *); int ncl_mountroot(struct mount *); -int ncl_nfsiodnew(void); +int ncl_nfsiodnew(int); #endif /* _KERNEL */ Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clbio.c Thu Feb 11 21:10:56 2010 (r203788) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Thu Feb 11 21:25:48 2010 (r203789) @@ -63,7 +63,7 @@ extern int newnfs_directio_allow_mmap; extern struct nfsstats newnfsstats; extern struct mtx ncl_iod_mutex; extern int ncl_numasync; -extern struct proc *ncl_iodwant[NFS_MAXRAHEAD]; +extern enum nfsiod_state ncl_iodwant[NFS_MAXRAHEAD]; extern struct nfsmount *ncl_iodmount[NFS_MAXRAHEAD]; extern int newnfs_directio_enable; @@ -1396,7 +1396,7 @@ again: * Find a free iod to process this request. */ for (iod = 0; iod < ncl_numasync; iod++) - if (ncl_iodwant[iod]) { + if (ncl_iodwant[iod] == NFSIOD_AVAILABLE) { gotiod = TRUE; break; } @@ -1405,7 +1405,7 @@ again: * Try to create one if none are free. */ if (!gotiod) { - iod = ncl_nfsiodnew(); + iod = ncl_nfsiodnew(1); if (iod != -1) gotiod = TRUE; } @@ -1417,7 +1417,7 @@ again: */ NFS_DPF(ASYNCIO, ("ncl_asyncio: waking iod %d for mount %p\n", iod, nmp)); - ncl_iodwant[iod] = NULL; + ncl_iodwant[iod] = NFSIOD_NOT_AVAILABLE; ncl_iodmount[iod] = nmp; nmp->nm_bufqiods++; wakeup(&ncl_iodwant[iod]); Modified: stable/8/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clnfsiod.c Thu Feb 11 21:10:56 2010 (r203788) +++ stable/8/sys/fs/nfsclient/nfs_clnfsiod.c Thu Feb 11 21:25:48 2010 (r203789) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); extern struct mtx ncl_iod_mutex; int ncl_numasync; -struct proc *ncl_iodwant[NFS_MAXRAHEAD]; +enum nfsiod_state ncl_iodwant[NFS_MAXRAHEAD]; struct nfsmount *ncl_iodmount[NFS_MAXRAHEAD]; static void nfssvc_iod(void *); @@ -114,7 +114,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) * than the new minimum, create some more. */ for (i = nfs_iodmin - ncl_numasync; i > 0; i--) - ncl_nfsiodnew(); + ncl_nfsiodnew(0); out: mtx_unlock(&ncl_iod_mutex); return (0); @@ -147,7 +147,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) */ iod = ncl_numasync - 1; for (i = 0; i < ncl_numasync - ncl_iodmax; i++) { - if (ncl_iodwant[iod]) + if (ncl_iodwant[iod] == NFSIOD_AVAILABLE) wakeup(&ncl_iodwant[iod]); iod--; } @@ -159,7 +159,7 @@ SYSCTL_PROC(_vfs_newnfs, OID_AUTO, iodma sizeof (ncl_iodmax), sysctl_iodmax, "IU", ""); int -ncl_nfsiodnew(void) +ncl_nfsiodnew(int set_iodwant) { int error, i; int newiod; @@ -175,12 +175,17 @@ ncl_nfsiodnew(void) } if (newiod == -1) return (-1); + if (set_iodwant > 0) + ncl_iodwant[i] = NFSIOD_CREATED_FOR_NFS_ASYNCIO; mtx_unlock(&ncl_iod_mutex); error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID, 0, "nfsiod %d", newiod); mtx_lock(&ncl_iod_mutex); - if (error) + if (error) { + if (set_iodwant > 0) + ncl_iodwant[i] = NFSIOD_NOT_AVAILABLE; return (-1); + } ncl_numasync++; return (newiod); } @@ -199,7 +204,7 @@ nfsiod_setup(void *dummy) nfs_iodmin = NFS_MAXRAHEAD; for (i = 0; i < nfs_iodmin; i++) { - error = ncl_nfsiodnew(); + error = ncl_nfsiodnew(0); if (error == -1) panic("newnfsiod_setup: ncl_nfsiodnew failed"); } @@ -235,7 +240,8 @@ nfssvc_iod(void *instance) goto finish; if (nmp) nmp->nm_bufqiods--; - ncl_iodwant[myiod] = curthread->td_proc; + if (ncl_iodwant[myiod] == NFSIOD_NOT_AVAILABLE) + ncl_iodwant[myiod] = NFSIOD_AVAILABLE; ncl_iodmount[myiod] = NULL; /* * Always keep at least nfs_iodmin kthreads. @@ -295,7 +301,7 @@ finish: nfs_asyncdaemon[myiod] = 0; if (nmp) nmp->nm_bufqiods--; - ncl_iodwant[myiod] = NULL; + ncl_iodwant[myiod] = NFSIOD_NOT_AVAILABLE; ncl_iodmount[myiod] = NULL; /* Someone may be waiting for the last nfsiod to terminate. */ if (--ncl_numasync == 0) Modified: stable/8/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clsubs.c Thu Feb 11 21:10:56 2010 (r203788) +++ stable/8/sys/fs/nfsclient/nfs_clsubs.c Thu Feb 11 21:25:48 2010 (r203789) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #include extern struct mtx ncl_iod_mutex; -extern struct proc *ncl_iodwant[NFS_MAXRAHEAD]; +extern enum nfsiod_state ncl_iodwant[NFS_MAXRAHEAD]; extern struct nfsmount *ncl_iodmount[NFS_MAXRAHEAD]; extern int ncl_numasync; extern unsigned int ncl_iodmax; @@ -100,7 +100,7 @@ ncl_uninit(struct vfsconf *vfsp) mtx_lock(&ncl_iod_mutex); ncl_iodmax = 0; for (i = 0; i < ncl_numasync; i++) - if (ncl_iodwant[i]) + if (ncl_iodwant[i] == NFSIOD_AVAILABLE) wakeup(&ncl_iodwant[i]); /* The last nfsiod to exit will wake us up when ncl_numasync hits 0 */ while (ncl_numasync) @@ -396,7 +396,7 @@ ncl_init(struct vfsconf *vfsp) /* Ensure async daemons disabled */ for (i = 0; i < NFS_MAXRAHEAD; i++) { - ncl_iodwant[i] = NULL; + ncl_iodwant[i] = NFSIOD_NOT_AVAILABLE; ncl_iodmount[i] = NULL; } ncl_nhinit(); /* Init the nfsnode table */ Modified: stable/8/sys/fs/nfsclient/nfsmount.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfsmount.h Thu Feb 11 21:10:56 2010 (r203788) +++ stable/8/sys/fs/nfsclient/nfsmount.h Thu Feb 11 21:25:48 2010 (r203789) @@ -71,8 +71,6 @@ struct nfsmount { int nm_tprintf_delay; /* interval for messages */ /* Newnfs additions */ - int nm_iothreadcnt; - struct proc *nm_iodwant[NFS_MAXRAHEAD]; struct nfsclclient *nm_clp; uid_t nm_uid; /* Uid for SetClientID etc. */ u_int64_t nm_clval; /* identifies which clientid */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 21:45:12 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61A4F106566B; Thu, 11 Feb 2010 21:45:12 +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 195328FC1C; Thu, 11 Feb 2010 21:45:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id D28969CB08A; Thu, 11 Feb 2010 22:44:35 +0100 (CET) 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 O0nfKJmf7Ib0; Thu, 11 Feb 2010 22:44:33 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 889519CB0F7; Thu, 11 Feb 2010 22:44:33 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id o1BLiXWv057263; Thu, 11 Feb 2010 22:44:33 +0100 (CET) (envelope-from rdivacky) Date: Thu, 11 Feb 2010 22:44:33 +0100 From: Roman Divacky To: Marcel Moolenaar Message-ID: <20100211214433.GA57045@freebsd.org> References: <201002112110.o1BLAutg089126@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201002112110.o1BLAutg089126@svn.freebsd.org> 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: r203788 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 21:45:12 -0000 On Thu, Feb 11, 2010 at 09:10:56PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Thu Feb 11 21:10:56 2010 > New Revision: 203788 > URL: http://svn.freebsd.org/changeset/base/203788 > > Log: > Initialize pve_fsid and pve_fileid to VNOVAL. why? From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 22:15:33 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1C15106566B; Thu, 11 Feb 2010 22:15:33 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100]) by mx1.freebsd.org (Postfix) with ESMTP id D56D78FC14; Thu, 11 Feb 2010 22:15:33 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp025.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KXP00F6J757D690@asmtp025.mac.com>; Thu, 11 Feb 2010 14:15:19 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1002110190 From: Marcel Moolenaar In-reply-to: <20100211214433.GA57045@freebsd.org> Date: Thu, 11 Feb 2010 14:15:06 -0800 Message-id: References: <201002112110.o1BLAutg089126@svn.freebsd.org> <20100211214433.GA57045@freebsd.org> To: Roman Divacky X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Marcel Moolenaar , src-committers@FreeBSD.org Subject: Re: svn commit: r203788 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 22:15:34 -0000 On Feb 11, 2010, at 1:44 PM, Roman Divacky wrote: > On Thu, Feb 11, 2010 at 09:10:56PM +0000, Marcel Moolenaar wrote: >> Author: marcel >> Date: Thu Feb 11 21:10:56 2010 >> New Revision: 203788 >> URL: http://svn.freebsd.org/changeset/base/203788 >> >> Log: >> Initialize pve_fsid and pve_fileid to VNOVAL. > > why? It gives the tracing process a deterministic and reliably way of knowing whether the entry is backed by a vnode or not. We won't be able to guarantee that otherwise. FYI, -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 22:51:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3CD2106566C; Thu, 11 Feb 2010 22:51:44 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C15638FC0A; Thu, 11 Feb 2010 22:51:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BMpiZo011937; Thu, 11 Feb 2010 22:51:44 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BMpi58011929; Thu, 11 Feb 2010 22:51:44 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201002112251.o1BMpi58011929@svn.freebsd.org> From: Fabien Thomas Date: Thu, 11 Feb 2010 22:51: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: r203790 - head/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 22:51:45 -0000 Author: fabient Date: Thu Feb 11 22:51:44 2010 New Revision: 203790 URL: http://svn.freebsd.org/changeset/base/203790 Log: - Reorganize code in 'plugin' to share log processing. - Kcachegrind (calltree) support with assembly/source code mapping and call count estimator (-F). - Top mode for calltree and callgraph plugin (-T). MFC after: 1 month Added: head/usr.sbin/pmcstat/pmcpl_annotate.c (contents, props changed) head/usr.sbin/pmcstat/pmcpl_annotate.h (contents, props changed) head/usr.sbin/pmcstat/pmcpl_callgraph.c (contents, props changed) head/usr.sbin/pmcstat/pmcpl_callgraph.h (contents, props changed) head/usr.sbin/pmcstat/pmcpl_calltree.c (contents, props changed) head/usr.sbin/pmcstat/pmcpl_calltree.h (contents, props changed) head/usr.sbin/pmcstat/pmcpl_gprof.c (contents, props changed) head/usr.sbin/pmcstat/pmcpl_gprof.h (contents, props changed) head/usr.sbin/pmcstat/pmcstat_log.h (contents, props changed) head/usr.sbin/pmcstat/pmcstat_top.h (contents, props changed) Modified: head/usr.sbin/pmcstat/Makefile head/usr.sbin/pmcstat/pmcstat.8 head/usr.sbin/pmcstat/pmcstat.c head/usr.sbin/pmcstat/pmcstat.h head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/Makefile ============================================================================== --- head/usr.sbin/pmcstat/Makefile Thu Feb 11 21:25:48 2010 (r203789) +++ head/usr.sbin/pmcstat/Makefile Thu Feb 11 22:51:44 2010 (r203790) @@ -6,8 +6,9 @@ PROG= pmcstat MAN= pmcstat.8 DPADD= ${LIBELF} ${LIBKVM} ${LIBPMC} ${LIBM} -LDADD= -lelf -lkvm -lpmc -lm +LDADD= -lelf -lkvm -lpmc -lm -lncurses -SRCS= pmcstat.c pmcstat.h pmcstat_log.c +SRCS= pmcstat.c pmcstat.h pmcstat_log.c \ +pmcpl_callgraph.c pmcpl_gprof.c pmcpl_annotate.c pmcpl_calltree.c .include Added: head/usr.sbin/pmcstat/pmcpl_annotate.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmcstat/pmcpl_annotate.c Thu Feb 11 22:51:44 2010 (r203790) @@ -0,0 +1,111 @@ +/*- + * Copyright (c) 2005-2007, Joseph Koshy + * Copyright (c) 2007 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by A. Joseph Koshy under + * sponsorship from the FreeBSD Foundation and Google, Inc. + * + * 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. + */ + +/* + * Transform a hwpmc(4) log into human readable form, and into + * gprof(1) compatible profiles. + */ + +#include +__FBSDID("$FreeBSD$"); + +#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 + +#include "pmcstat.h" +#include "pmcstat_log.h" +#include "pmcpl_annotate.h" + +/* + * Record a callchain. + */ + +void +pmcpl_annotate_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr, + uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu) +{ + struct pmcstat_pcmap *map; + struct pmcstat_symbol *sym; + uintfptr_t newpc; + struct pmcstat_image *image; + + (void) pmcr; (void) nsamples; (void) usermode; (void) cpu; + + map = pmcstat_process_find_map(usermode ? pp : pmcstat_kernproc, cc[0]); + if (map == NULL) { + /* Unknown offset. */ + pmcstat_stats.ps_samples_unknown_offset++; + return; + } + + assert(cc[0] >= map->ppm_lowpc && cc[0] < map->ppm_highpc); + + image = map->ppm_image; + newpc = cc[0] - (map->ppm_lowpc + + (image->pi_vaddr - image->pi_start)); + sym = pmcstat_symbol_search(image, newpc); + if (sym == NULL) + return; + + fprintf(args.pa_graphfile, "%p %s 0x%jx 0x%jx\n", + (void *)cc[0], + pmcstat_string_unintern(sym->ps_name), + (uintmax_t)(sym->ps_start + + image->pi_vaddr), (uintmax_t)(sym->ps_end + + image->pi_vaddr)); +} Added: head/usr.sbin/pmcstat/pmcpl_annotate.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmcstat/pmcpl_annotate.h Thu Feb 11 22:51:44 2010 (r203790) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2005-2007, Joseph Koshy + * Copyright (c) 2007 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by A. Joseph Koshy under + * sponsorship from the FreeBSD Foundation and Google, Inc. + * + * 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$ + */ + +#ifndef _PMCSTAT_PL_ANNOTATE_H_ +#define _PMCSTAT_PL_ANNOTATE_H_ + +/* Function prototypes */ +void pmcpl_annotate_process( + struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr, + uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu); + +#endif /* _PMCSTAT_PL_ANNOTATE_H_ */ Added: head/usr.sbin/pmcstat/pmcpl_callgraph.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmcstat/pmcpl_callgraph.c Thu Feb 11 22:51:44 2010 (r203790) @@ -0,0 +1,682 @@ +/*- + * Copyright (c) 2005-2007, Joseph Koshy + * Copyright (c) 2007 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by A. Joseph Koshy under + * sponsorship from the FreeBSD Foundation and Google, Inc. + * + * 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. + */ + +/* + * Transform a hwpmc(4) log into human readable form, and into + * gprof(1) compatible profiles. + */ + +#include +__FBSDID("$FreeBSD$"); + +#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 +#include + +#include "pmcstat.h" +#include "pmcstat_log.h" +#include "pmcstat_top.h" +#include "pmcpl_callgraph.h" + +/* Get the sample value in percent related to nsamples. */ +#define PMCPL_CG_COUNTP(a) \ + ((a)->pcg_count * 100.0 / nsamples) + +/* + * The toplevel CG nodes (i.e., with rank == 0) are placed in a hash table. + */ + +struct pmcstat_cgnode_hash_list pmcstat_cgnode_hash[PMCSTAT_NHASH]; +int pmcstat_cgnode_hash_count; + +static pmcstat_interned_string pmcstat_previous_filename_printed; + +static struct pmcstat_cgnode * +pmcstat_cgnode_allocate(struct pmcstat_image *image, uintfptr_t pc) +{ + struct pmcstat_cgnode *cg; + + if ((cg = malloc(sizeof(*cg))) == NULL) + err(EX_OSERR, "ERROR: Cannot allocate callgraph node"); + + cg->pcg_image = image; + cg->pcg_func = pc; + + cg->pcg_count = 0; + cg->pcg_nchildren = 0; + LIST_INIT(&cg->pcg_children); + + return (cg); +} + +/* + * Free a node and its children. + */ +static void +pmcstat_cgnode_free(struct pmcstat_cgnode *cg) +{ + struct pmcstat_cgnode *cgc, *cgtmp; + + LIST_FOREACH_SAFE(cgc, &cg->pcg_children, pcg_sibling, cgtmp) + pmcstat_cgnode_free(cgc); + free(cg); +} + +/* + * Look for a callgraph node associated with pmc `pmcid' in the global + * hash table that corresponds to the given `pc' value in the process + * `pp'. + */ +static struct pmcstat_cgnode * +pmcstat_cgnode_hash_lookup_pc(struct pmcstat_process *pp, pmc_id_t pmcid, + uintfptr_t pc, int usermode) +{ + struct pmcstat_pcmap *ppm; + struct pmcstat_symbol *sym; + struct pmcstat_image *image; + struct pmcstat_cgnode *cg; + struct pmcstat_cgnode_hash *h; + uintfptr_t loadaddress; + unsigned int i, hash; + + ppm = pmcstat_process_find_map(usermode ? pp : pmcstat_kernproc, pc); + if (ppm == NULL) + return (NULL); + + image = ppm->ppm_image; + + loadaddress = ppm->ppm_lowpc + image->pi_vaddr - image->pi_start; + pc -= loadaddress; /* Convert to an offset in the image. */ + + /* + * Try determine the function at this offset. If we can't + * find a function round leave the `pc' value alone. + */ + if ((sym = pmcstat_symbol_search(image, pc)) != NULL) + pc = sym->ps_start; + + for (hash = i = 0; i < sizeof(uintfptr_t); i++) + hash += (pc >> i) & 0xFF; + + hash &= PMCSTAT_HASH_MASK; + + cg = NULL; + LIST_FOREACH(h, &pmcstat_cgnode_hash[hash], pch_next) + { + if (h->pch_pmcid != pmcid) + continue; + + cg = h->pch_cgnode; + + assert(cg != NULL); + + if (cg->pcg_image == image && cg->pcg_func == pc) + return (cg); + } + + /* + * We haven't seen this (pmcid, pc) tuple yet, so allocate a + * new callgraph node and a new hash table entry for it. + */ + cg = pmcstat_cgnode_allocate(image, pc); + if ((h = malloc(sizeof(*h))) == NULL) + err(EX_OSERR, "ERROR: Could not allocate callgraph node"); + + h->pch_pmcid = pmcid; + h->pch_cgnode = cg; + LIST_INSERT_HEAD(&pmcstat_cgnode_hash[hash], h, pch_next); + + pmcstat_cgnode_hash_count++; + + return (cg); +} + +/* + * Compare two callgraph nodes for sorting. + */ +static int +pmcstat_cgnode_compare(const void *a, const void *b) +{ + const struct pmcstat_cgnode *const *pcg1, *const *pcg2, *cg1, *cg2; + + pcg1 = (const struct pmcstat_cgnode *const *) a; + cg1 = *pcg1; + pcg2 = (const struct pmcstat_cgnode *const *) b; + cg2 = *pcg2; + + /* Sort in reverse order */ + if (cg1->pcg_count < cg2->pcg_count) + return (1); + if (cg1->pcg_count > cg2->pcg_count) + return (-1); + return (0); +} + +/* + * Find (allocating if a needed) a callgraph node in the given + * parent with the same (image, pcoffset) pair. + */ + +static struct pmcstat_cgnode * +pmcstat_cgnode_find(struct pmcstat_cgnode *parent, struct pmcstat_image *image, + uintfptr_t pcoffset) +{ + struct pmcstat_cgnode *child; + + LIST_FOREACH(child, &parent->pcg_children, pcg_sibling) { + if (child->pcg_image == image && + child->pcg_func == pcoffset) + return (child); + } + + /* + * Allocate a new structure. + */ + + child = pmcstat_cgnode_allocate(image, pcoffset); + + /* + * Link it into the parent. + */ + LIST_INSERT_HEAD(&parent->pcg_children, child, pcg_sibling); + parent->pcg_nchildren++; + + return (child); +} + +/* + * Print one callgraph node. The output format is: + * + * indentation %(parent's samples) #nsamples function@object + */ +static void +pmcstat_cgnode_print(struct pmcstat_cgnode *cg, int depth, uint32_t total) +{ + uint32_t n; + const char *space; + struct pmcstat_symbol *sym; + struct pmcstat_cgnode **sortbuffer, **cgn, *pcg; + + space = " "; + + if (depth > 0) + (void) fprintf(args.pa_graphfile, "%*s", depth, space); + + if (cg->pcg_count == total) + (void) fprintf(args.pa_graphfile, "100.0%% "); + else + (void) fprintf(args.pa_graphfile, "%05.2f%% ", + 100.0 * cg->pcg_count / total); + + n = fprintf(args.pa_graphfile, " [%u] ", cg->pcg_count); + + /* #samples is a 12 character wide field. */ + if (n < 12) + (void) fprintf(args.pa_graphfile, "%*s", 12 - n, space); + + if (depth > 0) + (void) fprintf(args.pa_graphfile, "%*s", depth, space); + + sym = pmcstat_symbol_search(cg->pcg_image, cg->pcg_func); + if (sym) + (void) fprintf(args.pa_graphfile, "%s", + pmcstat_string_unintern(sym->ps_name)); + else + (void) fprintf(args.pa_graphfile, "%p", + (void *) (cg->pcg_image->pi_vaddr + cg->pcg_func)); + + if (pmcstat_previous_filename_printed != + cg->pcg_image->pi_fullpath) { + pmcstat_previous_filename_printed = cg->pcg_image->pi_fullpath; + (void) fprintf(args.pa_graphfile, " @ %s\n", + pmcstat_string_unintern( + pmcstat_previous_filename_printed)); + } else + (void) fprintf(args.pa_graphfile, "\n"); + + if (cg->pcg_nchildren == 0) + return; + + if ((sortbuffer = (struct pmcstat_cgnode **) + malloc(sizeof(struct pmcstat_cgnode *) * + cg->pcg_nchildren)) == NULL) + err(EX_OSERR, "ERROR: Cannot print callgraph"); + cgn = sortbuffer; + + LIST_FOREACH(pcg, &cg->pcg_children, pcg_sibling) + *cgn++ = pcg; + + assert(cgn - sortbuffer == (int) cg->pcg_nchildren); + + qsort(sortbuffer, cg->pcg_nchildren, sizeof(struct pmcstat_cgnode *), + pmcstat_cgnode_compare); + + for (cgn = sortbuffer, n = 0; n < cg->pcg_nchildren; n++, cgn++) + pmcstat_cgnode_print(*cgn, depth+1, cg->pcg_count); + + free(sortbuffer); +} + +/* + * Record a callchain. + */ + +void +pmcpl_cg_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr, + uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu) +{ + uintfptr_t pc, loadaddress; + uint32_t n; + struct pmcstat_image *image; + struct pmcstat_pcmap *ppm; + struct pmcstat_symbol *sym; + struct pmcstat_cgnode *parent, *child; + struct pmcstat_process *km; + pmc_id_t pmcid; + + (void) cpu; + + /* + * Find the callgraph node recorded in the global hash table + * for this (pmcid, pc). + */ + + pc = cc[0]; + pmcid = pmcr->pr_pmcid; + parent = pmcstat_cgnode_hash_lookup_pc(pp, pmcid, pc, usermode); + if (parent == NULL) { + pmcstat_stats.ps_callchain_dubious_frames++; + return; + } + + parent->pcg_count++; + + /* + * For each return address in the call chain record, subject + * to the maximum depth desired. + * - Find the image associated with the sample. Stop if there + * there is no valid image at that address. + * - Find the function that overlaps the return address. + * - If found: use the start address of the function. + * If not found (say an object's symbol table is not present or + * is incomplete), round down to th gprof bucket granularity. + * - Convert return virtual address to an offset in the image. + * - Look for a child with the same {offset,image} tuple, + * inserting one if needed. + * - Increment the count of occurrences of the child. + */ + km = pmcstat_kernproc; + + for (n = 1; n < (uint32_t) args.pa_graphdepth && n < nsamples; n++, + parent = child) { + pc = cc[n]; + + ppm = pmcstat_process_find_map(usermode ? pp : km, pc); + if (ppm == NULL) { + /* Detect full frame capture (kernel + user). */ + if (!usermode) { + ppm = pmcstat_process_find_map(pp, pc); + if (ppm != NULL) + km = pp; + } + } + if (ppm == NULL) + return; + + image = ppm->ppm_image; + loadaddress = ppm->ppm_lowpc + image->pi_vaddr - + image->pi_start; + pc -= loadaddress; + + if ((sym = pmcstat_symbol_search(image, pc)) != NULL) + pc = sym->ps_start; + + child = pmcstat_cgnode_find(parent, image, pc); + child->pcg_count++; + } +} + +/* + * Printing a callgraph for a PMC. + */ +static void +pmcstat_callgraph_print_for_pmcid(struct pmcstat_pmcrecord *pmcr) +{ + int n, nentries; + uint32_t nsamples; + pmc_id_t pmcid; + struct pmcstat_cgnode **sortbuffer, **cgn; + struct pmcstat_cgnode_hash *pch; + + /* + * We pull out all callgraph nodes in the top-level hash table + * with a matching PMC id. We then sort these based on the + * frequency of occurrence. Each callgraph node is then + * printed. + */ + + nsamples = 0; + pmcid = pmcr->pr_pmcid; + if ((sortbuffer = (struct pmcstat_cgnode **) + malloc(sizeof(struct pmcstat_cgnode *) * + pmcstat_cgnode_hash_count)) == NULL) + err(EX_OSERR, "ERROR: Cannot sort callgraph"); + cgn = sortbuffer; + + for (n = 0; n < PMCSTAT_NHASH; n++) + LIST_FOREACH(pch, &pmcstat_cgnode_hash[n], pch_next) + if (pch->pch_pmcid == pmcid) { + nsamples += pch->pch_cgnode->pcg_count; + *cgn++ = pch->pch_cgnode; + } + + nentries = cgn - sortbuffer; + assert(nentries <= pmcstat_cgnode_hash_count); + + if (nentries == 0) { + free(sortbuffer); + return; + } + + qsort(sortbuffer, nentries, sizeof(struct pmcstat_cgnode *), + pmcstat_cgnode_compare); + + (void) fprintf(args.pa_graphfile, + "@ %s [%u samples]\n\n", + pmcstat_string_unintern(pmcr->pr_pmcname), + nsamples); + + for (cgn = sortbuffer, n = 0; n < nentries; n++, cgn++) { + pmcstat_previous_filename_printed = NULL; + pmcstat_cgnode_print(*cgn, 0, nsamples); + (void) fprintf(args.pa_graphfile, "\n"); + } + + free(sortbuffer); +} + +/* + * Print out callgraphs. + */ + +static void +pmcstat_callgraph_print(void) +{ + struct pmcstat_pmcrecord *pmcr; + + LIST_FOREACH(pmcr, &pmcstat_pmcs, pr_next) + pmcstat_callgraph_print_for_pmcid(pmcr); +} + +static void +pmcstat_cgnode_topprint(struct pmcstat_cgnode *cg, + int depth, uint32_t nsamples) +{ + int v_attrs, vs_len, ns_len, width, len, n, nchildren; + float v; + char ns[30], vs[10]; + struct pmcstat_symbol *sym; + struct pmcstat_cgnode **sortbuffer, **cgn, *pcg; + + (void) depth; + + /* Format value. */ + v = PMCPL_CG_COUNTP(cg); + snprintf(vs, sizeof(vs), "%.1f", v); + v_attrs = PMCSTAT_ATTRPERCENT(v); + + /* Format name. */ + sym = pmcstat_symbol_search(cg->pcg_image, cg->pcg_func); + if (sym != NULL) { + snprintf(ns, sizeof(ns), "%s", + pmcstat_string_unintern(sym->ps_name)); + } else + snprintf(ns, sizeof(ns), "%p", + (void *)cg->pcg_func); + + PMCSTAT_ATTRON(v_attrs); + PMCSTAT_PRINTW("%5.5s", vs); + PMCSTAT_ATTROFF(v_attrs); + PMCSTAT_PRINTW(" %-10.10s %-20.20s", + pmcstat_string_unintern(cg->pcg_image->pi_name), + ns); + + nchildren = cg->pcg_nchildren; + if (nchildren == 0) { + PMCSTAT_PRINTW("\n"); + return; + } + + width = pmcstat_displaywidth - 40; + + if ((sortbuffer = (struct pmcstat_cgnode **) + malloc(sizeof(struct pmcstat_cgnode *) * + nchildren)) == NULL) + err(EX_OSERR, "ERROR: Cannot print callgraph"); + cgn = sortbuffer; + + LIST_FOREACH(pcg, &cg->pcg_children, pcg_sibling) + *cgn++ = pcg; + + assert(cgn - sortbuffer == (int)nchildren); + + qsort(sortbuffer, nchildren, sizeof(struct pmcstat_cgnode *), + pmcstat_cgnode_compare); + + /* Count how many callers. */ + for (cgn = sortbuffer, n = 0; n < nchildren; n++, cgn++) { + pcg = *cgn; + + v = PMCPL_CG_COUNTP(pcg); + if (v < pmcstat_threshold) + break; + } + nchildren = n; + + for (cgn = sortbuffer, n = 0; n < nchildren; n++, cgn++) { + pcg = *cgn; + + /* Format value. */ + if (nchildren > 1) { + v = PMCPL_CG_COUNTP(pcg); + vs_len = snprintf(vs, sizeof(vs), ":%.1f", v); + v_attrs = PMCSTAT_ATTRPERCENT(v); + } else + vs_len = 0; + + /* Format name. */ + sym = pmcstat_symbol_search(pcg->pcg_image, pcg->pcg_func); + if (sym != NULL) { + ns_len = snprintf(ns, sizeof(ns), "%s", + pmcstat_string_unintern(sym->ps_name)); + } else + ns_len = snprintf(ns, sizeof(ns), "%p", + (void *)pcg->pcg_func); + + len = ns_len + vs_len + 1; + if (width - len < 0) { + PMCSTAT_PRINTW("..."); + break; + } + width -= len; + + PMCSTAT_PRINTW(" %s", ns); + if (nchildren > 1) { + PMCSTAT_ATTRON(v_attrs); + PMCSTAT_PRINTW("%s", vs); + PMCSTAT_ATTROFF(v_attrs); + } + } + PMCSTAT_PRINTW("\n"); + free(sortbuffer); +} + +/* + * Top mode display. + */ + +void +pmcpl_cg_topdisplay(void) +{ + int n, nentries; + uint32_t nsamples; + struct pmcstat_cgnode **sortbuffer, **cgn; + struct pmcstat_cgnode_hash *pch; + struct pmcstat_pmcrecord *pmcr; + + pmcr = pmcstat_pmcindex_to_pmcr(pmcstat_pmcinfilter); + + /* + * We pull out all callgraph nodes in the top-level hash table + * with a matching PMC index. We then sort these based on the + * frequency of occurrence. Each callgraph node is then + * printed. + */ + + nsamples = 0; + + if ((sortbuffer = (struct pmcstat_cgnode **) + malloc(sizeof(struct pmcstat_cgnode *) * + pmcstat_cgnode_hash_count)) == NULL) + err(EX_OSERR, "ERROR: Cannot sort callgraph"); + cgn = sortbuffer; + + for (n = 0; n < PMCSTAT_NHASH; n++) + LIST_FOREACH(pch, &pmcstat_cgnode_hash[n], pch_next) + if (pmcr == NULL || pch->pch_pmcid == pmcr->pr_pmcid) { + nsamples += pch->pch_cgnode->pcg_count; + *cgn++ = pch->pch_cgnode; + } + + nentries = cgn - sortbuffer; + assert(nentries <= pmcstat_cgnode_hash_count); + + if (nentries == 0) { + free(sortbuffer); + return; + } + + qsort(sortbuffer, nentries, sizeof(struct pmcstat_cgnode *), + pmcstat_cgnode_compare); + + PMCSTAT_PRINTW("%5.5s %-10.10s %-20.20s %s\n", + "%SAMP", "IMAGE", "FUNCTION", "CALLERS"); + + nentries = min(pmcstat_displayheight - 2, nentries); + + for (cgn = sortbuffer, n = 0; n < nentries; n++, cgn++) { + if (PMCPL_CG_COUNTP(*cgn) < pmcstat_threshold) + break; + pmcstat_cgnode_topprint(*cgn, 0, nsamples); + } + + free(sortbuffer); +} + +/* + * Handle top mode keypress. + */ + +int +pmcpl_cg_topkeypress(int c, WINDOW *w) +{ + + (void) c; (void) w; + + return 0; +} + +int +pmcpl_cg_init(void) +{ + int i; + + pmcstat_cgnode_hash_count = 0; + pmcstat_previous_filename_printed = NULL; + + for (i = 0; i < PMCSTAT_NHASH; i++) { + LIST_INIT(&pmcstat_cgnode_hash[i]); + } + + return (0); +} + +void +pmcpl_cg_shutdown(FILE *mf) +{ + int i; + struct pmcstat_cgnode_hash *pch, *pchtmp; + + (void) mf; + + if (args.pa_flags & FLAG_DO_CALLGRAPHS) + pmcstat_callgraph_print(); + + /* + * Free memory. + */ + for (i = 0; i < PMCSTAT_NHASH; i++) { + LIST_FOREACH_SAFE(pch, &pmcstat_cgnode_hash[i], pch_next, + pchtmp) { + pmcstat_cgnode_free(pch->pch_cgnode); + LIST_REMOVE(pch, pch_next); + free(pch); + } + } +} + Added: head/usr.sbin/pmcstat/pmcpl_callgraph.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmcstat/pmcpl_callgraph.h Thu Feb 11 22:51:44 2010 (r203790) @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 2005-2007, Joseph Koshy + * Copyright (c) 2007 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by A. Joseph Koshy under + * sponsorship from the FreeBSD Foundation and Google, Inc. + * + * 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$ + */ + +#ifndef _PMCSTAT_PL_CALLGRAPH_H_ +#define _PMCSTAT_PL_CALLGRAPH_H_ + +/* + * Each call graph node is tracked by a pmcstat_cgnode struct. + */ + +struct pmcstat_cgnode { + struct pmcstat_image *pcg_image; + uintfptr_t pcg_func; + uint32_t pcg_count; + uint32_t pcg_nchildren; + LIST_ENTRY(pmcstat_cgnode) pcg_sibling; + LIST_HEAD(,pmcstat_cgnode) pcg_children; +}; + +struct pmcstat_cgnode_hash { + struct pmcstat_cgnode *pch_cgnode; + pmc_id_t pch_pmcid; + LIST_ENTRY(pmcstat_cgnode_hash) pch_next; +}; +extern LIST_HEAD(pmcstat_cgnode_hash_list, pmcstat_cgnode_hash) pmcstat_cgnode_hash[PMCSTAT_NHASH]; +extern int pmcstat_cgnode_hash_count; + +/* Function prototypes */ +int pmcpl_cg_init(void); +void pmcpl_cg_shutdown(FILE *mf); +void pmcpl_cg_process( + struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr, + uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu); +int pmcpl_cg_topkeypress(int c, WINDOW *w); +void pmcpl_cg_topdisplay(void); +void pmcpl_cg_configure(char *opt); + +#endif /* _PMCSTAT_PL_CALLGRAPH_H_ */ Added: head/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmcstat/pmcpl_calltree.c Thu Feb 11 22:51:44 2010 (r203790) @@ -0,0 +1,1000 @@ +/*- + * Copyright (c) 2009, Fabien Thomas + * 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. + */ + +/* + * Process hwpmc(4) samples as calltree. + * + * Output file format compatible with Kcachegrind (kdesdk). + * Handle top mode with a sorted tree display. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pmcstat.h" +#include "pmcstat_log.h" +#include "pmcstat_top.h" +#include "pmcpl_calltree.h" + +#define PMCPL_CT_GROWSIZE 4 + +static pmcstat_interned_string pmcpl_ct_prevfn; + +static int pmcstat_skiplink = 0; + +struct pmcpl_ct_node; + +/* Get the sample value for PMC a. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 11 23:07:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 136EC1065696; Thu, 11 Feb 2010 23:07:43 +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 AA35C8FC08; Thu, 11 Feb 2010 23:07:41 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id BAA01260; Fri, 12 Feb 2010 01:07:40 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Nfi8J-000AaI-QZ; Fri, 12 Feb 2010 01:07:39 +0200 Message-ID: <4B748DBA.504@freebsd.org> Date: Fri, 12 Feb 2010 01:07:38 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20091128) MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201002111824.o1BIO058052040@svn.freebsd.org> <201002111505.12589.jhb@freebsd.org> In-Reply-To: <201002111505.12589.jhb@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: John Baldwin Subject: Re: svn commit: r203785 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 23:07:43 -0000 on 11/02/2010 22:05 John Baldwin said the following: > On Thursday 11 February 2010 1:24:00 pm Andriy Gapon wrote: >> Author: avg >> Date: Thu Feb 11 18:24:00 2010 >> New Revision: 203785 >> URL: http://svn.freebsd.org/changeset/base/203785 >> >> Log: >> acpi: drop the second bus_generic_attach pass >> >> It is belived that that pass s not needed anymore. >> Specifically it is not required now for the reasons that were given >> in the removed comment. >> >> Discussed with: jhb And, in fact, the above should have been "Suggested by". >> MFC after: 4 weeks > > I suspect it was in fact never required in the version of acpi that was in the > FreeBSD source tree. It may have been required at some point in the early > stages of acpi development when the drivers were not yet part of the base > system. > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 00:47:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E3AE106566C; Fri, 12 Feb 2010 00:47:23 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D0948FC14; Fri, 12 Feb 2010 00:47:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1C0lN09040677; Fri, 12 Feb 2010 00:47:23 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1C0lN0W040674; Fri, 12 Feb 2010 00:47:23 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002120047.o1C0lN0W040674@svn.freebsd.org> From: Matt Jacob Date: Fri, 12 Feb 2010 00:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203794 - stable/8/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 00:47:23 -0000 Author: mjacob Date: Fri Feb 12 00:47:23 2010 New Revision: 203794 URL: http://svn.freebsd.org/changeset/base/203794 Log: Pick up some changes the the MFC missed. Modified: stable/8/sys/dev/isp/isp.c stable/8/sys/dev/isp/isp_library.c Modified: stable/8/sys/dev/isp/isp.c ============================================================================== --- stable/8/sys/dev/isp/isp.c Fri Feb 12 00:45:29 2010 (r203793) +++ stable/8/sys/dev/isp/isp.c Fri Feb 12 00:47:23 2010 (r203794) @@ -2763,15 +2763,21 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) /* * Make sure we're okay for doing this right now. */ - if (fcp->isp_loopstate != LOOP_PDB_RCVD && fcp->isp_loopstate != LOOP_FSCAN_DONE && fcp->isp_loopstate != LOOP_LSCAN_DONE) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", fcp->isp_loopstate); + if (fcp->isp_loopstate != LOOP_PDB_RCVD && + fcp->isp_loopstate != LOOP_FSCAN_DONE && + fcp->isp_loopstate != LOOP_LSCAN_DONE) { + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", + fcp->isp_loopstate); return (-1); } - if (fcp->isp_topo == TOPO_FL_PORT || fcp->isp_topo == TOPO_NL_PORT || fcp->isp_topo == TOPO_N_PORT) { + if (fcp->isp_topo == TOPO_FL_PORT || + fcp->isp_topo == TOPO_NL_PORT || + fcp->isp_topo == TOPO_N_PORT) { if (fcp->isp_loopstate < LOOP_LSCAN_DONE) { if (isp_scan_loop(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_loop failed"); + isp_prt(isp, ISP_LOGWARN, + "isp_pdb_sync: isp_scan_loop failed"); return (-1); } } @@ -2780,13 +2786,15 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) if (fcp->isp_topo == TOPO_F_PORT || fcp->isp_topo == TOPO_FL_PORT) { if (fcp->isp_loopstate < LOOP_FSCAN_DONE) { if (isp_scan_fabric(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_fabric failed"); + isp_prt(isp, ISP_LOGWARN, + "isp_pdb_sync: isp_scan_fabric failed"); return (-1); } } } - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Synchronizing PDBs", chan); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, + "Chan %d Synchronizing PDBs", chan); fcp->isp_loopstate = LOOP_SYNCING_PDB; @@ -2815,7 +2823,11 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) lp->state = FC_PORTDB_STATE_NIL; isp_async(isp, ISPASYNC_DEV_GONE, chan, lp); if (lp->autologin == 0) { - (void) isp_plogx(isp, chan, lp->handle, lp->portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 0); + (void) isp_plogx(isp, chan, lp->handle, + lp->portid, + PLOGX_FLG_CMD_LOGO | + PLOGX_FLG_IMPLICIT | + PLOGX_FLG_FREE_NPHDL, 0); } else { lp->autologin = 0; } @@ -3061,7 +3073,8 @@ isp_scan_loop(ispsoftc_t *isp, int chan) for (i = 0; i < MAX_FC_TARG; i++) { lp = &fcp->portdb[i]; - if (lp->state == FC_PORTDB_STATE_NIL || lp->target_mode) { + if (lp->state == FC_PORTDB_STATE_NIL || + lp->target_mode) { continue; } if (lp->node_wwn != tmp.node_wwn) { @@ -3579,7 +3592,8 @@ isp_scan_fabric(ispsoftc_t *isp, int cha for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) { lp = &fcp->portdb[dbidx]; - if (lp->state != FC_PORTDB_STATE_PROBATIONAL || lp->target_mode) { + if (lp->state != FC_PORTDB_STATE_PROBATIONAL || + lp->target_mode) { continue; } if (lp->portid == portid) { @@ -3816,7 +3830,8 @@ isp_scan_fabric(ispsoftc_t *isp, int cha if (fcp->portdb[dbidx].target_mode) { continue; } - if (fcp->portdb[dbidx].node_wwn == wwnn && fcp->portdb[dbidx].port_wwn == wwpn) { + if (fcp->portdb[dbidx].node_wwn == wwnn && + fcp->portdb[dbidx].port_wwn == wwpn) { break; } } Modified: stable/8/sys/dev/isp/isp_library.c ============================================================================== --- stable/8/sys/dev/isp/isp_library.c Fri Feb 12 00:45:29 2010 (r203793) +++ stable/8/sys/dev/isp/isp_library.c Fri Feb 12 00:47:23 2010 (r203794) @@ -650,7 +650,7 @@ isp_clear_commands(ispsoftc_t *isp) #ifdef ISP_TARGET_MODE for (tmp = 0; isp->isp_tgtlist && tmp < isp->isp_maxcmds; tmp++) { uint8_t local[QENTRY_LEN]; - hdp = &isp->isp_tgt_xflist[tmp]; + hdp = &isp->isp_tgtlist[tmp]; if (hdp->handle == ISP_HANDLE_FREE) { continue; } @@ -2275,7 +2275,7 @@ isp_find_tgt_handle(ispsoftc_t *isp, voi void isp_destroy_tgt_handle(ispsoftc_t *isp, uint32_t handle) { - if (!ISP_VALID_TGT_HANDLE(handle)) { + if (!ISP_VALID_TGT_HANDLE(isp, handle)) { isp_prt(isp, ISP_LOGERR, "%s: bad handle 0x%x", __func__, handle); } else { isp->isp_tgtlist[(handle & ISP_HANDLE_CMD_MASK)].handle = ISP_HANDLE_FREE; From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 02:59:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BA6F106566B; Fri, 12 Feb 2010 02:59:50 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29B978FC12; Fri, 12 Feb 2010 02:59:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1C2xoUm069701; Fri, 12 Feb 2010 02:59:50 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1C2xoPr069696; Fri, 12 Feb 2010 02:59:50 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002120259.o1C2xoPr069696@svn.freebsd.org> From: Neel Natu Date: Fri, 12 Feb 2010 02:59: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: r203796 - in head/sys: conf mips/conf mips/mips mips/sibyte X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 02:59:50 -0000 Author: neel Date: Fri Feb 12 02:59:49 2010 New Revision: 203796 URL: http://svn.freebsd.org/changeset/base/203796 Log: Remove the PCI_IOSPACE_SIZE and PCI_IOSPACE_ADDR hack from nexus.c. Implement this in the Sibyte PCI hostbridge driver instead. The nexus driver sees resource allocation requests for memory and irq resources only. These are legitimate resources on all MIPS platforms. Suggested by: imp Modified: head/sys/conf/options.mips head/sys/mips/conf/SWARM head/sys/mips/mips/nexus.c head/sys/mips/sibyte/sb_zbpci.c Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Fri Feb 12 02:26:12 2010 (r203795) +++ head/sys/conf/options.mips Fri Feb 12 02:59:49 2010 (r203796) @@ -61,14 +61,6 @@ TICK_USE_YAMON_FREQ opt_global.h TICK_USE_MALTA_RTC opt_global.h # -# The MIPS architecture does not have separate memory and i/o address space -# like x86. However some MIPS processors provide a memory-mapped window that -# maps onto the PCI I/O space. -# -PCI_IOSPACE_SIZE opt_global.h -PCI_IOSPACE_ADDR opt_global.h - -# # The highest memory address that can be used by the kernel in units of KB. # MAXMEM opt_global.h Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Fri Feb 12 02:26:12 2010 (r203795) +++ head/sys/mips/conf/SWARM Fri Feb 12 02:59:49 2010 (r203796) @@ -8,9 +8,6 @@ options CPU_SB1 files "../sibyte/files.sibyte" hints "SWARM.hints" -options PCI_IOSPACE_ADDR=0xFC000000 -options PCI_IOSPACE_SIZE=0x02000000 - # # 32-bit kernel cannot deal with physical memory beyond 4GB # XXX pmap assumes that all the memory can be mapped using KSEG0 Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Fri Feb 12 02:26:12 2010 (r203795) +++ head/sys/mips/mips/nexus.c Fri Feb 12 02:59:49 2010 (r203796) @@ -77,7 +77,6 @@ struct nexus_device { static struct rman irq_rman; static struct rman mem_rman; -static struct rman port_rman; static struct resource * nexus_alloc_resource(device_t, device_t, int, int *, u_long, @@ -161,21 +160,6 @@ nexus_probe(device_t dev) panic("%s: mem_rman", __func__); } - /* - * MIPS has no concept of the x86 I/O address space but some cpus - * provide a memory mapped window to access the PCI I/O BARs. - */ - port_rman.rm_start = 0; -#ifdef PCI_IOSPACE_SIZE - port_rman.rm_end = PCI_IOSPACE_SIZE - 1; -#endif - port_rman.rm_type = RMAN_ARRAY; - port_rman.rm_descr = "I/O ports"; - if (rman_init(&port_rman) != 0 || - rman_manage_region(&port_rman, 0, port_rman.rm_end) != 0) - panic("%s: port_rman", __func__); - - return (0); } @@ -241,7 +225,6 @@ nexus_print_all_resources(device_t dev) retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); return (retval); } @@ -368,9 +351,6 @@ nexus_alloc_resource(device_t bus, devic case SYS_RES_MEMORY: rm = &mem_rman; break; - case SYS_RES_IOPORT: - rm = &port_rman; - break; default: printf("%s: unknown resource type %d\n", __func__, type); return (0); @@ -400,21 +380,17 @@ static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + void *vaddr; + u_int32_t paddr, psize; + /* * If this is a memory resource, track the direct mapping * in the uncached MIPS KSEG1 segment. */ - /* XXX we shouldn't be supporting sys_res_ioport here */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - caddr_t vaddr = 0; - u_int32_t paddr; - u_int32_t psize; - u_int32_t poffs; - + if (type == SYS_RES_MEMORY) { paddr = rman_get_start(r); psize = rman_get_size(r); - poffs = paddr - trunc_page(paddr); - vaddr = (caddr_t) pmap_mapdev(paddr-poffs, psize+poffs) + poffs; + vaddr = pmap_mapdev(paddr, psize); rman_set_virtual(r, vaddr); rman_set_bustag(r, mips_bus_space_generic); @@ -501,7 +477,7 @@ nexus_deactivate_resource(device_t bus, { vm_offset_t va; - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + if (type == SYS_RES_MEMORY) { va = (vm_offset_t)rman_get_virtual(r); pmap_unmapdev(va, rman_get_size(r)); } Modified: head/sys/mips/sibyte/sb_zbpci.c ============================================================================== --- head/sys/mips/sibyte/sb_zbpci.c Fri Feb 12 02:26:12 2010 (r203795) +++ head/sys/mips/sibyte/sb_zbpci.c Fri Feb 12 02:59:49 2010 (r203796) @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,7 @@ #include #include +#include #include "pcib_if.h" @@ -58,7 +60,11 @@ static struct { } zbpci_config_space[MAXCPU]; static const vm_paddr_t CFG_PADDR_BASE = 0xFE000000; - +static const u_long PCI_IOSPACE_ADDR = 0xFC000000; +static const u_long PCI_IOSPACE_SIZE = 0x02000000; + +static struct rman port_rman; + static int zbpci_probe(device_t dev) { @@ -73,13 +79,32 @@ zbpci_attach(device_t dev) int n, rid, size; vm_offset_t va; struct resource *res; + + /* + * Reserve the physical memory window used to map PCI I/O space. + */ + rid = 0; + res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, + PCI_IOSPACE_ADDR, + PCI_IOSPACE_ADDR + PCI_IOSPACE_SIZE - 1, + PCI_IOSPACE_SIZE, 0); + if (res == NULL) + panic("Cannot allocate resource for PCI I/O space mapping."); + + port_rman.rm_start = 0; + port_rman.rm_end = PCI_IOSPACE_SIZE - 1; + port_rman.rm_type = RMAN_ARRAY; + port_rman.rm_descr = "PCI I/O ports"; + if (rman_init(&port_rman) != 0 || + rman_manage_region(&port_rman, 0, PCI_IOSPACE_SIZE - 1) != 0) + panic("%s: port_rman", __func__); /* * Reserve the the physical memory that is used to read/write to the * pci config space but don't activate it. We are using a page worth * of KVA as a window over this region. */ - rid = 0; + rid = 1; size = (PCI_BUSMAX + 1) * (PCI_SLOTMAX + 1) * (PCI_FUNCMAX + 1) * 256; res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, CFG_PADDR_BASE, CFG_PADDR_BASE + size - 1, size, 0); @@ -115,6 +140,101 @@ zbpci_attach(device_t dev) return (bus_generic_attach(dev)); } +static struct resource * +zbpci_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct resource *res; + + /* + * Handle PCI I/O port resources here and pass everything else to nexus. + */ + if (type != SYS_RES_IOPORT) { + res = bus_generic_alloc_resource(bus, child, type, rid, + start, end, count, flags); + return (res); + } + + res = rman_reserve_resource(&port_rman, start, end, count, + flags, child); + if (res == NULL) + return (NULL); + + rman_set_rid(res, *rid); + + /* Activate the resource is requested */ + if (flags & RF_ACTIVE) { + if (bus_activate_resource(child, type, *rid, res) != 0) { + rman_release_resource(res); + return (NULL); + } + } + + return (res); +} + +static int +zbpci_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + void *vaddr; + u_long paddr, psize; + + if (type != SYS_RES_IOPORT) { + return (bus_generic_activate_resource(bus, child, type, + rid, res)); + } + + /* + * Map the I/O space resource through the memory window starting + * at PCI_IOSPACE_ADDR. + */ + paddr = rman_get_start(res) + PCI_IOSPACE_ADDR; + psize = rman_get_size(res); + vaddr = pmap_mapdev(paddr, psize); + + rman_set_virtual(res, vaddr); + rman_set_bustag(res, mips_bus_space_generic); + rman_set_bushandle(res, (bus_space_handle_t)vaddr); + + return (rman_activate_resource(res)); +} + +static int +zbpci_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + int error; + + if (type != SYS_RES_IOPORT) + return (bus_generic_release_resource(bus, child, type, rid, r)); + + if (rman_get_flags(r) & RF_ACTIVE) { + error = bus_deactivate_resource(child, type, rid, r); + if (error) + return (error); + } + + return (rman_release_resource(r)); +} + +static int +zbpci_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + vm_offset_t va; + + if (type != SYS_RES_IOPORT) { + return (bus_generic_deactivate_resource(bus, child, type, + rid, r)); + } + + va = (vm_offset_t)rman_get_virtual(r); + pmap_unmapdev(va, rman_get_size(r)); + + return (rman_deactivate_resource(r)); +} + static int zbpci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { @@ -248,10 +368,10 @@ static device_method_t zbpci_methods[] = /* Bus interface */ DEVMETHOD(bus_read_ivar, zbpci_read_ivar), DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_alloc_resource, zbpci_alloc_resource), + DEVMETHOD(bus_activate_resource, zbpci_activate_resource), + DEVMETHOD(bus_deactivate_resource, zbpci_deactivate_resource), + DEVMETHOD(bus_release_resource, zbpci_release_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_add_child, bus_generic_add_child), From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 07:40:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B9C6106566B; Fri, 12 Feb 2010 07:40:50 +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 F222A8FC13; Fri, 12 Feb 2010 07:40:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o1C7a34e039326; Fri, 12 Feb 2010 00:36:03 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 12 Feb 2010 00:36:08 -0700 (MST) Message-Id: <20100212.003608.59640143160092016.imp@bsdimp.com> To: neel@freebsd.org From: "M. Warner Losh" In-Reply-To: <201002120259.o1C2xoPr069696@svn.freebsd.org> References: <201002120259.o1C2xoPr069696@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.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: r203796 - in head/sys: conf mips/conf mips/mips mips/sibyte X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 07:40:50 -0000 In message: <201002120259.o1C2xoPr069696@svn.freebsd.org> Neel Natu writes: : Author: neel : Date: Fri Feb 12 02:59:49 2010 : New Revision: 203796 : URL: http://svn.freebsd.org/changeset/base/203796 : : Log: : Remove the PCI_IOSPACE_SIZE and PCI_IOSPACE_ADDR hack from nexus.c. Implement : this in the Sibyte PCI hostbridge driver instead. : : The nexus driver sees resource allocation requests for memory and irq : resources only. These are legitimate resources on all MIPS platforms. : : Suggested by: imp Thanks. In general, by the time we get to the nexus, there should be only native resources. I/O space is a construct of the PCI bus, or whatever other bus on the system maps it to an address space. Now that we have a real bus-space implementation, we no longer need to pretend there's an I/O space at the nexus to make the bus space functions happy. Bus space now does the proper mapping up the tree, so by the time we get here, only memory space and hard IRQs should be left (which also means that any IRQ fan-in should be mapped by this point too). Warner From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 08:57:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74A18106566B; Fri, 12 Feb 2010 08:57:30 +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 4ACEA8FC12; Fri, 12 Feb 2010 08:57:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1C8vUYL064578; Fri, 12 Feb 2010 08:57:30 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1C8vUxV064577; Fri, 12 Feb 2010 08:57:30 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201002120857.o1C8vUxV064577@svn.freebsd.org> From: Doug Barton Date: Fri, 12 Feb 2010 08:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203797 - vendor/bind9/9.4-ESV X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 08:57:30 -0000 Author: dougb Date: Fri Feb 12 08:57:30 2010 New Revision: 203797 URL: http://svn.freebsd.org/changeset/base/203797 Log: Tag the 9.4-ESV release Added: vendor/bind9/9.4-ESV/ - copied from r203796, vendor/bind9/dist-9.4/ From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 10:25:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E6D0106566B for ; Fri, 12 Feb 2010 10:25:26 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward11.mail.yandex.net (forward11.mail.yandex.net [95.108.130.93]) by mx1.freebsd.org (Postfix) with ESMTP id 1FB298FC17 for ; Fri, 12 Feb 2010 10:25:25 +0000 (UTC) Received: from smtp1.mail.yandex.net (smtp1.mail.yandex.net [77.88.46.101]) by forward11.mail.yandex.net (Yandex) with ESMTP id 5D3CDF490D8; Fri, 12 Feb 2010 13:25:24 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1265970324; bh=f6oTECAQkVuCKHrABfxWdWQd8rqQOjWJbZFRsEwtnDw=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=ljKfBQggP3b1xIb8WExq/PklaYRaWJ+STqB2GUfWrDCaVIdgVS1Q8yomp1SbcHMk3 5rvEk3tyObzuxQN9W6VbEpkEklTBrO+RjD+c9Y8hK9ddMF5SKJ5uik3FIHBeC2m1TG K5uvtQspjr7+HGjw4SJtNMgdRyLJbstM258XjEu4= Received: from [127.0.0.1] (ns.kirov.so-ups.ru [77.72.136.145]) by smtp1.mail.yandex.net (Yandex) with ESMTPSA id 55C4AE60155; Fri, 12 Feb 2010 13:25:23 +0300 (MSK) Message-ID: <4B752C92.30705@yandex.ru> Date: Fri, 12 Feb 2010 13:25:22 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Luigi Rizzo References: <200912221901.nBMJ1mXQ072673@svn.freebsd.org> In-Reply-To: <200912221901.nBMJ1mXQ072673@svn.freebsd.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Yandex-TimeMark: 1265970323 X-Yandex-Spam: 1 X-Yandex-Front: smtp1.mail.yandex.net Cc: freebsd-ipfw@FreeBSD.org, svn-src-all@freebsd.org Subject: Re: svn commit: r200855 - in head/sys: net netgraph netinet netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 10:25:26 -0000 On 22.12.2009 22:01, Luigi Rizzo wrote: > Author: luigi > Date: Tue Dec 22 19:01:47 2009 > New Revision: 200855 > URL: http://svn.freebsd.org/changeset/base/200855 > > Log: > merge code from ipfw3-head to reduce contention on the ipfw lock > and remove all O(N) sequences from kernel critical sections in ipfw. > > In detail: > > 1. introduce a IPFW_UH_LOCK to arbitrate requests from > the upper half of the kernel. Some things, such as 'ipfw show', > can be done holding this lock in read mode, whereas insert and > delete require IPFW_UH_WLOCK. > > The only (very small) regression is on dynamic rule lookup and this will > be fixed in a day or two, without changing the userland/kernel ABI > > Supported by: Valeria Paoli > MFC after: 1 month > > Modified: > head/sys/netinet/ipfw/ip_fw_sockopt.c Hi, Luigi. This commit also broke `ipfw set show` operation. It always show all sets enabled, because IP_FW_GET command gets small buffer and after calculating wanted size it returns back without copying anything. -- WBR, Andrey V. Elsukov From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 14:50:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E9D61065695; Fri, 12 Feb 2010 14:50:22 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3208FC18; Fri, 12 Feb 2010 14:50:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1CEoMug044713; Fri, 12 Feb 2010 14:50:22 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1CEoMDO044712; Fri, 12 Feb 2010 14:50:22 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201002121450.o1CEoMDO044712@svn.freebsd.org> From: Ken Smith Date: Fri, 12 Feb 2010 14:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203798 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 14:50:22 -0000 Author: kensmith Date: Fri Feb 12 14:50:21 2010 New Revision: 203798 URL: http://svn.freebsd.org/changeset/base/203798 Log: Add releng/7.3/ as needing re@ approval. Nudged by: kib Approved by: core (implicit) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Fri Feb 12 08:57:30 2010 (r203797) +++ svnadmin/conf/approvers Fri Feb 12 14:50:21 2010 (r203798) @@ -19,6 +19,7 @@ #^head/ re #^stable/8/ re ^stable/7/ re +^releng/7.3/ re ^releng/8.0/ (security-officer|so) ^releng/7.[0-2]/ (security-officer|so) ^releng/6.[0-4]/ (security-officer|so) From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 15:07:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9312E106566C; Fri, 12 Feb 2010 15:07:24 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81F338FC15; Fri, 12 Feb 2010 15:07:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1CF7OBF048545; Fri, 12 Feb 2010 15:07:24 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1CF7OU5048542; Fri, 12 Feb 2010 15:07:24 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002121507.o1CF7OU5048542@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 12 Feb 2010 15:07: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: r203799 - head/usr.bin/elf2aout X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 15:07:24 -0000 Author: ru Date: Fri Feb 12 15:07:24 2010 New Revision: 203799 URL: http://svn.freebsd.org/changeset/base/203799 Log: Make manpage's SYNOPSIS match program's usage(). Submitted by: Alexander Best (manpage) Modified: head/usr.bin/elf2aout/elf2aout.1 head/usr.bin/elf2aout/elf2aout.c Modified: head/usr.bin/elf2aout/elf2aout.1 ============================================================================== --- head/usr.bin/elf2aout/elf2aout.1 Fri Feb 12 14:50:21 2010 (r203798) +++ head/usr.bin/elf2aout/elf2aout.1 Fri Feb 12 15:07:24 2010 (r203799) @@ -32,7 +32,7 @@ .Nd "Convert ELF binary to a.out format" .Sh SYNOPSIS .Nm -.Op Fl o outfile +.Op Fl o Ar outfile .Ar infile .Sh DESCRIPTION The Modified: head/usr.bin/elf2aout/elf2aout.c ============================================================================== --- head/usr.bin/elf2aout/elf2aout.c Fri Feb 12 14:50:21 2010 (r203798) +++ head/usr.bin/elf2aout/elf2aout.c Fri Feb 12 15:07:24 2010 (r203799) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -155,5 +157,6 @@ static void usage(void) { - errx(1, "usage: elf2aout [-o outfile] infile"); + fprintf(stderr, "usage: elf2aout [-o outfile] infile\n"); + exit(1); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 16:33:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A059F106566B; Fri, 12 Feb 2010 16:33:03 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CE6F8FC14; Fri, 12 Feb 2010 16:33:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1CGX3fS067430; Fri, 12 Feb 2010 16:33:03 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1CGX3hd067423; Fri, 12 Feb 2010 16:33:03 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002121633.o1CGX3hd067423@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 12 Feb 2010 16:33: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: r203800 - in head/tools: regression/file/newfileops_on_fork regression/gaithrstress tools/mctest tools/netrate/http tools/netrate/httpd tools/netrate/juggle X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 16:33:03 -0000 Author: ru Date: Fri Feb 12 16:33:03 2010 New Revision: 203800 URL: http://svn.freebsd.org/changeset/base/203800 Log: Fixed error checking of pthread(3) functions. PR: 143807 Submitted by: pluknet (partly) Modified: head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c head/tools/regression/gaithrstress/gaithrstress.c head/tools/tools/mctest/mctest.cc head/tools/tools/netrate/http/http.c head/tools/tools/netrate/httpd/httpd.c head/tools/tools/netrate/juggle/juggle.c Modified: head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c ============================================================================== --- head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c Fri Feb 12 15:07:24 2010 (r203799) +++ head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c Fri Feb 12 16:33:03 2010 (r203800) @@ -113,7 +113,7 @@ main(__unused int argc, __unused char *a err(-1, "bind"); if (listen(listen_fd, -1) <0) err(-1, "listen"); - if (pthread_create(&accept_thread, NULL, do_accept, NULL) < 0) + if (pthread_create(&accept_thread, NULL, do_accept, NULL) != 0) err(-1, "pthread_create"); sleep(1); /* Easier than using a CV. */; do_fork(); Modified: head/tools/regression/gaithrstress/gaithrstress.c ============================================================================== --- head/tools/regression/gaithrstress/gaithrstress.c Fri Feb 12 15:07:24 2010 (r203799) +++ head/tools/regression/gaithrstress/gaithrstress.c Fri Feb 12 16:33:03 2010 (r203800) @@ -241,7 +241,7 @@ usage: fflush(stdout); for (i = 0; i < nworkers; i++) { if (pthread_create(&workers[i].w_thread, NULL, work, - &workers[i]) == -1) + &workers[i]) != 0) err(1, "creating worker %u", i); printf("%u%s", i, i == nworkers - 1 ? ".\n" : ", "); fflush(stdout); Modified: head/tools/tools/mctest/mctest.cc ============================================================================== --- head/tools/tools/mctest/mctest.cc Fri Feb 12 15:07:24 2010 (r203799) +++ head/tools/tools/mctest/mctest.cc Fri Feb 12 16:33:03 2010 (r203800) @@ -368,7 +368,7 @@ int source(char *interface, struct in_ad args[i].packets = received[i]; args[i].number = number / clients; args[i].client = base_port + i; - if (pthread_create(&thread[i], NULL, server, &args[i]) < 0) { + if (pthread_create(&thread[i], NULL, server, &args[i]) != 0) { perror("failed to create server thread"); return -1; } @@ -393,7 +393,7 @@ int source(char *interface, struct in_ad } for (int i = 0; i < clients; i++) { - if (pthread_join(thread[i], NULL) < 0) { + if (pthread_join(thread[i], NULL) != 0) { perror("failed to join thread"); return -1; } Modified: head/tools/tools/netrate/http/http.c ============================================================================== --- head/tools/tools/netrate/http/http.c Fri Feb 12 15:07:24 2010 (r203799) +++ head/tools/tools/netrate/http/http.c Fri Feb 12 16:33:03 2010 (r203800) @@ -300,15 +300,15 @@ main(int argc, char *argv[]) if (threaded) { if (pthread_barrier_init(&statep->start_barrier, NULL, - numthreads) < 0) - err(-1, "pthread_mutex_init"); + numthreads) != 0) + err(-1, "pthread_barrier_init"); } for (i = 0; i < numthreads; i++) { statep->hwd[i].hwd_count = 0; if (threaded) { if (pthread_create(&statep->hwd[i].hwd_thread, NULL, - http_worker, &statep->hwd[i]) < 0) + http_worker, &statep->hwd[i]) != 0) err(-1, "pthread_create"); } else { curthread = i; @@ -339,7 +339,7 @@ main(int argc, char *argv[]) for (i = 0; i < numthreads; i++) { if (threaded) { if (pthread_join(statep->hwd[i].hwd_thread, NULL) - < 0) + != 0) err(-1, "pthread_join"); } else { pid = waitpid(statep->hwd[i].hwd_pid, NULL, 0); Modified: head/tools/tools/netrate/httpd/httpd.c ============================================================================== --- head/tools/tools/netrate/httpd/httpd.c Fri Feb 12 15:07:24 2010 (r203799) +++ head/tools/tools/netrate/httpd/httpd.c Fri Feb 12 16:33:03 2010 (r203800) @@ -280,7 +280,7 @@ main(int argc, char *argv[]) for (i = 0; i < THREADS; i++) { if (threaded) { if (pthread_create(&statep->hts[i].hts_thread, NULL, - httpd_worker, &statep->hts[i]) < 0) + httpd_worker, &statep->hts[i]) != 0) err(-1, "pthread_create"); } else { pid = fork(); @@ -299,7 +299,7 @@ main(int argc, char *argv[]) for (i = 0; i < THREADS; i++) { if (threaded) { if (pthread_join(statep->hts[i].hts_thread, NULL) - < 0) + != 0) err(-1, "pthread_join"); } else { pid = waitpid(statep->hts[i].hts_pid, NULL, 0); Modified: head/tools/tools/netrate/juggle/juggle.c ============================================================================== --- head/tools/tools/netrate/juggle/juggle.c Fri Feb 12 15:07:24 2010 (r203799) +++ head/tools/tools/netrate/juggle/juggle.c Fri Feb 12 16:33:03 2010 (r203800) @@ -301,15 +301,15 @@ juggling_thread(void *arg) fd2 = *(int *)arg; - if (pthread_mutex_lock(&threaded_mtx) < 0) + if (pthread_mutex_lock(&threaded_mtx) != 0) err(-1, "juggling_thread: pthread_mutex_lock"); threaded_child_ready = 1; - if (pthread_cond_signal(&threaded_cond) < 0) + if (pthread_cond_signal(&threaded_cond) != 0) err(-1, "juggling_thread: pthread_cond_signal"); - if (pthread_mutex_unlock(&threaded_mtx) < 0) + if (pthread_mutex_unlock(&threaded_mtx) != 0) err(-1, "juggling_thread: pthread_mutex_unlock"); for (i = 0; i < NUMCYCLES; i++) { @@ -334,21 +334,21 @@ thread_juggle(int fd1, int fd2, int pipe threaded_pipeline = pipeline; - if (pthread_mutex_init(&threaded_mtx, NULL) < 0) + if (pthread_mutex_init(&threaded_mtx, NULL) != 0) err(-1, "thread_juggle: pthread_mutex_init"); - if (pthread_create(&thread, NULL, juggling_thread, &fd2) < 0) + if (pthread_create(&thread, NULL, juggling_thread, &fd2) != 0) err(-1, "thread_juggle: pthread_create"); - if (pthread_mutex_lock(&threaded_mtx) < 0) + if (pthread_mutex_lock(&threaded_mtx) != 0) err(-1, "thread_juggle: pthread_mutex_lock"); while (!threaded_child_ready) { - if (pthread_cond_wait(&threaded_cond, &threaded_mtx) < 0) + if (pthread_cond_wait(&threaded_cond, &threaded_mtx) != 0) err(-1, "thread_juggle: pthread_cond_wait"); } - if (pthread_mutex_unlock(&threaded_mtx) < 0) + if (pthread_mutex_unlock(&threaded_mtx) != 0) err(-1, "thread_juggle: pthread_mutex_unlock"); if (clock_gettime(CLOCK_REALTIME, &tstart) < 0) @@ -369,7 +369,7 @@ thread_juggle(int fd1, int fd2, int pipe if (clock_gettime(CLOCK_REALTIME, &tfinish) < 0) err(-1, "thread_juggle: clock_gettime"); - if (pthread_join(thread, NULL) < 0) + if (pthread_join(thread, NULL) != 0) err(-1, "thread_juggle: pthread_join"); timespecsub(&tfinish, &tstart); From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 16:43:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67AE01065692; Fri, 12 Feb 2010 16:43:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id E7F288FC13; Fri, 12 Feb 2010 16:43:51 +0000 (UTC) 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 o1CGhcNa097333 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Feb 2010 18:43:38 +0200 (EET) (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 o1CGhcdk030035; Fri, 12 Feb 2010 18:43:38 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o1CGhckQ030034; Fri, 12 Feb 2010 18:43:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 12 Feb 2010 18:43:38 +0200 From: Kostik Belousov To: Ruslan Ermilov Message-ID: <20100212164338.GH9991@deviant.kiev.zoral.com.ua> References: <201002121633.o1CGX3hd067423@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u0lqphHC8S+ob1K0" Content-Disposition: inline In-Reply-To: <201002121633.o1CGX3hd067423@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 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 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203800 - in head/tools: regression/file/newfileops_on_fork regression/gaithrstress tools/mctest tools/netrate/http tools/netrate/httpd tools/netrate/juggle X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 16:43:52 -0000 --u0lqphHC8S+ob1K0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 12, 2010 at 04:33:03PM +0000, Ruslan Ermilov wrote: > Author: ru > Date: Fri Feb 12 16:33:03 2010 > New Revision: 203800 > URL: http://svn.freebsd.org/changeset/base/203800 >=20 > Log: > Fixed error checking of pthread(3) functions. > =20 > PR: 143807 > Submitted by: pluknet (partly) >=20 > Modified: > head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c > head/tools/regression/gaithrstress/gaithrstress.c > head/tools/tools/mctest/mctest.cc > head/tools/tools/netrate/http/http.c > head/tools/tools/netrate/httpd/httpd.c > head/tools/tools/netrate/juggle/juggle.c >=20 > Modified: head/tools/regression/file/newfileops_on_fork/newfileops_on_for= k.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/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c Fr= i Feb 12 15:07:24 2010 (r203799) > +++ head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c Fr= i Feb 12 16:33:03 2010 (r203800) > @@ -113,7 +113,7 @@ main(__unused int argc, __unused char *a > err(-1, "bind"); > if (listen(listen_fd, -1) <0) > err(-1, "listen"); > - if (pthread_create(&accept_thread, NULL, do_accept, NULL) < 0) > + if (pthread_create(&accept_thread, NULL, do_accept, NULL) !=3D 0) > err(-1, "pthread_create"); > sleep(1); /* Easier than using a CV. */; > do_fork(); err() uses errno, so this is still not quite right ? --u0lqphHC8S+ob1K0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkt1hTkACgkQC3+MBN1Mb4g0/gCg0DkzuOyPjgTOnN202g1YinVl 8dYAoPH0SeCcshpbz6//kIiVgZ/g048R =5vT8 -----END PGP SIGNATURE----- --u0lqphHC8S+ob1K0-- From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 17:25:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F9D5106566B; Fri, 12 Feb 2010 17:25:59 +0000 (UTC) (envelope-from ru@freebsd.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id CD5E58FC1B; Fri, 12 Feb 2010 17:25:58 +0000 (UTC) Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NfzHA-000Eo2-HE; Fri, 12 Feb 2010 20:25:56 +0300 Date: Fri, 12 Feb 2010 20:25:54 +0300 From: Ruslan Ermilov To: Kostik Belousov Message-ID: <20100212172554.GB99835@edoofus.dev.vega.ru> References: <201002121633.o1CGX3hd067423@svn.freebsd.org> <20100212164338.GH9991@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100212164338.GH9991@deviant.kiev.zoral.com.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203800 - in head/tools: regression/file/newfileops_on_fork regression/gaithrstress tools/mctest tools/netrate/http tools/netrate/httpd tools/netrate/juggle X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 17:25:59 -0000 On Fri, Feb 12, 2010 at 06:43:38PM +0200, Kostik Belousov wrote: > On Fri, Feb 12, 2010 at 04:33:03PM +0000, Ruslan Ermilov wrote: > > Author: ru > > Date: Fri Feb 12 16:33:03 2010 > > New Revision: 203800 > > URL: http://svn.freebsd.org/changeset/base/203800 > > > > Log: > > Fixed error checking of pthread(3) functions. > > > > PR: 143807 > > Submitted by: pluknet (partly) > > > > Modified: > > head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c > > head/tools/regression/gaithrstress/gaithrstress.c > > head/tools/tools/mctest/mctest.cc > > head/tools/tools/netrate/http/http.c > > head/tools/tools/netrate/httpd/httpd.c > > head/tools/tools/netrate/juggle/juggle.c > > > > Modified: head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c > > ============================================================================== > > --- head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c Fri Feb 12 15:07:24 2010 (r203799) > > +++ head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c Fri Feb 12 16:33:03 2010 (r203800) > > @@ -113,7 +113,7 @@ main(__unused int argc, __unused char *a > > err(-1, "bind"); > > if (listen(listen_fd, -1) <0) > > err(-1, "listen"); > > - if (pthread_create(&accept_thread, NULL, do_accept, NULL) < 0) > > + if (pthread_create(&accept_thread, NULL, do_accept, NULL) != 0) > > err(-1, "pthread_create"); > > sleep(1); /* Easier than using a CV. */; > > do_fork(); > > err() uses errno, so this is still not quite right ? Yes, errc() would be in order here. "eval" of -1 in the err() call is also not quite correct, and is silently converted to 255. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 18:48:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FA8D10656C3; Fri, 12 Feb 2010 18:48:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F384D8FC13; Fri, 12 Feb 2010 18:48:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1CImIVY098866; Fri, 12 Feb 2010 18:48:18 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1CImIpk098861; Fri, 12 Feb 2010 18:48:18 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002121848.o1CImIpk098861@svn.freebsd.org> From: Ed Maste Date: Fri, 12 Feb 2010 18:48: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: r203801 - head/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 18:48:19 -0000 Author: emaste Date: Fri Feb 12 18:48:18 2010 New Revision: 203801 URL: http://svn.freebsd.org/changeset/base/203801 Log: Garbage collect Falcon/PPC support that has not been used in released products, based on discussion with Adaptec. Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_pci.c head/sys/dev/aac/aacreg.h head/sys/dev/aac/aacvar.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Fri Feb 12 16:33:03 2010 (r203800) +++ head/sys/dev/aac/aac.c Fri Feb 12 18:48:18 2010 (r203801) @@ -107,28 +107,6 @@ static int aac_dequeue_fib(struct aac_so static int aac_enqueue_response(struct aac_softc *sc, int queue, struct aac_fib *fib); -/* Falcon/PPC interface */ -static int aac_fa_get_fwstatus(struct aac_softc *sc); -static void aac_fa_qnotify(struct aac_softc *sc, int qbit); -static int aac_fa_get_istatus(struct aac_softc *sc); -static void aac_fa_clear_istatus(struct aac_softc *sc, int mask); -static void aac_fa_set_mailbox(struct aac_softc *sc, u_int32_t command, - u_int32_t arg0, u_int32_t arg1, - u_int32_t arg2, u_int32_t arg3); -static int aac_fa_get_mailbox(struct aac_softc *sc, int mb); -static void aac_fa_set_interrupts(struct aac_softc *sc, int enable); - -struct aac_interface aac_fa_interface = { - aac_fa_get_fwstatus, - aac_fa_qnotify, - aac_fa_get_istatus, - aac_fa_clear_istatus, - aac_fa_set_mailbox, - aac_fa_get_mailbox, - aac_fa_set_interrupts, - NULL, NULL, NULL -}; - /* StrongARM interface */ static int aac_sa_get_fwstatus(struct aac_softc *sc); static void aac_sa_qnotify(struct aac_softc *sc, int qbit); @@ -2417,17 +2395,6 @@ aac_rx_get_fwstatus(struct aac_softc *sc } static int -aac_fa_get_fwstatus(struct aac_softc *sc) -{ - int val; - - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - val = AAC_MEM0_GETREG4(sc, AAC_FA_FWSTATUS); - return (val); -} - -static int aac_rkt_get_fwstatus(struct aac_softc *sc) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2457,15 +2424,6 @@ aac_rx_qnotify(struct aac_softc *sc, int } static void -aac_fa_qnotify(struct aac_softc *sc, int qbit) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - AAC_MEM0_SETREG2(sc, AAC_FA_DOORBELL1, qbit); - AAC_FA_HACK(sc); -} - -static void aac_rkt_qnotify(struct aac_softc *sc, int qbit) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2493,17 +2451,6 @@ aac_rx_get_istatus(struct aac_softc *sc) } static int -aac_fa_get_istatus(struct aac_softc *sc) -{ - int val; - - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - val = AAC_MEM0_GETREG2(sc, AAC_FA_DOORBELL0); - return (val); -} - -static int aac_rkt_get_istatus(struct aac_softc *sc) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2531,15 +2478,6 @@ aac_rx_clear_istatus(struct aac_softc *s } static void -aac_fa_clear_istatus(struct aac_softc *sc, int mask) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - AAC_MEM0_SETREG2(sc, AAC_FA_DOORBELL0_CLEAR, mask); - AAC_FA_HACK(sc); -} - -static void aac_rkt_clear_istatus(struct aac_softc *sc, int mask) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2577,24 +2515,6 @@ aac_rx_set_mailbox(struct aac_softc *sc, } static void -aac_fa_set_mailbox(struct aac_softc *sc, u_int32_t command, - u_int32_t arg0, u_int32_t arg1, u_int32_t arg2, u_int32_t arg3) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX, command); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 4, arg0); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 8, arg1); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 12, arg2); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 16, arg3); - AAC_FA_HACK(sc); -} - -static void aac_rkt_set_mailbox(struct aac_softc *sc, u_int32_t command, u_int32_t arg0, u_int32_t arg1, u_int32_t arg2, u_int32_t arg3) { @@ -2627,17 +2547,6 @@ aac_rx_get_mailbox(struct aac_softc *sc, } static int -aac_fa_get_mailbox(struct aac_softc *sc, int mb) -{ - int val; - - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - val = AAC_MEM1_GETREG4(sc, AAC_FA_MAILBOX + (mb * 4)); - return (val); -} - -static int aac_rkt_get_mailbox(struct aac_softc *sc, int mb) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2676,20 +2585,6 @@ aac_rx_set_interrupts(struct aac_softc * } static void -aac_fa_set_interrupts(struct aac_softc *sc, int enable) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis"); - - if (enable) { - AAC_MEM0_SETREG2((sc), AAC_FA_MASK0_CLEAR, AAC_DB_INTERRUPTS); - AAC_FA_HACK(sc); - } else { - AAC_MEM0_SETREG2((sc), AAC_FA_MASK0, ~0); - AAC_FA_HACK(sc); - } -} - -static void aac_rkt_set_interrupts(struct aac_softc *sc, int enable) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis"); Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Fri Feb 12 16:33:03 2010 (r203800) +++ head/sys/dev/aac/aac_pci.c Fri Feb 12 18:48:18 2010 (r203801) @@ -435,10 +435,6 @@ aac_pci_attach(device_t dev) fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for StrongARM"); sc->aac_if = aac_sa_interface; break; - case AAC_HWIF_FALCON: - fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Falcon/PPC"); - sc->aac_if = aac_fa_interface; - break; case AAC_HWIF_RKT: fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Rocket/MIPS"); sc->aac_if = aac_rkt_interface; Modified: head/sys/dev/aac/aacreg.h ============================================================================== --- head/sys/dev/aac/aacreg.h Fri Feb 12 16:33:03 2010 (r203800) +++ head/sys/dev/aac/aacreg.h Fri Feb 12 18:48:18 2010 (r203801) @@ -1453,24 +1453,6 @@ enum { }; /* - * Register set for adapters based on the Falcon bridge and PPC core - */ - -#define AAC_FA_DOORBELL0_CLEAR 0x00 -#define AAC_FA_DOORBELL1_CLEAR 0x02 -#define AAC_FA_DOORBELL0 0x04 -#define AAC_FA_DOORBELL1 0x06 -#define AAC_FA_MASK0_CLEAR 0x08 -#define AAC_FA_MASK1_CLEAR 0x0a -#define AAC_FA_MASK0 0x0c -#define AAC_FA_MASK1 0x0e -#define AAC_FA_MAILBOX 0x10 -#define AAC_FA_FWSTATUS 0x2c /* Mailbox 7 */ -#define AAC_FA_INTSRC 0x900 - -#define AAC_FA_HACK(sc) (void)AAC_MEM0_GETREG4(sc, AAC_FA_INTSRC) - -/* * Register definitions for the Adaptec AAC-364 'Jalapeno I/II' adapters, based * on the SA110 'StrongArm'. */ Modified: head/sys/dev/aac/aacvar.h ============================================================================== --- head/sys/dev/aac/aacvar.h Fri Feb 12 16:33:03 2010 (r203800) +++ head/sys/dev/aac/aacvar.h Fri Feb 12 18:48:18 2010 (r203801) @@ -319,7 +319,6 @@ struct aac_softc int aac_hwif; #define AAC_HWIF_I960RX 0 #define AAC_HWIF_STRONGARM 1 -#define AAC_HWIF_FALCON 2 #define AAC_HWIF_RKT 3 #define AAC_HWIF_NARK 4 #define AAC_HWIF_UNKNOWN -1 From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 18:52:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3782D106568D; Fri, 12 Feb 2010 18:52:25 +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 271F68FC37; Fri, 12 Feb 2010 18:52:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1CIqPDv099871; Fri, 12 Feb 2010 18:52:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1CIqPm3099867; Fri, 12 Feb 2010 18:52:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002121852.o1CIqPm3099867@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 12 Feb 2010 18:52: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: r203802 - in head: bin/pkill tools/regression/usr.bin/pkill X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 18:52:25 -0000 Author: pjd Date: Fri Feb 12 18:52:24 2010 New Revision: 203802 URL: http://svn.freebsd.org/changeset/base/203802 Log: - Implement -q option for pgrep(1). - Add regression test to test -q option. Added: head/tools/regression/usr.bin/pkill/pgrep-q.t (contents, props changed) Modified: head/bin/pkill/pkill.1 head/bin/pkill/pkill.c Modified: head/bin/pkill/pkill.1 ============================================================================== --- head/bin/pkill/pkill.1 Fri Feb 12 18:48:18 2010 (r203801) +++ head/bin/pkill/pkill.1 Fri Feb 12 18:52:24 2010 (r203802) @@ -36,7 +36,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 16, 2009 +.Dd February 11, 2010 .Dt PKILL 1 .Os .Sh NAME @@ -44,7 +44,7 @@ .Nd find or signal processes by name .Sh SYNOPSIS .Nm pgrep -.Op Fl LSafilnovx +.Op Fl LSafilnoqvx .Op Fl F Ar pidfile .Op Fl G Ar gid .Op Fl M Ar core @@ -175,6 +175,8 @@ command. Select only the newest (most recently started) of the matching processes. .It Fl o Select only the oldest (least recently started) of the matching processes. +.It Fl q +Do not write anything to standard output. .It Fl s Ar sid Restrict matches to processes with a session ID in the comma-separated list Modified: head/bin/pkill/pkill.c ============================================================================== --- head/bin/pkill/pkill.c Fri Feb 12 18:48:18 2010 (r203801) +++ head/bin/pkill/pkill.c Fri Feb 12 18:52:24 2010 (r203802) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -110,6 +111,7 @@ static int matchargs; static int fullmatch; static int kthreads; static int cflags = REG_EXTENDED; +static int quiet; static kvm_t *kd; static pid_t mypid; @@ -180,10 +182,11 @@ main(int argc, char **argv) debug_opt = 0; pidfile = NULL; pidfilelock = 0; + quiet = 0; execf = NULL; coref = _PATH_DEVNULL; - while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1) + while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnoqs:t:u:vx")) != -1) switch (ch) { case 'D': debug_opt++; @@ -258,6 +261,11 @@ main(int argc, char **argv) oldest = 1; criteria = 1; break; + case 'q': + if (!pgrep) + usage(); + quiet = 1; + break; case 's': makelist(&sidlist, LT_SID, optarg); criteria = 1; @@ -549,7 +557,7 @@ usage(void) const char *ustr; if (pgrep) - ustr = "[-LSfilnovx] [-d delim]"; + ustr = "[-LSfilnoqvx] [-d delim]"; else ustr = "[-signal] [-ILfinovx]"; @@ -567,6 +575,10 @@ show_process(const struct kinfo_proc *kp { char **argv; + if (quiet) { + assert(pgrep); + return; + } if ((longfmt || !pgrep) && matchargs && (argv = kvm_getargv(kd, kp, 0)) != NULL) { printf("%d ", (int)kp->ki_pid); @@ -623,7 +635,8 @@ grepact(const struct kinfo_proc *kp) { show_process(kp); - printf("%s", delim); + if (!quiet) + printf("%s", delim); return (1); } Added: head/tools/regression/usr.bin/pkill/pgrep-q.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/pkill/pgrep-q.t Fri Feb 12 18:52:24 2010 (r203802) @@ -0,0 +1,38 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo "1..4" + +name="pgrep -q" +sleep0=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep1=`mktemp /tmp/$base.XXXXXX` || exit 1 +ln -sf /bin/sleep $sleep0 +$sleep0 5 & +sleep 0.3 +pid=$! +out="`pgrep -q -f $sleep0 2>&1`" +if [ $? -eq 0 ]; then + echo "ok 1 - $name" +else + echo "not ok 1 - $name" +fi +if [ -z "${out}" ]; then + echo "ok 2 - $name" +else + echo "not ok 2 - $name" +fi +out="`pgrep -q -f $sleep1 2>&1`" +if [ $? -ne 0 ]; then + echo "ok 3 - $name" +else + echo "not ok 3 - $name" +fi +if [ -z "${out}" ]; then + echo "ok 4 - $name" +else + echo "not ok 4 - $name" +fi +kill $pid +rm -f $sleep0 $sleep1 From owner-svn-src-all@FreeBSD.ORG Fri Feb 12 19:52:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3AFB1065692; Fri, 12 Feb 2010 19:52:51 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A42B98FC12; Fri, 12 Feb 2010 19:52:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1CJqpbg013354; Fri, 12 Feb 2010 19:52:51 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1CJqpt2013352; Fri, 12 Feb 2010 19:52:51 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002121952.o1CJqpt2013352@svn.freebsd.org> From: Rui Paulo Date: Fri, 12 Feb 2010 19:52: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: r203804 - head/sys/ddb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 19:52:51 -0000 Author: rpaulo Date: Fri Feb 12 19:52:51 2010 New Revision: 203804 URL: http://svn.freebsd.org/changeset/base/203804 Log: Add a space before printing 'thread pid ...' to match the space before ']'. Modified: head/sys/ddb/db_thread.c Modified: head/sys/ddb/db_thread.c ============================================================================== --- head/sys/ddb/db_thread.c Fri Feb 12 19:36:37 2010 (r203803) +++ head/sys/ddb/db_thread.c Fri Feb 12 19:52:51 2010 (r203804) @@ -48,7 +48,7 @@ db_print_thread(void) pid = -1; if (kdb_thread->td_proc != NULL) pid = kdb_thread->td_proc->p_pid; - db_printf("[thread pid %d tid %ld ]\n", pid, (long)kdb_thread->td_tid); + db_printf("[ thread pid %d tid %ld ]\n", pid, (long)kdb_thread->td_tid); } void From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 00:29:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DCE41065693; Sat, 13 Feb 2010 00:29:02 +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 2C75B8FC15; Sat, 13 Feb 2010 00:29:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D0T2C0073968; Sat, 13 Feb 2010 00:29:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D0T2g5073966; Sat, 13 Feb 2010 00:29:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002130029.o1D0T2g5073966@svn.freebsd.org> From: Xin LI Date: Sat, 13 Feb 2010 00:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203806 - stable/8/sbin/newfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 00:29:02 -0000 Author: delphij Date: Sat Feb 13 00:29:01 2010 New Revision: 203806 URL: http://svn.freebsd.org/changeset/base/203806 Log: MFC r203534: Correct two typos. Reported by: Brandon Falk Modified: stable/8/sbin/newfs/newfs.c Directory Properties: stable/8/sbin/newfs/ (props changed) Modified: stable/8/sbin/newfs/newfs.c ============================================================================== --- stable/8/sbin/newfs/newfs.c Fri Feb 12 20:27:35 2010 (r203805) +++ stable/8/sbin/newfs/newfs.c Sat Feb 13 00:29:01 2010 (r203806) @@ -499,13 +499,13 @@ usage() getprogname(), " [device-type]"); fprintf(stderr, "where fsoptions are:\n"); - fprintf(stderr, "\t-E Erase previuos disk content\n"); + fprintf(stderr, "\t-E Erase previous disk content\n"); fprintf(stderr, "\t-J Enable journaling via gjournal\n"); fprintf(stderr, "\t-L volume label to add to superblock\n"); fprintf(stderr, "\t-N do not create file system, just print out parameters\n"); fprintf(stderr, "\t-O file system format: 1 => UFS1, 2 => UFS2\n"); - fprintf(stderr, "\t-R regression test, supress random factors\n"); + fprintf(stderr, "\t-R regression test, suppress random factors\n"); fprintf(stderr, "\t-S sector size\n"); fprintf(stderr, "\t-T disktype\n"); fprintf(stderr, "\t-U enable soft updates\n"); From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 00:30:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB717106566B; Sat, 13 Feb 2010 00:30:50 +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 D96788FC13; Sat, 13 Feb 2010 00:30:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D0Uo2d074413; Sat, 13 Feb 2010 00:30:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D0UopM074410; Sat, 13 Feb 2010 00:30:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002130030.o1D0UopM074410@svn.freebsd.org> From: Xin LI Date: Sat, 13 Feb 2010 00:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203807 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 00:30:51 -0000 Author: delphij Date: Sat Feb 13 00:30:50 2010 New Revision: 203807 URL: http://svn.freebsd.org/changeset/base/203807 Log: MFC r203053: Add a manual page for nvram(4). Added: stable/8/share/man/man4/nvram.4 - copied unchanged from r203053, head/share/man/man4/nvram.4 Modified: stable/8/share/man/man4/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Sat Feb 13 00:29:01 2010 (r203806) +++ stable/8/share/man/man4/Makefile Sat Feb 13 00:30:50 2010 (r203807) @@ -290,6 +290,7 @@ MAN= aac.4 \ nsp.4 \ null.4 \ ${_nve.4} \ + ${_nvram.4} \ ${_nxge.4} \ ohci.4 \ orm.4 \ @@ -638,6 +639,7 @@ _ndis.4= ndis.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 _nve.4= nve.4 +_nvram.4= nvram.4 _nxge.4= nxge.4 _rr232x.4= rr232x.4 _speaker.4= speaker.4 Copied: stable/8/share/man/man4/nvram.4 (from r203053, head/share/man/man4/nvram.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/nvram.4 Sat Feb 13 00:30:50 2010 (r203807, copy of r203053, head/share/man/man4/nvram.4) @@ -0,0 +1,93 @@ +.\" +.\"Copyright (c) 2010 iXsystems, Inc. +.\"All rights reserved. +.\" written by: Xin LI +.\" +.\"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 January 27, 2010 +.Dt NVRAM 4 i386 +.Os +.Sh NAME +.Nm nvram +.Nd "non-volatile RAM" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device nvram" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +nvram_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides access to BIOS configuration NVRAM on i386 and amd64 +systems. +.Pp +PC motherboard uses a small non-volatile memory to store BIOS settings +which is usually part of its clock chip and sometimes referred as +.Dq CMOS SRAM . +This driver exposes bytes 14 through 128 of the NVRAM, or a total of +114 bytes, at offset zero of the device file +.Pa /dev/nvram . +.Pp +This driver is useful for cloning machines that shares the same hardware +configuration and need same BIOS setting tweaks. +.Sh IMPLEMENTATION NOTES +The BIOS NVRAM's bytes 16 through 31 are checksummed at byte 32. +This driver +.Em does not +take care for these checksums. +.Sh EXAMPLES +Backup existing BIOS NVRAM to +.Pa nvram.bin : +.Pp +.Dl dd if=/dev/nvram of=nvram.bin +.Pp +Restore BIOS NVRAM from +.Pa nvram.bin : +.Pp +.Dl dd if=nvram.bin of=/dev/nvram +.Sh SEE ALSO +.Xr dd 1 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 6.4 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver was written by +.An Peter Wemm . +This manual page was written by +.An Xin LI . From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 00:39:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1DD8106566C; Sat, 13 Feb 2010 00:39:03 +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 877BF8FC0C; Sat, 13 Feb 2010 00:39:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D0d3CP076435; Sat, 13 Feb 2010 00:39:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D0d3Em076434; Sat, 13 Feb 2010 00:39:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002130039.o1D0d3Em076434@svn.freebsd.org> From: Xin LI Date: Sat, 13 Feb 2010 00:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203808 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 00:39:03 -0000 Author: delphij Date: Sat Feb 13 00:39:03 2010 New Revision: 203808 URL: http://svn.freebsd.org/changeset/base/203808 Log: Migrate mergeinfo which was done on wrong target back to etc/ (203163). Modified: Directory Properties: stable/8/etc/ (props changed) stable/8/etc/services (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 00:39:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D567106568B; Sat, 13 Feb 2010 00:39:48 +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 62C818FC21; Sat, 13 Feb 2010 00:39:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D0dlp7076645; Sat, 13 Feb 2010 00:39:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D0dlqp076644; Sat, 13 Feb 2010 00:39:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002130039.o1D0dlqp076644@svn.freebsd.org> From: Xin LI Date: Sat, 13 Feb 2010 00:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203809 - stable/8/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 00:39:48 -0000 Author: delphij Date: Sat Feb 13 00:39:46 2010 New Revision: 203809 URL: http://svn.freebsd.org/changeset/base/203809 Log: MFC r202130: Set svn:executable to *. Modified: Directory Properties: stable/8/etc/ (props changed) stable/8/etc/rc.d/static_arp (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 02:24:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8D61106566C; Sat, 13 Feb 2010 02:24:23 +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 A945B8FC08; Sat, 13 Feb 2010 02:24:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D2ONfg099527; Sat, 13 Feb 2010 02:24:23 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D2ONJk099525; Sat, 13 Feb 2010 02:24:23 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002130224.o1D2ONJk099525@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 13 Feb 2010 02:24: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: r203810 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 02:24:23 -0000 Author: jkim Date: Sat Feb 13 02:24:23 2010 New Revision: 203810 URL: http://svn.freebsd.org/changeset/base/203810 Log: Implement LCD brightness control notify handler. Submitted by: Daniel Walter(d dot walter at 0x90 dot at) (intial version) Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Sat Feb 13 00:39:46 2010 (r203809) +++ head/sys/dev/acpica/acpi_video.c Sat Feb 13 02:24:23 2010 (r203810) @@ -83,6 +83,7 @@ static struct acpi_video_output *acpi_vi static void acpi_video_vo_bind(struct acpi_video_output *, ACPI_HANDLE); static void acpi_video_vo_destroy(struct acpi_video_output *); static int acpi_video_vo_check_level(struct acpi_video_output *, int); +static void acpi_video_vo_notify_handler(ACPI_HANDLE, UINT32, void *); static int acpi_video_vo_active_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_video_vo_bright_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_video_vo_presets_sysctl(SYSCTL_HANDLER_ARGS); @@ -93,6 +94,7 @@ static void vid_set_switch_policy(ACPI_H static int vid_enum_outputs(ACPI_HANDLE, void(*)(ACPI_HANDLE, UINT32, void *), void *); static int vo_get_brightness_levels(ACPI_HANDLE, int **); +static int vo_get_brightness(ACPI_HANDLE); static void vo_set_brightness(ACPI_HANDLE, int); static UINT32 vo_get_device_status(ACPI_HANDLE); static UINT32 vo_get_graphics_state(ACPI_HANDLE); @@ -101,6 +103,8 @@ static void vo_set_device_state(ACPI_HAN /* events */ #define VID_NOTIFY_SWITCHED 0x80 #define VID_NOTIFY_REPROBE 0x81 +#define VID_NOTIFY_INC_BRN 0x86 +#define VID_NOTIFY_DEC_BRN 0x87 /* _DOS (Enable/Disable Output Switching) argument bits */ #define DOS_SWITCH_MASK 3 @@ -577,6 +581,9 @@ acpi_video_vo_bind(struct acpi_video_out /* XXX - see above. */ vo->vo_economy = vo->vo_levels[BCL_ECONOMY]; } + if (vo->vo_levels != NULL) + AcpiInstallNotifyHandler(handle, ACPI_DEVICE_NOTIFY, + acpi_video_vo_notify_handler, vo); ACPI_SERIAL_END(video_output); } @@ -590,8 +597,11 @@ acpi_video_vo_destroy(struct acpi_video_ vo->vo_sysctl_tree = NULL; sysctl_ctx_free(&vo->vo_sysctl_ctx); } - if (vo->vo_levels != NULL) + if (vo->vo_levels != NULL) { + AcpiRemoveNotifyHandler(vo->handle, ACPI_DEVICE_NOTIFY, + acpi_video_vo_notify_handler); AcpiOsFree(vo->vo_levels); + } switch (vo->adr & DOD_DEVID_MASK) { case DOD_DEVID_MONITOR: @@ -627,6 +637,52 @@ acpi_video_vo_check_level(struct acpi_vi return (EINVAL); } +static void +acpi_video_vo_notify_handler(ACPI_HANDLE handle, UINT32 notify, void *context) +{ + struct acpi_video_output *vo; + int i, j, level, new_level; + + vo = context; + ACPI_SERIAL_BEGIN(video_output); + if (vo->handle == NULL) { + ACPI_SERIAL_END(video_output); + return; + } + + switch (notify) { + case VID_NOTIFY_INC_BRN: + case VID_NOTIFY_DEC_BRN: + if (vo->vo_levels == NULL) + break; + level = vo_get_brightness(vo->handle); + if (level < 0) + break; + new_level = level; + for (i = 0; i < vo->vo_numlevels; i++) { + j = vo->vo_levels[i]; + if (notify == VID_NOTIFY_INC_BRN) { + if (j > level && + (j < new_level || level == new_level)) + new_level = j; + } else { + if (j < level && + (j > new_level || level == new_level)) + new_level = j; + } + } + if (new_level != level) { + vo_set_brightness(vo->handle, new_level); + vo->vo_brightness = new_level; + } + break; + default: + printf("%s: unknown notify event 0x%x\n", + acpi_name(vo->handle), notify); + } + ACPI_SERIAL_END(video_output); +} + /* ARGSUSED */ static int acpi_video_vo_active_sysctl(SYSCTL_HANDLER_ARGS) @@ -900,6 +956,25 @@ out: return (num); } +static int +vo_get_brightness(ACPI_HANDLE handle) +{ + UINT32 level; + ACPI_STATUS status; + + ACPI_SERIAL_ASSERT(video_output); + status = acpi_GetInteger(handle, "_BQC", &level); + if (ACPI_FAILURE(status)) { + printf("can't evaluate %s._BQC - %s\n", acpi_name(handle), + AcpiFormatException(status)); + return (-1); + } + if (level > 100) + return (-1); + + return (level); +} + static void vo_set_brightness(ACPI_HANDLE handle, int level) { From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 02:30:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7413106566B; Sat, 13 Feb 2010 02:30:43 +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 A7B5D8FC08; Sat, 13 Feb 2010 02:30:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D2UhC7001051; Sat, 13 Feb 2010 02:30:43 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D2Uhnm001049; Sat, 13 Feb 2010 02:30:43 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002130230.o1D2Uhnm001049@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 13 Feb 2010 02:30: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: r203811 - head/sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 02:30:43 -0000 Author: jkim Date: Sat Feb 13 02:30:43 2010 New Revision: 203811 URL: http://svn.freebsd.org/changeset/base/203811 Log: Prefer correct and simpler backlight control methods for ASUS G2K laptop. Modified: head/sys/dev/acpi_support/acpi_asus.c Modified: head/sys/dev/acpi_support/acpi_asus.c ============================================================================== --- head/sys/dev/acpi_support/acpi_asus.c Sat Feb 13 02:24:23 2010 (r203810) +++ head/sys/dev/acpi_support/acpi_asus.c Sat Feb 13 02:30:43 2010 (r203811) @@ -270,8 +270,8 @@ static struct acpi_asus_model acpi_asus_ .wled_set = "WLED", .brn_get = "GPLV", .brn_set = "SPLV", - .lcd_get = "\\_SB.PCI0.SBRG.EC0.RPIN", - .lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10", + .lcd_get = "GBTL", + .lcd_set = "SBTL", .disp_get = "\\_SB.PCI0.PCE2.VGA.GETD", .disp_set = "SDSP", }, @@ -1134,26 +1134,7 @@ acpi_asus_sysctl_init(struct acpi_asus_s return (FALSE); case ACPI_ASUS_METHOD_LCD: if (sc->model->lcd_get) { - if (strncmp(sc->model->name, "G2K", 3) == 0) { - ACPI_BUFFER Buf; - ACPI_OBJECT Arg, Obj; - ACPI_OBJECT_LIST Args; - - Arg.Type = ACPI_TYPE_INTEGER; - Arg.Integer.Value = 0x11; - Args.Count = 1; - Args.Pointer = &Arg; - Buf.Length = sizeof(Obj); - Buf.Pointer = &Obj; - - status = AcpiEvaluateObject(sc->handle, - sc->model->lcd_get, &Args, &Buf); - if (ACPI_SUCCESS(status) && - Obj.Type == ACPI_TYPE_INTEGER) { - sc->s_lcd = Obj.Integer.Value; - return (TRUE); - } - } else if (strncmp(sc->model->name, "L3H", 3) == 0) { + if (strncmp(sc->model->name, "L3H", 3) == 0) { ACPI_BUFFER Buf; ACPI_OBJECT Arg[2], Obj; ACPI_OBJECT_LIST Args; From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 05:38:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 431F31065679; Sat, 13 Feb 2010 05:38:22 +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 34F3D8FC12; Sat, 13 Feb 2010 05:38:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D5cMsW044374; Sat, 13 Feb 2010 05:38:22 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D5cMNh044372; Sat, 13 Feb 2010 05:38:22 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002130538.o1D5cMNh044372@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 13 Feb 2010 05:38: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: r203813 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 05:38:22 -0000 Author: jkim Date: Sat Feb 13 05:38:21 2010 New Revision: 203813 URL: http://svn.freebsd.org/changeset/base/203813 Log: Make sanity check slightly more useful and tweak an error message. Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Sat Feb 13 02:36:00 2010 (r203812) +++ head/sys/dev/acpica/acpi_video.c Sat Feb 13 05:38:21 2010 (r203813) @@ -645,7 +645,7 @@ acpi_video_vo_notify_handler(ACPI_HANDLE vo = context; ACPI_SERIAL_BEGIN(video_output); - if (vo->handle == NULL) { + if (vo->handle != handle) { ACPI_SERIAL_END(video_output); return; } @@ -655,7 +655,7 @@ acpi_video_vo_notify_handler(ACPI_HANDLE case VID_NOTIFY_DEC_BRN: if (vo->vo_levels == NULL) break; - level = vo_get_brightness(vo->handle); + level = vo_get_brightness(handle); if (level < 0) break; new_level = level; @@ -672,13 +672,13 @@ acpi_video_vo_notify_handler(ACPI_HANDLE } } if (new_level != level) { - vo_set_brightness(vo->handle, new_level); + vo_set_brightness(handle, new_level); vo->vo_brightness = new_level; } break; default: - printf("%s: unknown notify event 0x%x\n", - acpi_name(vo->handle), notify); + printf("unknown notify event 0x%x from %s\n", + notify, acpi_name(handle)); } ACPI_SERIAL_END(video_output); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 09:45:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD888106566C; Sat, 13 Feb 2010 09:45:51 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99AAA8FC0C; Sat, 13 Feb 2010 09:45:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D9jp6T005296; Sat, 13 Feb 2010 09:45:51 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D9jo8T005254; Sat, 13 Feb 2010 09:45:50 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201002130945.o1D9jo8T005254@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sat, 13 Feb 2010 09:45: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: r203815 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 09:45:51 -0000 Author: wkoszek Date: Sat Feb 13 09:45:50 2010 New Revision: 203815 URL: http://svn.freebsd.org/changeset/base/203815 Log: Resort includes to match style(9) a bit more. No functional change is expected after this commit. Tested by: make buildworld Reviewed by: hps (patch without .h changes) Modified: head/lib/libusb/libusb.h head/lib/libusb/libusb10.c head/lib/libusb/libusb10_desc.c head/lib/libusb/libusb10_io.c head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h head/lib/libusb/libusb20_compat01.c head/lib/libusb/libusb20_desc.c head/lib/libusb/libusb20_ugen20.c head/lib/libusb/usb.h Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Sat Feb 13 08:23:47 2010 (r203814) +++ head/lib/libusb/libusb.h Sat Feb 13 09:45:50 2010 (r203815) @@ -30,8 +30,6 @@ #include #include - - #ifdef __cplusplus extern "C" { #endif Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Sat Feb 13 08:23:47 2010 (r203814) +++ head/lib/libusb/libusb10.c Sat Feb 13 09:45:50 2010 (r203815) @@ -25,16 +25,17 @@ * SUCH DAMAGE. */ +#include +#include +#include + #include -#include -#include -#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include #include "libusb20.h" #include "libusb20_desc.h" Modified: head/lib/libusb/libusb10_desc.c ============================================================================== --- head/lib/libusb/libusb10_desc.c Sat Feb 13 08:23:47 2010 (r203814) +++ head/lib/libusb/libusb10_desc.c Sat Feb 13 09:45:50 2010 (r203815) @@ -24,10 +24,11 @@ * SUCH DAMAGE. */ -#include -#include #include +#include +#include + #include "libusb20.h" #include "libusb20_desc.h" #include "libusb20_int.h" Modified: head/lib/libusb/libusb10_io.c ============================================================================== --- head/lib/libusb/libusb10_io.c Sat Feb 13 08:23:47 2010 (r203814) +++ head/lib/libusb/libusb10_io.c Sat Feb 13 09:45:50 2010 (r203815) @@ -24,14 +24,15 @@ * SUCH DAMAGE. */ -#include -#include -#include +#include + +#include #include #include +#include +#include #include -#include -#include +#include #include "libusb20.h" #include "libusb20_desc.h" Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Sat Feb 13 08:23:47 2010 (r203814) +++ head/lib/libusb/libusb20.c Sat Feb 13 09:45:50 2010 (r203815) @@ -24,12 +24,13 @@ * SUCH DAMAGE. */ +#include + +#include +#include #include #include #include -#include -#include -#include #include "libusb20.h" #include "libusb20_desc.h" Modified: head/lib/libusb/libusb20.h ============================================================================== --- head/lib/libusb/libusb20.h Sat Feb 13 08:23:47 2010 (r203814) +++ head/lib/libusb/libusb20.h Sat Feb 13 09:45:50 2010 (r203815) @@ -29,13 +29,13 @@ #ifndef _LIBUSB20_H_ #define _LIBUSB20_H_ -#include -#include -#include - +#include #include #include -#include + +#include +#include +#include #ifdef __cplusplus extern "C" { Modified: head/lib/libusb/libusb20_compat01.c ============================================================================== --- head/lib/libusb/libusb20_compat01.c Sat Feb 13 08:23:47 2010 (r203814) +++ head/lib/libusb/libusb20_compat01.c Sat Feb 13 09:45:50 2010 (r203815) @@ -30,9 +30,9 @@ #include -#include -#include #include +#include +#include #include "libusb20.h" #include "libusb20_desc.h" Modified: head/lib/libusb/libusb20_desc.c ============================================================================== --- head/lib/libusb/libusb20_desc.c Sat Feb 13 08:23:47 2010 (r203814) +++ head/lib/libusb/libusb20_desc.c Sat Feb 13 09:45:50 2010 (r203815) @@ -24,10 +24,11 @@ * SUCH DAMAGE. */ +#include + #include #include #include -#include #include "libusb20.h" #include "libusb20_desc.h" Modified: head/lib/libusb/libusb20_ugen20.c ============================================================================== --- head/lib/libusb/libusb20_ugen20.c Sat Feb 13 08:23:47 2010 (r203814) +++ head/lib/libusb/libusb20_ugen20.c Sat Feb 13 09:45:50 2010 (r203815) @@ -27,12 +27,12 @@ #include #include +#include +#include #include #include -#include #include -#include -#include +#include #include "libusb20.h" #include "libusb20_desc.h" Modified: head/lib/libusb/usb.h ============================================================================== --- head/lib/libusb/usb.h Sat Feb 13 08:23:47 2010 (r203814) +++ head/lib/libusb/usb.h Sat Feb 13 09:45:50 2010 (r203815) @@ -27,9 +27,10 @@ #ifndef _LIBUSB20_COMPAT_01_H_ #define _LIBUSB20_COMPAT_01_H_ -#include -#include #include +#include + +#include /* USB interface class codes */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 10:22:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C26EB106566C; Sat, 13 Feb 2010 10:22:07 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF51F8FC0A; Sat, 13 Feb 2010 10:22:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DAM7j1041923; Sat, 13 Feb 2010 10:22:07 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DAM75M041921; Sat, 13 Feb 2010 10:22:07 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002131022.o1DAM75M041921@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 13 Feb 2010 10:22: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: r203816 - head/sbin/restore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 10:22:07 -0000 Author: jh Date: Sat Feb 13 10:22:07 2010 New Revision: 203816 URL: http://svn.freebsd.org/changeset/base/203816 Log: Don't try to determine tape block size when the -P option is used. This was missed in r203157. PR: bin/121502 Modified: head/sbin/restore/tape.c Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Sat Feb 13 09:45:50 2010 (r203815) +++ head/sbin/restore/tape.c Sat Feb 13 10:22:07 2010 (r203816) @@ -227,7 +227,7 @@ setup(void) volno = 1; setdumpnum(); FLUSHTAPEBUF(); - if (!pipein && !bflag) + if (!pipein && !pipecmdin && !bflag) findtapeblksize(); if (gethead(&spcl) == FAIL) { fprintf(stderr, "Tape is not a dump tape\n"); From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 10:26:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C6B7106568D; Sat, 13 Feb 2010 10:26:00 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6853B8FC13; Sat, 13 Feb 2010 10:26:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DAQ0Bu045467; Sat, 13 Feb 2010 10:26:00 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DAQ0qw045465; Sat, 13 Feb 2010 10:26:00 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002131026.o1DAQ0qw045465@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 13 Feb 2010 10:26:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203817 - stable/8/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 10:26:00 -0000 Author: gavin Date: Sat Feb 13 10:26:00 2010 New Revision: 203817 URL: http://svn.freebsd.org/changeset/base/203817 Log: Merge r203393,r203395 from head: The multiplicand a = 0x5deece66d = 25214903917, not 0xfdeece66d. This bug in the man page has gone unnoticed for over 15 years! PR: docs/143461 Submitted by: Jeremy Huddleston jeremyhu apple.com Modified: stable/8/lib/libc/gen/rand48.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/gen/rand48.3 ============================================================================== --- stable/8/lib/libc/gen/rand48.3 Sat Feb 13 10:22:07 2010 (r203816) +++ stable/8/lib/libc/gen/rand48.3 Sat Feb 13 10:26:00 2010 (r203817) @@ -12,7 +12,7 @@ .\" @(#)rand48.3 V1.0 MB 8 Oct 1993 .\" $FreeBSD$ .\" -.Dd October 8, 1993 +.Dd February 2, 2010 .Dt RAND48 3 .Os .Sh NAME @@ -57,7 +57,7 @@ The particular formula employed is r(n+1) = (a * r(n) + c) mod m where the default values are -for the multiplicand a = 0xfdeece66d = 25214903917 and +for the multiplicand a = 0x5deece66d = 25214903917 and the addend c = 0xb = 11. The modulo is always fixed at m = 2 ** 48. r(n) is called the seed of the random number generator. From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 10:34:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CC4C1065676; Sat, 13 Feb 2010 10:34: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 19ABD8FC08; Sat, 13 Feb 2010 10:34:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DAYoOh053659; Sat, 13 Feb 2010 10:34:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DAYoCc053656; Sat, 13 Feb 2010 10:34:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002131034.o1DAYoCc053656@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Feb 2010 10:34: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: r203818 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 10:34:51 -0000 Author: kib Date: Sat Feb 13 10:34:50 2010 New Revision: 203818 URL: http://svn.freebsd.org/changeset/base/203818 Log: When ffs_realloccg() failed to allocate bigger fragment and, because pending blocks are scheduled for removal, goes to retry the (re)allocation, clear the bp pointer. It might happen that meantime free space is really exhausted and we are entering nospace: label without bread()ing buffer, causing stale bp value to be brelse()d again. Tested by: pho (Producing a scenario to reliably reproduce the race appeared to be much harder then fixing the bug) MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sat Feb 13 10:26:00 2010 (r203817) +++ head/sys/ufs/ffs/ffs_alloc.c Sat Feb 13 10:34:50 2010 (r203818) @@ -432,8 +432,10 @@ nospace: reclaimed = 1; softdep_request_cleanup(fs, vp); UFS_UNLOCK(ump); - if (bp) + if (bp) { brelse(bp); + bp = NULL; + } UFS_LOCK(ump); goto retry; } From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 10:42:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC9941065670; Sat, 13 Feb 2010 10:42:29 +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 D8C428FC12; Sat, 13 Feb 2010 10:42:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DAgTu4060952; Sat, 13 Feb 2010 10:42:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DAgTos060950; Sat, 13 Feb 2010 10:42:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002131042.o1DAgTos060950@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Feb 2010 10:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203819 - stable/7/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 10:42:30 -0000 Author: kib Date: Sat Feb 13 10:42:29 2010 New Revision: 203819 URL: http://svn.freebsd.org/changeset/base/203819 Log: MFC r195635: Properly set MAP_ENTRY_WIRE_SKIPPED when aborting the loop. PR: kern/143717 (for RELENG_7) Approved by: re (bz) Modified: stable/7/sys/vm/vm_map.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/vm/vm_map.c ============================================================================== --- stable/7/sys/vm/vm_map.c Sat Feb 13 10:34:50 2010 (r203818) +++ stable/7/sys/vm/vm_map.c Sat Feb 13 10:42:29 2010 (r203819) @@ -2060,12 +2060,12 @@ vm_map_wire(vm_map_t map, vm_offset_t st if (entry->wired_count == 0) { if ((entry->protection & (VM_PROT_READ|VM_PROT_EXECUTE)) == 0) { + entry->eflags |= MAP_ENTRY_WIRE_SKIPPED; if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { end = entry->end; rv = KERN_INVALID_ADDRESS; goto done; } - entry->eflags |= MAP_ENTRY_WIRE_SKIPPED; goto next_entry; } entry->wired_count++; From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 11:24:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CA491065670; Sat, 13 Feb 2010 11:24:11 +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 697AF8FC1D; Sat, 13 Feb 2010 11:24:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DBOBSa098666; Sat, 13 Feb 2010 11:24:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DBOBm8098664; Sat, 13 Feb 2010 11:24:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002131124.o1DBOBm8098664@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Feb 2010 11:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203820 - releng/7.3/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 11:24:11 -0000 Author: kib Date: Sat Feb 13 11:24:11 2010 New Revision: 203820 URL: http://svn.freebsd.org/changeset/base/203820 Log: MFC r195635: Properly set MAP_ENTRY_WIRE_SKIPPED when aborting the loop. PR: kern/143717 (for RELENG_7) Approved by: re (bz) Modified: releng/7.3/sys/vm/vm_map.c Directory Properties: releng/7.3/sys/ (props changed) releng/7.3/sys/cddl/contrib/opensolaris/ (props changed) releng/7.3/sys/contrib/dev/acpica/ (props changed) releng/7.3/sys/contrib/pf/ (props changed) Modified: releng/7.3/sys/vm/vm_map.c ============================================================================== --- releng/7.3/sys/vm/vm_map.c Sat Feb 13 10:42:29 2010 (r203819) +++ releng/7.3/sys/vm/vm_map.c Sat Feb 13 11:24:11 2010 (r203820) @@ -2060,12 +2060,12 @@ vm_map_wire(vm_map_t map, vm_offset_t st if (entry->wired_count == 0) { if ((entry->protection & (VM_PROT_READ|VM_PROT_EXECUTE)) == 0) { + entry->eflags |= MAP_ENTRY_WIRE_SKIPPED; if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { end = entry->end; rv = KERN_INVALID_ADDRESS; goto done; } - entry->eflags |= MAP_ENTRY_WIRE_SKIPPED; goto next_entry; } entry->wired_count++; From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 11:34:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E56001065693; Sat, 13 Feb 2010 11:34:25 +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 D26418FC18; Sat, 13 Feb 2010 11:34:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DBYPsq008581; Sat, 13 Feb 2010 11:34:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DBYPJq008579; Sat, 13 Feb 2010 11:34:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002131134.o1DBYPJq008579@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Feb 2010 11:34: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: r203822 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 11:34:26 -0000 Author: kib Date: Sat Feb 13 11:34:25 2010 New Revision: 203822 URL: http://svn.freebsd.org/changeset/base/203822 Log: Remove unused macros. MFC after: 1 week Modified: head/sys/fs/msdosfs/denode.h Modified: head/sys/fs/msdosfs/denode.h ============================================================================== --- head/sys/fs/msdosfs/denode.h Sat Feb 13 11:33:14 2010 (r203821) +++ head/sys/fs/msdosfs/denode.h Sat Feb 13 11:34:25 2010 (r203822) @@ -207,9 +207,6 @@ struct denode { ((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \ putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)) -#define de_forw de_chain[0] -#define de_back de_chain[1] - #ifdef _KERNEL #define VTODE(vp) ((struct denode *)(vp)->v_data) From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 11:47:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D9B3106566B; Sat, 13 Feb 2010 11:47:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEE3D8FC15; Sat, 13 Feb 2010 11:47:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DBl4mn020044; Sat, 13 Feb 2010 11:47:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DBl4hK020042; Sat, 13 Feb 2010 11:47:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201002131147.o1DBl4hK020042@svn.freebsd.org> From: Andriy Gapon Date: Sat, 13 Feb 2010 11: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: r203823 - head/gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 11:47:05 -0000 Author: avg Date: Sat Feb 13 11:47:04 2010 New Revision: 203823 URL: http://svn.freebsd.org/changeset/base/203823 Log: kgdb: initialize n_type field of nlist entry for kvm_nlist call kvm_nlist skips lookup for entries that have n_type != N_UNDF. N_UNDF happens to be zero, so n_type typically has a correct value by accident, but not always. Note: jhb has a patch that replaces kvm_nlist use with direct gdb parsing. MFC after: 5 days X-MFC-Note: unless jhb commits kvm_nlist => kgdb_parse change Modified: head/gnu/usr.bin/gdb/kgdb/kthr.c Modified: head/gnu/usr.bin/gdb/kgdb/kthr.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/kthr.c Sat Feb 13 11:34:25 2010 (r203822) +++ head/gnu/usr.bin/gdb/kgdb/kthr.c Sat Feb 13 11:47:04 2010 (r203823) @@ -58,6 +58,7 @@ kgdb_lookup(const char *sym) { struct nlist nl[2]; + nl[0].n_type = N_UNDF; nl[0].n_name = (char *)(uintptr_t)sym; nl[1].n_name = NULL; if (kvm_nlist(kvm, nl) != 0) From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 11:54:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E18B1065672; Sat, 13 Feb 2010 11:54:02 +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 0B5488FC19; Sat, 13 Feb 2010 11:54:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DBs1SU026573; Sat, 13 Feb 2010 11:54:01 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DBs1iY026570; Sat, 13 Feb 2010 11:54:01 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201002131154.o1DBs1iY026570@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 13 Feb 2010 11:54: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: r203824 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 11:54:02 -0000 Author: trasz Date: Sat Feb 13 11:54:01 2010 New Revision: 203824 URL: http://svn.freebsd.org/changeset/base/203824 Log: Fix VBAD description. Modified: head/share/man/man9/vnode.9 Modified: head/share/man/man9/vnode.9 ============================================================================== --- head/share/man/man9/vnode.9 Sat Feb 13 11:47:04 2010 (r203823) +++ head/share/man/man9/vnode.9 Sat Feb 13 11:54:01 2010 (r203824) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2010 +.Dd February 13, 2010 .Os .Dt VNODE 9 .Sh NAME @@ -137,7 +137,7 @@ Advisory locking will not work on this. A FIFO (named pipe). Advisory locking will not work on this. .It Dv VBAD -An old style bad sector map +Indicates that the vnode has been reclaimed. .El .Sh IMPLEMENTATION NOTES VFIFO uses the "struct fileops" from From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 12:03:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC6FE1065692; Sat, 13 Feb 2010 12:03:03 +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 A900F8FC13; Sat, 13 Feb 2010 12:03:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DC33pY034862; Sat, 13 Feb 2010 12:03:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DC33Rf034860; Sat, 13 Feb 2010 12:03:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201002131203.o1DC33Rf034860@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 13 Feb 2010 12:03: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: r203825 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 12:03:03 -0000 Author: trasz Date: Sat Feb 13 12:03:03 2010 New Revision: 203825 URL: http://svn.freebsd.org/changeset/base/203825 Log: Remove list of locking primitives, which is kind of redundant, move information about witness(9) to the section about interactions, and expand 'contexts' table. Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Sat Feb 13 11:54:01 2010 (r203824) +++ head/share/man/man9/locking.9 Sat Feb 13 12:03:03 2010 (r203825) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 10, 2010 +.Dd February 13, 2010 .Dt LOCKING 9 .Os .Sh NAME @@ -36,41 +36,9 @@ The kernel is written to run across multiple CPUs and as such requires several different synchronization primitives to allow the developers to safely access and manipulate the many data types required. -.Pp -These include: -.Bl -enum -.It -Mutexes -.It -Spin mutexes -.It -Pool mutexes -.It -Shared/exclusive locks -.It -Reader/writer locks -.It -Read-mostly locks -.It -Counting semaphores -.It -Condition variables -.It -Sleep/wakeup -.It -Giant -.It -Lockmanager locks -.El -.Pp -The primitives interact and have a number of rules regarding how -they can and can not be combined. -Many of these rules are checked using the -.Xr witness 4 -code. -.Pp .Ss Mutexes -Mutexes are the most commonly used synchronization primitive in the kernel. +Mutexes (also called "sleep mutexes") are the most commonly used +synchronization primitive in the kernel. Thread acquires (locks) a mutex before accessing data shared with other threads (including interrupt threads), and releases (unlocks) it afterwards. If the mutex cannot be acquired, the thread requesting it will sleep. @@ -85,12 +53,10 @@ the two is that spin mutexes never sleep for the thread holding the lock, which runs on another CPU, to release it. Differently from ordinary mutex, spin mutexes disable interrupts when acquired. Since disabling interrupts is expensive, they are also generally slower. -Spin mutexes should only be used to protect data shared with primary -(INTR_FILTER) interrupt code. -You -.Em must not -do anything that deschedules the thread while you -are holding a spin mutex. +Spin mutexes should be used only when neccessary, e.g. to protect data shared +with interrupt filter code (see +.Xr bus_setup_intr 9 +for details). .Ss Pool mutexes With most synchronisaton primitives, such as mutexes, programmer must provide a piece of allocated memory to hold the primitive. @@ -284,6 +250,11 @@ See .Xr lock 9 for details. .Sh INTERACTIONS +The primitives interact and have a number of rules regarding how +they can and can not be combined. +Many of these rules are checked using the +.Xr witness 4 +code. .Ss Bounded vs. unbounded sleep The following primitives perform bounded sleep: mutexes, pool mutexes, reader/writer locks and read-mostly locks. @@ -320,21 +291,23 @@ rwlock, your sleep, will cause a panic. If the sleep only happens rarely it may be years before the bad code path is found. .Pp +It is an error to do any operation that could result in any kind of sleep when +running inside an interrupt filter. +.Pp It is an error to do any operation that could result in unbounded sleep when running inside an interrupt thread. .Ss Interaction table -The following table shows what you can and can not do if you hold -one of the synchronization primitives discussed here: -(someone who knows what they are talking about should write this table) +The following table shows what you can and can not do while holding +one of the synchronization primitives discussed: .Bl -column ".Ic xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXX" -offset indent .It Xo .Em "You have: You want:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep .Xc -.It Ic spin mtx Ta \&ok-1 Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no-3 -.It Ic mutex Ta \&ok Ta \&ok-1 Ta \&no Ta \&ok Ta \&ok Ta \&no-3 -.It Ic sx Ta \&ok Ta \&ok Ta \&ok-2 Ta \&ok Ta \&ok Ta \&ok-4 -.It Ic rwlock Ta \&ok Ta \&ok Ta \&no Ta \&ok-2 Ta \&ok Ta \&no-3 -.It Ic rmlock Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&ok-2 Ta \&no +.It spin mtx Ta \&ok-1 Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no-3 +.It mutex Ta \&ok Ta \&ok-1 Ta \&no Ta \&ok Ta \&ok Ta \&no-3 +.It sx Ta \&ok Ta \&ok Ta \&ok-2 Ta \&ok Ta \&ok Ta \&ok-4 +.It rwlock Ta \&ok Ta \&ok Ta \&no Ta \&ok-2 Ta \&ok Ta \&no-3 +.It rmlock Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&ok-2 Ta \&no .El .Pp .Em *1 @@ -364,10 +337,12 @@ The next table shows what can be used in At this time this is a rather easy to remember table. .Bl -column ".Ic Xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXX" -offset indent .It Xo -.Em "Context:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep +.Em "Context:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep .Xc -.It interrupt: Ta \&ok Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no -.It idle: Ta \&ok Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no +.It interrupt filter: Ta \&ok Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no +.It ithread: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&ok Ta \&no +.It callout: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&no Ta \&no +.It syscall: Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok .El .Sh SEE ALSO .Xr condvar 9 , From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 12:11:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C03E1065672; Sat, 13 Feb 2010 12:11:04 +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 4995D8FC15; Sat, 13 Feb 2010 12:11:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DCB405042259; Sat, 13 Feb 2010 12:11:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DCB4KV042257; Sat, 13 Feb 2010 12:11:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002131211.o1DCB4KV042257@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Feb 2010 12:11: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: r203826 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 12:11:04 -0000 Author: kib Date: Sat Feb 13 12:11:03 2010 New Revision: 203826 URL: http://svn.freebsd.org/changeset/base/203826 Log: Use M_ZERO instead of calling bzero(). Fix function name in the comment. MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_denode.c Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Sat Feb 13 12:03:03 2010 (r203825) +++ head/sys/fs/msdosfs/msdosfs_denode.c Sat Feb 13 12:11:03 2010 (r203826) @@ -144,11 +144,11 @@ deget(pmp, dirclust, diroffset, depp) } /* - * Do the MALLOC before the getnewvnode since doing so afterward + * Do the malloc before the getnewvnode since doing so afterward * might cause a bogus v_data pointer to get dereferenced * elsewhere if MALLOC should block. */ - ldep = malloc(sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK); + ldep = malloc(sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK | M_ZERO); /* * Directory entry was not in cache, have to create a vnode and @@ -161,7 +161,6 @@ deget(pmp, dirclust, diroffset, depp) free(ldep, M_MSDOSFSNODE); return error; } - bzero((caddr_t)ldep, sizeof *ldep); nvp->v_data = ldep; ldep->de_vnode = nvp; ldep->de_flag = 0; From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 12:35:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEA64106566B; Sat, 13 Feb 2010 12:35:43 +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 7198D8FC08; Sat, 13 Feb 2010 12:35:43 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 292B81CFC1; Sat, 13 Feb 2010 13:35:42 +0100 (CET) Date: Sat, 13 Feb 2010 13:35:42 +0100 From: Ed Schouten To: Konstantin Belousov Message-ID: <20100213123542.GC8200@hoeg.nl> References: <201002131211.o1DCB4KV042257@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8NvZYKFJsRX2Djef" Content-Disposition: inline In-Reply-To: <201002131211.o1DCB4KV042257@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203826 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 12:35:43 -0000 --8NvZYKFJsRX2Djef Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Kostik, * Konstantin Belousov wrote: > /* > - * Do the MALLOC before the getnewvnode since doing so afterward > + * Do the malloc before the getnewvnode since doing so afterward > * might cause a bogus v_data pointer to get dereferenced > * elsewhere if MALLOC should block. ^^^^^^ Maybe this should be changed as well? Greetings, --=20 Ed Schouten WWW: http://80386.nl/ --8NvZYKFJsRX2Djef Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkt2nJ0ACgkQ52SDGA2eCwWGbQCffej+mJhiSbiv1qDkh/Ro1wQb m3YAmQHtIwLoB2MD1HTzbpE/0xFtTnti =Mggp -----END PGP SIGNATURE----- --8NvZYKFJsRX2Djef-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 12:41:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 945E71065672; Sat, 13 Feb 2010 12:41: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 820228FC0A; Sat, 13 Feb 2010 12:41:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DCf7to069863; Sat, 13 Feb 2010 12:41:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DCf7hn069852; Sat, 13 Feb 2010 12:41:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002131241.o1DCf7hn069852@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Feb 2010 12:41: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: r203827 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 12:41:07 -0000 Author: kib Date: Sat Feb 13 12:41:07 2010 New Revision: 203827 URL: http://svn.freebsd.org/changeset/base/203827 Log: - Add idempotency guards so the structures can be used in other utilities. - Update bpb structs with reserved fields. - In direntry struct join deName with deExtension. Although a fix was attempted in the past, these fields were being overflowed, Now this is consistent with the spec, and we can now share the WinChksum code with NetBSD. Submitted by: Pedro F. Giffuni Mostly obtained from: NetBSD Reviewed by: bde MFC after: 2 weeks Modified: head/sys/fs/msdosfs/bootsect.h head/sys/fs/msdosfs/bpb.h head/sys/fs/msdosfs/direntry.h head/sys/fs/msdosfs/msdosfs_conv.c head/sys/fs/msdosfs/msdosfs_lookup.c head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/bootsect.h ============================================================================== --- head/sys/fs/msdosfs/bootsect.h Sat Feb 13 12:11:03 2010 (r203826) +++ head/sys/fs/msdosfs/bootsect.h Sat Feb 13 12:41:07 2010 (r203827) @@ -16,6 +16,8 @@ * * October 1992 */ +#ifndef _FS_MSDOSFS_BOOTSECT_H_ +#define _FS_MSDOSFS_BOOTSECT_H_ /* * Format of a boot sector. This is the first sector on a DOS floppy disk @@ -91,3 +93,5 @@ union bootsector { #define bsHiddenSecs bsBPB.bpbHiddenSecs #define bsHugeSectors bsBPB.bpbHugeSectors #endif + +#endif /* !_FS_MSDOSFS_BOOTSECT_H_ */ Modified: head/sys/fs/msdosfs/bpb.h ============================================================================== --- head/sys/fs/msdosfs/bpb.h Sat Feb 13 12:11:03 2010 (r203826) +++ head/sys/fs/msdosfs/bpb.h Sat Feb 13 12:41:07 2010 (r203827) @@ -17,6 +17,9 @@ * October 1992 */ +#ifndef _FS_MSDOSFS_BPB_H_ +#define _FS_MSDOSFS_BPB_H_ + /* * BIOS Parameter Block (BPB) for DOS 3.3 */ @@ -78,7 +81,7 @@ struct bpb710 { u_int32_t bpbRootClust; /* start cluster for root directory */ u_int16_t bpbFSInfo; /* filesystem info structure sector */ u_int16_t bpbBackup; /* backup boot sector */ - /* There is a 12 byte filler here, but we ignore it */ + u_int8_t bpbReserved[12]; /* reserved for future expansion */ }; /* @@ -153,7 +156,7 @@ struct byte_bpb710 { u_int8_t bpbRootClust[4]; /* start cluster for root directory */ u_int8_t bpbFSInfo[2]; /* filesystem info structure sector */ u_int8_t bpbBackup[2]; /* backup boot sector */ - /* There is a 12 byte filler here, but we ignore it */ + u_int8_t bpbReserved[12]; /* reserved for future expansion */ }; /* @@ -168,3 +171,4 @@ struct fsinfo { u_int8_t fsifill2[12]; u_int8_t fsisig3[4]; }; +#endif /* !_FS_MSDOSFS_BPB_H_ */ Modified: head/sys/fs/msdosfs/direntry.h ============================================================================== --- head/sys/fs/msdosfs/direntry.h Sat Feb 13 12:11:03 2010 (r203826) +++ head/sys/fs/msdosfs/direntry.h Sat Feb 13 12:41:07 2010 (r203827) @@ -47,16 +47,17 @@ * * October 1992 */ +#ifndef _FS_MSDOSFS_DIRENTRY_H_ +#define _FS_MSDOSFS_DIRENTRY_H_ /* * Structure of a dos directory entry. */ struct direntry { - u_int8_t deName[8]; /* filename, blank filled */ + u_int8_t deName[11]; /* filename, blank filled */ #define SLOT_EMPTY 0x00 /* slot has never been used */ #define SLOT_E5 0x05 /* the real value is 0xe5 */ #define SLOT_DELETED 0xe5 /* file in this slot deleted */ - u_int8_t deExtension[3]; /* extension, blank filled */ u_int8_t deAttributes; /* file attributes */ #define ATTR_NORMAL 0x00 /* normal file */ #define ATTR_READONLY 0x01 /* file is readonly */ @@ -155,7 +156,8 @@ int winChkName(struct mbnambuf *nbp, con int chksum, struct msdosfsmount *pmp); int win2unixfn(struct mbnambuf *nbp, struct winentry *wep, int chksum, struct msdosfsmount *pmp); -u_int8_t winChksum(struct direntry *dep); +u_int8_t winChksum(u_int8_t *name); int winSlotCnt(const u_char *un, size_t unlen, struct msdosfsmount *pmp); size_t winLenFixup(const u_char *un, size_t unlen); #endif /* _KERNEL */ +#endif /* !_FS_MSDOSFS_DIRENTRY_H_ */ Modified: head/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_conv.c Sat Feb 13 12:11:03 2010 (r203826) +++ head/sys/fs/msdosfs/msdosfs_conv.c Sat Feb 13 12:41:07 2010 (r203827) @@ -741,22 +741,13 @@ win2unixfn(nbp, wep, chksum, pmp) * Compute the unrolled checksum of a DOS filename for Win95 LFN use. */ u_int8_t -winChksum(struct direntry *dep) +winChksum(u_int8_t *name) { + int i; u_int8_t s; - s = dep->deName[0]; - s = ((s << 7) | (s >> 1)) + dep->deName[1]; - s = ((s << 7) | (s >> 1)) + dep->deName[2]; - s = ((s << 7) | (s >> 1)) + dep->deName[3]; - s = ((s << 7) | (s >> 1)) + dep->deName[4]; - s = ((s << 7) | (s >> 1)) + dep->deName[5]; - s = ((s << 7) | (s >> 1)) + dep->deName[6]; - s = ((s << 7) | (s >> 1)) + dep->deName[7]; - s = ((s << 7) | (s >> 1)) + dep->deExtension[0]; - s = ((s << 7) | (s >> 1)) + dep->deExtension[1]; - s = ((s << 7) | (s >> 1)) + dep->deExtension[2]; - + for (s = 0, i = 11; --i >= 0; s += *name++) + s = (s << 7)|(s >> 1); return (s); } Modified: head/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_lookup.c Sat Feb 13 12:11:03 2010 (r203826) +++ head/sys/fs/msdosfs/msdosfs_lookup.c Sat Feb 13 12:41:07 2010 (r203827) @@ -276,7 +276,7 @@ msdosfs_lookup(ap) /* * Check for a checksum or name match */ - chksum_ok = (chksum == winChksum(dep)); + chksum_ok = (chksum == winChksum(dep->deName)); if (!chksum_ok && (!olddos || bcmp(dosfilename, dep->deName, 11))) { chksum = -1; @@ -617,7 +617,7 @@ createde(dep, ddep, depp, cnp) * Now write the Win95 long name */ if (ddep->de_fndcnt > 0) { - u_int8_t chksum = winChksum(ndep); + u_int8_t chksum = winChksum(ndep->deName); const u_char *un = (const u_char *)cnp->cn_nameptr; int unlen = cnp->cn_namelen; int cnt = 1; Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Sat Feb 13 12:11:03 2010 (r203826) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Sat Feb 13 12:41:07 2010 (r203827) @@ -1287,7 +1287,7 @@ static struct { struct direntry dot; struct direntry dotdot; } dosdirtemplate = { - { ". ", " ", /* the . entry */ + { ". ", /* the . entry */ ATTR_DIRECTORY, /* file attribute */ 0, /* reserved */ 0, { 0, 0 }, { 0, 0 }, /* create time & date */ @@ -1297,7 +1297,7 @@ static struct { { 0, 0 }, /* startcluster */ { 0, 0, 0, 0 } /* filesize */ }, - { ".. ", " ", /* the .. entry */ + { ".. ", /* the .. entry */ ATTR_DIRECTORY, /* file attribute */ 0, /* reserved */ 0, { 0, 0 }, { 0, 0 }, /* create time & date */ @@ -1729,7 +1729,7 @@ msdosfs_readdir(ap) } else dirbuf.d_fileno = (uint32_t)fileno; - if (chksum != winChksum(dentp)) { + if (chksum != winChksum(dentp->deName)) { dirbuf.d_namlen = dos2unixfn(dentp->deName, (u_char *)dirbuf.d_name, dentp->deLowerCase | From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 12:50:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD19E106566C; Sat, 13 Feb 2010 12:50:09 +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 ABA4F8FC13; Sat, 13 Feb 2010 12:50:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DCo990078171; Sat, 13 Feb 2010 12:50:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DCo9S7078168; Sat, 13 Feb 2010 12:50:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002131250.o1DCo9S7078168@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Feb 2010 12:50: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: r203828 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 12:50:09 -0000 Author: kib Date: Sat Feb 13 12:50:09 2010 New Revision: 203828 URL: http://svn.freebsd.org/changeset/base/203828 Log: Fix function name in the comment in the second location too. Submitted by: ed MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_denode.c Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Sat Feb 13 12:41:07 2010 (r203827) +++ head/sys/fs/msdosfs/msdosfs_denode.c Sat Feb 13 12:50:09 2010 (r203828) @@ -146,7 +146,7 @@ deget(pmp, dirclust, diroffset, depp) /* * Do the malloc before the getnewvnode since doing so afterward * might cause a bogus v_data pointer to get dereferenced - * elsewhere if MALLOC should block. + * elsewhere if malloc should block. */ ldep = malloc(sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK | M_ZERO); From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 14:13:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E3B61065679; Sat, 13 Feb 2010 14:13:39 +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 8D4158FC0A; Sat, 13 Feb 2010 14:13:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DEDdxs054260; Sat, 13 Feb 2010 14:13:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DEDdrs054249; Sat, 13 Feb 2010 14:13:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002131413.o1DEDdrs054249@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Feb 2010 14:13: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: r203829 - in head/sys: boot/sparc64/loader sparc64/include sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 14:13:39 -0000 Author: marius Date: Sat Feb 13 14:13:39 2010 New Revision: 203829 URL: http://svn.freebsd.org/changeset/base/203829 Log: - Assert that HEAPSZ is a multiple of PAGE_SIZE as at least the firmware of Sun Fire V1280 doesn't round up the size itself but instead lets claiming of non page-sized amounts of memory fail. - Change parameters and variables related to the TLB slots to unsigned which is more appropriate. - Search the whole OFW device tree instead of only the children of the root nexus device for the BSP as starting with UltraSPARC IV the 'cpu' nodes hang off of from 'cmp' (chip multi-threading processor) or 'core' or combinations thereof. Also in large UltraSPARC III based machines the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which group snooping-coherency domains together instead of directly from the nexus. - Add support for UltraSPARC IV and IV+ BSPs. Due to the fact that these are multi-core each CPU has two Fireplane config registers and thus the module/target ID has to be determined differently so the one specific to a certain core is used. Similarly, starting with UltraSPARC IV the individual cores use a different property in the OFW device tree to indicate the CPU/core ID as it no longer is in coincidence with the shared slot/socket ID. While at it additionally distinguish between CPUs with Fireplane and JBus interconnects as these also use slightly different sizes for the JBus/agent/module/target IDs. - Check the return value of init_heap(). This requires moving it after cons_probe() so we can panic when appropriate. This should be fine as the PowerPC OFW loader uses that order for quite some time now. Added: head/sys/sparc64/include/cmt.h (contents, props changed) head/sys/sparc64/include/fireplane.h (contents, props changed) head/sys/sparc64/include/jbus.h (contents, props changed) head/sys/sun4v/include/cmt.h (contents, props changed) head/sys/sun4v/include/fireplane.h (contents, props changed) head/sys/sun4v/include/jbus.h (contents, props changed) Modified: head/sys/boot/sparc64/loader/main.c head/sys/sparc64/include/asi.h head/sys/sun4v/include/asi.h Modified: head/sys/boot/sparc64/loader/main.c ============================================================================== --- head/sys/boot/sparc64/loader/main.c Sat Feb 13 12:50:09 2010 (r203828) +++ head/sys/boot/sparc64/loader/main.c Sat Feb 13 14:13:39 2010 (r203829) @@ -46,16 +46,19 @@ __FBSDID("$FreeBSD$"); */ #include -#include #include -#include +#include #include +#include #include #include #include +#include #include #include +#include +#include #include #include #include @@ -68,6 +71,12 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" +#ifndef CTASSERT +#define CTASSERT(x) _CTASSERT(x, __LINE__) +#define _CTASSERT(x, y) __CTASSERT(x, y) +#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] +#endif + extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; enum { @@ -76,6 +85,9 @@ enum { LOADSZ = 0x1000000 /* for kernel and modules */ }; +/* At least Sun Fire V1280 require page sized allocations to be claimed. */ +CTASSERT(HEAPSZ % PAGE_SIZE == 0); + static struct mmu_ops { void (*tlb_init)(void); int (*mmu_mapin)(vm_offset_t va, vm_size_t len); @@ -84,11 +96,11 @@ static struct mmu_ops { typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, void *openfirmware); -static inline u_long dtlb_get_data_sun4u(int slot); -static void dtlb_enter_sun4u(u_long vpn, u_long data); +static inline u_long dtlb_get_data_sun4u(u_int); +static void dtlb_enter_sun4u(u_long, u_long); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); -static inline u_long itlb_get_data_sun4u(int slot); -static void itlb_enter_sun4u(u_long vpn, u_long data); +static inline u_long itlb_get_data_sun4u(u_int); +static void itlb_enter_sun4u(u_long, u_long); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); extern vm_offset_t md_load(char *, vm_offset_t *); @@ -104,6 +116,9 @@ static int __elfN(exec)(struct preloaded static int mmu_mapin_sun4u(vm_offset_t, vm_size_t); static int mmu_mapin_sun4v(vm_offset_t, vm_size_t); static vm_offset_t init_heap(void); +static phandle_t find_bsp_sun4u(phandle_t, uint32_t); +const char *cpu_cpuid_prop_sun4u(void); +uint32_t cpu_get_mid_sun4u(void); static void tlb_init_sun4u(void); static void tlb_init_sun4v(void); @@ -120,11 +135,11 @@ static struct mmu_ops mmu_ops_sun4v = { /* sun4u */ struct tlb_entry *dtlb_store; struct tlb_entry *itlb_store; -int dtlb_slot; -int itlb_slot; +u_int dtlb_slot; +u_int itlb_slot; int cpu_impl; -static int dtlb_slot_max; -static int itlb_slot_max; +static u_int dtlb_slot_max; +static u_int itlb_slot_max; /* sun4v */ static struct tlb_entry *tlb_store; @@ -398,7 +413,7 @@ __elfN(exec)(struct preloaded_file *fp) } static inline u_long -dtlb_get_data_sun4u(int slot) +dtlb_get_data_sun4u(u_int slot) { /* @@ -410,7 +425,7 @@ dtlb_get_data_sun4u(int slot) } static inline u_long -itlb_get_data_sun4u(int slot) +itlb_get_data_sun4u(u_int slot) { /* @@ -668,33 +683,98 @@ init_heap(void) return (heapva); } +static phandle_t +find_bsp_sun4u(phandle_t node, uint32_t bspid) +{ + char type[sizeof("cpu")]; + phandle_t child; + uint32_t cpuid; + + for (; node > 0; node = OF_peer(node)) { + child = OF_child(node); + if (child > 0) { + child = find_bsp_sun4u(child, bspid); + if (child > 0) + return (child); + } else { + if (OF_getprop(node, "device_type", type, + sizeof(type)) <= 0) + continue; + if (strcmp(type, "cpu") != 0) + continue; + if (OF_getprop(node, cpu_cpuid_prop_sun4u(), &cpuid, + sizeof(cpuid)) <= 0) + continue; + if (cpuid == bspid) + return (node); + } + } + return (0); +} + +const char * +cpu_cpuid_prop_sun4u(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return ("upa-portid"); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return ("portid"); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return ("cpuid"); + default: + return (""); + } +} + +uint32_t +cpu_get_mid_sun4u(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return (UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + return (FIREPLANE_CR_GET_AID(ldxa(AA_FIREPLANE_CONFIG, + ASI_FIREPLANE_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return (JBUS_CR_GET_JID(ldxa(0, ASI_JBUS_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return (INTR_ID_GET_ID(ldxa(AA_INTR_ID, ASI_INTR_ID))); + default: + return (0); + } +} + static void tlb_init_sun4u(void) { - phandle_t child; - char buf[128]; - u_int bootcpu; - u_int cpu; + phandle_t bsp; cpu_impl = VER_IMPL(rdpr(ver)); - bootcpu = UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)); - for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0) - continue; - if (strcmp(buf, "cpu") != 0) - continue; - if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? - "upa-portid" : "portid", &cpu, sizeof(cpu)) <= 0) - continue; - if (cpu == bootcpu) - break; - } - if (cpu != bootcpu) + bsp = find_bsp_sun4u(OF_child(root), cpu_get_mid_sun4u()); + if (bsp == 0) panic("%s: no node for bootcpu?!?!", __func__); - if (OF_getprop(child, "#dtlb-entries", &dtlb_slot_max, + if (OF_getprop(bsp, "#dtlb-entries", &dtlb_slot_max, sizeof(dtlb_slot_max)) == -1 || - OF_getprop(child, "#itlb-entries", &itlb_slot_max, + OF_getprop(bsp, "#itlb-entries", &itlb_slot_max, sizeof(itlb_slot_max)) == -1) panic("%s: can't get TLB slot max.", __func__); @@ -749,14 +829,15 @@ main(int (*openfirm)(void *)) archsw.arch_autoload = sparc64_autoload; archsw.arch_maphint = sparc64_maphint; - init_heap(); - setheap((void *)heapva, (void *)(heapva + HEAPSZ)); - /* * Probe for a console. */ cons_probe(); + if (init_heap() == (vm_offset_t)-1) + panic("%s: can't claim heap", __func__); + setheap((void *)heapva, (void *)(heapva + HEAPSZ)); + if ((root = OF_peer(0)) == -1) panic("%s: can't get root phandle", __func__); OF_getprop(root, "compatible", compatible, sizeof(compatible)); Modified: head/sys/sparc64/include/asi.h ============================================================================== --- head/sys/sparc64/include/asi.h Sat Feb 13 12:50:09 2010 (r203828) +++ head/sys/sparc64/include/asi.h Sat Feb 13 14:13:39 2010 (r203829) @@ -33,7 +33,7 @@ #define _MACHINE_ASI_H_ /* - * Standard v9 asis + * Standard v9 ASIs */ #define ASI_N 0x4 #define ASI_NL 0xc @@ -51,7 +51,7 @@ #define ASI_SNFL 0x8b /* - * UltraSPARC extensions. ASIs limited to a certain family are annotated. + * UltraSPARC extensions - ASIs limited to a certain family are annotated. */ #define ASI_PHYS_USE_EC 0x14 #define ASI_PHYS_BYPASS_EC_WITH_EBIT 0x15 @@ -91,9 +91,12 @@ #define ASI_INTR_RECEIVE 0x49 #define ASI_UPA_CONFIG_REG 0x4a /* US-I, II */ -#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III Cu */ -#define AA_FIREPLANE_CONFIG 0x0 /* US-III Cu */ -#define AA_FIREPLANE_ADDRESS 0x8 /* US-III Cu */ +#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG 0x0 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_ADDRESS 0x8 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG_2 0x10 /* US-IV{,+} */ + +#define ASI_JBUS_CONFIG_REG 0x4a /* US-IIIi{,+} */ #define ASI_ESTATE_ERROR_EN_REG 0x4b #define AA_ESTATE_CEEN 0x1 @@ -153,6 +156,11 @@ #define ASI_IIU_INST_TRAP 0x60 /* US-III family */ +#define ASI_INTR_ID 0x63 /* US-IV{,+} */ +#define AA_INTR_ID 0x0 /* US-IV{,+} */ +#define AA_CORE_ID 0x10 /* US-IV{,+} */ +#define AA_CESR_ID 0x40 /* US-IV{,+} */ + #define ASI_ICACHE_INSTR 0x66 #define ASI_ICACHE_TAG 0x67 #define ASI_ICACHE_SNOOP_TAG 0x68 /* US-III family */ @@ -179,7 +187,7 @@ /* * With the advent of the US-III, the numbering has changed, as additional - * registers were inserted in between. We retain the original ordering for + * registers were inserted in between. We retain the original ordering for * now, and append an A to the inserted registers. * Exceptions are AA_SDB_INTR_D6 and AA_SDB_INTR_D7, which were appended * at the end. Added: head/sys/sparc64/include/cmt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sparc64/include/cmt.h Sat Feb 13 14:13:39 2010 (r203829) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * 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$ + */ + +#ifndef _MACHINE_CMT_H_ +#define _MACHINE_CMT_H_ + +#define INTR_ID_ID_SHIFT (0) +#define INTR_ID_ID_SIZE (10) +#define INTR_ID_ID_MASK \ + (((1 << INTR_ID_ID_SIZE) - 1) << INTR_ID_ID_SHIFT) + +#define INTR_ID_GET_ID(cr) ((cr & INTR_ID_ID_MASK) >> INTR_ID_ID_SHIFT) + +#endif /* _MACHINE_CMT_H_ */ Added: head/sys/sparc64/include/fireplane.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sparc64/include/fireplane.h Sat Feb 13 14:13:39 2010 (r203829) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * 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$ + */ + +#ifndef _MACHINE_FIREPLANE_H_ +#define _MACHINE_FIREPLANE_H_ + +#define FIREPLANE_CR_AID_SHIFT (17) +#define FIREPLANE_CR_AID_SIZE (10) +#define FIREPLANE_CR_AID_MASK \ + (((1 << FIREPLANE_CR_AID_SIZE) - 1) << FIREPLANE_CR_AID_SHIFT) + +#define FIREPLANE_CR_GET_AID(cr) \ + ((cr & FIREPLANE_CR_AID_MASK) >> FIREPLANE_CR_AID_SHIFT) + +#endif /* _MACHINE_FIREPLANE_H_ */ Added: head/sys/sparc64/include/jbus.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sparc64/include/jbus.h Sat Feb 13 14:13:39 2010 (r203829) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * 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$ + */ + +#ifndef _MACHINE_JBUS_H_ +#define _MACHINE_JBUS_H_ + +#define JBUS_CR_JID_SHIFT (17) +#define JBUS_CR_JID_SIZE (3) +#define JBUS_CR_JID_MASK \ + (((1 << JBUS_CR_JID_SIZE) - 1) << JBUS_CR_JID_SHIFT) + +#define JBUS_CR_GET_JID(cr) ((cr & JBUS_CR_JID_MASK) >> JBUS_CR_JID_SHIFT) + +#endif /* _MACHINE_JBUS_H_ */ Modified: head/sys/sun4v/include/asi.h ============================================================================== --- head/sys/sun4v/include/asi.h Sat Feb 13 12:50:09 2010 (r203828) +++ head/sys/sun4v/include/asi.h Sat Feb 13 14:13:39 2010 (r203829) @@ -158,6 +158,11 @@ #define AA_DMMU_TAR 0x30 #define ASI_UPA_CONFIG_REG 0x4a /* US-I, II */ +#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG 0x0 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_ADDRESS 0x8 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG_2 0x10 /* US-IV{,+} */ +#define ASI_JBUS_CONFIG_REG 0x4a /* US-IIIi{,+} */ #define ASI_IMMU 0x50 #define ASI_ITLB_DATA_IN_REG 0x54 #define ASI_ITLB_DATA_ACCESS_REG 0x55 @@ -167,5 +172,7 @@ #define ASI_DTLB_DATA_IN_REG 0x5c #define ASI_DTLB_DATA_ACCESS_REG 0x5d #define ASI_DTLB_TAG_READ_REG 0x5e +#define ASI_INTR_ID 0x63 /* US-IV{,+} */ +#define AA_INTR_ID 0x0 /* US-IV{,+} */ #endif /* !_MACHINE_ASI_H_ */ Added: head/sys/sun4v/include/cmt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sun4v/include/cmt.h Sat Feb 13 14:13:39 2010 (r203829) @@ -0,0 +1,7 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ + +#include Added: head/sys/sun4v/include/fireplane.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sun4v/include/fireplane.h Sat Feb 13 14:13:39 2010 (r203829) @@ -0,0 +1,7 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ + +#include Added: head/sys/sun4v/include/jbus.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sun4v/include/jbus.h Sat Feb 13 14:13:39 2010 (r203829) @@ -0,0 +1,7 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ + +#include From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 14:40:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FFBE1065670; Sat, 13 Feb 2010 14:40:42 +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 80EB18FC13; Sat, 13 Feb 2010 14:40:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DEegdZ079316; Sat, 13 Feb 2010 14:40:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DEegpY079314; Sat, 13 Feb 2010 14:40:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002131440.o1DEegpY079314@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Feb 2010 14:40: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: r203830 - head/sys/boot/sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 14:40:42 -0000 Author: marius Date: Sat Feb 13 14:40:42 2010 New Revision: 203830 URL: http://svn.freebsd.org/changeset/base/203830 Log: Use the SUNW,{d,i}tlb-load methods for entering locked TLB entries like OpenBSD and OpenSolaris do instead of fiddling with the MMUs ourselves. Unlike direct access the firmware methods don't automatically use the next free (?) TLB slot, instead the slot to be used has to be specified. We allocate the TLB slots for the kernel top-down as OpenSolaris suggests that the firmware will always allocate the ones for its own use bottom-up. Besides being simpler, according to OpenBSD using the firmware methods is required to allow booting on Sun Fire E10K with multi-systemboard domains. Modified: head/sys/boot/sparc64/loader/main.c Modified: head/sys/boot/sparc64/loader/main.c ============================================================================== --- head/sys/boot/sparc64/loader/main.c Sat Feb 13 14:13:39 2010 (r203829) +++ head/sys/boot/sparc64/loader/main.c Sat Feb 13 14:40:42 2010 (r203830) @@ -97,10 +97,10 @@ typedef void kernel_entry_t(vm_offset_t void *openfirmware); static inline u_long dtlb_get_data_sun4u(u_int); -static void dtlb_enter_sun4u(u_long, u_long); +static int dtlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); static inline u_long itlb_get_data_sun4u(u_int); -static void itlb_enter_sun4u(u_long, u_long); +static int itlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); extern vm_offset_t md_load(char *, vm_offset_t *); @@ -482,55 +482,24 @@ itlb_va_to_pa_sun4u(vm_offset_t va) return (-1); } -static void -dtlb_enter_sun4u(u_long vpn, u_long data) +static int +dtlb_enter_sun4u(u_int index, u_long data, vm_offset_t virt) { - u_long reg; - reg = rdpr(pstate); - wrpr(pstate, reg & ~PSTATE_IE, 0); - stxa(AA_DMMU_TAR, ASI_DMMU, - TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); - stxa(0, ASI_DTLB_DATA_IN_REG, data); - membar(Sync); - wrpr(pstate, reg, 0); + return (OF_call_method("SUNW,dtlb-load", mmu, 3, 0, index, data, + virt)); } -static void -itlb_enter_sun4u(u_long vpn, u_long data) +static int +itlb_enter_sun4u(u_int index, u_long data, vm_offset_t virt) { - u_long reg; - int i; - reg = rdpr(pstate); - wrpr(pstate, reg & ~PSTATE_IE, 0); - - if (cpu_impl == CPU_IMPL_ULTRASPARCIIIp) { - /* - * Search an unused slot != 0 and explicitly enter the data - * and tag there in order to avoid Cheetah+ erratum 34. - */ - for (i = 1; i < itlb_slot_max; i++) { - if ((itlb_get_data_sun4u(i) & TD_V) != 0) - continue; - - stxa(AA_IMMU_TAR, ASI_IMMU, - TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); - stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); - flush(PROMBASE); - break; - } - wrpr(pstate, reg, 0); - if (i == itlb_slot_max) - panic("%s: could not find an unused slot", __func__); - return; - } - - stxa(AA_IMMU_TAR, ASI_IMMU, - TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); - stxa(0, ASI_ITLB_DATA_IN_REG, data); - flush(PROMBASE); - wrpr(pstate, reg, 0); + if (cpu_impl == CPU_IMPL_ULTRASPARCIIIp && index == 0 && + (data & TD_L) != 0) + panic("%s: won't enter locked TLB entry at index 0 on USIII+", + __func__); + return (OF_call_method("SUNW,itlb-load", mmu, 3, 0, index, data, + virt)); } static void @@ -580,6 +549,7 @@ mmu_mapin_sun4u(vm_offset_t va, vm_size_ { vm_offset_t pa, mva; u_long data; + u_int index; if (va + len > curkva) curkva = va + len; @@ -617,12 +587,20 @@ mmu_mapin_sun4u(vm_offset_t va, vm_size_ TD_CV | TD_P | TD_W; dtlb_store[dtlb_slot].te_pa = pa; dtlb_store[dtlb_slot].te_va = va; + index = dtlb_slot_max - dtlb_slot - 1; + if (dtlb_enter_sun4u(index, data, va) < 0) + panic("%s: can't enter dTLB slot %d data " + "%#lx va %#lx index %d", __func__, index, + data, va); + dtlb_slot++; itlb_store[itlb_slot].te_pa = pa; itlb_store[itlb_slot].te_va = va; - dtlb_slot++; + index = itlb_slot_max - itlb_slot - 1; + if (itlb_enter_sun4u(index, data, va) < 0) + panic("%s: can't enter iTLB slot %d data " + "%#lx va %#lx index %d", __func__, index, + data, va); itlb_slot++; - dtlb_enter_sun4u(va, data); - itlb_enter_sun4u(va, data); pa = (vm_offset_t)-1; } len -= len > PAGE_SIZE_4M ? PAGE_SIZE_4M : len; From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 15:12:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63F2F1065670; Sat, 13 Feb 2010 15:12:46 +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 55BD28FC0A; Sat, 13 Feb 2010 15:12:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DFCkWY009907; Sat, 13 Feb 2010 15:12:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DFCkCJ009904; Sat, 13 Feb 2010 15:12:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002131512.o1DFCkCJ009904@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Feb 2010 15:12: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: r203831 - head/sys/boot/sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 15:12:46 -0000 Author: marius Date: Sat Feb 13 15:12:46 2010 New Revision: 203831 URL: http://svn.freebsd.org/changeset/base/203831 Log: Correct the panic strings introduced in r203830 to match their arguments. Modified: head/sys/boot/sparc64/loader/main.c Modified: head/sys/boot/sparc64/loader/main.c ============================================================================== --- head/sys/boot/sparc64/loader/main.c Sat Feb 13 14:40:42 2010 (r203830) +++ head/sys/boot/sparc64/loader/main.c Sat Feb 13 15:12:46 2010 (r203831) @@ -590,16 +590,16 @@ mmu_mapin_sun4u(vm_offset_t va, vm_size_ index = dtlb_slot_max - dtlb_slot - 1; if (dtlb_enter_sun4u(index, data, va) < 0) panic("%s: can't enter dTLB slot %d data " - "%#lx va %#lx index %d", __func__, index, - data, va); + "%#lx va %#lx", __func__, index, data, + va); dtlb_slot++; itlb_store[itlb_slot].te_pa = pa; itlb_store[itlb_slot].te_va = va; index = itlb_slot_max - itlb_slot - 1; if (itlb_enter_sun4u(index, data, va) < 0) panic("%s: can't enter iTLB slot %d data " - "%#lx va %#lx index %d", __func__, index, - data, va); + "%#lx va %#lxd", __func__, index, data, + va); itlb_slot++; pa = (vm_offset_t)-1; } From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 15:36:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DB4A106566B; Sat, 13 Feb 2010 15:36:34 +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 2FAC18FC15; Sat, 13 Feb 2010 15:36:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DFaYpa031718; Sat, 13 Feb 2010 15:36:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DFaYmX031713; Sat, 13 Feb 2010 15:36:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002131536.o1DFaYmX031713@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Feb 2010 15:36: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: r203833 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 15:36:34 -0000 Author: marius Date: Sat Feb 13 15:36:33 2010 New Revision: 203833 URL: http://svn.freebsd.org/changeset/base/203833 Log: - At least the trap table of the Sun Fire V1280 firmware apparently has no cleanwindows handler so just remove trying to trigger it from _start and the AP trampoline code as that leads to a crash there. This should be okay as leaking data from the OFW via the CPU registers on start of the kernel should be no real concern. - Make the comments of _start and the AP trampoline code regarding the initializations they perform match each other and reality. - Make the comments of the AP trampoline code regarding iTLB accesses refer to the right macro. Modified: head/sys/sparc64/sparc64/locore.S head/sys/sparc64/sparc64/mp_locore.S Modified: head/sys/sparc64/sparc64/locore.S ============================================================================== --- head/sys/sparc64/sparc64/locore.S Sat Feb 13 15:35:51 2010 (r203832) +++ head/sys/sparc64/sparc64/locore.S Sat Feb 13 15:36:33 2010 (r203833) @@ -46,12 +46,14 @@ ENTRY(btext) ENTRY(_start) /* * Initialize misc. state to known values: interrupts disabled, normal - * globals, windows flushed (cr = 0, cs = nwindows - 1), no clean - * windows, pil 0, and floating point disabled. + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * floating point disabled. + * Note that some firmware versions don't implement a clean window + * trap handler so we unfortunately can't clear the windows by setting + * %cleanwin to zero here. */ wrpr %g0, PSTATE_NORMAL, %pstate flushw - wrpr %g0, 0, %cleanwin wrpr %g0, 0, %pil wr %g0, 0, %fprs Modified: head/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- head/sys/sparc64/sparc64/mp_locore.S Sat Feb 13 15:35:51 2010 (r203832) +++ head/sys/sparc64/sparc64/mp_locore.S Sat Feb 13 15:36:33 2010 (r203833) @@ -44,12 +44,14 @@ __FBSDID("$FreeBSD$"); .text _ALIGN_TEXT /* - * Initialize misc. state to known values: interrupts disabled, - * normal globals, no clean windows, PIL 0, and floating point - * disabled. + * Initialize misc. state to known values: interrupts disabled, normal + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * floating point disabled. + * Note that some firmware versions don't implement a clean window + * trap handler so we unfortunately can't clear the windows by setting + * %cleanwin to zero here. */ 1: wrpr %g0, PSTATE_NORMAL, %pstate - wrpr %g0, 0, %cleanwin wrpr %g0, 0, %pil wr %g0, 0, %fprs @@ -68,7 +70,7 @@ __FBSDID("$FreeBSD$"); setx TD_V | TD_L, %l1, %l0 /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work * around errata of USIII and beyond. */ ldxa [%g0] ASI_ITLB_DATA_ACCESS_REG, %g0 @@ -94,7 +96,7 @@ __FBSDID("$FreeBSD$"); mov (1 << TLB_DAR_SLOT_SHIFT), %l4 setx TD_V, %l1, %l0 /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work * around errata of USIII and beyond. */ 2: ldxa [%l4] ASI_ITLB_DATA_ACCESS_REG, %g0 @@ -136,7 +138,7 @@ __FBSDID("$FreeBSD$"); mov (1 << TLB_DAR_SLOT_SHIFT), %l0 setx TD_V, %o1, %o0 /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work * around errata of USIII and beyond. */ 5: ldxa [%l0] ASI_ITLB_DATA_ACCESS_REG, %g0 From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 16:04:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D011106566C; Sat, 13 Feb 2010 16:04:58 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E5A68FC12; Sat, 13 Feb 2010 16:04:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DG4wL5058301; Sat, 13 Feb 2010 16:04:58 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DG4wA8058290; Sat, 13 Feb 2010 16:04:58 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <201002131604.o1DG4wA8058290@svn.freebsd.org> From: Max Laier Date: Sat, 13 Feb 2010 16:04: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: r203834 - in head/sys: dev/cxgb dev/e1000 dev/ixgbe dev/mxge net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 16:04:58 -0000 Author: mlaier Date: Sat Feb 13 16:04:58 2010 New Revision: 203834 URL: http://svn.freebsd.org/changeset/base/203834 Log: Fix drbr and altq interaction: - introduce drbr_needs_enqueue that returns whether the interface/br needs an enqueue operation: returns true if altq is enabled or there are already packets in the ring (as we need to maintain packet order) - update all drbr consumers - fix drbr_flush - avoid using the driver queue (IFQ_DRV_*) in the altq case as the multiqueue consumer does not provide enough protection, serialize altq interaction with the main queue lock - make drbr_dequeue_cond work with altq Discussed with: kmacy, yongari, jfv MFC after: 4 weeks Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/mxge/if_mxge.c head/sys/net/if_var.h Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Sat Feb 13 15:36:33 2010 (r203833) +++ head/sys/dev/cxgb/cxgb_sge.c Sat Feb 13 16:04:58 2010 (r203834) @@ -228,6 +228,8 @@ static uint8_t flit_desc_map[] = { #define TXQ_LOCK(qs) mtx_lock(&(qs)->lock) #define TXQ_UNLOCK(qs) mtx_unlock(&(qs)->lock) #define TXQ_RING_EMPTY(qs) drbr_empty((qs)->port->ifp, (qs)->txq[TXQ_ETH].txq_mr) +#define TXQ_RING_NEEDS_ENQUEUE(qs) \ + drbr_needs_enqueue((qs)->port->ifp, (qs)->txq[TXQ_ETH].txq_mr) #define TXQ_RING_FLUSH(qs) drbr_flush((qs)->port->ifp, (qs)->txq[TXQ_ETH].txq_mr) #define TXQ_RING_DEQUEUE_COND(qs, func, arg) \ drbr_dequeue_cond((qs)->port->ifp, (qs)->txq[TXQ_ETH].txq_mr, func, arg) @@ -1712,7 +1714,7 @@ cxgb_transmit_locked(struct ifnet *ifp, * - there is space in hardware transmit queue */ if (check_pkt_coalesce(qs) == 0 && - TXQ_RING_EMPTY(qs) && avail > 4) { + !TXQ_RING_NEEDS_ENQUEUE(qs) && avail > 4) { if (t3_encap(qs, &m)) { if (m != NULL && (error = drbr_enqueue(ifp, br, m)) != 0) Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Feb 13 15:36:33 2010 (r203833) +++ head/sys/dev/e1000/if_em.c Sat Feb 13 16:04:58 2010 (r203834) @@ -955,7 +955,7 @@ em_mq_start_locked(struct ifnet *ifp, st || (!adapter->link_active)) { error = drbr_enqueue(ifp, adapter->br, m); return (error); - } else if (drbr_empty(ifp, adapter->br) && + } else if (!drbr_needs_enqueue(ifp, adapter->br) && (adapter->num_tx_desc_avail > EM_TX_OP_THRESHOLD)) { if ((error = em_xmit(adapter, &m)) != 0) { if (m) Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Feb 13 15:36:33 2010 (r203833) +++ head/sys/dev/e1000/if_igb.c Sat Feb 13 16:04:58 2010 (r203834) @@ -842,9 +842,13 @@ igb_mq_start_locked(struct ifnet *ifp, s } enq = 0; - if (m == NULL) + if (m == NULL) { next = drbr_dequeue(ifp, txr->br); - else + } else if (drbr_needs_enqueue(ifp, txr->br)) { + if ((err = drbr_enqueue(ifp, txr->br, m)) != 0) + return (err); + next = drbr_dequeue(ifp, txr->br); + } else next = m; /* Process the queue */ while (next != NULL) { Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Feb 13 15:36:33 2010 (r203833) +++ head/sys/dev/ixgbe/ixgbe.c Sat Feb 13 16:04:58 2010 (r203834) @@ -861,7 +861,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp, goto process; /* If nothing queued go right to xmit */ - if (drbr_empty(ifp, txr->br)) { + if (!drbr_needs_enqueue(ifp, txr->br)) { if ((err = ixgbe_xmit(txr, &m)) != 0) { if (m != NULL) err = drbr_enqueue(ifp, txr->br, m); Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Sat Feb 13 15:36:33 2010 (r203833) +++ head/sys/dev/mxge/if_mxge.c Sat Feb 13 16:04:58 2010 (r203834) @@ -2249,7 +2249,7 @@ mxge_transmit_locked(struct mxge_slice_s return (err); } - if (drbr_empty(ifp, tx->br) && + if (!drbr_needs_enqueue(ifp, tx->br) && ((tx->mask - (tx->req - tx->done)) > tx->max_desc)) { /* let BPF see it */ BPF_MTAP(ifp, m); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sat Feb 13 15:36:33 2010 (r203833) +++ head/sys/net/if_var.h Sat Feb 13 16:04:58 2010 (r203834) @@ -603,12 +603,8 @@ drbr_flush(struct ifnet *ifp, struct buf struct mbuf *m; #ifdef ALTQ - if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) { - while (!IFQ_IS_EMPTY(&ifp->if_snd)) { - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); - m_freem(m); - } - } + if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) + IFQ_PURGE(&ifp->if_snd); #endif while ((m = buf_ring_dequeue_sc(br)) != NULL) m_freem(m); @@ -629,7 +625,7 @@ drbr_dequeue(struct ifnet *ifp, struct b struct mbuf *m; if (ALTQ_IS_ENABLED(&ifp->if_snd)) { - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + IFQ_DEQUEUE(&ifp->if_snd, m); return (m); } #endif @@ -642,11 +638,15 @@ drbr_dequeue_cond(struct ifnet *ifp, str { struct mbuf *m; #ifdef ALTQ - /* - * XXX need to evaluate / requeue - */ - if (ALTQ_IS_ENABLED(&ifp->if_snd)) { - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (ALTQ_IS_ENABLED(&ifp->if_snd)) { + IFQ_LOCK(&ifp->if_snd); + IFQ_POLL_NOLOCK(&ifp->if_snd, m); + if (m != NULL && func(m, arg) == 0) { + IFQ_UNLOCK(&ifp->if_snd); + return (NULL); + } + IFQ_DEQUEUE(&ifp->if_snd, m); + IFQ_UNLOCK(&ifp->if_snd); return (m); } #endif @@ -662,12 +662,22 @@ drbr_empty(struct ifnet *ifp, struct buf { #ifdef ALTQ if (ALTQ_IS_ENABLED(&ifp->if_snd)) - return (IFQ_DRV_IS_EMPTY(&ifp->if_snd)); + return (IFQ_IS_EMPTY(&ifp->if_snd)); #endif return (buf_ring_empty(br)); } static __inline int +drbr_needs_enqueue(struct ifnet *ifp, struct buf_ring *br) +{ +#ifdef ALTQ + if (ALTQ_IS_ENABLED(&ifp->if_snd)) + return (1); +#endif + return (!buf_ring_empty(br)); +} + +static __inline int drbr_inuse(struct ifnet *ifp, struct buf_ring *br) { #ifdef ALTQ From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 16:17:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F366106566B; Sat, 13 Feb 2010 16:17:22 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id EF9BE8FC0A; Sat, 13 Feb 2010 16:17:20 +0000 (UTC) Received: by ewy3 with SMTP id 3so3642896ewy.13 for ; Sat, 13 Feb 2010 08:17:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=pvG+TRbNkJDnhmBWvaN8vsWENQKjW3XyY8x5G3kSShA=; b=KN8eT2dgnCjyDsHjaybC1q826P10E2yc/+N7B+1wy2vXu1lbdtvieh1NjGNd7OTUB8 Od9Ibq+wvdtvD/F/RkJbVLOx5qoKyyqoivuYnGUBF2ta3Ojx7Y6VhaqR1mp0OUt387VY 6OPgutTkm8+2x04pBLgeIKAkyRAkMH/XlW764= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=X1AkDst2xXi52/ZrKAqw2V3uVztVZgXrQZQbaAhyNyWEBIQcRHApoLCzd9HCoJdOGx IMilsYy88cPiTl6jVdQ0rCYDt0BPBCmMya1jbgec4Yp4LE4ag4CTZO+0Wd7BjxLmSyvx YZJ/w2t1qcYdpcsZbCtwBXrwRtQweMg0gGK5M= MIME-Version: 1.0 Received: by 10.213.68.139 with SMTP id v11mr1174384ebi.32.1266077840104; Sat, 13 Feb 2010 08:17:20 -0800 (PST) In-Reply-To: <201002131203.o1DC33Rf034860@svn.freebsd.org> References: <201002131203.o1DC33Rf034860@svn.freebsd.org> Date: Sat, 13 Feb 2010 11:17:20 -0500 Message-ID: <47d0403c1002130817u6261bf1bs57c8e26d74cf655@mail.gmail.com> From: Ben Kaduk To: Edward Tomasz Napierala 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: r203825 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 16:17:22 -0000 On Sat, Feb 13, 2010 at 7:03 AM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sat Feb 13 12:03:03 2010 > New Revision: 203825 > URL: http://svn.freebsd.org/changeset/base/203825 > > Log: > =A0Remove list of locking primitives, which is kind of redundant, move > =A0information about witness(9) to the section about interactions, and > =A0expand 'contexts' table. > > Modified: > =A0head/share/man/man9/locking.9 Hi Edward, Please consider looking at docs/136918 and docs/134074 (which both have patches to locking.9) while you're here. Thanks, Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 16:18:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 150601065670 for ; Sat, 13 Feb 2010 16:18:49 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mx1.freebsd.org (Postfix) with ESMTP id 9E7078FC0C for ; Sat, 13 Feb 2010 16:18:48 +0000 (UTC) Received: from vampire.homelinux.org (dslb-088-064-176-235.pools.arcor-ip.net [88.64.176.235]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0M4muv-1NuhGU23iv-00zLP9; Sat, 13 Feb 2010 17:18:47 +0100 Received: (qmail 39413 invoked from network); 13 Feb 2010 16:18:47 -0000 Received: from f8x64.laiers.local (192.168.4.188) by ns1.laiers.local with SMTP; 13 Feb 2010 16:18:47 -0000 From: Max Laier Organization: FreeBSD To: Max Laier Date: Sat, 13 Feb 2010 17:18:46 +0100 User-Agent: KMail/1.12.4 (FreeBSD/8.0-RELEASE-p2; KDE/4.3.5; amd64; ; ) References: <201002131604.o1DG4wA8058290@svn.freebsd.org> In-Reply-To: <201002131604.o1DG4wA8058290@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201002131718.46177.max@love2party.net> X-Provags-ID: V01U2FsdGVkX18oJX/HuoRvVOADAytt6y8FotLO7xJNbDdCvcX wawwOl8ABo5utkiagtRo7hligvravGLV3O9MFM3SMW7HklVOW2 98TLqz5opaKRzuMM2FqbA== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203834 - in head/sys: dev/cxgb dev/e1000 dev/ixgbe dev/mxge net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 16:18:49 -0000 On Saturday 13 February 2010 17:04:58 Max Laier wrote: > Author: mlaier > Date: Sat Feb 13 16:04:58 2010 > New Revision: 203834 > URL: http://svn.freebsd.org/changeset/base/203834 > > Log: > Fix drbr and altq interaction: > - introduce drbr_needs_enqueue that returns whether the interface/br > needs an enqueue operation: returns true if altq is enabled or there are > already packets in the ring (as we need to maintain packet order) - update > all drbr consumers > - fix drbr_flush > - avoid using the driver queue (IFQ_DRV_*) in the altq case as the > multiqueue consumer does not provide enough protection, serialize altq > interaction with the main queue lock > - make drbr_dequeue_cond work with altq > > Discussed with: kmacy, yongari, jfv > MFC after: 4 weeks > > Modified: > head/sys/dev/cxgb/cxgb_sge.c > head/sys/dev/e1000/if_em.c > head/sys/dev/e1000/if_igb.c > head/sys/dev/ixgbe/ixgbe.c > head/sys/dev/mxge/if_mxge.c > head/sys/net/if_var.h Note that em, igb and ixgbe are still subtly broken after this. The problem is that they all call drbr_enqueue after failure to transmit a previously dequeued packet. This might mess up the packet order as the buf_rings are strictly FIFO. The fix is to make sure that there are enough resources to transmit before dequeuing the packet (drbr_dequeue_cond may be helpful here) and discarding the packet if the transmission fails for any other reason. Regards, Max From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 16:22:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22E981065672; Sat, 13 Feb 2010 16:22:09 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F05428FC17; Sat, 13 Feb 2010 16:22:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DGM8LA074408; Sat, 13 Feb 2010 16:22:08 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DGM8Ft074405; Sat, 13 Feb 2010 16:22:08 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002131622.o1DGM8Ft074405@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 13 Feb 2010 16:22: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: r203835 - head/sbin/growfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 16:22:09 -0000 Author: gavin Date: Sat Feb 13 16:22:08 2010 New Revision: 203835 URL: http://svn.freebsd.org/changeset/base/203835 Log: When growing a UFS1 filesystem, we need to initialise all inodes in any new cylinder groups that are created. When the filesystem is first created, newfs always initialises the first two blocks of inodes, and then in the UFS1 case will also initialise the remaining inode blocks. The changes in growfs.c 1.23 broke the initialisation of all inodes, seemingly based on this implementation detail in newfs(8). The result was that instead of initialising all inodes, we would actually end up initialising all but the first two blocks of inodes. If the filesystem was grown into empty (all-zeros) space then the resulting filesystem was fine, however when grown onto non-zeroed space the filesystem produced would appear to have massive corruption on the first fsck after growing. A test case for this problem can be found in the PR audit trail. Fix this by once again initialising all inodes in the UFS1 case. PR: bin/115174 Submitted by: Nate Eldredgei nge cs.hmc.edu Reviewed by: mjacob MFC after: 1 month Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sat Feb 13 16:04:58 2010 (r203834) +++ head/sbin/growfs/growfs.c Sat Feb 13 16:22:08 2010 (r203835) @@ -450,13 +450,11 @@ initcg(int cylno, time_t utime, int fso, acg.cg_cs.cs_nifree--; } /* - * XXX Newfs writes out two blocks of initialized inodes - * unconditionally. Should we check here to make sure that they - * were actually written? + * For the old file system, we have to initialize all the inodes. */ if (sblock.fs_magic == FS_UFS1_MAGIC) { bzero(iobuf, sblock.fs_bsize); - for (i = 2 * sblock.fs_frag; i < sblock.fs_ipg / INOPF(&sblock); + for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) { dp1 = (struct ufs1_dinode *)iobuf; #ifdef FSIRAND From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 16:25:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66C9B1065672; Sat, 13 Feb 2010 16:25:33 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58EE18FC0A; Sat, 13 Feb 2010 16:25:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DGPXSZ077859; Sat, 13 Feb 2010 16:25:33 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DGPX0P077855; Sat, 13 Feb 2010 16:25:33 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201002131625.o1DGPX0P077855@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 13 Feb 2010 16:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203836 - stable/8/usr.sbin/rtsold X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 16:25:33 -0000 Author: ume Date: Sat Feb 13 16:25:33 2010 New Revision: 203836 URL: http://svn.freebsd.org/changeset/base/203836 Log: MFC r203378: Make -a option actually work. Modified: stable/8/usr.sbin/rtsold/rtsold.c Directory Properties: stable/8/usr.sbin/rtsold/ (props changed) Modified: stable/8/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/8/usr.sbin/rtsold/rtsold.c Sat Feb 13 16:22:08 2010 (r203835) +++ stable/8/usr.sbin/rtsold/rtsold.c Sat Feb 13 16:25:33 2010 (r203836) @@ -841,7 +841,6 @@ autoifprobe(void) if (!argv[n]) err(1, "malloc"); n++; - argv[n] = NULL; } if (n) { From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 16:28:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E625E1065696; Sat, 13 Feb 2010 16:28:25 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEE9D8FC14; Sat, 13 Feb 2010 16:28:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DGSPmd080649; Sat, 13 Feb 2010 16:28:25 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DGSPwO080646; Sat, 13 Feb 2010 16:28:25 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201002131628.o1DGSPwO080646@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 13 Feb 2010 16:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203837 - stable/8/usr.sbin/rtsold X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 16:28:26 -0000 Author: ume Date: Sat Feb 13 16:28:25 2010 New Revision: 203837 URL: http://svn.freebsd.org/changeset/base/203837 Log: MFC r203387: Exclude the interfaces which IPv6 and/or accepting RA is disabled from the auto probed interface list. Modified: stable/8/usr.sbin/rtsold/rtsold.c Directory Properties: stable/8/usr.sbin/rtsold/ (props changed) Modified: stable/8/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/8/usr.sbin/rtsold/rtsold.c Sat Feb 13 16:25:33 2010 (r203836) +++ stable/8/usr.sbin/rtsold/rtsold.c Sat Feb 13 16:28:25 2010 (r203837) @@ -32,15 +32,20 @@ */ #include +#include #include #include #include #include #include +#include #include #include +#include + +#include #include #include @@ -789,8 +794,9 @@ autoifprobe(void) static char **argv = NULL; static int n = 0; char **a; - int i, found; + int s, i, found; struct ifaddrs *ifap, *ifa, *target; + struct in6_ndireq nd; /* initialize */ while (n--) @@ -804,6 +810,11 @@ autoifprobe(void) if (getifaddrs(&ifap) != 0) return NULL; + if (!Fflag && (s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + err(1, "socket"); + /* NOTREACHED */ + } + target = NULL; /* find an ethernet */ for (ifa = ifap; ifa; ifa = ifa->ifa_next) { @@ -829,6 +840,23 @@ autoifprobe(void) if (found) continue; + /* + * Skip the interfaces which IPv6 and/or accepting RA + * is disabled. + */ + if (!Fflag) { + memset(&nd, 0, sizeof(nd)); + strlcpy(nd.ifname, ifa->ifa_name, sizeof(nd.ifname)); + if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd) < 0) { + err(1, "ioctl(SIOCGIFINFO_IN6)"); + /* NOTREACHED */ + } + if ((nd.ndi.flags & ND6_IFF_IFDISABLED)) + continue; + if (!(nd.ndi.flags & ND6_IFF_ACCEPT_RTADV)) + continue; + } + /* if we find multiple candidates, just warn. */ if (n != 0 && dflag > 1) warnx("multiple interfaces found"); @@ -855,6 +883,8 @@ autoifprobe(void) warnx("probing %s", argv[i]); } } + if (!Fflag) + close(s); freeifaddrs(ifap); return argv; } From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 16:52:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91DCA1065670; Sat, 13 Feb 2010 16:52:33 +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 82CB88FC13; Sat, 13 Feb 2010 16:52:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DGqXXH002984; Sat, 13 Feb 2010 16:52:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DGqXIM002977; Sat, 13 Feb 2010 16:52:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002131652.o1DGqXIM002977@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Feb 2010 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: r203838 - in head/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 16:52:33 -0000 Author: marius Date: Sat Feb 13 16:52:33 2010 New Revision: 203838 URL: http://svn.freebsd.org/changeset/base/203838 Log: - Search the whole OFW device tree instead of only the children of the root nexus device for the CPUs as starting with UltraSPARC IV the 'cpu' nodes hang off of from 'cmp' (chip multi-threading processor) or 'core' or combinations thereof. Also in large UltraSPARC III based machines the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which group snooping-coherency domains together instead of directly from the nexus. It would be great if we could use newbus to deal with the different ways the 'cpu' devices can hang off of pseudo ones but unfortunately both cpu_mp_setmaxid() and sparc64_init() have to work prior to regular device probing. - Add support for UltraSPARC IV and IV+ CPUs. Due to the fact that these are multi-core each CPU has two Fireplane config registers and thus the module/target ID has to be determined differently so the one specific to a certain core is used. Similarly, starting with UltraSPARC IV the individual cores use a different property in the OFW device tree to indicate the CPU/core ID as it no longer is in coincidence with the shared slot/socket ID. This involves changing the MD KTR code to not directly read the UPA module ID either. We use the MID stored in the per-CPU data instead of calling cpu_get_mid() as a replacement in order prevent clobbering any registers as side-effect in the assembler version. This requires CATR() invocations from mp_startup() prior to mapping the per-CPU pages to be removed though. While at it additionally distinguish between CPUs with Fireplane and JBus interconnects as these also use slightly different sizes for the JBus/agent/module/target IDs. - Make sparc64_shutdown_final() static as it's not used outside of machdep.c. Modified: head/sys/sparc64/include/ktr.h head/sys/sparc64/include/md_var.h head/sys/sparc64/include/upa.h head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/mp_locore.S head/sys/sparc64/sparc64/mp_machdep.c Modified: head/sys/sparc64/include/ktr.h ============================================================================== --- head/sys/sparc64/include/ktr.h Sat Feb 13 16:28:25 2010 (r203837) +++ head/sys/sparc64/include/ktr.h Sat Feb 13 16:52:33 2010 (r203838) @@ -34,11 +34,9 @@ #include -#include - #ifndef LOCORE -#define KTR_CPU UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)) +#define KTR_CPU PCPU_GET(mid) #else @@ -74,7 +72,7 @@ l2: add r2, 1, r3 ; \ add r1, r2, r1 ; \ rd %tick, r2 ; \ stx r2, [r1 + KTR_TIMESTAMP] ; \ - UPA_GET_MID(r2) ; \ + lduw [PCPU(MID)], r2 ; \ stw r2, [r1 + KTR_CPU] ; \ stw %g0, [r1 + KTR_LINE] ; \ stx %g0, [r1 + KTR_FILE] ; \ @@ -84,7 +82,7 @@ l2: add r2, 1, r3 ; \ #define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \ set mask, r1 ; \ TEST(ktr_mask, r1, r2, r2, l3) ; \ - UPA_GET_MID(r1) ; \ + lduw [PCPU(MID)], r1 ; \ mov 1, r2 ; \ sllx r2, r1, r1 ; \ TEST(ktr_cpumask, r1, r2, r3, l3) ; \ Modified: head/sys/sparc64/include/md_var.h ============================================================================== --- head/sys/sparc64/include/md_var.h Sat Feb 13 16:28:25 2010 (r203837) +++ head/sys/sparc64/include/md_var.h Sat Feb 13 16:52:33 2010 (r203838) @@ -47,6 +47,8 @@ extern vm_paddr_t kstack0_phys; struct pcpu; struct md_utrap; +const char *cpu_cpuid_prop(void); +uint32_t cpu_get_mid(void); void cpu_identify(u_long vers, u_int clock, u_int id); void cpu_setregs(struct pcpu *pc); int is_physical_memory(vm_paddr_t addr); Modified: head/sys/sparc64/include/upa.h ============================================================================== --- head/sys/sparc64/include/upa.h Sat Feb 13 16:28:25 2010 (r203837) +++ head/sys/sparc64/include/upa.h Sat Feb 13 16:52:33 2010 (r203838) @@ -26,25 +26,16 @@ */ #ifndef _MACHINE_UPA_H_ -#define _MACHINE_UPA_H_ +#define _MACHINE_UPA_H_ #define UPA_MEMSTART 0x1c000000000UL #define UPA_MEMEND 0x1ffffffffffUL #define UPA_CR_MID_SHIFT (17) #define UPA_CR_MID_SIZE (5) -#define UPA_CR_MID_MASK \ +#define UPA_CR_MID_MASK \ (((1 << UPA_CR_MID_SIZE) - 1) << UPA_CR_MID_SHIFT) #define UPA_CR_GET_MID(cr) ((cr & UPA_CR_MID_MASK) >> UPA_CR_MID_SHIFT) -#ifdef LOCORE - -#define UPA_GET_MID(r1) \ - ldxa [%g0] ASI_UPA_CONFIG_REG, r1 ; \ - srlx r1, UPA_CR_MID_SHIFT, r1 ; \ - and r1, (1 << UPA_CR_MID_SIZE) - 1, r1 - -#endif - #endif /* _MACHINE_UPA_H_ */ Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Sat Feb 13 16:28:25 2010 (r203837) +++ head/sys/sparc64/sparc64/machdep.c Sat Feb 13 16:52:33 2010 (r203838) @@ -89,10 +89,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include +#include #include #include #include @@ -143,11 +146,12 @@ static int cpu_use_vis = 1; cpu_block_copy_t *cpu_block_copy; cpu_block_zero_t *cpu_block_zero; +static phandle_t find_bsp(phandle_t node, uint32_t bspid); void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec); -void sparc64_shutdown_final(void *dummy, int howto); +static void sparc64_shutdown_final(void *dummy, int howto); -static void cpu_startup(void *); +static void cpu_startup(void *arg); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); CTASSERT((1 << INT_SHIFT) == sizeof(int)); @@ -236,18 +240,94 @@ spinlock_exit(void) wrpr(pil, td->td_md.md_saved_pil, 0); } +static phandle_t +find_bsp(phandle_t node, uint32_t bspid) +{ + char type[sizeof("cpu")]; + phandle_t child; + uint32_t cpuid; + + for (; node != 0; node = OF_peer(node)) { + child = OF_child(node); + if (child > 0) { + child = find_bsp(child, bspid); + if (child > 0) + return (child); + } else { + if (OF_getprop(node, "device_type", type, + sizeof(type)) <= 0) + continue; + if (strcmp(type, "cpu") != 0) + continue; + if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, + sizeof(cpuid)) <= 0) + continue; + if (cpuid == bspid) + return (node); + } + } + return (0); +} + +const char * +cpu_cpuid_prop(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return ("upa-portid"); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return ("portid"); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return ("cpuid"); + default: + return (""); + } +} + +uint32_t +cpu_get_mid(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return (UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + return (FIREPLANE_CR_GET_AID(ldxa(AA_FIREPLANE_CONFIG, + ASI_FIREPLANE_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return (JBUS_CR_GET_JID(ldxa(0, ASI_JBUS_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return (INTR_ID_GET_ID(ldxa(AA_INTR_ID, ASI_INTR_ID))); + default: + return (0); + } +} + void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec) { - char type[8]; char *env; struct pcpu *pc; vm_offset_t end; vm_offset_t va; caddr_t kmdp; - phandle_t child; phandle_t root; - uint32_t portid; end = 0; kmdp = NULL; @@ -319,7 +399,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1; pcpu_init(pc, 0, sizeof(struct pcpu)); pc->pc_addr = (vm_offset_t)pcpu0; - pc->pc_mid = UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)); + pc->pc_mid = cpu_get_mid(); pc->pc_tlb_ctx = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_min = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_max = TLB_CTX_USER_MAX; @@ -328,24 +408,11 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * Determine the OFW node and frequency of the BSP (and ensure the * BSP is in the device tree in the first place). */ - pc->pc_node = 0; root = OF_peer(0); - for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (OF_getprop(child, "device_type", type, sizeof(type)) <= 0) - continue; - if (strcmp(type, "cpu") != 0) - continue; - if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? - "upa-portid" : "portid", &portid, sizeof(portid)) <= 0) - continue; - if (portid == pc->pc_mid) { - pc->pc_node = child; - break; - } - } + pc->pc_node = find_bsp(root, pc->pc_mid); if (pc->pc_node == 0) OF_exit(); - if (OF_getprop(child, "clock-frequency", &pc->pc_clock, + if (OF_getprop(pc->pc_node, "clock-frequency", &pc->pc_clock, sizeof(pc->pc_clock)) <= 0) OF_exit(); @@ -838,7 +905,7 @@ cpu_halt(void) cpu_shutdown(&args); } -void +static void sparc64_shutdown_final(void *dummy, int howto) { static struct { Modified: head/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- head/sys/sparc64/sparc64/mp_locore.S Sat Feb 13 16:28:25 2010 (r203837) +++ head/sys/sparc64/sparc64/mp_locore.S Sat Feb 13 16:52:33 2010 (r203838) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "assym.s" @@ -212,14 +211,8 @@ ENTRY(mp_startup) nop wr %l1, 0, %asr24 -3: UPA_GET_MID(%o0) - -#if KTR_COMPILE & KTR_SMP - CATR(KTR_SMP, "mp_start: CPU %d entered kernel" - , %g1, %g2, %g3, 7, 8, 9) - stx %o0, [%g1 + KTR_PARM1] -9: -#endif +3: call cpu_get_mid + nop /* * Inform the boot processor we have inited. @@ -236,13 +229,6 @@ ENTRY(mp_startup) bne %xcc, 4b nop -#if KTR_COMPILE & KTR_SMP - CATR(KTR_SMP, "_mp_start: CPU %d got start signal" - , %g1, %g2, %g3, 7, 8, 9) - stx %o0, [%g1 + KTR_PARM1] -9: -#endif - add %l0, CSA_TTES, %l1 clr %l2 @@ -283,7 +269,7 @@ ENTRY(mp_startup) #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, - "_mp_start: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" + "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" , %g1, %g2, %g3, 7, 8, 9) lduw [%l1 + PC_CPUID], %g2 stx %g2, [%g1 + KTR_PARM1] Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Sat Feb 13 16:28:25 2010 (r203837) +++ head/sys/sparc64/sparc64/mp_machdep.c Sat Feb 13 16:52:33 2010 (r203838) @@ -119,7 +119,11 @@ static u_int cpuid_to_mid[MAXCPU]; static int isjbus; static volatile u_int shutdown_cpus; +static void ap_count(phandle_t node, u_int mid); +static void ap_start(phandle_t node, u_int mid); static void cpu_mp_unleash(void *v); +static void foreach_ap(phandle_t node, void (*func)(phandle_t node, + u_int mid)); static void spitfire_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); static void sun4u_startcpu(phandle_t cpu, void *func, u_long arg); @@ -166,25 +170,56 @@ mp_init(void) cpu_ipi_selected = spitfire_ipi_selected; } +static void +foreach_ap(phandle_t node, void (*func)(phandle_t node, u_int mid)) +{ + char type[sizeof("cpu")]; + phandle_t child; + u_int cpuid; + + /* There's no need to traverse the whole OFW tree twice. */ + if (mp_maxid > 0 && mp_ncpus >= mp_maxid + 1) + return; + + for (; node != 0; node = OF_peer(node)) { + child = OF_child(node); + if (child > 0) + foreach_ap(child, func); + else { + if (OF_getprop(node, "device_type", type, + sizeof(type)) <= 0) + continue; + if (strcmp(type, "cpu") != 0) + continue; + if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, + sizeof(cpuid)) <= 0) + panic("%s: can't get module ID", __func__); + if (cpuid == PCPU_GET(mid)) + continue; + (*func)(node, cpuid); + } + } +} + /* * Probe for other CPUs. */ void -cpu_mp_setmaxid(void) +cpu_mp_setmaxid() { - char buf[128]; - phandle_t child; - u_int cpus; all_cpus = 1 << curcpu; mp_ncpus = 1; + mp_maxid = 0; + + foreach_ap(OF_child(OF_peer(0)), ap_count); +} + +static void +ap_count(phandle_t node __unused, u_int mid __unused) +{ - cpus = 0; - for (child = OF_child(OF_peer(0)); child != 0; child = OF_peer(child)) - if (OF_getprop(child, "device_type", buf, sizeof(buf)) > 0 && - strcmp(buf, "cpu") == 0) - cpus++; - mp_maxid = cpus - 1; + mp_maxid++; } int @@ -228,15 +263,6 @@ sun4u_startcpu(phandle_t cpu, void *func void cpu_mp_start(void) { - char buf[128]; - volatile struct cpu_start_args *csa; - struct pcpu *pc; - register_t s; - vm_offset_t va; - phandle_t child; - u_int mid; - u_int clock; - u_int cpuid; mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN); @@ -248,65 +274,68 @@ cpu_mp_start(void) cpuid_to_mid[curcpu] = PCPU_GET(mid); - csa = &cpu_start_args; - for (child = OF_child(OF_peer(0)); child != 0 && mp_ncpus <= MAXCPU; - child = OF_peer(child)) { - if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0 || - strcmp(buf, "cpu") != 0) - continue; - if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? - "upa-portid" : "portid", &mid, sizeof(mid)) <= 0) - panic("%s: can't get module ID", __func__); - if (mid == PCPU_GET(mid)) - continue; - if (OF_getprop(child, "clock-frequency", &clock, - sizeof(clock)) <= 0) - panic("%s: can't get clock", __func__); - if (clock != PCPU_GET(clock)) - hardclock_use_stick = 1; + foreach_ap(OF_child(OF_peer(0)), ap_start); + KASSERT(!isjbus || mp_ncpus <= IDR_JALAPENO_MAX_BN_PAIRS, + ("%s: can only IPI a maximum of %d JBus-CPUs", + __func__, IDR_JALAPENO_MAX_BN_PAIRS)); + PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu)); + smp_active = 1; +} - csa->csa_state = 0; - sun4u_startcpu(child, (void *)mp_tramp, 0); - s = intr_disable(); - while (csa->csa_state != CPU_TICKSYNC) +static void +ap_start(phandle_t node, u_int mid) +{ + volatile struct cpu_start_args *csa; + struct pcpu *pc; + register_t s; + vm_offset_t va; + u_int clock; + u_int cpuid; + + if (mp_ncpus > MAXCPU) + return; + + if (OF_getprop(node, "clock-frequency", &clock, sizeof(clock)) <= 0) + panic("%s: can't get clock", __func__); + if (clock != PCPU_GET(clock)) + hardclock_use_stick = 1; + + csa = &cpu_start_args; + csa->csa_state = 0; + sun4u_startcpu(node, (void *)mp_tramp, 0); + s = intr_disable(); + while (csa->csa_state != CPU_TICKSYNC) + ; + membar(StoreLoad); + csa->csa_tick = rd(tick); + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { + while (csa->csa_state != CPU_STICKSYNC) ; membar(StoreLoad); - csa->csa_tick = rd(tick); - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { - while (csa->csa_state != CPU_STICKSYNC) - ; - membar(StoreLoad); - csa->csa_stick = rdstick(); - } - while (csa->csa_state != CPU_INIT) - ; - csa->csa_tick = csa->csa_stick = 0; - intr_restore(s); + csa->csa_stick = rdstick(); + } + while (csa->csa_state != CPU_INIT) + ; + csa->csa_tick = csa->csa_stick = 0; + intr_restore(s); - cpuid = mp_ncpus++; - cpuid_to_mid[cpuid] = mid; - cpu_identify(csa->csa_ver, clock, cpuid); - - va = kmem_alloc(kernel_map, PCPU_PAGES * PAGE_SIZE); - pc = (struct pcpu *)(va + (PCPU_PAGES * PAGE_SIZE)) - 1; - pcpu_init(pc, cpuid, sizeof(*pc)); - dpcpu_init((void *)kmem_alloc(kernel_map, DPCPU_SIZE), - cpuid); - pc->pc_addr = va; - pc->pc_clock = clock; - pc->pc_mid = mid; - pc->pc_node = child; + cpuid = mp_ncpus++; + cpuid_to_mid[cpuid] = mid; + cpu_identify(csa->csa_ver, clock, cpuid); + + va = kmem_alloc(kernel_map, PCPU_PAGES * PAGE_SIZE); + pc = (struct pcpu *)(va + (PCPU_PAGES * PAGE_SIZE)) - 1; + pcpu_init(pc, cpuid, sizeof(*pc)); + dpcpu_init((void *)kmem_alloc(kernel_map, DPCPU_SIZE), cpuid); + pc->pc_addr = va; + pc->pc_clock = clock; + pc->pc_mid = mid; + pc->pc_node = node; - cache_init(pc); + cache_init(pc); - all_cpus |= 1 << cpuid; - intr_add_cpu(cpuid); - } - KASSERT(!isjbus || mp_ncpus <= IDR_JALAPENO_MAX_BN_PAIRS, - ("%s: can only IPI a maximum of %d JBus-CPUs", - __func__, IDR_JALAPENO_MAX_BN_PAIRS)); - PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu)); - smp_active = 1; + all_cpus |= 1 << cpuid; + intr_add_cpu(cpuid); } void From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 17:05:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6C8C10656AD; Sat, 13 Feb 2010 17:05:57 +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 6F1AC8FC1A; Sat, 13 Feb 2010 17:05:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DH5vNc016197; Sat, 13 Feb 2010 17:05:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DH5vNt016194; Sat, 13 Feb 2010 17:05:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002131705.o1DH5vNt016194@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Feb 2010 17:05: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: r203839 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 17:05:57 -0000 Author: marius Date: Sat Feb 13 17:05:57 2010 New Revision: 203839 URL: http://svn.freebsd.org/changeset/base/203839 Log: Style fixes Modified: head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Sat Feb 13 16:52:33 2010 (r203838) +++ head/sys/sparc64/sparc64/pmap.c Sat Feb 13 17:05:57 2010 (r203839) @@ -241,6 +241,7 @@ PMAP_STATS_VAR(pmap_nnew_thread_oc); */ static int mr_cmp(const void *a, const void *b); static int om_cmp(const void *a, const void *b); + static int mr_cmp(const void *a, const void *b) { @@ -256,6 +257,7 @@ mr_cmp(const void *a, const void *b) else return (0); } + static int om_cmp(const void *a, const void *b) { @@ -1111,10 +1113,9 @@ pmap_release(pmap_t pm) * to a kernel thread, leaving the pmap pointer unchanged. */ mtx_lock_spin(&sched_lock); - SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) if (pc->pc_pmap == pm) pc->pc_pmap = NULL; - } mtx_unlock_spin(&sched_lock); obj = pm->pm_tsb_obj; @@ -1150,7 +1151,7 @@ pmap_growkernel(vm_offset_t addr) int pmap_remove_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, - vm_offset_t va) + vm_offset_t va) { vm_page_t m; u_long data; @@ -1198,12 +1199,10 @@ pmap_remove(pmap_t pm, vm_offset_t start tsb_foreach(pm, NULL, start, end, pmap_remove_tte); tlb_context_demap(pm); } else { - for (va = start; va < end; va += PAGE_SIZE) { - if ((tp = tsb_tte_lookup(pm, va)) != NULL) { - if (!pmap_remove_tte(pm, NULL, tp, va)) - break; - } - } + for (va = start; va < end; va += PAGE_SIZE) + if ((tp = tsb_tte_lookup(pm, va)) != NULL && + !pmap_remove_tte(pm, NULL, tp, va)) + break; tlb_range_demap(pm, start, end - 1); } PMAP_UNLOCK(pm); @@ -1245,7 +1244,7 @@ pmap_remove_all(vm_page_t m) int pmap_protect_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, - vm_offset_t va) + vm_offset_t va) { u_long data; vm_page_t m; @@ -1287,10 +1286,9 @@ pmap_protect(pmap_t pm, vm_offset_t sva, tsb_foreach(pm, NULL, sva, eva, pmap_protect_tte); tlb_context_demap(pm); } else { - for (va = sva; va < eva; va += PAGE_SIZE) { + for (va = sva; va < eva; va += PAGE_SIZE) if ((tp = tsb_tte_lookup(pm, va)) != NULL) pmap_protect_tte(pm, NULL, tp, va); - } tlb_range_demap(pm, sva, eva - 1); } PMAP_UNLOCK(pm); @@ -1386,21 +1384,18 @@ pmap_enter_locked(pmap_t pm, vm_offset_t */ if ((prot & VM_PROT_WRITE) != 0) { tp->tte_data |= TD_SW; - if (wired) { + if (wired) tp->tte_data |= TD_W; - } vm_page_flag_set(m, PG_WRITEABLE); - } else if ((data & TD_W) != 0) { + } else if ((data & TD_W) != 0) vm_page_dirty(m); - } /* * If we're turning on execute permissions, flush the icache. */ if ((prot & VM_PROT_EXECUTE) != 0) { - if ((data & TD_EXEC) == 0) { + if ((data & TD_EXEC) == 0) icache_page_inval(pa); - } tp->tte_data |= TD_EXEC; } @@ -1495,7 +1490,7 @@ pmap_enter_quick(pmap_t pm, vm_offset_t void pmap_object_init_pt(pmap_t pm, vm_offset_t addr, vm_object_t object, - vm_pindex_t pindex, vm_size_t size) + vm_pindex_t pindex, vm_size_t size) { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); @@ -1529,7 +1524,8 @@ pmap_change_wiring(pmap_t pm, vm_offset_ } static int -pmap_copy_tte(pmap_t src_pmap, pmap_t dst_pmap, struct tte *tp, vm_offset_t va) +pmap_copy_tte(pmap_t src_pmap, pmap_t dst_pmap, struct tte *tp, + vm_offset_t va) { vm_page_t m; u_long data; @@ -1567,10 +1563,9 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm pmap_copy_tte); tlb_context_demap(dst_pmap); } else { - for (va = src_addr; va < src_addr + len; va += PAGE_SIZE) { + for (va = src_addr; va < src_addr + len; va += PAGE_SIZE) if ((tp = tsb_tte_lookup(src_pmap, va)) != NULL) pmap_copy_tte(src_pmap, dst_pmap, tp, va); - } tlb_range_demap(dst_pmap, src_addr, src_addr + len - 1); } vm_page_unlock_queues(); @@ -1823,10 +1818,9 @@ pmap_page_is_mapped(vm_page_t m) if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) return (FALSE); mtx_assert(&vm_page_queue_mtx, MA_OWNED); - TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { + TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) if ((tp->tte_data & TD_PV) != 0) return (TRUE); - } return (FALSE); } @@ -2004,6 +1998,7 @@ pmap_activate(struct thread *td) void pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) { + } /* From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 17:35:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF08C1065706; Sat, 13 Feb 2010 17:35:29 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFB5C8FC14; Sat, 13 Feb 2010 17:35:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DHZTF4044968; Sat, 13 Feb 2010 17:35:29 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DHZTgM044965; Sat, 13 Feb 2010 17:35:29 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201002131735.o1DHZTgM044965@svn.freebsd.org> From: Antoine Brodin Date: Sat, 13 Feb 2010 17:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203840 - stable/8/kerberos5/usr.bin/kdestroy X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 17:35:30 -0000 Author: antoine Date: Sat Feb 13 17:35:29 2010 New Revision: 203840 URL: http://svn.freebsd.org/changeset/base/203840 Log: Merge r201918 to stable/8: Fix a typo. Modified: stable/8/kerberos5/usr.bin/kdestroy/Makefile Directory Properties: stable/8/kerberos5/usr.bin/kdestroy/ (props changed) Modified: stable/8/kerberos5/usr.bin/kdestroy/Makefile ============================================================================== --- stable/8/kerberos5/usr.bin/kdestroy/Makefile Sat Feb 13 17:05:57 2010 (r203839) +++ stable/8/kerberos5/usr.bin/kdestroy/Makefile Sat Feb 13 17:35:29 2010 (r203840) @@ -2,7 +2,7 @@ PROG= kdestroy CFLAGS+=-I${KRB5DIR}/lib/roken -DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHX509) ${LIBROKEN} ${LIBVERS} \ +DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHX509} ${LIBROKEN} ${LIBVERS} \ ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT} ${LIBCOM_ERR} LDADD= -lkafs5 -lkrb5 -lhx509 -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -lcom_err From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 17:41:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DB0A1065679; Sat, 13 Feb 2010 17:41:23 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E6B78FC16; Sat, 13 Feb 2010 17:41:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DHfNxT050705; Sat, 13 Feb 2010 17:41:23 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DHfNVO050703; Sat, 13 Feb 2010 17:41:23 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201002131741.o1DHfNVO050703@svn.freebsd.org> From: Antoine Brodin Date: Sat, 13 Feb 2010 17:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203841 - stable/8/kerberos5/usr.bin/kpasswd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 17:41:23 -0000 Author: antoine Date: Sat Feb 13 17:41:22 2010 New Revision: 203841 URL: http://svn.freebsd.org/changeset/base/203841 Log: Merge r201919 to stable/8: Fix a typo. Modified: stable/8/kerberos5/usr.bin/kpasswd/Makefile Directory Properties: stable/8/kerberos5/usr.bin/kpasswd/ (props changed) Modified: stable/8/kerberos5/usr.bin/kpasswd/Makefile ============================================================================== --- stable/8/kerberos5/usr.bin/kpasswd/Makefile Sat Feb 13 17:35:29 2010 (r203840) +++ stable/8/kerberos5/usr.bin/kpasswd/Makefile Sat Feb 13 17:41:22 2010 (r203841) @@ -2,7 +2,7 @@ PROG= kpasswd CFLAGS+=-I${KRB5DIR}/lib/roken -DPADD= ${LIBKRB5} ${LIBHX509 ${LIBROKEN} ${LIBVERS} \ +DPADD= ${LIBKRB5} ${LIBHX509} ${LIBROKEN} ${LIBVERS} \ ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT} ${LIBCOM_ERR} LDADD= -lkrb5 -lhx509 -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -lcom_err From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 17:48:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD3D3106566B; Sat, 13 Feb 2010 17:48:52 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADF348FC0C; Sat, 13 Feb 2010 17:48:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DHmqsH058000; Sat, 13 Feb 2010 17:48:52 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DHmqbS057998; Sat, 13 Feb 2010 17:48:52 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201002131748.o1DHmqbS057998@svn.freebsd.org> From: Antoine Brodin Date: Sat, 13 Feb 2010 17:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203842 - stable/8/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 17:48:52 -0000 Author: antoine Date: Sat Feb 13 17:48:52 2010 New Revision: 203842 URL: http://svn.freebsd.org/changeset/base/203842 Log: Merge r201920 to stable/8: libusb20 was renamed libusb several months ago. Modified: stable/8/share/mk/bsd.libnames.mk Directory Properties: stable/8/share/mk/ (props changed) Modified: stable/8/share/mk/bsd.libnames.mk ============================================================================== --- stable/8/share/mk/bsd.libnames.mk Sat Feb 13 17:41:22 2010 (r203841) +++ stable/8/share/mk/bsd.libnames.mk Sat Feb 13 17:48:52 2010 (r203842) @@ -150,7 +150,7 @@ LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a -LIBUSB20?= ${DESTDIR}${LIBDIR}/libusb20.a +LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 18:18:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16FF9106568D; Sat, 13 Feb 2010 18:18:46 +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 E23058FC0C; Sat, 13 Feb 2010 18:18:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DIIj9a087257; Sat, 13 Feb 2010 18:18:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DIIj3R087254; Sat, 13 Feb 2010 18:18:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002131818.o1DIIj3R087254@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Feb 2010 18:18: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: r203843 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 18:18:46 -0000 Author: marius Date: Sat Feb 13 18:18:45 2010 New Revision: 203843 URL: http://svn.freebsd.org/changeset/base/203843 Log: Resurrect nexusvar.h from r167307. Added: head/sys/sparc64/include/nexusvar.h - copied unchanged from r167307, head/sys/sparc64/include/nexusvar.h Copied: head/sys/sparc64/include/nexusvar.h (from r167307, head/sys/sparc64/include/nexusvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sparc64/include/nexusvar.h Sat Feb 13 18:18:45 2010 (r203843, copy of r167307, head/sys/sparc64/include/nexusvar.h) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2001 by Thomas Moestl . + * 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 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$ + */ + +#ifndef _MACHINE_NEXUSVAR_H_ +#define _MACHINE_NEXUSVAR_H_ + +enum nexus_ivars { + NEXUS_IVAR_NODE, + NEXUS_IVAR_NAME, + NEXUS_IVAR_DEVICE_TYPE, + NEXUS_IVAR_MODEL, + NEXUS_IVAR_REG, + NEXUS_IVAR_NREG, + NEXUS_IVAR_INTERRUPTS, + NEXUS_IVAR_NINTERRUPTS, + NEXUS_IVAR_DMATAG, +}; + +#define NEXUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(nexus, var, NEXUS, ivar, type) + +NEXUS_ACCESSOR(node, NODE, phandle_t) +NEXUS_ACCESSOR(name, NAME, char *) +NEXUS_ACCESSOR(device_type, DEVICE_TYPE, char *) +NEXUS_ACCESSOR(model, MODEL, char *) +NEXUS_ACCESSOR(reg, REG, struct upa_regs *) +NEXUS_ACCESSOR(nreg, NREG, int) +NEXUS_ACCESSOR(interrupts, INTERRUPTS, u_int *) +NEXUS_ACCESSOR(ninterrupts, NINTERRUPTS, int) +NEXUS_ACCESSOR(dmatag, DMATAG, bus_dma_tag_t) + +#undef NEXUS_ACCESSOR + +#endif /* _MACHINE_NEXUSVAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 18:51:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F0B41065693; Sat, 13 Feb 2010 18:51:49 +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 6F3F58FC1E; Sat, 13 Feb 2010 18:51:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DIpnCM019677; Sat, 13 Feb 2010 18:51:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DIpngt019671; Sat, 13 Feb 2010 18:51:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002131851.o1DIpngt019671@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Feb 2010 18:51: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: r203844 - in head/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 18:51:50 -0000 Author: marius Date: Sat Feb 13 18:51:49 2010 New Revision: 203844 URL: http://svn.freebsd.org/changeset/base/203844 Log: - Add the 'cmp' and 'core' pseudo-busses which are used to group CPU cores to the exclusion lists as the CPU nodes aren't handled as regular devices either. Also add the pseudo-devices found in Sun Fire V1280. - Allow nexus_attach() and nexus_alloc_resource() to be used by drivers derived from nexus(4) for subordinate busses. - Don't add the zero-sized memory resources of glue devices to the resource lists. Modified: head/sys/sparc64/include/nexusvar.h head/sys/sparc64/sparc64/nexus.c Modified: head/sys/sparc64/include/nexusvar.h ============================================================================== --- head/sys/sparc64/include/nexusvar.h Sat Feb 13 18:18:45 2010 (r203843) +++ head/sys/sparc64/include/nexusvar.h Sat Feb 13 18:51:49 2010 (r203844) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 by Thomas Moestl . + * Copyright (c) 2010 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -11,48 +11,24 @@ * 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 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. + * 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$ */ #ifndef _MACHINE_NEXUSVAR_H_ -#define _MACHINE_NEXUSVAR_H_ +#define _MACHINE_NEXUSVAR_H_ -enum nexus_ivars { - NEXUS_IVAR_NODE, - NEXUS_IVAR_NAME, - NEXUS_IVAR_DEVICE_TYPE, - NEXUS_IVAR_MODEL, - NEXUS_IVAR_REG, - NEXUS_IVAR_NREG, - NEXUS_IVAR_INTERRUPTS, - NEXUS_IVAR_NINTERRUPTS, - NEXUS_IVAR_DMATAG, -}; - -#define NEXUS_ACCESSOR(var, ivar, type) \ - __BUS_ACCESSOR(nexus, var, NEXUS, ivar, type) - -NEXUS_ACCESSOR(node, NODE, phandle_t) -NEXUS_ACCESSOR(name, NAME, char *) -NEXUS_ACCESSOR(device_type, DEVICE_TYPE, char *) -NEXUS_ACCESSOR(model, MODEL, char *) -NEXUS_ACCESSOR(reg, REG, struct upa_regs *) -NEXUS_ACCESSOR(nreg, NREG, int) -NEXUS_ACCESSOR(interrupts, INTERRUPTS, u_int *) -NEXUS_ACCESSOR(ninterrupts, NINTERRUPTS, int) -NEXUS_ACCESSOR(dmatag, DMATAG, bus_dma_tag_t) - -#undef NEXUS_ACCESSOR +DECLARE_CLASS(nexus_driver); #endif /* _MACHINE_NEXUSVAR_H_ */ Modified: head/sys/sparc64/sparc64/nexus.c ============================================================================== --- head/sys/sparc64/sparc64/nexus.c Sat Feb 13 18:18:45 2010 (r203843) +++ head/sys/sparc64/sparc64/nexus.c Sat Feb 13 18:51:49 2010 (r203844) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -154,17 +155,22 @@ static const char *const nexus_excl_name "aliases", "associations", "chosen", + "cmp", "counter-timer", /* No separate device; handled by psycho/sbus */ + "failsafe", "memory", "openprom", "options", "packages", "rsc", + "sgcn", + "todsg", "virtual-memory", NULL }; static const char *const nexus_excl_type[] = { + "core", "cpu", NULL }; @@ -206,20 +212,24 @@ nexus_attach(device_t dev) device_t cdev; phandle_t node; - node = OF_peer(0); - if (node == -1) - panic("%s: OF_peer failed.", __func__); - - sc = device_get_softc(dev); - sc->sc_intr_rman.rm_type = RMAN_ARRAY; - sc->sc_intr_rman.rm_descr = "Interrupts"; - sc->sc_mem_rman.rm_type = RMAN_ARRAY; - sc->sc_mem_rman.rm_descr = "Device Memory"; - if (rman_init(&sc->sc_intr_rman) != 0 || - rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_intr_rman, 0, IV_MAX - 1) != 0 || - rman_manage_region(&sc->sc_mem_rman, 0ULL, ~0ULL) != 0) - panic("%s: failed to set up rmans.", __func__); + if (strcmp(device_get_name(device_get_parent(dev)), "root") == 0) { + node = OF_peer(0); + if (node == -1) + panic("%s: OF_peer failed.", __func__); + + sc = device_get_softc(dev); + sc->sc_intr_rman.rm_type = RMAN_ARRAY; + sc->sc_intr_rman.rm_descr = "Interrupts"; + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "Device Memory"; + if (rman_init(&sc->sc_intr_rman) != 0 || + rman_init(&sc->sc_mem_rman) != 0 || + rman_manage_region(&sc->sc_intr_rman, 0, + IV_MAX - 1) != 0 || + rman_manage_region(&sc->sc_mem_rman, 0ULL, ~0ULL) != 0) + panic("%s: failed to set up rmans.", __func__); + } else + node = ofw_bus_get_node(dev); /* * Allow devices to identify. @@ -347,12 +357,16 @@ nexus_alloc_resource(device_t bus, devic struct rman *rm; struct resource *rv; struct resource_list_entry *rle; + device_t nexus; int isdefault, needactivate, passthrough; isdefault = (start == 0UL && end == ~0UL); needactivate = flags & RF_ACTIVE; passthrough = (device_get_parent(child) != bus); - sc = device_get_softc(bus); + nexus = bus; + while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) + nexus = device_get_parent(nexus); + sc = device_get_softc(nexus); rle = NULL; if (!passthrough) { @@ -498,8 +512,10 @@ nexus_setup_dinfo(device_t dev, phandle_ for (i = 0; i < nreg; i++) { phys = NEXUS_REG_PHYS(®[i]); size = NEXUS_REG_SIZE(®[i]); - resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, phys, - phys + size - 1, size); + /* Skip the dummy reg property of glue devices like ssm(4). */ + if (size != 0) + resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, + phys, phys + size - 1, size); } free(reg, M_OFWPROP); From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 19:05:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F1B106566B; Sat, 13 Feb 2010 19:05:35 +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 A41728FC1D; Sat, 13 Feb 2010 19:05:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DJ5Z0k032149; Sat, 13 Feb 2010 19:05:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DJ5ZNp032146; Sat, 13 Feb 2010 19:05:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002131905.o1DJ5ZNp032146@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Feb 2010 19:05: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: r203845 - in head/sys: conf sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 19:05:35 -0000 Author: marius Date: Sat Feb 13 19:05:34 2010 New Revision: 203845 URL: http://svn.freebsd.org/changeset/base/203845 Log: Add ssm(4), which serves as a glue device allowing devices beneath the scalable shared memory node, which is used in large UltraSPARC III based machines to group snooping-coherency domains together, like schizo(4) to be treated like nexus(4) children. Added: head/sys/sparc64/sparc64/ssm.c (contents, props changed) Modified: head/sys/conf/files.sparc64 Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Sat Feb 13 18:51:49 2010 (r203844) +++ head/sys/conf/files.sparc64 Sat Feb 13 19:05:34 2010 (r203845) @@ -124,6 +124,7 @@ sparc64/sparc64/rwindow.c standard sparc64/sparc64/sc_machdep.c optional sc sparc64/sparc64/schppm.c standard sparc64/sparc64/spitfire.c standard +sparc64/sparc64/ssm.c standard sparc64/sparc64/stack_machdep.c optional ddb | stack sparc64/sparc64/support.S standard \ compile-with "${NORMAL_S} -mcpu=ultrasparc" Added: head/sys/sparc64/sparc64/ssm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sparc64/sparc64/ssm.c Sat Feb 13 19:05:34 2010 (r203845) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * 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$"); + +/* + * Glue allowing devices beneath the scalable shared memory node to be + * treated like nexus(4) children + */ + +#include +#include +#include +#include +#include + +#include + +#include + +static device_probe_t ssm_probe; + +static device_method_t ssm_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ssm_probe), + + /* Bus interface */ + + /* ofw_bus interface */ + + KOBJMETHOD_END +}; + +static devclass_t ssm_devclass; + +DEFINE_CLASS_1(ssm, ssm_driver, ssm_methods, 1 /* no softc */, nexus_driver); +EARLY_DRIVER_MODULE(ssm, nexus, ssm_driver, ssm_devclass, 0, 0, BUS_PASS_BUS); +MODULE_DEPEND(ssm, nexus, 1, 1, 1); +MODULE_VERSION(ssm, 1); + +static int +ssm_probe(device_t dev) +{ + + if (strcmp(ofw_bus_get_name(dev), "ssm") == 0) { + device_set_desc(dev, "Scalable Shared Memory"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 19:17:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F89A1065676; Sat, 13 Feb 2010 19:17:07 +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 45D288FC12; Sat, 13 Feb 2010 19:17:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DJH7YA043299; Sat, 13 Feb 2010 19:17:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DJH71D043296; Sat, 13 Feb 2010 19:17:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002131917.o1DJH71D043296@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Feb 2010 19:17: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: r203846 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 19:17:07 -0000 Author: marius Date: Sat Feb 13 19:17:06 2010 New Revision: 203846 URL: http://svn.freebsd.org/changeset/base/203846 Log: Predict KASSERTs to be true. Modified: head/sys/sparc64/include/asmacros.h Modified: head/sys/sparc64/include/asmacros.h ============================================================================== --- head/sys/sparc64/include/asmacros.h Sat Feb 13 19:05:34 2010 (r203845) +++ head/sys/sparc64/include/asmacros.h Sat Feb 13 19:17:06 2010 (r203846) @@ -107,7 +107,7 @@ #ifdef INVARIANTS #define KASSERT(r1, msg) \ - brnz r1, 8f ; \ + brnz,pt r1, 8f ; \ nop ; \ PANIC(msg, r1) ; \ 8: From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 21:38:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D02711065670; Sat, 13 Feb 2010 21:38:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD5B78FC08; Sat, 13 Feb 2010 21:38:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DLcFvN077389; Sat, 13 Feb 2010 21:38:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DLcFMO077388; Sat, 13 Feb 2010 21:38:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201002132138.o1DLcFMO077388@svn.freebsd.org> From: Michael Tuexen Date: Sat, 13 Feb 2010 21:38: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: r203847 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 21:38:15 -0000 Author: tuexen Date: Sat Feb 13 21:38:15 2010 New Revision: 203847 URL: http://svn.freebsd.org/changeset/base/203847 Log: Add missing SCTP_PACKED. Spotted by Irene Ruengeler. MFC after: 1 week Modified: head/sys/netinet/sctp_header.h Modified: head/sys/netinet/sctp_header.h ============================================================================== --- head/sys/netinet/sctp_header.h Sat Feb 13 19:17:06 2010 (r203846) +++ head/sys/netinet/sctp_header.h Sat Feb 13 21:38:15 2010 (r203847) @@ -62,7 +62,7 @@ struct sctp_ipv6addr_param { struct sctp_cookie_perserve_param { struct sctp_paramhdr ph;/* type=SCTP_COOKIE_PRESERVE, len=8 */ uint32_t time; /* time in ms to extend cookie */ -}; +} SCTP_PACKED; #define SCTP_ARRAY_MIN_LEN 1 /* Host Name Address */ @@ -495,7 +495,7 @@ struct sctp_stream_reset_add_strm { uint32_t request_seq; uint16_t number_of_streams; uint16_t reserved; -}; +} SCTP_PACKED; #define SCTP_STREAM_RESET_NOTHING 0x00000000 /* Nothing for me to do */ #define SCTP_STREAM_RESET_PERFORMED 0x00000001 /* Did it */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 13 23:56:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 510DF106566B; Sat, 13 Feb 2010 23:56:20 +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 096C28FC0C; Sat, 13 Feb 2010 23:56:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DNuJwY099148; Sat, 13 Feb 2010 23:56:19 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DNuJFW099146; Sat, 13 Feb 2010 23:56:19 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201002132356.o1DNuJFW099146@svn.freebsd.org> From: Rick Macklem Date: Sat, 13 Feb 2010 23:56:19 +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: r203848 - head/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 23:56:20 -0000 Author: rmacklem Date: Sat Feb 13 23:56:19 2010 New Revision: 203848 URL: http://svn.freebsd.org/changeset/base/203848 Log: This fixes the experimental NFS server so that it won't crash in the caching code for IPv6 by fixing a typo that used the incorrect variable. It also fixes the indentation of the statement above it. Reported by: simon AT comsys.ntu-kpi.kiev.ua MFC after: 5 days Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdcache.c Sat Feb 13 21:38:15 2010 (r203847) +++ head/sys/fs/nfsserver/nfs_nfsdcache.c Sat Feb 13 23:56:19 2010 (r203848) @@ -386,9 +386,9 @@ loop: newrp->rc_inet = saddr->sin_addr.s_addr; else if (saddr->sin_family == AF_INET6) { saddr6 = (struct sockaddr_in6 *)saddr; - NFSBCOPY((caddr_t)&saddr6->sin6_addr,(caddr_t)&newrp->rc_inet6, - sizeof (struct in6_addr)); - rp->rc_flag |= RC_INETIPV6; + NFSBCOPY((caddr_t)&saddr6->sin6_addr, (caddr_t)&newrp->rc_inet6, + sizeof (struct in6_addr)); + newrp->rc_flag |= RC_INETIPV6; } LIST_INSERT_HEAD(hp, newrp, rc_hash); TAILQ_INSERT_TAIL(&nfsrvudplru, newrp, rc_lru);