From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 00:57: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 6FF53106564A; Sun, 18 Apr 2010 00:57:31 +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 447CB8FC15; Sun, 18 Apr 2010 00:57: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 o3I0vVsq023282; Sun, 18 Apr 2010 00:57:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I0vVut023279; Sun, 18 Apr 2010 00:57:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004180057.o3I0vVut023279@svn.freebsd.org> From: Warner Losh Date: Sun, 18 Apr 2010 00:57: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: r206781 - stable/8/usr.sbin/config 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, 18 Apr 2010 00:57:31 -0000 Author: imp Date: Sun Apr 18 00:57:30 2010 New Revision: 206781 URL: http://svn.freebsd.org/changeset/base/206781 Log: MFC r206664: Allow option aliasing. Lines of the form: OLD_OPT = NEW_OPT in options* files will now map OLD_OPT to NEW_OPT with a friendly message. This is indented for situations where we need to preserve an interface in the config file in an upwards compatible fashion on a stable branch. Reviewed by: nwhitehorn@ MFC after: 3 days Modified: stable/8/usr.sbin/config/config.h stable/8/usr.sbin/config/mkoptions.c Directory Properties: stable/8/usr.sbin/config/ (props changed) Modified: stable/8/usr.sbin/config/config.h ============================================================================== --- stable/8/usr.sbin/config/config.h Sat Apr 17 23:48:07 2010 (r206780) +++ stable/8/usr.sbin/config/config.h Sun Apr 18 00:57:30 2010 (r206781) @@ -129,6 +129,8 @@ SLIST_HEAD(opt_head, opt) opt, mkopt, rm struct opt_list { char *o_name; char *o_file; + int o_flags; +#define OL_ALIAS 1 SLIST_ENTRY(opt_list) o_next; }; Modified: stable/8/usr.sbin/config/mkoptions.c ============================================================================== --- stable/8/usr.sbin/config/mkoptions.c Sat Apr 17 23:48:07 2010 (r206780) +++ stable/8/usr.sbin/config/mkoptions.c Sun Apr 18 00:57:30 2010 (r206781) @@ -94,6 +94,17 @@ options(void) SLIST_INSERT_HEAD(&opt, op, op_next); read_options(); + SLIST_FOREACH(op, &opt, op_next) { + SLIST_FOREACH(ol, &otab, o_next) { + if (eq(op->op_name, ol->o_name) && + (ol->o_flags & OL_ALIAS)) { + printf("Mapping option %s to %s.\n", + op->op_name, ol->o_file); + op->op_name = ol->o_file; + break; + } + } + } SLIST_FOREACH(ol, &otab, o_next) do_option(ol->o_name); SLIST_FOREACH(op, &opt, op_next) { @@ -124,7 +135,6 @@ do_option(char *name) int tidy; file = tooption(name); - /* * Check to see if the option was specified.. */ @@ -292,6 +302,7 @@ read_options(void) struct opt_list *po; int first = 1; char genopt[MAXPATHLEN]; + int flags = 0; SLIST_INIT(&otab); (void) snprintf(fname, sizeof(fname), "../../conf/options"); @@ -301,6 +312,7 @@ openit: return; } next: + flags = 0; wd = get_word(fp); if (wd == (char *)EOF) { (void) fclose(fp); @@ -332,6 +344,18 @@ next: (void) snprintf(genopt, sizeof(genopt), "opt_%s.h", lower(s)); val = genopt; free(s); + } else if (eq(val, "=")) { + val = get_word(fp); + if (val == (char *)EOF) { + printf("%s: unexpected end of file\n", fname); + exit(1); + } + if (val == 0) { + printf("%s: Expected a right hand side at %s\n", fname, + this); + exit(1); + } + flags |= OL_ALIAS; } val = ns(val); @@ -348,6 +372,7 @@ next: err(EXIT_FAILURE, "calloc"); po->o_name = this; po->o_file = val; + po->o_flags = flags; SLIST_INSERT_HEAD(&otab, po, o_next); goto next; From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 01:15: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 27854106566B; Sun, 18 Apr 2010 01:15:48 +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 0FE928FC0A; Sun, 18 Apr 2010 01:15: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 o3I1FlP5027359; Sun, 18 Apr 2010 01:15:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I1FlLh027356; Sun, 18 Apr 2010 01:15:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004180115.o3I1FlLh027356@svn.freebsd.org> From: Warner Losh Date: Sun, 18 Apr 2010 01:15: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: r206782 - stable/8/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, 18 Apr 2010 01:15:48 -0000 Author: imp Date: Sun Apr 18 01:15:47 2010 New Revision: 206782 URL: http://svn.freebsd.org/changeset/base/206782 Log: Remap COMPAT_IA32 to COMPAT_FREEBSD32 to ease the transition of this option and not break 8.0 config files later in the 8.x branch. # Yes, this is a direct commit, since this is not relevant to head. Modified: stable/8/sys/conf/options.amd64 stable/8/sys/conf/options.ia64 Modified: stable/8/sys/conf/options.amd64 ============================================================================== --- stable/8/sys/conf/options.amd64 Sun Apr 18 00:57:30 2010 (r206781) +++ stable/8/sys/conf/options.amd64 Sun Apr 18 01:15:47 2010 (r206782) @@ -11,6 +11,7 @@ MP_WATCHDOG # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems # (see src/sys/conf/options), except for broken debugging options. +COMPAT_IA32 = COMPAT_FREEBSD32 COMPAT_FREEBSD32 opt_compat.h #IBCS2 opt_dontuse.h #COMPAT_LINUX opt_dontuse.h Modified: stable/8/sys/conf/options.ia64 ============================================================================== --- stable/8/sys/conf/options.ia64 Sun Apr 18 00:57:30 2010 (r206781) +++ stable/8/sys/conf/options.ia64 Sun Apr 18 01:15:47 2010 (r206782) @@ -9,6 +9,7 @@ LOG2_PAGE_SIZE opt_global.h UWX_TRACE_ENABLE opt_global.h +COMPAT_IA32 = COMPAT_FREEBSD32 COMPAT_FREEBSD32 opt_compat.h EXCEPTION_TRACING opt_xtrace.h From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 03:52: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 ADC9B1065673; Sun, 18 Apr 2010 03:52:41 +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 9B3478FC0A; Sun, 18 Apr 2010 03:52: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 o3I3qf4R061983; Sun, 18 Apr 2010 03:52:41 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I3qf1q061982; Sun, 18 Apr 2010 03:52:41 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004180352.o3I3qf1q061982@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 18 Apr 2010 03:52:41 +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: r206783 - stable/8/lib/libc/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: Sun, 18 Apr 2010 03:52:41 -0000 Author: ume Date: Sun Apr 18 03:52:41 2010 New Revision: 206783 URL: http://svn.freebsd.org/changeset/base/206783 Log: MFC ir206152, r206153, r206154: - Stop adding trailing '\n'. The servent_unpack() doesn't expect lines terminated with '\n'. - Treat '+' as special only when in compat mode, and simplify the logic bit. - Reduce duplicate code. Modified: stable/8/lib/libc/net/getservent.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/net/getservent.c ============================================================================== --- stable/8/lib/libc/net/getservent.c Sun Apr 18 01:15:47 2010 (r206782) +++ stable/8/lib/libc/net/getservent.c Sun Apr 18 03:52:41 2010 (r206783) @@ -207,6 +207,32 @@ servent_unpack(char *p, struct servent * return 0; } +static int +parse_result(struct servent *serv, char *buffer, size_t bufsize, + char *resultbuf, size_t resultbuflen, int *errnop) +{ + char **aliases; + int aliases_size; + + if (bufsize <= resultbuflen + _ALIGNBYTES + sizeof(char *)) { + *errnop = ERANGE; + return (NS_RETURN); + } + aliases = (char **)_ALIGN(&buffer[resultbuflen + 1]); + aliases_size = (buffer + bufsize - (char *)aliases) / sizeof(char *); + if (aliases_size < 1) { + *errnop = ERANGE; + return (NS_RETURN); + } + + memcpy(buffer, resultbuf, resultbuflen); + buffer[resultbuflen] = '\0'; + + if (servent_unpack(buffer, serv, aliases, aliases_size, errnop) != 0) + return ((*errnop == 0) ? NS_NOTFOUND : NS_RETURN); + return (NS_SUCCESS); +} + /* files backend implementation */ static void files_endstate(void *p) @@ -258,8 +284,6 @@ files_servent(void *retval, void *mdata, size_t bufsize; int *errnop; - char **aliases; - int aliases_size; size_t linesize; char *line; char **cp; @@ -315,28 +339,8 @@ files_servent(void *retval, void *mdata, break; } - if (*line=='+') { - if (serv_mdata->compat_mode != 0) - st->compat_mode_active = 1; - } else { - if (bufsize <= linesize + _ALIGNBYTES + - sizeof(char *)) { - *errnop = ERANGE; - rv = NS_RETURN; - break; - } - aliases = (char **)_ALIGN(&buffer[linesize+1]); - aliases_size = (buffer + bufsize - - (char *)aliases) / sizeof(char *); - if (aliases_size < 1) { - *errnop = ERANGE; - rv = NS_RETURN; - break; - } - - memcpy(buffer, line, linesize); - buffer[linesize] = '\0'; - } + if (*line=='+' && serv_mdata->compat_mode != 0) + st->compat_mode_active = 1; } if (st->compat_mode_active != 0) { @@ -367,18 +371,12 @@ files_servent(void *retval, void *mdata, continue; } - rv = servent_unpack(buffer, serv, aliases, aliases_size, + rv = parse_result(serv, buffer, bufsize, line, linesize, errnop); - if (rv !=0 ) { - if (*errnop == 0) { - rv = NS_NOTFOUND; - continue; - } - else { - rv = NS_RETURN; - break; - } - } + if (rv == NS_NOTFOUND) + continue; + if (rv == NS_RETURN) + break; rv = NS_NOTFOUND; switch (serv_mdata->how) { @@ -486,9 +484,6 @@ nis_servent(void *retval, void *mdata, v size_t bufsize; int *errnop; - char **aliases; - int aliases_size; - name = NULL; proto = NULL; how = (enum nss_lookup_type)mdata; @@ -594,39 +589,8 @@ nis_servent(void *retval, void *mdata, v break; }; - /* we need a room for additional \n symbol */ - if (bufsize <= - resultbuflen + 1 + _ALIGNBYTES + sizeof(char *)) { - *errnop = ERANGE; - rv = NS_RETURN; - break; - } - - aliases = (char **)_ALIGN(&buffer[resultbuflen + 2]); - aliases_size = - (buffer + bufsize - (char *)aliases) / sizeof(char *); - if (aliases_size < 1) { - *errnop = ERANGE; - rv = NS_RETURN; - break; - } - - /* - * servent_unpack expects lines terminated with \n -- - * make it happy - */ - memcpy(buffer, resultbuf, resultbuflen); - buffer[resultbuflen] = '\n'; - buffer[resultbuflen + 1] = '\0'; - - if (servent_unpack(buffer, serv, aliases, aliases_size, - errnop) != 0) { - if (*errnop == 0) - rv = NS_NOTFOUND; - else - rv = NS_RETURN; - } else - rv = NS_SUCCESS; + rv = parse_result(serv, buffer, bufsize, resultbuf, + resultbuflen, errnop); free(resultbuf); } while (!(rv & NS_TERMINATE) && how == nss_lt_all); From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 04:07: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 4DDA01065670; Sun, 18 Apr 2010 04:07: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 39E868FC1C; Sun, 18 Apr 2010 04:07: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 o3I47X5D065418; Sun, 18 Apr 2010 04:07:33 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I47XDC065411; Sun, 18 Apr 2010 04:07:33 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004180407.o3I47XDC065411@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 18 Apr 2010 04:07: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: r206784 - in stable/8: include lib/libc/net 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: Sun, 18 Apr 2010 04:07:33 -0000 Author: ume Date: Sun Apr 18 04:07:32 2010 New Revision: 206784 URL: http://svn.freebsd.org/changeset/base/206784 Log: MFC r206155, r206267: Add capability to use a db version of services. It is enabled by specifying `db' as source of services in /etc/nsswitch.conf. Modified: stable/8/include/netdb.h stable/8/include/nsswitch.h stable/8/lib/libc/net/getservent.c stable/8/lib/libc/net/nsdispatch.3 stable/8/share/man/man5/nsswitch.conf.5 stable/8/share/man/man5/services.5 Directory Properties: stable/8/include/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/include/netdb.h ============================================================================== --- stable/8/include/netdb.h Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/include/netdb.h Sun Apr 18 04:07:32 2010 (r206784) @@ -86,6 +86,7 @@ typedef __uint32_t uint32_t; #define _PATH_NETWORKS "/etc/networks" #define _PATH_PROTOCOLS "/etc/protocols" #define _PATH_SERVICES "/etc/services" +#define _PATH_SERVICES_DB "/var/db/services.db" #define h_errno (*__h_errno()) Modified: stable/8/include/nsswitch.h ============================================================================== --- stable/8/include/nsswitch.h Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/include/nsswitch.h Sun Apr 18 04:07:32 2010 (r206784) @@ -65,6 +65,7 @@ * currently implemented sources */ #define NSSRC_FILES "files" /* local files */ +#define NSSRC_DB "db" /* database */ #define NSSRC_DNS "dns" /* DNS; IN for hosts, HS for others */ #define NSSRC_NIS "nis" /* YP/NIS */ #define NSSRC_COMPAT "compat" /* passwd,group in YP compat mode */ Modified: stable/8/lib/libc/net/getservent.c ============================================================================== --- stable/8/lib/libc/net/getservent.c Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/lib/libc/net/getservent.c Sun Apr 18 04:07:32 2010 (r206784) @@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -94,6 +96,19 @@ NSS_TLS_HANDLING(files); static int files_servent(void *, void *, va_list); static int files_setservent(void *, void *, va_list); +/* db backend declarations */ +struct db_state +{ + DB *db; + int stayopen; + int keynum; +}; +static void db_endstate(void *); +NSS_TLS_HANDLING(db); + +static int db_servent(void *, void *, va_list); +static int db_setservent(void *, void *, va_list); + #ifdef YP /* nis backend declarations */ static int nis_servent(void *, void *, va_list); @@ -263,6 +278,8 @@ files_servent(void *retval, void *mdata, { NULL, 0 } }; ns_dtab compat_dtab[] = { + { NSSRC_DB, db_servent, + (void *)((struct servent_mdata *)mdata)->how }, #ifdef YP { NSSRC_NIS, nis_servent, (void *)((struct servent_mdata *)mdata)->how }, @@ -452,6 +469,183 @@ files_setservent(void *retval, void *mda return (NS_UNAVAIL); } +/* db backend implementation */ +static void +db_endstate(void *p) +{ + DB *db; + + if (p == NULL) + return; + + db = ((struct db_state *)p)->db; + if (db != NULL) + db->close(db); + + free(p); +} + +static int +db_servent(void *retval, void *mdata, va_list ap) +{ + char buf[BUFSIZ]; + DBT key, data, *result; + DB *db; + + struct db_state *st; + int rv; + int stayopen; + + enum nss_lookup_type how; + char *name; + char *proto; + int port; + + struct servent *serv; + char *buffer; + size_t bufsize; + int *errnop; + + name = NULL; + proto = NULL; + how = (enum nss_lookup_type)mdata; + switch (how) { + case nss_lt_name: + name = va_arg(ap, char *); + proto = va_arg(ap, char *); + break; + case nss_lt_id: + port = va_arg(ap, int); + proto = va_arg(ap, char *); + break; + case nss_lt_all: + break; + default: + return NS_NOTFOUND; + }; + + serv = va_arg(ap, struct servent *); + buffer = va_arg(ap, char *); + bufsize = va_arg(ap, size_t); + errnop = va_arg(ap,int *); + + *errnop = db_getstate(&st); + if (*errnop != 0) + return (NS_UNAVAIL); + + if (how == nss_lt_all && st->keynum < 0) + return (NS_NOTFOUND); + + if (st->db == NULL) { + st->db = dbopen(_PATH_SERVICES_DB, O_RDONLY, 0, DB_HASH, NULL); + if (st->db == NULL) { + *errnop = errno; + return (NS_UNAVAIL); + } + } + + stayopen = (how == nss_lt_all) ? 1 : st->stayopen; + db = st->db; + + do { + switch (how) { + case nss_lt_name: + key.data = buf; + if (proto == NULL) + key.size = snprintf(buf, sizeof(buf), + "\376%s", name); + else + key.size = snprintf(buf, sizeof(buf), + "\376%s/%s", name, proto); + key.size++; + if (db->get(db, &key, &data, 0) != 0 || + db->get(db, &data, &key, 0) != 0) { + rv = NS_NOTFOUND; + goto db_fin; + } + result = &key; + break; + case nss_lt_id: + key.data = buf; + port = htons(port); + if (proto == NULL) + key.size = snprintf(buf, sizeof(buf), + "\377%d", port); + else + key.size = snprintf(buf, sizeof(buf), + "\377%d/%s", port, proto); + key.size++; + if (db->get(db, &key, &data, 0) != 0 || + db->get(db, &data, &key, 0) != 0) { + rv = NS_NOTFOUND; + goto db_fin; + } + result = &key; + break; + case nss_lt_all: + key.data = buf; + key.size = snprintf(buf, sizeof(buf), "%d", + st->keynum++); + key.size++; + if (db->get(db, &key, &data, 0) != 0) { + st->keynum = -1; + rv = NS_NOTFOUND; + goto db_fin; + } + result = &data; + break; + } + + rv = parse_result(serv, buffer, bufsize, result->data, + result->size - 1, errnop); + + } while (!(rv & NS_TERMINATE) && how == nss_lt_all); + +db_fin: + if (!stayopen && st->db != NULL) { + db->close(db); + st->db = NULL; + } + + if (rv == NS_SUCCESS && retval != NULL) + *(struct servent **)retval = serv; + + return (rv); +} + +static int +db_setservent(void *retval, void *mdata, va_list ap) +{ + DB *db; + struct db_state *st; + int rv; + int f; + + rv = db_getstate(&st); + if (rv != 0) + return (NS_UNAVAIL); + + switch ((enum constants)mdata) { + case SETSERVENT: + f = va_arg(ap, int); + st->stayopen |= f; + st->keynum = 0; + break; + case ENDSERVENT: + db = st->db; + if (db != NULL) { + db->close(db); + st->db = NULL; + } + st->stayopen = 0; + break; + default: + break; + }; + + return (NS_UNAVAIL); +} + /* nis backend implementation */ #ifdef YP static void @@ -638,6 +832,7 @@ compat_setservent(void *retval, void *md { NULL, 0 } }; ns_dtab compat_dtab[] = { + { NSSRC_DB, db_setservent, mdata }, #ifdef YP { NSSRC_NIS, nis_setservent, mdata }, #endif @@ -924,6 +1119,7 @@ getservbyname_r(const char *name, const #endif /* NS_CACHING */ static const ns_dtab dtab[] = { { NSSRC_FILES, files_servent, (void *)&mdata }, + { NSSRC_DB, db_servent, (void *)nss_lt_name }, #ifdef YP { NSSRC_NIS, nis_servent, (void *)nss_lt_name }, #endif @@ -960,6 +1156,7 @@ getservbyport_r(int port, const char *pr #endif static const ns_dtab dtab[] = { { NSSRC_FILES, files_servent, (void *)&mdata }, + { NSSRC_DB, db_servent, (void *)nss_lt_id }, #ifdef YP { NSSRC_NIS, nis_servent, (void *)nss_lt_id }, #endif @@ -995,6 +1192,7 @@ getservent_r(struct servent *serv, char #endif static const ns_dtab dtab[] = { { NSSRC_FILES, files_servent, (void *)&mdata }, + { NSSRC_DB, db_servent, (void *)nss_lt_all }, #ifdef YP { NSSRC_NIS, nis_servent, (void *)nss_lt_all }, #endif @@ -1027,6 +1225,7 @@ setservent(int stayopen) #endif static const ns_dtab dtab[] = { { NSSRC_FILES, files_setservent, (void *)SETSERVENT }, + { NSSRC_DB, db_setservent, (void *)SETSERVENT }, #ifdef YP { NSSRC_NIS, nis_setservent, (void *)SETSERVENT }, #endif @@ -1051,6 +1250,7 @@ endservent() #endif static const ns_dtab dtab[] = { { NSSRC_FILES, files_setservent, (void *)ENDSERVENT }, + { NSSRC_DB, db_setservent, (void *)ENDSERVENT }, #ifdef YP { NSSRC_NIS, nis_setservent, (void *)ENDSERVENT }, #endif Modified: stable/8/lib/libc/net/nsdispatch.3 ============================================================================== --- stable/8/lib/libc/net/nsdispatch.3 Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/lib/libc/net/nsdispatch.3 Sun Apr 18 04:07:32 2010 (r206784) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2007 +.Dd April 4, 2010 .Dt NSDISPATCH 3 .Os .Sh NAME @@ -176,6 +176,7 @@ While there is support for arbitrary sou .Bl -column NSSRC_COMPAT compat -offset indent .It Sy "#define value" .It Dv NSSRC_FILES Ta """files"" +.It Dv NSSRC_DB Ta """db"" .It Dv NSSRC_DNS Ta """dns"" .It Dv NSSRC_NIS Ta """nis"" .It Dv NSSRC_COMPAT Ta """compat"" Modified: stable/8/share/man/man5/nsswitch.conf.5 ============================================================================== --- stable/8/share/man/man5/nsswitch.conf.5 Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/share/man/man5/nsswitch.conf.5 Sun Apr 18 04:07:32 2010 (r206784) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd April 4, 2010 .Dt NSSWITCH.CONF 5 .Os .Sh NAME @@ -72,6 +72,8 @@ Local files, such as .Pa /etc/hosts , and .Pa /etc/passwd . +.It db +Local database. .It dns Internet Domain Name System. .Dq hosts Modified: stable/8/share/man/man5/services.5 ============================================================================== --- stable/8/share/man/man5/services.5 Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/share/man/man5/services.5 Sun Apr 18 04:07:32 2010 (r206784) @@ -32,7 +32,7 @@ .\" @(#)services.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd April 4, 2010 .Dt SERVICES 5 .Os .Sh NAME @@ -65,6 +65,18 @@ not interpreted by the routines which se Service names may contain any printable character other than a field delimiter, newline, or comment character. +.Pp +If +.Dq db +is specified as source in the +.Xr nsswitch.conf 5 , +.Pa /var/db/services.db +is searched. +The database in +.Pa /var/db/services.db +needs to be updated with +.Xr services_mkdb 8 +after changes to the services file have been applied. .Sh NIS INTERACTION Access to the NIS .Pa services.byname @@ -84,6 +96,8 @@ file resides in .El .Sh SEE ALSO .Xr getservent 3 +.Xr nsswitch.conf 5 +.Xr services_mkdb 8 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 04:15: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 9C980106564A; Sun, 18 Apr 2010 04:15:21 +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 70C3B8FC1C; Sun, 18 Apr 2010 04:15: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 o3I4FLtx067202; Sun, 18 Apr 2010 04:15:21 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I4FLoY067199; Sun, 18 Apr 2010 04:15:21 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004180415.o3I4FLoY067199@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 18 Apr 2010 04:15:21 +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: r206785 - in stable/8/usr.sbin: . services_mkdb 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, 18 Apr 2010 04:15:21 -0000 Author: ume Date: Sun Apr 18 04:15:21 2010 New Revision: 206785 URL: http://svn.freebsd.org/changeset/base/206785 Log: MFC r206156, r206159, r206163: services_mkdb; generate db file from services(5) to increase speed of getserv*() Added: - copied from r206156, head/usr.sbin/services_mkdb/ Directory Properties: stable/8/usr.sbin/services_mkdb/ (props changed) Modified: stable/8/usr.sbin/Makefile (contents, props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.c Modified: stable/8/usr.sbin/Makefile ============================================================================== --- stable/8/usr.sbin/Makefile Sun Apr 18 04:07:32 2010 (r206784) +++ stable/8/usr.sbin/Makefile Sun Apr 18 04:15:21 2010 (r206785) @@ -168,6 +168,7 @@ SUBDIR= ${_ac} \ ${_sade} \ ${_sendmail} \ service \ + services_mkdb \ setfib \ setfmac \ setpmac \ Modified: stable/8/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Sun Apr 4 08:38:14 2010 (r206156) +++ stable/8/usr.sbin/services_mkdb/services_mkdb.c Sun Apr 18 04:15:21 2010 (r206785) @@ -219,7 +219,7 @@ parseservices(const char *fname, StringL line = 0; if ((svc = calloc(PMASK + 1, sizeof(StringList **))) == NULL) - err(1, "Cannot allocate %zu bytes", PMASK + 1); + err(1, "Cannot allocate %zu bytes", (size_t)(PMASK + 1)); /* XXX: change NULL to "\0\0#" when fparseln fixed */ for (; (p = fparseln(fp, &len, &line, NULL, 0)) != NULL; free(p)) { @@ -271,7 +271,8 @@ parseservices(const char *fname, StringL if (svc[pnum] == NULL) { svc[pnum] = calloc(PROTOMAX, sizeof(StringList *)); if (svc[pnum] == NULL) - err(1, "Cannot allocate %zu bytes", PROTOMAX); + err(1, "Cannot allocate %zu bytes", + (size_t)PROTOMAX); } pindex = getprotoindex(sl, proto); @@ -282,11 +283,11 @@ parseservices(const char *fname, StringL /* build list of aliases */ if (sl_find(s, name) == NULL) { - char *p; + char *p2; - if ((p = strdup(name)) == NULL) + if ((p2 = strdup(name)) == NULL) err(1, "Cannot copy string"); - (void)sl_add(s, p); + (void)sl_add(s, p2); } if (aliases) { @@ -294,11 +295,11 @@ parseservices(const char *fname, StringL if (alias[0] == '\0') continue; if (sl_find(s, alias) == NULL) { - char *p; + char *p2; - if ((p = strdup(alias)) == NULL) + if ((p2 = strdup(alias)) == NULL) err(1, "Cannot copy string"); - (void)sl_add(s, p); + (void)sl_add(s, p2); } } } From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 04:35: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 B749C106564A; Sun, 18 Apr 2010 04:35:16 +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 A572A8FC12; Sun, 18 Apr 2010 04:35: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 o3I4ZG3p071602; Sun, 18 Apr 2010 04:35:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I4ZGWa071600; Sun, 18 Apr 2010 04:35:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004180435.o3I4ZGWa071600@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 18 Apr 2010 04:35:16 +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: r206786 - 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: Sun, 18 Apr 2010 04:35:16 -0000 Author: kib Date: Sun Apr 18 04:35:16 2010 New Revision: 206786 URL: http://svn.freebsd.org/changeset/base/206786 Log: MFC r206671: Fix typo. Modified: stable/8/sys/kern/vfs_cache.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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/vfs_cache.c ============================================================================== --- stable/8/sys/kern/vfs_cache.c Sun Apr 18 04:15:21 2010 (r206785) +++ stable/8/sys/kern/vfs_cache.c Sun Apr 18 04:35:16 2010 (r206786) @@ -610,7 +610,7 @@ cache_enter(dvp, vp, cnp) CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp, - ("cahe_enter: Adding a doomed vnode")); + ("cache_enter: Adding a doomed vnode")); if (!doingcache) return; From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 04:49: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 A3175106564A; Sun, 18 Apr 2010 04:49: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 9186E8FC1E; Sun, 18 Apr 2010 04:49: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 o3I4n7SO074678; Sun, 18 Apr 2010 04:49:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I4n7PX074676; Sun, 18 Apr 2010 04:49:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004180449.o3I4n7PX074676@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 18 Apr 2010 04:49:07 +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: r206787 - 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: Sun, 18 Apr 2010 04:49:07 -0000 Author: kib Date: Sun Apr 18 04:49:07 2010 New Revision: 206787 URL: http://svn.freebsd.org/changeset/base/206787 Log: MFC r206671: Fix typo. Modified: stable/7/sys/kern/vfs_cache.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/vfs_cache.c ============================================================================== --- stable/7/sys/kern/vfs_cache.c Sun Apr 18 04:35:16 2010 (r206786) +++ stable/7/sys/kern/vfs_cache.c Sun Apr 18 04:49:07 2010 (r206787) @@ -513,7 +513,7 @@ cache_enter(dvp, vp, cnp) CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp, - ("cahe_enter: Adding a doomed vnode")); + ("cache_enter: Adding a doomed vnode")); if (!doingcache) return; From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 05:49: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 C54E2106564A; Sun, 18 Apr 2010 05:49:16 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 846EC8FC16; Sun, 18 Apr 2010 05:49:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 5076993736; Sun, 18 Apr 2010 17:49:15 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6tBhq0rPfNQ8; Sun, 18 Apr 2010 17:49:10 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Sun, 18 Apr 2010 17:49:10 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 19A8D11432; Sun, 18 Apr 2010 17:49:10 +1200 (NZST) Date: Sun, 18 Apr 2010 17:49:09 +1200 From: Andrew Thompson To: Doug Barton Message-ID: <20100418054909.GA8617@citylink.fud.org.nz> References: <201004171848.o3HImI3u040381@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004171848.o3HImI3u040381@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206769 - in head: etc/defaults 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: Sun, 18 Apr 2010 05:49:16 -0000 On Sat, Apr 17, 2010 at 06:48:18PM +0000, Doug Barton wrote: > Author: dougb > Date: Sat Apr 17 18:48:18 2010 > New Revision: 206769 > URL: http://svn.freebsd.org/changeset/base/206769 > > Log: > In case a user wants to configure only an IPv6 link-local address > add an example that shows how to do it. > > Modified: > head/etc/defaults/rc.conf > head/share/man/man5/rc.conf.5 > > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Sat Apr 17 18:35:07 2010 (r206768) > +++ head/etc/defaults/rc.conf Sat Apr 17 18:48:18 2010 (r206769) > @@ -211,6 +211,7 @@ ifconfig_lo0="inet 127.0.0.1" # default > #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. > #ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry. > #ifconfig_ed0_ipv6="RTADV" # Sample IPv6 entry for RA/rtsol(8) > +#ifconfig_ed0_ipv6="inet6 auto_linklocal" # To configure only link-local Magic ifconfig parameters in rc.conf are usually in upper case, what makes this one different? Andrew From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 06:16:47 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 7B31D106566C for ; Sun, 18 Apr 2010 06:16:47 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5D78FC12 for ; Sun, 18 Apr 2010 06:16:46 +0000 (UTC) Received: (qmail 27035 invoked by uid 399); 18 Apr 2010 06:16:46 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 18 Apr 2010 06:16:46 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BCAA3CC.3020200@FreeBSD.org> Date: Sat, 17 Apr 2010 23:16:44 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: Andrew Thompson References: <201004171848.o3HImI3u040381@svn.freebsd.org> <20100418054909.GA8617@citylink.fud.org.nz> In-Reply-To: <20100418054909.GA8617@citylink.fud.org.nz> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206769 - in head: etc/defaults 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: Sun, 18 Apr 2010 06:16:47 -0000 On 04/17/10 22:49, Andrew Thompson wrote: > Magic ifconfig parameters in rc.conf are usually in upper case, what > makes this one different? It's not magic. :) That's the actual command line that will be fed to ifconfig. Doug -- ... 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 Sun Apr 18 06:28: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 9762C1065670; Sun, 18 Apr 2010 06:28:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC9B8FC21; Sun, 18 Apr 2010 06:28:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 49C2A93764; Sun, 18 Apr 2010 18:28:49 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T0KIj34Penwm; Sun, 18 Apr 2010 18:28:45 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Sun, 18 Apr 2010 18:28:45 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id EFB6911432; Sun, 18 Apr 2010 18:28:44 +1200 (NZST) Date: Sun, 18 Apr 2010 18:28:44 +1200 From: Andrew Thompson To: Doug Barton Message-ID: <20100418062844.GB8617@citylink.fud.org.nz> References: <201004171848.o3HImI3u040381@svn.freebsd.org> <20100418054909.GA8617@citylink.fud.org.nz> <4BCAA3CC.3020200@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BCAA3CC.3020200@FreeBSD.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206769 - in head: etc/defaults 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: Sun, 18 Apr 2010 06:28:50 -0000 On Sat, Apr 17, 2010 at 11:16:44PM -0700, Doug Barton wrote: > On 04/17/10 22:49, Andrew Thompson wrote: > > Magic ifconfig parameters in rc.conf are usually in upper case, what > > makes this one different? > > It's not magic. :) That's the actual command line that will be fed to > ifconfig. oops, my mistake. From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 10:29: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 5EE3C106564A; Sun, 18 Apr 2010 10:29:27 +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 4D5A38FC14; Sun, 18 Apr 2010 10:29:27 +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 o3IATR0x049930; Sun, 18 Apr 2010 10:29:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IATQiq049925; Sun, 18 Apr 2010 10:29:26 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181029.o3IATQiq049925@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 10:29: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: r206788 - stable/8/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, 18 Apr 2010 10:29:27 -0000 Author: trasz Date: Sun Apr 18 10:29:26 2010 New Revision: 206788 URL: http://svn.freebsd.org/changeset/base/206788 Log: MFC r205846: Fix references. Modified: stable/8/share/man/man9/ieee80211.9 stable/8/share/man/man9/ieee80211_crypto.9 stable/8/share/man/man9/ieee80211_node.9 stable/8/share/man/man9/ieee80211_output.9 stable/8/share/man/man9/ieee80211_scan.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/ieee80211.9 ============================================================================== --- stable/8/share/man/man9/ieee80211.9 Sun Apr 18 04:49:07 2010 (r206787) +++ stable/8/share/man/man9/ieee80211.9 Sun Apr 18 10:29:26 2010 (r206788) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 2009 +.Dd March 29, 2010 .Dt NET80211 9 .Os .Sh NAME @@ -551,11 +551,18 @@ Device supports Reduced Inter Frame Spac .Sh SEE ALSO .Xr ioctl 2 , .Xr ndis 4 , +.Xr ieee80211_amrr 9 , +.Xr ieee80211_beacon 9 , +.Xr ieee80211_bmiss 9 , +.Xr ieee80211_crypto 9 , +.Xr ieee80211_ddb 9 , .Xr ieee80211_input 9 , -.Xr ieee80211_input_all 9 , -.Xr ieee80211_scan_next 9 , -.Xr ieee80211_recv_action 9 , -.Xr ieee80211_send_action 9 , -.Xr ieee80211_radiotap_attach 9 , +.Xr ieee80211_node 9 , +.Xr ieee80211_output 9 , +.Xr ieee80211_proto 9 , +.Xr ieee80211_radiotap 9 , +.Xr ieee80211_regdomain 9 , +.Xr ieee80211_scan 9 , +.Xr ieee80211_vap 9 , .Xr ifnet 9 , .Xr malloc 9 Modified: stable/8/share/man/man9/ieee80211_crypto.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_crypto.9 Sun Apr 18 04:49:07 2010 (r206787) +++ stable/8/share/man/man9/ieee80211_crypto.9 Sun Apr 18 10:29:26 2010 (r206788) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" $Id: ieee80211_crypto.9,v 1.3 2004/03/04 10:42:56 bruce Exp $ .\" -.Dd August 4, 2009 +.Dd March 29, 2010 .Dt IEEE80211_CRYPTO 9 .Os .Sh NAME @@ -253,6 +253,7 @@ and These calls also synchronize hardware key state update when receive traffic is active. .Sh SEE ALSO +.Xr ieee80211 9 , .Xr ioctl 2 , .Xr wlan_ccmp 4 , .Xr wlan_tkip 4 , Modified: stable/8/share/man/man9/ieee80211_node.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_node.9 Sun Apr 18 04:49:07 2010 (r206787) +++ stable/8/share/man/man9/ieee80211_node.9 Sun Apr 18 10:29:26 2010 (r206788) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 2009 +.Dd March 29, 2010 .Dt IEEE80211_NODE 9 .Os .Sh NAME @@ -246,6 +246,6 @@ If the specified index is .Dv IEEE80211_KEYIX_NONE then a normal lookup is done without a table update. .Sh SEE ALSO -.Xr ddb 9 +.Xr ddb 9 , .Xr ieee80211 9 , .Xr ieee80211_proto 9 Modified: stable/8/share/man/man9/ieee80211_output.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_output.9 Sun Apr 18 04:49:07 2010 (r206787) +++ stable/8/share/man/man9/ieee80211_output.9 Sun Apr 18 10:29:26 2010 (r206788) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" $Id: ieee80211_output.9,v 1.5 2004/03/04 12:31:18 bruce Exp $ .\" -.Dd August 4, 2009 +.Dd March 29, 2010 .Dt IEEE80211_OUTPUT 9 .Os .Sh NAME @@ -189,6 +189,6 @@ a device may not report if an ACK frame transmit requests in its hardware and only report status on whether the frame was successfully queued. .Sh SEE ALSO -.Xr bpf 4 +.Xr bpf 4 , .Xr ieee80211 9 , .Xr ifnet 9 Modified: stable/8/share/man/man9/ieee80211_scan.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_scan.9 Sun Apr 18 04:49:07 2010 (r206787) +++ stable/8/share/man/man9/ieee80211_scan.9 Sun Apr 18 10:29:26 2010 (r206788) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2010 +.Dd March 29, 2010 .Dt IEEE80211_SCAN 9 .Os .Sh NAME @@ -346,5 +346,5 @@ applications through the request. .Sh SEE ALSO .Xr ioctl 2 , -.Xr ieee80211 9 . +.Xr ieee80211 9 , .Xr ieee80211_proto 9 From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 10:36: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 484DA106564A; Sun, 18 Apr 2010 10:36:50 +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 36A1C8FC1F; Sun, 18 Apr 2010 10:36: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 o3IAaoxK051627; Sun, 18 Apr 2010 10:36:50 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IAaogr051625; Sun, 18 Apr 2010 10:36:50 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181036.o3IAaogr051625@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 10:36: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: r206789 - 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: Sun, 18 Apr 2010 10:36:50 -0000 Author: trasz Date: Sun Apr 18 10:36:49 2010 New Revision: 206789 URL: http://svn.freebsd.org/changeset/base/206789 Log: MFC r201115: Line discipline support is gone; update tty(4) manual page to reflect this. Reviewed by: ed Modified: stable/8/share/man/man4/tty.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/tty.4 ============================================================================== --- stable/8/share/man/man4/tty.4 Sun Apr 18 10:29:26 2010 (r206788) +++ stable/8/share/man/man4/tty.4 Sun Apr 18 10:36:49 2010 (r206789) @@ -88,47 +88,6 @@ The remainder of this man page is concer with describing details of using and controlling terminal devices at a low level, such as that possibly required by a program wishing to provide features similar to those provided by the system. -.Ss Line disciplines -A terminal file is used like any other file in the system in that -it can be opened, read, and written to using standard system -calls. -For each existing terminal file, there is a software processing module -called a -.Em "line discipline" -is associated with it. -The -.Em "line discipline" -essentially glues the low level device driver code with the high -level generic interface routines (such as -.Xr read 2 -and -.Xr write 2 ) , -and is responsible for implementing the semantics associated -with the device. -When a terminal file is first opened by a program, the default -.Em "line discipline" -called the -.Dv termios -line discipline is associated with the file. -This is the primary -line discipline that is used in most cases and provides the semantics -that users normally associate with a terminal. -When the -.Dv termios -line discipline is in effect, the terminal file behaves and is -operated according to the rules described in -.Xr termios 4 . -Please refer to that man page for a full description of the terminal -semantics. -The operations described here -generally represent features common -across all -.Em "line disciplines" , -however some of these calls may not -make sense in conjunction with a line discipline other than -.Dv termios , -and some may not be supported by the underlying -hardware (or lack thereof, as in the case of ptys). .Ss Terminal File Operations All of the following operations are invoked using the .Xr ioctl 2 @@ -154,39 +113,24 @@ parameter (if any) are listed. For example, the first entry says .Pp -.D1 Em "TIOCSETD int *ldisc" +.D1 Em "TIOCSPGRP int *tpgrp" .Pp and would be called on the terminal associated with file descriptor zero by the following code fragment: .Bd -literal - int ldisc; + int pgrp; - ldisc = TTYDISC; - ioctl(0, TIOCSETD, &ldisc); + pgrp = getpgrp(); + ioctl(0, TIOCSPGRP, &pgrp); .Ed .Ss Terminal File Request Descriptions .Bl -tag -width TIOCGWINSZ .It Dv TIOCSETD Fa int *ldisc -Change to the new line discipline pointed to by +This call is obsolete but left for compatibility. +Before +.Fx 8.0 , +it would change to the new line discipline pointed to by .Fa ldisc . -The available line disciplines are listed in -.In sys/ttycom.h -and currently are: -.Pp -.Bl -tag -width NETGRAPHDISC -compact -.It TTYDISC -Termios interactive line discipline. -.It TABLDISC -Tablet line discipline. -.It SLIPDISC -Serial IP line discipline. -.It PPPDISC -PPP line discipline. -.It NETGRAPHDISC -Netgraph -.Xr ng_tty 4 -line discipline. -.El .Pp .It Dv TIOCGETD Fa int *ldisc Return the current line discipline in the integer pointed to by From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 10:38: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 E8754106564A; Sun, 18 Apr 2010 10:38:17 +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 D77AB8FC08; Sun, 18 Apr 2010 10:38: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 o3IAcHpi051972; Sun, 18 Apr 2010 10:38:17 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IAcH7R051970; Sun, 18 Apr 2010 10:38:17 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181038.o3IAcH7R051970@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 10:38: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: r206790 - 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: Sun, 18 Apr 2010 10:38:18 -0000 Author: trasz Date: Sun Apr 18 10:38:17 2010 New Revision: 206790 URL: http://svn.freebsd.org/changeset/base/206790 Log: MFC r201114: Add references to termios-related stuff. Modified: stable/8/share/man/man4/termios.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/termios.4 ============================================================================== --- stable/8/share/man/man4/termios.4 Sun Apr 18 10:36:49 2010 (r206789) +++ stable/8/share/man/man4/termios.4 Sun Apr 18 10:38:17 2010 (r206790) @@ -1577,3 +1577,10 @@ after is set according to the values in the header .In sys/ttydefaults.h . +.Sh SEE ALSO +.Xr stty 1 , +.Xr tcgetsid 3 , +.Xr tcsendbreak 3 , +.Xr tcsetattr 3 , +.Xr tcsetsid 3 , +.Xr tty 4 From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 10:42: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 7CD4F1065676; Sun, 18 Apr 2010 10:42:42 +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 6BA558FC2F; Sun, 18 Apr 2010 10:42: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 o3IAggXM053012; Sun, 18 Apr 2010 10:42:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IAggK6053009; Sun, 18 Apr 2010 10:42:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181042.o3IAggK6053009@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 10:42:42 +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: r206791 - 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: Sun, 18 Apr 2010 10:42:42 -0000 Author: trasz Date: Sun Apr 18 10:42:42 2010 New Revision: 206791 URL: http://svn.freebsd.org/changeset/base/206791 Log: MFC r201118: Bump manual page dates. Modified: stable/8/share/man/man4/termios.4 stable/8/share/man/man4/tty.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/termios.4 ============================================================================== --- stable/8/share/man/man4/termios.4 Sun Apr 18 10:38:17 2010 (r206790) +++ stable/8/share/man/man4/termios.4 Sun Apr 18 10:42:42 2010 (r206791) @@ -32,7 +32,7 @@ .\" @(#)termios.4 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd December 26, 2009 .Dt TERMIOS 4 .Os .Sh NAME Modified: stable/8/share/man/man4/tty.4 ============================================================================== --- stable/8/share/man/man4/tty.4 Sun Apr 18 10:38:17 2010 (r206790) +++ stable/8/share/man/man4/tty.4 Sun Apr 18 10:42:42 2010 (r206791) @@ -32,7 +32,7 @@ .\" @(#)tty.4 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd Jun 27, 2007 +.Dd December 26, 2009 .Dt TTY 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 12:20: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 7B0221065673; Sun, 18 Apr 2010 12:20:33 +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 69F2C8FC1C; Sun, 18 Apr 2010 12:20: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 o3ICKX3A076490; Sun, 18 Apr 2010 12:20:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ICKX41076488; Sun, 18 Apr 2010 12:20:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004181220.o3ICKX41076488@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 12:20: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: r206792 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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, 18 Apr 2010 12:20:33 -0000 Author: pjd Date: Sun Apr 18 12:20:33 2010 New Revision: 206792 URL: http://svn.freebsd.org/changeset/base/206792 Log: Set ARC_L2_WRITING on L2ARC header creation. Obtained from: OpenSolaris Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 10:42:42 2010 (r206791) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 12:20:33 2010 (r206792) @@ -4562,6 +4562,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de hdrl2->b_dev = dev; hdrl2->b_daddr = dev->l2ad_hand; + ab->b_flags |= ARC_L2_WRITING; ab->b_l2hdr = hdrl2; list_insert_head(dev->l2ad_buflist, ab); buf_data = ab->b_buf->b_data; From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 12:21: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 9AFE4106566C; Sun, 18 Apr 2010 12:21:52 +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 89C628FC24; Sun, 18 Apr 2010 12:21: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 o3ICLq8i076788; Sun, 18 Apr 2010 12:21:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ICLqWP076786; Sun, 18 Apr 2010 12:21:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004181221.o3ICLqWP076786@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 12:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206793 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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, 18 Apr 2010 12:21:52 -0000 Author: pjd Date: Sun Apr 18 12:21:52 2010 New Revision: 206793 URL: http://svn.freebsd.org/changeset/base/206793 Log: Remove racy assertion. Obtained from: OpenSolaris Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 12:20:33 2010 (r206792) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 12:21:52 2010 (r206793) @@ -2731,7 +2731,6 @@ arc_read(zio_t *pio, spa_t *spa, blkptr_ uint32_t *arc_flags, const zbookmark_t *zb) { int err; - arc_buf_hdr_t *hdr = pbuf->b_hdr; ASSERT(!refcount_is_zero(&pbuf->b_hdr->b_refcnt)); ASSERT3U((char *)bp - (char *)pbuf->b_data, <, pbuf->b_hdr->b_size); @@ -2739,8 +2738,6 @@ arc_read(zio_t *pio, spa_t *spa, blkptr_ err = arc_read_nolock(pio, spa, bp, done, private, priority, zio_flags, arc_flags, zb); - - ASSERT3P(hdr, ==, pbuf->b_hdr); rw_exit(&pbuf->b_lock); return (err); } From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 12:25: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 2F6E8106564A; Sun, 18 Apr 2010 12:25:41 +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 1E0248FC0C; Sun, 18 Apr 2010 12:25: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 o3ICPfl0077686; Sun, 18 Apr 2010 12:25:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ICPenT077684; Sun, 18 Apr 2010 12:25:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004181225.o3ICPenT077684@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 12:25: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: r206794 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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, 18 Apr 2010 12:25:41 -0000 Author: pjd Date: Sun Apr 18 12:25:40 2010 New Revision: 206794 URL: http://svn.freebsd.org/changeset/base/206794 Log: Extend locks scope to match OpenSolaris. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 12:21:52 2010 (r206793) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 12:25:40 2010 (r206794) @@ -1106,8 +1106,6 @@ add_reference(arc_buf_hdr_t *ab, kmutex_ mutex_enter(lock); ASSERT(list_link_active(&ab->b_arc_node)); list_remove(list, ab); - mutex_exit(lock); - if (GHOST_STATE(ab->b_state)) { ASSERT3U(ab->b_datacnt, ==, 0); ASSERT3P(ab->b_buf, ==, NULL); @@ -1116,6 +1114,7 @@ add_reference(arc_buf_hdr_t *ab, kmutex_ ASSERT(delta > 0); ASSERT3U(*size, >=, delta); atomic_add_64(size, -delta); + mutex_exit(lock); /* remove the prefetch flag if we get a reference */ if (ab->b_flags & ARC_PREFETCH) ab->b_flags &= ~ARC_PREFETCH; @@ -1138,15 +1137,13 @@ remove_reference(arc_buf_hdr_t *ab, kmut kmutex_t *lock; get_buf_info(ab, state, &list, &lock); - ASSERT(!MUTEX_HELD(lock)); mutex_enter(lock); ASSERT(!list_link_active(&ab->b_arc_node)); list_insert_head(list, ab); - mutex_exit(lock); - ASSERT(ab->b_datacnt > 0); atomic_add_64(size, ab->b_size * ab->b_datacnt); + mutex_exit(lock); } return (cnt); } From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 12:27: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 7C0AB1065670; Sun, 18 Apr 2010 12:27:07 +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 6AD7D8FC1E; Sun, 18 Apr 2010 12:27: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 o3ICR7G6078020; Sun, 18 Apr 2010 12:27:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ICR7nw078018; Sun, 18 Apr 2010 12:27:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004181227.o3ICR7nw078018@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 12:27: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: r206795 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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, 18 Apr 2010 12:27:07 -0000 Author: pjd Date: Sun Apr 18 12:27:07 2010 New Revision: 206795 URL: http://svn.freebsd.org/changeset/base/206795 Log: Add missing list and lock destruction. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 12:25:40 2010 (r206794) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 12:27:07 2010 (r206795) @@ -3850,12 +3850,14 @@ arc_fini(void) list_destroy(&arc_mru_ghost->arcs_lists[i]); list_destroy(&arc_mfu->arcs_lists[i]); list_destroy(&arc_mfu_ghost->arcs_lists[i]); + list_destroy(&arc_l2c_only->arcs_lists[i]); mutex_destroy(&arc_anon->arcs_locks[i].arcs_lock); mutex_destroy(&arc_mru->arcs_locks[i].arcs_lock); mutex_destroy(&arc_mru_ghost->arcs_locks[i].arcs_lock); mutex_destroy(&arc_mfu->arcs_locks[i].arcs_lock); mutex_destroy(&arc_mfu_ghost->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_l2c_only->arcs_locks[i].arcs_lock); } mutex_destroy(&zfs_write_limit_lock); From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 12:36: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 63E601065675; Sun, 18 Apr 2010 12:36:53 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51B628FC27; Sun, 18 Apr 2010 12:36: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 o3ICarQf080175; Sun, 18 Apr 2010 12:36:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ICarvZ080173; Sun, 18 Apr 2010 12:36:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004181236.o3ICarvZ080173@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 12:36: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: r206796 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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, 18 Apr 2010 12:36:53 -0000 Author: pjd Date: Sun Apr 18 12:36:53 2010 New Revision: 206796 URL: http://svn.freebsd.org/changeset/base/206796 Log: Style fixes. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 12:27:07 2010 (r206795) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 12:36:53 2010 (r206796) @@ -131,7 +131,6 @@ #include #include -#include #include static kmutex_t arc_reclaim_thr_lock; @@ -238,7 +237,7 @@ struct arcs_lock { */ #define ARC_BUFC_NUMDATALISTS 16 #define ARC_BUFC_NUMMETADATALISTS 16 -#define ARC_BUFC_NUMLISTS (ARC_BUFC_NUMMETADATALISTS+ARC_BUFC_NUMDATALISTS) +#define ARC_BUFC_NUMLISTS (ARC_BUFC_NUMMETADATALISTS + ARC_BUFC_NUMDATALISTS) typedef struct arc_state { uint64_t arcs_lsize[ARC_BUFC_NUMTYPES]; /* amount of evictable data */ @@ -247,7 +246,7 @@ typedef struct arc_state { struct arcs_lock arcs_locks[ARC_BUFC_NUMLISTS] __aligned(CACHE_LINE_SIZE); } arc_state_t; -#define ARCS_LOCK(s, i) &((s)->arcs_locks[(i)].arcs_lock) +#define ARCS_LOCK(s, i) (&((s)->arcs_locks[(i)].arcs_lock)) /* The 6 states: */ static arc_state_t ARC_anon; @@ -307,9 +306,9 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_hdr_size; kstat_named_t arcstat_memory_throttle_count; kstat_named_t arcstat_l2_write_trylock_fail; - kstat_named_t arcstat_l2_write_in_l2; kstat_named_t arcstat_l2_write_passed_headroom; kstat_named_t arcstat_l2_write_spa_mismatch; + kstat_named_t arcstat_l2_write_in_l2; kstat_named_t arcstat_l2_write_hdr_io_in_progress; kstat_named_t arcstat_l2_write_not_cacheable; kstat_named_t arcstat_l2_write_full; @@ -370,19 +369,19 @@ static arc_stats_t arc_stats = { { "l2_size", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, { "memory_throttle_count", KSTAT_DATA_UINT64 }, - { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, - { "l2_write_in_l2", KSTAT_DATA_UINT64 }, - { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, - { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, - { "l2_write_io_in_progress", KSTAT_DATA_UINT64 }, - { "l2_write_not_cacheable", KSTAT_DATA_UINT64 }, - { "l2_write_full", KSTAT_DATA_UINT64 }, - { "l2_write_buffer_iter", KSTAT_DATA_UINT64 }, - { "l2_write_pios", KSTAT_DATA_UINT64 }, - { "l2_write_bytes_written", KSTAT_DATA_UINT64 }, - { "l2_write_buffer_bytes_scanned", KSTAT_DATA_UINT64 }, - { "l2_write_buffer_list_iter", KSTAT_DATA_UINT64 }, - { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 } + { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, + { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, + { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, + { "l2_write_in_l2", KSTAT_DATA_UINT64 }, + { "l2_write_io_in_progress", KSTAT_DATA_UINT64 }, + { "l2_write_not_cacheable", KSTAT_DATA_UINT64 }, + { "l2_write_full", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_iter", KSTAT_DATA_UINT64 }, + { "l2_write_pios", KSTAT_DATA_UINT64 }, + { "l2_write_bytes_written", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_bytes_scanned", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_list_iter", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 } }; #define ARCSTAT(stat) (arc_stats.stat.value.ui64) @@ -390,7 +389,7 @@ static arc_stats_t arc_stats = { #define ARCSTAT_INCR(stat, val) \ atomic_add_64(&arc_stats.stat.value.ui64, (val)); -#define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) +#define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) #define ARCSTAT_BUMPDOWN(stat) ARCSTAT_INCR(stat, -1) #define ARCSTAT_MAX(stat, val) { \ @@ -424,7 +423,7 @@ static arc_stats_t arc_stats = { } kstat_t *arc_ksp; -static arc_state_t *arc_anon; +static arc_state_t *arc_anon; static arc_state_t *arc_mru; static arc_state_t *arc_mru_ghost; static arc_state_t *arc_mfu; @@ -1076,10 +1075,10 @@ get_buf_info(arc_buf_hdr_t *ab, arc_stat { uint64_t buf_hashid = buf_hash(ab->b_spa, &ab->b_dva, ab->b_birth); - if (ab->b_type == ARC_BUFC_METADATA) - buf_hashid &= (ARC_BUFC_NUMMETADATALISTS-1); + if (ab->b_type == ARC_BUFC_METADATA) + buf_hashid &= (ARC_BUFC_NUMMETADATALISTS - 1); else { - buf_hashid &= (ARC_BUFC_NUMDATALISTS-1); + buf_hashid &= (ARC_BUFC_NUMDATALISTS - 1); buf_hashid += ARC_BUFC_NUMMETADATALISTS; } @@ -1096,10 +1095,10 @@ add_reference(arc_buf_hdr_t *ab, kmutex_ if ((refcount_add(&ab->b_refcnt, tag) == 1) && (ab->b_state != arc_anon)) { - list_t *list; - kmutex_t *lock; uint64_t delta = ab->b_size * ab->b_datacnt; uint64_t *size = &ab->b_state->arcs_lsize[ab->b_type]; + list_t *list; + kmutex_t *lock; get_buf_info(ab, ab->b_state, &list, &lock); ASSERT(!MUTEX_HELD(lock)); @@ -1179,7 +1178,6 @@ arc_change_state(arc_state_t *new_state, get_buf_info(ab, old_state, &list, &lock); use_mutex = !MUTEX_HELD(lock); - if (use_mutex) mutex_enter(lock); @@ -1202,13 +1200,11 @@ arc_change_state(arc_state_t *new_state, mutex_exit(lock); } if (new_state != arc_anon) { - int use_mutex; + int use_mutex; uint64_t *size = &new_state->arcs_lsize[ab->b_type]; get_buf_info(ab, new_state, &list, &lock); use_mutex = !MUTEX_HELD(lock); - - if (use_mutex) mutex_enter(lock); @@ -1626,7 +1622,7 @@ arc_evict(arc_state_t *state, spa_t *spa ASSERT(state == arc_mru || state == arc_mfu); evicted_state = (state == arc_mru) ? arc_mru_ghost : arc_mfu_ghost; - + if (type == ARC_BUFC_METADATA) { offset = 0; list_count = ARC_BUFC_NUMMETADATALISTS; @@ -1635,7 +1631,6 @@ arc_evict(arc_state_t *state, spa_t *spa idx = evict_metadata_offset; } else { offset = ARC_BUFC_NUMMETADATALISTS; - list_start = &state->arcs_lists[offset]; evicted_list_start = &evicted_state->arcs_lists[offset]; list_count = ARC_BUFC_NUMDATALISTS; @@ -1643,12 +1638,12 @@ arc_evict(arc_state_t *state, spa_t *spa } bytes_remaining = evicted_state->arcs_lsize[type]; count = 0; - + evict_start: list = &list_start[idx]; evicted_list = &evicted_list_start[idx]; lock = ARCS_LOCK(state, (offset + idx)); - evicted_lock = ARCS_LOCK(evicted_state, (offset + idx)); + evicted_lock = ARCS_LOCK(evicted_state, (offset + idx)); mutex_enter(lock); mutex_enter(evicted_lock); @@ -1718,7 +1713,7 @@ evict_start: if (bytes_remaining > 0) { mutex_exit(evicted_lock); mutex_exit(lock); - idx = ((idx + 1)&(list_count-1)); + idx = ((idx + 1) & (list_count - 1)); count++; goto evict_start; } @@ -1729,8 +1724,8 @@ evict_start: mutex_exit(evicted_lock); mutex_exit(lock); - - idx = ((idx + 1)&(list_count-1)); + + idx = ((idx + 1) & (list_count - 1)); count++; if (bytes_evicted < bytes) { @@ -1740,11 +1735,11 @@ evict_start: dprintf("only evicted %lld bytes from %x", (longlong_t)bytes_evicted, state); } - if (type == ARC_BUFC_METADATA) + if (type == ARC_BUFC_METADATA) evict_metadata_offset = idx; else evict_data_offset = idx; - + if (skipped) ARCSTAT_INCR(arcstat_evict_skip, skipped); @@ -1801,7 +1796,7 @@ arc_evict_ghost(arc_state_t *state, spa_ list_start = &state->arcs_lists[ARC_BUFC_NUMMETADATALISTS]; list_count = ARC_BUFC_NUMDATALISTS; offset = ARC_BUFC_NUMMETADATALISTS; - + evict_start: list = &list_start[idx]; lock = ARCS_LOCK(state, idx + offset); @@ -1848,12 +1843,12 @@ evict_start: } } mutex_exit(lock); - idx = ((idx + 1)&(ARC_BUFC_NUMDATALISTS-1)); + idx = ((idx + 1) & (ARC_BUFC_NUMDATALISTS - 1)); count++; - + if (count < list_count) goto evict_start; - + evict_offset = idx; if ((uintptr_t)list > (uintptr_t)&state->arcs_lists[ARC_BUFC_NUMMETADATALISTS] && (bytes < 0 || bytes_deleted < bytes)) { @@ -1942,7 +1937,7 @@ arc_do_user_evicts(void) /* * Move list over to avoid LOR */ -restart: +restart: mutex_enter(&arc_eviction_mtx); tmp_arc_eviction_list = arc_eviction_list; arc_eviction_list = NULL; @@ -2053,7 +2048,7 @@ arc_reclaim_needed(void) return (0); /* - * If pages are needed or we're within 2048 pages + * If pages are needed or we're within 2048 pages * of needing to page need to reclaim */ if (vm_pages_needed || (vm_paging_target() > -2048)) @@ -2611,10 +2606,7 @@ arc_read_done(zio_t *zio) hdr->b_flags &= ~ARC_L2_EVICTED; if (l2arc_noprefetch && (hdr->b_flags & ARC_PREFETCH)) hdr->b_flags &= ~ARC_L2CACHE; -#if 0 - else if ((hdr->b_flags & ARC_PREFETCH) == 0) - hdr->b_flags |= ARC_L2CACHE; -#endif + /* byteswap if necessary */ callback_list = hdr->b_acb; ASSERT(callback_list != NULL); @@ -2951,7 +2943,7 @@ top: * released by l2arc_read_done(). */ rzio = zio_read_phys(pio, vd, addr, size, - buf->b_data, ZIO_CHECKSUM_OFF, + buf->b_data, ZIO_CHECKSUM_OFF, l2arc_read_done, cb, priority, zio_flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | @@ -3048,7 +3040,7 @@ arc_buf_evict(arc_buf_t *buf) arc_buf_t **bufp; list_t *list, *evicted_list; kmutex_t *lock, *evicted_lock; - + rw_enter(&buf->b_lock, RW_WRITER); hdr = buf->b_hdr; if (hdr == NULL) { @@ -3723,7 +3715,6 @@ arc_init(void) arc_size = 0; for (i = 0; i < ARC_BUFC_NUMLISTS; i++) { - mutex_init(&arc_anon->arcs_locks[i].arcs_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&arc_mru->arcs_locks[i].arcs_lock, @@ -3736,7 +3727,7 @@ arc_init(void) NULL, MUTEX_DEFAULT, NULL); mutex_init(&arc_l2c_only->arcs_locks[i].arcs_lock, NULL, MUTEX_DEFAULT, NULL); - + list_create(&arc_mru->arcs_lists[i], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); list_create(&arc_mru_ghost->arcs_lists[i], @@ -3786,7 +3777,7 @@ arc_init(void) #ifdef _KERNEL if (TUNABLE_INT_FETCH("vfs.zfs.prefetch_disable", &zfs_prefetch_disable)) prefetch_tunable_set = 1; - + #ifdef __i386__ if (prefetch_tunable_set == 0) { printf("ZFS NOTICE: Prefetch is disabled by default on i386 " @@ -3795,7 +3786,7 @@ arc_init(void) "to /boot/loader.conf.\n"); zfs_prefetch_disable=1; } -#else +#else if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) && prefetch_tunable_set == 0) { printf("ZFS NOTICE: Prefetch is disabled by default if less " @@ -3804,7 +3795,7 @@ arc_init(void) "to /boot/loader.conf.\n"); zfs_prefetch_disable=1; } -#endif +#endif /* Warn about ZFS memory and address space requirements. */ if (((uint64_t)physmem * PAGESIZE) < (256 + 128 + 64) * (1 << 20)) { printf("ZFS WARNING: Recommended minimum RAM size is 512MB; " @@ -3824,7 +3815,7 @@ void arc_fini(void) { int i; - + mutex_enter(&arc_reclaim_thr_lock); arc_thread_exit = 1; cv_signal(&arc_reclaim_thr_cv); @@ -3859,7 +3850,7 @@ arc_fini(void) mutex_destroy(&arc_mfu_ghost->arcs_locks[i].arcs_lock); mutex_destroy(&arc_l2c_only->arcs_locks[i].arcs_lock); } - + mutex_destroy(&zfs_write_limit_lock); buf_fini(); @@ -4255,18 +4246,18 @@ l2arc_list_locked(int list_num, kmutex_t { list_t *list; int idx; - - ASSERT(list_num >= 0 && list_num < 2*ARC_BUFC_NUMLISTS); + + ASSERT(list_num >= 0 && list_num < 2 * ARC_BUFC_NUMLISTS); if (list_num < ARC_BUFC_NUMMETADATALISTS) { idx = list_num; list = &arc_mfu->arcs_lists[idx]; *lock = ARCS_LOCK(arc_mfu, idx); - } else if (list_num < ARC_BUFC_NUMMETADATALISTS*2) { + } else if (list_num < ARC_BUFC_NUMMETADATALISTS * 2) { idx = list_num - ARC_BUFC_NUMMETADATALISTS; list = &arc_mru->arcs_lists[idx]; *lock = ARCS_LOCK(arc_mru, idx); - } else if (list_num < (ARC_BUFC_NUMMETADATALISTS*2 + + } else if (list_num < (ARC_BUFC_NUMMETADATALISTS * 2 + ARC_BUFC_NUMDATALISTS)) { idx = list_num - ARC_BUFC_NUMMETADATALISTS; list = &arc_mfu->arcs_lists[idx]; @@ -4277,8 +4268,6 @@ l2arc_list_locked(int list_num, kmutex_t *lock = ARCS_LOCK(arc_mru, idx); } - CTR3(KTR_SPARE2, "list=%p list_num=%d idx=%d", - list, list_num, idx); ASSERT(!(MUTEX_HELD(*lock))); mutex_enter(*lock); return (list); @@ -4448,7 +4437,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * Copy buffers for L2ARC writing. */ mutex_enter(&l2arc_buflist_mtx); - for (try = 0; try < 2*ARC_BUFC_NUMLISTS; try++) { + for (try = 0; try < 2 * ARC_BUFC_NUMLISTS; try++) { list = l2arc_list_locked(try, &list_lock); passed_sz = 0; ARCSTAT_BUMP(arcstat_l2_write_buffer_list_iter); @@ -4464,9 +4453,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de ab = list_head(list); else ab = list_tail(list); - if (ab == NULL) { + if (ab == NULL) ARCSTAT_BUMP(arcstat_l2_write_buffer_list_null_iter); - } for (; ab; ab = ab_prev) { if (arc_warm == B_FALSE) @@ -4474,7 +4462,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de else ab_prev = list_prev(list, ab); ARCSTAT_INCR(arcstat_l2_write_buffer_bytes_scanned, ab->b_size); - + hash_lock = HDR_LOCK(ab); have_lock = MUTEX_HELD(hash_lock); if (!have_lock && !mutex_tryenter(hash_lock)) { From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 12:43: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 51972106566C; Sun, 18 Apr 2010 12:43:34 +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 390618FC24; Sun, 18 Apr 2010 12:43: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 o3IChY4P081684; Sun, 18 Apr 2010 12:43:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IChYmE081682; Sun, 18 Apr 2010 12:43:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004181243.o3IChYmE081682@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 12:43: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: r206797 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/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, 18 Apr 2010 12:43:34 -0000 Author: pjd Date: Sun Apr 18 12:43:33 2010 New Revision: 206797 URL: http://svn.freebsd.org/changeset/base/206797 Log: Restore previous order. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sun Apr 18 12:36:53 2010 (r206796) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sun Apr 18 12:43:33 2010 (r206797) @@ -55,8 +55,8 @@ struct arc_buf { }; typedef enum arc_buf_contents { - ARC_BUFC_METADATA, /* buffer contains metadata */ ARC_BUFC_DATA, /* buffer contains data */ + ARC_BUFC_METADATA, /* buffer contains metadata */ ARC_BUFC_NUMTYPES } arc_buf_contents_t; /* From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 12:50: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 5264F1065672; Sun, 18 Apr 2010 12:50:27 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40F4C8FC1D; Sun, 18 Apr 2010 12:50:27 +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 o3ICoRni083220; Sun, 18 Apr 2010 12:50:27 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ICoRv6083218; Sun, 18 Apr 2010 12:50:27 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201004181250.o3ICoRv6083218@svn.freebsd.org> From: Peter Holm Date: Sun, 18 Apr 2010 12:50:27 +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: r206798 - 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: Sun, 18 Apr 2010 12:50:27 -0000 Author: pho Date: Sun Apr 18 12:50:26 2010 New Revision: 206798 URL: http://svn.freebsd.org/changeset/base/206798 Log: Fix incorrect assertion. If the caller passed in no lock flags (i.e. just checking the vnode for validity) then there is a window between the VI_UNLOCK() in _vn_lock(9) and the subsequent VI_LOCK() in vget() where another thread could have set VI_DOOMED. Submitted by: Matthew Fleming Reviewed by: kib Modified: stable/7/sys/kern/vfs_subr.c Modified: stable/7/sys/kern/vfs_subr.c ============================================================================== --- stable/7/sys/kern/vfs_subr.c Sun Apr 18 12:43:33 2010 (r206797) +++ stable/7/sys/kern/vfs_subr.c Sun Apr 18 12:50:26 2010 (r206798) @@ -2064,10 +2064,18 @@ vget(struct vnode *vp, int flags, struct return (error); } VI_LOCK(vp); + /* + * Deal with a timing window when the interlock is not held + * and VI_DOOMED can be set, since we only have a holdcnt, + * not a usecount. + */ + if (vp->v_iflag & VI_DOOMED && (flags & LK_RETRY) == 0) { + KASSERT((flags & LK_TYPE_MASK) == 0, ("Unexpected flags %x", flags)); + vdropl(vp); + return (ENOENT); + } /* Upgrade our holdcnt to a usecount. */ v_upgrade_usecount(vp); - if (vp->v_iflag & VI_DOOMED && (flags & LK_RETRY) == 0) - panic("vget: vn_lock failed to return ENOENT\n"); if (oweinact) { if (vp->v_iflag & VI_OWEINACT) vinactive(vp, td); From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 16:36: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 821811065674; Sun, 18 Apr 2010 16:36:38 +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 6F9BE8FC17; Sun, 18 Apr 2010 16:36: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 o3IGacdq033037; Sun, 18 Apr 2010 16:36:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IGac8D033035; Sun, 18 Apr 2010 16:36:38 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181636.o3IGac8D033035@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 16:36: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: r206799 - stable/8/cddl/contrib/opensolaris/lib/libzfs/common 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, 18 Apr 2010 16:36:38 -0000 Author: trasz Date: Sun Apr 18 16:36:38 2010 New Revision: 206799 URL: http://svn.freebsd.org/changeset/base/206799 Log: MFC r197859: 'aclmode' and 'aclinherit' properties should work as advertised; don't refuse to set them. Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 18 12:50:26 2010 (r206798) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 18 16:36:38 2010 (r206799) @@ -1792,8 +1792,6 @@ zfs_prop_set(zfs_handle_t *zhp, const ch switch (prop) { case ZFS_PROP_SHAREISCSI: case ZFS_PROP_DEVICES: - case ZFS_PROP_ACLMODE: - case ZFS_PROP_ACLINHERIT: case ZFS_PROP_ISCSIOPTIONS: (void) snprintf(errbuf, sizeof (errbuf), "property '%s' not supported on FreeBSD", propname); From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 16:37: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 D1807106566B; Sun, 18 Apr 2010 16:37:38 +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 BF36B8FC18; Sun, 18 Apr 2010 16:37: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 o3IGbc1K033313; Sun, 18 Apr 2010 16:37:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IGbc0T033311; Sun, 18 Apr 2010 16:37:38 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181637.o3IGbc0T033311@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 16: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: r206800 - stable/8/cddl/contrib/opensolaris/lib/libzfs/common 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, 18 Apr 2010 16:37:39 -0000 Author: trasz Date: Sun Apr 18 16:37:38 2010 New Revision: 206800 URL: http://svn.freebsd.org/changeset/base/206800 Log: MFC r197867: Properly mark ZFS properties which are not changeable under FreeBSD. Reviewed by: pjd Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 18 16:36:38 2010 (r206799) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 18 16:37:38 2010 (r206800) @@ -1790,9 +1790,14 @@ zfs_prop_set(zfs_handle_t *zhp, const ch /* We don't support those properties on FreeBSD. */ switch (prop) { - case ZFS_PROP_SHAREISCSI: case ZFS_PROP_DEVICES: + case ZFS_PROP_ZONED: + case ZFS_PROP_SHAREISCSI: case ZFS_PROP_ISCSIOPTIONS: + case ZFS_PROP_XATTR: + case ZFS_PROP_VSCAN: + case ZFS_PROP_NBMAND: + case ZFS_PROP_SHARESMB: (void) snprintf(errbuf, sizeof (errbuf), "property '%s' not supported on FreeBSD", propname); ret = zfs_error(hdl, EZFS_PERM, errbuf); From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 17: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 82B861065673; Sun, 18 Apr 2010 17:50:09 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 722388FC1A; Sun, 18 Apr 2010 17: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 o3IHo9DI049306; Sun, 18 Apr 2010 17:50:09 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IHo9hV049304; Sun, 18 Apr 2010 17:50:09 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004181750.o3IHo9hV049304@svn.freebsd.org> From: Alan Cox Date: Sun, 18 Apr 2010 17: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: r206801 - head/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, 18 Apr 2010 17:50:09 -0000 Author: alc Date: Sun Apr 18 17:50:09 2010 New Revision: 206801 URL: http://svn.freebsd.org/changeset/base/206801 Log: There is no justification for vm_object_split() setting PG_REFERENCED on a page that it is going to sleep on. Eliminate it. MFC after: 3 weeks Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Apr 18 16:37:38 2010 (r206800) +++ head/sys/vm/vm_object.c Sun Apr 18 17:50:09 2010 (r206801) @@ -1422,7 +1422,6 @@ retry: * not be changed by this operation. */ if ((m->oflags & VPO_BUSY) || m->busy) { - vm_page_flag_set(m, PG_REFERENCED); vm_page_unlock_queues(); VM_OBJECT_UNLOCK(new_object); m->oflags |= VPO_WANTED; From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 18:04: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 4B2E7106566B; Sun, 18 Apr 2010 18:04:05 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 617CE8FC15; Sun, 18 Apr 2010 18:04:03 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 819E045E8E; Sun, 18 Apr 2010 20:04:01 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id C9F8945C9C; Sun, 18 Apr 2010 20:03:55 +0200 (CEST) Date: Sun, 18 Apr 2010 20:03:57 +0200 From: Pawel Jakub Dawidek To: Kip Macy Message-ID: <20100418180356.GC2005@garage.freebsd.pl> References: <201003162217.o2GMHMjU012285@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ABTtc+pdwF7KHXCz" Content-Disposition: inline In-Reply-To: <201003162217.o2GMHMjU012285@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r205231 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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, 18 Apr 2010 18:04:05 -0000 --ABTtc+pdwF7KHXCz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 16, 2010 at 10:17:22PM +0000, Kip Macy wrote: > Author: kmacy > Date: Tue Mar 16 22:17:21 2010 > New Revision: 205231 > URL: http://svn.freebsd.org/changeset/base/205231 >=20 > Log: > - reduce contention by breaking up ARC state locks in to 16 for data > and 16 for metadata > - export L2ARC tunables as sysctls > - add several kstats to track L2ARC state more precisely > - avoid holding a contended lock when atomically incrementing a > contended counter (no lock protection needed for atomics) [...] > @@ -2505,6 +2731,7 @@ arc_read(zio_t *pio, spa_t *spa, blkptr_ > uint32_t *arc_flags, const zbookmark_t *zb) > { > int err; > + arc_buf_hdr_t *hdr =3D pbuf->b_hdr; > =20 > ASSERT(!refcount_is_zero(&pbuf->b_hdr->b_refcnt)); > ASSERT3U((char *)bp - (char *)pbuf->b_data, <, pbuf->b_hdr->b_size); > @@ -2513,8 +2740,8 @@ arc_read(zio_t *pio, spa_t *spa, blkptr_ > err =3D arc_read_nolock(pio, spa, bp, done, private, priority, > zio_flags, arc_flags, zb); > =20 > + ASSERT3P(hdr, =3D=3D, pbuf->b_hdr); > rw_exit(&pbuf->b_lock); > - > return (err); > } [...] This commit reverted my fix, which I committed in r204804. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --ABTtc+pdwF7KHXCz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkvLSYwACgkQForvXbEpPzTylQCfTvpmDmrl0d++RrH9VTs1YrH5 EckAoPW1L6V7dTQb05N8PGeuWDQSn6+z =ctfk -----END PGP SIGNATURE----- --ABTtc+pdwF7KHXCz-- From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 18:23: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 8002E1065670; Sun, 18 Apr 2010 18:23: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 5440D8FC13; Sun, 18 Apr 2010 18:23: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 o3IINBlJ056642; Sun, 18 Apr 2010 18:23:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IINBKB056640; Sun, 18 Apr 2010 18:23:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004181823.o3IINBKB056640@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 18 Apr 2010 18:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206802 - head/lib/libc/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, 18 Apr 2010 18:23:11 -0000 Author: kib Date: Sun Apr 18 18:23:11 2010 New Revision: 206802 URL: http://svn.freebsd.org/changeset/base/206802 Log: Revert r206649. Simplify the presented declaration of struct sigaction, noting the caveat in the text. Real layout of the structure and exposed implementation namespace only obfuscates the usage. Submitted by: bde MFC after: 3 days Modified: head/lib/libc/sys/sigaction.2 Modified: head/lib/libc/sys/sigaction.2 ============================================================================== --- head/lib/libc/sys/sigaction.2 Sun Apr 18 17:50:09 2010 (r206801) +++ head/lib/libc/sys/sigaction.2 Sun Apr 18 18:23:11 2010 (r206802) @@ -28,7 +28,7 @@ .\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" $FreeBSD$ .\" -.Dd April 13, 2010 +.Dd April 18, 2010 .Dt SIGACTION 2 .Os .Sh NAME @@ -40,16 +40,11 @@ .In signal.h .Bd -literal struct sigaction { - union { - void (*__sa_handler)(int); - void (*__sa_sigaction)(int, siginfo_t *, void *); - } __sigaction_u; /* signal handler */ + void (*sa_handler)(int); + void (*sa_sigaction)(int, siginfo_t *, void *); int sa_flags; /* see signal options below */ sigset_t sa_mask; /* signal mask to apply */ }; - -#define sa_handler __sigaction_u.__sa_handler -#define sa_sigaction __sigaction_u.__sa_sigaction .Ed .Ft int .Fo sigaction @@ -148,6 +143,16 @@ If is non-zero, the previous handling information for the signal is returned to the user. .Pp +The above declaration of +.Vt "struct sigaction" +is not literal. +It is provided only to list the accessible members. +See +.In sys/signal.h +for the actual definition. +In particular, the storage occupied by sa_handler and sa_sigaction overlaps, +and an application can not use both simultaneously. +.Pp Once a signal handler is installed, it normally remains installed until another .Fn sigaction @@ -496,16 +501,6 @@ or .Dv SIG_IGN this way. .Pp -If preprocessing symbol -.Va _POSIX_C_SOURCE -with the value >= 199309 is not defined, the following declaration for -the handler shall be used: -.Bl -tag -offset indent -width short -.It Tn POSIX Dv SA_SIGINFO : -.Ft void -.Fn handler int "struct __sigaction *" "void *" ; -.El -.Pp If the .Dv SA_SIGINFO flag is not set, the handler function should match From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 18:43: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 288DA1065679; Sun, 18 Apr 2010 18:43: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 F2ADC8FC1C; Sun, 18 Apr 2010 18:43: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 o3IIhael061259; Sun, 18 Apr 2010 18:43:36 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IIhaGw061258; Sun, 18 Apr 2010 18:43:36 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004181843.o3IIhaGw061258@svn.freebsd.org> From: Rui Paulo Date: Sun, 18 Apr 2010 18:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206803 - head/sys/mips/rmi/dev/sec 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, 18 Apr 2010 18:43:37 -0000 Author: rpaulo Date: Sun Apr 18 18:43:36 2010 New Revision: 206803 URL: http://svn.freebsd.org/changeset/base/206803 Log: Delete svn:executable prop. Modified: Directory Properties: head/sys/mips/rmi/dev/sec/desc.h (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 19:21: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 CD94A106566B; Sun, 18 Apr 2010 19:21:08 +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 B97B98FC13; Sun, 18 Apr 2010 19:21: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 o3IJL80l070039; Sun, 18 Apr 2010 19:21:08 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IJL8eS070025; Sun, 18 Apr 2010 19:21:08 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181921.o3IJL8eS070025@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 19:21: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: r206804 - in stable/8: sbin/dumpfs sbin/mount sbin/tunefs sys/sys sys/ufs/ffs sys/ufs/ufs 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, 18 Apr 2010 19:21:08 -0000 Author: trasz Date: Sun Apr 18 19:21:08 2010 New Revision: 206804 URL: http://svn.freebsd.org/changeset/base/206804 Log: MFC r200796: Implement NFSv4 ACL support for UFS. Reviewed by: rwatson Modified: stable/8/sbin/dumpfs/dumpfs.c stable/8/sbin/mount/mntopts.h stable/8/sbin/mount/mount.8 stable/8/sbin/mount/mount.c stable/8/sbin/tunefs/tunefs.8 stable/8/sbin/tunefs/tunefs.c stable/8/sys/sys/mount.h stable/8/sys/ufs/ffs/ffs_vfsops.c stable/8/sys/ufs/ffs/fs.h stable/8/sys/ufs/ufs/acl.h stable/8/sys/ufs/ufs/ufs_acl.c stable/8/sys/ufs/ufs/ufs_lookup.c stable/8/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/tunefs/ (props changed) 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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/dumpfs/dumpfs.c Sun Apr 18 19:21:08 2010 (r206804) @@ -251,8 +251,11 @@ dumpfs(const char *name) printf("gjournal "); if (fsflags & FS_FLAGS_UPDATED) printf("fs_flags expanded "); + if (fsflags & FS_NFS4ACLS) + printf("nfsv4acls "); fsflags &= ~(FS_UNCLEAN | FS_DOSOFTDEP | FS_NEEDSFSCK | FS_INDEXDIRS | - FS_ACLS | FS_MULTILABEL | FS_GJOURNAL | FS_FLAGS_UPDATED); + FS_ACLS | FS_MULTILABEL | FS_GJOURNAL | FS_FLAGS_UPDATED | + FS_NFS4ACLS); if (fsflags != 0) printf("unknown flags (%#x)", fsflags); putchar('\n'); Modified: stable/8/sbin/mount/mntopts.h ============================================================================== --- stable/8/sbin/mount/mntopts.h Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/mount/mntopts.h Sun Apr 18 19:21:08 2010 (r206804) @@ -54,6 +54,7 @@ struct mntopt { #define MOPT_SNAPSHOT { "snapshot", 0, MNT_SNAPSHOT, 0 } #define MOPT_MULTILABEL { "multilabel", 0, MNT_MULTILABEL, 0 } #define MOPT_ACLS { "acls", 0, MNT_ACLS, 0 } +#define MOPT_NFS4ACLS { "nfsv4acls", 0, MNT_NFS4ACLS, 0 } /* Control flags. */ #define MOPT_FORCE { "force", 0, MNT_FORCE, 0 } @@ -87,7 +88,8 @@ struct mntopt { MOPT_NOCLUSTERR, \ MOPT_NOCLUSTERW, \ MOPT_MULTILABEL, \ - MOPT_ACLS + MOPT_ACLS, \ + MOPT_NFS4ACLS void getmntopts(const char *, const struct mntopt *, int *, int *); void rmslashes(char *, char *); Modified: stable/8/sbin/mount/mount.8 ============================================================================== --- stable/8/sbin/mount/mount.8 Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/mount/mount.8 Sun Apr 18 19:21:08 2010 (r206804) @@ -120,11 +120,14 @@ takes effect. The following options are available: .Bl -tag -width indent .It Cm acls -Enable Access Control Lists, or ACLS, which can be customized via the +Enable POSIX.1e Access Control Lists, or ACLs, which can be customized via the .Xr setfacl 1 and .Xr getfacl 1 commands. +This flag is mutually exclusive with +.Cm nfsv4acls +flag. .It Cm async All .Tn I/O @@ -186,6 +189,15 @@ See .Xr mac 4 for more information, which cause the multilabel mount flag to be set automatically at mount-time. +.It Cm nfsv4acls +Enable NFSv4 ACLs, which can be customized via the +.Xr setfacl 1 +and +.Xr getfacl 1 +commands. +This flag is mutually exclusive with +.Cm acls +flag. .It Cm noasync Metadata I/O should be done synchronously, while data I/O should be done asynchronously. Modified: stable/8/sbin/mount/mount.c ============================================================================== --- stable/8/sbin/mount/mount.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/mount/mount.c Sun Apr 18 19:21:08 2010 (r206804) @@ -111,6 +111,7 @@ static struct opt { { MNT_SOFTDEP, "soft-updates" }, { MNT_MULTILABEL, "multilabel" }, { MNT_ACLS, "acls" }, + { MNT_NFS4ACLS, "nfsv4acls" }, { MNT_GJOURNAL, "gjournal" }, { 0, NULL } }; @@ -918,6 +919,7 @@ flags2opts(int flags) if (flags & MNT_SUIDDIR) res = catopt(res, "suiddir"); if (flags & MNT_MULTILABEL) res = catopt(res, "multilabel"); if (flags & MNT_ACLS) res = catopt(res, "acls"); + if (flags & MNT_NFS4ACLS) res = catopt(res, "nfsv4acls"); return (res); } Modified: stable/8/sbin/tunefs/tunefs.8 ============================================================================== --- stable/8/sbin/tunefs/tunefs.8 Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/tunefs/tunefs.8 Sun Apr 18 19:21:08 2010 (r206804) @@ -44,6 +44,7 @@ .Op Fl L Ar volname .Op Fl l Cm enable | disable .Op Fl m Ar minfree +.Op Fl N Cm enable | disable .Op Fl n Cm enable | disable .Op Fl o Cm space | time .Op Fl p @@ -70,7 +71,7 @@ this option will cause all backups to be primary super-block. This is potentially dangerous - use with caution. .It Fl a Cm enable | disable -Turn on/off the administrative ACL enable flag. +Turn on/off the administrative POSIX.1e ACL enable flag. .It Fl e Ar maxbpg Indicate the maximum number of blocks any single file can allocate out of a cylinder group before it is forced to begin @@ -114,6 +115,8 @@ factor of three over the performance obt If the value is raised above the current usage level, users will be unable to allocate files until enough files have been deleted to get under the higher threshold. +.It Fl N Cm enable | disable +Turn on/off the administrative NFSv4 ACL enable flag. .It Fl n Cm enable | disable Turn on/off soft updates. .It Fl o Cm space | time Modified: stable/8/sbin/tunefs/tunefs.c ============================================================================== --- stable/8/sbin/tunefs/tunefs.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/tunefs/tunefs.c Sun Apr 18 19:21:08 2010 (r206804) @@ -76,12 +76,12 @@ void printfs(void); int main(int argc, char *argv[]) { - char *avalue, *Jvalue, *Lvalue, *lvalue, *nvalue; + char *avalue, *Jvalue, *Lvalue, *lvalue, *Nvalue, *nvalue; const char *special, *on; const char *name; int active; int Aflag, aflag, eflag, evalue, fflag, fvalue, Jflag, Lflag, lflag; - int mflag, mvalue, nflag, oflag, ovalue, pflag, sflag, svalue; + int mflag, mvalue, Nflag, nflag, oflag, ovalue, pflag, sflag, svalue; int ch, found_arg, i; const char *chg[2]; struct ufs_args args; @@ -90,12 +90,12 @@ main(int argc, char *argv[]) if (argc < 3) usage(); Aflag = aflag = eflag = fflag = Jflag = Lflag = lflag = mflag = 0; - nflag = oflag = pflag = sflag = 0; - avalue = Jvalue = Lvalue = lvalue = nvalue = NULL; + Nflag = nflag = oflag = pflag = sflag = 0; + avalue = Jvalue = Lvalue = lvalue = Nvalue = nvalue = NULL; evalue = fvalue = mvalue = ovalue = svalue = 0; active = 0; found_arg = 0; /* At least one arg is required. */ - while ((ch = getopt(argc, argv, "Aa:e:f:J:L:l:m:n:o:ps:")) != -1) + while ((ch = getopt(argc, argv, "Aa:e:f:J:L:l:m:N:n:o:ps:")) != -1) switch (ch) { case 'A': @@ -105,7 +105,7 @@ main(int argc, char *argv[]) case 'a': found_arg = 1; - name = "ACLs"; + name = "POSIX.1e ACLs"; avalue = optarg; if (strcmp(avalue, "enable") && strcmp(avalue, "disable")) { @@ -187,6 +187,18 @@ main(int argc, char *argv[]) mflag = 1; break; + case 'N': + found_arg = 1; + name = "NFSv4 ACLs"; + Nvalue = optarg; + if (strcmp(Nvalue, "enable") && + strcmp(Nvalue, "disable")) { + errx(10, "bad %s (options are %s)", + name, "`enable' or `disable'"); + } + Nflag = 1; + break; + case 'n': found_arg = 1; name = "soft updates"; @@ -255,10 +267,13 @@ main(int argc, char *argv[]) strlcpy(sblock.fs_volname, Lvalue, MAXVOLLEN); } if (aflag) { - name = "ACLs"; + name = "POSIX.1e ACLs"; if (strcmp(avalue, "enable") == 0) { if (sblock.fs_flags & FS_ACLS) { warnx("%s remains unchanged as enabled", name); + } else if (sblock.fs_flags & FS_NFS4ACLS) { + warnx("%s and NFSv4 ACLs are mutually " + "exclusive", name); } else { sblock.fs_flags |= FS_ACLS; warnx("%s set", name); @@ -349,6 +364,29 @@ main(int argc, char *argv[]) warnx(OPTWARN, "space", "<", MINFREE); } } + if (Nflag) { + name = "NFSv4 ACLs"; + if (strcmp(Nvalue, "enable") == 0) { + if (sblock.fs_flags & FS_NFS4ACLS) { + warnx("%s remains unchanged as enabled", name); + } else if (sblock.fs_flags & FS_ACLS) { + warnx("%s and POSIX.1e ACLs are mutually " + "exclusive", name); + } else { + sblock.fs_flags |= FS_NFS4ACLS; + warnx("%s set", name); + } + } else if (strcmp(Nvalue, "disable") == 0) { + if ((~sblock.fs_flags & FS_NFS4ACLS) == + FS_NFS4ACLS) { + warnx("%s remains unchanged as disabled", + name); + } else { + sblock.fs_flags &= ~FS_NFS4ACLS; + warnx("%s cleared", name); + } + } + } if (nflag) { name = "soft updates"; if (strcmp(nvalue, "enable") == 0) { @@ -423,16 +461,18 @@ usage(void) fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]", " [-J enable | disable ] [-L volname] [-l enable | disable]", -" [-m minfree] [-n enable | disable] [-o space | time] [-p]", -" [-s avgfpdir] special | filesystem"); +" [-m minfree] [-N enable | disable] [-n enable | disable]", +" [-o space | time] [-p] [-s avgfpdir] special | filesystem"); exit(2); } void printfs(void) { - warnx("ACLs: (-a) %s", + warnx("POSIX.1e ACLs: (-a) %s", (sblock.fs_flags & FS_ACLS)? "enabled" : "disabled"); + warnx("NFSv4 ACLs: (-N) %s", + (sblock.fs_flags & FS_NFS4ACLS)? "enabled" : "disabled"); warnx("MAC multilabel: (-l) %s", (sblock.fs_flags & FS_MULTILABEL)? "enabled" : "disabled"); warnx("soft updates: (-n) %s", Modified: stable/8/sys/sys/mount.h ============================================================================== --- stable/8/sys/sys/mount.h Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/sys/mount.h Sun Apr 18 19:21:08 2010 (r206804) @@ -239,6 +239,7 @@ void __mnt_vnode_markerfree(str #define MNT_NOATIME 0x10000000 /* disable update of file access time */ #define MNT_NOCLUSTERR 0x40000000 /* disable cluster read */ #define MNT_NOCLUSTERW 0x80000000 /* disable cluster write */ +#define MNT_NFS4ACLS 0x00000010 /* * NFS export related mount flags. @@ -274,7 +275,7 @@ void __mnt_vnode_markerfree(str MNT_ROOTFS | MNT_NOATIME | MNT_NOCLUSTERR| \ MNT_NOCLUSTERW | MNT_SUIDDIR | MNT_SOFTDEP | \ MNT_IGNORE | MNT_EXPUBLIC | MNT_NOSYMFOLLOW | \ - MNT_GJOURNAL | MNT_MULTILABEL | MNT_ACLS) + MNT_GJOURNAL | MNT_MULTILABEL | MNT_ACLS | MNT_NFS4ACLS) /* Mask of flags that can be updated. */ #define MNT_UPDATEMASK (MNT_NOSUID | MNT_NOEXEC | \ @@ -282,7 +283,7 @@ void __mnt_vnode_markerfree(str MNT_NOATIME | \ MNT_NOSYMFOLLOW | MNT_IGNORE | \ MNT_NOCLUSTERR | MNT_NOCLUSTERW | MNT_SUIDDIR | \ - MNT_ACLS | MNT_USER) + MNT_ACLS | MNT_USER | MNT_NFS4ACLS) /* * External filesystem command modifier flags. @@ -300,10 +301,6 @@ void __mnt_vnode_markerfree(str #define MNT_CMDFLAGS (MNT_UPDATE | MNT_DELEXPORT | MNT_RELOAD | \ MNT_FORCE | MNT_SNAPSHOT | MNT_BYFSID) /* - * Still available. - */ -#define MNT_SPARE_0x00000010 0x00000010 -/* * Internal filesystem control flags stored in mnt_kern_flag. * * MNTK_UNMOUNT locks the mount entry so that name lookup cannot proceed Modified: stable/8/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_vfsops.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ffs/ffs_vfsops.c Sun Apr 18 19:21:08 2010 (r206804) @@ -128,7 +128,7 @@ static struct buf_ops ffs_ops = { static const char *ffs_opts[] = { "acls", "async", "noatime", "noclusterr", "noclusterw", "noexec", "export", "force", "from", "multilabel", "snapshot", "nosuid", "suiddir", "nosymfollow", "sync", - "union", NULL }; + "union", "nfsv4acls", NULL }; static int ffs_mount(struct mount *mp) @@ -177,6 +177,15 @@ ffs_mount(struct mount *mp) vfs_deleteopt(mp->mnt_opt, "snapshot"); } + if (vfs_getopt(mp->mnt_optnew, "nfsv4acls", NULL, NULL) == 0) { + if (mntorflags & MNT_ACLS) { + printf("WARNING: \"acls\" and \"nfsv4acls\" " + "options are mutually exclusive\n"); + return (EINVAL); + } + mntorflags |= MNT_NFS4ACLS; + } + MNT_ILOCK(mp); mp->mnt_flag = (mp->mnt_flag | mntorflags) & ~mntandnotflags; MNT_IUNLOCK(mp); @@ -360,6 +369,13 @@ ffs_mount(struct mount *mp) MNT_IUNLOCK(mp); } + if ((fs->fs_flags & FS_NFS4ACLS) != 0) { + /* XXX: Set too late ? */ + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_NFS4ACLS; + MNT_IUNLOCK(mp); + } + /* * If this is a snapshot request, take the snapshot. */ @@ -833,7 +849,13 @@ ffs_mountfs(devvp, mp, td) if ((fs->fs_flags & FS_ACLS) != 0) { #ifdef UFS_ACL MNT_ILOCK(mp); + + if (mp->mnt_flag & MNT_NFS4ACLS) + printf("WARNING: ACLs flag on fs conflicts with " + "\"nfsv4acls\" mount option; option ignored\n"); + mp->mnt_flag &= ~MNT_NFS4ACLS; mp->mnt_flag |= MNT_ACLS; + MNT_IUNLOCK(mp); #else printf( @@ -841,6 +863,24 @@ ffs_mountfs(devvp, mp, td) mp->mnt_stat.f_mntonname); #endif } + if ((fs->fs_flags & FS_NFS4ACLS) != 0) { +#ifdef UFS_ACL + MNT_ILOCK(mp); + + if (mp->mnt_flag & MNT_ACLS) + printf("WARNING: NFSv4 ACLs flag on fs conflicts with " + "\"acls\" mount option; option ignored\n"); + mp->mnt_flag &= ~MNT_ACLS; + mp->mnt_flag |= MNT_NFS4ACLS; + + MNT_IUNLOCK(mp); +#else + printf( +"WARNING: %s: NFSv4 ACLs flag on fs but no ACLs support\n", + mp->mnt_stat.f_mntonname); +#endif + } + ump->um_mountp = mp; ump->um_dev = dev; ump->um_devvp = devvp; Modified: stable/8/sys/ufs/ffs/fs.h ============================================================================== --- stable/8/sys/ufs/ffs/fs.h Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ffs/fs.h Sun Apr 18 19:21:08 2010 (r206804) @@ -393,22 +393,24 @@ CTASSERT(sizeof(struct fs) == 1376); * flag to indicate that the indicies need to be rebuilt (by fsck) before * they can be used. * - * FS_ACLS indicates that ACLs are administratively enabled for the - * file system, so they should be loaded from extended attributes, + * FS_ACLS indicates that POSIX.1e ACLs are administratively enabled + * for the file system, so they should be loaded from extended attributes, * observed for access control purposes, and be administered by object - * owners. FS_MULTILABEL indicates that the TrustedBSD MAC Framework - * should attempt to back MAC labels into extended attributes on the - * file system rather than maintain a single mount label for all - * objects. - */ -#define FS_UNCLEAN 0x01 /* filesystem not clean at mount */ -#define FS_DOSOFTDEP 0x02 /* filesystem using soft dependencies */ -#define FS_NEEDSFSCK 0x04 /* filesystem needs sync fsck before mount */ -#define FS_INDEXDIRS 0x08 /* kernel supports indexed directories */ -#define FS_ACLS 0x10 /* file system has ACLs enabled */ -#define FS_MULTILABEL 0x20 /* file system is MAC multi-label */ -#define FS_GJOURNAL 0x40 /* gjournaled file system */ -#define FS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */ + * owners. FS_NFS4ACLS indicates that NFSv4 ACLs are administratively + * enabled. This flag is mutually exclusive with FS_ACLS. FS_MULTILABEL + * indicates that the TrustedBSD MAC Framework should attempt to back MAC + * labels into extended attributes on the file system rather than maintain + * a single mount label for all objects. + */ +#define FS_UNCLEAN 0x0001 /* filesystem not clean at mount */ +#define FS_DOSOFTDEP 0x0002 /* filesystem using soft dependencies */ +#define FS_NEEDSFSCK 0x0004 /* filesystem needs sync fsck before mount */ +#define FS_INDEXDIRS 0x0008 /* kernel supports indexed directories */ +#define FS_ACLS 0x0010 /* file system has POSIX.1e ACLs enabled */ +#define FS_MULTILABEL 0x0020 /* file system is MAC multi-label */ +#define FS_GJOURNAL 0x0040 /* gjournaled file system */ +#define FS_FLAGS_UPDATED 0x0080 /* flags have been moved to new location */ +#define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ /* * Macros to access bits in the fs_active array. Modified: stable/8/sys/ufs/ufs/acl.h ============================================================================== --- stable/8/sys/ufs/ufs/acl.h Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ufs/acl.h Sun Apr 18 19:21:08 2010 (r206804) @@ -37,6 +37,8 @@ #ifdef _KERNEL +int ufs_getacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td); +int ufs_setacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td); void ufs_sync_acl_from_inode(struct inode *ip, struct acl *acl); void ufs_sync_inode_from_acl(struct acl *acl, struct inode *ip); Modified: stable/8/sys/ufs/ufs/ufs_acl.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_acl.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ufs/ufs_acl.c Sun Apr 18 19:21:08 2010 (r206804) @@ -141,6 +141,81 @@ ufs_sync_inode_from_acl(struct acl *acl, } /* + * Retrieve NFSv4 ACL, skipping access checks. Must be used in UFS code + * instead of VOP_GETACL() when we don't want to be restricted by the user + * not having ACL_READ_ACL permission, e.g. when calculating inherited ACL + * or in ufs_vnops.c:ufs_accessx(). + */ +int +ufs_getacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td) +{ + int error, len; + struct inode *ip = VTOI(vp); + + len = sizeof(*aclp); + bzero(aclp, len); + + error = vn_extattr_get(vp, IO_NODELOCKED, + NFS4_ACL_EXTATTR_NAMESPACE, NFS4_ACL_EXTATTR_NAME, + &len, (char *) aclp, td); + aclp->acl_maxcnt = ACL_MAX_ENTRIES; + if (error == ENOATTR) { + /* + * Legitimately no ACL set on object, purely + * emulate it through the inode. + */ + acl_nfs4_sync_acl_from_mode(aclp, ip->i_mode, ip->i_uid); + + return (0); + } + + if (error) + return (error); + + if (len != sizeof(*aclp)) { + /* + * A short (or long) read, meaning that for + * some reason the ACL is corrupted. Return + * EPERM since the object DAC protections + * are unsafe. + */ + printf("ufs_getacl_nfs4(): Loaded invalid ACL (" + "%d bytes), inumber %d on %s\n", len, + ip->i_number, ip->i_fs->fs_fsmnt); + + return (EPERM); + } + + error = acl_nfs4_check(aclp, vp->v_type == VDIR); + if (error) { + printf("ufs_getacl_nfs4(): Loaded invalid ACL " + "(failed acl_nfs4_check), inumber %d on %s\n", + ip->i_number, ip->i_fs->fs_fsmnt); + + return (EPERM); + } + + return (0); +} + +static int +ufs_getacl_nfs4(struct vop_getacl_args *ap) +{ + int error; + + if ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 0) + return (EINVAL); + + error = VOP_ACCESSX(ap->a_vp, VREAD_ACL, ap->a_td->td_ucred, ap->a_td); + if (error) + return (error); + + error = ufs_getacl_nfs4_internal(ap->a_vp, ap->a_aclp, ap->a_td); + + return (error); +} + +/* * Read POSIX.1e ACL from an EA. Return error if its not found * or if any other error has occured. */ @@ -209,7 +284,7 @@ ufs_getacl_posix1e(struct vop_getacl_arg * ACLs, remove this check. */ if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); old = malloc(sizeof(*old), M_ACL, M_WAITOK | M_ZERO); @@ -285,10 +360,118 @@ ufs_getacl(ap) } */ *ap; { + if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) + return (EOPNOTSUPP); + + if (ap->a_type == ACL_TYPE_NFS4) + return (ufs_getacl_nfs4(ap)); + return (ufs_getacl_posix1e(ap)); } /* + * Set NFSv4 ACL without doing any access checking. This is required + * e.g. by the UFS code that implements ACL inheritance, or from + * ufs_vnops.c:ufs_chmod(), as some of the checks have to be skipped + * in that case, and others are redundant. + */ +int +ufs_setacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td) +{ + int error; + mode_t mode; + struct inode *ip = VTOI(vp); + + KASSERT(acl_nfs4_check(aclp, vp->v_type == VDIR) == 0, + ("invalid ACL passed to ufs_setacl_nfs4_internal")); + + if (acl_nfs4_is_trivial(aclp, ip->i_uid)) { + error = vn_extattr_rm(vp, IO_NODELOCKED, + NFS4_ACL_EXTATTR_NAMESPACE, NFS4_ACL_EXTATTR_NAME, td); + + /* + * An attempt to remove ACL from a file that didn't have + * any extended entries is not an error. + */ + if (error == ENOATTR) + error = 0; + + } else { + error = vn_extattr_set(vp, IO_NODELOCKED, + NFS4_ACL_EXTATTR_NAMESPACE, NFS4_ACL_EXTATTR_NAME, + sizeof(*aclp), (char *) aclp, td); + } + + /* + * Map lack of attribute definition in UFS_EXTATTR into lack of + * support for ACLs on the filesystem. + */ + if (error == ENOATTR) + return (EOPNOTSUPP); + + if (error) + return (error); + + mode = ip->i_mode; + + acl_nfs4_sync_mode_from_acl(&mode, aclp); + + ip->i_mode &= ACL_PRESERVE_MASK; + ip->i_mode |= mode; + DIP_SET(ip, i_mode, ip->i_mode); + ip->i_flag |= IN_CHANGE; + + VN_KNOTE_UNLOCKED(vp, NOTE_ATTRIB); + + return (0); +} + +static int +ufs_setacl_nfs4(struct vop_setacl_args *ap) +{ + int error; + struct inode *ip = VTOI(ap->a_vp); + + if ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 0) + return (EINVAL); + + if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + return (EROFS); + + if (ap->a_aclp == NULL) + return (EINVAL); + + error = VOP_ACLCHECK(ap->a_vp, ap->a_type, ap->a_aclp, ap->a_cred, + ap->a_td); + if (error) + return (error); + + /* + * Authorize the ACL operation. + */ + if (ip->i_flags & (IMMUTABLE | APPEND)) + return (EPERM); + + /* + * Must hold VWRITE_ACL or have appropriate privilege. + */ + if ((error = VOP_ACCESSX(ap->a_vp, VWRITE_ACL, ap->a_cred, ap->a_td))) + return (error); + + /* + * With NFSv4 ACLs, chmod(2) may need to add additional entries. + * Make sure it has enough room for that - splitting every entry + * into two and appending "canonical six" entries at the end. + */ + if (ap->a_aclp->acl_cnt > (ACL_MAX_ENTRIES - 6) / 2) + return (ENOSPC); + + error = ufs_setacl_nfs4_internal(ap->a_vp, ap->a_aclp, ap->a_td); + + return (0); +} + +/* * Set the ACL on a file. * * As part of the ACL is stored in the inode, and the rest in an EA, @@ -305,7 +488,7 @@ ufs_setacl_posix1e(struct vop_setacl_arg struct oldacl *old; if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); /* * If this is a set operation rather than a delete operation, @@ -425,16 +608,43 @@ ufs_setacl(ap) struct thread *td; } */ *ap; { + if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) + return (EOPNOTSUPP); + + if (ap->a_type == ACL_TYPE_NFS4) + return (ufs_setacl_nfs4(ap)); return (ufs_setacl_posix1e(ap)); } static int +ufs_aclcheck_nfs4(struct vop_aclcheck_args *ap) +{ + int is_directory = 0; + + if ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 0) + return (EINVAL); + + /* + * With NFSv4 ACLs, chmod(2) may need to add additional entries. + * Make sure it has enough room for that - splitting every entry + * into two and appending "canonical six" entries at the end. + */ + if (ap->a_aclp->acl_cnt > (ACL_MAX_ENTRIES - 6) / 2) + return (ENOSPC); + + if (ap->a_vp->v_type == VDIR) + is_directory = 1; + + return (acl_nfs4_check(ap->a_aclp, is_directory)); +} + +static int ufs_aclcheck_posix1e(struct vop_aclcheck_args *ap) { if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); /* * Verify we understand this type of ACL, and that it applies @@ -474,6 +684,12 @@ ufs_aclcheck(ap) } */ *ap; { + if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) + return (EOPNOTSUPP); + + if (ap->a_type == ACL_TYPE_NFS4) + return (ufs_aclcheck_nfs4(ap)); + return (ufs_aclcheck_posix1e(ap)); } Modified: stable/8/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_lookup.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ufs/ufs_lookup.c Sun Apr 18 19:21:08 2010 (r206804) @@ -80,6 +80,61 @@ SYSCTL_INT(_debug, OID_AUTO, dircheck, C static int ufs_lookup_(struct vnode *, struct vnode **, struct componentname *, ino_t *); +static int +ufs_delete_denied(struct vnode *vdp, struct vnode *tdp, struct ucred *cred, + struct thread *td) +{ + int error; + +#ifdef UFS_ACL + /* + * NFSv4 Minor Version 1, draft-ietf-nfsv4-minorversion1-03.txt + * + * 3.16.2.1. ACE4_DELETE vs. ACE4_DELETE_CHILD + */ + + /* + * XXX: Is this check required? + */ + error = VOP_ACCESS(vdp, VEXEC, cred, td); + if (error) + return (error); + + error = VOP_ACCESSX(tdp, VDELETE, cred, td); + if (error == 0) + return (0); + + error = VOP_ACCESSX(vdp, VDELETE_CHILD, cred, td); + if (error == 0) + return (0); + + error = VOP_ACCESSX(vdp, VEXPLICIT_DENY | VDELETE_CHILD, cred, td); + if (error) + return (error); + +#endif /* !UFS_ACL */ + + /* + * Standard Unix access control - delete access requires VWRITE. + */ + error = VOP_ACCESS(vdp, VWRITE, cred, td); + if (error) + return (error); + + /* + * If directory is "sticky", then user must own + * the directory, or the file in it, else she + * may not delete it (unless she's root). This + * implements append-only directories. + */ + if ((VTOI(vdp)->i_mode & ISVTX) && + VOP_ACCESS(vdp, VADMIN, cred, td) && + VOP_ACCESS(tdp, VADMIN, cred, td)) + return (EPERM); + + return (0); +} + /* * Convert a component of a pathname into a pointer to a locked inode. * This is a very central and rather complicated routine. @@ -410,8 +465,13 @@ notfound: /* * Access for write is interpreted as allowing * creation of files in the directory. + * + * XXX: Fix the comment above. */ - error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); + if (flags & WILLBEDIR) + error = VOP_ACCESSX(vdp, VWRITE | VAPPEND, cred, cnp->cn_thread); + else + error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); if (error) return (error); /* @@ -498,12 +558,17 @@ found: if (nameiop == DELETE && (flags & ISLASTCN)) { if (flags & LOCKPARENT) ASSERT_VOP_ELOCKED(vdp, __FUNCTION__); - /* - * Write access to directory required to delete files. - */ - error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); - if (error) + if ((error = VFS_VGET(vdp->v_mount, ino, + LK_EXCLUSIVE, &tdp)) != 0) return (error); + + error = ufs_delete_denied(vdp, tdp, cred, cnp->cn_thread); + if (error) { + vput(tdp); + return (error); + } + + /* * Return pointer to current entry in dp->i_offset, * and distance past previous entry (if there @@ -523,23 +588,10 @@ found: if (dp->i_number == ino) { VREF(vdp); *vpp = vdp; - return (0); - } - if ((error = VFS_VGET(vdp->v_mount, ino, - LK_EXCLUSIVE, &tdp)) != 0) - return (error); - /* - * If directory is "sticky", then user must own - * the directory, or the file in it, else she - * may not delete it (unless she's root). This - * implements append-only directories. - */ - if ((dp->i_mode & ISVTX) && - VOP_ACCESS(vdp, VADMIN, cred, cnp->cn_thread) && - VOP_ACCESS(tdp, VADMIN, cred, cnp->cn_thread)) { vput(tdp); - return (EPERM); + return (0); } + *vpp = tdp; return (0); } @@ -551,7 +603,11 @@ found: * regular file, or empty directory. */ if (nameiop == RENAME && (flags & ISLASTCN)) { - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread))) + if (flags & WILLBEDIR) + error = VOP_ACCESSX(vdp, VWRITE | VAPPEND, cred, cnp->cn_thread); + else + error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); + if (error) return (error); /* * Careful about locking second inode. @@ -563,6 +619,33 @@ found: if ((error = VFS_VGET(vdp->v_mount, ino, LK_EXCLUSIVE, &tdp)) != 0) return (error); + + error = ufs_delete_denied(vdp, tdp, cred, cnp->cn_thread); + if (error) { + vput(tdp); + return (error); + } + +#ifdef SunOS_doesnt_do_that + /* + * The only purpose of this check is to return the correct + * error. Assume that we want to rename directory "a" + * to a file "b", and that we have no ACL_WRITE_DATA on + * a containing directory, but we _do_ have ACL_APPEND_DATA. + * In that case, the VOP_ACCESS check above will return 0, + * and the operation will fail with ENOTDIR instead + * of EACCESS. + */ + if (tdp->v_type == VDIR) + error = VOP_ACCESSX(vdp, VWRITE | VAPPEND, cred, cnp->cn_thread); + else + error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); + if (error) { + vput(tdp); + return (error); + } +#endif + *vpp = tdp; cnp->cn_flags |= SAVENAME; return (0); Modified: stable/8/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_vnops.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ufs/ufs_vnops.c Sun Apr 18 19:21:08 2010 (r206804) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); #include -static vop_access_t ufs_access; +static vop_accessx_t ufs_accessx; static int ufs_chmod(struct vnode *, int, struct ucred *, struct thread *); static int ufs_chown(struct vnode *, uid_t, gid_t, struct ucred *, struct thread *); static vop_close_t ufs_close; @@ -298,8 +298,8 @@ ufs_close(ap) } static int -ufs_access(ap) - struct vop_access_args /* { +ufs_accessx(ap) + struct vop_accessx_args /* { struct vnode *a_vp; accmode_t a_accmode; struct ucred *a_cred; @@ -315,6 +315,7 @@ ufs_access(ap) #endif #ifdef UFS_ACL struct acl *acl; + acl_type_t type; #endif /* @@ -322,7 +323,7 @@ ufs_access(ap) * unless the file is a socket, fifo, or a block or * character device resident on the filesystem. */ - if (accmode & VWRITE) { + if (accmode & VMODIFY_PERMS) { switch (vp->v_type) { case VDIR: case VLNK: @@ -367,41 +368,63 @@ relock: } } - /* If immutable bit set, nobody gets to write it. */ - if ((accmode & VWRITE) && (ip->i_flags & (IMMUTABLE | SF_SNAPSHOT))) + /* + * If immutable bit set, nobody gets to write it. "& ~VADMIN_PERMS" + * is here, because without it, * it would be impossible for the owner + * to remove the IMMUTABLE flag. + */ + if ((accmode & (VMODIFY_PERMS & ~VADMIN_PERMS)) && + (ip->i_flags & (IMMUTABLE | SF_SNAPSHOT))) return (EPERM); #ifdef UFS_ACL - if ((vp->v_mount->mnt_flag & MNT_ACLS) != 0) { + if ((vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) != 0) { + if (vp->v_mount->mnt_flag & MNT_NFS4ACLS) + type = ACL_TYPE_NFS4; + else + type = ACL_TYPE_ACCESS; + acl = acl_alloc(M_WAITOK); - error = VOP_GETACL(vp, ACL_TYPE_ACCESS, acl, ap->a_cred, - ap->a_td); + if (type == ACL_TYPE_NFS4) + error = ufs_getacl_nfs4_internal(vp, acl, ap->a_td); + else + error = VOP_GETACL(vp, type, acl, ap->a_cred, ap->a_td); switch (error) { - case EOPNOTSUPP: - error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, - ip->i_gid, ap->a_accmode, ap->a_cred, NULL); - break; case 0: - error = vaccess_acl_posix1e(vp->v_type, ip->i_uid, - ip->i_gid, acl, ap->a_accmode, ap->a_cred, NULL); + if (type == ACL_TYPE_NFS4) { + error = vaccess_acl_nfs4(vp->v_type, ip->i_uid, + ip->i_gid, acl, accmode, ap->a_cred, NULL); + } else { + error = vfs_unixify_accmode(&accmode); + if (error == 0) + error = vaccess_acl_posix1e(vp->v_type, ip->i_uid, + ip->i_gid, acl, accmode, ap->a_cred, NULL); + } break; default: - printf( -"ufs_access(): Error retrieving ACL on object (%d).\n", - error); + if (error != EOPNOTSUPP) + printf( +"ufs_accessx(): Error retrieving ACL on object (%d).\n", + error); /* * XXX: Fall back until debugged. Should * eventually possibly log an error, and return * EPERM for safety. */ - error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, - ip->i_gid, ap->a_accmode, ap->a_cred, NULL); + error = vfs_unixify_accmode(&accmode); + if (error == 0) + error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, + ip->i_gid, accmode, ap->a_cred, NULL); } acl_free(acl); - } else + + return (error); + } #endif /* !UFS_ACL */ + error = vfs_unixify_accmode(&accmode); + if (error == 0) error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid, - ap->a_accmode, ap->a_cred, NULL); + accmode, ap->a_cred, NULL); return (error); } @@ -608,11 +631,20 @@ ufs_setattr(ap) * check succeeds. */ if (vap->va_vaflags & VA_UTIMES_NULL) { - error = VOP_ACCESS(vp, VADMIN, cred, td); + /* + * NFSv4.1, draft 21, 6.2.1.3.1, Discussion of Mask Attributes + * + * "A user having ACL_WRITE_DATA or ACL_WRITE_ATTRIBUTES + * will be allowed to set the times [..] to the current *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 19:40: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 42B4E1065670; Sun, 18 Apr 2010 19:40:53 +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 3088A8FC1B; Sun, 18 Apr 2010 19:40: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 o3IJerBV074406; Sun, 18 Apr 2010 19:40:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IJerJi074405; Sun, 18 Apr 2010 19:40:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181940.o3IJerJi074405@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 19:40:53 +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: r206805 - stable/8/tools/regression/acltools 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, 18 Apr 2010 19:40:53 -0000 Author: trasz Date: Sun Apr 18 19:40:52 2010 New Revision: 206805 URL: http://svn.freebsd.org/changeset/base/206805 Log: MFC r200811: Add regression test for NFSv4 ACLs on UFS. Added: stable/8/tools/regression/acltools/02.t - copied unchanged from r200811, head/tools/regression/acltools/02.t Modified: Directory Properties: stable/8/tools/regression/acltools/ (props changed) Copied: stable/8/tools/regression/acltools/02.t (from r200811, head/tools/regression/acltools/02.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/acltools/02.t Sun Apr 18 19:40:52 2010 (r206805, copy of r200811, head/tools/regression/acltools/02.t) @@ -0,0 +1,86 @@ +#!/bin/sh +# +# Copyright (c) 2008, 2009 Edward Tomasz Napierała +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 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$ +# + +# This is a wrapper script to run tools-nfs4.test. +# +# If any of the tests fails, here is how to debug it: go to +# the directory with problematic filesystem mounted on it, +# and do /path/to/test run /path/to/test tools-nfs4.test, e.g. +# +# /usr/src/tools/regression/acltools/run /usr/src/tools/regression/acltools/tools-nfs4.test +# +# Output should be obvious. + +echo "1..4" + +if [ `whoami` != "root" ]; then + echo "not ok 1 - you need to be root to run this test." + exit 1 +fi + +TESTDIR=`dirname $0` + +# Set up the test filesystem. +MD=`mdconfig -at swap -s 10m` +MNT=`mktemp -dt acltools` +newfs /dev/$MD > /dev/null +mount -o nfsv4acls /dev/$MD $MNT +if [ $? -ne 0 ]; then + echo "not ok 1 - mount failed." + exit 1 +fi + +echo "ok 1" + +cd $MNT + +# First, check whether we can crash the kernel by creating too many +# entries. For some reason this won't work in the test file. +touch xxx +setfacl -x5 xxx +while :; do setfacl -a0 u:42:rwx:allow xxx 2> /dev/null; if [ $? -ne 0 ]; then break; fi; done +chmod 600 xxx +rm xxx +echo "ok 2" + +perl $TESTDIR/run $TESTDIR/tools-nfs4.test > /dev/null + +if [ $? -eq 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +cd / +umount -f $MNT +rmdir $MNT +mdconfig -du $MD + +echo "ok 4" + From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 19:44: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 C12341065670; Sun, 18 Apr 2010 19:44:54 +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 AFD8B8FC23; Sun, 18 Apr 2010 19:44: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 o3IJis0c075355; Sun, 18 Apr 2010 19:44:54 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IJisc6075353; Sun, 18 Apr 2010 19:44:54 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181944.o3IJisc6075353@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 19:44: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: r206806 - stable/8/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: Sun, 18 Apr 2010 19:44:54 -0000 Author: trasz Date: Sun Apr 18 19:44:54 2010 New Revision: 206806 URL: http://svn.freebsd.org/changeset/base/206806 Log: MFC r200829: Cosmetic fixes. Modified: stable/8/sys/sys/acl.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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/acl.h ============================================================================== --- stable/8/sys/sys/acl.h Sun Apr 18 19:40:52 2010 (r206805) +++ stable/8/sys/sys/acl.h Sun Apr 18 19:44:54 2010 (r206806) @@ -99,13 +99,13 @@ struct oldacl { * Current "struct acl". */ struct acl_entry { - acl_tag_t ae_tag; - uid_t ae_id; - acl_perm_t ae_perm; - /* "allow" or "deny". Unused in POSIX ACLs. */ + acl_tag_t ae_tag; + uid_t ae_id; + acl_perm_t ae_perm; + /* NFSv4 entry type, "allow" or "deny". Unused in POSIX.1e ACLs. */ acl_entry_type_t ae_entry_type; - /* Flags control inheritance. Unused in POSIX ACLs. */ - acl_flag_t ae_flags; + /* NFSv4 ACL inheritance. Unused in POSIX.1e ACLs. */ + acl_flag_t ae_flags; }; typedef struct acl_entry *acl_entry_t; From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 19:51:47 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 4E83D106566B; Sun, 18 Apr 2010 19:51:47 +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 3D0188FC28; Sun, 18 Apr 2010 19:51:47 +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 o3IJpl8e076922; Sun, 18 Apr 2010 19:51:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IJplQn076920; Sun, 18 Apr 2010 19:51:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181951.o3IJplQn076920@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 19:51: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: r206807 - 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: Sun, 18 Apr 2010 19:51:47 -0000 Author: trasz Date: Sun Apr 18 19:51:46 2010 New Revision: 206807 URL: http://svn.freebsd.org/changeset/base/206807 Log: MFC r206160 by jh@: Add missing MNT_NFS4ACLS. Modified: stable/8/sys/kern/vfs_subr.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/dev/uath/ (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 Apr 18 19:44:54 2010 (r206806) +++ stable/8/sys/kern/vfs_subr.c Sun Apr 18 19:51:46 2010 (r206807) @@ -2799,6 +2799,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_NOATIME); MNT_FLAG(MNT_NOCLUSTERR); MNT_FLAG(MNT_NOCLUSTERW); + MNT_FLAG(MNT_NFS4ACLS); MNT_FLAG(MNT_EXRDONLY); MNT_FLAG(MNT_EXPORTED); MNT_FLAG(MNT_DEFEXPORTED); From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 20:23: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 CEEF4106566B; Sun, 18 Apr 2010 20:23:08 +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 BD0A38FC0C; Sun, 18 Apr 2010 20:23: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 o3IKN8vt083892; Sun, 18 Apr 2010 20:23:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IKN8gx083889; Sun, 18 Apr 2010 20:23:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182023.o3IKN8gx083889@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 20:23: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: r206808 - in stable/8/sbin/ggate: ggated shared 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, 18 Apr 2010 20:23:08 -0000 Author: pjd Date: Sun Apr 18 20:23:08 2010 New Revision: 206808 URL: http://svn.freebsd.org/changeset/base/206808 Log: MFC r204075: Style nits. Modified: stable/8/sbin/ggate/ggated/ggated.c stable/8/sbin/ggate/shared/ggate.c Directory Properties: stable/8/sbin/ggate/ (props changed) Modified: stable/8/sbin/ggate/ggated/ggated.c ============================================================================== --- stable/8/sbin/ggate/ggated/ggated.c Sun Apr 18 19:51:46 2010 (r206807) +++ stable/8/sbin/ggate/ggated/ggated.c Sun Apr 18 20:23:08 2010 (r206808) @@ -10,7 +10,7 @@ * 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 AUTHORS 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 Modified: stable/8/sbin/ggate/shared/ggate.c ============================================================================== --- stable/8/sbin/ggate/shared/ggate.c Sun Apr 18 19:51:46 2010 (r206807) +++ stable/8/sbin/ggate/shared/ggate.c Sun Apr 18 20:23:08 2010 (r206808) @@ -10,7 +10,7 @@ * 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 AUTHORS 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 @@ -159,7 +159,7 @@ g_gate_sectorsize(int fd) g_gate_xlog("fstat(): %s.", strerror(errno)); if (S_ISCHR(sb.st_mode)) { if (ioctl(fd, DIOCGSECTORSIZE, &secsize) == -1) { - g_gate_xlog("Can't get sector size: %s.", + g_gate_xlog("Can't get sector size: %s.", strerror(errno)); } } else if (S_ISREG(sb.st_mode)) { @@ -174,7 +174,7 @@ void g_gate_open_device(void) { - g_gate_devfd = open("/dev/" G_GATE_CTL_NAME, O_RDWR, 0); + g_gate_devfd = open("/dev/" G_GATE_CTL_NAME, O_RDWR); if (g_gate_devfd == -1) err(EXIT_FAILURE, "open(/dev/%s)", G_GATE_CTL_NAME); } @@ -281,7 +281,7 @@ g_gate_socket_settings(int sfd) /* Socket settings. */ on = 1; if (nagle) { - if (setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &on, + if (setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) == -1) { g_gate_xlog("setsockopt() error: %s.", strerror(errno)); } From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 20:34:47 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 38E60106566B; Sun, 18 Apr 2010 20:34:47 +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 265DA8FC1C; Sun, 18 Apr 2010 20:34:47 +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 o3IKYltU086532; Sun, 18 Apr 2010 20:34:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IKYlA6086530; Sun, 18 Apr 2010 20:34:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004182034.o3IKYlA6086530@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 20:34: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: r206809 - stable/8/sys/ufs/ufs 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, 18 Apr 2010 20:34:47 -0000 Author: trasz Date: Sun Apr 18 20:34:46 2010 New Revision: 206809 URL: http://svn.freebsd.org/changeset/base/206809 Log: MFC r202934: Move out code that does POSIX.1e ACL inheritance into separate routines. Reviewed by: rwatson Modified: stable/8/sys/ufs/ufs/ufs_vnops.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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_vnops.c Sun Apr 18 20:23:08 2010 (r206808) +++ stable/8/sys/ufs/ufs/ufs_vnops.c Sun Apr 18 20:34:46 2010 (r206809) @@ -1471,6 +1471,163 @@ out: #ifdef UFS_ACL static int +ufs_do_posix1e_acl_inheritance_dir(struct vnode *dvp, struct vnode *tvp, + mode_t dmode, struct ucred *cred, struct thread *td) +{ + int error; + struct inode *ip = VTOI(tvp); + struct acl *dacl, *acl; + + acl = acl_alloc(M_WAITOK); + dacl = acl_alloc(M_WAITOK); + + /* + * Retrieve default ACL from parent, if any. + */ + error = VOP_GETACL(dvp, ACL_TYPE_DEFAULT, acl, cred, td); + switch (error) { + case 0: + /* + * Retrieved a default ACL, so merge mode and ACL if + * necessary. If the ACL is empty, fall through to + * the "not defined or available" case. + */ + if (acl->acl_cnt != 0) { + dmode = acl_posix1e_newfilemode(dmode, acl); + ip->i_mode = dmode; + DIP_SET(ip, i_mode, dmode); + *dacl = *acl; + ufs_sync_acl_from_inode(ip, acl); + break; + } + /* FALLTHROUGH */ + + case EOPNOTSUPP: + /* + * Just use the mode as-is. + */ + ip->i_mode = dmode; + DIP_SET(ip, i_mode, dmode); + error = 0; + goto out; + + default: + goto out; + } + + /* + * XXX: If we abort now, will Soft Updates notify the extattr + * code that the EAs for the file need to be released? + */ + error = VOP_SETACL(tvp, ACL_TYPE_ACCESS, acl, cred, td); + if (error == 0) + error = VOP_SETACL(tvp, ACL_TYPE_DEFAULT, dacl, cred, td); + switch (error) { + case 0: + break; + + case EOPNOTSUPP: + /* + * XXX: This should not happen, as EOPNOTSUPP above + * was supposed to free acl. + */ + printf("ufs_mkdir: VOP_GETACL() but no VOP_SETACL()\n"); + /* + panic("ufs_mkdir: VOP_GETACL() but no VOP_SETACL()"); + */ + break; + + default: + goto out; + } + +out: + acl_free(acl); + acl_free(dacl); + + return (error); +} + +static int +ufs_do_posix1e_acl_inheritance_file(struct vnode *dvp, struct vnode *tvp, + mode_t mode, struct ucred *cred, struct thread *td) +{ + int error; + struct inode *ip = VTOI(tvp); + struct acl *acl; + + acl = acl_alloc(M_WAITOK); + + /* + * Retrieve default ACL for parent, if any. + */ + error = VOP_GETACL(dvp, ACL_TYPE_DEFAULT, acl, cred, td); + switch (error) { + case 0: + /* + * Retrieved a default ACL, so merge mode and ACL if + * necessary. + */ + if (acl->acl_cnt != 0) { + /* + * Two possible ways for default ACL to not + * be present. First, the EA can be + * undefined, or second, the default ACL can + * be blank. If it's blank, fall through to + * the it's not defined case. + */ + mode = acl_posix1e_newfilemode(mode, acl); + ip->i_mode = mode; + DIP_SET(ip, i_mode, mode); + ufs_sync_acl_from_inode(ip, acl); + break; + } + /* FALLTHROUGH */ + + case EOPNOTSUPP: + /* + * Just use the mode as-is. + */ + ip->i_mode = mode; + DIP_SET(ip, i_mode, mode); + error = 0; + goto out; + + default: + goto out; + } + + /* + * XXX: If we abort now, will Soft Updates notify the extattr + * code that the EAs for the file need to be released? + */ + error = VOP_SETACL(tvp, ACL_TYPE_ACCESS, acl, cred, td); + switch (error) { + case 0: + break; + + case EOPNOTSUPP: + /* + * XXX: This should not happen, as EOPNOTSUPP above was + * supposed to free acl. + */ + printf("ufs_makeinode: VOP_GETACL() but no " + "VOP_SETACL()\n"); + /* panic("ufs_makeinode: VOP_GETACL() but no " + "VOP_SETACL()"); */ + break; + + default: + goto out; + } + +out: + acl_free(acl); + + return (error); +} + +static int ufs_do_nfs4_acl_inheritance(struct vnode *dvp, struct vnode *tvp, mode_t child_mode, struct ucred *cred, struct thread *td) { @@ -1516,9 +1673,6 @@ ufs_mkdir(ap) struct buf *bp; struct dirtemplate dirtemplate, *dtp; struct direct newdir; -#ifdef UFS_ACL - struct acl *acl, *dacl; -#endif int error, dmode; long blkoff; @@ -1607,59 +1761,8 @@ ufs_mkdir(ap) #endif #endif /* !SUIDDIR */ ip->i_flag |= IN_ACCESS | IN_CHANGE | IN_UPDATE; -#ifdef UFS_ACL - acl = dacl = NULL; - if ((dvp->v_mount->mnt_flag & MNT_ACLS) != 0) { - acl = acl_alloc(M_WAITOK); - dacl = acl_alloc(M_WAITOK); - - /* - * Retrieve default ACL from parent, if any. - */ - error = VOP_GETACL(dvp, ACL_TYPE_DEFAULT, acl, cnp->cn_cred, - cnp->cn_thread); - switch (error) { - case 0: - /* - * Retrieved a default ACL, so merge mode and ACL if - * necessary. If the ACL is empty, fall through to - * the "not defined or available" case. - */ - if (acl->acl_cnt != 0) { - dmode = acl_posix1e_newfilemode(dmode, acl); - ip->i_mode = dmode; - DIP_SET(ip, i_mode, dmode); - *dacl = *acl; - ufs_sync_acl_from_inode(ip, acl); - break; - } - /* FALLTHROUGH */ - - case EOPNOTSUPP: - /* - * Just use the mode as-is. - */ - ip->i_mode = dmode; - DIP_SET(ip, i_mode, dmode); - acl_free(acl); - acl_free(dacl); - dacl = acl = NULL; - break; - - default: - UFS_VFREE(tvp, ip->i_number, dmode); - vput(tvp); - acl_free(acl); - acl_free(dacl); - return (error); - } - } else { -#endif /* !UFS_ACL */ - ip->i_mode = dmode; - DIP_SET(ip, i_mode, dmode); -#ifdef UFS_ACL - } -#endif + ip->i_mode = dmode; + DIP_SET(ip, i_mode, dmode); tvp->v_type = VDIR; /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 2; ip->i_nlink = 2; @@ -1694,43 +1797,12 @@ ufs_mkdir(ap) } #endif #ifdef UFS_ACL - if (acl != NULL) { - /* - * XXX: If we abort now, will Soft Updates notify the extattr - * code that the EAs for the file need to be released? - */ - error = VOP_SETACL(tvp, ACL_TYPE_ACCESS, acl, cnp->cn_cred, - cnp->cn_thread); - if (error == 0) - error = VOP_SETACL(tvp, ACL_TYPE_DEFAULT, dacl, - cnp->cn_cred, cnp->cn_thread); - switch (error) { - case 0: - break; - - case EOPNOTSUPP: - /* - * XXX: This should not happen, as EOPNOTSUPP above - * was supposed to free acl. - */ - printf("ufs_mkdir: VOP_GETACL() but no VOP_SETACL()\n"); - /* - panic("ufs_mkdir: VOP_GETACL() but no VOP_SETACL()"); - */ - break; - - default: - acl_free(acl); - acl_free(dacl); - dacl = acl = NULL; + if (dvp->v_mount->mnt_flag & MNT_ACLS) { + error = ufs_do_posix1e_acl_inheritance_dir(dvp, tvp, dmode, + cnp->cn_cred, cnp->cn_thread); + if (error) goto bad; - } - acl_free(acl); - acl_free(dacl); - dacl = acl = NULL; - } - - if (dvp->v_mount->mnt_flag & MNT_NFS4ACLS) { + } else if (dvp->v_mount->mnt_flag & MNT_NFS4ACLS) { error = ufs_do_nfs4_acl_inheritance(dvp, tvp, dmode, cnp->cn_cred, cnp->cn_thread); if (error) @@ -1797,12 +1869,6 @@ bad: if (error == 0) { *ap->a_vpp = tvp; } else { -#ifdef UFS_ACL - if (acl != NULL) - acl_free(acl); - if (dacl != NULL) - acl_free(dacl); -#endif dp->i_effnlink--; dp->i_nlink--; DIP_SET(dp, i_nlink, dp->i_nlink); @@ -2387,9 +2453,6 @@ ufs_makeinode(mode, dvp, vpp, cnp) struct inode *ip, *pdir; struct direct newdir; struct vnode *tvp; -#ifdef UFS_ACL - struct acl *acl; -#endif int error; pdir = VTOI(dvp); @@ -2469,62 +2532,8 @@ ufs_makeinode(mode, dvp, vpp, cnp) #endif #endif /* !SUIDDIR */ ip->i_flag |= IN_ACCESS | IN_CHANGE | IN_UPDATE; -#ifdef UFS_ACL - acl = NULL; - if ((dvp->v_mount->mnt_flag & MNT_ACLS) != 0) { - acl = acl_alloc(M_WAITOK); - - /* - * Retrieve default ACL for parent, if any. - */ - error = VOP_GETACL(dvp, ACL_TYPE_DEFAULT, acl, cnp->cn_cred, - cnp->cn_thread); - switch (error) { - case 0: - /* - * Retrieved a default ACL, so merge mode and ACL if - * necessary. - */ - if (acl->acl_cnt != 0) { - /* - * Two possible ways for default ACL to not - * be present. First, the EA can be - * undefined, or second, the default ACL can - * be blank. If it's blank, fall through to - * the it's not defined case. - */ - mode = acl_posix1e_newfilemode(mode, acl); - ip->i_mode = mode; - DIP_SET(ip, i_mode, mode); - ufs_sync_acl_from_inode(ip, acl); - break; - } - /* FALLTHROUGH */ - - case EOPNOTSUPP: - /* - * Just use the mode as-is. - */ - ip->i_mode = mode; - DIP_SET(ip, i_mode, mode); - acl_free(acl); - acl = NULL; - break; - - default: - UFS_VFREE(tvp, ip->i_number, mode); - vput(tvp); - acl_free(acl); - acl = NULL; - return (error); - } - } else { -#endif - ip->i_mode = mode; - DIP_SET(ip, i_mode, mode); -#ifdef UFS_ACL - } -#endif + ip->i_mode = mode; + DIP_SET(ip, i_mode, mode); tvp->v_type = IFTOVT(mode); /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 1; ip->i_nlink = 1; @@ -2557,36 +2566,12 @@ ufs_makeinode(mode, dvp, vpp, cnp) } #endif #ifdef UFS_ACL - if (acl != NULL) { - /* - * XXX: If we abort now, will Soft Updates notify the extattr - * code that the EAs for the file need to be released? - */ - error = VOP_SETACL(tvp, ACL_TYPE_ACCESS, acl, cnp->cn_cred, - cnp->cn_thread); - switch (error) { - case 0: - break; - - case EOPNOTSUPP: - /* - * XXX: This should not happen, as EOPNOTSUPP above was - * supposed to free acl. - */ - printf("ufs_makeinode: VOP_GETACL() but no " - "VOP_SETACL()\n"); - /* panic("ufs_makeinode: VOP_GETACL() but no " - "VOP_SETACL()"); */ - break; - - default: - acl_free(acl); + if (dvp->v_mount->mnt_flag & MNT_ACLS) { + error = ufs_do_posix1e_acl_inheritance_file(dvp, tvp, mode, + cnp->cn_cred, cnp->cn_thread); + if (error) goto bad; - } - acl_free(acl); - } - - if (dvp->v_mount->mnt_flag & MNT_NFS4ACLS) { + } else if (dvp->v_mount->mnt_flag & MNT_NFS4ACLS) { error = ufs_do_nfs4_acl_inheritance(dvp, tvp, mode, cnp->cn_cred, cnp->cn_thread); if (error) From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 21:14: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 1E0C4106566B; Sun, 18 Apr 2010 21:14:50 +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 08D2A8FC1A; Sun, 18 Apr 2010 21:14: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 o3ILEoJb095444; Sun, 18 Apr 2010 21:14:50 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILEnUo095433; Sun, 18 Apr 2010 21:14:49 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182114.o3ILEnUo095433@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 21:14:49 +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: r206810 - in stable/8: etc/defaults etc/rc.d sbin sbin/ggate/ggatec sbin/ggate/ggatel sbin/hastctl sbin/hastd share/examples share/examples/hast share/man/man5 sys/geom/gate 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, 18 Apr 2010 21:14:50 -0000 Author: pjd Date: Sun Apr 18 21:14:49 2010 New Revision: 206810 URL: http://svn.freebsd.org/changeset/base/206810 Log: MFC r204076,r204077,r204083,r205279: r204076: Please welcome HAST - Highly Avalable Storage. HAST allows to transparently store data on two physically separated machines connected over the TCP/IP network. HAST works in Primary-Secondary (Master-Backup, Master-Slave) configuration, which means that only one of the cluster nodes can be active at any given time. Only Primary node is able to handle I/O requests to HAST-managed devices. Currently HAST is limited to two cluster nodes in total. HAST operates on block level - it provides disk-like devices in /dev/hast/ directory for use by file systems and/or applications. Working on block level makes it transparent for file systems and applications. There in no difference between using HAST-provided device and raw disk, partition, etc. All of them are just regular GEOM providers in FreeBSD. For more information please consult hastd(8), hastctl(8) and hast.conf(5) manual pages, as well as http://wiki.FreeBSD.org/HAST. Sponsored by: FreeBSD Foundation Sponsored by: OMCnet Internet Service GmbH Sponsored by: TransIP BV r204077: Remove some lines left over by accident. r204083: Add missing KEYWORD line. Pointed out by: dougb r205279 sys: Simplify loops. Added: stable/8/etc/rc.d/hastd - copied, changed from r204076, head/etc/rc.d/hastd stable/8/sbin/hastctl/ - copied from r204076, head/sbin/hastctl/ stable/8/sbin/hastd/ - copied from r204076, head/sbin/hastd/ stable/8/share/examples/hast/ - copied from r204076, head/share/examples/hast/ Modified: stable/8/etc/defaults/rc.conf stable/8/etc/rc.d/Makefile stable/8/sbin/Makefile stable/8/sbin/ggate/ggatec/ggatec.c stable/8/sbin/ggate/ggatel/ggatel.c stable/8/share/examples/Makefile stable/8/share/man/man5/rc.conf.5 stable/8/sys/geom/gate/g_gate.c stable/8/sys/geom/gate/g_gate.h Directory Properties: stable/8/etc/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/man/man5/ (props changed) 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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/etc/defaults/rc.conf ============================================================================== --- stable/8/etc/defaults/rc.conf Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/etc/defaults/rc.conf Sun Apr 18 21:14:49 2010 (r206810) @@ -258,6 +258,9 @@ syslogd_flags="-s" # Flags to syslogd ( inetd_enable="NO" # Run the network daemon dispatcher (YES/NO). inetd_program="/usr/sbin/inetd" # path to inetd, if you want a different one. inetd_flags="-wW -C 60" # Optional flags to inetd +hastd_enable="NO" # Run the HAST daemon (YES/NO). +hastd_program="/sbin/hastd" # path to hastd, if you want a different one. +hastd_flags="" # Optional flags to hastd. # # named. It may be possible to run named in a sandbox, man security for # details. Modified: stable/8/etc/rc.d/Makefile ============================================================================== --- stable/8/etc/rc.d/Makefile Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/etc/rc.d/Makefile Sun Apr 18 21:14:49 2010 (r206810) @@ -12,7 +12,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI encswap \ fsck ftp-proxy ftpd \ gbde geli geli2 gssd \ - hcsecd \ + hastd hcsecd \ hostapd hostid hostid_save hostname \ inetd initrandom \ ip6addrctl ipfilter ipfs ipfw ipmon \ Copied and modified: stable/8/etc/rc.d/hastd (from r204076, head/etc/rc.d/hastd) ============================================================================== --- head/etc/rc.d/hastd Thu Feb 18 23:16:19 2010 (r204076, copy source) +++ stable/8/etc/rc.d/hastd Sun Apr 18 21:14:49 2010 (r206810) @@ -6,6 +6,7 @@ # PROVIDE: hastd # REQUIRE: NETWORKING syslogd # BEFORE: DAEMON +# KEYWORD: nojail shutdown . /etc/rc.subr @@ -18,10 +19,6 @@ required_files="/etc/hast.conf" stop_precmd="hastd_stop_precmd" required_modules="geom_gate:g_gate" -sockfile="/var/run/syslogd.sockets" -evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" -altlog_proglist="named" - hastd_stop_precmd() { ${hastctl} role init all Modified: stable/8/sbin/Makefile ============================================================================== --- stable/8/sbin/Makefile Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/sbin/Makefile Sun Apr 18 21:14:49 2010 (r206810) @@ -36,6 +36,8 @@ SUBDIR= adjkerntz \ ggate \ growfs \ gvinum \ + hastctl \ + hastd \ ifconfig \ init \ ${_ipf} \ Modified: stable/8/sbin/ggate/ggatec/ggatec.c ============================================================================== --- stable/8/sbin/ggate/ggatec/ggatec.c Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/sbin/ggate/ggatec/ggatec.c Sun Apr 18 21:14:49 2010 (r206810) @@ -59,7 +59,7 @@ enum { UNSET, CREATE, DESTROY, LIST, RES static const char *path = NULL; static const char *host = NULL; -static int unit = -1; +static int unit = G_GATE_UNIT_AUTO; static unsigned flags = 0; static int force = 0; static unsigned queue_size = G_GATE_QUEUE_SIZE; Modified: stable/8/sbin/ggate/ggatel/ggatel.c ============================================================================== --- stable/8/sbin/ggate/ggatel/ggatel.c Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/sbin/ggate/ggatel/ggatel.c Sun Apr 18 21:14:49 2010 (r206810) @@ -50,7 +50,7 @@ enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; static const char *path = NULL; -static int unit = -1; +static int unit = G_GATE_UNIT_AUTO; static unsigned flags = 0; static int force = 0; static unsigned queue_size = G_GATE_QUEUE_SIZE; Modified: stable/8/share/examples/Makefile ============================================================================== --- stable/8/share/examples/Makefile Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/share/examples/Makefile Sun Apr 18 21:14:49 2010 (r206810) @@ -13,6 +13,7 @@ LDIRS= BSD_daemon \ drivers \ etc \ find_interface \ + hast \ ibcs2 \ ipfw \ kld \ @@ -69,6 +70,11 @@ XFILES= BSD_daemon/FreeBSD.pfa \ find_interface/Makefile \ find_interface/README \ find_interface/find_interface.c \ + hast/ucarp.sh \ + hast/ucarp_down.sh \ + hast/ucarp_up.sh \ + hast/vip-down.sh \ + hast/vip-up.sh \ ibcs2/README \ ibcs2/hello.uu \ ipfw/change_rules.sh \ Modified: stable/8/share/man/man5/rc.conf.5 ============================================================================== --- stable/8/share/man/man5/rc.conf.5 Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/share/man/man5/rc.conf.5 Sun Apr 18 21:14:49 2010 (r206810) @@ -1645,6 +1645,27 @@ is set to .Dq Li YES , these are the flags to pass to .Xr inetd 8 . +.It Va hastd_enable +.Pq Vt bool +If set to +.Dq Li YES , +run the +.Xr hastd 8 +daemon. +.It Va hastd_program +.Pq Vt str +Path to +.Xr hastd 8 +(default +.Pa /sbin/hastd ) . +.It Va hastd_flags +.Pq Vt str +If +.Va hastd_enable +is set to +.Dq Li YES , +these are the flags to pass to +.Xr hastd 8 . .It Va named_enable .Pq Vt bool If set to Modified: stable/8/sys/geom/gate/g_gate.c ============================================================================== --- stable/8/sys/geom/gate/g_gate.c Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/sys/geom/gate/g_gate.c Sun Apr 18 21:14:49 2010 (r206810) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2004-2006 Pawel Jakub Dawidek + * Copyright (c) 2009-2010 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Pawel Jakub Dawidek + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -53,9 +57,14 @@ static MALLOC_DEFINE(M_GATE, "gg_data", SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, gate, CTLFLAG_RW, 0, "GEOM_GATE stuff"); -static u_int g_gate_debug = 0; -SYSCTL_UINT(_kern_geom_gate, OID_AUTO, debug, CTLFLAG_RW, &g_gate_debug, 0, +static int g_gate_debug = 0; +TUNABLE_INT("kern.geom.gate.debug", &g_gate_debug); +SYSCTL_INT(_kern_geom_gate, OID_AUTO, debug, CTLFLAG_RW, &g_gate_debug, 0, "Debug level"); +static u_int g_gate_maxunits = 256; +TUNABLE_INT("kern.geom.gate.maxunits", &g_gate_maxunits); +SYSCTL_UINT(_kern_geom_gate, OID_AUTO, maxunits, CTLFLAG_RDTUN, + &g_gate_maxunits, 0, "Maximum number of ggate devices"); struct g_class g_gate_class = { .name = G_GATE_CLASS_NAME, @@ -71,10 +80,9 @@ static struct cdevsw g_gate_cdevsw = { }; -static LIST_HEAD(, g_gate_softc) g_gate_list = - LIST_HEAD_INITIALIZER(g_gate_list); -static struct mtx g_gate_list_mtx; - +static struct g_gate_softc **g_gate_units; +static u_int g_gate_nunits; +static struct mtx g_gate_units_lock; static int g_gate_destroy(struct g_gate_softc *sc, boolean_t force) @@ -84,13 +92,13 @@ g_gate_destroy(struct g_gate_softc *sc, struct bio *bp; g_topology_assert(); - mtx_assert(&g_gate_list_mtx, MA_OWNED); + mtx_assert(&g_gate_units_lock, MA_OWNED); pp = sc->sc_provider; if (!force && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) { - mtx_unlock(&g_gate_list_mtx); + mtx_unlock(&g_gate_units_lock); return (EBUSY); } - mtx_unlock(&g_gate_list_mtx); + mtx_unlock(&g_gate_units_lock); mtx_lock(&sc->sc_queue_mtx); if ((sc->sc_flags & G_GATE_FLAG_DESTROY) == 0) sc->sc_flags |= G_GATE_FLAG_DESTROY; @@ -101,38 +109,29 @@ g_gate_destroy(struct g_gate_softc *sc, g_orphan_provider(pp, ENXIO); callout_drain(&sc->sc_callout); mtx_lock(&sc->sc_queue_mtx); - for (;;) { - bp = bioq_first(&sc->sc_inqueue); - if (bp != NULL) { - bioq_remove(&sc->sc_inqueue, bp); - sc->sc_queue_count--; - G_GATE_LOGREQ(1, bp, "Request canceled."); - g_io_deliver(bp, ENXIO); - } else { - break; - } + while ((bp = bioq_first(&sc->sc_inqueue)) != NULL) { + bioq_remove(&sc->sc_inqueue, bp); + sc->sc_queue_count--; + G_GATE_LOGREQ(1, bp, "Request canceled."); + g_io_deliver(bp, ENXIO); } - for (;;) { - bp = bioq_first(&sc->sc_outqueue); - if (bp != NULL) { - bioq_remove(&sc->sc_outqueue, bp); - sc->sc_queue_count--; - G_GATE_LOGREQ(1, bp, "Request canceled."); - g_io_deliver(bp, ENXIO); - } else { - break; - } + while ((bp = bioq_first(&sc->sc_outqueue)) != NULL) { + bioq_remove(&sc->sc_outqueue, bp); + sc->sc_queue_count--; + G_GATE_LOGREQ(1, bp, "Request canceled."); + g_io_deliver(bp, ENXIO); } mtx_unlock(&sc->sc_queue_mtx); g_topology_unlock(); - mtx_lock(&g_gate_list_mtx); + mtx_lock(&g_gate_units_lock); /* One reference is ours. */ sc->sc_ref--; - while (sc->sc_ref > 0) { - msleep(&sc->sc_ref, &g_gate_list_mtx, 0, "gg:destroy", 0); - } - LIST_REMOVE(sc, sc_next); - mtx_unlock(&g_gate_list_mtx); + while (sc->sc_ref > 0) + msleep(&sc->sc_ref, &g_gate_units_lock, 0, "gg:destroy", 0); + g_gate_units[sc->sc_unit] = NULL; + KASSERT(g_gate_nunits > 0, ("negative g_gate_nunits?")); + g_gate_nunits--; + mtx_unlock(&g_gate_units_lock); mtx_destroy(&sc->sc_queue_mtx); g_topology_lock(); G_GATE_DEBUG(0, "Device %s destroyed.", gp->name); @@ -196,7 +195,7 @@ g_gate_start(struct bio *bp) if (sc->sc_queue_count > sc->sc_queue_size) { mtx_unlock(&sc->sc_queue_mtx); G_GATE_LOGREQ(1, bp, "Queue full, request canceled."); - g_io_deliver(bp, EIO); + g_io_deliver(bp, ENOMEM); return; } @@ -211,18 +210,29 @@ g_gate_start(struct bio *bp) } static struct g_gate_softc * -g_gate_hold(u_int unit) +g_gate_hold(u_int unit, const char *name) { - struct g_gate_softc *sc; + struct g_gate_softc *sc = NULL; - mtx_lock(&g_gate_list_mtx); - LIST_FOREACH(sc, &g_gate_list, sc_next) { - if (sc->sc_unit == unit) + mtx_lock(&g_gate_units_lock); + if (unit >= 0 && unit < g_gate_maxunits) + sc = g_gate_units[unit]; + else if (unit == G_GATE_NAME_GIVEN) { + KASSERT(name != NULL, ("name is NULL")); + for (unit = 0; unit < g_gate_maxunits; unit++) { + if (g_gate_units[unit] == NULL) + continue; + if (strcmp(name, + g_gate_units[unit]->sc_provider->name) != 0) { + continue; + } + sc = g_gate_units[unit]; break; + } } if (sc != NULL) sc->sc_ref++; - mtx_unlock(&g_gate_list_mtx); + mtx_unlock(&g_gate_units_lock); return (sc); } @@ -231,40 +241,34 @@ g_gate_release(struct g_gate_softc *sc) { g_topology_assert_not(); - mtx_lock(&g_gate_list_mtx); + mtx_lock(&g_gate_units_lock); sc->sc_ref--; KASSERT(sc->sc_ref >= 0, ("Negative sc_ref for %s.", sc->sc_name)); - if (sc->sc_ref == 0 && (sc->sc_flags & G_GATE_FLAG_DESTROY) != 0) { + if (sc->sc_ref == 0 && (sc->sc_flags & G_GATE_FLAG_DESTROY) != 0) wakeup(&sc->sc_ref); - mtx_unlock(&g_gate_list_mtx); - } else { - mtx_unlock(&g_gate_list_mtx); - } + mtx_unlock(&g_gate_units_lock); } static int -g_gate_getunit(int unit) +g_gate_getunit(int unit, int *errorp) { - struct g_gate_softc *sc; - mtx_assert(&g_gate_list_mtx, MA_OWNED); + mtx_assert(&g_gate_units_lock, MA_OWNED); if (unit >= 0) { - LIST_FOREACH(sc, &g_gate_list, sc_next) { - if (sc->sc_unit == unit) - return (-1); - } + if (unit >= g_gate_maxunits) + *errorp = EINVAL; + else if (g_gate_units[unit] == NULL) + return (unit); + else + *errorp = EEXIST; } else { - unit = 0; -once_again: - LIST_FOREACH(sc, &g_gate_list, sc_next) { - if (sc->sc_unit == unit) { - if (++unit > 666) - return (-1); - goto once_again; - } + for (unit = 0; unit < g_gate_maxunits; unit++) { + if (g_gate_units[unit] == NULL) + return (unit); } + *errorp = ENFILE; } - return (unit); + return (-1); } static void @@ -276,7 +280,7 @@ g_gate_guard(void *arg) sc = arg; binuptime(&curtime); - g_gate_hold(sc->sc_unit); + g_gate_hold(sc->sc_unit, NULL); mtx_lock(&sc->sc_queue_mtx); TAILQ_FOREACH_SAFE(bp, &sc->sc_inqueue.queue, bio_queue, bp2) { if (curtime.sec - bp->bio_t0.sec < 5) @@ -311,7 +315,7 @@ g_gate_dumpconf(struct sbuf *sb, const c sc = gp->softc; if (sc == NULL || pp != NULL || cp != NULL) return; - g_gate_hold(sc->sc_unit); + g_gate_hold(sc->sc_unit, NULL); if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) { sbuf_printf(sb, "%s%s\n", indent, "read-only"); } else if ((sc->sc_flags & G_GATE_FLAG_WRITEONLY) != 0) { @@ -328,6 +332,7 @@ g_gate_dumpconf(struct sbuf *sb, const c sbuf_printf(sb, "%s%u\n", indent, sc->sc_queue_size); sbuf_printf(sb, "%s%u\n", indent, sc->sc_ref); + sbuf_printf(sb, "%s%d\n", indent, sc->sc_unit); g_topology_unlock(); g_gate_release(sc); g_topology_lock(); @@ -339,6 +344,8 @@ g_gate_create(struct g_gate_ctl_create * struct g_gate_softc *sc; struct g_geom *gp; struct g_provider *pp; + char name[NAME_MAX]; + int error = 0, unit; if (ggio->gctl_mediasize == 0) { G_GATE_DEBUG(1, "Invalid media size."); @@ -357,15 +364,22 @@ g_gate_create(struct g_gate_ctl_create * G_GATE_DEBUG(1, "Invalid flags."); return (EINVAL); } - if (ggio->gctl_unit < -1) { + if (ggio->gctl_unit != G_GATE_UNIT_AUTO && + ggio->gctl_unit != G_GATE_NAME_GIVEN && + ggio->gctl_unit < 0) { G_GATE_DEBUG(1, "Invalid unit number."); return (EINVAL); } + if (ggio->gctl_unit == G_GATE_NAME_GIVEN && + ggio->gctl_name[0] == '\0') { + G_GATE_DEBUG(1, "No device name."); + return (EINVAL); + } sc = malloc(sizeof(*sc), M_GATE, M_WAITOK | M_ZERO); sc->sc_flags = (ggio->gctl_flags & G_GATE_USERFLAGS); strlcpy(sc->sc_info, ggio->gctl_info, sizeof(sc->sc_info)); - sc->sc_seq = 0; + sc->sc_seq = 1; bioq_init(&sc->sc_inqueue); bioq_init(&sc->sc_outqueue); mtx_init(&sc->sc_queue_mtx, "gg:queue", NULL, MTX_DEF); @@ -375,26 +389,44 @@ g_gate_create(struct g_gate_ctl_create * sc->sc_queue_size = G_GATE_MAX_QUEUE_SIZE; sc->sc_timeout = ggio->gctl_timeout; callout_init(&sc->sc_callout, CALLOUT_MPSAFE); - mtx_lock(&g_gate_list_mtx); - ggio->gctl_unit = g_gate_getunit(ggio->gctl_unit); - if (ggio->gctl_unit == -1) { - mtx_unlock(&g_gate_list_mtx); + mtx_lock(&g_gate_units_lock); + sc->sc_unit = g_gate_getunit(ggio->gctl_unit, &error); + if (sc->sc_unit < 0) { + mtx_unlock(&g_gate_units_lock); mtx_destroy(&sc->sc_queue_mtx); free(sc, M_GATE); - return (EBUSY); + return (error); } - sc->sc_unit = ggio->gctl_unit; - LIST_INSERT_HEAD(&g_gate_list, sc, sc_next); - mtx_unlock(&g_gate_list_mtx); + if (ggio->gctl_unit == G_GATE_NAME_GIVEN) + snprintf(name, sizeof(name), "%s", ggio->gctl_name); + else { + snprintf(name, sizeof(name), "%s%d", G_GATE_PROVIDER_NAME, + sc->sc_unit); + } + /* Check for name collision. */ + for (unit = 0; unit < g_gate_maxunits; unit++) { + if (g_gate_units[unit] == NULL) + continue; + if (strcmp(name, g_gate_units[unit]->sc_provider->name) != 0) + continue; + mtx_unlock(&g_gate_units_lock); + mtx_destroy(&sc->sc_queue_mtx); + free(sc, M_GATE); + return (EEXIST); + } + g_gate_units[sc->sc_unit] = sc; + g_gate_nunits++; + mtx_unlock(&g_gate_units_lock); + + ggio->gctl_unit = sc->sc_unit; g_topology_lock(); - gp = g_new_geomf(&g_gate_class, "%s%d", G_GATE_PROVIDER_NAME, - sc->sc_unit); + gp = g_new_geomf(&g_gate_class, "%s", name); gp->start = g_gate_start; gp->access = g_gate_access; gp->dumpconf = g_gate_dumpconf; gp->softc = sc; - pp = g_new_providerf(gp, "%s%d", G_GATE_PROVIDER_NAME, sc->sc_unit); + pp = g_new_providerf(gp, "%s", name); pp->mediasize = ggio->gctl_mediasize; pp->sectorsize = ggio->gctl_sectorsize; sc->sc_provider = pp; @@ -446,11 +478,11 @@ g_gate_ioctl(struct cdev *dev, u_long cm struct g_gate_ctl_destroy *ggio = (void *)addr; G_GATE_CHECK_VERSION(ggio); - sc = g_gate_hold(ggio->gctl_unit); + sc = g_gate_hold(ggio->gctl_unit, ggio->gctl_name); if (sc == NULL) return (ENXIO); g_topology_lock(); - mtx_lock(&g_gate_list_mtx); + mtx_lock(&g_gate_units_lock); error = g_gate_destroy(sc, ggio->gctl_force); g_topology_unlock(); if (error != 0) @@ -463,7 +495,7 @@ g_gate_ioctl(struct cdev *dev, u_long cm struct bio *tbp, *lbp; G_GATE_CHECK_VERSION(ggio); - sc = g_gate_hold(ggio->gctl_unit); + sc = g_gate_hold(ggio->gctl_unit, ggio->gctl_name); if (sc == NULL) return (ENXIO); lbp = NULL; @@ -491,6 +523,8 @@ g_gate_ioctl(struct cdev *dev, u_long cm break; } } + if (ggio->gctl_unit == G_GATE_NAME_GIVEN) + ggio->gctl_unit = sc->sc_unit; mtx_unlock(&sc->sc_queue_mtx); g_gate_release(sc); return (error); @@ -500,7 +534,7 @@ g_gate_ioctl(struct cdev *dev, u_long cm struct g_gate_ctl_io *ggio = (void *)addr; G_GATE_CHECK_VERSION(ggio); - sc = g_gate_hold(ggio->gctl_unit); + sc = g_gate_hold(ggio->gctl_unit, NULL); if (sc == NULL) return (ENXIO); error = 0; @@ -561,7 +595,7 @@ start_end: struct g_gate_ctl_io *ggio = (void *)addr; G_GATE_CHECK_VERSION(ggio); - sc = g_gate_hold(ggio->gctl_unit); + sc = g_gate_hold(ggio->gctl_unit, NULL); if (sc == NULL) return (ENOENT); error = 0; @@ -631,20 +665,24 @@ g_gate_modevent(module_t mod, int type, switch (type) { case MOD_LOAD: - mtx_init(&g_gate_list_mtx, "gg_list_lock", NULL, MTX_DEF); + mtx_init(&g_gate_units_lock, "gg_units_lock", NULL, MTX_DEF); + g_gate_units = malloc(g_gate_maxunits * sizeof(g_gate_units[0]), + M_GATE, M_WAITOK | M_ZERO); + g_gate_nunits = 0; g_gate_device(); break; case MOD_UNLOAD: - mtx_lock(&g_gate_list_mtx); - if (!LIST_EMPTY(&g_gate_list)) { - mtx_unlock(&g_gate_list_mtx); + mtx_lock(&g_gate_units_lock); + if (g_gate_nunits > 0) { + mtx_unlock(&g_gate_units_lock); error = EBUSY; break; } - mtx_unlock(&g_gate_list_mtx); - mtx_destroy(&g_gate_list_mtx); + mtx_unlock(&g_gate_units_lock); + mtx_destroy(&g_gate_units_lock); if (status_dev != 0) destroy_dev(status_dev); + free(g_gate_units, M_GATE); break; default: return (EOPNOTSUPP); Modified: stable/8/sys/geom/gate/g_gate.h ============================================================================== --- stable/8/sys/geom/gate/g_gate.h Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/sys/geom/gate/g_gate.h Sun Apr 18 21:14:49 2010 (r206810) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004-2006 Pawel Jakub Dawidek + * Copyright (c) 2004-2009 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ #define G_GATE_MOD_NAME "ggate" #define G_GATE_CTL_NAME "ggctl" -#define G_GATE_VERSION 1 +#define G_GATE_VERSION 2 /* * Maximum number of request that can be stored in @@ -54,6 +54,15 @@ #define G_GATE_FLAG_DESTROY 0x1000 #define G_GATE_USERFLAGS (G_GATE_FLAG_READONLY | G_GATE_FLAG_WRITEONLY) +/* + * Pick unit number automatically in /dev/ggate. + */ +#define G_GATE_UNIT_AUTO (-1) +/* + * Full provider name is given, so don't use ggate. + */ +#define G_GATE_NAME_GIVEN (-2) + #define G_GATE_CMD_CREATE _IOWR('m', 0, struct g_gate_ctl_create) #define G_GATE_CMD_DESTROY _IOWR('m', 1, struct g_gate_ctl_destroy) #define G_GATE_CMD_CANCEL _IOWR('m', 2, struct g_gate_ctl_cancel) @@ -120,20 +129,23 @@ struct g_gate_ctl_create { u_int gctl_flags; u_int gctl_maxcount; u_int gctl_timeout; + char gctl_name[NAME_MAX]; char gctl_info[G_GATE_INFOSIZE]; - int gctl_unit; /* out */ + int gctl_unit; /* in/out */ }; struct g_gate_ctl_destroy { u_int gctl_version; int gctl_unit; int gctl_force; + char gctl_name[NAME_MAX]; }; struct g_gate_ctl_cancel { u_int gctl_version; int gctl_unit; uintptr_t gctl_seq; + char gctl_name[NAME_MAX]; }; struct g_gate_ctl_io { From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 21:18: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 9F1131065673; Sun, 18 Apr 2010 21:18:33 +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 8CBC68FC24; Sun, 18 Apr 2010 21:18: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 o3ILIXLs096294; Sun, 18 Apr 2010 21:18:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILIWMM096292; Sun, 18 Apr 2010 21:18:32 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182118.o3ILIWMM096292@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 21:18: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: r206811 - stable/8/sbin/hastd 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, 18 Apr 2010 21:18:33 -0000 Author: pjd Date: Sun Apr 18 21:18:32 2010 New Revision: 206811 URL: http://svn.freebsd.org/changeset/base/206811 Log: MFC r204177,r205738,r206669,r206696,r206697: r204177: Changing proto_socketpair.c compilation and linking order revealed a problem - we should simply ignore proto_server() if address doesn't start with socketpair://, and not abort. r205738: Don't hold connection lock when doing reconnects as it makes I/Os wait for connection timeouts. Reported by: Kevin Day r206669: Increase ggate queue size to maximum value. HAST was not able to stand heavy random load. Reported by: Hiroyuki Yamagami r206696: Fix control socket leak when worker process exits. Submitted by: Mikolaj Golub r206697: Fix log size calculation which caused message truncation. Submitted by: Mikolaj Golub Modified: stable/8/sbin/hastd/hastd.c stable/8/sbin/hastd/pjdlog.c stable/8/sbin/hastd/primary.c stable/8/sbin/hastd/proto_socketpair.c Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/hastd.c ============================================================================== --- stable/8/sbin/hastd/hastd.c Sun Apr 18 21:14:49 2010 (r206810) +++ stable/8/sbin/hastd/hastd.c Sun Apr 18 21:18:32 2010 (r206811) @@ -137,6 +137,7 @@ child_exit(void) pjdlog_error("Worker process failed (pid=%u, status=%d).", (unsigned int)pid, WEXITSTATUS(status)); } + proto_close(res->hr_ctrl); res->hr_workerpid = 0; if (res->hr_role == HAST_ROLE_PRIMARY) { sleep(1); Modified: stable/8/sbin/hastd/pjdlog.c ============================================================================== --- stable/8/sbin/hastd/pjdlog.c Sun Apr 18 21:14:49 2010 (r206810) +++ stable/8/sbin/hastd/pjdlog.c Sun Apr 18 21:18:32 2010 (r206811) @@ -228,7 +228,7 @@ pjdlogv_common(int loglevel, int debugle len = snprintf(log, sizeof(log), "%s", pjdlog_prefix); if ((size_t)len < sizeof(log)) - len = vsnprintf(log + len, sizeof(log) - len, fmt, ap); + len += vsnprintf(log + len, sizeof(log) - len, fmt, ap); if (error != -1 && (size_t)len < sizeof(log)) { (void)snprintf(log + len, sizeof(log) - len, ": %s.", strerror(error)); Modified: stable/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Sun Apr 18 21:14:49 2010 (r206810) +++ stable/8/sbin/hastd/primary.c Sun Apr 18 21:18:32 2010 (r206811) @@ -460,9 +460,11 @@ init_local(struct hast_resource *res) exit(EX_NOINPUT); } -static void -init_remote(struct hast_resource *res) +static bool +init_remote(struct hast_resource *res, struct proto_conn **inp, + struct proto_conn **outp) { + struct proto_conn *in, *out; struct nv *nvout, *nvin; const unsigned char *token; unsigned char *map; @@ -472,13 +474,17 @@ init_remote(struct hast_resource *res) uint32_t mapsize; size_t size; + assert((inp == NULL && outp == NULL) || (inp != NULL && outp != NULL)); + + in = out = NULL; + /* Prepare outgoing connection with remote node. */ - if (proto_client(res->hr_remoteaddr, &res->hr_remoteout) < 0) { + if (proto_client(res->hr_remoteaddr, &out) < 0) { primary_exit(EX_OSERR, "Unable to create connection to %s", res->hr_remoteaddr); } /* Try to connect, but accept failure. */ - if (proto_connect(res->hr_remoteout) < 0) { + if (proto_connect(out) < 0) { pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); goto close; @@ -496,7 +502,7 @@ init_remote(struct hast_resource *res) nv_free(nvout); goto close; } - if (hast_proto_send(res, res->hr_remoteout, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, out, nvout, NULL, 0) < 0) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -504,7 +510,7 @@ init_remote(struct hast_resource *res) goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(res->hr_remoteout, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) < 0) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -536,12 +542,12 @@ init_remote(struct hast_resource *res) * Second handshake step. * Setup incoming connection with remote node. */ - if (proto_client(res->hr_remoteaddr, &res->hr_remotein) < 0) { + if (proto_client(res->hr_remoteaddr, &in) < 0) { pjdlog_errno(LOG_WARNING, "Unable to create connection to %s", res->hr_remoteaddr); } /* Try to connect, but accept failure. */ - if (proto_connect(res->hr_remotein) < 0) { + if (proto_connect(in) < 0) { pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); goto close; @@ -560,7 +566,7 @@ init_remote(struct hast_resource *res) nv_free(nvout); goto close; } - if (hast_proto_send(res, res->hr_remotein, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, in, nvout, NULL, 0) < 0) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -568,7 +574,7 @@ init_remote(struct hast_resource *res) goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(res->hr_remoteout, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) < 0) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -611,7 +617,7 @@ init_remote(struct hast_resource *res) * Remote node have some dirty extents on its own, lets * download its activemap. */ - if (hast_proto_recv_data(res, res->hr_remoteout, nvin, map, + if (hast_proto_recv_data(res, out, nvin, map, mapsize) < 0) { pjdlog_errno(LOG_ERR, "Unable to receive remote activemap"); @@ -631,18 +637,29 @@ init_remote(struct hast_resource *res) (void)hast_activemap_flush(res); } pjdlog_info("Connected to %s.", res->hr_remoteaddr); + if (inp != NULL && outp != NULL) { + *inp = in; + *outp = out; + } else { + res->hr_remotein = in; + res->hr_remoteout = out; + } + return (true); +close: + proto_close(out); + if (in != NULL) + proto_close(in); + return (false); +} + +static void +sync_start(void) +{ + mtx_lock(&sync_lock); sync_inprogress = true; mtx_unlock(&sync_lock); cv_signal(&sync_cond); - return; -close: - proto_close(res->hr_remoteout); - res->hr_remoteout = NULL; - if (res->hr_remotein != NULL) { - proto_close(res->hr_remotein); - res->hr_remotein = NULL; - } } static void @@ -665,7 +682,7 @@ init_ggate(struct hast_resource *res) ggiocreate.gctl_mediasize = res->hr_datasize; ggiocreate.gctl_sectorsize = res->hr_local_sectorsize; ggiocreate.gctl_flags = 0; - ggiocreate.gctl_maxcount = 128; + ggiocreate.gctl_maxcount = G_GATE_MAX_QUEUE_SIZE; ggiocreate.gctl_timeout = 0; ggiocreate.gctl_unit = G_GATE_NAME_GIVEN; snprintf(ggiocreate.gctl_name, sizeof(ggiocreate.gctl_name), "hast/%s", @@ -735,7 +752,8 @@ hastd_primary(struct hast_resource *res) setproctitle("%s (primary)", res->hr_name); init_local(res); - init_remote(res); + if (init_remote(res, NULL, NULL)) + sync_start(); init_ggate(res); init_environment(res); error = pthread_create(&td, NULL, ggate_recv_thread, res); @@ -1695,6 +1713,7 @@ static void * guard_thread(void *arg) { struct hast_resource *res = arg; + struct proto_conn *in, *out; unsigned int ii, ncomps; int timeout; @@ -1738,26 +1757,31 @@ guard_thread(void *arg) * connected. */ rw_unlock(&hio_remote_lock[ii]); - rw_wlock(&hio_remote_lock[ii]); - assert(res->hr_remotein == NULL); - assert(res->hr_remoteout == NULL); pjdlog_debug(2, "remote_guard: Reconnecting to %s.", res->hr_remoteaddr); - init_remote(res); - if (ISCONNECTED(res, ii)) { + in = out = NULL; + if (init_remote(res, &in, &out)) { + rw_wlock(&hio_remote_lock[ii]); + assert(res->hr_remotein == NULL); + assert(res->hr_remoteout == NULL); + assert(in != NULL && out != NULL); + res->hr_remotein = in; + res->hr_remoteout = out; + rw_unlock(&hio_remote_lock[ii]); pjdlog_info("Successfully reconnected to %s.", res->hr_remoteaddr); + sync_start(); } else { /* Both connections should be NULL. */ assert(res->hr_remotein == NULL); assert(res->hr_remoteout == NULL); + assert(in == NULL && out == NULL); pjdlog_debug(2, "remote_guard: Reconnect to %s failed.", res->hr_remoteaddr); timeout = RECONNECT_SLEEP; } - rw_unlock(&hio_remote_lock[ii]); } } (void)cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); Modified: stable/8/sbin/hastd/proto_socketpair.c ============================================================================== --- stable/8/sbin/hastd/proto_socketpair.c Sun Apr 18 21:14:49 2010 (r206810) +++ stable/8/sbin/hastd/proto_socketpair.c Sun Apr 18 21:18:32 2010 (r206811) @@ -91,9 +91,12 @@ sp_connect(void *ctx __unused) } static int -sp_server(const char *addr __unused, void **ctxp __unused) +sp_server(const char *addr, void **ctxp __unused) { + if (strcmp(addr, "socketpair://") != 0) + return (-1); + assert(!"proto_server() not supported on socketpairs"); abort(); } From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 21:24: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 391611065676; Sun, 18 Apr 2010 21:24:24 +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 27BA98FC27; Sun, 18 Apr 2010 21:24: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 o3ILOOTg097629; Sun, 18 Apr 2010 21:24:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILOO8o097628; Sun, 18 Apr 2010 21:24:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182124.o3ILOO8o097628@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 21:24: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: r206812 - stable/8/sbin/geom/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, 18 Apr 2010 21:24:24 -0000 Author: pjd Date: Sun Apr 18 21:24:23 2010 New Revision: 206812 URL: http://svn.freebsd.org/changeset/base/206812 Log: MFC r206666: Flush disk write cache after storing and clearing metadata. Modified: stable/8/sbin/geom/misc/subr.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/misc/subr.c ============================================================================== --- stable/8/sbin/geom/misc/subr.c Sun Apr 18 21:18:32 2010 (r206811) +++ stable/8/sbin/geom/misc/subr.c Sun Apr 18 21:24:23 2010 (r206812) @@ -236,6 +236,7 @@ g_metadata_store(const char *name, u_cha error = errno; goto out; } + (void)ioctl(fd, DIOCGFLUSH, NULL); out: if (sector != NULL) free(sector); @@ -293,6 +294,7 @@ g_metadata_clear(const char *name, const error = errno; goto out; } + (void)ioctl(fd, DIOCGFLUSH, NULL); out: if (sector != NULL) free(sector); From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 21:27: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 2693E106566C; Sun, 18 Apr 2010 21:27:00 +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 156208FC1B; Sun, 18 Apr 2010 21:27: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 o3ILQx9u098236; Sun, 18 Apr 2010 21:26:59 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILQxdu098234; Sun, 18 Apr 2010 21:26:59 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182126.o3ILQxdu098234@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 21:26:59 +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: r206813 - stable/8/sys/geom/eli 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, 18 Apr 2010 21:27:00 -0000 Author: pjd Date: Sun Apr 18 21:26:59 2010 New Revision: 206813 URL: http://svn.freebsd.org/changeset/base/206813 Log: MFC r206665: Use lower priority for GELI worker threads. This improves system responsiveness under heavy GELI load. Modified: stable/8/sys/geom/eli/g_eli.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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/eli/g_eli.c ============================================================================== --- stable/8/sys/geom/eli/g_eli.c Sun Apr 18 21:24:23 2010 (r206812) +++ stable/8/sys/geom/eli/g_eli.c Sun Apr 18 21:26:59 2010 (r206813) @@ -340,7 +340,7 @@ g_eli_worker(void *arg) } #endif thread_lock(curthread); - sched_prio(curthread, PRIBIO); + sched_prio(curthread, PUSER); if (sc->sc_crypto == G_ELI_CRYPTO_SW && g_eli_threads == 0) sched_bind(curthread, wr->w_number); thread_unlock(curthread); @@ -361,8 +361,7 @@ g_eli_worker(void *arg) mtx_unlock(&sc->sc_queue_mtx); kproc_exit(0); } - msleep(sc, &sc->sc_queue_mtx, PRIBIO | PDROP, - "geli:w", 0); + msleep(sc, &sc->sc_queue_mtx, PDROP, "geli:w", 0); continue; } mtx_unlock(&sc->sc_queue_mtx); From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 21:29: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 BDE2D106566B; Sun, 18 Apr 2010 21:29:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD9008FC14; Sun, 18 Apr 2010 21:29: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 o3ILTSR7098834; Sun, 18 Apr 2010 21:29:28 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILTSCd098832; Sun, 18 Apr 2010 21:29:28 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004182129.o3ILTSCd098832@svn.freebsd.org> From: Alan Cox Date: Sun, 18 Apr 2010 21:29: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: r206814 - head/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, 18 Apr 2010 21:29:28 -0000 Author: alc Date: Sun Apr 18 21:29:28 2010 New Revision: 206814 URL: http://svn.freebsd.org/changeset/base/206814 Log: Remove a nonsensical test from vm_pageout_clean(). A page can't be in the inactive queue and have a non-zero wire count. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Apr 18 21:26:59 2010 (r206813) +++ head/sys/vm/vm_pageout.c Sun Apr 18 21:29:28 2010 (r206814) @@ -350,7 +350,6 @@ more: vm_page_test_dirty(p); if (p->dirty == 0 || p->queue != PQ_INACTIVE || - p->wire_count != 0 || /* may be held by buf cache */ p->hold_count != 0) { /* may be undergoing I/O */ ib = 0; break; @@ -378,7 +377,6 @@ more: vm_page_test_dirty(p); if (p->dirty == 0 || p->queue != PQ_INACTIVE || - p->wire_count != 0 || /* may be held by buf cache */ p->hold_count != 0) { /* may be undergoing I/O */ break; } From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 21: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 D9E0A1065680; Sun, 18 Apr 2010 21:36:34 +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 C65578FC16; Sun, 18 Apr 2010 21: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 o3ILaYBX000555; Sun, 18 Apr 2010 21:36:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILaYHV000549; Sun, 18 Apr 2010 21:36:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182136.o3ILaYHV000549@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 21:36:34 +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: r206815 - in stable/8/sys: boot/zfs cddl/contrib/opensolaris/uts/common/fs/zfs modules/zfs 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, 18 Apr 2010 21:36:35 -0000 Author: pjd Date: Sun Apr 18 21:36:34 2010 New Revision: 206815 URL: http://svn.freebsd.org/changeset/base/206815 Log: MFC r203504,r204067,r204073,r204101,r204804,r205079,r205080,r205132,r205133, r205134,r205231,r205253,r205264,r205346,r206051,r206667,r206792,r206793, r206794,r206795,r206796,r206797: r203504: Open provider for writting when we find the right one. Opening too much providers for writing provokes huge traffic related to taste events send by GEOM on close. This can lead to various problems with opening GEOM providers that are created on top of other GEOM providers. Reorted by: Kurt Touet , mr Tested by: mr, Baginski Darren r204067: Update comment. We also look for GPT partitions. r204073: Add tunable and sysctl to skip hostid check on pool import. r204101: Don't set f_bsize to recordsize. It might confuse some software (like squid). Submitted by: Alexander Zagrebin r204804: Remove racy assertion. Reported by: Attila Nagy Obtained from: OpenSolaris, Bug ID 6827260 r205079: Remove bogus assertion. Reported by: Johan Ström Obtained from: OpenSolaris, Bug ID 6920880 r205080: Force commit to correct Bug ID: Obtained from: OpenSolaris, Bug ID 6920880 r205132: Don't bottleneck on acquiring the stream locks - this avoids a massive drop off in throughput with large numbers of simultaneous reads r205133: fix compilation under ZIO_USE_UMA r205134: make UMA the default allocator for ZFS buffers - this avoids a great deal of contention in kmem_alloc r205231: - reduce contention by breaking up ARC state locks in to 16 for data and 16 for metadata - export L2ARC tunables as sysctls - add several kstats to track L2ARC state more precisely - avoid holding a contended lock when atomically incrementing a contended counter (no lock protection needed for atomics) r205253: use CACHE_LINE_SIZE instead of hardcoding 128 for lock pad pointed out by Marius Nuennerich and jhb@ r205264: - cache line align arcs_lock array (h/t Marius Nuennerich) - fix ARCS_LOCK_PAD to use architecture defined CACHE_LINE_SIZE - cache line align buf_hash_table ht_locks array r205346: The same code is used to import and to create pool. The order of operations is the following: 1. Try to open vdev by remembered path and guid. 2. If 1 failed, try to find vdev which guid matches and ignore the path. 3. If 2 failed this means either that the vdev we're looking for is gone or that pool is being created and vdev doesn't contain proper guid yet. To be able to handle pool creation we open vdev by path anyway. Because of 3 it is possible that we open wrong vdev on import which can lead to confusions. The solution for this is to check spa_load_state. On pool creation it will be equal to SPA_LOAD_NONE and we can open vdev only by path immediately and if it is not equal to SPA_LOAD_NONE we first open by path+guid and when that fails, we open by guid. We no longer open wrong vdev on import. r206051: IOCPARM_MAX defines maximum size of a structure that can be passed directly to ioctl(2). Because of how ioctl command is build using _IO*() macros we have only 13 bits to encode structure size. So the structure can be up to 8kB-1. Currently we define IOCPARM_MAX as PAGE_SIZE. This is IMHO wrong for three main reasons: 1. It is confusing on archs with page size larger than 8kB (not really sure if we support such archs (sparc64?)), as even if PAGE_SIZE is bigger than 8kB, we won't be able to encode anything larger in ioctl command. 2. It is a waste. Why the structure can be only 4kB on most archs if we have 13 bits dedicated for that, not 12? 3. It shouldn't depend on architecture and page size. My ioctl command can work on one arch, but can't on the other? Increase IOCPARM_MAX to 8kB and make it independed of PAGE_SIZE and architecture it is compiled for. This allows to use all the bits on all the archs for size. Note that this doesn't mean we will copy more on every ioctl(2) call. No. We still copyin(9)/copyout(9) only exact number of bytes encoded in ioctl command. Practical use for this change is ZFS. zfs_cmd_t structure used for ZFS ioctls is larger than 4kB. Silence on: arch@ r206667: Fix 3-way deadlock that can happen because of ZFS and vnode lock order reversal. thread0 (vfs_fhtovp) thread1 (vop_getattr) thread2 (zfs_recv) -------------------- --------------------- ------------------ vn_lock rrw_enter_read rrw_enter_write (hangs) rrw_enter_read (hangs) vn_lock (hangs) Reported by: Attila Nagy r206792: Set ARC_L2_WRITING on L2ARC header creation. Obtained from: OpenSolaris r206793: Remove racy assertion. Obtained from: OpenSolaris r206794: Extend locks scope to match OpenSolaris. r206795: Add missing list and lock destruction. r206796: Style fixes. r206797: Restore previous order. Modified: stable/8/sys/boot/zfs/zfs.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/8/sys/modules/zfs/Makefile stable/8/sys/sys/ioccom.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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Sun Apr 18 21:29:28 2010 (r206814) +++ stable/8/sys/boot/zfs/zfs.c Sun Apr 18 21:36:34 2010 (r206815) @@ -397,7 +397,7 @@ zfs_dev_init(void) /* * Open all the disks we can find and see if we can reconstruct * ZFS pools from them. Bogusly assumes that the disks are named - * diskN or diskNsM. + * diskN, diskNpM or diskNsM. */ zfs_init(); for (unit = 0; unit < 32 /* XXX */; unit++) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 21:29:28 2010 (r206814) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 21:36:34 2010 (r206815) @@ -186,6 +186,11 @@ SYSCTL_QUAD(_vfs_zfs, OID_AUTO, arc_min, SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RDTUN, &zfs_mdcomp_disable, 0, "Disable metadata compression"); +#ifdef ZIO_USE_UMA +extern kmem_cache_t *zio_buf_cache[]; +extern kmem_cache_t *zio_data_buf_cache[]; +#endif + /* * Note that buffers can be in one of 6 states: * ARC_anon - anonymous (discussed below) @@ -218,13 +223,31 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_di * second level ARC benefit from these fast lookups. */ +#define ARCS_LOCK_PAD CACHE_LINE_SIZE +struct arcs_lock { + kmutex_t arcs_lock; +#ifdef _KERNEL + unsigned char pad[(ARCS_LOCK_PAD - sizeof (kmutex_t))]; +#endif +}; + +/* + * must be power of two for mask use to work + * + */ +#define ARC_BUFC_NUMDATALISTS 16 +#define ARC_BUFC_NUMMETADATALISTS 16 +#define ARC_BUFC_NUMLISTS (ARC_BUFC_NUMMETADATALISTS + ARC_BUFC_NUMDATALISTS) + typedef struct arc_state { - list_t arcs_list[ARC_BUFC_NUMTYPES]; /* list of evictable buffers */ uint64_t arcs_lsize[ARC_BUFC_NUMTYPES]; /* amount of evictable data */ uint64_t arcs_size; /* total amount of data in this state */ - kmutex_t arcs_mtx; + list_t arcs_lists[ARC_BUFC_NUMLISTS]; /* list of evictable buffers */ + struct arcs_lock arcs_locks[ARC_BUFC_NUMLISTS] __aligned(CACHE_LINE_SIZE); } arc_state_t; +#define ARCS_LOCK(s, i) (&((s)->arcs_locks[(i)].arcs_lock)) + /* The 6 states: */ static arc_state_t ARC_anon; static arc_state_t ARC_mru; @@ -248,7 +271,9 @@ typedef struct arc_stats { kstat_named_t arcstat_mru_ghost_hits; kstat_named_t arcstat_mfu_hits; kstat_named_t arcstat_mfu_ghost_hits; + kstat_named_t arcstat_allocated; kstat_named_t arcstat_deleted; + kstat_named_t arcstat_stolen; kstat_named_t arcstat_recycle_miss; kstat_named_t arcstat_mutex_miss; kstat_named_t arcstat_evict_skip; @@ -280,6 +305,19 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_size; kstat_named_t arcstat_l2_hdr_size; kstat_named_t arcstat_memory_throttle_count; + kstat_named_t arcstat_l2_write_trylock_fail; + kstat_named_t arcstat_l2_write_passed_headroom; + kstat_named_t arcstat_l2_write_spa_mismatch; + kstat_named_t arcstat_l2_write_in_l2; + kstat_named_t arcstat_l2_write_hdr_io_in_progress; + kstat_named_t arcstat_l2_write_not_cacheable; + kstat_named_t arcstat_l2_write_full; + kstat_named_t arcstat_l2_write_buffer_iter; + kstat_named_t arcstat_l2_write_pios; + kstat_named_t arcstat_l2_write_bytes_written; + kstat_named_t arcstat_l2_write_buffer_bytes_scanned; + kstat_named_t arcstat_l2_write_buffer_list_iter; + kstat_named_t arcstat_l2_write_buffer_list_null_iter; } arc_stats_t; static arc_stats_t arc_stats = { @@ -297,7 +335,9 @@ static arc_stats_t arc_stats = { { "mru_ghost_hits", KSTAT_DATA_UINT64 }, { "mfu_hits", KSTAT_DATA_UINT64 }, { "mfu_ghost_hits", KSTAT_DATA_UINT64 }, + { "allocated", KSTAT_DATA_UINT64 }, { "deleted", KSTAT_DATA_UINT64 }, + { "stolen", KSTAT_DATA_UINT64 }, { "recycle_miss", KSTAT_DATA_UINT64 }, { "mutex_miss", KSTAT_DATA_UINT64 }, { "evict_skip", KSTAT_DATA_UINT64 }, @@ -328,7 +368,20 @@ static arc_stats_t arc_stats = { { "l2_io_error", KSTAT_DATA_UINT64 }, { "l2_size", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, - { "memory_throttle_count", KSTAT_DATA_UINT64 } + { "memory_throttle_count", KSTAT_DATA_UINT64 }, + { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, + { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, + { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, + { "l2_write_in_l2", KSTAT_DATA_UINT64 }, + { "l2_write_io_in_progress", KSTAT_DATA_UINT64 }, + { "l2_write_not_cacheable", KSTAT_DATA_UINT64 }, + { "l2_write_full", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_iter", KSTAT_DATA_UINT64 }, + { "l2_write_pios", KSTAT_DATA_UINT64 }, + { "l2_write_bytes_written", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_bytes_scanned", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_list_iter", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 } }; #define ARCSTAT(stat) (arc_stats.stat.value.ui64) @@ -336,7 +389,7 @@ static arc_stats_t arc_stats = { #define ARCSTAT_INCR(stat, val) \ atomic_add_64(&arc_stats.stat.value.ui64, (val)); -#define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) +#define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) #define ARCSTAT_BUMPDOWN(stat) ARCSTAT_INCR(stat, -1) #define ARCSTAT_MAX(stat, val) { \ @@ -370,7 +423,7 @@ static arc_stats_t arc_stats = { } kstat_t *arc_ksp; -static arc_state_t *arc_anon; +static arc_state_t *arc_anon; static arc_state_t *arc_mru; static arc_state_t *arc_mru_ghost; static arc_state_t *arc_mfu; @@ -514,7 +567,7 @@ static void arc_evict_ghost(arc_state_t * Hash table routines */ -#define HT_LOCK_PAD 128 +#define HT_LOCK_PAD CACHE_LINE_SIZE struct ht_lock { kmutex_t ht_lock; @@ -527,7 +580,7 @@ struct ht_lock { typedef struct buf_hash_table { uint64_t ht_mask; arc_buf_hdr_t **ht_table; - struct ht_lock ht_locks[BUF_LOCKS]; + struct ht_lock ht_locks[BUF_LOCKS] __aligned(CACHE_LINE_SIZE); } buf_hash_table_t; static buf_hash_table_t buf_hash_table; @@ -541,13 +594,19 @@ static buf_hash_table_t buf_hash_table; uint64_t zfs_crc64_table[256]; +#ifdef ZIO_USE_UMA +extern kmem_cache_t *zio_buf_cache[]; +extern kmem_cache_t *zio_data_buf_cache[]; +#endif + /* * Level 2 ARC */ -#define L2ARC_WRITE_SIZE (8 * 1024 * 1024) /* initial write max */ -#define L2ARC_HEADROOM 4 /* num of writes */ +#define L2ARC_WRITE_SIZE (64 * 1024 * 1024) /* initial write max */ +#define L2ARC_HEADROOM 128 /* num of writes */ #define L2ARC_FEED_SECS 1 /* caching interval */ +#define L2ARC_FEED_SECS_SHIFT 1 /* caching interval shift */ #define l2arc_writes_sent ARCSTAT(arcstat_l2_writes_sent) #define l2arc_writes_done ARCSTAT(arcstat_l2_writes_done) @@ -559,7 +618,66 @@ uint64_t l2arc_write_max = L2ARC_WRITE_S uint64_t l2arc_write_boost = L2ARC_WRITE_SIZE; /* extra write during warmup */ uint64_t l2arc_headroom = L2ARC_HEADROOM; /* number of dev writes */ uint64_t l2arc_feed_secs = L2ARC_FEED_SECS; /* interval seconds */ -boolean_t l2arc_noprefetch = B_TRUE; /* don't cache prefetch bufs */ +uint64_t l2arc_feed_secs_shift = L2ARC_FEED_SECS_SHIFT; /* interval seconds shift */ +boolean_t l2arc_noprefetch = B_FALSE; /* don't cache prefetch bufs */ + + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2arc_write_max, CTLFLAG_RW, + &l2arc_write_max, 0, "max write size"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2arc_write_boost, CTLFLAG_RW, + &l2arc_write_boost, 0, "extra write during warmup"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2arc_headroom, CTLFLAG_RW, + &l2arc_headroom, 0, "number of dev writes"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2arc_feed_secs, CTLFLAG_RW, + &l2arc_feed_secs, 0, "interval seconds"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2arc_feed_secs_shift, CTLFLAG_RW, + &l2arc_feed_secs_shift, 0, "power of 2 division of feed seconds"); + +SYSCTL_INT(_vfs_zfs, OID_AUTO, l2arc_noprefetch, CTLFLAG_RW, + &l2arc_noprefetch, 0, "don't cache prefetch bufs"); + + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, anon_size, CTLFLAG_RD, + &ARC_anon.arcs_size, 0, "size of anonymous state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, anon_metadata_lsize, CTLFLAG_RD, + &ARC_anon.arcs_lsize[ARC_BUFC_METADATA], 0, "size of anonymous state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, anon_data_lsize, CTLFLAG_RD, + &ARC_anon.arcs_lsize[ARC_BUFC_DATA], 0, "size of anonymous state"); + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_size, CTLFLAG_RD, + &ARC_mru.arcs_size, 0, "size of mru state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_metadata_lsize, CTLFLAG_RD, + &ARC_mru.arcs_lsize[ARC_BUFC_METADATA], 0, "size of metadata in mru state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_data_lsize, CTLFLAG_RD, + &ARC_mru.arcs_lsize[ARC_BUFC_DATA], 0, "size of data in mru state"); + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_ghost_size, CTLFLAG_RD, + &ARC_mru_ghost.arcs_size, 0, "size of mru ghost state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_ghost_metadata_lsize, CTLFLAG_RD, + &ARC_mru_ghost.arcs_lsize[ARC_BUFC_METADATA], 0, + "size of metadata in mru ghost state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_ghost_data_lsize, CTLFLAG_RD, + &ARC_mru_ghost.arcs_lsize[ARC_BUFC_DATA], 0, + "size of data in mru ghost state"); + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_size, CTLFLAG_RD, + &ARC_mfu.arcs_size, 0, "size of mfu state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_metadata_lsize, CTLFLAG_RD, + &ARC_mfu.arcs_lsize[ARC_BUFC_METADATA], 0, "size of metadata in mfu state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_data_lsize, CTLFLAG_RD, + &ARC_mfu.arcs_lsize[ARC_BUFC_DATA], 0, "size of data in mfu state"); + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_ghost_size, CTLFLAG_RD, + &ARC_mfu_ghost.arcs_size, 0, "size of mfu ghost state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_ghost_metadata_lsize, CTLFLAG_RD, + &ARC_mfu_ghost.arcs_lsize[ARC_BUFC_METADATA], 0, + "size of metadata in mfu ghost state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_ghost_data_lsize, CTLFLAG_RD, + &ARC_mfu_ghost.arcs_lsize[ARC_BUFC_DATA], 0, + "size of data in mfu ghost state"); + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2c_only_size, CTLFLAG_RD, + &ARC_l2c_only.arcs_size, 0, "size of mru state"); /* * L2ARC Internals @@ -953,18 +1071,38 @@ arc_buf_freeze(arc_buf_t *buf) } static void +get_buf_info(arc_buf_hdr_t *ab, arc_state_t *state, list_t **list, kmutex_t **lock) +{ + uint64_t buf_hashid = buf_hash(ab->b_spa, &ab->b_dva, ab->b_birth); + + if (ab->b_type == ARC_BUFC_METADATA) + buf_hashid &= (ARC_BUFC_NUMMETADATALISTS - 1); + else { + buf_hashid &= (ARC_BUFC_NUMDATALISTS - 1); + buf_hashid += ARC_BUFC_NUMMETADATALISTS; + } + + *list = &state->arcs_lists[buf_hashid]; + *lock = ARCS_LOCK(state, buf_hashid); +} + + +static void add_reference(arc_buf_hdr_t *ab, kmutex_t *hash_lock, void *tag) { + ASSERT(MUTEX_HELD(hash_lock)); if ((refcount_add(&ab->b_refcnt, tag) == 1) && (ab->b_state != arc_anon)) { uint64_t delta = ab->b_size * ab->b_datacnt; - list_t *list = &ab->b_state->arcs_list[ab->b_type]; uint64_t *size = &ab->b_state->arcs_lsize[ab->b_type]; + list_t *list; + kmutex_t *lock; - ASSERT(!MUTEX_HELD(&ab->b_state->arcs_mtx)); - mutex_enter(&ab->b_state->arcs_mtx); + get_buf_info(ab, ab->b_state, &list, &lock); + ASSERT(!MUTEX_HELD(lock)); + mutex_enter(lock); ASSERT(list_link_active(&ab->b_arc_node)); list_remove(list, ab); if (GHOST_STATE(ab->b_state)) { @@ -975,7 +1113,7 @@ add_reference(arc_buf_hdr_t *ab, kmutex_ ASSERT(delta > 0); ASSERT3U(*size, >=, delta); atomic_add_64(size, -delta); - mutex_exit(&ab->b_state->arcs_mtx); + mutex_exit(lock); /* remove the prefetch flag if we get a reference */ if (ab->b_flags & ARC_PREFETCH) ab->b_flags &= ~ARC_PREFETCH; @@ -994,14 +1132,17 @@ remove_reference(arc_buf_hdr_t *ab, kmut if (((cnt = refcount_remove(&ab->b_refcnt, tag)) == 0) && (state != arc_anon)) { uint64_t *size = &state->arcs_lsize[ab->b_type]; + list_t *list; + kmutex_t *lock; - ASSERT(!MUTEX_HELD(&state->arcs_mtx)); - mutex_enter(&state->arcs_mtx); + get_buf_info(ab, state, &list, &lock); + ASSERT(!MUTEX_HELD(lock)); + mutex_enter(lock); ASSERT(!list_link_active(&ab->b_arc_node)); - list_insert_head(&state->arcs_list[ab->b_type], ab); + list_insert_head(list, ab); ASSERT(ab->b_datacnt > 0); atomic_add_64(size, ab->b_size * ab->b_datacnt); - mutex_exit(&state->arcs_mtx); + mutex_exit(lock); } return (cnt); } @@ -1016,6 +1157,8 @@ arc_change_state(arc_state_t *new_state, arc_state_t *old_state = ab->b_state; int64_t refcnt = refcount_count(&ab->b_refcnt); uint64_t from_delta, to_delta; + list_t *list; + kmutex_t *lock; ASSERT(MUTEX_HELD(hash_lock)); ASSERT(new_state != old_state); @@ -1030,14 +1173,16 @@ arc_change_state(arc_state_t *new_state, */ if (refcnt == 0) { if (old_state != arc_anon) { - int use_mutex = !MUTEX_HELD(&old_state->arcs_mtx); + int use_mutex; uint64_t *size = &old_state->arcs_lsize[ab->b_type]; + get_buf_info(ab, old_state, &list, &lock); + use_mutex = !MUTEX_HELD(lock); if (use_mutex) - mutex_enter(&old_state->arcs_mtx); + mutex_enter(lock); ASSERT(list_link_active(&ab->b_arc_node)); - list_remove(&old_state->arcs_list[ab->b_type], ab); + list_remove(list, ab); /* * If prefetching out of the ghost cache, @@ -1052,16 +1197,18 @@ arc_change_state(arc_state_t *new_state, atomic_add_64(size, -from_delta); if (use_mutex) - mutex_exit(&old_state->arcs_mtx); + mutex_exit(lock); } if (new_state != arc_anon) { - int use_mutex = !MUTEX_HELD(&new_state->arcs_mtx); + int use_mutex; uint64_t *size = &new_state->arcs_lsize[ab->b_type]; + get_buf_info(ab, new_state, &list, &lock); + use_mutex = !MUTEX_HELD(lock); if (use_mutex) - mutex_enter(&new_state->arcs_mtx); + mutex_enter(lock); - list_insert_head(&new_state->arcs_list[ab->b_type], ab); + list_insert_head(list, ab); /* ghost elements have a ghost size */ if (GHOST_STATE(new_state)) { @@ -1072,7 +1219,7 @@ arc_change_state(arc_state_t *new_state, atomic_add_64(size, to_delta); if (use_mutex) - mutex_exit(&new_state->arcs_mtx); + mutex_exit(lock); } } @@ -1462,21 +1609,48 @@ arc_evict(arc_state_t *state, spa_t *spa { arc_state_t *evicted_state; uint64_t bytes_evicted = 0, skipped = 0, missed = 0; + int64_t bytes_remaining; arc_buf_hdr_t *ab, *ab_prev = NULL; - list_t *list = &state->arcs_list[type]; + list_t *evicted_list, *list, *evicted_list_start, *list_start; + kmutex_t *lock, *evicted_lock; kmutex_t *hash_lock; boolean_t have_lock; void *stolen = NULL; + static int evict_metadata_offset, evict_data_offset; + int i, idx, offset, list_count, count; ASSERT(state == arc_mru || state == arc_mfu); evicted_state = (state == arc_mru) ? arc_mru_ghost : arc_mfu_ghost; - mutex_enter(&state->arcs_mtx); - mutex_enter(&evicted_state->arcs_mtx); + if (type == ARC_BUFC_METADATA) { + offset = 0; + list_count = ARC_BUFC_NUMMETADATALISTS; + list_start = &state->arcs_lists[0]; + evicted_list_start = &evicted_state->arcs_lists[0]; + idx = evict_metadata_offset; + } else { + offset = ARC_BUFC_NUMMETADATALISTS; + list_start = &state->arcs_lists[offset]; + evicted_list_start = &evicted_state->arcs_lists[offset]; + list_count = ARC_BUFC_NUMDATALISTS; + idx = evict_data_offset; + } + bytes_remaining = evicted_state->arcs_lsize[type]; + count = 0; + +evict_start: + list = &list_start[idx]; + evicted_list = &evicted_list_start[idx]; + lock = ARCS_LOCK(state, (offset + idx)); + evicted_lock = ARCS_LOCK(evicted_state, (offset + idx)); + + mutex_enter(lock); + mutex_enter(evicted_lock); for (ab = list_tail(list); ab; ab = ab_prev) { ab_prev = list_prev(list, ab); + bytes_remaining -= (ab->b_size * ab->b_datacnt); /* prefetch buffers have a minimum lifespan */ if (HDR_IO_IN_PROGRESS(ab) || (spa && ab->b_spa != spa) || @@ -1536,17 +1710,35 @@ arc_evict(arc_state_t *state, spa_t *spa mutex_exit(hash_lock); if (bytes >= 0 && bytes_evicted >= bytes) break; + if (bytes_remaining > 0) { + mutex_exit(evicted_lock); + mutex_exit(lock); + idx = ((idx + 1) & (list_count - 1)); + count++; + goto evict_start; + } } else { missed += 1; } } - mutex_exit(&evicted_state->arcs_mtx); - mutex_exit(&state->arcs_mtx); + mutex_exit(evicted_lock); + mutex_exit(lock); + + idx = ((idx + 1) & (list_count - 1)); + count++; - if (bytes_evicted < bytes) - dprintf("only evicted %lld bytes from %x", - (longlong_t)bytes_evicted, state); + if (bytes_evicted < bytes) { + if (count < list_count) + goto evict_start; + else + dprintf("only evicted %lld bytes from %x", + (longlong_t)bytes_evicted, state); + } + if (type == ARC_BUFC_METADATA) + evict_metadata_offset = idx; + else + evict_data_offset = idx; if (skipped) ARCSTAT_INCR(arcstat_evict_skip, skipped); @@ -1574,6 +1766,8 @@ arc_evict(arc_state_t *state, spa_t *spa arc_evict_ghost(arc_mfu_ghost, NULL, todelete); } } + if (stolen) + ARCSTAT_BUMP(arcstat_stolen); return (stolen); } @@ -1586,14 +1780,28 @@ static void arc_evict_ghost(arc_state_t *state, spa_t *spa, int64_t bytes) { arc_buf_hdr_t *ab, *ab_prev; - list_t *list = &state->arcs_list[ARC_BUFC_DATA]; - kmutex_t *hash_lock; + list_t *list, *list_start; + kmutex_t *hash_lock, *lock; uint64_t bytes_deleted = 0; uint64_t bufs_skipped = 0; + static int evict_offset; + int list_count, idx = evict_offset; + int offset, count = 0; ASSERT(GHOST_STATE(state)); -top: - mutex_enter(&state->arcs_mtx); + + /* + * data lists come after metadata lists + */ + list_start = &state->arcs_lists[ARC_BUFC_NUMMETADATALISTS]; + list_count = ARC_BUFC_NUMDATALISTS; + offset = ARC_BUFC_NUMMETADATALISTS; + +evict_start: + list = &list_start[idx]; + lock = ARCS_LOCK(state, idx + offset); + + mutex_enter(lock); for (ab = list_tail(list); ab; ab = ab_prev) { ab_prev = list_prev(list, ab); if (spa && ab->b_spa != spa) @@ -1623,20 +1831,31 @@ top: break; } else { if (bytes < 0) { - mutex_exit(&state->arcs_mtx); + /* + * we're draining the ARC, retry + */ + mutex_exit(lock); mutex_enter(hash_lock); mutex_exit(hash_lock); - goto top; + goto evict_start; } bufs_skipped += 1; } } - mutex_exit(&state->arcs_mtx); + mutex_exit(lock); + idx = ((idx + 1) & (ARC_BUFC_NUMDATALISTS - 1)); + count++; + + if (count < list_count) + goto evict_start; - if (list == &state->arcs_list[ARC_BUFC_DATA] && + evict_offset = idx; + if ((uintptr_t)list > (uintptr_t)&state->arcs_lists[ARC_BUFC_NUMMETADATALISTS] && (bytes < 0 || bytes_deleted < bytes)) { - list = &state->arcs_list[ARC_BUFC_METADATA]; - goto top; + list_start = &state->arcs_lists[0]; + list_count = ARC_BUFC_NUMMETADATALISTS; + offset = count = 0; + goto evict_start; } if (bufs_skipped) { @@ -1718,7 +1937,7 @@ arc_do_user_evicts(void) /* * Move list over to avoid LOR */ -restart: +restart: mutex_enter(&arc_eviction_mtx); tmp_arc_eviction_list = arc_eviction_list; arc_eviction_list = NULL; @@ -1750,22 +1969,22 @@ restart: void arc_flush(spa_t *spa) { - while (list_head(&arc_mru->arcs_list[ARC_BUFC_DATA])) { + while (arc_mru->arcs_lsize[ARC_BUFC_DATA]) { (void) arc_evict(arc_mru, spa, -1, FALSE, ARC_BUFC_DATA); if (spa) break; } - while (list_head(&arc_mru->arcs_list[ARC_BUFC_METADATA])) { + while (arc_mru->arcs_lsize[ARC_BUFC_METADATA]) { (void) arc_evict(arc_mru, spa, -1, FALSE, ARC_BUFC_METADATA); if (spa) break; } - while (list_head(&arc_mfu->arcs_list[ARC_BUFC_DATA])) { + while (arc_mfu->arcs_lsize[ARC_BUFC_DATA]) { (void) arc_evict(arc_mfu, spa, -1, FALSE, ARC_BUFC_DATA); if (spa) break; } - while (list_head(&arc_mfu->arcs_list[ARC_BUFC_METADATA])) { + while (arc_mfu->arcs_lsize[ARC_BUFC_METADATA]) { (void) arc_evict(arc_mfu, spa, -1, FALSE, ARC_BUFC_METADATA); if (spa) break; @@ -1829,7 +2048,7 @@ arc_reclaim_needed(void) return (0); /* - * If pages are needed or we're within 2048 pages + * If pages are needed or we're within 2048 pages * of needing to page need to reclaim */ if (vm_pages_needed || (vm_paging_target() > -2048)) @@ -1896,8 +2115,6 @@ arc_kmem_reap_now(arc_reclaim_strategy_t size_t i; kmem_cache_t *prev_cache = NULL; kmem_cache_t *prev_data_cache = NULL; - extern kmem_cache_t *zio_buf_cache[]; - extern kmem_cache_t *zio_data_buf_cache[]; #endif #ifdef _KERNEL @@ -2203,6 +2420,7 @@ out: arc_anon->arcs_size + arc_mru->arcs_size > arc_p) arc_p = MIN(arc_c, arc_p + size); } + ARCSTAT_BUMP(arcstat_allocated); } /* @@ -2502,7 +2720,6 @@ arc_read(zio_t *pio, spa_t *spa, blkptr_ uint32_t *arc_flags, const zbookmark_t *zb) { int err; - arc_buf_hdr_t *hdr = pbuf->b_hdr; ASSERT(!refcount_is_zero(&pbuf->b_hdr->b_refcnt)); ASSERT3U((char *)bp - (char *)pbuf->b_data, <, pbuf->b_hdr->b_size); @@ -2510,8 +2727,6 @@ arc_read(zio_t *pio, spa_t *spa, blkptr_ err = arc_read_nolock(pio, spa, bp, done, private, priority, zio_flags, arc_flags, zb); - - ASSERT3P(hdr, ==, pbuf->b_hdr); rw_exit(&pbuf->b_lock); return (err); } @@ -2728,7 +2943,7 @@ top: * released by l2arc_read_done(). */ rzio = zio_read_phys(pio, vd, addr, size, - buf->b_data, ZIO_CHECKSUM_OFF, + buf->b_data, ZIO_CHECKSUM_OFF, l2arc_read_done, cb, priority, zio_flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | @@ -2823,6 +3038,8 @@ arc_buf_evict(arc_buf_t *buf) arc_buf_hdr_t *hdr; kmutex_t *hash_lock; arc_buf_t **bufp; + list_t *list, *evicted_list; + kmutex_t *lock, *evicted_lock; rw_enter(&buf->b_lock, RW_WRITER); hdr = buf->b_hdr; @@ -2871,16 +3088,18 @@ arc_buf_evict(arc_buf_t *buf) evicted_state = (old_state == arc_mru) ? arc_mru_ghost : arc_mfu_ghost; - mutex_enter(&old_state->arcs_mtx); - mutex_enter(&evicted_state->arcs_mtx); + get_buf_info(hdr, old_state, &list, &lock); + get_buf_info(hdr, evicted_state, &evicted_list, &evicted_lock); + mutex_enter(lock); + mutex_enter(evicted_lock); arc_change_state(evicted_state, hdr, hash_lock); ASSERT(HDR_IN_HASH_TABLE(hdr)); hdr->b_flags |= ARC_IN_HASH_TABLE; hdr->b_flags &= ~ARC_BUF_AVAILABLE; - mutex_exit(&evicted_state->arcs_mtx); - mutex_exit(&old_state->arcs_mtx); + mutex_exit(evicted_lock); + mutex_exit(lock); } mutex_exit(hash_lock); rw_exit(&buf->b_lock); @@ -3426,7 +3645,8 @@ void arc_init(void) { int prefetch_tunable_set = 0; - + int i; + mutex_init(&arc_reclaim_thr_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&arc_reclaim_thr_cv, NULL, CV_DEFAULT, NULL); mutex_init(&arc_lowmem_lock, NULL, MUTEX_DEFAULT, NULL); @@ -3494,33 +3714,33 @@ arc_init(void) arc_l2c_only = &ARC_l2c_only; arc_size = 0; - mutex_init(&arc_anon->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&arc_mru->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&arc_mru_ghost->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&arc_mfu->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&arc_mfu_ghost->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&arc_l2c_only->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - - list_create(&arc_mru->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mru->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mru_ghost->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mru_ghost->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mfu->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mfu->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mfu_ghost->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_l2c_only->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_l2c_only->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + for (i = 0; i < ARC_BUFC_NUMLISTS; i++) { + mutex_init(&arc_anon->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + mutex_init(&arc_mru->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + mutex_init(&arc_mru_ghost->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + mutex_init(&arc_mfu->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + mutex_init(&arc_mfu_ghost->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + mutex_init(&arc_l2c_only->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + + list_create(&arc_mru->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + list_create(&arc_mru_ghost->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + list_create(&arc_mfu->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + list_create(&arc_mfu_ghost->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + list_create(&arc_mfu_ghost->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + list_create(&arc_l2c_only->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + } buf_init(); @@ -3557,7 +3777,7 @@ arc_init(void) #ifdef _KERNEL if (TUNABLE_INT_FETCH("vfs.zfs.prefetch_disable", &zfs_prefetch_disable)) prefetch_tunable_set = 1; - + #ifdef __i386__ if (prefetch_tunable_set == 0) { printf("ZFS NOTICE: Prefetch is disabled by default on i386 " @@ -3566,7 +3786,7 @@ arc_init(void) "to /boot/loader.conf.\n"); zfs_prefetch_disable=1; } -#else +#else if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) && prefetch_tunable_set == 0) { printf("ZFS NOTICE: Prefetch is disabled by default if less " @@ -3575,7 +3795,7 @@ arc_init(void) "to /boot/loader.conf.\n"); zfs_prefetch_disable=1; } -#endif +#endif /* Warn about ZFS memory and address space requirements. */ if (((uint64_t)physmem * PAGESIZE) < (256 + 128 + 64) * (1 << 20)) { printf("ZFS WARNING: Recommended minimum RAM size is 512MB; " @@ -3594,6 +3814,7 @@ arc_init(void) void arc_fini(void) { + int i; mutex_enter(&arc_reclaim_thr_lock); arc_thread_exit = 1; @@ -3615,20 +3836,20 @@ arc_fini(void) mutex_destroy(&arc_reclaim_thr_lock); cv_destroy(&arc_reclaim_thr_cv); - list_destroy(&arc_mru->arcs_list[ARC_BUFC_METADATA]); - list_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_METADATA]); - list_destroy(&arc_mfu->arcs_list[ARC_BUFC_METADATA]); - list_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA]); - list_destroy(&arc_mru->arcs_list[ARC_BUFC_DATA]); - list_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_DATA]); - list_destroy(&arc_mfu->arcs_list[ARC_BUFC_DATA]); - list_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_DATA]); - - mutex_destroy(&arc_anon->arcs_mtx); - mutex_destroy(&arc_mru->arcs_mtx); - mutex_destroy(&arc_mru_ghost->arcs_mtx); - mutex_destroy(&arc_mfu->arcs_mtx); - mutex_destroy(&arc_mfu_ghost->arcs_mtx); + for (i = 0; i < ARC_BUFC_NUMLISTS; i++) { + list_destroy(&arc_mru->arcs_lists[i]); + list_destroy(&arc_mru_ghost->arcs_lists[i]); + list_destroy(&arc_mfu->arcs_lists[i]); + list_destroy(&arc_mfu_ghost->arcs_lists[i]); + list_destroy(&arc_l2c_only->arcs_lists[i]); + + mutex_destroy(&arc_anon->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_mru->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_mru_ghost->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_mfu->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_mfu_ghost->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_l2c_only->arcs_locks[i].arcs_lock); + } mutex_destroy(&zfs_write_limit_lock); @@ -4024,26 +4245,27 @@ static list_t * l2arc_list_locked(int list_num, kmutex_t **lock) { list_t *list; + int idx; - ASSERT(list_num >= 0 && list_num <= 3); + ASSERT(list_num >= 0 && list_num < 2 * ARC_BUFC_NUMLISTS); - switch (list_num) { - case 0: - list = &arc_mfu->arcs_list[ARC_BUFC_METADATA]; - *lock = &arc_mfu->arcs_mtx; - break; - case 1: - list = &arc_mru->arcs_list[ARC_BUFC_METADATA]; - *lock = &arc_mru->arcs_mtx; - break; - case 2: - list = &arc_mfu->arcs_list[ARC_BUFC_DATA]; - *lock = &arc_mfu->arcs_mtx; - break; - case 3: - list = &arc_mru->arcs_list[ARC_BUFC_DATA]; - *lock = &arc_mru->arcs_mtx; - break; + if (list_num < ARC_BUFC_NUMMETADATALISTS) { + idx = list_num; + list = &arc_mfu->arcs_lists[idx]; + *lock = ARCS_LOCK(arc_mfu, idx); + } else if (list_num < ARC_BUFC_NUMMETADATALISTS * 2) { + idx = list_num - ARC_BUFC_NUMMETADATALISTS; + list = &arc_mru->arcs_lists[idx]; + *lock = ARCS_LOCK(arc_mru, idx); + } else if (list_num < (ARC_BUFC_NUMMETADATALISTS * 2 + + ARC_BUFC_NUMDATALISTS)) { + idx = list_num - ARC_BUFC_NUMMETADATALISTS; + list = &arc_mfu->arcs_lists[idx]; + *lock = ARCS_LOCK(arc_mfu, idx); + } else { + idx = list_num - ARC_BUFC_NUMLISTS; + list = &arc_mru->arcs_lists[idx]; + *lock = ARCS_LOCK(arc_mru, idx); } ASSERT(!(MUTEX_HELD(*lock))); @@ -4210,13 +4432,15 @@ l2arc_write_buffers(spa_t *spa, l2arc_de head = kmem_cache_alloc(hdr_cache, KM_PUSHPAGE); head->b_flags |= ARC_L2_WRITE_HEAD; + ARCSTAT_BUMP(arcstat_l2_write_buffer_iter); /* * Copy buffers for L2ARC writing. */ mutex_enter(&l2arc_buflist_mtx); - for (try = 0; try <= 3; try++) { + for (try = 0; try < 2 * ARC_BUFC_NUMLISTS; try++) { list = l2arc_list_locked(try, &list_lock); passed_sz = 0; + ARCSTAT_BUMP(arcstat_l2_write_buffer_list_iter); /* * L2ARC fast warmup. @@ -4229,52 +4453,65 @@ l2arc_write_buffers(spa_t *spa, l2arc_de ab = list_head(list); else ab = list_tail(list); + if (ab == NULL) + ARCSTAT_BUMP(arcstat_l2_write_buffer_list_null_iter); for (; ab; ab = ab_prev) { if (arc_warm == B_FALSE) ab_prev = list_next(list, ab); else ab_prev = list_prev(list, ab); + ARCSTAT_INCR(arcstat_l2_write_buffer_bytes_scanned, ab->b_size); hash_lock = HDR_LOCK(ab); have_lock = MUTEX_HELD(hash_lock); if (!have_lock && !mutex_tryenter(hash_lock)) { + ARCSTAT_BUMP(arcstat_l2_write_trylock_fail); /* * Skip this buffer rather than waiting. */ continue; } + if (ab->b_l2hdr != NULL) { + /* + * Already in L2ARC. + */ + mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_in_l2); + continue; + } + passed_sz += ab->b_size; if (passed_sz > headroom) { /* * Searched too far. */ mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_passed_headroom); break; } if (ab->b_spa != spa) { mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_spa_mismatch); continue; } - if (ab->b_l2hdr != NULL) { - /* - * Already in L2ARC. - */ + if (HDR_IO_IN_PROGRESS(ab)) { mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_hdr_io_in_progress); continue; } - - if (HDR_IO_IN_PROGRESS(ab) || !HDR_L2CACHE(ab)) { + if (!HDR_L2CACHE(ab)) { mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_not_cacheable); continue; } - if ((write_sz + ab->b_size) > target_sz) { full = B_TRUE; mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_full); break; } @@ -4298,8 +4535,10 @@ l2arc_write_buffers(spa_t *spa, l2arc_de cb->l2wcb_head = head; pio = zio_root(spa, l2arc_write_done, cb, ZIO_FLAG_CANFAIL); + ARCSTAT_BUMP(arcstat_l2_write_pios); } + ARCSTAT_INCR(arcstat_l2_write_bytes_written, ab->b_size); /* * Create and add a new L2ARC header. */ @@ -4395,7 +4634,7 @@ l2arc_feed_thread(void *dummy __unused) */ CALLB_CPR_SAFE_BEGIN(&cpr); (void) cv_timedwait(&l2arc_feed_thr_cv, &l2arc_feed_thr_lock, - hz * l2arc_feed_secs); + hz * l2arc_feed_secs >> l2arc_feed_secs_shift); CALLB_CPR_SAFE_END(&cpr, &l2arc_feed_thr_lock); /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Apr 18 21:29:28 2010 (r206814) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Apr 18 21:36:34 2010 (r206815) @@ -2210,9 +2210,6 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * for (i = db->db.db_size >> SPA_BLKPTRSHIFT; i > 0; i--, ibp++) { if (BP_IS_HOLE(ibp)) continue; - ASSERT3U(BP_GET_LSIZE(ibp), ==, - db->db_level == 1 ? dn->dn_datablksz : - (1<dn_phys->dn_indblkshift)); fill += ibp->blk_fill; } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Sun Apr 18 21:29:28 2010 (r206814) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Sun Apr 18 21:36:34 2010 (r206815) @@ -49,11 +49,11 @@ uint32_t zfetch_block_cap = 256; uint64_t zfetch_array_rd_sz = 1024 * 1024; SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RDTUN, +SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RW, &zfs_prefetch_disable, 0, "Disable prefetch"); SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH"); TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams); -SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RDTUN, +SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RW, &zfetch_max_streams, 0, "Max # of streams per zfetch"); TUNABLE_INT("vfs.zfs.zfetch.min_sec_reap", &zfetch_min_sec_reap); SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RDTUN, @@ -338,8 +338,10 @@ top: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 22: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 50F1F106564A; Sun, 18 Apr 2010 22:13:46 +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 18B888FC23; Sun, 18 Apr 2010 22: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 o3IMDjtV009575; Sun, 18 Apr 2010 22:13:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IMDjES009573; Sun, 18 Apr 2010 22:13:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004182213.o3IMDjES009573@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 18 Apr 2010 22:13: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: r206817 - head/tools/regression/bin/sh/expansion 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, 18 Apr 2010 22:13:46 -0000 Author: jilles Date: Sun Apr 18 22:13:45 2010 New Revision: 206817 URL: http://svn.freebsd.org/changeset/base/206817 Log: sh: Add testcases for double-quotes within quoted ${var+-...} (non-POSIX). POSIX leaves things like "${var+"word"}" undefined. We follow traditional ash behaviour here. Hence, these testcases also work on stable/8. Added: head/tools/regression/bin/sh/expansion/plus-minus3.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/plus-minus3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/plus-minus3.0 Sun Apr 18 22:13:45 2010 (r206817) @@ -0,0 +1,44 @@ +# $FreeBSD$ + +e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' +h='##' +failures='' +ok='' + +testcase() { + code="$1" + expected="$2" + oIFS="$IFS" + eval "$code" + IFS='|' + result="$#|$*" + IFS="$oIFS" + if [ "x$result" = "x$expected" ]; then + ok=x$ok + else + failures=x$failures + echo "For $code, expected $expected actual $result" + fi +} + +# We follow original ash behaviour for quoted ${var+-=?} expansions: +# a double-quote in one switches back to unquoted state. +# This allows expanding a variable as a single word if it is set +# and substituting multiple words otherwise. +# It is also close to the Bourne and Korn shells. +# POSIX leaves this undefined, and various other shells treat +# such double-quotes as introducing a second level of quoting +# which does not do much except quoting close braces. + +testcase 'set -- "${p+"/et[c]/"}"' '1|/etc/' +testcase 'set -- "${p-"/et[c]/"}"' '1|/et[c]/' +testcase 'set -- "${p+"$p"}"' '1|/etc/' +testcase 'set -- "${p-"$p"}"' '1|/et[c]/' +testcase 'set -- "${p+"""/et[c]/"}"' '1|/etc/' +testcase 'set -- "${p-"""/et[c]/"}"' '1|/et[c]/' +testcase 'set -- "${p+"""$p"}"' '1|/etc/' +testcase 'set -- "${p-"""$p"}"' '1|/et[c]/' +testcase 'set -- "${p+"\@"}"' '1|@' +testcase 'set -- "${p+"'\''/et[c]/'\''"}"' '1|/et[c]/' + +test "x$failures" = x From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 22:21: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 84A0D106566B; Sun, 18 Apr 2010 22:21:23 +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 7393A8FC17; Sun, 18 Apr 2010 22:21: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 o3IMLNCW011570; Sun, 18 Apr 2010 22:21:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IMLNFW011567; Sun, 18 Apr 2010 22:21:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004182221.o3IMLNFW011567@svn.freebsd.org> From: Rick Macklem Date: Sun, 18 Apr 2010 22:21: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: r206818 - in head/sys/fs: 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: Sun, 18 Apr 2010 22:21:23 -0000 Author: rmacklem Date: Sun Apr 18 22:21:23 2010 New Revision: 206818 URL: http://svn.freebsd.org/changeset/base/206818 Log: Avoid extraneous recovery cycles in the experimental NFS client when an NFSv4 server reboots, by doing two things. 1 - Make the function that acquires a stateid for I/O operations block until recovery is complete, so that it doesn't acquire out of date stateids. 2 - Only allow a recovery once every 1/2 of a lease duration, since the NFSv4 server must provide a recovery grace period of at least a lease duration. This should avoid recoveries caused by an out of date stateid that was acquired for an I/O op. just before a recovery cycle started. MFC after: 1 week Modified: head/sys/fs/nfs/nfsclstate.h head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfs/nfsclstate.h ============================================================================== --- head/sys/fs/nfs/nfsclstate.h Sun Apr 18 22:13:45 2010 (r206817) +++ head/sys/fs/nfs/nfsclstate.h Sun Apr 18 22:21:23 2010 (r206818) @@ -74,6 +74,7 @@ struct nfsclclient { #define NFSCLFLAGS_EXPIREIT 0x0040 #define NFSCLFLAGS_FIRSTDELEG 0x0080 #define NFSCLFLAGS_GOTDELEG 0x0100 +#define NFSCLFLAGS_RECVRINPROG 0x0200 struct nfsclowner { LIST_ENTRY(nfsclowner) nfsow_list; Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sun Apr 18 22:13:45 2010 (r206817) +++ head/sys/fs/nfsclient/nfs_clstate.c Sun Apr 18 22:21:23 2010 (r206818) @@ -481,6 +481,13 @@ nfscl_getstateid(vnode_t vp, u_int8_t *n } /* + * Wait for recovery to complete. + */ + while ((clp->nfsc_flags & NFSCLFLAGS_RECVRINPROG)) + (void) nfsmsleep(&clp->nfsc_flags, NFSCLSTATEMUTEXPTR, + PZERO, "nfsrecvr", NULL); + + /* * First, look for a delegation. */ LIST_FOREACH(dp, NFSCLDELEGHASH(clp, nfhp, fhlen), nfsdl_hash) { @@ -1778,6 +1785,7 @@ nfscl_recover(struct nfsclclient *clp, s * block when trying to use state. */ NFSLOCKCLSTATE(); + clp->nfsc_flags |= NFSCLFLAGS_RECVRINPROG; do { igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL, NFSCLSTATEMUTEXPTR); @@ -1794,9 +1802,10 @@ nfscl_recover(struct nfsclclient *clp, s error == NFSERR_STALEDONTRECOVER) && --trycnt > 0); if (error) { nfscl_cleanclient(clp); - clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID | - NFSCLFLAGS_RECOVER); NFSLOCKCLSTATE(); + clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID | + NFSCLFLAGS_RECOVER | NFSCLFLAGS_RECVRINPROG); + wakeup(&clp->nfsc_flags); nfsv4_unlock(&clp->nfsc_lock, 0); NFSUNLOCKCLSTATE(); return; @@ -2057,6 +2066,8 @@ nfscl_recover(struct nfsclclient *clp, s } NFSLOCKCLSTATE(); + clp->nfsc_flags &= ~NFSCLFLAGS_RECVRINPROG; + wakeup(&clp->nfsc_flags); nfsv4_unlock(&clp->nfsc_lock, 0); NFSUNLOCKCLSTATE(); NFSFREECRED(tcred); @@ -2316,6 +2327,7 @@ nfscl_renewthread(struct nfsclclient *cl struct ucred *cred; u_int32_t clidrev; int error, cbpathdown, islept, igotlock, ret, clearok; + uint32_t recover_done_time = 0; cred = newnfs_getcred(); NFSLOCKCLSTATE(); @@ -2324,8 +2336,21 @@ nfscl_renewthread(struct nfsclclient *cl for(;;) { newnfs_setroot(cred); cbpathdown = 0; - if (clp->nfsc_flags & NFSCLFLAGS_RECOVER) - nfscl_recover(clp, cred, p); + if (clp->nfsc_flags & NFSCLFLAGS_RECOVER) { + /* + * Only allow one recover within 1/2 of the lease + * duration (nfsc_renew). + */ + if (recover_done_time < NFSD_MONOSEC) { + recover_done_time = NFSD_MONOSEC + + clp->nfsc_renew; + nfscl_recover(clp, cred, p); + } else { + NFSLOCKCLSTATE(); + clp->nfsc_flags &= ~NFSCLFLAGS_RECOVER; + NFSUNLOCKCLSTATE(); + } + } if (clp->nfsc_expire <= NFSD_MONOSEC && (clp->nfsc_flags & NFSCLFLAGS_HASCLIENTID)) { clp->nfsc_expire = NFSD_MONOSEC + clp->nfsc_renew; From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 22:32: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 569451065673; Sun, 18 Apr 2010 22:32:08 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 445978FC0C; Sun, 18 Apr 2010 22:32: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 o3IMW8wx013969; Sun, 18 Apr 2010 22:32:08 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IMW860013954; Sun, 18 Apr 2010 22:32:08 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004182232.o3IMW860013954@svn.freebsd.org> From: Juli Mallett Date: Sun, 18 Apr 2010 22:32: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: r206819 - in head/sys: mips/include mips/mips 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, 18 Apr 2010 22:32:08 -0000 Author: jmallett Date: Sun Apr 18 22:32:07 2010 New Revision: 206819 URL: http://svn.freebsd.org/changeset/base/206819 Log: o) Add a VM find-space option, VMFS_TLB_ALIGNED_SPACE, which searches the address space for an address as aligned by the new pmap_align_tlb() function, which is for constraints imposed by the TLB. [1] o) Add a kmem_alloc_nofault_space() function, which acts like kmem_alloc_nofault() but allows the caller to specify which find-space option to use. [1] o) Use kmem_alloc_nofault_space() with VMFS_TLB_ALIGNED_SPACE to allocate the kernel stack address on MIPS. [1] o) Make pmap_align_tlb() on MIPS align addresses so that they do not start on an odd boundary within the TLB, so that they are suitable for insertion as wired entries and do not have to share a TLB entry with another mapping, assuming they are appropriately-sized. o) Eliminate md_realstack now that the kstack will be appropriately-aligned on MIPS. o) Increase the number of guard pages to 2 so that we retain the proper alignment of the kstack address. Reviewed by: [1] alc X-MFC-after: Making sure alc has not come up with a better interface. Modified: head/sys/mips/include/param.h head/sys/mips/include/proc.h head/sys/mips/mips/exception.S head/sys/mips/mips/genassym.c head/sys/mips/mips/machdep.c head/sys/mips/mips/pmap.c head/sys/mips/mips/swtch.S head/sys/mips/mips/vm_machdep.c head/sys/vm/pmap.h head/sys/vm/vm_extern.h head/sys/vm/vm_glue.c head/sys/vm/vm_kern.c head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/mips/include/param.h Sun Apr 18 22:32:07 2010 (r206819) @@ -113,12 +113,9 @@ /* * The kernel stack needs to be aligned on a (PAGE_SIZE * 2) boundary. - * - * Although we allocate 3 pages for the kernel stack we end up using - * only the 2 pages that are aligned on a (PAGE_SIZE * 2) boundary. */ -#define KSTACK_PAGES 3 /* kernel stack*/ -#define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ +#define KSTACK_PAGES 2 /* kernel stack*/ +#define KSTACK_GUARD_PAGES 2 /* pages of kstack guard; 0 disables */ #define UPAGES 2 Modified: head/sys/mips/include/proc.h ============================================================================== --- head/sys/mips/include/proc.h Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/mips/include/proc.h Sun Apr 18 22:32:07 2010 (r206819) @@ -44,7 +44,7 @@ */ struct mdthread { int md_flags; /* machine-dependent flags */ - int md_upte[KSTACK_PAGES - 1]; /* ptes for mapping u pcb */ + int md_upte[KSTACK_PAGES]; /* ptes for mapping u pcb */ int md_ss_addr; /* single step address for ptrace */ int md_ss_instr; /* single step instruction for ptrace */ register_t md_saved_intr; @@ -53,7 +53,6 @@ struct mdthread { int md_pc_ctrl; /* performance counter control */ int md_pc_count; /* performance counter */ int md_pc_spill; /* performance counter spill */ - vm_offset_t md_realstack; void *md_tls; }; Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/mips/mips/exception.S Sun Apr 18 22:32:07 2010 (r206819) @@ -928,7 +928,7 @@ tlb_insert_random: */ GET_CPU_PCPU(k1) lw k0, PC_CURTHREAD(k1) - lw k0, TD_REALKSTACK(k0) + lw k0, TD_KSTACK(k0) sltu k0, k0, sp bnez k0, _C_LABEL(MipsKernGenException) nop @@ -975,7 +975,7 @@ tlb_insert_random: */ GET_CPU_PCPU(k1) lw k0, PC_CURTHREAD(k1) - sw zero, TD_REALKSTACK(k0) + sw zero, TD_KSTACK(k0) move a1, a0 PANIC("kernel stack overflow - trapframe at %p") Modified: head/sys/mips/mips/genassym.c ============================================================================== --- head/sys/mips/mips/genassym.c Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/mips/mips/genassym.c Sun Apr 18 22:32:07 2010 (r206819) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_UPTE, offsetof(struct thread, td_md.md_upte)); -ASSYM(TD_REALKSTACK, offsetof(struct thread, td_md.md_realstack)); +ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack)); ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/mips/mips/machdep.c Sun Apr 18 22:32:07 2010 (r206819) @@ -298,14 +298,13 @@ mips_proc0_init(void) (long)kstack0)); thread0.td_kstack = kstack0; thread0.td_kstack_pages = KSTACK_PAGES; - thread0.td_md.md_realstack = roundup2(thread0.td_kstack, PAGE_SIZE * 2); /* * Do not use cpu_thread_alloc to initialize these fields * thread0 is the only thread that has kstack located in KSEG0 * while cpu_thread_alloc handles kstack allocated in KSEG2. */ - thread0.td_pcb = (struct pcb *)(thread0.td_md.md_realstack + - (thread0.td_kstack_pages - 1) * PAGE_SIZE) - 1; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + + thread0.td_kstack_pages * PAGE_SIZE) - 1; thread0.td_frame = &thread0.td_pcb->pcb_regs; /* Steal memory for the dynamic per-cpu area. */ Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/mips/mips/pmap.c Sun Apr 18 22:32:07 2010 (r206819) @@ -2813,6 +2813,21 @@ pmap_align_superpage(vm_object_t object, *addr = ((*addr + SEGOFSET) & ~SEGOFSET) + superpage_offset; } +/* + * Increase the starting virtual address of the given mapping so + * that it is aligned to not be the second page in a TLB entry. + * This routine assumes that the length is appropriately-sized so + * that the allocation does not share a TLB entry at all if required. + */ +void +pmap_align_tlb(vm_offset_t *addr) +{ + if ((*addr & PAGE_SIZE) == 0) + return; + *addr += PAGE_SIZE; + return; +} + int pmap_pid_dump(int pid); int Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/mips/mips/swtch.S Sun Apr 18 22:32:07 2010 (r206819) @@ -339,7 +339,7 @@ blocked_loop: sw a1, PC_CURTHREAD(a3) lw a2, TD_PCB(a1) sw a2, PC_CURPCB(a3) - lw v0, TD_REALKSTACK(a1) + lw v0, TD_KSTACK(a1) li s0, MIPS_KSEG2_START # If Uarea addr is below kseg2, bltu v0, s0, sw2 # no need to insert in TLB. lw a1, TD_UPTE+0(s7) # t0 = first u. pte Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/mips/mips/vm_machdep.c Sun Apr 18 22:32:07 2010 (r206819) @@ -217,13 +217,9 @@ cpu_thread_swapin(struct thread *td) * part of the thread struct so cpu_switch() can quickly map in * the pcb struct and kernel stack. */ - if (!(pte = pmap_segmap(kernel_pmap, td->td_md.md_realstack))) - panic("cpu_thread_swapin: invalid segmap"); - pte += ((vm_offset_t)td->td_md.md_realstack >> PAGE_SHIFT) & (NPTEPG - 1); - - for (i = 0; i < KSTACK_PAGES - 1; i++) { + for (i = 0; i < KSTACK_PAGES; i++) { + pte = pmap_pte(kernel_pmap, td->td_kstack + i * PAGE_SIZE); td->td_md.md_upte[i] = *pte & ~(PTE_RO|PTE_WIRED); - pte++; } } @@ -238,22 +234,14 @@ cpu_thread_alloc(struct thread *td) pt_entry_t *pte; int i; - if (td->td_kstack & (1 << PAGE_SHIFT)) - td->td_md.md_realstack = td->td_kstack + PAGE_SIZE; - else - td->td_md.md_realstack = td->td_kstack; - - td->td_pcb = (struct pcb *)(td->td_md.md_realstack + - (td->td_kstack_pages - 1) * PAGE_SIZE) - 1; + KASSERT((td->td_kstack & (1 << PAGE_SHIFT)) == 0, ("kernel stack must be aligned.")); + td->td_pcb = (struct pcb *)(td->td_kstack + + td->td_kstack_pages * PAGE_SIZE) - 1; td->td_frame = &td->td_pcb->pcb_regs; - if (!(pte = pmap_segmap(kernel_pmap, td->td_md.md_realstack))) - panic("cpu_thread_alloc: invalid segmap"); - pte += ((vm_offset_t)td->td_md.md_realstack >> PAGE_SHIFT) & (NPTEPG - 1); - - for (i = 0; i < KSTACK_PAGES - 1; i++) { + for (i = 0; i < KSTACK_PAGES; i++) { + pte = pmap_pte(kernel_pmap, td->td_kstack + i * PAGE_SIZE); td->td_md.md_upte[i] = *pte & ~(PTE_RO|PTE_WIRED); - pte++; } } Modified: head/sys/vm/pmap.h ============================================================================== --- head/sys/vm/pmap.h Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/vm/pmap.h Sun Apr 18 22:32:07 2010 (r206819) @@ -98,6 +98,9 @@ extern vm_offset_t kernel_vm_end; void pmap_align_superpage(vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t); +#if defined(__mips__) +void pmap_align_tlb(vm_offset_t *); +#endif void pmap_change_wiring(pmap_t, vm_offset_t, boolean_t); void pmap_clear_modify(vm_page_t m); void pmap_clear_reference(vm_page_t m); Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/vm/vm_extern.h Sun Apr 18 22:32:07 2010 (r206819) @@ -47,6 +47,7 @@ vm_offset_t kmem_alloc_contig(vm_map_t m vm_paddr_t low, vm_paddr_t high, unsigned long alignment, unsigned long boundary, vm_memattr_t memattr); vm_offset_t kmem_alloc_nofault(vm_map_t, vm_size_t); +vm_offset_t kmem_alloc_nofault_space(vm_map_t, vm_size_t, int); vm_offset_t kmem_alloc_wait(vm_map_t, vm_size_t); void kmem_free(vm_map_t, vm_offset_t, vm_size_t); void kmem_free_wakeup(vm_map_t, vm_offset_t, vm_size_t); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/vm/vm_glue.c Sun Apr 18 22:32:07 2010 (r206819) @@ -373,8 +373,17 @@ vm_thread_new(struct thread *td, int pag /* * Get a kernel virtual address for this thread's kstack. */ +#if defined(__mips__) + /* + * We need to align the kstack's mapped address to fit within + * a single TLB entry. + */ + ks = kmem_alloc_nofault_space(kernel_map, + (pages + KSTACK_GUARD_PAGES) * PAGE_SIZE, VMFS_TLB_ALIGNED_SPACE); +#else ks = kmem_alloc_nofault(kernel_map, (pages + KSTACK_GUARD_PAGES) * PAGE_SIZE); +#endif if (ks == 0) { printf("vm_thread_new: kstack allocation failed\n"); vm_object_deallocate(ksobj); Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/vm/vm_kern.c Sun Apr 18 22:32:07 2010 (r206819) @@ -119,6 +119,35 @@ kmem_alloc_nofault(map, size) } /* + * kmem_alloc_nofault_space: + * + * Allocate a virtual address range with no underlying object and + * no initial mapping to physical memory within the specified + * address space. Any mapping from this range to physical memory + * must be explicitly created prior to its use, typically with + * pmap_qenter(). Any attempt to create a mapping on demand + * through vm_fault() will result in a panic. + */ +vm_offset_t +kmem_alloc_nofault_space(map, size, find_space) + vm_map_t map; + vm_size_t size; + int find_space; +{ + vm_offset_t addr; + int result; + + size = round_page(size); + addr = vm_map_min(map); + result = vm_map_find(map, NULL, 0, &addr, size, find_space, + VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); + if (result != KERN_SUCCESS) { + return (0); + } + return (addr); +} + +/* * Allocate wired-down memory in the kernel's address map * or a submap. */ Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/vm/vm_map.c Sun Apr 18 22:32:07 2010 (r206819) @@ -1394,9 +1394,20 @@ vm_map_find(vm_map_t map, vm_object_t ob vm_map_unlock(map); return (KERN_NO_SPACE); } - if (find_space == VMFS_ALIGNED_SPACE) + switch (find_space) { + case VMFS_ALIGNED_SPACE: pmap_align_superpage(object, offset, addr, length); + break; +#ifdef VMFS_TLB_ALIGNED_SPACE + case VMFS_TLB_ALIGNED_SPACE: + pmap_align_tlb(addr); + break; +#endif + default: + break; + } + start = *addr; } result = vm_map_insert(map, object, offset, start, start + Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sun Apr 18 22:21:23 2010 (r206818) +++ head/sys/vm/vm_map.h Sun Apr 18 22:32:07 2010 (r206819) @@ -326,6 +326,9 @@ long vmspace_wired_count(struct vmspace #define VMFS_NO_SPACE 0 /* don't find; use the given range */ #define VMFS_ANY_SPACE 1 /* find a range with any alignment */ #define VMFS_ALIGNED_SPACE 2 /* find a superpage-aligned range */ +#if defined(__mips__) +#define VMFS_TLB_ALIGNED_SPACE 3 /* find a TLB entry aligned range */ +#endif /* * vm_map_wire and vm_map_unwire option flags From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 22:51: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 3C5B2106566C; Sun, 18 Apr 2010 22:51:16 +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 2A75C8FC1B; Sun, 18 Apr 2010 22:51: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 o3IMpGVk018259; Sun, 18 Apr 2010 22:51:16 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IMpGJb018257; Sun, 18 Apr 2010 22:51:16 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004182251.o3IMpGJb018257@svn.freebsd.org> From: Rick Macklem Date: Sun, 18 Apr 2010 22:51:16 +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: r206821 - stable/8/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: Sun, 18 Apr 2010 22:51:16 -0000 Author: rmacklem Date: Sun Apr 18 22:51:15 2010 New Revision: 206821 URL: http://svn.freebsd.org/changeset/base/206821 Log: MFC: r206170 Harden the experimental NFS server a little, by adding extra checks in the readdir functions for non-positive byte count arguments. For the negative case, set it to the maximum allowable, since it was actually a large positive value (unsigned) on the wire. Also, fix up the readdir function comment a bit. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Apr 18 22:34:29 2010 (r206820) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Apr 18 22:51:15 2010 (r206821) @@ -1397,24 +1397,16 @@ nfsvno_fillattr(struct nfsrv_descript *n * nfs readdir service * - mallocs what it thinks is enough to read * count rounded up to a multiple of DIRBLKSIZ <= NFS_MAXREADDIR - * - calls nfsvno_readdir() + * - calls VOP_READDIR() * - loops around building the reply * if the output generated exceeds count break out of loop * The NFSM_CLGET macro is used here so that the reply will be packed * tightly in mbuf clusters. - * - it only knows that it has encountered eof when the nfsvno_readdir() - * reads nothing - * - as such one readdir rpc will return eof false although you are there - * and then the next will return eof * - it trims out records with d_fileno == 0 * this doesn't matter for Unix clients, but they might confuse clients * for other os'. * - it trims out records with d_type == DT_WHT * these cannot be seen through NFS (unless we extend the protocol) - * NB: It is tempting to set eof to true if the nfsvno_readdir() reads less - * than requested, but this may not apply to all filesystems. For - * example, client NFS does not { although it is never remote mounted - * anyhow } * The alternate call nfsrvd_readdirplus() does lookups as well. * PS: The NFS protocol spec. does not clarify what the "count" byte * argument is a count of.. just name strings and file id's or the @@ -1456,7 +1448,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd } toff = off; cnt = fxdr_unsigned(int, *tl); - if (cnt > NFS_SRVMAXDATA(nd)) + if (cnt > NFS_SRVMAXDATA(nd) || cnt < 0) cnt = NFS_SRVMAXDATA(nd); siz = ((cnt + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1)); fullsiz = siz; @@ -1474,6 +1466,13 @@ nfsrvd_readdir(struct nfsrv_descript *nd nd->nd_repstat = NFSERR_BAD_COOKIE; #endif } + if (nd->nd_repstat == 0 && cnt == 0) { + if (nd->nd_flag & ND_NFSV2) + /* NFSv2 does not have NFSERR_TOOSMALL */ + nd->nd_repstat = EPERM; + else + nd->nd_repstat = NFSERR_TOOSMALL; + } if (!nd->nd_repstat) nd->nd_repstat = nfsvno_accchk(vp, VEXEC, nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE, @@ -1696,7 +1695,7 @@ nfsrvd_readdirplus(struct nfsrv_descript * Use the server's maximum data transfer size as the upper bound * on reply datalen. */ - if (cnt > NFS_SRVMAXDATA(nd)) + if (cnt > NFS_SRVMAXDATA(nd) || cnt < 0) cnt = NFS_SRVMAXDATA(nd); /* @@ -1705,7 +1704,7 @@ nfsrvd_readdirplus(struct nfsrv_descript * so I set it to cnt for that case. I also round it up to the * next multiple of DIRBLKSIZ. */ - if (siz == 0) + if (siz <= 0) siz = cnt; siz = ((siz + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1)); From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 00:18: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 2CD3B106566B; Mon, 19 Apr 2010 00:18:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CB808FC1E; Mon, 19 Apr 2010 00:18: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 o3J0IFM9037377; Mon, 19 Apr 2010 00:18:15 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3J0IEhA037375; Mon, 19 Apr 2010 00:18:14 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004190018.o3J0IEhA037375@svn.freebsd.org> From: Alan Cox Date: Mon, 19 Apr 2010 00:18: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: r206823 - head/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: Mon, 19 Apr 2010 00:18:15 -0000 Author: alc Date: Mon Apr 19 00:18:14 2010 New Revision: 206823 URL: http://svn.freebsd.org/changeset/base/206823 Log: vm_thread_swapout() can safely dirty the page before rather than after acquiring the page queues lock. Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sun Apr 18 22:51:20 2010 (r206822) +++ head/sys/vm/vm_glue.c Mon Apr 19 00:18:14 2010 (r206823) @@ -523,8 +523,8 @@ vm_thread_swapout(struct thread *td) m = vm_page_lookup(ksobj, i); if (m == NULL) panic("vm_thread_swapout: kstack already missing?"); - vm_page_lock_queues(); vm_page_dirty(m); + vm_page_lock_queues(); vm_page_unwire(m, 0); vm_page_unlock_queues(); } From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 02:12: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 3F2991065672; Mon, 19 Apr 2010 02:12:34 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id AB7568FC19; Mon, 19 Apr 2010 02:12:33 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so1418455qwi.7 for ; Sun, 18 Apr 2010 19:12:33 -0700 (PDT) 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:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BM4xQniw4B11NovFRBwfAg5Rhi54rjIT0/WE8+qEOAs=; b=EBb/HI+TRBXVxvHsOXyZRosdWN/g7FMkim8GgTcGY+ALep8wYETOvU9hUSPHcfIZW/ 15PrpPerztdmiVwqY7Uo/7ADr54+V+hxvnbtVav9KF8Lo1QinZnHxZzKQn0g1R2UUzSb h8mMUkb5XaOSu9Wn8Qr+4W+1Q/zZ3Bke53oNs= 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=hAwSZSp6hMYZ8EuZ50jpBpPPOyqM7VFQZ69RcWIblFRr4TH2IL6Tqtt8AOttksz/rm HzcftSwC4jgx6T6ea4ZMALMLB6gOBsmg4cXpvlIGhSxGpc5IusE1dWf6rdG1INYpbErr xmzbmtQGNzhUkQ1tEUJOLlpyf2j9fpQUinrtY= MIME-Version: 1.0 Received: by 10.229.28.85 with HTTP; Sun, 18 Apr 2010 19:12:32 -0700 (PDT) In-Reply-To: <201004130952.o3D9qgJs012413@svn.freebsd.org> References: <201004130952.o3D9qgJs012413@svn.freebsd.org> Date: Sun, 18 Apr 2010 19:12:32 -0700 Received: by 10.229.217.14 with SMTP id hk14mr6289291qcb.89.1271643152794; Sun, 18 Apr 2010 19:12:32 -0700 (PDT) Message-ID: From: Garrett Cooper To: Luigi Rizzo 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: r206550 - head/sbin/geom/class/sched 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, 19 Apr 2010 02:12:34 -0000 On Tue, Apr 13, 2010 at 2:52 AM, Luigi Rizzo wrote: > Author: luigi > Date: Tue Apr 13 09:52:42 2010 > New Revision: 206550 > URL: http://svn.freebsd.org/changeset/base/206550 > > Log: > =A0use correct .PATH, remove unused CFLAGS > > Modified: > =A0head/sbin/geom/class/sched/Makefile > > Modified: head/sbin/geom/class/sched/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/geom/class/sched/Makefile Tue Apr 13 08:56:03 2010 =A0 =A0 = =A0 =A0(r206549) > +++ head/sbin/geom/class/sched/Makefile Tue Apr 13 09:52:42 2010 =A0 =A0 = =A0 =A0(r206550) > @@ -1,9 +1,8 @@ > =A0# GEOM_LIBRARY_PATH > =A0# $FreeBSD$ > > -.PATH: /usr/src/sbin/geom/misc > - > -CFLAGS +=3D -I/usr/src/sbin/geom > +.PATH: ${.CURDIR}/../../misc > +#CFLAGS +=3D -I/usr/src/sbin/geom Shouldn't this just be removed instead of commented out? Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 04:54: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 276DB106564A; Mon, 19 Apr 2010 04:54:35 +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 15F6E8FC12; Mon, 19 Apr 2010 04:54: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 o3J4sYWu098274; Mon, 19 Apr 2010 04:54:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3J4sYgb098272; Mon, 19 Apr 2010 04:54:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004190454.o3J4sYgb098272@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 19 Apr 2010 04:54:34 +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: r206828 - stable/8/etc/mtree 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, 19 Apr 2010 04:54:35 -0000 Author: pjd Date: Mon Apr 19 04:54:34 2010 New Revision: 206828 URL: http://svn.freebsd.org/changeset/base/206828 Log: MFC r204080: Create a directory for hast's examples. Modified: stable/8/etc/mtree/BSD.usr.dist Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/mtree/BSD.usr.dist ============================================================================== --- stable/8/etc/mtree/BSD.usr.dist Mon Apr 19 04:22:45 2010 (r206827) +++ stable/8/etc/mtree/BSD.usr.dist Mon Apr 19 04:54:34 2010 (r206828) @@ -211,6 +211,8 @@ .. find_interface .. + hast + .. hostapd .. ibcs2 From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 06:01: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 B2F6E106566B; Mon, 19 Apr 2010 06:01:58 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FEAA8FC18; Mon, 19 Apr 2010 06:01: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 o3J61wRf013166; Mon, 19 Apr 2010 06:01:58 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3J61wBc013160; Mon, 19 Apr 2010 06:01:58 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004190601.o3J61wBc013160@svn.freebsd.org> From: Juli Mallett Date: Mon, 19 Apr 2010 06:01: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: r206829 - in head/sys/mips: cavium include 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: Mon, 19 Apr 2010 06:01:58 -0000 Author: jmallett Date: Mon Apr 19 06:01:58 2010 New Revision: 206829 URL: http://svn.freebsd.org/changeset/base/206829 Log: o) Fix XKPHYS physical address extraction. Also define cache coherency attributes for XKPHYS. o) Make coprocessor 0 accessor function macros for register+selector registers take the full name so that e.g. (as done in this commit), prid selector 1 can be written through mips_wr_ebase() rather than mips_wr_prid1(). o) Allow for sign extension of 32-bit segment addresses. o) Remove an unused MIPS-I register number. Modified: head/sys/mips/cavium/octeon_machdep.c head/sys/mips/cavium/octeon_mp.c head/sys/mips/include/cpufunc.h head/sys/mips/include/cpuregs.h head/sys/mips/mips/genassym.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Mon Apr 19 04:54:34 2010 (r206828) +++ head/sys/mips/cavium/octeon_machdep.c Mon Apr 19 06:01:58 2010 (r206829) @@ -86,16 +86,6 @@ static void octeon_boot_params_init(regi static uint64_t ciu_get_intr_sum_reg_addr(int core_num, int intx, int enx); static uint64_t ciu_get_intr_en_reg_addr(int core_num, int intx, int enx); -static __inline void -mips_wr_ebase(u_int32_t a0) -{ - __asm __volatile("mtc0 %[a0], $15, 1 ;" - : - : [a0] "r"(a0)); - - mips_barrier(); -} - void platform_cpu_init() { Modified: head/sys/mips/cavium/octeon_mp.c ============================================================================== --- head/sys/mips/cavium/octeon_mp.c Mon Apr 19 04:54:34 2010 (r206828) +++ head/sys/mips/cavium/octeon_mp.c Mon Apr 19 06:01:58 2010 (r206829) @@ -69,7 +69,7 @@ platform_init_ap(int cpuid) /* * Set the exception base. */ - mips_wr_prid1(0x80000000 | cpuid); + mips_wr_ebase(0x80000000 | cpuid); /* * Set up interrupts, clear IPIs and unmask the IPI interrupt. Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Mon Apr 19 04:54:34 2010 (r206828) +++ head/sys/mips/include/cpufunc.h Mon Apr 19 06:01:58 2010 (r206829) @@ -166,7 +166,7 @@ mips_wr_ ## n (uint32_t a0) \ #define MIPS_RDRW32_COP0_SEL(n,r,s) \ static __inline uint32_t \ -mips_rd_ ## n ## s(void) \ +mips_rd_ ## n(void) \ { \ int v0; \ __asm __volatile ("mfc0 %[v0], $"__XSTRING(r)", "__XSTRING(s)";" \ @@ -175,7 +175,7 @@ mips_rd_ ## n ## s(void) \ return (v0); \ } \ static __inline void \ -mips_wr_ ## n ## s(uint32_t a0) \ +mips_wr_ ## n(uint32_t a0) \ { \ __asm __volatile ("mtc0 %[a0], $"__XSTRING(r)", "__XSTRING(s)";" \ __XSTRING(COP0_SYNC)";" \ @@ -201,9 +201,9 @@ static __inline void mips_sync_icache (v MIPS_RDRW32_COP0(compare, MIPS_COP_0_COMPARE); MIPS_RDRW32_COP0(config, MIPS_COP_0_CONFIG); -MIPS_RDRW32_COP0_SEL(config, MIPS_COP_0_CONFIG, 1); -MIPS_RDRW32_COP0_SEL(config, MIPS_COP_0_CONFIG, 2); -MIPS_RDRW32_COP0_SEL(config, MIPS_COP_0_CONFIG, 3); +MIPS_RDRW32_COP0_SEL(config1, MIPS_COP_0_CONFIG, 1); +MIPS_RDRW32_COP0_SEL(config2, MIPS_COP_0_CONFIG, 2); +MIPS_RDRW32_COP0_SEL(config3, MIPS_COP_0_CONFIG, 3); MIPS_RDRW32_COP0(count, MIPS_COP_0_COUNT); MIPS_RDRW32_COP0(index, MIPS_COP_0_TLB_INDEX); MIPS_RDRW32_COP0(wired, MIPS_COP_0_TLB_WIRED); @@ -219,20 +219,20 @@ MIPS_RDRW32_COP0(pagemask, MIPS_COP_0_TL #endif MIPS_RDRW32_COP0(prid, MIPS_COP_0_PRID); /* XXX 64-bit? */ -MIPS_RDRW32_COP0_SEL(prid, MIPS_COP_0_PRID, 1); +MIPS_RDRW32_COP0_SEL(ebase, MIPS_COP_0_PRID, 1); MIPS_RDRW32_COP0(watchlo, MIPS_COP_0_WATCH_LO); -MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 1); -MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 2); -MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 3); +MIPS_RDRW32_COP0_SEL(watchlo1, MIPS_COP_0_WATCH_LO, 1); +MIPS_RDRW32_COP0_SEL(watchlo2, MIPS_COP_0_WATCH_LO, 2); +MIPS_RDRW32_COP0_SEL(watchlo3, MIPS_COP_0_WATCH_LO, 3); MIPS_RDRW32_COP0(watchhi, MIPS_COP_0_WATCH_HI); -MIPS_RDRW32_COP0_SEL(watchhi, MIPS_COP_0_WATCH_HI, 1); -MIPS_RDRW32_COP0_SEL(watchhi, MIPS_COP_0_WATCH_HI, 2); -MIPS_RDRW32_COP0_SEL(watchhi, MIPS_COP_0_WATCH_HI, 3); - -MIPS_RDRW32_COP0_SEL(perfcnt, MIPS_COP_0_PERFCNT, 0); -MIPS_RDRW32_COP0_SEL(perfcnt, MIPS_COP_0_PERFCNT, 1); -MIPS_RDRW32_COP0_SEL(perfcnt, MIPS_COP_0_PERFCNT, 2); -MIPS_RDRW32_COP0_SEL(perfcnt, MIPS_COP_0_PERFCNT, 3); +MIPS_RDRW32_COP0_SEL(watchhi1, MIPS_COP_0_WATCH_HI, 1); +MIPS_RDRW32_COP0_SEL(watchhi2, MIPS_COP_0_WATCH_HI, 2); +MIPS_RDRW32_COP0_SEL(watchhi3, MIPS_COP_0_WATCH_HI, 3); + +MIPS_RDRW32_COP0_SEL(perfcnt0, MIPS_COP_0_PERFCNT, 0); +MIPS_RDRW32_COP0_SEL(perfcnt1, MIPS_COP_0_PERFCNT, 1); +MIPS_RDRW32_COP0_SEL(perfcnt2, MIPS_COP_0_PERFCNT, 2); +MIPS_RDRW32_COP0_SEL(perfcnt3, MIPS_COP_0_PERFCNT, 3); #undef MIPS_RDRW32_COP0 Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Mon Apr 19 04:54:34 2010 (r206828) +++ head/sys/mips/include/cpuregs.h Mon Apr 19 06:01:58 2010 (r206829) @@ -78,21 +78,36 @@ * Caching of mapped addresses is controlled by bits in the TLB entry. */ -#define MIPS_KUSEG_START 0x0 -#define MIPS_KSEG0_START 0x80000000 -#define MIPS_KSEG0_END 0x9fffffff -#define MIPS_KSEG1_START 0xa0000000 -#define MIPS_KSEG1_END 0xbfffffff -#define MIPS_KSSEG_START 0xc0000000 -#define MIPS_KSSEG_END 0xdfffffff +#if !defined(_LOCORE) +#define MIPS_KUSEG_START 0x00000000 +#define MIPS_KSEG0_START ((intptr_t)(int32_t)0x80000000) +#define MIPS_KSEG0_END ((intptr_t)(int32_t)0x9fffffff) +#define MIPS_KSEG1_START ((intptr_t)(int32_t)0xa0000000) +#define MIPS_KSEG1_END ((intptr_t)(int32_t)0xbfffffff) +#define MIPS_KSSEG_START ((intptr_t)(int32_t)0xc0000000) +#define MIPS_KSSEG_END ((intptr_t)(int32_t)0xdfffffff) +#define MIPS_KSEG3_START ((intptr_t)(int32_t)0xe0000000) +#define MIPS_KSEG3_END ((intptr_t)(int32_t)0xffffffff) + #define MIPS_KSEG2_START MIPS_KSSEG_START #define MIPS_KSEG2_END MIPS_KSSEG_END -#define MIPS_KSEG3_START 0xe0000000 -#define MIPS_KSEG3_END 0xffffffff +#endif + +#define MIPS_XKPHYS_START 0x8000000000000000 +#define MIPS_XKPHYS_END 0xbfffffffffffffff + +#define MIPS_XKPHYS_CCA_UC 0x02 /* Uncached. */ +#define MIPS_XKPHYS_CCA_CNC 0x03 /* Cacheable non-coherent. */ #define MIPS_PHYS_TO_XKPHYS(cca,x) \ ((0x2ULL << 62) | ((unsigned long long)(cca) << 59) | (x)) -#define MIPS_XKPHYS_TO_PHYS(x) ((x) & 0x0effffffffffffffULL) +#define MIPS_XKPHYS_TO_PHYS(x) ((x) & 0x07ffffffffffffffULL) + +#define MIPS_XUSEG_START 0x0000000000000000 +#define MIPS_XUSEG_END 0x0000010000000000 + +#define MIPS_XKSEG_START 0xc000000000000000 +#define MIPS_XKSEG_END 0xc00000ff80000000 /* CPU dependent mtc0 hazard hook */ #ifdef TARGET_OCTEON @@ -471,7 +486,6 @@ * (3=32bit, 6=64bit, i=impl dep) * 0 MIPS_COP_0_TLB_INDEX 3333 TLB Index. * 1 MIPS_COP_0_TLB_RANDOM 3333 TLB Random. - * 2 MIPS_COP_0_TLB_LOW 3... r3k TLB entry low. * 2 MIPS_COP_0_TLB_LO0 .636 r4k TLB entry low. * 3 MIPS_COP_0_TLB_LO1 .636 r4k TLB entry low, extended. * 4 MIPS_COP_0_TLB_CONTEXT 3636 TLB Context. @@ -531,10 +545,6 @@ #define MIPS_COP_0_EXC_PC _(14) #define MIPS_COP_0_PRID _(15) - -/* MIPS-I */ -#define MIPS_COP_0_TLB_LOW _(2) - /* MIPS-III */ #define MIPS_COP_0_TLB_LO0 _(2) #define MIPS_COP_0_TLB_LO1 _(3) Modified: head/sys/mips/mips/genassym.c ============================================================================== --- head/sys/mips/mips/genassym.c Mon Apr 19 04:54:34 2010 (r206828) +++ head/sys/mips/mips/genassym.c Mon Apr 19 06:01:58 2010 (r206829) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -91,9 +92,14 @@ ASSYM(SIGF_UC, offsetof(struct sigframe, ASSYM(SIGFPE, SIGFPE); ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PAGE_SIZE, PAGE_SIZE); +ASSYM(PAGE_MASK, PAGE_MASK); ASSYM(SEGSHIFT, SEGSHIFT); ASSYM(NPTEPG, NPTEPG); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(PCPU_SIZE, sizeof(struct pcpu)); ASSYM(MAXCOMLEN, MAXCOMLEN); + +ASSYM(MIPS_KSEG0_START, MIPS_KSEG0_START); +ASSYM(MIPS_KSEG1_START, MIPS_KSEG1_START); +ASSYM(MIPS_KSEG2_START, MIPS_KSEG2_START); From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 06:28: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 91D3F106564A; Mon, 19 Apr 2010 06:28:35 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 0BCFD8FC25; Mon, 19 Apr 2010 06:28:31 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id e12so1660294fga.13 for ; Sun, 18 Apr 2010 23:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=JzofWUnxh9MP28ymFg3J5SAvAQqqk0T4/xXbFQ2EA28=; b=JGnvGgzjABSNEnth/fWbFMGkQa5X0Klcn8Uz/B31p70xS5f6KwRi54VG1Aq0o97s38 4mBHcye7hWZjlmf0MB/eedn0MlnSOk3EwHUmFEVIyRZgcEmjzsnmIyl5at9jdq7q4v8F uTXIRjbvCiKHFMfCUTGAu8Ag7P3i37oqERnMs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=W+CMPNoR3n/+vVREhj+Drrl2W3qC8rc91PJNJpcjVuM9JESa7Jk9xAeqfa0NcTqPtX G2Nib4ph3usM7z4U27aL+9zYbD9IUQl1vQ7A09Bb2Nof7Lgeczg6tiWcIhlnnEy+xV1J DswVw8NTJIEGgB6HOzIJ7zJYs3aw+tKbnnfTc= Received: by 10.223.63.138 with SMTP id b10mr2382043fai.95.1271658510497; Sun, 18 Apr 2010 23:28:30 -0700 (PDT) Received: from mbp-gige.totalterror.net (93-152-151-19.ddns.onlinedirect.bg [93.152.151.19]) by mx.google.com with ESMTPS id 21sm9721623fks.23.2010.04.18.23.28.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 18 Apr 2010 23:28:29 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <201004180115.o3I1FlLh027356@svn.freebsd.org> Date: Mon, 19 Apr 2010 09:28:27 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> References: <201004180115.o3I1FlLh027356@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.1078) 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: r206782 - stable/8/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, 19 Apr 2010 06:28:35 -0000 On 18 Apr, 2010, at 04:15 , Warner Losh wrote: > Author: imp > Date: Sun Apr 18 01:15:47 2010 > New Revision: 206782 > URL: http://svn.freebsd.org/changeset/base/206782 >=20 > Log: > Remap COMPAT_IA32 to COMPAT_FREEBSD32 to ease the transition of this > option and not break 8.0 config files later in the 8.x branch. >=20 > # Yes, this is a direct commit, since this is not relevant to head. >=20 > Modified: > stable/8/sys/conf/options.amd64 > stable/8/sys/conf/options.ia64 >=20 > Modified: stable/8/sys/conf/options.amd64 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/8/sys/conf/options.amd64 Sun Apr 18 00:57:30 2010 = (r206781) > +++ stable/8/sys/conf/options.amd64 Sun Apr 18 01:15:47 2010 = (r206782) > @@ -11,6 +11,7 @@ MP_WATCHDOG > # Options for emulators. These should only be used at config time, so > # they are handled like options for static filesystems > # (see src/sys/conf/options), except for broken debugging options. > +COMPAT_IA32 =3D COMPAT_FREEBSD32 > COMPAT_FREEBSD32 opt_compat.h > #IBCS2 opt_dontuse.h > #COMPAT_LINUX opt_dontuse.h >=20 > Modified: stable/8/sys/conf/options.ia64 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/8/sys/conf/options.ia64 Sun Apr 18 00:57:30 2010 = (r206781) > +++ stable/8/sys/conf/options.ia64 Sun Apr 18 01:15:47 2010 = (r206782) > @@ -9,6 +9,7 @@ LOG2_PAGE_SIZE opt_global.h >=20 > UWX_TRACE_ENABLE opt_global.h >=20 > +COMPAT_IA32 =3D COMPAT_FREEBSD32 > COMPAT_FREEBSD32 opt_compat.h >=20 > EXCEPTION_TRACING opt_xtrace.h >=20 Hi, After this change I can no longer compile a kernel : nas# make -j8 buildkernel WITH_CTF=3D1 -------------------------------------------------------------- >>> Kernel build for NAS started on Mon Apr 19 09:25:57 EEST 2010 -------------------------------------------------------------- =3D=3D=3D> NAS mkdir -p /usr/obj/usr/src/sys -------------------------------------------------------------- >>> stage 1: configuring the kernel -------------------------------------------------------------- cd /usr/src/sys/amd64/conf; = PATH=3D/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/us= r/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:= /usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/us= r/sbin:/usr/bin config -d /usr/obj/usr/src/sys/NAS = /usr/src/sys/amd64/conf/NAS ../../conf/options.amd64: Duplicate option COMPAT_FREEBSD32. *** Error code 1 1 error *** Error code 2 1 error When the change is reverted everything compiles ok. -- Regards, Nikolay Denev From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 07:34: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 CE3E91065674; Mon, 19 Apr 2010 07:34:26 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA1B08FC08; Mon, 19 Apr 2010 07:34: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 o3J7YQHd033618; Mon, 19 Apr 2010 07:34:26 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3J7YQ37033610; Mon, 19 Apr 2010 07:34:26 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004190734.o3J7YQ37033610@svn.freebsd.org> From: Juli Mallett Date: Mon, 19 Apr 2010 07:34: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: r206834 - in head/sys/mips: include 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: Mon, 19 Apr 2010 07:34:26 -0000 Author: jmallett Date: Mon Apr 19 07:34:26 2010 New Revision: 206834 URL: http://svn.freebsd.org/changeset/base/206834 Log: o) Eliminate the "stand" frame and its use. Use CALLFRAME_* everywhere. o) Use macros for register-width, etc., rather than doing it by hand in a few more assembly files. o) Reduce diffs between various bits of TLB refill code in exception.S and between interrupt processing code. o) Use PTR_* to operate on registers that are pointers (e.g. sp). o) Add and use a macro, CLEAR_PTE_SWBITS rather than using the mysteriously-named WIRED_SHIFT to select bits to truncate when loading PTEs. o) Don't doubly disable interrupts by moving zero to the status register, especially since that has the nasty side-effect of taking us out of 64-bit mode. o) Use CLEAR_STATUS to disable interrupts the first time. o) Keep SR_PX set as well as SR_[KSU]X when doing exception processing. This is the bit that determines whether 64-bit operations are allowed. o) Don't enable interrupts until configure_final(), like most other ports. Modified: head/sys/mips/include/regnum.h head/sys/mips/mips/autoconf.c head/sys/mips/mips/exception.S head/sys/mips/mips/fp.S head/sys/mips/mips/machdep.c head/sys/mips/mips/swtch.S head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/regnum.h ============================================================================== --- head/sys/mips/include/regnum.h Mon Apr 19 07:16:01 2010 (r206833) +++ head/sys/mips/include/regnum.h Mon Apr 19 07:34:26 2010 (r206834) @@ -42,10 +42,6 @@ #ifndef _MACHINE_REGNUM_H_ #define _MACHINE_REGNUM_H_ -#define STAND_ARG_SIZE 16 -#define STAND_FRAME_SIZE 24 -#define STAND_RA_OFFSET 20 - /* This must match the numbers * in pcb.h and is used by * swtch.S Modified: head/sys/mips/mips/autoconf.c ============================================================================== --- head/sys/mips/mips/autoconf.c Mon Apr 19 07:16:01 2010 (r206833) +++ head/sys/mips/mips/autoconf.c Mon Apr 19 07:34:26 2010 (r206834) @@ -102,6 +102,7 @@ static void configure_final(dummy) void *dummy; { + intr_enable(); cninit_finish(); Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Mon Apr 19 07:16:01 2010 (r206833) +++ head/sys/mips/mips/exception.S Mon Apr 19 07:34:26 2010 (r206834) @@ -66,37 +66,14 @@ #include "assym.s" -#if defined(ISA_MIPS32) -#undef WITH_64BIT_CP0 -#elif defined(ISA_MIPS64) -#define WITH_64BIT_CP0 -#elif defined(ISA_MIPS3) -#define WITH_64BIT_CP0 -#else -#error "Please write the code for this ISA" -#endif +/* + * Clear the software-managed bits in a PTE in register pr. + */ +#define CLEAR_PTE_SWBITS(pr) \ + sll pr, 2 ; \ + srl pr, 2 # keep bottom 30 bits -#ifdef WITH_64BIT_CP0 -#define _SLL dsll -#define _SRL dsrl -#define _MFC0 dmfc0 -#define _MTC0 dmtc0 -#define WIRED_SHIFT 34 -#else -#define _SLL sll -#define _SRL srl -#define _MFC0 mfc0 -#define _MTC0 mtc0 -#define WIRED_SHIFT 2 -#endif .set noreorder # Noreorder is default style! -#if defined(ISA_MIPS32) - .set mips32 -#elif defined(ISA_MIPS64) - .set mips64 -#elif defined(ISA_MIPS3) - .set mips3 -#endif /* * Reasonable limit @@ -125,12 +102,12 @@ * * */ - - .set noat VECTOR(MipsTLBMiss, unknown) - j _C_LABEL(MipsDoTLBMiss) - mfc0 k0, COP_0_BAD_VADDR # get the fault address - nop + .set push + .set noat + j MipsDoTLBMiss + MFC0 k0, COP_0_BAD_VADDR # get the fault address + .set pop VECTOR_END(MipsTLBMiss) /* @@ -145,42 +122,40 @@ VECTOR_END(MipsTLBMiss) * let the processor trap to load the correct value after service. *---------------------------------------------------------------------------- */ + .set push + .set noat MipsDoTLBMiss: - #k0 already has BadVA - bltz k0, 1f #02: k0<0 -> 1f (kernel fault) - srl k0, k0, SEGSHIFT - 2 #03: k0=seg offset (almost) - GET_CPU_PCPU(k1) - lw k1, PC_SEGBASE(k1) - beqz k1, 2f #05: make sure segbase is not null - andi k0, k0, 0x7fc #06: k0=seg offset (mask 0x3) -#xxx mips64 unsafe? - addu k1, k0, k1 #07: k1=seg entry address - lw k1, 0(k1) #08: k1=seg entry - mfc0 k0, COP_0_BAD_VADDR #09: k0=bad address (again) - beq k1, zero, 2f #0a: ==0 -- no page table - srl k0, PAGE_SHIFT - 2 #0b: k0=VPN (aka va>>10) + bltz k0, 1f #02: k0<0 -> 1f (kernel fault) + PTR_SRL k0, k0, SEGSHIFT - 2 #03: k0=seg offset (almost) - andi k0, k0, ((NPTEPG/2) - 1) << 3 #0c: k0=page tab offset -#xxx mips64 unsafe? - addu k1, k1, k0 #0d: k1=pte address - lw k0, 0(k1) #0e: k0=lo0 pte - lw k1, 4(k1) #0f: k1=lo1 pte - _SLL k0, k0, WIRED_SHIFT #10: keep bottom 30 bits - _SRL k0, k0, WIRED_SHIFT #11: keep bottom 30 bits - _MTC0 k0, COP_0_TLB_LO0 #12: lo0 is loaded - _SLL k1, k1, WIRED_SHIFT #13: keep bottom 30 bits - _SRL k1, k1, WIRED_SHIFT #14: keep bottom 30 bits - _MTC0 k1, COP_0_TLB_LO1 #15: lo1 is loaded - HAZARD_DELAY - tlbwr #1a: write to tlb + GET_CPU_PCPU(k1) + PTR_L k1, PC_SEGBASE(k1) + beqz k1, 2f #05: make sure segbase is not null + andi k0, k0, 0xffc #06: k0=seg offset (mask 0x3) + PTR_ADDU k1, k0, k1 #07: k1=seg entry address + + PTR_L k1, 0(k1) #08: k1=seg entry + MFC0 k0, COP_0_BAD_VADDR #09: k0=bad address (again) + beq k1, zero, 2f #0a: ==0 -- no page table + srl k0, PAGE_SHIFT - 2 #0b: k0=VPN (aka va>>10) + andi k0, k0, 0xff8 #0c: k0=page tab offset + PTR_ADDU k1, k1, k0 #0d: k1=pte address + lw k0, 0(k1) #0e: k0=lo0 pte + lw k1, 4(k1) #0f: k1=lo0 pte + CLEAR_PTE_SWBITS(k0) + MTC0 k0, COP_0_TLB_LO0 #12: lo0 is loaded + COP0_SYNC + CLEAR_PTE_SWBITS(k1) + MTC0 k1, COP_0_TLB_LO1 #15: lo1 is loaded + COP0_SYNC + tlbwr #1a: write to tlb HAZARD_DELAY - eret #1f: retUrn from exception -1: j _C_LABEL(MipsTLBMissException) #20: kernel exception - nop #21: branch delay slot -2: j SlowFault #22: no page table present - nop #23: branch delay slot - - .set at + eret #1f: retUrn from exception +1: j MipsTLBMissException #20: kernel exception + nop #21: branch delay slot +2: j SlowFault #22: no page table present + nop #23: branch delay slot + .set pop /* * This code is copied to the general exception vector address to @@ -207,7 +182,7 @@ VECTOR(MipsException, unknown) # the cause is already # shifted left by 2 bits so # we dont have to shift. - lw k0, 0(k0) # Get the function address + PTR_L k0, 0(k0) # Get the function address nop j k0 # Jump to the function. nop @@ -244,20 +219,9 @@ SlowFault: * *---------------------------------------------------------------------------- */ -#if defined(ISA_MIPS32) -#define STORE sw /* 32 bit mode regsave instruction */ -#define LOAD lw /* 32 bit mode regload instruction */ -#define RSIZE 4 /* 32 bit mode register size */ -#elif defined(ISA_MIPS64) -#define STORE sd /* 64 bit mode regsave instruction */ -#define LOAD ld /* 64 bit mode regload instruction */ -#define RSIZE 8 /* 64 bit mode register size */ -#else -#error "Please write code for this isa." -#endif #define SAVE_REG(reg, offs, base) \ - STORE reg, STAND_ARG_SIZE + (RSIZE * offs) (base) + REG_S reg, CALLFRAME_SIZ + (SZREG * offs) (base) #ifdef TARGET_OCTEON #define CLEAR_STATUS \ @@ -274,7 +238,7 @@ SlowFault: and a0, a0, a2 ; \ mtc0 a0, COP_0_STATUS_REG #endif - + /* * Save CPU and CP0 register state. * @@ -317,8 +281,8 @@ SlowFault: mfhi v1 ;\ mfc0 a0, COP_0_STATUS_REG ;\ mfc0 a1, COP_0_CAUSE_REG ;\ - mfc0 a2, COP_0_BAD_VADDR ;\ - mfc0 a3, COP_0_EXC_PC ;\ + MFC0 a2, COP_0_BAD_VADDR ;\ + MFC0 a3, COP_0_EXC_PC ;\ SAVE_REG(v0, MULLO, sp) ;\ SAVE_REG(v1, MULHI, sp) ;\ SAVE_REG(a0, SR, sp) ;\ @@ -332,20 +296,20 @@ SlowFault: PTR_ADDU v0, sp, KERN_EXC_FRAME_SIZE ;\ SAVE_REG(v0, SP, sp) ;\ CLEAR_STATUS ;\ - PTR_ADDU a0, sp, STAND_ARG_SIZE ;\ + PTR_ADDU a0, sp, CALLFRAME_SIZ ;\ ITLBNOPFIX #define RESTORE_REG(reg, offs, base) \ - LOAD reg, STAND_ARG_SIZE + (RSIZE * offs) (base) + REG_L reg, CALLFRAME_SIZ + (SZREG * offs) (base) #define RESTORE_CPU \ - mtc0 zero,COP_0_STATUS_REG ;\ + CLEAR_STATUS ;\ RESTORE_REG(k0, SR, sp) ;\ RESTORE_REG(t0, MULLO, sp) ;\ RESTORE_REG(t1, MULHI, sp) ;\ mtlo t0 ;\ mthi t1 ;\ - _MTC0 v0, COP_0_EXC_PC ;\ + MTC0 v0, COP_0_EXC_PC ;\ .set noat ;\ RESTORE_REG(AT, AST, sp) ;\ RESTORE_REG(v0, V0, sp) ;\ @@ -384,13 +348,13 @@ SlowFault: * the status register and the multiply lo and high registers. * In addition, we set this up for linkage conventions. */ -#define KERN_REG_SIZE (NUMSAVEREGS * RSIZE) -#define KERN_EXC_FRAME_SIZE (STAND_FRAME_SIZE + KERN_REG_SIZE + 16) +#define KERN_REG_SIZE (NUMSAVEREGS * SZREG) +#define KERN_EXC_FRAME_SIZE (CALLFRAME_SIZ + KERN_REG_SIZE + 16) NNON_LEAF(MipsKernGenException, KERN_EXC_FRAME_SIZE, ra) .set noat - subu sp, sp, KERN_EXC_FRAME_SIZE - .mask 0x80000000, (STAND_RA_OFFSET - KERN_EXC_FRAME_SIZE) + PTR_SUBU sp, sp, KERN_EXC_FRAME_SIZE + .mask 0x80000000, (CALLFRAME_RA - KERN_EXC_FRAME_SIZE) /* * Save CPU state, building 'frame'. */ @@ -401,7 +365,7 @@ NNON_LEAF(MipsKernGenException, KERN_EXC PTR_LA gp, _C_LABEL(_gp) PTR_LA k0, _C_LABEL(trap) jalr k0 - sw a3, STAND_RA_OFFSET + KERN_REG_SIZE(sp) # for debugging + REG_S a3, CALLFRAME_RA + KERN_REG_SIZE(sp) # for debugging /* * Update interrupt mask in saved status register @@ -410,7 +374,6 @@ NNON_LEAF(MipsKernGenException, KERN_EXC * in trap handler */ mfc0 a0, COP_0_STATUS_REG - mtc0 zero, COP_0_STATUS_REG and a0, a0, SR_INT_MASK RESTORE_REG(a1, SR, sp) and a1, a1, ~SR_INT_MASK @@ -424,10 +387,10 @@ END(MipsKernGenException) #define SAVE_U_PCB_REG(reg, offs, base) \ - STORE reg, U_PCB_REGS + (RSIZE * offs) (base) + REG_S reg, U_PCB_REGS + (SZREG * offs) (base) #define RESTORE_U_PCB_REG(reg, offs, base) \ - LOAD reg, U_PCB_REGS + (RSIZE * offs) (base) + REG_L reg, U_PCB_REGS + (SZREG * offs) (base) /*---------------------------------------------------------------------------- * @@ -443,14 +406,14 @@ END(MipsKernGenException) * *---------------------------------------------------------------------------- */ -NNON_LEAF(MipsUserGenException, STAND_FRAME_SIZE, ra) +NNON_LEAF(MipsUserGenException, CALLFRAME_SIZ, ra) .set noat - .mask 0x80000000, (STAND_RA_OFFSET - STAND_FRAME_SIZE) + .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) /* * Save all of the registers except for the kernel temporaries in u.u_pcb. */ GET_CPU_PCPU(k1) - lw k1, PC_CURPCB(k1) + PTR_L k1, PC_CURPCB(k1) SAVE_U_PCB_REG(AT, AST, k1) .set at SAVE_U_PCB_REG(v0, V0, k1) @@ -476,17 +439,17 @@ NNON_LEAF(MipsUserGenException, STAND_FR SAVE_U_PCB_REG(s2, S2, k1) SAVE_U_PCB_REG(s3, S3, k1) SAVE_U_PCB_REG(s4, S4, k1) - mfc0 a2, COP_0_BAD_VADDR # Third arg is the fault addr + MFC0 a2, COP_0_BAD_VADDR # Third arg is the fault addr SAVE_U_PCB_REG(s5, S5, k1) SAVE_U_PCB_REG(s6, S6, k1) SAVE_U_PCB_REG(s7, S7, k1) SAVE_U_PCB_REG(t8, T8, k1) - mfc0 a3, COP_0_EXC_PC # Fourth arg is the pc. + MFC0 a3, COP_0_EXC_PC # Fourth arg is the pc. SAVE_U_PCB_REG(t9, T9, k1) SAVE_U_PCB_REG(gp, GP, k1) SAVE_U_PCB_REG(sp, SP, k1) SAVE_U_PCB_REG(s8, S8, k1) - subu sp, k1, STAND_FRAME_SIZE # switch to kernel SP + PTR_SUBU sp, k1, CALLFRAME_SIZ # switch to kernel SP SAVE_U_PCB_REG(ra, RA, k1) SAVE_U_PCB_REG(v0, MULLO, k1) SAVE_U_PCB_REG(v1, MULHI, k1) @@ -494,12 +457,12 @@ NNON_LEAF(MipsUserGenException, STAND_FR SAVE_U_PCB_REG(a1, CAUSE, k1) SAVE_U_PCB_REG(a2, BADVADDR, k1) SAVE_U_PCB_REG(a3, PC, k1) - sw a3, STAND_RA_OFFSET(sp) # for debugging + REG_S a3, CALLFRAME_RA(sp) # for debugging PTR_LA gp, _C_LABEL(_gp) # switch to kernel GP # Turn off fpu and enter kernel mode and t0, a0, ~(SR_COP_1_BIT | SR_EXL | SR_KSU_MASK | SR_INT_ENAB) #ifdef TARGET_OCTEON - or t0, t0, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) + or t0, t0, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX | MIPS32_SR_PX) #endif mtc0 t0, COP_0_STATUS_REG PTR_ADDU a0, k1, U_PCB_REGS @@ -518,10 +481,7 @@ NNON_LEAF(MipsUserGenException, STAND_FR */ DO_AST - mfc0 t0, COP_0_STATUS_REG # disable int - and t0, t0, ~(MIPS_SR_INT_IE) - mtc0 t0, COP_0_STATUS_REG - ITLBNOPFIX + CLEAR_STATUS /* * The use of k1 for storing the PCB pointer must be done only @@ -529,7 +489,7 @@ NNON_LEAF(MipsUserGenException, STAND_FR * by the interrupt code. */ GET_CPU_PCPU(k1) - lw k1, PC_CURPCB(k1) + PTR_L k1, PC_CURPCB(k1) /* * Update interrupt mask in saved status register @@ -549,7 +509,7 @@ NNON_LEAF(MipsUserGenException, STAND_FR mthi t1 RESTORE_U_PCB_REG(a0, PC, k1) RESTORE_U_PCB_REG(v0, V0, k1) - _MTC0 a0, COP_0_EXC_PC # set return address + MTC0 a0, COP_0_EXC_PC # set return address RESTORE_U_PCB_REG(v1, V1, k1) RESTORE_U_PCB_REG(a0, A0, k1) RESTORE_U_PCB_REG(a1, A1, k1) @@ -578,9 +538,6 @@ NNON_LEAF(MipsUserGenException, STAND_FR RESTORE_U_PCB_REG(k0, SR, k1) RESTORE_U_PCB_REG(s8, S8, k1) RESTORE_U_PCB_REG(ra, RA, k1) -#ifdef TARGET_OCTEON - and k0, k0, ~(MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) -#endif .set noat RESTORE_U_PCB_REG(AT, AST, k1) @@ -610,27 +567,25 @@ END(MipsUserGenException) NNON_LEAF(MipsKernIntr, KERN_EXC_FRAME_SIZE, ra) .set noat - subu sp, sp, KERN_EXC_FRAME_SIZE - .mask 0x80000000, (STAND_RA_OFFSET - KERN_EXC_FRAME_SIZE) + PTR_SUBU sp, sp, KERN_EXC_FRAME_SIZE + .mask 0x80000000, (CALLFRAME_RA - KERN_EXC_FRAME_SIZE) /* - * Save the relevant kernel registers onto the stack. + * Save CPU state, building 'frame'. */ SAVE_CPU - /* - * Call the interrupt handler. + * Call the interrupt handler. a0 points at the saved frame. */ PTR_LA gp, _C_LABEL(_gp) - PTR_ADDU a0, sp, STAND_ARG_SIZE PTR_LA k0, _C_LABEL(cpu_intr) jalr k0 - sw a3, STAND_RA_OFFSET + KERN_REG_SIZE(sp) - /* Why no AST processing here? */ + REG_S a3, CALLFRAME_RA + KERN_REG_SIZE(sp) # for debugging /* * Update interrupt mask in saved status register * Some of interrupts could be disabled by - * intr filters + * intr filters if interrupts are enabled later + * in trap handler */ mfc0 a0, COP_0_STATUS_REG and a0, a0, SR_INT_MASK @@ -638,12 +593,8 @@ NNON_LEAF(MipsKernIntr, KERN_EXC_FRAME_S and a1, a1, ~SR_INT_MASK or a1, a1, a0 SAVE_REG(a1, SR, sp) - -/* - * Restore registers and return from the interrupt. - */ - lw v0, STAND_RA_OFFSET + KERN_REG_SIZE(sp) - RESTORE_CPU + REG_L v0, CALLFRAME_RA + KERN_REG_SIZE(sp) + RESTORE_CPU # v0 contains the return address. sync eret .set at @@ -668,15 +619,15 @@ END(MipsKernIntr) * *---------------------------------------------------------------------------- */ -NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE, ra) +NNON_LEAF(MipsUserIntr, CALLFRAME_SIZ, ra) .set noat - .mask 0x80000000, (STAND_RA_OFFSET - STAND_FRAME_SIZE) + .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) /* * Save the relevant user registers into the u.u_pcb struct. * We don't need to save s0 - s8 because the compiler does it for us. */ GET_CPU_PCPU(k1) - lw k1, PC_CURPCB(k1) + PTR_L k1, PC_CURPCB(k1) SAVE_U_PCB_REG(AT, AST, k1) .set at SAVE_U_PCB_REG(v0, V0, k1) @@ -715,19 +666,19 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE mfhi v1 mfc0 a0, COP_0_STATUS_REG mfc0 a1, COP_0_CAUSE_REG - mfc0 a3, COP_0_EXC_PC + MFC0 a3, COP_0_EXC_PC SAVE_U_PCB_REG(v0, MULLO, k1) SAVE_U_PCB_REG(v1, MULHI, k1) SAVE_U_PCB_REG(a0, SR, k1) SAVE_U_PCB_REG(a1, CAUSE, k1) SAVE_U_PCB_REG(a3, PC, k1) # PC in a3, note used later! - subu sp, k1, STAND_FRAME_SIZE # switch to kernel SP + PTR_SUBU sp, k1, CALLFRAME_SIZ # switch to kernel SP PTR_LA gp, _C_LABEL(_gp) # switch to kernel GP # Turn off fpu, disable interrupts, set kernel mode kernel mode, clear exception level. and t0, a0, ~(SR_COP_1_BIT | SR_EXL | SR_INT_ENAB | SR_KSU_MASK) #ifdef TARGET_OCTEON - or t0, t0, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) + or t0, t0, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX | MIPS32_SR_PX) #endif mtc0 t0, COP_0_STATUS_REG ITLBNOPFIX @@ -737,7 +688,7 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE */ PTR_LA k0, _C_LABEL(cpu_intr) jalr k0 - sw a3, STAND_RA_OFFSET(sp) # for debugging + REG_S a3, CALLFRAME_RA(sp) # for debugging /* * Enable interrupts before doing ast(). @@ -759,13 +710,10 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE /* * Restore user registers and return. */ - mfc0 t0, COP_0_STATUS_REG # disable int - and t0, t0, ~(MIPS_SR_INT_IE) - mtc0 t0, COP_0_STATUS_REG - ITLBNOPFIX + CLEAR_STATUS GET_CPU_PCPU(k1) - lw k1, PC_CURPCB(k1) + PTR_L k1, PC_CURPCB(k1) /* * Update interrupt mask in saved status register @@ -793,7 +741,7 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE RESTORE_U_PCB_REG(t2, PC, k1) mtlo t0 mthi t1 - _MTC0 t2, COP_0_EXC_PC # set return address + MTC0 t2, COP_0_EXC_PC # set return address RESTORE_U_PCB_REG(v0, V0, k1) RESTORE_U_PCB_REG(v1, V1, k1) RESTORE_U_PCB_REG(a0, A0, k1) @@ -814,9 +762,6 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE RESTORE_U_PCB_REG(k0, SR, k1) RESTORE_U_PCB_REG(sp, SP, k1) RESTORE_U_PCB_REG(ra, RA, k1) -#ifdef TARGET_OCTEON - and k0, k0, ~(MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) -#endif .set noat RESTORE_U_PCB_REG(AT, AST, k1) @@ -832,78 +777,78 @@ NLEAF(MipsTLBInvalidException) .set noat .set noreorder - mfc0 k0, COP_0_BAD_VADDR - li k1, VM_MAXUSER_ADDRESS - sltu k1, k0, k1 - bnez k1, 1f + MFC0 k0, COP_0_BAD_VADDR + PTR_LI k1, VM_MAXUSER_ADDRESS + sltu k1, k0, k1 + bnez k1, 1f nop - /* badvaddr = kernel address */ - lui k1, %hi(_C_LABEL(kernel_segmap)) - b 2f - lw k1, %lo(_C_LABEL(kernel_segmap))(k1) + /* Kernel address. */ + lui k1, %hi(kernel_segmap) # k1=hi of segbase + b 2f + PTR_L k1, %lo(kernel_segmap)(k1) # k1=segment tab base -1: - /* badvaddr = user address */ +1: /* User address. */ GET_CPU_PCPU(k1) - lw k1, PC_SEGBASE(k1) + PTR_L k1, PC_SEGBASE(k1) -2: - beqz k1, 3f /* invalid page directory pointer */ +2: /* Validate page directory pointer. */ + beqz k1, 3f nop - srl k0, SEGSHIFT - 2 - andi k0, 0xffc - addu k1, k1, k0 - lw k1, 0(k1) - beqz k1, 3f /* invalid page table page pointer */ + PTR_SRL k0, SEGSHIFT - 2 # k0=seg offset (almost) + beq k1, zero, MipsKernGenException # ==0 -- no seg tab + andi k0, k0, 0xffc # k0=seg offset (mask 0x3) + PTR_ADDU k1, k0, k1 # k1=seg entry address + PTR_L k1, 0(k1) # k1=seg entry + + /* Validate page table pointer. */ + beqz k1, 3f nop - mfc0 k0, COP_0_BAD_VADDR - srl k0, PAGE_SHIFT - 2 - andi k0, 0xffc - addu k1, k1, k0 + MFC0 k0, COP_0_BAD_VADDR # k0=bad address (again) + PTR_SRL k0, PAGE_SHIFT - 2 # k0=VPN + andi k0, k0, 0xffc # k0=page tab offset + PTR_ADDU k1, k1, k0 # k1=pte address + lw k0, 0(k1) # k0=this PTE - lw k0, 0(k1) - andi k0, PTE_V - beqz k0, 3f /* invalid page table entry */ + /* Validate page table entry. */ + andi k0, PTE_V + beqz k0, 3f nop - andi k0, k1, 4 - bnez k0, odd_page + /* Check whether this is an even or odd entry. */ + andi k0, k1, 4 + bnez k0, odd_page nop -even_page: - lw k0, 0(k1) - _SLL k0, k0, WIRED_SHIFT - _SRL k0, k0, WIRED_SHIFT - _MTC0 k0, COP_0_TLB_LO0 - - lw k0, 4(k1) - _SLL k0, k0, WIRED_SHIFT - _SRL k0, k0, WIRED_SHIFT - _MTC0 k0, COP_0_TLB_LO1 + lw k0, 0(k1) + lw k1, 4(k1) + CLEAR_PTE_SWBITS(k0) + MTC0 k0, COP_0_TLB_LO0 + COP0_SYNC + CLEAR_PTE_SWBITS(k1) + MTC0 k1, COP_0_TLB_LO1 + COP0_SYNC - b tlb_insert_entry + b tlb_insert_entry nop odd_page: - lw k0, 0(k1) - _SLL k0, k0, WIRED_SHIFT - _SRL k0, k0, WIRED_SHIFT - _MTC0 k0, COP_0_TLB_LO1 - - lw k0, -4(k1) - _SLL k0, k0, WIRED_SHIFT - _SRL k0, k0, WIRED_SHIFT - _MTC0 k0, COP_0_TLB_LO0 + lw k0, -4(k1) + lw k1, 0(k1) + CLEAR_PTE_SWBITS(k0) + MTC0 k0, COP_0_TLB_LO0 + COP0_SYNC + CLEAR_PTE_SWBITS(k1) + MTC0 k1, COP_0_TLB_LO1 + COP0_SYNC tlb_insert_entry: tlbp HAZARD_DELAY - mfc0 k0, COP_0_TLB_INDEX - HAZARD_DELAY - bltz k0, tlb_insert_random + mfc0 k0, COP_0_TLB_INDEX + bltz k0, tlb_insert_random nop tlbwi eret @@ -927,8 +872,8 @@ tlb_insert_random: * Check for kernel stack overflow. */ GET_CPU_PCPU(k1) - lw k0, PC_CURTHREAD(k1) - lw k0, TD_KSTACK(k0) + PTR_L k0, PC_CURTHREAD(k1) + PTR_L k0, TD_KSTACK(k0) sltu k0, k0, sp bnez k0, _C_LABEL(MipsKernGenException) nop @@ -944,8 +889,8 @@ tlb_insert_random: sll k1, k1, PAGE_SHIFT + 1 PTR_LA k0, _C_LABEL(pcpu_space) - addiu k0, (PAGE_SIZE * 2) - addu k0, k0, k1 + PTR_ADDU k0, PAGE_SIZE * 2 + PTR_ADDU k0, k0, k1 /* * Stash the original value of 'sp' so we can update trapframe later. @@ -954,12 +899,12 @@ tlb_insert_random: move k1, sp move sp, k0 - subu sp, sp, KERN_EXC_FRAME_SIZE + PTR_SUBU sp, sp, KERN_EXC_FRAME_SIZE move k0, ra move ra, zero - sw ra, CALLFRAME_RA(sp) /* stop the ddb backtrace right here */ - sw zero, CALLFRAME_SP(sp) + REG_S ra, CALLFRAME_RA(sp) /* stop the ddb backtrace right here */ + REG_S zero, CALLFRAME_SP(sp) move ra, k0 SAVE_CPU @@ -974,8 +919,8 @@ tlb_insert_random: * Squelch any more overflow checks by setting the stack base to 0. */ GET_CPU_PCPU(k1) - lw k0, PC_CURTHREAD(k1) - sw zero, TD_KSTACK(k0) + PTR_L k0, PC_CURTHREAD(k1) + PTR_S zero, TD_KSTACK(k0) move a1, a0 PANIC("kernel stack overflow - trapframe at %p") @@ -1008,34 +953,30 @@ END(MipsTLBInvalidException) */ NLEAF(MipsTLBMissException) .set noat - mfc0 k0, COP_0_BAD_VADDR # k0=bad address - li k1, (VM_MAX_KERNEL_ADDRESS) # check fault address against - sltu k1, k1, k0 # upper bound of kernel_segmap - bnez k1, _C_LABEL(MipsKernGenException) # out of bound - lui k1, %hi(_C_LABEL(kernel_segmap)) # k1=hi of segbase - srl k0, 20 # k0=seg offset (almost) - lw k1, %lo(_C_LABEL(kernel_segmap))(k1) # k1=segment tab base - beq k1, zero, _C_LABEL(MipsKernGenException) # ==0 -- no seg tab - andi k0, k0, 0xffc # k0=seg offset (mask 0x3) -#xxx mips64 unsafe - addu k1, k0, k1 # k1=seg entry address - lw k1, 0(k1) # k1=seg entry - mfc0 k0, COP_0_BAD_VADDR # k0=bad address (again) - beq k1, zero, _C_LABEL(MipsKernGenException) # ==0 -- no page table - srl k0, 10 # k0=VPN (aka va>>10) - andi k0, k0, 0xff8 # k0=page tab offset -#xxx mips64 unsafe - addu k1, k1, k0 # k1=pte address - lw k0, 0(k1) # k0=lo0 pte - lw k1, 4(k1) # k1=lo1 pte - _SLL k0, WIRED_SHIFT # chop bits [31..30] - _SRL k0, WIRED_SHIFT # chop bits [31..30] - _MTC0 k0, COP_0_TLB_LO0 # lo0 is loaded - _SLL k1, WIRED_SHIFT # chop bits [31..30] - _SRL k1, WIRED_SHIFT # chop bits [31..30] - _MTC0 k1, COP_0_TLB_LO1 # lo1 is loaded - - HAZARD_DELAY + MFC0 k0, COP_0_BAD_VADDR # k0=bad address + PTR_LI k1, VM_MAX_KERNEL_ADDRESS # check fault address against + sltu k1, k1, k0 # upper bound of kernel_segmap + bnez k1, MipsKernGenException # out of bound + lui k1, %hi(kernel_segmap) # k1=hi of segbase + PTR_SRL k0, SEGSHIFT - 2 # k0=seg offset (almost) + PTR_L k1, %lo(kernel_segmap)(k1) # k1=segment tab base + beq k1, zero, MipsKernGenException # ==0 -- no seg tab + andi k0, k0, 0xffc # k0=seg offset (mask 0x3) + PTR_ADDU k1, k0, k1 # k1=seg entry address + PTR_L k1, 0(k1) # k1=seg entry + MFC0 k0, COP_0_BAD_VADDR # k0=bad address (again) + beq k1, zero, MipsKernGenException # ==0 -- no page table + PTR_SRL k0, PAGE_SHIFT - 2 # k0=VPN + andi k0, k0, 0xff8 # k0=page tab offset + PTR_ADDU k1, k1, k0 # k1=pte address + lw k0, 0(k1) # k0=lo0 pte + lw k1, 4(k1) # k1=lo1 pte + CLEAR_PTE_SWBITS(k0) + MTC0 k0, COP_0_TLB_LO0 # lo0 is loaded + COP0_SYNC + CLEAR_PTE_SWBITS(k1) + MTC0 k1, COP_0_TLB_LO1 # lo1 is loaded + COP0_SYNC tlbwr # write to tlb HAZARD_DELAY eret # return from exception @@ -1061,11 +1002,11 @@ END(MipsTLBMissException) * *---------------------------------------------------------------------------- */ -NON_LEAF(MipsFPTrap, STAND_FRAME_SIZE, ra) - subu sp, sp, STAND_FRAME_SIZE +NON_LEAF(MipsFPTrap, CALLFRAME_SIZ, ra) + PTR_SUBU sp, sp, CALLFRAME_SIZ mfc0 t0, COP_0_STATUS_REG - sw ra, STAND_RA_OFFSET(sp) - .mask 0x80000000, (STAND_RA_OFFSET - STAND_FRAME_SIZE) + REG_S ra, CALLFRAME_RA(sp) + .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) or t1, t0, SR_COP_1_BIT mtc0 t1, COP_0_STATUS_REG @@ -1086,10 +1027,10 @@ NON_LEAF(MipsFPTrap, STAND_FRAME_SIZE, r * The instruction is in the branch delay slot so the branch will have to * be emulated to get the resulting PC. */ - sw a2, STAND_FRAME_SIZE + 8(sp) + PTR_S a2, CALLFRAME_SIZ + 8(sp) GET_CPU_PCPU(a0) #mips64 unsafe? - lw a0, PC_CURPCB(a0) + PTR_L a0, PC_CURPCB(a0) PTR_ADDU a0, a0, U_PCB_REGS # first arg is ptr to CPU registers move a1, a2 # second arg is instruction PC move a2, t1 # third arg is floating point CSR @@ -1100,7 +1041,7 @@ NON_LEAF(MipsFPTrap, STAND_FRAME_SIZE, r * Now load the floating-point instruction in the branch delay slot * to be emulated. */ - lw a2, STAND_FRAME_SIZE + 8(sp) # restore EXC pc + PTR_L a2, CALLFRAME_SIZ + 8(sp) # restore EXC pc b 2f lw a0, 4(a2) # a0 = coproc instruction /* @@ -1110,10 +1051,10 @@ NON_LEAF(MipsFPTrap, STAND_FRAME_SIZE, r 1: lw a0, 0(a2) # a0 = coproc instruction #xxx mips64 unsafe? - addu v0, a2, 4 # v0 = next pc + PTR_ADDU v0, a2, 4 # v0 = next pc 2: GET_CPU_PCPU(t2) - lw t2, PC_CURPCB(t2) + PTR_L t2, PC_CURPCB(t2) SAVE_U_PCB_REG(v0, PC, t2) # save new pc /* * Check to see if the instruction to be emulated is a floating-point @@ -1127,7 +1068,7 @@ NON_LEAF(MipsFPTrap, STAND_FRAME_SIZE, r */ 3: GET_CPU_PCPU(a0) - lw a0, PC_CURTHREAD(a0) # get current thread + PTR_L a0, PC_CURTHREAD(a0) # get current thread cfc1 a2, FPC_CSR # code = FP execptions ctc1 zero, FPC_CSR # Clear exceptions PTR_LA t3, _C_LABEL(trapsignal) @@ -1149,12 +1090,12 @@ NON_LEAF(MipsFPTrap, STAND_FRAME_SIZE, r */ FPReturn: mfc0 t0, COP_0_STATUS_REG - lw ra, STAND_RA_OFFSET(sp) + PTR_L ra, CALLFRAME_RA(sp) and t0, t0, ~SR_COP_1_BIT mtc0 t0, COP_0_STATUS_REG ITLBNOPFIX j ra - PTR_ADDU sp, sp, STAND_FRAME_SIZE + PTR_ADDU sp, sp, CALLFRAME_SIZ END(MipsFPTrap) /* @@ -1182,7 +1123,7 @@ VECTOR(MipsCache, unknown) PTR_LA k0, _C_LABEL(MipsCacheException) li k1, MIPS_PHYS_MASK and k0, k1 - li k1, MIPS_KSEG1_START + PTR_LI k1, MIPS_KSEG1_START or k0, k1 j k0 nop @@ -1200,16 +1141,16 @@ NESTED_NOPROFILE(MipsCacheException, KER .mask 0x80000000, -4 PTR_LA k0, _C_LABEL(panic) # return to panic PTR_LA a0, 9f # panicstr - _MFC0 a1, COP_0_ERROR_PC + MFC0 a1, COP_0_ERROR_PC mfc0 a2, COP_0_CACHE_ERR # 3rd arg cache error - _MTC0 k0, COP_0_ERROR_PC # set return address + MTC0 k0, COP_0_ERROR_PC # set return address mfc0 k0, COP_0_STATUS_REG # restore status li k1, SR_DIAG_DE # ignore further errors or k0, k1 mtc0 k0, COP_0_STATUS_REG # restore status - HAZARD_DELAY + COP0_SYNC eret Modified: head/sys/mips/mips/fp.S ============================================================================== --- head/sys/mips/mips/fp.S Mon Apr 19 07:16:01 2010 (r206833) +++ head/sys/mips/mips/fp.S Mon Apr 19 07:34:26 2010 (r206834) @@ -94,9 +94,9 @@ * *---------------------------------------------------------------------------- */ -NON_LEAF(MipsEmulateFP, STAND_FRAME_SIZE, ra) - subu sp, sp, STAND_FRAME_SIZE - sw ra, STAND_RA_OFFSET(sp) +NON_LEAF(MipsEmulateFP, CALLFRAME_SIZ, ra) + subu sp, sp, CALLFRAME_SIZ + sw ra, CALLFRAME_RA(sp) /* * Decode the FMT field (bits 24-21) and FUNCTION field (bits 5-0). */ @@ -2247,8 +2247,8 @@ result_fs_d: # result is FS jal set_fd_d # save result (in t0,t1,t2,t3) done: - lw ra, STAND_RA_OFFSET(sp) - addu sp, sp, STAND_FRAME_SIZE + lw ra, CALLFRAME_RA(sp) + addu sp, sp, CALLFRAME_SIZ j ra END(MipsEmulateFP) Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Mon Apr 19 07:16:01 2010 (r206833) +++ head/sys/mips/mips/machdep.c Mon Apr 19 07:34:26 2010 (r206834) @@ -369,7 +369,6 @@ mips_vector_init(void) * when handler is installed for it */ set_intr_mask(ALL_INT_MASK); - intr_enable(); /* Clear BEV in SR so we start handling our own exceptions */ mips_wr_status(mips_rd_status() & ~SR_BOOT_EXC_VEC); Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Mon Apr 19 07:16:01 2010 (r206833) +++ head/sys/mips/mips/swtch.S Mon Apr 19 07:34:26 2010 (r206834) @@ -65,53 +65,7 @@ #include "assym.s" -#if defined(ISA_MIPS32) -#undef WITH_64BIT_CP0 -#elif defined(ISA_MIPS64) -#define WITH_64BIT_CP0 -#elif defined(ISA_MIPS3) -#define WITH_64BIT_CP0 -#else -#error "Please write the code for this ISA" -#endif - -#ifdef WITH_64BIT_CP0 -#define _SLL dsll -#define _SRL dsrl -#define _MFC0 dmfc0 -#define _MTC0 dmtc0 -#define WIRED_SHIFT 34 -#else -#define _SLL sll -#define _SRL srl -#define _MFC0 mfc0 -#define _MTC0 mtc0 -#define WIRED_SHIFT 2 -#endif .set noreorder # Noreorder is default style! -#if defined(ISA_MIPS32) - .set mips32 -#elif defined(ISA_MIPS64) - .set mips64 -#elif defined(ISA_MIPS3) - .set mips3 -#endif - -#if defined(ISA_MIPS32) -#define STORE sw /* 32 bit mode regsave instruction */ -#define LOAD lw /* 32 bit mode regload instruction */ -#define RSIZE 4 /* 32 bit mode register size */ -#define STORE_FP swc1 /* 32 bit mode fp regsave instruction */ -#define LOAD_FP lwc1 /* 32 bit mode fp regload instruction */ -#define FP_RSIZE 4 /* 32 bit mode fp register size */ -#else -#define STORE sd /* 64 bit mode regsave instruction */ -#define LOAD ld /* 64 bit mode regload instruction */ -#define RSIZE 8 /* 64 bit mode register size */ -#define STORE_FP sdc1 /* 64 bit mode fp regsave instruction */ -#define LOAD_FP ldc1 /* 64 bit mode fp regload instruction */ -#define FP_RSIZE 8 /* 64 bit mode fp register size */ -#endif /* * FREEBSD_DEVELOPERS_FIXME @@ -125,28 +79,28 @@ #endif #define SAVE_U_PCB_REG(reg, offs, base) \ - STORE reg, U_PCB_REGS + (RSIZE * offs) (base) + REG_S reg, U_PCB_REGS + (SZREG * offs) (base) #define RESTORE_U_PCB_REG(reg, offs, base) \ - LOAD reg, U_PCB_REGS + (RSIZE * offs) (base) + REG_L reg, U_PCB_REGS + (SZREG * offs) (base) #define SAVE_U_PCB_FPREG(reg, offs, base) \ - STORE_FP reg, U_PCB_FPREGS + (FP_RSIZE * offs) (base) + FP_S reg, U_PCB_FPREGS + (SZFPREG * offs) (base) #define RESTORE_U_PCB_FPREG(reg, offs, base) \ - LOAD_FP reg, U_PCB_FPREGS + (FP_RSIZE * offs) (base) + FP_L reg, U_PCB_FPREGS + (SZFPREG * offs) (base) #define SAVE_U_PCB_FPSR(reg, offs, base) \ - STORE reg, U_PCB_FPREGS + (FP_RSIZE * offs) (base) + REG_S reg, U_PCB_FPREGS + (SZFPREG * offs) (base) #define RESTORE_U_PCB_FPSR(reg, offs, base) \ - LOAD reg, U_PCB_FPREGS + (FP_RSIZE * offs) (base) + REG_L reg, U_PCB_FPREGS + (SZFPREG * offs) (base) #define SAVE_U_PCB_CONTEXT(reg, offs, base) \ - STORE reg, U_PCB_CONTEXT + (RSIZE * offs) (base) + REG_S reg, U_PCB_CONTEXT + (SZREG * offs) (base) #define RESTORE_U_PCB_CONTEXT(reg, offs, base) \ - LOAD reg, U_PCB_CONTEXT + (RSIZE * offs) (base) + REG_L reg, U_PCB_CONTEXT + (SZREG * offs) (base) #define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; @@ -172,7 +126,7 @@ LEAF(fork_trampoline) */ .set noat GET_CPU_PCPU(k1) - lw k1, PC_CURPCB(k1) + PTR_L k1, PC_CURPCB(k1) RESTORE_U_PCB_REG(t0, MULLO, k1) RESTORE_U_PCB_REG(t1, MULHI, k1) @@ -181,7 +135,7 @@ LEAF(fork_trampoline) RESTORE_U_PCB_REG(a0, PC, k1) RESTORE_U_PCB_REG(AT, AST, k1) RESTORE_U_PCB_REG(v0, V0, k1) - _MTC0 a0, COP_0_EXC_PC # set return address + MTC0 a0, COP_0_EXC_PC # set return address *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 07:51: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 AEBB1106564A; Mon, 19 Apr 2010 07:51:57 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CA908FC1E; Mon, 19 Apr 2010 07:51: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 o3J7pv8M037530; Mon, 19 Apr 2010 07:51:57 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3J7pvMa037528; Mon, 19 Apr 2010 07:51:57 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004190751.o3J7pvMa037528@svn.freebsd.org> From: Juli Mallett Date: Mon, 19 Apr 2010 07:51: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: r206836 - in head/sys: conf 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: Mon, 19 Apr 2010 07:51:57 -0000 Author: jmallett Date: Mon Apr 19 07:51:57 2010 New Revision: 206836 URL: http://svn.freebsd.org/changeset/base/206836 Log: Remove unused file. Deleted: head/sys/mips/mips/copystr.S Modified: head/sys/conf/files.mips Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Mon Apr 19 07:39:56 2010 (r206835) +++ head/sys/conf/files.mips Mon Apr 19 07:51:57 2010 (r206836) @@ -50,7 +50,6 @@ mips/mips/bus_space_generic.c standard mips/mips/busdma_machdep.c standard mips/mips/cache.c standard mips/mips/cache_mipsNN.c standard -#mips/mips/copystr.S standard mips/mips/db_disasm.c optional ddb mips/mips/db_interface.c optional ddb mips/mips/db_trace.c optional ddb From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 09:03: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 9555A1065676; Mon, 19 Apr 2010 09:03:34 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 843758FC14; Mon, 19 Apr 2010 09:03: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 o3J93YFY053272; Mon, 19 Apr 2010 09:03:34 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3J93YTR053270; Mon, 19 Apr 2010 09:03:34 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004190903.o3J93YTR053270@svn.freebsd.org> From: Juli Mallett Date: Mon, 19 Apr 2010 09:03: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: r206837 - head/sys/mips/malta 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, 19 Apr 2010 09:03:34 -0000 Author: jmallett Date: Mon Apr 19 09:03:34 2010 New Revision: 206837 URL: http://svn.freebsd.org/changeset/base/206837 Log: Fix MALTA64 build. Modified: head/sys/mips/malta/gt_pci.c Modified: head/sys/mips/malta/gt_pci.c ============================================================================== --- head/sys/mips/malta/gt_pci.c Mon Apr 19 07:51:57 2010 (r206836) +++ head/sys/mips/malta/gt_pci.c Mon Apr 19 09:03:34 2010 (r206837) @@ -109,8 +109,8 @@ struct gt_pci_softc { struct rman sc_mem_rman; struct rman sc_io_rman; struct rman sc_irq_rman; - uint32_t sc_mem; - uint32_t sc_io; + unsigned long sc_mem; + bus_space_handle_t sc_io; struct resource *sc_irq; struct intr_event *sc_eventstab[ICU_LEN]; From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 09:03: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 482B51065674; Mon, 19 Apr 2010 09:03:37 +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 369C88FC2C; Mon, 19 Apr 2010 09:03: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 o3J93boT053310; Mon, 19 Apr 2010 09:03:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3J93b5R053308; Mon, 19 Apr 2010 09:03:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004190903.o3J93b5R053308@svn.freebsd.org> From: Xin LI Date: Mon, 19 Apr 2010 09:03: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: r206838 - head/sys/cddl/compat/opensolaris/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, 19 Apr 2010 09:03:37 -0000 Author: delphij Date: Mon Apr 19 09:03:36 2010 New Revision: 206838 URL: http://svn.freebsd.org/changeset/base/206838 Log: Partially MFp4 #176265 by pjd@: - Properly initialize and destroy system_taskq. - Add a dummy implementation of taskq_create_proc(). Note: We do not currently use system_taskq in ZFS so this is mostly a no-op at this time. Proper system_taskq initialization is required by newer ZFS code. Ok'ed by: pjd MFC after: 2 weeks Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Apr 19 09:03:34 2010 (r206837) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Apr 19 09:03:36 2010 (r206838) @@ -52,9 +52,9 @@ static void system_taskq_init(void *arg) { - system_taskq = (taskq_t *)taskqueue_thread; taskq_zone = uma_zcreate("taskq_zone", sizeof(struct ostask), NULL, NULL, NULL, NULL, 0, 0); + system_taskq = taskq_create("system_taskq", mp_ncpus, 0, 0, 0, 0); } SYSINIT(system_taskq_init, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_init, NULL); @@ -62,6 +62,7 @@ static void system_taskq_fini(void *arg) { + taskq_destroy(system_taskq); uma_zdestroy(taskq_zone); } SYSUNINIT(system_taskq_fini, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_fini, NULL); @@ -72,10 +73,8 @@ taskq_create(const char *name, int nthre { taskq_t *tq; - if ((flags & TASKQ_THREADS_CPU_PCT) != 0) { - /* TODO: Calculate number od threads. */ - printf("%s: TASKQ_THREADS_CPU_PCT\n", __func__); - } + if ((flags & TASKQ_THREADS_CPU_PCT) != 0) + nthreads = MAX((mp_ncpus * nthreads) / 100, 1); tq = kmem_alloc(sizeof(*tq), KM_SLEEP); tq->tq_queue = taskqueue_create(name, M_WAITOK, taskqueue_thread_enqueue, @@ -85,6 +84,14 @@ taskq_create(const char *name, int nthre return ((taskq_t *)tq); } +taskq_t * +taskq_create_proc(const char *name, int nthreads, pri_t pri, int minalloc, + int maxalloc, proc_t *proc __unused, uint_t flags) +{ + + return (taskq_create(name, nthreads, pri, minalloc, maxalloc, flags)); +} + void taskq_destroy(taskq_t *tq) { From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 10:16: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 9CDF0106564A; Mon, 19 Apr 2010 10:16:36 +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 4E5518FC08; Mon, 19 Apr 2010 10:16:36 +0000 (UTC) Received: from [10.0.0.3] (warner-iphone.bsdimp.com [10.0.0.3]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3JA8n6T044606; Mon, 19 Apr 2010 04:08:49 -0600 (MDT) (envelope-from imp@bsdimp.com) From: Warner Losh To: Nikolay Denev In-Reply-To: <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> X-Mailer: iPhone Mail (7E18) References: <201004180115.o3I1FlLh027356@svn.freebsd.org> <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> Message-Id: <98983E26-D091-42C8-B920-8D4F917E5019@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (iPhone Mail 7E18) Date: Mon, 19 Apr 2010 04:08:46 -0600 Cc: "svn-src-stable@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , Warner Losh , "svn-src-stable-8@FreeBSD.org" Subject: Re: svn commit: r206782 - stable/8/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, 19 Apr 2010 10:16:36 -0000 Nikolay Did you do a buildworld after updating the sources before the buildkernel? Warner On Apr 19, 2010, at 12:28 AM, Nikolay Denev wrote: > On 18 Apr, 2010, at 04:15 , Warner Losh wrote: > >> Author: imp >> Date: Sun Apr 18 01:15:47 2010 >> New Revision: 206782 >> URL: http://svn.freebsd.org/changeset/base/206782 >> >> Log: >> Remap COMPAT_IA32 to COMPAT_FREEBSD32 to ease the transition of this >> option and not break 8.0 config files later in the 8.x branch. >> >> # Yes, this is a direct commit, since this is not relevant to head. >> >> Modified: >> stable/8/sys/conf/options.amd64 >> stable/8/sys/conf/options.ia64 >> >> Modified: stable/8/sys/conf/options.amd64 >> === >> === >> === >> ===================================================================== >> --- stable/8/sys/conf/options.amd64 Sun Apr 18 00:57:30 2010 >> (r206781) >> +++ stable/8/sys/conf/options.amd64 Sun Apr 18 01:15:47 2010 >> (r206782) >> @@ -11,6 +11,7 @@ MP_WATCHDOG >> # Options for emulators. These should only be used at config time, >> so >> # they are handled like options for static filesystems >> # (see src/sys/conf/options), except for broken debugging options. >> +COMPAT_IA32 = COMPAT_FREEBSD32 >> COMPAT_FREEBSD32 opt_compat.h >> #IBCS2 opt_dontuse.h >> #COMPAT_LINUX opt_dontuse.h >> >> Modified: stable/8/sys/conf/options.ia64 >> === >> === >> === >> ===================================================================== >> --- stable/8/sys/conf/options.ia64 Sun Apr 18 00:57:30 2010 >> (r206781) >> +++ stable/8/sys/conf/options.ia64 Sun Apr 18 01:15:47 2010 >> (r206782) >> @@ -9,6 +9,7 @@ LOG2_PAGE_SIZE opt_global.h >> >> UWX_TRACE_ENABLE opt_global.h >> >> +COMPAT_IA32 = COMPAT_FREEBSD32 >> COMPAT_FREEBSD32 opt_compat.h >> >> EXCEPTION_TRACING opt_xtrace.h >> > > > > Hi, > > After this change I can no longer compile a kernel : > > nas# make -j8 buildkernel WITH_CTF=1 > -------------------------------------------------------------- >>>> Kernel build for NAS started on Mon Apr 19 09:25:57 EEST 2010 > -------------------------------------------------------------- > ===> NAS > mkdir -p /usr/obj/usr/src/sys > -------------------------------------------------------------- >>>> stage 1: configuring the kernel > -------------------------------------------------------------- > cd /usr/src/sys/amd64/conf; PATH=/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:/usr/obj/usr/src/tmp/usr/ > bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin > config -d /usr/obj/usr/src/sys/NAS /usr/src/sys/amd64/conf/NAS > ../../conf/options.amd64: Duplicate option COMPAT_FREEBSD32. > *** Error code 1 > 1 error > *** Error code 2 > 1 error > > When the change is reverted everything compiles ok. > > -- > Regards, > Nikolay Denev > > > > > > > From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 11:34: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 A3194106564A; Mon, 19 Apr 2010 11:34:50 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id 806958FC0C; Mon, 19 Apr 2010 11:34:49 +0000 (UTC) Received: by ewy24 with SMTP id 24so1308936ewy.33 for ; Mon, 19 Apr 2010 04:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=l/NZis/UTbVsOzdCDwNG2TOlypjJ0y5Dcnds6klF04M=; b=IuH/NJ3QddRVRefqkd7ACy5mpDcR7fuKlRAcU02vhBn5OZTszSJVjogiVx6O5eGbQf wYLcSRamwo4RlsqlsfUjXPEfn2DKHfMBiTma5oL7D+FSzoe9MxSyrRTAjb/LZj2kyBTG N1QThTRx62B7BhqdAB3fi7AHmMxkgO3B4qAiI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=clj6/NCt9aPDTvXHKWHMFwJE0iLF5Z+mxTSTSpatgXbJ8qRCH1CJxDUm5gyeQpee82 KHanXHo+Vik9f9CqyYZZm4f2wG57zeLxDrI1UOekwfsNGrhpHpVYS2xmV+vefC87vDRC KEs8YokBacwSfV2WG4dFdKT9wtWbVDmcMUjME= Received: by 10.103.69.2 with SMTP id w2mr6298muk.18.1271676887433; Mon, 19 Apr 2010 04:34:47 -0700 (PDT) Received: from ndenevsa.sof.moneybookers.net ([195.34.111.178]) by mx.google.com with ESMTPS id y6sm27332959mug.50.2010.04.19.04.34.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Apr 2010 04:34:46 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <98983E26-D091-42C8-B920-8D4F917E5019@bsdimp.com> Date: Mon, 19 Apr 2010 14:34:44 +0300 Content-Transfer-Encoding: 7bit Message-Id: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> References: <201004180115.o3I1FlLh027356@svn.freebsd.org> <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> <98983E26-D091-42C8-B920-8D4F917E5019@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.1078) Cc: "svn-src-stable@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , Warner Losh , "svn-src-stable-8@FreeBSD.org" Subject: Re: svn commit: r206782 - stable/8/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, 19 Apr 2010 11:34:50 -0000 On Apr 19, 2010, at 1:08 PM, Warner Losh wrote: > Nikolay > > Did you do a buildworld after updating the sources before the buildkernel? > > > Warner > > Hmm, no... I tried first to build the kernel. Regards, Niki Denev From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 14:07: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 0F579106567D; Mon, 19 Apr 2010 14:07:34 +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 BC30C8FC1C; Mon, 19 Apr 2010 14:07: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 o3JE7XNK021883; Mon, 19 Apr 2010 14:07:33 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JE7XuU021881; Mon, 19 Apr 2010 14:07:33 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004191407.o3JE7XuU021881@svn.freebsd.org> From: Rui Paulo Date: Mon, 19 Apr 2010 14:07: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: r206839 - head/sys/dev/ahci 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, 19 Apr 2010 14:07:34 -0000 Author: rpaulo Date: Mon Apr 19 14:07:33 2010 New Revision: 206839 URL: http://svn.freebsd.org/changeset/base/206839 Log: Revert r206755. It causes some laptops to stop booting. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Mon Apr 19 09:03:36 2010 (r206838) +++ head/sys/dev/ahci/ahci.c Mon Apr 19 14:07:33 2010 (r206839) @@ -126,7 +126,6 @@ static struct { {0x26838086, 0x00, "Intel ESB2", 0}, {0x27c18086, 0x00, "Intel ICH7", 0}, {0x27c38086, 0x00, "Intel ICH7", 0}, - {0x27c48086, 0x00, "Intel ICH7M", 0}, {0x27c58086, 0x00, "Intel ICH7M", 0}, {0x27c68086, 0x00, "Intel ICH7M", 0}, {0x28218086, 0x00, "Intel ICH8", 0}, From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 14:15: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 7C67D1065675; Mon, 19 Apr 2010 14:15:58 +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 6BC4A8FC13; Mon, 19 Apr 2010 14:15: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 o3JEFwKB023797; Mon, 19 Apr 2010 14:15:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JEFwbM023795; Mon, 19 Apr 2010 14:15:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201004191415.o3JEFwbM023795@svn.freebsd.org> From: Michael Tuexen Date: Mon, 19 Apr 2010 14:15: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: r206840 - 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: Mon, 19 Apr 2010 14:15:58 -0000 Author: tuexen Date: Mon Apr 19 14:15:58 2010 New Revision: 206840 URL: http://svn.freebsd.org/changeset/base/206840 Log: Get delayed SACK working again. MFC after: 3 days. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Apr 19 14:07:33 2010 (r206839) +++ head/sys/netinet/sctp_indata.c Mon Apr 19 14:15:58 2010 (r206840) @@ -2123,6 +2123,10 @@ failed_pdapi_express_del: } } finish_express_del: + if (tsn == (asoc->cumulative_tsn + 1)) { + /* Update cum-ack */ + asoc->cumulative_tsn = tsn; + } if (last_chunk) { *m = NULL; } From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 14:23: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 63B361065670; Mon, 19 Apr 2010 14:23:15 +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 526818FC1A; Mon, 19 Apr 2010 14:23: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 o3JENFNl025446; Mon, 19 Apr 2010 14:23:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JENFa7025444; Mon, 19 Apr 2010 14:23:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004191423.o3JENFa7025444@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 19 Apr 2010 14:23:15 +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: r206841 - stable/8/sbin/hastd 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, 19 Apr 2010 14:23:15 -0000 Author: pjd Date: Mon Apr 19 14:23:15 2010 New Revision: 206841 URL: http://svn.freebsd.org/changeset/base/206841 Log: MFC r204352: Fixed static linkage. Modified: stable/8/sbin/hastd/Makefile Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/Makefile ============================================================================== --- stable/8/sbin/hastd/Makefile Mon Apr 19 14:15:58 2010 (r206840) +++ stable/8/sbin/hastd/Makefile Mon Apr 19 14:23:15 2010 (r206841) @@ -27,8 +27,9 @@ CFLAGS+=-DINET6 # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT -DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lcrypto -lgeom -ll -lpthread -lutil +DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} \ + ${LIBPTHREAD} ${LIBUTIL} +LDADD= -lcrypto -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil YFLAGS+=-v From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 14:34: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 B6505106564A; Mon, 19 Apr 2010 14:34:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A54CA8FC29; Mon, 19 Apr 2010 14:34: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 o3JEYioR027974; Mon, 19 Apr 2010 14:34:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JEYih5027972; Mon, 19 Apr 2010 14:34:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201004191434.o3JEYih5027972@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 19 Apr 2010 14:34: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: r206842 - head/contrib/top 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, 19 Apr 2010 14:34:44 -0000 Author: nwhitehorn Date: Mon Apr 19 14:34:44 2010 New Revision: 206842 URL: http://svn.freebsd.org/changeset/base/206842 Log: Fix brokenness in top on big-endian 32-bit systems introduced when changing format_k2 to take a long long. Because itoa is defined as a K&R C function, without prototyping its arguments, format_k2 passed a 64-bit value, but itoa() received only the first word, showing '0' in all memory fields. Modified: head/contrib/top/utils.c Modified: head/contrib/top/utils.c ============================================================================== --- head/contrib/top/utils.c Mon Apr 19 14:23:15 2010 (r206841) +++ head/contrib/top/utils.c Mon Apr 19 14:34:44 2010 (r206842) @@ -499,7 +499,7 @@ unsigned long long amt; } } - p = strecpy(p, itoa(amt)); + p = strecpy(p, itoa((int)amt)); *p++ = tag; *p = '\0'; From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 15:11: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 29A30106566B; Mon, 19 Apr 2010 15:11:46 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 181E98FC14; Mon, 19 Apr 2010 15:11: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 o3JFBjHb036353; Mon, 19 Apr 2010 15:11:45 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JFBjLj036350; Mon, 19 Apr 2010 15:11:45 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201004191511.o3JFBjLj036350@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 19 Apr 2010 15:11: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: r206843 - head/sbin/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: Mon, 19 Apr 2010 15:11:46 -0000 Author: luigi Date: Mon Apr 19 15:11:45 2010 New Revision: 206843 URL: http://svn.freebsd.org/changeset/base/206843 Log: Slightly different handling of printf/snprintf for unaligned uint64_t, which should improve readability, and also to ease the port to platforms that do not support %llu MFC after: 3 days Modified: head/sbin/ipfw/dummynet.c head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Mon Apr 19 14:34:44 2010 (r206842) +++ head/sbin/ipfw/dummynet.c Mon Apr 19 15:11:45 2010 (r206843) @@ -203,9 +203,9 @@ list_flow(struct dn_flow *ni) inet_ntop(AF_INET6, &(id->dst_ip6), buff, sizeof(buff)), id->dst_port); } - printf("%4llu %8llu %2u %4u %3u\n", - align_uint64(&ni->tot_pkts), - align_uint64(&ni->tot_bytes), + pr_u64(&ni->tot_pkts, 4); + pr_u64(&ni->tot_bytes, 8); + printf("%2u %4u %3u\n", ni->length, ni->len_bytes, ni->drops); } @@ -290,8 +290,8 @@ static void list_pipes(struct dn_id *oid, struct dn_id *end) { char buf[160]; /* pending buffer */ - buf[0] = '\0'; + buf[0] = '\0'; for (; oid != end; oid = O_NEXT(oid, oid->len)) { if (oid->len < sizeof(*oid)) errx(1, "invalid oid len %d\n", oid->len); Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Apr 19 14:34:44 2010 (r206842) +++ head/sbin/ipfw/ipfw2.c Mon Apr 19 15:11:45 2010 (r206843) @@ -314,22 +314,27 @@ static struct _s_x rule_options[] = { { NULL, 0 } /* terminator */ }; -/* - * The following is used to generate a printable argument for - * 64-bit numbers, irrespective of platform alignment and bit size. - * Because all the printf in this program use %llu as a format, - * we just return an unsigned long long, which is larger than - * we need in certain cases, but saves the hassle of using - * PRIu64 as a format specifier. - * We don't care about inlining, this is not performance critical code. +/* + * Helper routine to print a possibly unaligned uint64_t on + * various platform. If width > 0, print the value with + * the desired width, followed by a space; + * otherwise, return the required width. */ -unsigned long long -align_uint64(const uint64_t *pll) +int +pr_u64(uint64_t *pd, int width) { - uint64_t ret; +#ifdef TCC +#define U64_FMT "I64" +#else +#define U64_FMT "llu" +#endif + uint64_t d; - bcopy (pll, &ret, sizeof(ret)); - return ret; + bcopy (pd, &d, sizeof(d)); + return (width > 0) ? + printf("%*" U64_FMT " ", width, d) : + snprintf(NULL, 0, "%" U64_FMT, d) ; +#undef U64_FMT } void * @@ -973,9 +978,10 @@ show_ipfw(struct ip_fw *rule, int pcwidt } printf("%05u ", rule->rulenum); - if (pcwidth>0 || bcwidth>0) - printf("%*llu %*llu ", pcwidth, align_uint64(&rule->pcnt), - bcwidth, align_uint64(&rule->bcnt)); + if (pcwidth > 0 || bcwidth > 0) { + pr_u64(&rule->pcnt, pcwidth); + pr_u64(&rule->bcnt, bcwidth); + } if (co.do_time == 2) printf("%10u ", rule->timestamp); @@ -1577,10 +1583,12 @@ show_dyn_ipfw(ipfw_dyn_rule *d, int pcwi } bcopy(&d->rule, &rulenum, sizeof(rulenum)); printf("%05d", rulenum); - if (pcwidth>0 || bcwidth>0) - printf(" %*llu %*llu (%ds)", pcwidth, - align_uint64(&d->pcnt), bcwidth, - align_uint64(&d->bcnt), d->expire); + if (pcwidth > 0 || bcwidth > 0) { + printf(" "); + pr_u64(&d->pcnt, pcwidth); + pr_u64(&d->bcnt, bcwidth); + printf("(%ds)", d->expire); + } switch (d->dyn_type) { case O_LIMIT_PARENT: printf(" PARENT %d", d->count); @@ -1645,9 +1653,9 @@ ipfw_sets_handler(char *av[]) free(data); nalloc = nalloc * 2 + 200; nbytes = nalloc; - data = safe_calloc(1, nbytes); - if (do_cmd(IP_FW_GET, data, (uintptr_t)&nbytes) < 0) - err(EX_OSERR, "getsockopt(IP_FW_GET)"); + data = safe_calloc(1, nbytes); + if (do_cmd(IP_FW_GET, data, (uintptr_t)&nbytes) < 0) + err(EX_OSERR, "getsockopt(IP_FW_GET)"); } bcopy(&((struct ip_fw *)data)->next_rule, @@ -1837,14 +1845,12 @@ ipfw_list(int ac, char *av[], int show_c continue; /* packet counter */ - width = snprintf(NULL, 0, "%llu", - align_uint64(&r->pcnt)); + width = pr_u64(&r->pcnt, 0); if (width > pcwidth) pcwidth = width; /* byte counter */ - width = snprintf(NULL, 0, "%llu", - align_uint64(&r->bcnt)); + width = pr_u64(&r->bcnt, 0); if (width > bcwidth) bcwidth = width; } @@ -1858,13 +1864,11 @@ ipfw_list(int ac, char *av[], int show_c if (set != co.use_set - 1) continue; } - width = snprintf(NULL, 0, "%llu", - align_uint64(&d->pcnt)); + width = pr_u64(&d->pcnt, 0); if (width > pcwidth) pcwidth = width; - width = snprintf(NULL, 0, "%llu", - align_uint64(&d->bcnt)); + width = pr_u64(&d->bcnt, 0); if (width > bcwidth) bcwidth = width; } Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Mon Apr 19 14:34:44 2010 (r206842) +++ head/sbin/ipfw/ipfw2.h Mon Apr 19 15:11:45 2010 (r206843) @@ -207,7 +207,7 @@ enum tokens { #define NEED(_p, msg) {if (!_p) errx(EX_USAGE, msg);} #define NEED1(msg) {if (!(*av)) errx(EX_USAGE, msg);} -unsigned long long align_uint64(const uint64_t *pll); +int pr_u64(uint64_t *pd, int width); /* memory allocation support */ void *safe_calloc(size_t number, size_t size); From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 15:15: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 60942106566C; Mon, 19 Apr 2010 15:15:36 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5006D8FC23; Mon, 19 Apr 2010 15:15: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 o3JFFaNQ037278; Mon, 19 Apr 2010 15:15:36 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JFFapS037276; Mon, 19 Apr 2010 15:15:36 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201004191515.o3JFFapS037276@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 19 Apr 2010 15:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206844 - 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: Mon, 19 Apr 2010 15:15:36 -0000 Author: ken Date: Mon Apr 19 15:15:36 2010 New Revision: 206844 URL: http://svn.freebsd.org/changeset/base/206844 Log: Don't clear other flags (e.g. CSUM_TCP) when setting CSUM_TSO. This was causing TSO to break for the Xen netfront driver. Reviewed by: gibbs, rwatson MFC after: 7 days Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Apr 19 15:11:45 2010 (r206843) +++ head/sys/netinet/tcp_output.c Mon Apr 19 15:15:36 2010 (r206844) @@ -1048,7 +1048,7 @@ send: * XXX: Fixme: This is currently not the case for IPv6. */ if (tso) { - m->m_pkthdr.csum_flags = CSUM_TSO; + m->m_pkthdr.csum_flags |= CSUM_TSO; m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen; } From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 16:01: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 9C54C106567D; Mon, 19 Apr 2010 16:01:56 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195]) by mx1.freebsd.org (Postfix) with ESMTP id 5AF6F8FC19; Mon, 19 Apr 2010 16:01:56 +0000 (UTC) Received: from [10.170.20.44] (nat-170-142-177-44.tn.gov [170.142.177.44]) (authenticated bits=0) by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id o3JG1rkR003589 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Apr 2010 12:01:54 -0400 (EDT) (envelope-from rnoland@FreeBSD.org) Message-ID: <4BCC7E64.4040200@FreeBSD.org> Date: Mon, 19 Apr 2010 11:01:40 -0500 From: Robert Noland Organization: FreeBSD User-Agent: Thunderbird 2.0.0.19 (X11/20090218) MIME-Version: 1.0 To: Luigi Rizzo References: <201004191511.o3JFBjLj036350@svn.freebsd.org> In-Reply-To: <201004191511.o3JFBjLj036350@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.0 required=5.0 tests=AWL, BAYES_00, FH_DATE_PAST_20XX, RDNS_DYNAMIC,SPF_SOFTFAIL autolearn=no version=3.2.5 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206843 - head/sbin/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: Mon, 19 Apr 2010 16:01:56 -0000 Luigi Rizzo wrote: > Author: luigi > Date: Mon Apr 19 15:11:45 2010 > New Revision: 206843 > URL: http://svn.freebsd.org/changeset/base/206843 > > Log: > Slightly different handling of printf/snprintf for unaligned uint64_t, > which should improve readability, and also to ease the port to > platforms that do not support %llu > > MFC after: 3 days > > Modified: > head/sbin/ipfw/dummynet.c > head/sbin/ipfw/ipfw2.c > head/sbin/ipfw/ipfw2.h > > Modified: head/sbin/ipfw/dummynet.c > ============================================================================== > --- head/sbin/ipfw/dummynet.c Mon Apr 19 14:34:44 2010 (r206842) > +++ head/sbin/ipfw/dummynet.c Mon Apr 19 15:11:45 2010 (r206843) > @@ -203,9 +203,9 @@ list_flow(struct dn_flow *ni) > inet_ntop(AF_INET6, &(id->dst_ip6), buff, sizeof(buff)), > id->dst_port); > } > - printf("%4llu %8llu %2u %4u %3u\n", > - align_uint64(&ni->tot_pkts), > - align_uint64(&ni->tot_bytes), > + pr_u64(&ni->tot_pkts, 4); > + pr_u64(&ni->tot_bytes, 8); > + printf("%2u %4u %3u\n", > ni->length, ni->len_bytes, ni->drops); > } > > @@ -290,8 +290,8 @@ static void > list_pipes(struct dn_id *oid, struct dn_id *end) > { > char buf[160]; /* pending buffer */ > - buf[0] = '\0'; > > + buf[0] = '\0'; > for (; oid != end; oid = O_NEXT(oid, oid->len)) { > if (oid->len < sizeof(*oid)) > errx(1, "invalid oid len %d\n", oid->len); > > Modified: head/sbin/ipfw/ipfw2.c > ============================================================================== > --- head/sbin/ipfw/ipfw2.c Mon Apr 19 14:34:44 2010 (r206842) > +++ head/sbin/ipfw/ipfw2.c Mon Apr 19 15:11:45 2010 (r206843) > @@ -314,22 +314,27 @@ static struct _s_x rule_options[] = { > { NULL, 0 } /* terminator */ > }; > > -/* > - * The following is used to generate a printable argument for > - * 64-bit numbers, irrespective of platform alignment and bit size. > - * Because all the printf in this program use %llu as a format, > - * we just return an unsigned long long, which is larger than > - * we need in certain cases, but saves the hassle of using > - * PRIu64 as a format specifier. > - * We don't care about inlining, this is not performance critical code. > +/* > + * Helper routine to print a possibly unaligned uint64_t on > + * various platform. If width > 0, print the value with > + * the desired width, followed by a space; > + * otherwise, return the required width. > */ > -unsigned long long > -align_uint64(const uint64_t *pll) > +int > +pr_u64(uint64_t *pd, int width) > { > - uint64_t ret; > +#ifdef TCC > +#define U64_FMT "I64" > +#else > +#define U64_FMT "llu" This is broken on amd64. It either needs casting or the following patch... beastie% svn diff Index: sbin/ipfw/ipfw2.c =================================================================== --- sbin/ipfw/ipfw2.c (revision 206844) +++ sbin/ipfw/ipfw2.c (working copy) @@ -326,7 +326,7 @@ #ifdef TCC #define U64_FMT "I64" #else -#define U64_FMT "llu" +#define U64_FMT "ju" #endif uint64_t d; robert. > +#endif > + uint64_t d; > > - bcopy (pll, &ret, sizeof(ret)); > - return ret; > + bcopy (pd, &d, sizeof(d)); > + return (width > 0) ? > + printf("%*" U64_FMT " ", width, d) : > + snprintf(NULL, 0, "%" U64_FMT, d) ; > +#undef U64_FMT > } > > void * > @@ -973,9 +978,10 @@ show_ipfw(struct ip_fw *rule, int pcwidt > } > printf("%05u ", rule->rulenum); > > - if (pcwidth>0 || bcwidth>0) > - printf("%*llu %*llu ", pcwidth, align_uint64(&rule->pcnt), > - bcwidth, align_uint64(&rule->bcnt)); > + if (pcwidth > 0 || bcwidth > 0) { > + pr_u64(&rule->pcnt, pcwidth); > + pr_u64(&rule->bcnt, bcwidth); > + } > > if (co.do_time == 2) > printf("%10u ", rule->timestamp); > @@ -1577,10 +1583,12 @@ show_dyn_ipfw(ipfw_dyn_rule *d, int pcwi > } > bcopy(&d->rule, &rulenum, sizeof(rulenum)); > printf("%05d", rulenum); > - if (pcwidth>0 || bcwidth>0) > - printf(" %*llu %*llu (%ds)", pcwidth, > - align_uint64(&d->pcnt), bcwidth, > - align_uint64(&d->bcnt), d->expire); > + if (pcwidth > 0 || bcwidth > 0) { > + printf(" "); > + pr_u64(&d->pcnt, pcwidth); > + pr_u64(&d->bcnt, bcwidth); > + printf("(%ds)", d->expire); > + } > switch (d->dyn_type) { > case O_LIMIT_PARENT: > printf(" PARENT %d", d->count); > @@ -1645,9 +1653,9 @@ ipfw_sets_handler(char *av[]) > free(data); > nalloc = nalloc * 2 + 200; > nbytes = nalloc; > - data = safe_calloc(1, nbytes); > - if (do_cmd(IP_FW_GET, data, (uintptr_t)&nbytes) < 0) > - err(EX_OSERR, "getsockopt(IP_FW_GET)"); > + data = safe_calloc(1, nbytes); > + if (do_cmd(IP_FW_GET, data, (uintptr_t)&nbytes) < 0) > + err(EX_OSERR, "getsockopt(IP_FW_GET)"); > } > > bcopy(&((struct ip_fw *)data)->next_rule, > @@ -1837,14 +1845,12 @@ ipfw_list(int ac, char *av[], int show_c > continue; > > /* packet counter */ > - width = snprintf(NULL, 0, "%llu", > - align_uint64(&r->pcnt)); > + width = pr_u64(&r->pcnt, 0); > if (width > pcwidth) > pcwidth = width; > > /* byte counter */ > - width = snprintf(NULL, 0, "%llu", > - align_uint64(&r->bcnt)); > + width = pr_u64(&r->bcnt, 0); > if (width > bcwidth) > bcwidth = width; > } > @@ -1858,13 +1864,11 @@ ipfw_list(int ac, char *av[], int show_c > if (set != co.use_set - 1) > continue; > } > - width = snprintf(NULL, 0, "%llu", > - align_uint64(&d->pcnt)); > + width = pr_u64(&d->pcnt, 0); > if (width > pcwidth) > pcwidth = width; > > - width = snprintf(NULL, 0, "%llu", > - align_uint64(&d->bcnt)); > + width = pr_u64(&d->bcnt, 0); > if (width > bcwidth) > bcwidth = width; > } > > Modified: head/sbin/ipfw/ipfw2.h > ============================================================================== > --- head/sbin/ipfw/ipfw2.h Mon Apr 19 14:34:44 2010 (r206842) > +++ head/sbin/ipfw/ipfw2.h Mon Apr 19 15:11:45 2010 (r206843) > @@ -207,7 +207,7 @@ enum tokens { > #define NEED(_p, msg) {if (!_p) errx(EX_USAGE, msg);} > #define NEED1(msg) {if (!(*av)) errx(EX_USAGE, msg);} > > -unsigned long long align_uint64(const uint64_t *pll); > +int pr_u64(uint64_t *pd, int width); > > /* memory allocation support */ > void *safe_calloc(size_t number, size_t size); From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 16:17: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 F1E541065670; Mon, 19 Apr 2010 16:17:30 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFC538FC08; Mon, 19 Apr 2010 16:17: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 o3JGHUVo050908; Mon, 19 Apr 2010 16:17:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JGHUbx050899; Mon, 19 Apr 2010 16:17:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201004191617.o3JGHUbx050899@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 19 Apr 2010 16:17: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: r206845 - in head/sys/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: Mon, 19 Apr 2010 16:17:31 -0000 Author: luigi Date: Mon Apr 19 16:17:30 2010 New Revision: 206845 URL: http://svn.freebsd.org/changeset/base/206845 Log: whitespace fixes (trailing whitespace, bad indentation after a merge, etc.) Modified: head/sys/netinet/ip_dummynet.h head/sys/netinet/ipfw/dn_sched.h head/sys/netinet/ipfw/dn_sched_rr.c head/sys/netinet/ipfw/dn_sched_wf2q.c head/sys/netinet/ipfw/ip_dn_private.h head/sys/netinet/ipfw/ip_dummynet.c head/sys/netinet/ipfw/ip_fw_pfil.c head/sys/netinet/ipfw/ip_fw_private.h Modified: head/sys/netinet/ip_dummynet.h ============================================================================== --- head/sys/netinet/ip_dummynet.h Mon Apr 19 15:15:36 2010 (r206844) +++ head/sys/netinet/ip_dummynet.h Mon Apr 19 16:17:30 2010 (r206845) @@ -87,14 +87,14 @@ enum { DN_SYSCTL_SET, DN_LAST, -} ; +}; enum { /* subtype for schedulers, flowset and the like */ DN_SCHED_UNKNOWN = 0, DN_SCHED_FIFO = 1, DN_SCHED_WF2QP = 2, /* others are in individual modules */ -} ; +}; enum { /* user flags */ DN_HAVE_MASK = 0x0001, /* fs or sched has a mask */ @@ -113,16 +113,16 @@ enum { /* user flags */ struct dn_link { struct dn_id oid; - /* + /* * Userland sets bw and delay in bits/s and milliseconds. * The kernel converts this back and forth to bits/tick and ticks. * XXX what about burst ? - */ + */ int32_t link_nr; int bandwidth; /* bit/s or bits/tick. */ int delay; /* ms and ticks */ uint64_t burst; /* scaled. bits*Hz XXX */ -} ; +}; /* * A flowset, which is a template for flows. Contains parameters @@ -132,13 +132,13 @@ struct dn_link { */ struct dn_fs { struct dn_id oid; - uint32_t fs_nr; /* the flowset number */ - uint32_t flags; /* userland flags */ - int qsize ; /* queue size in slots or bytes */ - int32_t plr; /* PLR, pkt loss rate (2^31-1 means 100%) */ + uint32_t fs_nr; /* the flowset number */ + uint32_t flags; /* userland flags */ + int qsize; /* queue size in slots or bytes */ + int32_t plr; /* PLR, pkt loss rate (2^31-1 means 100%) */ uint32_t buckets; /* buckets used for the queue hash table */ - struct ipfw_flow_id flow_mask ; + struct ipfw_flow_id flow_mask; uint32_t sched_nr; /* the scheduler we attach to */ /* generic scheduler parameters. Leave them at -1 if unset. * Now we use 0: weight, 1: lmax, 2: priority @@ -149,14 +149,14 @@ struct dn_fs { * weight and probabilities are in the range 0..1 represented * in fixed point arithmetic with SCALE_RED decimal bits. */ -#define SCALE_RED 16 -#define SCALE(x) ( (x) << SCALE_RED ) -#define SCALE_VAL(x) ( (x) >> SCALE_RED ) -#define SCALE_MUL(x,y) ( ( (x) * (y) ) >> SCALE_RED ) - int w_q ; /* queue weight (scaled) */ - int max_th ; /* maximum threshold for queue (scaled) */ - int min_th ; /* minimum threshold for queue (scaled) */ - int max_p ; /* maximum value for p_b (scaled) */ +#define SCALE_RED 16 +#define SCALE(x) ( (x) << SCALE_RED ) +#define SCALE_VAL(x) ( (x) >> SCALE_RED ) +#define SCALE_MUL(x,y) ( ( (x) * (y) ) >> SCALE_RED ) + int w_q ; /* queue weight (scaled) */ + int max_th ; /* maximum threshold for queue (scaled) */ + int min_th ; /* minimum threshold for queue (scaled) */ + int max_p ; /* maximum value for p_b (scaled) */ }; @@ -177,10 +177,10 @@ struct dn_flow { }; - /* +/* * Scheduler template, mostly indicating the name, number, * sched_mask and buckets. - */ + */ struct dn_sch { struct dn_id oid; uint32_t sched_nr; /* N, scheduler number */ @@ -199,14 +199,14 @@ struct dn_sch { #define ED_MAX_SAMPLES_NO 1024 struct dn_profile { struct dn_id oid; - /* fields to simulate a delay profile */ + /* fields to simulate a delay profile */ #define ED_MAX_NAME_LEN 32 - char name[ED_MAX_NAME_LEN]; - int link_nr; - int loss_level; - int bandwidth; // XXX use link bandwidth? - int samples_no; /* actual length of samples[] */ - int samples[ED_MAX_SAMPLES_NO]; /* may be shorter */ + char name[ED_MAX_NAME_LEN]; + int link_nr; + int loss_level; + int bandwidth; // XXX use link bandwidth? + int samples_no; /* actual len of samples[] */ + int samples[ED_MAX_SAMPLES_NO]; /* may be shorter */ }; Modified: head/sys/netinet/ipfw/dn_sched.h ============================================================================== --- head/sys/netinet/ipfw/dn_sched.h Mon Apr 19 15:15:36 2010 (r206844) +++ head/sys/netinet/ipfw/dn_sched.h Mon Apr 19 16:17:30 2010 (r206845) @@ -140,9 +140,9 @@ struct dn_alg { /* MSVC does not support initializers so we need this ugly macro */ #ifdef _WIN32 -#define _SI(fld) +#define _SI(fld) #else -#define _SI(fld) fld +#define _SI(fld) fld #endif /* Modified: head/sys/netinet/ipfw/dn_sched_rr.c ============================================================================== --- head/sys/netinet/ipfw/dn_sched_rr.c Mon Apr 19 15:15:36 2010 (r206844) +++ head/sys/netinet/ipfw/dn_sched_rr.c Mon Apr 19 16:17:30 2010 (r206845) @@ -94,7 +94,7 @@ rr_remove_head(struct rr_si *si) if (si->head == NULL) return; /* empty queue */ si->head->status = 0; - + if (si->head == si->tail) { si->head = si->tail = NULL; return; @@ -141,7 +141,7 @@ next_pointer(struct rr_si *si) si->tail = si->tail->qnext; } -static int +static int rr_enqueue(struct dn_sch_inst *_si, struct dn_queue *q, struct mbuf *m) { struct rr_si *si; @@ -154,7 +154,7 @@ rr_enqueue(struct dn_sch_inst *_si, stru return 0; } - /* If reach this point, queue q was idle */ + /* If reach this point, queue q was idle */ si = (struct rr_si *)(_si + 1); rrq = (struct rr_queue *)q; Modified: head/sys/netinet/ipfw/dn_sched_wf2q.c ============================================================================== --- head/sys/netinet/ipfw/dn_sched_wf2q.c Mon Apr 19 15:15:36 2010 (r206844) +++ head/sys/netinet/ipfw/dn_sched_wf2q.c Mon Apr 19 16:17:30 2010 (r206845) @@ -125,7 +125,7 @@ idle_check(struct wf2qp_si *si, int n, i } } -static int +static int wf2qp_enqueue(struct dn_sch_inst *_si, struct dn_queue *q, struct mbuf *m) { struct dn_fsk *fs = q->fs; @@ -140,7 +140,7 @@ wf2qp_enqueue(struct dn_sch_inst *_si, s return 0; } - /* If reach this point, queue q was idle */ + /* If reach this point, queue q was idle */ alg_fq = (struct wf2qp_queue *)q; if (DN_KEY_LT(alg_fq->F, alg_fq->S)) { @@ -318,7 +318,7 @@ wf2qp_free_queue(struct dn_queue *q) { struct wf2qp_queue *alg_fq = (struct wf2qp_queue *)q; struct wf2qp_si *si = (struct wf2qp_si *)(q->_si + 1); - + if (alg_fq->S >= alg_fq->F + 1) return 0; /* nothing to do, not in any heap */ si->wsum -= q->fs->fs.par[0]; @@ -361,7 +361,7 @@ static struct dn_alg wf2qp_desc = { _SI( .destroy = ) NULL, _SI( .new_sched = ) wf2qp_new_sched, _SI( .free_sched = ) wf2qp_free_sched, - + _SI( .new_fsk = ) wf2qp_new_fsk, _SI( .free_fsk = ) NULL, Modified: head/sys/netinet/ipfw/ip_dn_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_dn_private.h Mon Apr 19 15:15:36 2010 (r206844) +++ head/sys/netinet/ipfw/ip_dn_private.h Mon Apr 19 16:17:30 2010 (r206845) @@ -149,7 +149,7 @@ struct dn_parms { int drain_sch; uint32_t expire; uint32_t expire_cycle; /* tick count */ - + int init_done; /* if the upper half is busy doing something long, Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Mon Apr 19 15:15:36 2010 (r206844) +++ head/sys/netinet/ipfw/ip_dummynet.c Mon Apr 19 16:17:30 2010 (r206845) @@ -1547,28 +1547,28 @@ config_profile(struct dn_profile *pf, st /* XXX other sanity checks */ DN_BH_WLOCK(); for (; i < 2*DN_MAX_ID; i += DN_MAX_ID) { - s = locate_scheduler(i); + s = locate_scheduler(i); - if (s == NULL) { + if (s == NULL) { err = EINVAL; break; - } - dn_cfg.id++; - /* - * If we had a profile and the new one does not fit, - * or it is deleted, then we need to free memory. - */ - if (s->profile && (pf->samples_no == 0 || - s->profile->oid.len < pf->oid.len)) { - free(s->profile, M_DUMMYNET); - s->profile = NULL; - } + } + dn_cfg.id++; + /* + * If we had a profile and the new one does not fit, + * or it is deleted, then we need to free memory. + */ + if (s->profile && (pf->samples_no == 0 || + s->profile->oid.len < pf->oid.len)) { + free(s->profile, M_DUMMYNET); + s->profile = NULL; + } if (pf->samples_no == 0) continue; - /* + /* * new profile, possibly allocate memory - * and copy data. - */ + * and copy data. + */ if (s->profile == NULL) s->profile = malloc(pf->oid.len, M_DUMMYNET, M_NOWAIT | M_ZERO); @@ -1642,7 +1642,8 @@ do_config(void *p, int l) default: D("cmd %d not implemented", o->type); break; -#ifdef EMULATE_SYSCTL + +#ifdef EMULATE_SYSCTL /* sysctl emulation. * if we recognize the command, jump to the correct * handler and return @@ -1651,6 +1652,7 @@ do_config(void *p, int l) err = kesysctl_emu_set(p, l); return err; #endif + case DN_CMD_CONFIG: /* simply a header */ break; Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Mon Apr 19 15:15:36 2010 (r206844) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Mon Apr 19 16:17:30 2010 (r206845) @@ -147,8 +147,8 @@ again: switch (ipfw) { case IP_FW_PASS: /* next_hop may be set by ipfw_chk */ - if (args.next_hop == NULL) - break; /* pass */ + if (args.next_hop == NULL) + break; /* pass */ #ifndef IPFIREWALL_FORWARD ret = EACCES; #else @@ -347,14 +347,14 @@ ipfw_attach_hooks(int arg) if (arg == 0) /* detach */ ipfw_hook(0, AF_INET); - else if (V_fw_enable && ipfw_hook(1, AF_INET) != 0) { + else if (V_fw_enable && ipfw_hook(1, AF_INET) != 0) { error = ENOENT; /* see ip_fw_pfil.c::ipfw_hook() */ printf("ipfw_hook() error\n"); } #ifdef INET6 if (arg == 0) /* detach */ ipfw_hook(0, AF_INET6); - else if (V_fw6_enable && ipfw_hook(1, AF_INET6) != 0) { + else if (V_fw6_enable && ipfw_hook(1, AF_INET6) != 0) { error = ENOENT; printf("ipfw6_hook() error\n"); } Modified: head/sys/netinet/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_fw_private.h Mon Apr 19 15:15:36 2010 (r206844) +++ head/sys/netinet/ipfw/ip_fw_private.h Mon Apr 19 16:17:30 2010 (r206845) @@ -214,7 +214,7 @@ struct ip_fw_chain { struct ip_fw *default_rule; int n_rules; /* number of static rules */ int static_len; /* total len of static rules */ - struct ip_fw **map; /* array of rule ptrs to ease lookup */ + struct ip_fw **map; /* array of rule ptrs to ease lookup */ LIST_HEAD(nat_list, cfg_nat) nat; /* list of nat entries */ struct radix_node_head *tables[IPFW_TABLES_MAX]; #if defined( __linux__ ) || defined( _WIN32 ) From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 16:35: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 591DF1065672; Mon, 19 Apr 2010 16:35:48 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 481FD8FC1D; Mon, 19 Apr 2010 16:35: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 o3JGZmU9055007; Mon, 19 Apr 2010 16:35:48 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JGZmU4055005; Mon, 19 Apr 2010 16:35:48 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201004191635.o3JGZmU4055005@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 19 Apr 2010 16:35: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: r206846 - head/sbin/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: Mon, 19 Apr 2010 16:35:48 -0000 Author: luigi Date: Mon Apr 19 16:35:47 2010 New Revision: 206846 URL: http://svn.freebsd.org/changeset/base/206846 Log: fix 64-bit build Reported by: Robert Noland Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Apr 19 16:17:30 2010 (r206845) +++ head/sbin/ipfw/ipfw2.c Mon Apr 19 16:35:47 2010 (r206846) @@ -328,9 +328,11 @@ pr_u64(uint64_t *pd, int width) #else #define U64_FMT "llu" #endif - uint64_t d; + uint64_t u; + unsigned long long d; - bcopy (pd, &d, sizeof(d)); + bcopy (pd, &u, sizeof(u)); + d = u; return (width > 0) ? printf("%*" U64_FMT " ", width, d) : snprintf(NULL, 0, "%" U64_FMT, d) ; From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 16:36: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 BD8AF1065676; Mon, 19 Apr 2010 16:36:59 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 7B4598FC28; Mon, 19 Apr 2010 16:36:59 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 671F073098; Mon, 19 Apr 2010 18:47:32 +0200 (CEST) Date: Mon, 19 Apr 2010 18:47:32 +0200 From: Luigi Rizzo To: Robert Noland Message-ID: <20100419164732.GA51318@onelab2.iet.unipi.it> References: <201004191511.o3JFBjLj036350@svn.freebsd.org> <4BCC7E64.4040200@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BCC7E64.4040200@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r206843 - head/sbin/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: Mon, 19 Apr 2010 16:36:59 -0000 On Mon, Apr 19, 2010 at 11:01:40AM -0500, Robert Noland wrote: ... > >+#ifdef TCC > >+#define U64_FMT "I64" > >+#else > >+#define U64_FMT "llu" > > This is broken on amd64. It either needs casting or the following patch... thanks, i prefer passing through an unsigned long long as in the previous version because %ju seems less portable than %llu cheers luigi From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 16:59: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 8F8831065673; Mon, 19 Apr 2010 16:59:02 +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 7E5EA8FC15; Mon, 19 Apr 2010 16:59: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 o3JGx28H060144; Mon, 19 Apr 2010 16:59:02 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JGx217060141; Mon, 19 Apr 2010 16:59:02 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201004191659.o3JGx217060141@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Apr 2010 16:59:02 +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: r206847 - 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: Mon, 19 Apr 2010 16:59:02 -0000 Author: emaste Date: Mon Apr 19 16:59:01 2010 New Revision: 206847 URL: http://svn.freebsd.org/changeset/base/206847 Log: Welcome Ryan Stone (rstone@) as a new src committer. I will be his mentor, with Joseph Koshy as a co-mentor. Ryan has some hwpmc work in progress, and will also continue with general kernel fixes in various areas. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Mon Apr 19 16:35:47 2010 (r206846) +++ svnadmin/conf/access Mon Apr 19 16:59:01 2010 (r206847) @@ -189,6 +189,7 @@ rodrigc rpaulo rrs rse +rstone ru rwatson bb+lists.freebsd.cvs-committers@cyrus.watson.org sam Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Apr 19 16:35:47 2010 (r206846) +++ svnadmin/conf/mentors Mon Apr 19 16:59:01 2010 (r206847) @@ -20,6 +20,7 @@ gabor delphij jinmei gnn nork imp rdivacky ed +rstone emaste Co-mentor: jkoshy sbruno scottl snb dwmalone sson gnn From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 17:16: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 A8816106564A; Mon, 19 Apr 2010 17:16:23 +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 972068FC1A; Mon, 19 Apr 2010 17:16: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 o3JHGNon064023; Mon, 19 Apr 2010 17:16:23 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JHGN33064021; Mon, 19 Apr 2010 17:16:23 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004191716.o3JHGN33064021@svn.freebsd.org> From: Rui Paulo Date: Mon, 19 Apr 2010 17:16: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: r206848 - head/tools/tools/ath/common 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, 19 Apr 2010 17:16:23 -0000 Author: rpaulo Date: Mon Apr 19 17:16:23 2010 New Revision: 206848 URL: http://svn.freebsd.org/changeset/base/206848 Log: Dump the AR_PHY_TURBO register on the AR5416. This register holds 11n configurations. Sponsored by: iXsystems, inc. Modified: head/tools/tools/ath/common/dumpregs_5416.c Modified: head/tools/tools/ath/common/dumpregs_5416.c ============================================================================== --- head/tools/tools/ath/common/dumpregs_5416.c Mon Apr 19 16:59:01 2010 (r206847) +++ head/tools/tools/ath/common/dumpregs_5416.c Mon Apr 19 17:16:23 2010 (r206848) @@ -394,6 +394,7 @@ static struct dumpreg ar5416regs[] = { DEFBASIC(AR_SLP_CNT, "SLPCNT"), DEFBASIC(AR_SLP_MIB_CTRL, "SLPMIB"), DEFBASIC(AR_EXTRCCNT, "EXTRCCNT"), + DEFBASIC(AR_PHY_TURBO, "PHYTURBO"), DEFVOID(AR_PHY_ADC_SERIAL_CTL, "PHY_ADC_SERIAL_CTL"), From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 17:51: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 ED43B106566C; Mon, 19 Apr 2010 17:51:58 +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 8C69A8FC1C; Mon, 19 Apr 2010 17:51:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3JHjS47050955; Mon, 19 Apr 2010 11:45:29 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 19 Apr 2010 11:45:39 -0600 (MDT) Message-Id: <20100419.114539.867924114585647412.imp@bsdimp.com> To: ndenev@gmail.com From: "M. Warner Losh" In-Reply-To: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> References: <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> <98983E26-D091-42C8-B920-8D4F917E5019@bsdimp.com> <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> 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-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r206782 - stable/8/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, 19 Apr 2010 17:51:59 -0000 In message: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> Nikolay Denev writes: : : On Apr 19, 2010, at 1:08 PM, Warner Losh wrote: : : > Nikolay : > : > Did you do a buildworld after updating the sources before the buildkernel? : > : > : > Warner : > : > : : : Hmm, no... I tried first to build the kernel. OK. Can you try a buildworld (or at least kernel-toolchain) before building the kernel? Warner From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 18: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 33627106566C; Mon, 19 Apr 2010 18:20:00 +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 1F5B28FC17; Mon, 19 Apr 2010 18: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 o3JIJxlm078126; Mon, 19 Apr 2010 18:19:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JIJxJ1078124; Mon, 19 Apr 2010 18:19:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004191819.o3JIJxJ1078124@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 19 Apr 2010 18:19:59 +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: r206849 - stable/8/sys/ufs/ufs 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, 19 Apr 2010 18:20:00 -0000 Author: trasz Date: Mon Apr 19 18:19:59 2010 New Revision: 206849 URL: http://svn.freebsd.org/changeset/base/206849 Log: MFC r196987: Remove useless variable assignment. Modified: stable/8/sys/ufs/ufs/ufs_acl.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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ufs/ufs/ufs_acl.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_acl.c Mon Apr 19 17:16:23 2010 (r206848) +++ stable/8/sys/ufs/ufs/ufs_acl.c Mon Apr 19 18:19:59 2010 (r206849) @@ -330,9 +330,6 @@ ufs_getacl_posix1e(struct vop_getacl_arg old->acl_cnt = 0; break; } - - error = 0; - /* FALLTHROUGH */ case 0: error = acl_copy_oldacl_into_acl(old, ap->a_aclp); From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 18:22: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 9F8A91065672; Mon, 19 Apr 2010 18:22:21 +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 8D8398FC16; Mon, 19 Apr 2010 18:22: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 o3JIMLvL078714; Mon, 19 Apr 2010 18:22:21 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JIMLYU078712; Mon, 19 Apr 2010 18:22:21 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004191822.o3JIMLYU078712@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 19 Apr 2010 18:22:21 +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: r206850 - stable/8/sys/ufs/ufs 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, 19 Apr 2010 18:22:21 -0000 Author: trasz Date: Mon Apr 19 18:22:21 2010 New Revision: 206850 URL: http://svn.freebsd.org/changeset/base/206850 Log: MFC r202971: Return proper error code. Found with: clang Modified: stable/8/sys/ufs/ufs/ufs_acl.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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ufs/ufs/ufs_acl.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_acl.c Mon Apr 19 18:19:59 2010 (r206849) +++ stable/8/sys/ufs/ufs/ufs_acl.c Mon Apr 19 18:22:21 2010 (r206850) @@ -465,7 +465,7 @@ ufs_setacl_nfs4(struct vop_setacl_args * error = ufs_setacl_nfs4_internal(ap->a_vp, ap->a_aclp, ap->a_td); - return (0); + return (error); } /* From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 18:52: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 7E4B31065673; Mon, 19 Apr 2010 18:52:29 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id 884B78FC1C; Mon, 19 Apr 2010 18:52:28 +0000 (UTC) Received: by ewy24 with SMTP id 24so1573047ewy.33 for ; Mon, 19 Apr 2010 11:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:received:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=aRhLf2H28km06kzZ3Hl3scDDdiZiJ7UKhA3gGcfT7FY=; b=L1EQMe92BJemuHS8fq05Tfk0X8kvnElLpEEKjg9FfHm0osGxPrP/g1ppuH5KeV1Vgj oEgHKOQvjN4ha9Kv1G9/ocI9J8daG1kZmCXbusZWVTDZHjVXizTE1+FS/a6ZPTz9EGeC UT2LD5rsOERMjbn3AOxYr8xXhaCNaZeCLuT5s= 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=EH+uWKmYu9jG/vfrToz9BmHwDrd6gL9WLkt1jGmHhhGcqFy1JroRaWxv84NsYryp+Y XRFKMsPPllzaxjKJydOAEecvv9ZRbUOVzlBRdvbUnCkovpGivnyO2si2MhGucCUfmxem 5VPH1LNk0I0QTeSo+DWGilORNcTL+EYP5ZUgU= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.239.164.140 with HTTP; Mon, 19 Apr 2010 11:52:26 -0700 (PDT) In-Reply-To: <201004191659.o3JGx217060141@svn.freebsd.org> References: <201004191659.o3JGx217060141@svn.freebsd.org> Date: Mon, 19 Apr 2010 20:52:26 +0200 X-Google-Sender-Auth: 26c28b189e07ca54 Received: by 10.239.145.73 with SMTP id r9mr543692hba.22.1271703147158; Mon, 19 Apr 2010 11:52:27 -0700 (PDT) Message-ID: From: Attilio Rao To: Ed Maste , rstone@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-svnadmin@freebsd.org Subject: Re: svn commit: r206847 - 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: Mon, 19 Apr 2010 18:52:29 -0000 2010/4/19 Ed Maste : > Author: emaste > Date: Mon Apr 19 16:59:01 2010 > New Revision: 206847 > URL: http://svn.freebsd.org/changeset/base/206847 > > Log: > =C2=A0Welcome Ryan Stone (rstone@) as a new src committer. =C2=A0I will b= e his mentor, > =C2=A0with Joseph Koshy as a co-mentor. > > =C2=A0Ryan has some hwpmc work in progress, and will also continue with g= eneral > =C2=A0kernel fixes in various areas. It is great to see you on-board Ryan! Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 20:07: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 B35C21065670; Mon, 19 Apr 2010 20:07:35 +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 8908B8FC13; Mon, 19 Apr 2010 20:07: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 o3JK7ZDK002568; Mon, 19 Apr 2010 20:07:35 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JK7Zsc002566; Mon, 19 Apr 2010 20:07:35 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201004192007.o3JK7Zsc002566@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 19 Apr 2010 20:07: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: r206859 - head/sys/geom 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, 19 Apr 2010 20:07:35 -0000 Author: jh Date: Mon Apr 19 20:07:35 2010 New Revision: 206859 URL: http://svn.freebsd.org/changeset/base/206859 Log: Fix ddb(4) "show geom addr" command when INVARIANTS is enabled. Don't assert that the topology lock is held when g_valid_obj() is called from debugger. MFC after: 1 week Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Mon Apr 19 19:50:39 2010 (r206858) +++ head/sys/geom/geom_subr.c Mon Apr 19 20:07:35 2010 (r206859) @@ -59,6 +59,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef KDB +#include +#endif + struct class_list_head g_classes = LIST_HEAD_INITIALIZER(g_classes); static struct g_tailq_head geoms = TAILQ_HEAD_INITIALIZER(geoms); char *g_wait_event, *g_wait_up, *g_wait_down, *g_wait_sim; @@ -1011,12 +1015,11 @@ g_getattr__(const char *attr, struct g_c #if defined(DIAGNOSTIC) || defined(DDB) /* - * This function walks (topologically unsafely) the mesh and return a - * non-zero integer if it finds the argument pointer is an object. - * The return value indicates which type of object it is belived to be. - * If topology is not locked, this function is potentially dangerous, - * but since it is for debugging purposes and can be useful for instance - * from DDB, we do not assert topology lock is held. + * This function walks the mesh and returns a non-zero integer if it + * finds the argument pointer is an object. The return value indicates + * which type of object it is believed to be. If topology is not locked, + * this function is potentially dangerous, but we don't assert that the + * topology lock is held when called from debugger. */ int g_valid_obj(void const *ptr) @@ -1026,7 +1029,10 @@ g_valid_obj(void const *ptr) struct g_consumer *cp; struct g_provider *pp; - g_topology_assert(); +#ifdef KDB + if (kdb_active == 0) +#endif + g_topology_assert(); LIST_FOREACH(mp, &g_classes, class) { if (ptr == mp) From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 20:08: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 DBC1A1065675; Mon, 19 Apr 2010 20:08:19 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id BEE9C8FC2E; Mon, 19 Apr 2010 20:08:18 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id e12so1995152fga.13 for ; Mon, 19 Apr 2010 13:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=MR+GmuPvWIEhNc0wbGFWagxldjx5qnpW/mvN9AGzqG0=; b=Duv0qXFEc6Qvw3lf5rCg55ZS/Ss6LJ8gI8eQdq+NzQ2iGRgMB/nHkU/FlekQGpRDUm RZw3sJY52szoroFYUmlGuZKRkNfG2hvyCjIENmuhUrDMBbE1waZDm+IrFSDRiUety6aS T8toawycOSZDJR83ZY6+wlRcGEun0dYWIbaWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=LdJ3o0g1Pfp3gP9wDQcK8TMqZZRHzYaJyKFeATc0rPjjgxsRSAlWz7VGENEpRB9g5m YVLmfthwcw/puKKSjPk9BYR6V1bbl0JKjvsqpvO8XM9qdXnfG93Wr3GtdxLvUehOTBiy lZoZncT6WwzZYMqnFCFeSB5gIBzGHgpBarWus= Received: by 10.223.17.136 with SMTP id s8mr532353faa.41.1271707535591; Mon, 19 Apr 2010 13:05:35 -0700 (PDT) Received: from mbp-gige.totalterror.net (93-152-151-19.ddns.onlinedirect.bg [93.152.151.19]) by mx.google.com with ESMTPS id 3sm4772295fge.20.2010.04.19.13.05.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Apr 2010 13:05:34 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <20100419.114539.867924114585647412.imp@bsdimp.com> Date: Mon, 19 Apr 2010 23:05:31 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <6FD1C0AB-AEFF-4089-B549-266E73093CCC@gmail.com> References: <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> <98983E26-D091-42C8-B920-8D4F917E5019@bsdimp.com> <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> <20100419.114539.867924114585647412.imp@bsdimp.com> To: M. Warner Losh X-Mailer: Apple Mail (2.1078) 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: r206782 - stable/8/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, 19 Apr 2010 20:08:20 -0000 On 19 Apr, 2010, at 20:45 , M. Warner Losh wrote: > In message: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> > Nikolay Denev writes: > :=20 > : On Apr 19, 2010, at 1:08 PM, Warner Losh wrote: > :=20 > : > Nikolay > : >=20 > : > Did you do a buildworld after updating the sources before the = buildkernel? > : >=20 > : >=20 > : > Warner > : >=20 > : >=20 > :=20 > :=20 > : Hmm, no... I tried first to build the kernel. >=20 > OK. Can you try a buildworld (or at least kernel-toolchain) before > building the kernel? >=20 > Warner Yep, the kernel was built OK after the buildworld. From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 20:34: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 C3B8B106566C; Mon, 19 Apr 2010 20:34:39 +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 823CF8FC0A; Mon, 19 Apr 2010 20:34:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3JKLvJN052954; Mon, 19 Apr 2010 14:21:57 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 19 Apr 2010 14:22:08 -0600 (MDT) Message-Id: <20100419.142208.81694732398034836.imp@bsdimp.com> To: ndenev@gmail.com From: "M. Warner Losh" In-Reply-To: <6FD1C0AB-AEFF-4089-B549-266E73093CCC@gmail.com> References: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> <20100419.114539.867924114585647412.imp@bsdimp.com> <6FD1C0AB-AEFF-4089-B549-266E73093CCC@gmail.com> 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-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r206782 - stable/8/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, 19 Apr 2010 20:34:39 -0000 In message: <6FD1C0AB-AEFF-4089-B549-266E73093CCC@gmail.com> Nikolay Denev writes: : On 19 Apr, 2010, at 20:45 , M. Warner Losh wrote: : : > In message: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> : > Nikolay Denev writes: : > : : > : On Apr 19, 2010, at 1:08 PM, Warner Losh wrote: : > : : > : > Nikolay : > : > : > : > Did you do a buildworld after updating the sources before the buildkernel? : > : > : > : > : > : > Warner : > : > : > : > : > : : > : : > : Hmm, no... I tried first to build the kernel. : > : > OK. Can you try a buildworld (or at least kernel-toolchain) before : > building the kernel? : > : > Warner : : Yep, the kernel was built OK after the buildworld. OK. Sounds like I need to add a version check on the config stuff then to make it clearer you need to do this. thanks. Warner From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 20:48: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 E68D51065677; Mon, 19 Apr 2010 20:48:27 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3C428FC2F; Mon, 19 Apr 2010 20:48:27 +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 o3JKmR7f011672; Mon, 19 Apr 2010 20:48:27 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JKmR7v011669; Mon, 19 Apr 2010 20:48:27 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201004192048.o3JKmR7v011669@svn.freebsd.org> From: Giorgos Keramidas Date: Mon, 19 Apr 2010 20:48:27 +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: r206862 - stable/7/lib/libgssapi 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, 19 Apr 2010 20:48:28 -0000 Author: keramida (doc committer) Date: Mon Apr 19 20:48:27 2010 New Revision: 206862 URL: http://svn.freebsd.org/changeset/base/206862 Log: MFC 173187 Remove duplicate (but commented out) .Sh HISTORY section heading and add a missing .El request. Modified: stable/7/lib/libgssapi/gss_wrap.3 stable/7/lib/libgssapi/gss_wrap_size_limit.3 Directory Properties: stable/7/lib/libgssapi/ (props changed) Modified: stable/7/lib/libgssapi/gss_wrap.3 ============================================================================== --- stable/7/lib/libgssapi/gss_wrap.3 Mon Apr 19 20:41:13 2010 (r206861) +++ stable/7/lib/libgssapi/gss_wrap.3 Mon Apr 19 20:48:27 2010 (r206862) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_WRAP 3 PRM .Sh NAME @@ -142,7 +142,7 @@ The specified QOP is not supported by th Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY +.El .Sh HISTORY The .Nm Modified: stable/7/lib/libgssapi/gss_wrap_size_limit.3 ============================================================================== --- stable/7/lib/libgssapi/gss_wrap_size_limit.3 Mon Apr 19 20:41:13 2010 (r206861) +++ stable/7/lib/libgssapi/gss_wrap_size_limit.3 Mon Apr 19 20:48:27 2010 (r206862) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_WRAP_SIZE_LIMIT 3 PRM .Sh NAME @@ -127,7 +127,7 @@ The specified QOP is not supported by th Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY +.El .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 20:51: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 B3ADB106566C; Mon, 19 Apr 2010 20:51:54 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A06988FC0A; Mon, 19 Apr 2010 20:51: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 o3JKps3h012512; Mon, 19 Apr 2010 20:51:54 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JKps8f012483; Mon, 19 Apr 2010 20:51:54 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201004192051.o3JKps8f012483@svn.freebsd.org> From: Giorgos Keramidas Date: Mon, 19 Apr 2010 20:51:54 +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: r206863 - stable/7/lib/libgssapi 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, 19 Apr 2010 20:51:54 -0000 Author: keramida (doc committer) Date: Mon Apr 19 20:51:54 2010 New Revision: 206863 URL: http://svn.freebsd.org/changeset/base/206863 Log: MFC 173188 Remove duplicate (but commented out) .Sh HISTORY section heading. It almost "shadows" the ending .El request of a list, which seems to have caused mdoc buglets in some gss_*.3 manpages. Modified: stable/7/lib/libgssapi/gss_accept_sec_context.3 stable/7/lib/libgssapi/gss_acquire_cred.3 stable/7/lib/libgssapi/gss_add_oid_set_member.3 stable/7/lib/libgssapi/gss_canonicalize_name.3 stable/7/lib/libgssapi/gss_compare_name.3 stable/7/lib/libgssapi/gss_context_time.3 stable/7/lib/libgssapi/gss_delete_sec_context.3 stable/7/lib/libgssapi/gss_display_name.3 stable/7/lib/libgssapi/gss_display_status.3 stable/7/lib/libgssapi/gss_duplicate_name.3 stable/7/lib/libgssapi/gss_export_name.3 stable/7/lib/libgssapi/gss_export_sec_context.3 stable/7/lib/libgssapi/gss_get_mic.3 stable/7/lib/libgssapi/gss_import_name.3 stable/7/lib/libgssapi/gss_import_sec_context.3 stable/7/lib/libgssapi/gss_indicate_mechs.3 stable/7/lib/libgssapi/gss_init_sec_context.3 stable/7/lib/libgssapi/gss_inquire_context.3 stable/7/lib/libgssapi/gss_inquire_cred.3 stable/7/lib/libgssapi/gss_inquire_names_for_mech.3 stable/7/lib/libgssapi/gss_process_context_token.3 stable/7/lib/libgssapi/gss_release_buffer.3 stable/7/lib/libgssapi/gss_release_cred.3 stable/7/lib/libgssapi/gss_release_name.3 stable/7/lib/libgssapi/gss_release_oid_set.3 stable/7/lib/libgssapi/gss_test_oid_set_member.3 stable/7/lib/libgssapi/gss_unwrap.3 stable/7/lib/libgssapi/gss_verify_mic.3 Directory Properties: stable/7/lib/libgssapi/ (props changed) Modified: stable/7/lib/libgssapi/gss_accept_sec_context.3 ============================================================================== --- stable/7/lib/libgssapi/gss_accept_sec_context.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_accept_sec_context.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_ACCEPT_SEC_CONTEXT 3 PRM .Sh NAME @@ -448,7 +448,6 @@ Generic Security Service Application Pro .It RFC 2744 Generic Security Service API Version 2 : C-bindings .El -.\" .Sh HISTORY .Sh HISTORY The .Nm Modified: stable/7/lib/libgssapi/gss_acquire_cred.3 ============================================================================== --- stable/7/lib/libgssapi/gss_acquire_cred.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_acquire_cred.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_ACQUIRE_CRED 3 PRM .Sh NAME @@ -201,7 +201,6 @@ No credentials were found for the specif Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_add_oid_set_member.3 ============================================================================== --- stable/7/lib/libgssapi/gss_add_oid_set_member.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_add_oid_set_member.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_ADD_OID_SET_MEMBER 3 PRM .Sh NAME @@ -93,7 +93,6 @@ Successful completion Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_canonicalize_name.3 ============================================================================== --- stable/7/lib/libgssapi/gss_canonicalize_name.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_canonicalize_name.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_CANONICALIZE_NAME 3 PRM .Sh NAME @@ -100,7 +100,6 @@ The provided internal name was ill-forme Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_compare_name.3 ============================================================================== --- stable/7/lib/libgssapi/gss_compare_name.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_compare_name.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_COMPARE_NAME PRM .Sh NAME @@ -85,7 +85,6 @@ One or both of name1 or name2 was ill-fo Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_context_time.3 ============================================================================== --- stable/7/lib/libgssapi/gss_context_time.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_context_time.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_CONTEXT_TIME 3 PRM .Sh NAME @@ -71,7 +71,6 @@ The context_handle parameter did not ide Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_delete_sec_context.3 ============================================================================== --- stable/7/lib/libgssapi/gss_delete_sec_context.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_delete_sec_context.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_DELETE_SEC_CONTEXT 3 PRM .Sh NAME @@ -126,7 +126,6 @@ No valid context was supplied Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_display_name.3 ============================================================================== --- stable/7/lib/libgssapi/gss_display_name.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_display_name.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_DISPLAY_NAME 3 PRM .Sh NAME @@ -114,7 +114,6 @@ was ill-formed Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_display_status.3 ============================================================================== --- stable/7/lib/libgssapi/gss_display_status.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_display_status.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_DISPLAY_STATUS 3 PRM .Sh NAME @@ -173,7 +173,6 @@ nor Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_duplicate_name.3 ============================================================================== --- stable/7/lib/libgssapi/gss_duplicate_name.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_duplicate_name.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_DUPLICATE_NAME 3 PRM .Sh NAME @@ -86,7 +86,6 @@ parameter was ill-formed Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_export_name.3 ============================================================================== --- stable/7/lib/libgssapi/gss_export_name.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_export_name.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_EXPORT_NAME 3 PRM .Sh NAME @@ -91,7 +91,6 @@ The internal name was of a type not supp Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_export_sec_context.3 ============================================================================== --- stable/7/lib/libgssapi/gss_export_sec_context.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_export_sec_context.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_EXPORT_SEC_CONTEXT 3 PRM .Sh NAME @@ -131,7 +131,6 @@ The operation is not supported Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_get_mic.3 ============================================================================== --- stable/7/lib/libgssapi/gss_get_mic.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_get_mic.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_GET_MIC 3 PRM .Sh NAME @@ -128,7 +128,6 @@ The specified QOP is not supported by th Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_import_name.3 ============================================================================== --- stable/7/lib/libgssapi/gss_import_name.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_import_name.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_IMPORT_NAME 3 PRM .Sh NAME @@ -102,7 +102,6 @@ but the mechanism contained within the i Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_import_sec_context.3 ============================================================================== --- stable/7/lib/libgssapi/gss_import_sec_context.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_import_sec_context.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_IMPORT_SEC_CONTEXT 3 PRM .Sh NAME @@ -83,7 +83,6 @@ Local policy prevents the import of this Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_indicate_mechs.3 ============================================================================== --- stable/7/lib/libgssapi/gss_indicate_mechs.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_indicate_mechs.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_INDICATE_MECHS 3 PRM .Sh NAME @@ -70,7 +70,6 @@ Successful completion Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_init_sec_context.3 ============================================================================== --- stable/7/lib/libgssapi/gss_init_sec_context.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_init_sec_context.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_INIT_SEC_CONTEXT 3 PRM .Sh NAME @@ -535,7 +535,6 @@ Generic Security Service Application Pro .It RFC 2744 Generic Security Service API Version 2 : C-bindings .El -.\" .Sh HISTORY .Sh HISTORY The .Nm Modified: stable/7/lib/libgssapi/gss_inquire_context.3 ============================================================================== --- stable/7/lib/libgssapi/gss_inquire_context.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_inquire_context.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_INQUIRE_CONTEXT 3 PRM .Sh NAME @@ -247,7 +247,6 @@ The referenced context could not be acce Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_inquire_cred.3 ============================================================================== --- stable/7/lib/libgssapi/gss_inquire_cred.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_inquire_cred.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_INQUIRE_CRED 3 PRM .Sh NAME @@ -121,7 +121,6 @@ it will be set to 0 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_inquire_names_for_mech.3 ============================================================================== --- stable/7/lib/libgssapi/gss_inquire_names_for_mech.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_inquire_names_for_mech.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_INQUIRE_NAMES_FOR_MECH 3 PRM .Sh NAME @@ -70,7 +70,6 @@ Successful completion Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_process_context_token.3 ============================================================================== --- stable/7/lib/libgssapi/gss_process_context_token.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_process_context_token.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_PROCESS_CONTEXT_TOKEN 3 PRM .Sh NAME @@ -99,7 +99,6 @@ did not refer to a valid context Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_release_buffer.3 ============================================================================== --- stable/7/lib/libgssapi/gss_release_buffer.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_release_buffer.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_RELEASE_BUFFER 3 PRM .Sh NAME @@ -74,7 +74,6 @@ Successful completion Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_release_cred.3 ============================================================================== --- stable/7/lib/libgssapi/gss_release_cred.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_release_cred.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_RELEASE_CRED 3 PRM .Sh NAME @@ -71,7 +71,6 @@ Credentials could not be accessed Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_release_name.3 ============================================================================== --- stable/7/lib/libgssapi/gss_release_name.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_release_name.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_RELEASE_NAME 3 PRM .Sh NAME @@ -67,7 +67,6 @@ The name parameter did not contain a val Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_release_oid_set.3 ============================================================================== --- stable/7/lib/libgssapi/gss_release_oid_set.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_release_oid_set.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_RELEASE_OID_SET 3 PRM .Sh NAME @@ -72,7 +72,6 @@ Successful completion Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_test_oid_set_member.3 ============================================================================== --- stable/7/lib/libgssapi/gss_test_oid_set_member.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_test_oid_set_member.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_TEST_OID_SET_MEMBER 3 PRM .Sh NAME @@ -79,7 +79,6 @@ Successful completion Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_unwrap.3 ============================================================================== --- stable/7/lib/libgssapi/gss_unwrap.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_unwrap.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_UNWRAP 3 PRM .Sh NAME @@ -155,7 +155,6 @@ The context_handle parameter did not ide Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .Sh HISTORY The .Nm Modified: stable/7/lib/libgssapi/gss_verify_mic.3 ============================================================================== --- stable/7/lib/libgssapi/gss_verify_mic.3 Mon Apr 19 20:48:27 2010 (r206862) +++ stable/7/lib/libgssapi/gss_verify_mic.3 Mon Apr 19 20:51:54 2010 (r206863) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_VERIFY_MIC 3 PRM .Sh NAME @@ -135,7 +135,6 @@ The context_handle parameter did not ide Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 20:53: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 5D61F106566C; Mon, 19 Apr 2010 20:53:38 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3261B8FC1D; Mon, 19 Apr 2010 20:53: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 o3JKrcZf012953; Mon, 19 Apr 2010 20:53:38 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JKrcfU012950; Mon, 19 Apr 2010 20:53:38 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201004192053.o3JKrcfU012950@svn.freebsd.org> From: Giorgos Keramidas Date: Mon, 19 Apr 2010 20:53:38 +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: r206864 - stable/7/lib/libgssapi 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, 19 Apr 2010 20:53:39 -0000 Author: keramida (doc committer) Date: Mon Apr 19 20:53:37 2010 New Revision: 206864 URL: http://svn.freebsd.org/changeset/base/206864 Log: MFC 173189 Change a .PP request to a valid .Pp mdoc request, and remove an extra (but commented out) .Sh HISTORY section heading. Modified: stable/7/lib/libgssapi/gss_add_cred.3 stable/7/lib/libgssapi/gss_create_empty_oid_set.3 Directory Properties: stable/7/lib/libgssapi/ (props changed) Modified: stable/7/lib/libgssapi/gss_add_cred.3 ============================================================================== --- stable/7/lib/libgssapi/gss_add_cred.3 Mon Apr 19 20:51:54 2010 (r206863) +++ stable/7/lib/libgssapi/gss_add_cred.3 Mon Apr 19 20:53:37 2010 (r206864) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_ADD_CRED 3 PRM .Sh NAME @@ -86,7 +86,7 @@ is .Dv GSS_C_ACCEPT or .Dv GSS_C_BOTH ). -.PP +.Pp This routine is expected to be used primarily by context acceptors, since implementations are likely to provide mechanism-specific ways of obtaining GSS-API initiator credentials from the system login process. @@ -301,7 +301,6 @@ No credentials were found for the specif Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The Modified: stable/7/lib/libgssapi/gss_create_empty_oid_set.3 ============================================================================== --- stable/7/lib/libgssapi/gss_create_empty_oid_set.3 Mon Apr 19 20:51:54 2010 (r206863) +++ stable/7/lib/libgssapi/gss_create_empty_oid_set.3 Mon Apr 19 20:53:37 2010 (r206864) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" The following commands are required for all man pages. -.Dd November 12, 2005 +.Dd October 30, 2007 .Os .Dt GSS_CREATE_EMPTY_OID_SET 3 PRM .Sh NAME @@ -55,7 +55,6 @@ object identifiers for input to .It minor_status Mechanism specific status code. .It oid_set - The empty object identifier set. The routine will allocate the gss_OID_set_desc object, which the application must free after use with a call to @@ -75,7 +74,6 @@ Successful completion Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Generic Security Service API Version 2 : C-bindings -.\" .Sh HISTORY .El .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Mon Apr 19 20:54: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 0924B1065687; Mon, 19 Apr 2010 20:54:01 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAD138FC18; Mon, 19 Apr 2010 20:54: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 o3JKs02e013056; Mon, 19 Apr 2010 20:54:00 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JKs0id013052; Mon, 19 Apr 2010 20:54:00 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201004192054.o3JKs0id013052@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 19 Apr 2010 20:54:00 +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: r206865 - vendor/tzdata/dist 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, 19 Apr 2010 20:54:01 -0000 Author: edwin Date: Mon Apr 19 20:54:00 2010 New Revision: 206865 URL: http://svn.freebsd.org/changeset/base/206865 Log: Vendor import of tzdata2010i: - Marocca will have DST this year between May and August - Historical data for Taiwan - No more DST for the Argentinian province/state San Luis this year. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzdata/dist/africa vendor/tzdata/dist/asia vendor/tzdata/dist/southamerica Modified: vendor/tzdata/dist/africa ============================================================================== --- vendor/tzdata/dist/africa Mon Apr 19 20:53:37 2010 (r206864) +++ vendor/tzdata/dist/africa Mon Apr 19 20:54:00 2010 (r206865) @@ -1,5 +1,5 @@ #
-# @(#)africa	8.23
+# @(#)africa	8.26
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -680,6 +680,21 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
 # 
 
+# From Steffen Thorsen (2010-04-13):
+# Several news media in Morocco report that the Ministry of Modernization
+# of Public Sectors has announced that Morocco will have DST from
+# 2010-05-02 to 2010-08-08.
+#
+# Example:
+# 
+# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
+# 
+# (French)
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
+# 
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -701,6 +716,8 @@ Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
 Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
+Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
+Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16
@@ -942,6 +959,24 @@ Zone	Africa/Lome	0:04:52 -	LMT	1893
 # Therefore, the standard time will be kept unchanged the whole year long."
 # So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
 
+# From Alexander Krivenyshev (2010-03-27):
+# According to some news reports Tunis confirmed not to use DST in 2010
+#
+# (translation):
+# "The Tunisian government has decided to abandon DST, which was scheduled on
+# Sunday...
+# Tunisian authorities had suspended the DST for the first time last year also
+# coincided with the month of Ramadan..."
+#
+# (in Arabic)
+# 
+# http://www.moheet.com/show_news.aspx?nid=358861&pg=1
+# 
+# http://www.almadenahnews.com/newss/news.php?c=118&id=38036
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_tunis02.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Tunisia	1939	only	-	Apr	15	23:00s	1:00	S
 Rule	Tunisia	1939	only	-	Nov	18	23:00s	0	-
@@ -968,8 +1003,7 @@ Rule	Tunisia	2005	only	-	May	 1	 0:00s	1
 Rule	Tunisia	2005	only	-	Sep	30	 1:00s	0	-
 Rule	Tunisia	2006	2008	-	Mar	lastSun	 2:00s	1:00	S
 Rule	Tunisia	2006	2008	-	Oct	lastSun	 2:00s	0	-
-Rule	Tunisia	2010	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Tunisia	2010	max	-	Oct	lastSun	 2:00s	0	-
+
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.
 # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.

Modified: vendor/tzdata/dist/asia
==============================================================================
--- vendor/tzdata/dist/asia	Mon Apr 19 20:53:37 2010	(r206864)
+++ vendor/tzdata/dist/asia	Mon Apr 19 20:54:00 2010	(r206865)
@@ -1,4 +1,4 @@
-# @(#)asia	8.58
+# @(#)asia	8.60
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -566,6 +566,28 @@ Zone	Asia/Hong_Kong	7:36:36 -	LMT	1904 O
 # was still controlled by Japan.  This is hard to believe, but we don't
 # have any other information.
 
+# From smallufo (2010-04-03):
+# According to Taiwan's CWB,
+# 
+# http://www.cwb.gov.tw/V6/astronomy/cdata/summert.htm
+# 
+# Taipei has DST in 1979 between July 1st and Sep 30.
+
+# From Arthur David Olson (2010-04-07):
+# Here's Google's translation of the table at the bottom of the "summert.htm" page:
+# Decade 	                                                    Name                      Start and end date
+# Republic of China 34 years to 40 years (AD 1945-1951 years) Summer Time               May 1 to September 30 
+# 41 years of the Republic of China (AD 1952)                 Daylight Saving Time      March 1 to October 31 
+# Republic of China 42 years to 43 years (AD 1953-1954 years) Daylight Saving Time      April 1 to October 31 
+# In the 44 years to 45 years (AD 1955-1956 years)            Daylight Saving Time      April 1 to September 30 
+# Republic of China 46 years to 48 years (AD 1957-1959)       Summer Time               April 1 to September 30 
+# Republic of China 49 years to 50 years (AD 1960-1961)       Summer Time               June 1 to September 30 
+# Republic of China 51 years to 62 years (AD 1962-1973 years) Stop Summer Time 
+# Republic of China 63 years to 64 years (1974-1975 AD)       Daylight Saving Time      April 1 to September 30 
+# Republic of China 65 years to 67 years (1976-1978 AD)       Stop Daylight Saving Time 
+# Republic of China 68 years (AD 1979)                        Daylight Saving Time      July 1 to September 30 
+# Republic of China since 69 years (AD 1980)                  Stop Daylight Saving Time
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Taiwan	1945	1951	-	May	1	0:00	1:00	D
 Rule	Taiwan	1945	1951	-	Oct	1	0:00	0	S
@@ -576,8 +598,9 @@ Rule	Taiwan	1955	1961	-	Oct	1	0:00	0	S
 Rule	Taiwan	1960	1961	-	Jun	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Apr	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Oct	1	0:00	0	S
-Rule	Taiwan	1980	only	-	Jun	30	0:00	1:00	D
-Rule	Taiwan	1980	only	-	Sep	30	0:00	0	S
+Rule	Taiwan	1979	only	-	Jun	30	0:00	1:00	D
+Rule	Taiwan	1979	only	-	Sep	30	0:00	0	S
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Taipei	8:06:00 -	LMT	1896 # or Taibei or T'ai-pei
 			8:00	Taiwan	C%sT
@@ -1912,13 +1935,35 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # [T]he German Consulate General in Karachi reported me today that Pakistan
 # will go back to standard time on 1st of November.
 
+# From Steffen Thorsen (2010-03-26):
+# Steffen Thorsen wrote:
+# > On Thursday (2010-03-25) it was announced that DST would start in
+# > Pakistan on 2010-04-01.
+# >
+# > Then today, the president said that they might have to revert the
+# > decision if it is not supported by the parliament. So at the time
+# > being, it seems unclear if DST will be actually observed or not - but
+# > April 1 could be a more likely date than April 15.
+# Now, it seems that the decision to not observe DST in final:
+#
+# "Govt Withdraws Plan To Advance Clocks"
+# 
+# http://www.apakistannews.com/govt-withdraws-plan-to-advance-clocks-172041
+# 
+#
+# "People laud PM's announcement to end DST"
+# 
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
 Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
-Rule Pakistan	2009	max	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	max	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: vendor/tzdata/dist/southamerica
==============================================================================
--- vendor/tzdata/dist/southamerica	Mon Apr 19 20:53:37 2010	(r206864)
+++ vendor/tzdata/dist/southamerica	Mon Apr 19 20:54:00 2010	(r206865)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.43
+# @(#)southamerica	8.44
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -437,6 +437,27 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:
 # of the country calls it "ART".
 # ...
 
+# From Alexander Krivenyshev (2010-04-09):
+# According to news reports from El Diario de la Republica Province San
+# Luis, Argentina (standard time UTC-04) will keep Daylight Saving Time
+# after April 11, 2010--will continue to have same time as rest of
+# Argentina (UTC-3) (no DST).
+#
+# Confirmaron la prórroga del huso horario de verano (Spanish)
+# 
+# http://www.eldiariodelarepublica.com/index.php?option=com_content&task=view&id=29383&Itemid=9
+# 
+# or (some English translation):
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_argentina08.html
+# 
+
+# From Mariano Absatz (2010-04-12):
+# yes...I can confirm this...and given that San Luis keeps calling
+# UTC-03:00 "summer time", we should't just let San Luis go back to "Arg"
+# rules...San Luis is still using "Western ARgentina Time" and it got
+# stuck on Summer daylight savings time even though the summer is over.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),
@@ -570,8 +591,8 @@ Zone America/Argentina/Mendoza -4:35:16 
 #
 # San Luis (SL)
 
-Rule	SanLuis	2008	max	-	Mar	Sun>=8	0:00	0	-
-Rule	SanLuis	2007	max	-	Oct	Sun>=8	0:00	1:00	S
+Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
+Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
 
 Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 20: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 EE9DB106564A;
	Mon, 19 Apr 2010 20:55:41 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B19898FC17;
	Mon, 19 Apr 2010 20:55: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 o3JKtfC5013513;
	Mon, 19 Apr 2010 20:55:41 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JKtf1v013512;
	Mon, 19 Apr 2010 20:55:41 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201004192055.o3JKtf1v013512@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 19 Apr 2010 20:55:41 +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: r206866 - vendor/tzdata/tzdata2010i
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, 19 Apr 2010 20:55:42 -0000

Author: edwin
Date: Mon Apr 19 20:55:41 2010
New Revision: 206866
URL: http://svn.freebsd.org/changeset/base/206866

Log:
  Tag of tzdata2010i

Added:
  vendor/tzdata/tzdata2010i/
     - copied from r206865, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 20:56: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 684F91065674;
	Mon, 19 Apr 2010 20:56:04 +0000 (UTC)
	(envelope-from keramida@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 569E88FC1C;
	Mon, 19 Apr 2010 20:56: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 o3JKu4pF013620;
	Mon, 19 Apr 2010 20:56:04 GMT
	(envelope-from keramida@svn.freebsd.org)
Received: (from keramida@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JKu4Ml013618;
	Mon, 19 Apr 2010 20:56:04 GMT
	(envelope-from keramida@svn.freebsd.org)
Message-Id: <201004192056.o3JKu4Ml013618@svn.freebsd.org>
From: Giorgos Keramidas 
Date: Mon, 19 Apr 2010 20:56:04 +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: r206867 - stable/7/lib/libgssapi
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, 19 Apr 2010 20:56:04 -0000

Author: keramida (doc committer)
Date: Mon Apr 19 20:56:04 2010
New Revision: 206867
URL: http://svn.freebsd.org/changeset/base/206867

Log:
  MFC 173190
  
  Remove an extra (commented out) .Sh HISTORY section heading, to avoid
  the risk of "shadowing" the following .El request, strip eol spaces
  and delete an empty line to fix mdoc warnings.

Modified:
  stable/7/lib/libgssapi/gss_inquire_cred_by_mech.3
Directory Properties:
  stable/7/lib/libgssapi/   (props changed)

Modified: stable/7/lib/libgssapi/gss_inquire_cred_by_mech.3
==============================================================================
--- stable/7/lib/libgssapi/gss_inquire_cred_by_mech.3	Mon Apr 19 20:55:41 2010	(r206866)
+++ stable/7/lib/libgssapi/gss_inquire_cred_by_mech.3	Mon Apr 19 20:56:04 2010	(r206867)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd November 12, 2005
+.Dd October 30, 2007
 .Os
 .Dt GSS_INQUIRE_CRED_BY_MECH 3 PRM
 .Sh NAME
@@ -67,9 +67,8 @@ after use with a call to
 .Fn gss_release_name .
 Specify
 .Dv NULL
-if not required. 
+if not required.
 .It initiator_lifetime
-                     
 The number of seconds for which the credential will remain capable of
 initiating security contexts under the specified mechanism.
 If the credential can no longer be used to initiate contexts,
@@ -136,7 +135,6 @@ it will be set to 0.
 Generic Security Service Application Program Interface Version 2, Update 1
 .It RFC 2744
 Generic Security Service API Version 2 : C-bindings
-.\" .Sh HISTORY
 .El
 .Sh HISTORY
 The

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 20:59: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 056D1106566C;
	Mon, 19 Apr 2010 20:59:40 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E71808FC18;
	Mon, 19 Apr 2010 20:59: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 o3JKxdd1014460;
	Mon, 19 Apr 2010 20:59:39 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JKxdrK014455;
	Mon, 19 Apr 2010 20:59:39 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201004192059.o3JKxdrK014455@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 19 Apr 2010 20:59: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: r206868 - head/contrib/tzdata
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, 19 Apr 2010 20:59:40 -0000

Author: edwin
Date: Mon Apr 19 20:59:39 2010
New Revision: 206868
URL: http://svn.freebsd.org/changeset/base/206868

Log:
  MFV of tzdata2010i, r206865
  
  - Marocco does have DST this year between May and August.
  - Historical data for Taiwan
  - Argentina / San Luis does not do DST this year.

Modified:
  head/contrib/tzdata/africa
  head/contrib/tzdata/asia
  head/contrib/tzdata/southamerica
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/africa
==============================================================================
--- head/contrib/tzdata/africa	Mon Apr 19 20:56:04 2010	(r206867)
+++ head/contrib/tzdata/africa	Mon Apr 19 20:59:39 2010	(r206868)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.23
+# @(#)africa	8.26
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -680,6 +680,21 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
 # 
 
+# From Steffen Thorsen (2010-04-13):
+# Several news media in Morocco report that the Ministry of Modernization
+# of Public Sectors has announced that Morocco will have DST from
+# 2010-05-02 to 2010-08-08.
+#
+# Example:
+# 
+# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
+# 
+# (French)
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
+# 
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -701,6 +716,8 @@ Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
 Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
+Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
+Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16
@@ -942,6 +959,24 @@ Zone	Africa/Lome	0:04:52 -	LMT	1893
 # Therefore, the standard time will be kept unchanged the whole year long."
 # So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
 
+# From Alexander Krivenyshev (2010-03-27):
+# According to some news reports Tunis confirmed not to use DST in 2010
+#
+# (translation):
+# "The Tunisian government has decided to abandon DST, which was scheduled on
+# Sunday...
+# Tunisian authorities had suspended the DST for the first time last year also
+# coincided with the month of Ramadan..."
+#
+# (in Arabic)
+# 
+# http://www.moheet.com/show_news.aspx?nid=358861&pg=1
+# 
+# http://www.almadenahnews.com/newss/news.php?c=118&id=38036
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_tunis02.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Tunisia	1939	only	-	Apr	15	23:00s	1:00	S
 Rule	Tunisia	1939	only	-	Nov	18	23:00s	0	-
@@ -968,8 +1003,7 @@ Rule	Tunisia	2005	only	-	May	 1	 0:00s	1
 Rule	Tunisia	2005	only	-	Sep	30	 1:00s	0	-
 Rule	Tunisia	2006	2008	-	Mar	lastSun	 2:00s	1:00	S
 Rule	Tunisia	2006	2008	-	Oct	lastSun	 2:00s	0	-
-Rule	Tunisia	2010	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Tunisia	2010	max	-	Oct	lastSun	 2:00s	0	-
+
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.
 # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.

Modified: head/contrib/tzdata/asia
==============================================================================
--- head/contrib/tzdata/asia	Mon Apr 19 20:56:04 2010	(r206867)
+++ head/contrib/tzdata/asia	Mon Apr 19 20:59:39 2010	(r206868)
@@ -1,4 +1,4 @@
-# @(#)asia	8.58
+# @(#)asia	8.60
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -566,6 +566,28 @@ Zone	Asia/Hong_Kong	7:36:36 -	LMT	1904 O
 # was still controlled by Japan.  This is hard to believe, but we don't
 # have any other information.
 
+# From smallufo (2010-04-03):
+# According to Taiwan's CWB,
+# 
+# http://www.cwb.gov.tw/V6/astronomy/cdata/summert.htm
+# 
+# Taipei has DST in 1979 between July 1st and Sep 30.
+
+# From Arthur David Olson (2010-04-07):
+# Here's Google's translation of the table at the bottom of the "summert.htm" page:
+# Decade 	                                                    Name                      Start and end date
+# Republic of China 34 years to 40 years (AD 1945-1951 years) Summer Time               May 1 to September 30 
+# 41 years of the Republic of China (AD 1952)                 Daylight Saving Time      March 1 to October 31 
+# Republic of China 42 years to 43 years (AD 1953-1954 years) Daylight Saving Time      April 1 to October 31 
+# In the 44 years to 45 years (AD 1955-1956 years)            Daylight Saving Time      April 1 to September 30 
+# Republic of China 46 years to 48 years (AD 1957-1959)       Summer Time               April 1 to September 30 
+# Republic of China 49 years to 50 years (AD 1960-1961)       Summer Time               June 1 to September 30 
+# Republic of China 51 years to 62 years (AD 1962-1973 years) Stop Summer Time 
+# Republic of China 63 years to 64 years (1974-1975 AD)       Daylight Saving Time      April 1 to September 30 
+# Republic of China 65 years to 67 years (1976-1978 AD)       Stop Daylight Saving Time 
+# Republic of China 68 years (AD 1979)                        Daylight Saving Time      July 1 to September 30 
+# Republic of China since 69 years (AD 1980)                  Stop Daylight Saving Time
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Taiwan	1945	1951	-	May	1	0:00	1:00	D
 Rule	Taiwan	1945	1951	-	Oct	1	0:00	0	S
@@ -576,8 +598,9 @@ Rule	Taiwan	1955	1961	-	Oct	1	0:00	0	S
 Rule	Taiwan	1960	1961	-	Jun	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Apr	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Oct	1	0:00	0	S
-Rule	Taiwan	1980	only	-	Jun	30	0:00	1:00	D
-Rule	Taiwan	1980	only	-	Sep	30	0:00	0	S
+Rule	Taiwan	1979	only	-	Jun	30	0:00	1:00	D
+Rule	Taiwan	1979	only	-	Sep	30	0:00	0	S
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Taipei	8:06:00 -	LMT	1896 # or Taibei or T'ai-pei
 			8:00	Taiwan	C%sT
@@ -1912,13 +1935,35 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # [T]he German Consulate General in Karachi reported me today that Pakistan
 # will go back to standard time on 1st of November.
 
+# From Steffen Thorsen (2010-03-26):
+# Steffen Thorsen wrote:
+# > On Thursday (2010-03-25) it was announced that DST would start in
+# > Pakistan on 2010-04-01.
+# >
+# > Then today, the president said that they might have to revert the
+# > decision if it is not supported by the parliament. So at the time
+# > being, it seems unclear if DST will be actually observed or not - but
+# > April 1 could be a more likely date than April 15.
+# Now, it seems that the decision to not observe DST in final:
+#
+# "Govt Withdraws Plan To Advance Clocks"
+# 
+# http://www.apakistannews.com/govt-withdraws-plan-to-advance-clocks-172041
+# 
+#
+# "People laud PM's announcement to end DST"
+# 
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
 Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
-Rule Pakistan	2009	max	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	max	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: head/contrib/tzdata/southamerica
==============================================================================
--- head/contrib/tzdata/southamerica	Mon Apr 19 20:56:04 2010	(r206867)
+++ head/contrib/tzdata/southamerica	Mon Apr 19 20:59:39 2010	(r206868)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.43
+# @(#)southamerica	8.44
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -437,6 +437,27 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:
 # of the country calls it "ART".
 # ...
 
+# From Alexander Krivenyshev (2010-04-09):
+# According to news reports from El Diario de la Republica Province San
+# Luis, Argentina (standard time UTC-04) will keep Daylight Saving Time
+# after April 11, 2010--will continue to have same time as rest of
+# Argentina (UTC-3) (no DST).
+#
+# Confirmaron la prórroga del huso horario de verano (Spanish)
+# 
+# http://www.eldiariodelarepublica.com/index.php?option=com_content&task=view&id=29383&Itemid=9
+# 
+# or (some English translation):
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_argentina08.html
+# 
+
+# From Mariano Absatz (2010-04-12):
+# yes...I can confirm this...and given that San Luis keeps calling
+# UTC-03:00 "summer time", we should't just let San Luis go back to "Arg"
+# rules...San Luis is still using "Western ARgentina Time" and it got
+# stuck on Summer daylight savings time even though the summer is over.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),
@@ -570,8 +591,8 @@ Zone America/Argentina/Mendoza -4:35:16 
 #
 # San Luis (SL)
 
-Rule	SanLuis	2008	max	-	Mar	Sun>=8	0:00	0	-
-Rule	SanLuis	2007	max	-	Oct	Sun>=8	0:00	1:00	S
+Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
+Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
 
 Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 21:01: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 970BC106566B;
	Mon, 19 Apr 2010 21:01:24 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 83BA28FC2C;
	Mon, 19 Apr 2010 21:01: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 o3JL1OPu014960;
	Mon, 19 Apr 2010 21:01:24 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JL1O9g014935;
	Mon, 19 Apr 2010 21:01:24 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201004192101.o3JL1O9g014935@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 19 Apr 2010 21:01:24 +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: r206869 - stable/8/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: Mon, 19 Apr 2010 21:01:24 -0000

Author: edwin
Date: Mon Apr 19 21:01:24 2010
New Revision: 206869
URL: http://svn.freebsd.org/changeset/base/206869

Log:
  MFC of tzdata2010i, r206868
  
  - Marocco does have DST this year between May and August.
  - Historical data for Taiwan
  - Argentina / San Luis does not do DST this year.

Modified:
  stable/8/share/zoneinfo/africa
  stable/8/share/zoneinfo/asia
  stable/8/share/zoneinfo/southamerica
Directory Properties:
  stable/8/share/zoneinfo/   (props changed)

Modified: stable/8/share/zoneinfo/africa
==============================================================================
--- stable/8/share/zoneinfo/africa	Mon Apr 19 20:59:39 2010	(r206868)
+++ stable/8/share/zoneinfo/africa	Mon Apr 19 21:01:24 2010	(r206869)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.23
+# @(#)africa	8.26
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -680,6 +680,21 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
 # 
 
+# From Steffen Thorsen (2010-04-13):
+# Several news media in Morocco report that the Ministry of Modernization
+# of Public Sectors has announced that Morocco will have DST from
+# 2010-05-02 to 2010-08-08.
+#
+# Example:
+# 
+# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
+# 
+# (French)
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
+# 
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -701,6 +716,8 @@ Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
 Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
+Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
+Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16
@@ -942,6 +959,24 @@ Zone	Africa/Lome	0:04:52 -	LMT	1893
 # Therefore, the standard time will be kept unchanged the whole year long."
 # So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
 
+# From Alexander Krivenyshev (2010-03-27):
+# According to some news reports Tunis confirmed not to use DST in 2010
+#
+# (translation):
+# "The Tunisian government has decided to abandon DST, which was scheduled on
+# Sunday...
+# Tunisian authorities had suspended the DST for the first time last year also
+# coincided with the month of Ramadan..."
+#
+# (in Arabic)
+# 
+# http://www.moheet.com/show_news.aspx?nid=358861&pg=1
+# 
+# http://www.almadenahnews.com/newss/news.php?c=118&id=38036
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_tunis02.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Tunisia	1939	only	-	Apr	15	23:00s	1:00	S
 Rule	Tunisia	1939	only	-	Nov	18	23:00s	0	-
@@ -968,8 +1003,7 @@ Rule	Tunisia	2005	only	-	May	 1	 0:00s	1
 Rule	Tunisia	2005	only	-	Sep	30	 1:00s	0	-
 Rule	Tunisia	2006	2008	-	Mar	lastSun	 2:00s	1:00	S
 Rule	Tunisia	2006	2008	-	Oct	lastSun	 2:00s	0	-
-Rule	Tunisia	2010	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Tunisia	2010	max	-	Oct	lastSun	 2:00s	0	-
+
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.
 # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.

Modified: stable/8/share/zoneinfo/asia
==============================================================================
--- stable/8/share/zoneinfo/asia	Mon Apr 19 20:59:39 2010	(r206868)
+++ stable/8/share/zoneinfo/asia	Mon Apr 19 21:01:24 2010	(r206869)
@@ -1,4 +1,4 @@
-# @(#)asia	8.58
+# @(#)asia	8.60
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -566,6 +566,28 @@ Zone	Asia/Hong_Kong	7:36:36 -	LMT	1904 O
 # was still controlled by Japan.  This is hard to believe, but we don't
 # have any other information.
 
+# From smallufo (2010-04-03):
+# According to Taiwan's CWB,
+# 
+# http://www.cwb.gov.tw/V6/astronomy/cdata/summert.htm
+# 
+# Taipei has DST in 1979 between July 1st and Sep 30.
+
+# From Arthur David Olson (2010-04-07):
+# Here's Google's translation of the table at the bottom of the "summert.htm" page:
+# Decade 	                                                    Name                      Start and end date
+# Republic of China 34 years to 40 years (AD 1945-1951 years) Summer Time               May 1 to September 30 
+# 41 years of the Republic of China (AD 1952)                 Daylight Saving Time      March 1 to October 31 
+# Republic of China 42 years to 43 years (AD 1953-1954 years) Daylight Saving Time      April 1 to October 31 
+# In the 44 years to 45 years (AD 1955-1956 years)            Daylight Saving Time      April 1 to September 30 
+# Republic of China 46 years to 48 years (AD 1957-1959)       Summer Time               April 1 to September 30 
+# Republic of China 49 years to 50 years (AD 1960-1961)       Summer Time               June 1 to September 30 
+# Republic of China 51 years to 62 years (AD 1962-1973 years) Stop Summer Time 
+# Republic of China 63 years to 64 years (1974-1975 AD)       Daylight Saving Time      April 1 to September 30 
+# Republic of China 65 years to 67 years (1976-1978 AD)       Stop Daylight Saving Time 
+# Republic of China 68 years (AD 1979)                        Daylight Saving Time      July 1 to September 30 
+# Republic of China since 69 years (AD 1980)                  Stop Daylight Saving Time
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Taiwan	1945	1951	-	May	1	0:00	1:00	D
 Rule	Taiwan	1945	1951	-	Oct	1	0:00	0	S
@@ -576,8 +598,9 @@ Rule	Taiwan	1955	1961	-	Oct	1	0:00	0	S
 Rule	Taiwan	1960	1961	-	Jun	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Apr	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Oct	1	0:00	0	S
-Rule	Taiwan	1980	only	-	Jun	30	0:00	1:00	D
-Rule	Taiwan	1980	only	-	Sep	30	0:00	0	S
+Rule	Taiwan	1979	only	-	Jun	30	0:00	1:00	D
+Rule	Taiwan	1979	only	-	Sep	30	0:00	0	S
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Taipei	8:06:00 -	LMT	1896 # or Taibei or T'ai-pei
 			8:00	Taiwan	C%sT
@@ -1912,13 +1935,35 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # [T]he German Consulate General in Karachi reported me today that Pakistan
 # will go back to standard time on 1st of November.
 
+# From Steffen Thorsen (2010-03-26):
+# Steffen Thorsen wrote:
+# > On Thursday (2010-03-25) it was announced that DST would start in
+# > Pakistan on 2010-04-01.
+# >
+# > Then today, the president said that they might have to revert the
+# > decision if it is not supported by the parliament. So at the time
+# > being, it seems unclear if DST will be actually observed or not - but
+# > April 1 could be a more likely date than April 15.
+# Now, it seems that the decision to not observe DST in final:
+#
+# "Govt Withdraws Plan To Advance Clocks"
+# 
+# http://www.apakistannews.com/govt-withdraws-plan-to-advance-clocks-172041
+# 
+#
+# "People laud PM's announcement to end DST"
+# 
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
 Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
-Rule Pakistan	2009	max	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	max	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: stable/8/share/zoneinfo/southamerica
==============================================================================
--- stable/8/share/zoneinfo/southamerica	Mon Apr 19 20:59:39 2010	(r206868)
+++ stable/8/share/zoneinfo/southamerica	Mon Apr 19 21:01:24 2010	(r206869)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.43
+# @(#)southamerica	8.44
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -437,6 +437,27 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:
 # of the country calls it "ART".
 # ...
 
+# From Alexander Krivenyshev (2010-04-09):
+# According to news reports from El Diario de la Republica Province San
+# Luis, Argentina (standard time UTC-04) will keep Daylight Saving Time
+# after April 11, 2010--will continue to have same time as rest of
+# Argentina (UTC-3) (no DST).
+#
+# Confirmaron la prórroga del huso horario de verano (Spanish)
+# 
+# http://www.eldiariodelarepublica.com/index.php?option=com_content&task=view&id=29383&Itemid=9
+# 
+# or (some English translation):
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_argentina08.html
+# 
+
+# From Mariano Absatz (2010-04-12):
+# yes...I can confirm this...and given that San Luis keeps calling
+# UTC-03:00 "summer time", we should't just let San Luis go back to "Arg"
+# rules...San Luis is still using "Western ARgentina Time" and it got
+# stuck on Summer daylight savings time even though the summer is over.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),
@@ -570,8 +591,8 @@ Zone America/Argentina/Mendoza -4:35:16 
 #
 # San Luis (SL)
 
-Rule	SanLuis	2008	max	-	Mar	Sun>=8	0:00	0	-
-Rule	SanLuis	2007	max	-	Oct	Sun>=8	0:00	1:00	S
+Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
+Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
 
 Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 21:01: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 BCB07106564A;
	Mon, 19 Apr 2010 21:01:26 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A97508FC20;
	Mon, 19 Apr 2010 21:01: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 o3JL1Q0R014996;
	Mon, 19 Apr 2010 21:01:26 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JL1Qat014992;
	Mon, 19 Apr 2010 21:01:26 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201004192101.o3JL1Qat014992@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 19 Apr 2010 21:01:26 +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: r206870 - stable/6/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: Mon, 19 Apr 2010 21:01:26 -0000

Author: edwin
Date: Mon Apr 19 21:01:26 2010
New Revision: 206870
URL: http://svn.freebsd.org/changeset/base/206870

Log:
  MFC of tzdata2010i, r206868
  
  - Marocco does have DST this year between May and August.
  - Historical data for Taiwan
  - Argentina / San Luis does not do DST this year.

Modified:
  stable/6/share/zoneinfo/africa
  stable/6/share/zoneinfo/asia
  stable/6/share/zoneinfo/southamerica
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/africa
==============================================================================
--- stable/6/share/zoneinfo/africa	Mon Apr 19 21:01:24 2010	(r206869)
+++ stable/6/share/zoneinfo/africa	Mon Apr 19 21:01:26 2010	(r206870)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.23
+# @(#)africa	8.26
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -680,6 +680,21 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
 # 
 
+# From Steffen Thorsen (2010-04-13):
+# Several news media in Morocco report that the Ministry of Modernization
+# of Public Sectors has announced that Morocco will have DST from
+# 2010-05-02 to 2010-08-08.
+#
+# Example:
+# 
+# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
+# 
+# (French)
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
+# 
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -701,6 +716,8 @@ Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
 Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
+Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
+Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16
@@ -942,6 +959,24 @@ Zone	Africa/Lome	0:04:52 -	LMT	1893
 # Therefore, the standard time will be kept unchanged the whole year long."
 # So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
 
+# From Alexander Krivenyshev (2010-03-27):
+# According to some news reports Tunis confirmed not to use DST in 2010
+#
+# (translation):
+# "The Tunisian government has decided to abandon DST, which was scheduled on
+# Sunday...
+# Tunisian authorities had suspended the DST for the first time last year also
+# coincided with the month of Ramadan..."
+#
+# (in Arabic)
+# 
+# http://www.moheet.com/show_news.aspx?nid=358861&pg=1
+# 
+# http://www.almadenahnews.com/newss/news.php?c=118&id=38036
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_tunis02.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Tunisia	1939	only	-	Apr	15	23:00s	1:00	S
 Rule	Tunisia	1939	only	-	Nov	18	23:00s	0	-
@@ -968,8 +1003,7 @@ Rule	Tunisia	2005	only	-	May	 1	 0:00s	1
 Rule	Tunisia	2005	only	-	Sep	30	 1:00s	0	-
 Rule	Tunisia	2006	2008	-	Mar	lastSun	 2:00s	1:00	S
 Rule	Tunisia	2006	2008	-	Oct	lastSun	 2:00s	0	-
-Rule	Tunisia	2010	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Tunisia	2010	max	-	Oct	lastSun	 2:00s	0	-
+
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.
 # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.

Modified: stable/6/share/zoneinfo/asia
==============================================================================
--- stable/6/share/zoneinfo/asia	Mon Apr 19 21:01:24 2010	(r206869)
+++ stable/6/share/zoneinfo/asia	Mon Apr 19 21:01:26 2010	(r206870)
@@ -1,4 +1,4 @@
-# @(#)asia	8.58
+# @(#)asia	8.60
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -566,6 +566,28 @@ Zone	Asia/Hong_Kong	7:36:36 -	LMT	1904 O
 # was still controlled by Japan.  This is hard to believe, but we don't
 # have any other information.
 
+# From smallufo (2010-04-03):
+# According to Taiwan's CWB,
+# 
+# http://www.cwb.gov.tw/V6/astronomy/cdata/summert.htm
+# 
+# Taipei has DST in 1979 between July 1st and Sep 30.
+
+# From Arthur David Olson (2010-04-07):
+# Here's Google's translation of the table at the bottom of the "summert.htm" page:
+# Decade 	                                                    Name                      Start and end date
+# Republic of China 34 years to 40 years (AD 1945-1951 years) Summer Time               May 1 to September 30 
+# 41 years of the Republic of China (AD 1952)                 Daylight Saving Time      March 1 to October 31 
+# Republic of China 42 years to 43 years (AD 1953-1954 years) Daylight Saving Time      April 1 to October 31 
+# In the 44 years to 45 years (AD 1955-1956 years)            Daylight Saving Time      April 1 to September 30 
+# Republic of China 46 years to 48 years (AD 1957-1959)       Summer Time               April 1 to September 30 
+# Republic of China 49 years to 50 years (AD 1960-1961)       Summer Time               June 1 to September 30 
+# Republic of China 51 years to 62 years (AD 1962-1973 years) Stop Summer Time 
+# Republic of China 63 years to 64 years (1974-1975 AD)       Daylight Saving Time      April 1 to September 30 
+# Republic of China 65 years to 67 years (1976-1978 AD)       Stop Daylight Saving Time 
+# Republic of China 68 years (AD 1979)                        Daylight Saving Time      July 1 to September 30 
+# Republic of China since 69 years (AD 1980)                  Stop Daylight Saving Time
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Taiwan	1945	1951	-	May	1	0:00	1:00	D
 Rule	Taiwan	1945	1951	-	Oct	1	0:00	0	S
@@ -576,8 +598,9 @@ Rule	Taiwan	1955	1961	-	Oct	1	0:00	0	S
 Rule	Taiwan	1960	1961	-	Jun	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Apr	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Oct	1	0:00	0	S
-Rule	Taiwan	1980	only	-	Jun	30	0:00	1:00	D
-Rule	Taiwan	1980	only	-	Sep	30	0:00	0	S
+Rule	Taiwan	1979	only	-	Jun	30	0:00	1:00	D
+Rule	Taiwan	1979	only	-	Sep	30	0:00	0	S
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Taipei	8:06:00 -	LMT	1896 # or Taibei or T'ai-pei
 			8:00	Taiwan	C%sT
@@ -1912,13 +1935,35 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # [T]he German Consulate General in Karachi reported me today that Pakistan
 # will go back to standard time on 1st of November.
 
+# From Steffen Thorsen (2010-03-26):
+# Steffen Thorsen wrote:
+# > On Thursday (2010-03-25) it was announced that DST would start in
+# > Pakistan on 2010-04-01.
+# >
+# > Then today, the president said that they might have to revert the
+# > decision if it is not supported by the parliament. So at the time
+# > being, it seems unclear if DST will be actually observed or not - but
+# > April 1 could be a more likely date than April 15.
+# Now, it seems that the decision to not observe DST in final:
+#
+# "Govt Withdraws Plan To Advance Clocks"
+# 
+# http://www.apakistannews.com/govt-withdraws-plan-to-advance-clocks-172041
+# 
+#
+# "People laud PM's announcement to end DST"
+# 
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
 Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
-Rule Pakistan	2009	max	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	max	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: stable/6/share/zoneinfo/southamerica
==============================================================================
--- stable/6/share/zoneinfo/southamerica	Mon Apr 19 21:01:24 2010	(r206869)
+++ stable/6/share/zoneinfo/southamerica	Mon Apr 19 21:01:26 2010	(r206870)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.43
+# @(#)southamerica	8.44
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -437,6 +437,27 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:
 # of the country calls it "ART".
 # ...
 
+# From Alexander Krivenyshev (2010-04-09):
+# According to news reports from El Diario de la Republica Province San
+# Luis, Argentina (standard time UTC-04) will keep Daylight Saving Time
+# after April 11, 2010--will continue to have same time as rest of
+# Argentina (UTC-3) (no DST).
+#
+# Confirmaron la prórroga del huso horario de verano (Spanish)
+# 
+# http://www.eldiariodelarepublica.com/index.php?option=com_content&task=view&id=29383&Itemid=9
+# 
+# or (some English translation):
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_argentina08.html
+# 
+
+# From Mariano Absatz (2010-04-12):
+# yes...I can confirm this...and given that San Luis keeps calling
+# UTC-03:00 "summer time", we should't just let San Luis go back to "Arg"
+# rules...San Luis is still using "Western ARgentina Time" and it got
+# stuck on Summer daylight savings time even though the summer is over.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),
@@ -570,8 +591,8 @@ Zone America/Argentina/Mendoza -4:35:16 
 #
 # San Luis (SL)
 
-Rule	SanLuis	2008	max	-	Mar	Sun>=8	0:00	0	-
-Rule	SanLuis	2007	max	-	Oct	Sun>=8	0:00	1:00	S
+Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
+Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
 
 Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 21:01: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 C9C371065677;
	Mon, 19 Apr 2010 21:01:29 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B690D8FC14;
	Mon, 19 Apr 2010 21:01: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 o3JL1Tj4015034;
	Mon, 19 Apr 2010 21:01:29 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JL1Tkg015030;
	Mon, 19 Apr 2010 21:01:29 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201004192101.o3JL1Tkg015030@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 19 Apr 2010 21:01: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: r206871 - stable/7/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: Mon, 19 Apr 2010 21:01:29 -0000

Author: edwin
Date: Mon Apr 19 21:01:29 2010
New Revision: 206871
URL: http://svn.freebsd.org/changeset/base/206871

Log:
  MFC of tzdata2010i, r206868
  
  - Marocco does have DST this year between May and August.
  - Historical data for Taiwan
  - Argentina / San Luis does not do DST this year.

Modified:
  stable/7/share/zoneinfo/africa
  stable/7/share/zoneinfo/asia
  stable/7/share/zoneinfo/southamerica
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/africa
==============================================================================
--- stable/7/share/zoneinfo/africa	Mon Apr 19 21:01:26 2010	(r206870)
+++ stable/7/share/zoneinfo/africa	Mon Apr 19 21:01:29 2010	(r206871)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.23
+# @(#)africa	8.26
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -680,6 +680,21 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
 # 
 
+# From Steffen Thorsen (2010-04-13):
+# Several news media in Morocco report that the Ministry of Modernization
+# of Public Sectors has announced that Morocco will have DST from
+# 2010-05-02 to 2010-08-08.
+#
+# Example:
+# 
+# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
+# 
+# (French)
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
+# 
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -701,6 +716,8 @@ Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
 Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
+Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
+Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16
@@ -942,6 +959,24 @@ Zone	Africa/Lome	0:04:52 -	LMT	1893
 # Therefore, the standard time will be kept unchanged the whole year long."
 # So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
 
+# From Alexander Krivenyshev (2010-03-27):
+# According to some news reports Tunis confirmed not to use DST in 2010
+#
+# (translation):
+# "The Tunisian government has decided to abandon DST, which was scheduled on
+# Sunday...
+# Tunisian authorities had suspended the DST for the first time last year also
+# coincided with the month of Ramadan..."
+#
+# (in Arabic)
+# 
+# http://www.moheet.com/show_news.aspx?nid=358861&pg=1
+# 
+# http://www.almadenahnews.com/newss/news.php?c=118&id=38036
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_tunis02.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Tunisia	1939	only	-	Apr	15	23:00s	1:00	S
 Rule	Tunisia	1939	only	-	Nov	18	23:00s	0	-
@@ -968,8 +1003,7 @@ Rule	Tunisia	2005	only	-	May	 1	 0:00s	1
 Rule	Tunisia	2005	only	-	Sep	30	 1:00s	0	-
 Rule	Tunisia	2006	2008	-	Mar	lastSun	 2:00s	1:00	S
 Rule	Tunisia	2006	2008	-	Oct	lastSun	 2:00s	0	-
-Rule	Tunisia	2010	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Tunisia	2010	max	-	Oct	lastSun	 2:00s	0	-
+
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.
 # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Mon Apr 19 21:01:26 2010	(r206870)
+++ stable/7/share/zoneinfo/asia	Mon Apr 19 21:01:29 2010	(r206871)
@@ -1,4 +1,4 @@
-# @(#)asia	8.58
+# @(#)asia	8.60
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -566,6 +566,28 @@ Zone	Asia/Hong_Kong	7:36:36 -	LMT	1904 O
 # was still controlled by Japan.  This is hard to believe, but we don't
 # have any other information.
 
+# From smallufo (2010-04-03):
+# According to Taiwan's CWB,
+# 
+# http://www.cwb.gov.tw/V6/astronomy/cdata/summert.htm
+# 
+# Taipei has DST in 1979 between July 1st and Sep 30.
+
+# From Arthur David Olson (2010-04-07):
+# Here's Google's translation of the table at the bottom of the "summert.htm" page:
+# Decade 	                                                    Name                      Start and end date
+# Republic of China 34 years to 40 years (AD 1945-1951 years) Summer Time               May 1 to September 30 
+# 41 years of the Republic of China (AD 1952)                 Daylight Saving Time      March 1 to October 31 
+# Republic of China 42 years to 43 years (AD 1953-1954 years) Daylight Saving Time      April 1 to October 31 
+# In the 44 years to 45 years (AD 1955-1956 years)            Daylight Saving Time      April 1 to September 30 
+# Republic of China 46 years to 48 years (AD 1957-1959)       Summer Time               April 1 to September 30 
+# Republic of China 49 years to 50 years (AD 1960-1961)       Summer Time               June 1 to September 30 
+# Republic of China 51 years to 62 years (AD 1962-1973 years) Stop Summer Time 
+# Republic of China 63 years to 64 years (1974-1975 AD)       Daylight Saving Time      April 1 to September 30 
+# Republic of China 65 years to 67 years (1976-1978 AD)       Stop Daylight Saving Time 
+# Republic of China 68 years (AD 1979)                        Daylight Saving Time      July 1 to September 30 
+# Republic of China since 69 years (AD 1980)                  Stop Daylight Saving Time
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Taiwan	1945	1951	-	May	1	0:00	1:00	D
 Rule	Taiwan	1945	1951	-	Oct	1	0:00	0	S
@@ -576,8 +598,9 @@ Rule	Taiwan	1955	1961	-	Oct	1	0:00	0	S
 Rule	Taiwan	1960	1961	-	Jun	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Apr	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Oct	1	0:00	0	S
-Rule	Taiwan	1980	only	-	Jun	30	0:00	1:00	D
-Rule	Taiwan	1980	only	-	Sep	30	0:00	0	S
+Rule	Taiwan	1979	only	-	Jun	30	0:00	1:00	D
+Rule	Taiwan	1979	only	-	Sep	30	0:00	0	S
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Taipei	8:06:00 -	LMT	1896 # or Taibei or T'ai-pei
 			8:00	Taiwan	C%sT
@@ -1912,13 +1935,35 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # [T]he German Consulate General in Karachi reported me today that Pakistan
 # will go back to standard time on 1st of November.
 
+# From Steffen Thorsen (2010-03-26):
+# Steffen Thorsen wrote:
+# > On Thursday (2010-03-25) it was announced that DST would start in
+# > Pakistan on 2010-04-01.
+# >
+# > Then today, the president said that they might have to revert the
+# > decision if it is not supported by the parliament. So at the time
+# > being, it seems unclear if DST will be actually observed or not - but
+# > April 1 could be a more likely date than April 15.
+# Now, it seems that the decision to not observe DST in final:
+#
+# "Govt Withdraws Plan To Advance Clocks"
+# 
+# http://www.apakistannews.com/govt-withdraws-plan-to-advance-clocks-172041
+# 
+#
+# "People laud PM's announcement to end DST"
+# 
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
 Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
-Rule Pakistan	2009	max	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	max	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: stable/7/share/zoneinfo/southamerica
==============================================================================
--- stable/7/share/zoneinfo/southamerica	Mon Apr 19 21:01:26 2010	(r206870)
+++ stable/7/share/zoneinfo/southamerica	Mon Apr 19 21:01:29 2010	(r206871)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.43
+# @(#)southamerica	8.44
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -437,6 +437,27 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:
 # of the country calls it "ART".
 # ...
 
+# From Alexander Krivenyshev (2010-04-09):
+# According to news reports from El Diario de la Republica Province San
+# Luis, Argentina (standard time UTC-04) will keep Daylight Saving Time
+# after April 11, 2010--will continue to have same time as rest of
+# Argentina (UTC-3) (no DST).
+#
+# Confirmaron la prórroga del huso horario de verano (Spanish)
+# 
+# http://www.eldiariodelarepublica.com/index.php?option=com_content&task=view&id=29383&Itemid=9
+# 
+# or (some English translation):
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_argentina08.html
+# 
+
+# From Mariano Absatz (2010-04-12):
+# yes...I can confirm this...and given that San Luis keeps calling
+# UTC-03:00 "summer time", we should't just let San Luis go back to "Arg"
+# rules...San Luis is still using "Western ARgentina Time" and it got
+# stuck on Summer daylight savings time even though the summer is over.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),
@@ -570,8 +591,8 @@ Zone America/Argentina/Mendoza -4:35:16 
 #
 # San Luis (SL)
 
-Rule	SanLuis	2008	max	-	Mar	Sun>=8	0:00	0	-
-Rule	SanLuis	2007	max	-	Oct	Sun>=8	0:00	1:00	S
+Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
+Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
 
 Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 21:02: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 3303A106564A;
	Mon, 19 Apr 2010 21:02:55 +0000 (UTC)
	(envelope-from keramida@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 216D38FC16;
	Mon, 19 Apr 2010 21:02: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 o3JL2tnh015402;
	Mon, 19 Apr 2010 21:02:55 GMT
	(envelope-from keramida@svn.freebsd.org)
Received: (from keramida@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JL2tQh015400;
	Mon, 19 Apr 2010 21:02:55 GMT
	(envelope-from keramida@svn.freebsd.org)
Message-Id: <201004192102.o3JL2tQh015400@svn.freebsd.org>
From: Giorgos Keramidas 
Date: Mon, 19 Apr 2010 21:02: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: r206872 - stable/7/lib/libgssapi
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, 19 Apr 2010 21:02:55 -0000

Author: keramida (doc committer)
Date: Mon Apr 19 21:02:54 2010
New Revision: 206872
URL: http://svn.freebsd.org/changeset/base/206872

Log:
  MFC 173194
  
  Remove an extra (commented out) .Sh HISTORY section heading, to avoid
  the risk of "shadowing" the following .El request, and delete an empty
  line to fix mdoc warnings.

Modified:
  stable/7/lib/libgssapi/gss_inquire_mechs_for_name.3
Directory Properties:
  stable/7/lib/libgssapi/   (props changed)

Modified: stable/7/lib/libgssapi/gss_inquire_mechs_for_name.3
==============================================================================
--- stable/7/lib/libgssapi/gss_inquire_mechs_for_name.3	Mon Apr 19 21:01:29 2010	(r206871)
+++ stable/7/lib/libgssapi/gss_inquire_mechs_for_name.3	Mon Apr 19 21:02:54 2010	(r206872)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd November 12, 2005
+.Dd October 30, 2007
 .Os
 .Dt GSS_INQUIRE_MECHS_FOR_NAME 3 PRM
 .Sh NAME
@@ -47,7 +47,6 @@
 Returns the set of mechanisms supported by the GSS-API implementation
 that may be able to process the specified name.
 .Pp
-   
 Each mechanism returned will recognize at least one element within the
 name.
 It is permissible for this routine to be implemented within a
@@ -97,7 +96,6 @@ parameter was ill-formed
 Generic Security Service Application Program Interface Version 2, Update 1
 .It RFC 2744
 Generic Security Service API Version 2 : C-bindings
-.\" .Sh HISTORY
 .El
 .Sh HISTORY
 The

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 22:10: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 C6372106566B;
	Mon, 19 Apr 2010 22:10:40 +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 B3D898FC14;
	Mon, 19 Apr 2010 22:10: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 o3JMAe8a030474;
	Mon, 19 Apr 2010 22:10:40 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JMAeHY030467;
	Mon, 19 Apr 2010 22:10:40 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201004192210.o3JMAeHY030467@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Mon, 19 Apr 2010 22:10: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: r206876 - in head/sys/dev: age alc ale fxp msk nfe
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, 19 Apr 2010 22:10:40 -0000

Author: yongari
Date: Mon Apr 19 22:10:40 2010
New Revision: 206876
URL: http://svn.freebsd.org/changeset/base/206876

Log:
  With r206844, CSUM_TCP is also set for CSUM_TSO case. Modify
  drivers to take into account for the change. Basically CSUM_TSO
  should be checked before checking CSUM_TCP.

Modified:
  head/sys/dev/age/if_age.c
  head/sys/dev/alc/if_alc.c
  head/sys/dev/ale/if_ale.c
  head/sys/dev/fxp/if_fxp.c
  head/sys/dev/msk/if_msk.c
  head/sys/dev/nfe/if_nfe.c

Modified: head/sys/dev/age/if_age.c
==============================================================================
--- head/sys/dev/age/if_age.c	Mon Apr 19 22:01:59 2010	(r206875)
+++ head/sys/dev/age/if_age.c	Mon Apr 19 22:10:40 2010	(r206876)
@@ -1629,22 +1629,8 @@ age_encap(struct age_softc *sc, struct m
 	}
 
 	m = *m_head;
-	/* Configure Tx IP/TCP/UDP checksum offload. */
-	if ((m->m_pkthdr.csum_flags & AGE_CSUM_FEATURES) != 0) {
-		cflags |= AGE_TD_CSUM;
-		if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0)
-			cflags |= AGE_TD_TCPCSUM;
-		if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0)
-			cflags |= AGE_TD_UDPCSUM;
-		/* Set checksum start offset. */
-		cflags |= (poff << AGE_TD_CSUM_PLOADOFFSET_SHIFT);
-		/* Set checksum insertion position of TCP/UDP. */
-		cflags |= ((poff + m->m_pkthdr.csum_data) <<
-		    AGE_TD_CSUM_XSUMOFFSET_SHIFT);
-	}
-
-	/* Configure TSO. */
 	if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
+		/* Configure TSO. */
 		if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) {
 			/* Not TSO but IP/TCP checksum offload. */
 			cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM;
@@ -1660,6 +1646,18 @@ age_encap(struct age_softc *sc, struct m
 		/* Set IP/TCP header size. */
 		cflags |= ip->ip_hl << AGE_TD_IPHDR_LEN_SHIFT;
 		cflags |= tcp->th_off << AGE_TD_TSO_TCPHDR_LEN_SHIFT;
+	} else if ((m->m_pkthdr.csum_flags & AGE_CSUM_FEATURES) != 0) {
+		/* Configure Tx IP/TCP/UDP checksum offload. */
+		cflags |= AGE_TD_CSUM;
+		if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0)
+			cflags |= AGE_TD_TCPCSUM;
+		if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0)
+			cflags |= AGE_TD_UDPCSUM;
+		/* Set checksum start offset. */
+		cflags |= (poff << AGE_TD_CSUM_PLOADOFFSET_SHIFT);
+		/* Set checksum insertion position of TCP/UDP. */
+		cflags |= ((poff + m->m_pkthdr.csum_data) <<
+		    AGE_TD_CSUM_XSUMOFFSET_SHIFT);
 	}
 
 	/* Configure VLAN hardware tag insertion. */

Modified: head/sys/dev/alc/if_alc.c
==============================================================================
--- head/sys/dev/alc/if_alc.c	Mon Apr 19 22:01:59 2010	(r206875)
+++ head/sys/dev/alc/if_alc.c	Mon Apr 19 22:10:40 2010	(r206876)
@@ -1908,28 +1908,7 @@ alc_encap(struct alc_softc *sc, struct m
 		vtag = (vtag << TD_VLAN_SHIFT) & TD_VLAN_MASK;
 		cflags |= TD_INS_VLAN_TAG;
 	}
-	/* Configure Tx checksum offload. */
-	if ((m->m_pkthdr.csum_flags & ALC_CSUM_FEATURES) != 0) {
-#ifdef ALC_USE_CUSTOM_CSUM
-		cflags |= TD_CUSTOM_CSUM;
-		/* Set checksum start offset. */
-		cflags |= ((poff >> 1) << TD_PLOAD_OFFSET_SHIFT) &
-		    TD_PLOAD_OFFSET_MASK;
-		/* Set checksum insertion position of TCP/UDP. */
-		cflags |= (((poff + m->m_pkthdr.csum_data) >> 1) <<
-		    TD_CUSTOM_CSUM_OFFSET_SHIFT) & TD_CUSTOM_CSUM_OFFSET_MASK;
-#else
-		if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0)
-			cflags |= TD_IPCSUM;
-		if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0)
-			cflags |= TD_TCPCSUM;
-		if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0)
-			cflags |= TD_UDPCSUM;
-		/* Set TCP/UDP header offset. */
-		cflags |= (poff << TD_L4HDR_OFFSET_SHIFT) &
-		    TD_L4HDR_OFFSET_MASK;
-#endif
-	} else if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
+	if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
 		/* Request TSO and set MSS. */
 		cflags |= TD_TSO | TD_TSO_DESCV1;
 		cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << TD_MSS_SHIFT) &
@@ -1961,6 +1940,27 @@ alc_encap(struct alc_softc *sc, struct m
 		}
 		/* Handle remaining fragments. */
 		idx = 1;
+	} else if ((m->m_pkthdr.csum_flags & ALC_CSUM_FEATURES) != 0) {
+		/* Configure Tx checksum offload. */
+#ifdef ALC_USE_CUSTOM_CSUM
+		cflags |= TD_CUSTOM_CSUM;
+		/* Set checksum start offset. */
+		cflags |= ((poff >> 1) << TD_PLOAD_OFFSET_SHIFT) &
+		    TD_PLOAD_OFFSET_MASK;
+		/* Set checksum insertion position of TCP/UDP. */
+		cflags |= (((poff + m->m_pkthdr.csum_data) >> 1) <<
+		    TD_CUSTOM_CSUM_OFFSET_SHIFT) & TD_CUSTOM_CSUM_OFFSET_MASK;
+#else
+		if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0)
+			cflags |= TD_IPCSUM;
+		if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0)
+			cflags |= TD_TCPCSUM;
+		if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0)
+			cflags |= TD_UDPCSUM;
+		/* Set TCP/UDP header offset. */
+		cflags |= (poff << TD_L4HDR_OFFSET_SHIFT) &
+		    TD_L4HDR_OFFSET_MASK;
+#endif
 	}
 	for (; idx < nsegs; idx++) {
 		desc = &sc->alc_rdata.alc_tx_ring[prod];

Modified: head/sys/dev/ale/if_ale.c
==============================================================================
--- head/sys/dev/ale/if_ale.c	Mon Apr 19 22:01:59 2010	(r206875)
+++ head/sys/dev/ale/if_ale.c	Mon Apr 19 22:10:40 2010	(r206876)
@@ -1737,8 +1737,14 @@ ale_encap(struct ale_softc *sc, struct m
 	bus_dmamap_sync(sc->ale_cdata.ale_tx_tag, map, BUS_DMASYNC_PREWRITE);
 
 	m = *m_head;
-	/* Configure Tx checksum offload. */
-	if ((m->m_pkthdr.csum_flags & ALE_CSUM_FEATURES) != 0) {
+	if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
+		/* Request TSO and set MSS. */
+		cflags |= ALE_TD_TSO;
+		cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << ALE_TD_MSS_SHIFT);
+		/* Set IP/TCP header size. */
+		cflags |= ip->ip_hl << ALE_TD_IPHDR_LEN_SHIFT;
+		cflags |= tcp->th_off << ALE_TD_TCPHDR_LEN_SHIFT;
+	} else if ((m->m_pkthdr.csum_flags & ALE_CSUM_FEATURES) != 0) {
 		/*
 		 * AR81xx supports Tx custom checksum offload feature
 		 * that offloads single 16bit checksum computation.
@@ -1769,15 +1775,6 @@ ale_encap(struct ale_softc *sc, struct m
 		    ALE_TD_CSUM_XSUMOFFSET_SHIFT);
 	}
 
-	if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
-		/* Request TSO and set MSS. */
-		cflags |= ALE_TD_TSO;
-		cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << ALE_TD_MSS_SHIFT);
-		/* Set IP/TCP header size. */
-		cflags |= ip->ip_hl << ALE_TD_IPHDR_LEN_SHIFT;
-		cflags |= tcp->th_off << ALE_TD_TCPHDR_LEN_SHIFT;
-	}
-
 	/* Configure VLAN hardware tag insertion. */
 	if ((m->m_flags & M_VLANTAG) != 0) {
 		vtag = ALE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag);

Modified: head/sys/dev/fxp/if_fxp.c
==============================================================================
--- head/sys/dev/fxp/if_fxp.c	Mon Apr 19 22:01:59 2010	(r206875)
+++ head/sys/dev/fxp/if_fxp.c	Mon Apr 19 22:10:40 2010	(r206876)
@@ -1417,60 +1417,6 @@ fxp_encap(struct fxp_softc *sc, struct m
 		    FXP_IPCB_HARDWAREPARSING_ENABLE;
 
 	m = *m_head;
-	/*
-	 * Deal with TCP/IP checksum offload. Note that
-	 * in order for TCP checksum offload to work,
-	 * the pseudo header checksum must have already
-	 * been computed and stored in the checksum field
-	 * in the TCP header. The stack should have
-	 * already done this for us.
-	 */
-	if (m->m_pkthdr.csum_flags & FXP_CSUM_FEATURES) {
-		txp->tx_cb->ipcb_ip_schedule = FXP_IPCB_TCPUDP_CHECKSUM_ENABLE;
-		if (m->m_pkthdr.csum_flags & CSUM_TCP)
-			txp->tx_cb->ipcb_ip_schedule |= FXP_IPCB_TCP_PACKET;
-
-#ifdef FXP_IP_CSUM_WAR
-		/*
-		 * XXX The 82550 chip appears to have trouble
-		 * dealing with IP header checksums in very small
-		 * datagrams, namely fragments from 1 to 3 bytes
-		 * in size. For example, say you want to transmit
-		 * a UDP packet of 1473 bytes. The packet will be
-		 * fragmented over two IP datagrams, the latter
-		 * containing only one byte of data. The 82550 will
-		 * botch the header checksum on the 1-byte fragment.
-		 * As long as the datagram contains 4 or more bytes
-		 * of data, you're ok.
-		 *
-                 * The following code attempts to work around this
-		 * problem: if the datagram is less than 38 bytes
-		 * in size (14 bytes ether header, 20 bytes IP header,
-		 * plus 4 bytes of data), we punt and compute the IP
-		 * header checksum by hand. This workaround doesn't
-		 * work very well, however, since it can be fooled
-		 * by things like VLAN tags and IP options that make
-		 * the header sizes/offsets vary.
-		 */
-
-		if (m->m_pkthdr.csum_flags & CSUM_IP) {
-			if (m->m_pkthdr.len < 38) {
-				struct ip *ip;
-				m->m_data += ETHER_HDR_LEN;
-				ip = mtod(m, struct ip *);
-				ip->ip_sum = in_cksum(m, ip->ip_hl << 2);
-				m->m_data -= ETHER_HDR_LEN;
-				m->m_pkthdr.csum_flags &= ~CSUM_IP;
-			} else {
-				txp->tx_cb->ipcb_ip_activation_high =
-				    FXP_IPCB_HARDWAREPARSING_ENABLE;
-				txp->tx_cb->ipcb_ip_schedule |=
-				    FXP_IPCB_IP_CHECKSUM_ENABLE;
-			}
-		}
-#endif
-	}
-
 	if (m->m_pkthdr.csum_flags & CSUM_TSO) {
 		/*
 		 * 82550/82551 requires ethernet/IP/TCP headers must be
@@ -1539,6 +1485,58 @@ fxp_encap(struct fxp_softc *sc, struct m
 		tcp_payload = m->m_pkthdr.len - ip_off - (ip->ip_hl << 2);
 		tcp_payload -= tcp->th_off << 2;
 		*m_head = m;
+	} else if (m->m_pkthdr.csum_flags & FXP_CSUM_FEATURES) {
+		/*
+		 * Deal with TCP/IP checksum offload. Note that
+		 * in order for TCP checksum offload to work,
+		 * the pseudo header checksum must have already
+		 * been computed and stored in the checksum field
+		 * in the TCP header. The stack should have
+		 * already done this for us.
+		 */
+		txp->tx_cb->ipcb_ip_schedule = FXP_IPCB_TCPUDP_CHECKSUM_ENABLE;
+		if (m->m_pkthdr.csum_flags & CSUM_TCP)
+			txp->tx_cb->ipcb_ip_schedule |= FXP_IPCB_TCP_PACKET;
+
+#ifdef FXP_IP_CSUM_WAR
+		/*
+		 * XXX The 82550 chip appears to have trouble
+		 * dealing with IP header checksums in very small
+		 * datagrams, namely fragments from 1 to 3 bytes
+		 * in size. For example, say you want to transmit
+		 * a UDP packet of 1473 bytes. The packet will be
+		 * fragmented over two IP datagrams, the latter
+		 * containing only one byte of data. The 82550 will
+		 * botch the header checksum on the 1-byte fragment.
+		 * As long as the datagram contains 4 or more bytes
+		 * of data, you're ok.
+		 *
+                 * The following code attempts to work around this
+		 * problem: if the datagram is less than 38 bytes
+		 * in size (14 bytes ether header, 20 bytes IP header,
+		 * plus 4 bytes of data), we punt and compute the IP
+		 * header checksum by hand. This workaround doesn't
+		 * work very well, however, since it can be fooled
+		 * by things like VLAN tags and IP options that make
+		 * the header sizes/offsets vary.
+		 */
+
+		if (m->m_pkthdr.csum_flags & CSUM_IP) {
+			if (m->m_pkthdr.len < 38) {
+				struct ip *ip;
+				m->m_data += ETHER_HDR_LEN;
+				ip = mtod(m, struct ip *);
+				ip->ip_sum = in_cksum(m, ip->ip_hl << 2);
+				m->m_data -= ETHER_HDR_LEN;
+				m->m_pkthdr.csum_flags &= ~CSUM_IP;
+			} else {
+				txp->tx_cb->ipcb_ip_activation_high =
+				    FXP_IPCB_HARDWAREPARSING_ENABLE;
+				txp->tx_cb->ipcb_ip_schedule |=
+				    FXP_IPCB_IP_CHECKSUM_ENABLE;
+			}
+		}
+#endif
 	}
 
 	error = bus_dmamap_load_mbuf_sg(sc->fxp_txmtag, txp->tx_map, *m_head,

Modified: head/sys/dev/msk/if_msk.c
==============================================================================
--- head/sys/dev/msk/if_msk.c	Mon Apr 19 22:01:59 2010	(r206875)
+++ head/sys/dev/msk/if_msk.c	Mon Apr 19 22:10:40 2010	(r206876)
@@ -2605,23 +2605,32 @@ msk_encap(struct msk_if_softc *sc_if, st
 		ip = (struct ip *)(mtod(m, char *) + offset);
 		offset += (ip->ip_hl << 2);
 		tcp_offset = offset;
-		/*
-		 * It seems that Yukon II has Tx checksum offload bug for
-		 * small TCP packets that's less than 60 bytes in size
-		 * (e.g. TCP window probe packet, pure ACK packet).
-		 * Common work around like padding with zeros to make the
-		 * frame minimum ethernet frame size didn't work at all.
-		 * Instead of disabling checksum offload completely we
-		 * resort to S/W checksum routine when we encounter short
-		 * TCP frames.
-		 * Short UDP packets appear to be handled correctly by
-		 * Yukon II. Also I assume this bug does not happen on
-		 * controllers that use newer descriptor format or
-		 * automatic Tx checksum calaulcation.
-		 */
-		if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 &&
+		if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
+			m = m_pullup(m, offset + sizeof(struct tcphdr));
+			if (m == NULL) {
+				*m_head = NULL;
+				return (ENOBUFS);
+			}
+			tcp = (struct tcphdr *)(mtod(m, char *) + offset);
+			offset += (tcp->th_off << 2);
+		} else if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 &&
 		    (m->m_pkthdr.len < MSK_MIN_FRAMELEN) &&
 		    (m->m_pkthdr.csum_flags & CSUM_TCP) != 0) {
+			/*
+			 * It seems that Yukon II has Tx checksum offload bug
+			 * for small TCP packets that's less than 60 bytes in
+			 * size (e.g. TCP window probe packet, pure ACK packet).
+			 * Common work around like padding with zeros to make
+			 * the frame minimum ethernet frame size didn't work at
+			 * all.
+			 * Instead of disabling checksum offload completely we
+			 * resort to S/W checksum routine when we encounter
+			 * short TCP frames.
+			 * Short UDP packets appear to be handled correctly by
+			 * Yukon II. Also I assume this bug does not happen on
+			 * controllers that use newer descriptor format or
+			 * automatic Tx checksum calaulcation.
+			 */
 			m = m_pullup(m, offset + sizeof(struct tcphdr));
 			if (m == NULL) {
 				*m_head = NULL;
@@ -2632,15 +2641,6 @@ msk_encap(struct msk_if_softc *sc_if, st
 			    m->m_pkthdr.len, offset);
 			m->m_pkthdr.csum_flags &= ~CSUM_TCP;
 		}
-		if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
-			m = m_pullup(m, offset + sizeof(struct tcphdr));
-			if (m == NULL) {
-				*m_head = NULL;
-				return (ENOBUFS);
-			}
-			tcp = (struct tcphdr *)(mtod(m, char *) + offset);
-			offset += (tcp->th_off << 2);
-		}
 		*m_head = m;
 	}
 

Modified: head/sys/dev/nfe/if_nfe.c
==============================================================================
--- head/sys/dev/nfe/if_nfe.c	Mon Apr 19 22:01:59 2010	(r206875)
+++ head/sys/dev/nfe/if_nfe.c	Mon Apr 19 22:10:40 2010	(r206876)
@@ -2366,7 +2366,12 @@ nfe_encap(struct nfe_softc *sc, struct m
 	m = *m_head;
 	cflags = flags = 0;
 	tso_segsz = 0;
-	if ((m->m_pkthdr.csum_flags & NFE_CSUM_FEATURES) != 0) {
+	if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
+		tso_segsz = (uint32_t)m->m_pkthdr.tso_segsz <<
+		    NFE_TX_TSO_SHIFT;
+		cflags &= ~(NFE_TX_IP_CSUM | NFE_TX_TCP_UDP_CSUM);
+		cflags |= NFE_TX_TSO;
+	} else if ((m->m_pkthdr.csum_flags & NFE_CSUM_FEATURES) != 0) {
 		if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0)
 			cflags |= NFE_TX_IP_CSUM;
 		if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0)
@@ -2374,12 +2379,6 @@ nfe_encap(struct nfe_softc *sc, struct m
 		if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0)
 			cflags |= NFE_TX_TCP_UDP_CSUM;
 	}
-	if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
-		tso_segsz = (uint32_t)m->m_pkthdr.tso_segsz <<
-		    NFE_TX_TSO_SHIFT;
-		cflags &= ~(NFE_TX_IP_CSUM | NFE_TX_TCP_UDP_CSUM);
-		cflags |= NFE_TX_TSO;
-	}
 
 	for (i = 0; i < nsegs; i++) {
 		if (sc->nfe_flags & NFE_40BIT_ADDR) {

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 23:12: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 5AB02106566C;
	Mon, 19 Apr 2010 23:12:05 +0000 (UTC)
	(envelope-from julianelischer@gmail.com)
Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com
	[209.85.212.54])
	by mx1.freebsd.org (Postfix) with ESMTP id B78FC8FC0C;
	Mon, 19 Apr 2010 23:12:04 +0000 (UTC)
Received: by vws18 with SMTP id 18so437382vws.13
	for ; Mon, 19 Apr 2010 16:12:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:message-id:date:from
	:user-agent:mime-version:to:cc:subject:references:in-reply-to
	:content-type:content-transfer-encoding;
	bh=Og/6YkpE3c1nDUyQeFOe1G3BxS6Y357VcAyiDClahHY=;
	b=aalRj3lErwlgrdNAiP8Z9NSPlwvHquPCH1vXqTTUNIlMFbuEZrwZ79dAlCaMSDO/uD
	JIgdvFc6gNUY57YH6AsbG98jMc2155XDY5QE5+fOIq/qGbUh5DMXtC+ROqtYyCptoalf
	5/jA2eD6z3fSk1BRxgkNK/r3RTHxGM8rDaLgA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	b=P3cC2yq69BaBd17sLZqEaIFXZD8Uy5V9oGm2+y3uFACwdJGEt7X5wrI+jKBD1rqk+r
	00r+RqbnEbrmWRwfAdfEr0mIde2tE78z8mN09NJBTmBLT+NFMfdDOR8ecWBFzXXpymmS
	9WjEmDs+vpA18inYGC6rg8Rpq+H4fVx4y2cew=
Received: by 10.220.128.22 with SMTP id i22mr4044506vcs.20.1271717068482;
	Mon, 19 Apr 2010 15:44:28 -0700 (PDT)
Received: from julian-mac.elischer.org
	(h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137])
	by mx.google.com with ESMTPS id m13sm20659521vcs.13.2010.04.19.15.44.26
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Mon, 19 Apr 2010 15:44:27 -0700 (PDT)
Sender: Julian Elischer 
Message-ID: <4BCCDCC9.2070604@elischer.org>
Date: Mon, 19 Apr 2010 15:44:25 -0700
From: Julian Elischer 
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US;
	rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
MIME-Version: 1.0
To: Robert Noland 
References: <201004191511.o3JFBjLj036350@svn.freebsd.org>
	<4BCC7E64.4040200@FreeBSD.org>
In-Reply-To: <4BCC7E64.4040200@FreeBSD.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, Luigi Rizzo ,
	src-committers@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r206843 - head/sbin/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: Mon, 19 Apr 2010 23:12:05 -0000

On 4/19/10 9:01 AM, Robert Noland wrote:
>
>
> Luigi Rizzo wrote:


[...]

> Index: sbin/ipfw/ipfw2.c
> ===================================================================
> --- sbin/ipfw/ipfw2.c (revision 206844)
> +++ sbin/ipfw/ipfw2.c (working copy)
> @@ -326,7 +326,7 @@
> #ifdef TCC
> #define U64_FMT "I64"
> #else
> -#define U64_FMT "llu"
> +#define U64_FMT "ju"
> #endif
> uint64_t d;

  believe there is a posix define for this?
(though I can't remember it right now).

>
> robert.

[...]

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 23:25: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 936EF1065670
	for ; Mon, 19 Apr 2010 23:25:16 +0000 (UTC)
	(envelope-from joerg@britannica.bec.de)
Received: from www.sonnenberger.org (www.sonnenberger.org [92.79.50.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 56A0E8FC20
	for ; Mon, 19 Apr 2010 23:25:16 +0000 (UTC)
Received: from britannica.bec.de (www.sonnenberger.org [192.168.1.10])
	by www.sonnenberger.org (Postfix) with ESMTP id 9E47E667A0
	for ; Tue, 20 Apr 2010 01:25:14 +0200 (CEST)
Received: by britannica.bec.de (Postfix, from userid 1000)
	id 5761415C6E; Tue, 20 Apr 2010 01:23:47 +0200 (CEST)
Date: Tue, 20 Apr 2010 01:23:47 +0200
From: Joerg Sonnenberger 
To: svn-src-all@freebsd.org
Message-ID: <20100419232347.GA21192@britannica.bec.de>
References: <201004191511.o3JFBjLj036350@svn.freebsd.org>
	<4BCC7E64.4040200@FreeBSD.org> <4BCCDCC9.2070604@elischer.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4BCCDCC9.2070604@elischer.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Subject: Re: svn commit: r206843 - head/sbin/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: Mon, 19 Apr 2010 23:25:16 -0000

On Mon, Apr 19, 2010 at 03:44:25PM -0700, Julian Elischer wrote:
> >Index: sbin/ipfw/ipfw2.c
> >===================================================================
> >--- sbin/ipfw/ipfw2.c (revision 206844)
> >+++ sbin/ipfw/ipfw2.c (working copy)
> >@@ -326,7 +326,7 @@
> >#ifdef TCC
> >#define U64_FMT "I64"
> >#else
> >-#define U64_FMT "llu"
> >+#define U64_FMT "ju"
> >#endif
> >uint64_t d;
> 
>  believe there is a posix define for this?
> (though I can't remember it right now).

PRIu64

Joerg

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 23: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 D6C951065675;
	Mon, 19 Apr 2010 23:27:54 +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 AB9478FC19;
	Mon, 19 Apr 2010 23: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 o3JNRsrA047858;
	Mon, 19 Apr 2010 23:27:54 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JNRsK4047856;
	Mon, 19 Apr 2010 23:27:54 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201004192327.o3JNRsK4047856@svn.freebsd.org>
From: Attilio Rao 
Date: Mon, 19 Apr 2010 23:27: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: r206878 - 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, 19 Apr 2010 23:27:54 -0000

Author: attilio
Date: Mon Apr 19 23:27:54 2010
New Revision: 206878
URL: http://svn.freebsd.org/changeset/base/206878

Log:
  Fix a deadlock in the shutdown code:
  When performing a smp_rendezvous() or more likely, on amd64 and i386,
  a smp_tlb_shootdown() the caller will end up with the smp_ipi_mtx
  spinlock held, busy-waiting for other CPUs to acknowledge the operation.
  As long as CPUs are suspended (via cpu_reset()) between the active mask
  read and IPI sending there can be a deadlock where the caller will wait
  forever for a dead CPU to acknowledge the operation.
  Please note that on CPU0 that is going to be someway heavier because of
  the spinlocks being disabled earlier than quitting the machine.
  
  Fix this bug by calling cpu_reset() with the smp_ipi_mtx held.
  Note that it is very likely that a saner offline/online CPUs mechanism
  will help heavilly in fixing similar cases as it is likely more bugs
  of this type may arise in the future.
  
  Reported by:	rwatson
  Discussed with:	jhb
  Tested by:	rnoland, Giovanni Trematerra
  		
  MFC:		2 weeks
  
  Special deciation to:	anyone who made possible to have 16-ways machines
  			in Netperf

Modified:
  head/sys/kern/kern_shutdown.c

Modified: head/sys/kern/kern_shutdown.c
==============================================================================
--- head/sys/kern/kern_shutdown.c	Mon Apr 19 22:15:40 2010	(r206877)
+++ head/sys/kern/kern_shutdown.c	Mon Apr 19 23:27:54 2010	(r206878)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 		/* smp_active */
+#include 
 #include 
 #include 
 
@@ -485,15 +485,20 @@ static void
 shutdown_reset(void *junk, int howto)
 {
 
+	printf("Rebooting...\n");
+	DELAY(1000000);	/* wait 1 sec for printf's to complete and be read */
+
 	/*
-	 * Disable interrupts on CPU0 in order to avoid fast handlers
-	 * to preempt the stopping process and to deadlock against other
-	 * CPUs.
+	 * Acquiring smp_ipi_mtx here has a double effect:
+	 * - it disables interrupts avoiding CPU0 preemption
+	 *   by fast handlers (thus deadlocking  against other CPUs)
+	 * - it avoids deadlocks against smp_rendezvous() or, more 
+	 *   generally, threads busy-waiting, with this spinlock held,
+	 *   and waiting for responses by threads on other CPUs
+	 *   (ie. smp_tlb_shootdown()).
 	 */
-	spinlock_enter();
+	mtx_lock_spin(&smp_ipi_mtx);
 
-	printf("Rebooting...\n");
-	DELAY(1000000);	/* wait 1 sec for printf's to complete and be read */
 	/* cpu_boot(howto); */ /* doesn't do anything at the moment */
 	cpu_reset();
 	/* NOTREACHED */ /* assuming reset worked */

From owner-svn-src-all@FreeBSD.ORG  Mon Apr 19 23:40: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 7FCDC1065675;
	Mon, 19 Apr 2010 23:40:46 +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 6FA6D8FC12;
	Mon, 19 Apr 2010 23:40: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 o3JNekjH050683;
	Mon, 19 Apr 2010 23:40:46 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JNeksX050681;
	Mon, 19 Apr 2010 23:40:46 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201004192340.o3JNeksX050681@svn.freebsd.org>
From: Attilio Rao 
Date: Mon, 19 Apr 2010 23:40: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: r206879 - 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, 19 Apr 2010 23:40:46 -0000

Author: attilio
Date: Mon Apr 19 23:40:46 2010
New Revision: 206879
URL: http://svn.freebsd.org/changeset/base/206879

Log:
  getblk lockmgr is mostly used as a msleep() and may lead too easilly to
  false positives.
  Whitelist it.
  
  Reported by:	Erik Cederstrand 

Modified:
  head/sys/kern/kern_clock.c

Modified: head/sys/kern/kern_clock.c
==============================================================================
--- head/sys/kern/kern_clock.c	Mon Apr 19 23:27:54 2010	(r206878)
+++ head/sys/kern/kern_clock.c	Mon Apr 19 23:40:46 2010	(r206879)
@@ -163,6 +163,7 @@ SYSCTL_PROC(_kern, OID_AUTO, cp_times, C
 
 #ifdef DEADLKRES
 static const char *blessed[] = {
+	"getblk",
 	"so_snd_sx",
 	"so_rcv_sx",
 	NULL

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 01:02: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 EC878106566C;
	Tue, 20 Apr 2010 01:02:39 +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 DC6B38FC18;
	Tue, 20 Apr 2010 01:02: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 o3K12d6V068621;
	Tue, 20 Apr 2010 01:02:39 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3K12dsp068619;
	Tue, 20 Apr 2010 01:02:39 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004200102.o3K12dsp068619@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 20 Apr 2010 01:02: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: r206880 - head/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: Tue, 20 Apr 2010 01:02:40 -0000

Author: rmacklem
Date: Tue Apr 20 01:02:39 2010
New Revision: 206880
URL: http://svn.freebsd.org/changeset/base/206880

Log:
  For the experimental NFS client doing an NFSv4 mount,
  set the NFSCLFLAGS_RECVRINPROG while doing recovery from an expired
  lease in a manner similar to r206818 for server reboot recovery.
  This will prevent the function that acquires stateids for I/O
  operations from acquiring out of date stateids during recovery.
  Also, fix up mutex locking on the nfsc_flags field.
  
  MFC after:	1 week

Modified:
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Mon Apr 19 23:40:46 2010	(r206879)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Tue Apr 20 01:02:39 2010	(r206880)
@@ -2111,6 +2111,7 @@ nfscl_hasexpired(struct nfsclclient *clp
 		NFSUNLOCKCLSTATE();
 		return (0);
 	}
+	clp->nfsc_flags |= NFSCLFLAGS_RECVRINPROG;
 	NFSUNLOCKCLSTATE();
 
 	nmp = clp->nfsc_nmp;
@@ -2127,6 +2128,7 @@ nfscl_hasexpired(struct nfsclclient *clp
 		 * Clear out any state.
 		 */
 		nfscl_cleanclient(clp);
+		NFSLOCKCLSTATE();
 		clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID |
 		    NFSCLFLAGS_RECOVER);
 	} else {
@@ -2140,14 +2142,15 @@ nfscl_hasexpired(struct nfsclclient *clp
 		 * Expire the state for the client.
 		 */
 		nfscl_expireclient(clp, nmp, cred, p);
+		NFSLOCKCLSTATE();
 		clp->nfsc_flags |= NFSCLFLAGS_HASCLIENTID;
 		clp->nfsc_flags &= ~NFSCLFLAGS_RECOVER;
 	}
-	NFSFREECRED(cred);
-	clp->nfsc_flags &= ~NFSCLFLAGS_EXPIREIT;
-	NFSLOCKCLSTATE();
+	clp->nfsc_flags &= ~(NFSCLFLAGS_EXPIREIT | NFSCLFLAGS_RECVRINPROG);
+	wakeup(&clp->nfsc_flags);
 	nfsv4_unlock(&clp->nfsc_lock, 0);
 	NFSUNLOCKCLSTATE();
+	NFSFREECRED(cred);
 	return (error);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 01:12: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 0509C106564A;
	Tue, 20 Apr 2010 01:12:24 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E89988FC1A;
	Tue, 20 Apr 2010 01:12: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 o3K1CNoW070753;
	Tue, 20 Apr 2010 01:12:23 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3K1CNbe070751;
	Tue, 20 Apr 2010 01:12:23 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201004200112.o3K1CNbe070751@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Tue, 20 Apr 2010 01:12: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: r206881 - head/release/powerpc
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, 20 Apr 2010 01:12:24 -0000

Author: nwhitehorn
Date: Tue Apr 20 01:12:23 2010
New Revision: 206881
URL: http://svn.freebsd.org/changeset/base/206881

Log:
  Add gpart and glabel to the release CD mfsroot. Even if sysinstall
  cannot partition disks on powerpc, this will allow the user to.
  
  PR:		powerpc/93203
  Obtained from:	ia64
  MFC after:	1 week

Modified:
  head/release/powerpc/boot_crunch.conf

Modified: head/release/powerpc/boot_crunch.conf
==============================================================================
--- head/release/powerpc/boot_crunch.conf	Tue Apr 20 01:02:39 2010	(r206880)
+++ head/release/powerpc/boot_crunch.conf	Tue Apr 20 01:12:23 2010	(r206881)
@@ -15,6 +15,7 @@ srcdirs /usr/src/sbin
 progs camcontrol
 progs dhclient
 progs fsck_ffs
+progs geom
 progs ifconfig
 progs mount_msdosfs
 progs mount_nfs
@@ -25,6 +26,8 @@ progs rtsol
 progs tunefs
 ln fsck_ffs fsck_4.2bsd
 ln fsck_ffs fsck_ufs
+ln geom glabel
+ln geom gpart
 
 srcdirs /usr/src/usr.bin
 progs cpio
@@ -43,4 +46,4 @@ progs usbconfig
 
 libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph
 libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs
-libs -lbsdxml -larchive -lbz2 -lusb -ljail
+libs -lgeom -lbsdxml -larchive -lbz2 -lusb -ljail

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 01:25: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 852941065675;
	Tue, 20 Apr 2010 01:25:18 +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 6A76B8FC08;
	Tue, 20 Apr 2010 01:25: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 o3K1PIi7073602;
	Tue, 20 Apr 2010 01:25:18 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3K1PIk7073600;
	Tue, 20 Apr 2010 01:25:18 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004200125.o3K1PIk7073600@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 20 Apr 2010 01:25: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: r206882 - stable/8/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: Tue, 20 Apr 2010 01:25:18 -0000

Author: rmacklem
Date: Tue Apr 20 01:25:18 2010
New Revision: 206882
URL: http://svn.freebsd.org/changeset/base/206882

Log:
  MFC: r206236
  Harden the experimental NFS server a little, by adding range
  checks on the length of the client's open/lock owner name. Also,
  add free()'s for one case where they were missing and would
  have caused a leak if NFSERR_BADXDR had been replied. Probably
  never happens, but the leak is now plugged, just in case.

Modified:
  stable/8/sys/fs/nfsserver/nfs_nfsdserv.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c
==============================================================================
--- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c	Tue Apr 20 01:12:23 2010	(r206881)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c	Tue Apr 20 01:25:18 2010	(r206882)
@@ -2086,6 +2086,10 @@ nfsrvd_lock(struct nfsrv_descript *nd, _
 	if (flags & NFSLCK_OPENTOLOCK) {
 		NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED + NFSX_STATEID);
 		i = fxdr_unsigned(int, *(tl+4+(NFSX_STATEID / NFSX_UNSIGNED)));
+		if (i <= 0 || i > NFSV4_OPAQUELIMIT) {
+			nd->nd_repstat = NFSERR_BADXDR;
+			goto nfsmout;
+		}
 		MALLOC(stp, struct nfsstate *, sizeof (struct nfsstate) + i,
 			M_NFSDSTATE, M_WAITOK);
 		stp->ls_ownerlen = i;
@@ -2229,6 +2233,10 @@ nfsrvd_lockt(struct nfsrv_descript *nd, 
 
 	NFSM_DISSECT(tl, u_int32_t *, 8 * NFSX_UNSIGNED);
 	i = fxdr_unsigned(int, *(tl + 7));
+	if (i <= 0 || i > NFSV4_OPAQUELIMIT) {
+		nd->nd_repstat = NFSERR_BADXDR;
+		goto nfsmout;
+	}
 	MALLOC(stp, struct nfsstate *, sizeof (struct nfsstate) + i,
 	    M_NFSDSTATE, M_WAITOK);
 	stp->ls_ownerlen = i;
@@ -2350,6 +2358,8 @@ nfsrvd_locku(struct nfsrv_descript *nd, 
 		break;
 	default:
 		nd->nd_repstat = NFSERR_BADXDR;
+		free(stp, M_NFSDSTATE);
+		free(lop, M_NFSDLOCK);
 		goto nfsmout;
 	};
 	stp->ls_ownerlen = 0;
@@ -2439,6 +2449,14 @@ nfsrvd_open(struct nfsrv_descript *nd, _
 	named.ni_cnd.cn_nameiop = 0;
 	NFSM_DISSECT(tl, u_int32_t *, 6 * NFSX_UNSIGNED);
 	i = fxdr_unsigned(int, *(tl + 5));
+	if (i <= 0 || i > NFSV4_OPAQUELIMIT) {
+		nd->nd_repstat = NFSERR_BADXDR;
+		vrele(dp);
+#ifdef NFS4_ACL_EXTATTR_NAME
+		acl_free(aclp);
+#endif
+		return (0);
+	}
 	MALLOC(stp, struct nfsstate *, sizeof (struct nfsstate) + i,
 	    M_NFSDSTATE, M_WAITOK);
 	stp->ls_ownerlen = i;
@@ -3391,6 +3409,10 @@ nfsrvd_releaselckown(struct nfsrv_descri
 	}
 	NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
 	len = fxdr_unsigned(int, *(tl + 2));
+	if (len <= 0 || len > NFSV4_OPAQUELIMIT) {
+		nd->nd_repstat = NFSERR_BADXDR;
+		return (0);
+	}
 	MALLOC(stp, struct nfsstate *, sizeof (struct nfsstate) + len,
 	    M_NFSDSTATE, M_WAITOK);
 	stp->ls_ownerlen = len;

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 04:16: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 C7E99106567A;
	Tue, 20 Apr 2010 04:16:39 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B7EFA8FC28;
	Tue, 20 Apr 2010 04:16: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 o3K4GdtS011463;
	Tue, 20 Apr 2010 04:16:39 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3K4Gdc3011461;
	Tue, 20 Apr 2010 04:16:39 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201004200416.o3K4Gdc3011461@svn.freebsd.org>
From: Alan Cox 
Date: Tue, 20 Apr 2010 04:16: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: r206885 - head/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: Tue, 20 Apr 2010 04:16:39 -0000

Author: alc
Date: Tue Apr 20 04:16:39 2010
New Revision: 206885
URL: http://svn.freebsd.org/changeset/base/206885

Log:
  Eliminate an unnecessary call to pmap_remove_all().  If a page belongs to
  an object whose reference count is zero, then that page cannot possibly
  be mapped.

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==============================================================================
--- head/sys/vm/vm_pageout.c	Tue Apr 20 03:20:20 2010	(r206884)
+++ head/sys/vm/vm_pageout.c	Tue Apr 20 04:16:39 2010	(r206885)
@@ -1122,7 +1122,8 @@ unlock_and_continue:
 			    m->act_count == 0) {
 				page_shortage--;
 				if (object->ref_count == 0) {
-					pmap_remove_all(m);
+					KASSERT(!pmap_page_is_mapped(m),
+				    ("vm_pageout_scan: page %p is mapped", m));
 					if (m->dirty == 0)
 						vm_page_cache(m);
 					else

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 05:17: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 E5DE6106564A;
	Tue, 20 Apr 2010 05:17:02 +0000 (UTC)
	(envelope-from kmatthew.macy@gmail.com)
Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com
	[209.85.221.181])
	by mx1.freebsd.org (Postfix) with ESMTP id 741BE8FC16;
	Tue, 20 Apr 2010 05:17:02 +0000 (UTC)
Received: by qyk11 with SMTP id 11so6012039qyk.13
	for ; Mon, 19 Apr 2010 22:17:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:reply-to:received
	:in-reply-to:references:date:x-google-sender-auth:received
	:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=WyKz3PMbtNUa818S+rFlLpSOE60Zs9GxLsxWBVJnbl0=;
	b=gkj4Zk1NZHMg9FKHNBfqo+Dpwei+Z5oMkNJIPp45xDVGdfpSnkODIs3lhsXuR+p8xq
	Nv2A2Jo7JU3nW4HaY0KMduMe8kg/8Dj6jiP0zfZ7r/8rgZ7IM5RUNH+EJ9MBoJN964Rz
	X4ReZq7I6nE0Ycg7IQznBiKJCfcymJPROUf2s=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:reply-to:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=QAtDzrpD1r6nL7bgYm2IVzljExHsBCd9VwwqICAvwmn0ip0AlFJ30Xc7Yass9lc/ec
	qlFgfEoGlAyoQYdXd0FYqZhQkECkS21iNqB12wRpTueRWl5zlvDMM8qckVOibK1ZIgQI
	yaNt9QsA9C2ghEswBhCsJ8nYRoyBnlNJB2+SE=
MIME-Version: 1.0
Sender: kmatthew.macy@gmail.com
Received: by 10.229.226.6 with HTTP; Mon, 19 Apr 2010 22:17:01 -0700 (PDT)
In-Reply-To: <201004031620.o33GKM0n037332@svn.freebsd.org>
References: <201004031620.o33GKM0n037332@svn.freebsd.org>
Date: Mon, 19 Apr 2010 22:17:01 -0700
X-Google-Sender-Auth: ff152be23782f1de
Received: by 10.229.193.18 with SMTP id ds18mr1567774qcb.14.1271740621272; 
	Mon, 19 Apr 2010 22:17:01 -0700 (PDT)
Message-ID: 
From: "K. Macy" 
To: Alan Cox 
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: r206140 - head/sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: kmacy@freebsd.org
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, 20 Apr 2010 05:17:03 -0000

How has the problem been addressed? I'm seeing periodic panics with
non-zero resident count with the page lock patch applied. It is
possible that I've inadvertently re-introduced an issue you've fixed.

Thanks,
Kip

On Sat, Apr 3, 2010 at 9:20 AM, Alan Cox  wrote:
> Author: alc
> Date: Sat Apr =A03 16:20:22 2010
> New Revision: 206140
> URL: http://svn.freebsd.org/changeset/base/206140
>
> Log:
> =A0Re-enable the call to pmap_release() by vmspace_dofree(). =A0The accou=
nting
> =A0problem that is described in the comment has been addressed.
>
> =A0Submitted by: kib
> =A0Tested by: =A0 =A0pho (a few months ago)
> =A0MFC after: =A0 =A06 weeks
>
> Modified:
> =A0head/sys/vm/vm_map.c
>
> Modified: head/sys/vm/vm_map.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/vm/vm_map.c =A0 =A0 =A0 =A0Sat Apr =A03 15:52:32 2010 =A0 =
=A0 =A0 =A0(r206139)
> +++ head/sys/vm/vm_map.c =A0 =A0 =A0 =A0Sat Apr =A03 16:20:22 2010 =A0 =
=A0 =A0 =A0(r206140)
> @@ -313,6 +313,7 @@ vm_init2(void)
> =A0static inline void
> =A0vmspace_dofree(struct vmspace *vm)
> =A0{
> +
> =A0 =A0 =A0 =A0CTR1(KTR_VM, "vmspace_free: %p", vm);
>
> =A0 =A0 =A0 =A0/*
> @@ -329,12 +330,8 @@ vmspace_dofree(struct vmspace *vm)
> =A0 =A0 =A0 =A0(void)vm_map_remove(&vm->vm_map, vm->vm_map.min_offset,
> =A0 =A0 =A0 =A0 =A0 =A0vm->vm_map.max_offset);
>
> - =A0 =A0 =A0 /*
> - =A0 =A0 =A0 =A0* XXX Comment out the pmap_release call for now. The
> - =A0 =A0 =A0 =A0* vmspace_zone is marked as UMA_ZONE_NOFREE, and bugs ca=
use
> - =A0 =A0 =A0 =A0* pmap.resident_count to be !=3D 0 on exit sometimes.
> - =A0 =A0 =A0 =A0*/
> -/* =A0 =A0 pmap_release(vmspace_pmap(vm)); */
> + =A0 =A0 =A0 pmap_release(vmspace_pmap(vm));
> + =A0 =A0 =A0 vm->vm_map.pmap =3D NULL;
> =A0 =A0 =A0 =A0uma_zfree(vmspace_zone, vm);
> =A0}
>
>

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 05:31: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 6A98F106566C;
	Tue, 20 Apr 2010 05:31:54 +0000 (UTC)
	(envelope-from luigi@onelab2.iet.unipi.it)
Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238])
	by mx1.freebsd.org (Postfix) with ESMTP id 29E2A8FC0C;
	Tue, 20 Apr 2010 05:31:53 +0000 (UTC)
Received: by onelab2.iet.unipi.it (Postfix, from userid 275)
	id C446773098; Tue, 20 Apr 2010 07:42:27 +0200 (CEST)
Date: Tue, 20 Apr 2010 07:42:27 +0200
From: Luigi Rizzo 
To: Julian Elischer 
Message-ID: <20100420054227.GA62058@onelab2.iet.unipi.it>
References: <201004191511.o3JFBjLj036350@svn.freebsd.org>
	<4BCC7E64.4040200@FreeBSD.org> <4BCCDCC9.2070604@elischer.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4BCCDCC9.2070604@elischer.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@FreeBSD.org, Luigi Rizzo ,
	src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	Robert Noland 
Subject: Re: svn commit: r206843 - head/sbin/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: Tue, 20 Apr 2010 05:31:54 -0000

On Mon, Apr 19, 2010 at 03:44:25PM -0700, Julian Elischer wrote:
> On 4/19/10 9:01 AM, Robert Noland wrote:
> >
> >
> >Luigi Rizzo wrote:
> 
> 
> [...]
> 
> >Index: sbin/ipfw/ipfw2.c
> >===================================================================
> >--- sbin/ipfw/ipfw2.c (revision 206844)
> >+++ sbin/ipfw/ipfw2.c (working copy)
> >@@ -326,7 +326,7 @@
> >#ifdef TCC
> >#define U64_FMT "I64"
> >#else
> >-#define U64_FMT "llu"
> >+#define U64_FMT "ju"
> >#endif
> >uint64_t d;
> 
>  believe there is a posix define for this?
> (though I can't remember it right now).

the reason for the above code is that MSVC (actually, the DLL in
Windows -- so the problem exists also for TCC on Windows) does not
support %llu or %ju but only %I64 and that is why i need this ugly
code (to tell the truth i am not even sure that the various libc
for embedded platforms support %ju).

	cheers
	luigi

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 06:10: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 75114106564A;
	Tue, 20 Apr 2010 06:10:05 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 496168FC27;
	Tue, 20 Apr 2010 06:10:05 +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 o3K6A5lv036470;
	Tue, 20 Apr 2010 06:10:05 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3K6A5qP036467;
	Tue, 20 Apr 2010 06:10:05 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201004200610.o3K6A5qP036467@svn.freebsd.org>
From: Maxim Konovalov 
Date: Tue, 20 Apr 2010 06:10: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: r206889 - head/sbin/ping6
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, 20 Apr 2010 06:10:05 -0000

Author: maxim
Date: Tue Apr 20 06:10:05 2010
New Revision: 206889
URL: http://svn.freebsd.org/changeset/base/206889

Log:
  o Add do-not-fragment option support to ping6(8).
  
  PR:		bin/145759
  Submitted by:	pluknet
  MFC after:	1 month

Modified:
  head/sbin/ping6/ping6.8
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.8
==============================================================================
--- head/sbin/ping6/ping6.8	Tue Apr 20 06:08:34 2010	(r206888)
+++ head/sbin/ping6/ping6.8	Tue Apr 20 06:10:05 2010	(r206889)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 27, 2008
+.Dd April 20, 2010
 .Dt PING6 8
 .Os
 .Sh NAME
@@ -40,9 +40,9 @@ packets to network hosts
 .Sh SYNOPSIS
 .Nm
 .\" without ipsec, or new ipsec
-.Op Fl dfHmnNoqrRtvwW
+.Op Fl DdfHmnNoqrRtvwW
 .\" old ipsec
-.\" .Op Fl AdEfmnNqRtvwW
+.\" .Op Fl ADdEfmnNqRtvwW
 .Bk -words
 .Op Fl a Ar addrtype
 .Ek
@@ -141,6 +141,8 @@ Stop after sending
 .Ar count
 .Tn ECHO_RESPONSE
 packets.
+.It Fl D
+Disable IPv6 fragmentation.
 .It Fl d
 Set the
 .Dv SO_DEBUG

Modified: head/sbin/ping6/ping6.c
==============================================================================
--- head/sbin/ping6/ping6.c	Tue Apr 20 06:08:34 2010	(r206888)
+++ head/sbin/ping6/ping6.c	Tue Apr 20 06:10:05 2010	(r206889)
@@ -191,6 +191,7 @@ struct tv32 {
 #define F_ONCE		0x200000
 #define F_AUDIBLE	0x400000
 #define F_MISSED	0x800000
+#define F_DONTFRAG	0x1000000
 #define F_NOUSERDATA	(F_NODEADDR | F_FQDN | F_FQDNOLD | F_SUPTYPES)
 u_int options;
 
@@ -349,7 +350,7 @@ main(argc, argv)
 #endif /*IPSEC_POLICY_IPSEC*/
 #endif
 	while ((ch = getopt(argc, argv,
-	    "a:b:c:dfHg:h:I:i:l:mnNop:qrRS:s:tvwW" ADDOPTS)) != -1) {
+	    "a:b:c:DdfHg:h:I:i:l:mnNop:qrRS:s:tvwW" ADDOPTS)) != -1) {
 #undef ADDOPTS
 		switch (ch) {
 		case 'a':
@@ -415,6 +416,9 @@ main(argc, argv)
 				errx(1,
 				    "illegal number of packets -- %s", optarg);
 			break;
+		case 'D':
+			options |= F_DONTFRAG;
+			break;
 		case 'd':
 			options |= F_SO_DEBUG;
 			break;
@@ -742,7 +746,11 @@ main(argc, argv)
 	for (i = 0; i < sizeof(nonce); i += sizeof(u_int32_t))
 		*((u_int32_t *)&nonce[i]) = arc4random();
 #endif
-
+	optval = 1;
+	if (options & F_DONTFRAG)
+		if (setsockopt(s, IPPROTO_IPV6, IPV6_DONTFRAG,
+		    &optval, sizeof(optval)) == -1)
+			err(1, "IPV6_DONTFRAG");
 	hold = 1;
 
 	if (options & F_SO_DEBUG)
@@ -2780,7 +2788,7 @@ usage()
 	    "A"
 #endif
 	    "usage: ping6 [-"
-	    "d"
+	    "Dd"
 #if defined(IPSEC) && !defined(IPSEC_POLICY_IPSEC)
 	    "E"
 #endif

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 07:09:47 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 818B4106564A;
	Tue, 20 Apr 2010 07:09:47 +0000 (UTC) (envelope-from alc@cs.rice.edu)
Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31])
	by mx1.freebsd.org (Postfix) with ESMTP id 4477A8FC16;
	Tue, 20 Apr 2010 07:09:47 +0000 (UTC)
Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1])
	by mail.cs.rice.edu (Postfix) with ESMTP id B302F2C2B0E;
	Tue, 20 Apr 2010 02:09:46 -0500 (CDT)
X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu
Received: from mail.cs.rice.edu ([127.0.0.1])
	by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new,
	port 10024)
	with LMTP id cSM087aFbX97; Tue, 20 Apr 2010 02:09:39 -0500 (CDT)
Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net
	(adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.cs.rice.edu (Postfix) with ESMTP id 43D662C2ACE;
	Tue, 20 Apr 2010 02:09:38 -0500 (CDT)
Message-ID: <4BCD5331.4030303@cs.rice.edu>
Date: Tue, 20 Apr 2010 02:09:37 -0500
From: Alan Cox 
User-Agent: Thunderbird 2.0.0.24 (X11/20100327)
MIME-Version: 1.0
To: kmacy@freebsd.org
References: <201004031620.o33GKM0n037332@svn.freebsd.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Alan Cox , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r206140 - head/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: Tue, 20 Apr 2010 07:09:47 -0000

K. Macy wrote:
> How has the problem been addressed? I'm seeing periodic panics with
> non-zero resident count with the page lock patch applied. It is
> possible that I've inadvertently re-introduced an issue you've fixed.
>
>   

r196318 and r189783 come to mind.

>
> On Sat, Apr 3, 2010 at 9:20 AM, Alan Cox  wrote:
>   
>> Author: alc
>> Date: Sat Apr  3 16:20:22 2010
>> New Revision: 206140
>> URL: http://svn.freebsd.org/changeset/base/206140
>>
>> Log:
>>  Re-enable the call to pmap_release() by vmspace_dofree().  The accounting
>>  problem that is described in the comment has been addressed.
>>
>>  Submitted by: kib
>>  Tested by:    pho (a few months ago)
>>  MFC after:    6 weeks
>>
>> Modified:
>>  head/sys/vm/vm_map.c
>>
>> Modified: head/sys/vm/vm_map.c
>> ==============================================================================
>> --- head/sys/vm/vm_map.c        Sat Apr  3 15:52:32 2010        (r206139)
>> +++ head/sys/vm/vm_map.c        Sat Apr  3 16:20:22 2010        (r206140)
>> @@ -313,6 +313,7 @@ vm_init2(void)
>>  static inline void
>>  vmspace_dofree(struct vmspace *vm)
>>  {
>> +
>>        CTR1(KTR_VM, "vmspace_free: %p", vm);
>>
>>        /*
>> @@ -329,12 +330,8 @@ vmspace_dofree(struct vmspace *vm)
>>        (void)vm_map_remove(&vm->vm_map, vm->vm_map.min_offset,
>>            vm->vm_map.max_offset);
>>
>> -       /*
>> -        * XXX Comment out the pmap_release call for now. The
>> -        * vmspace_zone is marked as UMA_ZONE_NOFREE, and bugs cause
>> -        * pmap.resident_count to be != 0 on exit sometimes.
>> -        */
>> -/*     pmap_release(vmspace_pmap(vm)); */
>> +       pmap_release(vmspace_pmap(vm));
>> +       vm->vm_map.pmap = NULL;
>>        uma_zfree(vmspace_zone, vm);
>>  }
>>
>>
>>     


From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 08:19: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 934EE106564A;
	Tue, 20 Apr 2010 08:19:43 +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 801F38FC14;
	Tue, 20 Apr 2010 08:19: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 o3K8JhTa064836;
	Tue, 20 Apr 2010 08:19:43 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3K8Jhjx064830;
	Tue, 20 Apr 2010 08:19:43 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004200819.o3K8Jhjx064830@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 20 Apr 2010 08:19:43 +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: r206890 - in stable/8/sys: amd64/amd64 amd64/ia32
	i386/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: Tue, 20 Apr 2010 08:19:43 -0000

Author: kib
Date: Tue Apr 20 08:19:43 2010
New Revision: 206890
URL: http://svn.freebsd.org/changeset/base/206890

Log:
  MFC r206553:
  Change printf() calls to uprintf() for sigreturn() and trap() complaints
  about inacessible or wrong mcontext, and for dreaded "kernel trap with
  interrupts disabled" situation. The later is changed when trap is
  generated from user mode (shall never be ?).
  
  Normalize the messages to include both pid and thread name.

Modified:
  stable/8/sys/amd64/amd64/machdep.c
  stable/8/sys/amd64/amd64/trap.c
  stable/8/sys/amd64/ia32/ia32_signal.c
  stable/8/sys/i386/i386/machdep.c
  stable/8/sys/i386/i386/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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/machdep.c	Tue Apr 20 06:10:05 2010	(r206889)
+++ stable/8/sys/amd64/amd64/machdep.c	Tue Apr 20 08:19:43 2010	(r206890)
@@ -422,13 +422,14 @@ sigreturn(td, uap)
 
 	error = copyin(uap->sigcntxp, &uc, sizeof(uc));
 	if (error != 0) {
-		printf("sigreturn (pid %d): copyin failed\n", p->p_pid);
+		uprintf("pid %d (%s): sigreturn copyin failed\n",
+		    p->p_pid, td->td_name);
 		return (error);
 	}
 	ucp = &uc;
 	if ((ucp->uc_mcontext.mc_flags & ~_MC_FLAG_MASK) != 0) {
-		printf("sigreturn (pid %d): mc_flags %x\n", p->p_pid,
-		    ucp->uc_mcontext.mc_flags);
+		uprintf("pid %d (%s): sigreturn mc_flags %x\n", p->p_pid,
+		    td->td_name, ucp->uc_mcontext.mc_flags);
 		return (EINVAL);
 	}
 	regs = td->td_frame;
@@ -447,8 +448,8 @@ sigreturn(td, uap)
 	 * one less debugger trap, so allowing it is fairly harmless.
 	 */
 	if (!EFL_SECURE(rflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
-		printf("sigreturn (pid %d): rflags = 0x%lx\n", p->p_pid,
-		    rflags);
+		uprintf("pid %d (%s): sigreturn rflags = 0x%lx\n", p->p_pid,
+		    td->td_name, rflags);
 		return (EINVAL);
 	}
 
@@ -459,7 +460,8 @@ sigreturn(td, uap)
 	 */
 	cs = ucp->uc_mcontext.mc_cs;
 	if (!CS_SECURE(cs)) {
-		printf("sigreturn (pid %d): cs = 0x%x\n", p->p_pid, cs);
+		uprintf("pid %d (%s): sigreturn cs = 0x%x\n", p->p_pid,
+		    td->td_name, cs);
 		ksiginfo_init_trap(&ksi);
 		ksi.ksi_signo = SIGBUS;
 		ksi.ksi_code = BUS_OBJERR;
@@ -471,7 +473,8 @@ sigreturn(td, uap)
 
 	ret = set_fpcontext(td, &ucp->uc_mcontext);
 	if (ret != 0) {
-		printf("sigreturn (pid %d): set_fpcontext\n", p->p_pid);
+		uprintf("pid %d (%s): sigreturn set_fpcontext err %d\n",
+		    p->p_pid, td->td_name, ret);
 		return (ret);
 	}
 	bcopy(&ucp->uc_mcontext.mc_rdi, regs, sizeof(*regs));

Modified: stable/8/sys/amd64/amd64/trap.c
==============================================================================
--- stable/8/sys/amd64/amd64/trap.c	Tue Apr 20 06:10:05 2010	(r206889)
+++ stable/8/sys/amd64/amd64/trap.c	Tue Apr 20 08:19:43 2010	(r206890)
@@ -303,7 +303,7 @@ trap(struct trapframe *frame)
 		 * enabled later.
 		 */
 		if (ISPL(frame->tf_cs) == SEL_UPL)
-			printf(
+			uprintf(
 			    "pid %ld (%s): trap %d with interrupts disabled\n",
 			    (long)curproc->p_pid, curthread->td_name, type);
 		else if (type != T_NMI && type != T_BPTFLT &&

Modified: stable/8/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- stable/8/sys/amd64/ia32/ia32_signal.c	Tue Apr 20 06:10:05 2010	(r206889)
+++ stable/8/sys/amd64/ia32/ia32_signal.c	Tue Apr 20 08:19:43 2010	(r206890)
@@ -565,7 +565,8 @@ freebsd4_freebsd32_sigreturn(td, uap)
 	 * one less debugger trap, so allowing it is fairly harmless.
 	 */
 	if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
-		printf("freebsd4_freebsd32_sigreturn: eflags = 0x%x\n", eflags);
+		uprintf("pid %d (%s): freebsd4_freebsd32_sigreturn eflags = 0x%x\n",
+		    td->td_proc->p_pid, td->td_name, eflags);
 		return (EINVAL);
 	}
 
@@ -576,7 +577,8 @@ freebsd4_freebsd32_sigreturn(td, uap)
 	 */
 	cs = ucp->uc_mcontext.mc_cs;
 	if (!CS_SECURE(cs)) {
-		printf("freebsd4_sigreturn: cs = 0x%x\n", cs);
+		uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n",
+		    td->td_proc->p_pid, td->td_name, cs);
 		ksiginfo_init_trap(&ksi);
 		ksi.ksi_signo = SIGBUS;
 		ksi.ksi_code = BUS_OBJERR;
@@ -647,7 +649,8 @@ freebsd32_sigreturn(td, uap)
 	 * one less debugger trap, so allowing it is fairly harmless.
 	 */
 	if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
-		printf("freebsd32_sigreturn: eflags = 0x%x\n", eflags);
+		uprintf("pid %d (%s): freebsd32_sigreturn eflags = 0x%x\n",
+		    td->td_proc->p_pid, td->td_name, eflags);
 		return (EINVAL);
 	}
 
@@ -658,7 +661,8 @@ freebsd32_sigreturn(td, uap)
 	 */
 	cs = ucp->uc_mcontext.mc_cs;
 	if (!CS_SECURE(cs)) {
-		printf("sigreturn: cs = 0x%x\n", cs);
+		uprintf("pid %d (%s): sigreturn cs = 0x%x\n",
+		    td->td_proc->p_pid, td->td_name, cs);
 		ksiginfo_init_trap(&ksi);
 		ksi.ksi_signo = SIGBUS;
 		ksi.ksi_code = BUS_OBJERR;

Modified: stable/8/sys/i386/i386/machdep.c
==============================================================================
--- stable/8/sys/i386/i386/machdep.c	Tue Apr 20 06:10:05 2010	(r206889)
+++ stable/8/sys/i386/i386/machdep.c	Tue Apr 20 08:19:43 2010	(r206890)
@@ -944,7 +944,8 @@ freebsd4_sigreturn(td, uap)
 		 * one less debugger trap, so allowing it is fairly harmless.
 		 */
 		if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) {
-			printf("freebsd4_sigreturn: eflags = 0x%x\n", eflags);
+			uprintf("pid %d (%s): freebsd4_sigreturn eflags = 0x%x\n",
+			    td->td_proc->p_pid, td->td_name, eflags);
 	    		return (EINVAL);
 		}
 
@@ -955,7 +956,8 @@ freebsd4_sigreturn(td, uap)
 		 */
 		cs = ucp->uc_mcontext.mc_cs;
 		if (!CS_SECURE(cs)) {
-			printf("freebsd4_sigreturn: cs = 0x%x\n", cs);
+			uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n",
+			    td->td_proc->p_pid, td->td_name, cs);
 			ksiginfo_init_trap(&ksi);
 			ksi.ksi_signo = SIGBUS;
 			ksi.ksi_code = BUS_OBJERR;
@@ -1056,7 +1058,8 @@ sigreturn(td, uap)
 		 * one less debugger trap, so allowing it is fairly harmless.
 		 */
 		if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) {
-			printf("sigreturn: eflags = 0x%x\n", eflags);
+			uprintf("pid %d (%s): sigreturn eflags = 0x%x\n",
+			    td->td_proc->p_pid, td->td_name, eflags);
 	    		return (EINVAL);
 		}
 
@@ -1067,7 +1070,8 @@ sigreturn(td, uap)
 		 */
 		cs = ucp->uc_mcontext.mc_cs;
 		if (!CS_SECURE(cs)) {
-			printf("sigreturn: cs = 0x%x\n", cs);
+			uprintf("pid %d (%s): sigreturn cs = 0x%x\n",
+			    td->td_proc->p_pid, td->td_name, cs);
 			ksiginfo_init_trap(&ksi);
 			ksi.ksi_signo = SIGBUS;
 			ksi.ksi_code = BUS_OBJERR;

Modified: stable/8/sys/i386/i386/trap.c
==============================================================================
--- stable/8/sys/i386/i386/trap.c	Tue Apr 20 06:10:05 2010	(r206889)
+++ stable/8/sys/i386/i386/trap.c	Tue Apr 20 08:19:43 2010	(r206890)
@@ -277,7 +277,7 @@ trap(struct trapframe *frame)
 		 * enabled later.
 		 */
 		if (ISPL(frame->tf_cs) == SEL_UPL || (frame->tf_eflags & PSL_VM))
-			printf(
+			uprintf(
 			    "pid %ld (%s): trap %d with interrupts disabled\n",
 			    (long)curproc->p_pid, curthread->td_name, type);
 		else if (type != T_BPTFLT && type != T_TRCTRAP &&
@@ -507,7 +507,7 @@ trap(struct trapframe *frame)
 			if (npxdna())
 				goto userout;
 #endif
-			printf("pid %d killed due to lack of floating point\n",
+			uprintf("pid %d killed due to lack of floating point\n",
 				p->p_pid);
 			i = SIGKILL;
 			ucode = 0;

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 08:50: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 313D41065672;
	Tue, 20 Apr 2010 08:50:20 +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 D69FD8FC1D;
	Tue, 20 Apr 2010 08:50: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 o3K8oJGT071733;
	Tue, 20 Apr 2010 08:50:19 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3K8oJG2071731;
	Tue, 20 Apr 2010 08:50:19 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201004200850.o3K8oJG2071731@svn.freebsd.org>
From: Michael Tuexen 
Date: Tue, 20 Apr 2010 08:50: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: r206891 - 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, 20 Apr 2010 08:50:20 -0000

Author: tuexen
Date: Tue Apr 20 08:50:19 2010
New Revision: 206891
URL: http://svn.freebsd.org/changeset/base/206891

Log:
  Really print the nr_mapping array when it should be printed.`
  
  MFC after: 3 days.

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c	Tue Apr 20 08:19:43 2010	(r206890)
+++ head/sys/netinet/sctputil.c	Tue Apr 20 08:50:19 2010	(r206891)
@@ -1215,7 +1215,7 @@ sctp_print_mapping_array(struct sctp_ass
 	}
 	printf("Non renegable mapping array (last %d entries are zero):\n", asoc->mapping_array_size - limit);
 	for (i = 0; i < limit; i++) {
-		printf("%2.2x%c", asoc->mapping_array[i], ((i + 1) % 16) ? ' ' : '\n');
+		printf("%2.2x%c", asoc->nr_mapping_array[i], ((i + 1) % 16) ? ' ' : '\n');
 	}
 	if (limit % 16)
 		printf("\n");

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 08:51: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 3BA8A106566C;
	Tue, 20 Apr 2010 08:51:22 +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 2AC2F8FC08;
	Tue, 20 Apr 2010 08:51: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 o3K8pMpe072009;
	Tue, 20 Apr 2010 08:51:22 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3K8pMHr072007;
	Tue, 20 Apr 2010 08:51:22 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201004200851.o3K8pMHr072007@svn.freebsd.org>
From: Michael Tuexen 
Date: Tue, 20 Apr 2010 08:51: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: r206892 - 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, 20 Apr 2010 08:51:22 -0000

Author: tuexen
Date: Tue Apr 20 08:51:21 2010
New Revision: 206892
URL: http://svn.freebsd.org/changeset/base/206892

Log:
  Update highest_tsn variables when sliding mapping arrays.

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Tue Apr 20 08:50:19 2010	(r206891)
+++ head/sys/netinet/sctp_indata.c	Tue Apr 20 08:51:21 2010	(r206892)
@@ -2390,6 +2390,12 @@ sctp_slide_mapping_arrays(struct sctp_tc
 				asoc->mapping_array[ii] = 0;
 				asoc->nr_mapping_array[ii] = 0;
 			}
+			if (asoc->highest_tsn_inside_map + 1 == asoc->mapping_array_base_tsn) {
+				asoc->highest_tsn_inside_map += (slide_from << 3);
+			}
+			if (asoc->highest_tsn_inside_nr_map + 1 == asoc->mapping_array_base_tsn) {
+				asoc->highest_tsn_inside_nr_map += (slide_from << 3);
+			}
 			asoc->mapping_array_base_tsn += (slide_from << 3);
 			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
 				sctp_log_map(asoc->mapping_array_base_tsn,

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 09:39: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 AFB64106564A;
	Tue, 20 Apr 2010 09:39:25 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au
	[211.29.132.185])
	by mx1.freebsd.org (Postfix) with ESMTP id 3DCB58FC22;
	Tue, 20 Apr 2010 09:39:24 +0000 (UTC)
Received: from c122-106-144-83.carlnfd1.nsw.optusnet.com.au
	(c122-106-144-83.carlnfd1.nsw.optusnet.com.au [122.106.144.83])
	by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o3K9dEkg011357
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Apr 2010 19:39:16 +1000
Date: Tue, 20 Apr 2010 19:39:14 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Luigi Rizzo 
In-Reply-To: <20100420054227.GA62058@onelab2.iet.unipi.it>
Message-ID: <20100420192603.R4920@delplex.bde.org>
References: <201004191511.o3JFBjLj036350@svn.freebsd.org>
	<4BCC7E64.4040200@FreeBSD.org> <4BCCDCC9.2070604@elischer.org>
	<20100420054227.GA62058@onelab2.iet.unipi.it>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: Luigi Rizzo , src-committers@FreeBSD.org,
	Robert Noland , svn-src-all@FreeBSD.org,
	Julian Elischer , svn-src-head@FreeBSD.org
Subject: Re: svn commit: r206843 - head/sbin/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: Tue, 20 Apr 2010 09:39:25 -0000

On Tue, 20 Apr 2010, Luigi Rizzo wrote:

> On Mon, Apr 19, 2010 at 03:44:25PM -0700, Julian Elischer wrote:
>> On 4/19/10 9:01 AM, Robert Noland wrote:
>>>
>>>
>>> Luigi Rizzo wrote:
>>
>>
>> [...]
>>
>>> Index: sbin/ipfw/ipfw2.c
>>> ===================================================================
>>> --- sbin/ipfw/ipfw2.c (revision 206844)
>>> +++ sbin/ipfw/ipfw2.c (working copy)
>>> @@ -326,7 +326,7 @@
>>> #ifdef TCC
>>> #define U64_FMT "I64"
>>> #else
>>> -#define U64_FMT "llu"
>>> +#define U64_FMT "ju"
>>> #endif
>>> uint64_t d;

Ugh.  I started introducing intmax_t about 10 years ago to try to kill
long long.  But long long is now used much more than 10 years ago :-(.
Also, uint64_t should not be used in contexts like this (where hardware
requirements don't require any particular size).

>>  believe there is a posix define for this?
>> (though I can't remember it right now).

Nothing to do with POSIX.  The C99 define for this even less portable
than the above (though easier to fake in header files).  All of the
above basically require C99.

> the reason for the above code is that MSVC (actually, the DLL in
> Windows -- so the problem exists also for TCC on Windows) does not
> support %llu or %ju but only %I64 and that is why i need this ugly
> code (to tell the truth i am not even sure that the various libc
> for embedded platforms support %ju).

All FreeBSD libc's should, since %ju is part of the small part of C99
actually supported by FreeBSD.  For a vendor embedded platform, support
depends on the vendor having the sam support for C99 as FreeBSD does in
this area.

%I64 is actually better than the C99 formats, though not as good as
%IDWIM where the compiler rewrites the format string, replacing %IDWIM
by any C99 or vendor format specifier that will work at runtime (only
works for literal format strings).  I think %I is in sfio, where this
and other design errors in stdio were fixed long before C99 standardized
more errors.  Don't know if sfio has %IDWIM -- this requires compiler
support.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 10:16: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 D1DD7106566B;
	Tue, 20 Apr 2010 10:16:44 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C01658FC14;
	Tue, 20 Apr 2010 10:16: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 o3KAGi5H090828;
	Tue, 20 Apr 2010 10:16:44 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KAGiWZ090824;
	Tue, 20 Apr 2010 10:16:44 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004201016.o3KAGiWZ090824@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 20 Apr 2010 10:16: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: r206893 - in head: include 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, 20 Apr 2010 10:16:44 -0000

Author: kib
Date: Tue Apr 20 10:16:44 2010
New Revision: 206893
URL: http://svn.freebsd.org/changeset/base/206893

Log:
  Slightly modernize realpath(3).
  
  SUSv4 requires that implementation returns EINVAL if supplied path is NULL,
  and ENOENT if path is empty string [1].
  Bring prototype in conformance with SUSv4, adding restrict keywords.
  Allow the resolved path buffer pointer be NULL, in which case realpath(3)
  allocates storage with malloc().
  
  PR:	kern/121897 [1]
  MFC after:	2 weeks

Modified:
  head/include/stdlib.h
  head/lib/libc/stdlib/realpath.3
  head/lib/libc/stdlib/realpath.c

Modified: head/include/stdlib.h
==============================================================================
--- head/include/stdlib.h	Tue Apr 20 08:51:21 2010	(r206892)
+++ head/include/stdlib.h	Tue Apr 20 10:16:44 2010	(r206893)
@@ -201,7 +201,7 @@ int	 posix_openpt(int);
 char	*ptsname(int);
 int	 putenv(char *);
 long	 random(void);
-char	*realpath(const char *, char resolved_path[]);
+char	*realpath(const char * __restrict, char * __restrict);
 unsigned short
 	*seed48(unsigned short[3]);
 #ifndef _SETKEY_DECLARED

Modified: head/lib/libc/stdlib/realpath.3
==============================================================================
--- head/lib/libc/stdlib/realpath.3	Tue Apr 20 08:51:21 2010	(r206892)
+++ head/lib/libc/stdlib/realpath.3	Tue Apr 20 10:16:44 2010	(r206893)
@@ -31,7 +31,7 @@
 .\"     @(#)realpath.3	8.2 (Berkeley) 2/16/94
 .\" $FreeBSD$
 .\"
-.Dd February 16, 1994
+.Dd April 19, 2010
 .Dt REALPATH 3
 .Os
 .Sh NAME
@@ -43,7 +43,7 @@
 .In sys/param.h
 .In stdlib.h
 .Ft "char *"
-.Fn realpath "const char *pathname" "char resolved_path[PATH_MAX]"
+.Fn realpath "const char *pathname" "char *resolved_path"
 .Sh DESCRIPTION
 The
 .Fn realpath
@@ -64,7 +64,8 @@ argument
 .Em must
 refer to a buffer capable of storing at least
 .Dv PATH_MAX
-characters.
+characters, or be
+.Dv NULL .
 .Pp
 The
 .Fn realpath
@@ -82,6 +83,13 @@ The
 function returns
 .Fa resolved_path
 on success.
+If the function was supplied
+.Dv NULL
+as
+.Fa resolved_path ,
+and operation did not cause errors, the returned value is
+a null-terminated string in a buffer allocated by a call to
+.Fn malloc 3 .
 If an error occurs,
 .Fn realpath
 returns
@@ -89,6 +97,11 @@ returns
 and
 .Fa resolved_path
 contains the pathname which caused the problem.
+If
+.Fa resolved_path
+was
+.Dv NULL ,
+then information of the failed pathname component is lost.
 .Sh ERRORS
 The function
 .Fn realpath

Modified: head/lib/libc/stdlib/realpath.c
==============================================================================
--- head/lib/libc/stdlib/realpath.c	Tue Apr 20 08:51:21 2010	(r206892)
+++ head/lib/libc/stdlib/realpath.c	Tue Apr 20 10:16:44 2010	(r206893)
@@ -43,23 +43,37 @@ __FBSDID("$FreeBSD$");
 #include "un-namespace.h"
 
 /*
- * char *realpath(const char *path, char resolved[PATH_MAX]);
- *
  * Find the real name of path, by removing all ".", ".." and symlink
  * components.  Returns (resolved) on success, or (NULL) on failure,
  * in which case the path which caused trouble is left in (resolved).
  */
 char *
-realpath(const char *path, char resolved[PATH_MAX])
+realpath(const char * __restrict path, char * __restrict resolved)
 {
 	struct stat sb;
 	char *p, *q, *s;
 	size_t left_len, resolved_len;
 	unsigned symlinks;
-	int serrno, slen;
+	int serrno, slen, m;
 	char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX];
 
+	if (path == NULL) {
+		errno = EINVAL;
+		return (NULL);
+	}
+	if (path[0] == '\0') {
+		errno = ENOENT;
+		return (NULL);
+	}
 	serrno = errno;
+	if (resolved == NULL) {
+		resolved = malloc(PATH_MAX);
+		if (resolved == NULL)
+			return (NULL);
+		m = 1;
+	} else
+		m = 0;
+
 	symlinks = 0;
 	if (path[0] == '/') {
 		resolved[0] = '/';
@@ -71,12 +85,19 @@ realpath(const char *path, char resolved
 	} else {
 		if (getcwd(resolved, PATH_MAX) == NULL) {
 			strlcpy(resolved, ".", PATH_MAX);
+			if (m) {
+				serrno = errno;
+				free(resolved);
+				errno = serrno;
+			}
 			return (NULL);
 		}
 		resolved_len = strlen(resolved);
 		left_len = strlcpy(left, path, sizeof(left));
 	}
 	if (left_len >= sizeof(left) || resolved_len >= PATH_MAX) {
+		if (m)
+			free(resolved);
 		errno = ENAMETOOLONG;
 		return (NULL);
 	}
@@ -92,6 +113,8 @@ realpath(const char *path, char resolved
 		p = strchr(left, '/');
 		s = p ? p : left + left_len;
 		if (s - left >= sizeof(next_token)) {
+			if (m)
+				free(resolved);
 			errno = ENAMETOOLONG;
 			return (NULL);
 		}
@@ -102,6 +125,8 @@ realpath(const char *path, char resolved
 			memmove(left, s + 1, left_len + 1);
 		if (resolved[resolved_len - 1] != '/') {
 			if (resolved_len + 1 >= PATH_MAX) {
+				if (m)
+					free(resolved);
 				errno = ENAMETOOLONG;
 				return (NULL);
 			}
@@ -133,6 +158,8 @@ realpath(const char *path, char resolved
 		 */
 		resolved_len = strlcat(resolved, next_token, PATH_MAX);
 		if (resolved_len >= PATH_MAX) {
+			if (m)
+				free(resolved);
 			errno = ENAMETOOLONG;
 			return (NULL);
 		}
@@ -141,16 +168,29 @@ realpath(const char *path, char resolved
 				errno = serrno;
 				return (resolved);
 			}
+			if (m) {
+				serrno = errno;
+				free(resolved);
+				errno = serrno;
+			}
 			return (NULL);
 		}
 		if (S_ISLNK(sb.st_mode)) {
 			if (symlinks++ > MAXSYMLINKS) {
+				if (m)
+					free(resolved);
 				errno = ELOOP;
 				return (NULL);
 			}
 			slen = readlink(resolved, symlink, sizeof(symlink) - 1);
-			if (slen < 0)
+			if (slen < 0) {
+				if (m) {
+					serrno = errno;
+					free(resolved);
+					errno = serrno;
+				}
 				return (NULL);
+			}
 			symlink[slen] = '\0';
 			if (symlink[0] == '/') {
 				resolved[1] = 0;
@@ -171,6 +211,8 @@ realpath(const char *path, char resolved
 			if (p != NULL) {
 				if (symlink[slen - 1] != '/') {
 					if (slen + 1 >= sizeof(symlink)) {
+						if (m)
+							free(resolved);
 						errno = ENAMETOOLONG;
 						return (NULL);
 					}
@@ -179,6 +221,8 @@ realpath(const char *path, char resolved
 				}
 				left_len = strlcat(symlink, left, sizeof(left));
 				if (left_len >= sizeof(left)) {
+					if (m)
+						free(resolved);
 					errno = ENAMETOOLONG;
 					return (NULL);
 				}

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 10:19: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 DF9871065676;
	Tue, 20 Apr 2010 10:19:27 +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 B51BD8FC1F;
	Tue, 20 Apr 2010 10:19:27 +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 o3KAJR51091448;
	Tue, 20 Apr 2010 10:19:27 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KAJRQT091444;
	Tue, 20 Apr 2010 10:19:27 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004201019.o3KAJRQT091444@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 20 Apr 2010 10:19:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206894 - in head/sys: fs/pseudofs kern ufs/ufs
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, 20 Apr 2010 10:19:28 -0000

Author: kib
Date: Tue Apr 20 10:19:27 2010
New Revision: 206894
URL: http://svn.freebsd.org/changeset/base/206894

Log:
  The cache_enter(9) function shall not be called for doomed dvp.
  Assert this.
  
  In the reported panic, vdestroy() fired the assertion "vp has namecache
  for ..", because pseudofs may end up doing cache_enter() with reclaimed
  dvp, after dotdot lookup temporary unlocked dvp.
  Similar problem exists in ufs_lookup() for "." lookup, when vnode
  lock needs to be upgraded.
  
  Verify that dvp is not reclaimed before calling cache_enter().
  
  Reported and tested by:	pho
  Reviewed by:	kan
  MFC after:	2 weeks

Modified:
  head/sys/fs/pseudofs/pseudofs_vnops.c
  head/sys/kern/vfs_cache.c
  head/sys/ufs/ufs/ufs_lookup.c

Modified: head/sys/fs/pseudofs/pseudofs_vnops.c
==============================================================================
--- head/sys/fs/pseudofs/pseudofs_vnops.c	Tue Apr 20 10:16:44 2010	(r206893)
+++ head/sys/fs/pseudofs/pseudofs_vnops.c	Tue Apr 20 10:19:27 2010	(r206894)
@@ -542,7 +542,7 @@ pfs_lookup(struct vop_cachedlookup_args 
 
 	if (cnp->cn_flags & ISDOTDOT)
 		vn_lock(vn, LK_EXCLUSIVE|LK_RETRY);
-	if (cnp->cn_flags & MAKEENTRY)
+	if (cnp->cn_flags & MAKEENTRY && !(vn->v_iflag & VI_DOOMED))
 		cache_enter(vn, *vpp, cnp);
 	PFS_RETURN (0);
  failed:

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Tue Apr 20 10:16:44 2010	(r206893)
+++ head/sys/kern/vfs_cache.c	Tue Apr 20 10:19:27 2010	(r206894)
@@ -611,6 +611,8 @@ cache_enter(dvp, vp, cnp)
 	CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr);
 	VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp,
 	    ("cache_enter: Adding a doomed vnode"));
+	VNASSERT(dvp == NULL || (dvp->v_iflag & VI_DOOMED) == 0, dvp,
+	    ("cache_enter: Doomed vnode used as src"));
 
 	if (!doingcache)
 		return;

Modified: head/sys/ufs/ufs/ufs_lookup.c
==============================================================================
--- head/sys/ufs/ufs/ufs_lookup.c	Tue Apr 20 10:16:44 2010	(r206893)
+++ head/sys/ufs/ufs/ufs_lookup.c	Tue Apr 20 10:19:27 2010	(r206894)
@@ -704,6 +704,14 @@ found:
 				vn_lock(vdp, LK_UPGRADE | LK_RETRY);
 			else /* if (ltype == LK_SHARED) */
 				vn_lock(vdp, LK_DOWNGRADE | LK_RETRY);
+			/*
+			 * Relock for the "." case may left us with
+			 * reclaimed vnode.
+			 */
+			if (vdp->v_iflag & VI_DOOMED) {
+				vrele(vdp);
+				return (ENOENT);
+			}
 		}
 		*vpp = vdp;
 	} else {

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 10: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 E951B106566C;
	Tue, 20 Apr 2010 10:42:08 +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 BF5B18FC14;
	Tue, 20 Apr 2010 10: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 o3KAg8nb096520;
	Tue, 20 Apr 2010 10:42:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KAg8Hc096519;
	Tue, 20 Apr 2010 10:42:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004201042.o3KAg8Hc096519@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 20 Apr 2010 10: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: r206895 - head/sys/mips/rmi
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, 20 Apr 2010 10:42:09 -0000

Author: rpaulo
Date: Tue Apr 20 10:42:08 2010
New Revision: 206895
URL: http://svn.freebsd.org/changeset/base/206895

Log:
  Remove svn:executable prop.

Modified:
Directory Properties:
  head/sys/mips/rmi/debug.h   (props changed)
  head/sys/mips/rmi/msgring.h   (props changed)
  head/sys/mips/rmi/shared_structs.h   (props changed)
  head/sys/mips/rmi/shared_structs_func.h   (props changed)
  head/sys/mips/rmi/shared_structs_offsets.h   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 12:07: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 CDB49106564A;
	Tue, 20 Apr 2010 12:07:16 +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 BBB148FC26;
	Tue, 20 Apr 2010 12:07: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 o3KC7Gi2021072;
	Tue, 20 Apr 2010 12:07:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KC7Gfo021070;
	Tue, 20 Apr 2010 12:07:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004201207.o3KC7Gfo021070@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 20 Apr 2010 12:07:16 +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: r206896 - in stable/8: 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: Tue, 20 Apr 2010 12:07:17 -0000

Author: rpaulo
Date: Tue Apr 20 12:07:16 2010
New Revision: 206896
URL: http://svn.freebsd.org/changeset/base/206896

Log:
  MFC r206427, r206706, r206771:
    ubthidhci rc.d script to switch an USB bluetooth dongle from HID to
    HCI mode.

Added:
  stable/8/etc/rc.d/ubthidhci
     - copied unchanged from r206427, head/etc/rc.d/ubthidhci
Modified:
  stable/8/etc/defaults/rc.conf
  stable/8/etc/rc.d/Makefile
  stable/8/share/man/man5/rc.conf.5
Directory Properties:
  stable/8/etc/   (props changed)
  stable/8/share/man/man5/   (props changed)

Modified: stable/8/etc/defaults/rc.conf
==============================================================================
--- stable/8/etc/defaults/rc.conf	Tue Apr 20 10:42:08 2010	(r206895)
+++ stable/8/etc/defaults/rc.conf	Tue Apr 20 12:07:16 2010	(r206896)
@@ -433,6 +433,11 @@ rfcomm_pppd_server_two_channel="3"	# Ove
 #rfcomm_pppd_server_two_register_sp="NO"	# Override SP and DUN register
 #rfcomm_pppd_server_two_register_dun="NO"	# for 'two'
 
+ubthidhci_enable="NO"		# Switch an USB BT controller present on
+#ubthidhci_busnum="3"		# bus 3 and addr 2 from HID mode to HCI mode.
+#ubthidhci_addr="2"		# Check usbconfig list to find the correct
+				# numbers for your system.
+
 ### Miscellaneous network options: ###
 icmp_bmcastecho="NO"	# respond to broadcast ping packets
 

Modified: stable/8/etc/rc.d/Makefile
==============================================================================
--- stable/8/etc/rc.d/Makefile	Tue Apr 20 10:42:08 2010	(r206895)
+++ stable/8/etc/rc.d/Makefile	Tue Apr 20 12:07:16 2010	(r206896)
@@ -50,6 +50,10 @@ FILES+=	sshd
 FILES+= nscd
 .endif
 
+.if ${MK_BLUETOOTH} != "no"
+FILES+=	ubthidhci
+.endif
+
 FILESDIR=	/etc/rc.d
 FILESMODE=	${BINMODE}
 

Copied: stable/8/etc/rc.d/ubthidhci (from r206427, head/etc/rc.d/ubthidhci)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/etc/rc.d/ubthidhci	Tue Apr 20 12:07:16 2010	(r206896, copy of r206427, head/etc/rc.d/ubthidhci)
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: ubthidhci
+# REQUIRE: DAEMON 
+# BEFORE: bluetooth 
+# KEYWORD: nojail shutdown
+
+. /etc/rc.subr
+
+name="ubthidhci"
+command="/usr/sbin/usbconfig"
+rcvar=`set_rcvar`
+start_precmd="ubthidhci_prestart"
+
+ubthidhci_prestart()
+{
+
+	if [ -z ${ubthidhci_busnum} ]; then
+		warn ubthidhci_busnum is not set
+		return 1
+	fi
+	if [ -z ${ubthidhci_addr} ]; then
+		warn ubthidhci_addr is not set
+		return 1
+	fi
+}
+
+load_rc_config $name
+#
+# We discard the output because:
+# 1) we don't want it to show up during boot; and
+# 2) the request usually returns an error, but that doesn't mean it failed
+#
+# NB: 0x40 is UT_VENDOR
+command_args="-u ${ubthidhci_busnum} -a ${ubthidhci_addr} do_request 0x40 0 0 0 0 > /dev/null 2>&1"
+
+run_rc_command "$1"

Modified: stable/8/share/man/man5/rc.conf.5
==============================================================================
--- stable/8/share/man/man5/rc.conf.5	Tue Apr 20 10:42:08 2010	(r206895)
+++ stable/8/share/man/man5/rc.conf.5	Tue Apr 20 12:07:16 2010	(r206896)
@@ -4143,6 +4143,26 @@ if it should register Dial-Up Networking
 RFCOMM channel.
 Default
 .Dq Li NO .
+.It Va ubthidhci_enable
+.Pq Vt bool
+If set to
+.Dq Li YES ,
+change the USB Bluetooth controller from HID mode to HCI mode.
+You also need to specify the location of USB Bluetooth controller with the
+.Va ubthidhci_busnum
+and
+.Va ubthidhci_addr
+variables.
+.It Va ubthidhci_busnum
+Bus number where the USB Bluetooth controller is located.
+Check the output of
+.Xr usbconfig 1
+on your system to find this information.
+.It Va ubthidhci_addr
+Bus address of the USB Bluetooth controller.
+Check the output of
+.Xr usbconfig 1
+on your system to find this information.
 .El
 .Sh FILES
 .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact
@@ -4158,6 +4178,7 @@ Default
 .Xr kbdcontrol 1 ,
 .Xr makewhatis 1 ,
 .Xr sh 1 ,
+.Xr usbconfig 1 ,
 .Xr vi 1 ,
 .Xr vidcontrol 1 ,
 .Xr bridge 4 ,

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 12:22: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 D11071065672;
	Tue, 20 Apr 2010 12:22:06 +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 C09EB8FC21;
	Tue, 20 Apr 2010 12:22: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 o3KCM6FX024388;
	Tue, 20 Apr 2010 12:22:06 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KCM6cc024386;
	Tue, 20 Apr 2010 12:22:06 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201004201222.o3KCM6cc024386@svn.freebsd.org>
From: Attilio Rao 
Date: Tue, 20 Apr 2010 12:22: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: r206897 - 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, 20 Apr 2010 12:22:06 -0000

Author: attilio
Date: Tue Apr 20 12:22:06 2010
New Revision: 206897
URL: http://svn.freebsd.org/changeset/base/206897

Log:
  Fix compilation in the !SMP case.
  Keep the interrupts disabled in order to avoid preemption problems.
  
  Reported by:	tinderbox, b.f. 
  MFC:		2 weeks
  X-MFC:		r206878

Modified:
  head/sys/kern/kern_shutdown.c

Modified: head/sys/kern/kern_shutdown.c
==============================================================================
--- head/sys/kern/kern_shutdown.c	Tue Apr 20 12:07:16 2010	(r206896)
+++ head/sys/kern/kern_shutdown.c	Tue Apr 20 12:22:06 2010	(r206897)
@@ -496,8 +496,14 @@ shutdown_reset(void *junk, int howto)
 	 *   generally, threads busy-waiting, with this spinlock held,
 	 *   and waiting for responses by threads on other CPUs
 	 *   (ie. smp_tlb_shootdown()).
+	 *
+	 * For the !SMP case it just needs to handle the former problem.
 	 */
+#ifdef SMP
 	mtx_lock_spin(&smp_ipi_mtx);
+#else
+	spinlock_enter();
+#endif
 
 	/* cpu_boot(howto); */ /* doesn't do anything at the moment */
 	cpu_reset();

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 13:57: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 15D611065670;
	Tue, 20 Apr 2010 13:57:45 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195])
	by mx1.freebsd.org (Postfix) with ESMTP id CDA478FC13;
	Tue, 20 Apr 2010 13:57:44 +0000 (UTC)
Received: from [10.170.20.44] (nat-170-142-177-44.tn.gov [170.142.177.44])
	(authenticated bits=0)
	by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id o3KDvenf014804
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Apr 2010 09:57:41 -0400 (EDT)
	(envelope-from rnoland@FreeBSD.org)
Message-ID: <4BCDB2C8.7090505@FreeBSD.org>
Date: Tue, 20 Apr 2010 08:57:28 -0500
From: Robert Noland 
Organization: FreeBSD
User-Agent: Thunderbird 2.0.0.19 (X11/20090218)
MIME-Version: 1.0
To: Julian Elischer 
References: <201004191511.o3JFBjLj036350@svn.freebsd.org>
	<4BCC7E64.4040200@FreeBSD.org> <4BCCDCC9.2070604@elischer.org>
In-Reply-To: <4BCCDCC9.2070604@elischer.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=0.9 required=5.0 tests=AWL, BAYES_00,
	FH_DATE_PAST_20XX, 
	RDNS_DYNAMIC,SPF_SOFTFAIL autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net
Cc: svn-src-head@freebsd.org, Luigi Rizzo ,
	src-committers@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r206843 - head/sbin/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: Tue, 20 Apr 2010 13:57:45 -0000



Julian Elischer wrote:
> On 4/19/10 9:01 AM, Robert Noland wrote:
>>
>>
>> Luigi Rizzo wrote:
> 
> 
> [...]
> 
>> Index: sbin/ipfw/ipfw2.c
>> ===================================================================
>> --- sbin/ipfw/ipfw2.c (revision 206844)
>> +++ sbin/ipfw/ipfw2.c (working copy)
>> @@ -326,7 +326,7 @@
>> #ifdef TCC
>> #define U64_FMT "I64"
>> #else
>> -#define U64_FMT "llu"
>> +#define U64_FMT "ju"
>> #endif
>> uint64_t d;
> 
>  believe there is a posix define for this?
> (though I can't remember it right now).

machine/_inttypes.h

...
#define PRIu8           "u"     /* uint8_t */
#define PRIu16          "u"     /* uint16_t */
#define PRIu32          "u"     /* uint32_t */
#define PRIu64          "lu"    /* uint64_t */
...

robert.


>>
>> robert.
> 
> [...]

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 14: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 964751065670;
	Tue, 20 Apr 2010 14:22: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 8319B8FC14;
	Tue, 20 Apr 2010 14: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 o3KEMTgp050819;
	Tue, 20 Apr 2010 14:22:29 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KEMTao050817;
	Tue, 20 Apr 2010 14:22:29 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004201422.o3KEMTao050817@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 20 Apr 2010 14:22:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206898 - 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: Tue, 20 Apr 2010 14:22:29 -0000

Author: kib
Date: Tue Apr 20 14:22:29 2010
New Revision: 206898
URL: http://svn.freebsd.org/changeset/base/206898

Log:
  Free() is not allowed to modify errno, remove safety brackets around it [1].
  Add small optimization, do not copy a string to the buffer that is
  to be freed immediately after.
  
  Noted by:	jh [1]
  Reviewed by:	jh
  MFC after:	2 weeks

Modified:
  head/lib/libc/stdlib/realpath.c

Modified: head/lib/libc/stdlib/realpath.c
==============================================================================
--- head/lib/libc/stdlib/realpath.c	Tue Apr 20 12:22:06 2010	(r206897)
+++ head/lib/libc/stdlib/realpath.c	Tue Apr 20 14:22:29 2010	(r206898)
@@ -84,12 +84,10 @@ realpath(const char * __restrict path, c
 		left_len = strlcpy(left, path + 1, sizeof(left));
 	} else {
 		if (getcwd(resolved, PATH_MAX) == NULL) {
-			strlcpy(resolved, ".", PATH_MAX);
-			if (m) {
-				serrno = errno;
+			if (m)
 				free(resolved);
-				errno = serrno;
-			}
+			else
+				strlcpy(resolved, ".", PATH_MAX);
 			return (NULL);
 		}
 		resolved_len = strlen(resolved);
@@ -168,11 +166,8 @@ realpath(const char * __restrict path, c
 				errno = serrno;
 				return (resolved);
 			}
-			if (m) {
-				serrno = errno;
+			if (m)
 				free(resolved);
-				errno = serrno;
-			}
 			return (NULL);
 		}
 		if (S_ISLNK(sb.st_mode)) {
@@ -184,11 +179,8 @@ realpath(const char * __restrict path, c
 			}
 			slen = readlink(resolved, symlink, sizeof(symlink) - 1);
 			if (slen < 0) {
-				if (m) {
-					serrno = errno;
+				if (m)
 					free(resolved);
-					errno = serrno;
-				}
 				return (NULL);
 			}
 			symlink[slen] = '\0';

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 15:23: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 3E819106564A;
	Tue, 20 Apr 2010 15:23:13 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2AC1D8FC27;
	Tue, 20 Apr 2010 15:23: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 o3KFNCT6065922;
	Tue, 20 Apr 2010 15:23:13 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KFNCYP065917;
	Tue, 20 Apr 2010 15:23:12 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201004201523.o3KFNCYP065917@svn.freebsd.org>
From: Luigi Rizzo 
Date: Tue, 20 Apr 2010 15:23:12 +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: r206899 - in stable/8: sbin/geom/class
	sbin/geom/class/sched sys/geom/sched sys/modules/geom
	sys/modules/geom/geom_sched
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, 20 Apr 2010 15:23:13 -0000

Author: luigi
Date: Tue Apr 20 15:23:12 2010
New Revision: 206899
URL: http://svn.freebsd.org/changeset/base/206899

Log:
  MFC geom_sched code, a geom-based disk scheduling framework.

Added:
  stable/8/sbin/geom/class/sched/
     - copied from r206497, head/sbin/geom/class/sched/
  stable/8/sys/geom/sched/
     - copied from r206497, head/sys/geom/sched/
  stable/8/sys/modules/geom/geom_sched/
     - copied from r206497, head/sys/modules/geom/geom_sched/
Modified:
  stable/8/sbin/geom/class/Makefile
  stable/8/sbin/geom/class/sched/Makefile
  stable/8/sbin/geom/class/sched/geom_sched.c
  stable/8/sbin/geom/class/sched/gsched.8
  stable/8/sys/geom/sched/g_sched.c
  stable/8/sys/geom/sched/g_sched.h
  stable/8/sys/geom/sched/gs_rr.c
  stable/8/sys/geom/sched/gs_scheduler.h
  stable/8/sys/modules/geom/Makefile
Directory Properties:
  stable/8/sbin/geom/   (props changed)
  stable/8/sbin/geom/class/stripe/   (props changed)

Modified: stable/8/sbin/geom/class/Makefile
==============================================================================
--- stable/8/sbin/geom/class/Makefile	Tue Apr 20 14:22:29 2010	(r206898)
+++ stable/8/sbin/geom/class/Makefile	Tue Apr 20 15:23:12 2010	(r206899)
@@ -14,6 +14,7 @@ SUBDIR+=multipath
 SUBDIR+=nop
 SUBDIR+=part
 SUBDIR+=raid3
+SUBDIR+=sched
 SUBDIR+=shsec
 SUBDIR+=stripe
 SUBDIR+=virstor

Modified: stable/8/sbin/geom/class/sched/Makefile
==============================================================================
--- head/sbin/geom/class/sched/Makefile	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sbin/geom/class/sched/Makefile	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,9 +1,8 @@
 # GEOM_LIBRARY_PATH
 # $FreeBSD$
 
-.PATH: /usr/src/sbin/geom/misc
-
-CFLAGS += -I/usr/src/sbin/geom
+.PATH: ${.CURDIR}/../../misc
+#CFLAGS += -I/usr/src/sbin/geom
 
 CLASS=sched
 

Modified: stable/8/sbin/geom/class/sched/geom_sched.c
==============================================================================
--- head/sbin/geom/class/sched/geom_sched.c	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sbin/geom/class/sched/geom_sched.c	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009 Fabio Checconi
+ * Copyright (c) 2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/8/sbin/geom/class/sched/gsched.8
==============================================================================
--- head/sbin/geom/class/sched/gsched.8	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sbin/geom/class/sched/gsched.8	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,6 +1,6 @@
-.\" Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+.\" Copyright (c) 2009-2010 Fabio Checconi
+.\" Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
 .\" All rights reserved.
-.\" $FreeBSD$
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -23,6 +23,8 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
+.\" $FreeBSD$
+.\"
 .Dd April 12, 2010
 .Dt GSCHED 8
 .Os

Modified: stable/8/sys/geom/sched/g_sched.c
==============================================================================
--- head/sys/geom/sched/g_sched.c	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sys/geom/sched/g_sched.c	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/8/sys/geom/sched/g_sched.h
==============================================================================
--- head/sys/geom/sched/g_sched.h	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sys/geom/sched/g_sched.h	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/8/sys/geom/sched/gs_rr.c
==============================================================================
--- head/sys/geom/sched/gs_rr.c	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sys/geom/sched/gs_rr.c	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/8/sys/geom/sched/gs_scheduler.h
==============================================================================
--- head/sys/geom/sched/gs_scheduler.h	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sys/geom/sched/gs_scheduler.h	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/8/sys/modules/geom/Makefile
==============================================================================
--- stable/8/sys/modules/geom/Makefile	Tue Apr 20 14:22:29 2010	(r206898)
+++ stable/8/sys/modules/geom/Makefile	Tue Apr 20 15:23:12 2010	(r206899)
@@ -18,6 +18,7 @@ SUBDIR=	geom_bde \
 	geom_part \
 	geom_pc98 \
 	geom_raid3 \
+	geom_sched \
 	geom_shsec \
 	geom_stripe \
 	geom_sunlabel \

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 16:30: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 033EA1065670;
	Tue, 20 Apr 2010 16:30: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 E5BE28FC1A;
	Tue, 20 Apr 2010 16:30: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 o3KGUHp8082389;
	Tue, 20 Apr 2010 16:30:17 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KGUHKP082387;
	Tue, 20 Apr 2010 16:30:17 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004201630.o3KGUHKP082387@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 20 Apr 2010 16:30:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206900 - in head/sys: cddl/dev/cyclic/amd64
	modules/cyclic
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, 20 Apr 2010 16:30:18 -0000

Author: rpaulo
Date: Tue Apr 20 16:30:17 2010
New Revision: 206900
URL: http://svn.freebsd.org/changeset/base/206900

Log:
  The amd64 version of the cyclic dtrace module is a verbatim copy of the
  i386 version, so instead having a copy of the same file, use Makefile
  foo to include the i386 version on amd64.

Deleted:
  head/sys/cddl/dev/cyclic/amd64/
Modified:
  head/sys/modules/cyclic/Makefile

Modified: head/sys/modules/cyclic/Makefile
==============================================================================
--- head/sys/modules/cyclic/Makefile	Tue Apr 20 15:23:12 2010	(r206899)
+++ head/sys/modules/cyclic/Makefile	Tue Apr 20 16:30:17 2010	(r206900)
@@ -10,7 +10,7 @@ SRCS+=		vnode_if.h
 CFLAGS+=	-I${.CURDIR}/../../cddl/compat/opensolaris		\
 		-I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common	\
 		-I${.CURDIR}/../..					\
-		-I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_ARCH}
+		-I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_ARCH:S/amd64/i386/}
 
 CFLAGS+=	-DDEBUG=1
 

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 17:03: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 E91B11065670;
	Tue, 20 Apr 2010 17:03:30 +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 D75E08FC16;
	Tue, 20 Apr 2010 17:03: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 o3KH3UXj089741;
	Tue, 20 Apr 2010 17:03:30 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KH3Uj5089736;
	Tue, 20 Apr 2010 17:03:30 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004201703.o3KH3Uj5089736@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 20 Apr 2010 17:03: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: r206901 - in head/sys: amd64/amd64 cddl/dev/cyclic/i386
	i386/i386 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, 20 Apr 2010 17:03:31 -0000

Author: rpaulo
Date: Tue Apr 20 17:03:30 2010
New Revision: 206901
URL: http://svn.freebsd.org/changeset/base/206901

Log:
  Rename the cyclic global variable lapic_cyclic_clock_func to just
  cyclic_clock_func. This will make more sense when we start developing non
  x86 cyclic version.

Modified:
  head/sys/amd64/amd64/local_apic.c
  head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
  head/sys/i386/i386/local_apic.c
  head/sys/sys/dtrace_bsd.h

Modified: head/sys/amd64/amd64/local_apic.c
==============================================================================
--- head/sys/amd64/amd64/local_apic.c	Tue Apr 20 16:30:17 2010	(r206900)
+++ head/sys/amd64/amd64/local_apic.c	Tue Apr 20 17:03:30 2010	(r206901)
@@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$");
 
 #ifdef KDTRACE_HOOKS
 #include 
-cyclic_clock_func_t	lapic_cyclic_clock_func[MAXCPU];
+cyclic_clock_func_t	cyclic_clock_func[MAXCPU];
 #endif
 
 /* Sanity checks on IDT vectors. */
@@ -778,8 +778,8 @@ lapic_handle_timer(struct trapframe *fra
 	 * timers.
 	 */
 	int cpu = PCPU_GET(cpuid);
-	if (lapic_cyclic_clock_func[cpu] != NULL)
-		(*lapic_cyclic_clock_func[cpu])(frame);
+	if (cyclic_clock_func[cpu] != NULL)
+		(*cyclic_clock_func[cpu])(frame);
 #endif
 
 	/* Fire hardclock at hz. */

Modified: head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
==============================================================================
--- head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Tue Apr 20 16:30:17 2010	(r206900)
+++ head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Tue Apr 20 17:03:30 2010	(r206901)
@@ -67,7 +67,7 @@ cyclic_machdep_uninit(void)
 
 	for (i = 0; i <= mp_maxid; i++)
 		/* Reset the cyclic clock callback hook. */
-		lapic_cyclic_clock_func[i] = NULL;
+		cyclic_clock_func[i] = NULL;
 
 	/* De-register the cyclic backend. */
 	cyclic_uninit();
@@ -105,13 +105,13 @@ cyclic_clock(struct trapframe *frame)
 static void enable(cyb_arg_t arg)
 {
 	/* Register the cyclic clock callback function. */
-	lapic_cyclic_clock_func[curcpu] = cyclic_clock;
+	cyclic_clock_func[curcpu] = cyclic_clock;
 }
 
 static void disable(cyb_arg_t arg)
 {
 	/* Reset the cyclic clock callback function. */
-	lapic_cyclic_clock_func[curcpu] = NULL;
+	cyclic_clock_func[curcpu] = NULL;
 }
 
 static void reprogram(cyb_arg_t arg, hrtime_t exp)

Modified: head/sys/i386/i386/local_apic.c
==============================================================================
--- head/sys/i386/i386/local_apic.c	Tue Apr 20 16:30:17 2010	(r206900)
+++ head/sys/i386/i386/local_apic.c	Tue Apr 20 17:03:30 2010	(r206901)
@@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
 
 #ifdef KDTRACE_HOOKS
 #include 
-cyclic_clock_func_t	lapic_cyclic_clock_func[MAXCPU];
+cyclic_clock_func_t	cyclic_clock_func[MAXCPU];
 #endif
 
 /* Sanity checks on IDT vectors. */
@@ -779,8 +779,8 @@ lapic_handle_timer(struct trapframe *fra
 	 * timers.
 	 */
 	int cpu = PCPU_GET(cpuid);
-	if (lapic_cyclic_clock_func[cpu] != NULL)
-		(*lapic_cyclic_clock_func[cpu])(frame);
+	if (cyclic_clock_func[cpu] != NULL)
+		(*cyclic_clock_func[cpu])(frame);
 #endif
 
 	/* Fire hardclock at hz. */

Modified: head/sys/sys/dtrace_bsd.h
==============================================================================
--- head/sys/sys/dtrace_bsd.h	Tue Apr 20 16:30:17 2010	(r206900)
+++ head/sys/sys/dtrace_bsd.h	Tue Apr 20 17:03:30 2010	(r206901)
@@ -50,7 +50,7 @@ typedef	void (*cyclic_clock_func_t)(stru
  *
  * Defining them here avoids a proliferation of header files.
  */
-extern cyclic_clock_func_t     lapic_cyclic_clock_func[];
+extern cyclic_clock_func_t     cyclic_clock_func[];
 
 /*
  * The dtrace module handles traps that occur during a DTrace probe.

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 17:22: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 A7CF71065676;
	Tue, 20 Apr 2010 17:22: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 96F9A8FC14;
	Tue, 20 Apr 2010 17:22: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 o3KHMKVm093879;
	Tue, 20 Apr 2010 17:22:20 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KHMKIf093877;
	Tue, 20 Apr 2010 17:22:20 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004201722.o3KHMKIf093877@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 20 Apr 2010 17:22: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: r206902 - 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: Tue, 20 Apr 2010 17:22:20 -0000

Author: rpaulo
Date: Tue Apr 20 17:22:20 2010
New Revision: 206902
URL: http://svn.freebsd.org/changeset/base/206902

Log:
  Add the necessary hooks for dtrace cyclic module.

Modified:
  head/sys/mips/mips/tick.c

Modified: head/sys/mips/mips/tick.c
==============================================================================
--- head/sys/mips/mips/tick.c	Tue Apr 20 17:03:30 2010	(r206901)
+++ head/sys/mips/mips/tick.c	Tue Apr 20 17:22:20 2010	(r206902)
@@ -295,7 +295,16 @@ clock_intr(void *arg)
 	 */
 	if (delta > cycles_per_hz)
 		delta = cycles_per_hz;
-
+#if KDTRACE_HOOKS
+	/*
+	 * If the DTrace hooks are configured and a callback function
+	 * has been registered, then call it to process the high speed
+	 * timers.
+	 */
+	int cpu = PCPU_GET(cpuid);
+	if (cyclic_clock_func[cpu] != NULL)
+		(*cyclic_clock_func[cpu])(tf);
+#endif
 	/* Fire hardclock at hz. */
 	cpu_ticks->hard_ticks += delta;
 	if (cpu_ticks->hard_ticks >= cycles_per_hz) {

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 17:57: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 536EB1065672;
	Tue, 20 Apr 2010 17:57:44 +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 42C018FC17;
	Tue, 20 Apr 2010 17:57: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 o3KHvio9001747;
	Tue, 20 Apr 2010 17:57:44 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KHvi2L001745;
	Tue, 20 Apr 2010 17:57:44 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201004201757.o3KHvi2L001745@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 20 Apr 2010 17:57:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206903 - head/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, 20 Apr 2010 17:57:44 -0000

Author: imp
Date: Tue Apr 20 17:57:43 2010
New Revision: 206903
URL: http://svn.freebsd.org/changeset/base/206903

Log:
  Make this file more C++ friendly.

Modified:
  head/sys/sys/thr.h

Modified: head/sys/sys/thr.h
==============================================================================
--- head/sys/sys/thr.h	Tue Apr 20 17:22:20 2010	(r206902)
+++ head/sys/sys/thr.h	Tue Apr 20 17:57:43 2010	(r206903)
@@ -30,6 +30,7 @@
 #ifndef _SYS_THR_H_
 #define	_SYS_THR_H_
 
+#include 
 #include 
 #include 
 
@@ -68,6 +69,7 @@ typedef __pid_t		pid_t;
 #define _PID_T_DECLARED
 #endif
 
+__BEGIN_DECLS
 int thr_create(ucontext_t *ctx, long *id, int flags);
 int thr_new(struct thr_param *param, int param_size);
 int thr_self(long *id);
@@ -77,7 +79,7 @@ int thr_kill2(pid_t pid, long id, int si
 int thr_suspend(const struct timespec *timeout);
 int thr_wake(long id);
 int thr_set_name(long id, const char *name);
-
+__END_DECLS
 #endif /* !_KERNEL */
 
 #endif /* ! _SYS_THR_H_ */

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 18:16: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 3398C1065677;
	Tue, 20 Apr 2010 18:16:57 +0000 (UTC)
	(envelope-from anchie@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E06BA8FC25;
	Tue, 20 Apr 2010 18:16: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 o3KIGuSD006082;
	Tue, 20 Apr 2010 18:16:56 GMT (envelope-from anchie@svn.freebsd.org)
Received: (from anchie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KIGuAk006081;
	Tue, 20 Apr 2010 18:16:56 GMT (envelope-from anchie@svn.freebsd.org)
Message-Id: <201004201816.o3KIGuAk006081@svn.freebsd.org>
From: Ana Kukec 
Date: Tue, 20 Apr 2010 18:16: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: r206904 - 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: Tue, 20 Apr 2010 18:16:57 -0000

Author: anchie
Date: Tue Apr 20 18:16:56 2010
New Revision: 206904
URL: http://svn.freebsd.org/changeset/base/206904

Log:
  Add myself and list bz@ as my mentor.
  
  Approved by:	bz (mentor)

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==============================================================================
--- head/share/misc/committers-src.dot	Tue Apr 20 17:57:43 2010	(r206903)
+++ head/share/misc/committers-src.dot	Tue Apr 20 18:16:56 2010	(r206904)
@@ -55,6 +55,7 @@ node [color=lightblue2, style=filled, bg
 ache [label="Andrey Chernov\nache@FreeBSD.org\n1993/10/31"]
 akiyama [label="Shunsuke Akiyama\nakiyama@FreeBSD.org\n2000/06/19"]
 ambrisko [label="Doug Ambrisko\nambrisko@FreeBSD.org\n2001/12/19"]
+anchie [label="Ana Kukec\anchie@FreeBSD.org\n2010/04/14"]
 andre [label="Andre Oppermann\nandre@FreeBSD.org\n2003/11/12"]
 anholt [label="Eric Anholt\nanholt@FreeBSD.org\n2002/04/22"]
 antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2008/02/03"]
@@ -238,6 +239,7 @@ brian -> joe
 brooks -> bushman
 brooks -> jamie
 
+bz -> anchie
 bz -> jamie
 bz -> syrinx
 

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 18:42: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 D5C1F1065673;
	Tue, 20 Apr 2010 18:42: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 C30AE8FC08;
	Tue, 20 Apr 2010 18:42: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 o3KIgpoV011863;
	Tue, 20 Apr 2010 18:42:51 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KIgpdH011844;
	Tue, 20 Apr 2010 18:42:51 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004201842.o3KIgpdH011844@svn.freebsd.org>
From: Xin LI 
Date: Tue, 20 Apr 2010 18:42:51 +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: r206905 - vendor/libz/dist
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, 20 Apr 2010 18:42:52 -0000

Author: delphij
Date: Tue Apr 20 18:42:51 2010
New Revision: 206905
URL: http://svn.freebsd.org/changeset/base/206905

Log:
  Vendor import of zlib 1.2.5.

Modified:
  vendor/libz/dist/ChangeLog
  vendor/libz/dist/README
  vendor/libz/dist/crc32.c
  vendor/libz/dist/deflate.c
  vendor/libz/dist/deflate.h
  vendor/libz/dist/gzguts.h
  vendor/libz/dist/gzlib.c
  vendor/libz/dist/inffast.c
  vendor/libz/dist/inffast.h
  vendor/libz/dist/inftrees.c
  vendor/libz/dist/inftrees.h
  vendor/libz/dist/trees.c
  vendor/libz/dist/trees.h
  vendor/libz/dist/zconf.h
  vendor/libz/dist/zlib.3
  vendor/libz/dist/zlib.h
  vendor/libz/dist/zutil.c
  vendor/libz/dist/zutil.h

Modified: vendor/libz/dist/ChangeLog
==============================================================================
--- vendor/libz/dist/ChangeLog	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/ChangeLog	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,6 +1,32 @@
 
                 ChangeLog file for zlib
 
+Changes in 1.2.5 (19 Apr 2010)
+- Disable visibility attribute in win32/Makefile.gcc [Bar-Lev]
+- Default to libdir as sharedlibdir in configure [Nieder]
+- Update copyright dates on modified source files
+- Update trees.c to be able to generate modified trees.h
+- Exit configure for MinGW, suggesting win32/Makefile.gcc
+
+Changes in 1.2.4.5 (18 Apr 2010)
+- Set sharedlibdir in configure [Torok]
+- Set LDFLAGS in Makefile.in [Bar-Lev]
+- Avoid mkdir objs race condition in Makefile.in [Bowler]
+- Add ZLIB_INTERNAL in front of internal inter-module functions and arrays
+- Define ZLIB_INTERNAL to hide internal functions and arrays for GNU C
+- Don't use hidden attribute when it is a warning generator (e.g. Solaris)
+
+Changes in 1.2.4.4 (18 Apr 2010)
+- Fix CROSS_PREFIX executable testing, CHOST extract, mingw* [Torok]
+- Undefine _LARGEFILE64_SOURCE in zconf.h if it is zero, but not if empty
+- Try to use bash or ksh regardless of functionality of /bin/sh
+- Fix configure incompatibility with NetBSD sh
+- Remove attempt to run under bash or ksh since have better NetBSD fix
+- Fix win32/Makefile.gcc for MinGW [Bar-Lev]
+- Add diagnostic messages when using CROSS_PREFIX in configure
+- Added --sharedlibdir option to configure [Weigelt]
+- Use hidden visibility attribute when available [Frysinger]
+
 Changes in 1.2.4.3 (10 Apr 2010)
 - Only use CROSS_PREFIX in configure for ar and ranlib if they exist
 - Use CROSS_PREFIX for nm [Bar-Lev]
@@ -151,7 +177,7 @@ Changes in 1.2.3.6 (17 Jan 2010)
 - Correct email address in configure for system options
 - Update make_vms.com and add make_vms.com to contrib/minizip [Zinser]
 - Update zlib.map [Brown]
-- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Tšršk]
+- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Torok]
 - Apply various fixes to CMakeLists.txt [Lowman]
 - Add checks on len in gzread() and gzwrite()
 - Add error message for no more room for gzungetc()

Modified: vendor/libz/dist/README
==============================================================================
--- vendor/libz/dist/README	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/README	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,6 +1,6 @@
 ZLIB DATA COMPRESSION LIBRARY
 
-zlib 1.2.4.3 is a general purpose data compression library.  All the code is
+zlib 1.2.5 is a general purpose data compression library.  All the code is
 thread safe.  The data format used by the zlib library is described by RFCs
 (Request for Comments) 1950 to 1952 in the files
 http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
@@ -31,7 +31,7 @@ Mark Nelson  wrote an ar
 issue of Dr.  Dobb's Journal; a copy of the article is available at
 http://marknelson.us/1997/01/01/zlib-engine/ .
 
-The changes made in version 1.2.4.3 are documented in the file ChangeLog.
+The changes made in version 1.2.5 are documented in the file ChangeLog.
 
 Unsupported third party contributions are provided in directory contrib/ .
 

Modified: vendor/libz/dist/crc32.c
==============================================================================
--- vendor/libz/dist/crc32.c	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/crc32.c	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,5 +1,5 @@
 /* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2006 Mark Adler
+ * Copyright (C) 1995-2006, 2010 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  *
  * Thanks to Rodney Brown  for his contribution of faster

Modified: vendor/libz/dist/deflate.c
==============================================================================
--- vendor/libz/dist/deflate.c	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/deflate.c	Tue Apr 20 18:42:51 2010	(r206905)
@@ -52,7 +52,7 @@
 #include "deflate.h"
 
 const char deflate_copyright[] =
-   " deflate 1.2.4.3 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
+   " deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot

Modified: vendor/libz/dist/deflate.h
==============================================================================
--- vendor/libz/dist/deflate.h	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/deflate.h	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,5 +1,5 @@
 /* deflate.h -- internal compression state
- * Copyright (C) 1995-2009 Jean-loup Gailly
+ * Copyright (C) 1995-2010 Jean-loup Gailly
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -290,13 +290,13 @@ typedef struct internal_state {
    memory checker errors from longest match routines */
 
         /* in trees.c */
-void _tr_init         OF((deflate_state *s));
-int  _tr_tally        OF((deflate_state *s, unsigned dist, unsigned lc));
-void _tr_flush_block  OF((deflate_state *s, charf *buf, ulg stored_len,
-                          int last));
-void _tr_align        OF((deflate_state *s));
-void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
-                          int last));
+void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
+int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
+void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
+                        ulg stored_len, int last));
+void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
+void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
+                        ulg stored_len, int last));
 
 #define d_code(dist) \
    ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
@@ -309,11 +309,11 @@ void _tr_stored_block OF((deflate_state 
 /* Inline versions of _tr_tally for speed: */
 
 #if defined(GEN_TREES_H) || !defined(STDC)
-  extern uch _length_code[];
-  extern uch _dist_code[];
+  extern uch ZLIB_INTERNAL _length_code[];
+  extern uch ZLIB_INTERNAL _dist_code[];
 #else
-  extern const uch _length_code[];
-  extern const uch _dist_code[];
+  extern const uch ZLIB_INTERNAL _length_code[];
+  extern const uch ZLIB_INTERNAL _dist_code[];
 #endif
 
 # define _tr_tally_lit(s, c, flush) \

Modified: vendor/libz/dist/gzguts.h
==============================================================================
--- vendor/libz/dist/gzguts.h	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/gzguts.h	Tue Apr 20 18:42:51 2010	(r206905)
@@ -12,7 +12,11 @@
 #  endif
 #endif
 
-#define ZLIB_INTERNAL
+#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
+#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+#  define ZLIB_INTERNAL
+#endif
 
 #include 
 #include "zlib.h"
@@ -112,9 +116,9 @@ typedef struct {
 typedef gz_state FAR *gz_statep;
 
 /* shared functions */
-ZEXTERN void ZEXPORT gz_error OF((gz_statep, int, const char *));
+void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
 #if defined UNDER_CE
-ZEXTERN char ZEXPORT *gz_strwinerror OF((DWORD error));
+char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
 #endif
 
 /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
@@ -123,6 +127,6 @@ ZEXTERN char ZEXPORT *gz_strwinerror OF(
 #ifdef INT_MAX
 #  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
 #else
-ZEXTERN unsigned ZEXPORT gz_intmax OF((void));
+unsigned ZLIB_INTERNAL gz_intmax OF((void));
 #  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
 #endif

Modified: vendor/libz/dist/gzlib.c
==============================================================================
--- vendor/libz/dist/gzlib.c	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/gzlib.c	Tue Apr 20 18:42:51 2010	(r206905)
@@ -26,7 +26,7 @@ local gzFile gz_open OF((const char *, i
 
    The gz_strwinerror function does not change the current setting of
    GetLastError. */
-char ZEXPORT *gz_strwinerror (error)
+char ZLIB_INTERNAL *gz_strwinerror (error)
      DWORD error;
 {
     static char buf[1024];
@@ -482,7 +482,7 @@ void ZEXPORT gzclearerr(file)
    memory).  Simply save the error message as a static string.  If there is an
    allocation failure constructing the error message, then convert the error to
    out of memory. */
-void ZEXPORT gz_error(state, err, msg)
+void ZLIB_INTERNAL gz_error(state, err, msg)
     gz_statep state;
     int err;
     const char *msg;
@@ -522,7 +522,7 @@ void ZEXPORT gz_error(state, err, msg)
    available) -- we need to do this to cover cases where 2's complement not
    used, since C standard permits 1's complement and sign-bit representations,
    otherwise we could just use ((unsigned)-1) >> 1 */
-unsigned ZEXPORT gz_intmax()
+unsigned ZLIB_INTERNAL gz_intmax()
 {
     unsigned p, q;
 

Modified: vendor/libz/dist/inffast.c
==============================================================================
--- vendor/libz/dist/inffast.c	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/inffast.c	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,5 +1,5 @@
 /* inffast.c -- fast decoding
- * Copyright (C) 1995-2008 Mark Adler
+ * Copyright (C) 1995-2008, 2010 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -64,7 +64,7 @@
       requires strm->avail_out >= 258 for each loop to avoid checking for
       output space.
  */
-void inflate_fast(strm, start)
+void ZLIB_INTERNAL inflate_fast(strm, start)
 z_streamp strm;
 unsigned start;         /* inflate()'s starting value for strm->avail_out */
 {

Modified: vendor/libz/dist/inffast.h
==============================================================================
--- vendor/libz/dist/inffast.h	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/inffast.h	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,5 +1,5 @@
 /* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-2003 Mark Adler
+ * Copyright (C) 1995-2003, 2010 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -8,4 +8,4 @@
    subject to change. Applications should only use zlib.h.
  */
 
-void inflate_fast OF((z_streamp strm, unsigned start));
+void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));

Modified: vendor/libz/dist/inftrees.c
==============================================================================
--- vendor/libz/dist/inftrees.c	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/inftrees.c	Tue Apr 20 18:42:51 2010	(r206905)
@@ -9,7 +9,7 @@
 #define MAXBITS 15
 
 const char inflate_copyright[] =
-   " inflate 1.2.4.3 Copyright 1995-2010 Mark Adler ";
+   " inflate 1.2.5 Copyright 1995-2010 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -29,7 +29,7 @@ const char inflate_copyright[] =
    table index bits.  It will differ if the request is greater than the
    longest code or if it is less than the shortest code.
  */
-int inflate_table(type, lens, codes, table, bits, work)
+int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
 codetype type;
 unsigned short FAR *lens;
 unsigned codes;
@@ -62,7 +62,7 @@ unsigned short FAR *work;
         35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
     static const unsigned short lext[31] = { /* Length codes 257..285 extra */
         16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
-        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 195, 66};
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 73, 195};
     static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
         1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
         257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,

Modified: vendor/libz/dist/inftrees.h
==============================================================================
--- vendor/libz/dist/inftrees.h	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/inftrees.h	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,5 +1,5 @@
 /* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2005, 2010 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -57,6 +57,6 @@ typedef enum {
     DISTS
 } codetype;
 
-extern int inflate_table OF((codetype type, unsigned short FAR *lens,
+int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
                              unsigned codes, code FAR * FAR *table,
                              unsigned FAR *bits, unsigned short FAR *work));

Modified: vendor/libz/dist/trees.c
==============================================================================
--- vendor/libz/dist/trees.c	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/trees.c	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,5 +1,5 @@
 /* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2009 Jean-loup Gailly
+ * Copyright (C) 1995-2010 Jean-loup Gailly
  * detect_data_type() function provided freely by Cosmin Truta, 2006
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
@@ -351,13 +351,14 @@ void gen_trees_header()
                 static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
     }
 
-    fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
+    fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n");
     for (i = 0; i < DIST_CODE_LEN; i++) {
         fprintf(header, "%2u%s", _dist_code[i],
                 SEPARATOR(i, DIST_CODE_LEN-1, 20));
     }
 
-    fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
+    fprintf(header,
+        "const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
     for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
         fprintf(header, "%2u%s", _length_code[i],
                 SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
@@ -382,7 +383,7 @@ void gen_trees_header()
 /* ===========================================================================
  * Initialize the tree data structures for a new zlib stream.
  */
-void _tr_init(s)
+void ZLIB_INTERNAL _tr_init(s)
     deflate_state *s;
 {
     tr_static_init();
@@ -867,7 +868,7 @@ local void send_all_trees(s, lcodes, dco
 /* ===========================================================================
  * Send a stored block
  */
-void _tr_stored_block(s, buf, stored_len, last)
+void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
     deflate_state *s;
     charf *buf;       /* input block */
     ulg stored_len;   /* length of input block */
@@ -892,7 +893,7 @@ void _tr_stored_block(s, buf, stored_len
  * To simplify the code, we assume the worst case of last real code encoded
  * on one bit only.
  */
-void _tr_align(s)
+void ZLIB_INTERNAL _tr_align(s)
     deflate_state *s;
 {
     send_bits(s, STATIC_TREES<<1, 3);
@@ -921,7 +922,7 @@ void _tr_align(s)
  * Determine the best encoding for the current block: dynamic trees, static
  * trees or store, and output the encoded block to the zip file.
  */
-void _tr_flush_block(s, buf, stored_len, last)
+void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
     deflate_state *s;
     charf *buf;       /* input block, or NULL if too old */
     ulg stored_len;   /* length of input block */
@@ -1022,7 +1023,7 @@ void _tr_flush_block(s, buf, stored_len,
  * Save the match info and tally the frequency counts. Return true if
  * the current block must be flushed.
  */
-int _tr_tally (s, dist, lc)
+int ZLIB_INTERNAL _tr_tally (s, dist, lc)
     deflate_state *s;
     unsigned dist;  /* distance of matched string */
     unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */

Modified: vendor/libz/dist/trees.h
==============================================================================
--- vendor/libz/dist/trees.h	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/trees.h	Tue Apr 20 18:42:51 2010	(r206905)
@@ -70,7 +70,7 @@ local const ct_data static_dtree[D_CODES
 {{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
 };
 
-const uch _dist_code[DIST_CODE_LEN] = {
+const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
  0,  1,  2,  3,  4,  4,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8,
  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 10, 10,
 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
@@ -99,7 +99,7 @@ const uch _dist_code[DIST_CODE_LEN] = {
 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
 };
 
-const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
+const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
  0,  1,  2,  3,  4,  5,  6,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 12, 12,
 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,

Modified: vendor/libz/dist/zconf.h
==============================================================================
--- vendor/libz/dist/zconf.h	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/zconf.h	Tue Apr 20 18:42:51 2010	(r206905)
@@ -315,10 +315,6 @@
 #  endif
 #endif
 
-#ifdef HAVE_VISIBILITY_PRAGMA
-#  define ZEXTERN __attribute__((visibility ("default"))) extern
-#endif
-
 #ifndef ZEXTERN
 #  define ZEXTERN extern
 #endif
@@ -368,6 +364,16 @@ typedef uLong FAR uLongf;
 #  include     /* for off_t */
 #endif
 
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if -_LARGEFILE64_SOURCE - -1 == 1
+#  undef _LARGEFILE64_SOURCE
+#endif
+
 #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
 #  include        /* for SEEK_* and off_t */
 #  ifdef VMS

Modified: vendor/libz/dist/zlib.3
==============================================================================
--- vendor/libz/dist/zlib.3	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/zlib.3	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "10 Apr 2010"
+.TH ZLIB 3 "19 Apr 2010"
 .SH NAME
 zlib \- compression/decompression library
 .SH SYNOPSIS
@@ -125,7 +125,7 @@ before asking for help.
 Send questions and/or comments to zlib@gzip.org,
 or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
 .SH AUTHORS
-Version 1.2.4.3
+Version 1.2.5
 Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org)
 and Mark Adler (madler@alumni.caltech.edu).
 .LP

Modified: vendor/libz/dist/zlib.h
==============================================================================
--- vendor/libz/dist/zlib.h	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/zlib.h	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,5 +1,5 @@
 /* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.2.4.3, April 10th, 2010
+  version 1.2.5, April 19th, 2010
 
   Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
 
@@ -37,12 +37,12 @@
 extern "C" {
 #endif
 
-#define ZLIB_VERSION "1.2.4.3"
-#define ZLIB_VERNUM 0x1243
+#define ZLIB_VERSION "1.2.5"
+#define ZLIB_VERNUM 0x1250
 #define ZLIB_VER_MAJOR 1
 #define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 4
-#define ZLIB_VER_SUBREVISION 3
+#define ZLIB_VER_REVISION 5
+#define ZLIB_VER_SUBREVISION 0
 
 /*
     The 'zlib' compression library provides in-memory compression and

Modified: vendor/libz/dist/zutil.c
==============================================================================
--- vendor/libz/dist/zutil.c	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/zutil.c	Tue Apr 20 18:42:51 2010	(r206905)
@@ -1,5 +1,5 @@
 /* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2005, 2010 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -117,9 +117,9 @@ uLong ZEXPORT zlibCompileFlags()
 #  ifndef verbose
 #    define verbose 0
 #  endif
-int z_verbose = verbose;
+int ZLIB_INTERNAL z_verbose = verbose;
 
-void z_error (m)
+void ZLIB_INTERNAL z_error (m)
     char *m;
 {
     fprintf(stderr, "%s\n", m);
@@ -146,7 +146,7 @@ const char * ZEXPORT zError(err)
 
 #ifndef HAVE_MEMCPY
 
-void zmemcpy(dest, source, len)
+void ZLIB_INTERNAL zmemcpy(dest, source, len)
     Bytef* dest;
     const Bytef* source;
     uInt  len;
@@ -157,7 +157,7 @@ void zmemcpy(dest, source, len)
     } while (--len != 0);
 }
 
-int zmemcmp(s1, s2, len)
+int ZLIB_INTERNAL zmemcmp(s1, s2, len)
     const Bytef* s1;
     const Bytef* s2;
     uInt  len;
@@ -170,7 +170,7 @@ int zmemcmp(s1, s2, len)
     return 0;
 }
 
-void zmemzero(dest, len)
+void ZLIB_INTERNAL zmemzero(dest, len)
     Bytef* dest;
     uInt  len;
 {
@@ -213,7 +213,7 @@ local ptr_table table[MAX_PTR];
  * a protected system like OS/2. Use Microsoft C instead.
  */
 
-voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
 {
     voidpf buf = opaque; /* just to make some compilers happy */
     ulg bsize = (ulg)items*size;
@@ -237,7 +237,7 @@ voidpf zcalloc (voidpf opaque, unsigned 
     return buf;
 }
 
-void  zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
 {
     int n;
     if (*(ush*)&ptr != 0) { /* object < 64K */
@@ -272,13 +272,13 @@ void  zcfree (voidpf opaque, voidpf ptr)
 #  define _hfree   hfree
 #endif
 
-voidpf zcalloc (voidpf opaque, uInt items, uInt size)
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
 {
     if (opaque) opaque = 0; /* to make compiler happy */
     return _halloc((long)items, size);
 }
 
-void  zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
 {
     if (opaque) opaque = 0; /* to make compiler happy */
     _hfree(ptr);
@@ -297,7 +297,7 @@ extern voidp  calloc OF((uInt items, uIn
 extern void   free   OF((voidpf ptr));
 #endif
 
-voidpf zcalloc (opaque, items, size)
+voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
     voidpf opaque;
     unsigned items;
     unsigned size;
@@ -307,7 +307,7 @@ voidpf zcalloc (opaque, items, size)
                               (voidpf)calloc(items, size);
 }
 
-void  zcfree (opaque, ptr)
+void ZLIB_INTERNAL zcfree (opaque, ptr)
     voidpf opaque;
     voidpf ptr;
 {

Modified: vendor/libz/dist/zutil.h
==============================================================================
--- vendor/libz/dist/zutil.h	Tue Apr 20 18:16:56 2010	(r206904)
+++ vendor/libz/dist/zutil.h	Tue Apr 20 18:42:51 2010	(r206905)
@@ -13,7 +13,12 @@
 #ifndef ZUTIL_H
 #define ZUTIL_H
 
-#define ZLIB_INTERNAL
+#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
+#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+#  define ZLIB_INTERNAL
+#endif
+
 #include "zlib.h"
 
 #ifdef STDC
@@ -231,16 +236,16 @@ extern const char * const z_errmsg[10]; 
 #    define zmemzero(dest, len) memset(dest, 0, len)
 #  endif
 #else
-   extern void zmemcpy  OF((Bytef* dest, const Bytef* source, uInt len));
-   extern int  zmemcmp  OF((const Bytef* s1, const Bytef* s2, uInt len));
-   extern void zmemzero OF((Bytef* dest, uInt len));
+   void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+   int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+   void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
 #endif
 
 /* Diagnostic functions */
 #ifdef DEBUG
 #  include 
-   extern int z_verbose;
-   extern void z_error    OF((char *m));
+   extern int ZLIB_INTERNAL z_verbose;
+   extern void ZLIB_INTERNAL z_error OF((char *m));
 #  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
 #  define Trace(x) {if (z_verbose>=0) fprintf x ;}
 #  define Tracev(x) {if (z_verbose>0) fprintf x ;}
@@ -257,8 +262,9 @@ extern const char * const z_errmsg[10]; 
 #endif
 
 
-voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
-void   zcfree  OF((voidpf opaque, voidpf ptr));
+voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
+                        unsigned size));
+void ZLIB_INTERNAL zcfree  OF((voidpf opaque, voidpf ptr));
 
 #define ZALLOC(strm, items, size) \
            (*((strm)->zalloc))((strm)->opaque, (items), (size))

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 18:43: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 33D401065674;
	Tue, 20 Apr 2010 18:43:24 +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 09C348FC12;
	Tue, 20 Apr 2010 18:43: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 o3KIhNhK012036;
	Tue, 20 Apr 2010 18:43:23 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KIhNBA012035;
	Tue, 20 Apr 2010 18:43:23 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004201843.o3KIhNBA012035@svn.freebsd.org>
From: Xin LI 
Date: Tue, 20 Apr 2010 18:43:23 +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: r206906 - vendor/libz/1.2.5
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, 20 Apr 2010 18:43:24 -0000

Author: delphij
Date: Tue Apr 20 18:43:23 2010
New Revision: 206906
URL: http://svn.freebsd.org/changeset/base/206906

Log:
  Tag zlib 1.2.5.

Added:
  vendor/libz/1.2.5/
     - copied from r206905, vendor/libz/dist/

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 18:46: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 72F33106566C;
	Tue, 20 Apr 2010 18:46:00 +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 51D488FC15;
	Tue, 20 Apr 2010 18:46: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 o3KIk0v2012697;
	Tue, 20 Apr 2010 18:46:00 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KIk0Mr012695;
	Tue, 20 Apr 2010 18:46:00 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004201846.o3KIk0Mr012695@svn.freebsd.org>
From: Bruce Cran 
Date: Tue, 20 Apr 2010 18:46: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: r206908 - 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, 20 Apr 2010 18:46:00 -0000

Author: brucec
Date: Tue Apr 20 18:46:00 2010
New Revision: 206908
URL: http://svn.freebsd.org/changeset/base/206908

Log:
  MFC r204820:
  
  Install /etc/termcap.small .
  
  PR:	conf/78419
  Submitted by:	Eygene A.Ryabinkin 
  Approved by:	rrs (mentor)

Modified:
  stable/8/etc/Makefile
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/Makefile
==============================================================================
--- stable/8/etc/Makefile	Tue Apr 20 18:44:23 2010	(r206907)
+++ stable/8/etc/Makefile	Tue Apr 20 18:46:00 2010	(r206908)
@@ -18,7 +18,7 @@ BIN1=	auth.conf \
 	rc rc.bsdextended rc.firewall rc.initdiskless \
 	rc.sendmail rc.shutdown \
 	rc.subr remote rpc services shells \
-	sysctl.conf syslog.conf \
+	sysctl.conf syslog.conf termcap.small \
 	etc.${MACHINE_ARCH}/ttys
 
 OPENBSMDIR=			${.CURDIR}/../contrib/openbsm

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 19:30: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 955561065673;
	Tue, 20 Apr 2010 19:30:12 +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 847308FC15;
	Tue, 20 Apr 2010 19:30: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 o3KJUCJi022416;
	Tue, 20 Apr 2010 19:30:12 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KJUCMR022414;
	Tue, 20 Apr 2010 19:30:12 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004201930.o3KJUCMR022414@svn.freebsd.org>
From: Bruce Cran 
Date: Tue, 20 Apr 2010 19:30: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: r206909 - head/sys/dev/sis
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, 20 Apr 2010 19:30:12 -0000

Author: brucec
Date: Tue Apr 20 19:30:12 2010
New Revision: 206909
URL: http://svn.freebsd.org/changeset/base/206909

Log:
  It's not necessary to reset the chip every time an input overflow event
  occurs. In addition, the delay when programming the short cable fix
  should be 100us, not 100ms.
  
  PR:	kern/64556
  Submitted by:	Thomas Hurst 
  Approved by:	rrs (mentor)
  MFC after:	1 week

Modified:
  head/sys/dev/sis/if_sis.c

Modified: head/sys/dev/sis/if_sis.c
==============================================================================
--- head/sys/dev/sis/if_sis.c	Tue Apr 20 18:46:00 2010	(r206908)
+++ head/sys/dev/sis/if_sis.c	Tue Apr 20 19:30:12 2010	(r206909)
@@ -1483,15 +1483,6 @@ sis_rxeof(struct sis_softc *sc)
 	return (rx_npkts);
 }
 
-static void
-sis_rxeoc(struct sis_softc *sc)
-{
-
-	SIS_LOCK_ASSERT(sc);
-	sis_rxeof(sc);
-	sis_initl(sc);
-}
-
 /*
  * A frame was downloaded to the chip. It's safe for us to clean up
  * the list buffers.
@@ -1614,7 +1605,7 @@ sis_poll(struct ifnet *ifp, enum poll_cm
 		status = CSR_READ_4(sc, SIS_ISR);
 
 		if (status & (SIS_ISR_RX_ERR|SIS_ISR_RX_OFLOW))
-			sis_rxeoc(sc);
+			ifp->if_ierrors++;
 
 		if (status & (SIS_ISR_RX_IDLE))
 			SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE);
@@ -1672,7 +1663,7 @@ sis_intr(void *arg)
 			sis_rxeof(sc);
 
 		if (status & SIS_ISR_RX_OFLOW)
-			sis_rxeoc(sc);
+			ifp->if_ierrors++;
 
 		if (status & (SIS_ISR_RX_IDLE))
 			SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE);
@@ -2017,7 +2008,7 @@ sis_initl(struct sis_softc *sc)
 		CSR_WRITE_4(sc, NS_PHY_PAGE, 0x0001);
 		reg = CSR_READ_4(sc, NS_PHY_DSPCFG) & 0xfff;
 		CSR_WRITE_4(sc, NS_PHY_DSPCFG, reg | 0x1000);
-		DELAY(100000);
+		DELAY(100);
 		reg = CSR_READ_4(sc, NS_PHY_TDATA) & 0xff;
 		if ((reg & 0x0080) == 0 || (reg > 0xd8 && reg <= 0xff)) {
 			device_printf(sc->sis_dev,

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 20:19: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 09FA41065670;
	Tue, 20 Apr 2010 20:19:20 +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 ECDAF8FC21;
	Tue, 20 Apr 2010 20:19: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 o3KKJJ3Z033341;
	Tue, 20 Apr 2010 20:19:19 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KKJJih033338;
	Tue, 20 Apr 2010 20:19:19 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004202019.o3KKJJih033338@svn.freebsd.org>
From: Bruce Cran 
Date: Tue, 20 Apr 2010 20:19:19 +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: r206911 - stable/8/contrib/top
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, 20 Apr 2010 20:19:20 -0000

Author: brucec
Date: Tue Apr 20 20:19:19 2010
New Revision: 206911
URL: http://svn.freebsd.org/changeset/base/206911

Log:
  MFC r205119 and r206056:
  
  Prevent the SIZE field being corrupted when a process allocates more than
  2TB.
  
  PR:	bin/129706
  Submitted by:	brucec
  Approved by: 	rrs (mentor)

Modified:
  stable/8/contrib/top/utils.c
  stable/8/contrib/top/utils.h
Directory Properties:
  stable/8/contrib/top/   (props changed)
  stable/8/contrib/top/install-sh   (props changed)

Modified: stable/8/contrib/top/utils.c
==============================================================================
--- stable/8/contrib/top/utils.c	Tue Apr 20 20:09:45 2010	(r206910)
+++ stable/8/contrib/top/utils.c	Tue Apr 20 20:19:19 2010	(r206911)
@@ -476,7 +476,7 @@ int amt;
 
 char *format_k2(amt)
 
-int amt;
+unsigned long long amt;
 
 {
     static char retarray[NUM_STRINGS][16];

Modified: stable/8/contrib/top/utils.h
==============================================================================
--- stable/8/contrib/top/utils.h	Tue Apr 20 20:09:45 2010	(r206910)
+++ stable/8/contrib/top/utils.h	Tue Apr 20 20:19:19 2010	(r206911)
@@ -21,4 +21,4 @@ long percentages();
 char *errmsg();
 char *format_time();
 char *format_k();
-char *format_k2();
+char *format_k2(unsigned long long);

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 20:21: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 6EC96106564A;
	Tue, 20 Apr 2010 20:21:01 +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 5D6288FC0A;
	Tue, 20 Apr 2010 20:21: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 o3KKL1FP033769;
	Tue, 20 Apr 2010 20:21:01 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KKL1WO033766;
	Tue, 20 Apr 2010 20:21:01 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004202021.o3KKL1WO033766@svn.freebsd.org>
From: Bruce Cran 
Date: Tue, 20 Apr 2010 20:21:01 +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: r206912 - stable/7/contrib/top
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, 20 Apr 2010 20:21:01 -0000

Author: brucec
Date: Tue Apr 20 20:21:01 2010
New Revision: 206912
URL: http://svn.freebsd.org/changeset/base/206912

Log:
  MFC r205119 and r206056:
  
  Prevent the SIZE field being corrupted when a process allocates more than
  2TB.
  
  PR:	bin/129706
  Submitted by:	brucec
  Approved by:	rrs (mentor)

Modified:
  stable/7/contrib/top/utils.c
  stable/7/contrib/top/utils.h
Directory Properties:
  stable/7/contrib/top/   (props changed)

Modified: stable/7/contrib/top/utils.c
==============================================================================
--- stable/7/contrib/top/utils.c	Tue Apr 20 20:19:19 2010	(r206911)
+++ stable/7/contrib/top/utils.c	Tue Apr 20 20:21:01 2010	(r206912)
@@ -476,7 +476,7 @@ int amt;
 
 char *format_k2(amt)
 
-int amt;
+unsigned long long amt;
 
 {
     static char retarray[NUM_STRINGS][16];

Modified: stable/7/contrib/top/utils.h
==============================================================================
--- stable/7/contrib/top/utils.h	Tue Apr 20 20:19:19 2010	(r206911)
+++ stable/7/contrib/top/utils.h	Tue Apr 20 20:21:01 2010	(r206912)
@@ -21,4 +21,4 @@ long percentages();
 char *errmsg();
 char *format_time();
 char *format_k();
-char *format_k2();
+char *format_k2(unsigned long long);

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 20: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 1B5F71065679;
	Tue, 20 Apr 2010 20:24:01 +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 0A28E8FC20;
	Tue, 20 Apr 2010 20: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 o3KKO04i034478;
	Tue, 20 Apr 2010 20:24:00 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KKO008034476;
	Tue, 20 Apr 2010 20:24:00 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004202024.o3KKO008034476@svn.freebsd.org>
From: Bruce Cran 
Date: Tue, 20 Apr 2010 20:24: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: r206913 - stable/8/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, 20 Apr 2010 20:24:01 -0000

Author: brucec
Date: Tue Apr 20 20:24:00 2010
New Revision: 206913
URL: http://svn.freebsd.org/changeset/base/206913

Log:
  MFC r205118:
  
  Free the memory allocated via strdup.
  
  PR:	bin/113881
  Submitted by:	Alexander Drozdov (dzal_mail at mtu-net.ru)
  Approved by:	rrs (mentor)

Modified:
  stable/8/sbin/sysctl/sysctl.c
Directory Properties:
  stable/8/sbin/sysctl/   (props changed)

Modified: stable/8/sbin/sysctl/sysctl.c
==============================================================================
--- stable/8/sbin/sysctl/sysctl.c	Tue Apr 20 20:21:01 2010	(r206912)
+++ stable/8/sbin/sysctl/sysctl.c	Tue Apr 20 20:24:00 2010	(r206913)
@@ -379,6 +379,7 @@ S_timeval(int l2, void *p)
 		if (*p2 == '\n')
 			*p2 = '\0';
 	fputs(p1, stdout);
+	free(p1);
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 20:26: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 5F181106566C;
	Tue, 20 Apr 2010 20:26:26 +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 4DE1F8FC18;
	Tue, 20 Apr 2010 20:26: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 o3KKQQn7035060;
	Tue, 20 Apr 2010 20:26:26 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KKQQpZ035058;
	Tue, 20 Apr 2010 20:26:26 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004202026.o3KKQQpZ035058@svn.freebsd.org>
From: Bruce Cran 
Date: Tue, 20 Apr 2010 20:26:26 +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: r206914 - stable/7/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, 20 Apr 2010 20:26:26 -0000

Author: brucec
Date: Tue Apr 20 20:26:26 2010
New Revision: 206914
URL: http://svn.freebsd.org/changeset/base/206914

Log:
  MFC r205118:
  
  Free the memory allocated via strdup.
  
  PR:	bin/113881
  Submitted by:	Alexander Drozdov 
  Approved by:	rrs (mentor)

Modified:
  stable/7/sbin/sysctl/sysctl.c
Directory Properties:
  stable/7/sbin/sysctl/   (props changed)

Modified: stable/7/sbin/sysctl/sysctl.c
==============================================================================
--- stable/7/sbin/sysctl/sysctl.c	Tue Apr 20 20:24:00 2010	(r206913)
+++ stable/7/sbin/sysctl/sysctl.c	Tue Apr 20 20:26:26 2010	(r206914)
@@ -371,6 +371,7 @@ S_timeval(int l2, void *p)
 		if (*p2 == '\n')
 			*p2 = '\0';
 	fputs(p1, stdout);
+	free(p1);
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 20:35: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 59C89106564A;
	Tue, 20 Apr 2010 20:35:09 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3])
	by mx1.freebsd.org (Postfix) with ESMTP id CED918FC27;
	Tue, 20 Apr 2010 20:35:08 +0000 (UTC)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id 3C49F41C751;
	Tue, 20 Apr 2010 22:35:07 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([192.168.74.103])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id oRq+C9l2EdAT; Tue, 20 Apr 2010 22:35:06 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id 5045F41C75A; Tue, 20 Apr 2010 22:35:06 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id 68AF044496D;
	Tue, 20 Apr 2010 20:30:19 +0000 (UTC)
Date: Tue, 20 Apr 2010 20:30:18 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Rui Paulo 
In-Reply-To: <201004201703.o3KH3Uj5089736@svn.freebsd.org>
Message-ID: <20100420202929.X40281@maildrop.int.zabbadoz.net>
References: <201004201703.o3KH3Uj5089736@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r206901 - in head/sys: amd64/amd64
 cddl/dev/cyclic/i386 i386/i386 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, 20 Apr 2010 20:35:09 -0000

On Tue, 20 Apr 2010, Rui Paulo wrote:

> Author: rpaulo
> Date: Tue Apr 20 17:03:30 2010
> New Revision: 206901
> URL: http://svn.freebsd.org/changeset/base/206901
>
> Log:
>  Rename the cyclic global variable lapic_cyclic_clock_func to just
>  cyclic_clock_func. This will make more sense when we start developing non
>  x86 cyclic version.

I think this is the cause for LINT.386 failing with:

  87 /scratch/tmp/bz/HEAD.svn/sys/x86/isa/clock.c: In function 'clkintr':
  88 /scratch/tmp/bz/HEAD.svn/sys/x86/isa/clock.c:189: error: 'lapic_cyclic_clock_func' undeclared (first use in this function)
  89 /scratch/tmp/bz/HEAD.svn/sys/x86/isa/clock.c:189: error: (Each undeclared identifier is reported only once
  90 /scratch/tmp/bz/HEAD.svn/sys/x86/isa/clock.c:189: error: for each function it appears in.)



> Modified:
>  head/sys/amd64/amd64/local_apic.c
>  head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
>  head/sys/i386/i386/local_apic.c
>  head/sys/sys/dtrace_bsd.h
>
> Modified: head/sys/amd64/amd64/local_apic.c
> ==============================================================================
> --- head/sys/amd64/amd64/local_apic.c	Tue Apr 20 16:30:17 2010	(r206900)
> +++ head/sys/amd64/amd64/local_apic.c	Tue Apr 20 17:03:30 2010	(r206901)
> @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$");
>
> #ifdef KDTRACE_HOOKS
> #include 
> -cyclic_clock_func_t	lapic_cyclic_clock_func[MAXCPU];
> +cyclic_clock_func_t	cyclic_clock_func[MAXCPU];
> #endif
>
> /* Sanity checks on IDT vectors. */
> @@ -778,8 +778,8 @@ lapic_handle_timer(struct trapframe *fra
> 	 * timers.
> 	 */
> 	int cpu = PCPU_GET(cpuid);
> -	if (lapic_cyclic_clock_func[cpu] != NULL)
> -		(*lapic_cyclic_clock_func[cpu])(frame);
> +	if (cyclic_clock_func[cpu] != NULL)
> +		(*cyclic_clock_func[cpu])(frame);
> #endif
>
> 	/* Fire hardclock at hz. */
>
> Modified: head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
> ==============================================================================
> --- head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Tue Apr 20 16:30:17 2010	(r206900)
> +++ head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Tue Apr 20 17:03:30 2010	(r206901)
> @@ -67,7 +67,7 @@ cyclic_machdep_uninit(void)
>
> 	for (i = 0; i <= mp_maxid; i++)
> 		/* Reset the cyclic clock callback hook. */
> -		lapic_cyclic_clock_func[i] = NULL;
> +		cyclic_clock_func[i] = NULL;
>
> 	/* De-register the cyclic backend. */
> 	cyclic_uninit();
> @@ -105,13 +105,13 @@ cyclic_clock(struct trapframe *frame)
> static void enable(cyb_arg_t arg)
> {
> 	/* Register the cyclic clock callback function. */
> -	lapic_cyclic_clock_func[curcpu] = cyclic_clock;
> +	cyclic_clock_func[curcpu] = cyclic_clock;
> }
>
> static void disable(cyb_arg_t arg)
> {
> 	/* Reset the cyclic clock callback function. */
> -	lapic_cyclic_clock_func[curcpu] = NULL;
> +	cyclic_clock_func[curcpu] = NULL;
> }
>
> static void reprogram(cyb_arg_t arg, hrtime_t exp)
>
> Modified: head/sys/i386/i386/local_apic.c
> ==============================================================================
> --- head/sys/i386/i386/local_apic.c	Tue Apr 20 16:30:17 2010	(r206900)
> +++ head/sys/i386/i386/local_apic.c	Tue Apr 20 17:03:30 2010	(r206901)
> @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
>
> #ifdef KDTRACE_HOOKS
> #include 
> -cyclic_clock_func_t	lapic_cyclic_clock_func[MAXCPU];
> +cyclic_clock_func_t	cyclic_clock_func[MAXCPU];
> #endif
>
> /* Sanity checks on IDT vectors. */
> @@ -779,8 +779,8 @@ lapic_handle_timer(struct trapframe *fra
> 	 * timers.
> 	 */
> 	int cpu = PCPU_GET(cpuid);
> -	if (lapic_cyclic_clock_func[cpu] != NULL)
> -		(*lapic_cyclic_clock_func[cpu])(frame);
> +	if (cyclic_clock_func[cpu] != NULL)
> +		(*cyclic_clock_func[cpu])(frame);
> #endif
>
> 	/* Fire hardclock at hz. */
>
> Modified: head/sys/sys/dtrace_bsd.h
> ==============================================================================
> --- head/sys/sys/dtrace_bsd.h	Tue Apr 20 16:30:17 2010	(r206900)
> +++ head/sys/sys/dtrace_bsd.h	Tue Apr 20 17:03:30 2010	(r206901)
> @@ -50,7 +50,7 @@ typedef	void (*cyclic_clock_func_t)(stru
>  *
>  * Defining them here avoids a proliferation of header files.
>  */
> -extern cyclic_clock_func_t     lapic_cyclic_clock_func[];
> +extern cyclic_clock_func_t     cyclic_clock_func[];
>
> /*
>  * The dtrace module handles traps that occur during a DTrace probe.
>

-- 
Bjoern A. Zeeb         It will not break if you know what you are doing.

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 20:36: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 8E9261065673;
	Tue, 20 Apr 2010 20:36:38 +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 7E3AB8FC23;
	Tue, 20 Apr 2010 20:36: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 o3KKacAr037397;
	Tue, 20 Apr 2010 20:36:38 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KKac1w037395;
	Tue, 20 Apr 2010 20:36:38 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201004202036.o3KKac1w037395@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 20 Apr 2010 20:36: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: r206915 - head/usr.sbin/config
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, 20 Apr 2010 20:36:38 -0000

Author: imp
Date: Tue Apr 20 20:36:38 2010
New Revision: 206915
URL: http://svn.freebsd.org/changeset/base/206915

Log:
  Bump minor version of config to reflect the new option remapping
  feature.  The kernel makefiles have specifically not been bumped
  because nothing uses this new feature and doing so forces everybody to
  recompile for no good reason.  This chnage will be MFC'd where the
  kernel version numbers for amd64 and ia64 will be bumped, since those
  are the only two that have use the option remapping feature.  Once
  merged, this will give a better error message to folks that are using
  buildkernel without buildworld or kernel-toolchain to update their
  kernels.
  
  MFC after:	3 days

Modified:
  head/usr.sbin/config/configvers.h

Modified: head/usr.sbin/config/configvers.h
==============================================================================
--- head/usr.sbin/config/configvers.h	Tue Apr 20 20:26:26 2010	(r206914)
+++ head/usr.sbin/config/configvers.h	Tue Apr 20 20:36:38 2010	(r206915)
@@ -49,5 +49,5 @@
  *
  * $FreeBSD$
  */
-#define	CONFIGVERS	600007
+#define	CONFIGVERS	600008
 #define	MAJOR_VERS(x)	((x) / 100000)

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 20:39: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 05930106564A;
	Tue, 20 Apr 2010 20:39:43 +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 E94A28FC08;
	Tue, 20 Apr 2010 20:39: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 o3KKdg2m038080;
	Tue, 20 Apr 2010 20:39:42 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KKdg86038078;
	Tue, 20 Apr 2010 20:39:42 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201004202039.o3KKdg86038078@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 20 Apr 2010 20:39: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: r206916 - 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, 20 Apr 2010 20:39:43 -0000

Author: imp
Date: Tue Apr 20 20:39:42 2010
New Revision: 206916
URL: http://svn.freebsd.org/changeset/base/206916

Log:
  Make sure that we free the passed in data message if we don't actually
  insert it onto the queue.  Also, fix a mtx leak if someone turns off
  devctl while we're processing a messages.
  
  MFC after:	5 days

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Tue Apr 20 20:36:38 2010	(r206915)
+++ head/sys/kern/subr_bus.c	Tue Apr 20 20:39:42 2010	(r206916)
@@ -545,15 +545,16 @@ devctl_queue_data(char *data)
 	struct proc *p;
 
 	if (strlen(data) == 0)
-		return;
+		goto out;
 	if (devctl_queue_length == 0)
-		return;
+		goto out;
 	n1 = malloc(sizeof(*n1), M_BUS, M_NOWAIT);
 	if (n1 == NULL)
-		return;
+		goto out;
 	n1->dei_data = data;
 	mtx_lock(&devsoftc.mtx);
 	if (devctl_queue_length == 0) {
+		mtx_unlock(&devsoftc.mtx);
 		free(n1->dei_data, M_BUS);
 		free(n1, M_BUS);
 		return;
@@ -577,6 +578,14 @@ devctl_queue_data(char *data)
 		psignal(p, SIGIO);
 		PROC_UNLOCK(p);
 	}
+	return;
+out:
+	/*
+	 * We have to free data on all error paths since the caller
+	 * assumes it will be free'd when this item is dequeued.
+	 */
+	free(data, M_BUS);
+	return;
 }
 
 /**

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 20:47: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 5777E106564A;
	Tue, 20 Apr 2010 20:47:59 +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 439438FC1D;
	Tue, 20 Apr 2010 20:47: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 o3KKlx0g039954;
	Tue, 20 Apr 2010 20:47:59 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KKlxPG039942;
	Tue, 20 Apr 2010 20:47:59 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201004202047.o3KKlxPG039942@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 20 Apr 2010 20:47:59 +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: r206917 - in vendor/testfloat: . processors testfloat
	testfloat/386-Win32-gcc testfloat/SPARC-Solaris-gcc
	testfloat/templates
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, 20 Apr 2010 20:47:59 -0000

Author: marius
Date: Tue Apr 20 20:47:58 2010
New Revision: 206917
URL: http://svn.freebsd.org/changeset/base/206917

Log:
  Initial import of TestFloat 2a.
  
  Obtained from:	http://www.jhauser.us/arithmetic/TestFloat.html

Added:
  vendor/testfloat/
  vendor/testfloat/processors/
  vendor/testfloat/processors/386-gcc.h   (contents, props changed)
  vendor/testfloat/processors/SPARC-gcc.h   (contents, props changed)
  vendor/testfloat/testfloat/
  vendor/testfloat/testfloat/386-Win32-gcc/
  vendor/testfloat/testfloat/386-Win32-gcc/Makefile   (contents, props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/milieu.h   (contents, props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systflags.S   (contents, props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systfloat.S   (contents, props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systfloat.h   (contents, props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systmodes.S   (contents, props changed)
  vendor/testfloat/testfloat/README.txt   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/Makefile   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/milieu.h   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systflags.c   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systfloat.S   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systfloat.h   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systmodes.c   (contents, props changed)
  vendor/testfloat/testfloat/fail.c   (contents, props changed)
  vendor/testfloat/testfloat/fail.h   (contents, props changed)
  vendor/testfloat/testfloat/random.c   (contents, props changed)
  vendor/testfloat/testfloat/random.h   (contents, props changed)
  vendor/testfloat/testfloat/slowfloat-32.c   (contents, props changed)
  vendor/testfloat/testfloat/slowfloat-64.c   (contents, props changed)
  vendor/testfloat/testfloat/slowfloat.c   (contents, props changed)
  vendor/testfloat/testfloat/slowfloat.h   (contents, props changed)
  vendor/testfloat/testfloat/systemBugs.txt   (contents, props changed)
  vendor/testfloat/testfloat/systflags.h   (contents, props changed)
  vendor/testfloat/testfloat/systfloat.c   (contents, props changed)
  vendor/testfloat/testfloat/systfloat.h   (contents, props changed)
  vendor/testfloat/testfloat/systmodes.h   (contents, props changed)
  vendor/testfloat/testfloat/templates/
  vendor/testfloat/testfloat/templates/Makefile   (contents, props changed)
  vendor/testfloat/testfloat/templates/milieu.h   (contents, props changed)
  vendor/testfloat/testfloat/templates/systflags.c   (contents, props changed)
  vendor/testfloat/testfloat/templates/systmodes.c   (contents, props changed)
  vendor/testfloat/testfloat/testCases.c   (contents, props changed)
  vendor/testfloat/testfloat/testCases.h   (contents, props changed)
  vendor/testfloat/testfloat/testFunction.c   (contents, props changed)
  vendor/testfloat/testfloat/testFunction.h   (contents, props changed)
  vendor/testfloat/testfloat/testLoops.c   (contents, props changed)
  vendor/testfloat/testfloat/testLoops.h   (contents, props changed)
  vendor/testfloat/testfloat/testfloat-history.txt   (contents, props changed)
  vendor/testfloat/testfloat/testfloat-source.txt   (contents, props changed)
  vendor/testfloat/testfloat/testfloat.c   (contents, props changed)
  vendor/testfloat/testfloat/testfloat.txt   (contents, props changed)
  vendor/testfloat/testfloat/testsoftfloat.c   (contents, props changed)
  vendor/testfloat/testfloat/writeHex.c   (contents, props changed)
  vendor/testfloat/testfloat/writeHex.h   (contents, props changed)

Added: vendor/testfloat/processors/386-gcc.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/processors/386-gcc.h	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,80 @@
+
+/*
+-------------------------------------------------------------------------------
+One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
+-------------------------------------------------------------------------------
+*/
+#define LITTLEENDIAN
+
+/*
+-------------------------------------------------------------------------------
+The macro `BITS64' can be defined to indicate that 64-bit integer types are
+supported by the compiler.
+-------------------------------------------------------------------------------
+*/
+#define BITS64
+
+/*
+-------------------------------------------------------------------------------
+Each of the following `typedef's defines the most convenient type that holds
+integers of at least as many bits as specified.  For example, `uint8' should
+be the most convenient type that can hold unsigned integers of as many as
+8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
+implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
+to the same as `int'.
+-------------------------------------------------------------------------------
+*/
+typedef char flag;
+typedef unsigned char uint8;
+typedef signed char int8;
+typedef int uint16;
+typedef int int16;
+typedef unsigned int uint32;
+typedef signed int int32;
+#ifdef BITS64
+typedef unsigned long long int uint64;
+typedef signed long long int int64;
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Each of the following `typedef's defines a type that holds integers
+of _exactly_ the number of bits specified.  For instance, for most
+implementation of C, `bits16' and `sbits16' should be `typedef'ed to
+`unsigned short int' and `signed short int' (or `short int'), respectively.
+-------------------------------------------------------------------------------
+*/
+typedef unsigned char bits8;
+typedef signed char sbits8;
+typedef unsigned short int bits16;
+typedef signed short int sbits16;
+typedef unsigned int bits32;
+typedef signed int sbits32;
+#ifdef BITS64
+typedef unsigned long long int bits64;
+typedef signed long long int sbits64;
+#endif
+
+#ifdef BITS64
+/*
+-------------------------------------------------------------------------------
+The `LIT64' macro takes as its argument a textual integer literal and
+if necessary ``marks'' the literal as having a 64-bit integer type.
+For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
+appended with the letters `LL' standing for `long long', which is `gcc's
+name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
+defined as the identity macro:  `#define LIT64( a ) a'.
+-------------------------------------------------------------------------------
+*/
+#define LIT64( a ) a##LL
+#endif
+
+/*
+-------------------------------------------------------------------------------
+The macro `INLINE' can be used before functions that should be inlined.  If
+a compiler does not support explicit inlining, this macro should be defined
+to be `static'.
+-------------------------------------------------------------------------------
+*/
+#define INLINE extern inline
+

Added: vendor/testfloat/processors/SPARC-gcc.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/processors/SPARC-gcc.h	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,80 @@
+
+/*
+-------------------------------------------------------------------------------
+One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
+-------------------------------------------------------------------------------
+*/
+#define BIGENDIAN
+
+/*
+-------------------------------------------------------------------------------
+The macro `BITS64' can be defined to indicate that 64-bit integer types are
+supported by the compiler.
+-------------------------------------------------------------------------------
+*/
+#define BITS64
+
+/*
+-------------------------------------------------------------------------------
+Each of the following `typedef's defines the most convenient type that holds
+integers of at least as many bits as specified.  For example, `uint8' should
+be the most convenient type that can hold unsigned integers of as many as
+8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
+implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
+to the same as `int'.
+-------------------------------------------------------------------------------
+*/
+typedef int flag;
+typedef int uint8;
+typedef int int8;
+typedef int uint16;
+typedef int int16;
+typedef unsigned int uint32;
+typedef signed int int32;
+#ifdef BITS64
+typedef unsigned long long int uint64;
+typedef signed long long int int64;
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Each of the following `typedef's defines a type that holds integers
+of _exactly_ the number of bits specified.  For instance, for most
+implementation of C, `bits16' and `sbits16' should be `typedef'ed to
+`unsigned short int' and `signed short int' (or `short int'), respectively.
+-------------------------------------------------------------------------------
+*/
+typedef unsigned char bits8;
+typedef signed char sbits8;
+typedef unsigned short int bits16;
+typedef signed short int sbits16;
+typedef unsigned int bits32;
+typedef signed int sbits32;
+#ifdef BITS64
+typedef unsigned long long int bits64;
+typedef signed long long int sbits64;
+#endif
+
+#ifdef BITS64
+/*
+-------------------------------------------------------------------------------
+The `LIT64' macro takes as its argument a textual integer literal and
+if necessary ``marks'' the literal as having a 64-bit integer type.
+For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
+appended with the letters `LL' standing for `long long', which is `gcc's
+name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
+defined as the identity macro:  `#define LIT64( a ) a'.
+-------------------------------------------------------------------------------
+*/
+#define LIT64( a ) a##LL
+#endif
+
+/*
+-------------------------------------------------------------------------------
+The macro `INLINE' can be used before functions that should be inlined.  If
+a compiler does not support explicit inlining, this macro should be defined
+to be `static'.
+-------------------------------------------------------------------------------
+*/
+#define INLINE extern inline
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/Makefile	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,64 @@
+
+PROCESSOR_H = ../../processors/386-gcc.h
+SOFTFLOAT_VERSION = bits64
+TARGET = 386-Win32-gcc
+SOFTFLOAT_DIR = ../../softfloat/$(SOFTFLOAT_VERSION)/$(TARGET)
+
+OBJ = .o
+EXE = .exe
+INCLUDES = -I. -I.. -I$(SOFTFLOAT_DIR)
+COMPILE_ASM = gcc -c -o $@
+COMPILE_C = gcc -c -o $@ $(INCLUDES) -I- -O2
+COMPILE_SLOWFLOAT_C = gcc -c -o $@ $(INCLUDES) -I- -O3
+LINK = gcc -o $@
+
+SOFTFLOAT_H = $(SOFTFLOAT_DIR)/softfloat.h
+SOFTFLOAT_OBJ = $(SOFTFLOAT_DIR)/softfloat$(OBJ)
+
+ALL: testsoftfloat$(EXE) testfloat$(EXE)
+
+milieu.h: $(PROCESSOR_H)
+	touch milieu.h
+
+fail$(OBJ): milieu.h ../fail.h
+	$(COMPILE_C) ../fail.c
+
+random$(OBJ): milieu.h ../random.h
+	$(COMPILE_C) ../random.c
+
+testCases$(OBJ): milieu.h ../fail.h ../random.h $(SOFTFLOAT_H) ../testCases.h ../testCases.c
+	$(COMPILE_C) ../testCases.c
+
+writeHex$(OBJ): milieu.h $(SOFTFLOAT_H) ../writeHex.h ../writeHex.c
+	$(COMPILE_C) ../writeHex.c
+
+testLoops$(OBJ): milieu.h $(SOFTFLOAT_H) ../testCases.h ../writeHex.h ../testLoops.h ../testLoops.c
+	$(COMPILE_C) ../testLoops.c
+
+slowfloat$(OBJ): milieu.h $(SOFTFLOAT_H) ../slowfloat.h ../slowfloat-32.c ../slowfloat-64.c ../slowfloat.c
+	$(COMPILE_SLOWFLOAT_C) ../slowfloat.c
+
+testsoftfloat$(OBJ): milieu.h ../fail.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../slowfloat.h ../testsoftfloat.c
+	$(COMPILE_C) ../testsoftfloat.c
+
+testsoftfloat$(EXE): fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) slowfloat$(OBJ) testsoftfloat$(OBJ)
+	$(LINK) fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) slowfloat$(OBJ) testsoftfloat$(OBJ)
+
+systmodes$(OBJ): systmodes.S
+	$(COMPILE_ASM) systmodes.S
+
+systflags$(OBJ): systflags.S
+	$(COMPILE_ASM) systflags.S
+
+systfloat$(OBJ): systfloat.S
+	$(COMPILE_ASM) systfloat.S
+
+testFunction$(OBJ): milieu.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../systmodes.h ../systflags.h systfloat.h ../testFunction.h ../testFunction.c
+	$(COMPILE_C) ../testFunction.c
+
+testfloat$(OBJ): milieu.h ../fail.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../systflags.h ../testFunction.h ../testfloat.c
+	$(COMPILE_C) ../testfloat.c
+
+testfloat$(EXE): fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) systmodes$(OBJ) systflags$(OBJ) systfloat$(OBJ) testFunction$(OBJ) testfloat$(OBJ)
+	$(LINK) fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) systmodes$(OBJ) systflags$(OBJ) systfloat$(OBJ) testFunction$(OBJ) testfloat$(OBJ)
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/milieu.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/milieu.h	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,51 @@
+
+/*
+===============================================================================
+
+This C header file is part of TestFloat, Release 2a, a package of programs
+for testing the correctness of floating-point arithmetic complying to the
+IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser.  More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+/*
+-------------------------------------------------------------------------------
+Include common integer types and flags.
+-------------------------------------------------------------------------------
+*/
+#include "../../processors/386-gcc.h"
+
+/*
+-------------------------------------------------------------------------------
+If the `BITS64' macro is defined by the processor header file but the
+version of SoftFloat being tested is the 32-bit one (`bits32'), the `BITS64'
+macro must be undefined here.
+-------------------------------------------------------------------------------
+#undef BITS64
+*/
+
+/*
+-------------------------------------------------------------------------------
+Symbolic Boolean literals.
+-------------------------------------------------------------------------------
+*/
+enum {
+    FALSE = 0,
+    TRUE  = 1
+};
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/systflags.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/systflags.S	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,41 @@
+
+/*
+===============================================================================
+
+This GNU assembler source file is part of TestFloat, Release 2a, a package
+of programs for testing the correctness of floating-point arithmetic
+complying to the IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser.  More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+	.text
+
+/*
+-------------------------------------------------------------------------------
+Clears the system's IEC/IEEE floating-point exception flags.  Returns the
+previous value of the flags.
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_float_flags_clear
+_syst_float_flags_clear:
+	fnstsw %ax
+	fnclex
+	andl $61,%eax
+	ret
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/systfloat.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/systfloat.S	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,332 @@
+
+/*
+===============================================================================
+
+This GNU assembler source file is part of TestFloat, Release 2a, a package
+of programs for testing the correctness of floating-point arithmetic
+complying to the IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser.  More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+	.text
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_int32_to_floatx80
+_syst_int32_to_floatx80:
+	fildl 8(%esp)
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_int64_to_floatx80
+_syst_int64_to_floatx80:
+	fildq 8(%esp)
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_float32_to_floatx80
+_syst_float32_to_floatx80:
+	flds 8(%esp)
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_float64_to_floatx80
+_syst_float64_to_floatx80:
+	fldl 8(%esp)
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_to_int32
+_syst_floatx80_to_int32:
+	fldt 4(%esp)
+	subl $4,%esp
+	fistpl (%esp)
+	movl (%esp),%eax
+	addl $4,%esp
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_to_int64
+_syst_floatx80_to_int64:
+	fldt 4(%esp)
+	subl $8,%esp
+	fistpq (%esp)
+	movl (%esp),%eax
+	movl 4(%esp),%edx
+	addl $8,%esp
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_to_float32
+_syst_floatx80_to_float32:
+	fldt 4(%esp)
+	subl $4,%esp
+	fstps (%esp)
+	movl (%esp),%eax
+	addl $4,%esp
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_to_float64
+_syst_floatx80_to_float64:
+	fldt 4(%esp)
+	subl $8,%esp
+	fstpl (%esp)
+	movl 4(%esp),%edx
+	movl (%esp),%eax
+	addl $8,%esp
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_round_to_int
+_syst_floatx80_round_to_int:
+	fldt 8(%esp)
+	frndint
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_add
+_syst_floatx80_add:
+	fldt 8(%esp)
+	fldt 20(%esp)
+	faddp
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_sub
+_syst_floatx80_sub:
+	fldt 8(%esp)
+	fldt 20(%esp)
+	fsubrp
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_mul
+_syst_floatx80_mul:
+	fldt 8(%esp)
+	fldt 20(%esp)
+	fmulp
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_div
+_syst_floatx80_div:
+	fldt 8(%esp)
+	fldt 20(%esp)
+	fdivrp
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_rem
+_syst_floatx80_rem:
+	fldt 20(%esp)
+	fldt 8(%esp)
+floatx80_rem_loop:
+	fprem1
+	fnstsw %ax
+	btw $10,%ax
+	jc floatx80_rem_loop
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	fstp %st(0)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_sqrt
+_syst_floatx80_sqrt:
+	fldt 8(%esp)
+	fsqrt
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_eq
+_syst_floatx80_eq:
+	fldt 16(%esp)
+	fldt 4(%esp)
+	fucompp
+	fnstsw %ax
+	andw $17664,%ax
+	cmpw $16384,%ax
+	seteb %al
+	movzb %al,%eax
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_le
+_syst_floatx80_le:
+	fldt 4(%esp)
+	fldt 16(%esp)
+	fcompp
+	fnstsw %ax
+	notl %eax
+	shrl $8,%eax
+	andl $1,%eax
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_lt
+_syst_floatx80_lt:
+	fldt 4(%esp)
+	fldt 16(%esp)
+	fcompp
+	fnstsw %ax
+	andw $17664,%ax
+	setzb %al
+	movzb %al,%eax
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_eq_signaling
+_syst_floatx80_eq_signaling:
+	fldt 16(%esp)
+	fldt 4(%esp)
+	fcompp
+	fnstsw %ax
+	andw $17664,%ax
+	cmpw $16384,%ax
+	seteb %al
+	movzb %al,%eax
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_le_quiet
+_syst_floatx80_le_quiet:
+	fldt 4(%esp)
+	fldt 16(%esp)
+	fucompp
+	fnstsw %ax
+	notl %eax
+	shrl $8,%eax
+	andl $1,%eax
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_lt_quiet
+_syst_floatx80_lt_quiet:
+	fldt 4(%esp)
+	fldt 16(%esp)
+	fucompp
+	fnstsw %ax
+	andw $17664,%ax
+	setzb %al
+	movzb %al,%eax
+	ret
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/systfloat.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/systfloat.h	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,181 @@
+
+/*
+===============================================================================
+
+This C header file is part of TestFloat, Release 2a, a package of programs
+for testing the correctness of floating-point arithmetic complying to the
+IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser.  More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+/*
+-------------------------------------------------------------------------------
+The following macros are defined to indicate that the corresponding
+functions exist.
+-------------------------------------------------------------------------------
+*/
+#define SYST_INT32_TO_FLOATX80
+#define SYST_INT64_TO_FLOATX80
+#define SYST_FLOAT32_TO_FLOATX80
+#define SYST_FLOAT64_TO_FLOATX80
+#define SYST_FLOATX80_TO_INT32
+#define SYST_FLOATX80_TO_INT64
+#define SYST_FLOATX80_TO_FLOAT32
+#define SYST_FLOATX80_TO_FLOAT64
+#define SYST_FLOATX80_ROUND_TO_INT
+#define SYST_FLOATX80_ADD
+#define SYST_FLOATX80_SUB
+#define SYST_FLOATX80_MUL
+#define SYST_FLOATX80_DIV
+#define SYST_FLOATX80_REM
+#define SYST_FLOATX80_SQRT
+#define SYST_FLOATX80_EQ
+#define SYST_FLOATX80_LE
+#define SYST_FLOATX80_LT
+#define SYST_FLOATX80_EQ_SIGNALING
+#define SYST_FLOATX80_LE_QUIET
+#define SYST_FLOATX80_LT_QUIET
+
+/*
+-------------------------------------------------------------------------------
+System function declarations.  (Some of these functions may not exist.)
+-------------------------------------------------------------------------------
+*/
+float32 syst_int32_to_float32( int32 );
+float64 syst_int32_to_float64( int32 );
+#ifdef FLOATX80
+floatx80 syst_int32_to_floatx80( int32 );
+#endif
+#ifdef FLOAT128
+float128 syst_int32_to_float128( int32 );
+#endif
+#ifdef BITS64
+float32 syst_int64_to_float32( int64 );
+float64 syst_int64_to_float64( int64 );
+#ifdef FLOATX80
+floatx80 syst_int64_to_floatx80( int64 );
+#endif
+#ifdef FLOAT128
+float128 syst_int64_to_float128( int64 );
+#endif
+#endif
+int32 syst_float32_to_int32( float32 );
+int32 syst_float32_to_int32_round_to_zero( float32 );
+#ifdef BITS64
+int64 syst_float32_to_int64( float32 );
+int64 syst_float32_to_int64_round_to_zero( float32 );
+#endif
+float64 syst_float32_to_float64( float32 );
+#ifdef FLOATX80
+floatx80 syst_float32_to_floatx80( float32 );
+#endif
+#ifdef FLOAT128
+float128 syst_float32_to_float128( float32 );
+#endif
+float32 syst_float32_round_to_int( float32 );
+float32 syst_float32_add( float32, float32 );
+float32 syst_float32_sub( float32, float32 );
+float32 syst_float32_mul( float32, float32 );
+float32 syst_float32_div( float32, float32 );
+float32 syst_float32_rem( float32, float32 );
+float32 syst_float32_sqrt( float32 );
+flag syst_float32_eq( float32, float32 );
+flag syst_float32_le( float32, float32 );
+flag syst_float32_lt( float32, float32 );
+flag syst_float32_eq_signaling( float32, float32 );
+flag syst_float32_le_quiet( float32, float32 );
+flag syst_float32_lt_quiet( float32, float32 );
+int32 syst_float64_to_int32( float64 );
+int32 syst_float64_to_int32_round_to_zero( float64 );
+#ifdef BITS64
+int64 syst_float64_to_int64( float64 );
+int64 syst_float64_to_int64_round_to_zero( float64 );
+#endif
+float32 syst_float64_to_float32( float64 );
+#ifdef FLOATX80
+floatx80 syst_float64_to_floatx80( float64 );
+#endif
+#ifdef FLOAT128
+float128 syst_float64_to_float128( float64 );
+#endif
+float64 syst_float64_round_to_int( float64 );
+float64 syst_float64_add( float64, float64 );
+float64 syst_float64_sub( float64, float64 );
+float64 syst_float64_mul( float64, float64 );
+float64 syst_float64_div( float64, float64 );
+float64 syst_float64_rem( float64, float64 );
+float64 syst_float64_sqrt( float64 );
+flag syst_float64_eq( float64, float64 );
+flag syst_float64_le( float64, float64 );
+flag syst_float64_lt( float64, float64 );
+flag syst_float64_eq_signaling( float64, float64 );
+flag syst_float64_le_quiet( float64, float64 );
+flag syst_float64_lt_quiet( float64, float64 );
+#ifdef FLOATX80
+int32 syst_floatx80_to_int32( floatx80 );
+int32 syst_floatx80_to_int32_round_to_zero( floatx80 );
+#ifdef BITS64
+int64 syst_floatx80_to_int64( floatx80 );
+int64 syst_floatx80_to_int64_round_to_zero( floatx80 );
+#endif
+float32 syst_floatx80_to_float32( floatx80 );
+float64 syst_floatx80_to_float64( floatx80 );
+#ifdef FLOAT128
+float128 syst_floatx80_to_float128( floatx80 );
+#endif
+floatx80 syst_floatx80_round_to_int( floatx80 );
+floatx80 syst_floatx80_add( floatx80, floatx80 );
+floatx80 syst_floatx80_sub( floatx80, floatx80 );
+floatx80 syst_floatx80_mul( floatx80, floatx80 );
+floatx80 syst_floatx80_div( floatx80, floatx80 );
+floatx80 syst_floatx80_rem( floatx80, floatx80 );
+floatx80 syst_floatx80_sqrt( floatx80 );
+flag syst_floatx80_eq( floatx80, floatx80 );
+flag syst_floatx80_le( floatx80, floatx80 );
+flag syst_floatx80_lt( floatx80, floatx80 );
+flag syst_floatx80_eq_signaling( floatx80, floatx80 );
+flag syst_floatx80_le_quiet( floatx80, floatx80 );
+flag syst_floatx80_lt_quiet( floatx80, floatx80 );
+#endif
+#ifdef FLOAT128
+int32 syst_float128_to_int32( float128 );
+int32 syst_float128_to_int32_round_to_zero( float128 );
+#ifdef BITS64
+int64 syst_float128_to_int64( float128 );
+int64 syst_float128_to_int64_round_to_zero( float128 );
+#endif
+float32 syst_float128_to_float32( float128 );
+float64 syst_float128_to_float64( float128 );
+#ifdef FLOATX80
+floatx80 syst_float128_to_floatx80( float128 );
+#endif
+float128 syst_float128_round_to_int( float128 );
+float128 syst_float128_add( float128, float128 );
+float128 syst_float128_sub( float128, float128 );
+float128 syst_float128_mul( float128, float128 );
+float128 syst_float128_div( float128, float128 );
+float128 syst_float128_rem( float128, float128 );
+float128 syst_float128_sqrt( float128 );
+flag syst_float128_eq( float128, float128 );
+flag syst_float128_le( float128, float128 );
+flag syst_float128_lt( float128, float128 );
+flag syst_float128_eq_signaling( float128, float128 );
+flag syst_float128_le_quiet( float128, float128 );
+flag syst_float128_lt_quiet( float128, float128 );
+#endif
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/systmodes.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/systmodes.S	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,82 @@
+
+/*
+===============================================================================
+
+This GNU assembler source file is part of TestFloat, Release 2a, a package
+of programs for testing the correctness of floating-point arithmetic
+complying to the IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser.  More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+	.text
+
+/*
+-------------------------------------------------------------------------------
+Sets the system's IEC/IEEE floating-point rounding mode.  Also disables all
+system exception traps.
+-------------------------------------------------------------------------------
+*/
+	.align 4
+	.global _syst_float_set_rounding_mode
+_syst_float_set_rounding_mode:
+	movb 4(%esp),%al
+	andb $3,%al
+	shlw $10,%ax
+	orw $63,%ax
+	subl $2,%esp
+	fnstcw 0(%esp)
+	andw $768,0(%esp)
+	orw %ax,0(%esp)
+	fldcw 0(%esp)
+	addl $2,%esp
+	ret
+
+/*
+-------------------------------------------------------------------------------
+Sets the rounding precision of subsequent extended double-precision
+operations.  The `precision' argument should be one of 0, 32, 64, or 80.
+If `precision' is 32, the rounding precision is set equivalent to single
+precision; else if `precision' is 64, the rounding precision is set
+equivalent to double precision; else the rounding precision is set to full
+extended double precision.
+-------------------------------------------------------------------------------
+*/
+	.align 4
+	.global _syst_float_set_rounding_precision
+_syst_float_set_rounding_precision:
+	movb 4(%esp),%al
+	movb $0,%ah
+	cmpb $32,%al
+	je setRoundingPrecision
+	movb $2,%ah
+	cmpb $64,%al
+	je setRoundingPrecision
+	movb $3,%ah
+	cmpb $80,%al
+	je setRoundingPrecision
+	movb $0,%ah
+setRoundingPrecision:
+	movb $0,%al
+	subl $2,%esp
+	fnstcw 0(%esp)
+	andw $64767,0(%esp)
+	orw %ax,0(%esp)
+	fldcw 0(%esp)
+	addl $2,%esp
+	ret
+

Added: vendor/testfloat/testfloat/README.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/README.txt	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,50 @@
+
+Package Overview for TestFloat Release 2a
+
+John R. Hauser
+1998 December 16
+
+
+TestFloat is a program for testing that a floating-point implementation
+conforms to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
+TestFloat is distributed in the form of C source code.  The TestFloat
+package actually provides two related programs:
+
+-- The `testfloat' program tests a system's floating-point for conformance
+   to the IEC/IEEE Standard.  This program uses the SoftFloat software
+   floating-point implementation as a basis for comparison.
+
+-- The `testsoftfloat' program tests SoftFloat itself for conformance to
+   the IEC/IEEE Standard.  These tests are performed by comparing against a
+   separate, slower software floating-point that is included in the TestFloat
+   package.
+
+TestFloat depends on SoftFloat, but SoftFloat is not included in the
+TestFloat package.  SoftFloat can be obtained through the Web page `http://
+HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/SoftFloat.html'.
+
+TestFloat is documented in three text files:
+
+   testfloat.txt          Documentation for using the TestFloat programs
+                              (both `testfloat' and `testsoftfloat').
+   testfloat-source.txt   Documentation for porting and compiling TestFloat.
+   testfloat-history.txt  History of major changes to TestFloat.
+
+The following file is also provided:
+
+   systemBugs.txt         Information about processor bugs found using
+                              TestFloat.
+
+Other files in the package comprise the source code for TestFloat.
+
+Please be aware that some work is involved in porting this software to other
+targets.  It is not just a matter of getting `make' to complete without
+error messages.  I would have written the code that way if I could, but
+there are fundamental differences between systems that I can't make go away.
+You should not attempt to compile the TestFloat sources without first
+reading `testfloat-source.txt'.
+
+At the time of this writing, the most up-to-date information about
+TestFloat and the latest release can be found at the Web page `http://
+HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+

Added: vendor/testfloat/testfloat/SPARC-Solaris-gcc/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/SPARC-Solaris-gcc/Makefile	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,64 @@
+
+PROCESSOR_H = ../../processors/SPARC-gcc.h
+SOFTFLOAT_VERSION = bits64
+TARGET = SPARC-Solaris-gcc
+SOFTFLOAT_DIR = ../../softfloat/$(SOFTFLOAT_VERSION)/$(TARGET)
+
+OBJ = .o
+EXE =
+INCLUDES = -I. -I.. -I$(SOFTFLOAT_DIR)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 20: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 6F198106566B;
	Tue, 20 Apr 2010 20: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 54E188FC12;
	Tue, 20 Apr 2010 20: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 o3KKqX5X041027;
	Tue, 20 Apr 2010 20: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 o3KKqX82041026;
	Tue, 20 Apr 2010 20:52:33 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201004202052.o3KKqX82041026@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 20 Apr 2010 20:52:33 +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: r206918 - in vendor/testfloat: processors testfloat
	testfloat/386-Win32-gcc testfloat/SPARC-Solaris-gcc
	testfloat/templates
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, 20 Apr 2010 20:52:33 -0000

Author: marius
Date: Tue Apr 20 20:52:33 2010
New Revision: 206918
URL: http://svn.freebsd.org/changeset/base/206918

Log:
  Remove the keywords property.

Modified:
Directory Properties:
  vendor/testfloat/processors/386-gcc.h   (props changed)
  vendor/testfloat/processors/SPARC-gcc.h   (props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/Makefile   (props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/milieu.h   (props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systflags.S   (props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systfloat.S   (props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systfloat.h   (props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systmodes.S   (props changed)
  vendor/testfloat/testfloat/README.txt   (props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/Makefile   (props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/milieu.h   (props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systflags.c   (props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systfloat.S   (props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systfloat.h   (props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systmodes.c   (props changed)
  vendor/testfloat/testfloat/fail.c   (props changed)
  vendor/testfloat/testfloat/fail.h   (props changed)
  vendor/testfloat/testfloat/random.c   (props changed)
  vendor/testfloat/testfloat/random.h   (props changed)
  vendor/testfloat/testfloat/slowfloat-32.c   (props changed)
  vendor/testfloat/testfloat/slowfloat-64.c   (props changed)
  vendor/testfloat/testfloat/slowfloat.c   (props changed)
  vendor/testfloat/testfloat/slowfloat.h   (props changed)
  vendor/testfloat/testfloat/systemBugs.txt   (props changed)
  vendor/testfloat/testfloat/systflags.h   (props changed)
  vendor/testfloat/testfloat/systfloat.c   (props changed)
  vendor/testfloat/testfloat/systfloat.h   (props changed)
  vendor/testfloat/testfloat/systmodes.h   (props changed)
  vendor/testfloat/testfloat/templates/Makefile   (props changed)
  vendor/testfloat/testfloat/templates/milieu.h   (props changed)
  vendor/testfloat/testfloat/templates/systflags.c   (props changed)
  vendor/testfloat/testfloat/templates/systmodes.c   (props changed)
  vendor/testfloat/testfloat/testCases.c   (props changed)
  vendor/testfloat/testfloat/testCases.h   (props changed)
  vendor/testfloat/testfloat/testFunction.c   (props changed)
  vendor/testfloat/testfloat/testFunction.h   (props changed)
  vendor/testfloat/testfloat/testLoops.c   (props changed)
  vendor/testfloat/testfloat/testLoops.h   (props changed)
  vendor/testfloat/testfloat/testfloat-history.txt   (props changed)
  vendor/testfloat/testfloat/testfloat-source.txt   (props changed)
  vendor/testfloat/testfloat/testfloat.c   (props changed)
  vendor/testfloat/testfloat/testfloat.txt   (props changed)
  vendor/testfloat/testfloat/testsoftfloat.c   (props changed)
  vendor/testfloat/testfloat/writeHex.c   (props changed)
  vendor/testfloat/testfloat/writeHex.h   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 20:58: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 160EE106566C;
	Tue, 20 Apr 2010 20:58:49 +0000 (UTC)
	(envelope-from peterjeremy@acm.org)
Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au
	[211.29.133.76])
	by mx1.freebsd.org (Postfix) with ESMTP id 7C50E8FC1B;
	Tue, 20 Apr 2010 20:58:48 +0000 (UTC)
Received: from server.vk2pj.dyndns.org
	(c122-106-253-149.belrs3.nsw.optusnet.com.au [122.106.253.149])
	by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o3KKwjRA025757
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Apr 2010 06:58:46 +1000
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id o3KKwjER038564;
	Wed, 21 Apr 2010 06:58:45 +1000 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id o3KKwjVf038563;
	Wed, 21 Apr 2010 06:58:45 +1000 (EST) (envelope-from peter)
Date: Wed, 21 Apr 2010 06:58:45 +1000
From: Peter Jeremy 
To: Alan Cox 
Message-ID: <20100420205845.GA38549@server.vk2pj.dyndns.org>
References: <201004182129.o3ILTSCd098832@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="y0ulUmNC+osPPQO6"
Content-Disposition: inline
In-Reply-To: <201004182129.o3ILTSCd098832@svn.freebsd.org>
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
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: r206814 - head/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: Tue, 20 Apr 2010 20:58:49 -0000


--y0ulUmNC+osPPQO6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2010-Apr-18 21:29:28 +0000, Alan Cox  wrote:
>  Remove a nonsensical test from vm_pageout_clean().  A page can't be in t=
he
>  inactive queue and have a non-zero wire count.

Should this test be turned into a KASSERT()?

--=20
Peter Jeremy

--y0ulUmNC+osPPQO6
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAkvOFYUACgkQ/opHv/APuIcIigCfXz9uw4dOnYsNA7hOwxUY0rAC
cO4AmQH5UcXSC7v9dC+DJGjRQRrFp42W
=dLMO
-----END PGP SIGNATURE-----

--y0ulUmNC+osPPQO6--

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:02: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 288B8106567F;
	Tue, 20 Apr 2010 21:02:16 +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 0D5668FC20;
	Tue, 20 Apr 2010 21:02:12 +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 o3KL28xv022346
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Apr 2010 00:02:08 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	o3KL28ba003894; Wed, 21 Apr 2010 00:02:08 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3KL28DW003893; 
	Wed, 21 Apr 2010 00:02:08 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Wed, 21 Apr 2010 00:02:08 +0300
From: Kostik Belousov 
To: Bruce Cran 
Message-ID: <20100420210208.GA2422@deviant.kiev.zoral.com.ua>
References: <201004202019.o3KKJJih033338@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="a8Wt8u1KmwUX3Y2C"
Content-Disposition: inline
In-Reply-To: <201004202019.o3KKJJih033338@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=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	DNS_FROM_OPENWHOIS autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
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: r206911 - stable/8/contrib/top
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, 20 Apr 2010 21:02:16 -0000


--a8Wt8u1KmwUX3Y2C
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 20, 2010 at 08:19:19PM +0000, Bruce Cran wrote:
> Author: brucec
> Date: Tue Apr 20 20:19:19 2010
> New Revision: 206911
> URL: http://svn.freebsd.org/changeset/base/206911
>=20
> Log:
>   MFC r205119 and r206056:
>  =20
>   Prevent the SIZE field being corrupted when a process allocates more th=
an
>   2TB.
>  =20
>   PR:	bin/129706
>   Submitted by:	brucec
>   Approved by: 	rrs (mentor)

Am I right that this change contains a bug that was fixed by r206842 ?
If yes, why is it merged as is ?

--a8Wt8u1KmwUX3Y2C
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkvOFlAACgkQC3+MBN1Mb4iODACdHeZsDEy7znvNrAWl9ltUA3tW
mEoAnjv9v2PaeISGkgZXEEmKDf/5DX7U
=C3DL
-----END PGP SIGNATURE-----

--a8Wt8u1KmwUX3Y2C--

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:02: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 80023106567F;
	Tue, 20 Apr 2010 21:02:22 +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 541A58FC25;
	Tue, 20 Apr 2010 21:02: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 o3KL2MUI043322;
	Tue, 20 Apr 2010 21:02:22 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KL2Mh0043321;
	Tue, 20 Apr 2010 21:02:22 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201004202102.o3KL2Mh0043321@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 20 Apr 2010 21:02:22 +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: r206920 - vendor/testfloat/dist
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, 20 Apr 2010 21:02:22 -0000

Author: marius
Date: Tue Apr 20 21:02:20 2010
New Revision: 206920
URL: http://svn.freebsd.org/changeset/base/206920

Log:
  Add a dist subdirectory.

Added:
  vendor/testfloat/dist/

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:03: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 D3E5E1065673;
	Tue, 20 Apr 2010 21:03: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 A98E28FC08;
	Tue, 20 Apr 2010 21:03: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 o3KL3g7s043657;
	Tue, 20 Apr 2010 21:03:42 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KL3gSG043656;
	Tue, 20 Apr 2010 21:03:42 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201004202103.o3KL3gSG043656@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 20 Apr 2010 21:03:42 +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: r206921 - in vendor/testfloat: dist/processors
	dist/testfloat processors testfloat
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, 20 Apr 2010 21:03:42 -0000

Author: marius
Date: Tue Apr 20 21:03:42 2010
New Revision: 206921
URL: http://svn.freebsd.org/changeset/base/206921

Log:
  Move TestFloat 2a to the dist subdirectory.

Added:
  vendor/testfloat/dist/processors/
     - copied from r206920, vendor/testfloat/processors/
  vendor/testfloat/dist/testfloat/
     - copied from r206920, vendor/testfloat/testfloat/
Deleted:
  vendor/testfloat/processors/
  vendor/testfloat/testfloat/

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:04: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 BB422106566B;
	Tue, 20 Apr 2010 21:04:57 +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 AAFAC8FC18;
	Tue, 20 Apr 2010 21:04: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 o3KL4vEA043957;
	Tue, 20 Apr 2010 21:04:57 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KL4vHv043955;
	Tue, 20 Apr 2010 21:04:57 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004202104.o3KL4vHv043955@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 20 Apr 2010 21:04: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: r206922 - head/sys/x86/isa
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, 20 Apr 2010 21:04:57 -0000

Author: rpaulo
Date: Tue Apr 20 21:04:57 2010
New Revision: 206922
URL: http://svn.freebsd.org/changeset/base/206922

Log:
  Fix another instance of lapic_cyclic_clock_func.

Modified:
  head/sys/x86/isa/clock.c

Modified: head/sys/x86/isa/clock.c
==============================================================================
--- head/sys/x86/isa/clock.c	Tue Apr 20 21:03:42 2010	(r206921)
+++ head/sys/x86/isa/clock.c	Tue Apr 20 21:04:57 2010	(r206922)
@@ -186,8 +186,8 @@ clkintr(struct trapframe *frame)
 	 * timers.
 	 */
 	int cpu = PCPU_GET(cpuid);
-	if (lapic_cyclic_clock_func[cpu] != NULL)
-		(*lapic_cyclic_clock_func[cpu])(frame);
+	if (cyclic_clock_func[cpu] != NULL)
+		(*cyclic_clock_func[cpu])(frame);
 #endif
 
 	if (using_atrtc_timer) {

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:08: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 83C5F106564A;
	Tue, 20 Apr 2010 21:08:01 +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 5A4228FC08;
	Tue, 20 Apr 2010 21:08: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 o3KL81Za044693;
	Tue, 20 Apr 2010 21:08:01 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KL81Ge044678;
	Tue, 20 Apr 2010 21:08:01 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201004202108.o3KL81Ge044678@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 20 Apr 2010 21:08:01 +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: r206923 - vendor/testfloat/2a
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, 20 Apr 2010 21:08:01 -0000

Author: marius
Date: Tue Apr 20 21:08:00 2010
New Revision: 206923
URL: http://svn.freebsd.org/changeset/base/206923

Log:
  Tag TestFloat 2a.

Added:
  vendor/testfloat/2a/
     - copied from r206922, vendor/testfloat/dist/

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:14: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 08C0B106566C;
	Tue, 20 Apr 2010 21:14: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 EB6518FC17;
	Tue, 20 Apr 2010 21:14: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 o3KLEUCt046172;
	Tue, 20 Apr 2010 21:14:30 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLEUNa046153;
	Tue, 20 Apr 2010 21:14:30 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004202114.o3KLEUNa046153@svn.freebsd.org>
From: Xin LI 
Date: Tue, 20 Apr 2010 21:14: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: r206924 - head/lib/libz
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, 20 Apr 2010 21:14:31 -0000

Author: delphij
Date: Tue Apr 20 21:14:30 2010
New Revision: 206924
URL: http://svn.freebsd.org/changeset/base/206924

Log:
  MFV: zlib 1.2.5.

Modified:
  head/lib/libz/ChangeLog
  head/lib/libz/README
  head/lib/libz/crc32.c
  head/lib/libz/deflate.c
  head/lib/libz/deflate.h
  head/lib/libz/gzguts.h
  head/lib/libz/gzlib.c
  head/lib/libz/inffast.c
  head/lib/libz/inffast.h
  head/lib/libz/inftrees.c
  head/lib/libz/inftrees.h
  head/lib/libz/trees.c
  head/lib/libz/trees.h
  head/lib/libz/zconf.h
  head/lib/libz/zlib.3
  head/lib/libz/zlib.h
  head/lib/libz/zutil.c
  head/lib/libz/zutil.h
Directory Properties:
  head/lib/libz/   (props changed)

Modified: head/lib/libz/ChangeLog
==============================================================================
--- head/lib/libz/ChangeLog	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/ChangeLog	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,6 +1,32 @@
 
                 ChangeLog file for zlib
 
+Changes in 1.2.5 (19 Apr 2010)
+- Disable visibility attribute in win32/Makefile.gcc [Bar-Lev]
+- Default to libdir as sharedlibdir in configure [Nieder]
+- Update copyright dates on modified source files
+- Update trees.c to be able to generate modified trees.h
+- Exit configure for MinGW, suggesting win32/Makefile.gcc
+
+Changes in 1.2.4.5 (18 Apr 2010)
+- Set sharedlibdir in configure [Torok]
+- Set LDFLAGS in Makefile.in [Bar-Lev]
+- Avoid mkdir objs race condition in Makefile.in [Bowler]
+- Add ZLIB_INTERNAL in front of internal inter-module functions and arrays
+- Define ZLIB_INTERNAL to hide internal functions and arrays for GNU C
+- Don't use hidden attribute when it is a warning generator (e.g. Solaris)
+
+Changes in 1.2.4.4 (18 Apr 2010)
+- Fix CROSS_PREFIX executable testing, CHOST extract, mingw* [Torok]
+- Undefine _LARGEFILE64_SOURCE in zconf.h if it is zero, but not if empty
+- Try to use bash or ksh regardless of functionality of /bin/sh
+- Fix configure incompatibility with NetBSD sh
+- Remove attempt to run under bash or ksh since have better NetBSD fix
+- Fix win32/Makefile.gcc for MinGW [Bar-Lev]
+- Add diagnostic messages when using CROSS_PREFIX in configure
+- Added --sharedlibdir option to configure [Weigelt]
+- Use hidden visibility attribute when available [Frysinger]
+
 Changes in 1.2.4.3 (10 Apr 2010)
 - Only use CROSS_PREFIX in configure for ar and ranlib if they exist
 - Use CROSS_PREFIX for nm [Bar-Lev]
@@ -151,7 +177,7 @@ Changes in 1.2.3.6 (17 Jan 2010)
 - Correct email address in configure for system options
 - Update make_vms.com and add make_vms.com to contrib/minizip [Zinser]
 - Update zlib.map [Brown]
-- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Tšršk]
+- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Torok]
 - Apply various fixes to CMakeLists.txt [Lowman]
 - Add checks on len in gzread() and gzwrite()
 - Add error message for no more room for gzungetc()

Modified: head/lib/libz/README
==============================================================================
--- head/lib/libz/README	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/README	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,6 +1,6 @@
 ZLIB DATA COMPRESSION LIBRARY
 
-zlib 1.2.4.3 is a general purpose data compression library.  All the code is
+zlib 1.2.5 is a general purpose data compression library.  All the code is
 thread safe.  The data format used by the zlib library is described by RFCs
 (Request for Comments) 1950 to 1952 in the files
 http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
@@ -31,7 +31,7 @@ Mark Nelson  wrote an ar
 issue of Dr.  Dobb's Journal; a copy of the article is available at
 http://marknelson.us/1997/01/01/zlib-engine/ .
 
-The changes made in version 1.2.4.3 are documented in the file ChangeLog.
+The changes made in version 1.2.5 are documented in the file ChangeLog.
 
 Unsupported third party contributions are provided in directory contrib/ .
 

Modified: head/lib/libz/crc32.c
==============================================================================
--- head/lib/libz/crc32.c	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/crc32.c	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,5 +1,5 @@
 /* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2006 Mark Adler
+ * Copyright (C) 1995-2006, 2010 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  *
  * Thanks to Rodney Brown  for his contribution of faster

Modified: head/lib/libz/deflate.c
==============================================================================
--- head/lib/libz/deflate.c	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/deflate.c	Tue Apr 20 21:14:30 2010	(r206924)
@@ -52,7 +52,7 @@
 #include "deflate.h"
 
 const char deflate_copyright[] =
-   " deflate 1.2.4.3 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
+   " deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot

Modified: head/lib/libz/deflate.h
==============================================================================
--- head/lib/libz/deflate.h	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/deflate.h	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,5 +1,5 @@
 /* deflate.h -- internal compression state
- * Copyright (C) 1995-2009 Jean-loup Gailly
+ * Copyright (C) 1995-2010 Jean-loup Gailly
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -290,13 +290,13 @@ typedef struct internal_state {
    memory checker errors from longest match routines */
 
         /* in trees.c */
-void _tr_init         OF((deflate_state *s));
-int  _tr_tally        OF((deflate_state *s, unsigned dist, unsigned lc));
-void _tr_flush_block  OF((deflate_state *s, charf *buf, ulg stored_len,
-                          int last));
-void _tr_align        OF((deflate_state *s));
-void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
-                          int last));
+void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
+int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
+void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
+                        ulg stored_len, int last));
+void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
+void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
+                        ulg stored_len, int last));
 
 #define d_code(dist) \
    ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
@@ -309,11 +309,11 @@ void _tr_stored_block OF((deflate_state 
 /* Inline versions of _tr_tally for speed: */
 
 #if defined(GEN_TREES_H) || !defined(STDC)
-  extern uch _length_code[];
-  extern uch _dist_code[];
+  extern uch ZLIB_INTERNAL _length_code[];
+  extern uch ZLIB_INTERNAL _dist_code[];
 #else
-  extern const uch _length_code[];
-  extern const uch _dist_code[];
+  extern const uch ZLIB_INTERNAL _length_code[];
+  extern const uch ZLIB_INTERNAL _dist_code[];
 #endif
 
 # define _tr_tally_lit(s, c, flush) \

Modified: head/lib/libz/gzguts.h
==============================================================================
--- head/lib/libz/gzguts.h	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/gzguts.h	Tue Apr 20 21:14:30 2010	(r206924)
@@ -12,7 +12,11 @@
 #  endif
 #endif
 
-#define ZLIB_INTERNAL
+#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
+#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+#  define ZLIB_INTERNAL
+#endif
 
 #include 
 #include "zlib.h"
@@ -112,9 +116,9 @@ typedef struct {
 typedef gz_state FAR *gz_statep;
 
 /* shared functions */
-ZEXTERN void ZEXPORT gz_error OF((gz_statep, int, const char *));
+void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
 #if defined UNDER_CE
-ZEXTERN char ZEXPORT *gz_strwinerror OF((DWORD error));
+char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
 #endif
 
 /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
@@ -123,6 +127,6 @@ ZEXTERN char ZEXPORT *gz_strwinerror OF(
 #ifdef INT_MAX
 #  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
 #else
-ZEXTERN unsigned ZEXPORT gz_intmax OF((void));
+unsigned ZLIB_INTERNAL gz_intmax OF((void));
 #  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
 #endif

Modified: head/lib/libz/gzlib.c
==============================================================================
--- head/lib/libz/gzlib.c	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/gzlib.c	Tue Apr 20 21:14:30 2010	(r206924)
@@ -29,7 +29,7 @@ local gzFile gz_open OF((const char *, i
 
    The gz_strwinerror function does not change the current setting of
    GetLastError. */
-char ZEXPORT *gz_strwinerror (error)
+char ZLIB_INTERNAL *gz_strwinerror (error)
      DWORD error;
 {
     static char buf[1024];
@@ -485,7 +485,7 @@ void ZEXPORT gzclearerr(file)
    memory).  Simply save the error message as a static string.  If there is an
    allocation failure constructing the error message, then convert the error to
    out of memory. */
-void ZEXPORT gz_error(state, err, msg)
+void ZLIB_INTERNAL gz_error(state, err, msg)
     gz_statep state;
     int err;
     const char *msg;
@@ -525,7 +525,7 @@ void ZEXPORT gz_error(state, err, msg)
    available) -- we need to do this to cover cases where 2's complement not
    used, since C standard permits 1's complement and sign-bit representations,
    otherwise we could just use ((unsigned)-1) >> 1 */
-unsigned ZEXPORT gz_intmax()
+unsigned ZLIB_INTERNAL gz_intmax()
 {
     unsigned p, q;
 

Modified: head/lib/libz/inffast.c
==============================================================================
--- head/lib/libz/inffast.c	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/inffast.c	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,5 +1,5 @@
 /* inffast.c -- fast decoding
- * Copyright (C) 1995-2008 Mark Adler
+ * Copyright (C) 1995-2008, 2010 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -64,7 +64,7 @@
       requires strm->avail_out >= 258 for each loop to avoid checking for
       output space.
  */
-void inflate_fast(strm, start)
+void ZLIB_INTERNAL inflate_fast(strm, start)
 z_streamp strm;
 unsigned start;         /* inflate()'s starting value for strm->avail_out */
 {

Modified: head/lib/libz/inffast.h
==============================================================================
--- head/lib/libz/inffast.h	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/inffast.h	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,5 +1,5 @@
 /* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-2003 Mark Adler
+ * Copyright (C) 1995-2003, 2010 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -8,4 +8,4 @@
    subject to change. Applications should only use zlib.h.
  */
 
-void inflate_fast OF((z_streamp strm, unsigned start));
+void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));

Modified: head/lib/libz/inftrees.c
==============================================================================
--- head/lib/libz/inftrees.c	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/inftrees.c	Tue Apr 20 21:14:30 2010	(r206924)
@@ -9,7 +9,7 @@
 #define MAXBITS 15
 
 const char inflate_copyright[] =
-   " inflate 1.2.4.3 Copyright 1995-2010 Mark Adler ";
+   " inflate 1.2.5 Copyright 1995-2010 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -29,7 +29,7 @@ const char inflate_copyright[] =
    table index bits.  It will differ if the request is greater than the
    longest code or if it is less than the shortest code.
  */
-int inflate_table(type, lens, codes, table, bits, work)
+int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
 codetype type;
 unsigned short FAR *lens;
 unsigned codes;
@@ -62,7 +62,7 @@ unsigned short FAR *work;
         35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
     static const unsigned short lext[31] = { /* Length codes 257..285 extra */
         16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
-        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 195, 66};
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 73, 195};
     static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
         1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
         257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,

Modified: head/lib/libz/inftrees.h
==============================================================================
--- head/lib/libz/inftrees.h	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/inftrees.h	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,5 +1,5 @@
 /* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2005, 2010 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -57,6 +57,6 @@ typedef enum {
     DISTS
 } codetype;
 
-extern int inflate_table OF((codetype type, unsigned short FAR *lens,
+int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
                              unsigned codes, code FAR * FAR *table,
                              unsigned FAR *bits, unsigned short FAR *work));

Modified: head/lib/libz/trees.c
==============================================================================
--- head/lib/libz/trees.c	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/trees.c	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,5 +1,5 @@
 /* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2009 Jean-loup Gailly
+ * Copyright (C) 1995-2010 Jean-loup Gailly
  * detect_data_type() function provided freely by Cosmin Truta, 2006
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
@@ -351,13 +351,14 @@ void gen_trees_header()
                 static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
     }
 
-    fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
+    fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n");
     for (i = 0; i < DIST_CODE_LEN; i++) {
         fprintf(header, "%2u%s", _dist_code[i],
                 SEPARATOR(i, DIST_CODE_LEN-1, 20));
     }
 
-    fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
+    fprintf(header,
+        "const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
     for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
         fprintf(header, "%2u%s", _length_code[i],
                 SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
@@ -382,7 +383,7 @@ void gen_trees_header()
 /* ===========================================================================
  * Initialize the tree data structures for a new zlib stream.
  */
-void _tr_init(s)
+void ZLIB_INTERNAL _tr_init(s)
     deflate_state *s;
 {
     tr_static_init();
@@ -867,7 +868,7 @@ local void send_all_trees(s, lcodes, dco
 /* ===========================================================================
  * Send a stored block
  */
-void _tr_stored_block(s, buf, stored_len, last)
+void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
     deflate_state *s;
     charf *buf;       /* input block */
     ulg stored_len;   /* length of input block */
@@ -892,7 +893,7 @@ void _tr_stored_block(s, buf, stored_len
  * To simplify the code, we assume the worst case of last real code encoded
  * on one bit only.
  */
-void _tr_align(s)
+void ZLIB_INTERNAL _tr_align(s)
     deflate_state *s;
 {
     send_bits(s, STATIC_TREES<<1, 3);
@@ -921,7 +922,7 @@ void _tr_align(s)
  * Determine the best encoding for the current block: dynamic trees, static
  * trees or store, and output the encoded block to the zip file.
  */
-void _tr_flush_block(s, buf, stored_len, last)
+void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
     deflate_state *s;
     charf *buf;       /* input block, or NULL if too old */
     ulg stored_len;   /* length of input block */
@@ -1022,7 +1023,7 @@ void _tr_flush_block(s, buf, stored_len,
  * Save the match info and tally the frequency counts. Return true if
  * the current block must be flushed.
  */
-int _tr_tally (s, dist, lc)
+int ZLIB_INTERNAL _tr_tally (s, dist, lc)
     deflate_state *s;
     unsigned dist;  /* distance of matched string */
     unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */

Modified: head/lib/libz/trees.h
==============================================================================
--- head/lib/libz/trees.h	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/trees.h	Tue Apr 20 21:14:30 2010	(r206924)
@@ -70,7 +70,7 @@ local const ct_data static_dtree[D_CODES
 {{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
 };
 
-const uch _dist_code[DIST_CODE_LEN] = {
+const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
  0,  1,  2,  3,  4,  4,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8,
  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 10, 10,
 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
@@ -99,7 +99,7 @@ const uch _dist_code[DIST_CODE_LEN] = {
 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
 };
 
-const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
+const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
  0,  1,  2,  3,  4,  5,  6,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 12, 12,
 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,

Modified: head/lib/libz/zconf.h
==============================================================================
--- head/lib/libz/zconf.h	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/zconf.h	Tue Apr 20 21:14:30 2010	(r206924)
@@ -315,10 +315,6 @@
 #  endif
 #endif
 
-#ifdef HAVE_VISIBILITY_PRAGMA
-#  define ZEXTERN __attribute__((visibility ("default"))) extern
-#endif
-
 #ifndef ZEXTERN
 #  define ZEXTERN extern
 #endif
@@ -368,6 +364,16 @@ typedef uLong FAR uLongf;
 #  include     /* for off_t */
 #endif
 
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if -_LARGEFILE64_SOURCE - -1 == 1
+#  undef _LARGEFILE64_SOURCE
+#endif
+
 #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
 #  include        /* for SEEK_* and off_t */
 #  ifdef VMS

Modified: head/lib/libz/zlib.3
==============================================================================
--- head/lib/libz/zlib.3	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/zlib.3	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "10 Apr 2010"
+.TH ZLIB 3 "19 Apr 2010"
 .SH NAME
 zlib \- compression/decompression library
 .SH SYNOPSIS
@@ -125,7 +125,7 @@ before asking for help.
 Send questions and/or comments to zlib@gzip.org,
 or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
 .SH AUTHORS
-Version 1.2.4.3
+Version 1.2.5
 Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org)
 and Mark Adler (madler@alumni.caltech.edu).
 .LP

Modified: head/lib/libz/zlib.h
==============================================================================
--- head/lib/libz/zlib.h	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/zlib.h	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,5 +1,5 @@
 /* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.2.4.3, April 10th, 2010
+  version 1.2.5, April 19th, 2010
 
   Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
 
@@ -37,12 +37,12 @@
 extern "C" {
 #endif
 
-#define ZLIB_VERSION "1.2.4.3"
-#define ZLIB_VERNUM 0x1243
+#define ZLIB_VERSION "1.2.5"
+#define ZLIB_VERNUM 0x1250
 #define ZLIB_VER_MAJOR 1
 #define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 4
-#define ZLIB_VER_SUBREVISION 3
+#define ZLIB_VER_REVISION 5
+#define ZLIB_VER_SUBREVISION 0
 
 /*
     The 'zlib' compression library provides in-memory compression and

Modified: head/lib/libz/zutil.c
==============================================================================
--- head/lib/libz/zutil.c	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/zutil.c	Tue Apr 20 21:14:30 2010	(r206924)
@@ -1,5 +1,5 @@
 /* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2005, 2010 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -117,9 +117,9 @@ uLong ZEXPORT zlibCompileFlags()
 #  ifndef verbose
 #    define verbose 0
 #  endif
-int z_verbose = verbose;
+int ZLIB_INTERNAL z_verbose = verbose;
 
-void z_error (m)
+void ZLIB_INTERNAL z_error (m)
     char *m;
 {
     fprintf(stderr, "%s\n", m);
@@ -146,7 +146,7 @@ const char * ZEXPORT zError(err)
 
 #ifndef HAVE_MEMCPY
 
-void zmemcpy(dest, source, len)
+void ZLIB_INTERNAL zmemcpy(dest, source, len)
     Bytef* dest;
     const Bytef* source;
     uInt  len;
@@ -157,7 +157,7 @@ void zmemcpy(dest, source, len)
     } while (--len != 0);
 }
 
-int zmemcmp(s1, s2, len)
+int ZLIB_INTERNAL zmemcmp(s1, s2, len)
     const Bytef* s1;
     const Bytef* s2;
     uInt  len;
@@ -170,7 +170,7 @@ int zmemcmp(s1, s2, len)
     return 0;
 }
 
-void zmemzero(dest, len)
+void ZLIB_INTERNAL zmemzero(dest, len)
     Bytef* dest;
     uInt  len;
 {
@@ -213,7 +213,7 @@ local ptr_table table[MAX_PTR];
  * a protected system like OS/2. Use Microsoft C instead.
  */
 
-voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
 {
     voidpf buf = opaque; /* just to make some compilers happy */
     ulg bsize = (ulg)items*size;
@@ -237,7 +237,7 @@ voidpf zcalloc (voidpf opaque, unsigned 
     return buf;
 }
 
-void  zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
 {
     int n;
     if (*(ush*)&ptr != 0) { /* object < 64K */
@@ -272,13 +272,13 @@ void  zcfree (voidpf opaque, voidpf ptr)
 #  define _hfree   hfree
 #endif
 
-voidpf zcalloc (voidpf opaque, uInt items, uInt size)
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
 {
     if (opaque) opaque = 0; /* to make compiler happy */
     return _halloc((long)items, size);
 }
 
-void  zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
 {
     if (opaque) opaque = 0; /* to make compiler happy */
     _hfree(ptr);
@@ -297,7 +297,7 @@ extern voidp  calloc OF((uInt items, uIn
 extern void   free   OF((voidpf ptr));
 #endif
 
-voidpf zcalloc (opaque, items, size)
+voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
     voidpf opaque;
     unsigned items;
     unsigned size;
@@ -307,7 +307,7 @@ voidpf zcalloc (opaque, items, size)
                               (voidpf)calloc(items, size);
 }
 
-void  zcfree (opaque, ptr)
+void ZLIB_INTERNAL zcfree (opaque, ptr)
     voidpf opaque;
     voidpf ptr;
 {

Modified: head/lib/libz/zutil.h
==============================================================================
--- head/lib/libz/zutil.h	Tue Apr 20 21:08:00 2010	(r206923)
+++ head/lib/libz/zutil.h	Tue Apr 20 21:14:30 2010	(r206924)
@@ -13,7 +13,12 @@
 #ifndef ZUTIL_H
 #define ZUTIL_H
 
-#define ZLIB_INTERNAL
+#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
+#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+#  define ZLIB_INTERNAL
+#endif
+
 #include "zlib.h"
 
 #ifdef STDC
@@ -231,16 +236,16 @@ extern const char * const z_errmsg[10]; 
 #    define zmemzero(dest, len) memset(dest, 0, len)
 #  endif
 #else
-   extern void zmemcpy  OF((Bytef* dest, const Bytef* source, uInt len));
-   extern int  zmemcmp  OF((const Bytef* s1, const Bytef* s2, uInt len));
-   extern void zmemzero OF((Bytef* dest, uInt len));
+   void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+   int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+   void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
 #endif
 
 /* Diagnostic functions */
 #ifdef DEBUG
 #  include 
-   extern int z_verbose;
-   extern void z_error    OF((char *m));
+   extern int ZLIB_INTERNAL z_verbose;
+   extern void ZLIB_INTERNAL z_error OF((char *m));
 #  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
 #  define Trace(x) {if (z_verbose>=0) fprintf x ;}
 #  define Tracev(x) {if (z_verbose>0) fprintf x ;}
@@ -257,8 +262,9 @@ extern const char * const z_errmsg[10]; 
 #endif
 
 
-voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
-void   zcfree  OF((voidpf opaque, voidpf ptr));
+voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
+                        unsigned size));
+void ZLIB_INTERNAL zcfree  OF((voidpf opaque, voidpf ptr));
 
 #define ZALLOC(strm, items, size) \
            (*((strm)->zalloc))((strm)->opaque, (items), (size))

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:24: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 0D4391065675;
	Tue, 20 Apr 2010 21:24:33 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EF6FE8FC0A;
	Tue, 20 Apr 2010 21:24: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 o3KLOWuv048527;
	Tue, 20 Apr 2010 21:24:32 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLOWm9048526;
	Tue, 20 Apr 2010 21:24:32 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202124.o3KLOWm9048526@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:24: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: r206927 - stable/8/sys/dev/siba
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, 20 Apr 2010 21:24:33 -0000

Author: weongyo
Date: Tue Apr 20 21:24:32 2010
New Revision: 206927
URL: http://svn.freebsd.org/changeset/base/206927

Log:
  MFC r201978:
    Merge from projects/mips to head by hand:
  
    Merge the siba bus device.  This was moved from mips to dev because
    siba bus can be in other architectures, like ARM.
  
  MFC r202056:
    Move this to the right location.  Grump.
  
  MFC r202057:
    This was somehow copied to the wrong place :(.  Remove the spare copy.
  
  Approved by:	imp

Added:
     - copied unchanged from r202056, head/sys/dev/siba/siba_cc.c
Directory Properties:
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Copied: stable/8/sys/dev/siba/siba_cc.c (from r202056, head/sys/dev/siba/siba_cc.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/dev/siba/siba_cc.c	Tue Apr 20 21:24:32 2010	(r206927, copy of r202056, head/sys/dev/siba/siba_cc.c)
@@ -0,0 +1,154 @@
+/*-
+ * Copyright (c) 2007 Bruce M. Simpson.
+ * 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.
+ */
+
+/*
+ * Child driver for ChipCommon core.
+ * This is not MI code at the moment.
+ * Two 16C550 compatible UARTs live here. On the WGT634U, uart1 is the
+ * system console, and uart0 is not pinned out.
+ *  Because their presence is conditional, they should probably
+ *  be attached from here.
+ * GPIO lives here.
+ * The hardware watchdog lives here.
+ * Clock control registers live here.
+ *  You don't need to read them to determine the clock speed on the 5365,
+ *  which is always 200MHz and thus may be hardcoded (for now).
+ * Flash config registers live here. There may or may not be system flash.
+ * The external interface bus lives here (conditionally).
+ * There is a JTAG interface here which may be used to attach probes to
+ * the SoC for debugging.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+static int	siba_cc_attach(device_t);
+static int	siba_cc_probe(device_t);
+static void	siba_cc_intr(void *v);
+
+static int
+siba_cc_probe(device_t dev)
+{
+
+	if (siba_get_vendor(dev) == SIBA_VID_BROADCOM &&
+	    siba_get_device(dev) == SIBA_DEVID_CHIPCOMMON) {
+		device_set_desc(dev, "ChipCommon core");
+		return (BUS_PROBE_DEFAULT);
+	}
+
+	return (ENXIO);
+}
+
+struct siba_cc_softc {
+	void *notused;
+};
+
+static int
+siba_cc_attach(device_t dev)
+{
+	//struct siba_cc_softc *sc = device_get_softc(dev);
+	struct resource *mem;
+	struct resource *irq;
+	int rid;
+
+	/*
+	 * Allocate the resources which the parent bus has already
+	 * determined for us.
+	 * TODO: interrupt routing
+	 */
+#define MIPS_MEM_RID 0x20
+	rid = MIPS_MEM_RID;
+	mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+	if (mem == NULL) {
+		device_printf(dev, "unable to allocate memory\n");
+		return (ENXIO);
+	}
+
+	rid = 0;
+	irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0);
+	if (irq == NULL) {
+		device_printf(dev, "unable to allocate irq\n");
+		return (ENXIO);
+	}
+
+	/* now setup the interrupt */
+	/* may be fast, exclusive or mpsafe at a later date */
+
+	/*
+	 * XXX is this interrupt line in ChipCommon used for anything
+	 * other than the uart? in that case we shouldn't hog it ourselves
+	 * and let uart claim it to avoid polled mode.
+	 */
+	int err;
+	void *cookie;
+	err = bus_setup_intr(dev, irq, INTR_TYPE_TTY, NULL, siba_cc_intr, NULL,
+	    &cookie);
+	if (err != 0) {
+		device_printf(dev, "unable to setup intr\n");
+		return (ENXIO);
+	}
+
+	/* TODO: attach uart child */
+
+	return (0);
+}
+
+static void
+siba_cc_intr(void *v)
+{
+
+}
+
+static device_method_t siba_cc_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_attach,	siba_cc_attach),
+	DEVMETHOD(device_probe,		siba_cc_probe),
+
+	{0, 0},
+};
+
+static driver_t siba_cc_driver = {
+	"siba_cc",
+	siba_cc_methods,
+	sizeof(struct siba_softc),
+};
+static devclass_t siba_cc_devclass;
+
+DRIVER_MODULE(siba_cc, siba, siba_cc_driver, siba_cc_devclass, 0, 0);

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:29: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 43973106567D;
	Tue, 20 Apr 2010 21:29:54 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 307768FC24;
	Tue, 20 Apr 2010 21:29: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 o3KLTsJL049843;
	Tue, 20 Apr 2010 21:29:54 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLTsCG049837;
	Tue, 20 Apr 2010 21:29:54 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202129.o3KLTsCG049837@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:29: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: r206928 - in stable/8/sys: dev/siba modules/siba_bwn
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, 20 Apr 2010 21:29:54 -0000

Author: weongyo
Date: Tue Apr 20 21:29:53 2010
New Revision: 206928
URL: http://svn.freebsd.org/changeset/base/206928

Log:
  MFC r203319:
    Adds siba_bwn module which is used with bwn(4).  Main purpose of this
    module is to distinguish parts of Silicon Backplane and of Broadcom
    Wireless.

Added:
  stable/8/sys/dev/siba/siba_bwn.c
     - copied unchanged from r203319, head/sys/dev/siba/siba_bwn.c
  stable/8/sys/dev/siba/siba_core.c
     - copied unchanged from r203319, head/sys/dev/siba/siba_core.c
  stable/8/sys/modules/siba_bwn/
     - copied from r203319, head/sys/modules/siba_bwn/
Modified:
  stable/8/sys/dev/siba/siba.c
  stable/8/sys/dev/siba/siba_cc.c   (contents, props changed)
  stable/8/sys/dev/siba/siba_ids.h
  stable/8/sys/dev/siba/siba_pcib.c
  stable/8/sys/dev/siba/sibareg.h
  stable/8/sys/dev/siba/sibavar.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/siba/siba.c
==============================================================================
--- stable/8/sys/dev/siba/siba.c	Tue Apr 20 21:24:32 2010	(r206927)
+++ stable/8/sys/dev/siba/siba.c	Tue Apr 20 21:29:53 2010	(r206928)
@@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
-#include 
 #include 
+#include 
+#include 
 
 /*
  * TODO: De-mipsify this code.
@@ -77,7 +77,7 @@ static struct siba_devid siba_devids[] =
 	  "MIPS core" },
 	{ SIBA_VID_BROADCOM,	SIBA_DEVID_ETHERNET,	SIBA_REV_ANY,
 	  "Ethernet core" },
-	{ SIBA_VID_BROADCOM,	SIBA_DEVID_USB,		SIBA_REV_ANY,
+	{ SIBA_VID_BROADCOM,	SIBA_DEVID_USB11_HOSTDEV, SIBA_REV_ANY,
 	  "USB host controller" },
 	{ SIBA_VID_BROADCOM,	SIBA_DEVID_IPSEC,	SIBA_REV_ANY,
 	  "IPSEC accelerator" },
@@ -103,7 +103,6 @@ static struct siba_devid *
 static struct resource_list *
 		siba_get_reslist(device_t, device_t);
 static uint8_t	siba_getirq(uint16_t);
-static uint8_t	siba_getncores(uint16_t);
 static int	siba_print_all_resources(device_t dev);
 static int	siba_print_child(device_t, device_t);
 static int	siba_probe(device_t);
@@ -112,30 +111,7 @@ int		siba_read_ivar(device_t, device_t, 
 static struct siba_devinfo *
 		siba_setup_devinfo(device_t, uint8_t);
 int		siba_write_ivar(device_t, device_t, int, uintptr_t);
-
-/*
- * Earlier ChipCommon revisions have hardcoded number of cores
- * present dependent on the ChipCommon ID.
- */
-static uint8_t
-siba_getncores(uint16_t ccid)
-{
-	uint8_t ncores;
-
-	switch (ccid) {
-	case SIBA_CCID_SENTRY5:
-		ncores = 7;
-		break;
-	case SIBA_CCID_BCM4710:
-	case SIBA_CCID_BCM4704:
-		ncores = 9;
-		break;
-	default:
-		ncores = 0;
-	}
-
-	return (ncores);
-}
+uint8_t		siba_getncores(device_t, uint16_t);
 
 /*
  * On the Sentry5, the system bus IRQs are the same as the
@@ -156,7 +132,7 @@ siba_getirq(uint16_t devid)
 	case SIBA_DEVID_IPSEC:
 		irq = 2;
 		break;
-	case SIBA_DEVID_USB:
+	case SIBA_DEVID_USB11_HOSTDEV:
 		irq = 3;
 		break;
 	case SIBA_DEVID_PCI:
@@ -188,7 +164,7 @@ siba_probe(device_t dev)
 	uint16_t ccid;
 	int rid;
 
-	sc->sc_dev = dev;
+	sc->siba_dev = dev;
 
 	//rman_debug = 1;	/* XXX */
 
@@ -197,24 +173,24 @@ siba_probe(device_t dev)
 	 * was compiled with.
 	 */
 	rid = MIPS_MEM_RID;
-	sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+	sc->siba_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
 	    RF_ACTIVE);
-	if (sc->sc_mem == NULL) {
+	if (sc->siba_mem_res == NULL) {
 		device_printf(dev, "unable to allocate probe aperture\n");
 		return (ENXIO);
 	}
-	sc->sc_bt = rman_get_bustag(sc->sc_mem);
-	sc->sc_bh = rman_get_bushandle(sc->sc_mem);
-	sc->sc_maddr = rman_get_start(sc->sc_mem);
-	sc->sc_msize = rman_get_size(sc->sc_mem);
+	sc->siba_mem_bt = rman_get_bustag(sc->siba_mem_res);
+	sc->siba_mem_bh = rman_get_bushandle(sc->siba_mem_res);
+	sc->siba_maddr = rman_get_start(sc->siba_mem_res);
+	sc->siba_msize = rman_get_size(sc->siba_mem_res);
 
 	if (siba_debug) {
 		device_printf(dev, "start %08x len %08x\n",
-		    sc->sc_maddr, sc->sc_msize);
+		    sc->siba_maddr, sc->siba_msize);
 	}
 
-	idlo = siba_read_4(sc, 0, SIBA_CORE_IDLO);
-	idhi = siba_read_4(sc, 0, SIBA_CORE_IDHI);
+	idlo = siba_mips_read_4(sc, 0, SIBA_IDLOW);
+	idhi = siba_mips_read_4(sc, 0, SIBA_IDHIGH);
 	ccid = ((idhi & 0x8ff0) >> 4);
 	if (siba_debug) {
 		device_printf(dev, "idlo = %08x\n", idlo);
@@ -256,7 +232,7 @@ siba_probe(device_t dev)
 	uint16_t cc_id;
 	uint16_t cc_rev;
 
-	ccidreg = siba_read_4(sc, 0, SIBA_CC_CCID);
+	ccidreg = siba_mips_read_4(sc, 0, SIBA_CC_CHIPID);
 	cc_id = (ccidreg & SIBA_CC_IDMASK);
 	cc_rev = (ccidreg & SIBA_CC_REVMASK) >> SIBA_CC_REVSHIFT;
 	if (siba_debug) {
@@ -264,9 +240,9 @@ siba_probe(device_t dev)
 		     ccidreg, cc_id, cc_rev);
 	}
 
-	sc->sc_ncores = siba_getncores(cc_id);
+	sc->siba_ncores = siba_getncores(dev, cc_id);
 	if (siba_debug) {
-		device_printf(dev, "%d cores detected.\n", sc->sc_ncores);
+		device_printf(dev, "%d cores detected.\n", sc->siba_ncores);
 	}
 
 	/*
@@ -275,36 +251,38 @@ siba_probe(device_t dev)
 	 */
 	rid = MIPS_MEM_RID;
 	int result;
-	result = bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->sc_mem);
+	result = bus_release_resource(dev, SYS_RES_MEMORY, rid,
+	    sc->siba_mem_res);
 	if (result != 0) {
 		device_printf(dev, "error %d releasing resource\n", result);
 		return (ENXIO);
 	}
 
 	uint32_t total;
-	total = sc->sc_ncores * SIBA_CORE_LEN;
+	total = sc->siba_ncores * SIBA_CORE_LEN;
 
 	/* XXX Don't allocate the entire window until we
 	 * enumerate the bus. Once the bus has been enumerated,
 	 * and instance variables/children instantiated + populated,
 	 * release the resource so children may attach.
 	 */
-	sc->sc_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
-	    sc->sc_maddr, sc->sc_maddr + total - 1, total, RF_ACTIVE);
-	if (sc->sc_mem == NULL) {
+	sc->siba_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
+	    sc->siba_maddr, sc->siba_maddr + total - 1, total, RF_ACTIVE);
+	if (sc->siba_mem_res == NULL) {
 		device_printf(dev, "unable to allocate entire aperture\n");
 		return (ENXIO);
 	}
-	sc->sc_bt = rman_get_bustag(sc->sc_mem);
-	sc->sc_bh = rman_get_bushandle(sc->sc_mem);
-	sc->sc_maddr = rman_get_start(sc->sc_mem);
-	sc->sc_msize = rman_get_size(sc->sc_mem);
+	sc->siba_mem_bt = rman_get_bustag(sc->siba_mem_res);
+	sc->siba_mem_bh = rman_get_bushandle(sc->siba_mem_res);
+	sc->siba_maddr = rman_get_start(sc->siba_mem_res);
+	sc->siba_msize = rman_get_size(sc->siba_mem_res);
 
 	if (siba_debug) {
 		device_printf(dev, "after remapping: start %08x len %08x\n",
-		    sc->sc_maddr, sc->sc_msize);
+		    sc->siba_maddr, sc->siba_msize);
 	}
-	bus_set_resource(dev, SYS_RES_MEMORY, rid, sc->sc_maddr, sc->sc_msize);
+	bus_set_resource(dev, SYS_RES_MEMORY, rid, sc->siba_maddr,
+	    sc->siba_msize);
 
 	/*
 	 * We need a manager for the space we claim on nexus to
@@ -313,12 +291,13 @@ siba_probe(device_t dev)
 	 * otherwise it may be claimed elsewhere.
 	 * XXX move to softc
 	 */
-	mem_rman.rm_start = sc->sc_maddr;
-	mem_rman.rm_end = sc->sc_maddr + sc->sc_msize - 1;
+	mem_rman.rm_start = sc->siba_maddr;
+	mem_rman.rm_end = sc->siba_maddr + sc->siba_msize - 1;
 	mem_rman.rm_type = RMAN_ARRAY;
 	mem_rman.rm_descr = "SiBa I/O memory addresses";
 	if (rman_init(&mem_rman) != 0 ||
-	    rman_manage_region(&mem_rman, mem_rman.rm_start, mem_rman.rm_end) != 0) {
+	    rman_manage_region(&mem_rman, mem_rman.rm_start,
+		mem_rman.rm_end) != 0) {
 		panic("%s: mem_rman", __func__);
 	}
 
@@ -344,7 +323,7 @@ siba_attach(device_t dev)
 	 * NB: only one core may be mapped at any time if the siba bus
 	 * is the child of a PCI or PCMCIA bus.
 	 */
-	for (idx = 0; idx < sc->sc_ncores; idx++) {
+	for (idx = 0; idx < sc->siba_ncores; idx++) {
 		sdi = siba_setup_devinfo(dev, idx);
 		child = device_add_child(dev, NULL, -1);
 		if (child == NULL)
@@ -483,13 +462,14 @@ siba_setup_devinfo(device_t dev, uint8_t
 	sdi = malloc(sizeof(*sdi), M_DEVBUF, M_WAITOK | M_ZERO);
 	resource_list_init(&sdi->sdi_rl);
 
-	idlo = siba_read_4(sc, idx, SIBA_CORE_IDLO);
-	idhi = siba_read_4(sc, idx, SIBA_CORE_IDHI);
+	idlo = siba_mips_read_4(sc, idx, SIBA_IDLOW);
+	idhi = siba_mips_read_4(sc, idx, SIBA_IDHIGH);
 
-	vendorid = (idhi & SIBA_IDHIGH_VC) >> SIBA_IDHIGH_VC_SHIFT;
+	vendorid = (idhi & SIBA_IDHIGH_VENDORMASK) >>
+	    SIBA_IDHIGH_VENDOR_SHIFT;
 	devid = ((idhi & 0x8ff0) >> 4);
-	rev = (idhi & SIBA_IDHIGH_RCLO);
-	rev |= (idhi & SIBA_IDHIGH_RCHI) >> SIBA_IDHIGH_RCHI_SHIFT;
+	rev = (idhi & SIBA_IDHIGH_REVLO);
+	rev |= (idhi & SIBA_IDHIGH_REVHI) >> SIBA_IDHIGH_REVHI_SHIFT;
 
 	sdi->sdi_vid = vendorid;
 	sdi->sdi_devid = devid;
@@ -500,7 +480,7 @@ siba_setup_devinfo(device_t dev, uint8_t
 	/*
 	 * Determine memory window on bus and irq if one is needed.
 	 */
-	baseaddr = sc->sc_maddr + (idx * SIBA_CORE_LEN);
+	baseaddr = sc->siba_maddr + (idx * SIBA_CORE_LEN);
 	resource_list_add(&sdi->sdi_rl, SYS_RES_MEMORY,
 	    MIPS_MEM_RID, /* XXX */
 	    baseaddr, baseaddr + SIBA_CORE_LEN - 1, SIBA_CORE_LEN);

Copied: stable/8/sys/dev/siba/siba_bwn.c (from r203319, head/sys/dev/siba/siba_bwn.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/dev/siba/siba_bwn.c	Tue Apr 20 21:29:53 2010	(r206928, copy of r203319, head/sys/dev/siba/siba_bwn.c)
@@ -0,0 +1,366 @@
+/*-
+ * Copyright (c) 2009-2010 Weongyo Jeong 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ *    redistribution must be conditioned upon including a substantially
+ *    similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * Sonics Silicon Backplane front-end for bwn(4).
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+/*
+ * PCI glue.
+ */
+
+struct siba_bwn_softc {
+	/* Child driver using MSI. */
+	device_t			ssc_msi_child;
+	struct siba_softc		ssc_siba;
+};
+
+#define	BS_BAR				0x10
+#define	PCI_VENDOR_BROADCOM		0x14e4
+#define	N(a)				(sizeof(a) / sizeof(a[0]))
+
+static const struct siba_dev {
+	uint16_t	vid;
+	uint16_t	did;
+	const char	*desc;
+} siba_devices[] = {
+	{ PCI_VENDOR_BROADCOM, 0x4301, "Broadcom BCM4301 802.11b Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4306, "Unknown" },
+	{ PCI_VENDOR_BROADCOM, 0x4307, "Broadcom BCM4307 802.11b Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4311, "Broadcom BCM4311 802.11b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4312,
+	  "Broadcom BCM4312 802.11a/b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4315, "Broadcom BCM4312 802.11b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4318, "Broadcom BCM4318 802.11b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4319,
+	  "Broadcom BCM4318 802.11a/b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4320, "Broadcom BCM4306 802.11b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4321, "Broadcom BCM4306 802.11a Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4324,
+	  "Broadcom BCM4309 802.11a/b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4325, "Broadcom BCM4306 802.11b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4328, "Unknown" },
+	{ PCI_VENDOR_BROADCOM, 0x4329, "Unknown" },
+	{ PCI_VENDOR_BROADCOM, 0x432b, "Unknown" }
+};
+
+device_t	siba_add_child(device_t, struct siba_softc *, int, const char *,
+		    int);
+int		siba_core_attach(struct siba_softc *);
+int		siba_core_detach(struct siba_softc *);
+int		siba_core_suspend(struct siba_softc *);
+int		siba_core_resume(struct siba_softc *);
+
+static int
+siba_bwn_probe(device_t dev)
+{
+	int i;
+	uint16_t did, vid;
+
+	did = pci_get_device(dev);
+	vid = pci_get_vendor(dev);
+
+	for (i = 0; i < N(siba_devices); i++) {
+		if (siba_devices[i].did == did && siba_devices[i].vid == vid) {
+			device_set_desc(dev, siba_devices[i].desc);
+			return (BUS_PROBE_DEFAULT);
+		}
+	}
+	return (ENXIO);
+}
+
+static int
+siba_bwn_attach(device_t dev)
+{
+	struct siba_bwn_softc *ssc = device_get_softc(dev);
+	struct siba_softc *siba = &ssc->ssc_siba;
+
+	siba->siba_dev = dev;
+	siba->siba_type = SIBA_TYPE_PCI;
+
+	/*
+	 * Enable bus mastering.
+	 */
+	pci_enable_busmaster(dev);
+
+	/* 
+	 * Setup memory-mapping of PCI registers.
+	 */
+	siba->siba_mem_rid = SIBA_PCIR_BAR;
+	siba->siba_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+		&siba->siba_mem_rid, RF_ACTIVE);
+	if (siba->siba_mem_res == NULL) {
+		device_printf(dev, "cannot map register space\n");
+		return (ENXIO);
+	}
+	siba->siba_mem_bt = rman_get_bustag(siba->siba_mem_res);
+	siba->siba_mem_bh = rman_get_bushandle(siba->siba_mem_res);
+
+	/* Get more PCI information */
+	siba->siba_pci_did = pci_get_device(dev);
+	siba->siba_pci_vid = pci_get_vendor(dev);
+	siba->siba_pci_subvid = pci_get_subvendor(dev);
+	siba->siba_pci_subdid = pci_get_subdevice(dev);
+
+	return (siba_core_attach(siba));
+}
+
+static int
+siba_bwn_detach(device_t dev)
+{
+	struct siba_bwn_softc *ssc = device_get_softc(dev);
+	struct siba_softc *siba = &ssc->ssc_siba;
+
+	/* check if device was removed */
+	siba->siba_invalid = !bus_child_present(dev);
+
+	pci_disable_busmaster(dev);
+	bus_generic_detach(dev);
+	siba_core_detach(siba);
+
+	bus_release_resource(dev, SYS_RES_MEMORY, BS_BAR, siba->siba_mem_res);
+
+	return (0);
+}
+
+static int
+siba_bwn_shutdown(device_t dev)
+{
+	device_t *devlistp;
+	int devcnt, error = 0, i;
+
+	error = device_get_children(dev, &devlistp, &devcnt);
+	if (error != 0)
+		return (error);
+
+	for (i = 0 ; i < devcnt ; i++)
+		device_shutdown(devlistp[i]);
+	free(devlistp, M_TEMP);
+	return (0);
+}
+
+static int
+siba_bwn_suspend(device_t dev)
+{
+	struct siba_bwn_softc *ssc = device_get_softc(dev);
+	struct siba_softc *siba = &ssc->ssc_siba;
+	device_t *devlistp;
+	int devcnt, error = 0, i, j;
+
+	error = device_get_children(dev, &devlistp, &devcnt);
+	if (error != 0)
+		return (error);
+
+	for (i = 0 ; i < devcnt ; i++) {
+		error = DEVICE_SUSPEND(devlistp[i]);
+		if (error) {
+			for (j = 0; j < i; i++)
+				DEVICE_RESUME(devlistp[j]);
+			return (error);
+		}
+	}
+	free(devlistp, M_TEMP);
+	return (siba_core_suspend(siba));
+}
+
+static int
+siba_bwn_resume(device_t dev)
+{
+	struct siba_bwn_softc *ssc = device_get_softc(dev);
+	struct siba_softc *siba = &ssc->ssc_siba;
+	device_t *devlistp;
+	int devcnt, error = 0, i;
+
+	error = siba_core_resume(siba);
+	if (error != 0)
+		return (error);
+
+	error = device_get_children(dev, &devlistp, &devcnt);
+	if (error != 0)
+		return (error);
+
+	for (i = 0 ; i < devcnt ; i++)
+		DEVICE_RESUME(devlistp[i]);
+	free(devlistp, M_TEMP);
+	return (0);
+}
+
+static device_t
+siba_bwn_add_child(device_t dev, int order, const char *name, int unit)
+{
+	struct siba_bwn_softc *ssc = device_get_softc(dev);
+	struct siba_softc *siba = &ssc->ssc_siba;
+
+	return (siba_add_child(dev, siba, order, name, unit));
+}
+
+/* proxying to the parent */
+static struct resource *
+siba_bwn_alloc_resource(device_t dev, device_t child, int type, int *rid,
+    u_long start, u_long end, u_long count, u_int flags)
+{
+
+	return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
+	    type, rid, start, end, count, flags));
+}
+
+/* proxying to the parent */
+static int
+siba_bwn_release_resource(device_t dev, device_t child, int type,
+    int rid, struct resource *r)
+{
+
+	return (BUS_RELEASE_RESOURCE(device_get_parent(dev), dev, type,
+	    rid, r));
+}
+
+/* proxying to the parent */
+static int
+siba_bwn_setup_intr(device_t dev, device_t child, struct resource *irq,
+    int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg,
+    void **cookiep)
+{
+
+	return (BUS_SETUP_INTR(device_get_parent(dev), dev, irq, flags,
+	    filter, intr, arg, cookiep));
+}
+
+/* proxying to the parent */
+static int
+siba_bwn_teardown_intr(device_t dev, device_t child, struct resource *irq,
+    void *cookie)
+{
+
+	return (BUS_TEARDOWN_INTR(device_get_parent(dev), dev, irq, cookie));
+}
+
+static int
+siba_bwn_find_extcap(device_t dev, device_t child, int capability,
+    int *capreg)
+{
+
+	return (pci_find_extcap(dev, capability, capreg));
+}
+
+static int
+siba_bwn_alloc_msi(device_t dev, device_t child, int *count)
+{
+	struct siba_bwn_softc *ssc;
+	int error;
+
+	ssc = device_get_softc(dev);
+	if (ssc->ssc_msi_child != NULL)
+		return (EBUSY);
+	error = pci_alloc_msi(dev, count);
+	if (error == 0)
+		ssc->ssc_msi_child = child;
+	return (error);
+}
+
+static int
+siba_bwn_release_msi(device_t dev, device_t child)
+{
+	struct siba_bwn_softc *ssc;
+	int error;
+
+	ssc = device_get_softc(dev);
+	if (ssc->ssc_msi_child != child)
+		return (ENXIO);
+	error = pci_release_msi(dev);
+	if (error == 0)
+		ssc->ssc_msi_child = NULL;
+	return (error);
+}
+
+static int
+siba_bwn_msi_count(device_t dev, device_t child)
+{
+
+	return (pci_msi_count(dev));
+}
+
+static device_method_t siba_bwn_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		siba_bwn_probe),
+	DEVMETHOD(device_attach,	siba_bwn_attach),
+	DEVMETHOD(device_detach,	siba_bwn_detach),
+	DEVMETHOD(device_shutdown,	siba_bwn_shutdown),
+	DEVMETHOD(device_suspend,	siba_bwn_suspend),
+	DEVMETHOD(device_resume,	siba_bwn_resume),
+
+	/* Bus interface */
+	DEVMETHOD(bus_add_child,	siba_bwn_add_child),
+	DEVMETHOD(bus_alloc_resource,   siba_bwn_alloc_resource),
+	DEVMETHOD(bus_release_resource, siba_bwn_release_resource),
+	DEVMETHOD(bus_setup_intr,       siba_bwn_setup_intr),
+	DEVMETHOD(bus_teardown_intr,    siba_bwn_teardown_intr),
+
+	/* PCI interface */
+	DEVMETHOD(pci_find_extcap,	siba_bwn_find_extcap),
+	DEVMETHOD(pci_alloc_msi,	siba_bwn_alloc_msi),
+	DEVMETHOD(pci_release_msi,	siba_bwn_release_msi),
+	DEVMETHOD(pci_msi_count,	siba_bwn_msi_count),
+
+	{ 0,0 }
+};
+static driver_t siba_bwn_driver = {
+	"siba_bwn",
+	siba_bwn_methods,
+	sizeof(struct siba_bwn_softc)
+};
+static devclass_t siba_bwn_devclass;
+DRIVER_MODULE(siba_bwn, pci, siba_bwn_driver, siba_bwn_devclass, 0, 0);
+MODULE_VERSION(siba_bwn, 1);

Modified: stable/8/sys/dev/siba/siba_cc.c
==============================================================================
--- stable/8/sys/dev/siba/siba_cc.c	Tue Apr 20 21:24:32 2010	(r206927)
+++ stable/8/sys/dev/siba/siba_cc.c	Tue Apr 20 21:29:53 2010	(r206928)
@@ -55,9 +55,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
-#include 
 #include 
+#include 
+#include 
 
 static int	siba_cc_attach(device_t);
 static int	siba_cc_probe(device_t);

Copied: stable/8/sys/dev/siba/siba_core.c (from r203319, head/sys/dev/siba/siba_core.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/dev/siba/siba_core.c	Tue Apr 20 21:29:53 2010	(r206928, copy of r203319, head/sys/dev/siba/siba_core.c)
@@ -0,0 +1,2007 @@
+/*-
+ * Copyright (c) 2009-2010 Weongyo Jeong 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ *    redistribution must be conditioned upon including a substantially
+ *    similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * the Sonics Silicon Backplane driver.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#ifdef SIBA_DEBUG
+enum {
+	SIBA_DEBUG_SCAN		= 0x00000001,	/* scan */
+	SIBA_DEBUG_PMU		= 0x00000002,	/* PMU */
+	SIBA_DEBUG_PLL		= 0x00000004,	/* PLL */
+	SIBA_DEBUG_SWITCHCORE	= 0x00000008,	/* switching core */
+	SIBA_DEBUG_SPROM	= 0x00000010,	/* SPROM */
+	SIBA_DEBUG_CORE		= 0x00000020,	/* handling cores */
+	SIBA_DEBUG_ANY		= 0xffffffff
+};
+#define DPRINTF(siba, m, fmt, ...) do {			\
+	if (siba->siba_debug & (m))			\
+		printf(fmt, __VA_ARGS__);		\
+} while (0)
+#else
+#define DPRINTF(siba, m, fmt, ...) do { (void) siba; } while (0)
+#endif
+#define	N(a)			(sizeof(a) / sizeof(a[0]))
+
+static void	siba_pci_gpio(struct siba_softc *, uint32_t, int);
+static void	siba_scan(struct siba_softc *);
+static int	siba_switchcore(struct siba_softc *, uint8_t);
+static int	siba_pci_switchcore_sub(struct siba_softc *, uint8_t);
+static uint32_t	siba_scan_read_4(struct siba_softc *, uint8_t, uint16_t);
+static uint16_t	siba_dev2chipid(struct siba_softc *);
+static uint16_t	siba_pci_read_2(struct siba_dev_softc *, uint16_t);
+static uint32_t	siba_pci_read_4(struct siba_dev_softc *, uint16_t);
+static void	siba_pci_write_2(struct siba_dev_softc *, uint16_t, uint16_t);
+static void	siba_pci_write_4(struct siba_dev_softc *, uint16_t, uint32_t);
+static void	siba_cc_clock(struct siba_cc *,
+		    enum siba_clock);
+static void	siba_cc_pmu_init(struct siba_cc *);
+static void	siba_cc_power_init(struct siba_cc *);
+static void	siba_cc_powerup_delay(struct siba_cc *);
+static int	siba_cc_clockfreq(struct siba_cc *, int);
+static void	siba_cc_pmu1_pll0_init(struct siba_cc *, uint32_t);
+static void	siba_cc_pmu0_pll0_init(struct siba_cc *, uint32_t);
+static enum siba_clksrc siba_cc_clksrc(struct siba_cc *);
+static const struct siba_cc_pmu1_plltab *siba_cc_pmu1_plltab_find(uint32_t);
+static uint32_t	siba_cc_pll_read(struct siba_cc *, uint32_t);
+static void	siba_cc_pll_write(struct siba_cc *, uint32_t,
+		    uint32_t);
+static const struct siba_cc_pmu0_plltab *
+		siba_cc_pmu0_plltab_findentry(uint32_t);
+static int	siba_pci_sprom(struct siba_softc *, struct siba_sprom *);
+static int	siba_sprom_read(struct siba_softc *, uint16_t *, uint16_t);
+static int	sprom_check_crc(const uint16_t *, size_t);
+static uint8_t	siba_crc8(uint8_t, uint8_t);
+static void	siba_sprom_r123(struct siba_sprom *, const uint16_t *);
+static void	siba_sprom_r45(struct siba_sprom *, const uint16_t *);
+static void	siba_sprom_r8(struct siba_sprom *, const uint16_t *);
+static int8_t	siba_sprom_r123_antgain(uint8_t, const uint16_t *, uint16_t,
+		    uint16_t);
+static uint32_t	siba_tmslow_reject_bitmask(struct siba_dev_softc *);
+static uint32_t	siba_pcicore_read_4(struct siba_pci *, uint16_t);
+static void	siba_pcicore_write_4(struct siba_pci *, uint16_t, uint32_t);
+static uint32_t	siba_pcie_read(struct siba_pci *, uint32_t);
+static void	siba_pcie_write(struct siba_pci *, uint32_t, uint32_t);
+static void	siba_pcie_mdio_write(struct siba_pci *, uint8_t, uint8_t,
+		    uint16_t);
+static void	siba_pci_read_multi_1(struct siba_dev_softc *, void *, size_t,
+		    uint16_t);
+static void	siba_pci_read_multi_2(struct siba_dev_softc *, void *, size_t,
+		    uint16_t);
+static void	siba_pci_read_multi_4(struct siba_dev_softc *, void *, size_t,
+		    uint16_t);
+static void	siba_pci_write_multi_1(struct siba_dev_softc *, const void *,
+		    size_t, uint16_t);
+static void	siba_pci_write_multi_2(struct siba_dev_softc *, const void *,
+		    size_t, uint16_t);
+static void	siba_pci_write_multi_4(struct siba_dev_softc *, const void *,
+		    size_t, uint16_t);
+static const char *siba_core_name(uint16_t);
+static void	siba_pcicore_init(struct siba_pci *);
+device_t	siba_add_child(device_t, struct siba_softc *, int, const char *,
+		    int);
+int		siba_core_attach(struct siba_softc *);
+int		siba_core_detach(struct siba_softc *);
+int		siba_core_suspend(struct siba_softc *);
+int		siba_core_resume(struct siba_softc *);
+uint8_t		siba_getncores(device_t, uint16_t);
+
+static const struct siba_bus_ops siba_pci_ops = {
+	.read_2		= siba_pci_read_2,
+	.read_4		= siba_pci_read_4,
+	.write_2	= siba_pci_write_2,
+	.write_4	= siba_pci_write_4,
+	.read_multi_1	= siba_pci_read_multi_1,
+	.read_multi_2	= siba_pci_read_multi_2,
+	.read_multi_4	= siba_pci_read_multi_4,
+	.write_multi_1	= siba_pci_write_multi_1,
+	.write_multi_2	= siba_pci_write_multi_2,
+	.write_multi_4	= siba_pci_write_multi_4,
+};
+
+static const struct siba_cc_pmu_res_updown siba_cc_pmu_4325_updown[] =
+    SIBA_CC_PMU_4325_RES_UPDOWN;
+static const struct siba_cc_pmu_res_depend siba_cc_pmu_4325_depend[] =
+    SIBA_CC_PMU_4325_RES_DEPEND;
+static const struct siba_cc_pmu_res_updown siba_cc_pmu_4328_updown[] =
+    SIBA_CC_PMU_4328_RES_UPDOWN;
+static const struct siba_cc_pmu_res_depend siba_cc_pmu_4328_depend[] =
+    SIBA_CC_PMU_4328_RES_DEPEND;
+static const struct siba_cc_pmu0_plltab siba_cc_pmu0_plltab[] =
+    SIBA_CC_PMU0_PLLTAB_ENTRY;
+static const struct siba_cc_pmu1_plltab siba_cc_pmu1_plltab[] =
+    SIBA_CC_PMU1_PLLTAB_ENTRY;
+
+int
+siba_core_attach(struct siba_softc *siba)
+{
+	struct siba_cc *scc;
+	int error;
+
+	KASSERT(siba->siba_type == SIBA_TYPE_PCI,
+	    ("unsupported BUS type (%#x)", siba->siba_type));
+
+	siba->siba_ops = &siba_pci_ops;
+
+	siba_pci_gpio(siba, SIBA_GPIO_CRYSTAL | SIBA_GPIO_PLL, 1);
+	siba_scan(siba);
+
+	/* XXX init PCI or PCMCIA host devices */
+
+	siba_powerup(siba, 0);
+
+	/* init ChipCommon */
+	scc = &siba->siba_cc;
+	if (scc->scc_dev != NULL) {
+		siba_cc_pmu_init(scc);
+		siba_cc_power_init(scc);
+		siba_cc_clock(scc, SIBA_CLOCK_FAST);
+		siba_cc_powerup_delay(scc);
+	}
+
+	/* fetch various internal informations for PCI */
+	siba->siba_board_vendor = pci_read_config(siba->siba_dev,
+	    PCIR_SUBVEND_0, 2);
+	siba->siba_board_type = pci_read_config(siba->siba_dev, PCIR_SUBDEV_0,
+	    2);
+	siba->siba_board_rev = pci_read_config(siba->siba_dev, PCIR_REVID, 2);
+	error = siba_pci_sprom(siba, &siba->siba_sprom);
+	if (error) {
+		siba_powerdown(siba);
+		return (error);
+	}
+
+	siba_powerdown(siba);
+	return (0);
+}
+
+int
+siba_core_detach(struct siba_softc *siba)
+{
+	device_t *devlistp;
+	int devcnt, error = 0, i;
+
+	error = device_get_children(siba->siba_dev, &devlistp, &devcnt);
+	if (error != 0)
+		return (0);
+
+	for ( i = 0 ; i < devcnt ; i++)
+		device_delete_child(siba->siba_dev, devlistp[i]);
+	free(devlistp, M_TEMP);
+	return (0);
+}
+
+static void
+siba_pci_gpio(struct siba_softc *siba, uint32_t what, int on)
+{
+	uint32_t in, out;
+	uint16_t status;
+
+	if (siba->siba_type != SIBA_TYPE_PCI)
+		return;
+
+	out = pci_read_config(siba->siba_dev, SIBA_GPIO_OUT, 4);
+	if (on == 0) {
+		if (what & SIBA_GPIO_PLL)
+			out |= SIBA_GPIO_PLL;
+		if (what & SIBA_GPIO_CRYSTAL)
+			out &= ~SIBA_GPIO_CRYSTAL;
+		pci_write_config(siba->siba_dev, SIBA_GPIO_OUT, out, 4);
+		pci_write_config(siba->siba_dev, SIBA_GPIO_OUT_EN,
+		    pci_read_config(siba->siba_dev,
+			SIBA_GPIO_OUT_EN, 4) | what, 4);
+		return;
+	}
+
+	in = pci_read_config(siba->siba_dev, SIBA_GPIO_IN, 4);
+	if ((in & SIBA_GPIO_CRYSTAL) != SIBA_GPIO_CRYSTAL) {
+		if (what & SIBA_GPIO_CRYSTAL) {
+			out |= SIBA_GPIO_CRYSTAL;
+			if (what & SIBA_GPIO_PLL)
+				out |= SIBA_GPIO_PLL;
+			pci_write_config(siba->siba_dev, SIBA_GPIO_OUT, out, 4);
+			pci_write_config(siba->siba_dev,
+			    SIBA_GPIO_OUT_EN, pci_read_config(siba->siba_dev,
+				SIBA_GPIO_OUT_EN, 4) | what, 4);
+			DELAY(1000);
+		}
+		if (what & SIBA_GPIO_PLL) {
+			out &= ~SIBA_GPIO_PLL;
+			pci_write_config(siba->siba_dev, SIBA_GPIO_OUT, out, 4);
+			DELAY(5000);
+		}
+	}
+
+	status = pci_read_config(siba->siba_dev, PCIR_STATUS, 2);
+	status &= ~PCIM_STATUS_STABORT;
+	pci_write_config(siba->siba_dev, PCIR_STATUS, status, 2);
+}
+
+static void
+siba_scan(struct siba_softc *siba)
+{
+	struct siba_dev_softc *sd;
+	uint32_t idhi, tmp;
+	int base, dev_i = 0, error, i, is_pcie, n_80211 = 0, n_cc = 0,
+	    n_pci = 0;
+
+	KASSERT(siba->siba_type == SIBA_TYPE_PCI,
+	    ("unsupported BUS type (%#x)", siba->siba_type));
+
+	siba->siba_ndevs = 0;
+	error = siba_switchcore(siba, 0); /* need the first core */
+	if (error)
+		return;
+
+	idhi = siba_scan_read_4(siba, 0, SIBA_IDHIGH);
+	if (SIBA_IDHIGH_CORECODE(idhi) == SIBA_DEVID_CHIPCOMMON) {
+		tmp = siba_scan_read_4(siba, 0, SIBA_CC_CHIPID);
+		siba->siba_chipid = SIBA_CC_ID(tmp);
+		siba->siba_chiprev = SIBA_CC_REV(tmp);
+		siba->siba_chippkg = SIBA_CC_PKG(tmp);
+		if (SIBA_IDHIGH_REV(idhi) >= 4)
+			siba->siba_ndevs = SIBA_CC_NCORES(tmp);
+		siba->siba_cc.scc_caps = siba_scan_read_4(siba, 0,
+		    SIBA_CC_CAPS);
+	} else {
+		if (siba->siba_type == SIBA_TYPE_PCI) {
+			siba->siba_chipid = siba_dev2chipid(siba);
+			siba->siba_chiprev = pci_read_config(siba->siba_dev,
+			    PCIR_REVID, 2);
+			siba->siba_chippkg = 0;
+		} else {
+			siba->siba_chipid = 0x4710;
+			siba->siba_chiprev = 0;
+			siba->siba_chippkg = 0;
+		}
+	}
+	if (siba->siba_ndevs == 0)
+		siba->siba_ndevs = siba_getncores(siba->siba_dev,
+		    siba->siba_chipid);
+	if (siba->siba_ndevs > SIBA_MAX_CORES) {
+		device_printf(siba->siba_dev,
+		    "too many siba cores (max %d %d)\n",
+		    SIBA_MAX_CORES, siba->siba_ndevs);
+		return;
+	}
+
+	/* looking basic information about each cores/devices */
+	for (i = 0; i < siba->siba_ndevs; i++) {
+		error = siba_switchcore(siba, i);
+		if (error)
+			return;
+		sd = &(siba->siba_devs[dev_i]);
+		idhi = siba_scan_read_4(siba, i, SIBA_IDHIGH);
+		sd->sd_bus = siba;
+		sd->sd_id.sd_device = SIBA_IDHIGH_CORECODE(idhi);
+		sd->sd_id.sd_rev = SIBA_IDHIGH_REV(idhi);
+		sd->sd_id.sd_vendor = SIBA_IDHIGH_VENDOR(idhi);
+		sd->sd_ops = siba->siba_ops;
+		sd->sd_coreidx = i;
+
+		DPRINTF(siba, SIBA_DEBUG_SCAN,
+		    "core %d (%s) found (cc %#xrev %#x vendor %#x)\n",
+		    i, siba_core_name(sd->sd_id.sd_device),
+		    sd->sd_id.sd_device, sd->sd_id.sd_rev, sd->sd_id.vendor);
+
+		switch (sd->sd_id.sd_device) {
+		case SIBA_DEVID_CHIPCOMMON:
+			n_cc++;
+			if (n_cc > 1) {
+				device_printf(siba->siba_dev,
+				    "warn: multiple ChipCommon\n");
+				break;
+			}
+			siba->siba_cc.scc_dev = sd;
+			break;
+		case SIBA_DEVID_80211:
+			n_80211++;
+			if (n_80211 > 1) {
+				device_printf(siba->siba_dev,
+				    "warn: multiple 802.11 core\n");
+				continue;
+			}
+			break;
+		case SIBA_DEVID_PCI:
+		case SIBA_DEVID_PCIE:
+			n_pci++;
+			error = pci_find_extcap(siba->siba_dev, PCIY_EXPRESS,
+			    &base);
+			is_pcie = (error == 0) ? 1 : 0;
+
+			if (n_pci > 1) {
+				device_printf(siba->siba_dev,
+				    "warn: multiple PCI(E) cores\n");
+				break;
+			}
+			if (sd->sd_id.sd_device == SIBA_DEVID_PCI &&
+			    is_pcie == 1)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:33: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 A24A41065674;
	Tue, 20 Apr 2010 21:33:14 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 912AC8FC14;
	Tue, 20 Apr 2010 21:33: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 o3KLXE0q050639;
	Tue, 20 Apr 2010 21:33:14 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLXEsM050637;
	Tue, 20 Apr 2010 21:33:14 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201004202133.o3KLXEsM050637@svn.freebsd.org>
From: Luigi Rizzo 
Date: Tue, 20 Apr 2010 21:33: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: r206929 - stable/8/sys/geom/sched
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, 20 Apr 2010 21:33:14 -0000

Author: luigi
Date: Tue Apr 20 21:33:14 2010
New Revision: 206929
URL: http://svn.freebsd.org/changeset/base/206929

Log:
  MFC r206551 (forgotten in previous commit): fix builds with ktr

Modified:
  stable/8/sys/geom/sched/g_sched.c
Directory Properties:
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/geom/sched/g_sched.c
==============================================================================
--- stable/8/sys/geom/sched/g_sched.c	Tue Apr 20 21:29:53 2010	(r206928)
+++ stable/8/sys/geom/sched/g_sched.c	Tue Apr 20 21:33:14 2010	(r206929)
@@ -754,13 +754,6 @@ g_gsched_modevent(module_t mod, int cmd,
 
 #ifdef KTR
 #define	TRC_BIO_EVENT(e, bp)	g_sched_trace_bio_ ## e (bp)
-static inline int
-g_sched_issuer_pid(struct bio *bp)
-{
-	struct thread *thread = g_sched_issuer(bp);
-
-	return (thread->td_tid);
-}
 
 static inline char
 g_sched_type(struct bio *bp)
@@ -777,7 +770,7 @@ static inline void
 g_sched_trace_bio_START(struct bio *bp)
 {
 
-	CTR5(KTR_GSCHED, "S %d %c %lu/%lu %lu", g_sched_issuer_pid(bp),
+	CTR5(KTR_GSCHED, "S %lu %c %lu/%lu %lu", g_sched_classify(bp),
 	    g_sched_type(bp), bp->bio_offset / ULONG_MAX,
 	    bp->bio_offset, bp->bio_length);
 }
@@ -786,13 +779,13 @@ static inline void
 g_sched_trace_bio_DONE(struct bio *bp)
 {
 
-	CTR5(KTR_GSCHED, "D %d %c %lu/%lu %lu", g_sched_issuer_pid(bp),
+	CTR5(KTR_GSCHED, "D %lu %c %lu/%lu %lu", g_sched_classify(bp),
 	    g_sched_type(bp), bp->bio_offset / ULONG_MAX,
 	    bp->bio_offset, bp->bio_length);
 }
-#else
+#else /* !KTR */
 #define	TRC_BIO_EVENT(e, bp)
-#endif
+#endif /* !KTR */
 
 /*
  * g_sched_done() and g_sched_start() dispatch the geom requests to

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:33: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 94FA01065670;
	Tue, 20 Apr 2010 21:33:23 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 70DAF8FC1E;
	Tue, 20 Apr 2010 21:33:23 +0000 (UTC)
Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14])
	by karen.lavabit.com (Postfix) with ESMTP id 2F62024ED91;
	Tue, 20 Apr 2010 16:05:17 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id T8RCU7GKKFZB;
	Tue, 20 Apr 2010 16:05:17 -0500
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <20100420202929.X40281@maildrop.int.zabbadoz.net>
Date: Tue, 20 Apr 2010 22:05:13 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <106EA284-739C-4431-B4B4-388F41C27B3D@FreeBSD.org>
References: <201004201703.o3KH3Uj5089736@svn.freebsd.org>
	<20100420202929.X40281@maildrop.int.zabbadoz.net>
To: "Bjoern A. Zeeb" 
X-Mailer: Apple Mail (2.1078)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r206901 - in head/sys: amd64/amd64
	cddl/dev/cyclic/i386 i386/i386 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, 20 Apr 2010 21:33:23 -0000


On 20 Apr 2010, at 21:30, Bjoern A. Zeeb wrote:

> On Tue, 20 Apr 2010, Rui Paulo wrote:
>=20
>> Author: rpaulo
>> Date: Tue Apr 20 17:03:30 2010
>> New Revision: 206901
>> URL: http://svn.freebsd.org/changeset/base/206901
>>=20
>> Log:
>> Rename the cyclic global variable lapic_cyclic_clock_func to just
>> cyclic_clock_func. This will make more sense when we start developing =
non
>> x86 cyclic version.
>=20
> I think this is the cause for LINT.386 failing with:
>=20
> 87 /scratch/tmp/bz/HEAD.svn/sys/x86/isa/clock.c: In function =
'clkintr':
> 88 /scratch/tmp/bz/HEAD.svn/sys/x86/isa/clock.c:189: error: =
'lapic_cyclic_clock_func' undeclared (first use in this function)
> 89 /scratch/tmp/bz/HEAD.svn/sys/x86/isa/clock.c:189: error: (Each =
undeclared identifier is reported only once
> 90 /scratch/tmp/bz/HEAD.svn/sys/x86/isa/clock.c:189: error: for each =
function it appears in.)

Fixed, thanks.

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:34: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 56F2C106566B;
	Tue, 20 Apr 2010 21:34:36 +0000 (UTC)
	(envelope-from cperciva@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 46B5C8FC14;
	Tue, 20 Apr 2010 21:34: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 o3KLYaQ4050997;
	Tue, 20 Apr 2010 21:34:36 GMT
	(envelope-from cperciva@svn.freebsd.org)
Received: (from cperciva@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLYaOp050994;
	Tue, 20 Apr 2010 21:34:36 GMT
	(envelope-from cperciva@svn.freebsd.org)
Message-Id: <201004202134.o3KLYaOp050994@svn.freebsd.org>
From: Colin Percival 
Date: Tue, 20 Apr 2010 21:34:36 +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: r206930 - 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: Tue, 20 Apr 2010 21:34:36 -0000

Author: cperciva
Date: Tue Apr 20 21:34:35 2010
New Revision: 206930
URL: http://svn.freebsd.org/changeset/base/206930

Log:
  Welcome Randi Harper (randi@) as a new src committer.  I will be her mentor.
  Randi comes to src via FreeBSD marketing, where she is sometimes known as
  "FreeBSDGirl".
  
  Randi is being punished for making the inexcusable mistake of volunteering
  to maintain sysinstall.
  
  Approved by:	core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==============================================================================
--- svnadmin/conf/access	Tue Apr 20 21:33:14 2010	(r206929)
+++ svnadmin/conf/access	Tue Apr 20 21:34:35 2010	(r206930)
@@ -178,6 +178,7 @@ ps
 qingli
 rafan
 raj
+randi
 rdivacky
 remko
 rik

Modified: svnadmin/conf/mentors
==============================================================================
--- svnadmin/conf/mentors	Tue Apr 20 21:33:14 2010	(r206929)
+++ svnadmin/conf/mentors	Tue Apr 20 21:34:35 2010	(r206930)
@@ -19,6 +19,7 @@ eri		mlaier		Co-mentor: thompsa
 gabor		delphij
 jinmei		gnn
 nork		imp
+randi		cperciva
 rdivacky	ed
 rstone		emaste		Co-mentor: jkoshy
 sbruno		scottl

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:35: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 BB619106564A;
	Tue, 20 Apr 2010 21:35:48 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AA4D68FC20;
	Tue, 20 Apr 2010 21:35: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 o3KLZmAU051308;
	Tue, 20 Apr 2010 21:35:48 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLZm2v051306;
	Tue, 20 Apr 2010 21:35:48 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202135.o3KLZm2v051306@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:35: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: r206931 - in stable/8/sys: dev/siba modules
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, 20 Apr 2010 21:35:48 -0000

Author: weongyo
Date: Tue Apr 20 21:35:48 2010
New Revision: 206931
URL: http://svn.freebsd.org/changeset/base/206931

Log:
  MFC r203320:
    Hook up the siba_bwn module to the build.

Modified:
  stable/8/sys/modules/Makefile
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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/modules/Makefile
==============================================================================
--- stable/8/sys/modules/Makefile	Tue Apr 20 21:34:35 2010	(r206930)
+++ stable/8/sys/modules/Makefile	Tue Apr 20 21:35:48 2010	(r206931)
@@ -248,6 +248,7 @@ SUBDIR=	${_3dfx} \
 	sdhci \
 	sem \
 	sf \
+	siba_bwn \
 	siis \
 	sis \
 	sk \

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:37:47 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 78659106564A;
	Tue, 20 Apr 2010 21:37:47 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 661018FC1C;
	Tue, 20 Apr 2010 21:37:47 +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 o3KLblKT051779;
	Tue, 20 Apr 2010 21:37:47 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLblpm051775;
	Tue, 20 Apr 2010 21:37:47 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202137.o3KLblpm051775@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:37: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: r206932 - stable/8/sys/dev/siba
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, 20 Apr 2010 21:37:47 -0000

Author: weongyo
Date: Tue Apr 20 21:37:47 2010
New Revision: 206932
URL: http://svn.freebsd.org/changeset/base/206932

Log:
  MFC r203944:
    supports SPROM rev8 informations properly which are used to support
    low-power PHY of bwn(4) and LDO voltage adjustments.

Modified:
  stable/8/sys/dev/siba/siba_core.c
  stable/8/sys/dev/siba/sibareg.h
  stable/8/sys/dev/siba/sibavar.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/siba/siba_core.c
==============================================================================
--- stable/8/sys/dev/siba/siba_core.c	Tue Apr 20 21:35:48 2010	(r206931)
+++ stable/8/sys/dev/siba/siba_core.c	Tue Apr 20 21:37:47 2010	(r206932)
@@ -1457,6 +1457,9 @@ siba_crc8(uint8_t crc, uint8_t data)
 	(((__x) & (__mask)) / SIBA_LOWEST_SET_BIT(__mask))
 #define	SIBA_SHIFTOUT(_var, _offset, _mask)				\
 	out->_var = SIBA_SHIFTOUT_SUB(in[SIBA_OFFSET(_offset)], (_mask))
+#define SIBA_SHIFTOUT_4(_var, _offset, _mask, _shift)			\
+	out->_var = ((((uint32_t)in[SIBA_OFFSET((_offset)+2)] << 16 |	\
+	    in[SIBA_OFFSET(_offset)]) & (_mask)) >> (_shift))
 
 static void
 siba_sprom_r123(struct siba_sprom *out, const uint16_t *in)
@@ -1511,6 +1514,7 @@ siba_sprom_r123(struct siba_sprom *out, 
 	SIBA_SHIFTOUT(gpio1, SIBA_SPROM1_GPIOA, SIBA_SPROM1_GPIOA_P1);
 	SIBA_SHIFTOUT(gpio2, SIBA_SPROM1_GPIOB, SIBA_SPROM1_GPIOB_P2);
 	SIBA_SHIFTOUT(gpio3, SIBA_SPROM1_GPIOB, SIBA_SPROM1_GPIOB_P3);
+
 	SIBA_SHIFTOUT(maxpwr_a, SIBA_SPROM1_MAXPWR, SIBA_SPROM1_MAXPWR_A);
 	SIBA_SHIFTOUT(maxpwr_bg, SIBA_SPROM1_MAXPWR, SIBA_SPROM1_MAXPWR_BG);
 	SIBA_SHIFTOUT(tssi_a, SIBA_SPROM1_TSSI, SIBA_SPROM1_TSSI_A);
@@ -1587,22 +1591,61 @@ siba_sprom_r8(struct siba_sprom *out, co
 	uint16_t v;
 
 	for (i = 0; i < 3; i++) {
-		v = in[SIBA_OFFSET(SIBA_SPROM1_MAC_80211BG) + i];
+		v = in[SIBA_OFFSET(SIBA_SPROM8_MAC_80211BG) + i];
 		*(((uint16_t *)out->mac_80211bg) + i) = htobe16(v);
 	}
 	SIBA_SHIFTOUT(ccode, SIBA_SPROM8_CCODE, 0xffff);
 	SIBA_SHIFTOUT(bf_lo, SIBA_SPROM8_BFLOW, 0xffff);
 	SIBA_SHIFTOUT(bf_hi, SIBA_SPROM8_BFHIGH, 0xffff);
+	SIBA_SHIFTOUT(bf2_lo, SIBA_SPROM8_BFL2LO, 0xffff);
+	SIBA_SHIFTOUT(bf2_hi, SIBA_SPROM8_BFL2HI, 0xffff);
 	SIBA_SHIFTOUT(ant_a, SIBA_SPROM8_ANTAVAIL, SIBA_SPROM8_ANTAVAIL_A);
 	SIBA_SHIFTOUT(ant_bg, SIBA_SPROM8_ANTAVAIL, SIBA_SPROM8_ANTAVAIL_BG);
 	SIBA_SHIFTOUT(maxpwr_bg, SIBA_SPROM8_MAXP_BG, SIBA_SPROM8_MAXP_BG_MASK);
 	SIBA_SHIFTOUT(tssi_bg, SIBA_SPROM8_MAXP_BG, SIBA_SPROM8_TSSI_BG);
 	SIBA_SHIFTOUT(maxpwr_a, SIBA_SPROM8_MAXP_A, SIBA_SPROM8_MAXP_A_MASK);
 	SIBA_SHIFTOUT(tssi_a, SIBA_SPROM8_MAXP_A, SIBA_SPROM8_TSSI_A);
+	SIBA_SHIFTOUT(maxpwr_ah, SIBA_SPROM8_MAXP_AHL,
+	    SIBA_SPROM8_MAXP_AH_MASK);
+	SIBA_SHIFTOUT(maxpwr_al, SIBA_SPROM8_MAXP_AHL,
+	    SIBA_SPROM8_MAXP_AL_MASK);
 	SIBA_SHIFTOUT(gpio0, SIBA_SPROM8_GPIOA, SIBA_SPROM8_GPIOA_P0);
 	SIBA_SHIFTOUT(gpio1, SIBA_SPROM8_GPIOA, SIBA_SPROM8_GPIOA_P1);
 	SIBA_SHIFTOUT(gpio2, SIBA_SPROM8_GPIOB, SIBA_SPROM8_GPIOB_P2);
 	SIBA_SHIFTOUT(gpio3, SIBA_SPROM8_GPIOB, SIBA_SPROM8_GPIOB_P3);
+	SIBA_SHIFTOUT(tri2g, SIBA_SPROM8_TRI25G, SIBA_SPROM8_TRI2G);
+	SIBA_SHIFTOUT(tri5g, SIBA_SPROM8_TRI25G, SIBA_SPROM8_TRI5G);
+	SIBA_SHIFTOUT(tri5gl, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GL);
+	SIBA_SHIFTOUT(tri5gh, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GH);
+	SIBA_SHIFTOUT(rxpo2g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO2G);
+	SIBA_SHIFTOUT(rxpo5g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO5G);
+	SIBA_SHIFTOUT(rssismf2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMF2G);
+	SIBA_SHIFTOUT(rssismc2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMC2G);
+	SIBA_SHIFTOUT(rssisav2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISAV2G);
+	SIBA_SHIFTOUT(bxa2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_BXA2G);
+	SIBA_SHIFTOUT(rssismf5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISMF5G);
+	SIBA_SHIFTOUT(rssismc5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISMC5G);
+	SIBA_SHIFTOUT(rssisav5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISAV5G);
+	SIBA_SHIFTOUT(bxa5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_BXA5G);
+
+	SIBA_SHIFTOUT(pa0b0, SIBA_SPROM8_PA0B0, 0xffff);
+	SIBA_SHIFTOUT(pa0b1, SIBA_SPROM8_PA0B1, 0xffff);
+	SIBA_SHIFTOUT(pa0b2, SIBA_SPROM8_PA0B2, 0xffff);
+	SIBA_SHIFTOUT(pa1b0, SIBA_SPROM8_PA1B0, 0xffff);
+	SIBA_SHIFTOUT(pa1b1, SIBA_SPROM8_PA1B1, 0xffff);
+	SIBA_SHIFTOUT(pa1b2, SIBA_SPROM8_PA1B2, 0xffff);
+	SIBA_SHIFTOUT(pa1lob0, SIBA_SPROM8_PA1LOB0, 0xffff);
+	SIBA_SHIFTOUT(pa1lob1, SIBA_SPROM8_PA1LOB1, 0xffff);
+	SIBA_SHIFTOUT(pa1lob2, SIBA_SPROM8_PA1LOB2, 0xffff);
+	SIBA_SHIFTOUT(pa1hib0, SIBA_SPROM8_PA1HIB0, 0xffff);
+	SIBA_SHIFTOUT(pa1hib1, SIBA_SPROM8_PA1HIB1, 0xffff);
+	SIBA_SHIFTOUT(pa1hib2, SIBA_SPROM8_PA1HIB2, 0xffff);
+	SIBA_SHIFTOUT(cck2gpo, SIBA_SPROM8_CCK2GPO, 0xffff);
+
+	SIBA_SHIFTOUT_4(ofdm2gpo, SIBA_SPROM8_OFDM2GPO, 0xffffffff, 0);
+	SIBA_SHIFTOUT_4(ofdm5glpo, SIBA_SPROM8_OFDM5GLPO, 0xffffffff, 0);
+	SIBA_SHIFTOUT_4(ofdm5gpo, SIBA_SPROM8_OFDM5GPO, 0xffffffff, 0);
+	SIBA_SHIFTOUT_4(ofdm5ghpo, SIBA_SPROM8_OFDM5GHPO, 0xffffffff, 0);
 
 	/* antenna gain */
 	SIBA_SHIFTOUT(again.ghz24.a0, SIBA_SPROM8_AGAIN01, SIBA_SPROM8_AGAIN0);
@@ -2005,3 +2048,79 @@ siba_core_resume(struct siba_softc *siba
 
 	return (0);
 }
+
+static void
+siba_cc_regctl_setmask(struct siba_cc *cc, uint32_t offset, uint32_t mask,
+    uint32_t set)
+{
+
+	SIBA_CC_READ32(cc, SIBA_CC_REGCTL_ADDR);
+	SIBA_CC_WRITE32(cc, SIBA_CC_REGCTL_ADDR, offset);
+	SIBA_CC_READ32(cc, SIBA_CC_REGCTL_ADDR);
+	SIBA_CC_WRITE32(cc, SIBA_CC_REGCTL_DATA,
+	    (SIBA_CC_READ32(cc, SIBA_CC_REGCTL_DATA) & mask) | set);
+	SIBA_CC_READ32(cc, SIBA_CC_REGCTL_DATA);
+}
+
+void
+siba_cc_pmu_set_ldovolt(struct siba_cc *scc, int id, uint32_t volt)
+{
+	struct siba_softc *siba = scc->scc_dev->sd_bus;
+	uint32_t *p = NULL, info[5][3] = {
+		{ 2, 25,  0xf },
+		{ 3,  1,  0xf },
+		{ 3,  9,  0xf },
+		{ 3, 17, 0x3f },
+		{ 0, 21, 0x3f }
+	};
+
+	if (siba->siba_chipid == 0x4312) {
+		if (id != SIBA_LDO_PAREF)
+			return;
+		p = info[4];
+		siba_cc_regctl_setmask(scc, p[0], ~(p[2] << p[1]),
+		    (volt & p[2]) << p[1]);
+		return;
+	}
+	if (siba->siba_chipid == 0x4328 || siba->siba_chipid == 0x5354) {
+		switch (id) {
+		case SIBA_LDO_PAREF:
+			p = info[3];
+			break;
+		case SIBA_LDO_VOLT1:
+			p = info[0];
+			break;
+		case SIBA_LDO_VOLT2:
+			p = info[1];
+			break;
+		case SIBA_LDO_VOLT3:
+			p = info[2];
+			break;
+		default:
+			KASSERT(0 == 1,
+			    ("%s: unsupported voltage ID %#x", __func__, id));
+			return;
+		}
+		siba_cc_regctl_setmask(scc, p[0], ~(p[2] << p[1]),
+		    (volt & p[2]) << p[1]);
+	}
+}
+
+void
+siba_cc_pmu_set_ldoparef(struct siba_cc *scc, uint8_t on)
+{
+	struct siba_softc *siba = scc->scc_dev->sd_bus;
+	int ldo;
+
+	ldo = ((siba->siba_chipid == 0x4312) ? SIBA_CC_PMU_4312_PA_REF :
+	    ((siba->siba_chipid == 0x4328) ? SIBA_CC_PMU_4328_PA_REF :
+	    ((siba->siba_chipid == 0x5354) ? SIBA_CC_PMU_5354_PA_REF : -1)));
+	if (ldo == -1)
+		return;
+
+	if (on)
+		SIBA_CC_SET32(scc, SIBA_CC_PMU_MINRES, 1 << ldo);
+	else
+		SIBA_CC_MASK32(scc, SIBA_CC_PMU_MINRES, ~(1 << ldo));
+	SIBA_CC_READ32(scc, SIBA_CC_PMU_MINRES);
+}

Modified: stable/8/sys/dev/siba/sibareg.h
==============================================================================
--- stable/8/sys/dev/siba/sibareg.h	Tue Apr 20 21:35:48 2010	(r206931)
+++ stable/8/sys/dev/siba/sibareg.h	Tue Apr 20 21:37:47 2010	(r206932)
@@ -32,7 +32,7 @@
  */
 
 #ifndef _SIBA_SIBAREG_H_
-#define _SIBA_SIBAREG_H_
+#define	_SIBA_SIBAREG_H_
 
 #define	PCI_DEVICE_ID_BCM4401		0x4401
 #define	PCI_DEVICE_ID_BCM4401B0		0x4402
@@ -92,6 +92,8 @@
 #define	SIBA_CC_PMU_TABSEL		0x0620
 #define	SIBA_CC_PMU_DEPMSK		0x0624
 #define	SIBA_CC_PMU_UPDNTM		0x0628
+#define	SIBA_CC_REGCTL_ADDR		0x0658
+#define	SIBA_CC_REGCTL_DATA		0x065c
 #define	SIBA_CC_PLLCTL_ADDR		0x0660
 #define	SIBA_CC_PLLCTL_DATA		0x0664
 
@@ -148,6 +150,7 @@
 	{ 38400, 13, 45, 873813, }, { 40000, 14, 45, 0,      },		\
 }
 
+#define	SIBA_CC_PMU_4312_PA_REF		2
 #define	SIBA_CC_PMU_4325_BURST		1
 #define	SIBA_CC_PMU_4325_CLBURST	3
 #define	SIBA_CC_PMU_4325_LN		10
@@ -178,6 +181,7 @@
 #define	SIBA_CC_PMU_4328_BB_PLL_FILTBYP	17
 #define	SIBA_CC_PMU_4328_RF_PLL_FILTBYP	18
 #define	SIBA_CC_PMU_4328_BB_PLL_PU	19
+#define	SIBA_CC_PMU_5354_PA_REF		8
 #define	SIBA_CC_PMU_5354_BB_PLL_PU	19
 
 #define	SIBA_CC_PMU_4325_RES_UPDOWN					\
@@ -237,9 +241,9 @@
 
 #define	SIBA_REGWIN(x)							\
 	(SIBA_ENUM_START + ((x) * SIBA_CORE_LEN))
-#define SIBA_CORE_LEN		0x00001000	/* Size of cfg per core */
-#define SIBA_CFG_END		0x00010000	/* Upper bound of cfg space */
-#define SIBA_MAX_CORES		(SIBA_CFG_END/SIBA_CORE_LEN)	/* #max cores */
+#define	SIBA_CORE_LEN		0x00001000	/* Size of cfg per core */
+#define	SIBA_CFG_END		0x00010000	/* Upper bound of cfg space */
+#define	SIBA_MAX_CORES		(SIBA_CFG_END/SIBA_CORE_LEN)	/* #max cores */
 #define	SIBA_ENUM_START			0x18000000U
 #define	SIBA_ENUM_END			0x18010000U
 
@@ -372,6 +376,9 @@
 #define	SIBA_SPROM5_GPIOB_P3		0xff00
 #define	SIBA_SPROM8_BFLOW		0x1084
 #define	SIBA_SPROM8_BFHIGH		0x1086
+#define	SIBA_SPROM8_BFL2LO		0x1088
+#define	SIBA_SPROM8_BFL2HI		0x108a
+#define	SIBA_SPROM8_MAC_80211BG		0x108c
 #define	SIBA_SPROM8_CCODE		0x1092
 #define	SIBA_SPROM8_ANTAVAIL		0x109c
 #define	SIBA_SPROM8_ANTAVAIL_A		0xff00
@@ -379,21 +386,60 @@
 #define	SIBA_SPROM8_AGAIN01		0x109e
 #define	SIBA_SPROM8_AGAIN0		0x00ff
 #define	SIBA_SPROM8_AGAIN1		0xff00
-#define	SIBA_SPROM8_AGAIN23		0x10a0
-#define	SIBA_SPROM8_AGAIN2		0x00ff
-#define	SIBA_SPROM8_AGAIN3		0xff00
 #define	SIBA_SPROM8_GPIOA		0x1096
 #define	SIBA_SPROM8_GPIOA_P0		0x00ff
 #define	SIBA_SPROM8_GPIOA_P1		0xff00
 #define	SIBA_SPROM8_GPIOB		0x1098
 #define	SIBA_SPROM8_GPIOB_P2		0x00ff
 #define	SIBA_SPROM8_GPIOB_P3		0xff00
+#define	SIBA_SPROM8_AGAIN23		0x10a0
+#define	SIBA_SPROM8_AGAIN2		0x00ff
+#define	SIBA_SPROM8_AGAIN3		0xff00
+#define	SIBA_SPROM8_RSSIPARM2G		0x10a4
+#define	SIBA_SPROM8_RSSISMF2G		0x000f
+#define	SIBA_SPROM8_RSSISMC2G		0x00f0
+#define	SIBA_SPROM8_RSSISAV2G		0x0700	/* BITMASK */
+#define	SIBA_SPROM8_BXA2G		0x1800	/* BITMASK */
+#define	SIBA_SPROM8_RSSIPARM5G		0x10a6
+#define	SIBA_SPROM8_RSSISMF5G		0x000f
+#define	SIBA_SPROM8_RSSISMC5G		0x00f0
+#define	SIBA_SPROM8_RSSISAV5G		0x0700	/* BITMASK */
+#define	SIBA_SPROM8_BXA5G		0x1800	/* BITMASK */
+#define	SIBA_SPROM8_TRI25G		0x10a8
+#define	SIBA_SPROM8_TRI2G		0x00ff
+#define	SIBA_SPROM8_TRI5G		0xff00
+#define	SIBA_SPROM8_TRI5GHL		0x10aa
+#define	SIBA_SPROM8_TRI5GL		0x00ff
+#define	SIBA_SPROM8_TRI5GH		0xff00
+#define	SIBA_SPROM8_RXPO		0x10ac
+#define	SIBA_SPROM8_RXPO2G		0x00ff
+#define	SIBA_SPROM8_RXPO5G		0xff00
 #define	SIBA_SPROM8_MAXP_BG		0x10c0
 #define	SIBA_SPROM8_MAXP_BG_MASK	0x00ff
 #define	SIBA_SPROM8_TSSI_BG		0xff00
+#define	SIBA_SPROM8_PA0B0		0x10c2
+#define	SIBA_SPROM8_PA0B1		0x10c4
+#define	SIBA_SPROM8_PA0B2		0x10c6
 #define	SIBA_SPROM8_MAXP_A		0x10c8
 #define	SIBA_SPROM8_MAXP_A_MASK		0x00ff
 #define	SIBA_SPROM8_TSSI_A		0xff00
+#define	SIBA_SPROM8_MAXP_AHL		0x10ca
+#define	SIBA_SPROM8_MAXP_AH_MASK	0x00ff
+#define	SIBA_SPROM8_MAXP_AL_MASK	0xff00
+#define	SIBA_SPROM8_PA1B0		0x10cc
+#define	SIBA_SPROM8_PA1B1		0x10ce
+#define	SIBA_SPROM8_PA1B2		0x10d0
+#define	SIBA_SPROM8_PA1LOB0		0x10d2
+#define	SIBA_SPROM8_PA1LOB1		0x10d4
+#define	SIBA_SPROM8_PA1LOB2		0x10d6
+#define	SIBA_SPROM8_PA1HIB0		0x10d8
+#define	SIBA_SPROM8_PA1HIB1		0x10da
+#define	SIBA_SPROM8_PA1HIB2		0x10dc
+#define	SIBA_SPROM8_CCK2GPO		0x1140
+#define	SIBA_SPROM8_OFDM2GPO		0x1142
+#define	SIBA_SPROM8_OFDM5GPO		0x1146
+#define	SIBA_SPROM8_OFDM5GLPO		0x114a
+#define	SIBA_SPROM8_OFDM5GHPO		0x114e
 
 #define	SIBA_BOARDVENDOR_DELL		0x1028
 #define	SIBA_BOARDVENDOR_BCM		0x14e4
@@ -413,4 +459,6 @@
 #define	SIBA_PCICORE_SBTOPCI_BURST	0x00000008
 #define	SIBA_PCICORE_SBTOPCI_MRM	0x00000020
 
+#define	SIBA_CHIPPACK_BCM4712S     1       /* Small 200pin 4712 */
+
 #endif /* _SIBA_SIBAREG_H_ */

Modified: stable/8/sys/dev/siba/sibavar.h
==============================================================================
--- stable/8/sys/dev/siba/sibavar.h	Tue Apr 20 21:35:48 2010	(r206931)
+++ stable/8/sys/dev/siba/sibavar.h	Tue Apr 20 21:37:47 2010	(r206932)
@@ -214,16 +214,46 @@ struct siba_sprom {
 	uint16_t		pa1b0;
 	uint16_t		pa1b1;
 	uint16_t		pa1b2;
+	uint16_t		pa1lob0;
+	uint16_t		pa1lob1;
+	uint16_t		pa1lob2;
+	uint16_t		pa1hib0;
+	uint16_t		pa1hib1;
+	uint16_t		pa1hib2;
 	uint8_t			gpio0;
 	uint8_t			gpio1;
 	uint8_t			gpio2;
 	uint8_t			gpio3;
+	uint16_t		maxpwr_al;
 	uint16_t		maxpwr_a;	/* A-PHY Max Power */
+	uint16_t		maxpwr_ah;
 	uint16_t		maxpwr_bg;	/* BG-PHY Max Power */
+	uint8_t			rxpo2g;
+	uint8_t			rxpo5g;
 	uint8_t			tssi_a;		/* Idle TSSI */
 	uint8_t			tssi_bg;	/* Idle TSSI */
+	uint8_t			tri2g;
+	uint8_t			tri5gl;
+	uint8_t			tri5g;
+	uint8_t			tri5gh;
+	uint8_t			rssisav2g;
+	uint8_t			rssismc2g;
+	uint8_t			rssismf2g;
+	uint8_t			bxa2g;
+	uint8_t			rssisav5g;
+	uint8_t			rssismc5g;
+	uint8_t			rssismf5g;
+	uint8_t			bxa5g;
+	uint16_t		cck2gpo;
+	uint32_t		ofdm2gpo;
+	uint32_t		ofdm5glpo;
+	uint32_t		ofdm5gpo;
+	uint32_t		ofdm5ghpo;
 	uint16_t		bf_lo;		/* boardflags */
 	uint16_t		bf_hi;		/* boardflags */
+	uint16_t		bf2_lo;
+	uint16_t		bf2_hi;
+
 	struct {
 		struct {
 			int8_t a0, a1, a2, a3;
@@ -234,6 +264,11 @@ struct siba_sprom {
 	} again;	/* antenna gain */
 };
 
+#define	SIBA_LDO_PAREF			0
+#define	SIBA_LDO_VOLT1			1
+#define	SIBA_LDO_VOLT2			2
+#define	SIBA_LDO_VOLT3			3
+
 struct siba_cc_pmu {
 	uint8_t				rev;	/* PMU rev */
 	uint32_t			freq;	/* crystal freq in kHz */
@@ -367,5 +402,7 @@ void		siba_write_multi_2(struct siba_dev
 void		siba_write_multi_4(struct siba_dev_softc *, const void *,
 		    size_t, uint16_t);
 void		siba_barrier(struct siba_dev_softc *, int);
+void		siba_cc_pmu_set_ldovolt(struct siba_cc *, int, uint32_t);
+void		siba_cc_pmu_set_ldoparef(struct siba_cc *, uint8_t);
 
 #endif /* _SIBA_SIBAVAR_H_ */

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:40: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 4EF3A1065670;
	Tue, 20 Apr 2010 21:40:12 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D7F08FC0A;
	Tue, 20 Apr 2010 21:40: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 o3KLeChi052370;
	Tue, 20 Apr 2010 21:40:12 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLeCfC052369;
	Tue, 20 Apr 2010 21:40:12 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202140.o3KLeCfC052369@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:40:12 +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: r206933 - in stable/8/sys: dev/bwn dev/siba modules/bwn
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, 20 Apr 2010 21:40:12 -0000

Author: weongyo
Date: Tue Apr 20 21:40:09 2010
New Revision: 206933
URL: http://svn.freebsd.org/changeset/base/206933

Log:
  MFC r203945:
    adds bwn(4) driver for supporting Broadcom BCM43xx chipsets.
  
      o uses v4 firmware instead of v3.  A port will be committed to
        create the bwn firmware module.
      o supports B/G and LP(low power) PHYs.
      o supports 32 / 64 bits DMA operations.
      o tested on big / little endian machines so should work on all
        architectures.
  
    It'd not connected to the build until the firmware port is committed.

Added:
  stable/8/sys/dev/bwn/
     - copied from r203945, head/sys/dev/bwn/
  stable/8/sys/modules/bwn/
     - copied from r203945, head/sys/modules/bwn/
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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:41: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 DFFCD106564A;
	Tue, 20 Apr 2010 21:41:43 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B563D8FC0A;
	Tue, 20 Apr 2010 21:41: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 o3KLfhkV052744;
	Tue, 20 Apr 2010 21:41:43 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLfhU4052742;
	Tue, 20 Apr 2010 21:41:43 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202141.o3KLfhU4052742@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:41:43 +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: r206934 - in stable/8/sys/dev: bwn siba
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, 20 Apr 2010 21:41:44 -0000

Author: weongyo
Date: Tue Apr 20 21:41:43 2010
New Revision: 206934
URL: http://svn.freebsd.org/changeset/base/206934

Log:
  MFC r204081:
    o print msgs with length if the frame is too short to pass to
      net80211.
    o print key index for debugging if the frame is attempted to decrypt
      for WEP, AES or TKIP though currently HW decryption isn't supported.

Modified:
  stable/8/sys/dev/bwn/if_bwn.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:40:09 2010	(r206933)
+++ stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:41:43 2010	(r206934)
@@ -9416,19 +9416,24 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 
 	padding = (macstat & BWN_RX_MAC_PADDING) ? 2 : 0;
 	if (m->m_pkthdr.len < (sizeof(struct bwn_plcp6) + padding)) {
-		device_printf(sc->sc_dev, "RX: Packet size underrun (1)\n");
+		device_printf(sc->sc_dev, "frame too short (length=%d)\n",
+		    m->m_pkthdr.len);
 		goto drop;
 	}
 	plcp = (struct bwn_plcp6 *)(mp + padding);
 	m_adj(m, sizeof(struct bwn_plcp6) + padding);
 	if (m->m_pkthdr.len < IEEE80211_MIN_LEN) {
-		device_printf(sc->sc_dev, "RX: Packet size underrun (2)\n");
+		device_printf(sc->sc_dev, "frame too short (length=%d)\n",
+		    m->m_pkthdr.len);
 		goto drop;
 	}
 	wh = mtod(m, struct ieee80211_frame_min *);
 
 	if (macstat & BWN_RX_MAC_DEC)
-		device_printf(sc->sc_dev, "TODO: BWN_RX_MAC_DEC\n");
+		device_printf(sc->sc_dev,
+		    "RX decryption attempted (old %d keyidx %#x)\n",
+		    BWN_ISOLDFMT(mac),
+		    (macstat & BWN_RX_MAC_KEYIDX) >> BWN_RX_MAC_KEYIDX_SHIFT);
 
 	/* XXX calculating RSSI & noise & antenna */
 

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:48: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 9B4B2106566B;
	Tue, 20 Apr 2010 21:48:48 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 898418FC17;
	Tue, 20 Apr 2010 21:48: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 o3KLmmYZ054382;
	Tue, 20 Apr 2010 21:48:48 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLmmaM054380;
	Tue, 20 Apr 2010 21:48:48 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202148.o3KLmmaM054380@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:48: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: r206935 - in stable/8/sys/dev: bwn siba
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, 20 Apr 2010 21:48:48 -0000

Author: weongyo
Date: Tue Apr 20 21:48:48 2010
New Revision: 206935
URL: http://svn.freebsd.org/changeset/base/206935

Log:
  MFC r204242:
    Fix compilation problems with INVARIANTS.
  
    # also limit RX decryption attempted messages to 50
  
    Reviewed by:  weongyo
  
  Approved by:	imp (implicit)

Modified:
  stable/8/sys/dev/bwn/if_bwn.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:41:43 2010	(r206934)
+++ stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:48:48 2010	(r206935)
@@ -1496,6 +1496,7 @@ bwn_pio_select(struct bwn_mac *mac, uint
 		return (&mac->mac_method.pio.wme[WME_AC_VO]);
 	}
 	KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__));
+	return (NULL);
 }
 
 static int
@@ -1905,10 +1906,9 @@ bwn_setup_channels(struct bwn_mac *mac, 
 static uint32_t
 bwn_shm_read_4(struct bwn_mac *mac, uint16_t way, uint16_t offset)
 {
-	struct bwn_softc *sc = mac->mac_sc;
 	uint32_t ret;
 
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	if (way == BWN_SHARED) {
 		KASSERT((offset & 0x0001) == 0,
@@ -1932,10 +1932,9 @@ out:
 static uint16_t
 bwn_shm_read_2(struct bwn_mac *mac, uint16_t way, uint16_t offset)
 {
-	struct bwn_softc *sc = mac->mac_sc;
 	uint16_t ret;
 
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	if (way == BWN_SHARED) {
 		KASSERT((offset & 0x0001) == 0,
@@ -1970,9 +1969,7 @@ static void
 bwn_shm_write_4(struct bwn_mac *mac, uint16_t way, uint16_t offset,
     uint32_t value)
 {
-	struct bwn_softc *sc = mac->mac_sc;
-
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	if (way == BWN_SHARED) {
 		KASSERT((offset & 0x0001) == 0,
@@ -1995,9 +1992,7 @@ static void
 bwn_shm_write_2(struct bwn_mac *mac, uint16_t way, uint16_t offset,
     uint16_t value)
 {
-	struct bwn_softc *sc = mac->mac_sc;
-
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	if (way == BWN_SHARED) {
 		KASSERT((offset & 0x0001) == 0,
@@ -3335,10 +3330,9 @@ bwn_core_start(struct bwn_mac *mac)
 static void
 bwn_core_exit(struct bwn_mac *mac)
 {
-	struct bwn_softc *sc = mac->mac_sc;
 	uint32_t macctl;
 
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	KASSERT(mac->mac_status <= BWN_MAC_STATUS_INITED,
 	    ("%s:%d: fail", __func__, __LINE__));
@@ -5198,6 +5192,8 @@ bwn_rf_init_bcm2050(struct bwn_mac *mac)
 		0x0e, 0x0f, 0x0d, 0x0f,
 	};
 
+	loctl = lomask = reg0 = classctl = crs0 = analogoverval = analogover =
+	    rfoverval = rfover = cck3 = 0;
 	radio0 = BWN_RF_READ(mac, 0x43);
 	radio1 = BWN_RF_READ(mac, 0x51);
 	radio2 = BWN_RF_READ(mac, 0x52);
@@ -5891,7 +5887,6 @@ static void
 bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
-	struct bwn_softc *sc = mac->mac_sc;
 	unsigned int i, max_loop;
 	uint16_t value;
 	uint32_t buffer[5] = {
@@ -5906,7 +5901,7 @@ bwn_dummy_transmission(struct bwn_mac *m
 		buffer[0] = 0x000b846e;
 	}
 
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	for (i = 0; i < 5; i++)
 		bwn_ram_write(mac, i * 4, buffer[i]);
@@ -5972,10 +5967,9 @@ bwn_ram_write(struct bwn_mac *mac, uint1
 static void
 bwn_lo_write(struct bwn_mac *mac, struct bwn_loctl *ctl)
 {
-	struct bwn_phy *phy = &mac->mac_phy;
 	uint16_t value;
 
-	KASSERT(phy->type == BWN_PHYTYPE_G,
+	KASSERT(mac->mac_phy->type == BWN_PHYTYPE_G,
 	    ("%s:%d: fail", __func__, __LINE__));
 
 	value = (uint8_t) (ctl->q);
@@ -6570,7 +6564,7 @@ bwn_lo_calibset(struct bwn_mac *mac,
 	struct bwn_phy_g *pg = &phy->phy_g;
 	struct bwn_loctl loctl = { 0, 0 };
 	struct bwn_lo_calib *cal;
-	struct bwn_lo_g_value sval;
+	struct bwn_lo_g_value sval = { 0 };
 	int rxgain;
 	uint16_t pad, reg, value;
 
@@ -8984,9 +8978,7 @@ bwn_noise_gensample(struct bwn_mac *mac)
 static int
 bwn_dma_freeslot(struct bwn_dma_ring *dr)
 {
-	struct bwn_mac *mac = dr->dr_mac;
-
-	BWN_ASSERT_LOCKED(mac->mac_sc);
+	BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc);
 
 	return (dr->dr_numslots - dr->dr_usedslot);
 }
@@ -8994,9 +8986,7 @@ bwn_dma_freeslot(struct bwn_dma_ring *dr
 static int
 bwn_dma_nextslot(struct bwn_dma_ring *dr, int slot)
 {
-	struct bwn_mac *mac = dr->dr_mac;
-
-	BWN_ASSERT_LOCKED(mac->mac_sc);
+	BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc);
 
 	KASSERT(slot >= -1 && slot <= dr->dr_numslots - 1,
 	    ("%s:%d: fail", __func__, __LINE__));
@@ -9393,9 +9383,10 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 	struct ifnet *ifp = sc->sc_ifp;
 	struct ieee80211com *ic = ifp->if_l2com;
 	uint32_t macstat;
-	int padding, rate, rssi, noise, type;
+	int padding, rate, rssi = 0, noise = 0, type;
 	uint16_t phytype, phystat0, phystat3, chanstat;
 	unsigned char *mp = mtod(m, unsigned char *);
+	static int rx_mac_dec_rpt = 0;
 
 	BWN_ASSERT_LOCKED(sc);
 
@@ -9429,7 +9420,7 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 	}
 	wh = mtod(m, struct ieee80211_frame_min *);
 
-	if (macstat & BWN_RX_MAC_DEC)
+	if (macstat & BWN_RX_MAC_DEC && rx_mac_dec_rpt++ < 50)
 		device_printf(sc->sc_dev,
 		    "RX decryption attempted (old %d keyidx %#x)\n",
 		    BWN_ISOLDFMT(mac),
@@ -10086,15 +10077,15 @@ bwn_dma_select(struct bwn_mac *mac, uint
 		return (mac->mac_method.dma.wme[WME_AC_BK]);
 	}
 	KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__));
+	return (NULL);
 }
 
 static int
 bwn_dma_getslot(struct bwn_dma_ring *dr)
 {
-	struct bwn_mac *mac = dr->dr_mac;
 	int slot;
 
-	BWN_ASSERT_LOCKED(mac->mac_sc);
+	BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc);
 
 	KASSERT(dr->dr_tx, ("%s:%d: fail", __func__, __LINE__));
 	KASSERT(!(dr->dr_stop), ("%s:%d: fail", __func__, __LINE__));
@@ -10579,6 +10570,7 @@ bwn_dma_parse_cookie(struct bwn_mac *mac
 		dr = dma->mcast;
 		break;
 	default:
+		dr = NULL;
 		KASSERT(0 == 1,
 		    ("invalid cookie value %d", cookie & 0xf000));
 	}
@@ -11677,6 +11669,7 @@ bwn_phy_lp_set_txpctlmode(struct bwn_mac
 		ctl = BWN_PHY_TX_PWR_CTL_CMD_MODE_SW;
 		break;
 	default:
+		ctl = 0;
 		KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__));
 	}
 	BWN_PHY_SETMASK(mac, BWN_PHY_TX_PWR_CTL_CMD,

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:51: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 837ED1065741;
	Tue, 20 Apr 2010 21:51:45 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 724598FC08;
	Tue, 20 Apr 2010 21:51: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 o3KLpjFh055096;
	Tue, 20 Apr 2010 21:51:45 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLpjpT055094;
	Tue, 20 Apr 2010 21:51:45 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202151.o3KLpjpT055094@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:51: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: r206937 - in stable/8/sys/dev: bwn siba
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, 20 Apr 2010 21:51:45 -0000

Author: weongyo
Date: Tue Apr 20 21:51:45 2010
New Revision: 206937
URL: http://svn.freebsd.org/changeset/base/206937

Log:
  MFC r204256:
    fixes a compile error; invalid type argument of '->'.

Modified:
  stable/8/sys/dev/bwn/if_bwn.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:51:28 2010	(r206936)
+++ stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:51:45 2010	(r206937)
@@ -5969,7 +5969,7 @@ bwn_lo_write(struct bwn_mac *mac, struct
 {
 	uint16_t value;
 
-	KASSERT(mac->mac_phy->type == BWN_PHYTYPE_G,
+	KASSERT(mac->mac_phy.type == BWN_PHYTYPE_G,
 	    ("%s:%d: fail", __func__, __LINE__));
 
 	value = (uint8_t) (ctl->q);

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:52: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 B67D910656A6;
	Tue, 20 Apr 2010 21:52:54 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A51C08FC15;
	Tue, 20 Apr 2010 21:52: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 o3KLqsXv055410;
	Tue, 20 Apr 2010 21:52:54 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLqsa4055407;
	Tue, 20 Apr 2010 21:52:54 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202152.o3KLqsa4055407@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:52: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: r206938 - in stable/8/sys/dev: bwn siba
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, 20 Apr 2010 21:52:54 -0000

Author: weongyo
Date: Tue Apr 20 21:52:54 2010
New Revision: 206938
URL: http://svn.freebsd.org/changeset/base/206938

Log:
  MFC r204257:
    o adds sysctl variables to show device statistics.
    o records RTS success/fail statistics.
  
    Pointed by:   imp

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/bwn/if_bwnvar.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:51:45 2010	(r206937)
+++ stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:52:54 2010	(r206938)
@@ -536,6 +536,7 @@ static void	bwn_phy_lp_gaintbl_write_r2(
 		    struct bwn_txgain_entry);
 static void	bwn_phy_lp_gaintbl_write_r01(struct bwn_mac *, int,
 		    struct bwn_txgain_entry);
+static void	bwn_sysctl_node(struct bwn_softc *);
 
 static struct resource_spec bwn_res_spec_legacy[] = {
 	{ SYS_RES_IRQ,		0,		RF_ACTIVE | RF_SHAREABLE },
@@ -1066,9 +1067,6 @@ bwn_attach_post(struct bwn_softc *sc)
 	struct ifnet *ifp = sc->sc_ifp;
 	struct siba_dev_softc *sd = sc->sc_sd;
 	struct siba_sprom *sprom = &sd->sd_bus->siba_sprom;
-#ifdef BWN_DEBUG
-	device_t dev = sc->sc_dev;
-#endif
 
 	ic = ifp->if_l2com;
 	ic->ic_ifp = ifp;
@@ -1117,11 +1115,7 @@ bwn_attach_post(struct bwn_softc *sc)
 	    &sc->sc_rx_th.wr_ihdr, sizeof(sc->sc_rx_th),
 	    BWN_RX_RADIOTAP_PRESENT);
 
-#ifdef BWN_DEBUG
-	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
-	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
-	    "debug", CTLFLAG_RW, &sc->sc_debug, 0, "Debug flags");
-#endif
+	bwn_sysctl_node(sc);
 
 	if (bootverbose)
 		ieee80211_announce(ic);
@@ -9077,6 +9071,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
 	struct bwn_pio_txqueue *tq;
 	struct bwn_pio_txpkt *tp = NULL;
 	struct bwn_softc *sc = mac->mac_sc;
+	struct bwn_stats *stats = &mac->mac_stats;
 	struct ieee80211_node *ni;
 	int slot;
 
@@ -9088,9 +9083,9 @@ bwn_handle_txeof(struct bwn_mac *mac, co
 		device_printf(sc->sc_dev, "TODO: STATUS AMPDU\n");
 	if (status->rtscnt) {
 		if (status->rtscnt == 0xf)
-			device_printf(sc->sc_dev, "TODO: RTS fail\n");
+			stats->rtsfail++;
 		else
-			device_printf(sc->sc_dev, "TODO: RTS ok\n");
+			stats->rts++;
 	}
 
 	if (mac->mac_flags & BWN_MAC_FLAG_DMA) {
@@ -14286,6 +14281,36 @@ bwn_phy_lp_gaintbl_write_r01(struct bwn_
 }
 
 static void
+bwn_sysctl_node(struct bwn_softc *sc)
+{
+	device_t dev = sc->sc_dev;
+	struct bwn_mac *mac;
+	struct bwn_stats *stats;
+
+	/* XXX assume that count of MAC is only 1. */
+
+	if ((mac = sc->sc_curmac) == NULL)
+		return;
+	stats = &mac->mac_stats;
+
+	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+	    "linknoise", CTLFLAG_RW, &stats->rts, 0, "Noise level");
+	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+	    "rts", CTLFLAG_RW, &stats->rts, 0, "RTS");
+	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+	    "rtsfail", CTLFLAG_RW, &stats->rtsfail, 0, "RTS failed to send");
+
+#ifdef BWN_DEBUG
+	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+	    "debug", CTLFLAG_RW, &sc->sc_debug, 0, "Debug flags");
+#endif
+}
+
+static void
 bwn_identify(driver_t *driver, device_t parent)
 {
 

Modified: stable/8/sys/dev/bwn/if_bwnvar.h
==============================================================================
--- stable/8/sys/dev/bwn/if_bwnvar.h	Tue Apr 20 21:51:45 2010	(r206937)
+++ stable/8/sys/dev/bwn/if_bwnvar.h	Tue Apr 20 21:52:54 2010	(r206938)
@@ -515,6 +515,8 @@ struct bwn_tx_radiotap_header {
 };
 
 struct bwn_stats {
+	int32_t				rtsfail;
+	int32_t				rts;
 	int32_t				link_noise;
 };
 

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 21:55: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 8A7601065676;
	Tue, 20 Apr 2010 21:55:44 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 796138FC15;
	Tue, 20 Apr 2010 21:55: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 o3KLtiH9056098;
	Tue, 20 Apr 2010 21:55:44 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLtiGQ056096;
	Tue, 20 Apr 2010 21:55:44 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202155.o3KLtiGQ056096@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:55: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: r206939 - in stable/8/sys: dev/siba modules
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, 20 Apr 2010 21:55:44 -0000

Author: weongyo
Date: Tue Apr 20 21:55:44 2010
New Revision: 206939
URL: http://svn.freebsd.org/changeset/base/206939

Log:
  MFC r204326:
    Add bwn(4) driver to the build.

Modified:
  stable/8/sys/modules/Makefile
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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/modules/Makefile
==============================================================================
--- stable/8/sys/modules/Makefile	Tue Apr 20 21:52:54 2010	(r206938)
+++ stable/8/sys/modules/Makefile	Tue Apr 20 21:55:44 2010	(r206939)
@@ -41,6 +41,7 @@ SUBDIR=	${_3dfx} \
 	${_bktr} \
 	${_bm} \
 	bridgestp \
+	bwn \
 	cam \
 	${_canbepm} \
 	${_canbus} \

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 22:00: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 3EE1E106564A;
	Tue, 20 Apr 2010 22:00:57 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2CCF88FC08;
	Tue, 20 Apr 2010 22:00: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 o3KM0vLJ057321;
	Tue, 20 Apr 2010 22:00:57 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KM0v8g057318;
	Tue, 20 Apr 2010 22:00:57 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202200.o3KM0v8g057318@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 22:00:57 +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: r206940 - 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: Tue, 20 Apr 2010 22:00:57 -0000

Author: weongyo
Date: Tue Apr 20 22:00:56 2010
New Revision: 206940
URL: http://svn.freebsd.org/changeset/base/206940

Log:
  MFC r203945:
    adds bwn(4) driver man page which missed to be merged.
  
  MFC r204327:
    Connect bwn.4 to the build.

Added:
  stable/8/share/man/man4/bwn.4
     - copied unchanged from r203945, head/share/man/man4/bwn.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	Tue Apr 20 21:55:44 2010	(r206939)
+++ stable/8/share/man/man4/Makefile	Tue Apr 20 22:00:56 2010	(r206940)
@@ -58,6 +58,7 @@ MAN=	aac.4 \
 	bridge.4 \
 	bt.4 \
 	bwi.4 \
+	bwn.4 \
 	cardbus.4 \
 	carp.4 \
 	cas.4 \

Copied: stable/8/share/man/man4/bwn.4 (from r203945, head/share/man/man4/bwn.4)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/share/man/man4/bwn.4	Tue Apr 20 22:00:56 2010	(r206940, copy of r203945, head/share/man/man4/bwn.4)
@@ -0,0 +1,134 @@
+.\" Copyright (c) 2009 Christian Brueffer
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd February 15, 2010
+.Dt BWN 4
+.Os
+.Sh NAME
+.Nm bwn
+.Nd Broadcom BCM43xx IEEE 802.11b/g wireless network driver
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device siba_bwn"
+.Cd "device bwn"
+.Cd "device wlan"
+.Cd "device wlan_amrr"
+.Cd "device firmware"
+.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
+if_bwn_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for Broadcom BCM43xx based
+PCI/CardBus network adapters.
+.Pp
+It supports
+.Cm station
+and
+.Cm monitor
+mode operation.
+Only one virtual interface may be configured at any time.
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Pp
+This driver requires firmware to be loaded before it will work.
+The
+.Pa ports/net/bwn-firmware-kmod
+port needs to be installed before
+.Xr ifconfig 8
+will work.
+.Sh HARDWARE
+The
+.Nm
+driver supports Broadcom BCM43xx based wireless devices, including:
+.Pp
+.Bl -column -compact "Apple Airport Extreme" "BCM4306" "Mini PCI" "a/b/g" -offset 6n
+.It Em "Card	Chip	Bus	Standard"
+.It "Apple Airport Extreme	BCM4306	PCI	b/g"
+.It "Apple Airport Extreme	BCM4318	PCI	b/g"
+.It "ASUS WL-138g	BCM4318	PCI	b/g"
+.It "Buffalo WLI-CB-G54S	BCM4318	CardBus	b/g"
+.It "Buffalo WLI-PCI-G54S	BCM4306	PCI	b/g"
+.It "Compaq R4035 onboard	BCM4306	PCI	b/g"
+.It "Dell Wireless 1470	BCM4318	Mini PCI	b/g"
+.It "Dell Truemobile 1400	BCM4309	Mini PCI	b/g"
+.It "HP nx6125	BCM4319	PCI	b/g"
+.It "Linksys WPC54G Ver 3	BCM4318	CardBus	b/g"
+.It "Linksys WPC54GS Ver 2	BCM4318	CardBus	b/g"
+.It "TRENDnet TEW-401PCplus	BCM4306	CardBus	b/g"
+.It "US Robotics 5411	BCM4318	CardBus	b/g"
+.El
+.Sh EXAMPLES
+Join an existing BSS network (i.e., connect to an access point):
+.Pp
+.Bd -literal -offset indent
+ifconfig wlan create wlandev bwn0 inet 192.168.0.20 \e
+    netmask 0xffffff00
+.Ed
+.Pp
+Join a specific BSS network with network name
+.Dq Li my_net :
+.Pp
+.Dl "ifconfig wlan create wlandev bwn0 ssid my_net up"
+.Pp
+Join a specific BSS network with 64-bit WEP encryption:
+.Bd -literal -offset indent
+ifconfig wlan create wlandev bwn0 ssid my_net \e
+        wepmode on wepkey 0x1234567890 weptxkey 1 up
+.Ed
+.Sh SEE ALSO
+.Xr arp 4 ,
+.Xr cardbus 4 ,
+.Xr intro 4 ,
+.Xr pci 4 ,
+.Xr wlan 4 ,
+.Xr wlan_amrr 4 ,
+.Xr ifconfig 8 ,
+.Xr wpa_supplicant 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 8.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Weongyo Jeong
+.Aq weongyo@FreeBSD.org .
+.\".Sh BUGS
+.\"Some card based on the BCM4306 and BCM4309 chips do not work properly
+.\"on channel 1, 2 and 3.

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 22:20: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 82F0E106564A;
	Tue, 20 Apr 2010 22:20:32 +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 57DF58FC19;
	Tue, 20 Apr 2010 22:20: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 o3KMKW6a061711;
	Tue, 20 Apr 2010 22:20:32 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMKWBt061708;
	Tue, 20 Apr 2010 22:20:32 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004202220.o3KMKWBt061708@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 20 Apr 2010 22:20: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: r206942 - in stable/8: bin/sh
	tools/regression/bin/sh/parser
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, 20 Apr 2010 22:20:32 -0000

Author: jilles
Date: Tue Apr 20 22:20:31 2010
New Revision: 206942
URL: http://svn.freebsd.org/changeset/base/206942

Log:
  MFC r199282: sh: Allow a newline before "in" in a for command,
  as required by POSIX.

Added:
  stable/8/tools/regression/bin/sh/parser/for1.0
     - copied unchanged from r199282, head/tools/regression/bin/sh/parser/for1.0
Modified:
  stable/8/bin/sh/parser.c
Directory Properties:
  stable/8/bin/sh/   (props changed)
  stable/8/tools/regression/bin/sh/   (props changed)

Modified: stable/8/bin/sh/parser.c
==============================================================================
--- stable/8/bin/sh/parser.c	Tue Apr 20 22:15:41 2010	(r206941)
+++ stable/8/bin/sh/parser.c	Tue Apr 20 22:20:31 2010	(r206942)
@@ -365,7 +365,9 @@ TRACE(("expecting DO got %s %s\n", tokna
 		n1 = (union node *)stalloc(sizeof (struct nfor));
 		n1->type = NFOR;
 		n1->nfor.var = wordtext;
-		if (readtoken() == TWORD && ! quoteflag && equal(wordtext, "in")) {
+		while (readtoken() == TNL)
+			;
+		if (lasttoken == TWORD && ! quoteflag && equal(wordtext, "in")) {
 			app = ≈
 			while (readtoken() == TWORD) {
 				n2 = (union node *)stalloc(sizeof (struct narg));

Copied: stable/8/tools/regression/bin/sh/parser/for1.0 (from r199282, head/tools/regression/bin/sh/parser/for1.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/parser/for1.0	Tue Apr 20 22:20:31 2010	(r206942, copy of r199282, head/tools/regression/bin/sh/parser/for1.0)
@@ -0,0 +1,29 @@
+# $FreeBSD$
+
+nl='
+'
+list=' a b c'
+for s1 in "$nl" " "; do
+	for s2 in "$nl" ";"; do
+		for s3 in "$nl" " "; do
+			r=''
+			eval "for i${s1}in ${list}${s2}do${s3}r=\"\$r \$i\"; done"
+			[ "$r" = "$list" ] || exit 1
+		done
+	done
+done
+set -- $list
+for s2 in "$nl" " " ";"; do # s2=";" is an extension to POSIX
+	for s3 in "$nl" " "; do
+		r=''
+		eval "for i${s2}do${s3}r=\"\$r \$i\"; done"
+		[ "$r" = "$list" ] || exit 1
+	done
+done
+for s1 in "$nl" " "; do
+	for s2 in "$nl" ";"; do
+		for s3 in "$nl" " "; do
+			eval "for i${s1}in${s2}do${s3}exit 1; done"
+		done
+	done
+done

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 22:32: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 A1211106564A;
	Tue, 20 Apr 2010 22:32:34 +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 8FDBD8FC13;
	Tue, 20 Apr 2010 22:32: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 o3KMWYMB064380;
	Tue, 20 Apr 2010 22:32:34 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMWYso064377;
	Tue, 20 Apr 2010 22:32:34 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004202232.o3KMWYso064377@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 20 Apr 2010 22:32:34 +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: r206944 - stable/8/bin/sh
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, 20 Apr 2010 22:32:34 -0000

Author: jilles
Date: Tue Apr 20 22:32:34 2010
New Revision: 206944
URL: http://svn.freebsd.org/changeset/base/206944

Log:
  MFC r200943: sh: Remove setting variables from dotcmd/exportcmd.
  
  It is already done by evalcommand(), unless special-ness has been removed,
  in which case variable assignments should not persist. (These are currently
  always special builtins, but this may change later: command builtin,
  command substitution.)
  
  This also fixes a memory leak when calling . with variable assignments.
  
  Example:
    valgrind --leak-check=full sh -c 'x=1 . /dev/null; x=2'

Modified:
  stable/8/bin/sh/main.c
  stable/8/bin/sh/var.c
Directory Properties:
  stable/8/bin/sh/   (props changed)

Modified: stable/8/bin/sh/main.c
==============================================================================
--- stable/8/bin/sh/main.c	Tue Apr 20 22:24:35 2010	(r206943)
+++ stable/8/bin/sh/main.c	Tue Apr 20 22:32:34 2010	(r206944)
@@ -315,7 +315,6 @@ find_dot_file(char *basename)
 int
 dotcmd(int argc, char **argv)
 {
-	struct strlist *sp;
 	char *fullname;
 
 	if (argc < 2)
@@ -323,9 +322,6 @@ dotcmd(int argc, char **argv)
 
 	exitstatus = 0;
 
-	for (sp = cmdenviron; sp ; sp = sp->next)
-		setvareq(savestr(sp->text), VSTRFIXED|VTEXTFIXED);
-
 	fullname = find_dot_file(argv[1]);
 	setinputfile(fullname, 1);
 	commandname = fullname;

Modified: stable/8/bin/sh/var.c
==============================================================================
--- stable/8/bin/sh/var.c	Tue Apr 20 22:24:35 2010	(r206943)
+++ stable/8/bin/sh/var.c	Tue Apr 20 22:32:34 2010	(r206944)
@@ -604,7 +604,6 @@ exportcmd(int argc, char **argv)
 
 	if (values && argc != 0)
 		error("-p requires no arguments");
-	listsetvar(cmdenviron);
 	if (argc != 0) {
 		while ((name = *argv++) != NULL) {
 			if ((p = strchr(name, '=')) != NULL) {

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 22:43: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 DB22A106566C;
	Tue, 20 Apr 2010 22:43:53 +0000 (UTC)
	(envelope-from rstone@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CACDB8FC08;
	Tue, 20 Apr 2010 22:43: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 o3KMhrti066948;
	Tue, 20 Apr 2010 22:43:53 GMT (envelope-from rstone@svn.freebsd.org)
Received: (from rstone@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMhrkX066946;
	Tue, 20 Apr 2010 22:43:53 GMT (envelope-from rstone@svn.freebsd.org)
Message-Id: <201004202243.o3KMhrkX066946@svn.freebsd.org>
From: Ryan Stone 
Date: Tue, 20 Apr 2010 22:43: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: r206945 - 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: Tue, 20 Apr 2010 22:43:54 -0000

Author: rstone
Date: Tue Apr 20 22:43:53 2010
New Revision: 206945
URL: http://svn.freebsd.org/changeset/base/206945

Log:
  add new committer rstone to committers-src.dot

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==============================================================================
--- head/share/misc/committers-src.dot	Tue Apr 20 22:32:34 2010	(r206944)
+++ head/share/misc/committers-src.dot	Tue Apr 20 22:43:53 2010	(r206945)
@@ -170,6 +170,7 @@ roberto [label="Ollivier Robert\nroberto
 rpaulo [label="Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25"]
 rrs [label="Randall R Stewart\nrrs@FreeBSD.org\n2007/02/08"]
 rse [label="Ralf S. Engelschall\nrse@FreeBSD.org\n1997/07/31"]
+rstone [label="Ryan Stone\nrstone@FreeBSD.org\n2010/04/19"]
 ru [label="Ruslan Ermilov\nru@FreeBSD.org\n1999/05/27"]
 rwatson [label="Robert N. M. Watson\nrwatson@FreeBSD.org\n1999/12/16"]
 sam [label="Sam Leffler\nsam@FreeBSD.org\n2002/07/02"]
@@ -271,6 +272,8 @@ ed -> uqs
 eivind -> des
 eivind -> rwatson
 
+emaste -> rstone
+
 emax -> markus
 
 gallatin -> ticso
@@ -342,6 +345,7 @@ jkh -> yar
 
 jkoshy -> kaiw
 jkoshy -> fabient
+jkoshy -> rstone
 
 jlemon -> bmilekic
 jlemon -> brooks

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 22:47: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 CB1001065670;
	Tue, 20 Apr 2010 22:47:24 +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 B99798FC17;
	Tue, 20 Apr 2010 22:47: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 o3KMlOuQ067865;
	Tue, 20 Apr 2010 22:47:24 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMlOHT067861;
	Tue, 20 Apr 2010 22:47:24 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004202247.o3KMlOHT067861@svn.freebsd.org>
From: Xin LI 
Date: Tue, 20 Apr 2010 22:47:24 +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: r206948 - stable/8/usr.bin/gzip
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, 20 Apr 2010 22:47:25 -0000

Author: delphij
Date: Tue Apr 20 22:47:24 2010
New Revision: 206948
URL: http://svn.freebsd.org/changeset/base/206948

Log:
  MFC r206387:
  
  Diff reduction against NetBSD and add myself to AUTHORS section of the
  manual page as I wrote the unpack functionality.  No actual executable
  code change verified with md5(1).

Modified:
  stable/8/usr.bin/gzip/gzip.1
  stable/8/usr.bin/gzip/gzip.c
  stable/8/usr.bin/gzip/unbzip2.c
Directory Properties:
  stable/8/usr.bin/gzip/   (props changed)

Modified: stable/8/usr.bin/gzip/gzip.1
==============================================================================
--- stable/8/usr.bin/gzip/gzip.1	Tue Apr 20 22:46:23 2010	(r206947)
+++ stable/8/usr.bin/gzip/gzip.1	Tue Apr 20 22:47:24 2010	(r206948)
@@ -25,7 +25,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd June 24, 2009
+.Dd April 7, 2010
 .Dt GZIP 1
 .Os
 .Sh NAME
@@ -205,14 +205,17 @@ This implementation of
 .Nm
 was ported based on the
 .Nx
-.Nm
-20090412, and first appeared in
+.Nm ,
+and first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
+.An -nosplit
 This implementation of
 .Nm
 was written by
-.An Matthew R. Green Aq mrg@eterna.com.au .
+.An Matthew R. Green Aq mrg@eterna.com.au
+with unpack support written by
+.An Xin LI Aq delphij@FreeBSD.org .
 .Sh BUGS
 According to RFC 1952, the recorded file size is stored in a 32-bit
 integer and therefore it can not represent files that is bigger than

Modified: stable/8/usr.bin/gzip/gzip.c
==============================================================================
--- stable/8/usr.bin/gzip/gzip.c	Tue Apr 20 22:46:23 2010	(r206947)
+++ stable/8/usr.bin/gzip/gzip.c	Tue Apr 20 22:47:24 2010	(r206948)
@@ -1,4 +1,4 @@
-/*	$NetBSD: gzip.c,v 1.94 2009/04/12 10:31:14 lukem Exp $	*/
+/*	$NetBSD: gzip.c,v 1.97 2009/10/11 09:17:21 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green
@@ -149,10 +149,9 @@ static suffixes_t suffixes[] = {
 #undef SUFFIX
 };
 #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0])
-
 #define SUFFIX_MAXLEN	30
 
-static	const char	gzip_version[] = "FreeBSD gzip 20090621";
+static	const char	gzip_version[] = "FreeBSD gzip 20100407";
 
 #ifndef SMALL
 static	const char	gzip_copyright[] = \
@@ -206,7 +205,7 @@ static	char	*infile;		/* name of file co
 
 static	void	maybe_err(const char *fmt, ...) __dead2
     __attribute__((__format__(__printf__, 1, 2)));
-#ifndef NO_BZIP2_SUPPORT
+#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT)
 static	void	maybe_errx(const char *fmt, ...) __dead2
     __attribute__((__format__(__printf__, 1, 2)));
 #endif
@@ -461,7 +460,7 @@ maybe_err(const char *fmt, ...)
 	exit(2);
 }
 
-#ifndef NO_BZIP2_SUPPORT
+#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT)
 /* ... without an errno. */
 void
 maybe_errx(const char *fmt, ...)
@@ -1319,6 +1318,7 @@ file_uncompress(char *file, char *outfil
 	enum filetype method;
 	int fd, ofd, zfd = -1;
 #ifndef SMALL
+	ssize_t rv;
 	time_t timestamp = 0;
 	unsigned char name[PATH_MAX + 1];
 #endif
@@ -1364,7 +1364,6 @@ file_uncompress(char *file, char *outfil
 #ifndef SMALL
 	if (method == FT_GZIP && Nflag) {
 		unsigned char ts[4];	/* timestamp */
-		ssize_t rv;
 
 		rv = pread(fd, ts, sizeof ts, GZIP_TIMESTAMP);
 		if (rv >= 0 && rv < (ssize_t)(sizeof ts))
@@ -2054,7 +2053,7 @@ static void
 display_license(void)
 {
 
-	fprintf(stderr, "%s (based on NetBSD gzip 20060927)\n", gzip_version);
+	fprintf(stderr, "%s (based on NetBSD gzip 20091011)\n", gzip_version);
 	fprintf(stderr, "%s\n", gzip_copyright);
 	exit(0);
 }
@@ -2100,4 +2099,3 @@ read_retry(int fd, void *buf, size_t sz)
 
 	return sz - left;
 }
-

Modified: stable/8/usr.bin/gzip/unbzip2.c
==============================================================================
--- stable/8/usr.bin/gzip/unbzip2.c	Tue Apr 20 22:46:23 2010	(r206947)
+++ stable/8/usr.bin/gzip/unbzip2.c	Tue Apr 20 22:47:24 2010	(r206948)
@@ -1,4 +1,4 @@
-/*	$NetBSD: unbzip2.c,v 1.12 2009/10/11 05:17:20 mrg Exp $	*/
+/*	$NetBSD: unbzip2.c,v 1.13 2009/12/05 03:23:37 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 22:52: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 367481065672;
	Tue, 20 Apr 2010 22:52: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 252998FC1D;
	Tue, 20 Apr 2010 22:52: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 o3KMqDd4068993;
	Tue, 20 Apr 2010 22:52:13 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMqDEV068991;
	Tue, 20 Apr 2010 22:52:13 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004202252.o3KMqDEV068991@svn.freebsd.org>
From: Xin LI 
Date: Tue, 20 Apr 2010 22:52:13 +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: r206949 - stable/8/usr.bin/minigzip
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, 20 Apr 2010 22:52:14 -0000

Author: delphij
Date: Tue Apr 20 22:52:13 2010
New Revision: 206949
URL: http://svn.freebsd.org/changeset/base/206949

Log:
  MFC r205472:
  
  Enable mmap for minigzip(1).

Modified:
  stable/8/usr.bin/minigzip/Makefile
Directory Properties:
  stable/8/usr.bin/minigzip/   (props changed)

Modified: stable/8/usr.bin/minigzip/Makefile
==============================================================================
--- stable/8/usr.bin/minigzip/Makefile	Tue Apr 20 22:47:24 2010	(r206948)
+++ stable/8/usr.bin/minigzip/Makefile	Tue Apr 20 22:52:13 2010	(r206949)
@@ -1,8 +1,12 @@
 # $FreeBSD$
 
+SRCDIR=	${.CURDIR}/../../lib/libz
+.PATH:	${SRCDIR}
+
 PROG=	minigzip
-LDADD=	-lz
+
+CFLAGS+=-DUSE_MMAP
 DPADD=	${LIBZ}
-.PATH:	${.CURDIR}/../../lib/libz
+LDADD=	-lz
 
 .include 

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 22:52: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 580631065686;
	Tue, 20 Apr 2010 22:52:29 +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 461AC8FC19;
	Tue, 20 Apr 2010 22:52: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 o3KMqTlU069093;
	Tue, 20 Apr 2010 22:52:29 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMqTjk069088;
	Tue, 20 Apr 2010 22:52:29 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004202252.o3KMqTjk069088@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 20 Apr 2010 22:52: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: r206950 - in stable/8: bin/sh
	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: Tue, 20 Apr 2010 22:52:29 -0000

Author: jilles
Date: Tue Apr 20 22:52:28 2010
New Revision: 206950
URL: http://svn.freebsd.org/changeset/base/206950

Log:
  MFC r203576,r203677: sh: Don't stat() $MAIL/$MAILPATH if not interactive.
  
  These may be NFS mounted, and we should not touch them unless we are going
  to do something useful with the information.

Added:
  stable/8/tools/regression/bin/sh/parameters/mail1.0
     - copied unchanged from r203576, head/tools/regression/bin/sh/parameters/mail1.0
  stable/8/tools/regression/bin/sh/parameters/mail2.0
     - copied, changed from r203576, head/tools/regression/bin/sh/parameters/mail2.0
Modified:
  stable/8/bin/sh/main.c
  stable/8/bin/sh/var.c
Directory Properties:
  stable/8/bin/sh/   (props changed)
  stable/8/tools/regression/bin/sh/   (props changed)

Modified: stable/8/bin/sh/main.c
==============================================================================
--- stable/8/bin/sh/main.c	Tue Apr 20 22:52:13 2010	(r206949)
+++ stable/8/bin/sh/main.c	Tue Apr 20 22:52:28 2010	(r206950)
@@ -157,6 +157,8 @@ main(int argc, char *argv[])
 		out2str("sh: cannot determine working directory\n");
 	if (getpwd() != NULL)
 		setvar ("PWD", getpwd(), VEXPORT);
+	if (iflag)
+		chkmail(1);
 	if (argv[0] && argv[0][0] == '-') {
 		state = 1;
 		read_profile("/etc/profile");

Modified: stable/8/bin/sh/var.c
==============================================================================
--- stable/8/bin/sh/var.c	Tue Apr 20 22:52:13 2010	(r206949)
+++ stable/8/bin/sh/var.c	Tue Apr 20 22:52:28 2010	(r206950)
@@ -335,8 +335,13 @@ setvareq(char *s, int flags)
 			/*
 			 * We could roll this to a function, to handle it as
 			 * a regular variable function callback, but why bother?
+			 *
+			 * Note: this assumes iflag is not set to 1 initially.
+			 * As part of init(), this is called before arguments
+			 * are looked at.
 			 */
-			if (vp == &vmpath || (vp == &vmail && ! mpathset()))
+			if ((vp == &vmpath || (vp == &vmail && ! mpathset())) &&
+			    iflag == 1)
 				chkmail(1);
 			if ((vp->flags & VEXPORT) && localevar(s)) {
 				change_env(s, 1);

Copied: stable/8/tools/regression/bin/sh/parameters/mail1.0 (from r203576, head/tools/regression/bin/sh/parameters/mail1.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/parameters/mail1.0	Tue Apr 20 22:52:28 2010	(r206950, copy of r203576, head/tools/regression/bin/sh/parameters/mail1.0)
@@ -0,0 +1,15 @@
+# $FreeBSD$
+# Test that a non-interactive shell does not access $MAIL.
+
+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 -c "[ -s $goodfile ]" 2>/dev/null
+if ! grep -q $goodfile "$T"; then
+	# ktrace problem
+	rc=0
+elif ! grep -q $mailfile "$T"; then
+	rc=0
+fi
+rm "$T"
+exit ${rc:-3}

Copied and modified: stable/8/tools/regression/bin/sh/parameters/mail2.0 (from r203576, head/tools/regression/bin/sh/parameters/mail2.0)
==============================================================================
--- head/tools/regression/bin/sh/parameters/mail2.0	Sat Feb  6 22:57:24 2010	(r203576, copy source)
+++ stable/8/tools/regression/bin/sh/parameters/mail2.0	Tue Apr 20 22:52:28 2010	(r206950)
@@ -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  Tue Apr 20 22:55: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 09C99106564A;
	Tue, 20 Apr 2010 22:55:08 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D2B998FC14;
	Tue, 20 Apr 2010 22:55: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 o3KMt7Ca069723;
	Tue, 20 Apr 2010 22:55:07 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMt7mu069720;
	Tue, 20 Apr 2010 22:55:07 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202255.o3KMt7mu069720@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 22:55: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: r206951 - in stable/8: sys/boot/forth sys/dev/siba
	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: Tue, 20 Apr 2010 22:55:08 -0000

Author: weongyo
Date: Tue Apr 20 22:55:07 2010
New Revision: 206951
URL: http://svn.freebsd.org/changeset/base/206951

Log:
  MFC r204328:
    Add bwn(4) driver.

Modified:
  stable/8/sys/boot/forth/loader.conf
  stable/8/usr.sbin/sysinstall/devices.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)
  stable/8/usr.sbin/sysinstall/   (props changed)

Modified: stable/8/sys/boot/forth/loader.conf
==============================================================================
--- stable/8/sys/boot/forth/loader.conf	Tue Apr 20 22:52:28 2010	(r206950)
+++ stable/8/sys/boot/forth/loader.conf	Tue Apr 20 22:55:07 2010	(r206951)
@@ -224,6 +224,7 @@ if_axe_load="NO"		# ASIX Electronics AX8
 if_bce_load="NO"		# Broadcom NetXtreme II Gigabit Ethernet
 if_bfe_load="NO"		# Broadcom BCM4401
 if_bge_load="NO"		# Broadcom BCM570x PCI Gigabit Ethernet
+if_bwn_load="NO"		# Broadcom BCM43xx IEEE 802.11 wireless NICs
 if_cas_load="NO"		# Sun Cassini/Cassini+ and NS DP83065 Saturn
 if_cm_load="NO"			# SMC (90c26, 90c56, 90c66)
 if_cs_load="NO"			# Crystal Semiconductor CS8920

Modified: stable/8/usr.sbin/sysinstall/devices.c
==============================================================================
--- stable/8/usr.sbin/sysinstall/devices.c	Tue Apr 20 22:52:28 2010	(r206950)
+++ stable/8/usr.sbin/sysinstall/devices.c	Tue Apr 20 22:55:07 2010	(r206951)
@@ -105,6 +105,7 @@ static struct _devname {
     NETWORK("bfe",	"Broadcom BCM440x PCI Ethernet card"),
     NETWORK("bge",	"Broadcom BCM570x PCI Gigabit Ethernet card"),
     NETWORK("bm",	"Apple BMAC Built-in Ethernet"),
+    NETWORK("bwn",	"Broadcom BCM43xx IEEE 802.11 wireless adapter"),
     NETWORK("cas",	"Sun Cassini/Cassini+ or NS DP83065 Saturn Ethernet"),
     NETWORK("cue",	"CATC USB Ethernet adapter"),
     NETWORK("cxgb",	"Chelsio T3 10Gb Ethernet card"),

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 22: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 445CE1065675;
	Tue, 20 Apr 2010 22:57:06 +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 332DC8FC17;
	Tue, 20 Apr 2010 22: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 o3KMv6Wo070250;
	Tue, 20 Apr 2010 22:57:06 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMv6lQ070248;
	Tue, 20 Apr 2010 22:57:06 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004202257.o3KMv6lQ070248@svn.freebsd.org>
From: Xin LI 
Date: Tue, 20 Apr 2010 22:57: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: r206952 - stable/8/lib/libz
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, 20 Apr 2010 22:57:06 -0000

Author: delphij
Date: Tue Apr 20 22:57:05 2010
New Revision: 206952
URL: http://svn.freebsd.org/changeset/base/206952

Log:
  MFC assembler version of match functions for amd64 and i386(*).
  
  This gives approximately 15% improvement on compression case.
  
  (*) i386 assembler version is enabled ONLY when MACHINE_CPU have
  'i686' which is not default on FreeBSD/i386.  One can specify
  for instance CPUTYPE=pentium4 in /etc/make.conf to get this
  feature.

Added:
     - copied from r206950, user/delphij/libz-8/contrib/
Directory Properties:
  stable/8/lib/libz/contrib/   (props changed)
Modified:
  stable/8/lib/libz/Makefile
Directory Properties:
  stable/8/lib/libz/   (props changed)

Modified: stable/8/lib/libz/Makefile
==============================================================================
--- stable/8/lib/libz/Makefile	Tue Apr 20 22:55:07 2010	(r206951)
+++ stable/8/lib/libz/Makefile	Tue Apr 20 22:57:05 2010	(r206952)
@@ -19,6 +19,18 @@ SRCS = adler32.c compress.c crc32.c gzio
        zutil.c inflate.c inftrees.c inffast.c zopen.c infback.c
 INCS=		zconf.h zlib.h
 
+.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*}
+.PATH:		${.CURDIR}/contrib/asm686
+SRCS+=		match.S
+CFLAGS+=	-DASMV -DNO_UNDERLINE
+.endif
+
+.if ${MACHINE_ARCH} == "amd64"
+.PATH:		${.CURDIR}/contrib/gcc_gvmat64
+SRCS+=		gvmat64.S
+CFLAGS+=	-DASMV -DNO_UNDERLINE
+.endif
+
 minigzip:	all minigzip.o
 	$(CC) -o minigzip minigzip.o -L. -lz
 

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 23:42: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 6E2A8106566C;
	Tue, 20 Apr 2010 23:42:36 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 444978FC20;
	Tue, 20 Apr 2010 23:42: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 o3KNga5S080348;
	Tue, 20 Apr 2010 23:42:36 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KNgaZA080346;
	Tue, 20 Apr 2010 23:42:36 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201004202342.o3KNgaZA080346@svn.freebsd.org>
From: Juli Mallett 
Date: Tue, 20 Apr 2010 23:42:36 +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: r206956 - 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: Tue, 20 Apr 2010 23:42:36 -0000

Author: jmallett
Date: Tue Apr 20 23:42:34 2010
New Revision: 206956
URL: http://svn.freebsd.org/changeset/base/206956

Log:
  Temporarily raise my limit.

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==============================================================================
--- svnadmin/conf/sizelimit.conf	Tue Apr 20 23:36:01 2010	(r206955)
+++ svnadmin/conf/sizelimit.conf	Tue Apr 20 23:42:34 2010	(r206956)
@@ -31,3 +31,4 @@ rwatson
 gonzo
 kmacy
 jb
+jmallett

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 23:43: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 6DEF71065673;
	Tue, 20 Apr 2010 23:43:33 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 444B38FC22;
	Tue, 20 Apr 2010 23:43: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 o3KNhXSZ080626;
	Tue, 20 Apr 2010 23:43:33 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KNhXo3080624;
	Tue, 20 Apr 2010 23:43:33 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201004202343.o3KNhXo3080624@svn.freebsd.org>
From: Juli Mallett 
Date: Tue, 20 Apr 2010 23:43:33 +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: r206958 - 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: Tue, 20 Apr 2010 23:43:33 -0000

Author: jmallett
Date: Tue Apr 20 23:43:32 2010
New Revision: 206958
URL: http://svn.freebsd.org/changeset/base/206958

Log:
  Back down to normal limit.

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==============================================================================
--- svnadmin/conf/sizelimit.conf	Tue Apr 20 23:42:57 2010	(r206957)
+++ svnadmin/conf/sizelimit.conf	Tue Apr 20 23:43:32 2010	(r206958)
@@ -31,4 +31,3 @@ rwatson
 gonzo
 kmacy
 jb
-jmallett

From owner-svn-src-all@FreeBSD.ORG  Tue Apr 20 23: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 068051065670;
	Tue, 20 Apr 2010 23:59:03 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E8F778FC08;
	Tue, 20 Apr 2010 23:59: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 o3KNx2eV084130;
	Tue, 20 Apr 2010 23:59:02 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KNx288084128;
	Tue, 20 Apr 2010 23:59:02 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202359.o3KNx288084128@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 23:59: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: r206961 - 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: Tue, 20 Apr 2010 23:59:03 -0000

Author: weongyo
Date: Tue Apr 20 23:59:02 2010
New Revision: 206961
URL: http://svn.freebsd.org/changeset/base/206961

Log:
  MFC  r204343:
    Updates what firmware module should be used for LP (low power) PHY
    users and bumps date.

Modified:
  stable/8/share/man/man4/bwn.4
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/bwn.4
==============================================================================
--- stable/8/share/man/man4/bwn.4	Tue Apr 20 23:45:48 2010	(r206960)
+++ stable/8/share/man/man4/bwn.4	Tue Apr 20 23:59:02 2010	(r206961)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 15, 2010
+.Dd February 25, 2010
 .Dt BWN 4
 .Os
 .Sh NAME
@@ -69,6 +69,8 @@ The
 port needs to be installed before
 .Xr ifconfig 8
 will work.
+Most cases you need to use bwn_v4_ucode module but if you are a
+LP (low power) PHY user please uses bwn_v4_lp_ucode module.
 .Sh HARDWARE
 The
 .Nm

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00:01: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 06838106564A;
	Wed, 21 Apr 2010 00:01:39 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E8BAE8FC16;
	Wed, 21 Apr 2010 00:01: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 o3L01c74084776;
	Wed, 21 Apr 2010 00:01:38 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L01cl9084774;
	Wed, 21 Apr 2010 00:01:38 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210001.o3L01cl9084774@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:01: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: r206962 - in stable/8/sys/dev: bwn siba
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, 21 Apr 2010 00:01:39 -0000

Author: weongyo
Date: Wed Apr 21 00:01:38 2010
New Revision: 206962
URL: http://svn.freebsd.org/changeset/base/206962

Log:
  MFC  r204385:
    don't need to check BWN_RX_PHYST0_SHORTPRMBL flag because it's already
    handled in later.
  
    Reported from: imp, nwhitehorn

Modified:
  stable/8/sys/dev/bwn/if_bwn.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 23:59:02 2010	(r206961)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:01:38 2010	(r206962)
@@ -9395,8 +9395,6 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 		device_printf(sc->sc_dev, "TODO RX: RX_FLAG_FAILED_FCS_CRC\n");
 	if (phystat0 & (BWN_RX_PHYST0_PLCPHCF | BWN_RX_PHYST0_PLCPFV))
 		device_printf(sc->sc_dev, "TODO RX: RX_FLAG_FAILED_PLCP_CRC\n");
-	if (phystat0 & BWN_RX_PHYST0_SHORTPRMBL)
-		device_printf(sc->sc_dev, "TODO RX: RX_FLAG_SHORTPRE\n");
 	if (macstat & BWN_RX_MAC_DECERR)
 		goto drop;
 

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00:02: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 C5E8E1065670;
	Wed, 21 Apr 2010 00:02:48 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B49438FC34;
	Wed, 21 Apr 2010 00:02: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 o3L02mjA085082;
	Wed, 21 Apr 2010 00:02:48 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L02mbX085080;
	Wed, 21 Apr 2010 00:02:48 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210002.o3L02mbX085080@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:02: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: r206963 - in stable/8/sys/dev: bwn siba
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, 21 Apr 2010 00:02:48 -0000

Author: weongyo
Date: Wed Apr 21 00:02:48 2010
New Revision: 206963
URL: http://svn.freebsd.org/changeset/base/206963

Log:
  MFC r204436:
    supports the adhoc demo mode that it's tested on modified aircrack-ng
    suite and worked.
  
    Submitted by:	Paul B Mahol 

Modified:
  stable/8/sys/dev/bwn/if_bwn.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:01:38 2010	(r206962)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:02:48 2010	(r206963)
@@ -1076,6 +1076,7 @@ bwn_attach_post(struct bwn_softc *sc)
 	ic->ic_caps =
 		  IEEE80211_C_STA		/* station mode supported */
 		| IEEE80211_C_MONITOR		/* monitor mode */
+		| IEEE80211_C_AHDEMO		/* adhoc demo mode */
 		| IEEE80211_C_SHPREAMBLE	/* short preamble supported */
 		| IEEE80211_C_SHSLOT		/* short slot time supported */
 		| IEEE80211_C_WME		/* WME/WMM supported */
@@ -8447,7 +8448,8 @@ bwn_newstate(struct ieee80211vap *vap, e
 		}
 	}
 
-	if (vap->iv_opmode == IEEE80211_M_MONITOR) {
+	if (vap->iv_opmode == IEEE80211_M_MONITOR ||
+	    vap->iv_opmode == IEEE80211_M_AHDEMO) {
 		/* XXX nothing to do? */
 	} else if (nstate == IEEE80211_S_RUN) {
 		memcpy(sc->sc_bssid, vap->iv_bss->ni_bssid, IEEE80211_ADDR_LEN);

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00: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 3117F106564A;
	Wed, 21 Apr 2010 00:05:23 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F9E38FC08;
	Wed, 21 Apr 2010 00:05: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 o3L05NOF085692;
	Wed, 21 Apr 2010 00:05:23 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L05MjW085690;
	Wed, 21 Apr 2010 00:05:22 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210005.o3L05MjW085690@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:05: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: r206964 - in stable/8/sys/dev: bwn siba
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, 21 Apr 2010 00:05:23 -0000

Author: weongyo
Date: Wed Apr 21 00:05:22 2010
New Revision: 206964
URL: http://svn.freebsd.org/changeset/base/206964

Log:
  MFC r204437:
    fixes a bug to load firmware images for LP PHY. For LP PHY always,
    `lp_' string is contained in its full image names.

Modified:
  stable/8/sys/dev/bwn/if_bwn.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:02:48 2010	(r206963)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:05:22 2010	(r206964)
@@ -7789,8 +7789,9 @@ bwn_fw_get(struct bwn_mac *mac, enum bwn
 		bwn_do_release_fw(bfw);
 	}
 
-	snprintf(namebuf, sizeof(namebuf), "bwn%s_v4_%s",
-	    (type == BWN_FWTYPE_OPENSOURCE) ? "-open" : "", name);
+	snprintf(namebuf, sizeof(namebuf), "bwn%s_v4_%s%s",
+	    (type == BWN_FWTYPE_OPENSOURCE) ? "-open" : "",
+	    (mac->mac_phy.type == BWN_PHYTYPE_LP) ? "lp_" : "", name);
 	/* XXX Sleeping on "fwload" with the non-sleepable locks held */
 	fw = firmware_get(namebuf);
 	if (fw == NULL) {

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00:06: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 316F8106564A;
	Wed, 21 Apr 2010 00:06:40 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1FF338FC14;
	Wed, 21 Apr 2010 00:06: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 o3L06erZ086031;
	Wed, 21 Apr 2010 00:06:40 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L06dig086029;
	Wed, 21 Apr 2010 00:06:40 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210006.o3L06dig086029@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:06:39 +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: r206965 - in stable/8/sys/dev: bwn siba
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, 21 Apr 2010 00:06:40 -0000

Author: weongyo
Date: Wed Apr 21 00:06:39 2010
New Revision: 206965
URL: http://svn.freebsd.org/changeset/base/206965

Log:
  MFC r204542:
    calculates the integer square root if a positive integer X is larger
    than 256 instead of using sqrt_table.
  
    Reported by: Joe Marcus Clarke 

Modified:
  stable/8/sys/dev/bwn/if_bwn.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:05:22 2010	(r206964)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:06:39 2010	(r206965)
@@ -12846,7 +12846,6 @@ bwn_phy_lp_clear_deaf(struct bwn_mac *ma
 static unsigned int
 bwn_sqrt(struct bwn_mac *mac, unsigned int x)
 {
-	struct bwn_softc *sc = mac->mac_sc;
 	/* Table holding (10 * sqrt(x)) for x between 1 and 256. */
 	static uint8_t sqrt_table[256] = {
 		10, 14, 17, 20, 22, 24, 26, 28,
@@ -12886,9 +12885,11 @@ bwn_sqrt(struct bwn_mac *mac, unsigned i
 	if (x == 0)
 		return (0);
 	if (x >= 256) {
-		device_printf(sc->sc_dev,
-		    "out of bounds of the square-root table (%d)\n", x);
-		return (16);
+		unsigned int tmp;
+
+		for (tmp = 0; x >= (2 * tmp) + 1; x -= (2 * tmp++) + 1)
+			/* do nothing */ ;
+		return (tmp);
 	}
 	return (sqrt_table[x - 1] / 10);
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00:13: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 C429D106568D;
	Wed, 21 Apr 2010 00:13:44 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B23678FC26;
	Wed, 21 Apr 2010 00:13: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 o3L0DiiM087715;
	Wed, 21 Apr 2010 00:13:44 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0DiE0087711;
	Wed, 21 Apr 2010 00:13:44 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210013.o3L0DiE0087711@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:13: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: r206967 - in stable/8/sys/dev: bwn siba
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, 21 Apr 2010 00:13:44 -0000

Author: weongyo
Date: Wed Apr 21 00:13:44 2010
New Revision: 206967
URL: http://svn.freebsd.org/changeset/base/206967

Log:
  MFC r204657:
    fixes an attached-at-boot issue that bwn(4) using device_identify
    interface didn't be attached automatically at boot time so changes a
    approach to attach children based on leveraging some newbus niceties.
  
    Submitted by: nwhitehorn

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/siba/siba_bwn.c
  stable/8/sys/dev/siba/siba_core.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:10:30 2010	(r206966)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:13:44 2010	(r206967)
@@ -14312,16 +14312,8 @@ bwn_sysctl_node(struct bwn_softc *sc)
 #endif
 }
 
-static void
-bwn_identify(driver_t *driver, device_t parent)
-{
-
-	BUS_ADD_CHILD(parent, 0, "bwn", -1);
-}
-
 static device_method_t bwn_methods[] = {
 	/* Device interface */
-	DEVMETHOD(device_identify,	bwn_identify),
 	DEVMETHOD(device_probe,		bwn_probe),
 	DEVMETHOD(device_attach,	bwn_attach),
 	DEVMETHOD(device_detach,	bwn_detach),

Modified: stable/8/sys/dev/siba/siba_bwn.c
==============================================================================
--- stable/8/sys/dev/siba/siba_bwn.c	Wed Apr 21 00:10:30 2010	(r206966)
+++ stable/8/sys/dev/siba/siba_bwn.c	Wed Apr 21 00:13:44 2010	(r206967)
@@ -97,8 +97,6 @@ static const struct siba_dev {
 	{ PCI_VENDOR_BROADCOM, 0x432b, "Unknown" }
 };
 
-device_t	siba_add_child(device_t, struct siba_softc *, int, const char *,
-		    int);
 int		siba_core_attach(struct siba_softc *);
 int		siba_core_detach(struct siba_softc *);
 int		siba_core_suspend(struct siba_softc *);
@@ -238,15 +236,6 @@ siba_bwn_resume(device_t dev)
 	return (0);
 }
 
-static device_t
-siba_bwn_add_child(device_t dev, int order, const char *name, int unit)
-{
-	struct siba_bwn_softc *ssc = device_get_softc(dev);
-	struct siba_softc *siba = &ssc->ssc_siba;
-
-	return (siba_add_child(dev, siba, order, name, unit));
-}
-
 /* proxying to the parent */
 static struct resource *
 siba_bwn_alloc_resource(device_t dev, device_t child, int type, int *rid,
@@ -342,7 +331,6 @@ static device_method_t siba_bwn_methods[
 	DEVMETHOD(device_resume,	siba_bwn_resume),
 
 	/* Bus interface */
-	DEVMETHOD(bus_add_child,	siba_bwn_add_child),
 	DEVMETHOD(bus_alloc_resource,   siba_bwn_alloc_resource),
 	DEVMETHOD(bus_release_resource, siba_bwn_release_resource),
 	DEVMETHOD(bus_setup_intr,       siba_bwn_setup_intr),

Modified: stable/8/sys/dev/siba/siba_core.c
==============================================================================
--- stable/8/sys/dev/siba/siba_core.c	Wed Apr 21 00:10:30 2010	(r206966)
+++ stable/8/sys/dev/siba/siba_core.c	Wed Apr 21 00:13:44 2010	(r206967)
@@ -133,8 +133,6 @@ static void	siba_pci_write_multi_4(struc
 		    size_t, uint16_t);
 static const char *siba_core_name(uint16_t);
 static void	siba_pcicore_init(struct siba_pci *);
-device_t	siba_add_child(device_t, struct siba_softc *, int, const char *,
-		    int);
 int		siba_core_attach(struct siba_softc *);
 int		siba_core_detach(struct siba_softc *);
 int		siba_core_suspend(struct siba_softc *);
@@ -206,8 +204,10 @@ siba_core_attach(struct siba_softc *siba
 		return (error);
 	}
 
+	siba_pcicore_init(&siba->siba_pci);
 	siba_powerdown(siba);
-	return (0);
+	
+	return (bus_generic_attach(siba->siba_dev));
 }
 
 int
@@ -277,6 +277,7 @@ siba_scan(struct siba_softc *siba)
 {
 	struct siba_dev_softc *sd;
 	uint32_t idhi, tmp;
+	device_t child;
 	int base, dev_i = 0, error, i, is_pcie, n_80211 = 0, n_cc = 0,
 	    n_pci = 0;
 
@@ -387,6 +388,14 @@ siba_scan(struct siba_softc *siba)
 			break;
 		}
 		dev_i++;
+
+		child = device_add_child(siba->siba_dev, NULL, -1);
+		if (child == NULL) {
+			device_printf(siba->siba_dev, "child attach failed\n");
+			continue;
+		}
+
+		device_set_ivars(child, sd);
 	}
 	siba->siba_ndevs = dev_i;
 }
@@ -1964,52 +1973,6 @@ siba_barrier(struct siba_dev_softc *sd, 
 	SIBA_BARRIER(siba, flags);
 }
 
-/*
- * Attach it as child.
- */
-device_t
-siba_add_child(device_t dev, struct siba_softc *siba, int order,
-    const char *name, int unit)
-{
-	struct siba_dev_softc *sd;
-	device_t child;
-	int idx = 0, i;
-
-	child = device_add_child(dev, name, unit);
-	if (child == NULL)
-		return (NULL);
-
-	siba_powerup(siba, 0);
-	siba_pcicore_init(&siba->siba_pci);
-	siba_powerdown(siba);
-
-	for (i = 0; i < siba->siba_ndevs; i++) {
-		sd = &(siba->siba_devs[i]);
-
-		if (sd->sd_id.sd_device != SIBA_DEVID_80211) {
-			DPRINTF(siba, SIBA_DEBUG_CORE,
-			    "skip to register coreid %#x (%s)\n",
-			    sd->sd_id.sd_device,
-			    siba_core_name(sd->sd_id.sd_device));
-			continue;
-		}
-
-		DPRINTF(siba, SIBA_DEBUG_CORE,
-		    "siba: attaching coreid %#x (%s) idx %d\n",
-		    sd->sd_id.sd_device,
-		    siba_core_name(sd->sd_id.sd_device), idx);
-
-		KASSERT(sd->sd_id.sd_device == SIBA_DEVID_80211,
-		    ("%s:%d: SIBA_DEVID_80211 is only supportted currently.",
-			__func__, __LINE__));
-
-		device_set_ivars(child, sd);
-		device_probe_and_attach(child);
-		idx++;
-	}
-	return (child);
-}
-
 static void
 siba_cc_suspend(struct siba_cc *scc)
 {

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00:15: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 AF13A106564A;
	Wed, 21 Apr 2010 00:15:58 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D2BB8FC2C;
	Wed, 21 Apr 2010 00:15: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 o3L0FwtB088252;
	Wed, 21 Apr 2010 00:15:58 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0Fw0p088250;
	Wed, 21 Apr 2010 00:15:58 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210015.o3L0Fw0p088250@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:15:58 +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: r206968 - in stable/8/sys: conf dev/siba
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, 21 Apr 2010 00:15:58 -0000

Author: weongyo
Date: Wed Apr 21 00:15:58 2010
New Revision: 206968
URL: http://svn.freebsd.org/changeset/base/206968

Log:
  MFC r204662:
    Hook up the bwn driver.
  
    Pointed by: nwhitehorn

Modified:
  stable/8/sys/conf/files
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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Wed Apr 21 00:13:44 2010	(r206967)
+++ stable/8/sys/conf/files	Wed Apr 21 00:15:58 2010	(r206968)
@@ -771,6 +771,7 @@ dev/bwi/bwiphy.c		optional bwi
 dev/bwi/bwirf.c			optional bwi
 dev/bwi/if_bwi.c		optional bwi
 dev/bwi/if_bwi_pci.c		optional bwi pci
+dev/bwn/if_bwn.c		optional bwn siba_bwn
 dev/cardbus/cardbus.c		optional cardbus
 dev/cardbus/cardbus_cis.c	optional cardbus
 dev/cardbus/cardbus_device.c	optional cardbus
@@ -1481,6 +1482,8 @@ dev/si/si3_t225.c		optional si
 dev/si/si_eisa.c		optional si eisa
 dev/si/si_isa.c			optional si isa
 dev/si/si_pci.c			optional si pci
+dev/siba/siba_bwn.c		optional siba_bwn pci
+dev/siba/siba_core.c		optional siba_bwn pci
 dev/siis/siis.c			optional siis pci
 dev/sis/if_sis.c		optional sis pci
 dev/sk/if_sk.c			optional sk pci inet

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00:22: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 2B3F31065675;
	Wed, 21 Apr 2010 00:22:17 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 186A68FC12;
	Wed, 21 Apr 2010 00:22: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 o3L0MHrh089766;
	Wed, 21 Apr 2010 00:22:17 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0MHNg089763;
	Wed, 21 Apr 2010 00:22:17 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210022.o3L0MHNg089763@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:22: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: r206969 - in stable/8/sys/dev: bwn siba
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, 21 Apr 2010 00:22:17 -0000

Author: weongyo
Date: Wed Apr 21 00:22:16 2010
New Revision: 206969
URL: http://svn.freebsd.org/changeset/base/206969

Log:
  MFC r205003:
    Revert r204992 and just wrap it all in ifdef INVARIANTS to fix the debug
    and non-debug cases
  
  MFC r204992:
    fixes a compile error if INVARIANTS is disabled.
  
    Pointy hat to: me
    Submitted by: Michael Butler 
  
  MFC r204983:
    Fix build breakage introduced in r204922.
  
  MFC r204923:
    uses KOBJMETHOD_END macro to indicate the end of method table.
  
    Submitted by: yongari
  
  MFC r204922:
    o uses bus accessor macros to read values from ivar so no more values
      are referenced directly from ivar pointer.  It's to do like what other
      buses do. [1]
    o changes exported prototypes.  It doesn't use struct siba_* structures
      anymore that instead of it it uses only device_t.
    o removes duplicate code and debug messages.
    o style(9)
  
    Pointed out by:        imp [1]

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/bwn/if_bwnvar.h
  stable/8/sys/dev/siba/siba.c
  stable/8/sys/dev/siba/siba_bwn.c
  stable/8/sys/dev/siba/siba_cc.c   (contents, props changed)
  stable/8/sys/dev/siba/siba_core.c
  stable/8/sys/dev/siba/siba_pcib.c
  stable/8/sys/dev/siba/sibavar.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:15:58 2010	(r206968)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:22:16 2010	(r206969)
@@ -134,7 +134,7 @@ SYSCTL_INT(_hw_bwn, OID_AUTO, wme, CTLFL
 
 static int	bwn_attach_pre(struct bwn_softc *);
 static int	bwn_attach_post(struct bwn_softc *);
-static void	bwn_sprom_bugfixes(struct siba_softc *);
+static void	bwn_sprom_bugfixes(device_t);
 static void	bwn_init(void *);
 static int	bwn_init_locked(struct bwn_softc *);
 static int	bwn_ioctl(struct ifnet *, u_long, caddr_t);
@@ -205,7 +205,6 @@ static void	bwn_stop_locked(struct bwn_s
 static int	bwn_core_init(struct bwn_mac *);
 static void	bwn_core_start(struct bwn_mac *);
 static void	bwn_core_exit(struct bwn_mac *);
-static void	bwn_fix_imcfglobug(struct bwn_mac *);
 static void	bwn_bt_disable(struct bwn_mac *);
 static int	bwn_chip_init(struct bwn_mac *);
 static uint64_t	bwn_hf_read(struct bwn_mac *);
@@ -225,7 +224,6 @@ static int	bwn_fw_loadinitvals(struct bw
 static int	bwn_phy_init(struct bwn_mac *);
 static void	bwn_set_txantenna(struct bwn_mac *, int);
 static void	bwn_set_opmode(struct bwn_mac *);
-static void	bwn_gpio_cleanup(struct bwn_mac *);
 static void	bwn_rate_write(struct bwn_mac *, uint16_t, int);
 static uint8_t	bwn_plcp_getcck(const uint8_t);
 static uint8_t	bwn_plcp_getofdm(const uint8_t);
@@ -910,13 +908,12 @@ static const struct siba_devid bwn_devs[
 static int
 bwn_probe(device_t dev)
 {
-	struct siba_dev_softc *sd = device_get_ivars(dev);
 	int i;
 
 	for (i = 0; i < sizeof(bwn_devs) / sizeof(bwn_devs[0]); i++) {
-		if (sd->sd_id.sd_vendor == bwn_devs[i].sd_vendor &&
-		    sd->sd_id.sd_device == bwn_devs[i].sd_device &&
-		    sd->sd_id.sd_rev == bwn_devs[i].sd_rev)
+		if (siba_get_vendor(dev) == bwn_devs[i].sd_vendor &&
+		    siba_get_device(dev) == bwn_devs[i].sd_device &&
+		    siba_get_revid(dev) == bwn_devs[i].sd_rev)
 			return (BUS_PROBE_DEFAULT);
 	}
 
@@ -928,12 +925,9 @@ bwn_attach(device_t dev)
 {
 	struct bwn_mac *mac;
 	struct bwn_softc *sc = device_get_softc(dev);
-	struct siba_dev_softc *sd = device_get_ivars(dev);
-	struct siba_softc *siba = sd->sd_bus;
 	int error, i, msic, reg;
 
 	sc->sc_dev = dev;
-	sc->sc_sd = sd;
 #ifdef BWN_DEBUG
 	sc->sc_debug = bwn_debug;
 #endif
@@ -942,14 +936,14 @@ bwn_attach(device_t dev)
 		error = bwn_attach_pre(sc);
 		if (error != 0)
 			return (error);
-		bwn_sprom_bugfixes(sd->sd_bus);
+		bwn_sprom_bugfixes(dev);
 		sc->sc_flags |= BWN_FLAG_ATTACHED;
 	}
 
 	if (!TAILQ_EMPTY(&sc->sc_maclist)) {
-		if (siba->siba_pci_did != 0x4313 &&
-		    siba->siba_pci_did != 0x431a &&
-		    siba->siba_pci_did != 0x4321) {
+		if (siba_get_pci_device(dev) != 0x4313 &&
+		    siba_get_pci_device(dev) != 0x431a &&
+		    siba_get_pci_device(dev) != 0x4321) {
 			device_printf(sc->sc_dev,
 			    "skip 802.11 cores\n");
 			return (ENODEV);
@@ -961,7 +955,6 @@ bwn_attach(device_t dev)
 	if (mac == NULL)
 		return (ENOMEM);
 	mac->mac_sc = sc;
-	mac->mac_sd = sd;
 	mac->mac_status = BWN_MAC_STATUS_UNINIT;
 	if (bwn_bfp != 0)
 		mac->mac_flags |= BWN_MAC_FLAG_BADFRAME_PREEMP;
@@ -977,7 +970,7 @@ bwn_attach(device_t dev)
 
 	device_printf(sc->sc_dev, "WLAN (chipid %#x rev %u) "
 	    "PHY (analog %d type %d rev %d) RADIO (manuf %#x ver %#x rev %d)\n",
-	    sd->sd_bus->siba_chipid, sd->sd_id.sd_rev,
+	    siba_get_chipid(sc->sc_dev), siba_get_revid(sc->sc_dev),
 	    mac->mac_phy.analog, mac->mac_phy.type, mac->mac_phy.rev,
 	    mac->mac_phy.rf_manuf, mac->mac_phy.rf_ver,
 	    mac->mac_phy.rf_rev);
@@ -1065,8 +1058,6 @@ bwn_attach_post(struct bwn_softc *sc)
 {
 	struct ieee80211com *ic;
 	struct ifnet *ifp = sc->sc_ifp;
-	struct siba_dev_softc *sd = sc->sc_sd;
-	struct siba_sprom *sprom = &sd->sd_bus->siba_sprom;
 
 	ic = ifp->if_l2com;
 	ic->ic_ifp = ifp;
@@ -1087,8 +1078,9 @@ bwn_attach_post(struct bwn_softc *sc)
 
 	/* call MI attach routine. */
 	ieee80211_ifattach(ic,
-	    bwn_is_valid_ether_addr(sprom->mac_80211a) ? sprom->mac_80211a :
-	    sprom->mac_80211bg);
+	    bwn_is_valid_ether_addr(siba_sprom_get_mac_80211a(sc->sc_dev)) ?
+	    siba_sprom_get_mac_80211a(sc->sc_dev) :
+	    siba_sprom_get_mac_80211bg(sc->sc_dev));
 
 	ic->ic_headroom = sizeof(struct bwn_txhdr);
 
@@ -1219,21 +1211,24 @@ fail:	BWN_LOCK_DESTROY(sc);
 }
 
 static void
-bwn_sprom_bugfixes(struct siba_softc *siba)
+bwn_sprom_bugfixes(device_t dev)
 {
 #define	BWN_ISDEV(_vendor, _device, _subvendor, _subdevice)		\
-	((siba->siba_pci_vid == PCI_VENDOR_##_vendor) &&		\
-	 (siba->siba_pci_did == _device) &&				\
-	 (siba->siba_pci_subvid == PCI_VENDOR_##_subvendor) &&		\
-	 (siba->siba_pci_subdid == _subdevice))
-
-	if (siba->siba_board_vendor == PCI_VENDOR_APPLE &&
-	    siba->siba_board_type == 0x4e && siba->siba_board_rev > 0x40)
-		siba->siba_sprom.bf_lo |= BWN_BFL_PACTRL;
-	if (siba->siba_board_vendor == SIBA_BOARDVENDOR_DELL &&
-	    siba->siba_chipid == 0x4301 && siba->siba_board_rev == 0x74)
-		siba->siba_sprom.bf_lo |= BWN_BFL_BTCOEXIST;
-	if (siba->siba_type == SIBA_TYPE_PCI) {
+	((siba_get_pci_vendor(dev) == PCI_VENDOR_##_vendor) &&		\
+	 (siba_get_pci_device(dev) == _device) &&			\
+	 (siba_get_pci_subvendor(dev) == PCI_VENDOR_##_subvendor) &&	\
+	 (siba_get_pci_subdevice(dev) == _subdevice))
+
+	if (siba_get_pci_subvendor(dev) == PCI_VENDOR_APPLE &&
+	    siba_get_pci_subdevice(dev) == 0x4e &&
+	    siba_get_pci_revid(dev) > 0x40)
+		siba_sprom_set_bf_lo(dev,
+		    siba_sprom_get_bf_lo(dev) | BWN_BFL_PACTRL);
+	if (siba_get_pci_subvendor(dev) == SIBA_BOARDVENDOR_DELL &&
+	    siba_get_chipid(dev) == 0x4301 && siba_get_pci_revid(dev) == 0x74)
+		siba_sprom_set_bf_lo(dev,
+		    siba_sprom_get_bf_lo(dev) | BWN_BFL_BTCOEXIST);
+	if (siba_get_type(dev) == SIBA_TYPE_PCI) {
 		if (BWN_ISDEV(BROADCOM, 0x4318, ASUSTEK, 0x100f) ||
 		    BWN_ISDEV(BROADCOM, 0x4320, DELL, 0x0003) ||
 		    BWN_ISDEV(BROADCOM, 0x4320, HP, 0x12f8) ||
@@ -1241,7 +1236,8 @@ bwn_sprom_bugfixes(struct siba_softc *si
 		    BWN_ISDEV(BROADCOM, 0x4320, LINKSYS, 0x0014) ||
 		    BWN_ISDEV(BROADCOM, 0x4320, LINKSYS, 0x0015) ||
 		    BWN_ISDEV(BROADCOM, 0x4320, MOTOROLA, 0x7010))
-			siba->siba_sprom.bf_lo &= ~BWN_BFL_BTCOEXIST;
+			siba_sprom_set_bf_lo(dev,
+			    siba_sprom_get_bf_lo(dev) & ~BWN_BFL_BTCOEXIST);
 	}
 #undef	BWN_ISDEV
 }
@@ -1434,7 +1430,7 @@ bwn_pio_tx_start(struct bwn_mac *mac, st
 	tq->tq_used += roundup(m->m_pkthdr.len + BWN_HDRSIZE(mac), 4);
 	tq->tq_free--;
 
-	if (mac->mac_sd->sd_id.sd_rev >= 8) {
+	if (siba_get_revid(sc->sc_dev) >= 8) {
 		/*
 		 * XXX please removes m_defrag(9)
 		 */
@@ -1606,17 +1602,15 @@ static int
 bwn_attach_core(struct bwn_mac *mac)
 {
 	struct bwn_softc *sc = mac->mac_sc;
-	struct siba_dev_softc *sd = mac->mac_sd;
-	struct siba_softc *siba = sd->sd_bus;
 	int error, have_bg = 0, have_a = 0;
 	uint32_t high;
 
-	KASSERT(sd->sd_id.sd_rev >= 5,
-	    ("unsupported revision %d", sd->sd_id.sd_rev));
+	KASSERT(siba_get_revid(sc->sc_dev) >= 5,
+	    ("unsupported revision %d", siba_get_revid(sc->sc_dev)));
 
-	siba_powerup(siba, 0);
+	siba_powerup(sc->sc_dev, 0);
 
-	high = siba_read_4(sd, SIBA_TGSHIGH);
+	high = siba_read_4(sc->sc_dev, SIBA_TGSHIGH);
 	bwn_reset_core(mac,
 	    (high & BWN_TGSHIGH_HAVE_2GHZ) ? BWN_TGSLOW_SUPPORT_G : 0);
 	error = bwn_phy_getinfo(mac, high);
@@ -1625,8 +1619,9 @@ bwn_attach_core(struct bwn_mac *mac)
 
 	have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0;
 	have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0;
-	if (siba->siba_pci_did != 0x4312 && siba->siba_pci_did != 0x4319 &&
-	    siba->siba_pci_did != 0x4324) {
+	if (siba_get_pci_device(sc->sc_dev) != 0x4312 &&
+	    siba_get_pci_device(sc->sc_dev) != 0x4319 &&
+	    siba_get_pci_device(sc->sc_dev) != 0x4324) {
 		have_a = have_bg = 0;
 		if (mac->mac_phy.type == BWN_PHYTYPE_A)
 			have_a = 1;
@@ -1719,30 +1714,30 @@ bwn_attach_core(struct bwn_mac *mac)
 
 	mac->mac_phy.switch_analog(mac, 0);
 
-	siba_dev_down(sd, 0);
+	siba_dev_down(sc->sc_dev, 0);
 fail:
-	siba_powerdown(siba);
+	siba_powerdown(sc->sc_dev);
 	return (error);
 }
 
 static void
 bwn_reset_core(struct bwn_mac *mac, uint32_t flags)
 {
-	struct siba_dev_softc *sd = mac->mac_sd;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint32_t low, ctl;
 
 	flags |= (BWN_TGSLOW_PHYCLOCK_ENABLE | BWN_TGSLOW_PHYRESET);
 
-	siba_dev_up(sd, flags);
+	siba_dev_up(sc->sc_dev, flags);
 	DELAY(2000);
 
-	low = (siba_read_4(sd, SIBA_TGSLOW) | SIBA_TGSLOW_FGC) &
+	low = (siba_read_4(sc->sc_dev, SIBA_TGSLOW) | SIBA_TGSLOW_FGC) &
 	    ~BWN_TGSLOW_PHYRESET;
-	siba_write_4(sd, SIBA_TGSLOW, low);
-	siba_read_4(sd, SIBA_TGSLOW);
+	siba_write_4(sc->sc_dev, SIBA_TGSLOW, low);
+	siba_read_4(sc->sc_dev, SIBA_TGSLOW);
 	DELAY(1000);
-	siba_write_4(sd, SIBA_TGSLOW, low & ~SIBA_TGSLOW_FGC);
-	siba_read_4(sd, SIBA_TGSLOW);
+	siba_write_4(sc->sc_dev, SIBA_TGSLOW, low & ~SIBA_TGSLOW_FGC);
+	siba_read_4(sc->sc_dev, SIBA_TGSLOW);
 	DELAY(1000);
 
 	if (mac->mac_phy.switch_analog != NULL)
@@ -1759,8 +1754,6 @@ bwn_phy_getinfo(struct bwn_mac *mac, int
 {
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_softc *sc = mac->mac_sc;
-	struct siba_dev_softc *sd = mac->mac_sd;
-	struct siba_softc *siba = sd->sd_bus;
 	uint32_t tmp;
 
 	/* PHY */
@@ -1779,10 +1772,10 @@ bwn_phy_getinfo(struct bwn_mac *mac, int
 		goto unsupphy;
 
 	/* RADIO */
-	if (siba->siba_chipid == 0x4317) {
-		if (siba->siba_chiprev == 0)
+	if (siba_get_chipid(sc->sc_dev) == 0x4317) {
+		if (siba_get_chiprev(sc->sc_dev) == 0)
 			tmp = 0x3205017f;
-		else if (siba->siba_chiprev == 1)
+		else if (siba_get_chiprev(sc->sc_dev) == 1)
 			tmp = 0x4205017f;
 		else
 			tmp = 0x5205017f;
@@ -1826,7 +1819,6 @@ bwn_chiptest(struct bwn_mac *mac)
 #define	TESTVAL0	0x55aaaa55
 #define	TESTVAL1	0xaa5555aa
 	struct bwn_softc *sc = mac->mac_sc;
-	struct siba_dev_softc *sd = mac->mac_sd;
 	uint32_t v, backup;
 
 	BWN_LOCK(sc);
@@ -1842,7 +1834,8 @@ bwn_chiptest(struct bwn_mac *mac)
 
 	bwn_shm_write_4(mac, BWN_SHARED, 0, backup);
 
-	if ((sd->sd_id.sd_rev >= 3) && (sd->sd_id.sd_rev <= 10)) {
+	if ((siba_get_revid(sc->sc_dev) >= 3) &&
+	    (siba_get_revid(sc->sc_dev) <= 10)) {
 		BWN_WRITE_2(mac, BWN_TSF_CFP_START, 0xaaaa);
 		BWN_WRITE_4(mac, BWN_TSF_CFP_START, 0xccccbbbb);
 		if (BWN_READ_2(mac, BWN_TSF_CFP_START_LOW) != 0xbbbb)
@@ -2070,15 +2063,17 @@ bwn_phy_g_attach(struct bwn_mac *mac)
 	struct bwn_softc *sc = mac->mac_sc;
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
-	struct siba_dev_softc *sd = mac->mac_sd;
-	struct siba_sprom *sprom = &sd->sd_bus->siba_sprom;
 	unsigned int i;
-	int16_t pab0 = (int16_t)(sprom->pa0b0), pab1 = (int16_t)(sprom->pa0b1),
-	    pab2 = (int16_t)(sprom->pa0b2);
+	int16_t pab0, pab1, pab2;
 	static int8_t bwn_phy_g_tssi2dbm_table[] = BWN_PHY_G_TSSI2DBM_TABLE;
-	int8_t bg = (int8_t)sprom->tssi_bg;
+	int8_t bg;
+
+	bg = (int8_t)siba_sprom_get_tssi_bg(sc->sc_dev);
+	pab0 = (int16_t)siba_sprom_get_pa0b0(sc->sc_dev);
+	pab1 = (int16_t)siba_sprom_get_pa0b1(sc->sc_dev);
+	pab2 = (int16_t)siba_sprom_get_pa0b2(sc->sc_dev);
 
-	if ((sd->sd_bus->siba_chipid == 0x4301) && (phy->rf_ver != 0x2050))
+	if ((siba_get_chipid(sc->sc_dev) == 0x4301) && (phy->rf_ver != 0x2050))
 		device_printf(sc->sc_dev, "not supported anymore\n");
 
 	pg->pg_flags = 0;
@@ -2175,8 +2170,8 @@ bwn_phy_g_prepare_hw(struct bwn_mac *mac
 {
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
+	struct bwn_softc *sc = mac->mac_sc;
 	struct bwn_txpwr_loctl *lo = &pg->pg_loctl;
-	struct siba_softc *bus = mac->mac_sd->sd_bus;
 	static const struct bwn_rfatt rfatt0[] = {
 		{ 3, 0 }, { 1, 0 }, { 5, 0 }, { 7, 0 },	{ 9, 0 }, { 2, 0 },
 		{ 0, 0 }, { 4, 0 }, { 6, 0 }, { 8, 0 }, { 1, 1 }, { 2, 1 },
@@ -2204,12 +2199,12 @@ bwn_phy_g_prepare_hw(struct bwn_mac *mac
 	/* prepare Radio Attenuation */
 	pg->pg_rfatt.padmix = 0;
 
-	if (bus->siba_board_vendor == SIBA_BOARDVENDOR_BCM &&
-	    bus->siba_board_type == SIBA_BOARD_BCM4309G) {
-		if (bus->siba_board_rev < 0x43) {
+	if (siba_get_pci_subvendor(sc->sc_dev) == SIBA_BOARDVENDOR_BCM &&
+	    siba_get_pci_subdevice(sc->sc_dev) == SIBA_BOARD_BCM4309G) {
+		if (siba_get_pci_revid(sc->sc_dev) < 0x43) {
 			pg->pg_rfatt.att = 2;
 			goto done;
-		} else if (bus->siba_board_rev < 0x51) {
+		} else if (siba_get_pci_revid(sc->sc_dev) < 0x51) {
 			pg->pg_rfatt.att = 3;
 			goto done;
 		}
@@ -2228,24 +2223,25 @@ bwn_phy_g_prepare_hw(struct bwn_mac *mac
 			goto done;
 		case 1:
 			if (phy->type == BWN_PHYTYPE_G) {
-				if (bus->siba_board_vendor ==
+				if (siba_get_pci_subvendor(sc->sc_dev) ==
 				    SIBA_BOARDVENDOR_BCM &&
-				    bus->siba_board_type ==
+				    siba_get_pci_subdevice(sc->sc_dev) ==
 				    SIBA_BOARD_BCM4309G &&
-				    bus->siba_board_rev >= 30)
+				    siba_get_pci_revid(sc->sc_dev) >= 30)
 					pg->pg_rfatt.att = 3;
-				else if (bus->siba_board_vendor ==
+				else if (siba_get_pci_subvendor(sc->sc_dev) ==
 				    SIBA_BOARDVENDOR_BCM &&
-				    bus->siba_board_type == SIBA_BOARD_BU4306)
+				    siba_get_pci_subdevice(sc->sc_dev) ==
+				    SIBA_BOARD_BU4306)
 					pg->pg_rfatt.att = 3;
 				else
 					pg->pg_rfatt.att = 1;
 			} else {
-				if (bus->siba_board_vendor ==
+				if (siba_get_pci_subvendor(sc->sc_dev) ==
 				    SIBA_BOARDVENDOR_BCM &&
-				    bus->siba_board_type ==
+				    siba_get_pci_subdevice(sc->sc_dev) ==
 				    SIBA_BOARD_BCM4309G &&
-				    bus->siba_board_rev >= 30)
+				    siba_get_pci_revid(sc->sc_dev) >= 30)
 					pg->pg_rfatt.att = 7;
 				else
 					pg->pg_rfatt.att = 6;
@@ -2253,17 +2249,18 @@ bwn_phy_g_prepare_hw(struct bwn_mac *mac
 			goto done;
 		case 2:
 			if (phy->type == BWN_PHYTYPE_G) {
-				if (bus->siba_board_vendor ==
+				if (siba_get_pci_subvendor(sc->sc_dev) ==
 				    SIBA_BOARDVENDOR_BCM &&
-				    bus->siba_board_type ==
+				    siba_get_pci_subdevice(sc->sc_dev) ==
 				    SIBA_BOARD_BCM4309G &&
-				    bus->siba_board_rev >= 30)
+				    siba_get_pci_revid(sc->sc_dev) >= 30)
 					pg->pg_rfatt.att = 3;
-				else if (bus->siba_board_vendor ==
+				else if (siba_get_pci_subvendor(sc->sc_dev) ==
 				    SIBA_BOARDVENDOR_BCM &&
-				    bus->siba_board_type == SIBA_BOARD_BU4306)
+				    siba_get_pci_subdevice(sc->sc_dev) ==
+				    SIBA_BOARD_BU4306)
 					pg->pg_rfatt.att = 5;
-				else if (bus->siba_chipid == 0x4320)
+				else if (siba_get_chipid(sc->sc_dev) == 0x4320)
 					pg->pg_rfatt.att = 4;
 				else
 					pg->pg_rfatt.att = 3;
@@ -2547,7 +2544,6 @@ bwn_phy_g_recalc_txpwr(struct bwn_mac *m
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
 	struct bwn_softc *sc = mac->mac_sc;
-	struct siba_softc *siba = mac->mac_sd->sd_bus;
 	unsigned int tssi;
 	int cck, ofdm;
 	int power;
@@ -2570,12 +2566,13 @@ bwn_phy_g_recalc_txpwr(struct bwn_mac *m
 	pg->pg_avgtssi = tssi;
 	KASSERT(tssi < BWN_TSSI_MAX, ("%s:%d: fail", __func__, __LINE__));
 
-	max = siba->siba_sprom.maxpwr_bg;
-	if (siba->siba_sprom.bf_lo & BWN_BFL_PACTRL)
+	max = siba_sprom_get_maxpwr_bg(sc->sc_dev);
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL)
 		max -= 3;
 	if (max >= 120) {
 		device_printf(sc->sc_dev, "invalid max TX-power value\n");
-		siba->siba_sprom.maxpwr_bg = max = 80;
+		max = 80;
+		siba_sprom_set_maxpwr_bg(sc->sc_dev, max);
 	}
 
 	power = MIN(MAX((phy->txpower < 0) ? 0 : (phy->txpower << 2), 0), max) -
@@ -2619,9 +2616,8 @@ bwn_phy_g_set_txpwr(struct bwn_mac *mac)
 				txctl = BWN_TXCTL_PA2DB | BWN_TXCTL_TXMIX;
 				rfatt += 2;
 				bbatt += 2;
-			} else if (mac->mac_sd->sd_bus->siba_sprom.
-				   bf_lo &
-				   BWN_BFL_PACTRL) {
+			} else if (siba_sprom_get_bf_lo(sc->sc_dev) &
+			    BWN_BFL_PACTRL) {
 				bbatt += 4 * (rfatt - 2);
 				rfatt = 2;
 			}
@@ -2716,9 +2712,10 @@ static void
 bwn_phy_g_task_60s(struct bwn_mac *mac)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint8_t old = phy->chan;
 
-	if (!(mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_RSSI))
+	if (!(siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_RSSI))
 		return;
 
 	bwn_mac_suspend(mac);
@@ -3182,20 +3179,15 @@ bwn_wme_clear(struct bwn_softc *sc)
 static int
 bwn_core_init(struct bwn_mac *mac)
 {
-#ifdef BWN_DEBUG
 	struct bwn_softc *sc = mac->mac_sc;
-#endif
-	struct siba_dev_softc *sd = mac->mac_sd;
-	struct siba_softc *siba = sd->sd_bus;
-	struct siba_sprom *sprom = &siba->siba_sprom;
 	uint64_t hf;
 	int error;
 
 	KASSERT(mac->mac_status == BWN_MAC_STATUS_UNINIT,
 	    ("%s:%d: fail", __func__, __LINE__));
 
-	siba_powerup(siba, 0);
-	if (!siba_dev_isup(sd))
+	siba_powerup(sc->sc_dev, 0);
+	if (!siba_dev_isup(sc->sc_dev))
 		bwn_reset_core(mac,
 		    mac->mac_phy.gmode ? BWN_TGSLOW_SUPPORT_G : 0);
 
@@ -3219,9 +3211,9 @@ bwn_core_init(struct bwn_mac *mac)
 
 	mac->mac_phy.init_pre(mac);
 
-	siba_pcicore_intr(&siba->siba_pci, sd);
+	siba_pcicore_intr(sc->sc_dev);
 
-	bwn_fix_imcfglobug(mac);
+	siba_fix_imcfglobug(sc->sc_dev);
 	bwn_bt_disable(mac);
 	if (mac->mac_phy.prepare_hw) {
 		error = mac->mac_phy.prepare_hw(mac);
@@ -3232,11 +3224,11 @@ bwn_core_init(struct bwn_mac *mac)
 	if (error)
 		goto fail0;
 	bwn_shm_write_2(mac, BWN_SHARED, BWN_SHARED_COREREV,
-	    mac->mac_sd->sd_id.sd_rev);
+	    siba_get_revid(sc->sc_dev));
 	hf = bwn_hf_read(mac);
 	if (mac->mac_phy.type == BWN_PHYTYPE_G) {
 		hf |= BWN_HF_GPHY_SYM_WORKAROUND;
-		if (sprom->bf_lo & BWN_BFL_PACTRL)
+		if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL)
 			hf |= BWN_HF_PAGAINBOOST_OFDM_ON;
 		if (mac->mac_phy.rev == 1)
 			hf |= BWN_HF_GPHY_DC_CANCELFILTER;
@@ -3247,10 +3239,10 @@ bwn_core_init(struct bwn_mac *mac)
 		if (mac->mac_phy.rf_rev == 6)
 			hf |= BWN_HF_4318_TSSI;
 	}
-	if (sprom->bf_lo & BWN_BFL_CRYSTAL_NOSLOW)
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_CRYSTAL_NOSLOW)
 		hf |= BWN_HF_SLOWCLOCK_REQ_OFF;
-	if ((siba->siba_type == SIBA_TYPE_PCI) &&
-	    (siba->siba_pci.spc_dev->sd_id.sd_rev <= 10))
+	if ((siba_get_type(sc->sc_dev) == SIBA_TYPE_PCI) &&
+	    (siba_get_pcicore_revid(sc->sc_dev) <= 10))
 		hf |= BWN_HF_PCI_SLOWCLOCK_WORKAROUND;
 	hf &= ~BWN_HF_SKIP_CFP_UPDATE;
 	bwn_hf_write(mac, hf);
@@ -3267,7 +3259,7 @@ bwn_core_init(struct bwn_mac *mac)
 	    (mac->mac_phy.type == BWN_PHYTYPE_B) ? 0x1f : 0xf);
 	bwn_shm_write_2(mac, BWN_SCRATCH, BWN_SCRATCH_CONT_MAX, 0x3ff);
 
-	if (siba->siba_type == SIBA_TYPE_PCMCIA || bwn_usedma == 0)
+	if (siba_get_type(sc->sc_dev) == SIBA_TYPE_PCMCIA || bwn_usedma == 0)
 		bwn_pio_init(mac);
 	else
 		bwn_dma_init(mac);
@@ -3277,7 +3269,8 @@ bwn_core_init(struct bwn_mac *mac)
 	bwn_spu_setdelay(mac, 1);
 	bwn_bt_enable(mac);
 
-	siba_powerup(siba, !(sprom->bf_lo & BWN_BFL_CRYSTAL_NOSLOW));
+	siba_powerup(sc->sc_dev,
+	    !(siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_CRYSTAL_NOSLOW));
 	bwn_set_macaddr(mac);
 	bwn_crypt_init(mac);
 
@@ -3290,7 +3283,7 @@ bwn_core_init(struct bwn_mac *mac)
 fail1:
 	bwn_chip_exit(mac);
 fail0:
-	siba_powerdown(siba);
+	siba_powerdown(sc->sc_dev);
 	KASSERT(mac->mac_status == BWN_MAC_STATUS_UNINIT,
 	    ("%s:%d: fail", __func__, __LINE__));
 	return (error);
@@ -3305,7 +3298,7 @@ bwn_core_start(struct bwn_mac *mac)
 	KASSERT(mac->mac_status == BWN_MAC_STATUS_INITED,
 	    ("%s:%d: fail", __func__, __LINE__));
 
-	if (mac->mac_sd->sd_id.sd_rev < 5)
+	if (siba_get_revid(sc->sc_dev) < 5)
 		return;
 
 	while (1) {
@@ -3325,6 +3318,7 @@ bwn_core_start(struct bwn_mac *mac)
 static void
 bwn_core_exit(struct bwn_mac *mac)
 {
+	struct bwn_softc *sc = mac->mac_sc;
 	uint32_t macctl;
 
 	BWN_ASSERT_LOCKED(mac->mac_sc);
@@ -3345,35 +3339,8 @@ bwn_core_exit(struct bwn_mac *mac)
 	bwn_pio_stop(mac);
 	bwn_chip_exit(mac);
 	mac->mac_phy.switch_analog(mac, 0);
-	siba_dev_down(mac->mac_sd, 0);
-	siba_powerdown(mac->mac_sd->sd_bus);
-}
-
-static void
-bwn_fix_imcfglobug(struct bwn_mac *mac)
-{
-	struct siba_dev_softc *sd = mac->mac_sd;
-	struct siba_softc *siba = sd->sd_bus;
-	uint32_t tmp;
-
-	if (siba->siba_pci.spc_dev == NULL)
-		return;
-	if (siba->siba_pci.spc_dev->sd_id.sd_device != SIBA_DEVID_PCI ||
-	    siba->siba_pci.spc_dev->sd_id.sd_rev > 5)
-		return;
-
-	tmp = siba_read_4(sd, SIBA_IMCFGLO) &
-	    ~(SIBA_IMCFGLO_REQTO | SIBA_IMCFGLO_SERTO);
-	switch (siba->siba_type) {
-	case SIBA_TYPE_PCI:
-	case SIBA_TYPE_PCMCIA:
-		tmp |= 0x32;
-		break;
-	case SIBA_TYPE_SSB:
-		tmp |= 0x53;
-		break;
-	}
-	siba_write_4(sd, SIBA_IMCFGLO, tmp);
+	siba_dev_down(sc->sc_dev, 0);
+	siba_powerdown(sc->sc_dev);
 }
 
 static void
@@ -3388,6 +3355,7 @@ bwn_bt_disable(struct bwn_mac *mac)
 static int
 bwn_chip_init(struct bwn_mac *mac)
 {
+	struct bwn_softc *sc = mac->mac_sc;
 	struct bwn_phy *phy = &mac->mac_phy;
 	uint32_t macctl;
 	int error;
@@ -3410,13 +3378,13 @@ bwn_chip_init(struct bwn_mac *mac)
 
 	error = bwn_fw_loadinitvals(mac);
 	if (error) {
-		bwn_gpio_cleanup(mac);
+		siba_gpio_set(sc->sc_dev, 0);
 		return (error);
 	}
 	phy->switch_analog(mac, 1);
 	error = bwn_phy_init(mac);
 	if (error) {
-		bwn_gpio_cleanup(mac);
+		siba_gpio_set(sc->sc_dev, 0);
 		return (error);
 	}
 	if (phy->set_im)
@@ -3428,7 +3396,7 @@ bwn_chip_init(struct bwn_mac *mac)
 	if (phy->type == BWN_PHYTYPE_B)
 		BWN_WRITE_2(mac, 0x005e, BWN_READ_2(mac, 0x005e) | 0x0004);
 	BWN_WRITE_4(mac, 0x0100, 0x01000000);
-	if (mac->mac_sd->sd_id.sd_rev < 5)
+	if (siba_get_revid(sc->sc_dev) < 5)
 		BWN_WRITE_4(mac, 0x010c, 0x01000000);
 
 	BWN_WRITE_4(mac, BWN_MACCTL,
@@ -3438,7 +3406,7 @@ bwn_chip_init(struct bwn_mac *mac)
 	bwn_shm_write_2(mac, BWN_SHARED, 0x0074, 0x0000);
 
 	bwn_set_opmode(mac);
-	if (mac->mac_sd->sd_id.sd_rev < 3) {
+	if (siba_get_revid(sc->sc_dev) < 3) {
 		BWN_WRITE_2(mac, 0x060e, 0x0000);
 		BWN_WRITE_2(mac, 0x0610, 0x8000);
 		BWN_WRITE_2(mac, 0x0604, 0x0000);
@@ -3454,10 +3422,9 @@ bwn_chip_init(struct bwn_mac *mac)
 	BWN_WRITE_4(mac, BWN_DMA3_INTR_MASK, 0x0001dc00);
 	BWN_WRITE_4(mac, BWN_DMA4_INTR_MASK, 0x0000dc00);
 	BWN_WRITE_4(mac, BWN_DMA5_INTR_MASK, 0x0000dc00);
-	siba_write_4(mac->mac_sd, SIBA_TGSLOW,
-	    siba_read_4(mac->mac_sd, SIBA_TGSLOW) | 0x00100000);
-	BWN_WRITE_2(mac, BWN_POWERUP_DELAY,
-	    mac->mac_sd->sd_bus->siba_cc.scc_powerup_delay);
+	siba_write_4(sc->sc_dev, SIBA_TGSLOW,
+	    siba_read_4(sc->sc_dev, SIBA_TGSLOW) | 0x00100000);
+	BWN_WRITE_2(mac, BWN_POWERUP_DELAY, siba_get_cc_powerdelay(sc->sc_dev));
 	return (error);
 }
 
@@ -3619,13 +3586,14 @@ bwn_pio_set_txqueue(struct bwn_mac *mac,
     int index)
 {
 	struct bwn_pio_txpkt *tp;
+	struct bwn_softc *sc = mac->mac_sc;
 	unsigned int i;
 
 	tq->tq_base = bwn_pio_idx2base(mac, index) + BWN_PIO_TXQOFFSET(mac);
 	tq->tq_index = index;
 
 	tq->tq_free = BWN_PIO_MAX_TXPACKETS;
-	if (mac->mac_sd->sd_id.sd_rev >= 8)
+	if (siba_get_revid(sc->sc_dev) >= 8)
 		tq->tq_size = 1920;
 	else {
 		tq->tq_size = bwn_pio_read_2(mac, tq, BWN_PIO_TXQBUFSIZE);
@@ -3664,7 +3632,7 @@ bwn_pio_idx2base(struct bwn_mac *mac, in
 		BWN_PIO11_BASE5,
 	};
 
-	if (mac->mac_sd->sd_id.sd_rev >= 11) {
+	if (siba_get_revid(sc->sc_dev) >= 11) {
 		if (index >= N(bases_rev11))
 			device_printf(sc->sc_dev, "%s: warning\n", __func__);
 		return (bases_rev11[index]);
@@ -3678,9 +3646,10 @@ static void
 bwn_pio_setupqueue_rx(struct bwn_mac *mac, struct bwn_pio_rxqueue *prq,
     int index)
 {
+	struct bwn_softc *sc = mac->mac_sc;
 
 	prq->prq_mac = mac;
-	prq->prq_rev = mac->mac_sd->sd_id.sd_rev;
+	prq->prq_rev = siba_get_revid(sc->sc_dev);
 	prq->prq_base = bwn_pio_idx2base(mac, index) + BWN_PIO_RXQOFFSET(mac);
 	bwn_dma_rxdirectfifo(mac, index, 1);
 }
@@ -4027,6 +3996,7 @@ bwn_dma_32_setdesc(struct bwn_dma_ring *
     int start, int end, int irq)
 {
 	struct bwn_dmadesc32 *descbase = dr->dr_ring_descbase;
+	struct bwn_softc *sc = dr->dr_mac->mac_sc;
 	uint32_t addr, addrext, ctl;
 	int slot;
 
@@ -4036,7 +4006,7 @@ bwn_dma_32_setdesc(struct bwn_dma_ring *
 
 	addr = (uint32_t) (dmaaddr & ~SIBA_DMA_TRANSLATION_MASK);
 	addrext = (uint32_t) (dmaaddr & SIBA_DMA_TRANSLATION_MASK) >> 30;
-	addr |= siba_dma_translation(dr->dr_mac->mac_sd);
+	addr |= siba_dma_translation(sc->sc_dev);
 	ctl = bufsize & BWN_DMA32_DCTL_BYTECNT;
 	if (slot == dr->dr_numslots - 1)
 		ctl |= BWN_DMA32_DCTL_DTABLEEND;
@@ -4115,6 +4085,7 @@ bwn_dma_64_setdesc(struct bwn_dma_ring *
     int start, int end, int irq)
 {
 	struct bwn_dmadesc64 *descbase = dr->dr_ring_descbase;
+	struct bwn_softc *sc = dr->dr_mac->mac_sc;
 	int slot;
 	uint32_t ctl0 = 0, ctl1 = 0;
 	uint32_t addrlo, addrhi;
@@ -4128,7 +4099,7 @@ bwn_dma_64_setdesc(struct bwn_dma_ring *
 	addrhi = (((uint64_t) dmaaddr >> 32) & ~SIBA_DMA_TRANSLATION_MASK);
 	addrext = (((uint64_t) dmaaddr >> 32) & SIBA_DMA_TRANSLATION_MASK) >>
 	    30;
-	addrhi |= (siba_dma_translation(dr->dr_mac->mac_sd) << 1);
+	addrhi |= (siba_dma_translation(sc->sc_dev) << 1);
 	if (slot == dr->dr_numslots - 1)
 		ctl0 |= BWN_DMA64_DCTL0_DTABLEEND;
 	if (start)
@@ -4238,9 +4209,10 @@ bwn_dma_allocringmemory(struct bwn_dma_r
 static void
 bwn_dma_setup(struct bwn_dma_ring *dr)
 {
+	struct bwn_softc *sc = dr->dr_mac->mac_sc;
 	uint64_t ring64;
 	uint32_t addrext, ring32, value;
-	uint32_t trans = siba_dma_translation(dr->dr_mac->mac_sd);
+	uint32_t trans = siba_dma_translation(sc->sc_dev);
 
 	if (dr->dr_tx) {
 		dr->dr_curslot = -1;
@@ -4536,18 +4508,18 @@ bwn_spu_setdelay(struct bwn_mac *mac, in
 static void
 bwn_bt_enable(struct bwn_mac *mac)
 {
-	struct siba_sprom *sprom = &mac->mac_sd->sd_bus->siba_sprom;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint64_t hf;
 
 	if (bwn_bluetooth == 0)
 		return;
-	if ((sprom->bf_lo & BWN_BFL_BTCOEXIST) == 0)
+	if ((siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_BTCOEXIST) == 0)
 		return;
 	if (mac->mac_phy.type != BWN_PHYTYPE_B && !mac->mac_phy.gmode)
 		return;
 
 	hf = bwn_hf_read(mac);
-	if (sprom->bf_lo & BWN_BFL_BTCMOD)
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_BTCMOD)
 		hf |= BWN_HF_BT_COEXISTALT;
 	else
 		hf |= BWN_HF_BT_COEXIST;
@@ -4584,25 +4556,25 @@ bwn_clear_keys(struct bwn_mac *mac)
 static void
 bwn_crypt_init(struct bwn_mac *mac)
 {
+	struct bwn_softc *sc = mac->mac_sc;
 
-	mac->mac_max_nr_keys = (mac->mac_sd->sd_id.sd_rev >= 5) ? 58 : 20;
+	mac->mac_max_nr_keys = (siba_get_revid(sc->sc_dev) >= 5) ? 58 : 20;
 	KASSERT(mac->mac_max_nr_keys <= N(mac->mac_key),
 	    ("%s:%d: fail", __func__, __LINE__));
 	mac->mac_ktp = bwn_shm_read_2(mac, BWN_SHARED, BWN_SHARED_KEY_TABLEP);
 	mac->mac_ktp *= 2;
-	if (mac->mac_sd->sd_id.sd_rev >= 5) {
-		BWN_WRITE_2(mac, BWN_RCMTA_COUNT,
-		    mac->mac_max_nr_keys - 8);
-	}
+	if (siba_get_revid(sc->sc_dev) >= 5)
+		BWN_WRITE_2(mac, BWN_RCMTA_COUNT, mac->mac_max_nr_keys - 8);
 	bwn_clear_keys(mac);
 }
 
 static void
 bwn_chip_exit(struct bwn_mac *mac)
 {
+	struct bwn_softc *sc = mac->mac_sc;
 
 	bwn_phy_exit(mac);
-	bwn_gpio_cleanup(mac);
+	siba_gpio_set(sc->sc_dev, 0);
 }
 
 static int
@@ -4622,33 +4594,31 @@ bwn_fw_fillinfo(struct bwn_mac *mac)
 static int
 bwn_gpio_init(struct bwn_mac *mac)
 {
-	struct siba_softc *bus = mac->mac_sd->sd_bus;
-	struct siba_dev_softc *sd;
-	uint32_t mask = 0x0000001f, set = 0x0000000f;
+	struct bwn_softc *sc = mac->mac_sc;
+	uint32_t mask = 0x1f, set = 0xf, value;
 
 	BWN_WRITE_4(mac, BWN_MACCTL,
 	    BWN_READ_4(mac, BWN_MACCTL) & ~BWN_MACCTL_GPOUT_MASK);
 	BWN_WRITE_2(mac, BWN_GPIO_MASK,
 	    BWN_READ_2(mac, BWN_GPIO_MASK) | 0x000f);
 
-	if (bus->siba_chipid == 0x4301) {
+	if (siba_get_chipid(sc->sc_dev) == 0x4301) {
 		mask |= 0x0060;
 		set |= 0x0060;
 	}
-	if (bus->siba_sprom.bf_lo & BWN_BFL_PACTRL) {
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL) {
 		BWN_WRITE_2(mac, BWN_GPIO_MASK,
 		    BWN_READ_2(mac, BWN_GPIO_MASK) | 0x0200);
 		mask |= 0x0200;
 		set |= 0x0200;
 	}
-	if (mac->mac_sd->sd_id.sd_rev >= 2)
+	if (siba_get_revid(sc->sc_dev) >= 2)
 		mask |= 0x0010;
-	sd = (bus->siba_cc.scc_dev != NULL) ? bus->siba_cc.scc_dev :
-	    bus->siba_pci.spc_dev;
-	if (sd == NULL)
+
+	value = siba_gpio_get(sc->sc_dev);
+	if (value == -1)
 		return (0);
-	siba_write_4(sd, BWN_GPIOCTL,
-	    (siba_read_4(sd, BWN_GPIOCTL) & mask) | set);
+	siba_gpio_set(sc->sc_dev, (value & mask) | set);
 
 	return (0);
 }
@@ -4749,15 +4719,15 @@ bwn_set_opmode(struct bwn_mac *mac)
 		ctl &= ~BWN_MACCTL_STA;
 	ctl |= sc->sc_filters;
 
-	if (mac->mac_sd->sd_id.sd_rev <= 4)
+	if (siba_get_revid(sc->sc_dev) <= 4)
 		ctl |= BWN_MACCTL_PROMISC;
 
 	BWN_WRITE_4(mac, BWN_MACCTL, ctl);
 
 	cfp_pretbtt = 2;
 	if ((ctl & BWN_MACCTL_STA) && !(ctl & BWN_MACCTL_HOSTAP)) {
-		if (mac->mac_sd->sd_bus->siba_chipid == 0x4306 &&
-		    mac->mac_sd->sd_bus->siba_chiprev == 3)
+		if (siba_get_chipid(sc->sc_dev) == 0x4306 &&
+		    siba_get_chiprev(sc->sc_dev) == 3)
 			cfp_pretbtt = 100;
 		else
 			cfp_pretbtt = 50;
@@ -4765,19 +4735,6 @@ bwn_set_opmode(struct bwn_mac *mac)
 	BWN_WRITE_2(mac, 0x612, cfp_pretbtt);
 }
 
-static void
-bwn_gpio_cleanup(struct bwn_mac *mac)
-{
-	struct siba_softc *bus = mac->mac_sd->sd_bus;
-	struct siba_dev_softc *gpiodev, *pcidev = NULL;
-
-	pcidev = bus->siba_pci.spc_dev;
-	gpiodev = bus->siba_cc.scc_dev ? bus->siba_cc.scc_dev : pcidev;
-	if (!gpiodev)
-		return;
-	siba_write_4(gpiodev, BWN_GPIOCTL, 0);
-}
-
 static int
 bwn_dma_gettype(struct bwn_mac *mac)
 {
@@ -4810,6 +4767,7 @@ bwn_phy_g_init_sub(struct bwn_mac *mac)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint16_t i, tmp;
 
 	if (phy->rev == 1)
@@ -4872,7 +4830,7 @@ bwn_phy_g_init_sub(struct bwn_mac *mac)
 		BWN_PHY_SETMASK(mac, BWN_PHY_CCK(0x36), 0x0fff,
 		    (pg->pg_loctl.tx_bias << 12));
 	}
-	if (mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_PACTRL)
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL)
 		BWN_PHY_WRITE(mac, BWN_PHY_CCK(0x2e), 0x8075);
 	else
 		BWN_PHY_WRITE(mac, BWN_PHY_CCK(0x2e), 0x807f);
@@ -4885,7 +4843,7 @@ bwn_phy_g_init_sub(struct bwn_mac *mac)
 		BWN_PHY_WRITE(mac, BWN_PHY_LO_MASK, 0x8078);
 	}
 
-	if (!(mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_RSSI)) {
+	if (!(siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_RSSI)) {
 		for (i = 0; i < 64; i++) {
 			BWN_PHY_WRITE(mac, BWN_PHY_NRSSI_CTRL, i);
 			BWN_PHY_WRITE(mac, BWN_PHY_NRSSI_DATA,
@@ -4904,8 +4862,8 @@ bwn_phy_g_init_sub(struct bwn_mac *mac)
 	if (phy->rf_rev == 8)
 		BWN_PHY_WRITE(mac, BWN_PHY_EXTG(0x05), 0x3230);
 	bwn_phy_hwpctl_init(mac);
-	if ((mac->mac_sd->sd_bus->siba_chipid == 0x4306
-	     && mac->mac_sd->sd_bus->siba_chippkg == 2) || 0) {
+	if ((siba_get_chipid(sc->sc_dev) == 0x4306
+	     && siba_get_chippkg(sc->sc_dev) == 2) || 0) {
 		BWN_PHY_MASK(mac, BWN_PHY_CRS0, 0xbfff);
 		BWN_PHY_MASK(mac, BWN_PHY_OFDM(0xc3), 0x7fff);
 	}
@@ -4923,16 +4881,16 @@ bwn_has_hwpctl(struct bwn_mac *mac)
 static void
 bwn_phy_init_b5(struct bwn_mac *mac)
 {
-	struct siba_softc *bus = mac->mac_sd->sd_bus;
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint16_t offset, value;
 	uint8_t old_channel;
 
 	if (phy->analog == 1)
 		BWN_RF_SET(mac, 0x007a, 0x0050);
-	if ((bus->siba_board_vendor != SIBA_BOARDVENDOR_BCM) &&
-	    (bus->siba_board_type != SIBA_BOARD_BU4306)) {
+	if ((siba_get_pci_subvendor(sc->sc_dev) != SIBA_BOARDVENDOR_BCM) &&
+	    (siba_get_pci_subdevice(sc->sc_dev) != SIBA_BOARD_BU4306)) {
 		value = 0x2120;
 		for (offset = 0x00a8; offset < 0x00c7; offset++) {
 			BWN_PHY_WRITE(mac, offset, value);
@@ -5021,6 +4979,7 @@ bwn_loopback_calcgain(struct bwn_mac *ma
 {
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint16_t backup_phy[16] = { 0 };
 	uint16_t backup_radio[3];
 	uint16_t backup_bband;
@@ -5099,7 +5058,7 @@ bwn_loopback_calcgain(struct bwn_mac *ma
 	BWN_PHY_SET(mac, BWN_PHY_RFOVER, 0x0100);
 	BWN_PHY_MASK(mac, BWN_PHY_RFOVERVAL, 0xcfff);
 
-	if (mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_EXTLNA) {
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_EXTLNA) {
 		if (phy->rev >= 7) {
 			BWN_PHY_SET(mac, BWN_PHY_RFOVER, 0x0800);
 			BWN_PHY_SET(mac, BWN_PHY_RFOVERVAL, 0x8000);
@@ -5399,6 +5358,7 @@ bwn_phy_init_b6(struct bwn_mac *mac)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint16_t offset, val;
 	uint8_t old_channel;
 
@@ -5428,7 +5388,7 @@ bwn_phy_init_b6(struct bwn_mac *mac)
 		BWN_RF_WRITE(mac, 0x5a, 0x88);
 		BWN_RF_WRITE(mac, 0x5b, 0x6b);
 		BWN_RF_WRITE(mac, 0x5c, 0x0f);
-		if (mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_ALTIQ) {
+		if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_ALTIQ) {
 			BWN_RF_WRITE(mac, 0x5d, 0xfa);
 			BWN_RF_WRITE(mac, 0x5e, 0xd8);
 		} else {
@@ -5509,6 +5469,7 @@ static void
 bwn_phy_init_a(struct bwn_mac *mac)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
+	struct bwn_softc *sc = mac->mac_sc;
 
 	KASSERT(phy->type == BWN_PHYTYPE_A || phy->type == BWN_PHYTYPE_G,
 	    ("%s:%d: fail", __func__, __LINE__));
@@ -5525,7 +5486,7 @@ bwn_phy_init_a(struct bwn_mac *mac)
 	bwn_wa_init(mac);
 
 	if (phy->type == BWN_PHYTYPE_G &&
-	    (mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_PACTRL))
+	    (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL))
 		BWN_PHY_SETMASK(mac, BWN_PHY_OFDM(0x6e), 0xe000, 0x3cf);
 }
 
@@ -5776,7 +5737,7 @@ static void
 bwn_wa_init(struct bwn_mac *mac)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
-	struct siba_softc *bus = mac->mac_sd->sd_bus;
+	struct bwn_softc *sc = mac->mac_sc;
 
 	KASSERT(phy->type == BWN_PHYTYPE_G, ("%s fail", __func__));
 
@@ -5795,9 +5756,9 @@ bwn_wa_init(struct bwn_mac *mac)
 		KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__));
 	}
 
-	if (bus->siba_board_vendor != SIBA_BOARDVENDOR_BCM ||
-	    bus->siba_board_type != SIBA_BOARD_BU4306 ||
-	    bus->siba_board_rev != 0x17) {
+	if (siba_get_pci_subvendor(sc->sc_dev) != SIBA_BOARDVENDOR_BCM ||
+	    siba_get_pci_subdevice(sc->sc_dev) != SIBA_BOARD_BU4306 ||
+	    siba_get_pci_revid(sc->sc_dev) != 0x17) {
 		if (phy->rev < 2) {
 			bwn_ofdmtab_write_2(mac, BWN_OFDMTAB_GAINX_R1, 1,
 			    0x0002);
@@ -5806,7 +5767,8 @@ bwn_wa_init(struct bwn_mac *mac)
 		} else {
 			bwn_ofdmtab_write_2(mac, BWN_OFDMTAB_GAINX, 1, 0x0002);
 			bwn_ofdmtab_write_2(mac, BWN_OFDMTAB_GAINX, 2, 0x0001);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00:23: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 02CE7106566C;
	Wed, 21 Apr 2010 00:23:24 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E570A8FC17;
	Wed, 21 Apr 2010 00:23: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 o3L0NN1V090085;
	Wed, 21 Apr 2010 00:23:23 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0NNC0090083;
	Wed, 21 Apr 2010 00:23:23 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210023.o3L0NNC0090083@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:23: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: r206970 - in stable/8/sys/dev: bwn siba
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, 21 Apr 2010 00:23:24 -0000

Author: weongyo
Date: Wed Apr 21 00:23:23 2010
New Revision: 206970
URL: http://svn.freebsd.org/changeset/base/206970

Log:
  MFC r205141:
    enables S/W beacon miss handler.
  
    Reported by:	imp

Modified:
  stable/8/sys/dev/bwn/if_bwn.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/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:22:16 2010	(r206969)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:23:23 2010	(r206970)
@@ -1076,6 +1076,8 @@ bwn_attach_post(struct bwn_softc *sc)
 		| IEEE80211_C_TXPMGT		/* capable of txpow mgt */
 		;
 
+	ic->ic_flags_ext |= IEEE80211_FEXT_SWBMISS;	/* s/w bmiss */
+
 	/* call MI attach routine. */
 	ieee80211_ifattach(ic,
 	    bwn_is_valid_ether_addr(siba_sprom_get_mac_80211a(sc->sc_dev)) ?

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00:26: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 6A60E106564A;
	Wed, 21 Apr 2010 00:26:42 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 401E68FC21;
	Wed, 21 Apr 2010 00:26: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 o3L0QgGU090836;
	Wed, 21 Apr 2010 00:26:42 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0Qg2B090835;
	Wed, 21 Apr 2010 00:26:42 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210026.o3L0Qg2B090835@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:26:42 +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: r206971 - stable/8/sys/dev/siba
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, 21 Apr 2010 00:26:42 -0000

Author: weongyo
Date: Wed Apr 21 00:26:41 2010
New Revision: 206971
URL: http://svn.freebsd.org/changeset/base/206971

Log:
  remove svn:mergeinfo properties committed during my MFCs.

Modified:
Directory Properties:
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00:42: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 38E5C1065676;
	Wed, 21 Apr 2010 00:42:49 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org
	[IPv6:2001:2f0:104:8060::1])
	by mx1.freebsd.org (Postfix) with ESMTP id D00398FC20;
	Wed, 21 Apr 2010 00:42:48 +0000 (UTC)
Received: from localhost (authenticated bits=0)
	by sakura.ccs.furiru.org (unknown) with ESMTP id o3L0gg6D021137;
	Wed, 21 Apr 2010 09:42:46 +0900 (JST)
	(envelope-from nyan@FreeBSD.org)
Date: Wed, 21 Apr 2010 09:42:42 +0900 (JST)
Message-Id: <20100421.094242.94902748.nyan@FreeBSD.org>
To: rpaulo@FreeBSD.org
From: TAKAHASHI Yoshihiro 
In-Reply-To: <201004202104.o3KL4vHv043955@svn.freebsd.org>
References: <201004202104.o3KL4vHv043955@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: r206922 - head/sys/x86/isa
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, 21 Apr 2010 00:42:49 -0000

In article <201004202104.o3KL4vHv043955@svn.freebsd.org>
Rui Paulo  writes:

> Log:
>   Fix another instance of lapic_cyclic_clock_func.
> 
> Modified:
>   head/sys/x86/isa/clock.c
> 
> Modified: head/sys/x86/isa/clock.c
> ==============================================================================
> --- head/sys/x86/isa/clock.c	Tue Apr 20 21:03:42 2010	(r206921)
> +++ head/sys/x86/isa/clock.c	Tue Apr 20 21:04:57 2010	(r206922)
> @@ -186,8 +186,8 @@ clkintr(struct trapframe *frame)
>  	 * timers.
>  	 */
>  	int cpu = PCPU_GET(cpuid);
> -	if (lapic_cyclic_clock_func[cpu] != NULL)
> -		(*lapic_cyclic_clock_func[cpu])(frame);
> +	if (cyclic_clock_func[cpu] != NULL)
> +		(*cyclic_clock_func[cpu])(frame);
>  #endif
>  
>  	if (using_atrtc_timer) {

The same change is needed for sys/pc98/cbus/clock.c.

---
TAKAHASHI Yoshihiro 

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 00:52: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 57CA0106564A;
	Wed, 21 Apr 2010 00:52:56 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 462078FC1E;
	Wed, 21 Apr 2010 00:52: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 o3L0quBA096707;
	Wed, 21 Apr 2010 00:52:56 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0qu4m096704;
	Wed, 21 Apr 2010 00:52:56 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <201004210052.o3L0qu4m096704@svn.freebsd.org>
From: Robert Watson 
Date: Wed, 21 Apr 2010 00:52: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: r206972 - head/tools/tools/netrate/tcpp
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, 21 Apr 2010 00:52:56 -0000

Author: rwatson
Date: Wed Apr 21 00:52:55 2010
New Revision: 206972
URL: http://svn.freebsd.org/changeset/base/206972

Log:
  Merge @176820, @176822, @177156 to tcpp from P4 to HEAD:
  
    Improve accuracy of connection data transfer math.
  
    Disable Nagle's algorithm to avoid delaying transfers of data --
    will want to refine this to combine payload with header transfer,
    however.
  
    Now that we're running w/o Nagle, try to send the initial data
    burst with the header in a single TCP segment.
  
    Prefer %zu to %ju for size_t.
  
  MFC after:	1 week
  Sponsored by:	Juniper, Inc.

Modified:
  head/tools/tools/netrate/tcpp/tcpp_client.c
  head/tools/tools/netrate/tcpp/tcpp_server.c

Modified: head/tools/tools/netrate/tcpp/tcpp_client.c
==============================================================================
--- head/tools/tools/netrate/tcpp/tcpp_client.c	Wed Apr 21 00:26:41 2010	(r206971)
+++ head/tools/tools/netrate/tcpp/tcpp_client.c	Wed Apr 21 00:52:55 2010	(r206972)
@@ -33,9 +33,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -82,6 +84,7 @@ static int			 kq;
 static int			 started;	/* Number started so far. */
 static int			 finished;	/* Number finished so far. */
 static int			 counter;	/* IP number offset. */
+static uint64_t			 payload_len;
 
 static struct connection *
 tcpp_client_newconn(void)
@@ -109,6 +112,9 @@ tcpp_client_newconn(void)
 	i = 1;
 	if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof(i)) < 0)
 		err(-1, "setsockopt");
+	i = 1;
+	if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &i, sizeof(i)) < 0)
+		err(-1, "setsockopt");
 #if 0
 	i = 1;
 	if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)) < 0)
@@ -131,7 +137,7 @@ tcpp_client_newconn(void)
 	conn->conn_magic = CONNECTION_MAGIC;
 	conn->conn_fd = fd;
 	conn->conn_header.th_magic = TCPP_MAGIC;
-	conn->conn_header.th_len = bflag;
+	conn->conn_header.th_len = payload_len;
 	tcpp_header_encode(&conn->conn_header);
 
 	EV_SET(&kev, fd, EVFILT_WRITE, EV_ADD, 0, 0, conn);
@@ -156,16 +162,22 @@ static void
 tcpp_client_handleconn(struct kevent *kev)
 {
 	struct connection *conn;
-	ssize_t len;
+	struct iovec iov[2];
+	ssize_t len, header_left;
 
 	conn = kev->udata;
 	if (conn->conn_magic != CONNECTION_MAGIC)
 		errx(-1, "tcpp_client_handleconn: magic");
 
 	if (conn->conn_header_sent < sizeof(conn->conn_header)) {
-		len = write(conn->conn_fd, ((u_char *)&conn->conn_header) +
-		    conn->conn_header_sent, sizeof(conn->conn_header) -
-		    conn->conn_header_sent);
+		header_left = sizeof(conn->conn_header) -
+		    conn->conn_header_sent;
+		iov[0].iov_base = ((u_char *)&conn->conn_header) +
+		    conn->conn_header_sent;
+		iov[0].iov_len = header_left;
+		iov[1].iov_base = buffer;
+		iov[1].iov_len = min(sizeof(buffer), payload_len);
+		len = writev(conn->conn_fd, iov, 2);
 		if (len < 0) {
 			tcpp_client_closeconn(conn);
 			err(-1, "tcpp_client_handleconn: header write");
@@ -175,10 +187,14 @@ tcpp_client_handleconn(struct kevent *ke
 			errx(-1, "tcpp_client_handleconn: header write "
 			    "premature EOF");
 		}
-		conn->conn_header_sent += len;
+		if (len > header_left) {
+			conn->conn_data_sent += (len - header_left);
+			conn->conn_header_sent += header_left;
+		} else
+			conn->conn_header_sent += len;
 	} else {
 		len = write(conn->conn_fd, buffer, min(sizeof(buffer),
-		    bflag - conn->conn_data_sent));
+		    payload_len - conn->conn_data_sent));
 		if (len < 0) {
 			tcpp_client_closeconn(conn);
 			err(-1, "tcpp_client_handleconn: data write");
@@ -189,12 +205,12 @@ tcpp_client_handleconn(struct kevent *ke
 			    "premature EOF");
 		}
 		conn->conn_data_sent += len;
-		if (conn->conn_data_sent >= bflag) {
-			/*
-			 * All is well.
-			 */
-			tcpp_client_closeconn(conn);
-		}
+	}
+	if (conn->conn_data_sent >= payload_len) {
+		/*
+		 * All is well.
+		 */
+		tcpp_client_closeconn(conn);
 	}
 }
 
@@ -261,6 +277,11 @@ tcpp_client(void)
 	pid_t pid;
 	int i, failed, status;
 
+	if (bflag < sizeof(struct tcpp_header))
+		errx(-1, "Can't use -b less than %zu\n",
+		   sizeof(struct tcpp_header));
+	payload_len = bflag - sizeof(struct tcpp_header);
+
 	pid_list = malloc(sizeof(*pid_list) * pflag);
 	if (pid_list == NULL)
 		err(-1, "malloc pid_list");

Modified: head/tools/tools/netrate/tcpp/tcpp_server.c
==============================================================================
--- head/tools/tools/netrate/tcpp/tcpp_server.c	Wed Apr 21 00:26:41 2010	(r206971)
+++ head/tools/tools/netrate/tcpp/tcpp_server.c	Wed Apr 21 00:52:55 2010	(r206972)
@@ -37,6 +37,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -239,6 +240,10 @@ tcpp_server_worker(int workernum)
 	if (setsockopt(listen_sock, SOL_SOCKET, SO_REUSEPORT, &i, sizeof(i))
 	    < 0)
 		err(-1, "setsockopt");
+	i = 1;
+	if (setsockopt(listen_sock, IPPROTO_TCP, TCP_NODELAY, &i, sizeof(i))
+	    < 0)
+		err(-1, "setsockopt");
 	if (bind(listen_sock, (struct sockaddr *)&localipbase,
 	    sizeof(localipbase)) < 0)
 		err(-1, "bind");

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 01:13: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 533411065678;
	Wed, 21 Apr 2010 01:13:09 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 42D5E8FC22;
	Wed, 21 Apr 2010 01:13: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 o3L1D9s0001273;
	Wed, 21 Apr 2010 01:13:09 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L1D9rw001271;
	Wed, 21 Apr 2010 01:13:09 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004210113.o3L1D9rw001271@svn.freebsd.org>
From: Xin LI 
Date: Wed, 21 Apr 2010 01:13: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: r206973 - head/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: Wed, 21 Apr 2010 01:13:09 -0000

Author: delphij
Date: Wed Apr 21 01:13:08 2010
New Revision: 206973
URL: http://svn.freebsd.org/changeset/base/206973

Log:
  When CPUTYPE is defined to any value, on amd64 platform "mmx" is
  available through MACHINE_CPU, indicating the CPU supports that
  feature, as done by revision 138685.
  
  This changeset adds "mmx" into the default amd64 MACHINE_CPU list
  when no CPUTYPE is specified to provide consistent behavior.
  
  PR:		amd64/145593
  Submitted by:	mm
  MFC after:	2 weeks

Modified:
  head/share/mk/bsd.cpu.mk

Modified: head/share/mk/bsd.cpu.mk
==============================================================================
--- head/share/mk/bsd.cpu.mk	Wed Apr 21 00:52:55 2010	(r206972)
+++ head/share/mk/bsd.cpu.mk	Wed Apr 21 01:13:08 2010	(r206973)
@@ -9,7 +9,7 @@ _CPUCFLAGS =
 . if ${MACHINE_ARCH} == "i386"
 MACHINE_CPU = i486
 . elif ${MACHINE_ARCH} == "amd64"
-MACHINE_CPU = amd64 sse2 sse
+MACHINE_CPU = amd64 sse2 sse mmx
 . elif ${MACHINE_ARCH} == "ia64"
 MACHINE_CPU = itanium
 . elif ${MACHINE_ARCH} == "powerpc"

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 01:48: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 C7C97106566C;
	Wed, 21 Apr 2010 01:48:11 +0000 (UTC)
	(envelope-from yanefbsd@gmail.com)
Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com
	[209.85.212.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 36E208FC22;
	Wed, 21 Apr 2010 01:48:11 +0000 (UTC)
Received: by vws8 with SMTP id 8so103768vws.13
	for ; Tue, 20 Apr 2010 18:48:10 -0700 (PDT)
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:received:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=M6W+e5oYVKjEatmRgTNQM/fqvDPIoI9D5ThtSUg1D9Q=;
	b=kg7CUKr3i/kolMYKYVY4wq2EdaeFol6p1cbPQHdoEPsFAl+kkocjSfG/Zq+EZ9Wh+q
	d1C7mn8/MKfo8LidT9P7bsLmvTcIXD++TT8CWygStEow6bYWklOk6o+fFPxfGXe02fpm
	TVriNB5rtRtIhozSnW250CVP8OFIPVsV/OMPQ=
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=GdMIUrWVfIgKQMtn2OuJsvIGrxamqv+XgmeW/b0Rtw5Z/17KZUpcITEXKHdS25MtD4
	2kOAGOVs6Levce/gjfjnx4XXTxUwSaN01LbaRCKvda1lhfkwP10sYUBn2HHhY0q/t2A1
	wVXZ229ftvR6zuEex+dGCvCz/mxfQuk0sdwyI=
MIME-Version: 1.0
Received: by 10.229.28.85 with HTTP; Tue, 20 Apr 2010 18:48:10 -0700 (PDT)
In-Reply-To: <201004210113.o3L1D9rw001271@svn.freebsd.org>
References: <201004210113.o3L1D9rw001271@svn.freebsd.org>
Date: Tue, 20 Apr 2010 18:48:10 -0700
Received: by 10.229.238.70 with SMTP id kr6mr3790259qcb.49.1271814490414; Tue, 
	20 Apr 2010 18:48:10 -0700 (PDT)
Message-ID: 
From: Garrett Cooper 
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: r206973 - head/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: Wed, 21 Apr 2010 01:48:11 -0000

On Tue, Apr 20, 2010 at 6:13 PM, Xin LI  wrote:
> Author: delphij
> Date: Wed Apr 21 01:13:08 2010
> New Revision: 206973
> URL: http://svn.freebsd.org/changeset/base/206973
>
> Log:
> =A0When CPUTYPE is defined to any value, on amd64 platform "mmx" is
> =A0available through MACHINE_CPU, indicating the CPU supports that
> =A0feature, as done by revision 138685.
>
> =A0This changeset adds "mmx" into the default amd64 MACHINE_CPU list
> =A0when no CPUTYPE is specified to provide consistent behavior.

The crowd goes wild XD...
Thanks Martin and Xin Li!
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 02:02: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 390C6106564A;
	Wed, 21 Apr 2010 02:02:30 +0000 (UTC)
	(envelope-from rysto32@gmail.com)
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 735858FC1A;
	Wed, 21 Apr 2010 02:02:29 +0000 (UTC)
Received: by wye20 with SMTP id 20so609970wye.13
	for ; Tue, 20 Apr 2010 19:02:28 -0700 (PDT)
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:received:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=ekzIPNLukoH34S3WW6eryGHrKadV5/qiFMpzFu2cn/g=;
	b=vsaSJzEoswNDM13/DQfrZiEUvQzAc7ODFdNKG32eQZhoXCW0oXnUa4G6a1FpuMz28V
	4h2YFXlPi5XK16Q0GHQEPnOLM6NFH7R4dTytcdZCQWjKgTAlw79mlzg6t0xihTZ99QR3
	Be8fZDXQHi/WkiJDmMkNrGJfXp5Y34iE69w54=
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=ud/6lpnzTeYr0zicQj+sGxxLAvr0KVPZW9HpGxNlnzSLE2x8QqBRUShJnKFiBCObIp
	I7fP85VRmsWNEbL3wCXasNCFkNJ5nswBz1/vGw3OsxhPBB4LaELXnnicOSw5PmK6tVBu
	jHnCbDtXqm+1WfSGFYsVnuhYUp59QLX4Q0PSw=
MIME-Version: 1.0
Received: by 10.216.53.202 with HTTP; Tue, 20 Apr 2010 18:36:19 -0700 (PDT)
In-Reply-To: <201004202243.o3KMhrkX066946@svn.freebsd.org>
References: <201004202243.o3KMhrkX066946@svn.freebsd.org>
Date: Tue, 20 Apr 2010 21:36:19 -0400
Received: by 10.216.184.195 with SMTP id s45mr421167wem.28.1271813779447; Tue, 
	20 Apr 2010 18:36:19 -0700 (PDT)
Message-ID: 
From: Ryan Stone 
To: Ryan Stone 
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: r206945 - 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: Wed, 21 Apr 2010 02:02:30 -0000

Sorry, I forgot the following:

Approved by: emaste (mentor) and jkoshy (mentor)


I'm looking into why svn wasn't using the default checkin template for me.

On Tue, Apr 20, 2010 at 6:43 PM, Ryan Stone  wrote:
> Author: rstone
> Date: Tue Apr 20 22:43:53 2010
> New Revision: 206945
> URL: http://svn.freebsd.org/changeset/base/206945
>
> Log:
> =A0add new committer rstone to committers-src.dot
>
> Modified:
> =A0head/share/misc/committers-src.dot
>
> Modified: head/share/misc/committers-src.dot
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=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/share/misc/committers-src.dot =A0Tue Apr 20 22:32:34 2010 =A0 =
=A0 =A0 =A0(r206944)
> +++ head/share/misc/committers-src.dot =A0Tue Apr 20 22:43:53 2010 =A0 =
=A0 =A0 =A0(r206945)
> @@ -170,6 +170,7 @@ roberto [label=3D"Ollivier Robert\nroberto
> =A0rpaulo [label=3D"Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25"]
> =A0rrs [label=3D"Randall R Stewart\nrrs@FreeBSD.org\n2007/02/08"]
> =A0rse [label=3D"Ralf S. Engelschall\nrse@FreeBSD.org\n1997/07/31"]
> +rstone [label=3D"Ryan Stone\nrstone@FreeBSD.org\n2010/04/19"]
> =A0ru [label=3D"Ruslan Ermilov\nru@FreeBSD.org\n1999/05/27"]
> =A0rwatson [label=3D"Robert N. M. Watson\nrwatson@FreeBSD.org\n1999/12/16=
"]
> =A0sam [label=3D"Sam Leffler\nsam@FreeBSD.org\n2002/07/02"]
> @@ -271,6 +272,8 @@ ed -> uqs
> =A0eivind -> des
> =A0eivind -> rwatson
>
> +emaste -> rstone
> +
> =A0emax -> markus
>
> =A0gallatin -> ticso
> @@ -342,6 +345,7 @@ jkh -> yar
>
> =A0jkoshy -> kaiw
> =A0jkoshy -> fabient
> +jkoshy -> rstone
>
> =A0jlemon -> bmilekic
> =A0jlemon -> brooks
>

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 05:10: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 46F2A106566C;
	Wed, 21 Apr 2010 05:10:54 +0000 (UTC) (envelope-from alc@cs.rice.edu)
Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31])
	by mx1.freebsd.org (Postfix) with ESMTP id 162868FC16;
	Wed, 21 Apr 2010 05:10:53 +0000 (UTC)
Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1])
	by mail.cs.rice.edu (Postfix) with ESMTP id 772ED2C2AEB;
	Wed, 21 Apr 2010 00:10:53 -0500 (CDT)
X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu
Received: from mail.cs.rice.edu ([127.0.0.1])
	by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new,
	port 10024)
	with LMTP id sWxE+yQNxR-m; Wed, 21 Apr 2010 00:10:45 -0500 (CDT)
Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net
	(adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.cs.rice.edu (Postfix) with ESMTP id 194302C2A92;
	Wed, 21 Apr 2010 00:10:45 -0500 (CDT)
Message-ID: <4BCE88D4.5080600@cs.rice.edu>
Date: Wed, 21 Apr 2010 00:10:44 -0500
From: Alan Cox 
User-Agent: Thunderbird 2.0.0.24 (X11/20100327)
MIME-Version: 1.0
To: Peter Jeremy 
References: <201004182129.o3ILTSCd098832@svn.freebsd.org>
	<20100420205845.GA38549@server.vk2pj.dyndns.org>
In-Reply-To: <20100420205845.GA38549@server.vk2pj.dyndns.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Alan Cox , svn-src-head@FreeBSD.org,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject: Re: svn commit: r206814 - head/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: Wed, 21 Apr 2010 05:10:54 -0000

Peter Jeremy wrote:
> On 2010-Apr-18 21:29:28 +0000, Alan Cox  wrote:
>   
>>  Remove a nonsensical test from vm_pageout_clean().  A page can't be in the
>>  inactive queue and have a non-zero wire count.
>>     
>
> Should this test be turned into a KASSERT()?
>
>   

I considered it, but no I don't think an assertion is called for.  We 
already have checks in the places where a page is wired or unwired.

Regards,
Alan


From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 05:35: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 3866C106564A;
	Wed, 21 Apr 2010 05:35:07 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 273BB8FC1C;
	Wed, 21 Apr 2010 05:35: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 o3L5Z7ic060019;
	Wed, 21 Apr 2010 05:35:07 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L5Z7f6060017;
	Wed, 21 Apr 2010 05:35:07 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201004210535.o3L5Z7f6060017@svn.freebsd.org>
From: Maxim Konovalov 
Date: Wed, 21 Apr 2010 05:35: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: r206980 - stable/8/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: Wed, 21 Apr 2010 05:35:07 -0000

Author: maxim
Date: Wed Apr 21 05:35:06 2010
New Revision: 206980
URL: http://svn.freebsd.org/changeset/base/206980

Log:
  MFC r205671: trim leading w/space.

Modified:
  stable/8/usr.sbin/sysinstall/sysinstall.8
Directory Properties:
  stable/8/usr.sbin/sysinstall/   (props changed)

Modified: stable/8/usr.sbin/sysinstall/sysinstall.8
==============================================================================
--- stable/8/usr.sbin/sysinstall/sysinstall.8	Wed Apr 21 04:58:48 2010	(r206979)
+++ stable/8/usr.sbin/sysinstall/sysinstall.8	Wed Apr 21 05:35:06 2010	(r206980)
@@ -543,7 +543,7 @@ Commit any rc.conf changes to disk.
 Preserve existing rc.conf parameters.
 This is useful if you have a post-install script which modifies rc.conf.
 .El
- .It installExpress
+.It installExpress
 Start an "express" installation, asking few questions of
 the user.
 .Pp

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 05:36: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 21B061065672;
	Wed, 21 Apr 2010 05:36:54 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 10F6B8FC22;
	Wed, 21 Apr 2010 05:36: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 o3L5arAO060457;
	Wed, 21 Apr 2010 05:36:53 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L5arh8060455;
	Wed, 21 Apr 2010 05:36:53 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201004210536.o3L5arh8060455@svn.freebsd.org>
From: Maxim Konovalov 
Date: Wed, 21 Apr 2010 05:36:53 +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: r206981 - stable/8/sbin/setkey
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, 21 Apr 2010 05:36:54 -0000

Author: maxim
Date: Wed Apr 21 05:36:53 2010
New Revision: 206981
URL: http://svn.freebsd.org/changeset/base/206981

Log:
  MFC r205672: fix typo.

Modified:
  stable/8/sbin/setkey/setkey.8
Directory Properties:
  stable/8/sbin/setkey/   (props changed)

Modified: stable/8/sbin/setkey/setkey.8
==============================================================================
--- stable/8/sbin/setkey/setkey.8	Wed Apr 21 05:35:06 2010	(r206980)
+++ stable/8/sbin/setkey/setkey.8	Wed Apr 21 05:36:53 2010	(r206981)
@@ -674,7 +674,7 @@ add 10.0.11.41 10.0.11.33 esp 0x10001
 	-A hmac-md5 "authentication!!" ;
 
 .Ed
-Get the SA information assocaited with first example above:
+Get the SA information associated with first example above:
 .Bd -literal -offset
 get 3ffe:501:4819::1 3ffe:501:481d::1 ah 123456 ;
 

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 05:38: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 723F71065674;
	Wed, 21 Apr 2010 05:38:16 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 61BBB8FC08;
	Wed, 21 Apr 2010 05:38: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 o3L5cGJG060807;
	Wed, 21 Apr 2010 05:38:16 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L5cGmo060805;
	Wed, 21 Apr 2010 05:38:16 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201004210538.o3L5cGmo060805@svn.freebsd.org>
From: Maxim Konovalov 
Date: Wed, 21 Apr 2010 05:38:16 +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: r206982 - stable/8/usr.sbin/mtree
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, 21 Apr 2010 05:38:16 -0000

Author: maxim
Date: Wed Apr 21 05:38:16 2010
New Revision: 206982
URL: http://svn.freebsd.org/changeset/base/206982

Log:
  MFC r205873: remove duplication, improve wording.

Modified:
  stable/8/usr.sbin/mtree/mtree.8
Directory Properties:
  stable/8/usr.sbin/mtree/   (props changed)

Modified: stable/8/usr.sbin/mtree/mtree.8
==============================================================================
--- stable/8/usr.sbin/mtree/mtree.8	Wed Apr 21 05:36:53 2010	(r206981)
+++ stable/8/usr.sbin/mtree/mtree.8	Wed Apr 21 05:38:16 2010	(r206982)
@@ -41,9 +41,6 @@
 .Op Fl f Ar spec
 .Ek
 .Bk -words
-.Op Fl f Ar spec
-.Ek
-.Bk -words
 .Op Fl K Ar keywords
 .Ek
 .Bk -words
@@ -119,7 +116,7 @@ Same as
 except a status of 2 is returned if the file hierarchy did not match
 the specification.
 .It Fl w
-Make some errorconditions non-fatal warnings.
+Make some errors non-fatal warnings.
 .It Fl x
 Do not descend below mount points in the file hierarchy.
 .It Fl f Ar file

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 05:39: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 095F6106567B;
	Wed, 21 Apr 2010 05:39:52 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ECD528FC24;
	Wed, 21 Apr 2010 05:39: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 o3L5dpIh061185;
	Wed, 21 Apr 2010 05:39:51 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L5dpL4061183;
	Wed, 21 Apr 2010 05:39:51 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201004210539.o3L5dpL4061183@svn.freebsd.org>
From: Maxim Konovalov 
Date: Wed, 21 Apr 2010 05:39: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: r206983 - stable/8/usr.bin/sockstat
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, 21 Apr 2010 05:39:52 -0000

Author: maxim
Date: Wed Apr 21 05:39:51 2010
New Revision: 206983
URL: http://svn.freebsd.org/changeset/base/206983

Log:
  MFC r205874: make sockstat -6 output more readable for long ipv6
  addresses.

Modified:
  stable/8/usr.bin/sockstat/sockstat.c
Directory Properties:
  stable/8/usr.bin/sockstat/   (props changed)

Modified: stable/8/usr.bin/sockstat/sockstat.c
==============================================================================
--- stable/8/usr.bin/sockstat/sockstat.c	Wed Apr 21 05:38:16 2010	(r206982)
+++ stable/8/usr.bin/sockstat/sockstat.c	Wed Apr 21 05:39:51 2010	(r206983)
@@ -621,6 +621,8 @@ display(void)
 		case AF_INET:
 		case AF_INET6:
 			pos += printaddr(s->family, &s->laddr);
+			if (s->family == AF_INET6 && pos >= 58)
+				pos += xprintf(" ");
 			while (pos < 58)
 				pos += xprintf(" ");
 			pos += printaddr(s->family, &s->faddr);

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 06:33: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 39DE5106564A;
	Wed, 21 Apr 2010 06:33:11 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 242D18FC24;
	Wed, 21 Apr 2010 06:33: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 o3L6XBuA072911;
	Wed, 21 Apr 2010 06:33:11 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L6XBtp072908;
	Wed, 21 Apr 2010 06:33:11 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201004210633.o3L6XBtp072908@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 21 Apr 2010 06:33:11 +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: r206984 - in stable/8: crypto/openssh
	crypto/openssh/openbsd-compat lib/libpam/modules/pam_ssh
	secure/lib/libssh secure/libexec secure/libexec/sftp-server
	secure/libexec/ssh-keysign sec...
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, 21 Apr 2010 06:33:11 -0000

Author: des
Date: Wed Apr 21 06:33:10 2010
New Revision: 206984
URL: http://svn.freebsd.org/changeset/base/206984

Log:
  MFH OpenSSH 5.4p1

Added:
  stable/8/crypto/openssh/PROTOCOL.certkeys
     - copied unchanged from r206396, head/crypto/openssh/PROTOCOL.certkeys
  stable/8/crypto/openssh/PROTOCOL.mux
     - copied unchanged from r206396, head/crypto/openssh/PROTOCOL.mux
  stable/8/crypto/openssh/openbsd-compat/pwcache.c
     - copied unchanged from r206396, head/crypto/openssh/openbsd-compat/pwcache.c
  stable/8/crypto/openssh/pkcs11.h
     - copied unchanged from r206396, head/crypto/openssh/pkcs11.h
  stable/8/crypto/openssh/roaming.h
     - copied, changed from r198019, head/crypto/openssh/roaming.h
  stable/8/crypto/openssh/roaming_client.c
     - copied unchanged from r206396, head/crypto/openssh/roaming_client.c
  stable/8/crypto/openssh/roaming_common.c
     - copied, changed from r198019, head/crypto/openssh/roaming_common.c
  stable/8/crypto/openssh/roaming_dummy.c
     - copied unchanged from r198019, head/crypto/openssh/roaming_dummy.c
  stable/8/crypto/openssh/roaming_serv.c
     - copied unchanged from r206396, head/crypto/openssh/roaming_serv.c
  stable/8/crypto/openssh/schnorr.h
     - copied unchanged from r198019, head/crypto/openssh/schnorr.h
  stable/8/crypto/openssh/ssh-pkcs11-client.c
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11-client.c
  stable/8/crypto/openssh/ssh-pkcs11-helper.0
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11-helper.0
  stable/8/crypto/openssh/ssh-pkcs11-helper.8
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11-helper.8
  stable/8/crypto/openssh/ssh-pkcs11-helper.c
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11-helper.c
  stable/8/crypto/openssh/ssh-pkcs11.c
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11.c
  stable/8/crypto/openssh/ssh-pkcs11.h
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11.h
  stable/8/secure/libexec/ssh-pkcs11-helper/
     - copied from r204917, head/secure/libexec/ssh-pkcs11-helper/
  stable/8/secure/libexec/ssh-pkcs11-helper/Makefile
     - copied unchanged from r204948, head/secure/libexec/ssh-pkcs11-helper/Makefile
Deleted:
  stable/8/crypto/openssh/README.smartcard
  stable/8/crypto/openssh/scard-opensc.c
  stable/8/crypto/openssh/scard.c
  stable/8/crypto/openssh/scard.h
Modified:
  stable/8/crypto/openssh/ChangeLog
  stable/8/crypto/openssh/INSTALL
  stable/8/crypto/openssh/PROTOCOL
  stable/8/crypto/openssh/PROTOCOL.agent
  stable/8/crypto/openssh/README
  stable/8/crypto/openssh/README.platform
  stable/8/crypto/openssh/addrmatch.c
  stable/8/crypto/openssh/auth-krb5.c
  stable/8/crypto/openssh/auth-options.c
  stable/8/crypto/openssh/auth-options.h
  stable/8/crypto/openssh/auth-pam.c
  stable/8/crypto/openssh/auth-passwd.c
  stable/8/crypto/openssh/auth-rh-rsa.c
  stable/8/crypto/openssh/auth-rhosts.c
  stable/8/crypto/openssh/auth-rsa.c
  stable/8/crypto/openssh/auth-sia.c
  stable/8/crypto/openssh/auth.c
  stable/8/crypto/openssh/auth.h
  stable/8/crypto/openssh/auth1.c
  stable/8/crypto/openssh/auth2-hostbased.c
  stable/8/crypto/openssh/auth2-jpake.c
  stable/8/crypto/openssh/auth2-kbdint.c
  stable/8/crypto/openssh/auth2-none.c
  stable/8/crypto/openssh/auth2-passwd.c
  stable/8/crypto/openssh/auth2-pubkey.c
  stable/8/crypto/openssh/auth2.c
  stable/8/crypto/openssh/authfd.c
  stable/8/crypto/openssh/authfd.h
  stable/8/crypto/openssh/authfile.c
  stable/8/crypto/openssh/authfile.h
  stable/8/crypto/openssh/bufaux.c
  stable/8/crypto/openssh/buffer.c
  stable/8/crypto/openssh/buffer.h
  stable/8/crypto/openssh/canohost.c
  stable/8/crypto/openssh/canohost.h
  stable/8/crypto/openssh/channels.c
  stable/8/crypto/openssh/channels.h
  stable/8/crypto/openssh/clientloop.c
  stable/8/crypto/openssh/clientloop.h
  stable/8/crypto/openssh/config.guess
  stable/8/crypto/openssh/config.h
  stable/8/crypto/openssh/config.h.in
  stable/8/crypto/openssh/defines.h
  stable/8/crypto/openssh/dh.c
  stable/8/crypto/openssh/dns.c
  stable/8/crypto/openssh/dns.h
  stable/8/crypto/openssh/gss-genr.c
  stable/8/crypto/openssh/hostfile.c
  stable/8/crypto/openssh/hostfile.h
  stable/8/crypto/openssh/includes.h
  stable/8/crypto/openssh/jpake.c
  stable/8/crypto/openssh/jpake.h
  stable/8/crypto/openssh/kex.c
  stable/8/crypto/openssh/kex.h
  stable/8/crypto/openssh/kexdhs.c
  stable/8/crypto/openssh/kexgexs.c
  stable/8/crypto/openssh/key.c
  stable/8/crypto/openssh/key.h
  stable/8/crypto/openssh/loginrec.c
  stable/8/crypto/openssh/match.h
  stable/8/crypto/openssh/misc.c
  stable/8/crypto/openssh/misc.h
  stable/8/crypto/openssh/monitor.c
  stable/8/crypto/openssh/monitor_fdpass.c
  stable/8/crypto/openssh/monitor_mm.c
  stable/8/crypto/openssh/monitor_wrap.c
  stable/8/crypto/openssh/monitor_wrap.h
  stable/8/crypto/openssh/mux.c
  stable/8/crypto/openssh/myproposal.h
  stable/8/crypto/openssh/nchan.c
  stable/8/crypto/openssh/openbsd-compat/bsd-cygwin_util.c
  stable/8/crypto/openssh/openbsd-compat/bsd-cygwin_util.h
  stable/8/crypto/openssh/openbsd-compat/daemon.c
  stable/8/crypto/openssh/openbsd-compat/getrrsetbyname.c
  stable/8/crypto/openssh/openbsd-compat/openbsd-compat.h
  stable/8/crypto/openssh/openbsd-compat/openssl-compat.c
  stable/8/crypto/openssh/openbsd-compat/openssl-compat.h
  stable/8/crypto/openssh/openbsd-compat/port-aix.c
  stable/8/crypto/openssh/openbsd-compat/port-aix.h
  stable/8/crypto/openssh/openbsd-compat/port-linux.c
  stable/8/crypto/openssh/openbsd-compat/port-linux.h
  stable/8/crypto/openssh/openbsd-compat/readpassphrase.c
  stable/8/crypto/openssh/packet.c
  stable/8/crypto/openssh/packet.h
  stable/8/crypto/openssh/pathnames.h
  stable/8/crypto/openssh/platform.c
  stable/8/crypto/openssh/platform.h
  stable/8/crypto/openssh/readconf.c
  stable/8/crypto/openssh/readconf.h
  stable/8/crypto/openssh/schnorr.c
  stable/8/crypto/openssh/scp.1
  stable/8/crypto/openssh/scp.c
  stable/8/crypto/openssh/servconf.c
  stable/8/crypto/openssh/servconf.h
  stable/8/crypto/openssh/serverloop.c
  stable/8/crypto/openssh/session.c
  stable/8/crypto/openssh/sftp-client.c
  stable/8/crypto/openssh/sftp-client.h
  stable/8/crypto/openssh/sftp-common.c
  stable/8/crypto/openssh/sftp-common.h
  stable/8/crypto/openssh/sftp-server.8   (contents, props changed)
  stable/8/crypto/openssh/sftp-server.c
  stable/8/crypto/openssh/sftp.1
  stable/8/crypto/openssh/sftp.c
  stable/8/crypto/openssh/ssh-add.1
  stable/8/crypto/openssh/ssh-add.c
  stable/8/crypto/openssh/ssh-agent.1   (contents, props changed)
  stable/8/crypto/openssh/ssh-agent.c
  stable/8/crypto/openssh/ssh-dss.c
  stable/8/crypto/openssh/ssh-keygen.1
  stable/8/crypto/openssh/ssh-keygen.c
  stable/8/crypto/openssh/ssh-keyscan.1
  stable/8/crypto/openssh/ssh-keyscan.c
  stable/8/crypto/openssh/ssh-keysign.c
  stable/8/crypto/openssh/ssh-rand-helper.c
  stable/8/crypto/openssh/ssh-rsa.c
  stable/8/crypto/openssh/ssh.1
  stable/8/crypto/openssh/ssh.c
  stable/8/crypto/openssh/ssh2.h
  stable/8/crypto/openssh/ssh_config
  stable/8/crypto/openssh/ssh_config.5
  stable/8/crypto/openssh/ssh_namespace.h
  stable/8/crypto/openssh/sshconnect.c
  stable/8/crypto/openssh/sshconnect.h
  stable/8/crypto/openssh/sshconnect2.c
  stable/8/crypto/openssh/sshd.8
  stable/8/crypto/openssh/sshd.c
  stable/8/crypto/openssh/sshd_config
  stable/8/crypto/openssh/sshd_config.5
  stable/8/crypto/openssh/sshlogin.c
  stable/8/crypto/openssh/sshpty.h
  stable/8/crypto/openssh/sshtty.c
  stable/8/crypto/openssh/uuencode.c
  stable/8/crypto/openssh/version.h
  stable/8/lib/libpam/modules/pam_ssh/Makefile
  stable/8/lib/libpam/modules/pam_ssh/pam_ssh.c
  stable/8/secure/lib/libssh/Makefile
  stable/8/secure/libexec/Makefile
  stable/8/secure/libexec/sftp-server/Makefile
  stable/8/secure/libexec/ssh-keysign/Makefile
  stable/8/secure/usr.bin/scp/Makefile
  stable/8/secure/usr.bin/sftp/Makefile
  stable/8/secure/usr.bin/ssh-add/Makefile
  stable/8/secure/usr.bin/ssh-agent/Makefile
  stable/8/secure/usr.bin/ssh-keygen/Makefile
  stable/8/secure/usr.bin/ssh-keyscan/Makefile
  stable/8/secure/usr.bin/ssh/Makefile
  stable/8/secure/usr.sbin/sshd/Makefile
Directory Properties:
  stable/8/crypto/openssh/   (props changed)
  stable/8/lib/libpam/   (props changed)
  stable/8/secure/   (props changed)
  stable/8/secure/usr.bin/bdes/   (props changed)

Modified: stable/8/crypto/openssh/ChangeLog
==============================================================================
--- stable/8/crypto/openssh/ChangeLog	Wed Apr 21 05:39:51 2010	(r206983)
+++ stable/8/crypto/openssh/ChangeLog	Wed Apr 21 06:33:10 2010	(r206984)
@@ -1,3 +1,1261 @@
+20100307
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/03/07 22:16:01
+     [ssh-keygen.c]
+     make internal strptime string match strftime format;
+     suggested by vinschen AT redhat.com and markus@
+   - djm@cvs.openbsd.org 2010/03/08 00:28:55
+     [ssh-keygen.1]
+     document permit-agent-forwarding certificate constraint; patch from
+     stevesk@
+   - djm@cvs.openbsd.org 2010/03/07 22:01:32
+     [version.h]
+     openssh-5.4
+ - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+   crank version numbers
+ - (djm) Release OpenSSH-5.4p1
+
+20100307
+ - (dtucker) [auth.c] Bug #1710: call setauthdb on AIX before getpwuid so that
+   it gets the passwd struct from the LAM that knows about the user which is
+   not necessarily the default.  Patch from Alexandre Letourneau.
+ - (dtucker) [session.c] Bug #1567: move setpcred call to before chroot and
+   do not set real uid, since that's needed for the chroot, and will be set
+   by permanently_set_uid.
+ - (dtucker) [session.c] Also initialize creds to NULL for handing to
+    setpcred.
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2010/03/07 11:57:13
+     [auth-rhosts.c monitor.c monitor_wrap.c session.c auth-options.c sshd.c]
+     Hold authentication debug messages until after successful authentication.
+     Fixes an info leak of environment variables specified in authorized_keys,
+     reported by Jacob Appelbaum.  ok djm@
+
+20100305
+ - OpenBSD CVS Sync
+   - jmc@cvs.openbsd.org 2010/03/04 12:51:25
+     [ssh.1 sshd_config.5]
+     tweak previous;
+   - djm@cvs.openbsd.org 2010/03/04 20:35:08
+     [ssh-keygen.1 ssh-keygen.c]
+     Add a -L flag to print the contents of a certificate; ok markus@
+   - jmc@cvs.openbsd.org 2010/03/04 22:52:40
+     [ssh-keygen.1]
+     fix Bk/Ek;
+   - djm@cvs.openbsd.org 2010/03/04 23:17:25
+     [sshd_config.5]
+     missing word; spotted by jmc@
+   - djm@cvs.openbsd.org 2010/03/04 23:19:29
+     [ssh.1 sshd.8]
+     move section on CA and revoked keys from ssh.1 to sshd.8's known hosts
+     format section and rework it a bit; requested by jmc@
+   - djm@cvs.openbsd.org 2010/03/04 23:27:25
+     [auth-options.c ssh-keygen.c]
+     "force-command" is not spelled "forced-command"; spotted by
+     imorgan AT nas.nasa.gov
+   - djm@cvs.openbsd.org 2010/03/05 02:58:11
+     [auth.c]
+     make the warning for a revoked key louder and more noticable
+   - jmc@cvs.openbsd.org 2010/03/05 06:50:35
+     [ssh.1 sshd.8]
+     tweak previous;
+   - jmc@cvs.openbsd.org 2010/03/05 08:31:20
+     [ssh.1]
+     document certificate authentication; help/ok djm
+   - djm@cvs.openbsd.org 2010/03/05 10:28:21
+     [ssh-add.1 ssh.1 ssh_config.5]
+     mention loading of certificate files from [private]-cert.pub when
+     they are present; feedback and ok jmc@
+ - (tim) [ssh-pkcs11.c] Fix "non-constant initializer" errors in older
+   compilers. OK djm@
+ - (djm) [ssh-rand-helper.c] declare optind, avoiding compilation failure
+   on some platforms
+ - (djm) [configure.ac] set -fno-strict-aliasing for gcc4; ok dtucker@
+
+20100304
+ - (djm) [ssh-keygen.c] Use correct local variable, instead of
+   maybe-undefined global "optarg"
+ - (djm) [contrib/redhat/openssh.spec] Replace obsolete BuildPreReq
+   on XFree86-devel with neutral /usr/include/X11/Xlib.h;
+   imorgan AT nas.nasa.gov in bz#1731
+ - (djm) [.cvsignore] Ignore ssh-pkcs11-helper
+ - (djm) [regress/Makefile] Cleanup sshd_proxy_orig
+ - OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/03/03 01:44:36
+     [auth-options.c key.c]
+     reject strings with embedded ASCII nul chars in certificate key IDs,
+     principal names and constraints
+   - djm@cvs.openbsd.org 2010/03/03 22:49:50
+     [sshd.8]
+     the authorized_keys option for CA keys is "cert-authority", not
+     "from=cert-authority". spotted by imorgan AT nas.nasa.gov
+   - djm@cvs.openbsd.org 2010/03/03 22:50:40
+     [PROTOCOL.certkeys]
+     s/similar same/similar/; from imorgan AT nas.nasa.gov
+   - djm@cvs.openbsd.org 2010/03/04 01:44:57
+     [key.c]
+     use buffer_get_string_ptr_ret() where we are checking the return
+     value explicitly instead of the fatal()-causing buffer_get_string_ptr()
+   - djm@cvs.openbsd.org 2010/03/04 10:36:03
+     [auth-rh-rsa.c auth-rsa.c auth.c auth.h auth2-hostbased.c auth2-pubkey.c]
+     [authfile.c authfile.h hostfile.c hostfile.h servconf.c servconf.h]
+     [ssh-keygen.c ssh.1 sshconnect.c sshd_config.5]
+     Add a TrustedUserCAKeys option to sshd_config to specify CA keys that
+     are trusted to authenticate users (in addition than doing it per-user
+     in authorized_keys).
+     
+     Add a RevokedKeys option to sshd_config and a @revoked marker to
+     known_hosts to allow keys to me revoked and banned for user or host
+     authentication.
+     
+     feedback and ok markus@
+   - djm@cvs.openbsd.org 2010/03/03 00:47:23
+     [regress/cert-hostkey.sh regress/cert-userkey.sh]
+     add an extra test to ensure that authentication with the wrong
+     certificate fails as it should (and it does)
+   - djm@cvs.openbsd.org 2010/03/04 10:38:23
+     [regress/cert-hostkey.sh regress/cert-userkey.sh]
+     additional regression tests for revoked keys and TrustedUserCAKeys
+
+20100303
+ - (djm) [PROTOCOL.certkeys] Add RCS Ident
+ - OpenBSD CVS Sync
+   - jmc@cvs.openbsd.org 2010/02/26 22:09:28
+     [ssh-keygen.1 ssh.1 sshd.8]
+     tweak previous;
+   - otto@cvs.openbsd.org 2010/03/01 11:07:06
+     [ssh-add.c]
+     zap what seems to be a left-over debug message; ok markus@
+   - djm@cvs.openbsd.org 2010/03/02 23:20:57
+     [ssh-keygen.c]
+     POSIX strptime is stricter than OpenBSD's so do a little dance to
+     appease it.
+ - (djm) [regress/cert-userkey.sh] s/echo -n/echon/ here too
+
+20100302
+ - (tim) [config.guess config.sub] Bug 1722: Update to latest versions from
+   http://git.savannah.gnu.org/gitweb/ (2009-12-30 and 2010-01-22
+   respectively).
+
+20100301
+ - (dtucker) [regress/{cert-hostkey,cfgmatch,cipher-speed}.sh} Replace
+   "echo -n" with "echon" for portability.
+ - (dtucker) [openbsd-compat/port-linux.c] Make failure to write to the OOM
+   adjust log at verbose only, since according to cjwatson in bug #1470
+   some virtualization platforms don't allow writes.
+
+20100228
+ - (djm) [auth.c] On Cygwin, refuse usernames that have differences in
+   case from that matched in the system password database. On this
+   platform, passwords are stored case-insensitively, but sshd requires
+   exact case matching for Match blocks in sshd_config(5). Based on
+   a patch from vinschen AT redhat.com.
+ - (tim) [ssh-pkcs11-helper.c] Move declarations before calling functions
+   to make older compilers (gcc 2.95) happy.
+
+20100227
+ - (djm) [ssh-pkcs11-helper.c ] Ensure RNG is initialised and seeded
+ - (djm) [openbsd-compat/bsd-cygwin_util.c] Reduce the set of environment
+   variables copied into sshd child processes. From vinschen AT redhat.com
+
+20100226
+ - OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/02/26 20:29:54
+     [PROTOCOL PROTOCOL.agent PROTOCOL.certkeys addrmatch.c auth-options.c]
+     [auth-options.h auth.h auth2-pubkey.c authfd.c dns.c dns.h hostfile.c]
+     [hostfile.h kex.h kexdhs.c kexgexs.c key.c key.h match.h monitor.c]
+     [myproposal.h servconf.c servconf.h ssh-add.c ssh-agent.c ssh-dss.c]
+     [ssh-keygen.1 ssh-keygen.c ssh-rsa.c ssh.1 ssh.c ssh2.h sshconnect.c]
+     [sshconnect2.c sshd.8 sshd.c sshd_config.5]
+     Add support for certificate key types for users and hosts.
+     
+     OpenSSH certificate key types are not X.509 certificates, but a much
+     simpler format that encodes a public key, identity information and
+     some validity constraints and signs it with a CA key. CA keys are
+     regular SSH keys. This certificate style avoids the attack surface
+     of X.509 certificates and is very easy to deploy.
+     
+     Certified host keys allow automatic acceptance of new host keys
+     when a CA certificate is marked as trusted in ~/.ssh/known_hosts.
+     see VERIFYING HOST KEYS in ssh(1) for details.
+     
+     Certified user keys allow authentication of users when the signing
+     CA key is marked as trusted in authorized_keys. See "AUTHORIZED_KEYS
+     FILE FORMAT" in sshd(8) for details.
+     
+     Certificates are minted using ssh-keygen(1), documentation is in
+     the "CERTIFICATES" section of that manpage.
+     
+     Documentation on the format of certificates is in the file
+     PROTOCOL.certkeys
+     
+     feedback and ok markus@
+   - djm@cvs.openbsd.org 2010/02/26 20:33:21
+     [Makefile regress/cert-hostkey.sh regress/cert-userkey.sh]
+     regression tests for certified keys
+
+20100224
+ - (djm) [pkcs11.h ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
+   [ssh-pkcs11.h] Add $OpenBSD$ RCS idents so we can sync portable
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/02/11 20:37:47
+     [pathnames.h]
+     correct comment
+   - dtucker@cvs.openbsd.org 2009/11/09 04:20:04
+     [regress/Makefile]
+     add regression test for ssh-keygen pubkey conversions
+   - dtucker@cvs.openbsd.org 2010/01/11 02:53:44
+     [regress/forwarding.sh]
+     regress test for stdio forwarding
+   - djm@cvs.openbsd.org 2010/02/09 04:57:36
+     [regress/addrmatch.sh]
+     clean up droppings
+   - djm@cvs.openbsd.org 2010/02/09 06:29:02
+     [regress/Makefile]
+     turn on all the malloc(3) checking options when running regression
+     tests. this has caught a few bugs for me in the past; ok dtucker@
+   - djm@cvs.openbsd.org 2010/02/24 06:21:56
+     [regress/test-exec.sh]
+     wait for sshd to fully stop in cleanup() function; avoids races in tests
+     that do multiple start_sshd/cleanup cycles; "I hate pidfiles" deraadt@
+   - markus@cvs.openbsd.org 2010/02/08 10:52:47
+     [regress/agent-pkcs11.sh]
+     test for PKCS#11 support (currently disabled)
+ - (djm) [Makefile.in ssh-pkcs11-helper.8] Add manpage for PKCS#11 helper
+ - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+   [contrib/suse/openssh.spec] Add PKCS#11 helper binary and manpage
+
+20100212
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/02/02 22:49:34
+     [bufaux.c]
+     make buffer_get_string_ret() really non-fatal in all cases (it was
+     using buffer_get_int(), which could fatal() on buffer empty);
+     ok markus dtucker
+   - markus@cvs.openbsd.org 2010/02/08 10:50:20
+     [pathnames.h readconf.c readconf.h scp.1 sftp.1 ssh-add.1 ssh-add.c]
+     [ssh-agent.c ssh-keygen.1 ssh-keygen.c ssh.1 ssh.c ssh_config.5]
+     replace our obsolete smartcard code with PKCS#11.
+        ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs-11v2-20.pdf
+     ssh(1) and ssh-keygen(1) use dlopen(3) directly to talk to a PKCS#11
+     provider (shared library) while ssh-agent(1) delegates PKCS#11 to
+     a forked a ssh-pkcs11-helper process.
+     PKCS#11 is currently a compile time option.
+     feedback and ok djm@; inspired by patches from Alon Bar-Lev
+   - jmc@cvs.openbsd.org 2010/02/08 22:03:05
+     [ssh-add.1 ssh-keygen.1 ssh.1 ssh.c]
+     tweak previous; ok markus
+   - djm@cvs.openbsd.org 2010/02/09 00:50:36
+     [ssh-agent.c]
+     fallout from PKCS#11: unbreak -D
+   - djm@cvs.openbsd.org 2010/02/09 00:50:59
+     [ssh-keygen.c]
+     fix -Wall
+   - djm@cvs.openbsd.org 2010/02/09 03:56:28
+     [buffer.c buffer.h]
+     constify the arguments to buffer_len, buffer_ptr and buffer_dump
+   - djm@cvs.openbsd.org 2010/02/09 06:18:46
+     [auth.c]
+     unbreak ChrootDirectory+internal-sftp by skipping check for executable
+     shell when chrooting; reported by danh AT wzrd.com; ok dtucker@
+   - markus@cvs.openbsd.org 2010/02/10 23:20:38
+     [ssh-add.1 ssh-keygen.1 ssh.1 ssh_config.5]
+     pkcs#11 is no longer optional; improve wording; ok jmc@
+   - jmc@cvs.openbsd.org 2010/02/11 13:23:29
+     [ssh.1]
+     libarary -> library;
+ - (djm) [INSTALL Makefile.in README.smartcard configure.ac scard-opensc.c]
+   [scard.c scard.h pkcs11.h scard/Makefile.in scard/Ssh.bin.uu scard/Ssh.java]
+   Remove obsolete smartcard support
+ - (djm) [ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
+   Make it compile on OSX
+ - (djm) [ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
+   Use ssh_get_progname to fill __progname
+ - (djm) [configure.ac] Enable PKCS#11 support only when we find a working
+   dlopen()
+
+20100210
+ - (djm) add -lselinux to LIBS before calling AC_CHECK_FUNCS for
+   getseuserbyname; patch from calebcase AT gmail.com via
+   cjwatson AT debian.org
+
+20100202
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/01/30 21:08:33
+     [sshd.8]
+     debug output goes to stderr, not "the system log"; ok markus dtucker
+   - djm@cvs.openbsd.org 2010/01/30 21:12:08
+     [channels.c]
+     fake local addr:port when stdio fowarding as some servers (Tectia at
+     least) validate that they are well-formed;
+     reported by imorgan AT nas.nasa.gov
+     ok dtucker
+
+20100130
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/01/28 00:21:18
+     [clientloop.c]
+     downgrade an error() to a debug() - this particular case can be hit in
+     normal operation for certain sequences of mux slave vs session closure
+     and is harmless
+   - djm@cvs.openbsd.org 2010/01/29 00:20:41
+     [sshd.c]
+     set FD_CLOEXEC on sock_in/sock_out; bz#1706 from jchadima AT redhat.com
+     ok dtucker@
+   - djm@cvs.openbsd.org 2010/01/29 20:16:17
+     [mux.c]
+     kill correct channel (was killing already-dead mux channel, not
+     its session channel)
+   - djm@cvs.openbsd.org 2010/01/30 02:54:53
+     [mux.c]
+     don't mark channel as read failed if it is already closing; suppresses
+     harmless error messages when connecting to SSH.COM Tectia server
+     report by imorgan AT nas.nasa.gov
+
+20100129
+ - (dtucker) [openbsd-compat/openssl-compat.c] Bug #1707: Call OPENSSL_config()
+   after registering the hardware engines, which causes the openssl.cnf file to
+   be processed.  See OpenSSL's man page for OPENSSL_config(3) for details.
+   Patch from Solomon Peachy, ok djm@.
+
+20100128
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/01/26 02:15:20
+     [mux.c]
+     -Wuninitialized and remove a // comment; from portable
+     (Id sync only)
+   - djm@cvs.openbsd.org 2010/01/27 13:26:17
+     [mux.c]
+     fix bug introduced in mux rewrite:
+     
+     In a mux master, when a socket to a mux slave closes before its server
+     session (as may occur when the slave has been signalled), gracefully
+     close the server session rather than deleting its channel immediately.
+     A server may have more messages on that channel to send (e.g. an exit
+     message) that will fatal() the client if they are sent to a channel that
+     has been prematurely deleted.
+     
+     spotted by imorgan AT nas.nasa.gov
+   - djm@cvs.openbsd.org 2010/01/27 19:21:39
+     [sftp.c]
+     add missing "p" flag to getopt optstring;
+     bz#1704 from imorgan AT nas.nasa.gov
+
+20100126
+ - (djm) OpenBSD CVS Sync
+   - tedu@cvs.openbsd.org 2010/01/17 21:49:09
+     [ssh-agent.1]
+     Correct and clarify ssh-add's password asking behavior.
+     Improved text dtucker and ok jmc
+   - dtucker@cvs.openbsd.org 2010/01/18 01:50:27
+     [roaming_client.c]
+     s/long long unsigned/unsigned long long/, from tim via portable
+     (Id sync only, change already in portable)
+   - djm@cvs.openbsd.org 2010/01/26 01:28:35
+     [channels.c channels.h clientloop.c clientloop.h mux.c nchan.c ssh.c]
+     rewrite ssh(1) multiplexing code to a more sensible protocol.
+     
+     The new multiplexing code uses channels for the listener and
+     accepted control sockets to make the mux master non-blocking, so
+     no stalls when processing messages from a slave.
+     
+     avoid use of fatal() in mux master protocol parsing so an errant slave
+     process cannot take down a running master.
+     
+     implement requesting of port-forwards over multiplexed sessions. Any
+     port forwards requested by the slave are added to those the master has
+     established.
+     
+     add support for stdio forwarding ("ssh -W host:port ...") in mux slaves.
+     
+     document master/slave mux protocol so that other tools can use it to
+     control a running ssh(1). Note: there are no guarantees that this
+     protocol won't be incompatibly changed (though it is versioned).
+     
+     feedback Salvador Fandino, dtucker@
+     channel changes ok markus@
+
+20100122
+ - (tim) [configure.ac] Due to constraints in Windows Sockets in terms of
+   socket inheritance, reduce the default SO_RCVBUF/SO_SNDBUF buffer size
+   in Cygwin to 65535. Patch from Corinna Vinschen.
+
+20100117
+ - (tim) [configure.ac] OpenServer 5 needs BROKEN_GETADDRINFO too.
+ - (tim) [configure.ac] On SVR5 systems, use the C99-conforming functions
+   snprintf() and vsnprintf() named _xsnprintf() and _xvsnprintf().
+
+20100116
+ - (dtucker) [openbsd-compat/pwcache.c] Pull in includes.h and thus defines.h
+   so we correctly detect whether or not we have a native user_from_uid.
+ - (dtucker) [openbsd-compat/openbsd-compat.h] Prototypes for user_from_uid
+   and group_from_gid.
+ - (dtucker) [openbsd-compat/openbsd-compat.h] Fix prototypes, spotted by
+   Tim.
+ - (dtucker) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2010/01/15 09:24:23
+     [sftp-common.c]
+     unused
+ - (dtucker) [openbsd-compat/pwcache.c] Shrink ifdef area to prevent unused
+   variable warnings.
+ - (dtucker) [openbsd-compat/openbsd-compat.h] Typo.
+ - (tim) [regress/portnum.sh] Shell portability fix.
+ - (tim) [configure.ac] Define BROKEN_GETADDRINFO on SVR5 systems. The native
+   getaddrinfo() is too old and limited for addr_pton() in addrmatch.c.
+ - (tim) [roaming_client.c] Use of  is not really portable so we
+   use "openbsd-compat/sys-queue.h". s/long long unsigned/unsigned long long/
+   to keep USL compilers happy.
+
+20100115
+ - (dtucker) OpenBSD CVS Sync
+   - jmc@cvs.openbsd.org 2010/01/13 12:48:34
+     [sftp.1 sftp.c]
+     sftp.1: put ls -h in the right place
+     sftp.c: as above, plus add -p to get/put, and shorten their arg names
+     to keep the help usage nicely aligned
+     ok djm
+   - djm@cvs.openbsd.org 2010/01/13 23:47:26
+     [auth.c]
+     when using ChrootDirectory, make sure we test for the existence of the
+     user's shell inside the chroot; bz #1679, patch from alex AT rtfs.hu;
+     ok dtucker
+   - dtucker@cvs.openbsd.org 2010/01/14 23:41:49
+     [sftp-common.c]
+     use user_from{uid,gid} to lookup up ids since it keeps a small cache.
+     ok djm
+   - guenther@cvs.openbsd.org 2010/01/15 00:05:22
+     [sftp.c]
+     Reset SIGTERM to SIG_DFL before executing ssh, so that even if sftp
+     inherited SIGTERM as ignored it will still be able to kill the ssh it
+     starts.
+     ok dtucker@
+ - (dtucker) [openbsd-compat/pwcache.c] Pull in pwcache.c from OpenBSD (no
+   changes yet but there will be some to come).
+ - (dtucker) [configure.ac openbsd-compat/{Makefile.in,pwcache.c} Portability
+   for pwcache.  Also, added caching of negative hits.
+
+20100114
+ - (djm) [platform.h] Add missing prototype for
+   platform_krb5_get_principal_name
+
+20100113
+ - (dtucker) [monitor_fdpass.c] Wrap poll.h include in ifdefs.
+ - (dtucker) [openbsd-compat/readpassphrase.c] Resync against OpenBSD's r1.18:
+   missing restore of SIGTTOU and some whitespace.
+ - (dtucker) [openbsd-compat/readpassphrase.c] Update to OpenBSD's r1.21.
+ - (dtucker) [openbsd-compat/readpassphrase.c] Update to OpenBSD's r1.22.
+   Fixes bz #1590, where sometimes you could not interrupt a connection while
+   ssh was prompting for a passphrase or password.
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2010/01/13 00:19:04
+     [sshconnect.c auth.c]
+     Fix a couple of typos/mispellings in comments
+   - dtucker@cvs.openbsd.org 2010/01/13 01:10:56
+     [key.c]
+     Ignore and log any Protocol 1 keys where the claimed size is not equal to
+     the actual size.  Noted by Derek Martin, ok djm@
+   - dtucker@cvs.openbsd.org 2010/01/13 01:20:20
+     [canohost.c ssh-keysign.c sshconnect2.c]
+     Make HostBased authentication work with a ProxyCommand.  bz #1569, patch
+     from imorgan at nas nasa gov, ok djm@
+   - djm@cvs.openbsd.org 2010/01/13 01:40:16
+     [sftp.c sftp-server.c sftp.1 sftp-common.c sftp-common.h]
+     support '-h' (human-readable units) for sftp's ls command, just like
+     ls(1); ok dtucker@
+   - djm@cvs.openbsd.org 2010/01/13 03:48:13
+     [servconf.c servconf.h sshd.c]
+     avoid run-time failures when specifying hostkeys via a relative
+     path by prepending the cwd in these cases; bz#1290; ok dtucker@
+   - djm@cvs.openbsd.org 2010/01/13 04:10:50
+     [sftp.c]
+     don't append a space after inserting a completion of a directory (i.e.
+     a path ending in '/') for a slightly better user experience; ok dtucker@
+ - (dtucker) [sftp-common.c] Wrap include of util.h in an ifdef.
+ - (tim) [defines.h] openbsd-compat/readpassphrase.c now needs _NSIG. 
+   feedback and ok dtucker@
+
+20100112
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2010/01/11 01:39:46
+     [ssh_config channels.c ssh.1 channels.h ssh.c]
+     Add a 'netcat mode' (ssh -W).  This connects stdio on the client to a
+     single port forward on the server.  This allows, for example, using ssh as
+     a ProxyCommand to route connections via intermediate servers.
+     bz #1618, man page help from jmc@, ok markus@
+   - dtucker@cvs.openbsd.org 2010/01/11 04:46:45
+     [authfile.c sshconnect2.c]
+     Do not prompt for a passphrase if we fail to open a keyfile, and log the
+     reason the open failed to debug.
+     bz #1693, found by tj AT castaglia org, ok djm@
+   - djm@cvs.openbsd.org 2010/01/11 10:51:07
+     [ssh-keygen.c]
+     when converting keys, truncate key comments at 72 chars as per RFC4716;
+     bz#1630 reported by tj AT castaglia.org; ok markus@
+   - dtucker@cvs.openbsd.org 2010/01/12 00:16:47
+     [authfile.c]
+     Fix bug introduced in r1.78 (incorrect brace location) that broke key auth.
+     Patch from joachim joachimschipper nl.
+   - djm@cvs.openbsd.org 2010/01/12 00:58:25
+     [monitor_fdpass.c]
+     avoid spinning when fd passing on nonblocking sockets by calling poll()
+     in the EINTR/EAGAIN path, much like we do in atomicio; ok dtucker@
+   - djm@cvs.openbsd.org 2010/01/12 00:59:29
+     [roaming_common.c]
+     delete with extreme prejudice a debug() that fired with every keypress;
+     ok dtucker deraadt
+   - dtucker@cvs.openbsd.org 2010/01/12 01:31:05
+     [session.c]
+     Do not allow logins if /etc/nologin exists but is not readable by the user
+     logging in.  Noted by Jan.Pechanec at Sun, ok djm@ deraadt@
+   - djm@cvs.openbsd.org 2010/01/12 01:36:08
+     [buffer.h bufaux.c]
+     add a buffer_get_string_ptr_ret() that does the same as
+     buffer_get_string_ptr() but does not fatal() on error; ok dtucker@
+   - dtucker@cvs.openbsd.org 2010/01/12 08:33:17
+     [session.c]
+     Add explicit stat so we reliably detect nologin with bad perms.
+     ok djm markus
+
+20100110
+ - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c]
+   Remove hacks add for RoutingDomain in preparation for its removal.
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2010/01/09 23:04:13
+     [channels.c ssh.1 servconf.c sshd_config.5 sshd.c channels.h servconf.h
+     ssh-keyscan.1 ssh-keyscan.c readconf.c sshconnect.c misc.c ssh.c
+     readconf.h scp.1 sftp.1 ssh_config.5 misc.h]
+     Remove RoutingDomain from ssh since it's now not needed.  It can be
+     replaced with "route exec" or "nc -V" as a proxycommand.  "route exec"
+     also ensures that trafic such as DNS lookups stays withing the specified
+     routingdomain.  For example (from reyk):
+     # route -T 2 exec /usr/sbin/sshd
+     or inherited from the parent process
+     $ route -T 2 exec sh
+     $ ssh 10.1.2.3
+     ok deraadt@ markus@ stevesk@ reyk@
+   - dtucker@cvs.openbsd.org 2010/01/10 03:51:17
+     [servconf.c]
+     Add ChrootDirectory to sshd.c test-mode output
+   - dtucker@cvs.openbsd.org 2010/01/10 07:15:56
+     [auth.c]
+     Output a debug if we can't open an existing keyfile.  bz#1694, ok djm@
+
+20100109
+ - (dtucker) Wrap use of IPPROTO_IPV6 in an ifdef for platforms that don't
+   have it.
+ - (dtucker) [defines.h] define PRIu64 for platforms that don't have it.
+ - (dtucker) [roaming_client.c] Wrap inttypes.h in an ifdef.
+ - (dtucker) [loginrec.c] Use the SUSv3 specified name for the user name
+   when using utmpx.  Patch from Ed Schouten.
+ - (dtucker) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/01/09 00:20:26
+     [sftp-server.c sftp-server.8]
+     add a 'read-only' mode to sftp-server(8) that disables open in write mode
+     and all other fs-modifying protocol methods. bz#430 ok dtucker@
+   - djm@cvs.openbsd.org 2010/01/09 00:57:10
+     [PROTOCOL]
+     tweak language
+   - jmc@cvs.openbsd.org 2010/01/09 03:36:00
+     [sftp-server.8]
+     bad place to forget a comma...
+   - djm@cvs.openbsd.org 2010/01/09 05:04:24
+     [mux.c sshpty.h clientloop.c sshtty.c]
+     quell tc[gs]etattr warnings when forcing a tty (ssh -tt), since we
+     usually don't actually have a tty to read/set; bz#1686 ok dtucker@
+   - dtucker@cvs.openbsd.org 2010/01/09 05:17:00
+     [roaming_client.c]
+     Remove a PRIu64 format string that snuck in with roaming.  ok djm@
+   - dtucker@cvs.openbsd.org 2010/01/09 11:13:02
+     [sftp.c]
+     Prevent sftp from derefing a null pointer when given a "-" without a
+     command.  Also, allow whitespace to follow a "-".  bz#1691, path from
+     Colin Watson via Debian.  ok djm@ deraadt@
+   - dtucker@cvs.openbsd.org 2010/01/09 11:17:56
+     [sshd.c]
+     Afer sshd receives a SIGHUP, ignore subsequent HUPs while sshd re-execs
+     itself.  Prevents two HUPs in quick succession from resulting in sshd
+     dying.  bz#1692, patch from Colin Watson via Ubuntu.
+ - (dtucker) [defines.h] Remove now-undeeded PRIu64 define.
+
+20100108
+ - (dtucker) OpenBSD CVS Sync
+   - andreas@cvs.openbsd.org 2009/10/24 11:11:58
+     [roaming.h]
+     Declarations needed for upcoming changes.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/10/24 11:13:54
+     [sshconnect2.c kex.h kex.c]
+     Let the client detect if the server supports roaming by looking
+     for the resume@appgate.com kex algorithm.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/10/24 11:15:29
+     [clientloop.c]
+     client_loop() must detect if the session has been suspended and resumed,
+     and take appropriate action in that case.
+     From Martin Forssen, maf at appgate dot com
+   - andreas@cvs.openbsd.org 2009/10/24 11:19:17
+     [ssh2.h]
+     Define the KEX messages used when resuming a suspended connection.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/10/24 11:22:37
+     [roaming_common.c]
+     Do the actual suspend/resume in the client. This won't be useful until
+     the server side supports roaming.
+     Most code from Martin Forssen, maf at appgate dot com. Some changes by
+     me and markus@
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/10/24 11:23:42
+     [ssh.c]
+     Request roaming to be enabled if UseRoaming is true and the server
+     supports it.
+     ok markus@
+   - reyk@cvs.openbsd.org 2009/10/28 16:38:18
+     [ssh_config.5 sshd.c misc.h ssh-keyscan.1 readconf.h sshconnect.c
+     channels.c channels.h servconf.h servconf.c ssh.1 ssh-keyscan.c scp.1
+     sftp.1 sshd_config.5 readconf.c ssh.c misc.c]
+     Allow to set the rdomain in ssh/sftp/scp/sshd and ssh-keyscan.
+     ok markus@
+   - jmc@cvs.openbsd.org 2009/10/28 21:45:08
+     [sshd_config.5 sftp.1]
+     tweak previous;
+   - djm@cvs.openbsd.org 2009/11/10 02:56:22
+     [ssh_config.5]
+     explain the constraints on LocalCommand some more so people don't
+     try to abuse it.
+   - djm@cvs.openbsd.org 2009/11/10 02:58:56
+     [sshd_config.5]
+     clarify that StrictModes does not apply to ChrootDirectory. Permissions
+     and ownership are always checked when chrooting. bz#1532
+   - dtucker@cvs.openbsd.org 2009/11/10 04:30:45
+     [sshconnect2.c channels.c sshconnect.c]
+     Set close-on-exec on various descriptors so they don't get leaked to
+     child processes.  bz #1643, patch from jchadima at redhat, ok deraadt.
+   - markus@cvs.openbsd.org 2009/11/11 21:37:03
+     [channels.c channels.h]
+     fix race condition in x11/agent channel allocation: don't read after
+     the end of the select read/write fdset and make sure a reused FD
+     is not touched before the pre-handlers are called.
+     with and ok djm@
+   - djm@cvs.openbsd.org 2009/11/17 05:31:44
+     [clientloop.c]
+     fix incorrect exit status when multiplexing and channel ID 0 is recycled
+     bz#1570 reported by peter.oliver AT eon-is.co.uk; ok dtucker
+   - djm@cvs.openbsd.org 2009/11/19 23:39:50
+     [session.c]
+     bz#1606: error when an attempt is made to connect to a server
+     with ForceCommand=internal-sftp with a shell session (i.e. not a
+     subsystem session). Avoids stuck client when attempting to ssh to such a
+     service. ok dtucker@
+   - dtucker@cvs.openbsd.org 2009/11/20 00:15:41
+     [session.c]
+     Warn but do not fail if stat()ing the subsystem binary fails.  This helps
+     with chrootdirectory+forcecommand=sftp-server and restricted shells.
+     bz #1599, ok djm.
+   - djm@cvs.openbsd.org 2009/11/20 00:54:01
+     [sftp.c]
+     bz#1588 change "Connecting to host..." message to "Connected to host."
+     and delay it until after the sftp protocol connection has been established.
+     Avoids confusing sequence of messages when the underlying ssh connection
+     experiences problems. ok dtucker@
+   - dtucker@cvs.openbsd.org 2009/11/20 00:59:36
+     [sshconnect2.c]
+     Use the HostKeyAlias when prompting for passwords.  bz#1039, ok djm@
+   - djm@cvs.openbsd.org 2009/11/20 03:24:07
+     [misc.c]
+     correct off-by-one in percent_expand(): we would fatal() when trying
+     to expand EXPAND_MAX_KEYS, allowing only EXPAND_MAX_KEYS-1 to actually
+     work.  Note that nothing in OpenSSH actually uses close to this limit at
+     present.  bz#1607 from Jan.Pechanec AT Sun.COM
+   - halex@cvs.openbsd.org 2009/11/22 13:18:00
+     [sftp.c]
+     make passing of zero-length arguments to ssh safe by
+     passing "-" "" rather than "-"
+     ok dtucker@, guenther@, djm@
+   - dtucker@cvs.openbsd.org 2009/12/06 23:41:15
+     [sshconnect2.c]
+     zap unused variable and strlen; from Steve McClellan, ok djm
+   - djm@cvs.openbsd.org 2009/12/06 23:53:45
+     [roaming_common.c]
+     use socklen_t for getsockopt optlen parameter; reported by
+     Steve.McClellan AT radisys.com, ok dtucker@
+   - dtucker@cvs.openbsd.org 2009/12/06 23:53:54
+     [sftp.c]
+     fix potential divide-by-zero in sftp's "df" output when talking to a server
+     that reports zero files on the filesystem (Unix filesystems always have at
+     least the root inode).  From Steve McClellan at radisys, ok djm@
+   - markus@cvs.openbsd.org 2009/12/11 18:16:33
+     [key.c]
+     switch from 35 to the more common value of RSA_F4 == (2**16)+1 == 65537
+     for the RSA public exponent; discussed with provos; ok djm@
+   - guenther@cvs.openbsd.org 2009/12/20 07:28:36
+     [ssh.c sftp.c scp.c]
+     When passing user-controlled options with arguments to other programs,
+     pass the option and option argument as separate argv entries and
+     not smashed into one (e.g., as -l foo and not -lfoo).  Also, always
+     pass a "--" argument to stop option parsing, so that a positional
+     argument that starts with a '-' isn't treated as an option.  This
+     fixes some error cases as well as the handling of hostnames and
+     filenames that start with a '-'.
+     Based on a diff by halex@
+     ok halex@ djm@ deraadt@
+   - djm@cvs.openbsd.org 2009/12/20 23:20:40
+     [PROTOCOL]
+     fix an incorrect magic number and typo in PROTOCOL; bz#1688
+     report and fix from ueno AT unixuser.org
+   - stevesk@cvs.openbsd.org 2009/12/25 19:40:21
+     [readconf.c servconf.c misc.h ssh-keyscan.c misc.c]
+     validate routing domain is in range 0-RT_TABLEID_MAX.
+     'Looks right' deraadt@
+   - stevesk@cvs.openbsd.org 2009/12/29 16:38:41
+     [sshd_config.5 readconf.c ssh_config.5 scp.1 servconf.c sftp.1 ssh.1]
+     Rename RDomain config option to RoutingDomain to be more clear and
+     consistent with other options.
+     NOTE: if you currently use RDomain in the ssh client or server config,
+     or ssh/sshd -o, you must update to use RoutingDomain.
+     ok markus@ djm@
+   - jmc@cvs.openbsd.org 2009/12/29 18:03:32
+     [sshd_config.5 ssh_config.5]
+     sort previous;
+   - dtucker@cvs.openbsd.org 2010/01/04 01:45:30
+     [sshconnect2.c]
+     Don't escape backslashes in the SSH2 banner.  bz#1533, patch from
+     Michal Gorny via Gentoo.
+   - djm@cvs.openbsd.org 2010/01/04 02:03:57
+     [sftp.c]
+     Implement tab-completion of commands, local and remote filenames for sftp.
+     Hacked on and off for some time by myself, mouring, Carlos Silva (via 2009
+     Google Summer of Code) and polished to a fine sheen by myself again.
+     It should deal more-or-less correctly with the ikky corner-cases presented
+     by quoted filenames, but the UI could still be slightly improved.
+     In particular, it is quite slow for remote completion on large directories.
+     bz#200; ok markus@
+   - djm@cvs.openbsd.org 2010/01/04 02:25:15
+     [sftp-server.c]
+     bz#1566 don't unnecessarily dup() in and out fds for sftp-server;
+     ok markus@
+   - dtucker@cvs.openbsd.org 2010/01/08 21:50:49
+     [sftp.c]
+     Fix two warnings: possibly used unitialized and use a nul byte instead of
+     NULL pointer.  ok djm@
+ - (dtucker) [Makefile.in added roaming_client.c roaming_serv.c] Import new
+   files for roaming and add to Makefile.
+ - (dtucker) [Makefile.in] .c files do not belong in the OBJ lines.
+ - (dtucker) [sftp.c] ifdef out the sftp completion bits for platforms that
+   don't have libedit.
+ - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c] Make
+   RoutingDomain an unsupported option on platforms that don't have it.
+ - (dtucker) [sftp.c] Expand ifdef for libedit to cover complete_is_remote
+   too.
+ - (dtucker) [misc.c] Move the routingdomain ifdef to allow the socket to
+   be created.
+ - (dtucker] [misc.c] Shrink the area covered by USE_ROUTINGDOMAIN more
+   to eliminate an unused variable warning.
+ - (dtucker) [roaming_serv.c] Include includes.h for u_intXX_t types.
+
+20091226
+ - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1
+   Gzip all man pages. Patch from Corinna Vinschen.
+
+20091221
+ - (dtucker) [auth-krb5.c platform.{c,h} openbsd-compat/port-aix.{c,h}]
+   Bug #1583: Use system's kerberos principal name on AIX if it's available.
+   Based on a patch from and tested by Miguel Sanders 
+
+20091208
+ - (dtucker) Bug #1470: Disable OOM-killing of the listening sshd on Linux,
+   based on a patch from Vaclav Ovsik and Colin Watson.  ok djm.
+
+20091207
+ - (dtucker) Bug #1160: use pkg-config for opensc config if it's available.
+   Tested by Martin Paljak.
+ - (dtucker) Bug #1677: add conditionals around the source for ssh-askpass.
+
+20091121
+ - (tim) [opensshd.init.in] If PidFile is set in sshd_config, use it.
+   Bug 1628. OK dtucker@
+
+20091120
+ - (djm) [ssh-rand-helper.c] Print error and usage() when passed command-
+   line arguments as none are supported. Exit when passed unrecognised
+   commandline flags. bz#1568 from gson AT araneus.fi
+
+20091118
+ - (djm) [channels.c misc.c misc.h sshd.c] add missing setsockopt() to
+   set IPV6_V6ONLY for local forwarding with GatwayPorts=yes. Unify
+   setting IPV6_V6ONLY behind a new function misc.c:sock_set_v6only()
+   bz#1648, report and fix from jan.kratochvil AT redhat.com
+ - (djm) [contrib/gnome-ssh-askpass2.c] Make askpass dialog desktop-modal.
+   bz#1645, patch from jchadima AT redhat.com
+
+20091107
+ - (dtucker) [authfile.c] Fall back to 3DES for the encryption of private
+    keys when built with OpenSSL versions that don't do AES.
+
+20091105
+ - (dtucker) [authfile.c] Add OpenSSL compat header so this still builds with
+   older versions of OpenSSL.
+
+20091024
+ - (dtucker) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2009/10/11 23:03:15
+     [hostfile.c]
+     mention the host name that we are looking for in check_host_in_hostfile()
+   - sobrado@cvs.openbsd.org 2009/10/17 12:10:39
+     [sftp-server.c]
+     sort flags.
+   - sobrado@cvs.openbsd.org 2009/10/22 12:35:53
+     [ssh.1 ssh-agent.1 ssh-add.1]
+     use the UNIX-related macros (.At and .Ux) where appropriate.
+     ok jmc@
+   - sobrado@cvs.openbsd.org 2009/10/22 15:02:12
+     [ssh-agent.1 ssh-add.1 ssh.1]
+     write UNIX-domain in a more consistent way; while here, replace a
+     few remaining ".Tn UNIX" macros with ".Ux" ones.
+     pointed out by ratchov@, thanks!
+     ok jmc@
+   - djm@cvs.openbsd.org 2009/10/22 22:26:13
+     [authfile.c]
+     switch from 3DES to AES-128 for encryption of passphrase-protected
+     SSH protocol 2 private keys; ok several
+   - djm@cvs.openbsd.org 2009/10/23 01:57:11
+     [sshconnect2.c]
+     disallow a hostile server from checking jpake auth by sending an
+     out-of-sequence success message. (doesn't affect code enabled by default)
+   - dtucker@cvs.openbsd.org 2009/10/24 00:48:34
+     [ssh-keygen.1]
+     ssh-keygen now uses AES-128 for private keys
+ - (dtucker) [mdoc2man.awk] Teach it to understand the .Ux macro.
+ - (dtucker) [session.c openbsd-compat/port-linux.{c,h}] Bug #1637: if selinux
+   is enabled set the security context to "sftpd_t" before running the
+   internal sftp server   Based on a patch from jchadima at redhat.
+
+20091011
+ - (dtucker) [configure.ac sftp-client.c] Remove the gyrations required for
+   dirent d_type and DTTOIF as we've switched OpenBSD to the more portable
+   lstat.
+ - (dtucker) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2009/10/08 14:03:41
+     [sshd_config readconf.c ssh_config.5 servconf.c sshd_config.5]
+     disable protocol 1 by default (after a transition period of about 10 years)
+     ok deraadt
+   - jmc@cvs.openbsd.org 2009/10/08 20:42:12
+     [sshd_config.5 ssh_config.5 sshd.8 ssh.1]
+     some tweaks now that protocol 1 is not offered by default; ok markus
+   - dtucker@cvs.openbsd.org 2009/10/11 10:41:26
+     [sftp-client.c]
+     d_type isn't portable so use lstat to get dirent modes.  Suggested by and
+     "looks sane" deraadt@
+   - markus@cvs.openbsd.org 2009/10/08 18:04:27
+     [regress/test-exec.sh]
+     re-enable protocol v1 for the tests.
+
+20091007
+ - (dtucker) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2009/08/12 00:13:00
+     [sftp.c sftp.1]
+     support most of scp(1)'s commandline arguments in sftp(1), as a first
+     step towards making sftp(1) a drop-in replacement for scp(1).
+     One conflicting option (-P) has not been changed, pending further
+     discussion.
+     Patch from carlosvsilvapt@gmail.com as part of his work in the
+     Google Summer of Code
+  - jmc@cvs.openbsd.org 2009/08/12 06:31:42
+     [sftp.1]
+     sort options;
+   - djm@cvs.openbsd.org 2009/08/13 01:11:19
+     [sftp.1 sftp.c]
+     Swizzle options: "-P sftp_server_path" moves to "-D sftp_server_path",
+     add "-P port" to match scp(1). Fortunately, the -P option is only really
+     used by our regression scripts.
+     part of larger patch from carlosvsilvapt@gmail.com for his Google Summer
+     of Code work; ok deraadt markus
+   - jmc@cvs.openbsd.org 2009/08/13 13:39:54
+     [sftp.1 sftp.c]
+     sync synopsis and usage();
+   - djm@cvs.openbsd.org 2009/08/14 18:17:49
+     [sftp-client.c]
+     make the "get_handle: ..." error messages vaguely useful by allowing
+     callers to specify their own error message strings.
+   - fgsch@cvs.openbsd.org 2009/08/15 18:56:34
+     [auth.h]
+     remove unused define. markus@ ok.
+     (Id sync only, Portable still uses this.)
+   - dtucker@cvs.openbsd.org 2009/08/16 23:29:26
+     [sshd_config.5]
+     Add PubkeyAuthentication to the list allowed in a Match block (bz #1577)
+   - djm@cvs.openbsd.org 2009/08/18 18:36:21
+     [sftp-client.h sftp.1 sftp-client.c sftp.c]
+     recursive transfer support for get/put and on the commandline
+     work mostly by carlosvsilvapt@gmail.com for the Google Summer of Code
+     with some tweaks by me; "go for it" deraadt@
+  - djm@cvs.openbsd.org 2009/08/18 21:15:59
+     [sftp.1]
+     fix "get" command usage, spotted by jmc@
+   - jmc@cvs.openbsd.org 2009/08/19 04:56:03
+     [sftp.1]
+     ether -> either;
+   - dtucker@cvs.openbsd.org 2009/08/20 23:54:28
+     [mux.c]
+     subsystem_flag is defined in ssh.c so it's extern; ok djm
+   - djm@cvs.openbsd.org 2009/08/27 17:28:52
+     [sftp-server.c]
+     allow setting an explicit umask on the commandline to override whatever
+     default the user has. bz#1229; ok dtucker@ deraadt@ markus@
+   - djm@cvs.openbsd.org 2009/08/27 17:33:49
+     [ssh-keygen.c]
+     force use of correct hash function for random-art signature display
+     as it was inheriting the wrong one when bubblebabble signatures were
+     activated; bz#1611 report and patch from fwojcik+openssh AT besh.com;
+     ok markus@
+   - djm@cvs.openbsd.org 2009/08/27 17:43:00
+     [sftp-server.8]
+     allow setting an explicit umask on the commandline to override whatever
+     default the user has. bz#1229; ok dtucker@ deraadt@ markus@
+   - djm@cvs.openbsd.org 2009/08/27 17:44:52
+     [authfd.c ssh-add.c authfd.h]
+     Do not fall back to adding keys without contraints (ssh-add -c / -t ...)
+     when the agent refuses the constrained add request. This was a useful
+     migration measure back in 2002 when constraints were new, but just
+     adds risk now.
+     bz #1612, report and patch from dkg AT fifthhorseman.net; ok markus@
+   - djm@cvs.openbsd.org 2009/08/31 20:56:02
+     [sftp-server.c]
+     check correct variable for error message, spotted by martynas@
+   - djm@cvs.openbsd.org 2009/08/31 21:01:29
+     [sftp-server.8]
+     document -e and -h; prodded by jmc@
+   - djm@cvs.openbsd.org 2009/09/01 14:43:17
+     [ssh-agent.c]
+     fix a race condition in ssh-agent that could result in a wedged or
+     spinning agent: don't read off the end of the allocated fd_sets, and
+     don't issue blocking read/write on agent sockets - just fall back to
+     select() on retriable read/write errors. bz#1633 reported and tested
+     by "noodle10000 AT googlemail.com"; ok dtucker@ markus@
+   - grunk@cvs.openbsd.org 2009/10/01 11:37:33
+     [dh.c]
+     fix a cast
+     ok djm@ markus@
+   - djm@cvs.openbsd.org 2009/10/06 04:46:40
+     [session.c]
+     bz#1596: fflush(NULL) before exec() to ensure that everying (motd
+     in particular) has made it out before the streams go away.
+   - djm@cvs.openbsd.org 2008/12/07 22:17:48
+     [regress/addrmatch.sh]
+     match string "passwordauthentication" only at start of line, not anywhere
+     in sshd -T output
+   - dtucker@cvs.openbsd.org 2009/05/05 07:51:36
+     [regress/multiplex.sh]
+     Always specify ssh_config for multiplex tests: prevents breakage caused
+     by options in ~/.ssh/config.  From Dan Peterson.
+   - djm@cvs.openbsd.org 2009/08/13 00:57:17
+     [regress/Makefile]
+     regression test for port number parsing. written as part of the a2port
+     change that went into 5.2 but I forgot to commit it at the time...
+   - djm@cvs.openbsd.org 2009/08/13 01:11:55
+     [regress/sftp-batch.sh regress/sftp-badcmds.sh regress/sftp.sh
+     regress/sftp-cmds.sh regres/sftp-glob.sh]
+     date: 2009/08/13 01:11:19;  author: djm;  state: Exp;  lines: +10 -7
+     Swizzle options: "-P sftp_server_path" moves to "-D sftp_server_path",
+     add "-P port" to match scp(1). Fortunately, the -P option is only really
+     used by our regression scripts.
+     part of larger patch from carlosvsilvapt@gmail.com for his Google Summer
+     of Code work; ok deraadt markus
+   - djm@cvs.openbsd.org 2009/08/20 18:43:07
+     [regress/ssh-com-sftp.sh]
+     fix one sftp -D ... => sftp -P ... conversion that I missed; from Carlos
+     Silva for Google Summer of Code
+   - dtucker@cvs.openbsd.org 2009/10/06 23:51:49
+     [regress/ssh2putty.sh]
+     Add OpenBSD tag to make syncs easier
+ - (dtucker) [regress/portnum.sh] Import new test.
+ - (dtucker) [configure.ac sftp-client.c] DTOTIF is in fs/ffs/dir.h on at
+   least dragonflybsd.
+ - (dtucker) d_type is not mandated by POSIX, so add fallback code using
+    stat(), needed on at least cygwin.
+
+20091002
+ - (djm) [Makefile.in] Mention readconf.o in ssh-keysign's make deps.
+   spotted by des AT des.no
+
+20090926
+ - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+         [contrib/suse/openssh.spec] Update for release
+ - (djm) [README] update relnotes URL
+ - (djm) [packet.c] Restore EWOULDBLOCK handling that got lost somewhere
+ - (djm) Release 5.3p1
+
+20090911
+ - (dtucker) [configure.ac] Change the -lresolv check so it works on Mac OS X
+   10.6 (which doesn't have BIND8_COMPAT and thus uses res_9_query).  Patch
+   from jbasney at ncsa uiuc edu.
+
+20090908
+ - (djm) [serverloop.c] Fix test for server-assigned remote forwarding port
+   (-R 0:...); bz#1578, spotted and fix by gavin AT emf.net; ok dtucker@
+
+20090901
+ - (dtucker) [configure.ac] Bug #1639: use AC_PATH_PROG to search the path for

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 08:18: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 DFA7F106564A;
	Wed, 21 Apr 2010 08:18:06 +0000 (UTC)
	(envelope-from randi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CED9C8FC26;
	Wed, 21 Apr 2010 08:18: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 o3L8I6LJ096041;
	Wed, 21 Apr 2010 08:18:06 GMT (envelope-from randi@svn.freebsd.org)
Received: (from randi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L8I6uv096039;
	Wed, 21 Apr 2010 08:18:06 GMT (envelope-from randi@svn.freebsd.org)
Message-Id: <201004210818.o3L8I6uv096039@svn.freebsd.org>
From: Randi Harper 
Date: Wed, 21 Apr 2010 08:18: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: r206988 - 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: Wed, 21 Apr 2010 08:18:07 -0000

Author: randi
Date: Wed Apr 21 08:18:06 2010
New Revision: 206988
URL: http://svn.freebsd.org/changeset/base/206988

Log:
  Add myself to committers-src.dot.
  
  Approved by:	cperciva (mentor)

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==============================================================================
--- head/share/misc/committers-src.dot	Wed Apr 21 07:39:11 2010	(r206987)
+++ head/share/misc/committers-src.dot	Wed Apr 21 08:18:06 2010	(r206988)
@@ -162,6 +162,7 @@ pjd [label="Pawel Jakub Dawidek\npjd@Fre
 ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"]
 qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"]
 rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31"]
+randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20"]
 remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"]
 rik [label="Roman Kurakin\nrik@FreeBSD.org\n2003/12/18"]
 rink [label="Rink Springer\nrink@FreeBSD.org\n2006/01/16"]
@@ -245,6 +246,7 @@ bz -> jamie
 bz -> syrinx
 
 cperciva -> flz
+cperciva -> randi
 cperciva -> simon
 
 csjp -> bushman

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 08:57:37 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id 98E851065670; Wed, 21 Apr 2010 08:57:37 +0000 (UTC)
Date: Wed, 21 Apr 2010 08:57:37 +0000
From: Alexey Dokuchaev 
To: Ana Kukec 
Message-ID: <20100421085737.GB70860@FreeBSD.org>
References: <201004201816.o3KIGuAk006081@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <201004201816.o3KIGuAk006081@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: r206904 - 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: Wed, 21 Apr 2010 08:57:37 -0000

On Tue, Apr 20, 2010 at 06:16:56PM +0000, Ana Kukec wrote:
> Author: anchie
> Date: Tue Apr 20 18:16:56 2010
> New Revision: 206904
> URL: http://svn.freebsd.org/changeset/base/206904
> 
> Log:
>   Add myself and list bz@ as my mentor.
>   
>   Approved by:	bz (mentor)
> 
> Modified:
>   head/share/misc/committers-src.dot
> 
> Modified: head/share/misc/committers-src.dot
> ==============================================================================
> --- head/share/misc/committers-src.dot	Tue Apr 20 17:57:43 2010	(r206903)
> +++ head/share/misc/committers-src.dot	Tue Apr 20 18:16:56 2010	(r206904)
> @@ -55,6 +55,7 @@ node [color=lightblue2, style=filled, bg
>  ache [label="Andrey Chernov\nache@FreeBSD.org\n1993/10/31"]
>  akiyama [label="Shunsuke Akiyama\nakiyama@FreeBSD.org\n2000/06/19"]
>  ambrisko [label="Doug Ambrisko\nambrisko@FreeBSD.org\n2001/12/19"]
> +anchie [label="Ana Kukec\anchie@FreeBSD.org\n2010/04/14"]

Looks like a missing `n' after `\' to me.

./danfe

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 10:21: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 406EF1065670;
	Wed, 21 Apr 2010 10:21:35 +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 2F37D8FC08;
	Wed, 21 Apr 2010 10:21: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 o3LALZZT023274;
	Wed, 21 Apr 2010 10:21:35 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LALZWn023272;
	Wed, 21 Apr 2010 10:21:35 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211021.o3LALZWn023272@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 10:21: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: r206989 - 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: Wed, 21 Apr 2010 10:21:35 -0000

Author: bz
Date: Wed Apr 21 10:21:34 2010
New Revision: 206989
URL: http://svn.freebsd.org/changeset/base/206989

Log:
  Avoid memory access after free.  Use the (shortend) copy for the
  ipsec mtu lookup as well.
  
  PR:		kern/145736
  Submitted by:	Peter Molnar (peter molnar.cc)
  MFC after:	3 days

Modified:
  head/sys/netinet/ip_input.c

Modified: head/sys/netinet/ip_input.c
==============================================================================
--- head/sys/netinet/ip_input.c	Wed Apr 21 08:18:06 2010	(r206988)
+++ head/sys/netinet/ip_input.c	Wed Apr 21 10:21:34 2010	(r206989)
@@ -1590,7 +1590,7 @@ ip_forward(struct mbuf *m, int srcrt)
 		 * If IPsec is configured for this path,
 		 * override any possibly mtu value set by ip_output.
 		 */ 
-		mtu = ip_ipsec_mtu(m, mtu);
+		mtu = ip_ipsec_mtu(mcopy, mtu);
 #endif /* IPSEC */
 		/*
 		 * If the MTU was set before make sure we are below the

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 11:09: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 9B465106564A;
	Wed, 21 Apr 2010 11:09:13 +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 6F7F38FC19;
	Wed, 21 Apr 2010 11:09: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 o3LB9DEF035116;
	Wed, 21 Apr 2010 11:09:13 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LB9DQO035114;
	Wed, 21 Apr 2010 11:09:13 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004211109.o3LB9DQO035114@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 21 Apr 2010 11:09:13 +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: r206990 - stable/8/lib/libc/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, 21 Apr 2010 11:09:13 -0000

Author: kib
Date: Wed Apr 21 11:09:13 2010
New Revision: 206990
URL: http://svn.freebsd.org/changeset/base/206990

Log:
  MFC r206549:
  Align the declaration for sa_sigaction with POSIX.
  
  MFC r206649:
  Still reference struct __sigaction with clarification when this form
  of argument declaration is needed.
  
  MFC r206802:
  Revert r206649. Simplify the presented declaration of struct sigaction.

Modified:
  stable/8/lib/libc/sys/sigaction.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/sys/sigaction.2
==============================================================================
--- stable/8/lib/libc/sys/sigaction.2	Wed Apr 21 10:21:34 2010	(r206989)
+++ stable/8/lib/libc/sys/sigaction.2	Wed Apr 21 11:09:13 2010	(r206990)
@@ -28,7 +28,7 @@
 .\"	From: @(#)sigaction.2	8.2 (Berkeley) 4/3/94
 .\" $FreeBSD$
 .\"
-.Dd June 7, 2004
+.Dd April 18, 2010
 .Dt SIGACTION 2
 .Os
 .Sh NAME
@@ -40,16 +40,11 @@
 .In signal.h
 .Bd -literal
 struct  sigaction {
-        union {
-                void    (*__sa_handler)(int);
-                void    (*__sa_sigaction)(int, struct __siginfo *, void *);
-        } __sigaction_u;                /* signal handler */
+        void    (*sa_handler)(int);
+        void    (*sa_sigaction)(int, siginfo_t *, void *);
         int     sa_flags;               /* see signal options below */
         sigset_t sa_mask;               /* signal mask to apply */
 };
-
-#define	sa_handler	__sigaction_u.__sa_handler
-#define	sa_sigaction	__sigaction_u.__sa_sigaction
 .Ed
 .Ft int
 .Fo sigaction
@@ -148,6 +143,16 @@ If
 is non-zero, the previous handling information for the signal
 is returned to the user.
 .Pp
+The above declaration of
+.Vt "struct sigaction"
+is not literal.
+It is provided only to list the accessible members.
+See
+.In sys/signal.h
+for the actual definition.
+In particular, the storage occupied by sa_handler and sa_sigaction overlaps,
+and an application can not use both simultaneously.
+.Pp
 Once a signal handler is installed, it normally remains installed
 until another
 .Fn sigaction

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 11:11: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 9744F106566B;
	Wed, 21 Apr 2010 11:11: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 6B9038FC15;
	Wed, 21 Apr 2010 11:11: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 o3LBBBKd035633;
	Wed, 21 Apr 2010 11:11:11 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LBBBti035631;
	Wed, 21 Apr 2010 11:11:11 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004211111.o3LBBBti035631@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 21 Apr 2010 11:11:11 +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: r206991 - stable/7/lib/libc/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, 21 Apr 2010 11:11:11 -0000

Author: kib
Date: Wed Apr 21 11:11:11 2010
New Revision: 206991
URL: http://svn.freebsd.org/changeset/base/206991

Log:
  MFC r206549:
  Align the declaration for sa_sigaction with POSIX.
  
  MFC r206649:
  Still reference struct __sigaction with clarification when this form
  of argument declaration is needed.
  
  MFC r206802:
  Revert r206649. Simplify the presented declaration of struct sigaction.

Modified:
  stable/7/lib/libc/sys/sigaction.2
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/sys/sigaction.2
==============================================================================
--- stable/7/lib/libc/sys/sigaction.2	Wed Apr 21 11:09:13 2010	(r206990)
+++ stable/7/lib/libc/sys/sigaction.2	Wed Apr 21 11:11:11 2010	(r206991)
@@ -28,7 +28,7 @@
 .\"	From: @(#)sigaction.2	8.2 (Berkeley) 4/3/94
 .\" $FreeBSD$
 .\"
-.Dd June 7, 2004
+.Dd April 18, 2010
 .Dt SIGACTION 2
 .Os
 .Sh NAME
@@ -40,16 +40,11 @@
 .In signal.h
 .Bd -literal
 struct  sigaction {
-        union {
-                void    (*__sa_handler)(int);
-                void    (*__sa_sigaction)(int, struct __siginfo *, void *);
-        } __sigaction_u;                /* signal handler */
+        void    (*sa_handler)(int);
+        void    (*sa_sigaction)(int, siginfo_t *, void *);
         int     sa_flags;               /* see signal options below */
         sigset_t sa_mask;               /* signal mask to apply */
 };
-
-#define	sa_handler	__sigaction_u.__sa_handler
-#define	sa_sigaction	__sigaction_u.__sa_sigaction
 .Ed
 .Ft int
 .Fo sigaction
@@ -148,6 +143,16 @@ If
 is non-zero, the previous handling information for the signal
 is returned to the user.
 .Pp
+The above declaration of
+.Vt "struct sigaction"
+is not literal.
+It is provided only to list the accessible members.
+See
+.In sys/signal.h
+for the actual definition.
+In particular, the storage occupied by sa_handler and sa_sigaction overlaps,
+and an application can not use both simultaneously.
+.Pp
 Once a signal handler is installed, it normally remains installed
 until another
 .Fn sigaction

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 11:17: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 C4692106566B;
	Wed, 21 Apr 2010 11:17:16 +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 B2F4E8FC18;
	Wed, 21 Apr 2010 11:17: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 o3LBHG1H036983;
	Wed, 21 Apr 2010 11:17:16 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LBHGOm036981;
	Wed, 21 Apr 2010 11:17:16 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004211117.o3LBHGOm036981@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 21 Apr 2010 11:17: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: r206992 - head/sys/amd64/ia32
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, 21 Apr 2010 11:17:16 -0000

Author: kib
Date: Wed Apr 21 11:17:16 2010
New Revision: 206992
URL: http://svn.freebsd.org/changeset/base/206992

Log:
  As was done in r155238 for i386 and in r155239 for amd64, clear the carry
  flag for ia32 binary executed on amd64 host in get_mcontext().
  
  PR:	kern/92110 (one more time)
  Reported by:	stas
  MFC after:	1 week

Modified:
  head/sys/amd64/ia32/ia32_signal.c

Modified: head/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- head/sys/amd64/ia32/ia32_signal.c	Wed Apr 21 11:11:11 2010	(r206991)
+++ head/sys/amd64/ia32/ia32_signal.c	Wed Apr 21 11:17:16 2010	(r206992)
@@ -141,9 +141,11 @@ ia32_get_mcontext(struct thread *td, str
 	mcp->mc_esi = tp->tf_rsi;
 	mcp->mc_ebp = tp->tf_rbp;
 	mcp->mc_isp = tp->tf_rsp;
+	mcp->mc_eflags = tp->tf_rflags;
 	if (flags & GET_MC_CLEAR_RET) {
 		mcp->mc_eax = 0;
 		mcp->mc_edx = 0;
+		mcp->mc_eflags &= ~PSL_C;
 	} else {
 		mcp->mc_eax = tp->tf_rax;
 		mcp->mc_edx = tp->tf_rdx;
@@ -152,7 +154,6 @@ ia32_get_mcontext(struct thread *td, str
 	mcp->mc_ecx = tp->tf_rcx;
 	mcp->mc_eip = tp->tf_rip;
 	mcp->mc_cs = tp->tf_cs;
-	mcp->mc_eflags = tp->tf_rflags;
 	mcp->mc_esp = tp->tf_rsp;
 	mcp->mc_ss = tp->tf_ss;
 	mcp->mc_len = sizeof(*mcp);

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 11:28: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 5935C106566C;
	Wed, 21 Apr 2010 11:28:13 +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 47F898FC13;
	Wed, 21 Apr 2010 11:28: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 o3LBSD7o039425;
	Wed, 21 Apr 2010 11:28:13 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LBSDwC039423;
	Wed, 21 Apr 2010 11:28:13 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004211128.o3LBSDwC039423@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 21 Apr 2010 11:28: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: r206993 - head/sys/pc98/cbus
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, 21 Apr 2010 11:28:13 -0000

Author: rpaulo
Date: Wed Apr 21 11:28:13 2010
New Revision: 206993
URL: http://svn.freebsd.org/changeset/base/206993

Log:
  Comply with the new cyclic dtrace module variable name
  (cyclic_clock_func).

Modified:
  head/sys/pc98/cbus/clock.c

Modified: head/sys/pc98/cbus/clock.c
==============================================================================
--- head/sys/pc98/cbus/clock.c	Wed Apr 21 11:17:16 2010	(r206992)
+++ head/sys/pc98/cbus/clock.c	Wed Apr 21 11:28:13 2010	(r206993)
@@ -175,8 +175,8 @@ clkintr(struct trapframe *frame)
 	 * timers.
 	 */
 	int cpu = PCPU_GET(cpuid);
-	if (lapic_cyclic_clock_func[cpu] != NULL)
-		(*lapic_cyclic_clock_func[cpu])(frame);
+	if (cyclic_clock_func[cpu] != NULL)
+		(*cyclic_clock_func[cpu])(frame);
 #endif
 
 #ifdef SMP

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 11:35: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 473B11065674;
	Wed, 21 Apr 2010 11:35:35 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 2271E8FC31;
	Wed, 21 Apr 2010 11:35:34 +0000 (UTC)
Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14])
	by karen.lavabit.com (Postfix) with ESMTP id 78AF724EE08;
	Wed, 21 Apr 2010 06:35:34 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id 73X69BNNVBWD;
	Wed, 21 Apr 2010 06:35:34 -0500
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <20100421.094242.94902748.nyan@FreeBSD.org>
Date: Wed, 21 Apr 2010 12:35:31 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <46ADE413-773C-47C3-8EDE-12B6FEDC0BD8@FreeBSD.org>
References: <201004202104.o3KL4vHv043955@svn.freebsd.org>
	<20100421.094242.94902748.nyan@FreeBSD.org>
To: TAKAHASHI Yoshihiro 
X-Mailer: Apple Mail (2.1078)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r206922 - head/sys/x86/isa
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, 21 Apr 2010 11:35:35 -0000

On 21 Apr 2010, at 01:42, TAKAHASHI Yoshihiro wrote:

> In article <201004202104.o3KL4vHv043955@svn.freebsd.org>
> Rui Paulo  writes:
>=20
>> Log:
>>  Fix another instance of lapic_cyclic_clock_func.
>>=20
>> Modified:
>>  head/sys/x86/isa/clock.c
>>=20
>> Modified: head/sys/x86/isa/clock.c
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>> --- head/sys/x86/isa/clock.c	Tue Apr 20 21:03:42 2010	=
(r206921)
>> +++ head/sys/x86/isa/clock.c	Tue Apr 20 21:04:57 2010	=
(r206922)
>> @@ -186,8 +186,8 @@ clkintr(struct trapframe *frame)
>> 	 * timers.
>> 	 */
>> 	int cpu =3D PCPU_GET(cpuid);
>> -	if (lapic_cyclic_clock_func[cpu] !=3D NULL)
>> -		(*lapic_cyclic_clock_func[cpu])(frame);
>> +	if (cyclic_clock_func[cpu] !=3D NULL)
>> +		(*cyclic_clock_func[cpu])(frame);
>> #endif
>>=20
>> 	if (using_atrtc_timer) {
>=20
> The same change is needed for sys/pc98/cbus/clock.c.

Thanks, fixed.

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 11:50: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 2D97D106566C;
	Wed, 21 Apr 2010 11:50:14 +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 1BE9B8FC17;
	Wed, 21 Apr 2010 11:50: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 o3LBoEQH044259;
	Wed, 21 Apr 2010 11:50:14 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LBoEGs044257;
	Wed, 21 Apr 2010 11:50:14 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201004211150.o3LBoEGs044257@svn.freebsd.org>
From: Fabien Thomas 
Date: Wed, 21 Apr 2010 11:50: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: r206994 - 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: Wed, 21 Apr 2010 11:50:14 -0000

Author: fabient
Date: Wed Apr 21 11:50:13 2010
New Revision: 206994
URL: http://svn.freebsd.org/changeset/base/206994

Log:
  Apply threshold filter to root node in calltree view.
  
  MFC after: 3days

Modified:
  head/usr.sbin/pmcstat/pmcpl_calltree.c

Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c
==============================================================================
--- head/usr.sbin/pmcstat/pmcpl_calltree.c	Wed Apr 21 11:28:13 2010	(r206993)
+++ head/usr.sbin/pmcstat/pmcpl_calltree.c	Wed Apr 21 11:50:13 2010	(r206994)
@@ -499,9 +499,10 @@ void
 pmcpl_ct_topdisplay(void)
 {
 	int i, x, y, pmcin;
-	struct pmcpl_ct_sample rsamples;
+	struct pmcpl_ct_sample r, *rsamples;
 
-	pmcpl_ct_samples_root(&rsamples);
+	rsamples = &r;
+	pmcpl_ct_samples_root(rsamples);
 
 	PMCSTAT_PRINTW("%-10.10s %s\n", "IMAGE", "CALLTREE");
 
@@ -524,16 +525,20 @@ pmcpl_ct_topdisplay(void)
 			if (PMCPL_CT_SAMPLE(pmcin,
 			    &pmcpl_ct_root->pct_arc[i].pcta_samples) == 0)
 				continue;
+			if (PMCPL_CT_SAMPLEP(pmcin,
+			    &pmcpl_ct_root->pct_arc[i].pcta_samples) <=
+			    pmcstat_threshold)
+				continue;
 			if (pmcpl_ct_node_dumptop(pmcin,
 			        pmcpl_ct_root->pct_arc[i].pcta_child,
-			        &rsamples, x, &y, pmcstat_displayheight - 2)) {
+			        rsamples, x, &y, pmcstat_displayheight - 2)) {
 				break;
 			}
 		}
 
-		pmcpl_ct_node_printtop(&rsamples, pmcin, y);
+		pmcpl_ct_node_printtop(rsamples, pmcin, y);
 	}
-	pmcpl_ct_samples_free(&rsamples);
+	pmcpl_ct_samples_free(rsamples);
 }
 
 /*

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 12:02: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 4F1DC106566B;
	Wed, 21 Apr 2010 12:02:46 +0000 (UTC)
	(envelope-from randi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3DF0C8FC2A;
	Wed, 21 Apr 2010 12:02: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 o3LC2kVV047113;
	Wed, 21 Apr 2010 12:02:46 GMT (envelope-from randi@svn.freebsd.org)
Received: (from randi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LC2k7Y047111;
	Wed, 21 Apr 2010 12:02:46 GMT (envelope-from randi@svn.freebsd.org)
Message-Id: <201004211202.o3LC2k7Y047111@svn.freebsd.org>
From: Randi Harper 
Date: Wed, 21 Apr 2010 12:02: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: r206995 - 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: Wed, 21 Apr 2010 12:02:46 -0000

Author: randi
Date: Wed Apr 21 12:02:45 2010
New Revision: 206995
URL: http://svn.freebsd.org/changeset/base/206995

Log:
  Fix bug introduced in r198317: Don't leak a file descriptor after scanning for network devices.
  
  Approved by:	cperciva (mentor)
  MFC after:	1 week (original commit + bugfix)

Modified:
  head/usr.sbin/sysinstall/tcpip.c

Modified: head/usr.sbin/sysinstall/tcpip.c
==============================================================================
--- head/usr.sbin/sysinstall/tcpip.c	Wed Apr 21 11:50:13 2010	(r206994)
+++ head/usr.sbin/sysinstall/tcpip.c	Wed Apr 21 12:02:45 2010	(r206995)
@@ -683,6 +683,8 @@ tcpDeviceScan(void)
 		}
 	}
 
+	close(s);
+
 	freeifaddrs(ifap);
 
 	return (NULL);

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 12:17: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 7BC39106566C;
	Wed, 21 Apr 2010 12:17:02 +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 6A9A18FC26;
	Wed, 21 Apr 2010 12:17: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 o3LCH2mr050252;
	Wed, 21 Apr 2010 12:17:02 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LCH2Lq050249;
	Wed, 21 Apr 2010 12:17:02 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004211217.o3LCH2Lq050249@svn.freebsd.org>
From: Andriy Gapon 
Date: Wed, 21 Apr 2010 12:17: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: r206996 - in head: etc/mtree share/examples
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, 21 Apr 2010 12:17:02 -0000

Author: avg
Date: Wed Apr 21 12:17:01 2010
New Revision: 206996
URL: http://svn.freebsd.org/changeset/base/206996

Log:
  indent.pro example: actually install the sample file

Modified:
  head/etc/mtree/BSD.usr.dist
  head/share/examples/Makefile

Modified: head/etc/mtree/BSD.usr.dist
==============================================================================
--- head/etc/mtree/BSD.usr.dist	Wed Apr 21 12:02:45 2010	(r206995)
+++ head/etc/mtree/BSD.usr.dist	Wed Apr 21 12:17:01 2010	(r206996)
@@ -219,6 +219,8 @@
             ..
             ibcs2
             ..
+            indent
+            ..
             ipfilter
             ..
             ipfw

Modified: head/share/examples/Makefile
==============================================================================
--- head/share/examples/Makefile	Wed Apr 21 12:02:45 2010	(r206995)
+++ head/share/examples/Makefile	Wed Apr 21 12:17:01 2010	(r206996)
@@ -15,6 +15,7 @@ LDIRS=	BSD_daemon \
 	find_interface \
 	hast \
 	ibcs2 \
+	indent \
 	ipfw \
 	kld \
 	libvgl \
@@ -77,6 +78,7 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
 	hast/vip-up.sh \
 	ibcs2/README \
 	ibcs2/hello.uu \
+	indent/indent.pro \
 	ipfw/change_rules.sh \
 	kld/Makefile \
 	kld/cdev/Makefile \

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 12:21: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 9C03C1065670;
	Wed, 21 Apr 2010 12:21:35 +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 3ED108FC2C;
	Wed, 21 Apr 2010 12:21:33 +0000 (UTC)
Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua
	[212.40.38.101])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA02403;
	Wed, 21 Apr 2010 15:21:29 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Message-ID: <4BCEEDC9.6040608@freebsd.org>
Date: Wed, 21 Apr 2010 15:21:29 +0300
From: Andriy Gapon 
User-Agent: Thunderbird 2.0.0.24 (X11/20100319)
MIME-Version: 1.0
To: Andriy Gapon 
References: <201004211217.o3LCH2Lq050249@svn.freebsd.org>
In-Reply-To: <201004211217.o3LCH2Lq050249@svn.freebsd.org>
X-Enigmail-Version: 0.95.7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r206996 - in head: etc/mtree share/examples
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, 21 Apr 2010 12:21:35 -0000

on 21/04/2010 15:17 Andriy Gapon said the following:
> Author: avg
> Date: Wed Apr 21 12:17:01 2010
> New Revision: 206996
> URL: http://svn.freebsd.org/changeset/base/206996
> 
> Log:
>   indent.pro example: actually install the sample file
> 
> Modified:
>   head/etc/mtree/BSD.usr.dist
>   head/share/examples/Makefile

I see that there is a number of files/directories in share/examples that are not
hooked into share/examples/Makefile and/or BSD.usr.dist.
Could that be by design/intention?

> Modified: head/etc/mtree/BSD.usr.dist
> ==============================================================================
> --- head/etc/mtree/BSD.usr.dist	Wed Apr 21 12:02:45 2010	(r206995)
> +++ head/etc/mtree/BSD.usr.dist	Wed Apr 21 12:17:01 2010	(r206996)
> @@ -219,6 +219,8 @@
>              ..
>              ibcs2
>              ..
> +            indent
> +            ..
>              ipfilter
>              ..
>              ipfw
> 
> Modified: head/share/examples/Makefile
> ==============================================================================
> --- head/share/examples/Makefile	Wed Apr 21 12:02:45 2010	(r206995)
> +++ head/share/examples/Makefile	Wed Apr 21 12:17:01 2010	(r206996)
> @@ -15,6 +15,7 @@ LDIRS=	BSD_daemon \
>  	find_interface \
>  	hast \
>  	ibcs2 \
> +	indent \
>  	ipfw \
>  	kld \
>  	libvgl \
> @@ -77,6 +78,7 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
>  	hast/vip-up.sh \
>  	ibcs2/README \
>  	ibcs2/hello.uu \
> +	indent/indent.pro \
>  	ipfw/change_rules.sh \
>  	kld/Makefile \
>  	kld/cdev/Makefile \


-- 
Andriy Gapon

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 16:38: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 E600F106564A;
	Wed, 21 Apr 2010 16:38:37 +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 D58C18FC08;
	Wed, 21 Apr 2010 16:38: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 o3LGcbK0008133;
	Wed, 21 Apr 2010 16:38:37 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LGcbAd008132;
	Wed, 21 Apr 2010 16:38:37 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004211638.o3LGcbAd008132@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 21 Apr 2010 16:38: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: r206997 - head/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: Wed, 21 Apr 2010 16:38:38 -0000

Author: kib
Date: Wed Apr 21 16:38:37 2010
New Revision: 206997
URL: http://svn.freebsd.org/changeset/base/206997

Log:
  Move realpath(3) prototype to a POSIX section.
  
  Noted by:	bde
  MFC after:	2 weeks

Modified:
  head/include/stdlib.h

Modified: head/include/stdlib.h
==============================================================================
--- head/include/stdlib.h	Wed Apr 21 12:17:01 2010	(r206996)
+++ head/include/stdlib.h	Wed Apr 21 16:38:37 2010	(r206997)
@@ -155,6 +155,7 @@ void	 _Exit(int) __dead2;
 #if __POSIX_VISIBLE /* >= ??? */
 int	 posix_memalign(void **, size_t, size_t); /* (ADV) */
 int	 rand_r(unsigned *);			/* (TSF) */
+char	*realpath(const char * __restrict, char * __restrict);
 int	 setenv(const char *, const char *, int);
 int	 unsetenv(const char *);
 #endif
@@ -201,7 +202,6 @@ int	 posix_openpt(int);
 char	*ptsname(int);
 int	 putenv(char *);
 long	 random(void);
-char	*realpath(const char * __restrict, char * __restrict);
 unsigned short
 	*seed48(unsigned short[3]);
 #ifndef _SETKEY_DECLARED

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 16:41: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 6C94E1065677;
	Wed, 21 Apr 2010 16:41:02 +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 5C5F88FC20;
	Wed, 21 Apr 2010 16:41: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 o3LGf2It008704;
	Wed, 21 Apr 2010 16:41:02 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LGf2jB008702;
	Wed, 21 Apr 2010 16:41:02 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004211641.o3LGf2jB008702@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 21 Apr 2010 16:41: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: r206998 - 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, 21 Apr 2010 16:41:02 -0000

Author: kib
Date: Wed Apr 21 16:41:02 2010
New Revision: 206998
URL: http://svn.freebsd.org/changeset/base/206998

Log:
  Add standards section, improve wording, taking into account the handling
  of NULL and changed type in declaration.
  
  Suggested by:	bde
  MFC after:	2 weeks

Modified:
  head/lib/libc/stdlib/realpath.3

Modified: head/lib/libc/stdlib/realpath.3
==============================================================================
--- head/lib/libc/stdlib/realpath.3	Wed Apr 21 16:38:37 2010	(r206997)
+++ head/lib/libc/stdlib/realpath.3	Wed Apr 21 16:41:02 2010	(r206998)
@@ -94,14 +94,11 @@ If an error occurs,
 .Fn realpath
 returns
 .Dv NULL ,
-and
-.Fa resolved_path
-contains the pathname which caused the problem.
-If
+and if
 .Fa resolved_path
-was
+is not
 .Dv NULL ,
-then information of the failed pathname component is lost.
+the array that it points to contains the pathname which caused the problem.
 .Sh ERRORS
 The function
 .Fn realpath
@@ -126,6 +123,11 @@ when given a relative
 .Fa pathname .
 .Sh "SEE ALSO"
 .Xr getcwd 3
+.Sh STANDARDS
+The
+.Fn realpath
+function conforms to
+.St -p1003.1-2001 .
 .Sh HISTORY
 The
 .Fn realpath

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 17:00: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 983A41065674;
	Wed, 21 Apr 2010 17:00:16 +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 8563A8FC13;
	Wed, 21 Apr 2010 17:00: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 o3LH0G5O013078;
	Wed, 21 Apr 2010 17:00:16 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LH0Gaq013041;
	Wed, 21 Apr 2010 17:00:16 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201004211700.o3LH0Gaq013041@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 21 Apr 2010 17:00:16 +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: r206999 - stable/7/lib/libgssapi
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, 21 Apr 2010 17:00:16 -0000

Author: gavin
Date: Wed Apr 21 17:00:15 2010
New Revision: 206999
URL: http://svn.freebsd.org/changeset/base/206999

Log:
  Merge r203027 from head:
  
    Correct the HISTORY section of these man pages to show when the function,
    not the "manual page example" was introduced.

Modified:
  stable/7/lib/libgssapi/gss_accept_sec_context.3
  stable/7/lib/libgssapi/gss_acquire_cred.3
  stable/7/lib/libgssapi/gss_add_cred.3
  stable/7/lib/libgssapi/gss_add_oid_set_member.3
  stable/7/lib/libgssapi/gss_canonicalize_name.3
  stable/7/lib/libgssapi/gss_compare_name.3
  stable/7/lib/libgssapi/gss_context_time.3
  stable/7/lib/libgssapi/gss_create_empty_oid_set.3
  stable/7/lib/libgssapi/gss_delete_sec_context.3
  stable/7/lib/libgssapi/gss_display_name.3
  stable/7/lib/libgssapi/gss_display_status.3
  stable/7/lib/libgssapi/gss_duplicate_name.3
  stable/7/lib/libgssapi/gss_export_name.3
  stable/7/lib/libgssapi/gss_export_sec_context.3
  stable/7/lib/libgssapi/gss_get_mic.3
  stable/7/lib/libgssapi/gss_import_name.3
  stable/7/lib/libgssapi/gss_import_sec_context.3
  stable/7/lib/libgssapi/gss_indicate_mechs.3
  stable/7/lib/libgssapi/gss_init_sec_context.3
  stable/7/lib/libgssapi/gss_inquire_context.3
  stable/7/lib/libgssapi/gss_inquire_cred.3
  stable/7/lib/libgssapi/gss_inquire_cred_by_mech.3
  stable/7/lib/libgssapi/gss_inquire_mechs_for_name.3
  stable/7/lib/libgssapi/gss_inquire_names_for_mech.3
  stable/7/lib/libgssapi/gss_process_context_token.3
  stable/7/lib/libgssapi/gss_release_buffer.3
  stable/7/lib/libgssapi/gss_release_cred.3
  stable/7/lib/libgssapi/gss_release_name.3
  stable/7/lib/libgssapi/gss_release_oid_set.3
  stable/7/lib/libgssapi/gss_test_oid_set_member.3
  stable/7/lib/libgssapi/gss_unwrap.3
  stable/7/lib/libgssapi/gss_verify_mic.3
  stable/7/lib/libgssapi/gss_wrap.3
  stable/7/lib/libgssapi/gss_wrap_size_limit.3
  stable/7/lib/libgssapi/gssapi.3
  stable/7/lib/libgssapi/mech.5
Directory Properties:
  stable/7/lib/libgssapi/   (props changed)

Modified: stable/7/lib/libgssapi/gss_accept_sec_context.3
==============================================================================
--- stable/7/lib/libgssapi/gss_accept_sec_context.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_accept_sec_context.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_ACCEPT_SEC_CONTEXT 3 PRM
 .Sh NAME
@@ -451,7 +451,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_acquire_cred.3
==============================================================================
--- stable/7/lib/libgssapi/gss_acquire_cred.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_acquire_cred.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_ACQUIRE_CRED 3 PRM
 .Sh NAME
@@ -205,7 +205,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_add_cred.3
==============================================================================
--- stable/7/lib/libgssapi/gss_add_cred.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_add_cred.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_ADD_CRED 3 PRM
 .Sh NAME
@@ -305,7 +305,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_add_oid_set_member.3
==============================================================================
--- stable/7/lib/libgssapi/gss_add_oid_set_member.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_add_oid_set_member.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_ADD_OID_SET_MEMBER 3 PRM
 .Sh NAME
@@ -97,7 +97,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_canonicalize_name.3
==============================================================================
--- stable/7/lib/libgssapi/gss_canonicalize_name.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_canonicalize_name.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_CANONICALIZE_NAME 3 PRM
 .Sh NAME
@@ -104,7 +104,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_compare_name.3
==============================================================================
--- stable/7/lib/libgssapi/gss_compare_name.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_compare_name.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_COMPARE_NAME PRM
 .Sh NAME
@@ -89,7 +89,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_context_time.3
==============================================================================
--- stable/7/lib/libgssapi/gss_context_time.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_context_time.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_CONTEXT_TIME 3 PRM
 .Sh NAME
@@ -75,7 +75,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_create_empty_oid_set.3
==============================================================================
--- stable/7/lib/libgssapi/gss_create_empty_oid_set.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_create_empty_oid_set.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_CREATE_EMPTY_OID_SET 3 PRM
 .Sh NAME
@@ -78,7 +78,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_delete_sec_context.3
==============================================================================
--- stable/7/lib/libgssapi/gss_delete_sec_context.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_delete_sec_context.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_DELETE_SEC_CONTEXT 3 PRM
 .Sh NAME
@@ -130,7 +130,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_display_name.3
==============================================================================
--- stable/7/lib/libgssapi/gss_display_name.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_display_name.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_DISPLAY_NAME 3 PRM
 .Sh NAME
@@ -118,7 +118,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_display_status.3
==============================================================================
--- stable/7/lib/libgssapi/gss_display_status.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_display_status.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_DISPLAY_STATUS 3 PRM
 .Sh NAME
@@ -177,7 +177,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_duplicate_name.3
==============================================================================
--- stable/7/lib/libgssapi/gss_duplicate_name.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_duplicate_name.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_DUPLICATE_NAME 3 PRM
 .Sh NAME
@@ -90,7 +90,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_export_name.3
==============================================================================
--- stable/7/lib/libgssapi/gss_export_name.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_export_name.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_EXPORT_NAME 3 PRM
 .Sh NAME
@@ -95,7 +95,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_export_sec_context.3
==============================================================================
--- stable/7/lib/libgssapi/gss_export_sec_context.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_export_sec_context.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_EXPORT_SEC_CONTEXT 3 PRM
 .Sh NAME
@@ -135,7 +135,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_get_mic.3
==============================================================================
--- stable/7/lib/libgssapi/gss_get_mic.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_get_mic.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_GET_MIC 3 PRM
 .Sh NAME
@@ -132,7 +132,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_import_name.3
==============================================================================
--- stable/7/lib/libgssapi/gss_import_name.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_import_name.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_IMPORT_NAME 3 PRM
 .Sh NAME
@@ -106,7 +106,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_import_sec_context.3
==============================================================================
--- stable/7/lib/libgssapi/gss_import_sec_context.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_import_sec_context.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_IMPORT_SEC_CONTEXT 3 PRM
 .Sh NAME
@@ -87,7 +87,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_indicate_mechs.3
==============================================================================
--- stable/7/lib/libgssapi/gss_indicate_mechs.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_indicate_mechs.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_INDICATE_MECHS 3 PRM
 .Sh NAME
@@ -74,7 +74,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_init_sec_context.3
==============================================================================
--- stable/7/lib/libgssapi/gss_init_sec_context.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_init_sec_context.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_INIT_SEC_CONTEXT 3 PRM
 .Sh NAME
@@ -538,7 +538,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_inquire_context.3
==============================================================================
--- stable/7/lib/libgssapi/gss_inquire_context.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_inquire_context.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_INQUIRE_CONTEXT 3 PRM
 .Sh NAME
@@ -251,7 +251,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_inquire_cred.3
==============================================================================
--- stable/7/lib/libgssapi/gss_inquire_cred.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_inquire_cred.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_INQUIRE_CRED 3 PRM
 .Sh NAME
@@ -125,7 +125,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_inquire_cred_by_mech.3
==============================================================================
--- stable/7/lib/libgssapi/gss_inquire_cred_by_mech.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_inquire_cred_by_mech.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_INQUIRE_CRED_BY_MECH 3 PRM
 .Sh NAME
@@ -139,7 +139,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_inquire_mechs_for_name.3
==============================================================================
--- stable/7/lib/libgssapi/gss_inquire_mechs_for_name.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_inquire_mechs_for_name.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_INQUIRE_MECHS_FOR_NAME 3 PRM
 .Sh NAME
@@ -100,7 +100,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_inquire_names_for_mech.3
==============================================================================
--- stable/7/lib/libgssapi/gss_inquire_names_for_mech.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_inquire_names_for_mech.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_INQUIRE_NAMES_FOR_MECH 3 PRM
 .Sh NAME
@@ -74,7 +74,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_process_context_token.3
==============================================================================
--- stable/7/lib/libgssapi/gss_process_context_token.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_process_context_token.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_PROCESS_CONTEXT_TOKEN 3 PRM
 .Sh NAME
@@ -103,7 +103,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_release_buffer.3
==============================================================================
--- stable/7/lib/libgssapi/gss_release_buffer.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_release_buffer.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_RELEASE_BUFFER 3 PRM
 .Sh NAME
@@ -78,7 +78,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_release_cred.3
==============================================================================
--- stable/7/lib/libgssapi/gss_release_cred.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_release_cred.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_RELEASE_CRED 3 PRM
 .Sh NAME
@@ -75,7 +75,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_release_name.3
==============================================================================
--- stable/7/lib/libgssapi/gss_release_name.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_release_name.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_RELEASE_NAME 3 PRM
 .Sh NAME
@@ -71,7 +71,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_release_oid_set.3
==============================================================================
--- stable/7/lib/libgssapi/gss_release_oid_set.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_release_oid_set.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_RELEASE_OID_SET 3 PRM
 .Sh NAME
@@ -76,7 +76,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_test_oid_set_member.3
==============================================================================
--- stable/7/lib/libgssapi/gss_test_oid_set_member.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_test_oid_set_member.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_TEST_OID_SET_MEMBER 3 PRM
 .Sh NAME
@@ -83,7 +83,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_unwrap.3
==============================================================================
--- stable/7/lib/libgssapi/gss_unwrap.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_unwrap.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_UNWRAP 3 PRM
 .Sh NAME
@@ -158,7 +158,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_verify_mic.3
==============================================================================
--- stable/7/lib/libgssapi/gss_verify_mic.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_verify_mic.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_VERIFY_MIC 3 PRM
 .Sh NAME
@@ -139,7 +139,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_wrap.3
==============================================================================
--- stable/7/lib/libgssapi/gss_wrap.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_wrap.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_WRAP 3 PRM
 .Sh NAME
@@ -146,7 +146,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gss_wrap_size_limit.3
==============================================================================
--- stable/7/lib/libgssapi/gss_wrap_size_limit.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gss_wrap_size_limit.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -27,7 +27,7 @@
 .\"	$FreeBSD$
 .\"
 .\" The following commands are required for all man pages.
-.Dd October 30, 2007
+.Dd January 26, 2010
 .Os
 .Dt GSS_WRAP_SIZE_LIMIT 3 PRM
 .Sh NAME
@@ -131,7 +131,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+function first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/gssapi.3
==============================================================================
--- stable/7/lib/libgssapi/gssapi.3	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/gssapi.3	Wed Apr 21 17:00:15 2010	(r206999)
@@ -26,7 +26,7 @@
 .\"
 .\"	$FreeBSD$
 .\"
-.Dd November 30, 2005
+.Dd January 26, 2010
 .Dt GSSAPI 3
 .Os
 .Sh NAME
@@ -229,7 +229,7 @@ Generic Security Service API Version 2 :
 .Sh HISTORY
 The
 .Nm
-manual page first appeared in
+library first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 John Wray, Iris Associates

Modified: stable/7/lib/libgssapi/mech.5
==============================================================================
--- stable/7/lib/libgssapi/mech.5	Wed Apr 21 16:41:02 2010	(r206998)
+++ stable/7/lib/libgssapi/mech.5	Wed Apr 21 17:00:15 2010	(r206999)
@@ -23,7 +23,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd November 14, 2005
+.Dd January 26, 2010
 .Dt MECH 5
 .Os
 .Sh NAME
@@ -86,7 +86,7 @@ GSS_KRB5_CONF_C_QOP_DES		0x0100	kerberos
 .Sh HISTORY
 The
 .Nm
-manual page example first appeared in
+manual page first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 This

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 17:02: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 2826D106566B;
	Wed, 21 Apr 2010 17:02:45 +0000 (UTC)
	(envelope-from bruce@cran.org.uk)
Received: from muon.cran.org.uk (unknown [IPv6:2001:470:1f09:679::1])
	by mx1.freebsd.org (Postfix) with ESMTP id DF4658FC15;
	Wed, 21 Apr 2010 17:02:44 +0000 (UTC)
Received: from muon.cran.org.uk (localhost [127.0.0.1])
	by muon.cran.org.uk (Postfix) with ESMTP id 6620EC400C;
	Wed, 21 Apr 2010 17:02:43 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on muon.cran.org.uk
X-Spam-Level: 
X-Spam-Status: No, score=-3.0 required=8.0 tests=AWL,BAYES_00,RDNS_DYNAMIC
	autolearn=no version=3.2.5
Received: from core.draftnet (87-194-158-129.bethere.co.uk [87.194.158.129])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by muon.cran.org.uk (Postfix) with ESMTPSA;
	Wed, 21 Apr 2010 17:02:43 +0000 (UTC)
From: Bruce Cran 
To: Kostik Belousov 
Date: Wed, 21 Apr 2010 18:01:58 +0100
User-Agent: KMail/1.13.2 (FreeBSD/9.0-CURRENT; KDE/4.4.2; amd64; ; )
References: <201004202019.o3KKJJih033338@svn.freebsd.org>
	<20100420210208.GA2422@deviant.kiev.zoral.com.ua>
In-Reply-To: <20100420210208.GA2422@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201004211801.59151.bruce@cran.org.uk>
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org,
	Bruce Cran 
Subject: Re: svn commit: r206911 - stable/8/contrib/top
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, 21 Apr 2010 17:02:45 -0000

On Tuesday 20 April 2010 22:02:08 Kostik Belousov wrote:
> On Tue, Apr 20, 2010 at 08:19:19PM +0000, Bruce Cran wrote:
> > Author: brucec
> > Date: Tue Apr 20 20:19:19 2010
> > New Revision: 206911
> > URL: http://svn.freebsd.org/changeset/base/206911
> > 
> > Log:
> >   MFC r205119 and r206056:
> >   
> >   Prevent the SIZE field being corrupted when a process allocates more
> >   than 2TB.
> >   
> >   PR:	bin/129706
> >   Submitted by:	brucec
> >   Approved by: 	rrs (mentor)
> 
> Am I right that this change contains a bug that was fixed by r206842 ?
> If yes, why is it merged as is ?

Yes, it looks like it does have a bug. I was unaware of it when I did the 
merge.

-- 
Bruce Cran

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 17:38: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 E0BDF106566B;
	Wed, 21 Apr 2010 17:38:16 +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 CFFA08FC14;
	Wed, 21 Apr 2010 17:38: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 o3LHcGCt021504;
	Wed, 21 Apr 2010 17:38:16 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Received: (from bschmidt@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LHcGtH021502;
	Wed, 21 Apr 2010 17:38:16 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Message-Id: <201004211738.o3LHcGtH021502@svn.freebsd.org>
From: Bernhard Schmidt 
Date: Wed, 21 Apr 2010 17:38: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: r207001 - head/sys/dev/iwn
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, 21 Apr 2010 17:38:17 -0000

Author: bschmidt
Date: Wed Apr 21 17:38:16 2010
New Revision: 207001
URL: http://svn.freebsd.org/changeset/base/207001

Log:
  Use correct bus_dma_tag_t for TX frames.
  
  Reported by:	Andreas Nilsson 
  Approved by:	rpaulo (mentor)
  MFC after:	3 days

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==============================================================================
--- head/sys/dev/iwn/if_iwn.c	Wed Apr 21 17:23:31 2010	(r207000)
+++ head/sys/dev/iwn/if_iwn.c	Wed Apr 21 17:38:16 2010	(r207001)
@@ -2282,6 +2282,7 @@ iwn4965_tx_done(struct iwn_softc *sc, st
     struct iwn_rx_data *data)
 {
 	struct iwn4965_tx_stat *stat = (struct iwn4965_tx_stat *)(desc + 1);
+	struct iwn_tx_ring *ring = &sc->txq[desc->qid & 0xf];
 
 	DPRINTF(sc, IWN_DEBUG_XMIT, "%s: "
 	    "qid %d idx %d retries %d nkill %d rate %x duration %d status %x\n",
@@ -2289,7 +2290,7 @@ iwn4965_tx_done(struct iwn_softc *sc, st
 	    stat->btkillcnt, stat->rate, le16toh(stat->duration),
 	    le32toh(stat->status));
 
-	bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD);
+	bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD);
 	iwn_tx_done(sc, desc, stat->ackfailcnt, le32toh(stat->status) & 0xff);
 }
 
@@ -2298,6 +2299,7 @@ iwn5000_tx_done(struct iwn_softc *sc, st
     struct iwn_rx_data *data)
 {
 	struct iwn5000_tx_stat *stat = (struct iwn5000_tx_stat *)(desc + 1);
+	struct iwn_tx_ring *ring = &sc->txq[desc->qid & 0xf];
 
 	DPRINTF(sc, IWN_DEBUG_XMIT, "%s: "
 	    "qid %d idx %d retries %d nkill %d rate %x duration %d status %x\n",
@@ -2310,7 +2312,7 @@ iwn5000_tx_done(struct iwn_softc *sc, st
 	iwn5000_reset_sched(sc, desc->qid & 0xf, desc->idx);
 #endif
 
-	bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD);
+	bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD);
 	iwn_tx_done(sc, desc, stat->ackfailcnt, le16toh(stat->status) & 0xff);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 17:53: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 2EA00106566C;
	Wed, 21 Apr 2010 17:53:11 +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 186398FC1D;
	Wed, 21 Apr 2010 17:53: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 o3LHrBiV024823;
	Wed, 21 Apr 2010 17:53:11 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LHrB5j024817;
	Wed, 21 Apr 2010 17:53:11 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004211753.o3LHrB5j024817@svn.freebsd.org>
From: Xin LI 
Date: Wed, 21 Apr 2010 17:53: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: r207002 - in vendor/gnu-sort: 2.0.21 2.0.21/contrib
	2.0.21/lib 2.0.21/man 2.0.21/src 2.1 2.1/contrib 2.1/lib
	2.1/man 2.1/src 20040812 20040812/contrib 20040812/lib
	20040812/src 5.2.1 5....
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, 21 Apr 2010 17:53:11 -0000

Author: delphij
Date: Wed Apr 21 17:53:10 2010
New Revision: 207002
URL: http://svn.freebsd.org/changeset/base/207002

Log:
  Flattern tree.

Added:
  vendor/gnu-sort/2.0.21/ABOUT-NLS
     - copied unchanged from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/ABOUT-NLS
  vendor/gnu-sort/2.0.21/AUTHORS
     - copied unchanged from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/AUTHORS
  vendor/gnu-sort/2.0.21/COPYING
     - copied unchanged from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/COPYING
  vendor/gnu-sort/2.0.21/ChangeLog
     - copied unchanged from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/ChangeLog
  vendor/gnu-sort/2.0.21/INSTALL
     - copied unchanged from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/INSTALL
  vendor/gnu-sort/2.0.21/NEWS
     - copied unchanged from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/NEWS
  vendor/gnu-sort/2.0.21/README
     - copied unchanged from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/README
  vendor/gnu-sort/2.0.21/README-alpha
     - copied unchanged from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/README-alpha
  vendor/gnu-sort/2.0.21/THANKS
     - copied unchanged from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/THANKS
  vendor/gnu-sort/2.0.21/TODO
     - copied unchanged from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/TODO
  vendor/gnu-sort/2.0.21/lib/
     - copied from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/lib/
  vendor/gnu-sort/2.0.21/man/
     - copied from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/man/
  vendor/gnu-sort/2.0.21/src/
     - copied from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/src/
  vendor/gnu-sort/2.1/ABOUT-NLS
     - copied unchanged from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/ABOUT-NLS
  vendor/gnu-sort/2.1/AUTHORS
     - copied unchanged from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/AUTHORS
  vendor/gnu-sort/2.1/COPYING
     - copied unchanged from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/COPYING
  vendor/gnu-sort/2.1/ChangeLog
     - copied unchanged from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/ChangeLog
  vendor/gnu-sort/2.1/INSTALL
     - copied unchanged from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/INSTALL
  vendor/gnu-sort/2.1/NEWS
     - copied unchanged from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/NEWS
  vendor/gnu-sort/2.1/README
     - copied unchanged from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/README
  vendor/gnu-sort/2.1/THANKS
     - copied unchanged from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/THANKS
  vendor/gnu-sort/2.1/TODO
     - copied unchanged from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/TODO
  vendor/gnu-sort/2.1/lib/
     - copied from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/lib/
  vendor/gnu-sort/2.1/man/
     - copied from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/man/
  vendor/gnu-sort/2.1/src/
     - copied from r207001, vendor/gnu-sort/2.1/contrib/gnu-sort/src/
  vendor/gnu-sort/20040812/ABOUT-NLS
     - copied unchanged from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/ABOUT-NLS
  vendor/gnu-sort/20040812/AUTHORS
     - copied unchanged from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/AUTHORS
  vendor/gnu-sort/20040812/COPYING
     - copied unchanged from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/COPYING
  vendor/gnu-sort/20040812/ChangeLog
     - copied unchanged from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/ChangeLog
  vendor/gnu-sort/20040812/INSTALL
     - copied unchanged from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/INSTALL
  vendor/gnu-sort/20040812/NEWS
     - copied unchanged from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/NEWS
  vendor/gnu-sort/20040812/README
     - copied unchanged from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/README
  vendor/gnu-sort/20040812/THANKS
     - copied unchanged from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/THANKS
  vendor/gnu-sort/20040812/TODO
     - copied unchanged from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/TODO
  vendor/gnu-sort/20040812/lib/
     - copied from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/lib/
  vendor/gnu-sort/20040812/src/
     - copied from r207001, vendor/gnu-sort/20040812/contrib/gnu-sort/src/
  vendor/gnu-sort/5.2.1/ABOUT-NLS
     - copied unchanged from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/ABOUT-NLS
  vendor/gnu-sort/5.2.1/AUTHORS
     - copied unchanged from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/AUTHORS
  vendor/gnu-sort/5.2.1/COPYING
     - copied unchanged from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/COPYING
  vendor/gnu-sort/5.2.1/ChangeLog
     - copied unchanged from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/ChangeLog
  vendor/gnu-sort/5.2.1/INSTALL
     - copied unchanged from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/INSTALL
  vendor/gnu-sort/5.2.1/NEWS
     - copied unchanged from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/NEWS
  vendor/gnu-sort/5.2.1/README
     - copied unchanged from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/README
  vendor/gnu-sort/5.2.1/THANKS
     - copied unchanged from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/THANKS
  vendor/gnu-sort/5.2.1/THANKS-to-translators
     - copied unchanged from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/THANKS-to-translators
  vendor/gnu-sort/5.2.1/TODO
     - copied unchanged from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/TODO
  vendor/gnu-sort/5.2.1/lib/
     - copied from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/lib/
  vendor/gnu-sort/5.2.1/man/
     - copied from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/man/
  vendor/gnu-sort/5.2.1/src/
     - copied from r207001, vendor/gnu-sort/5.2.1/contrib/gnu-sort/src/
  vendor/gnu-sort/dist/ABOUT-NLS
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/ABOUT-NLS
  vendor/gnu-sort/dist/AUTHORS
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/AUTHORS
  vendor/gnu-sort/dist/COPYING
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/COPYING
  vendor/gnu-sort/dist/ChangeLog
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/ChangeLog
  vendor/gnu-sort/dist/INSTALL
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/INSTALL
  vendor/gnu-sort/dist/NEWS
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/NEWS
  vendor/gnu-sort/dist/README
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/README
  vendor/gnu-sort/dist/README-alpha
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/README-alpha
  vendor/gnu-sort/dist/THANKS
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/THANKS
  vendor/gnu-sort/dist/THANKS-to-translators
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/THANKS-to-translators
  vendor/gnu-sort/dist/TODO
     - copied unchanged from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/TODO
  vendor/gnu-sort/dist/lib/
     - copied from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/lib/
  vendor/gnu-sort/dist/man/
     - copied from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/man/
  vendor/gnu-sort/dist/src/
     - copied from r207001, vendor/gnu-sort/dist/contrib/gnu-sort/src/
Deleted:
  vendor/gnu-sort/2.0.21/contrib/
  vendor/gnu-sort/2.1/contrib/
  vendor/gnu-sort/20040812/contrib/
  vendor/gnu-sort/5.2.1/contrib/
  vendor/gnu-sort/dist/contrib/

Copied: vendor/gnu-sort/2.0.21/ABOUT-NLS (from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/ABOUT-NLS)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/gnu-sort/2.0.21/ABOUT-NLS	Wed Apr 21 17:53:10 2010	(r207002, copy of r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/ABOUT-NLS)
@@ -0,0 +1,393 @@
+Notes on the Free Translation Project
+*************************************
+
+   Free software is going international!  The Free Translation Project
+is a way to get maintainers of free software, translators, and users all
+together, so that will gradually become able to speak many languages.
+A few packages already provide translations for their messages.
+
+   If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site.  But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+   Installers will find here some useful hints.  These notes also
+explain how users should proceed for getting the programs to use the
+available translations.  They tell how people wanting to contribute and
+work at translations should contact the appropriate team.
+
+   When reporting bugs in the `intl/' directory or bugs which may be
+related to internationalization, you should tell about the version of
+`gettext' which is used.  The information can be found in the
+`intl/VERSION' file, in internationalized packages.
+
+Quick configuration advice
+==========================
+
+   If you want to exploit the full power of internationalization, you
+should configure it using
+
+     ./configure --with-included-gettext
+
+to force usage of internationalizing routines provided within this
+package, despite the existence of internationalizing capabilities in the
+operating system where this package is being installed.  So far, only
+the `gettext' implementation in the GNU C library version 2 provides as
+many features (such as locale alias, message inheritance, automatic
+charset conversion or plural form handling) as the implementation here.
+It is also not possible to offer this additional functionality on top
+of a `catgets' implementation.  Future versions of GNU `gettext' will
+very likely convey even more functionality.  So it might be a good idea
+to change to GNU `gettext' as soon as possible.
+
+   So you need _not_ provide this option if you are using GNU libc 2 or
+you have installed a recent copy of the GNU gettext package with the
+included `libintl'.
+
+INSTALL Matters
+===============
+
+   Some packages are "localizable" when properly installed; the
+programs they contain can be made to speak your own native language.
+Most such packages use GNU `gettext'.  Other packages have their own
+ways to internationalization, predating GNU `gettext'.
+
+   By default, this package will be installed to allow translation of
+messages.  It will automatically detect whether the system already
+provides the GNU `gettext' functions.  If not, the GNU `gettext' own
+library will be used.  This library is wholly contained within this
+package, usually in the `intl/' subdirectory, so prior installation of
+the GNU `gettext' package is _not_ required.  Installers may use
+special options at configuration time for changing the default
+behaviour.  The commands:
+
+     ./configure --with-included-gettext
+     ./configure --disable-nls
+
+will respectively bypass any pre-existing `gettext' to use the
+internationalizing routines provided within this package, or else,
+_totally_ disable translation of messages.
+
+   When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl.a' file and
+will decide to use this.  This might be not what is desirable.  You
+should use the more recent version of the GNU `gettext' library.  I.e.
+if the file `intl/VERSION' shows that the library which comes with this
+package is more recent, you should use
+
+     ./configure --with-included-gettext
+
+to prevent auto-detection.
+
+   The configuration process will not test for the `catgets' function
+and therefore it will not be used.  The reason is that even an
+emulation of `gettext' on top of `catgets' could not provide all the
+extensions of the GNU `gettext' library.
+
+   Internationalized packages have usually many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language.  Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package.  However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+Using This Package
+==================
+
+   As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination.  Here `LL' is an ISO 639 two-letter language code,
+and `CC' is an ISO 3166 two-letter country code.  For example, let's
+suppose that you speak German and live in Germany.  At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+   You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries.  For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil.  The
+country code serves to distinguish the dialects.
+
+   The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc.  On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'.  You can get the list of
+locales supported by your system for your country by running the command
+`locale -a | grep '^LL''.
+
+   Not all programs have translations for all languages.  By default, an
+English message is shown in place of a nonexistent translation.  If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'.  GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries.  For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+   In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect.  For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+Translating Teams
+=================
+
+   For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list.  The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
+area.
+
+   If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended.  For example, speakers of Swedish can send a
+message to `sv-request@li.org', having this message body:
+
+     subscribe
+
+   Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around.  If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `translation@iro.umontreal.ca' to reach the
+coordinator for all translator teams.
+
+   The English team is special.  It works at improving and uniformizing
+the terminology in use.  Proven linguistic skill are praised more than
+programming skill, here.
+
+Available Packages
+==================
+
+   Languages are not equally supported in all packages.  The following
+matrix shows the current state of internationalization, as of January
+2002.  The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+     Ready PO files    bg ca cs da de el en eo es et fi fr
+                     +-------------------------------------+
+     a2ps            |          [] []             []    [] |
+     bash            |             []       [] []       [] |
+     bfd             |                         []       [] |
+     binutils        |                         []       [] |
+     bison           |             []             []    [] |
+     clisp           |             []    []    []       [] |
+     cpio            |          [] []          []       [] |
+     diffutils       |       [] [] []       [] []       [] |
+     enscript        |             []                   [] |
+     error           |                         []       [] |
+     fetchmail       |       () [] []          []       () |
+     fileutils       |          [] []          [] []    [] |
+     findutils       |          [] []          [] []    [] |
+     flex            |          []             []       [] |
+     gas             |                                  [] |
+     gawk            |                         []       [] |
+     gcal            |    []                            [] |
+     gcc             |                         []       [] |
+     gettext         |    []    [] []          []       [] |
+     gnupg           |             [] []    [] [] []    [] |
+     gprof           |                         []       [] |
+     grep            |       []    []       [] [] []    [] |
+     hello           |          [] [] []    [] [] [] [] [] |
+     id-utils        |          [] []                   [] |
+     indent          |             []       []    []    [] |
+     jpilot          |       () [] []                   [] |
+     jwhois          |                         []       [] |
+     kbd             |                                  [] |
+     ld              |                         []       [] |
+     libc            |    [] [] [] [] []       []       [] |
+     lilypond        |          []                      [] |
+     lynx            |       [] [] []             []       |
+     m4              |       [] [] [] []                [] |
+     make            |          [] []          []       [] |
+     mysecretdiary   |             []                   [] |
+     nano            |    [] () [] []          []       [] |
+     nano_1_0        |    [] () [] []          []       [] |
+     opcodes         |          []             []       [] |
+     parted          |    []    [] []                   [] |
+     ptx             |          [] []          [] []    [] |
+     python          |                                     |
+     recode          |          [] [] []    [] []       [] |
+     sed             |       [] [] [] []    [] [] []    [] |
+     sh-utils        |    [] [] [] [] []       [] []    [] |
+     sharutils       |       [] [] [] []       []       [] |
+     sketch          |             ()          []       () |
+     soundtracker    |             []          []       [] |
+     sp              |                                     |
+     tar             |       [] [] []          [] []    [] |
+     texinfo         |       [] [] []       []          [] |
+     textutils       |          [] []          []       [] |
+     util-linux      |       [] []             []       [] |
+     wdiff           |          [] []          [] []    [] |
+     wget            |    [] [] [] [] []       [] []    [] |
+                     +-------------------------------------+
+                       bg ca cs da de el en eo es et fi fr
+                        0  8 12 31 36  9  1  9 37 15  1 49
+     
+                       gl he hr hu id it ja ko lv nb nl nn
+                     +-------------------------------------+
+     a2ps            |                ()    ()       []    |
+     bash            |                                     |
+     bfd             |                   []                |
+     binutils        |                   []                |
+     bison           |                   []                |
+     clisp           |                               []    |
+     cpio            | []                   []       []    |
+     diffutils       | [] []                               |
+     enscript        |                               []    |
+     error           |          []                         |
+     fetchmail       |                                     |
+     fileutils       |                [] []                |
+     findutils       | []          [] [] [] []       []    |
+     flex            |                      []             |
+     gas             |                                     |
+     gawk            |    []                               |
+     gcal            |                                     |
+     gcc             |                   []                |
+     gettext         |                      []             |
+     gnupg           | []             [] []                |
+     gprof           |                                     |
+     grep            | []             []                   |
+     hello           | []       []    [] [] [] [] [] [] [] |
+     id-utils        |                               []    |
+     indent          | []                []          []    |
+     jpilot          |                   ()          ()    |
+     jwhois          |                                     |
+     kbd             |                                     |
+     ld              |                                     |
+     libc            | []                [] []    []       |
+     lilypond        |                   []          []    |
+     lynx            |                   []          []    |
+     m4              | []          []    []          []    |
+     make            | []                [] []       []    |
+     mysecretdiary   |                                     |
+     nano            | []          [] [] ()          () [] |
+     nano_1_0        | []          [] [] ()          () [] |
+     opcodes         |                                     |
+     parted          | []                []             [] |
+     ptx             | []          []             [] []    |
+     python          |                                     |
+     recode          | [] []          []                   |
+     sed             | [] []       [] [] [] []       []    |
+     sh-utils        | []             [] []       [] []    |
+     sharutils       | []                []          []    |
+     sketch          |                ()                   |
+     soundtracker    | []                                  |
+     sp              |                                     |
+     tar             |                [] []       []       |
+     texinfo         |    [] []          []                |
+     textutils       |                      []    []       |
+     util-linux      |                () []                |
+     wdiff           |                                     |
+     wget            | [] []    []       []          []    |
+                     +-------------------------------------+
+                       gl he hr hu id it ja ko lv nb nl nn
+                       20  6  1  3  6 11 22  9  1  6 17  4
+     
+                       no pl pt pt_BR ru sk sl sv tr uk zh
+                     +-------------------------------------+
+     a2ps            | () () ()       []    [] [] ()       |  8
+     bash            |                                     |  4
+     bfd             |                         [] []       |  5
+     binutils        |                            []       |  4
+     bison           |                []       [] []       |  7
+     clisp           |                                     |  5
+     cpio            |    []     []   []       []          | 11
+     diffutils       |                []       [] []       | 11
+     enscript        |           []   []       []          |  6
+     error           |                   []       []       |  5
+     fetchmail       |    ()     ()                        |  3
+     fileutils       |                []    [] [] []       | 11
+     findutils       |    []     []   []    [] [] []       | 17
+     flex            |                []       []          |  6
+     gas             |                            []       |  2
+     gawk            |                         [] []       |  5
+     gcal            |                         []          |  3
+     gcc             |                            []       |  4
+     gettext         |                   [] [] [] []       | 10
+     gnupg           |    []                   [] []       | 12
+     gprof           |                         [] []       |  4
+     grep            |    []          []    [] [] []       | 13
+     hello           | [] []          [] []    [] [] []    | 24
+     id-utils        |                []       []          |  6
+     indent          |                [] []    [] []       | 11
+     jpilot          | ()                      ()          |  3
+     jwhois          |                ()       ()          |  2
+     kbd             |                         [] []       |  3
+     ld              |                         [] []       |  4
+     libc            | [] []     []      []    [] []       | 17
+     lilypond        |                         []          |  5
+     lynx            |           []   []       []          |  9
+     m4              |    []          []       []          | 12
+     make            |    []     []   []          []       | 12
+     mysecretdiary   |                         []          |  3
+     nano            | ()             []       []    []    | 12
+     nano_1_0        | ()             []       []    []    | 12
+     opcodes         |                         [] []       |  5
+     parted          |       []  []            []          | 10
+     ptx             | [] [] []       []       [] []       | 15
+     python          |                                     |  0
+     recode          |    []          []    [] []          | 13
+     sed             |           []   [] [] [] [] []       | 21
+     sh-utils        | [] []     []   [] [] [] [] []    [] | 22
+     sharutils       |                []       []          | 11
+     sketch          |                ()                   |  1
+     soundtracker    |                                     |  4
+     sp              |                                     |  0
+     tar             | [] []     []      [] [] [] []       | 16
+     texinfo         |                []       []          | 10
+     textutils       |                      []    []       |  8
+     util-linux      |           []            [] []       |  8
+     wdiff           |                [] []    [] []       |  9
+     wget            |                [] [] [] [] [] []    | 19
+                     +-------------------------------------+
+       35 teams        no pl pt pt_BR ru sk sl sv tr uk zh
+       54 domains       5 12  2  11   25 10 11 39 29  4  1  463
+
+   Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect.  This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+   For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer.  There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+   If January 2002 seems to be old, you may fetch a more recent copy of
+this `ABOUT-NLS' file on most GNU archive sites.  The most up-to-date
+matrix with full percentage details can be found at
+`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
+
+Using `gettext' in new packages
+===============================
+
+   If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package.  Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library.  This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+   Once the sources are changed appropriately and the setup can handle
+to use of `gettext' the only thing missing are the translations.  The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project.  Therefore the information given above
+applies also for every other Free Software Project.  Contact
+`translation@iro.umontreal.ca' to make the `.pot' files available to
+the translation teams.
+

Copied: vendor/gnu-sort/2.0.21/AUTHORS (from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/AUTHORS)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/gnu-sort/2.0.21/AUTHORS	Wed Apr 21 17:53:10 2010	(r207002, copy of r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/AUTHORS)
@@ -0,0 +1,10 @@
+Authors of parts of GNU textutils.
+
+The following contributions warranted legal paper exchanges with the
+Free Software Foundation.  Also see files ChangeLog and THANKS.
+
+GPTX    François Pinard         CANADA, 1949
+Assigns the program.
+
+GPTX    Odyssee Recherches Appliquees
+Disclaims work by François Pinard

Copied: vendor/gnu-sort/2.0.21/COPYING (from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/COPYING)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/gnu-sort/2.0.21/COPYING	Wed Apr 21 17:53:10 2010	(r207002, copy of r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/COPYING)
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    
+    Copyright (C)   
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  , 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

Copied: vendor/gnu-sort/2.0.21/ChangeLog (from r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/ChangeLog)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/gnu-sort/2.0.21/ChangeLog	Wed Apr 21 17:53:10 2010	(r207002, copy of r207001, vendor/gnu-sort/2.0.21/contrib/gnu-sort/ChangeLog)
@@ -0,0 +1,8574 @@
+2002-02-18  Jim Meyering  
+
+	* Version 2.0.21.
+
+	* tests/tail/Test.pm: For tests matching /^(obs|err-[134])/,
+	put _POSIX2_VERSION=199209 in the environment, so the tests succeed
+	even when the environment would have contained _POSIX2_VERSION=200112.
+	* tests/uniq/Test.pm (test_vector): Rename tests of obsolete usage
+	to have prefix of `obs'.  Adjust environment for those tests as above.
+
+	* tests/mk-script: When getting input via a pipe, apply the
+	environment settings to the command in question, not to `cat'.
+	No longer allow more than one element in the $Test::env or
+	$Test::env_default arrays.  No caller used that feature.
+
+2002-02-17  Jim Meyering  
+
+	* tests/head/Test.pm: Accept pre-POSIX 1003.1-2001 options.
+	* tests/pr/Test.pm: Likewise.
+	* tests/sort/Test.pm: Likewise.
+
+	* Makefile.cfg (wget_files): Reflect new location of these files.
+
+2002-02-16  Jim Meyering  
+
+	* ABOUT-NLS, intl/*: Update to Gettext 0.11.
+	* INSTALL: Update to Autoconf 2.52h.
+
+	* src/Makefile.am (datadir): Use `share' in place of @DATADIRNAME@,
+	per Gettext-0.11.
+	(LDADD): Use @LIBINTL@ instead of @INTLLIBS@, per Gettext-0.11.
+
+	* configure.ac (AC_CONFIG_AUX_DIR): New macro invocation.
+	(ALL_LINGUAS): Remove: now in po/LINGUAS as per Gettext 0.11.
+
+	* config: New subdirectory, containing the following files from .:
+	config.guess, config.sub, depcomp, missing, install-sh, mkinstalldirs.
+	Move the following files here from doc: texinfo.tex, mdate-sh.
+
+2002-02-15  Paul Eggert  
+
+	Add support for _POSIX2_VERSION, which lets you pick which POSIX
+	version you want the utilities to conform to.  Remove warnings about
+	failure to conform to a future POSIX version.
+
+	* NEWS, doc/coreutils.texi: Document _POSIX2_VERSION.
+	* doc/coreutils.texi (Standards Conformance): New section.
+
+	* src/expand.c: Include posixver.h.
+	(usage): Document only the intersection of the old and new behaviors,
+	to encourage portability.
+	* src/fold.c: Likewise.
+	* src/head.c: Likewise.
+	* src/od.c: Likewise.
+	* src/pr.c: Likewise.
+	* src/sort.c: Likewise.
+	* src/split.c: Likewise.
+	* src/uniq.c: Likewise.
+	* src/tail.c: Likewise.
+	* src/unexpand.c: Likewise.
+
+	* src/expand.c (shortopts): Remove; no longer needed.
+	* src/od.c (short_options): Likewise.
+	* src/pr.c (short_options): Likewise.
+	* src/sort.c (short_options): Likewise.
+	* src/split.c (shortopts): Likewise.
+	* src/uniq.c (shortopts): Likewise.
+	* src/unexpand.c (shortopts): Likewise.
+
+	* src/od.c (COMMON_SHORT_OPTIONS): New macro.
+	* src/pr.c (COMMON_SHORT_OPTIONS): Likewise.
+	* src/sort.c (COMMON_SHORT_OPTIONS): Likewise.
+
+	* src/expand.c (main): Revert to previous behavior, except report
+	an error and exit if the obsolete syntax is used and if conforming
+	to the new standard.
+	* src/fold.c (main): Likewise.
+	* src/head.c (main): Likewise.
+	* src/split.c (main): Likewise.
+	* src/uniq.c (main): Likewise.
+	* src/tail.c (main, parse_obsolescent_option): Likewise.
+	* src/unexpand.c (main): Likewise.
+
+	* src/od.c (STRINGS_OPTION, WIDTH_OPTION): Remove; no longer needed.
+	All uses changed back to the corresponding short options.
+	* src/pr.c (SEP_STRING_OPTION): Likewise.
+
+	* src/od.c (main): Parse options using POSIX 1003.1-2001 rules if
+	conforming to that standard.  Do not warn of obsolete options.
+	* src/pr.c (main): Likewise.
+	* src/sort.c (main): Likewise.
+
+	* src/system.h (_POSIX2_VERSION, POSIX2_VERSION): Remove definitions.
+	(OPTARG_POSIX, OBSOLETE_OPTION_WARNINGS): Likewise.
+
+2002-02-16  Jim Meyering  
+
+	* tests/misc/split-a: New test for change of 2002-02-05.
+	* tests/misc/Makefile.am (TESTS): Add split-a.
+
+2002-02-12  Jim Meyering  
+
+	* src/split.c (DEFAULT_SUFFIX_LENGTH): Define constant.
+	(suffix_length): Use it here.
+	(usage): Use it here.
+
+2002-02-05  Paul Eggert  
+
+	Change 'split' to conform to POSIX.  It now accepts an -a or
+	--suffix-length option, and refuses to generate more files
+	than there are suffixes.
+
+	* NEWS, doc/coreutils.texi: Document this.
+	* src/split.c: Include "dirname.h".
+	(outbase): Now a global var.
+	(outfile_end): Remove.
+	(suffix_length): New var.
+	(shortopts, longopts, main): Add -a or --suffix-length.
+	(next_file_name): Implement -a.  Do not extend the suffix length.
+	Check for file names that are too long.
+	(main): Move outfile initialization to next_file_name.
+
+	* src/split.c (shortopts): Remove -v (a typo).
+
+2002-02-11  Jim Meyering  
+
+	* tests/misc/head-pos: New file/test for the change of 2002-02-08.
+	* tests/misc/Makefile.am (TESTS): Add head-pos.
+
+	* src/tr.c (unquote): Make comment a little clearer.
+
+2002-02-08  Paul Eggert  
+
+	* src/head.c (head_lines): If we have read too much data, try
+	to seek back to the position we would have gotten to had we
+	been reading one byte at a time.  POSIX currently doesn't
+	require this, but it's easy to do and some software relies on it.
+
+2002-02-02  Jim Meyering  
+
+	* src/uniq.c (main): Prepend `warning: ' to the diagnostic, so it's
+	consistent with all of the other `... is obsolete...' diagnostics.
+
+2002-01-31  Paul Eggert  
+
+	Add more support for POSIX 1003.1-2001, which requires removal for
+	support of obsolete "-N" option syntax in expand, head, fold,
+	split, tail, unexpand, uniq, and which prohibits options with
+	optional arguments in od and pr.
+
+	* NEWS: Document this.
+	* doc/coreutils.texi: Likewise.
+	* src/expand.c (usage): Likewise.
+	* src/fold.c (usage): Likewise.
+	* src/head.c (usage): Likewise.
+	* src/od.c (usage): Likewise.
+	* src/pr.c (usage): Likewise.
+	* src/split.c (usage): Likewise.
+	* src/unexpand.c (usage): Likewise.
+	* src/uniq.c (usage): Likewise.
+
+	* NEWS: Improve doc for previous fix in this area.
+
+	* src/expand.c (shortopts): New constant.
+	* src/od.c (short_options): Likewise.
+	* src/pr.c (short_options): Likewise.
+	* src/sort.c (short_options): Likewise.
+	* src/split.c (shortopts): Likewise.
+	* src/unexpand.c (shortopts): Likewise.
+	* src/uniq.c (shortopts): Likewise.
+
+	* src/expand.c (main): Check for obsolete options.
+	* src/fold.c (main): Likewise.
+	* src/head.c (main): Likewise.
+	* src/od.c (main): Likewise.
+	* src/pr.c (main): Likewise.
+	* src/sort.c (main): Likewise.
+	* src/split.c (main): Likewise.
+	* src/tail.c (parse_obsolescent_option, main): Likewise.
+	* src/unexpand.c (main): Likewise.
+	* src/uniq.c (main): Likewise.
+
+	* src/head.c (header_mode_option): New constant.
+
+	* src/od.c: New enum for long options.
+
+	* src/pr.c (SEP_STRING_OPTION): New enum value.
+	(long_options): Use it.
+
+	* src/split.c (main): Use -1, not EOF, for getopt_long.
+
+	* src/system.h (OPTARG_POSIX, OBSOLETE_OPTION_WARNINGS): New macros.
+
+	* src/fold.c (main): Fix bug: -- -N was treated as -N --.
+
+2002-02-01  Jim Meyering  
+
+	* src/tail.c (start_lines): Handle the case in which bytes_read is zero.
+
+2002-01-28  Jim Meyering  
+
+	* Makefile.maint (ac-check): Remove, now that we no longer have
+	to duplicate that information.
+	(local-check): Remove ac-check.
+
+	* Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.5d.
+
+	* configure.ac (AM_INIT_AUTOMAKE): Use zero-arg form of this macro.
+	(ALL_LINGUAS): Add the bokmål dialect of Norwegian (nb).
+
+2002-01-27  Jim Meyering  
+
+	tail -n +2 would perform an extra read after encountering EOF
+	* src/tail.c (start_lines): Detect EOF, inform caller.
+	(tail_lines): Upon EOF in start_lines, return immediately.
+
+2002-01-22  Jim Meyering  
+
+	* Version 2.0.20.
+
+2002-01-22  Paul Eggert  
+
+	* src/od.c (skip): Remove redundant check for overflow.
+	fseeko's seek argument is already known to be in range,
+	since it is less than the file size.
+
+2002-01-22  Jim Meyering  
+
+	* po/POTFILES.in: Add lib/xmemcoll.c.
+
+2002-01-22  Paul Eggert  
+
+	* src/tac.c (save_stdin): Report proper errno value after
+	fwrite failures.  Do not bother to rewind the temp file, as
+	it'll be read backwards anyway.
+
+2002-01-22  Paul Eggert  
+
+	* src/ptx.c (swallow_file_in_memory): Work even if `open' returns 0.
+	Check for `close' error.
+
+2002-01-22  Paul Eggert  
+
+	Port to glibc 2.2.5, whose mmap stdio positions the underlying
+	file descriptor at a nonzero offset after an fopen.

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 17:54: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 05EBC1065672;
	Wed, 21 Apr 2010 17:54:32 +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 D02B88FC15;
	Wed, 21 Apr 2010 17:54: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 o3LHsVoO025158;
	Wed, 21 Apr 2010 17:54:31 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LHsVgQ025157;
	Wed, 21 Apr 2010 17:54:31 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004211754.o3LHsVgQ025157@svn.freebsd.org>
From: Xin LI 
Date: Wed, 21 Apr 2010 17:54: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: r207003 - head/contrib/gnu-sort
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, 21 Apr 2010 17:54:32 -0000

Author: delphij
Date: Wed Apr 21 17:54:31 2010
New Revision: 207003
URL: http://svn.freebsd.org/changeset/base/207003

Log:
  Bootstrap merge history.

Modified:
Directory Properties:
  head/contrib/gnu-sort/   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 18: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 6F7D7106564A;
	Wed, 21 Apr 2010 18:55:45 +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 53E648FC14;
	Wed, 21 Apr 2010 18: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 o3LItjh1038859;
	Wed, 21 Apr 2010 18:55:45 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LItiw2038856;
	Wed, 21 Apr 2010 18:55:44 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004211855.o3LItiw2038856@svn.freebsd.org>
From: Bruce Cran 
Date: Wed, 21 Apr 2010 18:55: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: r207005 - 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: Wed, 21 Apr 2010 18:55:45 -0000

Author: brucec
Date: Wed Apr 21 18:55:44 2010
New Revision: 207005
URL: http://svn.freebsd.org/changeset/base/207005

Log:
  Make the "Q = Finish" text visible when running sysinstall as a normal
  application.  Reword the boot manager screen to try and avoid confusion.
  
  Reviewed by:	randi
  Approved by:	rrs (mentor)
  MFC after:	1 week

Modified:
  head/usr.sbin/sysinstall/disks.c
  head/usr.sbin/sysinstall/menus.c

Modified: head/usr.sbin/sysinstall/disks.c
==============================================================================
--- head/usr.sbin/sysinstall/disks.c	Wed Apr 21 18:43:15 2010	(r207004)
+++ head/usr.sbin/sysinstall/disks.c	Wed Apr 21 18:55:44 2010	(r207005)
@@ -207,9 +207,12 @@ print_command_summary(void)
     mvprintw(14, 0, "The following commands are supported (in upper or lower case):");
     mvprintw(16, 0, "A = Use Entire Disk   G = set Drive Geometry   C = Create Slice");
     mvprintw(17, 0, "D = Delete Slice      Z = Toggle Size Units    S = Set Bootable   | = Expert m.");
-    mvprintw(18, 0, "T = Change Type       U = Undo All Changes     Q = Finish");
+    mvprintw(18, 0, "T = Change Type       U = Undo All Changes");
+
     if (!RunningAsInit)
-	mvprintw(18, 47, "W = Write Changes");
+	mvprintw(18, 47, "W = Write Changes  Q = Finish");
+    else
+	mvprintw(18, 47, "Q = Finish");
     mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to select.");
     move(0, 0);
 }

Modified: head/usr.sbin/sysinstall/menus.c
==============================================================================
--- head/usr.sbin/sysinstall/menus.c	Wed Apr 21 18:43:15 2010	(r207004)
+++ head/usr.sbin/sysinstall/menus.c	Wed Apr 21 18:55:44 2010	(r207005)
@@ -1175,20 +1175,16 @@ DMenu MenuMBRType = {
     "at boot time.  If you have more than one drive and want to boot\n"
     "from the second one, the boot manager will also make it possible\n"
     "to do so (limitations in the PC BIOS usually prevent this otherwise).\n"
-    "If you will only have FreeBSD on the machine the boot manager is\n"
-    "not needed and it slows down the boot while offering you the choice\n"
-    "of which operating system to boot.  If you do not want a boot\n"
-    "manager, or wish to replace an existing one, select \"standard\".\n"
-    "If you would prefer your Master Boot Record remain untouched then\n"
-    "select \"None\".\n\n"
-    "  NOTE:  PC-DOS users will almost certainly require \"None\"!",
-    "Press F1 to read about drive setup",
+    "If you have other operating systems installed and would like a choice when\n"
+    "booting, choose \"BootMgr\". If you would prefer to keep your existing\n"
+    "boot manager, select \"None\".\n\n",
+    "",    
     "drives",
-    { { "Standard",	"Install a standard MBR (no boot manager)",
+    { { "Standard",	"Install a standard MBR (non-interactive boot manager)",
 	dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 },
       { "BootMgr",	"Install the FreeBSD Boot Manager",
 	dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 0 },
-      { "None",		"Leave the Master Boot Record untouched",
+      { "None",		"Do not install a boot manager",
 	dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 2 },
       { NULL } },
 };

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 19:03: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 26EBD1065673;
	Wed, 21 Apr 2010 19:03:35 +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 15E918FC12;
	Wed, 21 Apr 2010 19:03: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 o3LJ3YYc040632;
	Wed, 21 Apr 2010 19:03:34 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJ3YpY040629;
	Wed, 21 Apr 2010 19:03:34 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004211903.o3LJ3YpY040629@svn.freebsd.org>
From: Bruce Cran 
Date: Wed, 21 Apr 2010 19:03: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: r207006 - head/usr.sbin/sade
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, 21 Apr 2010 19:03:35 -0000

Author: brucec
Date: Wed Apr 21 19:03:34 2010
New Revision: 207006
URL: http://svn.freebsd.org/changeset/base/207006

Log:
  Remove the reference to DD mode, and replace with Expert mode. Also, make
  sure the "Q = Finish" text is visible.
  Reword the boot manager screen to try and avoid confusion, and make the
  order of the menu items match that in sysinstall.
  
  PR:		bin/142916
  Submitted by:	Jeremy Chadwick 
  Reviewed by:	randi
  Approved by:	rrs (mentor)
  MFC after:	1 week

Modified:
  head/usr.sbin/sade/disks.c
  head/usr.sbin/sade/menus.c

Modified: head/usr.sbin/sade/disks.c
==============================================================================
--- head/usr.sbin/sade/disks.c	Wed Apr 21 18:55:44 2010	(r207005)
+++ head/usr.sbin/sade/disks.c	Wed Apr 21 19:03:34 2010	(r207006)
@@ -202,10 +202,9 @@ static void
 print_command_summary(void)
 {
     mvprintw(14, 0, "The following commands are supported (in upper or lower case):");
-    mvprintw(16, 0, "A = Use Entire Disk   G = set Drive Geometry   C = Create Slice   F = `DD' mode");
-    mvprintw(17, 0, "D = Delete Slice      Z = Toggle Size Units    S = Set Bootable   | = Wizard m.");
-    mvprintw(18, 0, "T = Change Type       U = Undo All Changes     Q = Finish");
-    mvprintw(18, 47, "W = Write Changes");
+    mvprintw(16, 0, "A = Use Entire Disk   G = set Drive Geometry   C = Create Slice");
+    mvprintw(17, 0, "D = Delete Slice      Z = Toggle Size Units    S = Set Bootable   | = Expert m.");
+    mvprintw(18, 0, "T = Change Type       U = Undo All Changes     W = Write Changes  Q = Finish");
     mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to select.");
     move(0, 0);
 }

Modified: head/usr.sbin/sade/menus.c
==============================================================================
--- head/usr.sbin/sade/menus.c	Wed Apr 21 18:55:44 2010	(r207005)
+++ head/usr.sbin/sade/menus.c	Wed Apr 21 19:03:34 2010	(r207006)
@@ -92,24 +92,23 @@ DMenu MenuIPLType = {
 DMenu MenuMBRType = {
     DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
     "overwrite me",		/* will be disk specific label */
-    "FreeBSD comes with a boot selector that allows you to easily\n"
+    "FreeBSD comes with a boot manager that allows you to easily\n"
     "select between FreeBSD and any other operating systems on your machine\n"
     "at boot time.  If you have more than one drive and want to boot\n"
-    "from the second one, the boot selector will also make it possible\n"
+    "from the second one, the boot manager will also make it possible\n"
     "to do so (limitations in the PC BIOS usually prevent this otherwise).\n"
-    "If you do not want a boot selector, or wish to replace an existing\n"
-    "one, select \"standard\".  If you would prefer your Master Boot\n"
-    "Record to remain untouched then select \"None\".\n\n"
-    "  NOTE:  PC-DOS users will almost certainly require \"None\"!",
-    "Press F1 to read about drive setup",
+    "If you have other operating systems installed and would like a choice when\n"
+    "booting, choose \"BootMgr\". If you would prefer to keep your existing\n"
+    "boot manager, select \"None\".\n\n",
+    "",
     "drives",
-    { { "BootMgr",	"Install the FreeBSD Boot Manager",
-	dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, 0, 0, 0, 0 },
-      { "Standard",	"Install a standard MBR (no boot manager)",
+    { { "Standard",	"Install a standard MBR (non-interactive boot manager)",
 	dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 },
-      { "None",		"Leave the Master Boot Record untouched",
+      { "BootMgr",	"Install the FreeBSD boot manager",
+	dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 0 },
+      { "None",		"Do not install a boot manager",
 	dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 2 },
-      { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0 } },
+      { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0 } }
 };
 #endif /* PC98 */
 #endif /* __i386__ */

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 19:06: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 43195106566C;
	Wed, 21 Apr 2010 19:06:58 +0000 (UTC)
	(envelope-from bruce@cran.org.uk)
Received: from muon.cran.org.uk (unknown [IPv6:2001:470:1f09:679::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 07AB78FC08;
	Wed, 21 Apr 2010 19:06:58 +0000 (UTC)
Received: from muon.cran.org.uk (localhost [127.0.0.1])
	by muon.cran.org.uk (Postfix) with ESMTP id 50841C400C;
	Wed, 21 Apr 2010 19:06:57 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on muon.cran.org.uk
X-Spam-Level: 
X-Spam-Status: No, score=-2.7 required=8.0 tests=AWL,BAYES_00,RDNS_DYNAMIC
	autolearn=no version=3.2.5
Received: from core.draftnet (87-194-158-129.bethere.co.uk [87.194.158.129])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by muon.cran.org.uk (Postfix) with ESMTPSA;
	Wed, 21 Apr 2010 19:06:57 +0000 (UTC)
From: Bruce Cran 
To: Bruce Cran 
Date: Wed, 21 Apr 2010 20:06:12 +0100
User-Agent: KMail/1.13.2 (FreeBSD/9.0-CURRENT; KDE/4.4.2; amd64; ; )
References: <201004211903.o3LJ3YpY040629@svn.freebsd.org>
In-Reply-To: <201004211903.o3LJ3YpY040629@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201004212006.13188.bruce@cran.org.uk>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r207006 - head/usr.sbin/sade
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, 21 Apr 2010 19:06:58 -0000

On Wednesday 21 April 2010 20:03:34 Bruce Cran wrote:
> Author: brucec
> Date: Wed Apr 21 19:03:34 2010
> New Revision: 207006
> URL: http://svn.freebsd.org/changeset/base/207006
> 
> Log:
>   Remove the reference to DD mode, and replace with Expert mode. Also, make
>   sure the "Q = Finish" text is visible.
>   Reword the boot manager screen to try and avoid confusion, and make the
>   order of the menu items match that in sysinstall.

The checkin actually replaced Wizard mode with Expert mode, and removed 'DD' 
mode.

-- 
Bruce Cran

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 19:28: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 3CF70106566B;
	Wed, 21 Apr 2010 19:28:02 +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 2B89C8FC24;
	Wed, 21 Apr 2010 19:28: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 o3LJS2KX046008;
	Wed, 21 Apr 2010 19:28:02 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJS2Tl046005;
	Wed, 21 Apr 2010 19:28:02 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004211928.o3LJS2Tl046005@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 21 Apr 2010 19:28: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: r207007 - head/sys/compat/freebsd32
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, 21 Apr 2010 19:28:02 -0000

Author: kib
Date: Wed Apr 21 19:28:01 2010
New Revision: 207007
URL: http://svn.freebsd.org/changeset/base/207007

Log:
  Extract the code to copy-out struct rusage32 from struct rusage
  into the new function.
  
  Reviewed by:	jhb
  MFC after:	1 week

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/freebsd32_util.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr 21 19:03:34 2010	(r207006)
+++ head/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr 21 19:28:01 2010	(r207007)
@@ -129,6 +129,28 @@ static int freebsd32_kevent_copyin(void 
 #define RETVAL_LO 0	
 #endif
 
+void
+freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32)
+{
+
+	TV_CP(*s, *s32, ru_utime);
+	TV_CP(*s, *s32, ru_stime);
+	CP(*s, *s32, ru_maxrss);
+	CP(*s, *s32, ru_ixrss);
+	CP(*s, *s32, ru_idrss);
+	CP(*s, *s32, ru_isrss);
+	CP(*s, *s32, ru_minflt);
+	CP(*s, *s32, ru_majflt);
+	CP(*s, *s32, ru_nswap);
+	CP(*s, *s32, ru_inblock);
+	CP(*s, *s32, ru_oublock);
+	CP(*s, *s32, ru_msgsnd);
+	CP(*s, *s32, ru_msgrcv);
+	CP(*s, *s32, ru_nsignals);
+	CP(*s, *s32, ru_nvcsw);
+	CP(*s, *s32, ru_nivcsw);
+}
+
 int
 freebsd32_wait4(struct thread *td, struct freebsd32_wait4_args *uap)
 {
@@ -146,22 +168,7 @@ freebsd32_wait4(struct thread *td, struc
 	if (uap->status != NULL)
 		error = copyout(&status, uap->status, sizeof(status));
 	if (uap->rusage != NULL && error == 0) {
-		TV_CP(ru, ru32, ru_utime);
-		TV_CP(ru, ru32, ru_stime);
-		CP(ru, ru32, ru_maxrss);
-		CP(ru, ru32, ru_ixrss);
-		CP(ru, ru32, ru_idrss);
-		CP(ru, ru32, ru_isrss);
-		CP(ru, ru32, ru_minflt);
-		CP(ru, ru32, ru_majflt);
-		CP(ru, ru32, ru_nswap);
-		CP(ru, ru32, ru_inblock);
-		CP(ru, ru32, ru_oublock);
-		CP(ru, ru32, ru_msgsnd);
-		CP(ru, ru32, ru_msgrcv);
-		CP(ru, ru32, ru_nsignals);
-		CP(ru, ru32, ru_nvcsw);
-		CP(ru, ru32, ru_nivcsw);
+		freebsd32_rusage_out(&ru, &ru32);
 		error = copyout(&ru32, uap->rusage, sizeof(ru32));
 	}
 	return (error);
@@ -755,22 +762,7 @@ freebsd32_getrusage(struct thread *td, s
 	if (error)
 		return (error);
 	if (uap->rusage != NULL) {
-		TV_CP(s, s32, ru_utime);
-		TV_CP(s, s32, ru_stime);
-		CP(s, s32, ru_maxrss);
-		CP(s, s32, ru_ixrss);
-		CP(s, s32, ru_idrss);
-		CP(s, s32, ru_isrss);
-		CP(s, s32, ru_minflt);
-		CP(s, s32, ru_majflt);
-		CP(s, s32, ru_nswap);
-		CP(s, s32, ru_inblock);
-		CP(s, s32, ru_oublock);
-		CP(s, s32, ru_msgsnd);
-		CP(s, s32, ru_msgrcv);
-		CP(s, s32, ru_nsignals);
-		CP(s, s32, ru_nvcsw);
-		CP(s, s32, ru_nivcsw);
+		freebsd32_rusage_out(&s, &s32);
 		error = copyout(&s32, uap->rusage, sizeof(s32));
 	}
 	return (error);

Modified: head/sys/compat/freebsd32/freebsd32_util.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_util.h	Wed Apr 21 19:03:34 2010	(r207006)
+++ head/sys/compat/freebsd32/freebsd32_util.h	Wed Apr 21 19:28:01 2010	(r207007)
@@ -94,9 +94,12 @@ int    syscall32_module_handler(struct m
 int    syscall32_helper_register(struct syscall_helper_data *sd);
 int    syscall32_helper_unregister(struct syscall_helper_data *sd);
 
-register_t *freebsd32_copyout_strings(struct image_params *imgp);
 struct iovec32;
+struct rusage32;
+register_t *freebsd32_copyout_strings(struct image_params *imgp);
 int	freebsd32_copyiniov(struct iovec32 *iovp, u_int iovcnt,
 	    struct iovec **iov, int error);
+void	freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32);
+
 
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 19:32: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 E1D65106566C;
	Wed, 21 Apr 2010 19:32:00 +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 CFD738FC1B;
	Wed, 21 Apr 2010 19:32: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 o3LJW0KZ046910;
	Wed, 21 Apr 2010 19:32:00 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJW0Mc046907;
	Wed, 21 Apr 2010 19:32:00 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004211932.o3LJW0Mc046907@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 21 Apr 2010 19:32: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: r207008 - in head/sys: compat/freebsd32 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, 21 Apr 2010 19:32:01 -0000

Author: kib
Date: Wed Apr 21 19:32:00 2010
New Revision: 207008
URL: http://svn.freebsd.org/changeset/base/207008

Log:
  Provide compat32 shims for kinfo_proc sysctl. This allows 32bit ps(1) to
  mostly work on 64bit host.
  
  The work is based on an original patch submitted by emaste, obtained
  from Sandvine's source tree.
  
  Reviewed by:	jhb
  MFC after:	1 week

Modified:
  head/sys/compat/freebsd32/freebsd32.h
  head/sys/kern/kern_proc.c

Modified: head/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32.h	Wed Apr 21 19:28:01 2010	(r207007)
+++ head/sys/compat/freebsd32/freebsd32.h	Wed Apr 21 19:32:00 2010	(r207008)
@@ -31,6 +31,7 @@
 
 #include 
 #include 
+#include 
 
 #define PTRIN(v)	(void *)(uintptr_t) (v)
 #define PTROUT(v)	(u_int32_t)(uintptr_t) (v)
@@ -229,4 +230,85 @@ struct mq_attr32 {
 	int	__reserved[4];
 };
 
+struct kinfo_proc32 {
+	int	ki_structsize;
+	int	ki_layout;
+	uint32_t ki_args;
+	uint32_t ki_paddr;
+	uint32_t ki_addr;
+	uint32_t ki_tracep;
+	uint32_t ki_textvp;
+	uint32_t ki_fd;
+	uint32_t ki_vmspace;
+	uint32_t ki_wchan;
+	pid_t	ki_pid;
+	pid_t	ki_ppid;
+	pid_t	ki_pgid;
+	pid_t	ki_tpgid;
+	pid_t	ki_sid;
+	pid_t	ki_tsid;
+	short	ki_jobc;
+	short	ki_spare_short1;
+	dev_t	ki_tdev;
+	sigset_t ki_siglist;
+	sigset_t ki_sigmask;
+	sigset_t ki_sigignore;
+	sigset_t ki_sigcatch;
+	uid_t	ki_uid;
+	uid_t	ki_ruid;
+	uid_t	ki_svuid;
+	gid_t	ki_rgid;
+	gid_t	ki_svgid;
+	short	ki_ngroups;
+	short	ki_spare_short2;
+	gid_t 	ki_groups[KI_NGROUPS];
+	uint32_t ki_size;
+	int32_t ki_rssize;
+	int32_t ki_swrss;
+	int32_t ki_tsize;
+	int32_t ki_dsize;
+	int32_t ki_ssize;
+	u_short	ki_xstat;
+	u_short	ki_acflag;
+	fixpt_t	ki_pctcpu;
+	u_int	ki_estcpu;
+	u_int	ki_slptime;
+	u_int	ki_swtime;
+	int	ki_spareint1;
+	u_int64_t ki_runtime;
+	struct	timeval32 ki_start;
+	struct	timeval32 ki_childtime;
+	int	ki_flag;
+	int	ki_kiflag;
+	int	ki_traceflag;
+	char	ki_stat;
+	signed char ki_nice;
+	char	ki_lock;
+	char	ki_rqindex;
+	u_char	ki_oncpu;
+	u_char	ki_lastcpu;
+	char	ki_ocomm[OCOMMLEN+1];
+	char	ki_wmesg[WMESGLEN+1];
+	char	ki_login[LOGNAMELEN+1];
+	char	ki_lockname[LOCKNAMELEN+1];
+	char	ki_comm[COMMLEN+1];
+	char	ki_emul[KI_EMULNAMELEN+1];
+	char	ki_sparestrings[68];
+	int	ki_spareints[KI_NSPARE_INT];
+	u_int	ki_cr_flags;
+	int	ki_jid;
+	int	ki_numthreads;
+	lwpid_t	ki_tid;
+	struct	priority ki_pri;
+	struct	rusage32 ki_rusage;
+	struct	rusage32 ki_rusage_ch;
+	uint32_t ki_pcb;
+	uint32_t ki_kstack;
+	uint32_t ki_udata;
+	uint32_t ki_spareptrs[KI_NSPARE_PTR];	/* spare room for growth */
+	int	ki_sparelongs[KI_NSPARE_LONG];
+	int	ki_sflag;
+	int	ki_tdflags;
+};
+
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Wed Apr 21 19:28:01 2010	(r207007)
+++ head/sys/kern/kern_proc.c	Wed Apr 21 19:32:00 2010	(r207008)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -79,6 +80,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+#endif
+
 SDT_PROVIDER_DEFINE(proc);
 SDT_PROBE_DEFINE(proc, kernel, ctor, entry);
 SDT_PROBE_ARGTYPE(proc, kernel, ctor, entry, 0, "struct proc *");
@@ -969,6 +975,128 @@ zpfind(pid_t pid)
 #define KERN_PROC_ZOMBMASK	0x3
 #define KERN_PROC_NOTHREADS	0x4
 
+#ifdef COMPAT_FREEBSD32
+
+/*
+ * This function is typically used to copy out the kernel address, so
+ * it can be replaced by assignment of zero.
+ */
+static inline uint32_t
+ptr32_trim(void *ptr)
+{
+	uintptr_t uptr;
+
+	uptr = (uintptr_t)ptr;
+	return ((uptr > UINT_MAX) ? 0 : uptr);
+}
+
+#define PTRTRIM_CP(src,dst,fld) \
+	do { (dst).fld = ptr32_trim((src).fld); } while (0)
+
+static void
+freebsd32_kinfo_proc_out(const struct kinfo_proc *ki, struct kinfo_proc32 *ki32)
+{
+	int i;
+
+	bzero(ki32, sizeof(struct kinfo_proc32));
+	ki32->ki_structsize = sizeof(struct kinfo_proc32);
+	CP(*ki, *ki32, ki_layout);
+	PTRTRIM_CP(*ki, *ki32, ki_args);
+	PTRTRIM_CP(*ki, *ki32, ki_paddr);
+	PTRTRIM_CP(*ki, *ki32, ki_addr);
+	PTRTRIM_CP(*ki, *ki32, ki_tracep);
+	PTRTRIM_CP(*ki, *ki32, ki_textvp);
+	PTRTRIM_CP(*ki, *ki32, ki_fd);
+	PTRTRIM_CP(*ki, *ki32, ki_vmspace);
+	PTRTRIM_CP(*ki, *ki32, ki_wchan);
+	CP(*ki, *ki32, ki_pid);
+	CP(*ki, *ki32, ki_ppid);
+	CP(*ki, *ki32, ki_pgid);
+	CP(*ki, *ki32, ki_tpgid);
+	CP(*ki, *ki32, ki_sid);
+	CP(*ki, *ki32, ki_tsid);
+	CP(*ki, *ki32, ki_jobc);
+	CP(*ki, *ki32, ki_tdev);
+	CP(*ki, *ki32, ki_siglist);
+	CP(*ki, *ki32, ki_sigmask);
+	CP(*ki, *ki32, ki_sigignore);
+	CP(*ki, *ki32, ki_sigcatch);
+	CP(*ki, *ki32, ki_uid);
+	CP(*ki, *ki32, ki_ruid);
+	CP(*ki, *ki32, ki_svuid);
+	CP(*ki, *ki32, ki_rgid);
+	CP(*ki, *ki32, ki_svgid);
+	CP(*ki, *ki32, ki_ngroups);
+	for (i = 0; i < KI_NGROUPS; i++)
+		CP(*ki, *ki32, ki_groups[i]);
+	CP(*ki, *ki32, ki_size);
+	CP(*ki, *ki32, ki_rssize);
+	CP(*ki, *ki32, ki_swrss);
+	CP(*ki, *ki32, ki_tsize);
+	CP(*ki, *ki32, ki_dsize);
+	CP(*ki, *ki32, ki_ssize);
+	CP(*ki, *ki32, ki_xstat);
+	CP(*ki, *ki32, ki_acflag);
+	CP(*ki, *ki32, ki_pctcpu);
+	CP(*ki, *ki32, ki_estcpu);
+	CP(*ki, *ki32, ki_slptime);
+	CP(*ki, *ki32, ki_swtime);
+	CP(*ki, *ki32, ki_runtime);
+	TV_CP(*ki, *ki32, ki_start);
+	TV_CP(*ki, *ki32, ki_childtime);
+	CP(*ki, *ki32, ki_flag);
+	CP(*ki, *ki32, ki_kiflag);
+	CP(*ki, *ki32, ki_traceflag);
+	CP(*ki, *ki32, ki_stat);
+	CP(*ki, *ki32, ki_nice);
+	CP(*ki, *ki32, ki_lock);
+	CP(*ki, *ki32, ki_rqindex);
+	CP(*ki, *ki32, ki_oncpu);
+	CP(*ki, *ki32, ki_lastcpu);
+	bcopy(ki->ki_ocomm, ki32->ki_ocomm, OCOMMLEN + 1);
+	bcopy(ki->ki_wmesg, ki32->ki_wmesg, WMESGLEN + 1);
+	bcopy(ki->ki_login, ki32->ki_login, LOGNAMELEN + 1);
+	bcopy(ki->ki_lockname, ki32->ki_lockname, LOCKNAMELEN + 1);
+	bcopy(ki->ki_comm, ki32->ki_comm, COMMLEN + 1);
+	bcopy(ki->ki_emul, ki32->ki_emul, KI_EMULNAMELEN + 1);
+	CP(*ki, *ki32, ki_cr_flags);
+	CP(*ki, *ki32, ki_jid);
+	CP(*ki, *ki32, ki_numthreads);
+	CP(*ki, *ki32, ki_tid);
+	CP(*ki, *ki32, ki_pri);
+	freebsd32_rusage_out(&ki->ki_rusage, &ki32->ki_rusage);
+	freebsd32_rusage_out(&ki->ki_rusage_ch, &ki32->ki_rusage_ch);
+	PTRTRIM_CP(*ki, *ki32, ki_pcb);
+	PTRTRIM_CP(*ki, *ki32, ki_kstack);
+	PTRTRIM_CP(*ki, *ki32, ki_udata);
+	CP(*ki, *ki32, ki_sflag);
+	CP(*ki, *ki32, ki_tdflags);
+}
+
+static int
+sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req)
+{
+	struct kinfo_proc32 ki32;
+	int error;
+
+	if (req->flags & SCTL_MASK32) {
+		freebsd32_kinfo_proc_out(ki, &ki32);
+		error = SYSCTL_OUT(req, (caddr_t)&ki32,
+		    sizeof(struct kinfo_proc32));
+	} else
+		error = SYSCTL_OUT(req, (caddr_t)ki,
+		    sizeof(struct kinfo_proc));
+	return (error);
+}
+#else
+static int
+sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req)
+{
+
+	return (SYSCTL_OUT(req, (caddr_t)&ki, sizeof(struct kinfo_proc)));
+}
+#endif
+
 /*
  * Must be called with the process locked and will return with it unlocked.
  */
@@ -986,13 +1114,11 @@ sysctl_out_proc(struct proc *p, struct s
 
 	fill_kinfo_proc(p, &kinfo_proc);
 	if (flags & KERN_PROC_NOTHREADS)
-		error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc,
-		    sizeof(kinfo_proc));
+		error = sysctl_out_proc_copyout(&kinfo_proc, req);
 	else {
 		FOREACH_THREAD_IN_PROC(p, td) {
 			fill_kinfo_thread(td, &kinfo_proc, 1);
-			error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc,
-			    sizeof(kinfo_proc));
+			error = sysctl_out_proc_copyout(&kinfo_proc, req);
 			if (error)
 				break;
 		}

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 19:35: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 82E3F106566B;
	Wed, 21 Apr 2010 19:35:56 +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 725178FC0C;
	Wed, 21 Apr 2010 19:35: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 o3LJZuc6047808;
	Wed, 21 Apr 2010 19:35:56 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJZuBh047806;
	Wed, 21 Apr 2010 19:35:56 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004211935.o3LJZuBh047806@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 21 Apr 2010 19:35: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: r207009 - 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, 21 Apr 2010 19:35:56 -0000

Author: kib
Date: Wed Apr 21 19:35:56 2010
New Revision: 207009
URL: http://svn.freebsd.org/changeset/base/207009

Log:
  C language does not has references, it provides pointers.
  
  Suggested by:	bde
  MFC after:	2 weeks

Modified:
  head/lib/libc/stdlib/realpath.3

Modified: head/lib/libc/stdlib/realpath.3
==============================================================================
--- head/lib/libc/stdlib/realpath.3	Wed Apr 21 19:32:00 2010	(r207008)
+++ head/lib/libc/stdlib/realpath.3	Wed Apr 21 19:35:56 2010	(r207009)
@@ -56,13 +56,13 @@ and
 in
 .Fa pathname ,
 and copies the resulting absolute pathname into
-the memory referenced by
+the memory pointed to by
 .Fa resolved_path .
 The
 .Fa resolved_path
 argument
 .Em must
-refer to a buffer capable of storing at least
+point to a buffer capable of storing at least
 .Dv PATH_MAX
 characters, or be
 .Dv NULL .

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 19:45: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 33086106566C;
	Wed, 21 Apr 2010 19:45:42 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 206B38FC1C;
	Wed, 21 Apr 2010 19:45: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 o3LJjgp3049988;
	Wed, 21 Apr 2010 19:45:42 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJjfOf049983;
	Wed, 21 Apr 2010 19:45:41 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211945.o3LJjfOf049983@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 19:45:41 +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: r207010 - in stable/8/sys: kern net 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, 21 Apr 2010 19:45:42 -0000

Author: bz
Date: Wed Apr 21 19:45:41 2010
New Revision: 207010
URL: http://svn.freebsd.org/changeset/base/207010

Log:
  MFC r205345:
  
    Split eventhandler_register() into an internal part and a wrapper function
    that provides the allocated and setup eventhandler entry.
  
    Add a new wrapper for VIMAGE that allocates extra space to hold the
    callback function and argument in addition to an extra wrapper function.
    While the wrapper function goes as normal callback function the
    argument points to the extra space allocated holding the original func
    and arg that the wrapper function can then call.
  
    Provide an iterator function for the virtual network stack (vnet) that
    will call the callback function for each network stack.
  
    Provide a new set of macros for VNET that in the non-VIMAGE case will
    just call eventhandler_register() while in the VIMAGE case it will use
    vimage_eventhandler_register() passing in the extra iterator function
    but will only register once rather than per-vnet.
    We need a special macro in case we are interested in the tag returned
    as we must check for curvnet and can neither simply assign the
    return value, nor not change it in the non-vnet0 case without that.
  
    Discussed with:       jhb
    Reviewed by:  zec (earlier version), jhb

Modified:
  stable/8/sys/kern/subr_eventhandler.c
  stable/8/sys/net/vnet.c
  stable/8/sys/net/vnet.h
  stable/8/sys/sys/eventhandler.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/geom/sched/   (props changed)

Modified: stable/8/sys/kern/subr_eventhandler.c
==============================================================================
--- stable/8/sys/kern/subr_eventhandler.c	Wed Apr 21 19:35:56 2010	(r207009)
+++ stable/8/sys/kern/subr_eventhandler.c	Wed Apr 21 19:45:41 2010	(r207010)
@@ -68,15 +68,15 @@ SYSINIT(eventhandlers, SI_SUB_EVENTHANDL
  * Insertion is O(n) due to the priority scan, but optimises to O(1)
  * if all priorities are identical.
  */
-eventhandler_tag
-eventhandler_register(struct eventhandler_list *list, const char *name, 
-		      void *func, void *arg, int priority)
+static eventhandler_tag
+eventhandler_register_internal(struct eventhandler_list *list,
+    const char *name, eventhandler_tag epn)
 {
     struct eventhandler_list		*new_list;
-    struct eventhandler_entry_generic	*eg;
     struct eventhandler_entry		*ep;
     
     KASSERT(eventhandler_lists_initted, ("eventhandler registered too early"));
+    KASSERT(epn != NULL, ("%s: cannot register NULL event", __func__));
 
     /* lock the eventhandler lists */
     mtx_lock(&eventhandler_mutex);
@@ -117,31 +117,68 @@ eventhandler_register(struct eventhandle
     }
     mtx_unlock(&eventhandler_mutex);
 
-    /* allocate an entry for this handler, populate it */
-    eg = malloc(sizeof(struct eventhandler_entry_generic), M_EVENTHANDLER,
-	M_WAITOK | M_ZERO);
-    eg->func = func;
-    eg->ee.ee_arg = arg;
-    eg->ee.ee_priority = priority;
-    KASSERT(priority != EHE_DEAD_PRIORITY,
+    KASSERT(epn->ee_priority != EHE_DEAD_PRIORITY,
 	("%s: handler for %s registered with dead priority", __func__, name));
 
     /* sort it into the list */
-    CTR4(KTR_EVH, "%s: adding item %p (function %p) to \"%s\"", __func__, eg,
-	func, name);
+    CTR4(KTR_EVH, "%s: adding item %p (function %p) to \"%s\"", __func__, epn,
+	((struct eventhandler_entry_generic *)epn)->func, name);
     EHL_LOCK(list);
     TAILQ_FOREACH(ep, &list->el_entries, ee_link) {
 	if (ep->ee_priority != EHE_DEAD_PRIORITY &&
-	    eg->ee.ee_priority < ep->ee_priority) {
-	    TAILQ_INSERT_BEFORE(ep, &eg->ee, ee_link);
+	    epn->ee_priority < ep->ee_priority) {
+	    TAILQ_INSERT_BEFORE(ep, epn, ee_link);
 	    break;
 	}
     }
     if (ep == NULL)
-	TAILQ_INSERT_TAIL(&list->el_entries, &eg->ee, ee_link);
+	TAILQ_INSERT_TAIL(&list->el_entries, epn, ee_link);
     EHL_UNLOCK(list);
-    return(&eg->ee);
+    return(epn);
+}
+
+eventhandler_tag
+eventhandler_register(struct eventhandler_list *list, const char *name, 
+		      void *func, void *arg, int priority)
+{
+    struct eventhandler_entry_generic	*eg;
+    
+    /* allocate an entry for this handler, populate it */
+    eg = malloc(sizeof(struct eventhandler_entry_generic), M_EVENTHANDLER,
+	M_WAITOK | M_ZERO);
+    eg->func = func;
+    eg->ee.ee_arg = arg;
+    eg->ee.ee_priority = priority;
+
+    return (eventhandler_register_internal(list, name, &eg->ee));
+}
+
+#ifdef VIMAGE
+struct eventhandler_entry_generic_vimage
+{
+    struct eventhandler_entry		ee;
+    vimage_iterator_func_t		func;		/* Vimage iterator function. */
+    struct eventhandler_entry_vimage	v_ee;		/* Original func, arg. */
+};
+
+eventhandler_tag
+vimage_eventhandler_register(struct eventhandler_list *list, const char *name, 
+    void *func, void *arg, int priority, vimage_iterator_func_t iterfunc)
+{
+    struct eventhandler_entry_generic_vimage	*eg;
+    
+    /* allocate an entry for this handler, populate it */
+    eg = malloc(sizeof(struct eventhandler_entry_generic_vimage),
+	M_EVENTHANDLER, M_WAITOK | M_ZERO);
+    eg->func = iterfunc;
+    eg->v_ee.func = func;
+    eg->v_ee.ee_arg = arg;
+    eg->ee.ee_arg = &eg->v_ee;
+    eg->ee.ee_priority = priority;
+
+    return (eventhandler_register_internal(list, name, &eg->ee));
 }
+#endif
 
 void
 eventhandler_deregister(struct eventhandler_list *list, eventhandler_tag tag)

Modified: stable/8/sys/net/vnet.c
==============================================================================
--- stable/8/sys/net/vnet.c	Wed Apr 21 19:35:56 2010	(r207009)
+++ stable/8/sys/net/vnet.c	Wed Apr 21 19:45:41 2010	(r207010)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -55,6 +56,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #ifdef DDB
 #include 
 #include 
@@ -637,6 +640,39 @@ vnet_sysuninit(void)
 	VNET_SYSINIT_RUNLOCK();
 }
 
+/*
+ * EVENTHANDLER(9) extensions.
+ */
+/*
+ * Invoke the eventhandler function originally registered with the possibly
+ * registered argument for all virtual network stack instances.
+ *
+ * This iterator can only be used for eventhandlers that do not take any
+ * additional arguments, as we do ignore the variadic arguments from the
+ * EVENTHANDLER_INVOKE() call.
+ */
+void
+vnet_global_eventhandler_iterator_func(void *arg, ...)
+{
+	VNET_ITERATOR_DECL(vnet_iter);
+	struct eventhandler_entry_vimage *v_ee;
+
+	/*
+	 * There is a bug here in that we should actually cast things to
+	 * (struct eventhandler_entry_ ## name *)  but that's not easily
+	 * possible in here so just re-using the variadic version we
+	 * defined for the generic vimage case.
+	 */
+	v_ee = arg;
+	VNET_LIST_RLOCK();
+	VNET_FOREACH(vnet_iter) {
+		CURVNET_SET(vnet_iter);
+		((vimage_iterator_func_t)v_ee->func)(v_ee->ee_arg);
+		CURVNET_RESTORE();
+	}
+	VNET_LIST_RUNLOCK();
+}
+
 #ifdef VNET_DEBUG
 struct vnet_recursion {
 	SLIST_ENTRY(vnet_recursion)	 vnr_le;
@@ -696,6 +732,9 @@ vnet_log_recursion(struct vnet *old_vnet
 }
 #endif /* VNET_DEBUG */
 
+/*
+ * DDB(4).
+ */
 #ifdef DDB
 DB_SHOW_COMMAND(vnets, db_show_vnets)
 {

Modified: stable/8/sys/net/vnet.h
==============================================================================
--- stable/8/sys/net/vnet.h	Wed Apr 21 19:35:56 2010	(r207009)
+++ stable/8/sys/net/vnet.h	Wed Apr 21 19:45:41 2010	(r207010)
@@ -313,6 +313,29 @@ void	vnet_register_sysuninit(void *arg);
 void	vnet_deregister_sysinit(void *arg);
 void	vnet_deregister_sysuninit(void *arg);
 
+/*
+ * EVENTHANDLER(9) extensions.
+ */
+#include 
+
+void	vnet_global_eventhandler_iterator_func(void *, ...);
+#define VNET_GLOBAL_EVENTHANDLER_REGISTER_TAG(tag, name, func, arg, priority) \
+do {									\
+	if (IS_DEFAULT_VNET(curvnet)) {					\
+		(tag) = vimage_eventhandler_register(NULL, #name, func,	\
+		    arg, priority,					\
+		    vnet_global_eventhandler_iterator_func);		\
+	}								\
+} while(0)
+#define VNET_GLOBAL_EVENTHANDLER_REGISTER(name, func, arg, priority)	\
+do {									\
+	if (IS_DEFAULT_VNET(curvnet)) {					\
+		vimage_eventhandler_register(NULL, #name, func,		\
+		    arg, priority,					\
+		    vnet_global_eventhandler_iterator_func);		\
+	}								\
+} while(0)
+
 #else /* !VIMAGE */
 
 /*
@@ -384,6 +407,13 @@ void	vnet_deregister_sysuninit(void *arg
 #define	VNET_SYSUNINIT(ident, subsystem, order, func, arg)		\
 	SYSUNINIT(ident, subsystem, order, func, arg)
 
+/*
+ * Without VIMAGE revert to the default implementation.
+ */
+#define VNET_GLOBAL_EVENTHANDLER_REGISTER_TAG(tag, name, func, arg, priority) \
+	(tag) = eventhandler_register(NULL, #name, func, arg, priority)
+#define VNET_GLOBAL_EVENTHANDLER_REGISTER(name, func, arg, priority)	\
+	eventhandler_register(NULL, #name, func, arg, priority)
 #endif /* VIMAGE */
 #endif /* _KERNEL */
 

Modified: stable/8/sys/sys/eventhandler.h
==============================================================================
--- stable/8/sys/sys/eventhandler.h	Wed Apr 21 19:35:56 2010	(r207009)
+++ stable/8/sys/sys/eventhandler.h	Wed Apr 21 19:45:41 2010	(r207010)
@@ -41,6 +41,14 @@ struct eventhandler_entry {
 	void				*ee_arg;
 };
 
+#ifdef VIMAGE
+struct eventhandler_entry_vimage {
+	void	(* func)(void);		/* Original function registered. */
+	void	*ee_arg;		/* Original argument registered. */
+	void	*sparep[2];
+};
+#endif
+
 struct eventhandler_list {
 	char				*el_name;
 	int				el_flags;
@@ -142,6 +150,14 @@ void	eventhandler_deregister(struct even
 struct eventhandler_list *eventhandler_find_list(const char *name);
 void	eventhandler_prune_list(struct eventhandler_list *list);
 
+#ifdef VIMAGE
+typedef	void (*vimage_iterator_func_t)(void *, ...);
+
+eventhandler_tag vimage_eventhandler_register(struct eventhandler_list *list,
+	    const char *name, void *func, void *arg, int priority,
+	    vimage_iterator_func_t);
+#endif
+
 /*
  * Standard system event queues.
  */

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 19:47: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 81D601065673;
	Wed, 21 Apr 2010 19:47:19 +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 70B378FC0C;
	Wed, 21 Apr 2010 19:47: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 o3LJlJV0050415;
	Wed, 21 Apr 2010 19:47:19 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJlJTI050413;
	Wed, 21 Apr 2010 19:47:19 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211947.o3LJlJTI050413@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 19:47:19 +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: r207011 - 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, 21 Apr 2010 19:47:19 -0000

Author: bz
Date: Wed Apr 21 19:47:19 2010
New Revision: 207011
URL: http://svn.freebsd.org/changeset/base/207011

Log:
  MFC r206469:
  
    In if_detach_internal() only try to do the detach run if if_attachdomain1()
    has actually succeeded to initialize and attach.  There is a theoretical
    possibility to drop out early in if_attachdomain1() leaving the array
    uninitialized if we cannot get the lock.
  
    Discussed with:       rwatson

Modified:
  stable/8/sys/net/if.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/geom/sched/   (props changed)

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c	Wed Apr 21 19:45:41 2010	(r207010)
+++ stable/8/sys/net/if.c	Wed Apr 21 19:47:19 2010	(r207011)
@@ -931,7 +931,7 @@ if_detach_internal(struct ifnet *ifp, in
 	if_delgroups(ifp);
 
 	IF_AFDATA_LOCK(ifp);
-	for (dp = domains; dp; dp = dp->dom_next) {
+	for (dp = domains; ifp->if_afdata_initialized > 0 && dp; dp = dp->dom_next) {
 		if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family])
 			(*dp->dom_ifdetach)(ifp,
 			    ifp->if_afdata[dp->dom_family]);

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 19:48: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 22BDB106564A;
	Wed, 21 Apr 2010 19:48:41 +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 11AF48FC0C;
	Wed, 21 Apr 2010 19:48: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 o3LJmevN050771;
	Wed, 21 Apr 2010 19:48:40 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJmeox050769;
	Wed, 21 Apr 2010 19:48:40 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211948.o3LJmeox050769@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 19:48:40 +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: r207012 - 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, 21 Apr 2010 19:48:41 -0000

Author: bz
Date: Wed Apr 21 19:48:40 2010
New Revision: 207012
URL: http://svn.freebsd.org/changeset/base/207012

Log:
  MFC r206470:
  
    In if_detach_internal() we cannot hold the af_data lock over the
    dom_ifdetach() calls as they might sleep for callout_drain().
    Do as we do in if_attachdomain1() [r121470] and handle
    if_afdata_initialized earlier and call dom_ifdetach() unlocked.
  
    Discussed with:       rwatson

Modified:
  stable/8/sys/net/if.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/geom/sched/   (props changed)

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c	Wed Apr 21 19:47:19 2010	(r207011)
+++ stable/8/sys/net/if.c	Wed Apr 21 19:48:40 2010	(r207012)
@@ -930,14 +930,20 @@ if_detach_internal(struct ifnet *ifp, in
 		devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL);
 	if_delgroups(ifp);
 
+	/*
+	 * We cannot hold the lock over dom_ifdetach calls as they might
+	 * sleep, for example trying to drain a callout, thus open up the
+	 * theoretical race with re-attaching.
+	 */
 	IF_AFDATA_LOCK(ifp);
-	for (dp = domains; ifp->if_afdata_initialized > 0 && dp; dp = dp->dom_next) {
+	i = ifp->if_afdata_initialized;
+	ifp->if_afdata_initialized = 0;
+	IF_AFDATA_UNLOCK(ifp);
+	for (dp = domains; i > 0 && dp; dp = dp->dom_next) {
 		if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family])
 			(*dp->dom_ifdetach)(ifp,
 			    ifp->if_afdata[dp->dom_family]);
 	}
-	ifp->if_afdata_initialized = 0;
-	IF_AFDATA_UNLOCK(ifp);
 }
 
 #ifdef VIMAGE

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 19:51: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 A047D106566C;
	Wed, 21 Apr 2010 19:51:22 +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 8E5A78FC15;
	Wed, 21 Apr 2010 19:51: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 o3LJpMtc051427;
	Wed, 21 Apr 2010 19:51:22 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJpMs9051421;
	Wed, 21 Apr 2010 19:51:22 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211951.o3LJpMs9051421@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 19:51: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: r207013 - in stable/8/sys: net netinet 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: Wed, 21 Apr 2010 19:51:22 -0000

Author: bz
Date: Wed Apr 21 19:51:22 2010
New Revision: 207013
URL: http://svn.freebsd.org/changeset/base/207013

Log:
  MFC r206481:
  
    Plug reference leaks in the link-layer code ("new-arp") that previously
    prevented the link-layer entry from being freed.
  
    In both in.c and in6.c (though that code path seems to be basically dead)
    plug a reference leak in case of a pending callout being drained.
  
    In if_ether.c consistently add a reference before resetting the callout
    and in case we canceled a pending one remove the reference for that.
    In the final case in arptimer, before freeing the expired entry, remove
    the reference again and explicitly call callout_stop() to clear the active
    flag.
  
    In nd6.c:nd6_free() we are only ever called from the callout function and
    thus need to remove the reference there as well before calling into
    llentry_free().
  
    In if_llatbl.c when freeing the entire tables make sure that in case we
    cancel a pending callout to remove the reference as well.
  
    Reviewed by:          qingli (earlier version)
    MFC after:            10 days
    Problem observed, patch tested by: simon on ipv6gw.f.o,
                          Christian Kratzer (ck cksoft.de),
                          Evgenii Davidov (dado korolev-net.ru)
  PR:			kern/144564
  Configurations still affected:	with options FLOWTABLE

Modified:
  stable/8/sys/net/if_llatbl.c
  stable/8/sys/netinet/if_ether.c
  stable/8/sys/netinet/in.c
  stable/8/sys/netinet6/in6.c
  stable/8/sys/netinet6/nd6.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/geom/sched/   (props changed)

Modified: stable/8/sys/net/if_llatbl.c
==============================================================================
--- stable/8/sys/net/if_llatbl.c	Wed Apr 21 19:48:40 2010	(r207012)
+++ stable/8/sys/net/if_llatbl.c	Wed Apr 21 19:51:22 2010	(r207013)
@@ -170,9 +170,12 @@ lltable_free(struct lltable *llt)
 
 	for (i=0; i < LLTBL_HASHTBL_SIZE; i++) {
 		LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) {
+			int canceled;
 
-			callout_drain(&lle->la_timer);
+			canceled = callout_drain(&lle->la_timer);
 			LLE_WLOCK(lle);
+			if (canceled)
+				LLE_REMREF(lle);
 			llentry_free(lle);
 		}
 	}

Modified: stable/8/sys/netinet/if_ether.c
==============================================================================
--- stable/8/sys/netinet/if_ether.c	Wed Apr 21 19:48:40 2010	(r207012)
+++ stable/8/sys/netinet/if_ether.c	Wed Apr 21 19:51:22 2010	(r207013)
@@ -180,6 +180,8 @@ arptimer(void *arg)
 	else {
 		if (!callout_pending(&lle->la_timer) &&
 		    callout_active(&lle->la_timer)) {
+			callout_stop(&lle->la_timer);
+			LLE_REMREF(lle);
 			(void) llentry_free(lle);
 			ARPSTAT_INC(timeouts);
 		} 
@@ -382,9 +384,14 @@ retry:
 		    EHOSTUNREACH : EHOSTDOWN;
 
 	if (renew) {
+		int canceled;
+
 		LLE_ADDREF(la);
 		la->la_expire = time_second + V_arpt_down;
-		callout_reset(&la->la_timer, hz * V_arpt_down, arptimer, la);
+		canceled = callout_reset(&la->la_timer, hz * V_arpt_down,
+		    arptimer, la);
+		if (canceled)
+			LLE_REMREF(la);
 		la->la_asked++;
 		LLE_WUNLOCK(la);
 		arprequest(ifp, NULL, &SIN(dst)->sin_addr,
@@ -694,9 +701,14 @@ match:
 		la->la_flags |= LLE_VALID;
 
 		if (!(la->la_flags & LLE_STATIC)) {
+			int canceled;
+
+			LLE_ADDREF(la);
 			la->la_expire = time_second + V_arpt_keep;
-			callout_reset(&la->la_timer, hz * V_arpt_keep,
-			    arptimer, la);
+			canceled = callout_reset(&la->la_timer,
+			    hz * V_arpt_keep, arptimer, la);
+			if (canceled)
+				LLE_REMREF(la);
 		}
 		la->la_asked = 0;
 		la->la_preempt = V_arp_maxtries;

Modified: stable/8/sys/netinet/in.c
==============================================================================
--- stable/8/sys/netinet/in.c	Wed Apr 21 19:48:40 2010	(r207012)
+++ stable/8/sys/netinet/in.c	Wed Apr 21 19:51:22 2010	(r207013)
@@ -1357,8 +1357,12 @@ in_lltable_prefix_free(struct lltable *l
 
 			if (IN_ARE_MASKED_ADDR_EQUAL((struct sockaddr_in *)L3_ADDR(lle), 
 						     pfx, msk)) {
-				callout_drain(&lle->la_timer);
+				int canceled;
+
+				canceled = callout_drain(&lle->la_timer);
 				LLE_WLOCK(lle);
+				if (canceled)
+					LLE_REMREF(lle);
 				llentry_free(lle);
 			}
 		}

Modified: stable/8/sys/netinet6/in6.c
==============================================================================
--- stable/8/sys/netinet6/in6.c	Wed Apr 21 19:48:40 2010	(r207012)
+++ stable/8/sys/netinet6/in6.c	Wed Apr 21 19:51:22 2010	(r207013)
@@ -2337,8 +2337,12 @@ in6_lltable_prefix_free(struct lltable *
 				    &((struct sockaddr_in6 *)L3_ADDR(lle))->sin6_addr, 
 				    &pfx->sin6_addr, 
 				    &msk->sin6_addr)) {
-				callout_drain(&lle->la_timer);
+				int canceled;
+
+				canceled = callout_drain(&lle->la_timer);
 				LLE_WLOCK(lle);
+				if (canceled)
+					LLE_REMREF(lle);
 				llentry_free(lle);
 			}
 		}

Modified: stable/8/sys/netinet6/nd6.c
==============================================================================
--- stable/8/sys/netinet6/nd6.c	Wed Apr 21 19:48:40 2010	(r207012)
+++ stable/8/sys/netinet6/nd6.c	Wed Apr 21 19:51:22 2010	(r207013)
@@ -1124,6 +1124,7 @@ nd6_free(struct llentry *ln, int gc)
 	ifp = ln->lle_tbl->llt_ifp;
 	IF_AFDATA_LOCK(ifp);
 	LLE_WLOCK(ln);
+	LLE_REMREF(ln);
 	llentry_free(ln);
 	IF_AFDATA_UNLOCK(ifp);
 

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 19:55: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 60C9A1065673;
	Wed, 21 Apr 2010 19:55:43 +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 4FB5B8FC0C;
	Wed, 21 Apr 2010 19:55: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 o3LJthD2052439;
	Wed, 21 Apr 2010 19:55:43 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJthEg052437;
	Wed, 21 Apr 2010 19:55:43 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211955.o3LJthEg052437@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 19:55:43 +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: r207014 - 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, 21 Apr 2010 19:55:43 -0000

Author: bz
Date: Wed Apr 21 19:55:43 2010
New Revision: 207014
URL: http://svn.freebsd.org/changeset/base/207014

Log:
  MFC r206486:
  
    Check that the interface is on the list of cloned interfaces before trying
    to remove it to avoid panics in case of two threads trying to remove it in
    parallel.
  
  PR:	      kern/116837
  Submitted by: Takahiro Kurosawa (takahiro.kurosawa gmail.com) (orig version)

Modified:
  stable/8/sys/net/if_clone.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/geom/sched/   (props changed)

Modified: stable/8/sys/net/if_clone.c
==============================================================================
--- stable/8/sys/net/if_clone.c	Wed Apr 21 19:51:22 2010	(r207013)
+++ stable/8/sys/net/if_clone.c	Wed Apr 21 19:55:43 2010	(r207014)
@@ -234,6 +234,7 @@ int
 if_clone_destroyif(struct if_clone *ifc, struct ifnet *ifp)
 {
 	int err;
+	struct ifnet *ifcifp;
 
 	if (ifc->ifc_destroy == NULL)
 		return(EOPNOTSUPP);
@@ -246,8 +247,17 @@ if_clone_destroyif(struct if_clone *ifc,
 	CURVNET_SET_QUIET(ifp->if_vnet);
 
 	IF_CLONE_LOCK(ifc);
-	IFC_IFLIST_REMOVE(ifc, ifp);
+	LIST_FOREACH(ifcifp, &ifc->ifc_iflist, if_clones) {
+		if (ifcifp == ifp) {
+			IFC_IFLIST_REMOVE(ifc, ifp);
+			break;
+		}
+	}
 	IF_CLONE_UNLOCK(ifc);
+	if (ifcifp == NULL) {
+		CURVNET_RESTORE();
+		return (ENXIO);		/* ifp is not on the list. */
+	}
 
 	if_delgroup(ifp, ifc->ifc_name);
 

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 20: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 C7C891065672;
	Wed, 21 Apr 2010 20:00:13 +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 B69188FC27;
	Wed, 21 Apr 2010 20: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 o3LK0Drq053522;
	Wed, 21 Apr 2010 20:00:13 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LK0Df1053520;
	Wed, 21 Apr 2010 20:00:13 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004212000.o3LK0Df1053520@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 20:00:13 +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: r207015 - 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, 21 Apr 2010 20:00:13 -0000

Author: bz
Date: Wed Apr 21 20:00:13 2010
New Revision: 207015
URL: http://svn.freebsd.org/changeset/base/207015

Log:
  MFC r206488:
  
    Take a reference to make sure that the interface cannot go away during
    if_clone_destroy() in case parallel threads try to.
  
  PR:		kern/116837
  Submitted by:	Mikolaj Golub (to.my.trociny gmail.com)

Modified:
  stable/8/sys/net/if_clone.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/geom/sched/   (props changed)

Modified: stable/8/sys/net/if_clone.c
==============================================================================
--- stable/8/sys/net/if_clone.c	Wed Apr 21 19:55:43 2010	(r207014)
+++ stable/8/sys/net/if_clone.c	Wed Apr 21 20:00:13 2010	(r207015)
@@ -196,10 +196,11 @@ if_clone_createif(struct if_clone *ifc, 
 int
 if_clone_destroy(const char *name)
 {
+	int err;
 	struct if_clone *ifc;
 	struct ifnet *ifp;
 
-	ifp = ifunit(name);
+	ifp = ifunit_ref(name);
 	if (ifp == NULL)
 		return (ENXIO);
 
@@ -221,10 +222,14 @@ if_clone_destroy(const char *name)
 	}
 #endif
 	IF_CLONERS_UNLOCK();
-	if (ifc == NULL)
+	if (ifc == NULL) {
+		if_rele(ifp);
 		return (EINVAL);
+	}
 
-	return (if_clone_destroyif(ifc, ifp));
+	err = if_clone_destroyif(ifc, ifp);
+	if_rele(ifp);
+	return err;
 }
 
 /*

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 20:04: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 444F91065672;
	Wed, 21 Apr 2010 20:04:43 +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 339798FC18;
	Wed, 21 Apr 2010 20:04: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 o3LK4hqI054616;
	Wed, 21 Apr 2010 20:04:43 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LK4h3A054614;
	Wed, 21 Apr 2010 20:04:43 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004212004.o3LK4h3A054614@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 21 Apr 2010 20:04: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: r207016 - 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, 21 Apr 2010 20:04:43 -0000

Author: kib
Date: Wed Apr 21 20:04:42 2010
New Revision: 207016
URL: http://svn.freebsd.org/changeset/base/207016

Log:
  Fix typo.
  
  Submitted by:	emaste
  Pointy hat to:	kib (who needs much bigger wardrobe)
  MFC after:	1 week

Modified:
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Wed Apr 21 20:00:13 2010	(r207015)
+++ head/sys/kern/kern_proc.c	Wed Apr 21 20:04:42 2010	(r207016)
@@ -1093,7 +1093,7 @@ static int
 sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req)
 {
 
-	return (SYSCTL_OUT(req, (caddr_t)&ki, sizeof(struct kinfo_proc)));
+	return (SYSCTL_OUT(req, (caddr_t)ki, sizeof(struct kinfo_proc)));
 }
 #endif
 

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 20:05: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 298B0106564A;
	Wed, 21 Apr 2010 20:05:50 +0000 (UTC)
	(envelope-from anchie@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 190398FC0A;
	Wed, 21 Apr 2010 20:05: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 o3LK5nNe054889;
	Wed, 21 Apr 2010 20:05:49 GMT (envelope-from anchie@svn.freebsd.org)
Received: (from anchie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LK5nZ5054887;
	Wed, 21 Apr 2010 20:05:49 GMT (envelope-from anchie@svn.freebsd.org)
Message-Id: <201004212005.o3LK5nZ5054887@svn.freebsd.org>
From: Ana Kukec 
Date: Wed, 21 Apr 2010 20:05: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: r207017 - 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: Wed, 21 Apr 2010 20:05:50 -0000

Author: anchie
Date: Wed Apr 21 20:05:49 2010
New Revision: 207017
URL: http://svn.freebsd.org/changeset/base/207017

Log:
  Fix of r206904, \nanchie is needed instead of \anchie.
  
  Approved by:	bz (mentor)
  Reported by:	danfe, zec

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==============================================================================
--- head/share/misc/committers-src.dot	Wed Apr 21 20:04:42 2010	(r207016)
+++ head/share/misc/committers-src.dot	Wed Apr 21 20:05:49 2010	(r207017)
@@ -55,7 +55,7 @@ node [color=lightblue2, style=filled, bg
 ache [label="Andrey Chernov\nache@FreeBSD.org\n1993/10/31"]
 akiyama [label="Shunsuke Akiyama\nakiyama@FreeBSD.org\n2000/06/19"]
 ambrisko [label="Doug Ambrisko\nambrisko@FreeBSD.org\n2001/12/19"]
-anchie [label="Ana Kukec\anchie@FreeBSD.org\n2010/04/14"]
+anchie [label="Ana Kukec\nanchie@FreeBSD.org\n2010/04/14"]
 andre [label="Andre Oppermann\nandre@FreeBSD.org\n2003/11/12"]
 anholt [label="Eric Anholt\nanholt@FreeBSD.org\n2002/04/22"]
 antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2008/02/03"]

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 21:51: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 B817D106566B;
	Wed, 21 Apr 2010 21:51:14 +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 A61A58FC1F;
	Wed, 21 Apr 2010 21:51: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 o3LLpE0g078335;
	Wed, 21 Apr 2010 21:51:14 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LLpE3V078331;
	Wed, 21 Apr 2010 21:51:14 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004212151.o3LLpE3V078331@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 21 Apr 2010 21:51: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: r207020 - in head: etc etc/devd sys/dev/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: Wed, 21 Apr 2010 21:51:14 -0000

Author: thompsa
Date: Wed Apr 21 21:51:14 2010
New Revision: 207020
URL: http://svn.freebsd.org/changeset/base/207020

Log:
  Change usb devd events from fake attach to a notify. The ugen device is not a
  proper device_t so it faked the devctl event to appear like one, this is now a
  notify which allows more information to be passed.
  
  We notify for both the device attach/detach and for each usb interface. A devd
  rule can now match on the interface properties, including composite devices
  which may have a uvideo interface and also usound and possibly uhid too.
  
  An example to match a umass device with a scsi subclass and BBB protocol would be
  
  notify 100 {
  	match "system"          "USB";
  	match "subsystem"       "INTERFACE";
  	match "type"            "ATTACH";
  	match "intclass"        "0x08";
  	match "intsubclass"     "0x06";
  	match "intprotocol"     "0x50";
  	action ...
  };
  
  The old attach devctl event has been retained for the moment to make merging to
  8.1 easier. This was never compatible with 7.x or earlier due to the ugen regex
  change needed.
  
  Reviewed by:	warner
  MFC after:	1 week

Modified:
  head/etc/devd.conf
  head/etc/devd/uath.conf
  head/sys/dev/usb/usb_device.c

Modified: head/etc/devd.conf
==============================================================================
--- head/etc/devd.conf	Wed Apr 21 21:21:52 2010	(r207019)
+++ head/etc/devd.conf	Wed Apr 21 21:51:14 2010	(r207020)
@@ -138,12 +138,14 @@ attach 100 {
 # This entry starts the ColdSync tool in daemon mode. Make sure you have an up
 # to date /usr/local/etc/palms. We override the 'listen' settings for port and
 # type in /usr/local/etc/coldsync.conf.
-attach 100 {
-	device-name "ugen[0-9]+";
-	match "vendor" "0x082d";
-	match "product" "0x0100";
-	match "release" "0x0100";
-	action "/usr/local/bin/coldsync -md -p /dev/$device-name -t usb";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x082d";
+	match "product"		"0x0100";
+	match "release"		"0x0100";
+	action "/usr/local/bin/coldsync -md -p /dev/$cdev -t usb";
 };
 
 #

Modified: head/etc/devd/uath.conf
==============================================================================
--- head/etc/devd/uath.conf	Wed Apr 21 21:21:52 2010	(r207019)
+++ head/etc/devd/uath.conf	Wed Apr 21 21:51:14 2010	(r207020)
@@ -4,117 +4,143 @@
 
 # Accton
 #   SMCWUSB-G and SMCWUSBT-G2
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x083a";
-	match "product" "(0x4505|0x4507)";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x083a";
+	match "product"		"(0x4505|0x4507)";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # Atheros Communications
 #   AR5523
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x168c";
-	match "product" "0x0002";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x168c";
+	match "product"		"0x0002";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # Atheros Communications
 #   AR5523
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x0cf3";
-	match "product" "(0x0002|0x0004|0x0006)";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x0cf3";
+	match "product"		"(0x0002|0x0004|0x0006)";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # Conceptronic
 #   AR5523
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x0d8e";
-	match "product" "(0x7802|0x7812)";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x0d8e";
+	match "product"		"(0x7802|0x7812)";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # D-Link
 #   DWL-AG132, DWL-G132 and DWL-AG122
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x2001";
-	match "product" "(0x3a01|0x3a03|0x3a05)";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x2001";
+	match "product"		"(0x3a01|0x3a03|0x3a05)";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # D-Link
 #  DWA-120
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x07d1";
-	match "product" "0x3a0c";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x07d1";
+	match "product"		"0x3a0c";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # Gigaset
 #   SMCWUSBT-G
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x1690";
-	match "product" "(0x0711|0x0713)";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x1690";
+	match "product"		"(0x0711|0x0713)";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # Global Sun Technology
 #   AR5523
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x16ab";
-	match "product" "(0x7802|0x7812)";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x16ab";
+	match "product"		"(0x7802|0x7812)";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # BayNETGEAR
 #   WG111U
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x0846";
-	match "product" "0x4301";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x0846";
+	match "product"		"0x4301";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # Netgear
 #   WG111T and WPN111
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x1385";
-	match "product" "(0x4251|0x5f01)";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x1385";
+	match "product"		"(0x4251|0x5f01)";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # U-MEDIA Communications
 #   TEW-444UB and AR5523
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x157e";
-	match "product" "(0x3007|0x3206)";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x157e";
+	match "product"		"(0x3007|0x3206)";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # Wistron NeWeb
 #   AR5523
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x1435";
-	match "product" "(0x0827|0x0829)";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x1435";
+	match "product"		"(0x0827|0x0829)";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };
 
 # Z-Com
 #   AR5523
-attach 100 {
-	device-name "ugen[0-9.]+";
-	match "vendor" "0x0cde";
-	match "product" "0x0013";
-	action "/usr/sbin/uathload -d /dev/$device-name";
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"		"0x0cde";
+	match "product"		"0x0013";
+	action "/usr/sbin/uathload -d /dev/$cdev";
 };

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Wed Apr 21 21:21:52 2010	(r207019)
+++ head/sys/dev/usb/usb_device.c	Wed Apr 21 21:51:14 2010	(r207020)
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1834,7 +1835,7 @@ config_done:
 	printf("%s: <%s> at %s\n", udev->ugen_name, udev->manufacturer,
 	    device_get_nameunit(udev->bus->bdev));
 
-	usb_notify_addq("+", udev);
+	usb_notify_addq("ATTACH", udev);
 #endif
 done:
 	if (err) {
@@ -1980,7 +1981,7 @@ usb_free_device(struct usb_device *udev,
 	usb_set_device_state(udev, USB_STATE_DETACHED);
 
 #if USB_HAVE_UGEN
-	usb_notify_addq("-", udev);
+	usb_notify_addq("DETACH", udev);
 
 	printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name,
 	    udev->manufacturer, device_get_nameunit(bus->bdev));
@@ -2347,13 +2348,23 @@ usbd_get_device_index(struct usb_device 
  *
  * This function will generate events for dev.
  *------------------------------------------------------------------------*/
+#ifndef BURN_BRIDGES
 static void
-usb_notify_addq(const char *type, struct usb_device *udev)
+usb_notify_addq_compat(const char *type, struct usb_device *udev)
 {
 	char *data = NULL;
+	const char *ntype;
 	struct malloc_type *mt;
 	const size_t buf_size = 512;
 
+	/* Convert notify type */
+	if (strcmp(type, "ATTACH") == 0)
+		ntype = "+";
+	else if (strcmp(type, "DETACH") == 0)
+		ntype = "-";
+	else
+		return;
+
 	mtx_lock(&malloc_mtx);
 	mt = malloc_desc2type("bus");	/* XXX M_BUS */
 	mtx_unlock(&malloc_mtx);
@@ -2378,7 +2389,7 @@ usb_notify_addq(const char *type, struct
 	    "port=%u "
 	    "on "
 	    "%s\n",
-	    type,
+	    ntype,
 	    udev->ugen_name,
 	    UGETW(udev->ddesc.idVendor),
 	    UGETW(udev->ddesc.idProduct),
@@ -2393,6 +2404,85 @@ usb_notify_addq(const char *type, struct
 
 	devctl_queue_data(data);
 }
+#endif
+
+static void
+usb_notify_addq(const char *type, struct usb_device *udev)
+{
+	struct usb_interface *iface;
+	struct sbuf *sb;
+	int i;
+
+#ifndef BURN_BRIDGES
+	usb_notify_addq_compat(type, udev);
+#endif
+
+	/* announce the device */
+	sb = sbuf_new_auto();
+	sbuf_printf(sb,
+	    "cdev=%s "
+	    "vendor=0x%04x "
+	    "product=0x%04x "
+	    "devclass=0x%02x "
+	    "devsubclass=0x%02x "
+	    "sernum=\"%s\" "
+	    "release=0x%04x "
+	    "port=%u "
+	    "parent=%s\n",
+	    udev->ugen_name,
+	    UGETW(udev->ddesc.idVendor),
+	    UGETW(udev->ddesc.idProduct),
+	    udev->ddesc.bDeviceClass,
+	    udev->ddesc.bDeviceSubClass,
+	    udev->serial,
+	    UGETW(udev->ddesc.bcdDevice),
+	    udev->port_no,
+	    udev->parent_hub != NULL ?
+	    udev->parent_hub->ugen_name :
+	    device_get_nameunit(device_get_parent(udev->bus->bdev)));
+	sbuf_finish(sb);
+	devctl_notify("USB", "DEVICE", type, sbuf_data(sb));
+	sbuf_delete(sb);
+
+	/* announce each interface */
+	for (i = 0; i < USB_IFACE_MAX; i++) {
+		iface = usbd_get_iface(udev, i);
+		if (iface == NULL)
+			break;		/* end of interfaces */
+		if (iface->idesc == NULL)
+			continue;	/* no interface descriptor */
+
+		sb = sbuf_new_auto();
+		sbuf_printf(sb,
+		    "cdev=%s "
+		    "vendor=0x%04x "
+		    "product=0x%04x "
+		    "devclass=0x%02x "
+		    "devsubclass=0x%02x "
+		    "sernum=\"%s\" "
+		    "release=0x%04x "
+		    "interface=%d "
+		    "endpoints=%d "
+		    "intclass=0x%02x "
+		    "intsubclass=0x%02x "
+		    "intprotocol=0x%02x\n",
+		    udev->ugen_name,
+		    UGETW(udev->ddesc.idVendor),
+		    UGETW(udev->ddesc.idProduct),
+		    udev->ddesc.bDeviceClass,
+		    udev->ddesc.bDeviceSubClass,
+		    udev->serial,
+		    UGETW(udev->ddesc.bcdDevice),
+		    iface->idesc->bInterfaceNumber,
+		    iface->idesc->bNumEndpoints,
+		    iface->idesc->bInterfaceClass,
+		    iface->idesc->bInterfaceSubClass,
+		    iface->idesc->bInterfaceProtocol);
+		sbuf_finish(sb);
+		devctl_notify("USB", "INTERFACE", type, sbuf_data(sb));
+		sbuf_delete(sb);
+	}
+}
 
 /*------------------------------------------------------------------------*
  *	usb_fifo_free_wrap

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 21:57: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 D26421065670;
	Wed, 21 Apr 2010 21:57:03 +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 A84E98FC21;
	Wed, 21 Apr 2010 21:57: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 o3LLv3FI079659;
	Wed, 21 Apr 2010 21:57:03 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LLv37P079657;
	Wed, 21 Apr 2010 21:57:03 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004212157.o3LLv37P079657@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Wed, 21 Apr 2010 21:57: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: r207021 - head/bin/ln
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, 21 Apr 2010 21:57:03 -0000

Author: jilles
Date: Wed Apr 21 21:57:03 2010
New Revision: 207021
URL: http://svn.freebsd.org/changeset/base/207021

Log:
  ln: Allow a trailing slash when creating a link to a directory.
  
  In the 'ln source... directory' synopsis, the basename of each source
  determines the name of the created link. Determine this using basename(3)
  instead of strrchr(..., '/') which is incorrect if the pathname ends in a
  slash.
  
  The patch is somewhat changed to allow for basename(3) implementations that
  change the passed pathname, and to fix the -w option's checking also.
  The code to compare directory entries only applies to hard links, which
  cannot be created to directories using ln.
  
  Example:
    ln -s /etc/defaults/ /tmp
  This should create a symlink named defaults.
  
  PR:		121568
  Submitted by:	Ighighi
  MFC after:	1 week

Modified:
  head/bin/ln/ln.c

Modified: head/bin/ln/ln.c
==============================================================================
--- head/bin/ln/ln.c	Wed Apr 21 21:51:14 2010	(r207020)
+++ head/bin/ln/ln.c	Wed Apr 21 21:57:03 2010	(r207021)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -226,6 +227,7 @@ linkit(const char *source, const char *t
 	int ch, exists, first;
 	char path[PATH_MAX];
 	char wbuf[PATH_MAX];
+	char bbuf[PATH_MAX];
 
 	if (!sflag) {
 		/* If source doesn't exist, quit now. */
@@ -248,11 +250,9 @@ linkit(const char *source, const char *t
 	if (isdir ||
 	    (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) ||
 	    (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode))) {
-		if ((p = strrchr(source, '/')) == NULL)
-			p = source;
-		else
-			++p;
-		if (snprintf(path, sizeof(path), "%s/%s", target, p) >=
+		if (strlcpy(bbuf, source, sizeof(bbuf)) >= sizeof(bbuf) ||
+		    (p = basename(bbuf)) == NULL ||
+		    snprintf(path, sizeof(path), "%s/%s", target, p) >=
 		    (ssize_t)sizeof(path)) {
 			errno = ENAMETOOLONG;
 			warn("%s", source);
@@ -276,15 +276,14 @@ linkit(const char *source, const char *t
 			 * absolute path of the source, by appending `source'
 			 * to the parent directory of the target.
 			 */
-			p = strrchr(target, '/');
-			if (p != NULL)
-				p++;
-			else
-				p = target;
-			(void)snprintf(wbuf, sizeof(wbuf), "%.*s%s",
-			    (int)(p - target), target, source);
-			if (stat(wbuf, &sb) != 0)
-				warn("warning: %s", source);
+			strlcpy(bbuf, target, sizeof(bbuf));
+			p = dirname(bbuf);
+			if (p != NULL) {
+				(void)snprintf(wbuf, sizeof(wbuf), "%s/%s",
+						p, source);
+				if (stat(wbuf, &sb) != 0)
+					warn("warning: %s", source);
+			}
 		}
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Wed Apr 21 23:03: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 09F0C106566C;
	Wed, 21 Apr 2010 23:03:27 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EE65E8FC1D;
	Wed, 21 Apr 2010 23:03: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 o3LN3Qvs094695;
	Wed, 21 Apr 2010 23:03:26 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LN3QsF094693;
	Wed, 21 Apr 2010 23:03:26 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004212303.o3LN3QsF094693@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 21 Apr 2010 23:03: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: r207027 - head/sys/dev/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: Wed, 21 Apr 2010 23:03:27 -0000

Author: thompsa
Date: Wed Apr 21 23:03:26 2010
New Revision: 207027
URL: http://svn.freebsd.org/changeset/base/207027

Log:
  Also add the usb mode to the devd string as the usb controller can work in both
  host or device (gadget) modes.
  
  Suggested by:	HPS

Modified:
  head/sys/dev/usb/usb_device.c

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Wed Apr 21 22:34:49 2010	(r207026)
+++ head/sys/dev/usb/usb_device.c	Wed Apr 21 23:03:26 2010	(r207027)
@@ -2427,6 +2427,7 @@ usb_notify_addq(const char *type, struct
 	    "devsubclass=0x%02x "
 	    "sernum=\"%s\" "
 	    "release=0x%04x "
+	    "mode=%s "
 	    "port=%u "
 	    "parent=%s\n",
 	    udev->ugen_name,
@@ -2436,6 +2437,7 @@ usb_notify_addq(const char *type, struct
 	    udev->ddesc.bDeviceSubClass,
 	    udev->serial,
 	    UGETW(udev->ddesc.bcdDevice),
+	    (udev->flags.usb_mode == USB_MODE_HOST) ? "host" : "device",
 	    udev->port_no,
 	    udev->parent_hub != NULL ?
 	    udev->parent_hub->ugen_name :
@@ -2461,6 +2463,7 @@ usb_notify_addq(const char *type, struct
 		    "devsubclass=0x%02x "
 		    "sernum=\"%s\" "
 		    "release=0x%04x "
+		    "mode=%s "
 		    "interface=%d "
 		    "endpoints=%d "
 		    "intclass=0x%02x "
@@ -2473,6 +2476,7 @@ usb_notify_addq(const char *type, struct
 		    udev->ddesc.bDeviceSubClass,
 		    udev->serial,
 		    UGETW(udev->ddesc.bcdDevice),
+		    (udev->flags.usb_mode == USB_MODE_HOST) ? "host" : "device",
 		    iface->idesc->bInterfaceNumber,
 		    iface->idesc->bNumEndpoints,
 		    iface->idesc->bInterfaceClass,

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 00:28: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 76575106566B;
	Thu, 22 Apr 2010 00:28:49 +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 6539D8FC20;
	Thu, 22 Apr 2010 00:28: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 o3M0SnwO014649;
	Thu, 22 Apr 2010 00:28:49 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3M0Snmg014646;
	Thu, 22 Apr 2010 00:28:49 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004220028.o3M0Snmg014646@svn.freebsd.org>
From: Xin LI 
Date: Thu, 22 Apr 2010 00:28:49 +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: r207040 - stable/8/contrib/netcat
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, 22 Apr 2010 00:28:49 -0000

Author: delphij
Date: Thu Apr 22 00:28:49 2010
New Revision: 207040
URL: http://svn.freebsd.org/changeset/base/207040

Log:
  MFC: netcat 4.7.

Deleted:
  stable/8/contrib/netcat/FREEBSD-upgrade
  stable/8/contrib/netcat/FREEBSD-vendor
Modified:
  stable/8/contrib/netcat/nc.1
  stable/8/contrib/netcat/netcat.c
Directory Properties:
  stable/8/contrib/netcat/   (props changed)

Modified: stable/8/contrib/netcat/nc.1
==============================================================================
--- stable/8/contrib/netcat/nc.1	Thu Apr 22 00:21:30 2010	(r207039)
+++ stable/8/contrib/netcat/nc.1	Thu Apr 22 00:28:49 2010	(r207040)
@@ -1,4 +1,4 @@
-.\"     $OpenBSD: nc.1,v 1.50 2009/06/05 06:47:12 jmc Exp $
+.\"     $OpenBSD: nc.1,v 1.53 2010/02/23 23:00:52 schwarze Exp $
 .\"
 .\" Copyright (c) 1996 David Sacerdote
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 5 2009
+.Dd April 15, 2010
 .Dt NC 1
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Sh SYNOPSIS
 .Nm nc
 .Bk -words
-.Op Fl 46DdEhklnorStUuvz
+.Op Fl 46DdEhklnrStUuvz
 .Op Fl e Ar IPsec_policy
 .Op Fl I Ar length
 .Op Fl i Ar interval
@@ -51,8 +51,8 @@
 .Op Fl X Ar proxy_protocol
 .Oo Xo
 .Fl x Ar proxy_address Ns Oo : Ns
-.Ar port Oc Oc
-.Xc
+.Ar port Oc
+.Xc Oc
 .Op Ar hostname
 .Op Ar port
 .Ek
@@ -159,15 +159,6 @@ socket option.
 .It Fl O Ar length
 Specifies the size of the TCP send buffer.
 When
-.It Fl o
-.Dq Once-only mode .
-By default,
-.Nm
-does not terminate on EOF condition on input,
-but continues until the network side has been closed down.
-Specifying
-.Fl o
-will make it terminate on EOF as well.
 .It Fl P Ar proxy_username
 Specifies a username to present to a proxy server that requires authentication.
 If no username is specified then authentication will not be attempted.
@@ -206,7 +197,9 @@ This makes it possible to use
 .Nm
 to script telnet sessions.
 .It Fl U
-Specifies to use Unix Domain Sockets.
+Specifies to use
+.Ux Ns -domain
+sockets.
 .It Fl u
 Use UDP instead of the default option of TCP.
 .It Fl V Ar fib
@@ -428,7 +421,9 @@ outgoing traffic only.
 .Pp
 .Dl $ nc -e 'out ipsec esp/transport//require' host.example.com 42
 .Pp
-Create and listen on a Unix Domain Socket:
+Create and listen on a
+.Ux Ns -domain
+socket:
 .Pp
 .Dl $ nc -lU /var/tmp/dsocket
 .Pp

Modified: stable/8/contrib/netcat/netcat.c
==============================================================================
--- stable/8/contrib/netcat/netcat.c	Thu Apr 22 00:21:30 2010	(r207039)
+++ stable/8/contrib/netcat/netcat.c	Thu Apr 22 00:28:49 2010	(r207040)
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.93 2009/06/05 00:18:10 claudio Exp $ */
+/* $OpenBSD: netcat.c,v 1.95 2010/02/27 00:58:56 nicm Exp $ */
 /*
  * Copyright (c) 2001 Eric Jackson 
  *
@@ -72,14 +72,12 @@
 #define PORT_MAX_LEN	6
 
 /* Command Line Options */
-int	Eflag;					/* Use IPsec ESP */
 int	dflag;					/* detached, no stdin */
 unsigned int iflag;				/* Interval Flag */
 int	jflag;					/* use jumbo frames if we can */
 int	kflag;					/* More than one connect */
 int	lflag;					/* Bind to local port */
 int	nflag;					/* Don't do name look up */
-int	oflag;					/* Once only: stop on EOF */
 int	FreeBSD_Oflag;				/* Do not use TCP options */
 char   *Pflag;					/* Proxy username */
 char   *pflag;					/* Localport flag */
@@ -151,7 +149,7 @@ main(int argc, char *argv[])
 	sv = NULL;
 
 	while ((ch = getopt_long(argc, argv,
-	    "46DdEe:hI:i:jklnO:oP:p:rSs:tT:UuV:vw:X:x:z",
+	    "46DdEe:hI:i:jklnoO:P:p:rSs:tT:UuV:vw:X:x:z",
 	    longopts, NULL)) != -1) {
 		switch (ch) {
 		case '4':
@@ -214,7 +212,7 @@ main(int argc, char *argv[])
 			nflag = 1;
 			break;
 		case 'o':
-			oflag = 1;
+			fprintf(stderr, "option -o is deprecated.\n");
 			break;
 		case 'P':
 			Pflag = optarg;
@@ -282,8 +280,6 @@ main(int argc, char *argv[])
 		case 'T':
 			Tflag = parse_iptos(optarg);
 			break;
-		case 0:
-			break;
 		default:
 			usage(1);
 		}
@@ -455,8 +451,10 @@ main(int argc, char *argv[])
 					    uflag ? "udp" : "tcp");
 				}
 
-				printf("Connection to %s %s port [%s/%s] succeeded!\n",
-				    host, portlist[i], uflag ? "udp" : "tcp",
+				fprintf(stderr,
+				    "Connection to %s %s port [%s/%s] "
+				    "succeeded!\n", host, portlist[i],
+				    uflag ? "udp" : "tcp",
 				    sv ? sv->s_name : "*");
 			}
 			if (!zflag)
@@ -572,10 +570,8 @@ remote_connect(const char *host, const c
 		if (sflag || pflag) {
 			struct addrinfo ahints, *ares;
 
-#ifdef SO_BINDANY
-			/* try SO_BINDANY, but don't insist */
-			setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on));
-#endif
+			/* try IP_BINDANY, but don't insist */
+			setsockopt(s, IPPROTO_IP, IP_BINDANY, &on, sizeof(on));
 			memset(&ahints, 0, sizeof(struct addrinfo));
 			ahints.ai_family = res0->ai_family;
 			ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM;
@@ -727,10 +723,9 @@ readwrite(int nfd)
 		}
 
 		if (!dflag && pfd[1].revents & POLLIN) {
-			if ((n = read(wfd, buf, plen)) < 0 ||
-			    (oflag && n == 0)) {
+			if ((n = read(wfd, buf, plen)) < 0)
 				return;
-			} else if (n == 0) {
+			else if (n == 0) {
 				shutdown(nfd, SHUT_WR);
 				pfd[1].fd = -1;
 				pfd[1].events = 0;
@@ -749,27 +744,27 @@ atelnet(int nfd, unsigned char *buf, uns
 	unsigned char *p, *end;
 	unsigned char obuf[4];
 
-	end = buf + size;
-	obuf[0] = '\0';
+	if (size < 3)
+		return;
+	end = buf + size - 2;
 
 	for (p = buf; p < end; p++) {
 		if (*p != IAC)
-			break;
+			continue;
 
 		obuf[0] = IAC;
 		p++;
 		if ((*p == WILL) || (*p == WONT))
 			obuf[1] = DONT;
-		if ((*p == DO) || (*p == DONT))
+		else if ((*p == DO) || (*p == DONT))
 			obuf[1] = WONT;
-		if (obuf) {
-			p++;
-			obuf[2] = *p;
-			obuf[3] = '\0';
-			if (atomicio(vwrite, nfd, obuf, 3) != 3)
-				warn("Write Error!");
-			obuf[0] = '\0';
-		}
+		else
+			continue;
+
+		p++;
+		obuf[2] = *p;
+		if (atomicio(vwrite, nfd, obuf, 3) != 3)
+			warn("Write Error!");
 	}
 }
 
@@ -943,7 +938,6 @@ help(void)
 	\t-n		Suppress name/port resolutions\n\
 	\t--no-tcpopt	Disable TCP options\n\
 	\t-O length	TCP send buffer length\n\
-	\t-o		Terminate on EOF on input\n\
 	\t-P proxyuser\tUsername for proxy authentication\n\
 	\t-p port\t	Specify local port for remote connects\n\
 	\t-r		Randomize remote ports\n\
@@ -993,9 +987,9 @@ usage(int ret)
 {
 	fprintf(stderr,
 #ifdef IPSEC
-	    "usage: nc [-46DdEhklnorStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n"
+	    "usage: nc [-46DdEhklnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n"
 #else
-	    "usage: nc [-46DdhklnorStUuvz] [-I length] [-i interval] [-O length]\n"
+	    "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n"
 #endif
 	    "\t  [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS]\n"
 	    "\t  [-V fib] [-w timeout] [-X proxy_protocol]\n"

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 00:29: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 545B8106566B;
	Thu, 22 Apr 2010 00:29:37 +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 2A93E8FC08;
	Thu, 22 Apr 2010 00:29: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 o3M0Tbe2014917;
	Thu, 22 Apr 2010 00:29:37 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3M0TbqW014916;
	Thu, 22 Apr 2010 00:29:37 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004220029.o3M0TbqW014916@svn.freebsd.org>
From: Xin LI 
Date: Thu, 22 Apr 2010 00:29:37 +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: r207042 - stable/8/contrib/netcat
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, 22 Apr 2010 00:29:37 -0000

Author: delphij
Date: Thu Apr 22 00:29:36 2010
New Revision: 207042
URL: http://svn.freebsd.org/changeset/base/207042

Log:
  Remove a file that is not supposed to be part of -STABLE branch.

Deleted:
  stable/8/contrib/netcat/FREEBSD-Xlist

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 01:39: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 89C1C106566C;
	Thu, 22 Apr 2010 01:39:45 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5F95A8FC15;
	Thu, 22 Apr 2010 01:39: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 o3M1djZV030379;
	Thu, 22 Apr 2010 01:39:45 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3M1djYI030376;
	Thu, 22 Apr 2010 01:39:45 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201004220139.o3M1djYI030376@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 22 Apr 2010 01:39: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: r207046 - stable/8/sys/dev/mii
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, 22 Apr 2010 01:39:45 -0000

Author: yongari
Date: Thu Apr 22 01:39:45 2010
New Revision: 207046
URL: http://svn.freebsd.org/changeset/base/207046

Log:
  MFC r206563:
    Add Agere ET1011 PHY which is found on Belkin F5D5055 USB
    controller. Unlike Agere ET1011C, Agere ET1011 does not seem to
    need special DSP programming to workaround silicon bug.

Modified:
  stable/8/sys/dev/mii/miidevs
  stable/8/sys/dev/mii/truephy.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/geom/sched/   (props changed)

Modified: stable/8/sys/dev/mii/miidevs
==============================================================================
--- stable/8/sys/dev/mii/miidevs	Thu Apr 22 01:12:28 2010	(r207045)
+++ stable/8/sys/dev/mii/miidevs	Thu Apr 22 01:39:45 2010	(r207046)
@@ -109,6 +109,7 @@ oui xxREALTEK			0x000732
  */
 
 /* Agere Systems PHYs */
+model AGERE ET1011		0x0001 ET1011 10/100/1000baseT PHY
 model AGERE ET1011C		0x0004 ET1011C 10/100/1000baseT PHY
 
 /* Altima Communications PHYs */

Modified: stable/8/sys/dev/mii/truephy.c
==============================================================================
--- stable/8/sys/dev/mii/truephy.c	Thu Apr 22 01:12:28 2010	(r207045)
+++ stable/8/sys/dev/mii/truephy.c	Thu Apr 22 01:39:45 2010	(r207046)
@@ -76,6 +76,7 @@ static device_method_t truephy_methods[]
 };
 
 static const struct mii_phydesc truephys[] = {
+	MII_PHY_DESC(AGERE,	ET1011),
 	MII_PHY_DESC(AGERE,	ET1011C),
 	MII_PHY_END
 };
@@ -161,7 +162,10 @@ truephy_attach(device_t dev)
 
 	mii->mii_instance++;
 
-	truephy_reset(sc);
+	if (MII_MODEL(ma->mii_id2) == MII_MODEL_AGERE_ET1011)
+		mii_phy_reset(sc);
+	else
+		truephy_reset(sc);
 
 	sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
 	if (sc->mii_capabilities & BMSR_EXTSTAT) {

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 01:45: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 61272106566B;
	Thu, 22 Apr 2010 01:45:18 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 505228FC1C;
	Thu, 22 Apr 2010 01:45: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 o3M1jIB1031656;
	Thu, 22 Apr 2010 01:45:18 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3M1jIFu031653;
	Thu, 22 Apr 2010 01:45:18 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201004220145.o3M1jIFu031653@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 22 Apr 2010 01:45:18 +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: r207047 - stable/7/sys/dev/mii
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, 22 Apr 2010 01:45:18 -0000

Author: yongari
Date: Thu Apr 22 01:45:18 2010
New Revision: 207047
URL: http://svn.freebsd.org/changeset/base/207047

Log:
  MFC r206563:
    Add Agere ET1011 PHY which is found on Belkin F5D5055 USB
    controller. Unlike Agere ET1011C, Agere ET1011 does not seem to
    need special DSP programming to workaround silicon bug.

Modified:
  stable/7/sys/dev/mii/miidevs
  stable/7/sys/dev/mii/truephy.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/dev/mii/miidevs
==============================================================================
--- stable/7/sys/dev/mii/miidevs	Thu Apr 22 01:39:45 2010	(r207046)
+++ stable/7/sys/dev/mii/miidevs	Thu Apr 22 01:45:18 2010	(r207047)
@@ -107,6 +107,7 @@ oui xxREALTEK			0x000732
  */
 
 /* Agere Systems PHYs */
+model AGERE ET1011		0x0001 ET1011 10/100/1000baseT PHY
 model AGERE ET1011C		0x0004 ET1011C 10/100/1000baseT PHY
 
 /* Altima Communications PHYs */

Modified: stable/7/sys/dev/mii/truephy.c
==============================================================================
--- stable/7/sys/dev/mii/truephy.c	Thu Apr 22 01:39:45 2010	(r207046)
+++ stable/7/sys/dev/mii/truephy.c	Thu Apr 22 01:45:18 2010	(r207047)
@@ -75,6 +75,7 @@ static device_method_t truephy_methods[]
 };
 
 static const struct mii_phydesc truephys[] = {
+	MII_PHY_DESC(AGERE,	ET1011),
 	MII_PHY_DESC(AGERE,	ET1011C),
 	MII_PHY_END
 };
@@ -160,7 +161,10 @@ truephy_attach(device_t dev)
 
 	mii->mii_instance++;
 
-	truephy_reset(sc);
+	if (MII_MODEL(ma->mii_id2) == MII_MODEL_AGERE_ET1011)
+		mii_phy_reset(sc);
+	else
+		truephy_reset(sc);
 
 	sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
 	if (sc->mii_capabilities & BMSR_EXTSTAT) {

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 09:20: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 8D3E2106564A;
	Thu, 22 Apr 2010 09:20:18 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7BE438FC0C;
	Thu, 22 Apr 2010 09:20: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 o3M9KIUU032337;
	Thu, 22 Apr 2010 09:20:18 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3M9KICU032336;
	Thu, 22 Apr 2010 09:20:18 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201004220920.o3M9KICU032336@svn.freebsd.org>
From: Alexander Leidinger 
Date: Thu, 22 Apr 2010 09:20:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207056 - in head: sys/conf usr.sbin/config
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, 22 Apr 2010 09:20:18 -0000

Author: netchild
Date: Thu Apr 22 09:20:17 2010
New Revision: 207056
URL: http://svn.freebsd.org/changeset/base/207056

Log:
  Revert r206179 (by imp) and do something similar which is more consistent
  with all other corresponding CTF places by changing the corresponding
  code which is generated by config(8). Or in short, move the '@' from
  the variable definition to the use of the variable. [1]
  
  While I'm here break up a long line. [2]
  
  Discussed with:	imp [1,2], bde [2]

Modified:
  head/sys/conf/kern.pre.mk
  head/usr.sbin/config/mkmakefile.c

Modified: head/sys/conf/kern.pre.mk
==============================================================================
--- head/sys/conf/kern.pre.mk	Thu Apr 22 06:58:59 2010	(r207055)
+++ head/sys/conf/kern.pre.mk	Thu Apr 22 09:20:17 2010	(r207056)
@@ -128,7 +128,8 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${
 NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \
 	  ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c
 
-NORMAL_CTFCONVERT= @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+NORMAL_CTFCONVERT= [ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \
+		   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
 
 NORMAL_LINT=	${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC}
 

Modified: head/usr.sbin/config/mkmakefile.c
==============================================================================
--- head/usr.sbin/config/mkmakefile.c	Thu Apr 22 06:58:59 2010	(r207055)
+++ head/usr.sbin/config/mkmakefile.c	Thu Apr 22 09:20:17 2010	(r207056)
@@ -741,7 +741,7 @@ do_rules(FILE *f)
 				printf("config: don't know rules for %s\n", np);
 				break;
 			}
-			snprintf(cmd, sizeof(cmd), "${%s_%c%s}\n.if defined(NORMAL_CTFCONVERT) && !empty(NORMAL_CTFCONVERT)\n\t${NORMAL_CTFCONVERT}\n.endif", ftype,
+			snprintf(cmd, sizeof(cmd), "${%s_%c%s}\n\t@${NORMAL_CTFCONVERT}", ftype,
 			    toupper(och),
 			    ftp->f_flags & NOWERROR ? "_NOWERROR" : "");
 			compilewith = cmd;

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 09: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 D073A1065677;
	Thu, 22 Apr 2010 09:24:01 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BFB518FC0A;
	Thu, 22 Apr 2010 09: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 o3M9O19V033163;
	Thu, 22 Apr 2010 09:24:01 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3M9O1a4033162;
	Thu, 22 Apr 2010 09:24:01 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201004220924.o3M9O1a4033162@svn.freebsd.org>
From: Alexander Leidinger 
Date: Thu, 22 Apr 2010 09:24: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: r207057 - 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: Thu, 22 Apr 2010 09:24:01 -0000

Author: netchild
Date: Thu Apr 22 09:24:01 2010
New Revision: 207057
URL: http://svn.freebsd.org/changeset/base/207057

Log:
  Do the ctfmerge (= all symbols, not only symbols from one object file) for
  KLDs too.
  
  Noticed by:	np

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Thu Apr 22 09:20:17 2010	(r207056)
+++ head/sys/conf/kmod.mk	Thu Apr 22 09:24:01 2010	(r207057)
@@ -137,6 +137,10 @@ CFLAGS+=	-mlongcall -fno-omit-frame-poin
 CFLAGS+=	-G0 -fno-pic -mno-abicalls -mlong-calls
 .endif
 
+.if defined(DEBUG) || defined(DEBUG_FLAGS)
+CTFFLAGS+=	-g
+.endif
+
 .if defined(FIRMWS)
 .if !exists(@)
 ${KMOD:S/$/.c/}: @
@@ -202,6 +206,7 @@ ${KMOD}.kld: ${OBJS}
 ${FULLPROG}: ${OBJS}
 .endif
 	${LD} ${LDFLAGS} -r -d -o ${.TARGET} ${OBJS}
+	@[ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
 .if defined(EXPORT_SYMS)
 .if ${EXPORT_SYMS} != YES
 .if ${EXPORT_SYMS} == NO

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 09:30: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 011D91065670;
	Thu, 22 Apr 2010 09:30:03 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E46E28FC1A;
	Thu, 22 Apr 2010 09:30: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 o3M9U2mo034502;
	Thu, 22 Apr 2010 09:30:02 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3M9U2GS034500;
	Thu, 22 Apr 2010 09:30:02 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201004220930.o3M9U2GS034500@svn.freebsd.org>
From: Alexander Leidinger 
Date: Thu, 22 Apr 2010 09:30: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: r207058 - head
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, 22 Apr 2010 09:30:03 -0000

Author: netchild
Date: Thu Apr 22 09:30:02 2010
New Revision: 207058
URL: http://svn.freebsd.org/changeset/base/207058

Log:
  Remove explicit setting of NO_CTF in WMAKEENV and in the make call for
  the buildkernel. This way makeoptions WITH_CTF=yes not only works when
  compiling the tradtitional way, but also when using buildkernel. This
  does not enable the CTF part of the world, it still defaults to without
  CTF info.
  
  The cross/build-tools/bootstrap targets are not affected by this, they
  still have and should keep the explicit NO_CTF.
  
  Notified by:	np

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Thu Apr 22 09:24:01 2010	(r207057)
+++ head/Makefile.inc1	Thu Apr 22 09:30:02 2010	(r207058)
@@ -259,7 +259,7 @@ WMAKEENV=	${CROSSENV} \
 		VERSION="${VERSION}" \
 		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 		PATH=${TMPPATH}
-.if ${MK_CDDL} == "no" || defined(NO_CTF)
+.if ${MK_CDDL} == "no"
 WMAKEENV+=	NO_CTF=1
 .endif
 WMAKE=		${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
@@ -780,7 +780,7 @@ buildkernel:
 	@echo "--------------------------------------------------------------"
 	cd ${KRNLOBJDIR}/${_kernel}; \
 	    MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
-	    ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \
+	    ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS \
 	    -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
 # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 11:46: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 A6540106566B;
	Thu, 22 Apr 2010 11:46:42 +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 957FA8FC15;
	Thu, 22 Apr 2010 11:46: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 o3MBkgIs066839;
	Thu, 22 Apr 2010 11:46:42 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MBkg1h066837;
	Thu, 22 Apr 2010 11:46:42 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004221146.o3MBkg1h066837@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 22 Apr 2010 11:46:42 +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: r207059 - stable/8/sys/cam/scsi
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, 22 Apr 2010 11:46:42 -0000

Author: avg
Date: Thu Apr 22 11:46:42 2010
New Revision: 207059
URL: http://svn.freebsd.org/changeset/base/207059

Log:
  MFC r206648,206651: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set
  d_sectorsize and d_mediasize
  
  PR:		kern/138789

Modified:
  stable/8/sys/cam/scsi/scsi_cd.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/geom/sched/   (props changed)

Modified: stable/8/sys/cam/scsi/scsi_cd.c
==============================================================================
--- stable/8/sys/cam/scsi/scsi_cd.c	Thu Apr 22 09:30:02 2010	(r207058)
+++ stable/8/sys/cam/scsi/scsi_cd.c	Thu Apr 22 11:46:42 2010	(r207059)
@@ -2777,8 +2777,12 @@ cdcheckmedia(struct cam_periph *periph)
 		softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC);
 		cdprevent(periph, PR_ALLOW);
 		return (error);
-	} else
+	} else {
 		softc->flags |= CD_FLAG_VALID_MEDIA;
+		softc->disk->d_sectorsize = softc->params.blksize;
+		softc->disk->d_mediasize =
+		    (off_t)softc->params.blksize * softc->params.disksize;
+	}
 
 	/*
 	 * Now we check the table of contents.  This (currently) is only
@@ -2867,9 +2871,6 @@ cdcheckmedia(struct cam_periph *periph)
 	}
 
 	softc->flags |= CD_FLAG_VALID_TOC;
-	softc->disk->d_sectorsize = softc->params.blksize;
-	softc->disk->d_mediasize =
-	    (off_t)softc->params.blksize * softc->params.disksize;
 
 bailout:
 

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 12:12: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 8E365106566B;
	Thu, 22 Apr 2010 12:12:52 +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 7DB168FC12;
	Thu, 22 Apr 2010 12:12: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 o3MCCqPt072629;
	Thu, 22 Apr 2010 12:12:52 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MCCqtc072627;
	Thu, 22 Apr 2010 12:12:52 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004221212.o3MCCqtc072627@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 22 Apr 2010 12:12:52 +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: r207060 - stable/7/sys/cam/scsi
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, 22 Apr 2010 12:12:52 -0000

Author: avg
Date: Thu Apr 22 12:12:52 2010
New Revision: 207060
URL: http://svn.freebsd.org/changeset/base/207060

Log:
  MFC r206648,206651: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set
  d_sectorsize and d_mediasize
  
  Note that there is a redundant assignment of d_maxsize.
  
  PR:		kern/138789

Modified:
  stable/7/sys/cam/scsi/scsi_cd.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/cam/scsi/scsi_cd.c
==============================================================================
--- stable/7/sys/cam/scsi/scsi_cd.c	Thu Apr 22 11:46:42 2010	(r207059)
+++ stable/7/sys/cam/scsi/scsi_cd.c	Thu Apr 22 12:12:52 2010	(r207060)
@@ -2773,8 +2773,12 @@ cdcheckmedia(struct cam_periph *periph)
 		softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC);
 		cdprevent(periph, PR_ALLOW);
 		return (error);
-	} else
+	} else {
 		softc->flags |= CD_FLAG_VALID_MEDIA;
+		softc->disk->d_sectorsize = softc->params.blksize;
+		softc->disk->d_mediasize =
+		    (off_t)softc->params.blksize * softc->params.disksize;
+	}
 
 	/*
 	 * Now we check the table of contents.  This (currently) is only
@@ -2864,9 +2868,6 @@ cdcheckmedia(struct cam_periph *periph)
 
 	softc->flags |= CD_FLAG_VALID_TOC;
 	softc->disk->d_maxsize = DFLTPHYS;
-	softc->disk->d_sectorsize = softc->params.blksize;
-	softc->disk->d_mediasize =
-	    (off_t)softc->params.blksize * softc->params.disksize;
 
 bailout:
 

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 12:24: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 81E3C106566B;
	Thu, 22 Apr 2010 12:24:59 +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 71A928FC0A;
	Thu, 22 Apr 2010 12:24: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 o3MCOxP6075380;
	Thu, 22 Apr 2010 12:24:59 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MCOxcW075378;
	Thu, 22 Apr 2010 12:24:59 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004221224.o3MCOxcW075378@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 22 Apr 2010 12:24:59 +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: r207061 - stable/8/sys/geom
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, 22 Apr 2010 12:24:59 -0000

Author: avg
Date: Thu Apr 22 12:24:59 2010
New Revision: 207061
URL: http://svn.freebsd.org/changeset/base/207061

Log:
  MFC r206650: g_io_check: respond to zero pp->mediasize with ENXIO

Modified:
  stable/8/sys/geom/geom_io.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/geom/sched/   (props changed)

Modified: stable/8/sys/geom/geom_io.c
==============================================================================
--- stable/8/sys/geom/geom_io.c	Thu Apr 22 12:12:52 2010	(r207060)
+++ stable/8/sys/geom/geom_io.c	Thu Apr 22 12:24:59 2010	(r207061)
@@ -309,8 +309,8 @@ g_io_check(struct bio *bp)
 	case BIO_READ:
 	case BIO_WRITE:
 	case BIO_DELETE:
-		/* Zero sectorsize is a probably lack of media */
-		if (pp->sectorsize == 0)
+		/* Zero sectorsize or mediasize is probably a lack of media. */
+		if (pp->sectorsize == 0 || pp->mediasize == 0)
 			return (ENXIO);
 		/* Reject I/O not on sector boundary */
 		if (bp->bio_offset % pp->sectorsize)

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 12:50: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 3BFA6106566B;
	Thu, 22 Apr 2010 12:50:02 +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 2B99F8FC08;
	Thu, 22 Apr 2010 12:50: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 o3MCo2If080969;
	Thu, 22 Apr 2010 12:50:02 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MCo2Hb080967;
	Thu, 22 Apr 2010 12:50:02 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004221250.o3MCo2Hb080967@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 22 Apr 2010 12:50:02 +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: r207062 - stable/7/sys/geom
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, 22 Apr 2010 12:50:02 -0000

Author: avg
Date: Thu Apr 22 12:50:01 2010
New Revision: 207062
URL: http://svn.freebsd.org/changeset/base/207062

Log:
  MFC r206650: g_io_check: respond to zero pp->mediasize with ENXIO

Modified:
  stable/7/sys/geom/geom_io.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/geom/geom_io.c
==============================================================================
--- stable/7/sys/geom/geom_io.c	Thu Apr 22 12:24:59 2010	(r207061)
+++ stable/7/sys/geom/geom_io.c	Thu Apr 22 12:50:01 2010	(r207062)
@@ -297,8 +297,8 @@ g_io_check(struct bio *bp)
 	case BIO_READ:
 	case BIO_WRITE:
 	case BIO_DELETE:
-		/* Zero sectorsize is a probably lack of media */
-		if (pp->sectorsize == 0)
+		/* Zero sectorsize or mediasize is probably a lack of media. */
+		if (pp->sectorsize == 0 || pp->mediasize == 0)
 			return (ENXIO);
 		/* Reject I/O not on sector boundary */
 		if (bp->bio_offset % pp->sectorsize)

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 12:51: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 7A6BD1065672;
	Thu, 22 Apr 2010 12:51:55 +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 21A878FC20;
	Thu, 22 Apr 2010 12:51:53 +0000 (UTC)
Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua
	[212.40.38.101])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA05178;
	Thu, 22 Apr 2010 15:51:52 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Message-ID: <4BD04667.6020903@freebsd.org>
Date: Thu, 22 Apr 2010 15:51:51 +0300
From: Andriy Gapon 
User-Agent: Thunderbird 2.0.0.24 (X11/20100319)
MIME-Version: 1.0
To: src-committers@freebsd.org
References: <201004221224.o3MCOxcW075378@svn.freebsd.org>
In-Reply-To: <201004221224.o3MCOxcW075378@svn.freebsd.org>
X-Enigmail-Version: 0.95.7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r207061 - stable/8/sys/geom
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, 22 Apr 2010 12:51:55 -0000

on 22/04/2010 15:24 Andriy Gapon said the following:
> Author: avg
> Date: Thu Apr 22 12:24:59 2010
> New Revision: 207061
> URL: http://svn.freebsd.org/changeset/base/207061
> 
> Log:
>   MFC r206650: g_io_check: respond to zero pp->mediasize with ENXIO
> 
> Modified:
>   stable/8/sys/geom/geom_io.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/geom/sched/   (props changed)
             ^^^^^^^^^^^^^^^
I am not sure where the above came from and if its mergeinfo can be pushed up to sys.

-- 
Andriy Gapon

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 13:16: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 8B271106566B;
	Thu, 22 Apr 2010 13:16:18 +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 7AE6C8FC29;
	Thu, 22 Apr 2010 13:16: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 o3MDGI5c086895;
	Thu, 22 Apr 2010 13:16:18 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MDGIPF086893;
	Thu, 22 Apr 2010 13:16:18 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004221316.o3MDGIPF086893@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 22 Apr 2010 13:16: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: r207063 - stable/8/usr.bin/indent
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, 22 Apr 2010 13:16:18 -0000

Author: avg
Date: Thu Apr 22 13:16:18 2010
New Revision: 207063
URL: http://svn.freebsd.org/changeset/base/207063

Log:
  MFC r206687: indent(1): don't treat bare '_t' as a type name with -ta

Modified:
  stable/8/usr.bin/indent/lexi.c
Directory Properties:
  stable/8/usr.bin/indent/   (props changed)

Modified: stable/8/usr.bin/indent/lexi.c
==============================================================================
--- stable/8/usr.bin/indent/lexi.c	Thu Apr 22 12:50:01 2010	(r207062)
+++ stable/8/usr.bin/indent/lexi.c	Thu Apr 22 13:16:18 2010	(r207063)
@@ -251,9 +251,10 @@ lexi(void)
 
 	if (auto_typedefs) {
 	    const char *q = s_token;
+	    size_t q_len = strlen(q);
 	    /* Check if we have an "_t" in the end */
-	    if (q[0] && q[1] &&
-	        (strcmp(q + strlen(q) - 2, "_t") == 0)) {
+	    if (q_len > 2 &&
+	        (strcmp(q + q_len - 2, "_t") == 0)) {
 	        ps.its_a_keyword = true;
 		ps.last_u_d = true;
 	        goto found_auto_typedef;

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 14: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 6C2B21065675;
	Thu, 22 Apr 2010 14:11:59 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5B4DD8FC27;
	Thu, 22 Apr 2010 14:11: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 o3MEBxDX099221;
	Thu, 22 Apr 2010 14:11:59 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MEBxus099219;
	Thu, 22 Apr 2010 14:11:59 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201004221411.o3MEBxus099219@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 22 Apr 2010 14:11:59 +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: r207064 - stable/8/contrib/top
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, 22 Apr 2010 14:11:59 -0000

Author: nwhitehorn
Date: Thu Apr 22 14:11:59 2010
New Revision: 207064
URL: http://svn.freebsd.org/changeset/base/207064

Log:
  MFC r206842:
  
  Fix brokenness in top on big-endian 32-bit systems introduced when
  changing format_k2 to take a long long. Because itoa is defined as a K&R
  C function, without prototyping its arguments, format_k2 passed a 64-bit
  value, but itoa() received only the first word, showing '0' in all memory
  fields.

Modified:
  stable/8/contrib/top/utils.c
Directory Properties:
  stable/8/contrib/top/   (props changed)
  stable/8/contrib/top/install-sh   (props changed)

Modified: stable/8/contrib/top/utils.c
==============================================================================
--- stable/8/contrib/top/utils.c	Thu Apr 22 13:16:18 2010	(r207063)
+++ stable/8/contrib/top/utils.c	Thu Apr 22 14:11:59 2010	(r207064)
@@ -499,7 +499,7 @@ unsigned long long amt;
 	}
     }
 
-    p = strecpy(p, itoa(amt));
+    p = strecpy(p, itoa((int)amt));
     *p++ = tag;
     *p = '\0';
 

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 14:13: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 718C61065672;
	Thu, 22 Apr 2010 14:13:12 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C3468FC1F;
	Thu, 22 Apr 2010 14:13:12 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by
	smtpauth3.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009)) id <0L1A00G1C7HZO500@smtpauth3.wiscmail.wisc.edu>; Thu,
	22 Apr 2010 09:13:11 -0500 (CDT)
Received: from comporellon.tachypleus.net ([unknown] [76.210.66.137])
	by smtpauth3.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009))
	with ESMTPSA id <0L1A00CPJ7HVO160@smtpauth3.wiscmail.wisc.edu>; Thu,
	22 Apr 2010 09:13:08 -0500 (CDT)
Date: Thu, 22 Apr 2010 09:13:03 -0500
From: Nathan Whitehorn 
In-reply-to: <201004211801.59151.bruce@cran.org.uk>
To: Bruce Cran 
Message-id: <4BD0596F.7060209@freebsd.org>
X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.66.137
X-Spam-PmxInfo: Server=avs-11, Version=5.5.5.374460,
	Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.4.22.140615,
	SenderIP=76.210.66.137
References: <201004202019.o3KKJJih033338@svn.freebsd.org>
	<20100420210208.GA2422@deviant.kiev.zoral.com.ua>
	<201004211801.59151.bruce@cran.org.uk>
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9)
	Gecko/20100407 Thunderbird/3.0.4
Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org,
	svn-src-all@freebsd.org, svn-src-stable-8@freebsd.org,
	Bruce Cran , Kostik Belousov 
Subject: Re: svn commit: r206911 - stable/8/contrib/top
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, 22 Apr 2010 14:13:12 -0000

On 04/21/10 12:01, Bruce Cran wrote:
> On Tuesday 20 April 2010 22:02:08 Kostik Belousov wrote:
>    
>> On Tue, Apr 20, 2010 at 08:19:19PM +0000, Bruce Cran wrote:
>>      
>>> Author: brucec
>>> Date: Tue Apr 20 20:19:19 2010
>>> New Revision: 206911
>>> URL: http://svn.freebsd.org/changeset/base/206911
>>>
>>> Log:
>>>    MFC r205119 and r206056:
>>>
>>>    Prevent the SIZE field being corrupted when a process allocates more
>>>    than 2TB.
>>>
>>>    PR:	bin/129706
>>>    Submitted by:	brucec
>>>    Approved by: 	rrs (mentor)
>>>        
>> Am I right that this change contains a bug that was fixed by r206842 ?
>> If yes, why is it merged as is ?
>>      
> Yes, it looks like it does have a bug. I was unaware of it when I did the
> merge.
>    

I have MFC'ed the bug fix. There's a possibility it is still broken on 
32-bit big-endian MIPS, which I hope to check up on soon.
-Nathan


From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 14:54: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 96D321065672;
	Thu, 22 Apr 2010 14:54:54 +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 7BDD68FC1E;
	Thu, 22 Apr 2010 14:54: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 o3MEssOo008951;
	Thu, 22 Apr 2010 14:54:54 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MEssYE008949;
	Thu, 22 Apr 2010 14:54:54 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201004221454.o3MEssYE008949@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Thu, 22 Apr 2010 14:54:54 +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: r207065 - stable/7/sys/geom
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, 22 Apr 2010 14:54:54 -0000

Author: jh
Date: Thu Apr 22 14:54:54 2010
New Revision: 207065
URL: http://svn.freebsd.org/changeset/base/207065

Log:
  MFC r205385:
  
  Escape characters unsafe for XML output in GEOM class, instance and
  provider names.
  
  - Characters in range 0x01-0x1f except '\t', '\n', and '\r' are replaced
    with '?'. Those characters are disallowed in XML.
  - '&', '<', '>', '\'', '"' and characters in range 0x7f-0xff are
    replaced with XML numeric character reference.
  
  If the kern.geom.confxml sysctl provides invalid XML, libgeom
  geom_xml2tree() fails and utilities using it do not work. Unsafe
  characters are common in msdosfs and cd9660 labels.
  
  PR:		kern/104389

Modified:
  stable/7/sys/geom/geom_dump.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/geom/geom_dump.c
==============================================================================
--- stable/7/sys/geom/geom_dump.c	Thu Apr 22 14:11:59 2010	(r207064)
+++ stable/7/sys/geom/geom_dump.c	Thu Apr 22 14:54:54 2010	(r207065)
@@ -154,6 +154,28 @@ g_conftxt(void *p, int flag)
 
 
 static void
+g_conf_print_escaped(struct sbuf *sb, const char *fmt, const char *str)
+{
+	struct sbuf *s;
+	const u_char *c;
+
+	s = sbuf_new_auto();
+
+	for (c = str; *c != '\0'; c++) {
+		if (*c == '&' || *c == '<' || *c == '>' ||
+		    *c == '\'' || *c == '"' || *c > 0x7e)
+			sbuf_printf(s, "&#x%X;", *c);
+		else if (*c == '\t' || *c == '\n' || *c == '\r' || *c > 0x1f)
+			sbuf_putc(s, *c);
+		else
+			sbuf_putc(s, '?');
+	}
+	sbuf_finish(s);
+	sbuf_printf(sb, fmt, sbuf_data(s));
+	sbuf_delete(s);
+}
+
+static void
 g_conf_consumer(struct sbuf *sb, struct g_consumer *cp)
 {
 
@@ -181,7 +203,7 @@ g_conf_provider(struct sbuf *sb, struct 
 	sbuf_printf(sb, "\t  \n", pp->geom);
 	sbuf_printf(sb, "\t  r%dw%de%d\n",
 	    pp->acr, pp->acw, pp->ace);
-	sbuf_printf(sb, "\t  %s\n", pp->name);
+	g_conf_print_escaped(sb, "\t  %s\n", pp->name);
 	sbuf_printf(sb, "\t  %jd\n",
 	    (intmax_t)pp->mediasize);
 	sbuf_printf(sb, "\t  %u\n", pp->sectorsize);
@@ -204,7 +226,7 @@ g_conf_geom(struct sbuf *sb, struct g_ge
 
 	sbuf_printf(sb, "    \n", gp);
 	sbuf_printf(sb, "      \n", gp->class);
-	sbuf_printf(sb, "      %s\n", gp->name);
+	g_conf_print_escaped(sb, "      %s\n", gp->name);
 	sbuf_printf(sb, "      %d\n", gp->rank);
 	if (gp->flags & G_GEOM_WITHER)
 		sbuf_printf(sb, "      \n");
@@ -233,7 +255,7 @@ g_conf_class(struct sbuf *sb, struct g_c
 	struct g_geom *gp2;
 
 	sbuf_printf(sb, "  \n", mp);
-	sbuf_printf(sb, "    %s\n", mp->name);
+	g_conf_print_escaped(sb, "    %s\n", mp->name);
 	LIST_FOREACH(gp2, &mp->geom, geom) {
 		if (gp != NULL && gp != gp2)
 			continue;

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 18:21: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 1E7A7106564A;
	Thu, 22 Apr 2010 18:21:26 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0BF898FC21;
	Thu, 22 Apr 2010 18:21: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 o3MILQpl054565;
	Thu, 22 Apr 2010 18:21:26 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MILP0q054543;
	Thu, 22 Apr 2010 18:21:25 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <201004221821.o3MILP0q054543@svn.freebsd.org>
From: Robert Noland 
Date: Thu, 22 Apr 2010 18:21: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: r207066 - head/sys/dev/drm
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, 22 Apr 2010 18:21:26 -0000

Author: rnoland
Date: Thu Apr 22 18:21:25 2010
New Revision: 207066
URL: http://svn.freebsd.org/changeset/base/207066

Log:
  Rework how drm maps are handled.
  
   * On 32 bit platforms we steal the upper 4 bits of the map handle
     to store a unique map id.
   * On 64 bit platforms we steal the upper 24 bits.
  
  Resolves issues where the offsets that are handed to mmap may overlap the VRAM on some cards.
  
  Tested on: radeon, intel, mga, and via.
  
  This will break nouveau.  I will spin new patches shortly.

Modified:
  head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_bufs.c
  head/sys/dev/drm/drm_context.c
  head/sys/dev/drm/drm_drv.c
  head/sys/dev/drm/drm_memory.c
  head/sys/dev/drm/drm_scatter.c
  head/sys/dev/drm/drm_sysctl.c
  head/sys/dev/drm/drm_vm.c
  head/sys/dev/drm/i915_dma.c
  head/sys/dev/drm/mach64_dma.c
  head/sys/dev/drm/mga_dma.c
  head/sys/dev/drm/mga_warp.c
  head/sys/dev/drm/r128_cce.c
  head/sys/dev/drm/r128_state.c
  head/sys/dev/drm/r600_blit.c
  head/sys/dev/drm/r600_cp.c
  head/sys/dev/drm/radeon_cp.c
  head/sys/dev/drm/radeon_cs.c
  head/sys/dev/drm/radeon_state.c
  head/sys/dev/drm/savage_bci.c
  head/sys/dev/drm/via_dma.c
  head/sys/dev/drm/via_map.c
  head/sys/dev/drm/via_mm.c

Modified: head/sys/dev/drm/drmP.h
==============================================================================
--- head/sys/dev/drm/drmP.h	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/drmP.h	Thu Apr 22 18:21:25 2010	(r207066)
@@ -239,22 +239,22 @@ typedef u_int8_t u8;
 #define DRM_MEMORYBARRIER()		mb()
 
 #define DRM_READ8(map, offset)						\
-	*(volatile u_int8_t *)(((vm_offset_t)(map)->handle) +		\
+	*(volatile u_int8_t *)(((vm_offset_t)(map)->virtual) +		\
 	    (vm_offset_t)(offset))
 #define DRM_READ16(map, offset)						\
-	*(volatile u_int16_t *)(((vm_offset_t)(map)->handle) +		\
+	*(volatile u_int16_t *)(((vm_offset_t)(map)->virtual) +		\
 	    (vm_offset_t)(offset))
 #define DRM_READ32(map, offset)						\
-	*(volatile u_int32_t *)(((vm_offset_t)(map)->handle) +		\
+	*(volatile u_int32_t *)(((vm_offset_t)(map)->virtual) +		\
 	    (vm_offset_t)(offset))
 #define DRM_WRITE8(map, offset, val)					\
-	*(volatile u_int8_t *)(((vm_offset_t)(map)->handle) +		\
+	*(volatile u_int8_t *)(((vm_offset_t)(map)->virtual) +		\
 	    (vm_offset_t)(offset)) = val
 #define DRM_WRITE16(map, offset, val)					\
-	*(volatile u_int16_t *)(((vm_offset_t)(map)->handle) +		\
+	*(volatile u_int16_t *)(((vm_offset_t)(map)->virtual) +		\
 	    (vm_offset_t)(offset)) = val
 #define DRM_WRITE32(map, offset, val)					\
-	*(volatile u_int32_t *)(((vm_offset_t)(map)->handle) +		\
+	*(volatile u_int32_t *)(((vm_offset_t)(map)->virtual) +		\
 	    (vm_offset_t)(offset)) = val
 
 #define DRM_VERIFYAREA_READ( uaddr, size )		\
@@ -481,18 +481,21 @@ typedef struct drm_sg_mem {
 	struct drm_dma_handle	 *dmah;		/* Handle to PCI memory  */
 } drm_sg_mem_t;
 
+#define DRM_MAP_HANDLE_BITS	(sizeof(void *) == 4 ? 4 : 24)
+#define DRM_MAP_HANDLE_SHIFT	(sizeof(void *) * 8 - DRM_MAP_HANDLE_BITS)
 typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t;
 
 typedef struct drm_local_map {
-	unsigned long	offset;	 /* Physical address (0 for SAREA)*/
-	unsigned long	size;	 /* Physical size (bytes)	    */
-	enum drm_map_type	type;	 /* Type of memory mapped		    */
-	enum drm_map_flags	flags;	 /* Flags				    */
-	void		*handle; /* User-space: "Handle" to pass to mmap    */
-				 /* Kernel-space: kernel-virtual address    */
-	int		mtrr;	 /* Boolean: MTRR used */
-				 /* Private data			    */
-	int		rid;	 /* PCI resource ID for bus_space */
+	unsigned long offset;	  /* Physical address (0 for SAREA)       */
+	unsigned long size;	  /* Physical size (bytes)                */
+	enum drm_map_type type;	  /* Type of memory mapped                */
+	enum drm_map_flags flags; /* Flags                                */
+	void *handle;		  /* User-space: "Handle" to pass to mmap */
+				  /* Kernel-space: kernel-virtual address */
+	int mtrr;		  /* Boolean: MTRR used                   */
+				  /* Private data                         */
+	int rid;		  /* PCI resource ID for bus_space        */
+	void *virtual;		  /* Kernel-space: kernel-virtual address */
 	struct resource *bsr;
 	bus_space_tag_t bst;
 	bus_space_handle_t bsh;
@@ -643,6 +646,7 @@ struct drm_device {
 
 	/* Linked list of mappable regions. Protected by dev_lock */
 	drm_map_list_t	  maplist;
+	struct unrhdr	  *map_unrhdr;
 
 	drm_local_map_t	  **context_sareas;
 	int		  max_context;
@@ -973,17 +977,17 @@ drm_free(void *pt, size_t size, struct m
 static __inline__ void
 drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev)
 {
-	map->handle = drm_ioremap_wc(dev, map);
+	map->virtual = drm_ioremap_wc(dev, map);
 }
 static __inline__ void
 drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev)
 {
-	map->handle = drm_ioremap(dev, map);
+	map->virtual = drm_ioremap(dev, map);
 }
 static __inline__ void
 drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev)
 {
-	if ( map->handle && map->size )
+	if ( map->virtual && map->size )
 		drm_ioremapfree(map);
 }
 
@@ -994,7 +998,7 @@ drm_core_findmap(struct drm_device *dev,
 
 	DRM_SPINLOCK_ASSERT(&dev->dev_lock);
 	TAILQ_FOREACH(map, &dev->maplist, link) {
-		if (map->offset == offset)
+		if (offset == (unsigned long)map->handle)
 			return map;
 	}
 	return NULL;

Modified: head/sys/dev/drm/drm_bufs.c
==============================================================================
--- head/sys/dev/drm/drm_bufs.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/drm_bufs.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -156,10 +156,12 @@ int drm_addmap(struct drm_device * dev, 
 	map->size = size;
 	map->type = type;
 	map->flags = flags;
+	map->handle = (void *)((unsigned long)alloc_unr(dev->map_unrhdr) <<
+	    DRM_MAP_HANDLE_SHIFT);
 
 	switch (map->type) {
 	case _DRM_REGISTERS:
-		map->handle = drm_ioremap(dev, map);
+		map->virtual = drm_ioremap(dev, map);
 		if (!(map->flags & _DRM_WRITE_COMBINING))
 			break;
 		/* FALLTHROUGH */
@@ -168,25 +170,25 @@ int drm_addmap(struct drm_device * dev, 
 			map->mtrr = 1;
 		break;
 	case _DRM_SHM:
-		map->handle = malloc(map->size, DRM_MEM_MAPS, M_NOWAIT);
+		map->virtual = malloc(map->size, DRM_MEM_MAPS, M_NOWAIT);
 		DRM_DEBUG("%lu %d %p\n",
-		    map->size, drm_order(map->size), map->handle);
-		if (!map->handle) {
+		    map->size, drm_order(map->size), map->virtual);
+		if (!map->virtual) {
 			free(map, DRM_MEM_MAPS);
 			DRM_LOCK();
 			return ENOMEM;
 		}
-		map->offset = (unsigned long)map->handle;
+		map->offset = (unsigned long)map->virtual;
 		if (map->flags & _DRM_CONTAINS_LOCK) {
 			/* Prevent a 2nd X Server from creating a 2nd lock */
 			DRM_LOCK();
 			if (dev->lock.hw_lock != NULL) {
 				DRM_UNLOCK();
-				free(map->handle, DRM_MEM_MAPS);
+				free(map->virtual, DRM_MEM_MAPS);
 				free(map, DRM_MEM_MAPS);
 				return EBUSY;
 			}
-			dev->lock.hw_lock = map->handle; /* Pointer to lock */
+			dev->lock.hw_lock = map->virtual; /* Pointer to lock */
 			DRM_UNLOCK();
 		}
 		break;
@@ -224,7 +226,8 @@ int drm_addmap(struct drm_device * dev, 
 			DRM_LOCK();
 			return EINVAL;
 		}
-		map->offset += dev->sg->handle;
+		map->virtual = (void *)(dev->sg->handle + offset);
+		map->offset = dev->sg->handle + offset;
 		break;
 	case _DRM_CONSISTENT:
 		/* Unfortunately, we don't get any alignment specification from
@@ -242,7 +245,7 @@ int drm_addmap(struct drm_device * dev, 
 			DRM_LOCK();
 			return ENOMEM;
 		}
-		map->handle = map->dmah->vaddr;
+		map->virtual = map->dmah->vaddr;
 		map->offset = map->dmah->busaddr;
 		break;
 	default:
@@ -291,11 +294,7 @@ int drm_addmap_ioctl(struct drm_device *
 	request->type = map->type;
 	request->flags = map->flags;
 	request->mtrr   = map->mtrr;
-	request->handle = map->handle;
-
-	if (request->type != _DRM_SHM) {
-		request->handle = (void *)request->offset;
-	}
+	request->handle = (void *)map->handle;
 
 	return 0;
 }
@@ -324,7 +323,7 @@ void drm_rmmap(struct drm_device *dev, d
 		}
 		break;
 	case _DRM_SHM:
-		free(map->handle, DRM_MEM_MAPS);
+		free(map->virtual, DRM_MEM_MAPS);
 		break;
 	case _DRM_AGP:
 	case _DRM_SCATTER_GATHER:
@@ -342,6 +341,12 @@ void drm_rmmap(struct drm_device *dev, d
 		    map->bsr);
 	}
 
+	DRM_UNLOCK();
+	if (map->handle)
+		free_unr(dev->map_unrhdr, (unsigned long)map->handle >>
+		    DRM_MAP_HANDLE_SHIFT);
+	DRM_LOCK();
+
 	free(map, DRM_MEM_MAPS);
 }
 
@@ -1054,7 +1059,7 @@ int drm_mapbufs(struct drm_device *dev, 
 			goto done;
 		}
 		size = round_page(map->size);
-		foff = map->offset;
+		foff = (unsigned long)map->handle;
 	} else {
 		size = round_page(dma->byte_count),
 		foff = 0;

Modified: head/sys/dev/drm/drm_context.c
==============================================================================
--- head/sys/dev/drm/drm_context.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/drm_context.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -147,7 +147,7 @@ int drm_getsareactx(struct drm_device *d
 	map = dev->context_sareas[request->ctx_id];
 	DRM_UNLOCK();
 
-	request->handle = map->handle;
+	request->handle = (void *)map->handle;
 
 	return 0;
 }

Modified: head/sys/dev/drm/drm_drv.c
==============================================================================
--- head/sys/dev/drm/drm_drv.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/drm_drv.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -434,6 +434,12 @@ static int drm_load(struct drm_device *d
 	DRM_DEBUG("\n");
 
 	TAILQ_INIT(&dev->maplist);
+	dev->map_unrhdr = new_unrhdr(1, ((1 << DRM_MAP_HANDLE_BITS) - 1), NULL);
+	if (dev->map_unrhdr == NULL) {
+		DRM_ERROR("Couldn't allocate map number allocator\n");
+		return EINVAL;
+	}
+
 
 	drm_mem_init();
 	drm_sysctl_init(dev);
@@ -565,6 +571,7 @@ static void drm_unload(struct drm_device
 	}
 
 	delete_unrhdr(dev->drw_unrhdr);
+	delete_unrhdr(dev->map_unrhdr);
 
 	drm_mem_uninit();
 

Modified: head/sys/dev/drm/drm_memory.c
==============================================================================
--- head/sys/dev/drm/drm_memory.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/drm_memory.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -83,7 +83,7 @@ void *drm_ioremap(struct drm_device *dev
 
 void drm_ioremapfree(drm_local_map_t *map)
 {
-	pmap_unmapdev((vm_offset_t) map->handle, map->size);
+	pmap_unmapdev((vm_offset_t) map->virtual, map->size);
 }
 
 int

Modified: head/sys/dev/drm/drm_scatter.c
==============================================================================
--- head/sys/dev/drm/drm_scatter.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/drm_scatter.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -100,11 +100,14 @@ drm_sg_alloc(struct drm_device *dev, str
 	dev->sg = entry;
 	DRM_UNLOCK();
 
-	DRM_DEBUG("handle=%08lx, kva=%p, contents=%08lx\n", entry->handle,
-	    entry->virtual, *(unsigned long *)entry->virtual);
+	pmap_change_attr((vm_offset_t)dmah->vaddr, request->size,
+	    PAT_WRITE_COMBINING);
 
 	request->handle = entry->handle;
 
+	DRM_DEBUG("handle=%08lx, kva=%p, contents=%08lx\n", entry->handle,
+	    entry->virtual, *(unsigned long *)entry->virtual);
+
 	return 0;
 }
 

Modified: head/sys/dev/drm/drm_sysctl.c
==============================================================================
--- head/sys/dev/drm/drm_sysctl.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/drm_sysctl.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -188,7 +188,7 @@ static int drm_vm_info DRM_SYSCTL_HANDLE
 	DRM_UNLOCK();
 
 	DRM_SYSCTL_PRINT("\nslot offset	        size       "
-	    "type flags address            mtrr\n");
+	    "type flags address            handle mtrr\n");
 
 	for (i = 0; i < mapcount; i++) {
 		map = &tempmaps[i];
@@ -204,9 +204,11 @@ static int drm_vm_info DRM_SYSCTL_HANDLE
 			yesno = "yes";
 
 		DRM_SYSCTL_PRINT(
-		    "%4d 0x%016lx 0x%08lx %4.4s  0x%02x 0x%016lx %s\n", i,
-		    map->offset, map->size, type, map->flags,
-		    (unsigned long)map->handle, yesno);
+		    "%4d 0x%016lx 0x%08lx %4.4s  0x%02x 0x%016lx %6d %s\n",
+		    i, map->offset, map->size, type, map->flags,
+		    (unsigned long)map->virtual,
+		    (unsigned int)((unsigned long)map->handle >>
+		    DRM_MAP_HANDLE_SHIFT), yesno);
 	}
 	SYSCTL_OUT(req, "", 1);
 

Modified: head/sys/dev/drm/drm_vm.c
==============================================================================
--- head/sys/dev/drm/drm_vm.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/drm_vm.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -54,6 +54,7 @@ int drm_mmap(struct cdev *kdev, vm_ooffs
 	if (file_priv && !file_priv->authenticated)
 		return EACCES;
 
+	DRM_DEBUG("called with offset %016jx\n", offset);
 	if (dev->dma && offset < ptoa(dev->dma->page_count)) {
 		drm_device_dma_t *dma = dev->dma;
 
@@ -72,31 +73,31 @@ int drm_mmap(struct cdev *kdev, vm_ooffs
 		}
 	}
 
-				/* A sequential search of a linked list is
-				   fine here because: 1) there will only be
-				   about 5-10 entries in the list and, 2) a
-				   DRI client only has to do this mapping
-				   once, so it doesn't have to be optimized
-				   for performance, even if the list was a
-				   bit longer. */
+	/* A sequential search of a linked list is
+	   fine here because: 1) there will only be
+	   about 5-10 entries in the list and, 2) a
+	   DRI client only has to do this mapping
+	   once, so it doesn't have to be optimized
+	   for performance, even if the list was a
+	   bit longer.
+	*/
 	DRM_LOCK();
 	TAILQ_FOREACH(map, &dev->maplist, link) {
-		if (offset >= map->offset && offset < map->offset + map->size)
+		if (offset >> DRM_MAP_HANDLE_SHIFT ==
+		    (unsigned long)map->handle >> DRM_MAP_HANDLE_SHIFT)
 			break;
 	}
 
 	if (map == NULL) {
-		DRM_DEBUG("Can't find map, requested offset = %016lx\n",
-		    (unsigned long)offset);
+		DRM_DEBUG("Can't find map, request offset = %016jx\n", offset);
 		TAILQ_FOREACH(map, &dev->maplist, link) {
 			DRM_DEBUG("map offset = %016lx, handle = %016lx\n",
-			    (unsigned long)map->offset,
-			    (unsigned long)map->handle);
+			    map->offset, (unsigned long)map->handle);
 		}
 		DRM_UNLOCK();
 		return -1;
 	}
-	if (((map->flags&_DRM_RESTRICTED) && !DRM_SUSER(DRM_CURPROC))) {
+	if (((map->flags & _DRM_RESTRICTED) && !DRM_SUSER(DRM_CURPROC))) {
 		DRM_UNLOCK();
 		DRM_DEBUG("restricted map\n");
 		return -1;
@@ -104,18 +105,22 @@ int drm_mmap(struct cdev *kdev, vm_ooffs
 	type = map->type;
 	DRM_UNLOCK();
 
+	offset = offset & ((1ULL << DRM_MAP_HANDLE_SHIFT) - 1);
+
 	switch (type) {
 	case _DRM_FRAME_BUFFER:
-	case _DRM_REGISTERS:
 	case _DRM_AGP:
-		phys = offset;
-		break;
-	case _DRM_CONSISTENT:
-		phys = vtophys((char *)map->handle + (offset - map->offset));
+		*memattr = VM_MEMATTR_WRITE_COMBINING;
+		/* FALLTHROUGH */
+	case _DRM_REGISTERS:
+		phys = map->offset + offset;
 		break;
 	case _DRM_SCATTER_GATHER:
+		*memattr = VM_MEMATTR_WRITE_COMBINING;
+		/* FALLTHROUGH */
+	case _DRM_CONSISTENT:
 	case _DRM_SHM:
-		phys = vtophys(offset);
+		phys = vtophys((char *)map->virtual + offset);
 		break;
 	default:
 		DRM_ERROR("bad map type %d\n", type);

Modified: head/sys/dev/drm/i915_dma.c
==============================================================================
--- head/sys/dev/drm/i915_dma.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/i915_dma.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -151,7 +151,7 @@ static int i915_dma_cleanup(struct drm_d
 	if (dev_priv->ring.virtual_start) {
 		drm_core_ioremapfree(&dev_priv->ring.map, dev);
 		dev_priv->ring.virtual_start = NULL;
-		dev_priv->ring.map.handle = NULL;
+		dev_priv->ring.map.virtual = NULL;
 		dev_priv->ring.map.size = 0;
 	}
 
@@ -174,7 +174,7 @@ static int i915_initialize(struct drm_de
 	}
 
 	dev_priv->sarea_priv = (drm_i915_sarea_t *)
-	    ((u8 *) dev_priv->sarea->handle + init->sarea_priv_offset);
+	    ((u8 *) dev_priv->sarea->virtual + init->sarea_priv_offset);
 
 	if (init->ring_size != 0) {
 		if (dev_priv->ring.ring_obj != NULL) {
@@ -195,7 +195,7 @@ static int i915_initialize(struct drm_de
 
 		drm_core_ioremap_wc(&dev_priv->ring.map, dev);
 
-		if (dev_priv->ring.map.handle == NULL) {
+		if (dev_priv->ring.map.virtual == NULL) {
 			i915_dma_cleanup(dev);
 			DRM_ERROR("can not ioremap virtual address for"
 				  " ring buffer\n");
@@ -203,7 +203,7 @@ static int i915_initialize(struct drm_de
 		}
 	}
 
-	dev_priv->ring.virtual_start = dev_priv->ring.map.handle;
+	dev_priv->ring.virtual_start = dev_priv->ring.map.virtual;
 
 	dev_priv->cpp = init->cpp;
 	dev_priv->back_offset = init->back_offset;
@@ -229,7 +229,7 @@ static int i915_dma_resume(struct drm_de
 		return -EINVAL;
 	}
 
-	if (dev_priv->ring.map.handle == NULL) {
+	if (dev_priv->ring.map.virtual == NULL) {
 		DRM_ERROR("can not ioremap virtual address for"
 			  " ring buffer\n");
 		return -ENOMEM;
@@ -823,14 +823,14 @@ static int i915_set_status_page(struct d
 	dev_priv->hws_map.mtrr = 0;
 
 	drm_core_ioremap_wc(&dev_priv->hws_map, dev);
-	if (dev_priv->hws_map.handle == NULL) {
+	if (dev_priv->hws_map.virtual == NULL) {
 		i915_dma_cleanup(dev);
 		dev_priv->status_gfx_addr = 0;
 		DRM_ERROR("can not ioremap virtual address for"
 				" G33 hw status page\n");
 		return -ENOMEM;
 	}
-	dev_priv->hw_status_page = dev_priv->hws_map.handle;
+	dev_priv->hw_status_page = dev_priv->hws_map.virtual;
 
 	memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
 	I915_WRITE(HWS_PGA, dev_priv->status_gfx_addr);

Modified: head/sys/dev/drm/mach64_dma.c
==============================================================================
--- head/sys/dev/drm/mach64_dma.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/mach64_dma.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -1078,11 +1078,11 @@ static int mach64_do_dma_init(struct drm
 	}
 
 	dev_priv->sarea_priv = (drm_mach64_sarea_t *)
-	    ((u8 *) dev_priv->sarea->handle + init->sarea_priv_offset);
+	    ((u8 *) dev_priv->sarea->virtual + init->sarea_priv_offset);
 
 	if (!dev_priv->is_pci) {
 		drm_core_ioremap(dev_priv->ring_map, dev);
-		if (!dev_priv->ring_map->handle) {
+		if (!dev_priv->ring_map->virtual) {
 			DRM_ERROR("can not ioremap virtual address for"
 				  " descriptor ring\n");
 			dev->dev_private = (void *)dev_priv;
@@ -1103,7 +1103,7 @@ static int mach64_do_dma_init(struct drm
 		dev_priv->dev_buffers = dev->agp_buffer_map;
 
 		drm_core_ioremap(dev->agp_buffer_map, dev);
-		if (!dev->agp_buffer_map->handle) {
+		if (!dev->agp_buffer_map->virtual) {
 			DRM_ERROR("can not ioremap virtual address for"
 				  " dma buffer\n");
 			dev->dev_private = (void *)dev_priv;
@@ -1147,7 +1147,7 @@ static int mach64_do_dma_init(struct drm
 	}
 
 	dev_priv->ring.size = 0x4000;	/* 16KB */
-	dev_priv->ring.start = dev_priv->ring_map->handle;
+	dev_priv->ring.start = dev_priv->ring_map->virtual;
 	dev_priv->ring.start_addr = (u32) dev_priv->ring_map->offset;
 
 	memset(dev_priv->ring.start, 0, dev_priv->ring.size);

Modified: head/sys/dev/drm/mga_dma.c
==============================================================================
--- head/sys/dev/drm/mga_dma.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/mga_dma.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -585,11 +585,11 @@ static int mga_do_agp_dma_bootstrap(stru
 	drm_core_ioremap(dev_priv->primary, dev);
 	drm_core_ioremap(dev->agp_buffer_map, dev);
 
-	if (!dev_priv->warp->handle ||
-	    !dev_priv->primary->handle || !dev->agp_buffer_map->handle) {
+	if (!dev_priv->warp->virtual ||
+	    !dev_priv->primary->virtual || !dev->agp_buffer_map->virtual) {
 		DRM_ERROR("failed to ioremap agp regions! (%p, %p, %p)\n",
-			  dev_priv->warp->handle, dev_priv->primary->handle,
-			  dev->agp_buffer_map->handle);
+			  dev_priv->warp->virtual, dev_priv->primary->virtual,
+			  dev->agp_buffer_map->virtual);
 		return -ENOMEM;
 	}
 
@@ -878,14 +878,14 @@ static int mga_do_init_dma(struct drm_de
 	}
 
 	dev_priv->sarea_priv =
-	    (drm_mga_sarea_t *) ((u8 *) dev_priv->sarea->handle +
+	    (drm_mga_sarea_t *) ((u8 *) dev_priv->sarea->virtual +
 				 init->sarea_priv_offset);
 
-	if (!dev_priv->warp->handle ||
-	    !dev_priv->primary->handle ||
+	if (!dev_priv->warp->virtual ||
+	    !dev_priv->primary->virtual ||
 	    ((dev_priv->dma_access != 0) &&
 	     ((dev->agp_buffer_map == NULL) ||
-	      (dev->agp_buffer_map->handle == NULL)))) {
+	      (dev->agp_buffer_map->virtual == NULL)))) {
 		DRM_ERROR("failed to ioremap agp regions!\n");
 		return -ENOMEM;
 	}
@@ -902,7 +902,7 @@ static int mga_do_init_dma(struct drm_de
 		return ret;
 	}
 
-	dev_priv->prim.status = (u32 *) dev_priv->status->handle;
+	dev_priv->prim.status = (u32 *) dev_priv->status->virtual;
 
 	mga_do_wait_for_idle(dev_priv);
 
@@ -910,8 +910,8 @@ static int mga_do_init_dma(struct drm_de
 	 */
 	MGA_WRITE(MGA_PRIMADDRESS, dev_priv->primary->offset | MGA_DMA_GENERAL);
 
-	dev_priv->prim.start = (u8 *) dev_priv->primary->handle;
-	dev_priv->prim.end = ((u8 *) dev_priv->primary->handle
+	dev_priv->prim.start = (u8 *) dev_priv->primary->virtual;
+	dev_priv->prim.end = ((u8 *) dev_priv->primary->virtual
 			      + dev_priv->primary->size);
 	dev_priv->prim.size = dev_priv->primary->size;
 

Modified: head/sys/dev/drm/mga_warp.c
==============================================================================
--- head/sys/dev/drm/mga_warp.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/mga_warp.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -96,7 +96,7 @@ unsigned int mga_warp_microcode_size(con
 
 static int mga_warp_install_g400_microcode(drm_mga_private_t * dev_priv)
 {
-	unsigned char *vcbase = dev_priv->warp->handle;
+	unsigned char *vcbase = dev_priv->warp->virtual;
 	unsigned long pcbase = dev_priv->warp->offset;
 
 	memset(dev_priv->warp_pipe_phys, 0, sizeof(dev_priv->warp_pipe_phys));
@@ -124,7 +124,7 @@ static int mga_warp_install_g400_microco
 
 static int mga_warp_install_g200_microcode(drm_mga_private_t * dev_priv)
 {
-	unsigned char *vcbase = dev_priv->warp->handle;
+	unsigned char *vcbase = dev_priv->warp->virtual;
 	unsigned long pcbase = dev_priv->warp->offset;
 
 	memset(dev_priv->warp_pipe_phys, 0, sizeof(dev_priv->warp_pipe_phys));

Modified: head/sys/dev/drm/r128_cce.c
==============================================================================
--- head/sys/dev/drm/r128_cce.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/r128_cce.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -509,7 +509,7 @@ static int r128_do_init_cce(struct drm_d
 	}
 
 	dev_priv->sarea_priv =
-	    (drm_r128_sarea_t *) ((u8 *) dev_priv->sarea->handle +
+	    (drm_r128_sarea_t *) ((u8 *) dev_priv->sarea->virtual +
 				  init->sarea_priv_offset);
 
 #if __OS_HAS_AGP
@@ -517,9 +517,9 @@ static int r128_do_init_cce(struct drm_d
 		drm_core_ioremap(dev_priv->cce_ring, dev);
 		drm_core_ioremap(dev_priv->ring_rptr, dev);
 		drm_core_ioremap(dev->agp_buffer_map, dev);
-		if (!dev_priv->cce_ring->handle ||
-		    !dev_priv->ring_rptr->handle ||
-		    !dev->agp_buffer_map->handle) {
+		if (!dev_priv->cce_ring->virtual ||
+		    !dev_priv->ring_rptr->virtual ||
+		    !dev->agp_buffer_map->virtual) {
 			DRM_ERROR("Could not ioremap agp regions!\n");
 			dev->dev_private = (void *)dev_priv;
 			r128_do_cleanup_cce(dev);
@@ -528,10 +528,11 @@ static int r128_do_init_cce(struct drm_d
 	} else
 #endif
 	{
-		dev_priv->cce_ring->handle = (void *)dev_priv->cce_ring->offset;
-		dev_priv->ring_rptr->handle =
+		dev_priv->cce_ring->virtual =
+		    (void *)dev_priv->cce_ring->offset;
+		dev_priv->ring_rptr->virtual =
 		    (void *)dev_priv->ring_rptr->offset;
-		dev->agp_buffer_map->handle =
+		dev->agp_buffer_map->virtual =
 		    (void *)dev->agp_buffer_map->offset;
 	}
 
@@ -542,8 +543,8 @@ static int r128_do_init_cce(struct drm_d
 #endif
 		dev_priv->cce_buffers_offset = (unsigned long)dev->sg->virtual;
 
-	dev_priv->ring.start = (u32 *) dev_priv->cce_ring->handle;
-	dev_priv->ring.end = ((u32 *) dev_priv->cce_ring->handle
+	dev_priv->ring.start = (u32 *) dev_priv->cce_ring->virtual;
+	dev_priv->ring.end = ((u32 *) dev_priv->cce_ring->virtual
 			      + init->ring_size / sizeof(u32));
 	dev_priv->ring.size = init->ring_size;
 	dev_priv->ring.size_l2qw = drm_order(init->ring_size / 8);

Modified: head/sys/dev/drm/r128_state.c
==============================================================================
--- head/sys/dev/drm/r128_state.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/r128_state.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -657,7 +657,7 @@ static void r128_cce_dispatch_indirect(s
 		 */
 		if (dwords & 1) {
 			u32 *data = (u32 *)
-			    ((char *)dev->agp_buffer_map->handle
+			    ((char *)dev->agp_buffer_map->virtual
 			     + buf->offset + start);
 			data[dwords++] = cpu_to_le32(R128_CCE_PACKET2);
 		}
@@ -722,7 +722,7 @@ static void r128_cce_dispatch_indices(st
 
 		dwords = (end - start + 3) / sizeof(u32);
 
-		data = (u32 *) ((char *)dev->agp_buffer_map->handle
+		data = (u32 *) ((char *)dev->agp_buffer_map->virtual
 				+ buf->offset + start);
 
 		data[0] = cpu_to_le32(CCE_PACKET3(R128_3D_RNDR_GEN_INDX_PRIM,

Modified: head/sys/dev/drm/r600_blit.c
==============================================================================
--- head/sys/dev/drm/r600_blit.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/r600_blit.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -1290,8 +1290,8 @@ set_shaders(struct drm_device *dev)
 	DRM_DEBUG("\n");
 
 	/* load shaders */
-	vs = (u32 *) ((char *)dev->agp_buffer_map->handle + dev_priv->blit_vb->offset);
-	ps = (u32 *) ((char *)dev->agp_buffer_map->handle + dev_priv->blit_vb->offset + 256);
+	vs = (u32 *) ((char *)dev->agp_buffer_map->virtual + dev_priv->blit_vb->offset);
+	ps = (u32 *) ((char *)dev->agp_buffer_map->virtual + dev_priv->blit_vb->offset + 256);
 
 	shader_size = sizeof(r6xx_vs) / 4;
 	for (i= 0; i < shader_size; i++)
@@ -1718,11 +1718,10 @@ r600_blit_copy(struct drm_device *dev,
 	u64 vb_addr;
 	u32 *vb;
 
-	vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
+	vb = (u32 *) ((char *)dev->agp_buffer_map->virtual +
 	    dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
-	DRM_DEBUG("src=0x%016llx, dst=0x%016llx, size=%d\n",
-	    (unsigned long long)src_gpu_addr,
-	    (unsigned long long)dst_gpu_addr, size_bytes);
+	DRM_DEBUG("src=0x%016jx, dst=0x%016jx, size=%d\n",
+	    src_gpu_addr, dst_gpu_addr, size_bytes);
 
 	if ((size_bytes & 3) || (src_gpu_addr & 3) || (dst_gpu_addr & 3)) {
 		max_bytes = 8192;
@@ -1759,7 +1758,7 @@ r600_blit_copy(struct drm_device *dev,
 				if (!dev_priv->blit_vb)
 					return;
 				set_shaders(dev);
-				vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
+				vb = (u32 *) ((char *)dev->agp_buffer_map->virtual +
 				    dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
 			}
 
@@ -1849,7 +1848,7 @@ r600_blit_copy(struct drm_device *dev,
 				if (!dev_priv->blit_vb)
 					return;
 				set_shaders(dev);
-				vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
+				vb = (u32 *) ((char *)dev->agp_buffer_map->virtual +
 				    dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
 			}
 
@@ -1928,7 +1927,7 @@ r600_blit_swap(struct drm_device *dev,
 			return;
 		set_shaders(dev);
 	}
-	vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
+	vb = (u32 *) ((char *)dev->agp_buffer_map->virtual +
 	    dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
 
 	sx2 = sx + w;

Modified: head/sys/dev/drm/r600_cp.c
==============================================================================
--- head/sys/dev/drm/r600_cp.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/r600_cp.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -1914,7 +1914,7 @@ int r600_do_init_cp(struct drm_device *d
 	}
 
 	dev_priv->sarea_priv =
-	    (drm_radeon_sarea_t *) ((u8 *) dev_priv->sarea->handle +
+	    (drm_radeon_sarea_t *) ((u8 *) dev_priv->sarea->virtual +
 				    init->sarea_priv_offset);
 
 #if __OS_HAS_AGP
@@ -1923,9 +1923,9 @@ int r600_do_init_cp(struct drm_device *d
 		drm_core_ioremap_wc(dev_priv->cp_ring, dev);
 		drm_core_ioremap_wc(dev_priv->ring_rptr, dev);
 		drm_core_ioremap_wc(dev->agp_buffer_map, dev);
-		if (!dev_priv->cp_ring->handle ||
-		    !dev_priv->ring_rptr->handle ||
-		    !dev->agp_buffer_map->handle) {
+		if (!dev_priv->cp_ring->virtual ||
+		    !dev_priv->ring_rptr->virtual ||
+		    !dev->agp_buffer_map->virtual) {
 			DRM_ERROR("could not find ioremap agp regions!\n");
 			r600_do_cleanup_cp(dev);
 			return -EINVAL;
@@ -1933,18 +1933,19 @@ int r600_do_init_cp(struct drm_device *d
 	} else
 #endif
 	{
-		dev_priv->cp_ring->handle = (void *)dev_priv->cp_ring->offset;
-		dev_priv->ring_rptr->handle =
+		dev_priv->cp_ring->virtual =
+		    (void *)dev_priv->cp_ring->offset;
+		dev_priv->ring_rptr->virtual =
 		    (void *)dev_priv->ring_rptr->offset;
-		dev->agp_buffer_map->handle =
+		dev->agp_buffer_map->virtual =
 		    (void *)dev->agp_buffer_map->offset;
 
-		DRM_DEBUG("dev_priv->cp_ring->handle %p\n",
-			  dev_priv->cp_ring->handle);
-		DRM_DEBUG("dev_priv->ring_rptr->handle %p\n",
-			  dev_priv->ring_rptr->handle);
-		DRM_DEBUG("dev->agp_buffer_map->handle %p\n",
-			  dev->agp_buffer_map->handle);
+		DRM_DEBUG("dev_priv->cp_ring->virtual %p\n",
+			  dev_priv->cp_ring->virtual);
+		DRM_DEBUG("dev_priv->ring_rptr->virtual %p\n",
+			  dev_priv->ring_rptr->virtual);
+		DRM_DEBUG("dev->agp_buffer_map->virtual %p\n",
+			  dev->agp_buffer_map->virtual);
 	}
 
 	dev_priv->fb_location = (radeon_read_fb_location(dev_priv) & 0xffff) << 24;
@@ -2024,8 +2025,8 @@ int r600_do_init_cp(struct drm_device *d
 	DRM_DEBUG("dev_priv->gart_buffers_offset 0x%08lx\n",
 		  dev_priv->gart_buffers_offset);
 
-	dev_priv->ring.start = (u32 *) dev_priv->cp_ring->handle;
-	dev_priv->ring.end = ((u32 *) dev_priv->cp_ring->handle
+	dev_priv->ring.start = (u32 *) dev_priv->cp_ring->virtual;
+	dev_priv->ring.end = ((u32 *) dev_priv->cp_ring->virtual
 			      + init->ring_size / sizeof(u32));
 	dev_priv->ring.size = init->ring_size;
 	dev_priv->ring.size_l2qw = drm_order(init->ring_size / 8);
@@ -2064,14 +2065,14 @@ int r600_do_init_cp(struct drm_device *d
 			dev_priv->gart_info.table_size;
 
 		drm_core_ioremap_wc(&dev_priv->gart_info.mapping, dev);
-		if (!dev_priv->gart_info.mapping.handle) {
+		if (!dev_priv->gart_info.mapping.virtual) {
 			DRM_ERROR("ioremap failed.\n");
 			r600_do_cleanup_cp(dev);
 			return -EINVAL;
 		}
 
 		dev_priv->gart_info.addr =
-			dev_priv->gart_info.mapping.handle;
+			dev_priv->gart_info.mapping.virtual;
 
 		DRM_DEBUG("Setting phys_pci_gart to %p %08lX\n",
 			  dev_priv->gart_info.addr,
@@ -2219,7 +2220,7 @@ int r600_cp_dispatch_indirect(struct drm
 		 */
 		while (dwords & 0xf) {
 			u32 *data = (u32 *)
-			    ((char *)dev->agp_buffer_map->handle
+			    ((char *)dev->agp_buffer_map->virtual
 			     + buf->offset + start);
 			data[dwords++] = RADEON_CP_PACKET2;
 		}
@@ -2343,7 +2344,8 @@ int r600_cp_dispatch_texture(struct drm_
 		/* Dispatch the indirect buffer.
 		 */
 		buffer =
-		    (u32 *) ((char *)dev->agp_buffer_map->handle + buf->offset);
+		    (u32 *) ((char *)dev->agp_buffer_map->virtual +
+		    buf->offset);
 
 		if (DRM_COPY_FROM_USER(buffer, data, pass_size)) {
 			DRM_ERROR("EFAULT on pad, %d bytes\n", pass_size);

Modified: head/sys/dev/drm/radeon_cp.c
==============================================================================
--- head/sys/dev/drm/radeon_cp.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/radeon_cp.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -53,7 +53,7 @@ u32 radeon_read_ring_rptr(drm_radeon_pri
 		val = DRM_READ32(dev_priv->ring_rptr, off);
 	} else {
 		val = *(((volatile u32 *)
-			 dev_priv->ring_rptr->handle) +
+			 dev_priv->ring_rptr->virtual) +
 			(off / sizeof(u32)));
 		val = le32_to_cpu(val);
 	}
@@ -77,7 +77,7 @@ void radeon_write_ring_rptr(drm_radeon_p
 	if (dev_priv->flags & RADEON_IS_AGP)
 		DRM_WRITE32(dev_priv->ring_rptr, off, val);
 	else
-		*(((volatile u32 *) dev_priv->ring_rptr->handle) +
+		*(((volatile u32 *) dev_priv->ring_rptr->virtual) +
 		  (off / sizeof(u32))) = cpu_to_le32(val);
 }
 
@@ -1278,7 +1278,7 @@ static int radeon_do_init_cp(struct drm_
 	}
 
 	dev_priv->sarea_priv =
-	    (drm_radeon_sarea_t *) ((u8 *) dev_priv->sarea->handle +
+	    (drm_radeon_sarea_t *) ((u8 *) dev_priv->sarea->virtual +
 				    init->sarea_priv_offset);
 
 #if __OS_HAS_AGP
@@ -1286,9 +1286,9 @@ static int radeon_do_init_cp(struct drm_
 		drm_core_ioremap_wc(dev_priv->cp_ring, dev);
 		drm_core_ioremap_wc(dev_priv->ring_rptr, dev);
 		drm_core_ioremap_wc(dev->agp_buffer_map, dev);
-		if (!dev_priv->cp_ring->handle ||
-		    !dev_priv->ring_rptr->handle ||
-		    !dev->agp_buffer_map->handle) {
+		if (!dev_priv->cp_ring->virtual ||
+		    !dev_priv->ring_rptr->virtual ||
+		    !dev->agp_buffer_map->virtual) {
 			DRM_ERROR("could not find ioremap agp regions!\n");
 			radeon_do_cleanup_cp(dev);
 			return -EINVAL;
@@ -1296,19 +1296,19 @@ static int radeon_do_init_cp(struct drm_
 	} else
 #endif
 	{
-		dev_priv->cp_ring->handle =
+		dev_priv->cp_ring->virtual =
 			(void *)(unsigned long)dev_priv->cp_ring->offset;
-		dev_priv->ring_rptr->handle =
+		dev_priv->ring_rptr->virtual =
 			(void *)(unsigned long)dev_priv->ring_rptr->offset;
-		dev->agp_buffer_map->handle =
+		dev->agp_buffer_map->virtual =
 			(void *)(unsigned long)dev->agp_buffer_map->offset;
 
-		DRM_DEBUG("dev_priv->cp_ring->handle %p\n",
-			  dev_priv->cp_ring->handle);
-		DRM_DEBUG("dev_priv->ring_rptr->handle %p\n",
-			  dev_priv->ring_rptr->handle);
-		DRM_DEBUG("dev->agp_buffer_map->handle %p\n",
-			  dev->agp_buffer_map->handle);
+		DRM_DEBUG("dev_priv->cp_ring->virtual %p\n",
+			  dev_priv->cp_ring->virtual);
+		DRM_DEBUG("dev_priv->ring_rptr->virtual %p\n",
+			  dev_priv->ring_rptr->virtual);
+		DRM_DEBUG("dev->agp_buffer_map->virtual %p\n",
+			  dev->agp_buffer_map->virtual);
 	}
 
 	dev_priv->fb_location = (radeon_read_fb_location(dev_priv) & 0xffff) << 16;
@@ -1386,8 +1386,8 @@ static int radeon_do_init_cp(struct drm_
 	DRM_DEBUG("dev_priv->gart_buffers_offset 0x%lx\n",
 		  dev_priv->gart_buffers_offset);
 
-	dev_priv->ring.start = (u32 *) dev_priv->cp_ring->handle;
-	dev_priv->ring.end = ((u32 *) dev_priv->cp_ring->handle
+	dev_priv->ring.start = (u32 *) dev_priv->cp_ring->virtual;
+	dev_priv->ring.end = ((u32 *) dev_priv->cp_ring->virtual
 			      + init->ring_size / sizeof(u32));
 	dev_priv->ring.size = init->ring_size;
 	dev_priv->ring.size_l2qw = drm_order(init->ring_size / 8);
@@ -1423,7 +1423,7 @@ static int radeon_do_init_cp(struct drm_
 
 			drm_core_ioremap_wc(&dev_priv->gart_info.mapping, dev);
 			dev_priv->gart_info.addr =
-			    dev_priv->gart_info.mapping.handle;
+			    dev_priv->gart_info.mapping.virtual;
 
 			if (dev_priv->flags & RADEON_IS_PCIE)
 				dev_priv->gart_info.gart_reg_if = DRM_ATI_GART_PCIE;

Modified: head/sys/dev/drm/radeon_cs.c
==============================================================================
--- head/sys/dev/drm/radeon_cs.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/radeon_cs.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -821,7 +821,7 @@ static int r600_ib_get(struct drm_radeon
 	}
 	buf->file_priv = parser->file_priv;
 	dev_priv->cs_buf = buf;
-	parser->ib = (void *)((vm_offset_t)dev->agp_buffer_map->handle +
+	parser->ib = (void *)((vm_offset_t)dev->agp_buffer_map->virtual +
 	    buf->offset);
 
 	return 0;

Modified: head/sys/dev/drm/radeon_state.c
==============================================================================
--- head/sys/dev/drm/radeon_state.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/radeon_state.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -1420,7 +1420,7 @@ static void radeon_cp_dispatch_swap(stru
 static void radeon_cp_dispatch_flip(struct drm_device *dev)
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
-	struct drm_sarea *sarea = (struct drm_sarea *)dev_priv->sarea->handle;
+	struct drm_sarea *sarea = (struct drm_sarea *)dev_priv->sarea->virtual;
 	int offset = (dev_priv->sarea_priv->pfCurrentPage == 1)
 	    ? dev_priv->front_offset : dev_priv->back_offset;
 	RING_LOCALS;
@@ -1582,7 +1582,7 @@ static void radeon_cp_dispatch_indirect(
 		 */
 		if (dwords & 1) {
 			u32 *data = (u32 *)
-			    ((char *)dev->agp_buffer_map->handle
+			    ((char *)dev->agp_buffer_map->virtual
 			     + buf->offset + start);
 			data[dwords++] = RADEON_CP_PACKET2;
 		}
@@ -1629,7 +1629,7 @@ static void radeon_cp_dispatch_indices(s
 
 	dwords = (prim->finish - prim->start + 3) / sizeof(u32);
 
-	data = (u32 *) ((char *)dev->agp_buffer_map->handle +
+	data = (u32 *) ((char *)dev->agp_buffer_map->virtual +
 			elt_buf->offset + prim->start);
 
 	data[0] = CP_PACKET3(RADEON_3D_RNDR_GEN_INDX_PRIM, dwords - 2);
@@ -1781,7 +1781,7 @@ static int radeon_cp_dispatch_texture(st
 		/* Dispatch the indirect buffer.
 		 */
 		buffer =
-		    (u32 *) ((char *)dev->agp_buffer_map->handle + buf->offset);
+		    (u32 *) ((char *)dev->agp_buffer_map->virtual + buf->offset);
 		dwords = size / 4;
 
 #define RADEON_COPY_MT(_buf, _data, _width) \

Modified: head/sys/dev/drm/savage_bci.c
==============================================================================
--- head/sys/dev/drm/savage_bci.c	Thu Apr 22 14:54:54 2010	(r207065)
+++ head/sys/dev/drm/savage_bci.c	Thu Apr 22 18:21:25 2010	(r207066)
@@ -376,7 +376,7 @@ uint32_t *savage_dma_alloc(drm_savage_pr
 		  cur, dev_priv->dma_pages[cur].used, n, rest, nr_pages);
 
 	if (cur + nr_pages < dev_priv->nr_dma_pages) {
-		dma_ptr = (uint32_t *)dev_priv->cmd_dma->handle +
+		dma_ptr = (uint32_t *)dev_priv->cmd_dma->virtual +
 		    cur * SAVAGE_DMA_PAGE_SIZE + dev_priv->dma_pages[cur].used;
 		if (n < rest)
 			rest = n;
@@ -392,7 +392,7 @@ uint32_t *savage_dma_alloc(drm_savage_pr
 			dev_priv->dma_pages[i].used = 0;
 			dev_priv->dma_pages[i].flushed = 0;
 		}
-		dma_ptr = (uint32_t *)dev_priv->cmd_dma->handle;
+		dma_ptr = (uint32_t *)dev_priv->cmd_dma->virtual;
 		dev_priv->first_dma_page = cur = 0;
 	}
 	for (i = cur; nr_pages > 0; ++i, --nr_pages) {
@@ -443,7 +443,7 @@ static void savage_dma_flush(drm_savage_
 
 	/* pad with noops */
 	if (pad) {
-		uint32_t *dma_ptr = (uint32_t *)dev_priv->cmd_dma->handle +
+		uint32_t *dma_ptr = (uint32_t *)dev_priv->cmd_dma->virtual +
 		    cur * SAVAGE_DMA_PAGE_SIZE + dev_priv->dma_pages[cur].used;
 		dev_priv->dma_pages[cur].used += pad;
 		while (pad != 0) {
@@ -517,7 +517,7 @@ static void savage_fake_dma_flush(drm_sa
 	for (i = dev_priv->first_dma_page;
 	     i <= dev_priv->current_dma_page && dev_priv->dma_pages[i].used;
 	     ++i) {
-		uint32_t *dma_ptr = (uint32_t *)dev_priv->cmd_dma->handle +
+		uint32_t *dma_ptr = (uint32_t *)dev_priv->cmd_dma->virtual +
 			i * SAVAGE_DMA_PAGE_SIZE;
 #if SAVAGE_DMA_DEBUG
 		/* Sanity check: all pages except the last one must be full. */
@@ -784,7 +784,7 @@ static int savage_do_init_bci(struct drm
 				return -EINVAL;
 			}
 			drm_core_ioremap(dev_priv->cmd_dma, dev);
-			if (!dev_priv->cmd_dma->handle) {
+			if (!dev_priv->cmd_dma->virtual) {
 				DRM_ERROR("failed to ioremap command "
 					  "DMA region!\n");
 				savage_do_cleanup_bci(dev);
@@ -806,9 +806,9 @@ static int savage_do_init_bci(struct drm
 		dev_priv->fake_dma.offset = 0;
 		dev_priv->fake_dma.size = SAVAGE_FAKE_DMA_SIZE;
 		dev_priv->fake_dma.type = _DRM_SHM;
-		dev_priv->fake_dma.handle = drm_alloc(SAVAGE_FAKE_DMA_SIZE,
+		dev_priv->fake_dma.virtual = drm_alloc(SAVAGE_FAKE_DMA_SIZE,
 						      DRM_MEM_DRIVER);
-		if (!dev_priv->fake_dma.handle) {
+		if (!dev_priv->fake_dma.virtual) {
 			DRM_ERROR("could not allocate faked DMA buffer!\n");
 			savage_do_cleanup_bci(dev);
 			return -ENOMEM;
@@ -818,7 +818,7 @@ static int savage_do_init_bci(struct drm
 	}
 
 	dev_priv->sarea_priv =
-		(drm_savage_sarea_t *)((uint8_t *)dev_priv->sarea->handle +
+		(drm_savage_sarea_t *)((uint8_t *)dev_priv->sarea->virtual +
 				       init->sarea_priv_offset);
 
 	/* setup bitmap descriptors */
@@ -857,7 +857,7 @@ static int savage_do_init_bci(struct drm
 	dev_priv->event_counter = 0;
 	dev_priv->event_wrap = 0;
 	dev_priv->bci_ptr = (volatile uint32_t *)
-	    ((uint8_t *)dev_priv->mmio->handle + SAVAGE_BCI_OFFSET);
+	    ((uint8_t *)dev_priv->mmio->virtual + SAVAGE_BCI_OFFSET);
 	if (S3_SAVAGE3D_SERIES(dev_priv->chipset)) {

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 18:44: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 1C18F1065716;
	Thu, 22 Apr 2010 18:44:24 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 09A568FC12;
	Thu, 22 Apr 2010 18:44: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 o3MIiNMZ059706;
	Thu, 22 Apr 2010 18:44:23 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MIiNgV059699;
	Thu, 22 Apr 2010 18:44:23 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <201004221844.o3MIiNgV059699@svn.freebsd.org>
From: Robert Noland 
Date: Thu, 22 Apr 2010 18:44: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: r207067 - head/sys/dev/drm
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, 22 Apr 2010 18:44:24 -0000

Author: rnoland
Date: Thu Apr 22 18:44:23 2010
New Revision: 207067
URL: http://svn.freebsd.org/changeset/base/207067

Log:
  re-write scatter gather memory allocation yet again...
  
  This time, abandon the use of busdma and start interacting with the VM
  system directly.  Make use of the new kmem_alloc_attr() which allows us
  to easily allocate non-contiguous pages to back the GART table.  This
  should help a lot when starting or restarting X after the system has
  been running for a while and memory has become fragmented.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_bufs.c
  head/sys/dev/drm/drm_scatter.c
  head/sys/dev/drm/r128_cce.c
  head/sys/dev/drm/r600_cp.c
  head/sys/dev/drm/radeon_cp.c

Modified: head/sys/dev/drm/drmP.h
==============================================================================
--- head/sys/dev/drm/drmP.h	Thu Apr 22 18:21:25 2010	(r207066)
+++ head/sys/dev/drm/drmP.h	Thu Apr 22 18:44:23 2010	(r207067)
@@ -49,6 +49,7 @@ struct drm_file;
 #include 
 #include 
 #include 
+#include 
 #include 
 #if __FreeBSD_version >= 700000
 #include 
@@ -68,10 +69,13 @@ struct drm_file;
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -474,11 +478,10 @@ typedef struct drm_agp_head {
 } drm_agp_head_t;
 
 typedef struct drm_sg_mem {
-	unsigned long		  handle;
-	void			 *virtual;
-	int			  pages;
-	dma_addr_t		 *busaddr;
-	struct drm_dma_handle	 *dmah;		/* Handle to PCI memory  */
+	vm_offset_t vaddr;
+	vm_paddr_t *busaddr;
+	vm_pindex_t pages;
+	vm_object_t obj;
 } drm_sg_mem_t;
 
 #define DRM_MAP_HANDLE_BITS	(sizeof(void *) == 4 ? 4 : 24)

Modified: head/sys/dev/drm/drm_bufs.c
==============================================================================
--- head/sys/dev/drm/drm_bufs.c	Thu Apr 22 18:21:25 2010	(r207066)
+++ head/sys/dev/drm/drm_bufs.c	Thu Apr 22 18:44:23 2010	(r207067)
@@ -226,8 +226,8 @@ int drm_addmap(struct drm_device * dev, 
 			DRM_LOCK();
 			return EINVAL;
 		}
-		map->virtual = (void *)(dev->sg->handle + offset);
-		map->offset = dev->sg->handle + offset;
+		map->virtual = (void *)(dev->sg->vaddr + offset);
+		map->offset = dev->sg->vaddr + offset;
 		break;
 	case _DRM_CONSISTENT:
 		/* Unfortunately, we don't get any alignment specification from
@@ -744,7 +744,7 @@ static int drm_do_addbufs_sg(struct drm_
 
 		buf->offset  = (dma->byte_count + offset);
 		buf->bus_address = agp_offset + offset;
-		buf->address = (void *)(agp_offset + offset + dev->sg->handle);
+		buf->address = (void *)(agp_offset + offset + dev->sg->vaddr);
 		buf->next    = NULL;
 		buf->pending = 0;
 		buf->file_priv = NULL;

Modified: head/sys/dev/drm/drm_scatter.c
==============================================================================
--- head/sys/dev/drm/drm_scatter.c	Thu Apr 22 18:21:25 2010	(r207066)
+++ head/sys/dev/drm/drm_scatter.c	Thu Apr 22 18:44:23 2010	(r207067)
@@ -1,5 +1,5 @@
 /*-
- * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * Copyright (c) 2009 Robert C. Noland III 
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -20,11 +20,6 @@
  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- *   Gareth Hughes 
- *   Eric Anholt 
- *
  */
 
 #include 
@@ -32,99 +27,58 @@ __FBSDID("$FreeBSD$");
 
 /** @file drm_scatter.c
  * Allocation of memory for scatter-gather mappings by the graphics chip.
- *
  * The memory allocated here is then made into an aperture in the card
- * by drm_ati_pcigart_init().
+ * by mapping the pages into the GART.
  */
 
 #include "dev/drm/drmP.h"
 
-static void drm_sg_alloc_cb(void *arg, bus_dma_segment_t *segs,
-			    int nsegs, int error);
-
 int
 drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather *request)
 {
 	struct drm_sg_mem *entry;
-	struct drm_dma_handle *dmah;
-	int ret;
+	vm_size_t size;
+	vm_pindex_t pindex;
 
 	if (dev->sg)
 		return EINVAL;
 
-	entry = malloc(sizeof(*entry), DRM_MEM_SGLISTS, M_WAITOK | M_ZERO);
-	entry->pages = round_page(request->size) / PAGE_SIZE;
-	DRM_DEBUG("sg size=%ld pages=%d\n", request->size, entry->pages);
+	DRM_DEBUG("request size=%ld\n", request->size);
+
+	entry = malloc(sizeof(*entry), DRM_MEM_DRIVER, M_WAITOK | M_ZERO);
 
+	size = round_page(request->size);
+	entry->pages = OFF_TO_IDX(size);
 	entry->busaddr = malloc(entry->pages * sizeof(*entry->busaddr),
-	    DRM_MEM_PAGES, M_WAITOK | M_ZERO);
-	dmah = malloc(sizeof(struct drm_dma_handle), DRM_MEM_DMA,
-	    M_WAITOK | M_ZERO);
-	entry->dmah = dmah;
-
-	ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */
-	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */
-	    NULL, NULL, /* filtfunc, filtfuncargs */
-	    request->size, entry->pages, /* maxsize, nsegs */
-	    PAGE_SIZE, 0, /* maxsegsize, flags */
-	    NULL, NULL, /* lockfunc, lockfuncargs */
-	    &dmah->tag);
-	if (ret != 0) {
-		drm_sg_cleanup(entry);
-		return ENOMEM;
-	}
+	    DRM_MEM_SGLISTS, M_WAITOK | M_ZERO);
 
-	ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr,
-	    BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map);
-	if (ret != 0) {
+	entry->vaddr = kmem_alloc_attr(kernel_map, size, M_WAITOK | M_ZERO,
+	    0, BUS_SPACE_MAXADDR_32BIT, VM_MEMATTR_WRITE_COMBINING);
+	if (entry->vaddr == 0) {
 		drm_sg_cleanup(entry);
-		return ENOMEM;
+		return (ENOMEM);
 	}
 
-	entry->handle = (unsigned long)dmah->vaddr;
-	entry->virtual = dmah->vaddr;
-
-	ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr,
-	    request->size, drm_sg_alloc_cb, entry, BUS_DMA_NOWAIT);
-	if (ret != 0) {
-		drm_sg_cleanup(entry);
-		return ENOMEM;
+	for(pindex = 0; pindex < entry->pages; pindex++) {
+		entry->busaddr[pindex] =
+		    vtophys(entry->vaddr + IDX_TO_OFF(pindex));
 	}
 
 	DRM_LOCK();
 	if (dev->sg) {
 		DRM_UNLOCK();
 		drm_sg_cleanup(entry);
-		return EINVAL;
+		return (EINVAL);
 	}
 	dev->sg = entry;
 	DRM_UNLOCK();
 
-	pmap_change_attr((vm_offset_t)dmah->vaddr, request->size,
-	    PAT_WRITE_COMBINING);
+	request->handle = entry->vaddr;
 
-	request->handle = entry->handle;
+	DRM_DEBUG("allocated %ju pages @ 0x%08zx, contents=%08lx\n",
+	    entry->pages, entry->vaddr, *(unsigned long *)entry->vaddr);
 
-	DRM_DEBUG("handle=%08lx, kva=%p, contents=%08lx\n", entry->handle,
-	    entry->virtual, *(unsigned long *)entry->virtual);
-
-	return 0;
-}
-
-static void
-drm_sg_alloc_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
-{
-	struct drm_sg_mem *entry = arg;
-	int i;
-
-	if (error != 0)
-	    return;
-
-	for(i = 0 ; i < nsegs ; i++) {
-		entry->busaddr[i] = segs[i].ds_addr;
-		DRM_DEBUG("segment %d @ 0x%016lx\n", i,
-		    (unsigned long)segs[i].ds_addr);
-	}
+	return (0);
 }
 
 int
@@ -135,23 +89,22 @@ drm_sg_alloc_ioctl(struct drm_device *de
 
 	DRM_DEBUG("\n");
 
-	return drm_sg_alloc(dev, request);
+	return (drm_sg_alloc(dev, request));
 }
 
 void
 drm_sg_cleanup(struct drm_sg_mem *entry)
 {
-	struct drm_dma_handle *dmah = entry->dmah;
+	if (entry == NULL)
+		return;
+
+	if (entry->vaddr != 0)
+		kmem_free(kernel_map, entry->vaddr, IDX_TO_OFF(entry->pages));
 
-	if (dmah->map != NULL)
-		bus_dmamap_unload(dmah->tag, dmah->map);
-	if (dmah->vaddr != NULL)
-		bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
-	if (dmah->tag != NULL)
-		bus_dma_tag_destroy(dmah->tag);
-	free(dmah, DRM_MEM_DMA);
-	free(entry->busaddr, DRM_MEM_PAGES);
-	free(entry, DRM_MEM_SGLISTS);
+	free(entry->busaddr, DRM_MEM_SGLISTS);
+	free(entry, DRM_MEM_DRIVER);
+
+	return;
 }
 
 int
@@ -165,12 +118,12 @@ drm_sg_free(struct drm_device *dev, void
 	dev->sg = NULL;
 	DRM_UNLOCK();
 
-	if (!entry || entry->handle != request->handle)
-		return EINVAL;
+	if (!entry || entry->vaddr != request->handle)
+		return (EINVAL);
 
-	DRM_DEBUG("sg free virtual = 0x%lx\n", entry->handle);
+	DRM_DEBUG("free 0x%zx\n", entry->vaddr);
 
 	drm_sg_cleanup(entry);
 
-	return 0;
+	return (0);
 }

Modified: head/sys/dev/drm/r128_cce.c
==============================================================================
--- head/sys/dev/drm/r128_cce.c	Thu Apr 22 18:21:25 2010	(r207066)
+++ head/sys/dev/drm/r128_cce.c	Thu Apr 22 18:44:23 2010	(r207067)
@@ -327,8 +327,7 @@ static void r128_cce_init_ring_buffer(st
 		ring_start = dev_priv->cce_ring->offset - dev->agp->base;
 	else
 #endif
-		ring_start = dev_priv->cce_ring->offset -
-				(unsigned long)dev->sg->virtual;
+		ring_start = dev_priv->cce_ring->offset - dev->sg->vaddr;
 
 	R128_WRITE(R128_PM4_BUFFER_OFFSET, ring_start | R128_AGP_OFFSET);
 
@@ -541,7 +540,7 @@ static int r128_do_init_cce(struct drm_d
 		dev_priv->cce_buffers_offset = dev->agp->base;
 	else
 #endif
-		dev_priv->cce_buffers_offset = (unsigned long)dev->sg->virtual;
+		dev_priv->cce_buffers_offset = dev->sg->vaddr;
 
 	dev_priv->ring.start = (u32 *) dev_priv->cce_ring->virtual;
 	dev_priv->ring.end = ((u32 *) dev_priv->cce_ring->virtual

Modified: head/sys/dev/drm/r600_cp.c
==============================================================================
--- head/sys/dev/drm/r600_cp.c	Thu Apr 22 18:21:25 2010	(r207066)
+++ head/sys/dev/drm/r600_cp.c	Thu Apr 22 18:44:23 2010	(r207067)
@@ -1670,9 +1670,8 @@ static void r600_cp_init_ring_buffer(str
 	} else
 #endif
 	{
-		rptr_addr = dev_priv->ring_rptr->offset
-			- ((unsigned long) dev->sg->virtual)
-			+ dev_priv->gart_vm_start;
+		rptr_addr = dev_priv->ring_rptr->offset - dev->sg->vaddr +
+		    dev_priv->gart_vm_start;
 	}
 	RADEON_WRITE(R600_CP_RB_RPTR_ADDR,
 		     rptr_addr & 0xffffffff);
@@ -1706,9 +1705,8 @@ static void r600_cp_init_ring_buffer(str
 			      + dev_priv->gart_vm_start);
 	} else
 #endif
-		ring_start = (dev_priv->cp_ring->offset
-			      - (unsigned long)dev->sg->virtual
-			      + dev_priv->gart_vm_start);
+		ring_start = dev_priv->cp_ring->offset - dev->sg->vaddr +
+		    dev_priv->gart_vm_start;
 
 	RADEON_WRITE(R600_CP_RB_BASE, ring_start >> 8);
 
@@ -2012,9 +2010,8 @@ int r600_do_init_cp(struct drm_device *d
 						 + dev_priv->gart_vm_start);
 	else
 #endif
-		dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset
-						 - (unsigned long)dev->sg->virtual
-						 + dev_priv->gart_vm_start);
+		dev_priv->gart_buffers_offset = dev->agp_buffer_map->offset -
+		    dev->sg->vaddr + dev_priv->gart_vm_start;
 
 	DRM_DEBUG("fb 0x%08x size %d\n",
 		  (unsigned int) dev_priv->fb_location,

Modified: head/sys/dev/drm/radeon_cp.c
==============================================================================
--- head/sys/dev/drm/radeon_cp.c	Thu Apr 22 18:21:25 2010	(r207066)
+++ head/sys/dev/drm/radeon_cp.c	Thu Apr 22 18:44:23 2010	(r207067)
@@ -720,9 +720,8 @@ static void radeon_cp_init_ring_buffer(s
 			      + dev_priv->gart_vm_start);
 	} else
 #endif
-		ring_start = (dev_priv->cp_ring->offset
-			      - (unsigned long)dev->sg->virtual
-			      + dev_priv->gart_vm_start);
+		ring_start = (dev_priv->cp_ring->offset - dev->sg->vaddr +
+		    dev_priv->gart_vm_start);
 
 	RADEON_WRITE(RADEON_CP_RB_BASE, ring_start);
 
@@ -744,9 +743,8 @@ static void radeon_cp_init_ring_buffer(s
 #endif
 	{
 		RADEON_WRITE(RADEON_CP_RB_RPTR_ADDR,
-			     dev_priv->ring_rptr->offset
-			     - ((unsigned long) dev->sg->virtual)
-			     + dev_priv->gart_vm_start);
+		    dev_priv->ring_rptr->offset - dev->sg->vaddr +
+		    dev_priv->gart_vm_start);
 	}
 
 	/* Set ring buffer size */
@@ -1377,9 +1375,8 @@ static int radeon_do_init_cp(struct drm_
 						 + dev_priv->gart_vm_start);
 	else
 #endif
-		dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset
-					- (unsigned long)dev->sg->virtual
-					+ dev_priv->gart_vm_start);
+		dev_priv->gart_buffers_offset = dev->agp_buffer_map->offset -
+		    dev->sg->vaddr + dev_priv->gart_vm_start;
 
 	DRM_DEBUG("dev_priv->gart_size %d\n", dev_priv->gart_size);
 	DRM_DEBUG("dev_priv->gart_vm_start 0x%x\n", dev_priv->gart_vm_start);

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 18:47: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 228C01065673;
	Thu, 22 Apr 2010 18:47:24 +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 10FEC8FC1D;
	Thu, 22 Apr 2010 18:47: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 o3MIlNNE060439;
	Thu, 22 Apr 2010 18:47:23 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MIlNxa060437;
	Thu, 22 Apr 2010 18:47:23 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201004221847.o3MIlNxa060437@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Thu, 22 Apr 2010 18:47: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: r207068 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
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, 22 Apr 2010 18:47:24 -0000

Author: pjd
Date: Thu Apr 22 18:47:23 2010
New Revision: 207068
URL: http://svn.freebsd.org/changeset/base/207068

Log:
  Allow to modify directory's content even if the ZFS_NOUNLINK (SF_NOUNLINK,
  sunlnk) flag is set. We only deny dirctory's removal or rename.
  
  PR:		kern/143343
  Reported by:	marck
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c	Thu Apr 22 18:44:23 2010	(r207067)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c	Thu Apr 22 18:47:23 2010	(r207068)
@@ -2235,11 +2235,24 @@ zfs_zaccess_common(znode_t *zp, uint32_t
 		return (EPERM);
 	}
 
+#ifdef sun
 	if ((v4_mode & (ACE_DELETE | ACE_DELETE_CHILD)) &&
 	    (zp->z_phys->zp_flags & ZFS_NOUNLINK)) {
 		*check_privs = B_FALSE;
 		return (EPERM);
 	}
+#else
+	/*
+	 * In FreeBSD we allow to modify directory's content is ZFS_NOUNLINK
+	 * (sunlnk) is set. We just don't allow directory removal, which is
+	 * handled in zfs_zaccess_delete().
+	 */
+	if ((v4_mode & ACE_DELETE) &&
+	    (zp->z_phys->zp_flags & ZFS_NOUNLINK)) {
+		*check_privs = B_FALSE;
+		return (EPERM);
+	}
+#endif
 
 	if (((v4_mode & (ACE_READ_DATA|ACE_EXECUTE)) &&
 	    (zp->z_phys->zp_flags & ZFS_AV_QUARANTINED))) {

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 18:47: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 7D4551065670;
	Thu, 22 Apr 2010 18:47:30 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 517CB8FC08;
	Thu, 22 Apr 2010 18:47: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 o3MIlUEp060478;
	Thu, 22 Apr 2010 18:47:30 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MIlUFr060475;
	Thu, 22 Apr 2010 18:47:30 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <201004221847.o3MIlUFr060475@svn.freebsd.org>
From: Robert Noland 
Date: Thu, 22 Apr 2010 18:47: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: r207069 - head/sys/dev/drm
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, 22 Apr 2010 18:47:30 -0000

Author: rnoland
Date: Thu Apr 22 18:47:30 2010
New Revision: 207069
URL: http://svn.freebsd.org/changeset/base/207069

Log:
  Now that we properly set write-combining on the pages that back the GART,
  disable snooping on radeons.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/drm/ati_pcigart.c
  head/sys/dev/drm/r600_cp.c

Modified: head/sys/dev/drm/ati_pcigart.c
==============================================================================
--- head/sys/dev/drm/ati_pcigart.c	Thu Apr 22 18:47:23 2010	(r207068)
+++ head/sys/dev/drm/ati_pcigart.c	Thu Apr 22 18:47:30 2010	(r207069)
@@ -39,8 +39,9 @@ __FBSDID("$FreeBSD$");
 #define ATI_PCIGART_PAGE_SIZE		4096	/* PCI GART page size */
 #define ATI_PCIGART_PAGE_MASK		(~(ATI_PCIGART_PAGE_SIZE-1))
 
-#define ATI_PCIE_WRITE 0x4
-#define ATI_PCIE_READ 0x8
+#define ATI_GART_NOSNOOP	0x1
+#define ATI_GART_WRITE		0x4
+#define ATI_GART_READ		0x8
 
 static void
 drm_ati_alloc_pcigart_table_cb(void *arg, bus_dma_segment_t *segs,
@@ -196,13 +197,15 @@ drm_ati_pcigart_init(struct drm_device *
 			case DRM_ATI_GART_IGP:
 				page_base |=
 				    (upper_32_bits(entry_addr) & 0xff) << 4;
-				page_base |= 0xc;
+				page_base |= ATI_GART_READ | ATI_GART_WRITE;
+				page_base |= ATI_GART_NOSNOOP;
 				break;
 			case DRM_ATI_GART_PCIE:
 				page_base >>= 8;
 				page_base |=
 				    (upper_32_bits(entry_addr) & 0xff) << 24;
-				page_base |= ATI_PCIE_READ | ATI_PCIE_WRITE;
+				page_base |= ATI_GART_READ | ATI_GART_WRITE;
+				page_base |= ATI_GART_NOSNOOP;
 				break;
 			default:
 			case DRM_ATI_GART_PCI:

Modified: head/sys/dev/drm/r600_cp.c
==============================================================================
--- head/sys/dev/drm/r600_cp.c	Thu Apr 22 18:47:23 2010	(r207068)
+++ head/sys/dev/drm/r600_cp.c	Thu Apr 22 18:47:30 2010	(r207069)
@@ -180,7 +180,7 @@ int r600_page_table_init(struct drm_devi
 		entry_addr = entry->busaddr[i];
 		for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
 			page_base = (u64) entry_addr & ATI_PCIGART_PAGE_MASK;
-			page_base |= R600_PTE_VALID | R600_PTE_SYSTEM | R600_PTE_SNOOPED;
+			page_base |= R600_PTE_VALID | R600_PTE_SYSTEM;
 			page_base |= R600_PTE_READABLE | R600_PTE_WRITEABLE;
 
 			*pci_gart = page_base;

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 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 86D34106564A;
	Thu, 22 Apr 2010 19:18:10 +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 6BA598FC17;
	Thu, 22 Apr 2010 19:18: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 o3MJIA2c067372;
	Thu, 22 Apr 2010 19:18:10 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MJIA8i067368;
	Thu, 22 Apr 2010 19:18:10 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201004221918.o3MJIA8i067368@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Thu, 22 Apr 2010 19:18:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207070 - in head/sbin: hastctl hastd
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, 22 Apr 2010 19:18:10 -0000

Author: pjd
Date: Thu Apr 22 19:18:10 2010
New Revision: 207070
URL: http://svn.freebsd.org/changeset/base/207070

Log:
  Fix compilation with WITHOUT_CRYPT or WITHOUT_OPENSSL options.
  
  Reported by:	Andrei V. Lavreniyuk 
  MFC after:	3 days

Modified:
  head/sbin/hastctl/Makefile
  head/sbin/hastd/Makefile
  head/sbin/hastd/hast_proto.c

Modified: head/sbin/hastctl/Makefile
==============================================================================
--- head/sbin/hastctl/Makefile	Thu Apr 22 18:47:30 2010	(r207069)
+++ head/sbin/hastctl/Makefile	Thu Apr 22 19:18:10 2010	(r207070)
@@ -25,8 +25,13 @@ CFLAGS+=-DINET6
 # This is needed to have WARNS > 1.
 CFLAGS+=-DYY_NO_UNPUT
 
-DPADD=	${LIBCRYPTO} ${LIBL}
-LDADD=	-lcrypto -ll
+DPADD=	${LIBL}
+LDADD=	-ll
+.if ${MK_OPENSSL} != "no"
+DPADD+=	${LIBCRYPTO}
+LDADD+=	-lcrypto
+CFLAGS+=-DHAVE_CRYPTO
+.endif
 
 YFLAGS+=-v
 

Modified: head/sbin/hastd/Makefile
==============================================================================
--- head/sbin/hastd/Makefile	Thu Apr 22 18:47:30 2010	(r207069)
+++ head/sbin/hastd/Makefile	Thu Apr 22 19:18:10 2010	(r207070)
@@ -26,9 +26,13 @@ CFLAGS+=-DINET6
 # This is needed to have WARNS > 1.
 CFLAGS+=-DYY_NO_UNPUT
 
-DPADD=	${LIBCRYPTO} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} \
-	${LIBPTHREAD} ${LIBUTIL}
-LDADD=	-lcrypto -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil
+DPADD=	${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} ${LIBPTHREAD} ${LIBUTIL}
+LDADD=	-lgeom -lbsdxml -lsbuf -ll -lpthread -lutil
+.if ${MK_OPENSSL} != "no"
+DPADD+=	${LIBCRYPTO}
+LDADD+=	-lcrypto
+CFLAGS+=-DHAVE_CRYPTO
+.endif
 
 YFLAGS+=-v
 

Modified: head/sbin/hastd/hast_proto.c
==============================================================================
--- head/sbin/hastd/hast_proto.c	Thu Apr 22 18:47:30 2010	(r207069)
+++ head/sbin/hastd/hast_proto.c	Thu Apr 22 19:18:10 2010	(r207070)
@@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef HAVE_CRYPTO
 #include 
+#endif
 
 #include 
 #include 
@@ -67,14 +69,18 @@ static int compression_send(struct hast_
     void **datap, size_t *sizep, bool *freedatap);
 static int compression_recv(struct hast_resource *res, struct nv *nv,
     void **datap, size_t *sizep, bool *freedatap);
+#ifdef HAVE_CRYPTO
 static int checksum_send(struct hast_resource *res, struct nv *nv,
     void **datap, size_t *sizep, bool *freedatap);
 static int checksum_recv(struct hast_resource *res, struct nv *nv,
     void **datap, size_t *sizep, bool *freedatap);
+#endif
 
 static struct hast_pipe_stage pipeline[] = {
 	{ "compression", compression_send, compression_recv },
+#ifdef HAVE_CRYPTO
 	{ "checksum", checksum_send, checksum_recv }
+#endif
 };
 
 static int
@@ -161,6 +167,7 @@ compression_recv(struct hast_resource *r
 	return (0);
 }
 
+#ifdef HAVE_CRYPTO
 static int
 checksum_send(struct hast_resource *res, struct nv *nv, void **datap,
     size_t *sizep, bool *freedatap __unused)
@@ -221,6 +228,7 @@ checksum_recv(struct hast_resource *res,
 
 	return (0);
 }
+#endif	/* HAVE_CRYPTO */
 
 /*
  * Send the given nv structure via conn.

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 20:25: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 C1844106564A;
	Thu, 22 Apr 2010 20:25: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 AFC148FC0A;
	Thu, 22 Apr 2010 20:25: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 o3MKP74r082408;
	Thu, 22 Apr 2010 20:25:07 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MKP7im082406;
	Thu, 22 Apr 2010 20:25:07 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201004222025.o3MKP7im082406@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 22 Apr 2010 20:25: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: r207071 - head/sys/dev/sge
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, 22 Apr 2010 20:25:07 -0000

Author: yongari
Date: Thu Apr 22 20:25:07 2010
New Revision: 207071
URL: http://svn.freebsd.org/changeset/base/207071

Log:
  Intialize interrupt moderation control register. The magic value
  was chosen by lots of trial and errors. The chosen value shows
  good interrupt moderation without additional latency.
  Without this change, controller can generate more than 140k
  interrupts per second under high network load.
  
  Submitted by:	xclin  cs dot nctu dot edu dot tw >

Modified:
  head/sys/dev/sge/if_sge.c

Modified: head/sys/dev/sge/if_sge.c
==============================================================================
--- head/sys/dev/sge/if_sge.c	Thu Apr 22 19:18:10 2010	(r207070)
+++ head/sys/dev/sge/if_sge.c	Thu Apr 22 20:25:07 2010	(r207071)
@@ -1551,10 +1551,13 @@ sge_init_locked(struct sge_softc *sc)
 	/*
 	 * XXX Try to mitigate interrupts.
 	 */
+	CSR_WRITE_4(sc, IntrControl, 0x08880000);
+#ifdef notyet
 	if (sc->sge_intrcontrol != 0)
 		CSR_WRITE_4(sc, IntrControl, sc->sge_intrcontrol);
 	if (sc->sge_intrtimer != 0)
 		CSR_WRITE_4(sc, IntrTimer, sc->sge_intrtimer);
+#endif
 
 	/*
 	 * Clear and enable interrupts.

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 20:46: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 B634C106564A;
	Thu, 22 Apr 2010 20:46:39 +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 8B1BF8FC20;
	Thu, 22 Apr 2010 20:46: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 o3MKkdXX087403;
	Thu, 22 Apr 2010 20:46:39 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MKkdV7087402;
	Thu, 22 Apr 2010 20:46:39 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004222046.o3MKkdV7087402@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 22 Apr 2010 20:46: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: r207072 - head/sbin/devd
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, 22 Apr 2010 20:46:39 -0000

Author: thompsa
Date: Thu Apr 22 20:46:39 2010
New Revision: 207072
URL: http://svn.freebsd.org/changeset/base/207072

Log:
  Document the new USB notification types.

Modified:
  head/sbin/devd/devd.conf.5

Modified: head/sbin/devd/devd.conf.5
==============================================================================
--- head/sbin/devd/devd.conf.5	Thu Apr 22 20:25:07 2010	(r207071)
+++ head/sbin/devd/devd.conf.5	Thu Apr 22 20:46:39 2010	(r207072)
@@ -250,18 +250,40 @@ CIS-vendor.
 Device class.
 .It Li device
 Device ID.
+.It Li devclass
+Device Class (USB)
+.It Li devsubclass
+Device Sub-class (USB)
 .It Li device-name
 Name of attached/detached device.
+.It Li endpoints
+Endpoint count (USB)
 .It Li function
 Card functions.
+.It Li interface
+Interface ID (USB)
+.It Li intclass
+Interface Class (USB)
+.It Li intprotocol
+Interface Protocol  (USB)
+.It Li intsubclass
+Interface Sub-class (USB)
 .It Li manufacturer
 Manufacturer ID (pccard).
+.It Li mode
+Peripheral mode (USB)
 .It Li notify
 Match the value of the
 .Dq Li notify
 variable.
+.It Li parent
+Parent device
+.It Li port
+Hub port number (USB)
 .It Li product
-Product ID (pccard).
+Product ID (pccard/USB).
+.It Li release
+Hardware revision (USB)
 .It Li serial
 Serial Number (USB).
 .It Li slot
@@ -342,6 +364,27 @@ The
 node is destroyed.
 .El
 .El
+.It Li USB
+Events related to the USB subsystem.
+.Bl -tag -width ".Sy Subsystem" -compact
+.It Sy Subsystem
+.It Li DEVICE
+.Bl -tag -width ".Li DETACH" -compact
+.It Sy Type
+.It Li ATTACH
+USB device is attached to the system.
+.It Li DETACH
+USB device is detached from the system.
+.El
+.It Li INTERFACE
+.Bl -tag -width ".Li DETACH" -compact
+.It Sy Type
+.It Li ATTACH
+USB interface is attached from a device.
+.It Li DETACH
+USB interface is detached from a device.
+.El
+.El
 .It Li coretemp
 Events related to the
 .Xr coretemp 4
@@ -461,6 +504,17 @@ notify 0 {
 };
 
 #
+# Match a USB device type
+#
+notify 0 {
+	match "system"			"USB";
+	match "subsystem"		"INTERFACE";
+	match "type"			"ATTACH";
+	match "intclass"		"0x0e";
+	action "logger USB video device attached";
+};
+
+#
 # Try to configure ath and wi devices with pccard_ether
 # as they are attached.
 #

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 21:31: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 9E412106566C;
	Thu, 22 Apr 2010 21:31:35 +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 8894E8FC0A;
	Thu, 22 Apr 2010 21:31: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 o3MLVZ2o097527;
	Thu, 22 Apr 2010 21:31:35 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MLVYj2097482;
	Thu, 22 Apr 2010 21:31:34 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004222131.o3MLVYj2097482@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 22 Apr 2010 21:31: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: r207077 - in head/sys: amd64/conf arm/conf
	dev/sound/usb dev/usb dev/usb/controller dev/usb/input
	dev/usb/misc dev/usb/net dev/usb/serial dev/usb/storage
	dev/usb/wlan i386/conf ia64/con...
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, 22 Apr 2010 21:31:35 -0000

Author: thompsa
Date: Thu Apr 22 21:31:34 2010
New Revision: 207077
URL: http://svn.freebsd.org/changeset/base/207077

Log:
  Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had
  the illusion of a tunable setting but was always turned on regardless.
  
  MFC after:	1 week

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/arm/conf/DB-78XXX
  head/sys/arm/conf/DB-88F5XXX
  head/sys/arm/conf/DB-88F6XXX
  head/sys/arm/conf/HL200
  head/sys/arm/conf/KB920X
  head/sys/arm/conf/LN2410SBC
  head/sys/arm/conf/SHEEVAPLUG
  head/sys/dev/sound/usb/uaudio.c
  head/sys/dev/usb/controller/ehci.c
  head/sys/dev/usb/controller/uhci.c
  head/sys/dev/usb/controller/uss820dci.c
  head/sys/dev/usb/input/atp.c
  head/sys/dev/usb/input/uhid.c
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/input/ums.c
  head/sys/dev/usb/misc/udbp.c
  head/sys/dev/usb/net/if_aue.c
  head/sys/dev/usb/net/if_axe.c
  head/sys/dev/usb/net/if_cdce.c
  head/sys/dev/usb/net/if_cue.c
  head/sys/dev/usb/net/if_kue.c
  head/sys/dev/usb/net/if_rue.c
  head/sys/dev/usb/net/if_udav.c
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/serial/ubsa.c
  head/sys/dev/usb/serial/ubser.c
  head/sys/dev/usb/serial/uchcom.c
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/serial/ulpt.c
  head/sys/dev/usb/serial/umodem.c
  head/sys/dev/usb/serial/umoscom.c
  head/sys/dev/usb/serial/uplcom.c
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/uslcom.c
  head/sys/dev/usb/serial/uvisor.c
  head/sys/dev/usb/serial/uvscom.c
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/storage/urio.c
  head/sys/dev/usb/storage/ustorage_fs.c
  head/sys/dev/usb/usb_debug.h
  head/sys/dev/usb/usb_freebsd.h
  head/sys/dev/usb/usb_request.c
  head/sys/dev/usb/usb_transfer.c
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_zyd.c
  head/sys/i386/conf/GENERIC
  head/sys/i386/conf/XBOX
  head/sys/ia64/conf/GENERIC
  head/sys/mips/conf/SENTRY5
  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	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/amd64/conf/GENERIC	Thu Apr 22 21:31:34 2010	(r207077)
@@ -281,6 +281,7 @@ device		firmware	# firmware assist modul
 device		bpf		# Berkeley packet filter
 
 # USB support
+#options 	USB_DEBUG	# enable debug msgs
 device		uhci		# UHCI PCI->USB interface
 device		ohci		# OHCI PCI->USB interface
 device		ehci		# EHCI PCI->USB interface (USB 2.0)

Modified: head/sys/arm/conf/DB-78XXX
==============================================================================
--- head/sys/arm/conf/DB-78XXX	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/arm/conf/DB-78XXX	Thu Apr 22 21:31:34 2010	(r207077)
@@ -67,6 +67,7 @@ device		e1000phy
 device		bpf
 
 # USB
+options 	USB_DEBUG	# enable debug msgs
 device		usb
 device		ehci
 device		umass

Modified: head/sys/arm/conf/DB-88F5XXX
==============================================================================
--- head/sys/arm/conf/DB-88F5XXX	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/arm/conf/DB-88F5XXX	Thu Apr 22 21:31:34 2010	(r207077)
@@ -74,6 +74,7 @@ device		iicbus
 device		ds133x
 
 # USB
+options 	USB_DEBUG	# enable debug msgs
 device		usb
 device		ehci
 device		umass

Modified: head/sys/arm/conf/DB-88F6XXX
==============================================================================
--- head/sys/arm/conf/DB-88F6XXX	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/arm/conf/DB-88F6XXX	Thu Apr 22 21:31:34 2010	(r207077)
@@ -67,6 +67,7 @@ device		e1000phy
 device		bpf
 
 # USB
+options 	USB_DEBUG	# enable debug msgs
 device		usb
 device		ehci
 device		umass

Modified: head/sys/arm/conf/HL200
==============================================================================
--- head/sys/arm/conf/HL200	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/arm/conf/HL200	Thu Apr 22 21:31:34 2010	(r207077)
@@ -95,6 +95,7 @@ device		icee
 
 device		bpf
 # USB support
+options 	USB_DEBUG	# enable debug msgs
 device		ohci		# OHCI localbus->USB interface
 device		usb		# USB Bus (required)
 #device		udbp		# USB Double Bulk Pipe devices

Modified: head/sys/arm/conf/KB920X
==============================================================================
--- head/sys/arm/conf/KB920X	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/arm/conf/KB920X	Thu Apr 22 21:31:34 2010	(r207077)
@@ -96,6 +96,7 @@ device		icee
 
 device		bpf
 # USB support
+options 	USB_DEBUG	# enable debug msgs
 device		ohci		# OHCI localbus->USB interface
 device		usb		# USB Bus (required)
 #device		udbp		# USB Double Bulk Pipe devices

Modified: head/sys/arm/conf/LN2410SBC
==============================================================================
--- head/sys/arm/conf/LN2410SBC	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/arm/conf/LN2410SBC	Thu Apr 22 21:31:34 2010	(r207077)
@@ -79,6 +79,7 @@ options 	WITNESS_SKIPSPIN	#Don't run wit
 
 device		md
 
+options 	USB_DEBUG	# enable debug msgs
 device		usb
 device		ohci
 device		umass

Modified: head/sys/arm/conf/SHEEVAPLUG
==============================================================================
--- head/sys/arm/conf/SHEEVAPLUG	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/arm/conf/SHEEVAPLUG	Thu Apr 22 21:31:34 2010	(r207077)
@@ -61,6 +61,7 @@ options		DEVICE_POLLING
 device		vlan
 
 # USB
+options 	USB_DEBUG	# enable debug msgs
 device		usb
 device		ehci
 device		umass

Modified: head/sys/dev/sound/usb/uaudio.c
==============================================================================
--- head/sys/dev/sound/usb/uaudio.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/sound/usb/uaudio.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -91,7 +91,7 @@ static int uaudio_default_rate = 0;		/* 
 static int uaudio_default_bits = 32;
 static int uaudio_default_channels = 0;		/* use default */
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int uaudio_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio");
@@ -321,7 +321,7 @@ static const struct uaudio_format uaudio
 #define	UAC_RECORD	3
 #define	UAC_NCLASSES	4
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static const char *uac_names[] = {
 	"outputs", "inputs", "equalization", "record"
 };
@@ -406,7 +406,7 @@ static void	umidi_init(device_t dev);
 static int32_t	umidi_probe(device_t dev);
 static int32_t	umidi_detach(device_t dev);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static void	uaudio_chan_dump_ep_desc(
 		    const usb_endpoint_descriptor_audio_t *);
 static void	uaudio_mixer_dump_cluster(uint8_t,
@@ -780,7 +780,7 @@ uaudio_detach(device_t dev)
  * AS - Audio Stream - routines
  *========================================================================*/
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static void
 uaudio_chan_dump_ep_desc(const usb_endpoint_descriptor_audio_t *ed)
 {
@@ -1019,7 +1019,7 @@ uaudio_chan_fill_info_sub(struct uaudio_
 				if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) {
 
 					chan->valid = 1;
-#if USB_DEBUG
+#ifdef USB_DEBUG
 					uaudio_chan_dump_ep_desc(ed1);
 					uaudio_chan_dump_ep_desc(ed2);
 
@@ -1689,7 +1689,7 @@ uaudio_mixer_add_ctl(struct uaudio_softc
 
 	uaudio_mixer_add_ctl_sub(sc, mc);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (uaudio_debug > 2) {
 		uint8_t i;
 
@@ -1708,7 +1708,7 @@ static void
 uaudio_mixer_add_input(struct uaudio_softc *sc,
     const struct uaudio_terminal_node *iot, int id)
 {
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	const struct usb_audio_input_terminal *d = iot[id].u.it;
 
 	DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x "
@@ -1724,7 +1724,7 @@ static void
 uaudio_mixer_add_output(struct uaudio_softc *sc,
     const struct uaudio_terminal_node *iot, int id)
 {
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	const struct usb_audio_output_terminal *d = iot[id].u.ot;
 
 	DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x "
@@ -2257,7 +2257,7 @@ error:
 	return (NULL);
 }
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static void
 uaudio_mixer_dump_cluster(uint8_t id, const struct uaudio_terminal_node *iot)
 {
@@ -2350,7 +2350,7 @@ done:
 	return (r);
 }
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 
 struct uaudio_tt_to_string {
 	uint16_t terminal_type;
@@ -2856,7 +2856,7 @@ uaudio_mixer_fill_info(struct uaudio_sof
 		(iot + i)->root = iot;
 	} while (i--);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	i = ID_max;
 	do {
 		uint8_t j;

Modified: head/sys/dev/usb/controller/ehci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/controller/ehci.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$");
    ((ehci_softc_t *)(((uint8_t *)(bus)) - \
     ((uint8_t *)&(((ehci_softc_t *)0)->sc_bus))))
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int ehcidebug = 0;
 static int ehcinohighspeed = 0;
 static int ehciiaadbug = 0;
@@ -258,7 +258,7 @@ ehci_init(ehci_softc_t *sc)
 	usb_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0);
 	usb_callout_init_mtx(&sc->sc_tmo_poll, &sc->sc_bus.bus_mtx, 0);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (ehciiaadbug)
 		sc->sc_flags |= EHCI_SCFLG_IAADBUG;
 	if (ehcilostintrbug)
@@ -486,7 +486,7 @@ ehci_init(ehci_softc_t *sc)
 
 	usb_bus_mem_flush_all(&sc->sc_bus, &ehci_iterate_hw_softc);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (ehcidebug) {
 		ehci_dump_sqh(sc, sc->sc_async_p_last);
 	}
@@ -685,7 +685,7 @@ ehci_shutdown(ehci_softc_t *sc)
 	}
 }
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static void
 ehci_dump_regs(ehci_softc_t *sc)
 {
@@ -1229,7 +1229,7 @@ ehci_non_isoc_done_sub(struct usb_xfer *
 
 	xfer->td_transfer_cache = td;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (status & EHCI_QTD_STATERRS) {
 		DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x"
 		    "status=%s%s%s%s%s%s%s%s\n",
@@ -1260,7 +1260,7 @@ ehci_non_isoc_done(struct usb_xfer *xfer
 	DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
 	    xfer, xfer->endpoint);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (ehcidebug > 10) {
 		ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
 
@@ -1527,7 +1527,7 @@ ehci_interrupt(ehci_softc_t *sc)
 
 	DPRINTFN(16, "real interrupt\n");
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (ehcidebug > 15) {
 		ehci_dump_regs(sc);
 	}
@@ -1548,7 +1548,7 @@ ehci_interrupt(ehci_softc_t *sc)
 	if (status & EHCI_STS_HSE) {
 		printf("%s: unrecoverable error, "
 		    "controller halted\n", __FUNCTION__);
-#if USB_DEBUG
+#ifdef USB_DEBUG
 		ehci_dump_regs(sc);
 		ehci_dump_isoc(sc);
 #endif
@@ -1978,7 +1978,7 @@ ehci_setup_standard_chain(struct usb_xfe
 
 	xfer->td_transfer_last = td;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (ehcidebug > 8) {
 		DPRINTF("nexttog=%d; data before transfer:\n",
 		    xfer->endpoint->toggle_next);
@@ -2106,7 +2106,7 @@ ehci_isoc_fs_done(ehci_softc_t *sc, stru
 		if (pp_last >= &sc->sc_isoc_fs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]) {
 			pp_last = &sc->sc_isoc_fs_p_last[0];
 		}
-#if USB_DEBUG
+#ifdef USB_DEBUG
 		if (ehcidebug > 15) {
 			DPRINTF("isoc FS-TD\n");
 			ehci_dump_sitd(sc, td);
@@ -2160,7 +2160,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru
 		if (pp_last >= &sc->sc_isoc_hs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]) {
 			pp_last = &sc->sc_isoc_hs_p_last[0];
 		}
-#if USB_DEBUG
+#ifdef USB_DEBUG
 		if (ehcidebug > 15) {
 			DPRINTF("isoc HS-TD\n");
 			ehci_dump_itd(sc, td);
@@ -2224,7 +2224,7 @@ ehci_device_done(struct usb_xfer *xfer, 
 
 	if ((methods == &ehci_device_bulk_methods) ||
 	    (methods == &ehci_device_ctrl_methods)) {
-#if USB_DEBUG
+#ifdef USB_DEBUG
 		if (ehcidebug > 8) {
 			DPRINTF("nexttog=%d; data after transfer:\n",
 			    xfer->endpoint->toggle_next);
@@ -2509,7 +2509,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe
 	uint8_t sb;
 	uint8_t error;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	uint8_t once = 1;
 
 #endif
@@ -2593,7 +2593,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe
 		/* reuse sitd_portaddr and sitd_back from last transfer */
 
 		if (*plen > xfer->max_frame_size) {
-#if USB_DEBUG
+#ifdef USB_DEBUG
 			if (once) {
 				once = 0;
 				printf("%s: frame length(%d) exceeds %d "
@@ -2683,7 +2683,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe
 		}
 		usb_pc_cpu_flush(td->page_cache);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 		if (ehcidebug > 15) {
 			DPRINTF("FS-TD %d\n", nframes);
 			ehci_dump_sitd(sc, td);
@@ -2800,7 +2800,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe
 	uint8_t td_no;
 	uint8_t page_no;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	uint8_t once = 1;
 
 #endif
@@ -2878,7 +2878,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe
 		}
 		/* range check */
 		if (*plen > xfer->max_frame_size) {
-#if USB_DEBUG
+#ifdef USB_DEBUG
 			if (once) {
 				once = 0;
 				printf("%s: frame length(%d) exceeds %d bytes "
@@ -2962,7 +2962,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe
 				td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC);
 			}
 			usb_pc_cpu_flush(td->page_cache);
-#if USB_DEBUG
+#ifdef USB_DEBUG
 			if (ehcidebug > 15) {
 				DPRINTF("HS-TD %d\n", nframes);
 				ehci_dump_itd(sc, td);
@@ -3398,7 +3398,7 @@ ehci_roothub_exec(struct usb_device *ude
 			break;
 		case UHF_PORT_RESET:
 			DPRINTFN(6, "reset port %d\n", index);
-#if USB_DEBUG
+#ifdef USB_DEBUG
 			if (ehcinohighspeed) {
 				/*
 				 * Connect USB device to companion

Modified: head/sys/dev/usb/controller/uhci.c
==============================================================================
--- head/sys/dev/usb/controller/uhci.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/controller/uhci.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$");
    ((uhci_softc_t *)(((uint8_t *)(bus)) - \
     ((uint8_t *)&(((uhci_softc_t *)0)->sc_bus))))
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int uhcidebug = 0;
 static int uhcinoloop = 0;
 
@@ -459,7 +459,7 @@ uhci_init(uhci_softc_t *sc)
 
 	usb_callout_init_mtx(&sc->sc_root_intr, &sc->sc_bus.bus_mtx, 0);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (uhcidebug > 2) {
 		uhci_dumpregs(sc);
 	}
@@ -668,7 +668,7 @@ uhci_suspend(uhci_softc_t *sc)
 {
 	USB_BUS_LOCK(&sc->sc_bus);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (uhcidebug > 2) {
 		uhci_dumpregs(sc);
 	}
@@ -712,7 +712,7 @@ uhci_resume(uhci_softc_t *sc)
 
 	uhci_start(sc);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (uhcidebug > 2) {
 		uhci_dumpregs(sc);
 	}
@@ -724,7 +724,7 @@ uhci_resume(uhci_softc_t *sc)
 	uhci_do_poll(&sc->sc_bus);
 }
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static void
 uhci_dumpregs(uhci_softc_t *sc)
 {
@@ -855,7 +855,7 @@ uhci_add_loop(uhci_softc_t *sc)
 	struct uhci_qh *qh_lst;
 	struct uhci_qh *qh_rec;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (uhcinoloop) {
 		return;
 	}
@@ -878,7 +878,7 @@ uhci_rem_loop(uhci_softc_t *sc)
 {
 	struct uhci_qh *qh_lst;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (uhcinoloop) {
 		return;
 	}
@@ -1046,7 +1046,7 @@ uhci_isoc_done(uhci_softc_t *sc, struct 
 		if (pp_last >= &sc->sc_isoc_p_last[UHCI_VFRAMELIST_COUNT]) {
 			pp_last = &sc->sc_isoc_p_last[0];
 		}
-#if USB_DEBUG
+#ifdef USB_DEBUG
 		if (uhcidebug > 5) {
 			DPRINTF("isoc TD\n");
 			uhci_dump_td(td);
@@ -1177,7 +1177,7 @@ uhci_non_isoc_done_sub(struct usb_xfer *
 
 	xfer->endpoint->toggle_next = (token & UHCI_TD_SET_DT(1)) ? 0 : 1;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (status & UHCI_TD_ERROR) {
 		DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x "
 		    "status=%s%s%s%s%s%s%s%s%s%s%s\n",
@@ -1207,7 +1207,7 @@ uhci_non_isoc_done(struct usb_xfer *xfer
 	DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
 	    xfer, xfer->endpoint);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (uhcidebug > 10) {
 		uhci_dump_tds(xfer->td_transfer_first);
 	}
@@ -1446,7 +1446,7 @@ uhci_interrupt(uhci_softc_t *sc)
 
 	DPRINTFN(16, "real interrupt\n");
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (uhcidebug > 15) {
 		uhci_dumpregs(sc);
 	}
@@ -1460,7 +1460,7 @@ uhci_interrupt(uhci_softc_t *sc)
 	    UHCI_STS_HCPE | UHCI_STS_HCH)) {
 
 		if (status & UHCI_STS_RD) {
-#if USB_DEBUG
+#ifdef USB_DEBUG
 			printf("%s: resume detect\n",
 			    __FUNCTION__);
 #endif
@@ -1477,7 +1477,7 @@ uhci_interrupt(uhci_softc_t *sc)
 			/* no acknowledge needed */
 			DPRINTF("%s: host controller halted\n",
 			    __FUNCTION__);
-#if USB_DEBUG
+#ifdef USB_DEBUG
 			if (uhcidebug > 0) {
 				uhci_dump_all(sc);
 			}
@@ -1839,7 +1839,7 @@ uhci_setup_standard_chain(struct usb_xfe
 
 	xfer->td_transfer_last = td;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (uhcidebug > 8) {
 		DPRINTF("nexttog=%d; data before transfer:\n",
 		    xfer->endpoint->toggle_next);
@@ -2155,7 +2155,7 @@ uhci_device_isoc_enter(struct usb_xfer *
 	uint32_t temp;
 	uint32_t *plen;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	uint8_t once = 1;
 
 #endif
@@ -2227,7 +2227,7 @@ uhci_device_isoc_enter(struct usb_xfer *
 			pp_last = &sc->sc_isoc_p_last[0];
 		}
 		if (*plen > xfer->max_frame_size) {
-#if USB_DEBUG
+#ifdef USB_DEBUG
 			if (once) {
 				once = 0;
 				printf("%s: frame length(%d) exceeds %d "
@@ -2279,7 +2279,7 @@ uhci_device_isoc_enter(struct usb_xfer *
 
 		usb_pc_cpu_flush(td->page_cache);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 		if (uhcidebug > 5) {
 			DPRINTF("TD %d\n", nframes);
 			uhci_dump_td(td);

Modified: head/sys/dev/usb/controller/uss820dci.c
==============================================================================
--- head/sys/dev/usb/controller/uss820dci.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/controller/uss820dci.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -77,7 +77,7 @@
 #define	USS820_DCI_PC2SC(pc) \
    USS820_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int uss820dcidebug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, uss820dci, CTLFLAG_RW, 0, "USB uss820dci");

Modified: head/sys/dev/usb/input/atp.c
==============================================================================
--- head/sys/dev/usb/input/atp.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/input/atp.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$");
 /* Tunables */
 SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp");
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 enum atp_log_level {
 	ATP_LLEVEL_DISABLED = 0,
 	ATP_LLEVEL_ERROR,
@@ -126,7 +126,7 @@ enum atp_log_level {
 static int atp_debug = ATP_LLEVEL_ERROR; /* the default is to only log errors */
 SYSCTL_INT(_hw_usb_atp, OID_AUTO, debug, CTLFLAG_RW,
     &atp_debug, ATP_LLEVEL_ERROR, "ATP debug level");
-#endif /* #if USB_DEBUG */
+#endif /* USB_DEBUG */
 
 static u_int atp_touch_timeout = ATP_TOUCH_TIMEOUT;
 SYSCTL_INT(_hw_usb_atp, OID_AUTO, touch_timeout, CTLFLAG_RW, &atp_touch_timeout,
@@ -1055,7 +1055,7 @@ atp_update_strokes(struct atp_softc *sc,
 		if (pspans_y[j].matched == FALSE) break;
 	}
 	if ((i < n_xpspans) && (j < n_ypspans)) {
-#if USB_DEBUG
+#ifdef USB_DEBUG
 		if (atp_debug >= ATP_LLEVEL_INFO) {
 			printf("unmatched pspans:");
 			for (; i < n_xpspans; i++) {
@@ -1072,7 +1072,7 @@ atp_update_strokes(struct atp_softc *sc,
 			}
 			printf("\n");
 		}
-#endif /* #if USB_DEBUG */
+#endif /* USB_DEBUG */
 		if ((n_xpspans == 1) && (n_ypspans == 1))
 			/* The common case of a single pair of new pspans. */
 			atp_add_stroke(sc, &pspans_x[0], &pspans_y[0]);
@@ -1082,7 +1082,7 @@ atp_update_strokes(struct atp_softc *sc,
 			    pspans_y, n_ypspans);
 	}
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (atp_debug >= ATP_LLEVEL_INFO) {
 		for (i = 0; i < sc->sc_n_strokes; i++) {
 			atp_stroke *stroke = &sc->sc_strokes[i];
@@ -1110,7 +1110,7 @@ atp_update_strokes(struct atp_softc *sc,
 		if (sc->sc_n_strokes)
 			printf("\n");
 	}
-#endif /* #if USB_DEBUG */
+#endif /* USB_DEBUG */
 
 	return (movement);
 }

Modified: head/sys/dev/usb/input/uhid.c
==============================================================================
--- head/sys/dev/usb/input/uhid.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/input/uhid.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int uhid_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, uhid, CTLFLAG_RW, 0, "USB uhid");

Modified: head/sys/dev/usb/input/ukbd.c
==============================================================================
--- head/sys/dev/usb/input/ukbd.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/input/ukbd.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$");
 /* the following file must be included after "ukbdmap.h" */
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int ukbd_debug = 0;
 static int ukbd_no_leds = 0;
 
@@ -612,7 +612,7 @@ ukbd_intr_callback(struct usb_xfer *xfer
 				apple_fn = 1;
 			else
 				apple_fn = 0;
-#if USB_DEBUG
+#ifdef USB_DEBUG
 			DPRINTF("apple_eject=%u apple_fn=%u\n",
 			    apple_eject, apple_fn);
 
@@ -678,7 +678,7 @@ ukbd_set_leds_callback(struct usb_xfer *
 	uint8_t buf[2];
 	struct ukbd_softc *sc = usbd_xfer_softc(xfer);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (ukbd_no_leds)
 		return;
 #endif

Modified: head/sys/dev/usb/input/ums.c
==============================================================================
--- head/sys/dev/usb/input/ums.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/input/ums.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int ums_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, "USB ums");
@@ -494,7 +494,9 @@ ums_attach(device_t dev)
 	int err;
 	uint16_t d_len;
 	uint8_t i;
+#ifdef USB_DEBUG
 	uint8_t j;
+#endif
 
 	DPRINTFN(11, "sc=%p\n", sc);
 
@@ -588,7 +590,7 @@ ums_attach(device_t dev)
 	free(d_ptr, M_TEMP);
 	d_ptr = NULL;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	for (j = 0; j < UMS_INFO_MAX; j++) {
 		info = &sc->sc_info[j];
 

Modified: head/sys/dev/usb/misc/udbp.c
==============================================================================
--- head/sys/dev/usb/misc/udbp.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/misc/udbp.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -94,7 +94,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int udbp_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW, 0, "USB udbp");

Modified: head/sys/dev/usb/net/if_aue.c
==============================================================================
--- head/sys/dev/usb/net/if_aue.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/net/if_aue.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -100,7 +100,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int aue_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, aue, CTLFLAG_RW, 0, "USB aue");

Modified: head/sys/dev/usb/net/if_axe.c
==============================================================================
--- head/sys/dev/usb/net/if_axe.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/net/if_axe.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -123,7 +123,7 @@ __FBSDID("$FreeBSD$");
  */
 #define AXE_178_MAX_FRAME_BURST	1
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int axe_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, axe, CTLFLAG_RW, 0, "USB axe");

Modified: head/sys/dev/usb/net/if_cdce.c
==============================================================================
--- head/sys/dev/usb/net/if_cdce.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/net/if_cdce.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -108,7 +108,7 @@ static uether_fn_t cdce_setpromisc;
 
 static uint32_t	cdce_m_crc32(struct mbuf *, uint32_t, uint32_t);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int cdce_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet");

Modified: head/sys/dev/usb/net/if_cue.c
==============================================================================
--- head/sys/dev/usb/net/if_cue.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/net/if_cue.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -122,7 +122,7 @@ static int	cue_getmac(struct cue_softc *
 static uint32_t	cue_mchash(const uint8_t *);
 static void	cue_reset(struct cue_softc *);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int cue_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, cue, CTLFLAG_RW, 0, "USB cue");

Modified: head/sys/dev/usb/net/if_kue.c
==============================================================================
--- head/sys/dev/usb/net/if_kue.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/net/if_kue.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -163,7 +163,7 @@ static int	kue_ctl(struct kue_softc *, u
 static int	kue_load_fw(struct kue_softc *);
 static void	kue_reset(struct kue_softc *);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int kue_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, kue, CTLFLAG_RW, 0, "USB kue");

Modified: head/sys/dev/usb/net/if_rue.c
==============================================================================
--- head/sys/dev/usb/net/if_rue.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/net/if_rue.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -97,7 +97,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int rue_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW, 0, "USB rue");

Modified: head/sys/dev/usb/net/if_udav.c
==============================================================================
--- head/sys/dev/usb/net/if_udav.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/net/if_udav.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -185,7 +185,7 @@ static const struct usb_ether_methods ud
 	.ue_mii_sts = udav_ifmedia_status,
 };
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int udav_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, udav, CTLFLAG_RW, 0, "USB udav");

Modified: head/sys/dev/usb/serial/u3g.c
==============================================================================
--- head/sys/dev/usb/serial/u3g.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/u3g.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -63,7 +63,7 @@
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int u3g_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, u3g, CTLFLAG_RW, 0, "USB 3g");

Modified: head/sys/dev/usb/serial/ubsa.c
==============================================================================
--- head/sys/dev/usb/serial/ubsa.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/ubsa.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -93,7 +93,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int ubsa_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, "USB ubsa");
@@ -405,9 +405,8 @@ ubsa_cfg_set_break(struct ucom_softc *uc
 static int
 ubsa_pre_param(struct ucom_softc *ucom, struct termios *t)
 {
-	struct ubsa_softc *sc = ucom->sc_parent;
 
-	DPRINTF("sc = %p\n", sc);
+	DPRINTF("sc = %p\n", ucom->sc_parent);
 
 	switch (t->c_ospeed) {
 	case B0:

Modified: head/sys/dev/usb/serial/ubser.c
==============================================================================
--- head/sys/dev/usb/serial/ubser.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/ubser.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -115,7 +115,7 @@ __FBSDID("$FreeBSD$");
 #define	VENDOR_SET_BREAK		0x02
 #define	VENDOR_CLEAR_BREAK		0x03
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int ubser_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ubser, CTLFLAG_RW, 0, "USB ubser");

Modified: head/sys/dev/usb/serial/uchcom.c
==============================================================================
--- head/sys/dev/usb/serial/uchcom.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/uchcom.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -101,7 +101,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int uchcom_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, uchcom, CTLFLAG_RW, 0, "USB uchcom");

Modified: head/sys/dev/usb/serial/uftdi.c
==============================================================================
--- head/sys/dev/usb/serial/uftdi.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/uftdi.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int uftdi_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi");

Modified: head/sys/dev/usb/serial/ulpt.c
==============================================================================
--- head/sys/dev/usb/serial/ulpt.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/ulpt.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int ulpt_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ulpt, CTLFLAG_RW, 0, "USB ulpt");

Modified: head/sys/dev/usb/serial/umodem.c
==============================================================================
--- head/sys/dev/usb/serial/umodem.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/umodem.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int umodem_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, umodem, CTLFLAG_RW, 0, "USB umodem");

Modified: head/sys/dev/usb/serial/umoscom.c
==============================================================================
--- head/sys/dev/usb/serial/umoscom.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/umoscom.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -48,7 +48,7 @@
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int umoscom_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, umoscom, CTLFLAG_RW, 0, "USB umoscom");

Modified: head/sys/dev/usb/serial/uplcom.c
==============================================================================
--- head/sys/dev/usb/serial/uplcom.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/uplcom.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int uplcom_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, uplcom, CTLFLAG_RW, 0, "USB uplcom");

Modified: head/sys/dev/usb/serial/usb_serial.c
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/usb_serial.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -104,7 +104,7 @@ __FBSDID("$FreeBSD$");
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom");
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int ucom_debug = 0;
 
 SYSCTL_INT(_hw_usb_ucom, OID_AUTO, debug, CTLFLAG_RW,

Modified: head/sys/dev/usb/serial/uslcom.c
==============================================================================
--- head/sys/dev/usb/serial/uslcom.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/uslcom.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int uslcom_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, uslcom, CTLFLAG_RW, 0, "USB uslcom");

Modified: head/sys/dev/usb/serial/uvisor.c
==============================================================================
--- head/sys/dev/usb/serial/uvisor.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/uvisor.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -78,7 +78,7 @@
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int uvisor_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, uvisor, CTLFLAG_RW, 0, "USB uvisor");
@@ -392,7 +392,7 @@ uvisor_init(struct uvisor_softc *sc, str
 			goto done;
 		}
 	}
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	if (sc->sc_flag & UVISOR_FLAG_VISOR) {
 		uint16_t i, np;
 		const char *desc;

Modified: head/sys/dev/usb/serial/uvscom.c
==============================================================================
--- head/sys/dev/usb/serial/uvscom.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/serial/uvscom.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int uvscom_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, uvscom, CTLFLAG_RW, 0, "USB uvscom");

Modified: head/sys/dev/usb/storage/umass.c
==============================================================================
--- head/sys/dev/usb/storage/umass.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/storage/umass.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -146,7 +146,7 @@ __FBSDID("$FreeBSD$");
 #define	UMASS_USB_FLAGS
 #endif
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 #define	DIF(m, x)				\
   do {						\
     if (umass_debug & (m)) { x ; }		\
@@ -488,7 +488,7 @@ static uint8_t	umass_no_transform(struct
 static uint8_t	umass_std_transform(struct umass_softc *, union ccb *, uint8_t
 		    *, uint8_t);
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static void	umass_bbb_dump_cbw(struct umass_softc *, umass_bbb_cbw_t *);
 static void	umass_bbb_dump_csw(struct umass_softc *, umass_bbb_csw_t *);
 static void	umass_cbi_dump_cmd(struct umass_softc *, void *, uint8_t);
@@ -917,7 +917,7 @@ umass_attach(device_t dev)
 	}
 	sc->sc_iface_no = id->bInterfaceNumber;
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 	device_printf(dev, " ");
 
 	switch (sc->sc_proto & UMASS_PROTO_COMMAND) {
@@ -3012,7 +3012,7 @@ umass_std_transform(struct umass_softc *
 	return (1);
 }
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static void
 umass_bbb_dump_cbw(struct umass_softc *sc, umass_bbb_cbw_t *cbw)
 {

Modified: head/sys/dev/usb/storage/urio.c
==============================================================================
--- head/sys/dev/usb/storage/urio.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/storage/urio.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int urio_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, urio, CTLFLAG_RW, 0, "USB urio");

Modified: head/sys/dev/usb/storage/ustorage_fs.c
==============================================================================
--- head/sys/dev/usb/storage/ustorage_fs.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/storage/ustorage_fs.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -64,7 +64,7 @@
 #define	USB_DEBUG_VAR ustorage_fs_debug
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int ustorage_fs_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ustorage_fs, CTLFLAG_RW, 0, "USB ustorage_fs");

Modified: head/sys/dev/usb/usb_debug.h
==============================================================================
--- head/sys/dev/usb/usb_debug.h	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/usb_debug.h	Thu Apr 22 21:31:34 2010	(r207077)
@@ -34,7 +34,7 @@ extern int usb_debug;
 
 /* Check if USB debugging is enabled. */
 #ifdef USB_DEBUG_VAR
-#if (USB_DEBUG != 0)
+#ifdef USB_DEBUG
 #define	DPRINTFN(n,fmt,...) do {		\
   if ((USB_DEBUG_VAR) >= (n)) {			\
     printf("%s: " fmt,				\

Modified: head/sys/dev/usb/usb_freebsd.h
==============================================================================
--- head/sys/dev/usb/usb_freebsd.h	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/usb_freebsd.h	Thu Apr 22 21:31:34 2010	(r207077)
@@ -57,10 +57,6 @@
 #define	USB_HUB_MAX_DEPTH	5
 #define	USB_EP0_BUFSIZE		1024	/* bytes */
 
-#ifndef USB_DEBUG
-#define USB_DEBUG 1
-#endif
-
 typedef uint32_t usb_timeout_t;		/* milliseconds */
 typedef uint32_t usb_frlength_t;	/* bytes */
 typedef uint32_t usb_frcount_t;		/* units */

Modified: head/sys/dev/usb/usb_request.c
==============================================================================
--- head/sys/dev/usb/usb_request.c	Thu Apr 22 21:17:00 2010	(r207076)
+++ head/sys/dev/usb/usb_request.c	Thu Apr 22 21:31:34 2010	(r207077)
@@ -68,7 +68,7 @@
 #include 
 #include 
 
-#if USB_DEBUG
+#ifdef USB_DEBUG
 static int usb_pr_poll_delay = USB_PORT_RESET_DELAY;
 static int usb_pr_recovery_delay = USB_PORT_RESET_RECOVERY;
 static int usb_ss_delay = 0;
@@ -433,7 +433,7 @@ usbd_do_request_flags(struct usb_device 
 		} else {
 			if (xfer->frlengths[0] == 0) {
 				if (xfer->flags.manual_status) {
-#if USB_DEBUG
+#ifdef USB_DEBUG
 					int temp;
 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 21:41: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 DB68D106566C;
	Thu, 22 Apr 2010 21:41:50 +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 C984D8FC17;
	Thu, 22 Apr 2010 21:41: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 o3MLfot7099866;
	Thu, 22 Apr 2010 21:41:50 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MLfoRj099864;
	Thu, 22 Apr 2010 21:41:50 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004222141.o3MLfoRj099864@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 22 Apr 2010 21:41: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: r207078 - head/sys/dev/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: Thu, 22 Apr 2010 21:41:51 -0000

Author: thompsa
Date: Thu Apr 22 21:41:50 2010
New Revision: 207078
URL: http://svn.freebsd.org/changeset/base/207078

Log:
  Use SX_DUPOK rather than making the string unique.

Modified:
  head/sys/dev/usb/usb_device.c

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Thu Apr 22 21:31:34 2010	(r207077)
+++ head/sys/dev/usb/usb_device.c	Thu Apr 22 21:41:50 2010	(r207078)
@@ -1491,10 +1491,10 @@ usb_alloc_device(device_t parent_dev, st
 		return (NULL);
 	}
 	/* initialise our SX-lock */
-	sx_init(udev->default_sx, "0123456789ABCDEF - USB device SX lock" + depth);
+	sx_init_flags(udev->default_sx, "USB device SX lock", SX_DUPOK);
 
 	/* initialise our SX-lock */
-	sx_init(udev->default_sx + 1, "0123456789ABCDEF - USB config SX lock" + depth);
+	sx_init_flags(udev->default_sx + 1, "USB config SX lock", SX_DUPOK);
 
 	cv_init(udev->default_cv, "WCTRL");
 	cv_init(udev->default_cv + 1, "UGONE");

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 22:00: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 0A600106564A;
	Thu, 22 Apr 2010 22:00:17 +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 EC3538FC12;
	Thu, 22 Apr 2010 22:00: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 o3MM0GlW004109;
	Thu, 22 Apr 2010 22:00:16 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MM0GAQ004103;
	Thu, 22 Apr 2010 22:00:16 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004222200.o3MM0GAQ004103@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 22 Apr 2010 22:00:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207079 - head/sys/dev/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: Thu, 22 Apr 2010 22:00:17 -0000

Author: thompsa
Date: Thu Apr 22 22:00:16 2010
New Revision: 207079
URL: http://svn.freebsd.org/changeset/base/207079

Log:
  Properly name the sxlocks, mutexes and condvars.

Modified:
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_request.c
  head/sys/dev/usb/usb_transfer.c

Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c	Thu Apr 22 21:41:50 2010	(r207078)
+++ head/sys/dev/usb/usb_dev.c	Thu Apr 22 22:00:16 2010	(r207079)
@@ -284,7 +284,7 @@ error:
 		usbd_enum_unlock(cpd->udev);
 
 		if (--(cpd->udev->refcount) == 0) {
-			cv_signal(cpd->udev->default_cv + 1);
+			cv_signal(&cpd->udev->ref_cv);
 		}
 	}
 	mtx_unlock(&usb_ref_lock);
@@ -352,7 +352,7 @@ usb_unref_device(struct usb_cdev_privdat
 	}
 	if (crd->is_uref) {
 		if (--(cpd->udev->refcount) == 0) {
-			cv_signal(cpd->udev->default_cv + 1);
+			cv_signal(&cpd->udev->ref_cv);
 		}
 		crd->is_uref = 0;
 	}
@@ -500,7 +500,7 @@ usb_fifo_create(struct usb_cdev_privdata
 		/* update some fields */
 		f->fifo_index = n + USB_FIFO_TX;
 		f->dev_ep_index = e;
-		f->priv_mtx = udev->default_mtx;
+		f->priv_mtx = &udev->device_mtx;
 		f->priv_sc0 = ep;
 		f->methods = &usb_ugen_methods;
 		f->iface_index = ep->iface_index;
@@ -527,7 +527,7 @@ usb_fifo_create(struct usb_cdev_privdata
 		/* update some fields */
 		f->fifo_index = n + USB_FIFO_RX;
 		f->dev_ep_index = e;
-		f->priv_mtx = udev->default_mtx;
+		f->priv_mtx = &udev->device_mtx;
 		f->priv_sc0 = ep;
 		f->methods = &usb_ugen_methods;
 		f->iface_index = ep->iface_index;

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Thu Apr 22 21:41:50 2010	(r207078)
+++ head/sys/dev/usb/usb_device.c	Thu Apr 22 22:00:16 2010	(r207079)
@@ -655,7 +655,7 @@ usb_config_parse(struct usb_device *udev
 		goto cleanup;
 
 	if (cmd == USB_CFG_INIT) {
-		sx_assert(udev->default_sx + 1, SA_LOCKED);
+		sx_assert(&udev->enum_sx, SA_LOCKED);
 
 		/* check for in-use endpoints */
 
@@ -1062,7 +1062,7 @@ usb_detach_device(struct usb_device *ude
 	}
 	DPRINTFN(4, "udev=%p\n", udev);
 
-	sx_assert(udev->default_sx + 1, SA_LOCKED);
+	sx_assert(&udev->enum_sx, SA_LOCKED);
 
 	/*
 	 * First detach the child to give the child's detach routine a
@@ -1380,7 +1380,7 @@ usb_suspend_resume(struct usb_device *ud
 	}
 	DPRINTFN(4, "udev=%p do_suspend=%d\n", udev, do_suspend);
 
-	sx_assert(udev->default_sx + 1, SA_LOCKED);
+	sx_assert(&udev->enum_sx, SA_LOCKED);
 
 	USB_BUS_LOCK(udev->bus);
 	/* filter the suspend events */
@@ -1419,13 +1419,13 @@ usbd_clear_stall_proc(struct usb_proc_ms
 
 	/* Change lock */
 	USB_BUS_UNLOCK(udev->bus);
-	mtx_lock(udev->default_mtx);
+	mtx_lock(&udev->device_mtx);
 
 	/* Start clear stall callback */
 	usbd_transfer_start(udev->default_xfer[1]);
 
 	/* Change lock */
-	mtx_unlock(udev->default_mtx);
+	mtx_unlock(&udev->device_mtx);
 	USB_BUS_LOCK(udev->bus);
 }
 
@@ -1491,16 +1491,16 @@ usb_alloc_device(device_t parent_dev, st
 		return (NULL);
 	}
 	/* initialise our SX-lock */
-	sx_init_flags(udev->default_sx, "USB device SX lock", SX_DUPOK);
+	sx_init_flags(&udev->ctrl_sx, "USB device SX lock", SX_DUPOK);
 
 	/* initialise our SX-lock */
-	sx_init_flags(udev->default_sx + 1, "USB config SX lock", SX_DUPOK);
+	sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK);
 
-	cv_init(udev->default_cv, "WCTRL");
-	cv_init(udev->default_cv + 1, "UGONE");
+	cv_init(&udev->ctrlreq_cv, "WCTRL");
+	cv_init(&udev->ref_cv, "UGONE");
 
 	/* initialise our mutex */
-	mtx_init(udev->default_mtx, "USB device mutex", NULL, MTX_DEF);
+	mtx_init(&udev->device_mtx, "USB device mutex", NULL, MTX_DEF);
 
 	/* initialise generic clear stall */
 	udev->cs_msg[0].hdr.pm_callback = &usbd_clear_stall_proc;
@@ -2005,7 +2005,7 @@ usb_free_device(struct usb_device *udev,
 	mtx_lock(&usb_ref_lock);
 	udev->refcount--;
 	while (udev->refcount != 0) {
-		cv_wait(udev->default_cv + 1, &usb_ref_lock);
+		cv_wait(&udev->ref_cv, &usb_ref_lock);
 	}
 	mtx_unlock(&usb_ref_lock);
 
@@ -2036,13 +2036,13 @@ usb_free_device(struct usb_device *udev,
 	    &udev->cs_msg[0], &udev->cs_msg[1]);
 	USB_BUS_UNLOCK(udev->bus);
 
-	sx_destroy(udev->default_sx);
-	sx_destroy(udev->default_sx + 1);
+	sx_destroy(&udev->ctrl_sx);
+	sx_destroy(&udev->enum_sx);
 
-	cv_destroy(udev->default_cv);
-	cv_destroy(udev->default_cv + 1);
+	cv_destroy(&udev->ctrlreq_cv);
+	cv_destroy(&udev->ref_cv);
 
-	mtx_destroy(udev->default_mtx);
+	mtx_destroy(&udev->device_mtx);
 #if USB_HAVE_UGEN
 	KASSERT(LIST_FIRST(&udev->pd_list) == NULL, ("leaked cdev entries"));
 #endif
@@ -2588,7 +2588,7 @@ usbd_device_attached(struct usb_device *
 void
 usbd_enum_lock(struct usb_device *udev)
 {
-	sx_xlock(udev->default_sx + 1);
+	sx_xlock(&udev->enum_sx);
 	/* 
 	 * NEWBUS LOCK NOTE: We should check if any parent SX locks
 	 * are locked before locking Giant. Else the lock can be
@@ -2603,7 +2603,7 @@ void
 usbd_enum_unlock(struct usb_device *udev)
 {
 	mtx_unlock(&Giant);
-	sx_xunlock(udev->default_sx + 1);
+	sx_xunlock(&udev->enum_sx);
 }
 
 /*
@@ -2614,5 +2614,5 @@ usbd_enum_unlock(struct usb_device *udev
 uint8_t
 usbd_enum_is_locked(struct usb_device *udev)
 {
-	return (sx_xlocked(udev->default_sx + 1));
+	return (sx_xlocked(&udev->enum_sx));
 }

Modified: head/sys/dev/usb/usb_device.h
==============================================================================
--- head/sys/dev/usb/usb_device.h	Thu Apr 22 21:41:50 2010	(r207078)
+++ head/sys/dev/usb/usb_device.h	Thu Apr 22 22:00:16 2010	(r207079)
@@ -113,9 +113,11 @@ struct usb_power_save {
 struct usb_device {
 	struct usb_clear_stall_msg cs_msg[2];	/* generic clear stall
 						 * messages */
-	struct sx default_sx[2];
-	struct mtx default_mtx[1];
-	struct cv default_cv[2];
+	struct sx ctrl_sx;
+	struct sx enum_sx;
+	struct mtx device_mtx;
+	struct cv ctrlreq_cv;
+	struct cv ref_cv;
 	struct usb_interface *ifaces;
 	struct usb_endpoint default_ep;	/* Control Endpoint 0 */
 	struct usb_endpoint *endpoints;

Modified: head/sys/dev/usb/usb_request.c
==============================================================================
--- head/sys/dev/usb/usb_request.c	Thu Apr 22 21:41:50 2010	(r207078)
+++ head/sys/dev/usb/usb_request.c	Thu Apr 22 22:00:16 2010	(r207079)
@@ -99,7 +99,7 @@ usbd_do_request_callback(struct usb_xfer
 		usbd_transfer_submit(xfer);
 		break;
 	default:
-		cv_signal(xfer->xroot->udev->default_cv);
+		cv_signal(&xfer->xroot->udev->ctrlreq_cv);
 		break;
 	}
 }
@@ -319,7 +319,7 @@ usbd_do_request_flags(struct usb_device 
 	 * is achieved when multiple threads are involved:
 	 */
 
-	sx_xlock(udev->default_sx);
+	sx_xlock(&udev->ctrl_sx);
 
 	hr_func = usbd_get_hr_func(udev);
 
@@ -457,7 +457,7 @@ usbd_do_request_flags(struct usb_device 
 		usbd_transfer_start(xfer);
 
 		while (usbd_transfer_pending(xfer)) {
-			cv_wait(udev->default_cv,
+			cv_wait(&udev->ctrlreq_cv,
 			    xfer->xroot->xfer_mtx);
 		}
 
@@ -534,7 +534,7 @@ usbd_do_request_flags(struct usb_device 
 	USB_XFER_UNLOCK(xfer);
 
 done:
-	sx_xunlock(udev->default_sx);
+	sx_xunlock(&udev->ctrl_sx);
 
 	if (mtx) {
 		mtx_lock(mtx);

Modified: head/sys/dev/usb/usb_transfer.c
==============================================================================
--- head/sys/dev/usb/usb_transfer.c	Thu Apr 22 21:41:50 2010	(r207078)
+++ head/sys/dev/usb/usb_transfer.c	Thu Apr 22 22:00:16 2010	(r207079)
@@ -2821,7 +2821,7 @@ repeat:
 	iface_index = 0;
 	if (usbd_transfer_setup(udev, &iface_index,
 	    udev->default_xfer, usb_control_ep_cfg, USB_DEFAULT_XFER_MAX, NULL,
-	    udev->default_mtx)) {
+	    &udev->device_mtx)) {
 		DPRINTFN(0, "could not setup default "
 		    "USB transfer\n");
 	} else {

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 22:15: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 0ACFE1065672;
	Thu, 22 Apr 2010 22:15:09 +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 EBD558FC1D;
	Thu, 22 Apr 2010 22:15: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 o3MMF8QQ007491;
	Thu, 22 Apr 2010 22:15:08 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MMF8ia007481;
	Thu, 22 Apr 2010 22:15:08 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004222215.o3MMF8ia007481@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 22 Apr 2010 22:15: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: r207080 - head/sys/dev/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: Thu, 22 Apr 2010 22:15:09 -0000

Author: thompsa
Date: Thu Apr 22 22:15:08 2010
New Revision: 207080
URL: http://svn.freebsd.org/changeset/base/207080

Log:
  Use a more obvious prefix for the USB control (endpoint 0) transfers rather
  than default_*.

Modified:
  head/sys/dev/usb/usb_compat_linux.c
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_request.c
  head/sys/dev/usb/usb_transfer.c
  head/sys/dev/usb/usb_transfer.h

Modified: head/sys/dev/usb/usb_compat_linux.c
==============================================================================
--- head/sys/dev/usb/usb_compat_linux.c	Thu Apr 22 22:00:16 2010	(r207079)
+++ head/sys/dev/usb/usb_compat_linux.c	Thu Apr 22 22:15:08 2010	(r207080)
@@ -971,7 +971,7 @@ usb_linux_create_usb_device(struct usb_d
 			udev->devnum = device_get_unit(dev);
 			bcopy(&udev->ddesc, &udev->descriptor,
 			    sizeof(udev->descriptor));
-			bcopy(udev->default_ep.edesc, &udev->ep0.desc,
+			bcopy(udev->ctrl_ep.edesc, &udev->ep0.desc,
 			    sizeof(udev->ep0.desc));
 		}
 	}

Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c	Thu Apr 22 22:00:16 2010	(r207079)
+++ head/sys/dev/usb/usb_dev.c	Thu Apr 22 22:15:08 2010	(r207080)
@@ -615,7 +615,7 @@ usb_dev_get_ep(struct usb_device *udev, 
 	uint8_t ep_dir;
 
 	if (ep_index == 0) {
-		ep = &udev->default_ep;
+		ep = &udev->ctrl_ep;
 	} else {
 		if (dir == USB_FIFO_RX) {
 			if (udev->flags.usb_mode == USB_MODE_HOST) {

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Thu Apr 22 22:00:16 2010	(r207079)
+++ head/sys/dev/usb/usb_device.c	Thu Apr 22 22:15:08 2010	(r207080)
@@ -179,9 +179,9 @@ usbd_get_ep_by_addr(struct usb_device *u
 	/*
 	 * The default endpoint is always present and is checked separately:
 	 */
-	if ((udev->default_ep.edesc) &&
-	    ((udev->default_ep.edesc->bEndpointAddress & EA_MASK) == ea_val)) {
-		ep = &udev->default_ep;
+	if ((udev->ctrl_ep.edesc) &&
+	    ((udev->ctrl_ep.edesc->bEndpointAddress & EA_MASK) == ea_val)) {
+		ep = &udev->ctrl_ep;
 		goto found;
 	}
 	return (NULL);
@@ -297,11 +297,11 @@ usbd_get_endpoint(struct usb_device *ude
 	 * address" and "any direction" returns the first endpoint of the
 	 * interface. "iface_index" and "direction" is ignored:
 	 */
-	if ((udev->default_ep.edesc) &&
-	    ((udev->default_ep.edesc->bEndpointAddress & ea_mask) == ea_val) &&
-	    ((udev->default_ep.edesc->bmAttributes & type_mask) == type_val) &&
+	if ((udev->ctrl_ep.edesc) &&
+	    ((udev->ctrl_ep.edesc->bEndpointAddress & ea_mask) == ea_val) &&
+	    ((udev->ctrl_ep.edesc->bmAttributes & type_mask) == type_val) &&
 	    (!index)) {
-		ep = &udev->default_ep;
+		ep = &udev->ctrl_ep;
 		goto found;
 	}
 	return (NULL);
@@ -1422,7 +1422,7 @@ usbd_clear_stall_proc(struct usb_proc_ms
 	mtx_lock(&udev->device_mtx);
 
 	/* Start clear stall callback */
-	usbd_transfer_start(udev->default_xfer[1]);
+	usbd_transfer_start(udev->ctrl_xfer[1]);
 
 	/* Change lock */
 	mtx_unlock(&udev->device_mtx);
@@ -1529,13 +1529,13 @@ usb_alloc_device(device_t parent_dev, st
 	udev->refcount = 1;
 
 	/* set up default endpoint descriptor */
-	udev->default_ep_desc.bLength = sizeof(udev->default_ep_desc);
-	udev->default_ep_desc.bDescriptorType = UDESC_ENDPOINT;
-	udev->default_ep_desc.bEndpointAddress = USB_CONTROL_ENDPOINT;
-	udev->default_ep_desc.bmAttributes = UE_CONTROL;
-	udev->default_ep_desc.wMaxPacketSize[0] = USB_MAX_IPACKET;
-	udev->default_ep_desc.wMaxPacketSize[1] = 0;
-	udev->default_ep_desc.bInterval = 0;
+	udev->ctrl_ep_desc.bLength = sizeof(udev->ctrl_ep_desc);
+	udev->ctrl_ep_desc.bDescriptorType = UDESC_ENDPOINT;
+	udev->ctrl_ep_desc.bEndpointAddress = USB_CONTROL_ENDPOINT;
+	udev->ctrl_ep_desc.bmAttributes = UE_CONTROL;
+	udev->ctrl_ep_desc.wMaxPacketSize[0] = USB_MAX_IPACKET;
+	udev->ctrl_ep_desc.wMaxPacketSize[1] = 0;
+	udev->ctrl_ep_desc.bInterval = 0;
 	udev->ddesc.bMaxPacketSize = USB_MAX_IPACKET;
 
 	udev->speed = speed;
@@ -1559,8 +1559,8 @@ usb_alloc_device(device_t parent_dev, st
 
 	/* init the default endpoint */
 	usb_init_endpoint(udev, 0,
-	    &udev->default_ep_desc,
-	    &udev->default_ep);
+	    &udev->ctrl_ep_desc,
+	    &udev->ctrl_ep);
 
 	/* set device index */
 	udev->device_index = device_index;
@@ -1573,10 +1573,10 @@ usb_alloc_device(device_t parent_dev, st
 	LIST_INIT(&udev->pd_list);
 
 	/* Create the control endpoint device */
-	udev->default_dev = usb_make_dev(udev, 0, FREAD|FWRITE);
+	udev->ctrl_dev = usb_make_dev(udev, 0, FREAD|FWRITE);
 
 	/* Create a link from /dev/ugenX.X to the default endpoint */
-	make_dev_alias(udev->default_dev, udev->ugen_name);
+	make_dev_alias(udev->ctrl_dev, udev->ugen_name);
 #endif
 	if (udev->flags.usb_mode == USB_MODE_HOST) {
 
@@ -2009,20 +2009,20 @@ usb_free_device(struct usb_device *udev,
 	}
 	mtx_unlock(&usb_ref_lock);
 
-	destroy_dev_sched_cb(udev->default_dev, usb_cdev_cleanup,
-	    udev->default_dev->si_drv1);
+	destroy_dev_sched_cb(udev->ctrl_dev, usb_cdev_cleanup,
+	    udev->ctrl_dev->si_drv1);
 #endif
 
 	if (udev->flags.usb_mode == USB_MODE_DEVICE) {
 		/* stop receiving any control transfers (Device Side Mode) */
-		usbd_transfer_unsetup(udev->default_xfer, USB_DEFAULT_XFER_MAX);
+		usbd_transfer_unsetup(udev->ctrl_xfer, USB_CTRL_XFER_MAX);
 	}
 
 	/* the following will get the device unconfigured in software */
 	usb_unconfigure(udev, USB_UNCFG_FLAG_FREE_EP0);
 
 	/* unsetup any leftover default USB transfers */
-	usbd_transfer_unsetup(udev->default_xfer, USB_DEFAULT_XFER_MAX);
+	usbd_transfer_unsetup(udev->ctrl_xfer, USB_CTRL_XFER_MAX);
 
 	/* template unsetup, if any */
 	(usb_temp_unsetup_p) (udev);

Modified: head/sys/dev/usb/usb_device.h
==============================================================================
--- head/sys/dev/usb/usb_device.h	Thu Apr 22 22:00:16 2010	(r207079)
+++ head/sys/dev/usb/usb_device.h	Thu Apr 22 22:15:08 2010	(r207080)
@@ -30,7 +30,7 @@
 struct usb_symlink;		/* UGEN */
 struct usb_device;		/* linux compat */
 
-#define	USB_DEFAULT_XFER_MAX 2
+#define	USB_CTRL_XFER_MAX 2
 
 /* "usb_parse_config()" commands */
 
@@ -119,7 +119,7 @@ struct usb_device {
 	struct cv ctrlreq_cv;
 	struct cv ref_cv;
 	struct usb_interface *ifaces;
-	struct usb_endpoint default_ep;	/* Control Endpoint 0 */
+	struct usb_endpoint ctrl_ep;	/* Control Endpoint 0 */
 	struct usb_endpoint *endpoints;
 	struct usb_power_save pwr_save;/* power save data */
 	struct usb_bus *bus;		/* our USB BUS */
@@ -128,13 +128,13 @@ struct usb_device {
 	struct usb_device *parent_hs_hub;	/* high-speed parent HUB */
 	struct usb_config_descriptor *cdesc;	/* full config descr */
 	struct usb_hub *hub;		/* only if this is a hub */
-	struct usb_xfer *default_xfer[USB_DEFAULT_XFER_MAX];
+	struct usb_xfer *ctrl_xfer[USB_CTRL_XFER_MAX];
 	struct usb_temp_data *usb_template_ptr;
 	struct usb_endpoint *ep_curr;	/* current clear stall endpoint */
 #if USB_HAVE_UGEN
 	struct usb_fifo *fifo[USB_FIFO_MAX];
 	struct usb_symlink *ugen_symlink;	/* our generic symlink */
-	struct cdev *default_dev;	/* Control Endpoint 0 device node */
+	struct cdev *ctrl_dev;	/* Control Endpoint 0 device node */
 	LIST_HEAD(,usb_fs_privdata) pd_list;
 	char	ugen_name[20];		/* name of ugenX.X device */
 #endif
@@ -166,7 +166,7 @@ struct usb_device {
 
 	struct usb_device_flags flags;
 
-	struct usb_endpoint_descriptor default_ep_desc;	/* for endpoint 0 */
+	struct usb_endpoint_descriptor ctrl_ep_desc;	/* for endpoint 0 */
 	struct usb_device_descriptor ddesc;	/* device descriptor */
 
 	char	*serial;		/* serial number */

Modified: head/sys/dev/usb/usb_generic.c
==============================================================================
--- head/sys/dev/usb/usb_generic.c	Thu Apr 22 22:00:16 2010	(r207079)
+++ head/sys/dev/usb/usb_generic.c	Thu Apr 22 22:15:08 2010	(r207080)
@@ -81,11 +81,11 @@
 
 static usb_callback_t ugen_read_clear_stall_callback;
 static usb_callback_t ugen_write_clear_stall_callback;
-static usb_callback_t ugen_default_read_callback;
-static usb_callback_t ugen_default_write_callback;
+static usb_callback_t ugen_ctrl_read_callback;
+static usb_callback_t ugen_ctrl_write_callback;
 static usb_callback_t ugen_isoc_read_callback;
 static usb_callback_t ugen_isoc_write_callback;
-static usb_callback_t ugen_default_fs_callback;
+static usb_callback_t ugen_ctrl_fs_callback;
 
 static usb_fifo_open_t ugen_open;
 static usb_fifo_close_t ugen_close;
@@ -265,7 +265,7 @@ ugen_open_pipe_write(struct usb_fifo *f)
 		if (f->flag_short) {
 			usb_config[0].flags.force_short_xfer = 1;
 		}
-		usb_config[0].callback = &ugen_default_write_callback;
+		usb_config[0].callback = &ugen_ctrl_write_callback;
 		usb_config[0].timeout = f->timeout;
 		usb_config[0].frames = 1;
 		usb_config[0].bufsize = f->bufsize;
@@ -335,7 +335,7 @@ ugen_open_pipe_read(struct usb_fifo *f)
 		}
 		usb_config[0].timeout = f->timeout;
 		usb_config[0].frames = 1;
-		usb_config[0].callback = &ugen_default_read_callback;
+		usb_config[0].callback = &ugen_ctrl_read_callback;
 		usb_config[0].bufsize = f->bufsize;
 
 		if (ugen_transfer_setup(f, usb_config, 2)) {
@@ -401,7 +401,7 @@ ugen_stop_io(struct usb_fifo *f)
 }
 
 static void
-ugen_default_read_callback(struct usb_xfer *xfer, usb_error_t error)
+ugen_ctrl_read_callback(struct usb_xfer *xfer, usb_error_t error)
 {
 	struct usb_fifo *f = usbd_xfer_softc(xfer);
 	struct usb_mbuf *m;
@@ -453,7 +453,7 @@ ugen_default_read_callback(struct usb_xf
 }
 
 static void
-ugen_default_write_callback(struct usb_xfer *xfer, usb_error_t error)
+ugen_ctrl_write_callback(struct usb_xfer *xfer, usb_error_t error)
 {
 	struct usb_fifo *f = usbd_xfer_softc(xfer);
 	usb_frlength_t actlen;
@@ -1480,7 +1480,7 @@ ugen_ioctl(struct usb_fifo *f, u_long cm
 		usb_config[0].direction = ed->bEndpointAddress & (UE_DIR_OUT | UE_DIR_IN);
 		usb_config[0].interval = USB_DEFAULT_INTERVAL;
 		usb_config[0].flags.proxy_buffer = 1;
-		usb_config[0].callback = &ugen_default_fs_callback;
+		usb_config[0].callback = &ugen_ctrl_fs_callback;
 		usb_config[0].timeout = 0;	/* no timeout */
 		usb_config[0].frames = u.popen->max_frames;
 		usb_config[0].bufsize = u.popen->max_bufsize;
@@ -2201,7 +2201,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo
 }
 
 static void
-ugen_default_fs_callback(struct usb_xfer *xfer, usb_error_t error)
+ugen_ctrl_fs_callback(struct usb_xfer *xfer, usb_error_t error)
 {
 	;				/* workaround for a bug in "indent" */
 

Modified: head/sys/dev/usb/usb_hub.c
==============================================================================
--- head/sys/dev/usb/usb_hub.c	Thu Apr 22 22:00:16 2010	(r207079)
+++ head/sys/dev/usb/usb_hub.c	Thu Apr 22 22:15:08 2010	(r207080)
@@ -246,7 +246,7 @@ uhub_explore_sub(struct uhub_softc *sc, 
 	/* start control transfer, if device mode */
 
 	if (child->flags.usb_mode == USB_MODE_DEVICE) {
-		usbd_default_transfer_setup(child);
+		usbd_ctrl_transfer_setup(child);
 	}
 	/* if a HUB becomes present, do a recursive HUB explore */
 

Modified: head/sys/dev/usb/usb_request.c
==============================================================================
--- head/sys/dev/usb/usb_request.c	Thu Apr 22 22:00:16 2010	(r207079)
+++ head/sys/dev/usb/usb_request.c	Thu Apr 22 22:15:08 2010	(r207080)
@@ -374,9 +374,9 @@ usbd_do_request_flags(struct usb_device 
 	/*
 	 * Setup a new USB transfer or use the existing one, if any:
 	 */
-	usbd_default_transfer_setup(udev);
+	usbd_ctrl_transfer_setup(udev);
 
-	xfer = udev->default_xfer[0];
+	xfer = udev->ctrl_xfer[0];
 	if (xfer == NULL) {
 		/* most likely out of memory */
 		err = USB_ERR_NOMEM;

Modified: head/sys/dev/usb/usb_transfer.c
==============================================================================
--- head/sys/dev/usb/usb_transfer.c	Thu Apr 22 22:00:16 2010	(r207079)
+++ head/sys/dev/usb/usb_transfer.c	Thu Apr 22 22:15:08 2010	(r207080)
@@ -72,7 +72,7 @@ struct usb_std_packet_size {
 
 static usb_callback_t usb_request_callback;
 
-static const struct usb_config usb_control_ep_cfg[USB_DEFAULT_XFER_MAX] = {
+static const struct usb_config usb_control_ep_cfg[USB_CTRL_XFER_MAX] = {
 
 	/* This transfer is used for generic control endpoint transfers */
 
@@ -2433,8 +2433,8 @@ usbd_pipe_start(struct usb_xfer_queue *p
 			if (udev->flags.usb_mode == USB_MODE_DEVICE) {
 				(udev->bus->methods->set_stall) (
 				    udev, NULL, ep, &did_stall);
-			} else if (udev->default_xfer[1]) {
-				info = udev->default_xfer[1]->xroot;
+			} else if (udev->ctrl_xfer[1]) {
+				info = udev->ctrl_xfer[1]->xroot;
 				usb_proc_msignal(
 				    &info->bus->non_giant_callback_proc,
 				    &udev->cs_msg[0], &udev->cs_msg[1]);
@@ -2757,13 +2757,13 @@ usb_command_wrapper(struct usb_xfer_queu
 }
 
 /*------------------------------------------------------------------------*
- *	usbd_default_transfer_setup
+ *	usbd_ctrl_transfer_setup
  *
  * This function is used to setup the default USB control endpoint
  * transfer.
  *------------------------------------------------------------------------*/
 void
-usbd_default_transfer_setup(struct usb_device *udev)
+usbd_ctrl_transfer_setup(struct usb_device *udev)
 {
 	struct usb_xfer *xfer;
 	uint8_t no_resetup;
@@ -2774,12 +2774,12 @@ usbd_default_transfer_setup(struct usb_d
 		return;
 repeat:
 
-	xfer = udev->default_xfer[0];
+	xfer = udev->ctrl_xfer[0];
 	if (xfer) {
 		USB_XFER_LOCK(xfer);
 		no_resetup =
 		    ((xfer->address == udev->address) &&
-		    (udev->default_ep_desc.wMaxPacketSize[0] ==
+		    (udev->ctrl_ep_desc.wMaxPacketSize[0] ==
 		    udev->ddesc.bMaxPacketSize));
 		if (udev->flags.usb_mode == USB_MODE_DEVICE) {
 			if (no_resetup) {
@@ -2806,13 +2806,13 @@ repeat:
 	/*
 	 * Update wMaxPacketSize for the default control endpoint:
 	 */
-	udev->default_ep_desc.wMaxPacketSize[0] =
+	udev->ctrl_ep_desc.wMaxPacketSize[0] =
 	    udev->ddesc.bMaxPacketSize;
 
 	/*
 	 * Unsetup any existing USB transfer:
 	 */
-	usbd_transfer_unsetup(udev->default_xfer, USB_DEFAULT_XFER_MAX);
+	usbd_transfer_unsetup(udev->ctrl_xfer, USB_CTRL_XFER_MAX);
 
 	/*
 	 * Try to setup a new USB transfer for the
@@ -2820,7 +2820,7 @@ repeat:
 	 */
 	iface_index = 0;
 	if (usbd_transfer_setup(udev, &iface_index,
-	    udev->default_xfer, usb_control_ep_cfg, USB_DEFAULT_XFER_MAX, NULL,
+	    udev->ctrl_xfer, usb_control_ep_cfg, USB_CTRL_XFER_MAX, NULL,
 	    &udev->device_mtx)) {
 		DPRINTFN(0, "could not setup default "
 		    "USB transfer\n");
@@ -3001,13 +3001,13 @@ usbd_transfer_poll(struct usb_xfer **ppx
 		USB_BUS_LOCK(xroot->bus);
 
 		/* check for clear stall */
-		if (udev->default_xfer[1] != NULL) {
+		if (udev->ctrl_xfer[1] != NULL) {
 
 			/* poll clear stall start */
 			pm = &udev->cs_msg[0].hdr;
 			(pm->pm_callback) (pm);
 			/* poll clear stall done thread */
-			pm = &udev->default_xfer[1]->
+			pm = &udev->ctrl_xfer[1]->
 			    xroot->done_m[0].hdr;
 			(pm->pm_callback) (pm);
 		}

Modified: head/sys/dev/usb/usb_transfer.h
==============================================================================
--- head/sys/dev/usb/usb_transfer.h	Thu Apr 22 22:00:16 2010	(r207079)
+++ head/sys/dev/usb/usb_transfer.h	Thu Apr 22 22:15:08 2010	(r207080)
@@ -123,7 +123,7 @@ void	usbd_transfer_done(struct usb_xfer 
 void	usbd_transfer_enqueue(struct usb_xfer_queue *pq,
 	    struct usb_xfer *xfer);
 void	usbd_transfer_setup_sub(struct usb_setup_params *parm);
-void	usbd_default_transfer_setup(struct usb_device *udev);
+void	usbd_ctrl_transfer_setup(struct usb_device *udev);
 void	usbd_clear_data_toggle(struct usb_device *udev,
 	    struct usb_endpoint *ep);
 usb_callback_t usbd_do_request_callback;

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 23:47: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 C4218106566B;
	Thu, 22 Apr 2010 23:47:19 +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 B24198FC0C;
	Thu, 22 Apr 2010 23:47: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 o3MNlJPo028206;
	Thu, 22 Apr 2010 23:47:19 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MNlJMU028201;
	Thu, 22 Apr 2010 23:47:19 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201004222347.o3MNlJMU028201@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 22 Apr 2010 23:47: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: r207081 - in head/sys: amd64/amd64 i386/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: Thu, 22 Apr 2010 23:47:19 -0000

Author: jkim
Date: Thu Apr 22 23:47:19 2010
New Revision: 207081
URL: http://svn.freebsd.org/changeset/base/207081

Log:
  If a conditional jump instruction has the same jt and jf, do not perform
  the test and jump unconditionally.

Modified:
  head/sys/amd64/amd64/bpf_jit_machdep.c
  head/sys/amd64/amd64/bpf_jit_machdep.h
  head/sys/i386/i386/bpf_jit_machdep.c
  head/sys/i386/i386/bpf_jit_machdep.h

Modified: head/sys/amd64/amd64/bpf_jit_machdep.c
==============================================================================
--- head/sys/amd64/amd64/bpf_jit_machdep.c	Thu Apr 22 22:15:08 2010	(r207080)
+++ head/sys/amd64/amd64/bpf_jit_machdep.c	Thu Apr 22 23:47:19 2010	(r207081)
@@ -419,62 +419,77 @@ bpf_jit_compile(struct bpf_insn *prog, u
 				break;
 
 			case BPF_JMP|BPF_JA:
-				JMP(stream.refs[stream.bpf_pc + ins->k] -
-				    stream.refs[stream.bpf_pc]);
+				JUMP(ins->k);
 				break;
 
 			case BPF_JMP|BPF_JGT|BPF_K:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPid(ins->k, EAX);
 				JCC(JA, JBE);
 				break;
 
 			case BPF_JMP|BPF_JGE|BPF_K:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPid(ins->k, EAX);
 				JCC(JAE, JB);
 				break;
 
 			case BPF_JMP|BPF_JEQ|BPF_K:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPid(ins->k, EAX);
 				JCC(JE, JNE);
 				break;
 
 			case BPF_JMP|BPF_JSET|BPF_K:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				TESTid(ins->k, EAX);
 				JCC(JNE, JE);
 				break;
 
 			case BPF_JMP|BPF_JGT|BPF_X:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPrd(EDX, EAX);
 				JCC(JA, JBE);
 				break;
 
 			case BPF_JMP|BPF_JGE|BPF_X:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPrd(EDX, EAX);
 				JCC(JAE, JB);
 				break;
 
 			case BPF_JMP|BPF_JEQ|BPF_X:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPrd(EDX, EAX);
 				JCC(JE, JNE);
 				break;
 
 			case BPF_JMP|BPF_JSET|BPF_X:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				TESTrd(EDX, EAX);
 				JCC(JNE, JE);
 				break;

Modified: head/sys/amd64/amd64/bpf_jit_machdep.h
==============================================================================
--- head/sys/amd64/amd64/bpf_jit_machdep.h	Thu Apr 22 22:15:08 2010	(r207080)
+++ head/sys/amd64/amd64/bpf_jit_machdep.h	Thu Apr 22 23:47:19 2010	(r207081)
@@ -473,4 +473,10 @@ typedef void (*emit_func)(bpf_bin_stream
 	}								\
 } while (0)
 
+#define	JUMP(off) do {							\
+	if ((off) != 0)							\
+		JMP(stream.refs[stream.bpf_pc + (off)] -		\
+		    stream.refs[stream.bpf_pc]);			\
+} while (0)
+
 #endif	/* _BPF_JIT_MACHDEP_H_ */

Modified: head/sys/i386/i386/bpf_jit_machdep.c
==============================================================================
--- head/sys/i386/i386/bpf_jit_machdep.c	Thu Apr 22 22:15:08 2010	(r207080)
+++ head/sys/i386/i386/bpf_jit_machdep.c	Thu Apr 22 23:47:19 2010	(r207081)
@@ -440,62 +440,77 @@ bpf_jit_compile(struct bpf_insn *prog, u
 				break;
 
 			case BPF_JMP|BPF_JA:
-				JMP(stream.refs[stream.bpf_pc + ins->k] -
-				    stream.refs[stream.bpf_pc]);
+				JUMP(ins->k);
 				break;
 
 			case BPF_JMP|BPF_JGT|BPF_K:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPid(ins->k, EAX);
 				JCC(JA, JBE);
 				break;
 
 			case BPF_JMP|BPF_JGE|BPF_K:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPid(ins->k, EAX);
 				JCC(JAE, JB);
 				break;
 
 			case BPF_JMP|BPF_JEQ|BPF_K:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPid(ins->k, EAX);
 				JCC(JE, JNE);
 				break;
 
 			case BPF_JMP|BPF_JSET|BPF_K:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				TESTid(ins->k, EAX);
 				JCC(JNE, JE);
 				break;
 
 			case BPF_JMP|BPF_JGT|BPF_X:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPrd(EDX, EAX);
 				JCC(JA, JBE);
 				break;
 
 			case BPF_JMP|BPF_JGE|BPF_X:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPrd(EDX, EAX);
 				JCC(JAE, JB);
 				break;
 
 			case BPF_JMP|BPF_JEQ|BPF_X:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				CMPrd(EDX, EAX);
 				JCC(JE, JNE);
 				break;
 
 			case BPF_JMP|BPF_JSET|BPF_X:
-				if (ins->jt == 0 && ins->jf == 0)
+				if (ins->jt == ins->jf) {
+					JUMP(ins->jt);
 					break;
+				}
 				TESTrd(EDX, EAX);
 				JCC(JNE, JE);
 				break;

Modified: head/sys/i386/i386/bpf_jit_machdep.h
==============================================================================
--- head/sys/i386/i386/bpf_jit_machdep.h	Thu Apr 22 22:15:08 2010	(r207080)
+++ head/sys/i386/i386/bpf_jit_machdep.h	Thu Apr 22 23:47:19 2010	(r207081)
@@ -418,4 +418,10 @@ typedef void (*emit_func)(bpf_bin_stream
 	}								\
 } while (0)
 
+#define	JUMP(off) do {							\
+	if ((off) != 0)							\
+		JMP(stream.refs[stream.bpf_pc + (off)] -		\
+		    stream.refs[stream.bpf_pc]);			\
+} while (0)
+
 #endif	/* _BPF_JIT_MACHDEP_H_ */

From owner-svn-src-all@FreeBSD.ORG  Thu Apr 22 23:51: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 AA571106564A;
	Thu, 22 Apr 2010 23:51:01 +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 975ED8FC14;
	Thu, 22 Apr 2010 23:51: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 o3MNp1OY029071;
	Thu, 22 Apr 2010 23:51:01 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MNp1x2029061;
	Thu, 22 Apr 2010 23:51:01 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004222351.o3MNp1x2029061@svn.freebsd.org>
From: Rick Macklem 
Date: Thu, 22 Apr 2010 23:51: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: r207082 - in head/sys/fs: 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: Thu, 22 Apr 2010 23:51:01 -0000

Author: rmacklem
Date: Thu Apr 22 23:51:01 2010
New Revision: 207082
URL: http://svn.freebsd.org/changeset/base/207082

Log:
  When the experimental NFS client is handling an NFSv4 server reboot
  with delegations enabled, the recovery could fail if the renew
  thread is trying to return a delegation, since it will not do the
  recovery. This patch fixes the above by having nfscl_recalldeleg()
  fail with the I/O operations returning EIO, so that they will be
  attempted later. Most of the patch consists of adding an argument
  to various functions to indicate the delegation recall case where
  this needs to be done.
  
  MFC after:	1 week

Modified:
  head/sys/fs/nfs/nfs_var.h
  head/sys/fs/nfsclient/nfs.h
  head/sys/fs/nfsclient/nfs_clbio.c
  head/sys/fs/nfsclient/nfs_clnfsiod.c
  head/sys/fs/nfsclient/nfs_clnode.c
  head/sys/fs/nfsclient/nfs_clrpcops.c
  head/sys/fs/nfsclient/nfs_clstate.c
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfs/nfs_var.h
==============================================================================
--- head/sys/fs/nfs/nfs_var.h	Thu Apr 22 23:47:19 2010	(r207081)
+++ head/sys/fs/nfs/nfs_var.h	Thu Apr 22 23:51:01 2010	(r207082)
@@ -369,7 +369,7 @@ int nfsrpc_readlink(vnode_t, struct uio 
 int nfsrpc_read(vnode_t, struct uio *, struct ucred *, NFSPROC_T *,
     struct nfsvattr *, int *, void *);
 int nfsrpc_write(vnode_t, struct uio *, int *, u_char *,
-    struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *);
+    struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *, int);
 int nfsrpc_mknod(vnode_t, char *, int, struct vattr *, u_int32_t,
     enum vtype, struct ucred *, NFSPROC_T *, struct nfsvattr *,
     struct nfsvattr *, struct nfsfh **, int *, int *, void *);
@@ -502,7 +502,7 @@ int nfscl_maperr(NFSPROC_T *, int, uid_t
 void nfscl_init(void);
 
 /* nfs_clbio.c */
-int ncl_flush(vnode_t, int, struct ucred *, NFSPROC_T *, int);
+int ncl_flush(vnode_t, int, struct ucred *, NFSPROC_T *, int, int);
 
 /* nfs_clnode.c */
 void ncl_invalcaches(vnode_t);

Modified: head/sys/fs/nfsclient/nfs.h
==============================================================================
--- head/sys/fs/nfsclient/nfs.h	Thu Apr 22 23:47:19 2010	(r207081)
+++ head/sys/fs/nfsclient/nfs.h	Thu Apr 22 23:51:01 2010	(r207082)
@@ -79,14 +79,16 @@ int ncl_biowrite(struct vnode *, struct 
 int ncl_vinvalbuf(struct vnode *, int, struct thread *, int);
 int ncl_asyncio(struct nfsmount *, struct buf *, struct ucred *,
     struct thread *);
-int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *);
+int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *,
+    int);
 void ncl_nhinit(void);
 void ncl_nhuninit(void);
 void ncl_nodelock(struct nfsnode *);
 void ncl_nodeunlock(struct nfsnode *);
 int ncl_getattrcache(struct vnode *, struct vattr *);
 int ncl_readrpc(struct vnode *, struct uio *, struct ucred *);
-int ncl_writerpc(struct vnode *, struct uio *, struct ucred *, int *, int *);
+int ncl_writerpc(struct vnode *, struct uio *, struct ucred *, int *, int *,
+    int);
 int ncl_readlinkrpc(struct vnode *, struct uio *, struct ucred *);
 int ncl_readdirrpc(struct vnode *, struct uio *, struct ucred *,
     struct thread *);

Modified: head/sys/fs/nfsclient/nfs_clbio.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clbio.c	Thu Apr 22 23:47:19 2010	(r207081)
+++ head/sys/fs/nfsclient/nfs_clbio.c	Thu Apr 22 23:51:01 2010	(r207082)
@@ -336,7 +336,7 @@ ncl_putpages(struct vop_putpages_args *a
 	else
 	    iomode = NFSWRITE_FILESYNC;
 
-	error = ncl_writerpc(vp, &uio, cred, &iomode, &must_commit);
+	error = ncl_writerpc(vp, &uio, cred, &iomode, &must_commit, 0);
 
 	pmap_qremove(kva, npages);
 	relpbuf(bp, &ncl_pbuf_freecnt);
@@ -554,7 +554,7 @@ ncl_bioread(struct vnode *vp, struct uio
 		if ((bp->b_flags & B_CACHE) == 0) {
 		    bp->b_iocmd = BIO_READ;
 		    vfs_busy_pages(bp, 0);
-		    error = ncl_doio(vp, bp, cred, td);
+		    error = ncl_doio(vp, bp, cred, td, 0);
 		    if (error) {
 			brelse(bp);
 			return (error);
@@ -583,7 +583,7 @@ ncl_bioread(struct vnode *vp, struct uio
 		if ((bp->b_flags & B_CACHE) == 0) {
 		    bp->b_iocmd = BIO_READ;
 		    vfs_busy_pages(bp, 0);
-		    error = ncl_doio(vp, bp, cred, td);
+		    error = ncl_doio(vp, bp, cred, td, 0);
 		    if (error) {
 			bp->b_ioflags |= BIO_ERROR;
 			brelse(bp);
@@ -609,7 +609,7 @@ ncl_bioread(struct vnode *vp, struct uio
 		if ((bp->b_flags & B_CACHE) == 0) {
 		    bp->b_iocmd = BIO_READ;
 		    vfs_busy_pages(bp, 0);
-		    error = ncl_doio(vp, bp, cred, td);
+		    error = ncl_doio(vp, bp, cred, td, 0);
 		    if (error) {
 			    brelse(bp);
 		    }
@@ -638,7 +638,7 @@ ncl_bioread(struct vnode *vp, struct uio
 			    if ((bp->b_flags & B_CACHE) == 0) {
 				    bp->b_iocmd = BIO_READ;
 				    vfs_busy_pages(bp, 0);
-				    error = ncl_doio(vp, bp, cred, td);
+				    error = ncl_doio(vp, bp, cred, td, 0);
 				    /*
 				     * no error + B_INVAL == directory EOF,
 				     * use the block.
@@ -771,7 +771,7 @@ do_sync:
 			uio.uio_td = td;
 			iomode = NFSWRITE_FILESYNC;
 			error = ncl_writerpc(vp, &uio, cred, &iomode,
-			    &must_commit);
+			    &must_commit, 0);
 			KASSERT((must_commit == 0), 
 				("ncl_directio_write: Did not commit write"));
 			if (error)
@@ -1122,7 +1122,7 @@ again:
 		if ((bp->b_flags & B_CACHE) == 0) {
 			bp->b_iocmd = BIO_READ;
 			vfs_busy_pages(bp, 0);
-			error = ncl_doio(vp, bp, cred, td);
+			error = ncl_doio(vp, bp, cred, td, 0);
 			if (error) {
 				brelse(bp);
 				break;
@@ -1523,7 +1523,7 @@ ncl_doio_directwrite(struct buf *bp)
 	
 	iomode = NFSWRITE_FILESYNC;
 	uiop->uio_td = NULL; /* NULL since we're in nfsiod */
-	ncl_writerpc(bp->b_vp, uiop, bp->b_wcred, &iomode, &must_commit);
+	ncl_writerpc(bp->b_vp, uiop, bp->b_wcred, &iomode, &must_commit, 0);
 	KASSERT((must_commit == 0), ("ncl_doio_directwrite: Did not commit write"));
 	free(iov_base, M_NFSDIRECTIO);
 	free(uiop->uio_iov, M_NFSDIRECTIO);
@@ -1550,7 +1550,8 @@ ncl_doio_directwrite(struct buf *bp)
  * synchronously or from an nfsiod.
  */
 int
-ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td)
+ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
+    int called_from_strategy)
 {
 	struct uio *uiop;
 	struct nfsnode *np;
@@ -1695,7 +1696,8 @@ ncl_doio(struct vnode *vp, struct buf *b
 		else
 		    iomode = NFSWRITE_FILESYNC;
 
-		error = ncl_writerpc(vp, uiop, cr, &iomode, &must_commit);
+		error = ncl_writerpc(vp, uiop, cr, &iomode, &must_commit,
+		    called_from_strategy);
 
 		/*
 		 * When setting B_NEEDCOMMIT also set B_CLUSTEROK to try
@@ -1732,6 +1734,12 @@ ncl_doio(struct vnode *vp, struct buf *b
 		 * the block is reused. This is indicated by setting
 		 * the B_DELWRI and B_NEEDCOMMIT flags.
 		 *
+		 * EIO is returned by ncl_writerpc() to indicate a recoverable
+		 * write error and is handled as above, except that
+		 * B_EINTR isn't set. One cause of this is a stale stateid
+		 * error for the RPC that indicates recovery is required,
+		 * when called with called_from_strategy != 0.
+		 *
 		 * If the buffer is marked B_PAGING, it does not reside on
 		 * the vp's paging queues so we cannot call bdirty().  The
 		 * bp in this case is not an NFS cache block so we should
@@ -1760,7 +1768,8 @@ ncl_doio(struct vnode *vp, struct buf *b
 			    bdirty(bp);
 			    bp->b_flags &= ~B_DONE;
 			}
-			if (error && (bp->b_flags & B_ASYNC) == 0)
+			if ((error == EINTR || error == ETIMEDOUT) &&
+			    (bp->b_flags & B_ASYNC) == 0)
 			    bp->b_flags |= B_EINTR;
 			splx(s);
 	    	} else {

Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clnfsiod.c	Thu Apr 22 23:47:19 2010	(r207081)
+++ head/sys/fs/nfsclient/nfs_clnfsiod.c	Thu Apr 22 23:51:01 2010	(r207082)
@@ -278,9 +278,11 @@ nfssvc_iod(void *instance)
 			(void)ncl_doio_directwrite(bp);
 		} else {
 			if (bp->b_iocmd == BIO_READ)
-				(void) ncl_doio(bp->b_vp, bp, bp->b_rcred, NULL);
+				(void) ncl_doio(bp->b_vp, bp, bp->b_rcred,
+				    NULL, 0);
 			else
-				(void) ncl_doio(bp->b_vp, bp, bp->b_wcred, NULL);
+				(void) ncl_doio(bp->b_vp, bp, bp->b_wcred,
+				    NULL, 0);
 		}
 		mtx_lock(&ncl_iod_mutex);
 		/*

Modified: head/sys/fs/nfsclient/nfs_clnode.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clnode.c	Thu Apr 22 23:47:19 2010	(r207081)
+++ head/sys/fs/nfsclient/nfs_clnode.c	Thu Apr 22 23:51:01 2010	(r207082)
@@ -199,7 +199,7 @@ ncl_inactive(struct vop_inactive_args *a
 		 * available for the writes.
 		 */
 		if (nfscl_mustflush(vp))
-			(void) ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1);
+			(void) ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1, 0);
 		(void) nfsrpc_close(vp, 1, ap->a_td);
 	}
 

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clrpcops.c	Thu Apr 22 23:47:19 2010	(r207081)
+++ head/sys/fs/nfsclient/nfs_clrpcops.c	Thu Apr 22 23:51:01 2010	(r207082)
@@ -1346,11 +1346,16 @@ nfsmout:
 
 /*
  * nfs write operation
+ * When called_from_strategy != 0, it should return EIO for an error that
+ * indicates recovery is in progress, so that the buffer will be left
+ * dirty and be written back to the server later. If it loops around,
+ * the recovery thread could get stuck waiting for the buffer and recovery
+ * will then deadlock.
  */
 APPLESTATIC int
 nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, u_char *verfp,
     struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp,
-    void *stuff)
+    void *stuff, int called_from_strategy)
 {
 	int error, expireret = 0, retrycnt, nostateid;
 	u_int32_t clidrev = 0;
@@ -1410,12 +1415,15 @@ nfscl_dumpstate(nmp, 1, 1, 0, 0);
 			expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p);
 		}
 		retrycnt++;
-	} while (error == NFSERR_GRACE || error == NFSERR_STALESTATEID ||
-	    error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY ||
+	} while (error == NFSERR_GRACE || error == NFSERR_DELAY ||
+	    ((error == NFSERR_STALESTATEID ||
+	      error == NFSERR_STALEDONTRECOVER) && called_from_strategy == 0) ||
 	    (error == NFSERR_OLDSTATEID && retrycnt < 20) ||
 	    ((error == NFSERR_EXPIRED || error == NFSERR_BADSTATEID) &&
 	     expireret == 0 && clidrev != 0 && retrycnt < 4));
-	if (error && retrycnt >= 4)
+	if (error != 0 && (retrycnt >= 4 ||
+	    ((error == NFSERR_STALESTATEID ||
+	      error == NFSERR_STALEDONTRECOVER) && called_from_strategy != 0)))
 		error = EIO;
 	if (NFSHASNFSV4(nmp) && p == NULL)
 		NFSFREECRED(newcred);

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Thu Apr 22 23:47:19 2010	(r207081)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Thu Apr 22 23:51:01 2010	(r207082)
@@ -139,7 +139,7 @@ static void nfscl_freedeleg(struct nfscl
 static int nfscl_errmap(struct nfsrv_descript *);
 static void nfscl_cleanup_common(struct nfsclclient *, u_int8_t *);
 static int nfscl_recalldeleg(struct nfsclclient *, struct nfsmount *,
-    struct nfscldeleg *, vnode_t, struct ucred *, NFSPROC_T *);
+    struct nfscldeleg *, vnode_t, struct ucred *, NFSPROC_T *, int);
 static void nfscl_freeopenowner(struct nfsclowner *, int);
 static void nfscl_cleandeleg(struct nfscldeleg *);
 static int nfscl_trydelegreturn(struct nfscldeleg *, struct ucred *,
@@ -2469,7 +2469,7 @@ tryagain:
 				NFSUNLOCKCLSTATE();
 				newnfs_copycred(&dp->nfsdl_cred, cred);
 				ret = nfscl_recalldeleg(clp, clp->nfsc_nmp, dp,
-				    NULL, cred, p);
+				    NULL, cred, p, 1);
 				if (!ret) {
 				    nfscl_cleandeleg(dp);
 				    TAILQ_REMOVE(&clp->nfsc_deleg, dp,
@@ -3309,7 +3309,8 @@ nfscl_lockt(vnode_t vp, struct nfsclclie
  */
 static int
 nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp,
-    struct nfscldeleg *dp, vnode_t vp, struct ucred *cred, NFSPROC_T *p)
+    struct nfscldeleg *dp, vnode_t vp, struct ucred *cred, NFSPROC_T *p,
+    int called_from_renewthread)
 {
 	struct nfsclowner *owp, *lowp, *nowp;
 	struct nfsclopen *op, *lop;
@@ -3343,6 +3344,7 @@ nfscl_recalldeleg(struct nfsclclient *cl
 	 * Ok, if it's a write delegation, flush data to the server, so
 	 * that close/open consistency is retained.
 	 */
+	ret = 0;
 	NFSLOCKNODE(np);
 	if ((dp->nfsdl_flags & NFSCLDL_WRITE) && (np->n_flag & NMODIFIED)) {
 #ifdef APPLE
@@ -3351,7 +3353,8 @@ nfscl_recalldeleg(struct nfsclclient *cl
 		np->n_flag |= NDELEGRECALL;
 #endif
 		NFSUNLOCKNODE(np);
-		(void) ncl_flush(vp, MNT_WAIT, cred, p, 1);
+		ret = ncl_flush(vp, MNT_WAIT, cred, p, 1,
+		    called_from_renewthread);
 		NFSLOCKNODE(np);
 #ifdef APPLE
 		OSBitAndAtomic((int32_t)~(NMODIFIED | NDELEGRECALL), (UInt32 *)&np->n_flag);
@@ -3360,6 +3363,16 @@ nfscl_recalldeleg(struct nfsclclient *cl
 #endif
 	}
 	NFSUNLOCKNODE(np);
+	if (ret == EIO && called_from_renewthread != 0) {
+		/*
+		 * If the flush failed with EIO for the renew thread,
+		 * return now, so that the dirty buffer will be flushed
+		 * later.
+		 */
+		if (gotvp != 0)
+			vrele(vp);
+		return (ret);
+	}
 
 	/*
 	 * Now, for each openowner with opens issued locally, move them
@@ -3857,7 +3870,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T 
 			NFSUNLOCKCLSTATE();
 			cred = newnfs_getcred();
 			newnfs_copycred(&dp->nfsdl_cred, cred);
-			(void) nfscl_recalldeleg(clp, nmp, dp, vp, cred, p);
+			(void) nfscl_recalldeleg(clp, nmp, dp, vp, cred, p, 0);
 			NFSFREECRED(cred);
 			triedrecall = 1;
 			NFSLOCKCLSTATE();
@@ -3955,7 +3968,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stat
 			NFSUNLOCKCLSTATE();
 			cred = newnfs_getcred();
 			newnfs_copycred(&dp->nfsdl_cred, cred);
-			(void) nfscl_recalldeleg(clp, nmp, dp, fvp, cred, p);
+			(void) nfscl_recalldeleg(clp, nmp, dp, fvp, cred, p, 0);
 			NFSFREECRED(cred);
 			triedrecall = 1;
 			NFSLOCKCLSTATE();

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c	Thu Apr 22 23:47:19 2010	(r207081)
+++ head/sys/fs/nfsclient/nfs_clvnops.c	Thu Apr 22 23:51:01 2010	(r207082)
@@ -670,13 +670,13 @@ nfs_close(struct vop_close_args *ap)
 		     * traditional vnode locking implemented for Vnode Ops.
 		     */
 		    int cm = newnfs_commit_on_close ? 1 : 0;
-		    error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm);
+		    error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm, 0);
 		    /* np->n_flag &= ~NMODIFIED; */
 		} else if (NFS_ISV4(vp)) { 
 			if (nfscl_mustflush(vp)) {
 				int cm = newnfs_commit_on_close ? 1 : 0;
 				error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td,
-				    cm);
+				    cm, 0);
 				/*
 				 * as above w.r.t races when clearing
 				 * NMODIFIED.
@@ -1306,7 +1306,7 @@ ncl_readrpc(struct vnode *vp, struct uio
  */
 int
 ncl_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
-	     int *iomode, int *must_commit)
+    int *iomode, int *must_commit, int called_from_strategy)
 {
 	struct nfsvattr nfsva;
 	int error = 0, attrflag, ret;
@@ -1315,7 +1315,7 @@ ncl_writerpc(struct vnode *vp, struct ui
 
 	*must_commit = 0;
 	error = nfsrpc_write(vp, uiop, iomode, verf, cred,
-	    uiop->uio_td, &nfsva, &attrflag, NULL);
+	    uiop->uio_td, &nfsva, &attrflag, NULL, called_from_strategy);
 	NFSLOCKMNT(nmp);
 	if (!error && NFSHASWRITEVERF(nmp) &&
 	    NFSBCMP(verf, nmp->nm_verf, NFSX_VERF)) {
@@ -2473,7 +2473,7 @@ nfs_strategy(struct vop_strategy_args *a
 	 */
 	if ((bp->b_flags & B_ASYNC) == 0 ||
 	    ncl_asyncio(VFSTONFS(ap->a_vp->v_mount), bp, NOCRED, curthread))
-		(void)ncl_doio(ap->a_vp, bp, cr, curthread);
+		(void) ncl_doio(ap->a_vp, bp, cr, curthread, 1);
 	return (0);
 }
 
@@ -2484,17 +2484,20 @@ nfs_strategy(struct vop_strategy_args *a
 static int
 nfs_fsync(struct vop_fsync_args *ap)
 {
-	return (ncl_flush(ap->a_vp, ap->a_waitfor, NULL, ap->a_td, 1));
+	return (ncl_flush(ap->a_vp, ap->a_waitfor, NULL, ap->a_td, 1, 0));
 }
 
 /*
  * Flush all the blocks associated with a vnode.
  * 	Walk through the buffer pool and push any dirty pages
  *	associated with the vnode.
+ * If the called_from_renewthread argument is TRUE, it has been called
+ * from the NFSv4 renew thread and, as such, cannot block indefinitely
+ * waiting for a buffer write to complete.
  */
 int
 ncl_flush(struct vnode *vp, int waitfor, struct ucred *cred, struct thread *td,
-    int commit)
+    int commit, int called_from_renewthread)
 {
 	struct nfsnode *np = VTONFS(vp);
 	struct buf *bp;
@@ -2513,6 +2516,8 @@ ncl_flush(struct vnode *vp, int waitfor,
 	struct buf *bvec_on_stack[NFS_COMMITBVECSIZ];
 	int bvecsize = 0, bveccount;
 
+	if (called_from_renewthread != 0)
+		slptimeo = hz;
 	if (nmp->nm_flag & NFSMNT_INT)
 		slpflag = NFS_PCATCH;
 	if (!commit)
@@ -2708,6 +2713,14 @@ loop:
 				error = 0;
 				goto loop;
 			}
+			if (called_from_renewthread != 0) {
+				/*
+				 * Return EIO so the flush will be retried
+				 * later.
+				 */
+				error = EIO;
+				goto done;
+			}
 			if (newnfs_sigintr(nmp, td)) {
 				error = EINTR;
 				goto done;
@@ -2747,6 +2760,14 @@ loop:
 			error = bufobj_wwait(bo, slpflag, slptimeo);
 			if (error) {
 			    BO_UNLOCK(bo);
+			    if (called_from_renewthread != 0) {
+				/*
+				 * Return EIO so that the flush will be
+				 * retried later.
+				 */
+				error = EIO;
+				goto done;
+			    }
 			    error = newnfs_sigintr(nmp, td);
 			    if (error)
 				goto done;
@@ -2838,7 +2859,7 @@ nfs_advlock(struct vop_advlock_args *ap)
 		 */
 		if (ap->a_op == F_UNLCK &&
 		    nfscl_checkwritelocked(vp, ap->a_fl, cred, td))
-			(void) ncl_flush(vp, MNT_WAIT, cred, td, 1);
+			(void) ncl_flush(vp, MNT_WAIT, cred, td, 1, 0);
 
 		/*
 		 * Loop around doing the lock op, while a blocking lock

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 00:12: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 CE08E106564A;
	Fri, 23 Apr 2010 00:12:23 +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 BB6F98FC12;
	Fri, 23 Apr 2010 00:12: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 o3N0CNKx033897;
	Fri, 23 Apr 2010 00:12:23 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3N0CNiZ033891;
	Fri, 23 Apr 2010 00:12:23 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004230012.o3N0CNiZ033891@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 23 Apr 2010 00:12: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: r207085 - in stable/8/sys/fs: 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: Fri, 23 Apr 2010 00:12:24 -0000

Author: rmacklem
Date: Fri Apr 23 00:12:23 2010
New Revision: 207085
URL: http://svn.freebsd.org/changeset/base/207085

Log:
  MFC: r206688
  The experimental NFS client was not filling in recovery credentials
  for opens done locally in the client when a delegation for the file
  was held. This could cause the client to crash in crsetgroups() when
  recovering from a server crash/reboot. This patch fills in the
  recovery credentials for this case, in order to avoid the client crash.
  Also, add KASSERT()s to the credential copy functions, to catch any
  other cases where the credentials aren't filled in correctly.

Modified:
  stable/8/sys/fs/nfs/nfs_commonport.c
  stable/8/sys/fs/nfs/nfsclstate.h
  stable/8/sys/fs/nfsclient/nfs_clport.c
  stable/8/sys/fs/nfsclient/nfs_clrpcops.c
  stable/8/sys/fs/nfsclient/nfs_clstate.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/geom/sched/   (props changed)

Modified: stable/8/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- stable/8/sys/fs/nfs/nfs_commonport.c	Fri Apr 23 00:11:38 2010	(r207084)
+++ stable/8/sys/fs/nfs/nfs_commonport.c	Fri Apr 23 00:12:23 2010	(r207085)
@@ -225,6 +225,8 @@ void
 newnfs_copycred(struct nfscred *nfscr, struct ucred *cr)
 {
 
+	KASSERT(nfscr->nfsc_ngroups >= 0,
+	    ("newnfs_copycred: negative nfsc_ngroups"));
 	cr->cr_uid = nfscr->nfsc_uid;
 	crsetgroups(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups);
 }

Modified: stable/8/sys/fs/nfs/nfsclstate.h
==============================================================================
--- stable/8/sys/fs/nfs/nfsclstate.h	Fri Apr 23 00:11:38 2010	(r207084)
+++ stable/8/sys/fs/nfs/nfsclstate.h	Fri Apr 23 00:12:23 2010	(r207085)
@@ -140,6 +140,7 @@ struct nfsclopen {
 #define	NFSCLOPEN_OK		0
 #define	NFSCLOPEN_DOOPEN	1
 #define	NFSCLOPEN_DOOPENDOWNGRADE 2
+#define	NFSCLOPEN_SETCRED	3
 
 struct nfscllockowner {
 	LIST_ENTRY(nfscllockowner) nfsl_list;

Modified: stable/8/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clport.c	Fri Apr 23 00:11:38 2010	(r207084)
+++ stable/8/sys/fs/nfsclient/nfs_clport.c	Fri Apr 23 00:12:23 2010	(r207085)
@@ -978,6 +978,8 @@ newnfs_copyincred(struct ucred *cr, stru
 {
 	int i;
 
+	KASSERT(cr->cr_ngroups >= 0,
+	    ("newnfs_copyincred: negative cr_ngroups"));
 	nfscr->nfsc_uid = cr->cr_uid;
 	nfscr->nfsc_ngroups = MIN(cr->cr_ngroups, NFS_MAXGRPS + 1);
 	for (i = 0; i < nfscr->nfsc_ngroups; i++)

Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clrpcops.c	Fri Apr 23 00:11:38 2010	(r207084)
+++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c	Fri Apr 23 00:12:23 2010	(r207085)
@@ -280,7 +280,13 @@ else printf(" fhl=0\n");
 			error = EIO;
 		}
 		newnfs_copyincred(cred, &op->nfso_cred);
-	    }
+	    } else if (ret == NFSCLOPEN_SETCRED)
+		/*
+		 * This is a new local open on a delegation. It needs
+		 * to have credentials so that an open can be done
+		 * against the server during recovery.
+		 */
+		newnfs_copyincred(cred, &op->nfso_cred);
 
 	    /*
 	     * nfso_opencnt is the count of how many VOP_OPEN()s have

Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clstate.c	Fri Apr 23 00:11:38 2010	(r207084)
+++ stable/8/sys/fs/nfsclient/nfs_clstate.c	Fri Apr 23 00:12:23 2010	(r207085)
@@ -274,8 +274,13 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i
 		*owpp = owp;
 	if (opp != NULL)
 		*opp = op;
-	if (retp != NULL)
-		*retp = NFSCLOPEN_OK;
+	if (retp != NULL) {
+		if (nfhp != NULL && dp != NULL && nop == NULL)
+			/* new local open on delegation */
+			*retp = NFSCLOPEN_SETCRED;
+		else
+			*retp = NFSCLOPEN_OK;
+	}
 
 	/*
 	 * Now, check the mode on the open and return the appropriate

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 00:34: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 F12F2106566B;
	Fri, 23 Apr 2010 00:34:59 +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 DBD788FC2D;
	Fri, 23 Apr 2010 00:34: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 o3N0Yxhf039000;
	Fri, 23 Apr 2010 00:34:59 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3N0YxAp038998;
	Fri, 23 Apr 2010 00:34:59 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004230034.o3N0YxAp038998@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 23 Apr 2010 00:34:59 +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: r207086 - 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: Fri, 23 Apr 2010 00:35:00 -0000

Author: rmacklem
Date: Fri Apr 23 00:34:59 2010
New Revision: 207086
URL: http://svn.freebsd.org/changeset/base/207086

Log:
  MFC: r206690
  Add mutex lock calls to 2 cases in the experimental NFS client's
  renew thread where they were missing.

Modified:
  stable/8/sys/fs/nfsclient/nfs_clstate.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/geom/sched/   (props changed)

Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clstate.c	Fri Apr 23 00:12:23 2010	(r207085)
+++ stable/8/sys/fs/nfsclient/nfs_clstate.c	Fri Apr 23 00:34:59 2010	(r207086)
@@ -2318,7 +2318,9 @@ nfscl_renewthread(struct nfsclclient *cl
 	int error, cbpathdown, islept, igotlock, ret, clearok;
 
 	cred = newnfs_getcred();
+	NFSLOCKCLSTATE();
 	clp->nfsc_flags |= NFSCLFLAGS_HASTHREAD;
+	NFSUNLOCKCLSTATE();
 	for(;;) {
 		newnfs_setroot(cred);
 		cbpathdown = 0;
@@ -2331,9 +2333,11 @@ nfscl_renewthread(struct nfsclclient *cl
 			error = nfsrpc_renew(clp, cred, p);
 			if (error == NFSERR_CBPATHDOWN)
 			    cbpathdown = 1;
-			else if (error == NFSERR_STALECLIENTID)
+			else if (error == NFSERR_STALECLIENTID) {
+			    NFSLOCKCLSTATE();
 			    clp->nfsc_flags |= NFSCLFLAGS_RECOVER;
-			else if (error == NFSERR_EXPIRED)
+			    NFSUNLOCKCLSTATE();
+			} else if (error == NFSERR_EXPIRED)
 			    (void) nfscl_hasexpired(clp, clidrev, p);
 		}
 

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 01:34: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 B0654106566B;
	Fri, 23 Apr 2010 01:34:01 +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 A009D8FC13;
	Fri, 23 Apr 2010 01:34: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 o3N1Y1nE051990;
	Fri, 23 Apr 2010 01:34:01 GMT (envelope-from neel@svn.freebsd.org)
Received: (from neel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3N1Y1Ko051988;
	Fri, 23 Apr 2010 01:34:01 GMT (envelope-from neel@svn.freebsd.org)
Message-Id: <201004230134.o3N1Y1Ko051988@svn.freebsd.org>
From: Neel Natu 
Date: Fri, 23 Apr 2010 01:34: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: r207089 - 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: Fri, 23 Apr 2010 01:34:01 -0000

Author: neel
Date: Fri Apr 23 01:34:01 2010
New Revision: 207089
URL: http://svn.freebsd.org/changeset/base/207089

Log:
  Fix compilation error.
  
  tick.c:298:5: error: "KDTRACE_HOOKS" is not defined

Modified:
  head/sys/mips/mips/tick.c

Modified: head/sys/mips/mips/tick.c
==============================================================================
--- head/sys/mips/mips/tick.c	Fri Apr 23 01:22:48 2010	(r207088)
+++ head/sys/mips/mips/tick.c	Fri Apr 23 01:34:01 2010	(r207089)
@@ -295,7 +295,7 @@ clock_intr(void *arg)
 	 */
 	if (delta > cycles_per_hz)
 		delta = cycles_per_hz;
-#if KDTRACE_HOOKS
+#ifdef KDTRACE_HOOKS
 	/*
 	 * If the DTrace hooks are configured and a callback function
 	 * has been registered, then call it to process the high speed

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 03:11: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 3E60B106564A;
	Fri, 23 Apr 2010 03:11: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 2D3F78FC0C;
	Fri, 23 Apr 2010 03:11: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 o3N3BeQh073939;
	Fri, 23 Apr 2010 03:11:40 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3N3Be3O073930;
	Fri, 23 Apr 2010 03:11:40 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201004230311.o3N3Be3O073930@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 23 Apr 2010 03:11: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: r207094 - head/sys/geom/part
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, 23 Apr 2010 03:11:40 -0000

Author: marcel
Date: Fri Apr 23 03:11:39 2010
New Revision: 207094
URL: http://svn.freebsd.org/changeset/base/207094

Log:
  Implement the resize verb and add support for resizing partitions
  for all schemes but EBR. Quality work by Andrey!
  
  Submitted by:	"Andrey V. Elsukov" 

Modified:
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part_apm.c
  head/sys/geom/part/g_part_bsd.c
  head/sys/geom/part/g_part_gpt.c
  head/sys/geom/part/g_part_if.m
  head/sys/geom/part/g_part_mbr.c
  head/sys/geom/part/g_part_pc98.c
  head/sys/geom/part/g_part_vtoc8.c

Modified: head/sys/geom/part/g_part.c
==============================================================================
--- head/sys/geom/part/g_part.c	Fri Apr 23 02:31:28 2010	(r207093)
+++ head/sys/geom/part/g_part.c	Fri Apr 23 03:11:39 2010	(r207094)
@@ -971,9 +971,85 @@ g_part_ctl_recover(struct gctl_req *req,
 static int
 g_part_ctl_resize(struct gctl_req *req, struct g_part_parms *gpp)
 {
-	gctl_error(req, "%d verb 'resize'", ENOSYS);
-	return (ENOSYS);
-} 
+	struct g_geom *gp;
+	struct g_provider *pp;
+	struct g_part_entry *pe, *entry;
+	struct g_part_table *table;
+	struct sbuf *sb;
+	quad_t end;
+	int error;
+
+	gp = gpp->gpp_geom;
+	G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, gp->name));
+	g_topology_assert();
+	table = gp->softc;
+
+	/* check gpp_index */
+	LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) {
+		if (entry->gpe_deleted || entry->gpe_internal)
+			continue;
+		if (entry->gpe_index == gpp->gpp_index)
+			break;
+	}
+	if (entry == NULL) {
+		gctl_error(req, "%d index '%d'", ENOENT, gpp->gpp_index);
+		return (ENOENT);
+	}
+
+	/* check gpp_size */
+	end = entry->gpe_start + gpp->gpp_size - 1;
+	if (gpp->gpp_size < 1 || end > table->gpt_last) {
+		gctl_error(req, "%d size '%jd'", EINVAL,
+		    (intmax_t)gpp->gpp_size);
+		return (EINVAL);
+	}
+
+	LIST_FOREACH(pe, &table->gpt_entry, gpe_entry) {
+		if (pe->gpe_deleted || pe->gpe_internal || pe == entry)
+			continue;
+		if (end >= pe->gpe_start && end <= pe->gpe_end) {
+			gctl_error(req, "%d end '%jd'", ENOSPC,
+			    (intmax_t)end);
+			return (ENOSPC);
+		}
+		if (entry->gpe_start < pe->gpe_start && end > pe->gpe_end) {
+			gctl_error(req, "%d size '%jd'", ENOSPC,
+			    (intmax_t)gpp->gpp_size);
+			return (ENOSPC);
+		}
+	}
+
+	pp = entry->gpe_pp;
+	if ((g_debugflags & 16) == 0 &&
+	    (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) {
+		gctl_error(req, "%d", EBUSY);
+		return (EBUSY);
+	}
+
+	error = G_PART_RESIZE(table, entry, gpp);
+	if (error) {
+		gctl_error(req, "%d", error);
+		return (error);
+	}
+
+	if (!entry->gpe_created)
+		entry->gpe_modified = 1;
+
+	/* update mediasize of changed provider */
+	pp->mediasize = (entry->gpe_end - entry->gpe_start + 1) *
+		pp->sectorsize;
+
+	/* Provide feedback if so requested. */
+	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
+		sb = sbuf_new_auto();
+		G_PART_FULLNAME(table, entry, sb, gp->name);
+		sbuf_cat(sb, " resized\n");
+		sbuf_finish(sb);
+		gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
+		sbuf_delete(sb);
+	}
+	return (0);
+}
 
 static int
 g_part_ctl_setunset(struct gctl_req *req, struct g_part_parms *gpp,
@@ -1194,7 +1270,8 @@ g_part_ctlreq(struct gctl_req *req, stru
 			mparms |= G_PART_PARM_GEOM;
 		} else if (!strcmp(verb, "resize")) {
 			ctlreq = G_PART_CTL_RESIZE;
-			mparms |= G_PART_PARM_GEOM | G_PART_PARM_INDEX;
+			mparms |= G_PART_PARM_GEOM | G_PART_PARM_INDEX |
+			    G_PART_PARM_SIZE;
 		}
 		break;
 	case 's':

Modified: head/sys/geom/part/g_part_apm.c
==============================================================================
--- head/sys/geom/part/g_part_apm.c	Fri Apr 23 02:31:28 2010	(r207093)
+++ head/sys/geom/part/g_part_apm.c	Fri Apr 23 03:11:39 2010	(r207094)
@@ -74,6 +74,8 @@ static int g_part_apm_read(struct g_part
 static const char *g_part_apm_type(struct g_part_table *, struct g_part_entry *,
     char *, size_t);
 static int g_part_apm_write(struct g_part_table *, struct g_consumer *);
+static int g_part_apm_resize(struct g_part_table *, struct g_part_entry *,
+    struct g_part_parms *);
 
 static kobj_method_t g_part_apm_methods[] = {
 	KOBJMETHOD(g_part_add,		g_part_apm_add),
@@ -82,6 +84,7 @@ static kobj_method_t g_part_apm_methods[
 	KOBJMETHOD(g_part_dumpconf,	g_part_apm_dumpconf),
 	KOBJMETHOD(g_part_dumpto,	g_part_apm_dumpto),
 	KOBJMETHOD(g_part_modify,	g_part_apm_modify),
+	KOBJMETHOD(g_part_resize,	g_part_apm_resize),
 	KOBJMETHOD(g_part_name,		g_part_apm_name),
 	KOBJMETHOD(g_part_probe,	g_part_apm_probe),
 	KOBJMETHOD(g_part_read,		g_part_apm_read),
@@ -318,6 +321,19 @@ g_part_apm_modify(struct g_part_table *b
 	return (0);
 }
 
+static int
+g_part_apm_resize(struct g_part_table *basetable,
+    struct g_part_entry *baseentry, struct g_part_parms *gpp)
+{
+	struct g_part_apm_entry *entry;
+
+	entry = (struct g_part_apm_entry *)baseentry;
+	baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1;
+	entry->ent.ent_size = gpp->gpp_size;
+
+	return (0);
+}
+
 static const char *
 g_part_apm_name(struct g_part_table *table, struct g_part_entry *baseentry,
     char *buf, size_t bufsz)

Modified: head/sys/geom/part/g_part_bsd.c
==============================================================================
--- head/sys/geom/part/g_part_bsd.c	Fri Apr 23 02:31:28 2010	(r207093)
+++ head/sys/geom/part/g_part_bsd.c	Fri Apr 23 03:11:39 2010	(r207094)
@@ -73,6 +73,8 @@ static int g_part_bsd_read(struct g_part
 static const char *g_part_bsd_type(struct g_part_table *, struct g_part_entry *,
     char *, size_t);
 static int g_part_bsd_write(struct g_part_table *, struct g_consumer *);
+static int g_part_bsd_resize(struct g_part_table *, struct g_part_entry *,
+    struct g_part_parms *);
 
 static kobj_method_t g_part_bsd_methods[] = {
 	KOBJMETHOD(g_part_add,		g_part_bsd_add),
@@ -82,6 +84,7 @@ static kobj_method_t g_part_bsd_methods[
 	KOBJMETHOD(g_part_dumpconf,	g_part_bsd_dumpconf),
 	KOBJMETHOD(g_part_dumpto,	g_part_bsd_dumpto),
 	KOBJMETHOD(g_part_modify,	g_part_bsd_modify),
+	KOBJMETHOD(g_part_resize,	g_part_bsd_resize),
 	KOBJMETHOD(g_part_name,		g_part_bsd_name),
 	KOBJMETHOD(g_part_probe,	g_part_bsd_probe),
 	KOBJMETHOD(g_part_read,		g_part_bsd_read),
@@ -288,6 +291,19 @@ g_part_bsd_modify(struct g_part_table *b
 	return (0);
 }
 
+static int
+g_part_bsd_resize(struct g_part_table *basetable,
+    struct g_part_entry *baseentry, struct g_part_parms *gpp)
+{
+	struct g_part_bsd_entry *entry;
+
+	entry = (struct g_part_bsd_entry *)baseentry;
+	baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1;
+	entry->part.p_size = gpp->gpp_size;
+
+	return (0);
+}
+
 static const char *
 g_part_bsd_name(struct g_part_table *table, struct g_part_entry *baseentry,
     char *buf, size_t bufsz)

Modified: head/sys/geom/part/g_part_gpt.c
==============================================================================
--- head/sys/geom/part/g_part_gpt.c	Fri Apr 23 02:31:28 2010	(r207093)
+++ head/sys/geom/part/g_part_gpt.c	Fri Apr 23 03:11:39 2010	(r207094)
@@ -103,6 +103,8 @@ static int g_part_gpt_read(struct g_part
 static const char *g_part_gpt_type(struct g_part_table *, struct g_part_entry *,
     char *, size_t);
 static int g_part_gpt_write(struct g_part_table *, struct g_consumer *);
+static int g_part_gpt_resize(struct g_part_table *, struct g_part_entry *,
+    struct g_part_parms *);
 
 static kobj_method_t g_part_gpt_methods[] = {
 	KOBJMETHOD(g_part_add,		g_part_gpt_add),
@@ -112,6 +114,7 @@ static kobj_method_t g_part_gpt_methods[
 	KOBJMETHOD(g_part_dumpconf,	g_part_gpt_dumpconf),
 	KOBJMETHOD(g_part_dumpto,	g_part_gpt_dumpto),
 	KOBJMETHOD(g_part_modify,	g_part_gpt_modify),
+	KOBJMETHOD(g_part_resize,	g_part_gpt_resize),
 	KOBJMETHOD(g_part_name,		g_part_gpt_name),
 	KOBJMETHOD(g_part_probe,	g_part_gpt_probe),
 	KOBJMETHOD(g_part_read,		g_part_gpt_read),
@@ -550,6 +553,19 @@ g_part_gpt_modify(struct g_part_table *b
 	return (0);
 }
 
+static int
+g_part_gpt_resize(struct g_part_table *basetable,
+    struct g_part_entry *baseentry, struct g_part_parms *gpp)
+{
+	struct g_part_gpt_entry *entry;
+	entry = (struct g_part_gpt_entry *)baseentry;
+
+	baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1;
+	entry->ent.ent_lba_end = baseentry->gpe_end;
+
+	return (0);
+}
+
 static const char *
 g_part_gpt_name(struct g_part_table *table, struct g_part_entry *baseentry,
     char *buf, size_t bufsz)

Modified: head/sys/geom/part/g_part_if.m
==============================================================================
--- head/sys/geom/part/g_part_if.m	Fri Apr 23 02:31:28 2010	(r207093)
+++ head/sys/geom/part/g_part_if.m	Fri Apr 23 03:11:39 2010	(r207094)
@@ -58,6 +58,13 @@ CODE {
 	{
 		return (0);
 	}
+
+	static int
+	default_resize(struct g_part_table *t __unused,
+	    struct g_part_entry *e __unused, struct g_part_parms *p __unused)
+	{
+		return (ENOSYS);
+	}
 };
 
 # add() - scheme specific processing for the add verb.
@@ -114,6 +121,13 @@ METHOD int modify {
 	struct g_part_parms *gpp;
 };
 
+# resize() - scheme specific processing for the resize verb.
+METHOD int resize {
+	struct g_part_table *table;
+	struct g_part_entry *entry;
+	struct g_part_parms *gpp;
+} DEFAULT default_resize;
+
 # name() - return the name of the given partition entry.
 # Typical names are "p1", "s0" or "c".
 METHOD const char * name {

Modified: head/sys/geom/part/g_part_mbr.c
==============================================================================
--- head/sys/geom/part/g_part_mbr.c	Fri Apr 23 02:31:28 2010	(r207093)
+++ head/sys/geom/part/g_part_mbr.c	Fri Apr 23 03:11:39 2010	(r207094)
@@ -76,6 +76,8 @@ static int g_part_mbr_setunset(struct g_
 static const char *g_part_mbr_type(struct g_part_table *, struct g_part_entry *,
     char *, size_t);
 static int g_part_mbr_write(struct g_part_table *, struct g_consumer *);
+static int g_part_mbr_resize(struct g_part_table *, struct g_part_entry *,
+    struct g_part_parms *);
 
 static kobj_method_t g_part_mbr_methods[] = {
 	KOBJMETHOD(g_part_add,		g_part_mbr_add),
@@ -85,6 +87,7 @@ static kobj_method_t g_part_mbr_methods[
 	KOBJMETHOD(g_part_dumpconf,	g_part_mbr_dumpconf),
 	KOBJMETHOD(g_part_dumpto,	g_part_mbr_dumpto),
 	KOBJMETHOD(g_part_modify,	g_part_mbr_modify),
+	KOBJMETHOD(g_part_resize,	g_part_mbr_resize),
 	KOBJMETHOD(g_part_name,		g_part_mbr_name),
 	KOBJMETHOD(g_part_probe,	g_part_mbr_probe),
 	KOBJMETHOD(g_part_read,		g_part_mbr_read),
@@ -302,6 +305,31 @@ g_part_mbr_modify(struct g_part_table *b
 	return (0);
 }
 
+static int
+g_part_mbr_resize(struct g_part_table *basetable,
+    struct g_part_entry *baseentry, struct g_part_parms *gpp)
+{
+	struct g_part_mbr_entry *entry;
+	uint32_t size, sectors;
+
+	sectors = basetable->gpt_sectors;
+	size = gpp->gpp_size;
+
+	if (size < sectors)
+		return (EINVAL);
+	if (size % sectors)
+		size = size - (size % sectors);
+	if (size < sectors)
+		return (EINVAL);
+
+	entry = (struct g_part_mbr_entry *)baseentry;
+	baseentry->gpe_end = baseentry->gpe_start + size - 1;
+	entry->ent.dp_size = size;
+	mbr_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl,
+	    &entry->ent.dp_ehd, &entry->ent.dp_esect);
+	return (0);
+}
+
 static const char *
 g_part_mbr_name(struct g_part_table *table, struct g_part_entry *baseentry,
     char *buf, size_t bufsz)

Modified: head/sys/geom/part/g_part_pc98.c
==============================================================================
--- head/sys/geom/part/g_part_pc98.c	Fri Apr 23 02:31:28 2010	(r207093)
+++ head/sys/geom/part/g_part_pc98.c	Fri Apr 23 03:11:39 2010	(r207094)
@@ -77,6 +77,8 @@ static int g_part_pc98_setunset(struct g
 static const char *g_part_pc98_type(struct g_part_table *,
     struct g_part_entry *, char *, size_t);
 static int g_part_pc98_write(struct g_part_table *, struct g_consumer *);
+static int g_part_pc98_resize(struct g_part_table *, struct g_part_entry *,  
+    struct g_part_parms *);
 
 static kobj_method_t g_part_pc98_methods[] = {
 	KOBJMETHOD(g_part_add,		g_part_pc98_add),
@@ -86,6 +88,7 @@ static kobj_method_t g_part_pc98_methods
 	KOBJMETHOD(g_part_dumpconf,	g_part_pc98_dumpconf),
 	KOBJMETHOD(g_part_dumpto,	g_part_pc98_dumpto),
 	KOBJMETHOD(g_part_modify,	g_part_pc98_modify),
+	KOBJMETHOD(g_part_resize,	g_part_pc98_resize),
 	KOBJMETHOD(g_part_name,		g_part_pc98_name),
 	KOBJMETHOD(g_part_probe,	g_part_pc98_probe),
 	KOBJMETHOD(g_part_read,		g_part_pc98_read),
@@ -308,6 +311,31 @@ g_part_pc98_modify(struct g_part_table *
 	return (0);
 }
 
+static int
+g_part_pc98_resize(struct g_part_table *basetable,
+    struct g_part_entry *baseentry, struct g_part_parms *gpp)
+{
+	struct g_part_pc98_entry *entry;
+	uint32_t size, cyl;
+
+	cyl = basetable->gpt_heads * basetable->gpt_sectors;
+	size = gpp->gpp_size;
+
+	if (size < cyl)
+		return (EINVAL);
+	if (size % cyl)
+		size = size - (size % cyl);
+	if (size < cyl)
+		return (EINVAL);
+
+	entry = (struct g_part_pc98_entry *)baseentry;
+	baseentry->gpe_end = baseentry->gpe_start + size - 1;
+	pc98_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl,
+	    &entry->ent.dp_ehd, &entry->ent.dp_esect);
+
+	return (0);
+}
+
 static const char *
 g_part_pc98_name(struct g_part_table *table, struct g_part_entry *baseentry,
     char *buf, size_t bufsz)

Modified: head/sys/geom/part/g_part_vtoc8.c
==============================================================================
--- head/sys/geom/part/g_part_vtoc8.c	Fri Apr 23 02:31:28 2010	(r207093)
+++ head/sys/geom/part/g_part_vtoc8.c	Fri Apr 23 03:11:39 2010	(r207094)
@@ -67,6 +67,8 @@ static int g_part_vtoc8_read(struct g_pa
 static const char *g_part_vtoc8_type(struct g_part_table *, struct g_part_entry *,
     char *, size_t);
 static int g_part_vtoc8_write(struct g_part_table *, struct g_consumer *);
+static int g_part_vtoc8_resize(struct g_part_table *, struct g_part_entry *,  
+    struct g_part_parms *);
 
 static kobj_method_t g_part_vtoc8_methods[] = {
 	KOBJMETHOD(g_part_add,		g_part_vtoc8_add),
@@ -75,6 +77,7 @@ static kobj_method_t g_part_vtoc8_method
 	KOBJMETHOD(g_part_dumpconf,	g_part_vtoc8_dumpconf),
 	KOBJMETHOD(g_part_dumpto,	g_part_vtoc8_dumpto),
 	KOBJMETHOD(g_part_modify,	g_part_vtoc8_modify),
+	KOBJMETHOD(g_part_resize,	g_part_vtoc8_resize),
 	KOBJMETHOD(g_part_name,		g_part_vtoc8_name),
 	KOBJMETHOD(g_part_probe,	g_part_vtoc8_probe),
 	KOBJMETHOD(g_part_read,		g_part_vtoc8_read),
@@ -294,6 +297,26 @@ g_part_vtoc8_modify(struct g_part_table 
 	return (0);
 }
 
+static int
+g_part_vtoc8_resize(struct g_part_table *basetable,
+    struct g_part_entry *entry, struct g_part_parms *gpp)
+{
+	struct g_part_vtoc8_table *table;
+	uint64_t size;
+
+	table = (struct g_part_vtoc8_table *)basetable;
+	size = gpp->gpp_size;
+	if (size % table->secpercyl)
+		size = size - (size % table->secpercyl);
+	if (size < table->secpercyl)
+		return (EINVAL);
+
+	entry->gpe_end = entry->gpe_start + size - 1;
+	be32enc(&table->vtoc.map[entry->gpe_index - 1].nblks, size);
+
+	return (0);
+}
+
 static const char *
 g_part_vtoc8_name(struct g_part_table *table, struct g_part_entry *baseentry,
     char *buf, size_t bufsz)

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 03:14: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 12B3B1065674;
	Fri, 23 Apr 2010 03:14:05 +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 0241F8FC1C;
	Fri, 23 Apr 2010 03:14:05 +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 o3N3E4ok074498;
	Fri, 23 Apr 2010 03:14:04 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3N3E4t1074495;
	Fri, 23 Apr 2010 03:14:04 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201004230314.o3N3E4t1074495@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 23 Apr 2010 03:14: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: r207095 - head/sbin/geom/class/part
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, 23 Apr 2010 03:14:05 -0000

Author: marcel
Date: Fri Apr 23 03:14:04 2010
New Revision: 207095
URL: http://svn.freebsd.org/changeset/base/207095

Log:
  Implement the resize command for resizing partitions. Without new
  size, the partition in question is resized to fill all available
  space. Quality work by Andrey!
  
  Submitted by:	"Andrey V. Elsukov" 

Modified:
  head/sbin/geom/class/part/geom_part.c
  head/sbin/geom/class/part/gpart.8

Modified: head/sbin/geom/class/part/geom_part.c
==============================================================================
--- head/sbin/geom/class/part/geom_part.c	Fri Apr 23 03:11:39 2010	(r207094)
+++ head/sbin/geom/class/part/geom_part.c	Fri Apr 23 03:14:04 2010	(r207095)
@@ -133,6 +133,13 @@ struct g_command PUBSYM(class_commands)[
 		G_OPT_SENTINEL },
 	  "geom", NULL
         },
+	{ "resize", 0, gpart_issue, {
+		{ 's', "size", autofill, G_TYPE_ASCLBA },
+		{ 'i', index_param, NULL, G_TYPE_ASCNUM },
+		{ 'f', "flags", flags, G_TYPE_STRING },
+		G_OPT_SENTINEL },
+	  "geom", NULL
+	},
 	G_CMD_SENTINEL
 };
 
@@ -243,6 +250,99 @@ fmtattrib(struct gprovider *pp)
 }
 
 static int
+gpart_autofill_resize(struct gctl_req *req)
+{
+	struct gmesh mesh;
+	struct gclass *cp;
+	struct ggeom *gp;
+	struct gprovider *pp;
+	unsigned long long last, size, start, new_size;
+	unsigned long long lba, new_lba;
+	const char *s;
+	char *val;
+	int error, idx;
+
+	s = gctl_get_ascii(req, "size");
+	if (*s == '*')
+		new_size = (unsigned long long)atoll(s);
+	else
+		return (0);
+
+	s = gctl_get_ascii(req, index_param);
+	idx = strtol(s, &val, 10);
+	if (idx < 1 || *s == '\0' || *val != '\0')
+		errx(EXIT_FAILURE, "invalid partition index");
+
+	error = geom_gettree(&mesh);
+	if (error)
+		return (error);
+	s = gctl_get_ascii(req, "class");
+	if (s == NULL)
+		abort();
+	cp = find_class(&mesh, s);
+	if (cp == NULL)
+		errx(EXIT_FAILURE, "Class %s not found.", s);
+	s = gctl_get_ascii(req, "geom");
+	if (s == NULL)
+		abort();
+	gp = find_geom(cp, s);
+	if (gp == NULL)
+		errx(EXIT_FAILURE, "No such geom: %s.", s);
+	last = atoll(find_geomcfg(gp, "last"));
+
+	LIST_FOREACH(pp, &gp->lg_provider, lg_provider) {
+		s = find_provcfg(pp, "index");
+		if (s == NULL)
+			continue;
+		if (atoi(s) == idx)
+			break;
+	}
+	if (pp == NULL)
+		errx(EXIT_FAILURE, "invalid partition index");
+
+	s = find_provcfg(pp, "start");
+	if (s == NULL) {
+		s = find_provcfg(pp, "offset");
+		start = atoll(s) / pp->lg_sectorsize;
+	} else
+		start = atoll(s);
+	s = find_provcfg(pp, "end");
+	if (s == NULL) {
+		s = find_provcfg(pp, "length");
+		lba = start + atoll(s) / pp->lg_sectorsize;
+	} else
+		lba = atoll(s) + 1;
+
+	if (lba > last)
+		return (ENOSPC);
+	size = lba - start;
+	pp = find_provider(gp, lba);
+	if (pp == NULL)
+		new_size = last - start + 1;
+	else {
+		s = find_provcfg(pp, "start");
+		if (s == NULL) {
+			s = find_provcfg(pp, "offset");
+			new_lba = atoll(s) / pp->lg_sectorsize;
+		} else
+			new_lba = atoll(s);
+		/* Is there any free space between current and
+		 * next providers?
+		 */
+		if (new_lba > lba)
+			new_size = new_lba - start;
+		else
+			return (ENOSPC);
+	}
+	asprintf(&val, "%llu", new_size);
+	if (val == NULL)
+		return (ENOMEM);
+	gctl_change_param(req, "size", -1, val);
+
+	return (0);
+}
+
+static int
 gpart_autofill(struct gctl_req *req)
 {
 	struct gmesh mesh;
@@ -257,6 +357,8 @@ gpart_autofill(struct gctl_req *req)
 	int error, has_size, has_start;
 
 	s = gctl_get_ascii(req, "verb");
+	if (strcmp(s, "resize") == 0)
+		return gpart_autofill_resize(req);
 	if (strcmp(s, "add") != 0)
 		return (0);
 

Modified: head/sbin/geom/class/part/gpart.8
==============================================================================
--- head/sbin/geom/class/part/gpart.8	Fri Apr 23 03:11:39 2010	(r207094)
+++ head/sbin/geom/class/part/gpart.8	Fri Apr 23 03:14:04 2010	(r207095)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 18, 2008
+.Dd April 22, 2010
 .Dt GPART 8
 .Os
 .Sh NAME
@@ -120,6 +120,13 @@ utility:
 .Op Fl t Ar type
 .Op Fl f Ar flags
 .Ar geom
+.\" ==== RESIZE ====
+.Nm
+.Cm resize
+.Fl i Ar index
+.Op Fl s Ar size
+.Op Fl f Ar flags
+.Ar geom
 .\" ==== SET ====
 .Nm
 .Cm set
@@ -325,6 +332,30 @@ See the section entitled
 below for a discussion
 about its use.
 .El
+.\" ==== RESIZE ====
+.It Cm resize
+Resize a partition from geom
+.Ar geom
+and further identified by the
+.Fl i Ar index
+option. New partition size is expressed in logical block
+numbers and can be given by the 
+.Fl s Ar size
+option. If
+.Fl s
+option is ommited then new size is automatically calculated
+to maximum available from given geom
+.Ar geom .
+.Pp
+Additional options include:
+.Bl -tag -width 10n
+.It Fl f Ar flags
+Additional operational flags.
+See the section entitled
+.Sx "OPERATIONAL FLAGS"
+below for a discussion
+about its use.
+.El
 .\" ==== SET ====
 .It Cm set
 Set the named attribute on the partition entry.

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 03: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 D4937106566B;
	Fri, 23 Apr 2010 03:37:39 +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 C497C8FC1A;
	Fri, 23 Apr 2010 03: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 o3N3bdaK079743;
	Fri, 23 Apr 2010 03:37:39 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3N3bd7Q079742;
	Fri, 23 Apr 2010 03:37:39 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201004230337.o3N3bd7Q079742@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 23 Apr 2010 03:37: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: r207096 - head/sbin/geom/class/part
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, 23 Apr 2010 03:37:39 -0000

Author: marcel
Date: Fri Apr 23 03:37:39 2010
New Revision: 207096
URL: http://svn.freebsd.org/changeset/base/207096

Log:
  Add and describe GEOM_PART_EBR.

Modified:
  head/sbin/geom/class/part/gpart.8

Modified: head/sbin/geom/class/part/gpart.8
==============================================================================
--- head/sbin/geom/class/part/gpart.8	Fri Apr 23 03:14:04 2010	(r207095)
+++ head/sbin/geom/class/part/gpart.8	Fri Apr 23 03:37:39 2010	(r207096)
@@ -37,6 +37,7 @@ lines in your kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "options GEOM_PART_APM"
 .Cd "options GEOM_PART_BSD"
+.Cd "options GEOM_PART_EBR"
 .Cd "options GEOM_PART_GPT"
 .Cd "options GEOM_PART_MBR"
 .Cd "options GEOM_PART_PC98"
@@ -53,6 +54,10 @@ option adds support for the traditional
 .Bx
 disklabel.
 The
+.Dv GEOM_PART_EBR
+option adds support for the Extended Boot Record (EBR),
+which is used to define a logical partition.
+The
 .Dv GEOM_PART_GPT
 option adds support for the GUID Partition Table (GPT)
 found on Intel Itanium computers and Intel-based Macintosh computers.

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 06:51: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 69B481065670;
	Fri, 23 Apr 2010 06:51:19 +0000 (UTC)
	(envelope-from marius@alchemy.franken.de)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
	by mx1.freebsd.org (Postfix) with ESMTP id EA5068FC0A;
	Fri, 23 Apr 2010 06:51:18 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
	by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id
	o3N6pGWD091720; Fri, 23 Apr 2010 08:51:17 +0200 (CEST)
	(envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
	by alchemy.franken.de (8.14.3/8.14.3/Submit) id o3N6pGTU091719;
	Fri, 23 Apr 2010 08:51:16 +0200 (CEST) (envelope-from marius)
Date: Fri, 23 Apr 2010 08:51:16 +0200
From: Marius Strobl 
To: Andrew Thompson 
Message-ID: <20100423065116.GA59832@alchemy.franken.de>
References: <201004222131.o3MLVYj2097482@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201004222131.o3MLVYj2097482@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: r207077 - in head/sys: amd64/conf arm/conf
	dev/sound/usb dev/usb dev/usb/controller dev/usb/input
	dev/usb/misc dev/usb/net dev/usb/serial dev/usb/storage
	dev/usb/wlan i386/conf ia64/con...
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, 23 Apr 2010 06:51:19 -0000

On Thu, Apr 22, 2010 at 09:31:34PM +0000, Andrew Thompson wrote:
> Author: thompsa
> Date: Thu Apr 22 21:31:34 2010
> New Revision: 207077
> URL: http://svn.freebsd.org/changeset/base/207077
> 
> Log:
>   Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had
>   the illusion of a tunable setting but was always turned on regardless.
>   

What's the rationale behind enabling it in all configuration files
except those of amd64 and pc98?

Marius


From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 07:30: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 9ED501065677;
	Fri, 23 Apr 2010 07:30:42 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D0468FC1E;
	Fri, 23 Apr 2010 07:30:41 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by pele.citylink.co.nz (Postfix) with ESMTP id 4D7B47BF31;
	Fri, 23 Apr 2010 19:30:40 +1200 (NZST)
X-Virus-Scanned: Debian amavisd-new at citylink.co.nz
Received: from pele.citylink.co.nz ([127.0.0.1])
	by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id cFrIdZ76Wv3l; Fri, 23 Apr 2010 19:30:35 +1200 (NZST)
Received: from citylink.fud.org.nz (unknown [202.8.44.45])
	by pele.citylink.co.nz (Postfix) with ESMTP;
	Fri, 23 Apr 2010 19:30:35 +1200 (NZST)
Received: by citylink.fud.org.nz (Postfix, from userid 1001)
	id 39E8C11420; Fri, 23 Apr 2010 19:30:35 +1200 (NZST)
Date: Fri, 23 Apr 2010 19:30:35 +1200
From: Andrew Thompson 
To: Marius Strobl 
Message-ID: <20100423073035.GA20337@citylink.fud.org.nz>
References: <201004222131.o3MLVYj2097482@svn.freebsd.org>
	<20100423065116.GA59832@alchemy.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20100423065116.GA59832@alchemy.franken.de>
User-Agent: Mutt/1.5.17 (2007-11-01)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r207077 - in head/sys: amd64/conf arm/conf
	dev/sound/usb dev/usb dev/usb/controller dev/usb/input dev/usb/misc
	dev/usb/net dev/usb/serial dev/usb/storage dev/usb/wlan i386/conf
	ia64/con...
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, 23 Apr 2010 07:30:42 -0000

On Fri, Apr 23, 2010 at 08:51:16AM +0200, Marius Strobl wrote:
> On Thu, Apr 22, 2010 at 09:31:34PM +0000, Andrew Thompson wrote:
> > Author: thompsa
> > Date: Thu Apr 22 21:31:34 2010
> > New Revision: 207077
> > URL: http://svn.freebsd.org/changeset/base/207077
> > 
> > Log:
> >   Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had
> >   the illusion of a tunable setting but was always turned on regardless.
> >   
> 
> What's the rationale behind enabling it in all configuration files
> except those of amd64 and pc98?

Well since it was enabled before I was just keeping status quo. Missing
amd64 and pc98 was probably an oversight on my behalf.


Andrew

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 08:19:47 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 DB6A11065675;
	Fri, 23 Apr 2010 08:19:47 +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 C9AD08FC1F;
	Fri, 23 Apr 2010 08:19:47 +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 o3N8Jlcw041799;
	Fri, 23 Apr 2010 08:19:47 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3N8JljQ041797;
	Fri, 23 Apr 2010 08:19:47 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201004230819.o3N8JljQ041797@svn.freebsd.org>
From: Michael Tuexen 
Date: Fri, 23 Apr 2010 08:19:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207099 - 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: Fri, 23 Apr 2010 08:19:48 -0000

Author: tuexen
Date: Fri Apr 23 08:19:47 2010
New Revision: 207099
URL: http://svn.freebsd.org/changeset/base/207099

Log:
  * Fix compilation when using SCTP_AUDITING_ENABLED.
  * Fix delaying of SACK by taking out old optimization code
    which does not optimize anymore.
  * Fix fast retransmission of chunks abandoned by the
    "number of retransmissions" policy.
  
  MFC after: 3 days.

Modified:
  head/sys/netinet/sctp_asconf.c
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_asconf.c
==============================================================================
--- head/sys/netinet/sctp_asconf.c	Fri Apr 23 07:32:42 2010	(r207098)
+++ head/sys/netinet/sctp_asconf.c	Fri Apr 23 08:19:47 2010	(r207099)
@@ -1113,7 +1113,7 @@ sctp_assoc_immediate_retrans(struct sctp
 		}
 		SCTP_TCB_LOCK_ASSERT(stcb);
 #ifdef SCTP_AUDITING_ENABLED
-		sctp_auditing(4, stcb->sctp_ep, stcb->asoc.deleted_primary);
+		sctp_auditing(4, stcb->sctp_ep, stcb, stcb->asoc.deleted_primary);
 #endif
 		sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_NOT_LOCKED);
 		if ((stcb->asoc.num_send_timers_up == 0) &&

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Fri Apr 23 07:32:42 2010	(r207098)
+++ head/sys/netinet/sctp_indata.c	Fri Apr 23 08:19:47 2010	(r207099)
@@ -2823,25 +2823,7 @@ sctp_process_data(struct mbuf **mm, int 
 		stcb->asoc.send_sack = 1;
 	}
 	/* Start a sack timer or QUEUE a SACK for sending */
-	if ((stcb->asoc.cumulative_tsn == stcb->asoc.highest_tsn_inside_nr_map) &&
-	    (stcb->asoc.nr_mapping_array[0] != 0xff)) {
-		if ((stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq) ||
-		    (stcb->asoc.delayed_ack == 0) ||
-		    (stcb->asoc.numduptsns) ||
-		    (stcb->asoc.send_sack == 1)) {
-			if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) {
-				(void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer);
-			}
-			sctp_send_sack(stcb);
-		} else {
-			if (!SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) {
-				sctp_timer_start(SCTP_TIMER_TYPE_RECV,
-				    stcb->sctp_ep, stcb, NULL);
-			}
-		}
-	} else {
-		sctp_sack_check(stcb, was_a_gap, &abort_flag);
-	}
+	sctp_sack_check(stcb, was_a_gap, &abort_flag);
 	if (abort_flag)
 		return (2);
 
@@ -3532,6 +3514,25 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 		if (tp1->sent == SCTP_DATAGRAM_RESEND) {
 			struct sctp_nets *alt;
 
+			if ((stcb->asoc.peer_supports_prsctp) &&
+			    (PR_SCTP_RTX_ENABLED(tp1->flags))) {
+				/*
+				 * Has it been retransmitted tv_sec times? -
+				 * we store the retran count there.
+				 */
+				if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) {
+					/* Yes, so drop it */
+					if (tp1->data != NULL) {
+						(void)sctp_release_pr_sctp_chunk(stcb, tp1,
+						    (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT),
+						    SCTP_SO_NOT_LOCKED);
+					}
+					/* Make sure to flag we had a FR */
+					tp1->whoTo->net_ack++;
+					tp1 = TAILQ_NEXT(tp1, sctp_next);
+					continue;
+				}
+			}
 			/* fix counts and things */
 			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) {
 				sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND,
@@ -3554,25 +3555,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 			/* remove from the total flight */
 			sctp_total_flight_decrease(stcb, tp1);
 
-			if ((stcb->asoc.peer_supports_prsctp) &&
-			    (PR_SCTP_RTX_ENABLED(tp1->flags))) {
-				/*
-				 * Has it been retransmitted tv_sec times? -
-				 * we store the retran count there.
-				 */
-				if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) {
-					/* Yes, so drop it */
-					if (tp1->data != NULL) {
-						(void)sctp_release_pr_sctp_chunk(stcb, tp1,
-						    (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT),
-						    SCTP_SO_NOT_LOCKED);
-					}
-					/* Make sure to flag we had a FR */
-					tp1->whoTo->net_ack++;
-					tp1 = TAILQ_NEXT(tp1, sctp_next);
-					continue;
-				}
-			}
 			/* printf("OK, we are now ready to FR this guy\n"); */
 			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) {
 				sctp_log_fr(tp1->rec.data.TSN_seq, tp1->snd_count,

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c	Fri Apr 23 07:32:42 2010	(r207098)
+++ head/sys/netinet/sctputil.c	Fri Apr 23 08:19:47 2010	(r207099)
@@ -674,7 +674,7 @@ sctp_auditing(int from, struct sctp_inpc
 			sctp_audit_indx = 0;
 		}
 		rep = 1;
-		SCTP_PRINTF("tot_flt_book:%d\n", tot_book);
+		SCTP_PRINTF("tot_flt_book:%d\n", tot_book_cnt);
 
 		stcb->asoc.total_flight_count = tot_book_cnt;
 	}
@@ -703,8 +703,8 @@ sctp_auditing(int from, struct sctp_inpc
 				}
 			}
 			if (lnet->flight_size != tot_out) {
-				SCTP_PRINTF("net:%x flight was %d corrected to %d\n",
-				    (uint32_t) lnet, lnet->flight_size,
+				SCTP_PRINTF("net:%p flight was %d corrected to %d\n",
+				    lnet, lnet->flight_size,
 				    tot_out);
 				lnet->flight_size = tot_out;
 			}

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 10:55: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 768EF106566B;
	Fri, 23 Apr 2010 10:55:05 +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 5A31A8FC1C;
	Fri, 23 Apr 2010 10:55:03 +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 o3NAso1u015771
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Apr 2010 13:54:50 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	o3NAso8u093935; Fri, 23 Apr 2010 13:54:50 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3NAso3x093933; 
	Fri, 23 Apr 2010 13:54:50 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Fri, 23 Apr 2010 13:54:50 +0300
From: Kostik Belousov 
To: Gabor Kovesdan 
Message-ID: <20100423105450.GA90348@deviant.kiev.zoral.com.ua>
References: <201001252337.o0PNbobw012278@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj"
Content-Disposition: inline
In-Reply-To: <201001252337.o0PNbobw012278@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=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	DNS_FROM_OPENWHOIS autolearn=no 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: r202992 - 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: Fri, 23 Apr 2010 10:55:05 -0000


--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jan 25, 2010 at 11:37:50PM +0000, Gabor Kovesdan wrote:
> Author: gabor (doc,ports committer)
> Date: Mon Jan 25 23:37:49 2010
> New Revision: 202992
> URL: http://svn.freebsd.org/changeset/base/202992
>=20
> Log:
>   Cache failing and opened catalogs in catopen() and related functions.
>   Continuous catopen() calls cause 4 failig stat(2) each, which means a l=
ot
>   of overhead.  It is also a good idea to keep the opened catalogs in the=
 memory
>   to speed up further catopen() calls to the same catalog since these cat=
alogs
>   are not big at all.  In this case, we count references and only free() =
the
>   allocated space when the reference count reaches 0.  The reads and writ=
es to
>   the cache are syncronized with an rwlock when these functions are calle=
d from
>   a threaded program.
>  =20
>   Requested by:	kib
>   Approved by:	delphij

Would you, please merge this (and followups) to stable/8, preferably before
the 8.1 freeze ?

Thanks.

--9amGYk9869ThD9tj
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkvRfHkACgkQC3+MBN1Mb4iq8QCfZmMM78cYZpT5U0rf77ozStgB
hcgAn1wCkXeiIX+QbGR5EQOxL3EuJ6k9
=u82W
-----END PGP SIGNATURE-----

--9amGYk9869ThD9tj--

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 11:07: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 016CC106564A;
	Fri, 23 Apr 2010 11:07:44 +0000 (UTC) (envelope-from flz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E0A808FC13;
	Fri, 23 Apr 2010 11:07: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 o3NB7hNi080407;
	Fri, 23 Apr 2010 11:07:43 GMT (envelope-from flz@svn.freebsd.org)
Received: (from flz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NB7h2a080365;
	Fri, 23 Apr 2010 11:07:43 GMT (envelope-from flz@svn.freebsd.org)
Message-Id: <201004231107.o3NB7h2a080365@svn.freebsd.org>
From: Florent Thoumie 
Date: Fri, 23 Apr 2010 11:07: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: r207113 - in head: . lib lib/libpkg share/mk
	usr.sbin/pkg_install usr.sbin/pkg_install/add
	usr.sbin/pkg_install/create usr.sbin/pkg_install/delete
	usr.sbin/pkg_install/info usr.sbin/pkg...
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, 23 Apr 2010 11:07:44 -0000

Author: flz
Date: Fri Apr 23 11:07:43 2010
New Revision: 207113
URL: http://svn.freebsd.org/changeset/base/207113

Log:
  - Take libinstall.a out of pkg_install and make it a proper shared library.
  - Rework the wrapper support to check libpkg version as well as pkg_install
  version.
  - Add libfetch to _prebuild_libs.
  - There are no new features introduced.
  
  Notes: the API is not stable, so basically, do not use libpkg in your
  projects for now. Also there's no manpage for libpkg yet, because the API
  will change drastically. I repeat, do not use libpkg for now.

Added:
  head/lib/libpkg/
     - copied from r206135, head/usr.sbin/pkg_install/lib/
  head/lib/libpkg/pkg.h
     - copied, changed from r206135, head/usr.sbin/pkg_install/lib/lib.h
Deleted:
  head/lib/libpkg/lib.h
  head/usr.sbin/pkg_install/lib/
Modified:
  head/Makefile.inc1
  head/lib/Makefile
  head/lib/libpkg/Makefile
  head/lib/libpkg/deps.c
  head/lib/libpkg/exec.c
  head/lib/libpkg/file.c
  head/lib/libpkg/global.c
  head/lib/libpkg/match.c
  head/lib/libpkg/msg.c
  head/lib/libpkg/pen.c
  head/lib/libpkg/pkgwrap.c
  head/lib/libpkg/plist.c
  head/lib/libpkg/str.c
  head/lib/libpkg/url.c
  head/lib/libpkg/version.c
  head/share/mk/bsd.libnames.mk
  head/usr.sbin/pkg_install/Makefile
  head/usr.sbin/pkg_install/Makefile.inc
  head/usr.sbin/pkg_install/add/Makefile
  head/usr.sbin/pkg_install/add/extract.c
  head/usr.sbin/pkg_install/add/futil.c
  head/usr.sbin/pkg_install/add/main.c
  head/usr.sbin/pkg_install/add/perform.c
  head/usr.sbin/pkg_install/create/Makefile
  head/usr.sbin/pkg_install/create/main.c
  head/usr.sbin/pkg_install/create/perform.c
  head/usr.sbin/pkg_install/create/pl.c
  head/usr.sbin/pkg_install/delete/Makefile
  head/usr.sbin/pkg_install/delete/main.c
  head/usr.sbin/pkg_install/delete/perform.c
  head/usr.sbin/pkg_install/info/Makefile
  head/usr.sbin/pkg_install/info/info.h
  head/usr.sbin/pkg_install/info/main.c
  head/usr.sbin/pkg_install/info/perform.c
  head/usr.sbin/pkg_install/info/show.c
  head/usr.sbin/pkg_install/updating/Makefile
  head/usr.sbin/pkg_install/updating/main.c
  head/usr.sbin/pkg_install/version/Makefile
  head/usr.sbin/pkg_install/version/main.c
  head/usr.sbin/pkg_install/version/perform.c

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/Makefile.inc1	Fri Apr 23 11:07:43 2010	(r207113)
@@ -1111,7 +1111,7 @@ _prebuild_libs=	${_kerberos5_lib_libasn1
 		${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
 		${_kerberos5_lib_libroken} \
 		lib/libbz2 lib/libcom_err lib/libcrypt \
-		lib/libexpat \
+		lib/libexpat lib/libfetch \
 		${_lib_libgssapi} ${_lib_libipx} \
 		lib/libkiconv lib/libkvm lib/libmd \
 		lib/ncurses/ncurses lib/ncurses/ncursesw \
@@ -1138,6 +1138,7 @@ _cddl_lib= cddl/lib
 _secure_lib_libcrypto= secure/lib/libcrypto
 _secure_lib_libssl= secure/lib/libssl
 lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
+lib/libfetch__L: secure/lib/libcrypto__L secure/lib/libssl__L lib/libmd__L
 .if ${MK_OPENSSH} != "no"
 _secure_lib_libssh= secure/lib/libssh
 secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
@@ -1173,7 +1174,7 @@ _lib_libypclnt=	lib/libypclnt
 .endif
 
 .if ${MK_OPENSSL} == "no"
-lib/libradius__L: lib/libmd__L
+lib/libfetch__L lib/libradius__L: lib/libmd__L
 .endif
 
 .for _lib in ${_prereq_libs}

Modified: head/lib/Makefile
==============================================================================
--- head/lib/Makefile	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/lib/Makefile	Fri Apr 23 11:07:43 2010	(r207113)
@@ -85,6 +85,7 @@ SUBDIR=	${SUBDIR_ORDERED} \
 	libopie \
 	libpam \
 	libpcap \
+	${_libpkg} \
 	${_libpmc} \
 	libproc \
 	librt \
@@ -197,6 +198,10 @@ _libmp=		libmp
 _libpmc=	libpmc
 .endif
 
+.if ${MK_PKGTOOLS} != "no"
+_libpkg=	libpkg
+.endif
+
 .if ${MK_SENDMAIL} != "no"
 _libmilter=	libmilter
 _libsm=		libsm

Modified: head/lib/libpkg/Makefile
==============================================================================
--- head/usr.sbin/pkg_install/lib/Makefile	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/Makefile	Fri Apr 23 11:07:43 2010	(r207113)
@@ -1,11 +1,47 @@
 # $FreeBSD$
 
-LIB=	install
-INTERNALLIB=
-SRCS=	file.c msg.c plist.c str.c exec.c global.c pen.c match.c \
-	deps.c version.c pkgwrap.c url.c
+.include 
 
-WARNS?=	3
-WFORMAT?=	1
+LIB=		pkg
+
+SHLIBDIR?=	/usr/lib
+SHLIB_MAJOR=	0
+
+SRCS=		deps.c		\
+		exec.c		\
+		file.c		\
+		global.c	\
+		match.c		\
+		msg.c		\
+		pen.c		\
+		pkgwrap.c	\
+		plist.c		\
+		str.c		\
+		url.c		\
+		version.c
+INCS=		pkg.h
+
+CFLAGS+=	-DYES_I_KNOW_THE_API_IS_RUBBISH_AND_IS_DOOMED_TO_CHANGE
+
+DPADD=		${LIBFETCH} ${LIBMD} ${LIBUTIL}
+LDADD=		-lfetch -lmd -lutil
+
+.if ${MK_OPENSSL} != "no"
+DPADD+=         ${LIBSSL} ${LIBCRYPTO}
+LDADD+=         -lssl -lcrypto
+.endif
+
+WARNS?=		3
+
+DATE!= grep LIBPKG_VERSION ${.CURDIR}/pkg.h | sed 's|.*[      ]||'
+
+distfile: clean
+	@(cd ${.CURDIR}/..; \
+		cp -r libpkg libpkg-${DATE}; \
+		tar -czf libpkg/libpkg-${DATE}.tar.gz \
+			--exclude .#* --exclude *~ --exclude CVS \
+			--exclude .svn --exclude libpkg-*.tar.gz \
+			libpkg-${DATE}; \
+		rm -rf libpkg-${DATE})
 
 .include 

Modified: head/lib/libpkg/deps.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/deps.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/deps.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -22,7 +22,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 #include 
 #include 
 

Modified: head/lib/libpkg/exec.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/exec.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/exec.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 #include 
 
 /*

Modified: head/lib/libpkg/file.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/file.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/file.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 #include 
 #include 
 #include 

Modified: head/lib/libpkg/global.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/global.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/global.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -22,7 +22,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 
 /* These are global for all utils */
 Boolean	Quiet		= FALSE;

Modified: head/lib/libpkg/match.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/match.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/match.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 #include 
 #include 
 #include 
@@ -292,7 +292,7 @@ matchallbyorigin(const char **origins, i
 		break;
 	    }
 	}
-	if (cmd != PLIST_ORIGIN && ( Verbose || 0 != strncmp("bsdpan-", installed[i], 7 ) ) )
+	if (cmd != PLIST_ORIGIN && 0 != strncmp("bsdpan-", installed[i], 7))
 	    warnx("package %s has no origin recorded", installed[i]);
 	fclose(fp);
     }

Modified: head/lib/libpkg/msg.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/msg.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/msg.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 #include 
 #include 
 
@@ -61,12 +61,7 @@ y_or_n(Boolean def, const char *msg, ...
 	else
 	    fprintf(stderr, " [no]? ");
 	fflush(stderr);
-	if (AutoAnswer) {
-	    ch = (AutoAnswer == YES) ? 'Y' : 'N';
-	    fprintf(stderr, "%c\n", ch);
-	}
-	else
-	    ch = toupper(fgetc(tty));
+	ch = toupper(fgetc(tty));
 	if (ch == '\n')
 	    ch = (def) ? 'Y' : 'N';
     }

Modified: head/lib/libpkg/pen.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/pen.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/pen.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 #include 
 #include 
 #include 
@@ -103,7 +103,7 @@ popPen(char *pen)
 const char *
 make_playpen(char *pen, off_t sz)
 {
-    char humbuf1[6], humbuf2[6];
+    char humbuf[6];
     char cwd[FILENAME_MAX];
 
     if (!find_play_pen(pen, sz))
@@ -114,22 +114,15 @@ make_playpen(char *pen, off_t sz)
 	errx(2, "%s: can't mktemp '%s'", __func__, pen);
     }
 
-    if (Verbose) {
-	if (sz) {
-	    humanize_number(humbuf1, sizeof humbuf1, sz, "", HN_AUTOSCALE,
-	        HN_NOSPACE);
-	    humanize_number(humbuf2, sizeof humbuf2, min_free(pen),
-	        "", HN_AUTOSCALE, HN_NOSPACE);
-	    fprintf(stderr, "Requested space: %s bytes, free space: %s bytes in %s\n", humbuf1, humbuf2, pen);
-	}
-    }
+    humanize_number(humbuf, sizeof humbuf, sz, "", HN_AUTOSCALE, HN_NOSPACE);
 
     if (min_free(pen) < sz) {
 	rmdir(pen);
 	cleanup(0);
 	errx(2, "%s: not enough free space to create '%s'.\n"
 	     "Please set your PKG_TMPDIR environment variable to a location\n"
-	     "with more space and\ntry the command again", __func__, pen);
+	     "with at least %s and try the command again",
+	     __func__, humbuf, pen);
     }
 
     if (!getcwd(cwd, FILENAME_MAX)) {

Copied and modified: head/lib/libpkg/pkg.h (from r206135, head/usr.sbin/pkg_install/lib/lib.h)
==============================================================================
--- head/usr.sbin/pkg_install/lib/lib.h	Sat Apr  3 11:19:20 2010	(r206135, copy source)
+++ head/lib/libpkg/pkg.h	Fri Apr 23 11:07:43 2010	(r207113)
@@ -23,6 +23,10 @@
 #ifndef _INST_LIB_LIB_H_
 #define _INST_LIB_LIB_H_
 
+#ifndef YES_I_KNOW_THE_API_IS_RUBBISH_AND_IS_DOOMED_TO_CHANGE
+#error "You obviously have no idea what you're doing."
+#endif
+
 /* Includes */
 #include 
 #include 
@@ -96,13 +100,12 @@
 #define PKG_PREFIX_VNAME	"PKG_PREFIX"
 
 /*
- * Version of the package tools - increase whenever you make a change
+ * Version of the package library - increase whenever you make a change
  * in the code that is not cosmetic only.
  */
-#define PKG_INSTALL_VERSION	20100403
+#define LIBPKG_VERSION 20100423
 
 #define PKG_WRAPCONF_FNAME	"/var/db/pkg_install.conf"
-#define main(argc, argv)	real_main(argc, argv)
 
 /* Version numbers to assist with changes in package file format */
 #define PLIST_FMT_VER_MAJOR	1
@@ -214,7 +217,7 @@ Boolean 	make_preserve_name(char *, int,
 
 /* For all */
 int		pkg_perform(char **);
-int		real_main(int, char **);
+void		pkg_wrap(long, char **);
 
 /* Query installed packages */
 char		**matchinstalled(match_t, char **, int *);
@@ -229,6 +232,7 @@ int		chkifdepends(const char *, const ch
 int		requiredby(const char *, struct reqr_by_head **, Boolean, Boolean);
 
 /* Version */
+int		libpkg_version(void);
 int		verscmp(Package *, int, int);
 int		version_cmp(const char *, const char *);
 

Modified: head/lib/libpkg/pkgwrap.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/pkgwrap.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/pkgwrap.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -19,71 +19,72 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 #include 
 #include 
 #include 
 #include 
 
-#undef main
-
-#define SEPARATORS " \t"
-
 extern char **environ;
 
-int
-main(int argc, char **argv)
+void
+pkg_wrap(long curver, char **argv)
 {
-    FILE *f;
-    char buffer[FILENAME_MAX], *cp, *verstr;
-    int len;
+    FILE* f;
+    char ver[9];			/* Format is: 'YYYYMMDD\0' */
+    char buffer[FILENAME_MAX+10];	/* Format is: 'YYYYMMDD ' */
+    char cmd[FILENAME_MAX+5];		/* Format is: ' -PPq' */
+    char *path, *cp;
+    long ptver, lpver;
 
     if (getenv("PKG_NOWRAP") != NULL)
 	goto nowrap;
-    f = fopen(PKG_WRAPCONF_FNAME, "r");
-    if (f == NULL)
-	goto nowrap;
-    cp = fgets(buffer, 256, f);
-    fclose(f);
-    if (cp == NULL)
-	goto nowrap;
-    len = strlen(cp);
-    if (cp[len - 1] == '\n')
-	cp[len - 1] = '\0';
-    while (strchr(SEPARATORS, *cp) != NULL)
-	cp++;
-    verstr = cp;
-    cp = strpbrk(cp, SEPARATORS);
-    if (cp == NULL)
+
+    setenv("PKG_NOWRAP", "1", 1);
+
+    /* Get alternative location for package tools. */
+    if ((f = fopen(PKG_WRAPCONF_FNAME, "r")) == NULL) {
 	goto nowrap;
-    *cp = '\0';
-    for (cp = verstr; *cp != '\0'; cp++)
-	if (isdigit(*cp) == 0)
+    } else {
+	if (get_string(buffer, FILENAME_MAX+9, f) == NULL) {
 	    goto nowrap;
-    if (atoi(verstr) < PKG_INSTALL_VERSION)
-	goto nowrap;
-    cp++;
-    while (*cp != '\0' && strchr(SEPARATORS, *cp) != NULL)
-	cp++;
-    if (*cp == '\0')
-	goto nowrap;
-    bcopy(cp, buffer, strlen(cp) + 1);
-    cp = strpbrk(buffer, SEPARATORS);
-    if (cp != NULL)
-	*cp = '\0';
-    if (!isdir(buffer))
-	goto nowrap;
-    cp = strrchr(argv[0], '/');
-    if (cp == NULL)
+	} else {
+	    if ((path = strrchr(buffer, ' ')) == NULL) {
+		goto nowrap;
+	    } else {
+		*path++ = '\0';
+	    }
+	}
+    }
+
+    if ((cp = strrchr(argv[0], '/')) == NULL) {
 	cp = argv[0];
-    else
+    } else {
 	cp++;
-    strlcat(buffer, "/", sizeof(buffer));
-    strlcat(buffer, cp, sizeof(buffer));
-    setenv("PKG_NOWRAP", "1", 1);
-    execve(buffer, argv, environ);
+    }
+
+    /* Get version of the other pkg_install and libpkg */
+    snprintf(cmd, FILENAME_MAX+10, "%s/%s -PPq", path, cp);
+    if ((f = popen(cmd, "r")) == NULL) {
+	perror("popen()");
+	goto nowrap;
+    } else {
+	if (get_string(ver, 9, f) == NULL)
+	    goto nowrap; 
+	else
+	    ptver = strtol(ver, NULL, 10);
+	if (get_string(ver, 9, f) == NULL)
+	    goto nowrap;
+	else
+	    lpver = strtol(ver, NULL, 10);
+	pclose(f);
+    }
+
+    if ((lpver >= LIBPKG_VERSION) && (ptver > curver)) {
+	snprintf(cmd, FILENAME_MAX, "%s/%s", path, cp);
+	execve(cmd, argv, environ);
+    }
 
 nowrap:
     unsetenv("PKG_NOWRAP");
-    return(real_main(argc, argv));
 }

Modified: head/lib/libpkg/plist.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/plist.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/plist.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 #include 
 #include 
 

Modified: head/lib/libpkg/str.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/str.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/str.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 
 char *
 strconcat(const char *s1, const char *s2)

Modified: head/lib/libpkg/url.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/url.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/url.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 #include 
 #include 
 #include 
@@ -109,7 +109,7 @@ fileGetURL(const char *base, const char 
 	printf("Error: Unable to get %s: %s\n",
 	       fname, fetchLastErrString);
 	/* If the fetch fails, yank the package. */
-	if (keep_package && unlink(pkg) < 0 && Verbose) {
+	if (keep_package && unlink(pkg) < 0) {
 	    warnx("failed to remove partially fetched package: %s", pkg);
 	}
 	return NULL;

Modified: head/lib/libpkg/version.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/version.c	Sat Apr  3 11:19:20 2010	(r206135)
+++ head/lib/libpkg/version.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -19,10 +19,20 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include "pkg.h"
 #include 
 
 /*
+ * This routine could easily go somewhere else.
+ *
+ */
+int
+libpkg_version(void)
+{
+	return LIBPKG_VERSION;
+}
+
+/*
  * Routines to assist with PLIST_FMT_VER numbers in the packing
  * lists.
  *

Modified: head/share/mk/bsd.libnames.mk
==============================================================================
--- head/share/mk/bsd.libnames.mk	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/share/mk/bsd.libnames.mk	Fri Apr 23 11:07:43 2010	(r207113)
@@ -128,6 +128,7 @@ MINUSLPAM+=	-lypclnt
 
 LIBPANEL?=	${DESTDIR}${LIBDIR}/libpanel.a
 LIBPCAP?=	${DESTDIR}${LIBDIR}/libpcap.a
+LIBPKG?=	${DESTDIR}${LIBDIR}/libpkg.a
 LIBPMC?=	${DESTDIR}${LIBDIR}/libpmc.a
 LIBPROC?=	${DESTDIR}${LIBDIR}/libproc.a
 LIBPTHREAD?=	${DESTDIR}${LIBDIR}/libpthread.a

Modified: head/usr.sbin/pkg_install/Makefile
==============================================================================
--- head/usr.sbin/pkg_install/Makefile	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/Makefile	Fri Apr 23 11:07:43 2010	(r207113)
@@ -2,11 +2,11 @@
 
 .include 
 
-SUBDIR=	lib add create delete info updating version
+SUBDIR=	add create delete info updating version
 
 .include 
 
-DATE!=	grep PKG_INSTALL_VERSION ${.CURDIR}/lib/lib.h | sed 's|.*[ 	]||'
+DATE!=	grep PKG_INSTALL_VERSION ${.CURDIR}/Makefile.inc | sed 's|.*=||'
 
 distfile: clean
 	@(cd ${.CURDIR}/..; \

Modified: head/usr.sbin/pkg_install/Makefile.inc
==============================================================================
--- head/usr.sbin/pkg_install/Makefile.inc	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/Makefile.inc	Fri Apr 23 11:07:43 2010	(r207113)
@@ -2,16 +2,11 @@
 
 .include 
 
-LIBINSTALL=	${.OBJDIR}/../lib/libinstall.a
+CFLAGS+=	-DPKG_INSTALL_VERSION=20100423
+CFLAGS+=	-DYES_I_KNOW_THE_API_IS_RUBBISH_AND_IS_DOOMED_TO_CHANGE
 
-DPADD+=		${LIBUTIL}
-LDADD+=		-lutil
-
-.if ${MK_OPENSSL} != "no" && \
-    defined(LDADD) && ${LDADD:M-lfetch} != ""
-DPADD+=		${LIBSSL} ${LIBCRYPTO}
-LDADD+=		-lssl -lcrypto
-.endif
+DPADD+=		${LIBPKG}
+LDADD+=		-lpkg
 
 # Inherit BINDIR from one level up.
 .include "../Makefile.inc"

Modified: head/usr.sbin/pkg_install/add/Makefile
==============================================================================
--- head/usr.sbin/pkg_install/add/Makefile	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/add/Makefile	Fri Apr 23 11:07:43 2010	(r207113)
@@ -1,14 +1,11 @@
 # $FreeBSD$
 
+.include 
+
 PROG=	pkg_add
 SRCS=	main.c perform.c futil.c extract.c
 
-CFLAGS+= -I${.CURDIR}/../lib
-
 WARNS?=	3
 WFORMAT?=	1
 
-DPADD=	${LIBINSTALL} ${LIBFETCH} ${LIBMD}
-LDADD=	${LIBINSTALL} -lfetch -lmd
-
 .include 

Modified: head/usr.sbin/pkg_install/add/extract.c
==============================================================================
--- head/usr.sbin/pkg_install/add/extract.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/add/extract.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include "lib.h"
+#include 
 #include "add.h"
 
 

Modified: head/usr.sbin/pkg_install/add/futil.c
==============================================================================
--- head/usr.sbin/pkg_install/add/futil.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/add/futil.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -22,7 +22,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include "lib.h"
+#include 
 #include "add.h"
 
 /*

Modified: head/usr.sbin/pkg_install/add/main.c
==============================================================================
--- head/usr.sbin/pkg_install/add/main.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/add/main.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "lib.h"
+#include 
 #include "add.h"
 
 char	*Prefix		= NULL;
@@ -128,6 +128,8 @@ main(int argc, char **argv)
     static char temppackageroot[MAXPATHLEN];
     static char pkgaddpath[MAXPATHLEN];
 
+    pkg_wrap(PKG_INSTALL_VERSION, argv);
+
     if (*argv[0] != '/' && strchr(argv[0], '/') != NULL)
 	PkgAddCmd = realpath(argv[0], pkgaddpath);
     else

Modified: head/usr.sbin/pkg_install/add/perform.c
==============================================================================
--- head/usr.sbin/pkg_install/add/perform.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/add/perform.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include "lib.h"
+#include 
 #include "add.h"
 
 #include 

Modified: head/usr.sbin/pkg_install/create/Makefile
==============================================================================
--- head/usr.sbin/pkg_install/create/Makefile	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/create/Makefile	Fri Apr 23 11:07:43 2010	(r207113)
@@ -3,12 +3,10 @@
 PROG=	pkg_create
 SRCS=	main.c perform.c pl.c
 
-CFLAGS+= -I${.CURDIR}/../lib
-
 WARNS?=	3
 WFORMAT?=	1
 
-DPADD=	${LIBINSTALL} ${LIBMD}
-LDADD=	${LIBINSTALL} -lmd
+DPADD=	${LIBMD}
+LDADD=	-lmd
 
 .include 

Modified: head/usr.sbin/pkg_install/create/main.c
==============================================================================
--- head/usr.sbin/pkg_install/create/main.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/create/main.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -15,7 +15,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "lib.h"
+#include 
 #include "create.h"
 
 match_t	MatchType	= MATCH_GLOB;
@@ -72,6 +72,8 @@ main(int argc, char **argv)
     int ch;
     char **pkgs, **start, *tmp;
 
+    pkg_wrap(PKG_INSTALL_VERSION, argv);
+
     pkgs = start = argv;
     while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1)
 	switch(ch) {

Modified: head/usr.sbin/pkg_install/create/perform.c
==============================================================================
--- head/usr.sbin/pkg_install/create/perform.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/create/perform.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include 
 #include "create.h"
 
 #include 

Modified: head/usr.sbin/pkg_install/create/pl.c
==============================================================================
--- head/usr.sbin/pkg_install/create/pl.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/create/pl.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include 
 #include "create.h"
 #include 
 #include 

Modified: head/usr.sbin/pkg_install/delete/Makefile
==============================================================================
--- head/usr.sbin/pkg_install/delete/Makefile	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/delete/Makefile	Fri Apr 23 11:07:43 2010	(r207113)
@@ -3,11 +3,6 @@
 PROG=	pkg_delete
 SRCS=	main.c perform.c
 
-CFLAGS+= -I${.CURDIR}/../lib
-
 WFORMAT?=	1
 
-DPADD=	${LIBINSTALL} ${LIBMD}
-LDADD=	${LIBINSTALL} -lmd
-
 .include 

Modified: head/usr.sbin/pkg_install/delete/main.c
==============================================================================
--- head/usr.sbin/pkg_install/delete/main.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/delete/main.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "lib.h"
+#include 
 #include "delete.h"
 
 char	*Prefix		= NULL;
@@ -67,6 +67,8 @@ main(int argc, char **argv)
     const char *tmp;
     struct stat stat_s;
 
+    pkg_wrap(PKG_INSTALL_VERSION, argv);
+
     pkgs = start = argv;
     while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1)
 	switch(ch) {

Modified: head/usr.sbin/pkg_install/delete/perform.c
==============================================================================
--- head/usr.sbin/pkg_install/delete/perform.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/delete/perform.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -22,7 +22,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include "lib.h"
+#include 
 #include "delete.h"
 
 static int pkg_do(char *);

Modified: head/usr.sbin/pkg_install/info/Makefile
==============================================================================
--- head/usr.sbin/pkg_install/info/Makefile	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/info/Makefile	Fri Apr 23 11:07:43 2010	(r207113)
@@ -3,11 +3,9 @@
 PROG=	pkg_info
 SRCS=	main.c perform.c show.c
 
-CFLAGS+= -I${.CURDIR}/../lib
-
 WFORMAT?=	1
 
-DPADD=	${LIBINSTALL} ${LIBFETCH} ${LIBMD}
-LDADD=	${LIBINSTALL} -lfetch -lmd
+DPADD=	${LIBMD}
+LDADD=	-lmd
 
 .include 

Modified: head/usr.sbin/pkg_install/info/info.h
==============================================================================
--- head/usr.sbin/pkg_install/info/info.h	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/info/info.h	Fri Apr 23 11:07:43 2010	(r207113)
@@ -33,25 +33,26 @@
 #define MAXNAMESIZE  20
 #endif
 
-#define SHOW_COMMENT	0x00001
-#define SHOW_DESC	0x00002
-#define SHOW_PLIST	0x00004
-#define SHOW_INSTALL	0x00008
-#define SHOW_DEINSTALL	0x00010
-#define SHOW_REQUIRE	0x00020
-#define SHOW_PREFIX	0x00040
-#define SHOW_INDEX	0x00080
-#define SHOW_FILES	0x00100
-#define SHOW_DISPLAY	0x00200
-#define SHOW_REQBY	0x00400
-#define SHOW_MTREE	0x00800
-#define SHOW_SIZE	0x01000
-#define SHOW_ORIGIN	0x02000
-#define SHOW_CKSUM	0x04000
-#define SHOW_FMTREV	0x08000
-#define SHOW_PTREV	0x10000
-#define SHOW_DEPEND	0x20000
-#define SHOW_PKGNAME	0x40000
+#define SHOW_COMMENT	0x000001
+#define SHOW_DESC	0x000002
+#define SHOW_PLIST	0x000004
+#define SHOW_INSTALL	0x000008
+#define SHOW_DEINSTALL	0x000010
+#define SHOW_REQUIRE	0x000020
+#define SHOW_PREFIX	0x000040
+#define SHOW_INDEX	0x000080
+#define SHOW_FILES	0x000100
+#define SHOW_DISPLAY	0x000200
+#define SHOW_REQBY	0x000400
+#define SHOW_MTREE	0x000800
+#define SHOW_SIZE	0x001000
+#define SHOW_ORIGIN	0x002000
+#define SHOW_CKSUM	0x004000
+#define SHOW_FMTREV	0x008000
+#define SHOW_PTREV	0x010000
+#define SHOW_DEPEND	0x020000
+#define SHOW_PKGNAME	0x040000
+#define SHOW_LPREV	0x100000
 
 struct which_entry {
     TAILQ_ENTRY(which_entry) next;

Modified: head/usr.sbin/pkg_install/info/main.c
==============================================================================
--- head/usr.sbin/pkg_install/info/main.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/info/main.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -25,7 +25,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "lib.h"
+#include 
 #include "info.h"
 
 int	Flags		= 0;
@@ -68,6 +68,8 @@ main(int argc, char **argv)
     char **pkgs, **start;
     char *pkgs_split;
 
+    pkg_wrap(PKG_INSTALL_VERSION, argv);
+
     whead = malloc(sizeof(struct which_head));
     if (whead == NULL)
 	err(2, NULL);
@@ -225,7 +227,10 @@ main(int argc, char **argv)
 	    }
 
 	case 'P':
-	    Flags = SHOW_PTREV;
+	    if (Flags & SHOW_PTREV)
+		Flags |= SHOW_LPREV;
+	    else
+		Flags = SHOW_PTREV;
 	    break;
 
 	case 'h':
@@ -242,6 +247,11 @@ main(int argc, char **argv)
 	if (!Quiet)
 	    printf("Package tools revision: ");
 	printf("%d\n", PKG_INSTALL_VERSION);
+	if (Flags & SHOW_LPREV) {
+	    if (!Quiet)
+		printf("Libpkg revision: ");
+	    printf("%d\n", libpkg_version());
+	}
 	exit(0);
     }
 

Modified: head/usr.sbin/pkg_install/info/perform.c
==============================================================================
--- head/usr.sbin/pkg_install/info/perform.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/info/perform.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include 
 #include "info.h"
 #include 
 #include 

Modified: head/usr.sbin/pkg_install/info/show.c
==============================================================================
--- head/usr.sbin/pkg_install/info/show.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/info/show.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include 
 #include "info.h"
 #include 
 #include 

Modified: head/usr.sbin/pkg_install/updating/Makefile
==============================================================================
--- head/usr.sbin/pkg_install/updating/Makefile	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/updating/Makefile	Fri Apr 23 11:07:43 2010	(r207113)
@@ -3,11 +3,6 @@
 PROG=	pkg_updating
 SRCS=	main.c
 
-CFLAGS+= -I${.CURDIR}/../lib
-
 WFORMAT?= 1
 
-DPADD=	${LIBINSTALL} ${LIBFETCH} ${LIBMD}
-LDADD=	${LIBINSTALL} -lfetch -lmd
-
 .include 

Modified: head/usr.sbin/pkg_install/updating/main.c
==============================================================================
--- head/usr.sbin/pkg_install/updating/main.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/updating/main.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -19,7 +19,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "lib.h"
+#include 
 #include "pathnames.h"
 
 typedef struct installedport {
@@ -87,6 +87,8 @@ main(int argc, char *argv[])
 	DIR *dir;
 	FILE *fd;
 
+	pkg_wrap(PKG_INSTALL_VERSION, argv);
+
 	while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1) {
 		switch (ch) {
 			case 'd':

Modified: head/usr.sbin/pkg_install/version/Makefile
==============================================================================
--- head/usr.sbin/pkg_install/version/Makefile	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/version/Makefile	Fri Apr 23 11:07:43 2010	(r207113)
@@ -3,13 +3,8 @@
 PROG=	pkg_version
 SRCS=	main.c perform.c
 
-CFLAGS+= -I${.CURDIR}/../lib
-
 WFORMAT?=	1
 
-DPADD=	${LIBINSTALL} ${LIBFETCH} ${LIBMD}
-LDADD=	${LIBINSTALL} -lfetch -lmd
-
 test:
 	sh ${.CURDIR}/test-pkg_version.sh
 

Modified: head/usr.sbin/pkg_install/version/main.c
==============================================================================
--- head/usr.sbin/pkg_install/version/main.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/version/main.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -25,7 +25,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "lib.h"
+#include 
 #include "version.h"
 
 char	*LimitChars = NULL;
@@ -58,6 +58,8 @@ main(int argc, char **argv)
 {
     int ch, cmp = 0;
 
+    pkg_wrap(PKG_INSTALL_VERSION, argv);
+
     if (argc == 4 && !strcmp(argv[1], "-t")) {
 	cmp = version_cmp(argv[2], argv[3]);
 	printf(cmp > 0 ? ">\n" : (cmp < 0 ? "<\n" : "=\n"));

Modified: head/usr.sbin/pkg_install/version/perform.c
==============================================================================
--- head/usr.sbin/pkg_install/version/perform.c	Fri Apr 23 10:33:32 2010	(r207112)
+++ head/usr.sbin/pkg_install/version/perform.c	Fri Apr 23 11:07:43 2010	(r207113)
@@ -21,7 +21,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "lib.h"
+#include 
 #include "version.h"
 #include 
 #include 

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 14:32: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 ACCD61065670;
	Fri, 23 Apr 2010 14:32:58 +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 9C46B8FC1A;
	Fri, 23 Apr 2010 14:32: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 o3NEWwJQ025867;
	Fri, 23 Apr 2010 14:32:58 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NEWw8k025865;
	Fri, 23 Apr 2010 14:32:58 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004231432.o3NEWw8k025865@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Fri, 23 Apr 2010 14:32: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: r207116 - 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: Fri, 23 Apr 2010 14:32:58 -0000

Author: bz
Date: Fri Apr 23 14:32:58 2010
New Revision: 207116
URL: http://svn.freebsd.org/changeset/base/207116

Log:
  Remove one zero from the double-0.
  This code doesn't have a license to kill.
  
  MFC after:	3 days

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Fri Apr 23 14:16:10 2010	(r207115)
+++ head/sys/kern/kern_descrip.c	Fri Apr 23 14:32:58 2010	(r207116)
@@ -2896,7 +2896,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE
 				free(sa, M_SONAME);
 			}
 			if (so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa)
-			    == 00 && sa->sa_len <= sizeof(kif->kf_sa_peer)) {
+			    == 0 && sa->sa_len <= sizeof(kif->kf_sa_peer)) {
 				bcopy(sa, &kif->kf_sa_peer, sa->sa_len);
 				free(sa, M_SONAME);
 			}
@@ -3149,7 +3149,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER
 				free(sa, M_SONAME);
 			}
 			if (so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa)
-			    == 00 && sa->sa_len <= sizeof(kif->kf_sa_peer)) {
+			    == 0 && sa->sa_len <= sizeof(kif->kf_sa_peer)) {
 				bcopy(sa, &kif->kf_sa_peer, sa->sa_len);
 				free(sa, M_SONAME);
 			}

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 14:35: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 DED661065672;
	Fri, 23 Apr 2010 14:35:03 +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 CDAA88FC1A;
	Fri, 23 Apr 2010 14:35: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 o3NEZ3dx026377;
	Fri, 23 Apr 2010 14:35:03 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NEZ3WZ026375;
	Fri, 23 Apr 2010 14:35:03 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004231435.o3NEZ3WZ026375@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 23 Apr 2010 14:35:03 +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: r207117 - stable/7/usr.bin/indent
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, 23 Apr 2010 14:35:04 -0000

Author: avg
Date: Fri Apr 23 14:35:03 2010
New Revision: 207117
URL: http://svn.freebsd.org/changeset/base/207117

Log:
  MFC r206687: indent(1): don't treat bare '_t' as a type name with -ta

Modified:
  stable/7/usr.bin/indent/lexi.c
Directory Properties:
  stable/7/usr.bin/indent/   (props changed)

Modified: stable/7/usr.bin/indent/lexi.c
==============================================================================
--- stable/7/usr.bin/indent/lexi.c	Fri Apr 23 14:32:58 2010	(r207116)
+++ stable/7/usr.bin/indent/lexi.c	Fri Apr 23 14:35:03 2010	(r207117)
@@ -251,9 +251,10 @@ lexi(void)
 
 	if (auto_typedefs) {
 	    const char *q = s_token;
+	    size_t q_len = strlen(q);
 	    /* Check if we have an "_t" in the end */
-	    if (q[0] && q[1] &&
-	        (strcmp(q + strlen(q) - 2, "_t") == 0)) {
+	    if (q_len > 2 &&
+	        (strcmp(q + q_len - 2, "_t") == 0)) {
 	        ps.its_a_keyword = true;
 		ps.last_u_d = true;
 	        goto found_auto_typedef;

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 14:48: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 8A887106566B;
	Fri, 23 Apr 2010 14:48:30 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 791F78FC0C;
	Fri, 23 Apr 2010 14:48: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 o3NEmUL6029442;
	Fri, 23 Apr 2010 14:48:30 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NEmU3t029437;
	Fri, 23 Apr 2010 14:48:30 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <201004231448.o3NEmU3t029437@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 23 Apr 2010 14:48: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: r207118 - head/sys/dev/drm
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, 23 Apr 2010 14:48:30 -0000

Author: rnoland
Date: Fri Apr 23 14:48:30 2010
New Revision: 207118
URL: http://svn.freebsd.org/changeset/base/207118

Log:
  Address some WITNESS panics that occur when using the via driver.
  
  Some of these cases should be safe in a non-atomic fashion, however
  since all of the driver ioctls are locked, a lot of work is required to
  fix it correctly.  Just don't sleep now.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_hashtab.c
  head/sys/dev/drm/drm_mm.c
  head/sys/dev/drm/drm_sman.c

Modified: head/sys/dev/drm/drmP.h
==============================================================================
--- head/sys/dev/drm/drmP.h	Fri Apr 23 14:35:03 2010	(r207117)
+++ head/sys/dev/drm/drmP.h	Fri Apr 23 14:48:30 2010	(r207118)
@@ -228,7 +228,7 @@ enum {
 #define DRM_MTRR_WC		MDF_WRITECOMBINE
 #define jiffies			ticks
 
-typedef unsigned long dma_addr_t;
+typedef vm_paddr_t dma_addr_t;
 typedef u_int64_t u64;
 typedef u_int32_t u32;
 typedef u_int16_t u16;

Modified: head/sys/dev/drm/drm_hashtab.c
==============================================================================
--- head/sys/dev/drm/drm_hashtab.c	Fri Apr 23 14:35:03 2010	(r207117)
+++ head/sys/dev/drm/drm_hashtab.c	Fri Apr 23 14:48:30 2010	(r207118)
@@ -46,7 +46,8 @@ int drm_ht_create(struct drm_open_hash *
 	ht->size = 1 << order;
 	ht->order = order;
 	ht->table = NULL;
-	ht->table = hashinit(ht->size, DRM_MEM_HASHTAB, &ht->mask);
+	ht->table = hashinit_flags(ht->size, DRM_MEM_HASHTAB, &ht->mask,
+	    HASH_NOWAIT);
 	if (!ht->table) {
 		DRM_ERROR("Out of memory for hash table\n");
 		return -ENOMEM;

Modified: head/sys/dev/drm/drm_mm.c
==============================================================================
--- head/sys/dev/drm/drm_mm.c	Fri Apr 23 14:35:03 2010	(r207117)
+++ head/sys/dev/drm/drm_mm.c	Fri Apr 23 14:48:30 2010	(r207118)
@@ -333,7 +333,8 @@ int drm_mm_init(struct drm_mm * mm, unsi
 	mm->num_unused = 0;
 	mtx_init(&mm->unused_lock, "drm_unused", NULL, MTX_DEF);
 
-	return drm_mm_create_tail_node(mm, start, size, 0);
+	/* XXX This could be non-atomic but gets called from a locked path */
+	return drm_mm_create_tail_node(mm, start, size, 1);
 }
 
 void drm_mm_takedown(struct drm_mm * mm)

Modified: head/sys/dev/drm/drm_sman.c
==============================================================================
--- head/sys/dev/drm/drm_sman.c	Fri Apr 23 14:35:03 2010	(r207117)
+++ head/sys/dev/drm/drm_sman.c	Fri Apr 23 14:48:30 2010	(r207118)
@@ -96,7 +96,8 @@ static void *drm_sman_mm_allocate(void *
 	if (!tmp) {
 		return NULL;
 	}
-	tmp = drm_mm_get_block(tmp, size, alignment);
+	/* This could be non-atomic, but we are called from a locked path */
+	tmp = drm_mm_get_block_atomic(tmp, size, alignment);
 	return tmp;
 }
 
@@ -131,7 +132,7 @@ drm_sman_set_range(struct drm_sman * sma
 	KASSERT(manager < sman->num_managers, ("Invalid manager"));
 
 	sman_mm = &sman->mm[manager];
-	mm = malloc(sizeof(*mm), DRM_MEM_MM, M_WAITOK | M_ZERO);
+	mm = malloc(sizeof(*mm), DRM_MEM_MM, M_NOWAIT | M_ZERO);
 	if (!mm) {
 		return -ENOMEM;
 	}
@@ -174,7 +175,7 @@ static struct drm_owner_item *drm_sman_g
 				      owner_hash);
 	}
 
-	owner_item = malloc(sizeof(*owner_item), DRM_MEM_MM, M_WAITOK | M_ZERO);
+	owner_item = malloc(sizeof(*owner_item), DRM_MEM_MM, M_NOWAIT | M_ZERO);
 	if (!owner_item)
 		goto out;
 
@@ -206,12 +207,11 @@ struct drm_memblock_item *drm_sman_alloc
 
 	sman_mm = &sman->mm[manager];
 	tmp = sman_mm->allocate(sman_mm->private, size, alignment);
-
 	if (!tmp) {
 		return NULL;
 	}
 
-	memblock = malloc(sizeof(*memblock), DRM_MEM_MM, M_WAITOK | M_ZERO);
+	memblock = malloc(sizeof(*memblock), DRM_MEM_MM, M_NOWAIT | M_ZERO);
 	DRM_DEBUG("allocated mem_block %p\n", memblock);
 	if (!memblock)
 		goto out;

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 15:24: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 414781065676;
	Fri, 23 Apr 2010 15:24:57 +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 2F4AD8FC12;
	Fri, 23 Apr 2010 15:24: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 o3NFOvQt037762;
	Fri, 23 Apr 2010 15:24:57 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NFOvT7037759;
	Fri, 23 Apr 2010 15:24:57 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004231524.o3NFOvT7037759@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 23 Apr 2010 15:24:57 +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: r207119 - in stable/8: etc/mtree share/examples
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, 23 Apr 2010 15:24:57 -0000

Author: avg
Date: Fri Apr 23 15:24:56 2010
New Revision: 207119
URL: http://svn.freebsd.org/changeset/base/207119

Log:
  MFC r206996: indent.pro example: actually install the sample file

Modified:
  stable/8/etc/mtree/BSD.usr.dist
  stable/8/share/examples/Makefile
Directory Properties:
  stable/8/etc/   (props changed)
  stable/8/share/examples/   (props changed)

Modified: stable/8/etc/mtree/BSD.usr.dist
==============================================================================
--- stable/8/etc/mtree/BSD.usr.dist	Fri Apr 23 14:48:30 2010	(r207118)
+++ stable/8/etc/mtree/BSD.usr.dist	Fri Apr 23 15:24:56 2010	(r207119)
@@ -217,6 +217,8 @@
             ..
             ibcs2
             ..
+            indent
+            ..
             ipfilter
             ..
             ipfw

Modified: stable/8/share/examples/Makefile
==============================================================================
--- stable/8/share/examples/Makefile	Fri Apr 23 14:48:30 2010	(r207118)
+++ stable/8/share/examples/Makefile	Fri Apr 23 15:24:56 2010	(r207119)
@@ -15,6 +15,7 @@ LDIRS=	BSD_daemon \
 	find_interface \
 	hast \
 	ibcs2 \
+	indent \
 	ipfw \
 	kld \
 	libvgl \
@@ -77,6 +78,7 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
 	hast/vip-up.sh \
 	ibcs2/README \
 	ibcs2/hello.uu \
+	indent/indent.pro \
 	ipfw/change_rules.sh \
 	kld/Makefile \
 	kld/cdev/Makefile \

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 15:51: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 34FCA1065673;
	Fri, 23 Apr 2010 15:51:14 +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 2309B8FC0C;
	Fri, 23 Apr 2010 15:51: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 o3NFpEeB043636;
	Fri, 23 Apr 2010 15:51:14 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NFpEjt043633;
	Fri, 23 Apr 2010 15:51:14 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004231551.o3NFpEjt043633@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 23 Apr 2010 15:51:13 +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: r207120 - in stable/7: etc/mtree share/examples
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, 23 Apr 2010 15:51:14 -0000

Author: avg
Date: Fri Apr 23 15:51:13 2010
New Revision: 207120
URL: http://svn.freebsd.org/changeset/base/207120

Log:
  MFC r206996: indent.pro example: actually install the sample file

Modified:
  stable/7/etc/mtree/BSD.usr.dist
  stable/7/share/examples/Makefile
Directory Properties:
  stable/7/etc/   (props changed)
  stable/7/share/examples/   (props changed)

Modified: stable/7/etc/mtree/BSD.usr.dist
==============================================================================
--- stable/7/etc/mtree/BSD.usr.dist	Fri Apr 23 15:24:56 2010	(r207119)
+++ stable/7/etc/mtree/BSD.usr.dist	Fri Apr 23 15:51:13 2010	(r207120)
@@ -215,6 +215,8 @@
             ..
             ibcs2
             ..
+            indent
+            ..
             ipfilter
             ..
             ipfw

Modified: stable/7/share/examples/Makefile
==============================================================================
--- stable/7/share/examples/Makefile	Fri Apr 23 15:24:56 2010	(r207119)
+++ stable/7/share/examples/Makefile	Fri Apr 23 15:51:13 2010	(r207120)
@@ -14,6 +14,7 @@ LDIRS=	BSD_daemon \
 	etc \
 	find_interface \
 	ibcs2 \
+	indent \
 	ipfw \
 	isdn \
 	kld \
@@ -76,6 +77,7 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
 	find_interface/find_interface.c \
 	ibcs2/README \
 	ibcs2/hello.uu \
+	indent/indent.pro \
 	ipfw/change_rules.sh \
 	isdn/FAQ \
 	isdn/KERNEL \

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 16:20: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 B7F8B106566C;
	Fri, 23 Apr 2010 16:20:45 +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 A5C4A8FC17;
	Fri, 23 Apr 2010 16:20: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 o3NGKje2050310;
	Fri, 23 Apr 2010 16:20:45 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NGKjoL050308;
	Fri, 23 Apr 2010 16:20:45 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004231620.o3NGKjoL050308@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 23 Apr 2010 16:20: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: r207122 - stable/8/sbin/geom/class/multipath
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, 23 Apr 2010 16:20:45 -0000

Author: mjacob
Date: Fri Apr 23 16:20:45 2010
New Revision: 207122
URL: http://svn.freebsd.org/changeset/base/207122

Log:
  This is an MFS of 205412.
  
  Add 'rotate' and 'getactive' verbs to provide some control and information
  about what the currently active path is.

Modified:
  stable/8/sbin/geom/class/multipath/geom_multipath.c
Directory Properties:
  stable/8/sbin/geom/   (props changed)
  stable/8/sbin/geom/class/stripe/   (props changed)

Modified: stable/8/sbin/geom/class/multipath/geom_multipath.c
==============================================================================
--- stable/8/sbin/geom/class/multipath/geom_multipath.c	Fri Apr 23 16:13:09 2010	(r207121)
+++ stable/8/sbin/geom/class/multipath/geom_multipath.c	Fri Apr 23 16:20:45 2010	(r207122)
@@ -62,6 +62,14 @@ struct g_command class_commands[] = {
 		"clear", G_FLAG_VERBOSE, mp_main, G_NULL_OPTS,
 		NULL, "[-v] prov ..."
 	},
+	{
+		"rotate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
+		NULL, "[-v] prov ..."
+	},
+	{
+		"getactive", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
+		NULL, "[-v] prov ..."
+	},
 	G_CMD_SENTINEL
 };
 

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 16:21: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 98AE21065743;
	Fri, 23 Apr 2010 16:21:40 +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 86FD18FC0C;
	Fri, 23 Apr 2010 16:21: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 o3NGLedm050558;
	Fri, 23 Apr 2010 16:21:40 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NGLeUN050556;
	Fri, 23 Apr 2010 16:21:40 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004231621.o3NGLeUN050556@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 23 Apr 2010 16:21:40 +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: r207123 - stable/7/sbin/geom/class/multipath
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, 23 Apr 2010 16:21:40 -0000

Author: mjacob
Date: Fri Apr 23 16:21:40 2010
New Revision: 207123
URL: http://svn.freebsd.org/changeset/base/207123

Log:
  This is an MFC of 205412.
  
  Add 'rotate' and 'getactive' verbs to provide some control and information
  about what the currently active path is.

Modified:
  stable/7/sbin/geom/class/multipath/geom_multipath.c
Directory Properties:
  stable/7/sbin/geom/   (props changed)
  stable/7/sbin/geom/class/label/   (props changed)
  stable/7/sbin/geom/class/part/   (props changed)
  stable/7/sbin/geom/class/stripe/   (props changed)
  stable/7/sbin/geom/misc/   (props changed)

Modified: stable/7/sbin/geom/class/multipath/geom_multipath.c
==============================================================================
--- stable/7/sbin/geom/class/multipath/geom_multipath.c	Fri Apr 23 16:20:45 2010	(r207122)
+++ stable/7/sbin/geom/class/multipath/geom_multipath.c	Fri Apr 23 16:21:40 2010	(r207123)
@@ -62,6 +62,14 @@ struct g_command class_commands[] = {
 		"clear", G_FLAG_VERBOSE, mp_main, G_NULL_OPTS,
 		NULL, "[-v] prov ..."
 	},
+	{
+		"rotate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
+		NULL, "[-v] prov ..."
+	},
+	{
+		"getactive", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
+		NULL, "[-v] prov ..."
+	},
 	G_CMD_SENTINEL
 };
 

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 16:26: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 04258106568B;
	Fri, 23 Apr 2010 16:26:11 +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 E365E8FC13;
	Fri, 23 Apr 2010 16:26: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 o3NGQAZX051664;
	Fri, 23 Apr 2010 16:26:10 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NGQAFo051662;
	Fri, 23 Apr 2010 16:26:10 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004231626.o3NGQAFo051662@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 23 Apr 2010 16:26:10 +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: r207124 - stable/8/sys/geom/multipath
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, 23 Apr 2010 16:26:11 -0000

Author: mjacob
Date: Fri Apr 23 16:26:10 2010
New Revision: 207124
URL: http://svn.freebsd.org/changeset/base/207124

Log:
  This is an MFC of 205412.
  
  Add 'rotate' and 'getactive' verbs to provide some control and information
  about what the currently active path is.

Modified:
  stable/8/sys/geom/multipath/g_multipath.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/geom/sched/   (props changed)

Modified: stable/8/sys/geom/multipath/g_multipath.c
==============================================================================
--- stable/8/sys/geom/multipath/g_multipath.c	Fri Apr 23 16:21:40 2010	(r207123)
+++ stable/8/sys/geom/multipath/g_multipath.c	Fri Apr 23 16:26:10 2010	(r207124)
@@ -70,6 +70,8 @@ static int g_multipath_destroy(struct g_
 static int
 g_multipath_destroy_geom(struct gctl_req *, struct g_class *, struct g_geom *);
 
+static int g_multipath_rotate(struct g_geom *);
+
 static g_taste_t g_multipath_taste;
 static g_ctl_req_t g_multipath_config;
 static g_init_t g_multipath_init;
@@ -417,6 +419,30 @@ g_multipath_destroy_geom(struct gctl_req
 	return (g_multipath_destroy(gp));
 }
 
+static int
+g_multipath_rotate(struct g_geom *gp)
+{
+	struct g_consumer *lcp;
+	struct g_multipath_softc *sc = gp->softc;
+
+	g_topology_assert();
+	if (sc == NULL)
+		return (ENXIO);
+	LIST_FOREACH(lcp, &gp->consumer, consumer) {
+		if ((lcp->index & MP_BAD) == 0) {
+			if (sc->cp_active != lcp) {
+				break;
+			}
+		}
+	}
+	if (lcp) {
+		sc->cp_active = lcp;
+		printf("GEOM_MULTIPATH: %s now active path in %s\n",
+		    lcp->provider->name, sc->sc_name);
+	}
+	return (0);
+}
+
 static void
 g_multipath_init(struct g_class *mp)
 {
@@ -749,6 +775,63 @@ g_multipath_ctl_destroy(struct gctl_req 
 }
 
 static void
+g_multipath_ctl_rotate(struct gctl_req *req, struct g_class *mp)
+{
+	struct g_geom *gp;
+	const char *name;
+	int error;
+
+	g_topology_assert();
+
+	name = gctl_get_asciiparam(req, "arg0");
+        if (name == NULL) {
+                gctl_error(req, "No 'arg0' argument");
+                return;
+        }
+	gp = g_multipath_find_geom(mp, name);
+	if (gp == NULL) {
+		gctl_error(req, "Device %s is invalid", name);
+		return;
+	}
+	error = g_multipath_rotate(gp);
+	if (error != 0) {
+		gctl_error(req, "failed to rotate %s (err=%d)", name, error);
+	}
+}
+
+static void
+g_multipath_ctl_getactive(struct gctl_req *req, struct g_class *mp)
+{
+	struct sbuf *sb;
+	struct g_geom *gp;
+	struct g_multipath_softc *sc;
+	const char *name;
+
+	sb = sbuf_new_auto();
+
+	g_topology_assert();
+	name = gctl_get_asciiparam(req, "arg0");
+        if (name == NULL) {
+                gctl_error(req, "No 'arg0' argument");
+                return;
+        }
+	gp = g_multipath_find_geom(mp, name);
+	if (gp == NULL) {
+		gctl_error(req, "Device %s is invalid", name);
+		return;
+	}
+	sc = gp->softc;
+	if (sc->cp_active) {
+		sbuf_printf(sb, "%s\n", sc->cp_active->provider->name);
+	} else {
+		sbuf_printf(sb, "none\n");
+	}
+	sbuf_finish(sb);
+	gctl_set_param_err(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
+	sbuf_delete(sb);
+}
+
+static void
 g_multipath_config(struct gctl_req *req, struct g_class *mp, const char *verb)
 {
 	uint32_t *version;
@@ -762,6 +845,10 @@ g_multipath_config(struct gctl_req *req,
 		g_multipath_ctl_create(req, mp);
 	} else if (strcmp(verb, "destroy") == 0) {
 		g_multipath_ctl_destroy(req, mp);
+	} else if (strcmp(verb, "rotate") == 0) {
+		g_multipath_ctl_rotate(req, mp);
+	} else if (strcmp(verb, "getactive") == 0) {
+		g_multipath_ctl_getactive(req, mp);
 	} else {
 		gctl_error(req, "Unknown verb %s", verb);
 	}

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 16:28: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 2850E1065673;
	Fri, 23 Apr 2010 16:28:07 +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 1615C8FC2C;
	Fri, 23 Apr 2010 16:28: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 o3NGS6Gf052201;
	Fri, 23 Apr 2010 16:28:06 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NGS6IN052199;
	Fri, 23 Apr 2010 16:28:06 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004231628.o3NGS6IN052199@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 23 Apr 2010 16:28:06 +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: r207125 - stable/7/sys/geom/multipath
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, 23 Apr 2010 16:28:07 -0000

Author: mjacob
Date: Fri Apr 23 16:28:06 2010
New Revision: 207125
URL: http://svn.freebsd.org/changeset/base/207125

Log:
  This is an MFC of 205412.
  
  Add 'rotate' and 'getactive' verbs to provide some control and information
  about what the currently active path is.

Modified:
  stable/7/sys/geom/multipath/g_multipath.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/geom/multipath/g_multipath.c
==============================================================================
--- stable/7/sys/geom/multipath/g_multipath.c	Fri Apr 23 16:26:10 2010	(r207124)
+++ stable/7/sys/geom/multipath/g_multipath.c	Fri Apr 23 16:28:06 2010	(r207125)
@@ -70,6 +70,8 @@ static int g_multipath_destroy(struct g_
 static int
 g_multipath_destroy_geom(struct gctl_req *, struct g_class *, struct g_geom *);
 
+static int g_multipath_rotate(struct g_geom *);
+
 static g_taste_t g_multipath_taste;
 static g_ctl_req_t g_multipath_config;
 static g_init_t g_multipath_init;
@@ -416,6 +418,30 @@ g_multipath_destroy_geom(struct gctl_req
 	return (g_multipath_destroy(gp));
 }
 
+static int
+g_multipath_rotate(struct g_geom *gp)
+{
+	struct g_consumer *lcp;
+	struct g_multipath_softc *sc = gp->softc;
+
+	g_topology_assert();
+	if (sc == NULL)
+		return (ENXIO);
+	LIST_FOREACH(lcp, &gp->consumer, consumer) {
+		if ((lcp->index & MP_BAD) == 0) {
+			if (sc->cp_active != lcp) {
+				break;
+			}
+		}
+	}
+	if (lcp) {
+		sc->cp_active = lcp;
+		printf("GEOM_MULTIPATH: %s now active path in %s\n",
+		    lcp->provider->name, sc->sc_name);
+	}
+	return (0);
+}
+
 static void
 g_multipath_init(struct g_class *mp)
 {
@@ -748,6 +774,63 @@ g_multipath_ctl_destroy(struct gctl_req 
 }
 
 static void
+g_multipath_ctl_rotate(struct gctl_req *req, struct g_class *mp)
+{
+	struct g_geom *gp;
+	const char *name;
+	int error;
+
+	g_topology_assert();
+
+	name = gctl_get_asciiparam(req, "arg0");
+        if (name == NULL) {
+                gctl_error(req, "No 'arg0' argument");
+                return;
+        }
+	gp = g_multipath_find_geom(mp, name);
+	if (gp == NULL) {
+		gctl_error(req, "Device %s is invalid", name);
+		return;
+	}
+	error = g_multipath_rotate(gp);
+	if (error != 0) {
+		gctl_error(req, "failed to rotate %s (err=%d)", name, error);
+	}
+}
+
+static void
+g_multipath_ctl_getactive(struct gctl_req *req, struct g_class *mp)
+{
+	struct sbuf *sb;
+	struct g_geom *gp;
+	struct g_multipath_softc *sc;
+	const char *name;
+
+	sb = sbuf_new_auto();
+
+	g_topology_assert();
+	name = gctl_get_asciiparam(req, "arg0");
+        if (name == NULL) {
+                gctl_error(req, "No 'arg0' argument");
+                return;
+        }
+	gp = g_multipath_find_geom(mp, name);
+	if (gp == NULL) {
+		gctl_error(req, "Device %s is invalid", name);
+		return;
+	}
+	sc = gp->softc;
+	if (sc->cp_active) {
+		sbuf_printf(sb, "%s\n", sc->cp_active->provider->name);
+	} else {
+		sbuf_printf(sb, "none\n");
+	}
+	sbuf_finish(sb);
+	gctl_set_param_err(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
+	sbuf_delete(sb);
+}
+
+static void
 g_multipath_config(struct gctl_req *req, struct g_class *mp, const char *verb)
 {
 	uint32_t *version;
@@ -761,6 +844,10 @@ g_multipath_config(struct gctl_req *req,
 		g_multipath_ctl_create(req, mp);
 	} else if (strcmp(verb, "destroy") == 0) {
 		g_multipath_ctl_destroy(req, mp);
+	} else if (strcmp(verb, "rotate") == 0) {
+		g_multipath_ctl_rotate(req, mp);
+	} else if (strcmp(verb, "getactive") == 0) {
+		g_multipath_ctl_getactive(req, mp);
 	} else {
 		gctl_error(req, "Unknown verb %s", verb);
 	}

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 16:49: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 D8DF11065672;
	Fri, 23 Apr 2010 16:49:18 +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 C58088FC20;
	Fri, 23 Apr 2010 16:49: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 o3NGnIG8057065;
	Fri, 23 Apr 2010 16:49:18 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NGnIqa057063;
	Fri, 23 Apr 2010 16:49:18 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004231649.o3NGnIqa057063@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 23 Apr 2010 16:49: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: r207126 - stable/8/sys/geom/multipath
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, 23 Apr 2010 16:49:19 -0000

Author: mjacob
Date: Fri Apr 23 16:49:18 2010
New Revision: 207126
URL: http://svn.freebsd.org/changeset/base/207126

Log:
  This is an MFC of 205847, 204071 and 196580
  
  ------
  Change how multipath labels are created and managed. This makes it easier
  to support various storage boxes which really aren't active-active.
  
  We only write the label on the *first* provider. For all other providers
  we just "add" the disk. This also allows for an "add" verb.
  
  A usage implication is that you should specificy the currently active
  storage path as the first provider.
  
  Note that this does not add RDAC-like functionality, but better allows for
  autovolumefailover configurations (additional checkins elsewhere will support
  this).
  
  ------------------------------------------------------------------------
  
  - Style fixes.
  - Prefer strlcpy() over strncpy().
  
  ------------------------------------------------------------------------
  
  There's no need for checking result of M_WAITOK allocation.

Modified:
  stable/8/sys/geom/multipath/g_multipath.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/geom/sched/   (props changed)

Modified: stable/8/sys/geom/multipath/g_multipath.c
==============================================================================
--- stable/8/sys/geom/multipath/g_multipath.c	Fri Apr 23 16:28:06 2010	(r207125)
+++ stable/8/sys/geom/multipath/g_multipath.c	Fri Apr 23 16:49:18 2010	(r207126)
@@ -97,9 +97,8 @@ g_mpd(void *arg, int flags __unused)
 
 	g_topology_assert();
 	cp = arg;
-	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) {
+	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
 		g_access(cp, -cp->acr, -cp->acw, -cp->ace);
-	}
 	if (cp->provider) {
 		printf("GEOM_MULTIPATH: %s removed from %s\n",
 		    cp->provider->name, cp->geom->name);
@@ -224,15 +223,16 @@ g_multipath_done_error(struct bio *bp)
 static void
 g_multipath_kt(void *arg)
 {
+
 	g_multipath_kt_state = GKT_RUN;
 	mtx_lock(&gmtbq_mtx);
 	while (g_multipath_kt_state == GKT_RUN) {
 		for (;;) {
 			struct bio *bp;
+
 			bp = bioq_takefirst(&gmtbq);
-			if (bp == NULL) {
+			if (bp == NULL)
 				break;
-			}
 			mtx_unlock(&gmtbq_mtx);
 			g_multipath_done_error(bp);
 			mtx_lock(&gmtbq_mtx);
@@ -266,9 +266,8 @@ g_multipath_access(struct g_provider *pp
 
 fail:
 	LIST_FOREACH(cp, &gp->consumer, consumer) {
-		if (cp == badcp) {
+		if (cp == badcp)
 			break;
-		}
 		(void) g_access(cp, -dr, -dw, -de);
 	}
 	return (error);
@@ -292,15 +291,10 @@ g_multipath_create(struct g_class *mp, s
 	}
 
 	gp = g_new_geomf(mp, md->md_name);
-	if (gp == NULL) {
+	if (gp == NULL)
 		goto fail;
-	}
 
 	sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
-	if (sc == NULL) {
-		goto fail;
-	}
-
 	gp->softc = sc;
 	gp->start = g_multipath_start;
 	gp->orphan = g_multipath_orphan;
@@ -309,9 +303,8 @@ g_multipath_create(struct g_class *mp, s
 	memcpy(sc->sc_name, md->md_name, sizeof (sc->sc_name));
 
 	pp = g_new_providerf(gp, "multipath/%s", md->md_name);
-	if (pp == NULL) {
+	if (pp == NULL)
 		goto fail;
-	}
 	/* limit the provider to not have it stomp on metadata */
 	pp->mediasize = md->md_size - md->md_sectorsize;
 	pp->sectorsize = md->md_sectorsize;
@@ -320,9 +313,8 @@ g_multipath_create(struct g_class *mp, s
 	return (gp);
 fail:
 	if (gp != NULL) {
-		if (gp->softc != NULL) {
+		if (gp->softc != NULL)
 			g_free(gp->softc);
-		}
 		g_destroy_geom(gp);
 	}
 	return (NULL);
@@ -344,9 +336,8 @@ g_multipath_add_disk(struct g_geom *gp, 
 	 * Make sure that the passed provider isn't already attached
 	 */
 	LIST_FOREACH(cp, &gp->consumer, consumer) {
-		if (cp->provider == pp) {
+		if (cp->provider == pp)
 			break;
-		}
 	}
 	if (cp) {
 		printf("GEOM_MULTIPATH: provider %s already attached to %s\n",
@@ -355,9 +346,8 @@ g_multipath_add_disk(struct g_geom *gp, 
 	}
 	nxtcp = LIST_FIRST(&gp->consumer);
 	cp = g_new_consumer(gp);
-	if (cp == NULL) {
+	if (cp == NULL)
 		return (ENOMEM);
-	}
 	error = g_attach(cp, pp);
 	if (error != 0) {
 		printf("GEOM_MULTIPATH: cannot attach %s to %s",
@@ -398,13 +388,11 @@ g_multipath_destroy(struct g_geom *gp)
 	struct g_provider *pp;
 
 	g_topology_assert();
-	if (gp->softc == NULL) {
+	if (gp->softc == NULL)
 		return (ENXIO);
-	}
 	pp = LIST_FIRST(&gp->provider);
-	if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) {
+	if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0))
 		return (EBUSY);
-	}
 	printf("GEOM_MULTIPATH: destroying %s\n", gp->name);
 	g_free(gp->softc);
 	gp->softc = NULL;
@@ -416,6 +404,7 @@ static int
 g_multipath_destroy_geom(struct gctl_req *req, struct g_class *mp,
     struct g_geom *gp)
 {
+
 	return (g_multipath_destroy(gp));
 }
 
@@ -448,9 +437,8 @@ g_multipath_init(struct g_class *mp)
 {
 	bioq_init(&gmtbq);
 	mtx_init(&gmtbq_mtx, "gmtbq", NULL, MTX_DEF);
-	if (kproc_create(g_multipath_kt, mp, NULL, 0, 0, "g_mp_kt") == 0) {
+	if (kproc_create(g_multipath_kt, mp, NULL, 0, 0, "g_mp_kt") == 0)
 		g_multipath_kt_state = GKT_RUN;
-	}
 }
 
 static void
@@ -476,18 +464,16 @@ g_multipath_read_metadata(struct g_consu
 
 	g_topology_assert();
 	error = g_access(cp, 1, 0, 0);
-	if (error != 0) {
+	if (error != 0)
 		return (error);
-	}
 	pp = cp->provider;
 	g_topology_unlock();
 	buf = g_read_data(cp, pp->mediasize - pp->sectorsize,
 	    pp->sectorsize, &error);
 	g_topology_lock();
 	g_access(cp, -1, 0, 0);
-	if (buf == NULL) {
+	if (buf == NULL)
 		return (error);
-	}
 	multipath_metadata_decode(buf, md);
 	g_free(buf);
 	return (0);
@@ -514,15 +500,13 @@ g_multipath_taste(struct g_class *mp, st
 	g_detach(cp);
 	g_destroy_consumer(cp);
 	g_destroy_geom(gp);
-	if (error != 0) {
+	if (error != 0)
 		return (NULL);
-	}
 	gp = NULL;
 
 	if (strcmp(md.md_magic, G_MULTIPATH_MAGIC) != 0) {
-		if (g_multipath_debug) {
+		if (g_multipath_debug)
 			printf("%s is not MULTIPATH\n", pp->name);
-		}
 		return (NULL);
 	}
 	if (md.md_version != G_MULTIPATH_VERSION) {
@@ -531,9 +515,8 @@ g_multipath_taste(struct g_class *mp, st
 		    G_MULTIPATH_VERSION);
 		return (NULL);
 	}
-	if (g_multipath_debug) {
+	if (g_multipath_debug)
 		printf("MULTIPATH: %s/%s\n", md.md_name, md.md_uuid);
-	}
 
 	/*
 	 * Let's check if such a device already is present. We check against
@@ -549,25 +532,20 @@ g_multipath_taste(struct g_class *mp, st
 	sc = NULL;
 	LIST_FOREACH(gp, &mp->geom, geom) {
 		sc = gp->softc;
-		if (sc == NULL) {
+		if (sc == NULL)
 			continue;
-		}
-		if (strncmp(md.md_uuid, sc->sc_uuid, sizeof(md.md_uuid)) == 0) {
+		if (strncmp(md.md_uuid, sc->sc_uuid, sizeof(md.md_uuid)) == 0)
 			break;
-		}
 	}
 
 	LIST_FOREACH(gp1, &mp->geom, geom) {
-		if (gp1 == gp) {
+		if (gp1 == gp)
 			continue;
-		}
 		sc = gp1->softc;
-		if (sc == NULL) {
+		if (sc == NULL)
 			continue;
-		}
-		if (strncmp(md.md_name, sc->sc_name, sizeof(md.md_name)) == 0) {
+		if (strncmp(md.md_name, sc->sc_name, sizeof(md.md_name)) == 0)
 			break;
-		}
 	}
 
 	/*
@@ -594,9 +572,9 @@ g_multipath_taste(struct g_class *mp, st
 			    sc->sc_name, sc->sc_uuid);
 			printf("GEOM_MULTIPATH: %s will be (temporarily) %s\n",
 			    md.md_uuid, buf);
-			strlcpy(md.md_name, buf, sizeof (md.md_name));
+			strlcpy(md.md_name, buf, sizeof(md.md_name));
 		} else {
-			strlcpy(md.md_name, sc->sc_name, sizeof (md.md_name));
+			strlcpy(md.md_name, sc->sc_name, sizeof(md.md_name));
 		}
 	}
 
@@ -616,9 +594,8 @@ g_multipath_taste(struct g_class *mp, st
 	KASSERT(sc != NULL, ("sc is NULL"));
 	error = g_multipath_add_disk(gp, pp);
 	if (error != 0) {
-		if (isnew) {
+		if (isnew)
 			g_multipath_destroy(gp);
-		}
 		return (NULL);
 	}
 	return (gp);
@@ -657,9 +634,8 @@ g_multipath_ctl_create(struct gctl_req *
 		gctl_error(req, "No 'arg1' argument");
 		return;
 	}
-	if (strncmp(name, devpf, 5) == 0) {
+	if (strncmp(name, devpf, 5) == 0)
 		name += 5;
-	}
 	pp0 = g_provider_by_name(name);
 	if (pp0 == NULL) {
 		gctl_error(req, "Provider %s is invalid", name);
@@ -671,9 +647,8 @@ g_multipath_ctl_create(struct gctl_req *
 		gctl_error(req, "No 'arg2' argument");
 		return;
 	}
-	if (strncmp(name, devpf, 5) == 0) {
+	if (strncmp(name, devpf, 5) == 0)
 		name += 5;
-	}
 	pp1 = g_provider_by_name(name);
 	if (pp1 == NULL) {
 		gctl_error(req, "Provider %s is invalid", name);
@@ -717,13 +692,12 @@ g_multipath_ctl_create(struct gctl_req *
 	memset(&md, 0, sizeof(md));
 	md.md_size = pp0->mediasize;
 	md.md_sectorsize = pp0->sectorsize;
-	strncpy(md.md_name, mpname, sizeof (md.md_name));
-	strncpy(md.md_uuid, uuid, sizeof (md.md_uuid));
+	strlcpy(md.md_name, mpname, sizeof(md.md_name));
+	strlcpy(md.md_uuid, uuid, sizeof(md.md_uuid));
 
 	gp = g_multipath_create(mp, &md);
-	if (gp == NULL) {
+	if (gp == NULL)
 		return;
-	}
 	error = g_multipath_add_disk(gp, pp0);
 	if (error) {
 		g_multipath_destroy(gp);

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 17:26: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 7B0B21065686;
	Fri, 23 Apr 2010 17:26:49 +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 699D88FC1B;
	Fri, 23 Apr 2010 17:26: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 o3NHQnvF065424;
	Fri, 23 Apr 2010 17:26:49 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NHQnoa065422;
	Fri, 23 Apr 2010 17:26:49 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004231726.o3NHQnoa065422@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 23 Apr 2010 17:26: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: r207127 - head/tools/regression/bin/sh/expansion
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, 23 Apr 2010 17:26:49 -0000

Author: jilles
Date: Fri Apr 23 17:26:49 2010
New Revision: 207127
URL: http://svn.freebsd.org/changeset/base/207127

Log:
  sh: Add some more tests for ${v#...} and ${v%...}.
  
  These pass on stable/8 as well.

Added:
  head/tools/regression/bin/sh/expansion/trim3.0   (contents, props changed)

Added: head/tools/regression/bin/sh/expansion/trim3.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/trim3.0	Fri Apr 23 17:26:49 2010	(r207127)
@@ -0,0 +1,46 @@
+# $FreeBSD$
+
+e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}'
+h='##' c='\\\\'
+failures=''
+ok=''
+
+testcase() {
+	code="$1"
+	expected="$2"
+	oIFS="$IFS"
+	eval "$code"
+	IFS='|'
+	result="$#|$*"
+	IFS="$oIFS"
+	if [ "x$result" = "x$expected" ]; then
+		ok=x$ok
+	else
+		failures=x$failures
+		echo "For $code, expected $expected actual $result"
+	fi
+}
+
+# This doesn't make much sense, but it fails in dash so I'm adding it here:
+testcase 'set -- "${w%${w#???}}"'		'1|a b'
+
+testcase 'set -- ${p#/et[}'			'1|c]/'
+testcase 'set -- "${p#/et[}"'			'1|c]/'
+testcase 'set -- "${p%${p#????}}"'		'1|/et['
+
+testcase 'set -- ${b%'\'}\''}'			'1|{{(#)}'
+
+testcase 'set -- ${c#\\}'			'1|\\\'
+testcase 'set -- ${c#\\\\}'			'1|\\'
+testcase 'set -- ${c#\\\\\\}'			'1|\'
+testcase 'set -- ${c#\\\\\\\\}'			'0|'
+testcase 'set -- "${c#\\}"'			'1|\\\'
+testcase 'set -- "${c#\\\\}"'			'1|\\'
+testcase 'set -- "${c#\\\\\\}"'			'1|\'
+testcase 'set -- "${c#\\\\\\\\}"'		'1|'
+testcase 'set -- "${c#"$c"}"'			'1|'
+testcase 'set -- ${c#"$c"}'			'0|'
+testcase 'set -- "${c%"$c"}"'			'1|'
+testcase 'set -- ${c%"$c"}'			'0|'
+
+test "x$failures" = x

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 17: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 83DBE1065673;
	Fri, 23 Apr 2010 17:52:36 +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 6FE9D8FC0A;
	Fri, 23 Apr 2010 17:52: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 o3NHqaMI071096;
	Fri, 23 Apr 2010 17:52:36 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NHqaLB071093;
	Fri, 23 Apr 2010 17:52:36 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004231752.o3NHqaLB071093@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 23 Apr 2010 17:52:36 +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: r207128 - stable/8/tools/regression/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: Fri, 23 Apr 2010 17:52:36 -0000

Author: jilles
Date: Fri Apr 23 17:52:36 2010
New Revision: 207128
URL: http://svn.freebsd.org/changeset/base/207128

Log:
  MFC r206710: Add some tests for fnmatch(3).

Added:
  stable/8/tools/regression/lib/libc/gen/test-fnmatch.c
     - copied unchanged from r206710, head/tools/regression/lib/libc/gen/test-fnmatch.c
Modified:
  stable/8/tools/regression/lib/libc/gen/Makefile
Directory Properties:
  stable/8/tools/regression/lib/libc/   (props changed)

Modified: stable/8/tools/regression/lib/libc/gen/Makefile
==============================================================================
--- stable/8/tools/regression/lib/libc/gen/Makefile	Fri Apr 23 17:26:49 2010	(r207127)
+++ stable/8/tools/regression/lib/libc/gen/Makefile	Fri Apr 23 17:52:36 2010	(r207128)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-TESTS=	test-fmtcheck test-fpclassify test-wordexp
+TESTS=	test-fmtcheck test-fnmatch test-fpclassify test-wordexp
 
 .PHONY: tests
 tests: ${TESTS}

Copied: stable/8/tools/regression/lib/libc/gen/test-fnmatch.c (from r206710, head/tools/regression/lib/libc/gen/test-fnmatch.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/lib/libc/gen/test-fnmatch.c	Fri Apr 23 17:52:36 2010	(r207128, copy of r206710, head/tools/regression/lib/libc/gen/test-fnmatch.c)
@@ -0,0 +1,335 @@
+/*-
+ * Copyright (c) 2010 Jilles Tjoelker
+ * 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 
+#include 
+#include 
+#include 
+#include 
+
+struct testcase {
+	const char *pattern;
+	const char *string;
+	int flags;
+	int result;
+} testcases[] = {
+	"", "", 0, 0,
+	"a", "a", 0, 0,
+	"a", "b", 0, FNM_NOMATCH,
+	"a", "A", 0, FNM_NOMATCH,
+	"*", "a", 0, 0,
+	"*", "aa", 0, 0,
+	"*a", "a", 0, 0,
+	"*a", "b", 0, FNM_NOMATCH,
+	"*a*", "b", 0, FNM_NOMATCH,
+	"*a*b*", "ab", 0, 0,
+	"*a*b*", "qaqbq", 0, 0,
+	"*a*bb*", "qaqbqbbq", 0, 0,
+	"*a*bc*", "qaqbqbcq", 0, 0,
+	"*a*bb*", "qaqbqbb", 0, 0,
+	"*a*bc*", "qaqbqbc", 0, 0,
+	"*a*bb", "qaqbqbb", 0, 0,
+	"*a*bc", "qaqbqbc", 0, 0,
+	"*a*bb", "qaqbqbbq", 0, FNM_NOMATCH,
+	"*a*bc", "qaqbqbcq", 0, FNM_NOMATCH,
+	"*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaa", 0, FNM_NOMATCH,
+	"*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaa", 0, 0,
+	"*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaaa", 0, 0,
+	".*.*.*.*.*.*.*.*.*.*", ".........", 0, FNM_NOMATCH,
+	".*.*.*.*.*.*.*.*.*.*", "..........", 0, 0,
+	".*.*.*.*.*.*.*.*.*.*", "...........", 0, 0,
+	"*?*?*?*?*?*?*?*?*?*?*", "123456789", 0, FNM_NOMATCH,
+	"??????????*", "123456789", 0, FNM_NOMATCH,
+	"*??????????", "123456789", 0, FNM_NOMATCH,
+	"*?*?*?*?*?*?*?*?*?*?*", "1234567890", 0, 0,
+	"??????????*", "1234567890", 0, 0,
+	"*??????????", "1234567890", 0, 0,
+	"*?*?*?*?*?*?*?*?*?*?*", "12345678901", 0, 0,
+	"??????????*", "12345678901", 0, 0,
+	"*??????????", "12345678901", 0, 0,
+	"[x]", "x", 0, 0,
+	"[*]", "*", 0, 0,
+	"[?]", "?", 0, 0,
+	"[", "[", 0, 0,
+	"[[]", "[", 0, 0,
+	"[[]", "x", 0, FNM_NOMATCH,
+	"[*]", "", 0, FNM_NOMATCH,
+	"[*]", "x", 0, FNM_NOMATCH,
+	"[?]", "x", 0, FNM_NOMATCH,
+	"*[*]*", "foo*foo", 0, 0,
+	"*[*]*", "foo", 0, FNM_NOMATCH,
+	"[0-9]", "0", 0, 0,
+	"[0-9]", "5", 0, 0,
+	"[0-9]", "9", 0, 0,
+	"[0-9]", "/", 0, FNM_NOMATCH,
+	"[0-9]", ":", 0, FNM_NOMATCH,
+	"[0-9]", "*", 0, FNM_NOMATCH,
+	"[!0-9]", "0", 0, FNM_NOMATCH,
+	"[!0-9]", "5", 0, FNM_NOMATCH,
+	"[!0-9]", "9", 0, FNM_NOMATCH,
+	"[!0-9]", "/", 0, 0,
+	"[!0-9]", ":", 0, 0,
+	"[!0-9]", "*", 0, 0,
+	"*[0-9]", "a0", 0, 0,
+	"*[0-9]", "a5", 0, 0,
+	"*[0-9]", "a9", 0, 0,
+	"*[0-9]", "a/", 0, FNM_NOMATCH,
+	"*[0-9]", "a:", 0, FNM_NOMATCH,
+	"*[0-9]", "a*", 0, FNM_NOMATCH,
+	"*[!0-9]", "a0", 0, FNM_NOMATCH,
+	"*[!0-9]", "a5", 0, FNM_NOMATCH,
+	"*[!0-9]", "a9", 0, FNM_NOMATCH,
+	"*[!0-9]", "a/", 0, 0,
+	"*[!0-9]", "a:", 0, 0,
+	"*[!0-9]", "a*", 0, 0,
+	"*[0-9]", "a00", 0, 0,
+	"*[0-9]", "a55", 0, 0,
+	"*[0-9]", "a99", 0, 0,
+	"*[0-9]", "a0a0", 0, 0,
+	"*[0-9]", "a5a5", 0, 0,
+	"*[0-9]", "a9a9", 0, 0,
+	"\\*", "*", 0, 0,
+	"\\?", "?", 0, 0,
+	"\\[x]", "[x]", 0, 0,
+	"\\[", "[", 0, 0,
+	"\\\\", "\\", 0, 0,
+	"*\\**", "foo*foo", 0, 0,
+	"*\\**", "foo", 0, FNM_NOMATCH,
+	"*\\\\*", "foo\\foo", 0, 0,
+	"*\\\\*", "foo", 0, FNM_NOMATCH,
+	"\\(", "(", 0, 0,
+	"\\a", "a", 0, 0,
+	"\\*", "a", 0, FNM_NOMATCH,
+	"\\?", "a", 0, FNM_NOMATCH,
+	"\\*", "\\*", 0, FNM_NOMATCH,
+	"\\?", "\\?", 0, FNM_NOMATCH,
+	"\\[x]", "\\[x]", 0, FNM_NOMATCH,
+	"\\[x]", "\\x", 0, FNM_NOMATCH,
+	"\\[", "\\[", 0, FNM_NOMATCH,
+	"\\(", "\\(", 0, FNM_NOMATCH,
+	"\\a", "\\a", 0, FNM_NOMATCH,
+	"\\*", "\\*", FNM_NOESCAPE, 0,
+	"\\?", "\\?", FNM_NOESCAPE, 0,
+	"\\", "\\", FNM_NOESCAPE, 0,
+	"\\\\", "\\", FNM_NOESCAPE, FNM_NOMATCH,
+	"\\\\", "\\\\", FNM_NOESCAPE, 0,
+	"*\\*", "foo\\foo", FNM_NOESCAPE, 0,
+	"*\\*", "foo", FNM_NOESCAPE, FNM_NOMATCH,
+	"*", ".", FNM_PERIOD, FNM_NOMATCH,
+	"?", ".", FNM_PERIOD, FNM_NOMATCH,
+	".*", ".", 0, 0,
+	".*", "..", 0, 0,
+	".*", ".a", 0, 0,
+	"[0-9]", ".", FNM_PERIOD, FNM_NOMATCH,
+	"a*", "a.", 0, 0,
+	"a/a", "a/a", FNM_PATHNAME, 0,
+	"a/*", "a/a", FNM_PATHNAME, 0,
+	"*/a", "a/a", FNM_PATHNAME, 0,
+	"*/*", "a/a", FNM_PATHNAME, 0,
+	"a*b/*", "abbb/x", FNM_PATHNAME, 0,
+	"a*b/*", "abbb/.x", FNM_PATHNAME, 0,
+	"*", "a/a", FNM_PATHNAME, FNM_NOMATCH,
+	"*/*", "a/a/a", FNM_PATHNAME, FNM_NOMATCH,
+	"b/*", "b/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH,
+	"b*/*", "a/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH,
+	"b/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0,
+	"b*/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0,
+	"a", "A", FNM_CASEFOLD, 0,
+	"A", "a", FNM_CASEFOLD, 0,
+	"[a]", "A", FNM_CASEFOLD, 0,
+	"[A]", "a", FNM_CASEFOLD, 0,
+	"a", "b", FNM_CASEFOLD, FNM_NOMATCH,
+	"a", "a/b", FNM_PATHNAME, FNM_NOMATCH,
+	"*", "a/b", FNM_PATHNAME, FNM_NOMATCH,
+	"*b", "a/b", FNM_PATHNAME, FNM_NOMATCH,
+	"a", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
+	"*", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
+	"*", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
+	"*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
+	"*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH,
+	"*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH,
+};
+
+static const char *
+flags_to_string(int flags)
+{
+	static const int flagvalues[] = { FNM_NOESCAPE, FNM_PATHNAME,
+		FNM_PERIOD, FNM_LEADING_DIR, FNM_CASEFOLD, 0 };
+	static const char flagnames[] = "FNM_NOESCAPE\0FNM_PATHNAME\0FNM_PERIOD\0FNM_LEADING_DIR\0FNM_CASEFOLD\0";
+	static char result[sizeof(flagnames) + 3 * sizeof(int) + 2];
+	char *p;
+	size_t i, len;
+	const char *fp;
+
+	p = result;
+	fp = flagnames;
+	for (i = 0; flagvalues[i] != 0; i++) {
+		len = strlen(fp);
+		if (flags & flagvalues[i]) {
+			if (p != result)
+				*p++ = '|';
+			memcpy(p, fp, len);
+			p += len;
+			flags &= ~flagvalues[i];
+		}
+		fp += len + 1;
+	}
+	if (p == result)
+		memcpy(p, "0", 2);
+	else if (flags != 0)
+		sprintf(p, "%d", flags);
+	else
+		*p = '\0';
+	return result;
+}
+
+int
+main(int argc, char *argv[])
+{
+	size_t i, n;
+	int flags, result, extra, errors;
+	struct testcase *t;
+
+	n = sizeof(testcases) / sizeof(testcases[0]);
+	errors = 0;
+	printf("1..%zu\n", n);
+	for (i = 0; i < n; i++) {
+		t = &testcases[i];
+		flags = t->flags;
+		extra = 0;
+		do {
+			result = fnmatch(t->pattern, t->string, flags);
+			if (result != t->result)
+				break;
+			if (strchr(t->pattern, '\\') == NULL &&
+			    !(flags & FNM_NOESCAPE)) {
+				flags |= FNM_NOESCAPE;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if (strchr(t->pattern, '\\') != NULL &&
+			    strchr(t->string, '\\') == NULL &&
+			    t->result == FNM_NOMATCH &&
+			    !(flags & (FNM_NOESCAPE | FNM_LEADING_DIR))) {
+				flags |= FNM_NOESCAPE;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if ((t->string[0] != '.' || t->pattern[0] == '.' ||
+			    t->result == FNM_NOMATCH) &&
+			    !(flags & (FNM_PATHNAME | FNM_PERIOD))) {
+				flags |= FNM_PERIOD;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if ((strchr(t->string, '/') == NULL ||
+			    t->result == FNM_NOMATCH) &&
+			    !(flags & FNM_PATHNAME)) {
+				flags |= FNM_PATHNAME;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if ((((t->string[0] != '.' || t->pattern[0] == '.') &&
+			    strstr(t->string, "/.") == NULL) ||
+			    t->result == FNM_NOMATCH) &&
+			    flags & FNM_PATHNAME && !(flags & FNM_PERIOD)) {
+				flags |= FNM_PERIOD;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if ((((t->string[0] != '.' || t->pattern[0] == '.') &&
+			    strchr(t->string, '/') == NULL) ||
+			    t->result == FNM_NOMATCH) &&
+			    !(flags & (FNM_PATHNAME | FNM_PERIOD))) {
+				flags |= FNM_PATHNAME | FNM_PERIOD;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if ((strchr(t->string, '/') == NULL || t->result == 0)
+			    && !(flags & FNM_LEADING_DIR)) {
+				flags |= FNM_LEADING_DIR;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if (t->result == 0 && !(flags & FNM_CASEFOLD)) {
+				flags |= FNM_CASEFOLD;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if (strchr(t->pattern, '\\') == NULL &&
+			    t->result == 0 &&
+			    !(flags & (FNM_NOESCAPE | FNM_CASEFOLD))) {
+				flags |= FNM_NOESCAPE | FNM_CASEFOLD;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+		} while (0);
+		if (result == t->result)
+			printf("ok %zu - fnmatch(\"%s\", \"%s\", %s) = %d (+%d)\n",
+			    i + 1, t->pattern, t->string,
+			    flags_to_string(flags),
+			    result, extra);
+		else {
+			printf("not ok %zu - fnmatch(\"%s\", \"%s\", %s) = %d != %d\n",
+			    i + 1, t->pattern, t->string,
+			    flags_to_string(flags),
+			    result, t->result);
+			errors = 1;
+		}
+	}
+
+	return (errors);
+}

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 18:01: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 52C9D106567A;
	Fri, 23 Apr 2010 18:01:20 +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 268118FC46;
	Fri, 23 Apr 2010 18:01: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 o3NI1Kt7073108;
	Fri, 23 Apr 2010 18:01:20 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NI1K3e073105;
	Fri, 23 Apr 2010 18:01:20 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004231801.o3NI1K3e073105@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 23 Apr 2010 18:01: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: r207129 - in stable/8: lib/libc/gen
	tools/regression/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: Fri, 23 Apr 2010 18:01:20 -0000

Author: jilles
Date: Fri Apr 23 18:01:19 2010
New Revision: 207129
URL: http://svn.freebsd.org/changeset/base/207129

Log:
  MFC r206711: fnmatch: Fix bad FNM_PERIOD disabling
  if an asterisk has been seen.
  
  Example: fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD)
  
  PR:		116074

Modified:
  stable/8/lib/libc/gen/fnmatch.c
  stable/8/tools/regression/lib/libc/gen/test-fnmatch.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/tools/regression/lib/libc/   (props changed)

Modified: stable/8/lib/libc/gen/fnmatch.c
==============================================================================
--- stable/8/lib/libc/gen/fnmatch.c	Fri Apr 23 17:52:36 2010	(r207128)
+++ stable/8/lib/libc/gen/fnmatch.c	Fri Apr 23 18:01:19 2010	(r207129)
@@ -67,7 +67,8 @@ __FBSDID("$FreeBSD$");
 #define RANGE_ERROR     (-1)
 
 static int rangematch(const char *, wchar_t, int, char **, mbstate_t *);
-static int fnmatch1(const char *, const char *, int, mbstate_t, mbstate_t);
+static int fnmatch1(const char *, const char *, const char *, int, mbstate_t,
+		mbstate_t);
 
 int
 fnmatch(pattern, string, flags)
@@ -76,22 +77,21 @@ fnmatch(pattern, string, flags)
 {
 	static const mbstate_t initial;
 
-	return (fnmatch1(pattern, string, flags, initial, initial));
+	return (fnmatch1(pattern, string, string, flags, initial, initial));
 }
 
 static int
-fnmatch1(pattern, string, flags, patmbs, strmbs)
-	const char *pattern, *string;
+fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
+	const char *pattern, *string, *stringstart;
 	int flags;
 	mbstate_t patmbs, strmbs;
 {
-	const char *stringstart;
 	char *newp;
 	char c;
 	wchar_t pc, sc;
 	size_t pclen, sclen;
 
-	for (stringstart = string;;) {
+	for (;;) {
 		pclen = mbrtowc(&pc, pattern, MB_LEN_MAX, &patmbs);
 		if (pclen == (size_t)-1 || pclen == (size_t)-2)
 			return (FNM_NOMATCH);
@@ -145,8 +145,8 @@ fnmatch1(pattern, string, flags, patmbs,
 
 			/* General case, use recursion. */
 			while (sc != EOS) {
-				if (!fnmatch1(pattern, string,
-				    flags & ~FNM_PERIOD, patmbs, strmbs))
+				if (!fnmatch1(pattern, string, stringstart,
+				    flags, patmbs, strmbs))
 					return (0);
 				sclen = mbrtowc(&sc, string, MB_LEN_MAX,
 				    &strmbs);

Modified: stable/8/tools/regression/lib/libc/gen/test-fnmatch.c
==============================================================================
--- stable/8/tools/regression/lib/libc/gen/test-fnmatch.c	Fri Apr 23 17:52:36 2010	(r207128)
+++ stable/8/tools/regression/lib/libc/gen/test-fnmatch.c	Fri Apr 23 18:01:19 2010	(r207129)
@@ -174,6 +174,7 @@ struct testcase {
 	"*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
 	"*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH,
 	"*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH,
+	"a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH,
 };
 
 static const char *

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 18:53: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 3B4E2106567A;
	Fri, 23 Apr 2010 18:53:18 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2A9D78FC22;
	Fri, 23 Apr 2010 18:53: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 o3NIrINo084673;
	Fri, 23 Apr 2010 18:53:18 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NIrIoB084653;
	Fri, 23 Apr 2010 18:53:18 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201004231853.o3NIrIoB084653@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 23 Apr 2010 18:53: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: r207130 - 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: Fri, 23 Apr 2010 18:53:18 -0000

Author: jmallett
Date: Fri Apr 23 18:53:17 2010
New Revision: 207130
URL: http://svn.freebsd.org/changeset/base/207130

Log:
  Large memory mappings are always CPU local and always done with interrupts
  disabled.  Be doubly-sure that we don't try to do a TLB shootdown on SMP
  systems for those mappings.
  
  Submitted by:	C. Jayachandran

Modified:
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Fri Apr 23 18:01:19 2010	(r207129)
+++ head/sys/mips/mips/pmap.c	Fri Apr 23 18:53:17 2010	(r207130)
@@ -251,11 +251,11 @@ caddr_t virtual_sys_start = (caddr_t)0;
 #define	PMAP_LMEM_UNMAP()						\
 	pte = pmap_pte(kernel_pmap, sysm->base);			\
 	*pte = PTE_G;							\
-	pmap_invalidate_page(kernel_pmap, sysm->base);			\
+	pmap_TLB_invalidate_kernel(sysm->base);				\
 	sysm->valid1 = 0;						\
 	pte = pmap_pte(kernel_pmap, sysm->base + PAGE_SIZE);		\
 	*pte = PTE_G;							\
-	pmap_invalidate_page(kernel_pmap, sysm->base + PAGE_SIZE);	\
+	pmap_TLB_invalidate_kernel(sysm->base + PAGE_SIZE);		\
 	sysm->valid2 = 0;						\
 	sched_unpin();							\
 	intr_restore(intr);						\

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 19:20: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 863321065672;
	Fri, 23 Apr 2010 19:20:56 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 757858FC1C;
	Fri, 23 Apr 2010 19:20: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 o3NJKulL090839;
	Fri, 23 Apr 2010 19:20:56 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NJKuPo090836;
	Fri, 23 Apr 2010 19:20:56 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201004231920.o3NJKuPo090836@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 23 Apr 2010 19:20: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: r207131 - in head/sys/mips: conf 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, 23 Apr 2010 19:20:56 -0000

Author: jmallett
Date: Fri Apr 23 19:20:56 2010
New Revision: 207131
URL: http://svn.freebsd.org/changeset/base/207131

Log:
  o) Remove default MAXMEM on SWARM; pmap can readily use lmem for >512M
     physical addresses.
  o) Set a local maxmem in sb_machdep.c to avoid trying to use pages over 2^64
     under 32-bit ABIs.  Our pmap needs corrected to use vm_paddr_t consistently,
     then we can make vm_paddr_t 64-bit under 32-bit ABIs and add code in pmap
     to limit phys_avail by the maximum PFN that a 32-bit PTE can hold.

Modified:
  head/sys/mips/conf/SWARM
  head/sys/mips/sibyte/sb_machdep.c

Modified: head/sys/mips/conf/SWARM
==============================================================================
--- head/sys/mips/conf/SWARM	Fri Apr 23 18:53:17 2010	(r207130)
+++ head/sys/mips/conf/SWARM	Fri Apr 23 19:20:56 2010	(r207131)
@@ -8,12 +8,6 @@ options		CPU_SB1
 files		"../sibyte/files.sibyte"
 hints		"SWARM.hints"
 
-#
-# 32-bit kernel cannot deal with physical memory beyond 4GB
-# XXX pmap assumes that all the memory can be mapped using KSEG0
-#
-options		MAXMEM=512*1024
-
 options		CFE
 options		CFE_CONSOLE
 options		CFE_ENV

Modified: head/sys/mips/sibyte/sb_machdep.c
==============================================================================
--- head/sys/mips/sibyte/sb_machdep.c	Fri Apr 23 18:53:17 2010	(r207130)
+++ head/sys/mips/sibyte/sb_machdep.c	Fri Apr 23 19:20:56 2010	(r207131)
@@ -158,6 +158,17 @@ mips_init(void)
 	TUNABLE_INT_FETCH("hw.physmem", &tmp);
 	maxmem = (uint64_t)tmp * 1024;
 
+	/*
+	 * XXX
+	 * If we used vm_paddr_t consistently in pmap, etc., we could
+	 * use 64-bit page numbers on !n64 systems, too, like i386
+	 * does with PAE.
+	 */
+#if !defined(__mips_n64)
+	if (maxmem == 0 || maxmem > 0xffffffff)
+		maxmem = 0xffffffff;
+#endif
+
 #ifdef CFE
 	/*
 	 * Query DRAM memory map from CFE.

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 19:26: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 57226106564A;
	Fri, 23 Apr 2010 19:26:04 +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 45AE98FC18;
	Fri, 23 Apr 2010 19:26: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 o3NJQ41W092030;
	Fri, 23 Apr 2010 19:26:04 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NJQ4UR092028;
	Fri, 23 Apr 2010 19:26:04 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004231926.o3NJQ4UR092028@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 23 Apr 2010 19:26:04 +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: r207132 - stable/8/bin/sh
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, 23 Apr 2010 19:26:04 -0000

Author: jilles
Date: Fri Apr 23 19:26:03 2010
New Revision: 207132
URL: http://svn.freebsd.org/changeset/base/207132

Log:
  MFC r197848: Clarify quoting of word in ${v=word} in sh(1).

Modified:
  stable/8/bin/sh/sh.1
Directory Properties:
  stable/8/bin/sh/   (props changed)

Modified: stable/8/bin/sh/sh.1
==============================================================================
--- stable/8/bin/sh/sh.1	Fri Apr 23 19:20:56 2010	(r207131)
+++ stable/8/bin/sh/sh.1	Fri Apr 23 19:26:03 2010	(r207132)
@@ -1227,6 +1227,9 @@ In all cases, the
 final value of
 .Ar parameter
 is substituted.
+Quoting inside
+.Ar word
+does not prevent field splitting or pathname expansion.
 Only variables, not positional
 parameters or special parameters, can be
 assigned in this way.

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 19:35: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 D2080106566B;
	Fri, 23 Apr 2010 19:35:07 +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 BF9C48FC12;
	Fri, 23 Apr 2010 19:35: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 o3NJZ7Gf094044;
	Fri, 23 Apr 2010 19:35:07 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NJZ7Zt094042;
	Fri, 23 Apr 2010 19:35:07 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004231935.o3NJZ7Zt094042@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 23 Apr 2010 19:35:07 +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: r207133 - stable/7/sys/geom/multipath
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, 23 Apr 2010 19:35:07 -0000

Author: mjacob
Date: Fri Apr 23 19:35:07 2010
New Revision: 207133
URL: http://svn.freebsd.org/changeset/base/207133

Log:
  This is an MFC of 205847, 204071, 196580 and 196579
  
  ------------------------------------------------------------------------
  Change how multipath labels are created and managed. This makes it easier
  to support various storage boxes which really aren't active-active.
  
  We only write the label on the *first* provider. For all other providers
  we just "add" the disk. This also allows for an "add" verb.
  
  A usage implication is that you should specificy the currently active
  storage path as the first provider.
  
  Note that this does not add RDAC-like functionality, but better allows for
  autovolumefailover configurations (additional checkins elsewhere will support
  this).
  ------------------------------------------------------------------------
  
  - Style fixes.
  - Prefer strlcpy() over strncpy().
  
  ------------------------------------------------------------------------
  
  There's no need for checking result of M_WAITOK allocation.
  
  ------------------------------------------------------------------------
  
  Fix an obvious topology lock leak.

Modified:
  stable/7/sys/geom/multipath/g_multipath.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/geom/multipath/g_multipath.c
==============================================================================
--- stable/7/sys/geom/multipath/g_multipath.c	Fri Apr 23 19:26:03 2010	(r207132)
+++ stable/7/sys/geom/multipath/g_multipath.c	Fri Apr 23 19:35:07 2010	(r207133)
@@ -97,9 +97,8 @@ g_mpd(void *arg, int flags __unused)
 
 	g_topology_assert();
 	cp = arg;
-	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) {
+	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
 		g_access(cp, -cp->acr, -cp->acw, -cp->ace);
-	}
 	if (cp->provider) {
 		printf("GEOM_MULTIPATH: %s removed from %s\n",
 		    cp->provider->name, cp->geom->name);
@@ -223,15 +222,16 @@ g_multipath_done_error(struct bio *bp)
 static void
 g_multipath_kt(void *arg)
 {
+
 	g_multipath_kt_state = GKT_RUN;
 	mtx_lock(&gmtbq_mtx);
 	while (g_multipath_kt_state == GKT_RUN) {
 		for (;;) {
 			struct bio *bp;
+
 			bp = bioq_takefirst(&gmtbq);
-			if (bp == NULL) {
+			if (bp == NULL)
 				break;
-			}
 			mtx_unlock(&gmtbq_mtx);
 			g_multipath_done_error(bp);
 			mtx_lock(&gmtbq_mtx);
@@ -265,9 +265,8 @@ g_multipath_access(struct g_provider *pp
 
 fail:
 	LIST_FOREACH(cp, &gp->consumer, consumer) {
-		if (cp == badcp) {
+		if (cp == badcp)
 			break;
-		}
 		(void) g_access(cp, -dr, -dw, -de);
 	}
 	return (error);
@@ -291,9 +290,8 @@ g_multipath_create(struct g_class *mp, s
 	}
 
 	gp = g_new_geomf(mp, md->md_name);
-	if (gp == NULL) {
+	if (gp == NULL)
 		goto fail;
-	}
 
 	sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
 	if (sc == NULL) {
@@ -308,9 +306,8 @@ g_multipath_create(struct g_class *mp, s
 	memcpy(sc->sc_name, md->md_name, sizeof (sc->sc_name));
 
 	pp = g_new_providerf(gp, "multipath/%s", md->md_name);
-	if (pp == NULL) {
+	if (pp == NULL)
 		goto fail;
-	}
 	/* limit the provider to not have it stomp on metadata */
 	pp->mediasize = md->md_size - md->md_sectorsize;
 	pp->sectorsize = md->md_sectorsize;
@@ -319,9 +316,8 @@ g_multipath_create(struct g_class *mp, s
 	return (gp);
 fail:
 	if (gp != NULL) {
-		if (gp->softc != NULL) {
+		if (gp->softc != NULL)
 			g_free(gp->softc);
-		}
 		g_destroy_geom(gp);
 	}
 	return (NULL);
@@ -343,9 +339,8 @@ g_multipath_add_disk(struct g_geom *gp, 
 	 * Make sure that the passed provider isn't already attached
 	 */
 	LIST_FOREACH(cp, &gp->consumer, consumer) {
-		if (cp->provider == pp) {
+		if (cp->provider == pp)
 			break;
-		}
 	}
 	if (cp) {
 		printf("GEOM_MULTIPATH: provider %s already attached to %s\n",
@@ -354,9 +349,8 @@ g_multipath_add_disk(struct g_geom *gp, 
 	}
 	nxtcp = LIST_FIRST(&gp->consumer);
 	cp = g_new_consumer(gp);
-	if (cp == NULL) {
+	if (cp == NULL)
 		return (ENOMEM);
-	}
 	error = g_attach(cp, pp);
 	if (error != 0) {
 		printf("GEOM_MULTIPATH: cannot attach %s to %s",
@@ -397,13 +391,11 @@ g_multipath_destroy(struct g_geom *gp)
 	struct g_provider *pp;
 
 	g_topology_assert();
-	if (gp->softc == NULL) {
+	if (gp->softc == NULL)
 		return (ENXIO);
-	}
 	pp = LIST_FIRST(&gp->provider);
-	if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) {
+	if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0))
 		return (EBUSY);
-	}
 	printf("GEOM_MULTIPATH: destroying %s\n", gp->name);
 	g_free(gp->softc);
 	gp->softc = NULL;
@@ -415,6 +407,7 @@ static int
 g_multipath_destroy_geom(struct gctl_req *req, struct g_class *mp,
     struct g_geom *gp)
 {
+
 	return (g_multipath_destroy(gp));
 }
 
@@ -447,9 +440,8 @@ g_multipath_init(struct g_class *mp)
 {
 	bioq_init(&gmtbq);
 	mtx_init(&gmtbq_mtx, "gmtbq", NULL, MTX_DEF);
-	if (kthread_create(g_multipath_kt, mp, NULL, 0, 0, "g_mp_kt") == 0) {
+	if (kthread_create(g_multipath_kt, mp, NULL, 0, 0, "g_mp_kt") == 0)
 		g_multipath_kt_state = GKT_RUN;
-	}
 }
 
 static void
@@ -475,18 +467,16 @@ g_multipath_read_metadata(struct g_consu
 
 	g_topology_assert();
 	error = g_access(cp, 1, 0, 0);
-	if (error != 0) {
+	if (error != 0)
 		return (error);
-	}
 	pp = cp->provider;
 	g_topology_unlock();
 	buf = g_read_data(cp, pp->mediasize - pp->sectorsize,
 	    pp->sectorsize, &error);
 	g_topology_lock();
 	g_access(cp, -1, 0, 0);
-	if (buf == NULL) {
+	if (buf == NULL)
 		return (error);
-	}
 	multipath_metadata_decode(buf, md);
 	g_free(buf);
 	return (0);
@@ -513,15 +503,13 @@ g_multipath_taste(struct g_class *mp, st
 	g_detach(cp);
 	g_destroy_consumer(cp);
 	g_destroy_geom(gp);
-	if (error != 0) {
+	if (error != 0)
 		return (NULL);
-	}
 	gp = NULL;
 
 	if (strcmp(md.md_magic, G_MULTIPATH_MAGIC) != 0) {
-		if (g_multipath_debug) {
+		if (g_multipath_debug)
 			printf("%s is not MULTIPATH\n", pp->name);
-		}
 		return (NULL);
 	}
 	if (md.md_version != G_MULTIPATH_VERSION) {
@@ -530,9 +518,8 @@ g_multipath_taste(struct g_class *mp, st
 		    G_MULTIPATH_VERSION);
 		return (NULL);
 	}
-	if (g_multipath_debug) {
+	if (g_multipath_debug)
 		printf("MULTIPATH: %s/%s\n", md.md_name, md.md_uuid);
-	}
 
 	/*
 	 * Let's check if such a device already is present. We check against
@@ -548,25 +535,20 @@ g_multipath_taste(struct g_class *mp, st
 	sc = NULL;
 	LIST_FOREACH(gp, &mp->geom, geom) {
 		sc = gp->softc;
-		if (sc == NULL) {
+		if (sc == NULL)
 			continue;
-		}
-		if (strncmp(md.md_uuid, sc->sc_uuid, sizeof(md.md_uuid)) == 0) {
+		if (strncmp(md.md_uuid, sc->sc_uuid, sizeof(md.md_uuid)) == 0)
 			break;
-		}
 	}
 
 	LIST_FOREACH(gp1, &mp->geom, geom) {
-		if (gp1 == gp) {
+		if (gp1 == gp)
 			continue;
-		}
 		sc = gp1->softc;
-		if (sc == NULL) {
+		if (sc == NULL)
 			continue;
-		}
-		if (strncmp(md.md_name, sc->sc_name, sizeof(md.md_name)) == 0) {
+		if (strncmp(md.md_name, sc->sc_name, sizeof(md.md_name)) == 0)
 			break;
-		}
 	}
 
 	/*
@@ -593,9 +575,9 @@ g_multipath_taste(struct g_class *mp, st
 			    sc->sc_name, sc->sc_uuid);
 			printf("GEOM_MULTIPATH: %s will be (temporarily) %s\n",
 			    md.md_uuid, buf);
-			strlcpy(md.md_name, buf, sizeof (md.md_name));
+			strlcpy(md.md_name, buf, sizeof(md.md_name));
 		} else {
-			strlcpy(md.md_name, sc->sc_name, sizeof (md.md_name));
+			strlcpy(md.md_name, sc->sc_name, sizeof(md.md_name));
 		}
 	}
 
@@ -615,9 +597,8 @@ g_multipath_taste(struct g_class *mp, st
 	KASSERT(sc != NULL, ("sc is NULL"));
 	error = g_multipath_add_disk(gp, pp);
 	if (error != 0) {
-		if (isnew) {
+		if (isnew)
 			g_multipath_destroy(gp);
-		}
 		return (NULL);
 	}
 	return (gp);
@@ -656,9 +637,8 @@ g_multipath_ctl_create(struct gctl_req *
 		gctl_error(req, "No 'arg1' argument");
 		return;
 	}
-	if (strncmp(name, devpf, 5) == 0) {
+	if (strncmp(name, devpf, 5) == 0)
 		name += 5;
-	}
 	pp0 = g_provider_by_name(name);
 	if (pp0 == NULL) {
 		gctl_error(req, "Provider %s is invalid", name);
@@ -670,9 +650,8 @@ g_multipath_ctl_create(struct gctl_req *
 		gctl_error(req, "No 'arg2' argument");
 		return;
 	}
-	if (strncmp(name, devpf, 5) == 0) {
+	if (strncmp(name, devpf, 5) == 0)
 		name += 5;
-	}
 	pp1 = g_provider_by_name(name);
 	if (pp1 == NULL) {
 		gctl_error(req, "Provider %s is invalid", name);
@@ -716,13 +695,12 @@ g_multipath_ctl_create(struct gctl_req *
 	memset(&md, 0, sizeof(md));
 	md.md_size = pp0->mediasize;
 	md.md_sectorsize = pp0->sectorsize;
-	strncpy(md.md_name, mpname, sizeof (md.md_name));
-	strncpy(md.md_uuid, uuid, sizeof (md.md_uuid));
+	strlcpy(md.md_name, mpname, sizeof(md.md_name));
+	strlcpy(md.md_uuid, uuid, sizeof(md.md_uuid));
 
 	gp = g_multipath_create(mp, &md);
-	if (gp == NULL) {
+	if (gp == NULL)
 		return;
-	}
 	error = g_multipath_add_disk(gp, pp0);
 	if (error) {
 		g_multipath_destroy(gp);

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 19:48: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 65597106564A;
	Fri, 23 Apr 2010 19:48:31 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 54BF98FC13;
	Fri, 23 Apr 2010 19:48: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 o3NJmVux097031;
	Fri, 23 Apr 2010 19:48:31 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NJmVfB097029;
	Fri, 23 Apr 2010 19:48:31 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201004231948.o3NJmVfB097029@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 23 Apr 2010 19:48: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: r207134 - 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: Fri, 23 Apr 2010 19:48:31 -0000

Author: jmallett
Date: Fri Apr 23 19:48:31 2010
New Revision: 207134
URL: http://svn.freebsd.org/changeset/base/207134

Log:
  Build some nops into CLEAR_STATUS here to make sure that the following
  instructions can't be interrupted.

Modified:
  head/sys/mips/mips/exception.S

Modified: head/sys/mips/mips/exception.S
==============================================================================
--- head/sys/mips/mips/exception.S	Fri Apr 23 19:35:07 2010	(r207133)
+++ head/sys/mips/mips/exception.S	Fri Apr 23 19:48:31 2010	(r207134)
@@ -230,13 +230,15 @@ SlowFault:
 	or      a0, a0, a2	        ; \
 	li      a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER)   ; \
 	and     a0, a0, a2              ; \
-        mtc0    a0, COP_0_STATUS_REG    
+        mtc0    a0, COP_0_STATUS_REG    ; \
+	ITLBNOPFIX
 #else
 #define CLEAR_STATUS \
 	mfc0    a0, COP_0_STATUS_REG    ;\
 	li      a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER)   ; \
 	and     a0, a0, a2              ; \
-	mtc0	a0, COP_0_STATUS_REG
+	mtc0	a0, COP_0_STATUS_REG	; \
+	ITLBNOPFIX
 #endif
 
 /*

From owner-svn-src-all@FreeBSD.ORG  Fri Apr 23 22:42: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 1D8901065670;
	Fri, 23 Apr 2010 22:42:50 +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 0CCB58FC15;
	Fri, 23 Apr 2010 22:42: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 o3NMgnqA036408;
	Fri, 23 Apr 2010 22:42:49 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NMgnej036406;
	Fri, 23 Apr 2010 22:42:49 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201004232242.o3NMgnej036406@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 23 Apr 2010 22:42: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: r207135 - head/tools/regression/bpf/bpf_filter/tests
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, 23 Apr 2010 22:42:50 -0000

Author: jkim
Date: Fri Apr 23 22:42:49 2010
New Revision: 207135
URL: http://svn.freebsd.org/changeset/base/207135

Log:
  Adjust a test case and make it more jump optimization neutral for JIT case.

Modified:
  head/tools/regression/bpf/bpf_filter/tests/test0083.h

Modified: head/tools/regression/bpf/bpf_filter/tests/test0083.h
==============================================================================
--- head/tools/regression/bpf/bpf_filter/tests/test0083.h	Fri Apr 23 19:48:31 2010	(r207134)
+++ head/tools/regression/bpf/bpf_filter/tests/test0083.h	Fri Apr 23 22:42:49 2010	(r207135)
@@ -6,7 +6,7 @@
 
 /* BPF program */
 struct bpf_insn pc[] = {
-	BPF_JUMP(BPF_JMP+BPF_JA, 0, 0, 0),
+	BPF_STMT(BPF_LD|BPF_IMM, 0),
 };
 
 /* Packet */

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 00:49: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 4702C106566C;
	Sat, 24 Apr 2010 00:49:20 +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 1B1678FC0A;
	Sat, 24 Apr 2010 00:49: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 o3O0nKlZ064510;
	Sat, 24 Apr 2010 00:49:20 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3O0nJqi064506;
	Sat, 24 Apr 2010 00:49:19 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201004240049.o3O0nJqi064506@svn.freebsd.org>
From: Attilio Rao 
Date: Sat, 24 Apr 2010 00:49:19 +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: r207137 - in stable/8/sys: amd64/isa i386/isa pc98/cbus
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, 24 Apr 2010 00:49:20 -0000

Author: attilio
Date: Sat Apr 24 00:49:19 2010
New Revision: 207137
URL: http://svn.freebsd.org/changeset/base/207137

Log:
  MFC r206421:
  Default the machdep.lapic_allclocks to be enabled in order to cope with
  broken atrtc.
  Now if you want more correct stats on profhz and stathz it may be
  disabled by setting to 0.
  
  Sponsored by:	Sandvine Incorporated

Modified:
  stable/8/sys/amd64/isa/clock.c
  stable/8/sys/i386/isa/clock.c
  stable/8/sys/pc98/cbus/clock.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/geom/sched/   (props changed)

Modified: stable/8/sys/amd64/isa/clock.c
==============================================================================
--- stable/8/sys/amd64/isa/clock.c	Fri Apr 23 23:09:18 2010	(r207136)
+++ stable/8/sys/amd64/isa/clock.c	Sat Apr 24 00:49:19 2010	(r207137)
@@ -84,7 +84,7 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq
 int	i8254_max_count;
 static int i8254_real_max_count;
 
-static int lapic_allclocks;
+static int lapic_allclocks = 1;
 TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks);
 
 struct mtx clock_lock;

Modified: stable/8/sys/i386/isa/clock.c
==============================================================================
--- stable/8/sys/i386/isa/clock.c	Fri Apr 23 23:09:18 2010	(r207136)
+++ stable/8/sys/i386/isa/clock.c	Sat Apr 24 00:49:19 2010	(r207137)
@@ -97,7 +97,7 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq
 int	i8254_max_count;
 static int i8254_real_max_count;
 
-static int lapic_allclocks;
+static int lapic_allclocks = 1;
 TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks);
 
 struct mtx clock_lock;

Modified: stable/8/sys/pc98/cbus/clock.c
==============================================================================
--- stable/8/sys/pc98/cbus/clock.c	Fri Apr 23 23:09:18 2010	(r207136)
+++ stable/8/sys/pc98/cbus/clock.c	Sat Apr 24 00:49:19 2010	(r207137)
@@ -93,7 +93,7 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq
 int	i8254_max_count;
 static int i8254_real_max_count;
 
-static int lapic_allclocks;
+static int lapic_allclocks = 1;
 TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks);
 
 static	struct mtx clock_lock;

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 00:53: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 701B91065676;
	Sat, 24 Apr 2010 00:53:42 +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 44F928FC18;
	Sat, 24 Apr 2010 00:53: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 o3O0rgUK065846;
	Sat, 24 Apr 2010 00:53:42 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3O0rgVg065844;
	Sat, 24 Apr 2010 00:53:42 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201004240053.o3O0rgVg065844@svn.freebsd.org>
From: Attilio Rao 
Date: Sat, 24 Apr 2010 00:53:42 +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: r207138 - 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: Sat, 24 Apr 2010 00:53:42 -0000

Author: attilio
Date: Sat Apr 24 00:53:41 2010
New Revision: 207138
URL: http://svn.freebsd.org/changeset/base/207138

Log:
  MFC r206482, r206879:
  - Introduce a blessed list for sxlocks that prevents the deadlkres to
    panic on those ones. Populate this list with getblk and so_snd_sx and
    so_rcv_sx.
  - Fix ticks counter wrap-up
  
  Sponsored by:	Sandvine Incorporated

Modified:
  stable/8/sys/kern/kern_clock.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/geom/sched/   (props changed)

Modified: stable/8/sys/kern/kern_clock.c
==============================================================================
--- stable/8/sys/kern/kern_clock.c	Sat Apr 24 00:49:19 2010	(r207137)
+++ stable/8/sys/kern/kern_clock.c	Sat Apr 24 00:53:41 2010	(r207138)
@@ -162,6 +162,12 @@ SYSCTL_PROC(_kern, OID_AUTO, cp_times, C
     0,0, sysctl_kern_cp_times, "LU", "per-CPU time statistics");
 
 #ifdef DEADLKRES
+static const char *blessed[] = {
+	"getblk",
+	"so_snd_sx",
+	"so_rcv_sx",
+	NULL
+};
 static int slptime_threshold = 1800;
 static int blktime_threshold = 900;
 static int sleepfreq = 3;
@@ -172,7 +178,7 @@ deadlkres(void)
 	struct proc *p;
 	struct thread *td;
 	void *wchan;
-	int blkticks, slpticks, slptype, tryl, tticks;
+	int blkticks, i, slpticks, slptype, tryl, tticks;
 
 	tryl = 0;
 	for (;;) {
@@ -205,6 +211,10 @@ deadlkres(void)
 					 * turnstile channel is in good state.
 					 */
 					MPASS(td->td_blocked != NULL);
+
+					/* Handle ticks wrap-up. */
+					if (ticks < td->td_blktick)
+						continue;
 					tticks = ticks - td->td_blktick;
 					thread_unlock(td);
 					if (tticks > blkticks) {
@@ -222,6 +232,10 @@ deadlkres(void)
 					}
 				} else if (TD_IS_SLEEPING(td)) {
 
+					/* Handle ticks wrap-up. */
+					if (ticks < td->td_blktick)
+						continue;
+
 					/*
 					 * Check if the thread is sleeping on a
 					 * lock, otherwise skip the check.
@@ -242,7 +256,24 @@ deadlkres(void)
 						 * thresholds, this thread is
 						 * stuck for too long on a
 						 * sleepqueue.
+						 * However, being on a
+						 * sleepqueue, we might still
+						 * check for the blessed
+						 * list.
 						 */
+						tryl = 0;
+						for (i = 0; blessed[i] != NULL;
+						    i++) {
+							if (!strcmp(blessed[i],
+							    td->td_wmesg)) {
+								tryl = 1;
+								break;
+							}
+						}
+						if (tryl != 0) {
+							tryl = 0;
+							continue;
+						}
 						PROC_UNLOCK(p);
 						sx_sunlock(&allproc_lock);
 	panic("%s: possible deadlock detected for %p, blocked for %d ticks\n",

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 03:11: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 18F9D1065670;
	Sat, 24 Apr 2010 03:11:36 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0703B8FC15;
	Sat, 24 Apr 2010 03:11: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 o3O3BZIv004149;
	Sat, 24 Apr 2010 03:11:35 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3O3BZSa004146;
	Sat, 24 Apr 2010 03:11:35 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201004240311.o3O3BZSa004146@svn.freebsd.org>
From: Juli Mallett 
Date: Sat, 24 Apr 2010 03:11: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: r207139 - in head/sys/mips: include 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: Sat, 24 Apr 2010 03:11:36 -0000

Author: jmallett
Date: Sat Apr 24 03:11:35 2010
New Revision: 207139
URL: http://svn.freebsd.org/changeset/base/207139

Log:
  Most MIPS systems have a comparatively-sparse physical memory layout.  Switch
  to using the sparse physseg layout in the VM system.

Modified:
  head/sys/mips/include/vmparam.h
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/include/vmparam.h
==============================================================================
--- head/sys/mips/include/vmparam.h	Sat Apr 24 00:53:41 2010	(r207138)
+++ head/sys/mips/include/vmparam.h	Sat Apr 24 03:11:35 2010	(r207139)
@@ -152,9 +152,9 @@
 #define	VM_PHYSSEG_MAX		32
 
 /*
- * The physical address space is densely populated.
+ * The physical address space is sparsely populated.
  */
-#define	VM_PHYSSEG_DENSE
+#define	VM_PHYSSEG_SPARSE
 
 /*
  * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Sat Apr 24 00:53:41 2010	(r207138)
+++ head/sys/mips/mips/pmap.c	Sat Apr 24 03:11:35 2010	(r207139)
@@ -2381,8 +2381,7 @@ pmap_remove_pages(pmap_t pmap)
 		*pte = is_kernel_pmap(pmap) ? PTE_G : 0;
 
 		m = PHYS_TO_VM_PAGE(mips_tlbpfn_to_paddr(tpte));
-
-		KASSERT(m < &vm_page_array[vm_page_array_size],
+		KASSERT(m != NULL,
 		    ("pmap_remove_pages: bad tpte %x", tpte));
 
 		pv->pv_pmap->pm_stats.resident_count--;
@@ -2984,10 +2983,12 @@ page_is_managed(vm_offset_t pa)
 {
 	vm_offset_t pgnum = mips_btop(pa);
 
-	if (pgnum >= first_page && (pgnum < (first_page + vm_page_array_size))) {
+	if (pgnum >= first_page) {
 		vm_page_t m;
 
 		m = PHYS_TO_VM_PAGE(pa);
+		if (m == NULL)
+			return 0;
 		if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)
 			return 1;
 	}

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 07:05: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 69E361065670;
	Sat, 24 Apr 2010 07:05:36 +0000 (UTC)
	(envelope-from jeff@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 567B08FC1B;
	Sat, 24 Apr 2010 07:05: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 o3O75agf055415;
	Sat, 24 Apr 2010 07:05:36 GMT (envelope-from jeff@svn.freebsd.org)
Received: (from jeff@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3O75aZP055400;
	Sat, 24 Apr 2010 07:05:36 GMT (envelope-from jeff@svn.freebsd.org)
Message-Id: <201004240705.o3O75aZP055400@svn.freebsd.org>
From: Jeff Roberson 
Date: Sat, 24 Apr 2010 07:05:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207141 - in head: lib/libufs sbin/dumpfs sbin/fsck_ffs
	sbin/fsdb sbin/tunefs sys/kern sys/sys sys/ufs/ffs
	sys/ufs/ufs usr.sbin/makefs/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, 24 Apr 2010 07:05:36 -0000

Author: jeff
Date: Sat Apr 24 07:05:35 2010
New Revision: 207141
URL: http://svn.freebsd.org/changeset/base/207141

Log:
   - Merge soft-updates journaling from projects/suj/head into head.  This
     brings in support for an optional intent log which eliminates the need
     for background fsck on unclean shutdown.
  
  Sponsored by:   iXsystems, Yahoo!, and Juniper.
  With help from: McKusick and Peter Holm

Added:
  head/sbin/fsck_ffs/suj.c   (contents, props changed)
Modified:
  head/lib/libufs/Makefile
  head/lib/libufs/cgroup.c
  head/lib/libufs/inode.c
  head/lib/libufs/libufs.h
  head/lib/libufs/sblock.c
  head/lib/libufs/type.c
  head/sbin/dumpfs/dumpfs.c
  head/sbin/fsck_ffs/Makefile
  head/sbin/fsck_ffs/fsck.h
  head/sbin/fsck_ffs/gjournal.c
  head/sbin/fsck_ffs/main.c
  head/sbin/fsck_ffs/pass5.c
  head/sbin/fsdb/fsdb.c
  head/sbin/fsdb/fsdbutil.c
  head/sbin/tunefs/tunefs.8
  head/sbin/tunefs/tunefs.c
  head/sys/kern/vfs_bio.c
  head/sys/kern/vfs_subr.c
  head/sys/sys/buf.h
  head/sys/sys/mount.h
  head/sys/ufs/ffs/ffs_alloc.c
  head/sys/ufs/ffs/ffs_balloc.c
  head/sys/ufs/ffs/ffs_extern.h
  head/sys/ufs/ffs/ffs_inode.c
  head/sys/ufs/ffs/ffs_snapshot.c
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ffs/ffs_subr.c
  head/sys/ufs/ffs/ffs_vfsops.c
  head/sys/ufs/ffs/ffs_vnops.c
  head/sys/ufs/ffs/fs.h
  head/sys/ufs/ffs/softdep.h
  head/sys/ufs/ufs/dinode.h
  head/sys/ufs/ufs/inode.h
  head/sys/ufs/ufs/ufs_dirhash.c
  head/sys/ufs/ufs/ufs_extern.h
  head/sys/ufs/ufs/ufs_lookup.c
  head/sys/ufs/ufs/ufs_vnops.c
  head/sys/ufs/ufs/ufsmount.h
  head/usr.sbin/makefs/ffs/ffs_bswap.c

Modified: head/lib/libufs/Makefile
==============================================================================
--- head/lib/libufs/Makefile	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/lib/libufs/Makefile	Sat Apr 24 07:05:35 2010	(r207141)
@@ -3,7 +3,7 @@
 LIB=	ufs
 SHLIBDIR?= /lib
 
-SRCS=	block.c cgroup.c inode.c sblock.c type.c
+SRCS=	block.c cgroup.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c
 INCS=	libufs.h
 
 MAN=	bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close.3
@@ -16,8 +16,11 @@ 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
+.PATH:  ${.CURDIR}/../../sys/ufs/ffs
 
+WARNS?=	2
+
+DEBUG_FLAGS = -g
 CFLAGS+= -D_LIBUFS
 .if defined(LIBUFS_DEBUG)
 CFLAGS+= -D_LIBUFS_DEBUGGING

Modified: head/lib/libufs/cgroup.c
==============================================================================
--- head/lib/libufs/cgroup.c	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/lib/libufs/cgroup.c	Sat Apr 24 07:05:35 2010	(r207141)
@@ -40,11 +40,143 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
 #include 
 
+ufs2_daddr_t
+cgballoc(struct uufsd *disk)
+{
+	u_int8_t *blksfree;
+	struct cg *cgp;
+	struct fs *fs;
+	long bno;
+
+	fs = &disk->d_fs;
+	cgp = &disk->d_cg;
+	blksfree = cg_blksfree(cgp);
+	for (bno = 0; bno < fs->fs_fpg / fs->fs_frag; bno++)
+		if (ffs_isblock(fs, blksfree, bno))
+			goto gotit;
+	return (0);
+gotit:
+	fs->fs_cs(fs, cgp->cg_cgx).cs_nbfree--;
+	ffs_clrblock(fs, blksfree, (long)bno);
+	ffs_clusteracct(fs, cgp, bno, -1);
+	cgp->cg_cs.cs_nbfree--;
+	fs->fs_cstotal.cs_nbfree--;
+	fs->fs_fmod = 1;
+	return (cgbase(fs, cgp->cg_cgx) + blkstofrags(fs, bno));
+}
+
+int
+cgbfree(struct uufsd *disk, ufs2_daddr_t bno, long size)
+{
+	u_int8_t *blksfree;
+	struct fs *fs;
+	struct cg *cgp;
+	ufs1_daddr_t fragno, cgbno;
+	int i, cg, blk, frags, bbase;
+
+	fs = &disk->d_fs;
+	cg = dtog(fs, bno);
+	if (cgread1(disk, cg) != 1)
+		return (-1);
+	cgp = &disk->d_cg;
+	cgbno = dtogd(fs, bno);
+	blksfree = cg_blksfree(cgp);
+	if (size == fs->fs_bsize) {
+		fragno = fragstoblks(fs, cgbno);
+		ffs_setblock(fs, blksfree, fragno);
+		ffs_clusteracct(fs, cgp, fragno, 1);
+		cgp->cg_cs.cs_nbfree++;
+		fs->fs_cstotal.cs_nbfree++;
+		fs->fs_cs(fs, cg).cs_nbfree++;
+	} else {
+		bbase = cgbno - fragnum(fs, cgbno);
+		/*
+		 * decrement the counts associated with the old frags
+		 */
+		blk = blkmap(fs, blksfree, bbase);
+		ffs_fragacct(fs, blk, cgp->cg_frsum, -1);
+		/*
+		 * deallocate the fragment
+		 */
+		frags = numfrags(fs, size);
+		for (i = 0; i < frags; i++)
+			setbit(blksfree, cgbno + i);
+		cgp->cg_cs.cs_nffree += i;
+		fs->fs_cstotal.cs_nffree += i;
+		fs->fs_cs(fs, cg).cs_nffree += i;
+		/*
+		 * add back in counts associated with the new frags
+		 */
+		blk = blkmap(fs, blksfree, bbase);
+		ffs_fragacct(fs, blk, cgp->cg_frsum, 1);
+		/*
+		 * if a complete block has been reassembled, account for it
+		 */
+		fragno = fragstoblks(fs, bbase);
+		if (ffs_isblock(fs, blksfree, fragno)) {
+			cgp->cg_cs.cs_nffree -= fs->fs_frag;
+			fs->fs_cstotal.cs_nffree -= fs->fs_frag;
+			fs->fs_cs(fs, cg).cs_nffree -= fs->fs_frag;
+			ffs_clusteracct(fs, cgp, fragno, 1);
+			cgp->cg_cs.cs_nbfree++;
+			fs->fs_cstotal.cs_nbfree++;
+			fs->fs_cs(fs, cg).cs_nbfree++;
+		}
+	}
+	return cgwrite(disk);
+}
+
+ino_t
+cgialloc(struct uufsd *disk)
+{
+	struct ufs2_dinode *dp2;
+	u_int8_t *inosused;
+	struct cg *cgp;
+	struct fs *fs;
+	ino_t ino;
+	int i;
+
+	fs = &disk->d_fs;
+	cgp = &disk->d_cg;
+	inosused = cg_inosused(cgp);
+	for (ino = 0; ino < fs->fs_ipg / NBBY; ino++)
+		if (isclr(inosused, ino))
+			goto gotit;
+	return (0);
+gotit:
+	if (fs->fs_magic == FS_UFS2_MAGIC &&
+	    ino + INOPB(fs) > cgp->cg_initediblk &&
+	    cgp->cg_initediblk < cgp->cg_niblk) {
+		char block[MAXBSIZE];
+		bzero(block, (int)fs->fs_bsize);
+		dp2 = (struct ufs2_dinode *)█
+		for (i = 0; i < INOPB(fs); i++) {
+			dp2->di_gen = arc4random() / 2 + 1;
+			dp2++;
+		}
+		if (bwrite(disk, ino_to_fsba(fs,
+		    cgp->cg_cgx * fs->fs_ipg + cgp->cg_initediblk),
+		    block, fs->fs_bsize))
+			return (0);
+		cgp->cg_initediblk += INOPB(fs);
+	}
+
+	setbit(inosused, ino);
+	cgp->cg_irotor = ino;
+	cgp->cg_cs.cs_nifree--;
+	fs->fs_cstotal.cs_nifree--;
+	fs->fs_cs(fs, cgp->cg_cgx).cs_nifree--;
+	fs->fs_fmod = 1;
+
+	return (ino + (cgp->cg_cgx * fs->fs_ipg));
+}
+
 int
 cgread(struct uufsd *disk)
 {
@@ -55,14 +187,12 @@ int
 cgread1(struct uufsd *disk, int c)
 {
 	struct fs *fs;
-	off_t ccg;
 
 	fs = &disk->d_fs;
 
 	if ((unsigned)c >= fs->fs_ncg) {
 		return (0);
 	}
-	ccg = fsbtodb(fs, cgtod(fs, c)) * disk->d_bsize;
 	if (bread(disk, fsbtodb(fs, cgtod(fs, c)), disk->d_cgunion.d_buf,
 	    fs->fs_bsize) == -1) {
 		ERROR(disk, "unable to read cylinder group");
@@ -73,6 +203,12 @@ cgread1(struct uufsd *disk, int c)
 }
 
 int
+cgwrite(struct uufsd *disk)
+{
+	return (cgwrite1(disk, disk->d_lcg));
+}
+
+int
 cgwrite1(struct uufsd *disk, int c)
 {
 	struct fs *fs;

Modified: head/lib/libufs/inode.c
==============================================================================
--- head/lib/libufs/inode.c	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/lib/libufs/inode.c	Sat Apr 24 07:05:35 2010	(r207141)
@@ -93,3 +93,19 @@ gotit:	switch (disk->d_ufs) {
 	ERROR(disk, "unknown UFS filesystem type");
 	return (-1);
 }
+
+int
+putino(struct uufsd *disk)
+{
+	struct fs *fs;
+
+	fs = &disk->d_fs;
+	if (disk->d_inoblock == NULL) {
+		ERROR(disk, "No inode block allocated");
+		return (-1);
+	}
+	if (bwrite(disk, fsbtodb(fs, ino_to_fsba(&disk->d_fs, disk->d_inomin)),
+	    disk->d_inoblock, disk->d_fs.fs_bsize) <= 0)
+		return (-1);
+	return (0);
+}

Modified: head/lib/libufs/libufs.h
==============================================================================
--- head/lib/libufs/libufs.h	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/lib/libufs/libufs.h	Sat Apr 24 07:05:35 2010	(r207141)
@@ -71,6 +71,7 @@ struct uufsd {
 	int d_fd;		/* raw device file descriptor */
 	long d_bsize;		/* device bsize */
 	ufs2_daddr_t d_sblock;	/* superblock location */
+	struct csum *d_sbcsum;	/* Superblock summary info */
 	caddr_t d_inoblock;	/* inode block */
 	ino_t d_inomin;		/* low inode */
 	ino_t d_inomax;		/* high inode */
@@ -109,14 +110,19 @@ int berase(struct uufsd *, ufs2_daddr_t,
 /*
  * cgroup.c
  */
+ufs2_daddr_t cgballoc(struct uufsd *);
+int cgbfree(struct uufsd *, ufs2_daddr_t, long);
+ino_t cgialloc(struct uufsd *);
 int cgread(struct uufsd *);
 int cgread1(struct uufsd *, int);
+int cgwrite(struct uufsd *);
 int cgwrite1(struct uufsd *, int);
 
 /*
  * inode.c
  */
 int getino(struct uufsd *, void **, ino_t, int *);
+int putino(struct uufsd *);
 
 /*
  * sblock.c
@@ -132,6 +138,16 @@ int ufs_disk_fillout(struct uufsd *, con
 int ufs_disk_fillout_blank(struct uufsd *, const char *);
 int ufs_disk_write(struct uufsd *);
 
+/*
+ * ffs_subr.c
+ */
+void	ffs_clrblock(struct fs *, u_char *, ufs1_daddr_t);
+void	ffs_clusteracct(struct fs *, struct cg *, ufs1_daddr_t, int);
+void	ffs_fragacct(struct fs *, int, int32_t [], int);
+int	ffs_isblock(struct fs *, u_char *, ufs1_daddr_t);
+int	ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t);
+void	ffs_setblock(struct fs *, u_char *, ufs1_daddr_t);
+
 __END_DECLS
 
 #endif	/* __LIBUFS_H__ */

Modified: head/lib/libufs/sblock.c
==============================================================================
--- head/lib/libufs/sblock.c	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/lib/libufs/sblock.c	Sat Apr 24 07:05:35 2010	(r207141)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -49,8 +50,11 @@ static int superblocks[] = SBLOCKSEARCH;
 int
 sbread(struct uufsd *disk)
 {
+	uint8_t block[MAXBSIZE];
 	struct fs *fs;
 	int sb, superblock;
+	int i, size, blks;
+	uint8_t *space;
 
 	ERROR(disk, NULL);
 
@@ -86,6 +90,34 @@ sbread(struct uufsd *disk)
 	}
 	disk->d_bsize = fs->fs_fsize / fsbtodb(fs, 1);
 	disk->d_sblock = superblock / disk->d_bsize;
+	/*
+	 * Read in the superblock summary information.
+	 */
+	size = fs->fs_cssize;
+	blks = howmany(size, fs->fs_fsize);
+	size += fs->fs_ncg * sizeof(int32_t);
+	space = malloc(size);
+	if (space == NULL) {
+		ERROR(disk, "failed to allocate space for summary information");
+		return (-1);
+	}
+	fs->fs_csp = (struct csum *)space;
+	for (i = 0; i < blks; i += fs->fs_frag) {
+		size = fs->fs_bsize;
+		if (i + fs->fs_frag > blks)
+			size = (blks - i) * fs->fs_fsize;
+		if (bread(disk, fsbtodb(fs, fs->fs_csaddr + i), block, size)
+		    == -1) {
+			ERROR(disk, "Failed to read sb summary information");
+			free(fs->fs_csp);
+			return (-1);
+		}
+		bcopy(block, space, size);
+		space += size;
+	}
+	fs->fs_maxcluster = (uint32_t *)space;
+	disk->d_sbcsum = fs->fs_csp;
+
 	return (0);
 }
 
@@ -93,6 +125,8 @@ int
 sbwrite(struct uufsd *disk, int all)
 {
 	struct fs *fs;
+	int blks, size;
+	uint8_t *space;
 	unsigned i;
 
 	ERROR(disk, NULL);
@@ -107,6 +141,22 @@ sbwrite(struct uufsd *disk, int all)
 		ERROR(disk, "failed to write superblock");
 		return (-1);
 	}
+	/*
+	 * Write superblock summary information.
+	 */
+	blks = howmany(fs->fs_cssize, fs->fs_fsize);
+	space = (uint8_t *)disk->d_sbcsum;
+	for (i = 0; i < blks; i += fs->fs_frag) {
+		size = fs->fs_bsize;
+		if (i + fs->fs_frag > blks)
+			size = (blks - i) * fs->fs_fsize;
+		if (bwrite(disk, fsbtodb(fs, fs->fs_csaddr + i), space, size)
+		    == -1) {
+			ERROR(disk, "Failed to write sb summary information");
+			return (-1);
+		}
+		space += size;
+	}
 	if (all) {
 		for (i = 0; i < fs->fs_ncg; i++)
 			if (bwrite(disk, fsbtodb(fs, cgsblock(fs, i)),

Modified: head/lib/libufs/type.c
==============================================================================
--- head/lib/libufs/type.c	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/lib/libufs/type.c	Sat Apr 24 07:05:35 2010	(r207141)
@@ -66,6 +66,10 @@ ufs_disk_close(struct uufsd *disk)
 		free((char *)(uintptr_t)disk->d_name);
 		disk->d_name = NULL;
 	}
+	if (disk->d_sbcsum != NULL) {
+		free(disk->d_sbcsum);
+		disk->d_sbcsum = NULL;
+	}
 	return (0);
 }
 
@@ -156,6 +160,7 @@ again:	if ((ret = stat(name, &st)) < 0) 
 	disk->d_mine = 0;
 	disk->d_ufs = 0;
 	disk->d_error = NULL;
+	disk->d_sbcsum = NULL;
 
 	if (oname != name) {
 		name = strdup(name);

Modified: head/sbin/dumpfs/dumpfs.c
==============================================================================
--- head/sbin/dumpfs/dumpfs.c	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/sbin/dumpfs/dumpfs.c	Sat Apr 24 07:05:35 2010	(r207141)
@@ -238,7 +238,7 @@ dumpfs(const char *name)
 	if (fsflags & FS_UNCLEAN)
 		printf("unclean ");
 	if (fsflags & FS_DOSOFTDEP)
-		printf("soft-updates ");
+		printf("soft-updates%s ", (fsflags & FS_SUJ) ? "+journal" : "");
 	if (fsflags & FS_NEEDSFSCK)
 		printf("needs fsck run ");
 	if (fsflags & FS_INDEXDIRS)
@@ -255,7 +255,7 @@ dumpfs(const char *name)
 		printf("nfsv4acls ");
 	fsflags &= ~(FS_UNCLEAN | FS_DOSOFTDEP | FS_NEEDSFSCK | FS_INDEXDIRS |
 		     FS_ACLS | FS_MULTILABEL | FS_GJOURNAL | FS_FLAGS_UPDATED |
-		     FS_NFS4ACLS);
+		     FS_NFS4ACLS | FS_SUJ);
 	if (fsflags != 0)
 		printf("unknown flags (%#x)", fsflags);
 	putchar('\n');

Modified: head/sbin/fsck_ffs/Makefile
==============================================================================
--- head/sbin/fsck_ffs/Makefile	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/sbin/fsck_ffs/Makefile	Sat Apr 24 07:05:35 2010	(r207141)
@@ -7,8 +7,7 @@ LINKS+=	${BINDIR}/fsck_ffs ${BINDIR}/fsc
 MAN=	fsck_ffs.8
 MLINKS=	fsck_ffs.8 fsck_ufs.8 fsck_ffs.8 fsck_4.2bsd.8
 SRCS=	dir.c ea.c fsutil.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c \
-	pass4.c pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c gjournal.c \
-	getmntopts.c
+	pass4.c pass5.c setup.c suj.c utilities.c gjournal.c getmntopts.c
 DPADD=	${LIBUFS}
 LDADD=	-lufs
 WARNS?=	2

Modified: head/sbin/fsck_ffs/fsck.h
==============================================================================
--- head/sbin/fsck_ffs/fsck.h	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/sbin/fsck_ffs/fsck.h	Sat Apr 24 07:05:35 2010	(r207141)
@@ -347,10 +347,6 @@ void		direrror(ino_t ino, const char *er
 int		dirscan(struct inodesc *);
 int		dofix(struct inodesc *, const char *msg);
 int		eascan(struct inodesc *, struct ufs2_dinode *dp);
-void		ffs_clrblock(struct fs *, u_char *, ufs1_daddr_t);
-void		ffs_fragacct(struct fs *, int, int32_t [], int);
-int		ffs_isblock(struct fs *, u_char *, ufs1_daddr_t);
-void		ffs_setblock(struct fs *, u_char *, ufs1_daddr_t);
 void		fileerror(ino_t cwd, ino_t ino, const char *errmesg);
 int		findino(struct inodesc *);
 int		findname(struct inodesc *);
@@ -392,3 +388,4 @@ void		sblock_init(void);
 void		setinodebuf(ino_t);
 int		setup(char *dev);
 void		gjournal_check(const char *filesys);
+int		suj_check(const char *filesys);

Modified: head/sbin/fsck_ffs/gjournal.c
==============================================================================
--- head/sbin/fsck_ffs/gjournal.c	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/sbin/fsck_ffs/gjournal.c	Sat Apr 24 07:05:35 2010	(r207141)
@@ -96,27 +96,6 @@ struct ufs2_dinode ufs2_zino;
 static void putcgs(void);
 
 /*
- * Write current block of inodes.
- */
-static int
-putino(struct uufsd *disk, ino_t inode)
-{
-	caddr_t inoblock;
-	struct fs *fs;
-	ssize_t ret;
-
-	fs = &disk->d_fs;
-	inoblock = disk->d_inoblock;
-
-	assert(inoblock != NULL);
-	assert(inode >= disk->d_inomin && inode <= disk->d_inomax);
-	ret = bwrite(disk, fsbtodb(fs, ino_to_fsba(fs, inode)), inoblock,
-	    fs->fs_bsize);
-
-	return (ret == -1 ? -1 : 0);
-}
-
-/*
  * Return cylinder group from the cache or load it if it is not in the
  * cache yet.
  * Don't cache more than MAX_CACHED_CGS cylinder groups.
@@ -242,13 +221,11 @@ cancelcgs(void)
 #endif
 
 /*
- * Open the given provider, load statistics.
+ * Open the given provider, load superblock.
  */
 static void
-getdisk(void)
+opendisk(void)
 {
-	int i;
-
 	if (disk != NULL)
 		return;
 	disk = malloc(sizeof(*disk));
@@ -259,24 +236,6 @@ getdisk(void)
 		    disk->d_error);
 	}
 	fs = &disk->d_fs;
-	fs->fs_csp = malloc((size_t)fs->fs_cssize);
-	if (fs->fs_csp == NULL)
-		err(1, "malloc(%zu)", (size_t)fs->fs_cssize);
-	bzero(fs->fs_csp, (size_t)fs->fs_cssize);
-	for (i = 0; i < fs->fs_cssize; i += fs->fs_bsize) {
-		if (bread(disk, fsbtodb(fs, fs->fs_csaddr + numfrags(fs, i)),
-		    (void *)(((char *)fs->fs_csp) + i),
-		    (size_t)(fs->fs_cssize - i < fs->fs_bsize ? fs->fs_cssize - i : fs->fs_bsize)) == -1) {
-			err(1, "bread: %s", disk->d_error);
-		}
-	}
-	if (fs->fs_contigsumsize > 0) {
-		fs->fs_maxcluster = malloc(fs->fs_ncg * sizeof(int32_t));
-		if (fs->fs_maxcluster == NULL)
-			err(1, "malloc(%zu)", fs->fs_ncg * sizeof(int32_t));
-		for (i = 0; i < fs->fs_ncg; i++)
-			fs->fs_maxcluster[i] = fs->fs_contigsumsize;
-	}
 }
 
 /*
@@ -286,11 +245,6 @@ static void
 closedisk(void)
 {
 
-	free(fs->fs_csp);
-	if (fs->fs_contigsumsize > 0) {
-		free(fs->fs_maxcluster);
-		fs->fs_maxcluster = NULL;
-	}
 	fs->fs_clean = 1;
 	if (sbwrite(disk, 0) == -1)
 		err(1, "sbwrite(%s)", devnam);
@@ -301,227 +255,6 @@ closedisk(void)
 	fs = NULL;
 }
 
-/*
- * Write the statistics back, call closedisk().
- */
-static void
-putdisk(void)
-{
-	int i;
-
-	assert(disk != NULL && fs != NULL);
-	for (i = 0; i < fs->fs_cssize; i += fs->fs_bsize) {
-		if (bwrite(disk, fsbtodb(fs, fs->fs_csaddr + numfrags(fs, i)),
-		    (void *)(((char *)fs->fs_csp) + i),
-		    (size_t)(fs->fs_cssize - i < fs->fs_bsize ? fs->fs_cssize - i : fs->fs_bsize)) == -1) {
-			err(1, "bwrite: %s", disk->d_error);
-		}
-	}
-	closedisk();
-}
-
-#if 0
-/*
- * Free memory, close the disk, but don't write anything back.
- */
-static void
-canceldisk(void)
-{
-	int i;
-
-	assert(disk != NULL && fs != NULL);
-	free(fs->fs_csp);
-	if (fs->fs_contigsumsize > 0)
-		free(fs->fs_maxcluster);
-	if (ufs_disk_close(disk) == -1)
-		err(1, "ufs_disk_close(%s)", devnam);
-	free(disk);
-	disk = NULL;
-	fs = NULL;
-}
-#endif
-
-static int
-isblock(unsigned char *cp, ufs1_daddr_t h)
-{
-	unsigned char mask;
-
-	switch ((int)fs->fs_frag) {
-	case 8:
-		return (cp[h] == 0xff);
-	case 4:
-		mask = 0x0f << ((h & 0x1) << 2);
-		return ((cp[h >> 1] & mask) == mask);
-	case 2:
-		mask = 0x03 << ((h & 0x3) << 1);
-		return ((cp[h >> 2] & mask) == mask);
-	case 1:
-		mask = 0x01 << (h & 0x7);
-		return ((cp[h >> 3] & mask) == mask);
-	default:
-		assert(!"isblock: invalid number of fragments");
-	}
-	return (0);
-}
-
-/*
- * put a block into the map
- */
-static void
-setblock(unsigned char *cp, ufs1_daddr_t h)
-{
-
-	switch ((int)fs->fs_frag) {
-	case 8:
-		cp[h] = 0xff;
-		return;
-	case 4:
-		cp[h >> 1] |= (0x0f << ((h & 0x1) << 2));
-		return;
-	case 2:
-		cp[h >> 2] |= (0x03 << ((h & 0x3) << 1));
-		return;
-	case 1:
-		cp[h >> 3] |= (0x01 << (h & 0x7));
-		return;
-	default:
-		assert(!"setblock: invalid number of fragments");
-	}
-}
-
-/*
- * check if a block is free
- */
-static int
-isfreeblock(u_char *cp, ufs1_daddr_t h)
-{
-
-	switch ((int)fs->fs_frag) {
-	case 8:
-		return (cp[h] == 0);
-	case 4:
-		return ((cp[h >> 1] & (0x0f << ((h & 0x1) << 2))) == 0);
-	case 2:
-		return ((cp[h >> 2] & (0x03 << ((h & 0x3) << 1))) == 0);
-	case 1:
-		return ((cp[h >> 3] & (0x01 << (h & 0x7))) == 0);
-	default:
-		assert(!"isfreeblock: invalid number of fragments");
-	}
-	return (0);
-}
-
-/*
- * Update the frsum fields to reflect addition or deletion
- * of some frags.
- */
-void
-fragacct(int fragmap, int32_t fraglist[], int cnt)
-{
-	int inblk;
-	int field, subfield;
-	int siz, pos;
-
-	inblk = (int)(fragtbl[fs->fs_frag][fragmap]) << 1;
-	fragmap <<= 1;
-	for (siz = 1; siz < fs->fs_frag; siz++) {
-		if ((inblk & (1 << (siz + (fs->fs_frag % NBBY)))) == 0)
-			continue;
-		field = around[siz];
-		subfield = inside[siz];
-		for (pos = siz; pos <= fs->fs_frag; pos++) {
-			if ((fragmap & field) == subfield) {
-				fraglist[siz] += cnt;
-				pos += siz;
-				field <<= siz;
-				subfield <<= siz;
-			}
-			field <<= 1;
-			subfield <<= 1;
-		}
-	}
-}
-
-static void
-clusteracct(struct cg *cgp, ufs1_daddr_t blkno)
-{
-	int32_t *sump;
-	int32_t *lp;
-	u_char *freemapp, *mapp;
-	int i, start, end, forw, back, map, bit;
-
-	if (fs->fs_contigsumsize <= 0)
-		return;
-	freemapp = cg_clustersfree(cgp);
-	sump = cg_clustersum(cgp);
-	/*
-	 * Clear the actual block.
-	 */
-	setbit(freemapp, blkno);
-	/*
-	 * Find the size of the cluster going forward.
-	 */
-	start = blkno + 1;
-	end = start + fs->fs_contigsumsize;
-	if (end >= cgp->cg_nclusterblks)
-		end = cgp->cg_nclusterblks;
-	mapp = &freemapp[start / NBBY];
-	map = *mapp++;
-	bit = 1 << (start % NBBY);
-	for (i = start; i < end; i++) {
-		if ((map & bit) == 0)
-			break;
-		if ((i & (NBBY - 1)) != (NBBY - 1)) {
-			bit <<= 1;
-		} else {
-			map = *mapp++;
-			bit = 1;
-		}
-	}
-	forw = i - start;
-	/*
-	 * Find the size of the cluster going backward.
-	 */
-	start = blkno - 1;
-	end = start - fs->fs_contigsumsize;
-	if (end < 0)
-		end = -1;
-	mapp = &freemapp[start / NBBY];
-	map = *mapp--;
-	bit = 1 << (start % NBBY);
-	for (i = start; i > end; i--) {
-		if ((map & bit) == 0)
-			break;
-		if ((i & (NBBY - 1)) != 0) {
-			bit >>= 1;
-		} else {
-			map = *mapp--;
-			bit = 1 << (NBBY - 1);
-		}
-	}
-	back = start - i;
-	/*
-	 * Account for old cluster and the possibly new forward and
-	 * back clusters.
-	 */
-	i = back + forw + 1;
-	if (i > fs->fs_contigsumsize)
-		i = fs->fs_contigsumsize;
-	sump[i]++;
-	if (back > 0)
-		sump[back]--;
-	if (forw > 0)
-		sump[forw]--;
-	/*
-	 * Update cluster summary information.
-	 */
-	lp = &sump[fs->fs_contigsumsize];
-	for (i = fs->fs_contigsumsize; i > 0; i--)
-		if (*lp-- > 0)
-			break;
-	fs->fs_maxcluster[cgp->cg_cgx] = i;
-}
-
 static void
 blkfree(ufs2_daddr_t bno, long size)
 {
@@ -539,10 +272,10 @@ blkfree(ufs2_daddr_t bno, long size)
 	blksfree = cg_blksfree(cgp);
 	if (size == fs->fs_bsize) {
 		fragno = fragstoblks(fs, cgbno);
-		if (!isfreeblock(blksfree, fragno))
+		if (!ffs_isfreeblock(fs, blksfree, fragno))
 			assert(!"blkfree: freeing free block");
-		setblock(blksfree, fragno);
-		clusteracct(cgp, fragno);
+		ffs_setblock(fs, blksfree, fragno);
+		ffs_clusteracct(fs, cgp, fragno, 1);
 		cgp->cg_cs.cs_nbfree++;
 		fs->fs_cstotal.cs_nbfree++;
 		fs->fs_cs(fs, cg).cs_nbfree++;
@@ -552,7 +285,7 @@ blkfree(ufs2_daddr_t bno, long size)
 		 * decrement the counts associated with the old frags
 		 */
 		blk = blkmap(fs, blksfree, bbase);
-		fragacct(blk, cgp->cg_frsum, -1);
+		ffs_fragacct(fs, blk, cgp->cg_frsum, -1);
 		/*
 		 * deallocate the fragment
 		 */
@@ -569,16 +302,16 @@ blkfree(ufs2_daddr_t bno, long size)
 		 * add back in counts associated with the new frags
 		 */
 		blk = blkmap(fs, blksfree, bbase);
-		fragacct(blk, cgp->cg_frsum, 1);
+		ffs_fragacct(fs, blk, cgp->cg_frsum, 1);
 		/*
 		 * if a complete block has been reassembled, account for it
 		 */
 		fragno = fragstoblks(fs, bbase);
-		if (isblock(blksfree, fragno)) {
+		if (ffs_isblock(fs, blksfree, fragno)) {
 			cgp->cg_cs.cs_nffree -= fs->fs_frag;
 			fs->fs_cstotal.cs_nffree -= fs->fs_frag;
 			fs->fs_cs(fs, cg).cs_nffree -= fs->fs_frag;
-			clusteracct(cgp, fragno);
+			ffs_clusteracct(fs, cgp, fragno, 1);
 			cgp->cg_cs.cs_nbfree++;
 			fs->fs_cstotal.cs_nbfree++;
 			fs->fs_cs(fs, cg).cs_nbfree++;
@@ -599,7 +332,7 @@ freeindir(ufs2_daddr_t blk, int level)
 	if (bread(disk, fsbtodb(fs, blk), (void *)&sblks, (size_t)fs->fs_bsize) == -1)
 		err(1, "bread: %s", disk->d_error);
 	blks = (ufs2_daddr_t *)&sblks;
-	for (i = 0; i < howmany(fs->fs_bsize, sizeof(ufs2_daddr_t)); i++) {
+	for (i = 0; i < NINDIR(fs); i++) {
 		if (blks[i] == 0)
 			break;
 		if (level == 0)
@@ -671,7 +404,7 @@ gjournal_check(const char *filesys)
 	int cg, mode;
 
 	devnam = filesys;
-	getdisk();
+	opendisk();
 	/* Are there any unreferenced inodes in this file system? */
 	if (fs->fs_unrefs == 0) {
 		//printf("No unreferenced inodes.\n");
@@ -747,7 +480,7 @@ gjournal_check(const char *filesys)
 			/* Zero-fill the inode. */
 			*dino = ufs2_zino;
 			/* Write the inode back. */
-			if (putino(disk, ino) == -1)
+			if (putino(disk) == -1)
 				err(1, "putino(cg=%d ino=%d)", cg, ino);
 			if (cgp->cg_unrefs == 0) {
 				//printf("No more unreferenced inodes in cg=%d.\n", cg);
@@ -772,5 +505,5 @@ gjournal_check(const char *filesys)
 	/* Write back modified cylinder groups. */
 	putcgs();
 	/* Write back updated statistics and super-block. */
-	putdisk();
+	closedisk();
 }

Modified: head/sbin/fsck_ffs/main.c
==============================================================================
--- head/sbin/fsck_ffs/main.c	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/sbin/fsck_ffs/main.c	Sat Apr 24 07:05:35 2010	(r207141)
@@ -242,8 +242,9 @@ checkfilesys(char *filesys)
 		if ((fsreadfd = open(filesys, O_RDONLY)) < 0 || readsb(0) == 0)
 			exit(3);	/* Cannot read superblock */
 		close(fsreadfd);
-		if (sblock.fs_flags & FS_NEEDSFSCK)
-			exit(4);	/* Earlier background failed */
+		/* Earlier background failed or journaled */
+		if (sblock.fs_flags & (FS_NEEDSFSCK | FS_SUJ))
+			exit(4);
 		if ((sblock.fs_flags & FS_DOSOFTDEP) == 0)
 			exit(5);	/* Not running soft updates */
 		size = MIBSIZE;
@@ -299,7 +300,7 @@ checkfilesys(char *filesys)
 			pfatal("MOUNTED READ-ONLY, CANNOT RUN IN BACKGROUND\n");
 		} else if ((fsreadfd = open(filesys, O_RDONLY)) >= 0) {
 			if (readsb(0) != 0) {
-				if (sblock.fs_flags & FS_NEEDSFSCK) {
+				if (sblock.fs_flags & (FS_NEEDSFSCK | FS_SUJ)) {
 					bkgrdflag = 0;
 					pfatal("UNEXPECTED INCONSISTENCY, %s\n",
 					    "CANNOT RUN IN BACKGROUND\n");
@@ -384,6 +385,26 @@ checkfilesys(char *filesys)
 		    sblock.fs_cstotal.cs_nffree * 100.0 / sblock.fs_dsize);
 		return (0);
 	}
+	/*
+	 * Determine if we can and should do journal recovery.
+	 */
+	if ((sblock.fs_flags & (FS_SUJ | FS_NEEDSFSCK)) == FS_SUJ) {
+		if (preen || reply("USE JOURNAL?")) {
+			if (suj_check(filesys) == 0) {
+				if (chkdoreload(mntp) == 0)
+					exit(0);
+				exit(4);
+			}
+			/* suj_check failed, fall through. */
+		}
+		printf("** Skipping journal, falling through to full fsck\n");
+		/*
+		 * Write the superblock so we don't try to recover the
+		 * journal on another pass.
+		 */
+		sblock.fs_mtime = time(NULL);
+		sbdirty();
+	}
 	
 	/*
 	 * Cleared if any questions answered no. Used to decide if

Modified: head/sbin/fsck_ffs/pass5.c
==============================================================================
--- head/sbin/fsck_ffs/pass5.c	Sat Apr 24 05:03:42 2010	(r207140)
+++ head/sbin/fsck_ffs/pass5.c	Sat Apr 24 07:05:35 2010	(r207141)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include "fsck.h"
 

Added: head/sbin/fsck_ffs/suj.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sbin/fsck_ffs/suj.c	Sat Apr 24 07:05:35 2010	(r207141)
@@ -0,0 +1,4699 @@
+/*-
+ * Copyright 2009, 2010 Jeffrey W. Roberson 
+ * 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 AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "fsck.h"
+
+#define	DOTDOT_OFFSET	DIRECTSIZ(1)
+#define	SUJ_HASHSIZE	2048
+#define	SUJ_HASHMASK	(SUJ_HASHSIZE - 1)
+#define	SUJ_HASH(x)	((x * 2654435761) & SUJ_HASHMASK)
+
+struct suj_seg {
+	TAILQ_ENTRY(suj_seg) ss_next;
+	struct jsegrec	ss_rec;
+	uint8_t		*ss_blk;
+};
+
+struct suj_rec {
+	TAILQ_ENTRY(suj_rec) sr_next;
+	union jrec	*sr_rec;
+};
+TAILQ_HEAD(srechd, suj_rec);
+
+struct suj_ino {
+	LIST_ENTRY(suj_ino)	si_next;
+	struct srechd		si_recs;
+	struct srechd		si_newrecs;
+	struct srechd		si_movs;
+	struct jtrncrec		*si_trunc;
+	ino_t			si_ino;
+	char			si_skipparent;
+	char			si_hasrecs;
+	char			si_blkadj;
+	char			si_linkadj;
+	int			si_mode;
+	nlink_t			si_nlinkadj;
+	nlink_t			si_nlink;
+	nlink_t			si_dotlinks;
+};
+LIST_HEAD(inohd, suj_ino);
+
+struct suj_blk {
+	LIST_ENTRY(suj_blk)	sb_next;
+	struct srechd		sb_recs;
+	ufs2_daddr_t		sb_blk;
+};
+LIST_HEAD(blkhd, suj_blk);
+
+struct data_blk {
+	LIST_ENTRY(data_blk)	db_next;
+	uint8_t			*db_buf;
+	ufs2_daddr_t		db_blk;
+	int			db_size;
+	int			db_dirty;
+};
+
+struct ino_blk {
+	LIST_ENTRY(ino_blk)	ib_next;
+	uint8_t			*ib_buf;
+	int			ib_dirty;
+	ufs2_daddr_t		ib_blk;
+};
+LIST_HEAD(iblkhd, ino_blk);
+
+struct suj_cg {
+	LIST_ENTRY(suj_cg)	sc_next;
+	struct blkhd		sc_blkhash[SUJ_HASHSIZE];
+	struct inohd		sc_inohash[SUJ_HASHSIZE];
+	struct iblkhd		sc_iblkhash[SUJ_HASHSIZE];
+	struct ino_blk		*sc_lastiblk;
+	struct suj_ino		*sc_lastino;
+	struct suj_blk		*sc_lastblk;
+	uint8_t			*sc_cgbuf;
+	struct cg		*sc_cgp;
+	int			sc_dirty;
+	int			sc_cgx;
+};
+

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 07:36: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 94FDB106566C;
	Sat, 24 Apr 2010 07:36:33 +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 855AE8FC19;
	Sat, 24 Apr 2010 07:36: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 o3O7aX44062191;
	Sat, 24 Apr 2010 07:36:33 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3O7aXVX062189;
	Sat, 24 Apr 2010 07:36:33 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201004240736.o3O7aXVX062189@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Sat, 24 Apr 2010 07:36: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: r207142 - 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, 24 Apr 2010 07:36:33 -0000

Author: pjd
Date: Sat Apr 24 07:36:33 2010
New Revision: 207142
URL: http://svn.freebsd.org/changeset/base/207142

Log:
  Fix build for UFS without SOFTUPDATES.

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c	Sat Apr 24 07:05:35 2010	(r207141)
+++ head/sys/ufs/ffs/ffs_softdep.c	Sat Apr 24 07:36:33 2010	(r207142)
@@ -232,7 +232,8 @@ softdep_setup_directory_add(bp, dp, diro
 }
 
 void 
-softdep_change_directoryentry_offset(dp, base, oldloc, newloc, entrysize)
+softdep_change_directoryentry_offset(bp, dp, base, oldloc, newloc, entrysize)
+	struct buf *bp;
 	struct inode *dp;
 	caddr_t base;
 	caddr_t oldloc;

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 07:54: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 0736D1065679;
	Sat, 24 Apr 2010 07:54:50 +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 EBE068FC1C;
	Sat, 24 Apr 2010 07:54: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 o3O7snRI066340;
	Sat, 24 Apr 2010 07:54:49 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3O7snH5066338;
	Sat, 24 Apr 2010 07:54:49 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201004240754.o3O7snH5066338@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Sat, 24 Apr 2010 07:54: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: r207143 - head/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: Sat, 24 Apr 2010 07:54:50 -0000

Author: pjd
Date: Sat Apr 24 07:54:49 2010
New Revision: 207143
URL: http://svn.freebsd.org/changeset/base/207143

Log:
  Protect fsck.h from being included twice.

Modified:
  head/sbin/fsck_ffs/fsck.h

Modified: head/sbin/fsck_ffs/fsck.h
==============================================================================
--- head/sbin/fsck_ffs/fsck.h	Sat Apr 24 07:36:33 2010	(r207142)
+++ head/sbin/fsck_ffs/fsck.h	Sat Apr 24 07:54:49 2010	(r207143)
@@ -60,6 +60,9 @@
  * $FreeBSD$
  */
 
+#ifndef _FSCK_H_
+#define	_FSCK_H_
+
 #include 
 #include 
 #include 
@@ -389,3 +392,5 @@ void		setinodebuf(ino_t);
 int		setup(char *dev);
 void		gjournal_check(const char *filesys);
 int		suj_check(const char *filesys);
+
+#endif	/* !_FSCK_H_ */

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 07: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 DEC70106564A;
	Sat, 24 Apr 2010 07:58:59 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CDB8F8FC13;
	Sat, 24 Apr 2010 07:58: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 o3O7wxlx067334;
	Sat, 24 Apr 2010 07:58:59 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3O7wxZA067332;
	Sat, 24 Apr 2010 07:58:59 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201004240758.o3O7wxZA067332@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Sat, 24 Apr 2010 07:58:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207144 - head/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: Sat, 24 Apr 2010 07:59:00 -0000

Author: pjd
Date: Sat Apr 24 07:58:59 2010
New Revision: 207144
URL: http://svn.freebsd.org/changeset/base/207144

Log:
  suj.c seems to contain two versions of the code.
  Remove the one that doesn't compile.

Modified:
  head/sbin/fsck_ffs/suj.c

Modified: head/sbin/fsck_ffs/suj.c
==============================================================================
--- head/sbin/fsck_ffs/suj.c	Sat Apr 24 07:54:49 2010	(r207143)
+++ head/sbin/fsck_ffs/suj.c	Sat Apr 24 07:58:59 2010	(r207144)
@@ -2632,2068 +2632,3 @@ suj_check(const char *filesys)
 
 	return (0);
 }
-/*-
- * Copyright (c) 2009 Jeffrey W. Roberson 
- * 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 AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include 
-__FBSDID("$FreeBSD$");
-
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "fsck.h"
-
-static void	ino_decr(ino_t);
-
-#define	SUJ_HASHSIZE	128
-#define	SUJ_HASHMASK	(SUJ_HASHSIZE - 1)
-#define	SUJ_HASH(x)	((x * 2654435761) & SUJ_HASHMASK)
-
-struct suj_seg {
-	TAILQ_ENTRY(suj_seg) ss_next;
-	struct jsegrec	ss_rec;
-	uint8_t		*ss_blk;
-};
-
-struct suj_rec {
-	TAILQ_ENTRY(suj_rec) sr_next;
-	union jrec	*sr_rec;
-};
-TAILQ_HEAD(srechd, suj_rec);
-
-struct suj_ino {
-	LIST_ENTRY(suj_ino)	si_next;
-	struct srechd		si_recs;
-	struct srechd		si_movs;
-	ino_t			si_ino;
-	int			si_nlinkadj;
-	int			si_skipparent;
-	int			si_linkadj;
-	int			si_hasrecs;
-	int			si_blkadj;
-};
-LIST_HEAD(inohd, suj_ino);
-
-struct suj_blk {
-	LIST_ENTRY(suj_blk)	sb_next;
-	struct srechd		sb_recs;
-	ufs2_daddr_t		sb_blk;
-};
-LIST_HEAD(blkhd, suj_blk);
-
-struct data_blk {
-	LIST_ENTRY(data_blk)	db_next;
-	uint8_t			*db_buf;
-	ufs2_daddr_t		db_blk;
-	int			db_size;
-};
-
-struct ino_blk {
-	LIST_ENTRY(ino_blk)	ib_next;
-	uint8_t			*ib_buf;
-	int			ib_dirty;
-	ufs2_daddr_t		ib_blk;
-};
-LIST_HEAD(iblkhd, ino_blk);
-
-struct suj_cg {
-	LIST_ENTRY(suj_cg)	sc_next;
-	struct blkhd		sc_blkhash[SUJ_HASHSIZE];
-	struct inohd		sc_inohash[SUJ_HASHSIZE];
-	struct iblkhd		sc_iblkhash[SUJ_HASHSIZE];
-	struct ino_blk		*sc_lastiblk;
-	uint8_t			*sc_cgbuf;
-	struct cg		*sc_cgp;
-	int			sc_dirty;
-	int			sc_cgx;
-};
-
-LIST_HEAD(cghd, suj_cg) cghash[SUJ_HASHSIZE];
-LIST_HEAD(dblkhd, data_blk) dbhash[SUJ_HASHSIZE];
-
-TAILQ_HEAD(seghd, suj_seg) allsegs;
-uint64_t oldseq;
-static struct uufsd *disk = NULL;
-static struct fs *fs = NULL;
-
-/*
- * Summary statistics.
- */
-uint64_t freefrags;
-uint64_t freeblocks;
-uint64_t freeinos;
-uint64_t freedir;
-uint64_t jbytes;
-uint64_t jrecs;
-
-typedef void (*ino_visitor)(ino_t, ufs_lbn_t, ufs2_daddr_t, int);
-
-static void *
-errmalloc(size_t n)
-{
-	void *a;
-
-	a = malloc(n);
-	if (a == NULL)
-		errx(1, "malloc(%zu)", n);
-	return (a);
-}
-
-/*
- * Open the given provider, load superblock.
- */
-static void
-opendisk(const char *devnam)
-{
-	if (disk != NULL)
-		return;
-	disk = malloc(sizeof(*disk));
-	if (disk == NULL)
-		errx(1, "malloc(%zu)", sizeof(*disk));
-	if (ufs_disk_fillout(disk, devnam) == -1) {
-		err(1, "ufs_disk_fillout(%s) failed: %s", devnam,
-		    disk->d_error);
-	}
-	fs = &disk->d_fs;
-	/*
-	 * Setup a few things so reply() can work.
-	 */
-	bcopy(fs, &sblock, sizeof(sblock));
-	fsreadfd = disk->d_fd;
-	fswritefd = disk->d_fd;
-}
-
-/*
- * Mark file system as clean, write the super-block back, close the disk.
- */
-static void
-closedisk(const char *devnam)
-{
-	struct csum *cgsum;
-	int i;
-
-	/*
-	 * Recompute the fs summary info from correct cs summaries.
-	 */
-	bzero(&fs->fs_cstotal, sizeof(struct csum_total));
-	for (i = 0; i < fs->fs_ncg; i++) {
-		cgsum = &fs->fs_cs(fs, i);
-		fs->fs_cstotal.cs_nffree += cgsum->cs_nffree;
-		fs->fs_cstotal.cs_nbfree += cgsum->cs_nbfree;
-		fs->fs_cstotal.cs_nifree += cgsum->cs_nifree;
-		fs->fs_cstotal.cs_ndir += cgsum->cs_ndir;
-	}
-	/* XXX Don't set clean for now, we don't trust the journal. */
-	/* fs->fs_clean = 1; */
-	fs->fs_time = time(NULL);
-	fs->fs_mtime = time(NULL);
-	if (sbwrite(disk, 0) == -1)
-		err(1, "sbwrite(%s)", devnam);
-	if (ufs_disk_close(disk) == -1)
-		err(1, "ufs_disk_close(%s)", devnam);
-	free(disk);
-	disk = NULL;
-	fs = NULL;
-	fsreadfd = -1;
-	fswritefd = -1;
-}
-
-/*
- * Lookup a cg by number in the hash so we can keep track of which cgs
- * need stats rebuilt.
- */
-static struct suj_cg *
-cg_lookup(int cgx)
-{
-	struct cghd *hd;
-	struct suj_cg *sc;
-
-	if (cgx < 0 || cgx >= fs->fs_ncg) {
-		abort();
-		errx(1, "Bad cg number %d", cgx);
-	}
-	hd = &cghash[SUJ_HASH(cgx)];
-	LIST_FOREACH(sc, hd, sc_next)
-		if (sc->sc_cgx == cgx)
-			return (sc);
-	sc = errmalloc(sizeof(*sc));
-	bzero(sc, sizeof(*sc));
-	sc->sc_cgbuf = errmalloc(fs->fs_bsize);
-	sc->sc_cgp = (struct cg *)sc->sc_cgbuf;
-	sc->sc_cgx = cgx;
-	LIST_INSERT_HEAD(hd, sc, sc_next);
-	if (bread(disk, fsbtodb(fs, cgtod(fs, sc->sc_cgx)), sc->sc_cgbuf,
-	    fs->fs_bsize) == -1)
-		err(1, "Unable to read cylinder group %d", sc->sc_cgx);
-
-	return (sc);
-}
-
-/*
- * Lookup an inode number in the hash and allocate a suj_ino if it does
- * not exist.
- */
-static struct suj_ino *
-ino_lookup(ino_t ino, int creat)
-{
-	struct suj_ino *sino;
-	struct inohd *hd;
-	struct suj_cg *sc;
-
-	sc = cg_lookup(ino_to_cg(fs, ino));
-	hd = &sc->sc_inohash[SUJ_HASH(ino)];
-	LIST_FOREACH(sino, hd, si_next)
-		if (sino->si_ino == ino)
-			return (sino);
-	if (creat == 0)
-		return (NULL);
-	sino = errmalloc(sizeof(*sino));
-	bzero(sino, sizeof(*sino));
-	sino->si_ino = ino;
-	sino->si_nlinkadj = 0;
-	TAILQ_INIT(&sino->si_recs);
-	TAILQ_INIT(&sino->si_movs);
-	LIST_INSERT_HEAD(hd, sino, si_next);
-
-	return (sino);
-}
-
-/*
- * Lookup a block number in the hash and allocate a suj_blk if it does
- * not exist.
- */
-static struct suj_blk *
-blk_lookup(ufs2_daddr_t blk, int creat)
-{
-	struct suj_blk *sblk;
-	struct suj_cg *sc;
-	struct blkhd *hd;
-
-	sc = cg_lookup(dtog(fs, blk));
-	hd = &sc->sc_blkhash[SUJ_HASH(blk)];
-	LIST_FOREACH(sblk, hd, sb_next)
-		if (sblk->sb_blk == blk)
-			return (sblk);
-	if (creat == 0)
-		return (NULL);
-	sblk = errmalloc(sizeof(*sblk));
-	bzero(sblk, sizeof(*sblk));
-	sblk->sb_blk = blk;
-	TAILQ_INIT(&sblk->sb_recs);
-	LIST_INSERT_HEAD(hd, sblk, sb_next);
-
-	return (sblk);
-}
-
-static uint8_t *
-dblk_read(ufs2_daddr_t blk, int size)
-{
-	struct data_blk *dblk;
-	struct dblkhd *hd;
-
-	hd = &dbhash[SUJ_HASH(blk)];
-	LIST_FOREACH(dblk, hd, db_next)
-		if (dblk->db_blk == blk)
-			goto found;
-	/*
-	 * The inode block wasn't located, allocate a new one.
-	 */
-	dblk = errmalloc(sizeof(*dblk));
-	bzero(dblk, sizeof(*dblk));
-	LIST_INSERT_HEAD(hd, dblk, db_next);
-	dblk->db_blk = blk;
-found:
-	/*
-	 * I doubt size mismatches can happen in practice but it is trivial
-	 * to handle.
-	 */
-	if (size != dblk->db_size) {
-		if (dblk->db_buf)
-			free(dblk->db_buf);
-		dblk->db_buf = errmalloc(size);
-		dblk->db_size = size;
-		if (bread(disk, fsbtodb(fs, blk), dblk->db_buf, size) == -1)
-			err(1, "Failed to read data block %jd", blk);
-	}
-	return (dblk->db_buf);
-}
-
-static union dinode *
-ino_read(ino_t ino)
-{
-	struct ino_blk *iblk;
-	struct iblkhd *hd;
-	struct suj_cg *sc;
-	ufs2_daddr_t blk;
-	int off;
-
-	blk = ino_to_fsba(fs, ino);
-	sc = cg_lookup(ino_to_cg(fs, ino));
-	hd = &sc->sc_iblkhash[SUJ_HASH(blk)];
-	LIST_FOREACH(iblk, hd, ib_next)
-		if (iblk->ib_blk == blk)
-			goto found;
-	/*
-	 * The inode block wasn't located, allocate a new one.
-	 */
-	iblk = errmalloc(sizeof(*iblk));
-	bzero(iblk, sizeof(*iblk));
-	iblk->ib_buf = errmalloc(fs->fs_bsize);
-	iblk->ib_blk = blk;
-	LIST_INSERT_HEAD(hd, iblk, ib_next);
-	if (bread(disk, fsbtodb(fs, blk), iblk->ib_buf, fs->fs_bsize) == -1)
-		err(1, "Failed to read inode block %jd", blk);
-found:
-	sc->sc_lastiblk = iblk;
-	off = ino_to_fsbo(fs, ino);
-	if (fs->fs_magic == FS_UFS1_MAGIC)
-		return (union dinode *)&((struct ufs1_dinode *)iblk->ib_buf)[off];
-	else
-		return (union dinode *)&((struct ufs2_dinode *)iblk->ib_buf)[off];
-}
-
-static void
-ino_dirty(ino_t ino)
-{
-	struct ino_blk *iblk;
-	struct iblkhd *hd;
-	struct suj_cg *sc;
-	ufs2_daddr_t blk;
-
-	blk = ino_to_fsba(fs, ino);
-	sc = cg_lookup(ino_to_cg(fs, ino));
-	iblk = sc->sc_lastiblk;
-	if (iblk && iblk->ib_blk == blk) {
-		iblk->ib_dirty = 1;
-		return;
-	}
-	hd = &sc->sc_iblkhash[SUJ_HASH(blk)];
-	LIST_FOREACH(iblk, hd, ib_next) {
-		if (iblk->ib_blk == blk) {
-			iblk->ib_dirty = 1;
-			return;
-		}
-	}
-	ino_read(ino);
-	ino_dirty(ino);
-}
-
-static void
-iblk_write(struct ino_blk *iblk)
-{
-
-	if (iblk->ib_dirty == 0)
-		return;
-	if (bwrite(disk, fsbtodb(fs, iblk->ib_blk), iblk->ib_buf,
-	    fs->fs_bsize) == -1)
-		err(1, "Failed to write inode block %jd", iblk->ib_blk);
-}
-
-/*
- * Return 1 if the inode was free and 0 if it is allocated.
- */
-static int
-ino_isfree(ino_t ino)
-{
-	struct suj_cg *sc;
-	uint8_t *inosused;
-	struct cg *cgp;
-	int cg;
-
-	cg = ino_to_cg(fs, ino);
-	ino = ino % fs->fs_ipg;
-	sc = cg_lookup(cg);
-	cgp = sc->sc_cgp;
-	inosused = cg_inosused(cgp);
-	return isclr(inosused, ino);
-}
-
-static int
-blk_overlaps(struct jblkrec *brec, ufs2_daddr_t start, int frags)
-{
-	ufs2_daddr_t bstart;
-	ufs2_daddr_t bend;
-	ufs2_daddr_t end;
-
-	end = start + frags;
-	bstart = brec->jb_blkno + brec->jb_oldfrags;
-	bend = bstart + brec->jb_frags;
-	if (start < bend && end > bstart)
-		return (1);
-	return (0);
-}
-
-static int
-blk_equals(struct jblkrec *brec, ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t start,
-    int frags)
-{
-
-	if (brec->jb_ino != ino || brec->jb_lbn != lbn)
-		return (0);
-	if (brec->jb_blkno + brec->jb_oldfrags != start)
-		return (0);
-	if (brec->jb_frags != frags)
-		return (0);
-	return (1);
-}
-
-static void
-blk_setmask(struct jblkrec *brec, int *mask)
-{
-	int i;
-
-	for (i = brec->jb_oldfrags; i < brec->jb_oldfrags + brec->jb_frags; i++)
-		*mask |= 1 << i;
-}
-
-/*
- * Determine whether a given block has been reallocated to a new location.
- * Returns a mask of overlapping bits if any frags have been reused or
- * zero if the block has not been re-used and the contents can be trusted.
- * 
- * This is used to ensure that an orphaned pointer due to truncate is safe
- * to be freed.  The mask value can be used to free partial blocks.
- */
-static int
-blk_isfree(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t lbn, int frags)
-{
-	struct suj_blk *sblk;
-	struct suj_rec *srec;
-	struct jblkrec *brec;
-	int mask;
-	int off;
-
-	/*
-	 * To be certain we're not freeing a reallocated block we lookup
-	 * this block in the blk hash and see if there is an allocation
-	 * journal record that overlaps with any fragments in the block
-	 * we're concerned with.  If any fragments have ben reallocated
-	 * the block has already been freed and re-used for another purpose.
-	 */
-	mask = 0;
-	sblk = blk_lookup(blknum(fs, blk), 0);
-	if (sblk == NULL)
-		return (0);
-	off = blk - sblk->sb_blk;
-	TAILQ_FOREACH(srec, &sblk->sb_recs, sr_next) {
-		brec = (struct jblkrec *)srec->sr_rec;
-		/*
-		 * If the block overlaps but does not match
-		 * exactly it's a new allocation.  If it matches
-		 * exactly this record refers to the current
-		 * location.
-		 */ 
-		if (blk_overlaps(brec, blk, frags) == 0)
-			continue;
-		if (blk_equals(brec, ino, lbn, blk, frags) == 1)
-			mask = 0;
-		else
-			blk_setmask(brec, &mask);
-	}
-	if (debug)
-		printf("blk_isfree: blk %jd sblk %jd off %d mask 0x%X\n",
-		    blk, sblk->sb_blk, off, mask);
-	return (mask >> off);
-}
-
-/*
- * Determine whether it is safe to follow an indirect.  It is not safe
- * if any part of the indirect has been reallocated or the last journal
- * entry was an allocation.  Just allocated indirects may not have valid
- * pointers yet and all of their children will have their own records.
- * 
- * Returns 1 if it's safe to follow the indirect and 0 otherwise.
- */
-static int
-blk_isindir(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t lbn)
-{
-	struct suj_blk *sblk;
-	struct jblkrec *brec;
-
-	sblk = blk_lookup(blk, 0);
-	if (sblk == NULL)
-		return (1);
-	if (TAILQ_EMPTY(&sblk->sb_recs))
-		return (1);
-	brec = (struct jblkrec *)TAILQ_LAST(&sblk->sb_recs, srechd)->sr_rec;
-	if (blk_equals(brec, ino, lbn, blk, fs->fs_frag))
-		if (brec->jb_op == JOP_FREEBLK)
-			return (1);
-	return (0);
-}
-
-/*
- * Clear an inode from the cg bitmap.  If the inode was already clear return
- * 0 so the caller knows it does not have to check the inode contents.
- */
-static int
-ino_free(ino_t ino, int mode)
-{
-	struct suj_cg *sc;
-	uint8_t *inosused;
-	struct cg *cgp;
-	int cg;
-
-	cg = ino_to_cg(fs, ino);
-	ino = ino % fs->fs_ipg;
-	sc = cg_lookup(cg);
-	cgp = sc->sc_cgp;
-	inosused = cg_inosused(cgp);
-	/*
-	 * The bitmap may never have made it to the disk so we have to
-	 * conditionally clear.  We can avoid writing the cg in this case.
-	 */
-	if (isclr(inosused, ino))
-		return (0);
-	freeinos++;
-	clrbit(inosused, ino);
-	if (ino < cgp->cg_irotor)
-		cgp->cg_irotor = ino;
-	cgp->cg_cs.cs_nifree++;
-	if ((mode & IFMT) == IFDIR) {
-		freedir++;
-		cgp->cg_cs.cs_ndir--;
-	}
-	sc->sc_dirty = 1;
-
-	return (1);
-}
-
-/*
- * Free 'frags' frags starting at filesystem block 'bno' skipping any frags
- * set in the mask.
- */
-static void
-blk_free(ufs2_daddr_t bno, int mask, int frags)
-{
-	ufs1_daddr_t fragno, cgbno;
-	struct suj_cg *sc;
-	struct cg *cgp;
-	int i, cg;
-	uint8_t *blksfree;
-
-	if (debug)
-		printf("Freeing %d frags at blk %jd\n", frags, bno);
-	cg = dtog(fs, bno);
-	sc = cg_lookup(cg);
-	cgp = sc->sc_cgp;
-	cgbno = dtogd(fs, bno);
-	blksfree = cg_blksfree(cgp);
-
-	/*
-	 * If it's not allocated we only wrote the journal entry
-	 * and never the bitmaps.  Here we unconditionally clear and
-	 * resolve the cg summary later.
-	 */
-	if (frags == fs->fs_frag && mask == 0) {
-		fragno = fragstoblks(fs, cgbno);
-		ffs_setblock(fs, blksfree, fragno);
-		freeblocks++;
-	} else {
-		/*
-		 * deallocate the fragment
-		 */
-		for (i = 0; i < frags; i++)
-			if ((mask & (1 << i)) == 0 && isclr(blksfree, cgbno +i)) {
-				freefrags++;
-				setbit(blksfree, cgbno + i);
-			}
-	}
-	sc->sc_dirty = 1;
-}
-
-/*
- * Fetch an indirect block to find the block at a given lbn.  The lbn
- * may be negative to fetch a specific indirect block pointer or positive
- * to fetch a specific block.
- */
-static ufs2_daddr_t
-indir_blkatoff(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t cur, ufs_lbn_t lbn, int level)
-{
-	ufs2_daddr_t *bap2;
-	ufs2_daddr_t *bap1;
-	ufs_lbn_t lbnadd;
-	ufs_lbn_t base;
-	int i;
-
-	if (blk == 0)
-		return (0);
-	if (cur == lbn)
-		return (blk);
-	if (level == 0 && lbn < 0) {
-		abort();
-		errx(1, "Invalid lbn %jd", lbn);
-	}
-	bap2 = (void *)dblk_read(blk, fs->fs_bsize);
-	bap1 = (void *)bap2;
-	lbnadd = 1;
-	base = -(cur + level);
-	for (i = level; i > 0; i--)
-		lbnadd *= NINDIR(fs);
-	if (lbn > 0) 
-		i = (lbn - base) / lbnadd;
-	else
-		i = (-lbn - base) / lbnadd;
-	if (i < 0 || i >= NINDIR(fs)) {
-		abort();
-		errx(1, "Invalid indirect index %d produced by lbn %jd",
-		    i, lbn);
-	}
-	if (level == 0)
-		cur = base + (i * lbnadd);
-	else
-		cur = -(base + (i * lbnadd)) - (level - 1);
-	if (fs->fs_magic == FS_UFS1_MAGIC)
-		blk = bap1[i];
-	else
-		blk = bap2[i];
-	if (cur == lbn)
-		return (blk);
-	if (level == 0) {
-		abort();
-		errx(1, "Invalid lbn %jd at level 0", lbn);
-	}
-	return indir_blkatoff(blk, ino, cur, lbn, level - 1);
-}
-
-/*
- * Finds the disk block address at the specified lbn within the inode
- * specified by ip.  This follows the whole tree and honors di_size and
- * di_extsize so it is a true test of reachability.  The lbn may be
- * negative if an extattr or indirect block is requested.
- */
-static ufs2_daddr_t
-ino_blkatoff(union dinode *ip, ino_t ino, ufs_lbn_t lbn, int *frags)
-{
-	ufs_lbn_t tmpval;
-	ufs_lbn_t cur;
-	ufs_lbn_t next;
-	int i;
-
-	/*
-	 * Handle extattr blocks first.
-	 */
-	if (lbn < 0 && lbn >= -NXADDR) {
-		lbn = -1 - lbn;
-		if (lbn > lblkno(fs, ip->dp2.di_extsize - 1))
-			return (0);
-		*frags = numfrags(fs, sblksize(fs, ip->dp2.di_extsize, lbn));
-		return (ip->dp2.di_extb[lbn]);
-	}
-	/*
-	 * And now direct and indirect.  Verify that the lbn does not
-	 * exceed the size required to store the file by asking for
-	 * the lbn of the last byte.  These blocks should be 0 anyway
-	 * so this simply saves the traversal.
-	 */
-	if (lbn > 0 && lbn > lblkno(fs, DIP(ip, di_size) - 1))
-		return (0);
-	if (lbn < 0 && -lbn > lblkno(fs, DIP(ip, di_size) - 1))
-		return (0);
-	if (lbn >= 0 && lbn < NDADDR) {
-		*frags = numfrags(fs, sblksize(fs, DIP(ip, di_size), lbn));
-		return (DIP(ip, di_db[lbn]));
-	}
-	*frags = fs->fs_frag;
-
-	for (i = 0, tmpval = NINDIR(fs), cur = NDADDR; i < NIADDR; i++,
-	    tmpval *= NINDIR(fs), cur = next) {
-		next = cur + tmpval;
-		if (lbn == -cur)
-			return (DIP(ip, di_ib[i]));
-		/*
-		 * Determine whether the lbn in question is within this tree.
-		 */
-		if (lbn < 0 && -lbn >= next)
-			continue;
-		if (lbn > 0 && lbn >= next)
-			continue;
-
-		return indir_blkatoff(DIP(ip, di_ib[i]), ino, -cur - i, lbn, i);
-	}
-	errx(1, "lbn %jd not in ino", lbn);
-}
-
-/*
- * Determine whether a block exists at a particular lbn in an inode.
- * Returns 1 if found, 0 if not.  lbn may be negative for indirects
- * or ext blocks.
- */
-static int
-blk_isat(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int *frags)
-{
-	union dinode *ip;
-	ufs2_daddr_t nblk;
-
-	ip = ino_read(ino);
-
-	if (DIP(ip, di_nlink) == 0 || DIP(ip, di_mode) == 0)
-		return (0);
-	nblk = ino_blkatoff(ip, ino, lbn, frags);
-
-	return (nblk == blk);
-}
-
-/*
- * Determines whether a pointer to an inode exists within a directory
- * at a specified offset.  Returns the mode of the found entry.
- */
-static int
-ino_isat(ino_t parent, off_t diroff, ino_t child, int *mode, int *isdot)
-{
-	union dinode *dip;
-	struct direct *dp;
-	ufs2_daddr_t blk;
-	uint8_t *block;
-	ufs_lbn_t lbn;
-	int blksize;
-	int frags;
-	int dpoff;
-	int doff;
-
-	*isdot = 0;
-	dip = ino_read(parent);
-	*mode = DIP(dip, di_mode);
-	if ((*mode & IFMT) != IFDIR) {
-		if (debug) {
-			/* This can happen if the parent inode was reallocated. */
-			if (*mode != 0)
-				printf("Directory %d has bad mode %o\n",
-				    parent, *mode);
-			else
-				printf("Directory %d zero inode\n", parent);
-		}
-		return (0);
-	}
-	lbn = lblkno(fs, diroff);
-	doff = blkoff(fs, diroff);
-	blksize = sblksize(fs, DIP(dip, di_size), lbn);
-	if (diroff + DIRECTSIZ(1) > DIP(dip, di_size) || doff >= blksize) {
-		if (debug)
-			printf("ino %d absent from %d due to offset %jd"
-			    " exceeding size %jd\n",
-			    child, parent, diroff, DIP(dip, di_size));
-		return (0);
-	}
-	blk = ino_blkatoff(dip, parent, lbn, &frags);
-	if (blk <= 0) {
-		if (debug)
-			printf("Sparse directory %d", parent);
-		return (0);
-	}
-	block = dblk_read(blk, blksize);
-	/*
-	 * Walk through the records from the start of the block to be
-	 * certain we hit a valid record and not some junk in the middle
-	 * of a file name.  Stop when we reach or pass the expected offset.
-	 */
-	dpoff = 0;
-	do {
-		dp = (struct direct *)&block[dpoff];
-		if (dpoff == doff)
-			break;
-		if (dp->d_reclen == 0)
-			break;
-		dpoff += dp->d_reclen;
-	} while (dpoff <= doff);
-	if (dpoff > fs->fs_bsize)
-		errx(1, "Corrupt directory block in dir inode %d", parent);
-	/* Not found. */
-	if (dpoff != doff) {
-		if (debug)
-			printf("ino %d not found in %d, lbn %jd, dpoff %d\n",
-			    child, parent, lbn, dpoff);
-		return (0);
-	}
-	/*
-	 * We found the item in question.  Record the mode and whether it's
-	 * a . or .. link for the caller.
-	 */
-	if (dp->d_ino == child) {
-		if (child == parent)
-			*isdot = 1;
-		else if (dp->d_namlen == 2 &&
-		    dp->d_name[0] == '.' && dp->d_name[1] == '.')
-			*isdot = 1;
-		*mode = DTTOIF(dp->d_type);
-		return (1);
-	}
-	if (debug)
-		printf("ino %d doesn't match dirent ino %d in parent %d\n",
-		    child, dp->d_ino, parent);
-	return (0);
-}
-
-#define	VISIT_INDIR	0x0001
-#define	VISIT_EXT	0x0002
-
-/*
- * Read an indirect level which may or may not be linked into an inode.
- */
-static void
-indir_visit(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, uint64_t *frags,
-    ino_visitor visitor, int flags)
-{
-	ufs2_daddr_t *bap2;
-	ufs1_daddr_t *bap1;
-	ufs_lbn_t lbnadd;
-	ufs2_daddr_t nblk;
-	ufs_lbn_t nlbn;
-	int level;
-	int i;
-
-	/*
-	 * Don't visit indirect blocks with contents we can't trust.  This
-	 * should only happen when indir_visit() is called to complete a
-	 * truncate that never finished and not when a pointer is found via
-	 * an inode.
-	 */
-	if (blk == 0)
-		return;
-	if (blk_isindir(blk, ino, lbn) == 0) {
-		if (debug)
-			printf("blk %jd ino %d lbn %jd is not indir.\n",
-			    blk, ino, lbn);
-		goto out;
-	}
-	level = lbn_level(lbn);
-	if (level == -1) {
-		abort();
-		errx(1, "Invalid level for lbn %jd", lbn);
-	}
-	lbnadd = 1;
-	for (i = level; i > 0; i--)
-		lbnadd *= NINDIR(fs);
-	bap1 = (void *)dblk_read(blk, fs->fs_bsize);
-	bap2 = (void *)bap1;
-	for (i = 0; i < NINDIR(fs); i++) {
-		if (fs->fs_magic == FS_UFS1_MAGIC)
-			nblk = *bap1++;
-		else
-			nblk = *bap2++;
-		if (nblk == 0)
-			continue;
-		if (level == 0) {
-			nlbn = -lbn + i * lbnadd;
-			(*frags) += fs->fs_frag;
-			visitor(ino, nlbn, nblk, fs->fs_frag);
-		} else {
-			nlbn = (lbn + 1) - (i * lbnadd);
-			indir_visit(ino, nlbn, nblk, frags, visitor, flags);
-		}
-	}
-out:
-	if (flags & VISIT_INDIR) {
-		(*frags) += fs->fs_frag;
-		visitor(ino, lbn, blk, fs->fs_frag);
-	}
-}
-
-/*
- * Visit each block in an inode as specified by 'flags' and call a
- * callback function.  The callback may inspect or free blocks.  The
- * count of frags found according to the size in the file is returned.
- * This is not valid for sparse files but may be used to determine
- * the correct di_blocks for a file.
- */
-static uint64_t
-ino_visit(union dinode *ip, ino_t ino, ino_visitor visitor, int flags)
-{
-	ufs_lbn_t tmpval;
-	ufs_lbn_t lbn;
-	uint64_t size;
-	uint64_t fragcnt;
-	int mode;
-	int frags;
-	int i;
-
-	size = DIP(ip, di_size);
-	mode = DIP(ip, di_mode) & IFMT;
-	fragcnt = 0;
-	if ((flags & VISIT_EXT) &&
-	    fs->fs_magic == FS_UFS2_MAGIC && ip->dp2.di_extsize) {
-		for (i = 0; i < NXADDR; i++) {
-			if (ip->dp2.di_extb[i] == 0)
-				continue;
-			frags = sblksize(fs, ip->dp2.di_extsize, i);
-			frags = numfrags(fs, frags);
-			fragcnt += frags;
-			visitor(ino, -1 - i, ip->dp2.di_extb[i], frags);
-		}
-	}
-	/* Skip datablocks for short links and devices. */
-	if (mode == IFBLK || mode == IFCHR ||
-	    (mode == IFLNK && size < fs->fs_maxsymlinklen))
-		return (fragcnt);
-	for (i = 0; i < NDADDR; i++) {
-		if (DIP(ip, di_db[i]) == 0)
-			continue;
-		frags = sblksize(fs, size, i);
-		frags = numfrags(fs, frags);
-		fragcnt += frags;
-		visitor(ino, i, DIP(ip, di_db[i]), frags);
-	}
-	for (i = 0, tmpval = NINDIR(fs), lbn = NDADDR; i < NIADDR; i++,
-	    tmpval *= NINDIR(fs), lbn += tmpval) {
-		if (DIP(ip, di_ib[i]) == 0)
-			continue;
-		indir_visit(ino, -lbn - i, DIP(ip, di_ib[i]), &fragcnt, visitor,
-		    flags);
-	}
-	return (fragcnt);
-}
-
-/*
- * Null visitor function used when we just want to count blocks.
- */
-static void
-null_visit(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags)
-{
-}
-
-/*
- * Recalculate di_blocks when we discover that a block allocation or
- * free was not successfully completed.  The kernel does not roll this back
- * because it would be too expensive to compute which indirects were
- * reachable at the time the inode was written.
- */
-static void
-ino_adjblks(ino_t ino)
-{
-	struct suj_ino *sino;
-	union dinode *ip;
-	uint64_t blocks;
-	uint64_t frags;
-
-	sino = ino_lookup(ino, 1);
-	if (sino->si_blkadj)
-		return;
-	sino->si_blkadj = 1;
-	ip = ino_read(ino);
-	/* No need to adjust zero'd inodes. */
-	if (DIP(ip, di_mode) == 0)
-		return;
-	frags = ino_visit(ip, ino, null_visit, VISIT_INDIR | VISIT_EXT);
-	blocks = fsbtodb(fs, frags);
-	if (blocks == DIP(ip, di_blocks))
-		return;
-	if (debug)
-		printf("ino %d adjusting block count from %jd to %jd\n",
-		    ino, DIP(ip, di_blocks), blocks);
-	DIP_SET(ip, di_blocks, blocks);
-	ino_dirty(ino);
-}
-
-static void
-blk_free_visit(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags)
-{
-	int mask;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 07:59: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 7B0D81065687;
	Sat, 24 Apr 2010 07:59:45 +0000 (UTC)
	(envelope-from jeff@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 528BD8FC1E;
	Sat, 24 Apr 2010 07:59: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 o3O7xjTt067536;
	Sat, 24 Apr 2010 07:59:45 GMT (envelope-from jeff@svn.freebsd.org)
Received: (from jeff@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3O7xjhZ067534;
	Sat, 24 Apr 2010 07:59:45 GMT (envelope-from jeff@svn.freebsd.org)
Message-Id: <201004240759.o3O7xjhZ067534@svn.freebsd.org>
From: Jeff Roberson 
Date: Sat, 24 Apr 2010 07:59: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: r207145 - 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: Sat, 24 Apr 2010 07:59:45 -0000

Author: jeff
Date: Sat Apr 24 07:59:45 2010
New Revision: 207145
URL: http://svn.freebsd.org/changeset/base/207145

Log:
   - Temporarily lower WARNS until I fix alignment warnings on sparc64.
  
  Reported by:	Florian Smeets

Modified:
  head/sbin/tunefs/Makefile

Modified: head/sbin/tunefs/Makefile
==============================================================================
--- head/sbin/tunefs/Makefile	Sat Apr 24 07:58:59 2010	(r207144)
+++ head/sbin/tunefs/Makefile	Sat Apr 24 07:59:45 2010	(r207145)
@@ -6,4 +6,6 @@ DPADD=	${LIBUFS}
 LDADD=	-lufs
 MAN=	tunefs.8
 
+WARNS=	3
+
 .include 

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 09:02: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 723BB106566B;
	Sat, 24 Apr 2010 09:02:52 +0000 (UTC)
	(envelope-from jroberson@jroberson.net)
Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com
	[209.85.160.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A0F38FC17;
	Sat, 24 Apr 2010 09:02:52 +0000 (UTC)
Received: by pwi9 with SMTP id 9so7671297pwi.13
	for ; Sat, 24 Apr 2010 02:02:51 -0700 (PDT)
Received: by 10.141.124.4 with SMTP id b4mr1282840rvn.41.1272098445237;
	Sat, 24 Apr 2010 01:40:45 -0700 (PDT)
Received: from [10.0.1.198] (udp022762uds.hawaiiantel.net [72.234.79.107])
	by mx.google.com with ESMTPS id h11sm768861rvm.9.2010.04.24.01.40.42
	(version=SSLv3 cipher=RC4-MD5); Sat, 24 Apr 2010 01:40:44 -0700 (PDT)
Date: Fri, 23 Apr 2010 22:40:45 -1000 (HST)
From: Jeff Roberson 
X-X-Sender: jroberson@desktop
To: Pawel Jakub Dawidek 
In-Reply-To: <201004240758.o3O7wxZA067332@svn.freebsd.org>
Message-ID: 
References: <201004240758.o3O7wxZA067332@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r207144 - head/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: Sat, 24 Apr 2010 09:02:52 -0000

On Sat, 24 Apr 2010, Pawel Jakub Dawidek wrote:

> Author: pjd
> Date: Sat Apr 24 07:58:59 2010
> New Revision: 207144
> URL: http://svn.freebsd.org/changeset/base/207144
>
> Log:
>  suj.c seems to contain two versions of the code.
>  Remove the one that doesn't compile.

Thanks pjd.  I must've patched twice and not noticed.  When I tried to 
just merge the changes from my projects branch it failed.

Jeff

>
> Modified:
>  head/sbin/fsck_ffs/suj.c
>
> Modified: head/sbin/fsck_ffs/suj.c
> ==============================================================================
> --- head/sbin/fsck_ffs/suj.c	Sat Apr 24 07:54:49 2010	(r207143)
> +++ head/sbin/fsck_ffs/suj.c	Sat Apr 24 07:58:59 2010	(r207144)
> @@ -2632,2068 +2632,3 @@ suj_check(const char *filesys)
>
> 	return (0);
> }
> -/*-
> - * Copyright (c) 2009 Jeffrey W. Roberson 
> - * 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 AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE
> - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> - * SUCH DAMAGE.
> - */
> -
> -#include 
> -__FBSDID("$FreeBSD$");
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -#include "fsck.h"
> -
> -static void	ino_decr(ino_t);
> -
> -#define	SUJ_HASHSIZE	128
> -#define	SUJ_HASHMASK	(SUJ_HASHSIZE - 1)
> -#define	SUJ_HASH(x)	((x * 2654435761) & SUJ_HASHMASK)
> -
> -struct suj_seg {
> -	TAILQ_ENTRY(suj_seg) ss_next;
> -	struct jsegrec	ss_rec;
> -	uint8_t		*ss_blk;
> -};
> -
> -struct suj_rec {
> -	TAILQ_ENTRY(suj_rec) sr_next;
> -	union jrec	*sr_rec;
> -};
> -TAILQ_HEAD(srechd, suj_rec);
> -
> -struct suj_ino {
> -	LIST_ENTRY(suj_ino)	si_next;
> -	struct srechd		si_recs;
> -	struct srechd		si_movs;
> -	ino_t			si_ino;
> -	int			si_nlinkadj;
> -	int			si_skipparent;
> -	int			si_linkadj;
> -	int			si_hasrecs;
> -	int			si_blkadj;
> -};
> -LIST_HEAD(inohd, suj_ino);
> -
> -struct suj_blk {
> -	LIST_ENTRY(suj_blk)	sb_next;
> -	struct srechd		sb_recs;
> -	ufs2_daddr_t		sb_blk;
> -};
> -LIST_HEAD(blkhd, suj_blk);
> -
> -struct data_blk {
> -	LIST_ENTRY(data_blk)	db_next;
> -	uint8_t			*db_buf;
> -	ufs2_daddr_t		db_blk;
> -	int			db_size;
> -};
> -
> -struct ino_blk {
> -	LIST_ENTRY(ino_blk)	ib_next;
> -	uint8_t			*ib_buf;
> -	int			ib_dirty;
> -	ufs2_daddr_t		ib_blk;
> -};
> -LIST_HEAD(iblkhd, ino_blk);
> -
> -struct suj_cg {
> -	LIST_ENTRY(suj_cg)	sc_next;
> -	struct blkhd		sc_blkhash[SUJ_HASHSIZE];
> -	struct inohd		sc_inohash[SUJ_HASHSIZE];
> -	struct iblkhd		sc_iblkhash[SUJ_HASHSIZE];
> -	struct ino_blk		*sc_lastiblk;
> -	uint8_t			*sc_cgbuf;
> -	struct cg		*sc_cgp;
> -	int			sc_dirty;
> -	int			sc_cgx;
> -};
> -
> -LIST_HEAD(cghd, suj_cg) cghash[SUJ_HASHSIZE];
> -LIST_HEAD(dblkhd, data_blk) dbhash[SUJ_HASHSIZE];
> -
> -TAILQ_HEAD(seghd, suj_seg) allsegs;
> -uint64_t oldseq;
> -static struct uufsd *disk = NULL;
> -static struct fs *fs = NULL;
> -
> -/*
> - * Summary statistics.
> - */
> -uint64_t freefrags;
> -uint64_t freeblocks;
> -uint64_t freeinos;
> -uint64_t freedir;
> -uint64_t jbytes;
> -uint64_t jrecs;
> -
> -typedef void (*ino_visitor)(ino_t, ufs_lbn_t, ufs2_daddr_t, int);
> -
> -static void *
> -errmalloc(size_t n)
> -{
> -	void *a;
> -
> -	a = malloc(n);
> -	if (a == NULL)
> -		errx(1, "malloc(%zu)", n);
> -	return (a);
> -}
> -
> -/*
> - * Open the given provider, load superblock.
> - */
> -static void
> -opendisk(const char *devnam)
> -{
> -	if (disk != NULL)
> -		return;
> -	disk = malloc(sizeof(*disk));
> -	if (disk == NULL)
> -		errx(1, "malloc(%zu)", sizeof(*disk));
> -	if (ufs_disk_fillout(disk, devnam) == -1) {
> -		err(1, "ufs_disk_fillout(%s) failed: %s", devnam,
> -		    disk->d_error);
> -	}
> -	fs = &disk->d_fs;
> -	/*
> -	 * Setup a few things so reply() can work.
> -	 */
> -	bcopy(fs, &sblock, sizeof(sblock));
> -	fsreadfd = disk->d_fd;
> -	fswritefd = disk->d_fd;
> -}
> -
> -/*
> - * Mark file system as clean, write the super-block back, close the disk.
> - */
> -static void
> -closedisk(const char *devnam)
> -{
> -	struct csum *cgsum;
> -	int i;
> -
> -	/*
> -	 * Recompute the fs summary info from correct cs summaries.
> -	 */
> -	bzero(&fs->fs_cstotal, sizeof(struct csum_total));
> -	for (i = 0; i < fs->fs_ncg; i++) {
> -		cgsum = &fs->fs_cs(fs, i);
> -		fs->fs_cstotal.cs_nffree += cgsum->cs_nffree;
> -		fs->fs_cstotal.cs_nbfree += cgsum->cs_nbfree;
> -		fs->fs_cstotal.cs_nifree += cgsum->cs_nifree;
> -		fs->fs_cstotal.cs_ndir += cgsum->cs_ndir;
> -	}
> -	/* XXX Don't set clean for now, we don't trust the journal. */
> -	/* fs->fs_clean = 1; */
> -	fs->fs_time = time(NULL);
> -	fs->fs_mtime = time(NULL);
> -	if (sbwrite(disk, 0) == -1)
> -		err(1, "sbwrite(%s)", devnam);
> -	if (ufs_disk_close(disk) == -1)
> -		err(1, "ufs_disk_close(%s)", devnam);
> -	free(disk);
> -	disk = NULL;
> -	fs = NULL;
> -	fsreadfd = -1;
> -	fswritefd = -1;
> -}
> -
> -/*
> - * Lookup a cg by number in the hash so we can keep track of which cgs
> - * need stats rebuilt.
> - */
> -static struct suj_cg *
> -cg_lookup(int cgx)
> -{
> -	struct cghd *hd;
> -	struct suj_cg *sc;
> -
> -	if (cgx < 0 || cgx >= fs->fs_ncg) {
> -		abort();
> -		errx(1, "Bad cg number %d", cgx);
> -	}
> -	hd = &cghash[SUJ_HASH(cgx)];
> -	LIST_FOREACH(sc, hd, sc_next)
> -		if (sc->sc_cgx == cgx)
> -			return (sc);
> -	sc = errmalloc(sizeof(*sc));
> -	bzero(sc, sizeof(*sc));
> -	sc->sc_cgbuf = errmalloc(fs->fs_bsize);
> -	sc->sc_cgp = (struct cg *)sc->sc_cgbuf;
> -	sc->sc_cgx = cgx;
> -	LIST_INSERT_HEAD(hd, sc, sc_next);
> -	if (bread(disk, fsbtodb(fs, cgtod(fs, sc->sc_cgx)), sc->sc_cgbuf,
> -	    fs->fs_bsize) == -1)
> -		err(1, "Unable to read cylinder group %d", sc->sc_cgx);
> -
> -	return (sc);
> -}
> -
> -/*
> - * Lookup an inode number in the hash and allocate a suj_ino if it does
> - * not exist.
> - */
> -static struct suj_ino *
> -ino_lookup(ino_t ino, int creat)
> -{
> -	struct suj_ino *sino;
> -	struct inohd *hd;
> -	struct suj_cg *sc;
> -
> -	sc = cg_lookup(ino_to_cg(fs, ino));
> -	hd = &sc->sc_inohash[SUJ_HASH(ino)];
> -	LIST_FOREACH(sino, hd, si_next)
> -		if (sino->si_ino == ino)
> -			return (sino);
> -	if (creat == 0)
> -		return (NULL);
> -	sino = errmalloc(sizeof(*sino));
> -	bzero(sino, sizeof(*sino));
> -	sino->si_ino = ino;
> -	sino->si_nlinkadj = 0;
> -	TAILQ_INIT(&sino->si_recs);
> -	TAILQ_INIT(&sino->si_movs);
> -	LIST_INSERT_HEAD(hd, sino, si_next);
> -
> -	return (sino);
> -}
> -
> -/*
> - * Lookup a block number in the hash and allocate a suj_blk if it does
> - * not exist.
> - */
> -static struct suj_blk *
> -blk_lookup(ufs2_daddr_t blk, int creat)
> -{
> -	struct suj_blk *sblk;
> -	struct suj_cg *sc;
> -	struct blkhd *hd;
> -
> -	sc = cg_lookup(dtog(fs, blk));
> -	hd = &sc->sc_blkhash[SUJ_HASH(blk)];
> -	LIST_FOREACH(sblk, hd, sb_next)
> -		if (sblk->sb_blk == blk)
> -			return (sblk);
> -	if (creat == 0)
> -		return (NULL);
> -	sblk = errmalloc(sizeof(*sblk));
> -	bzero(sblk, sizeof(*sblk));
> -	sblk->sb_blk = blk;
> -	TAILQ_INIT(&sblk->sb_recs);
> -	LIST_INSERT_HEAD(hd, sblk, sb_next);
> -
> -	return (sblk);
> -}
> -
> -static uint8_t *
> -dblk_read(ufs2_daddr_t blk, int size)
> -{
> -	struct data_blk *dblk;
> -	struct dblkhd *hd;
> -
> -	hd = &dbhash[SUJ_HASH(blk)];
> -	LIST_FOREACH(dblk, hd, db_next)
> -		if (dblk->db_blk == blk)
> -			goto found;
> -	/*
> -	 * The inode block wasn't located, allocate a new one.
> -	 */
> -	dblk = errmalloc(sizeof(*dblk));
> -	bzero(dblk, sizeof(*dblk));
> -	LIST_INSERT_HEAD(hd, dblk, db_next);
> -	dblk->db_blk = blk;
> -found:
> -	/*
> -	 * I doubt size mismatches can happen in practice but it is trivial
> -	 * to handle.
> -	 */
> -	if (size != dblk->db_size) {
> -		if (dblk->db_buf)
> -			free(dblk->db_buf);
> -		dblk->db_buf = errmalloc(size);
> -		dblk->db_size = size;
> -		if (bread(disk, fsbtodb(fs, blk), dblk->db_buf, size) == -1)
> -			err(1, "Failed to read data block %jd", blk);
> -	}
> -	return (dblk->db_buf);
> -}
> -
> -static union dinode *
> -ino_read(ino_t ino)
> -{
> -	struct ino_blk *iblk;
> -	struct iblkhd *hd;
> -	struct suj_cg *sc;
> -	ufs2_daddr_t blk;
> -	int off;
> -
> -	blk = ino_to_fsba(fs, ino);
> -	sc = cg_lookup(ino_to_cg(fs, ino));
> -	hd = &sc->sc_iblkhash[SUJ_HASH(blk)];
> -	LIST_FOREACH(iblk, hd, ib_next)
> -		if (iblk->ib_blk == blk)
> -			goto found;
> -	/*
> -	 * The inode block wasn't located, allocate a new one.
> -	 */
> -	iblk = errmalloc(sizeof(*iblk));
> -	bzero(iblk, sizeof(*iblk));
> -	iblk->ib_buf = errmalloc(fs->fs_bsize);
> -	iblk->ib_blk = blk;
> -	LIST_INSERT_HEAD(hd, iblk, ib_next);
> -	if (bread(disk, fsbtodb(fs, blk), iblk->ib_buf, fs->fs_bsize) == -1)
> -		err(1, "Failed to read inode block %jd", blk);
> -found:
> -	sc->sc_lastiblk = iblk;
> -	off = ino_to_fsbo(fs, ino);
> -	if (fs->fs_magic == FS_UFS1_MAGIC)
> -		return (union dinode *)&((struct ufs1_dinode *)iblk->ib_buf)[off];
> -	else
> -		return (union dinode *)&((struct ufs2_dinode *)iblk->ib_buf)[off];
> -}
> -
> -static void
> -ino_dirty(ino_t ino)
> -{
> -	struct ino_blk *iblk;
> -	struct iblkhd *hd;
> -	struct suj_cg *sc;
> -	ufs2_daddr_t blk;
> -
> -	blk = ino_to_fsba(fs, ino);
> -	sc = cg_lookup(ino_to_cg(fs, ino));
> -	iblk = sc->sc_lastiblk;
> -	if (iblk && iblk->ib_blk == blk) {
> -		iblk->ib_dirty = 1;
> -		return;
> -	}
> -	hd = &sc->sc_iblkhash[SUJ_HASH(blk)];
> -	LIST_FOREACH(iblk, hd, ib_next) {
> -		if (iblk->ib_blk == blk) {
> -			iblk->ib_dirty = 1;
> -			return;
> -		}
> -	}
> -	ino_read(ino);
> -	ino_dirty(ino);
> -}
> -
> -static void
> -iblk_write(struct ino_blk *iblk)
> -{
> -
> -	if (iblk->ib_dirty == 0)
> -		return;
> -	if (bwrite(disk, fsbtodb(fs, iblk->ib_blk), iblk->ib_buf,
> -	    fs->fs_bsize) == -1)
> -		err(1, "Failed to write inode block %jd", iblk->ib_blk);
> -}
> -
> -/*
> - * Return 1 if the inode was free and 0 if it is allocated.
> - */
> -static int
> -ino_isfree(ino_t ino)
> -{
> -	struct suj_cg *sc;
> -	uint8_t *inosused;
> -	struct cg *cgp;
> -	int cg;
> -
> -	cg = ino_to_cg(fs, ino);
> -	ino = ino % fs->fs_ipg;
> -	sc = cg_lookup(cg);
> -	cgp = sc->sc_cgp;
> -	inosused = cg_inosused(cgp);
> -	return isclr(inosused, ino);
> -}
> -
> -static int
> -blk_overlaps(struct jblkrec *brec, ufs2_daddr_t start, int frags)
> -{
> -	ufs2_daddr_t bstart;
> -	ufs2_daddr_t bend;
> -	ufs2_daddr_t end;
> -
> -	end = start + frags;
> -	bstart = brec->jb_blkno + brec->jb_oldfrags;
> -	bend = bstart + brec->jb_frags;
> -	if (start < bend && end > bstart)
> -		return (1);
> -	return (0);
> -}
> -
> -static int
> -blk_equals(struct jblkrec *brec, ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t start,
> -    int frags)
> -{
> -
> -	if (brec->jb_ino != ino || brec->jb_lbn != lbn)
> -		return (0);
> -	if (brec->jb_blkno + brec->jb_oldfrags != start)
> -		return (0);
> -	if (brec->jb_frags != frags)
> -		return (0);
> -	return (1);
> -}
> -
> -static void
> -blk_setmask(struct jblkrec *brec, int *mask)
> -{
> -	int i;
> -
> -	for (i = brec->jb_oldfrags; i < brec->jb_oldfrags + brec->jb_frags; i++)
> -		*mask |= 1 << i;
> -}
> -
> -/*
> - * Determine whether a given block has been reallocated to a new location.
> - * Returns a mask of overlapping bits if any frags have been reused or
> - * zero if the block has not been re-used and the contents can be trusted.
> - *
> - * This is used to ensure that an orphaned pointer due to truncate is safe
> - * to be freed.  The mask value can be used to free partial blocks.
> - */
> -static int
> -blk_isfree(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t lbn, int frags)
> -{
> -	struct suj_blk *sblk;
> -	struct suj_rec *srec;
> -	struct jblkrec *brec;
> -	int mask;
> -	int off;
> -
> -	/*
> -	 * To be certain we're not freeing a reallocated block we lookup
> -	 * this block in the blk hash and see if there is an allocation
> -	 * journal record that overlaps with any fragments in the block
> -	 * we're concerned with.  If any fragments have ben reallocated
> -	 * the block has already been freed and re-used for another purpose.
> -	 */
> -	mask = 0;
> -	sblk = blk_lookup(blknum(fs, blk), 0);
> -	if (sblk == NULL)
> -		return (0);
> -	off = blk - sblk->sb_blk;
> -	TAILQ_FOREACH(srec, &sblk->sb_recs, sr_next) {
> -		brec = (struct jblkrec *)srec->sr_rec;
> -		/*
> -		 * If the block overlaps but does not match
> -		 * exactly it's a new allocation.  If it matches
> -		 * exactly this record refers to the current
> -		 * location.
> -		 */
> -		if (blk_overlaps(brec, blk, frags) == 0)
> -			continue;
> -		if (blk_equals(brec, ino, lbn, blk, frags) == 1)
> -			mask = 0;
> -		else
> -			blk_setmask(brec, &mask);
> -	}
> -	if (debug)
> -		printf("blk_isfree: blk %jd sblk %jd off %d mask 0x%X\n",
> -		    blk, sblk->sb_blk, off, mask);
> -	return (mask >> off);
> -}
> -
> -/*
> - * Determine whether it is safe to follow an indirect.  It is not safe
> - * if any part of the indirect has been reallocated or the last journal
> - * entry was an allocation.  Just allocated indirects may not have valid
> - * pointers yet and all of their children will have their own records.
> - *
> - * Returns 1 if it's safe to follow the indirect and 0 otherwise.
> - */
> -static int
> -blk_isindir(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t lbn)
> -{
> -	struct suj_blk *sblk;
> -	struct jblkrec *brec;
> -
> -	sblk = blk_lookup(blk, 0);
> -	if (sblk == NULL)
> -		return (1);
> -	if (TAILQ_EMPTY(&sblk->sb_recs))
> -		return (1);
> -	brec = (struct jblkrec *)TAILQ_LAST(&sblk->sb_recs, srechd)->sr_rec;
> -	if (blk_equals(brec, ino, lbn, blk, fs->fs_frag))
> -		if (brec->jb_op == JOP_FREEBLK)
> -			return (1);
> -	return (0);
> -}
> -
> -/*
> - * Clear an inode from the cg bitmap.  If the inode was already clear return
> - * 0 so the caller knows it does not have to check the inode contents.
> - */
> -static int
> -ino_free(ino_t ino, int mode)
> -{
> -	struct suj_cg *sc;
> -	uint8_t *inosused;
> -	struct cg *cgp;
> -	int cg;
> -
> -	cg = ino_to_cg(fs, ino);
> -	ino = ino % fs->fs_ipg;
> -	sc = cg_lookup(cg);
> -	cgp = sc->sc_cgp;
> -	inosused = cg_inosused(cgp);
> -	/*
> -	 * The bitmap may never have made it to the disk so we have to
> -	 * conditionally clear.  We can avoid writing the cg in this case.
> -	 */
> -	if (isclr(inosused, ino))
> -		return (0);
> -	freeinos++;
> -	clrbit(inosused, ino);
> -	if (ino < cgp->cg_irotor)
> -		cgp->cg_irotor = ino;
> -	cgp->cg_cs.cs_nifree++;
> -	if ((mode & IFMT) == IFDIR) {
> -		freedir++;
> -		cgp->cg_cs.cs_ndir--;
> -	}
> -	sc->sc_dirty = 1;
> -
> -	return (1);
> -}
> -
> -/*
> - * Free 'frags' frags starting at filesystem block 'bno' skipping any frags
> - * set in the mask.
> - */
> -static void
> -blk_free(ufs2_daddr_t bno, int mask, int frags)
> -{
> -	ufs1_daddr_t fragno, cgbno;
> -	struct suj_cg *sc;
> -	struct cg *cgp;
> -	int i, cg;
> -	uint8_t *blksfree;
> -
> -	if (debug)
> -		printf("Freeing %d frags at blk %jd\n", frags, bno);
> -	cg = dtog(fs, bno);
> -	sc = cg_lookup(cg);
> -	cgp = sc->sc_cgp;
> -	cgbno = dtogd(fs, bno);
> -	blksfree = cg_blksfree(cgp);
> -
> -	/*
> -	 * If it's not allocated we only wrote the journal entry
> -	 * and never the bitmaps.  Here we unconditionally clear and
> -	 * resolve the cg summary later.
> -	 */
> -	if (frags == fs->fs_frag && mask == 0) {
> -		fragno = fragstoblks(fs, cgbno);
> -		ffs_setblock(fs, blksfree, fragno);
> -		freeblocks++;
> -	} else {
> -		/*
> -		 * deallocate the fragment
> -		 */
> -		for (i = 0; i < frags; i++)
> -			if ((mask & (1 << i)) == 0 && isclr(blksfree, cgbno +i)) {
> -				freefrags++;
> -				setbit(blksfree, cgbno + i);
> -			}
> -	}
> -	sc->sc_dirty = 1;
> -}
> -
> -/*
> - * Fetch an indirect block to find the block at a given lbn.  The lbn
> - * may be negative to fetch a specific indirect block pointer or positive
> - * to fetch a specific block.
> - */
> -static ufs2_daddr_t
> -indir_blkatoff(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t cur, ufs_lbn_t lbn, int level)
> -{
> -	ufs2_daddr_t *bap2;
> -	ufs2_daddr_t *bap1;
> -	ufs_lbn_t lbnadd;
> -	ufs_lbn_t base;
> -	int i;
> -
> -	if (blk == 0)
> -		return (0);
> -	if (cur == lbn)
> -		return (blk);
> -	if (level == 0 && lbn < 0) {
> -		abort();
> -		errx(1, "Invalid lbn %jd", lbn);
> -	}
> -	bap2 = (void *)dblk_read(blk, fs->fs_bsize);
> -	bap1 = (void *)bap2;
> -	lbnadd = 1;
> -	base = -(cur + level);
> -	for (i = level; i > 0; i--)
> -		lbnadd *= NINDIR(fs);
> -	if (lbn > 0)
> -		i = (lbn - base) / lbnadd;
> -	else
> -		i = (-lbn - base) / lbnadd;
> -	if (i < 0 || i >= NINDIR(fs)) {
> -		abort();
> -		errx(1, "Invalid indirect index %d produced by lbn %jd",
> -		    i, lbn);
> -	}
> -	if (level == 0)
> -		cur = base + (i * lbnadd);
> -	else
> -		cur = -(base + (i * lbnadd)) - (level - 1);
> -	if (fs->fs_magic == FS_UFS1_MAGIC)
> -		blk = bap1[i];
> -	else
> -		blk = bap2[i];
> -	if (cur == lbn)
> -		return (blk);
> -	if (level == 0) {
> -		abort();
> -		errx(1, "Invalid lbn %jd at level 0", lbn);
> -	}
> -	return indir_blkatoff(blk, ino, cur, lbn, level - 1);
> -}
> -
> -/*
> - * Finds the disk block address at the specified lbn within the inode
> - * specified by ip.  This follows the whole tree and honors di_size and
> - * di_extsize so it is a true test of reachability.  The lbn may be
> - * negative if an extattr or indirect block is requested.
> - */
> -static ufs2_daddr_t
> -ino_blkatoff(union dinode *ip, ino_t ino, ufs_lbn_t lbn, int *frags)
> -{
> -	ufs_lbn_t tmpval;
> -	ufs_lbn_t cur;
> -	ufs_lbn_t next;
> -	int i;
> -
> -	/*
> -	 * Handle extattr blocks first.
> -	 */
> -	if (lbn < 0 && lbn >= -NXADDR) {
> -		lbn = -1 - lbn;
> -		if (lbn > lblkno(fs, ip->dp2.di_extsize - 1))
> -			return (0);
> -		*frags = numfrags(fs, sblksize(fs, ip->dp2.di_extsize, lbn));
> -		return (ip->dp2.di_extb[lbn]);
> -	}
> -	/*
> -	 * And now direct and indirect.  Verify that the lbn does not
> -	 * exceed the size required to store the file by asking for
> -	 * the lbn of the last byte.  These blocks should be 0 anyway
> -	 * so this simply saves the traversal.
> -	 */
> -	if (lbn > 0 && lbn > lblkno(fs, DIP(ip, di_size) - 1))
> -		return (0);
> -	if (lbn < 0 && -lbn > lblkno(fs, DIP(ip, di_size) - 1))
> -		return (0);
> -	if (lbn >= 0 && lbn < NDADDR) {
> -		*frags = numfrags(fs, sblksize(fs, DIP(ip, di_size), lbn));
> -		return (DIP(ip, di_db[lbn]));
> -	}
> -	*frags = fs->fs_frag;
> -
> -	for (i = 0, tmpval = NINDIR(fs), cur = NDADDR; i < NIADDR; i++,
> -	    tmpval *= NINDIR(fs), cur = next) {
> -		next = cur + tmpval;
> -		if (lbn == -cur)
> -			return (DIP(ip, di_ib[i]));
> -		/*
> -		 * Determine whether the lbn in question is within this tree.
> -		 */
> -		if (lbn < 0 && -lbn >= next)
> -			continue;
> -		if (lbn > 0 && lbn >= next)
> -			continue;
> -
> -		return indir_blkatoff(DIP(ip, di_ib[i]), ino, -cur - i, lbn, i);
> -	}
> -	errx(1, "lbn %jd not in ino", lbn);
> -}
> -
> -/*
> - * Determine whether a block exists at a particular lbn in an inode.
> - * Returns 1 if found, 0 if not.  lbn may be negative for indirects
> - * or ext blocks.
> - */
> -static int
> -blk_isat(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int *frags)
> -{
> -	union dinode *ip;
> -	ufs2_daddr_t nblk;
> -
> -	ip = ino_read(ino);
> -
> -	if (DIP(ip, di_nlink) == 0 || DIP(ip, di_mode) == 0)
> -		return (0);
> -	nblk = ino_blkatoff(ip, ino, lbn, frags);
> -
> -	return (nblk == blk);
> -}
> -
> -/*
> - * Determines whether a pointer to an inode exists within a directory
> - * at a specified offset.  Returns the mode of the found entry.
> - */
> -static int
> -ino_isat(ino_t parent, off_t diroff, ino_t child, int *mode, int *isdot)
> -{
> -	union dinode *dip;
> -	struct direct *dp;
> -	ufs2_daddr_t blk;
> -	uint8_t *block;
> -	ufs_lbn_t lbn;
> -	int blksize;
> -	int frags;
> -	int dpoff;
> -	int doff;
> -
> -	*isdot = 0;
> -	dip = ino_read(parent);
> -	*mode = DIP(dip, di_mode);
> -	if ((*mode & IFMT) != IFDIR) {
> -		if (debug) {
> -			/* This can happen if the parent inode was reallocated. */
> -			if (*mode != 0)
> -				printf("Directory %d has bad mode %o\n",
> -				    parent, *mode);
> -			else
> -				printf("Directory %d zero inode\n", parent);
> -		}
> -		return (0);
> -	}
> -	lbn = lblkno(fs, diroff);
> -	doff = blkoff(fs, diroff);
> -	blksize = sblksize(fs, DIP(dip, di_size), lbn);
> -	if (diroff + DIRECTSIZ(1) > DIP(dip, di_size) || doff >= blksize) {
> -		if (debug)
> -			printf("ino %d absent from %d due to offset %jd"
> -			    " exceeding size %jd\n",
> -			    child, parent, diroff, DIP(dip, di_size));
> -		return (0);
> -	}
> -	blk = ino_blkatoff(dip, parent, lbn, &frags);
> -	if (blk <= 0) {
> -		if (debug)
> -			printf("Sparse directory %d", parent);
> -		return (0);
> -	}
> -	block = dblk_read(blk, blksize);
> -	/*
> -	 * Walk through the records from the start of the block to be
> -	 * certain we hit a valid record and not some junk in the middle
> -	 * of a file name.  Stop when we reach or pass the expected offset.
> -	 */
> -	dpoff = 0;
> -	do {
> -		dp = (struct direct *)&block[dpoff];
> -		if (dpoff == doff)
> -			break;
> -		if (dp->d_reclen == 0)
> -			break;
> -		dpoff += dp->d_reclen;
> -	} while (dpoff <= doff);
> -	if (dpoff > fs->fs_bsize)
> -		errx(1, "Corrupt directory block in dir inode %d", parent);
> -	/* Not found. */
> -	if (dpoff != doff) {
> -		if (debug)
> -			printf("ino %d not found in %d, lbn %jd, dpoff %d\n",
> -			    child, parent, lbn, dpoff);
> -		return (0);
> -	}
> -	/*
> -	 * We found the item in question.  Record the mode and whether it's
> -	 * a . or .. link for the caller.
> -	 */
> -	if (dp->d_ino == child) {
> -		if (child == parent)
> -			*isdot = 1;
> -		else if (dp->d_namlen == 2 &&
> -		    dp->d_name[0] == '.' && dp->d_name[1] == '.')
> -			*isdot = 1;
> -		*mode = DTTOIF(dp->d_type);
> -		return (1);
> -	}
> -	if (debug)
> -		printf("ino %d doesn't match dirent ino %d in parent %d\n",
> -		    child, dp->d_ino, parent);
> -	return (0);
> -}
> -
> -#define	VISIT_INDIR	0x0001
> -#define	VISIT_EXT	0x0002
> -
> -/*
> - * Read an indirect level which may or may not be linked into an inode.
> - */
> -static void
> -indir_visit(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, uint64_t *frags,
> -    ino_visitor visitor, int flags)
> -{
> -	ufs2_daddr_t *bap2;
> -	ufs1_daddr_t *bap1;
> -	ufs_lbn_t lbnadd;
> -	ufs2_daddr_t nblk;
> -	ufs_lbn_t nlbn;
> -	int level;
> -	int i;
> -
> -	/*
> -	 * Don't visit indirect blocks with contents we can't trust.  This
> -	 * should only happen when indir_visit() is called to complete a
> -	 * truncate that never finished and not when a pointer is found via
> -	 * an inode.
> -	 */
> -	if (blk == 0)
> -		return;
> -	if (blk_isindir(blk, ino, lbn) == 0) {
> -		if (debug)
> -			printf("blk %jd ino %d lbn %jd is not indir.\n",
> -			    blk, ino, lbn);
> -		goto out;
> -	}
> -	level = lbn_level(lbn);
> -	if (level == -1) {
> -		abort();
> -		errx(1, "Invalid level for lbn %jd", lbn);
> -	}
> -	lbnadd = 1;
> -	for (i = level; i > 0; i--)
> -		lbnadd *= NINDIR(fs);
> -	bap1 = (void *)dblk_read(blk, fs->fs_bsize);
> -	bap2 = (void *)bap1;
> -	for (i = 0; i < NINDIR(fs); i++) {
> -		if (fs->fs_magic == FS_UFS1_MAGIC)
> -			nblk = *bap1++;
> -		else
> -			nblk = *bap2++;
> -		if (nblk == 0)
> -			continue;
> -		if (level == 0) {
> -			nlbn = -lbn + i * lbnadd;
> -			(*frags) += fs->fs_frag;
> -			visitor(ino, nlbn, nblk, fs->fs_frag);
> -		} else {
> -			nlbn = (lbn + 1) - (i * lbnadd);
> -			indir_visit(ino, nlbn, nblk, frags, visitor, flags);
> -		}
> -	}
> -out:
> -	if (flags & VISIT_INDIR) {
> -		(*frags) += fs->fs_frag;
> -		visitor(ino, lbn, blk, fs->fs_frag);
> -	}
> -}
> -
> -/*
> - * Visit each block in an inode as specified by 'flags' and call a
> - * callback function.  The callback may inspect or free blocks.  The
> - * count of frags found according to the size in the file is returned.
> - * This is not valid for sparse files but may be used to determine
> - * the correct di_blocks for a file.
> - */
> -static uint64_t
> -ino_visit(union dinode *ip, ino_t ino, ino_visitor visitor, int flags)
> -{
> -	ufs_lbn_t tmpval;
> -	ufs_lbn_t lbn;
> -	uint64_t size;
> -	uint64_t fragcnt;
> -	int mode;
> -	int frags;
> -	int i;
> -
> -	size = DIP(ip, di_size);
> -	mode = DIP(ip, di_mode) & IFMT;
> -	fragcnt = 0;
> -	if ((flags & VISIT_EXT) &&
> -	    fs->fs_magic == FS_UFS2_MAGIC && ip->dp2.di_extsize) {
> -		for (i = 0; i < NXADDR; i++) {
> -			if (ip->dp2.di_extb[i] == 0)
> -				continue;
> -			frags = sblksize(fs, ip->dp2.di_extsize, i);
> -			frags = numfrags(fs, frags);
> -			fragcnt += frags;
> -			visitor(ino, -1 - i, ip->dp2.di_extb[i], frags);
> -		}
> -	}
> -	/* Skip datablocks for short links and devices. */
> -	if (mode == IFBLK || mode == IFCHR ||
> -	    (mode == IFLNK && size < fs->fs_maxsymlinklen))
> -		return (fragcnt);
> -	for (i = 0; i < NDADDR; i++) {
> -		if (DIP(ip, di_db[i]) == 0)
> -			continue;
> -		frags = sblksize(fs, size, i);
> -		frags = numfrags(fs, frags);
> -		fragcnt += frags;
> -		visitor(ino, i, DIP(ip, di_db[i]), frags);
> -	}
> -	for (i = 0, tmpval = NINDIR(fs), lbn = NDADDR; i < NIADDR; i++,
> -	    tmpval *= NINDIR(fs), lbn += tmpval) {
> -		if (DIP(ip, di_ib[i]) == 0)
> -			continue;
> -		indir_visit(ino, -lbn - i, DIP(ip, di_ib[i]), &fragcnt, visitor,
> -		    flags);
> -	}
> -	return (fragcnt);
> -}
> -
> -/*
> - * Null visitor function used when we just want to count blocks.
> - */
> -static void
> -null_visit(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags)
> -{
> -}
> -
> -/*
> - * Recalculate di_blocks when we discover that a block allocation or
> - * free was not successfully completed.  The kernel does not roll this back
> - * because it would be too expensive to compute which indirects were
> - * reachable at the time the inode was written.
> - */
> -static void
> -ino_adjblks(ino_t ino)
> -{
> -	struct suj_ino *sino;
> -	union dinode *ip;
> -	uint64_t blocks;
> -	uint64_t frags;
> -
> -	sino = ino_lookup(ino, 1);
> -	if (sino->si_blkadj)
> -		return;
> -	sino->si_blkadj = 1;
> -	ip = ino_read(ino);
> -	/* No need to adjust zero'd inodes. */
> -	if (DIP(ip, di_mode) == 0)
> -		return;
> -	frags = ino_visit(ip, ino, null_visit, VISIT_INDIR | VISIT_EXT);
> -	blocks = fsbtodb(fs, frags);
> -	if (blocks == DIP(ip, di_blocks))
> -		return;
> -	if (debug)
> -		printf("ino %d adjusting block count from %jd to %jd\n",
> -		    ino, DIP(ip, di_blocks), blocks);
> -	DIP_SET(ip, di_blocks, blocks);
> -	ino_dirty(ino);
> -}
> -
> -static void
> -blk_free_visit(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags)
> -{
> -	int mask;
>
> *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
>

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 12:11: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 E462A1065672;
	Sat, 24 Apr 2010 12:11: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 D0B768FC1A;
	Sat, 24 Apr 2010 12:11: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 o3OCBgIe027193;
	Sat, 24 Apr 2010 12:11:42 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OCBgXD027190;
	Sat, 24 Apr 2010 12:11:42 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201004241211.o3OCBgXD027190@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 24 Apr 2010 12:11: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: r207151 - in head/tools/test: . testfloat
	testfloat/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, 24 Apr 2010 12:11:43 -0000

Author: marius
Date: Sat Apr 24 12:11:41 2010
New Revision: 207151
URL: http://svn.freebsd.org/changeset/base/207151

Log:
  Add a TestFloat based test suite for floating-point implementations
  currently supporting sparc64. After a `make depend all` there are
  three programs; testsoftfloat for testing against the SoftFloat in
  src/lib/libc/softfloat for reference purposes, testemufloat for
  testing the emulator source in src/lib/libc/sparc64/fpu and testfloat
  for testing with the installed libc. Support for other architectures
  can be added as needed.
  
  PR:		144900
  Submitted by:	Peter Jeremy

Added:
  head/tools/test/testfloat/
  head/tools/test/testfloat/README.txt
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/README.txt
  head/tools/test/testfloat/fail.c
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/fail.c
  head/tools/test/testfloat/fail.h
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/fail.h
  head/tools/test/testfloat/random.c   (contents, props changed)
     - copied, changed from r207134, vendor/testfloat/dist/testfloat/random.c
  head/tools/test/testfloat/random.h
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/random.h
  head/tools/test/testfloat/slowfloat-32.c
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/slowfloat-32.c
  head/tools/test/testfloat/slowfloat-64.c
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/slowfloat-64.c
  head/tools/test/testfloat/slowfloat.c
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/slowfloat.c
  head/tools/test/testfloat/slowfloat.h
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/slowfloat.h
  head/tools/test/testfloat/sparc64/
  head/tools/test/testfloat/sparc64/Makefile   (contents, props changed)
  head/tools/test/testfloat/sparc64/fpu_emul.S   (contents, props changed)
  head/tools/test/testfloat/sparc64/fpu_reg.h   (contents, props changed)
  head/tools/test/testfloat/sparc64/fpu_util.c   (contents, props changed)
  head/tools/test/testfloat/sparc64/libc_private.h   (contents, props changed)
  head/tools/test/testfloat/sparc64/milieu.h   (contents, props changed)
  head/tools/test/testfloat/sparc64/namespace.h   (contents, props changed)
  head/tools/test/testfloat/sparc64/softfloat.h   (contents, props changed)
  head/tools/test/testfloat/sparc64/sparc64.h   (contents, props changed)
  head/tools/test/testfloat/sparc64/systflags.c   (contents, props changed)
  head/tools/test/testfloat/sparc64/systfloat.S   (contents, props changed)
  head/tools/test/testfloat/sparc64/systfloat.h   (contents, props changed)
  head/tools/test/testfloat/sparc64/systmodes.c   (contents, props changed)
  head/tools/test/testfloat/sparc64/un-namespace.h   (contents, props changed)
  head/tools/test/testfloat/systemBugs.txt
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/systemBugs.txt
  head/tools/test/testfloat/systflags.h
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/systflags.h
  head/tools/test/testfloat/systfloat.c
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/systfloat.c
  head/tools/test/testfloat/systmodes.h
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/systmodes.h
  head/tools/test/testfloat/testCases.c   (contents, props changed)
     - copied, changed from r207134, vendor/testfloat/dist/testfloat/testCases.c
  head/tools/test/testfloat/testCases.h
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/testCases.h
  head/tools/test/testfloat/testFunction.c
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/testFunction.c
  head/tools/test/testfloat/testFunction.h
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/testFunction.h
  head/tools/test/testfloat/testLoops.c
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/testLoops.c
  head/tools/test/testfloat/testLoops.h
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/testLoops.h
  head/tools/test/testfloat/testfloat-history.txt
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/testfloat-history.txt
  head/tools/test/testfloat/testfloat-source.txt
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/testfloat-source.txt
  head/tools/test/testfloat/testfloat.c   (contents, props changed)
     - copied, changed from r207134, vendor/testfloat/dist/testfloat/testfloat.c
  head/tools/test/testfloat/testfloat.txt
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/testfloat.txt
  head/tools/test/testfloat/testsoftfloat.c   (contents, props changed)
     - copied, changed from r207134, vendor/testfloat/dist/testfloat/testsoftfloat.c
  head/tools/test/testfloat/writeHex.c
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/writeHex.c
  head/tools/test/testfloat/writeHex.h
     - copied unchanged from r207134, vendor/testfloat/dist/testfloat/writeHex.h
Modified:
  head/tools/test/README

Modified: head/tools/test/README
==============================================================================
--- head/tools/test/README	Sat Apr 24 10:22:08 2010	(r207150)
+++ head/tools/test/README	Sat Apr 24 12:11:41 2010	(r207151)
@@ -11,3 +11,4 @@ devrandom	Programs to test /dev/*random.
 dtrace		DTrace test suite
 malloc		A program to test and benchmark malloc().
 posixshm	A program to test POSIX shared memory.
+testfloat	Programs to test floating-point implementations

Copied: head/tools/test/testfloat/README.txt (from r207134, vendor/testfloat/dist/testfloat/README.txt)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/test/testfloat/README.txt	Sat Apr 24 12:11:41 2010	(r207151, copy of r207134, vendor/testfloat/dist/testfloat/README.txt)
@@ -0,0 +1,50 @@
+
+Package Overview for TestFloat Release 2a
+
+John R. Hauser
+1998 December 16
+
+
+TestFloat is a program for testing that a floating-point implementation
+conforms to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
+TestFloat is distributed in the form of C source code.  The TestFloat
+package actually provides two related programs:
+
+-- The `testfloat' program tests a system's floating-point for conformance
+   to the IEC/IEEE Standard.  This program uses the SoftFloat software
+   floating-point implementation as a basis for comparison.
+
+-- The `testsoftfloat' program tests SoftFloat itself for conformance to
+   the IEC/IEEE Standard.  These tests are performed by comparing against a
+   separate, slower software floating-point that is included in the TestFloat
+   package.
+
+TestFloat depends on SoftFloat, but SoftFloat is not included in the
+TestFloat package.  SoftFloat can be obtained through the Web page `http://
+HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/SoftFloat.html'.
+
+TestFloat is documented in three text files:
+
+   testfloat.txt          Documentation for using the TestFloat programs
+                              (both `testfloat' and `testsoftfloat').
+   testfloat-source.txt   Documentation for porting and compiling TestFloat.
+   testfloat-history.txt  History of major changes to TestFloat.
+
+The following file is also provided:
+
+   systemBugs.txt         Information about processor bugs found using
+                              TestFloat.
+
+Other files in the package comprise the source code for TestFloat.
+
+Please be aware that some work is involved in porting this software to other
+targets.  It is not just a matter of getting `make' to complete without
+error messages.  I would have written the code that way if I could, but
+there are fundamental differences between systems that I can't make go away.
+You should not attempt to compile the TestFloat sources without first
+reading `testfloat-source.txt'.
+
+At the time of this writing, the most up-to-date information about
+TestFloat and the latest release can be found at the Web page `http://
+HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+

Copied: head/tools/test/testfloat/fail.c (from r207134, vendor/testfloat/dist/testfloat/fail.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/test/testfloat/fail.c	Sat Apr 24 12:11:41 2010	(r207151, copy of r207134, vendor/testfloat/dist/testfloat/fail.c)
@@ -0,0 +1,46 @@
+
+/*
+===============================================================================
+
+This C source file is part of TestFloat, Release 2a, a package of programs
+for testing the correctness of floating-point arithmetic complying to the
+IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser.  More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+#include 
+#include 
+#include 
+#include "milieu.h"
+#include "fail.h"
+
+char *fail_programName = "";
+
+void fail( const char *message, ... )
+{
+    va_list varArgs;
+
+    fprintf( stderr, "%s: ", fail_programName );
+    va_start( varArgs, message );
+    vfprintf( stderr, message, varArgs );
+    va_end( varArgs );
+    fputs( ".\n", stderr );
+    exit( EXIT_FAILURE );
+
+}
+

Copied: head/tools/test/testfloat/fail.h (from r207134, vendor/testfloat/dist/testfloat/fail.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/test/testfloat/fail.h	Sat Apr 24 12:11:41 2010	(r207151, copy of r207134, vendor/testfloat/dist/testfloat/fail.h)
@@ -0,0 +1,29 @@
+
+/*
+===============================================================================
+
+This C header file is part of TestFloat, Release 2a, a package of programs
+for testing the correctness of floating-point arithmetic complying to the
+IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser.  More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+extern char *fail_programName;
+
+void fail( const char *, ... );
+

Copied and modified: head/tools/test/testfloat/random.c (from r207134, vendor/testfloat/dist/testfloat/random.c)
==============================================================================
--- vendor/testfloat/dist/testfloat/random.c	Fri Apr 23 19:48:31 2010	(r207134, copy source)
+++ head/tools/test/testfloat/random.c	Sat Apr 24 12:11:41 2010	(r207151)
@@ -23,6 +23,9 @@ this code that are retained.
 ===============================================================================
 */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include "milieu.h"
 #include "random.h"
@@ -30,26 +33,21 @@ this code that are retained.
 uint8 randomUint8( void )
 {
 
-    return (bits8) ( rand()>>4 );
+    return (bits8) ( random()>>4 );
 
 }
 
 uint16 randomUint16( void )
 {
 
-    return ( ( rand() & 0x0FF0 )<<4 ) | ( ( rand()>>4 ) & 0xFF );
+    return ( random() & 0x0000ffff );
 
 }
 
 uint32 randomUint32( void )
 {
 
-    return
-          ( ( (uint32) ( rand() & 0x0FF0 ) )<<20 )
-        | ( ( (uint32) ( rand() & 0x0FF0 ) )<<12 )
-        | ( ( rand() & 0x0FF0 )<<4 )
-        | ( ( rand()>>4 ) & 0xFF );
-
+    return ( ( (uint32) random()<<16) | ( (uint32) random() & 0x0000ffff) );
 }
 
 #ifdef BITS64

Copied: head/tools/test/testfloat/random.h (from r207134, vendor/testfloat/dist/testfloat/random.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/test/testfloat/random.h	Sat Apr 24 12:11:41 2010	(r207151, copy of r207134, vendor/testfloat/dist/testfloat/random.h)
@@ -0,0 +1,32 @@
+
+/*
+===============================================================================
+
+This C header file is part of TestFloat, Release 2a, a package of programs
+for testing the correctness of floating-point arithmetic complying to the
+IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser.  More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+uint8 randomUint8( void );
+uint16 randomUint16( void );
+uint32 randomUint32( void );
+#ifdef BITS64
+uint64 randomUint64( void );
+#endif
+

Copied: head/tools/test/testfloat/slowfloat-32.c (from r207134, vendor/testfloat/dist/testfloat/slowfloat-32.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/test/testfloat/slowfloat-32.c	Sat Apr 24 12:11:41 2010	(r207151, copy of r207134, vendor/testfloat/dist/testfloat/slowfloat-32.c)
@@ -0,0 +1,1183 @@
+
+/*
+===============================================================================
+
+This C source file is part of TestFloat, Release 2a, a package of programs
+for testing the correctness of floating-point arithmetic complying to the
+IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser.  More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+int8 slow_float_rounding_mode;
+int8 slow_float_exception_flags;
+int8 slow_float_detect_tininess;
+
+typedef struct {
+    bits32 a0, a1;
+} bits64X;
+
+typedef struct {
+    flag isNaN;
+    flag isInf;
+    flag isZero;
+    flag sign;
+    int16 exp;
+    bits64X sig;
+} floatX;
+
+static const floatX floatXNaN = { TRUE, FALSE, FALSE, FALSE, 0, { 0, 0 } };
+static const floatX floatXPositiveZero =
+    { FALSE, FALSE, TRUE, FALSE, 0, { 0, 0 } };
+static const floatX floatXNegativeZero =
+    { FALSE, FALSE, TRUE, TRUE, 0, { 0, 0 } };
+
+static bits64X shortShift64Left( bits64X a, int8 shiftCount )
+{
+    int8 negShiftCount;
+
+    negShiftCount = ( - shiftCount & 31 );
+    a.a0 = ( a.a0<>negShiftCount );
+    a.a1 <<= shiftCount;
+    return a;
+
+}
+
+static bits64X shortShift64RightJamming( bits64X a, int8 shiftCount )
+{
+    int8 negShiftCount;
+    bits32 extra;
+
+    negShiftCount = ( - shiftCount & 31 );
+    extra = a.a1<>shiftCount ) | ( extra != 0 );
+    a.a0 >>= shiftCount;
+    return a;
+
+}
+
+static bits64X neg64( bits64X a )
+{
+
+    if ( a.a1 == 0 ) {
+        a.a0 = - a.a0;
+    }
+    else {
+        a.a1 = - a.a1;
+        a.a0 = ~ a.a0;
+    }
+    return a;
+
+}
+
+static bits64X add64( bits64X a, bits64X b )
+{
+
+    a.a1 += b.a1;
+    a.a0 += b.a0 + ( a.a1 < b.a1 );
+    return a;
+
+}
+
+static flag eq64( bits64X a, bits64X b )
+{
+
+    return ( a.a0 == b.a0 ) && ( a.a1 == b.a1 );
+
+}
+
+static flag le64( bits64X a, bits64X b )
+{
+
+    return ( a.a0 < b.a0 ) || ( ( a.a0 == b.a0 ) && ( a.a1 <= b.a1 ) );
+
+}
+
+static flag lt64( bits64X a, bits64X b )
+{
+
+    return ( a.a0 < b.a0 ) || ( ( a.a0 == b.a0 ) && ( a.a1 < b.a1 ) );
+
+}
+
+static floatX roundFloatXTo24( flag isTiny, floatX zx )
+{
+
+    if ( zx.sig.a1 ) {
+        slow_float_exception_flags |= float_flag_inexact;
+        if ( isTiny ) slow_float_exception_flags |= float_flag_underflow;
+        switch ( slow_float_rounding_mode ) {
+         case float_round_nearest_even:
+            if ( zx.sig.a1 < 0x80000000 ) goto noIncrement;
+            if ( ( zx.sig.a1 == 0x80000000 ) && ! ( zx.sig.a0 & 1 ) ) {
+                goto noIncrement;
+            }
+            break;
+         case float_round_to_zero:
+            goto noIncrement;
+         case float_round_down:
+            if ( ! zx.sign ) goto noIncrement;
+            break;
+         case float_round_up:
+            if ( zx.sign ) goto noIncrement;
+            break;
+        }
+        ++zx.sig.a0;
+        if ( zx.sig.a0 == 0x01000000 ) {
+            zx.sig.a0 = 0x00800000;
+            ++zx.exp;
+        }
+    }
+ noIncrement:
+    zx.sig.a1 = 0;
+    return zx;
+
+}
+
+static floatX roundFloatXTo53( flag isTiny, floatX zx )
+{
+    int8 roundBits;
+
+    roundBits = zx.sig.a1 & 7;
+    zx.sig.a1 -= roundBits;
+    if ( roundBits ) {
+        slow_float_exception_flags |= float_flag_inexact;
+        if ( isTiny ) slow_float_exception_flags |= float_flag_underflow;
+        switch ( slow_float_rounding_mode ) {
+         case float_round_nearest_even:
+            if ( roundBits < 4 ) goto noIncrement;
+            if ( ( roundBits == 4 ) && ! ( zx.sig.a1 & 8 ) ) goto noIncrement;
+            break;
+         case float_round_to_zero:
+            goto noIncrement;
+         case float_round_down:
+            if ( ! zx.sign ) goto noIncrement;
+            break;
+         case float_round_up:
+            if ( zx.sign ) goto noIncrement;
+            break;
+        }
+        zx.sig.a1 += 8;
+        zx.sig.a0 += ( zx.sig.a1 == 0 );
+        if ( zx.sig.a0 == 0x01000000 ) {
+            zx.sig.a0 = 0x00800000;
+            ++zx.exp;
+        }
+    }
+ noIncrement:
+    return zx;
+
+}
+
+static floatX int32ToFloatX( int32 a )
+{
+    floatX ax;
+
+    ax.isNaN = FALSE;
+    ax.isInf = FALSE;
+    ax.sign = ( a < 0 );
+    ax.sig.a1 = ax.sign ? - a : a;
+    ax.sig.a0 = 0;
+    if ( a == 0 ) {
+        ax.isZero = TRUE;
+        return ax;
+    }
+    ax.isZero = FALSE;
+    ax.sig = shortShift64Left( ax.sig, 23 );
+    ax.exp = 32;
+    while ( ax.sig.a0 < 0x00800000 ) {
+        ax.sig = shortShift64Left( ax.sig, 1 );
+        --ax.exp;
+    }
+    return ax;
+
+}
+
+static int32 floatXToInt32( floatX ax )
+{
+    int8 savedExceptionFlags;
+    int16 shiftCount;
+    int32 z;
+
+    if ( ax.isInf || ax.isNaN ) {
+        slow_float_exception_flags |= float_flag_invalid;
+        return ( ax.isInf & ax.sign ) ? 0x80000000 : 0x7FFFFFFF;
+    }
+    if ( ax.isZero ) return 0;
+    savedExceptionFlags = slow_float_exception_flags;
+    shiftCount = 52 - ax.exp;
+    if ( 56 < shiftCount ) {
+        ax.sig.a1 = 1;
+        ax.sig.a0 = 0;
+    }
+    else {
+        while ( 0 < shiftCount ) {
+            ax.sig = shortShift64RightJamming( ax.sig, 1 );
+            --shiftCount;
+        }
+    }
+    ax = roundFloatXTo53( FALSE, ax );
+    ax.sig = shortShift64RightJamming( ax.sig, 3 );
+    z = ax.sig.a1;
+    if ( ax.sign ) z = - z;
+    if (    ( shiftCount < 0 )
+         || ax.sig.a0
+         || ( ( z != 0 ) && ( ( ax.sign ^ ( z < 0 ) ) != 0 ) )
+       ) {
+        slow_float_exception_flags = savedExceptionFlags | float_flag_invalid;
+        return ax.sign ? 0x80000000 : 0x7FFFFFFF;
+    }
+    return z;
+
+}
+
+static floatX float32ToFloatX( float32 a )
+{
+    int16 expField;
+    floatX ax;
+
+    ax.isNaN = FALSE;
+    ax.isInf = FALSE;
+    ax.isZero = FALSE;
+    ax.sign = ( ( a & 0x80000000 ) != 0 );
+    expField = ( a>>23 ) & 0xFF;
+    ax.sig.a1 = 0;
+    ax.sig.a0 = a & 0x007FFFFF;
+    if ( expField == 0 ) {
+        if ( ax.sig.a0 == 0 ) {
+            ax.isZero = TRUE;
+        }
+        else {
+            expField = 1 - 0x7F;
+            do {
+                ax.sig.a0 <<= 1;
+                --expField;
+            } while ( ax.sig.a0 < 0x00800000 );
+            ax.exp = expField;
+        }
+    }
+    else if ( expField == 0xFF ) {
+        if ( ax.sig.a0 == 0 ) {
+            ax.isInf = TRUE;
+        }
+        else {
+            ax.isNaN = TRUE;
+        }
+    }
+    else {
+        ax.sig.a0 |= 0x00800000;
+        ax.exp = expField - 0x7F;
+    }
+    return ax;
+
+}
+
+static float32 floatXToFloat32( floatX zx )
+{
+    floatX savedZ;
+    flag isTiny;
+    int16 expField;
+    float32 z;
+
+    if ( zx.isZero ) return zx.sign ? 0x80000000 : 0;
+    if ( zx.isInf ) return zx.sign ? 0xFF800000 : 0x7F800000;
+    if ( zx.isNaN ) return 0xFFFFFFFF;
+    while ( 0x01000000 <= zx.sig.a0 ) {
+        zx.sig = shortShift64RightJamming( zx.sig, 1 );
+        ++zx.exp;
+    }
+    while ( zx.sig.a0 < 0x00800000 ) {
+        zx.sig = shortShift64Left( zx.sig, 1 );
+        --zx.exp;
+    }
+    savedZ = zx;
+    isTiny =
+           ( slow_float_detect_tininess == float_tininess_before_rounding )
+        && ( zx.exp + 0x7F <= 0 );
+    zx = roundFloatXTo24( isTiny, zx );
+    expField = zx.exp + 0x7F;
+    if ( 0xFF <= expField ) {
+        slow_float_exception_flags |=
+            float_flag_overflow | float_flag_inexact;
+        if ( zx.sign ) {
+            switch ( slow_float_rounding_mode ) {
+             case float_round_nearest_even:
+             case float_round_down:
+                z = 0xFF800000;
+                break;
+             case float_round_to_zero:
+             case float_round_up:
+                z = 0xFF7FFFFF;
+                break;
+            }
+        }
+        else {
+            switch ( slow_float_rounding_mode ) {
+             case float_round_nearest_even:
+             case float_round_up:
+                z = 0x7F800000;
+                break;
+             case float_round_to_zero:
+             case float_round_down:
+                z = 0x7F7FFFFF;
+                break;
+            }
+        }
+        return z;
+    }
+    if ( expField <= 0 ) {
+        isTiny = TRUE;
+        zx = savedZ;
+        expField = zx.exp + 0x7F;
+        if ( expField < -27 ) {
+            zx.sig.a1 = ( zx.sig.a0 != 0 ) || ( zx.sig.a1 != 0 );
+            zx.sig.a0 = 0;
+        }
+        else {
+            while ( expField <= 0 ) {
+                zx.sig = shortShift64RightJamming( zx.sig, 1 );
+                ++expField;
+            }
+        }
+        zx = roundFloatXTo24( isTiny, zx );
+        expField = ( 0x00800000 <= zx.sig.a0 ) ? 1 : 0;
+    }
+    z = expField;
+    z <<= 23;
+    if ( zx.sign ) z |= 0x80000000;
+    z |= zx.sig.a0 & 0x007FFFFF;
+    return z;
+
+}
+
+static floatX float64ToFloatX( float64 a )
+{
+    int16 expField;
+    floatX ax;
+
+    ax.isNaN = FALSE;
+    ax.isInf = FALSE;
+    ax.isZero = FALSE;
+#ifdef BITS64
+    ax.sign = ( ( a & LIT64( 0x8000000000000000 ) ) != 0 );
+    expField = ( a>>52 ) & 0x7FF;
+    ax.sig.a1 = a;
+    ax.sig.a0 = ( a>>32 ) & 0x000FFFFF;
+#else
+    ax.sign = ( ( a.high & 0x80000000 ) != 0 );
+    expField = ( a.high>>( 52 - 32 ) ) & 0x7FF;
+    ax.sig.a1 = a.low;
+    ax.sig.a0 = a.high & 0x000FFFFF;
+#endif
+    if ( expField == 0 ) {
+        if ( ( ax.sig.a0 == 0 ) && ( ax.sig.a1 == 0 ) ) {
+            ax.isZero = TRUE;
+        }
+        else {
+            expField = 1 - 0x3FF;
+            do {
+                ax.sig = shortShift64Left( ax.sig, 1 );
+                --expField;
+            } while ( ax.sig.a0 < 0x00100000 );
+            ax.exp = expField;
+        }
+    }
+    else if ( expField == 0x7FF ) {
+        if ( ( ax.sig.a0 == 0 ) && ( ax.sig.a1 == 0 ) ) {
+            ax.isInf = TRUE;
+        }
+        else {
+            ax.isNaN = TRUE;
+        }
+    }
+    else {
+        ax.exp = expField - 0x3FF;
+        ax.sig.a0 |= 0x00100000;
+    }
+    ax.sig = shortShift64Left( ax.sig, 3 );
+    return ax;
+
+}
+
+static float64 floatXToFloat64( floatX zx )
+{
+    floatX savedZ;
+    flag isTiny;
+    int16 expField;
+    float64 z;
+
+#ifdef BITS64
+    if ( zx.isZero ) return zx.sign ? LIT64( 0x8000000000000000 ) : 0;
+    if ( zx.isInf ) {
+        return
+              zx.sign ? LIT64( 0xFFF0000000000000 )
+            : LIT64( 0x7FF0000000000000 );
+    }
+    if ( zx.isNaN ) return LIT64( 0xFFFFFFFFFFFFFFFF );
+#else
+    if ( zx.isZero ) {
+        z.low = 0;
+        z.high = zx.sign ? 0x80000000 : 0;
+        return z;
+    }
+    if ( zx.isInf ) {
+        z.low = 0;
+        z.high = zx.sign ? 0xFFF00000 : 0x7FF00000;
+        return z;
+    }
+    if ( zx.isNaN ) {
+        z.high = z.low = 0xFFFFFFFF;
+        return z;
+    }
+#endif
+    while ( 0x01000000 <= zx.sig.a0 ) {
+        zx.sig = shortShift64RightJamming( zx.sig, 1 );
+        ++zx.exp;
+    }
+    while ( zx.sig.a0 < 0x00800000 ) {
+        zx.sig = shortShift64Left( zx.sig, 1 );
+        --zx.exp;
+    }
+    savedZ = zx;
+    isTiny =
+           ( slow_float_detect_tininess == float_tininess_before_rounding )
+        && ( zx.exp + 0x3FF <= 0 );
+    zx = roundFloatXTo53( isTiny, zx );
+    expField = zx.exp + 0x3FF;
+    if ( 0x7FF <= expField ) {
+        slow_float_exception_flags |=
+            float_flag_overflow | float_flag_inexact;
+#ifdef BITS64
+        if ( zx.sign ) {
+            switch ( slow_float_rounding_mode ) {
+             case float_round_nearest_even:
+             case float_round_down:
+                z = LIT64( 0xFFF0000000000000 );
+                break;
+             case float_round_to_zero:
+             case float_round_up:
+                z = LIT64( 0xFFEFFFFFFFFFFFFF );
+                break;
+            }
+        }
+        else {
+            switch ( slow_float_rounding_mode ) {
+             case float_round_nearest_even:
+             case float_round_up:
+                z = LIT64( 0x7FF0000000000000 );
+                break;
+             case float_round_to_zero:
+             case float_round_down:
+                z = LIT64( 0x7FEFFFFFFFFFFFFF );
+                break;
+            }
+        }
+#else
+        if ( zx.sign ) {
+            switch ( slow_float_rounding_mode ) {
+             case float_round_nearest_even:
+             case float_round_down:
+                z.low = 0;
+                z.high = 0xFFF00000;
+                break;
+             case float_round_to_zero:
+             case float_round_up:
+                z.low = 0xFFFFFFFF;
+                z.high = 0xFFEFFFFF;
+                break;
+            }
+        }
+        else {
+            switch ( slow_float_rounding_mode ) {
+             case float_round_nearest_even:
+             case float_round_up:
+                z.low = 0;
+                z.high = 0x7FF00000;
+                break;
+             case float_round_to_zero:
+             case float_round_down:
+                z.low = 0xFFFFFFFF;
+                z.high = 0x7FEFFFFF;
+                break;
+            }
+        }
+#endif
+        return z;
+    }
+    if ( expField <= 0 ) {
+        isTiny = TRUE;
+        zx = savedZ;
+        expField = zx.exp + 0x3FF;
+        if ( expField < -56 ) {
+            zx.sig.a1 = ( zx.sig.a0 != 0 ) || ( zx.sig.a1 != 0 );
+            zx.sig.a0 = 0;
+        }
+        else {
+            while ( expField <= 0 ) {
+                zx.sig = shortShift64RightJamming( zx.sig, 1 );
+                ++expField;
+            }
+        }
+        zx = roundFloatXTo53( isTiny, zx );
+        expField = ( 0x00800000 <= zx.sig.a0 ) ? 1 : 0;
+    }
+    zx.sig = shortShift64RightJamming( zx.sig, 3 );
+#ifdef BITS64
+    z = expField;
+    z <<= 52;
+    if ( zx.sign ) z |= LIT64( 0x8000000000000000 );
+    z |= ( ( (bits64) ( zx.sig.a0 & 0x000FFFFF ) )<<32 ) | zx.sig.a1;
+#else
+    z.low = zx.sig.a1;
+    z.high = expField;
+    z.high <<= 52 - 32;
+    if ( zx.sign ) z.high |= 0x80000000;
+    z.high |= zx.sig.a0 & 0x000FFFFF;
+#endif
+    return z;
+
+}
+
+static floatX floatXInvalid( void )
+{
+
+    slow_float_exception_flags |= float_flag_invalid;
+    return floatXNaN;
+
+}
+
+static floatX floatXRoundToInt( floatX ax )
+{
+    int16 shiftCount, i;
+
+    if ( ax.isNaN || ax.isInf ) return ax;
+    shiftCount = 52 - ax.exp;
+    if ( shiftCount <= 0 ) return ax;
+    if ( 55 < shiftCount ) {
+        ax.exp = 52;
+        ax.sig.a1 = ! ax.isZero;
+        ax.sig.a0 = 0;
+    }
+    else {
+        while ( 0 < shiftCount ) {
+            ax.sig = shortShift64RightJamming( ax.sig, 1 );
+            ++ax.exp;
+            --shiftCount;
+        }
+    }
+    ax = roundFloatXTo53( FALSE, ax );
+    if ( ( ax.sig.a0 == 0 ) && ( ax.sig.a1 == 0 ) ) ax.isZero = TRUE;
+    return ax;
+
+}
+
+static floatX floatXAdd( floatX ax, floatX bx )
+{
+    int16 expDiff;
+    floatX zx;
+
+    if ( ax.isNaN ) return ax;
+    if ( bx.isNaN ) return bx;
+    if ( ax.isInf && bx.isInf ) {
+        if ( ax.sign == bx.sign ) return ax;
+        return floatXInvalid();
+    }
+    if ( ax.isInf ) return ax;
+    if ( bx.isInf ) return bx;
+    if ( ax.isZero && bx.isZero ) {
+        if ( ax.sign == bx.sign ) return ax;
+        goto completeCancellation;
+    }
+    if (    ( ax.sign != bx.sign )
+         && ( ax.exp == bx.exp )
+         && eq64( ax.sig, bx.sig )
+       ) {
+ completeCancellation:
+        return
+              ( slow_float_rounding_mode == float_round_down ) ?
+                  floatXNegativeZero
+            : floatXPositiveZero;
+    }
+    if ( ax.isZero ) return bx;
+    if ( bx.isZero ) return ax;
+    expDiff = ax.exp - bx.exp;
+    if ( expDiff < 0 ) {
+        zx = ax;
+        zx.exp = bx.exp;
+        if ( expDiff < -56 ) {
+            zx.sig.a1 = 1;
+            zx.sig.a0 = 0;
+        }
+        else {
+            while ( expDiff < 0 ) {
+                zx.sig = shortShift64RightJamming( zx.sig, 1 );
+                ++expDiff;
+            }
+        }
+        if ( ax.sign != bx.sign ) zx.sig = neg64( zx.sig );
+        zx.sign = bx.sign;
+        zx.sig = add64( zx.sig, bx.sig );
+    }
+    else {
+        zx = bx;
+        zx.exp = ax.exp;
+        if ( 56 < expDiff ) {
+            zx.sig.a1 = 1;
+            zx.sig.a0 = 0;
+        }
+        else {
+            while ( 0 < expDiff ) {
+                zx.sig = shortShift64RightJamming( zx.sig, 1 );
+                --expDiff;
+            }
+        }
+        if ( ax.sign != bx.sign ) zx.sig = neg64( zx.sig );
+        zx.sign = ax.sign;
+        zx.sig = add64( zx.sig, ax.sig );
+    }
+    if ( zx.sig.a0 & 0x80000000 ) {
+        zx.sig = neg64( zx.sig );
+        zx.sign = ! zx.sign;
+    }
+    return zx;
+
+}
+
+static floatX floatXMul( floatX ax, floatX bx )
+{
+    int8 bitNum;
+    floatX zx;
+
+    if ( ax.isNaN ) return ax;
+    if ( bx.isNaN ) return bx;
+    if ( ax.isInf ) {
+        if ( bx.isZero ) return floatXInvalid();
+        if ( bx.sign ) ax.sign = ! ax.sign;
+        return ax;
+    }
+    if ( bx.isInf ) {
+        if ( ax.isZero ) return floatXInvalid();
+        if ( ax.sign ) bx.sign = ! bx.sign;
+        return bx;
+    }
+    zx = ax;
+    zx.sign ^= bx.sign;
+    if ( ax.isZero || bx.isZero ) {
+        return zx.sign ? floatXNegativeZero : floatXPositiveZero;
+    }
+    zx.exp += bx.exp + 1;
+    zx.sig.a1 = 0;
+    zx.sig.a0 = 0;
+    for ( bitNum = 0; bitNum < 55; ++bitNum ) {
+        if ( bx.sig.a1 & 2 ) zx.sig = add64( zx.sig, ax.sig );
+        bx.sig = shortShift64RightJamming( bx.sig, 1 );
+        zx.sig = shortShift64RightJamming( zx.sig, 1 );
+    }
+    return zx;
+
+}
+
+static floatX floatXDiv( floatX ax, floatX bx )
+{
+    bits64X negBSig;
+    int8 bitNum;
+    floatX zx;
+
+    if ( ax.isNaN ) return ax;
+    if ( bx.isNaN ) return bx;
+    if ( ax.isInf ) {
+        if ( bx.isInf ) return floatXInvalid();
+        if ( bx.sign ) ax.sign = ! ax.sign;
+        return ax;
+    }
+    if ( bx.isZero ) {
+        if ( ax.isZero ) return floatXInvalid();
+        slow_float_exception_flags |= float_flag_divbyzero;
+        if ( ax.sign ) bx.sign = ! bx.sign;
+        bx.isZero = FALSE;
+        bx.isInf = TRUE;
+        return bx;
+    }
+    zx = ax;
+    zx.sign ^= bx.sign;
+    if ( ax.isZero || bx.isInf ) {
+        return zx.sign ? floatXNegativeZero : floatXPositiveZero;
+    }
+    zx.exp -= bx.exp + 1;
+    zx.sig.a1 = 0;
+    zx.sig.a0 = 0;
+    negBSig = neg64( bx.sig );
+    for ( bitNum = 0; bitNum < 56; ++bitNum ) {
+        if ( le64( bx.sig, ax.sig ) ) {
+            zx.sig.a1 |= 1;
+            ax.sig = add64( ax.sig, negBSig );
+        }
+        ax.sig = shortShift64Left( ax.sig, 1 );
+        zx.sig = shortShift64Left( zx.sig, 1 );
+    }
+    if ( ax.sig.a0 || ax.sig.a1 ) zx.sig.a1 |= 1;
+    return zx;
+
+}
+
+static floatX floatXRem( floatX ax, floatX bx )
+{
+    bits64X negBSig;
+    flag lastQuotientBit;
+    bits64X savedASig;
+
+    if ( ax.isNaN ) return ax;
+    if ( bx.isNaN ) return bx;
+    if ( ax.isInf || bx.isZero ) return floatXInvalid();
+    if ( ax.isZero || bx.isInf ) return ax;
+    --bx.exp;
+    if ( ax.exp < bx.exp ) return ax;
+    bx.sig = shortShift64Left( bx.sig, 1 );
+    negBSig = neg64( bx.sig );
+    while ( bx.exp < ax.exp ) {
+        if ( le64( bx.sig, ax.sig ) ) ax.sig = add64( ax.sig, negBSig );
+        ax.sig = shortShift64Left( ax.sig, 1 );
+        --ax.exp;
+    }
+    lastQuotientBit = le64( bx.sig, ax.sig );
+    if ( lastQuotientBit ) ax.sig = add64( ax.sig, negBSig );
+    savedASig = ax.sig;
+    ax.sig = neg64( add64( ax.sig, negBSig ) );
+    if ( lt64( ax.sig, savedASig ) ) {
+        ax.sign = ! ax.sign;
+    }
+    else if ( lt64( savedASig, ax.sig ) ) {
+        ax.sig = savedASig;
+    }
+    else {
+        if ( lastQuotientBit ) {
+            ax.sign = ! ax.sign;
+        }
+        else {
+            ax.sig = savedASig;
+        }
+    }
+    if ( ( ax.sig.a0 == 0 ) && ( ax.sig.a1 == 0 ) ) ax.isZero = TRUE;
+    return ax;
+
+}
+
+static floatX floatXSqrt( floatX ax )

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 12:49: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 6C513106564A;
	Sat, 24 Apr 2010 12:49:53 +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 59BD48FC12;
	Sat, 24 Apr 2010 12:49: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 o3OCnrhL035715;
	Sat, 24 Apr 2010 12:49:53 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OCnrXG035678;
	Sat, 24 Apr 2010 12:49:53 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004241249.o3OCnrXG035678@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 24 Apr 2010 12:49: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: r207152 - in head/sys: amd64/include arm/include
	i386/include ia64/include kern mips/include powerpc/include
	sparc64/include sun4v/include 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: Sat, 24 Apr 2010 12:49:53 -0000

Author: kib
Date: Sat Apr 24 12:49:52 2010
New Revision: 207152
URL: http://svn.freebsd.org/changeset/base/207152

Log:
  Move the constants specifying the size of struct kinfo_proc into
  machine-specific header files. Add KINFO_PROC32_SIZE for struct
  kinfo_proc32 for architectures providing COMPAT_FREEBSD32. Add
  CTASSERT for the size of struct kinfo_proc32.
  
  Submitted by:	pluknet
  Reviewed by:	imp, jhb, nwhitehorn
  MFC after:	2 weeks

Modified:
  head/sys/amd64/include/proc.h
  head/sys/arm/include/proc.h
  head/sys/i386/include/proc.h
  head/sys/ia64/include/proc.h
  head/sys/kern/kern_proc.c
  head/sys/mips/include/proc.h
  head/sys/powerpc/include/proc.h
  head/sys/sparc64/include/proc.h
  head/sys/sun4v/include/proc.h
  head/sys/sys/user.h

Modified: head/sys/amd64/include/proc.h
==============================================================================
--- head/sys/amd64/include/proc.h	Sat Apr 24 12:11:41 2010	(r207151)
+++ head/sys/amd64/include/proc.h	Sat Apr 24 12:49:52 2010	(r207152)
@@ -53,6 +53,9 @@ struct mdproc {
 	struct system_segment_descriptor md_ldt_sd;
 };
 
+#define KINFO_PROC_SIZE 1088
+#define KINFO_PROC32_SIZE 768
+
 #ifdef	_KERNEL
 
 /* Get the current kernel thread stack usage. */

Modified: head/sys/arm/include/proc.h
==============================================================================
--- head/sys/arm/include/proc.h	Sat Apr 24 12:11:41 2010	(r207151)
+++ head/sys/arm/include/proc.h	Sat Apr 24 12:49:52 2010	(r207152)
@@ -60,4 +60,6 @@ struct mdproc {
 	void	*md_sigtramp;
 };
 
+#define KINFO_PROC_SIZE 792
+
 #endif /* !_MACHINE_PROC_H_ */

Modified: head/sys/i386/include/proc.h
==============================================================================
--- head/sys/i386/include/proc.h	Sat Apr 24 12:11:41 2010	(r207151)
+++ head/sys/i386/include/proc.h	Sat Apr 24 12:49:52 2010	(r207152)
@@ -57,6 +57,8 @@ struct mdproc {
 	struct proc_ldt *md_ldt;	/* (t) per-process ldt */
 };
 
+#define KINFO_PROC_SIZE 768
+
 #ifdef	_KERNEL
 
 /* Get the current kernel thread stack usage. */

Modified: head/sys/ia64/include/proc.h
==============================================================================
--- head/sys/ia64/include/proc.h	Sat Apr 24 12:11:41 2010	(r207151)
+++ head/sys/ia64/include/proc.h	Sat Apr 24 12:49:52 2010	(r207152)
@@ -38,4 +38,7 @@ struct mdproc {
 	int		__dummy;	/* Avoid having an empty struct. */
 };
 
+#define KINFO_PROC_SIZE 1088
+#define KINFO_PROC32_SIZE 768
+
 #endif /* !_MACHINE_PROC_H_ */

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Sat Apr 24 12:11:41 2010	(r207151)
+++ head/sys/kern/kern_proc.c	Sat Apr 24 12:49:52 2010	(r207152)
@@ -151,6 +151,9 @@ int kstack_pages = KSTACK_PAGES;
 SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, "");
 
 CTASSERT(sizeof(struct kinfo_proc) == KINFO_PROC_SIZE);
+#ifdef COMPAT_FREEBSD32
+CTASSERT(sizeof(struct kinfo_proc32) == KINFO_PROC32_SIZE);
+#endif
 
 /*
  * Initialize global process hashing structures.

Modified: head/sys/mips/include/proc.h
==============================================================================
--- head/sys/mips/include/proc.h	Sat Apr 24 12:11:41 2010	(r207151)
+++ head/sys/mips/include/proc.h	Sat Apr 24 12:49:52 2010	(r207152)
@@ -68,4 +68,10 @@ struct thread;
 void	mips_cpu_switch(struct thread *, struct thread *, struct mtx *);
 void	mips_cpu_throw(struct thread *, struct thread *);
 
+#ifdef __mips_n64
+#define KINFO_PROC_SIZE 1088
+#else
+#define KINFO_PROC_SIZE 816
+#endif
+
 #endif	/* !_MACHINE_PROC_H_ */

Modified: head/sys/powerpc/include/proc.h
==============================================================================
--- head/sys/powerpc/include/proc.h	Sat Apr 24 12:11:41 2010	(r207151)
+++ head/sys/powerpc/include/proc.h	Sat Apr 24 12:49:52 2010	(r207152)
@@ -46,4 +46,6 @@ struct mdthread {
 struct mdproc {
 };
 
+#define KINFO_PROC_SIZE 768
+
 #endif /* !_MACHINE_PROC_H_ */

Modified: head/sys/sparc64/include/proc.h
==============================================================================
--- head/sys/sparc64/include/proc.h	Sat Apr 24 12:11:41 2010	(r207151)
+++ head/sys/sparc64/include/proc.h	Sat Apr 24 12:49:52 2010	(r207152)
@@ -51,4 +51,6 @@ struct mdproc {
 	void	*md_sigtramp;
 };
 
+#define KINFO_PROC_SIZE 1088
+
 #endif /* !_MACHINE_PROC_H_ */

Modified: head/sys/sun4v/include/proc.h
==============================================================================
--- head/sys/sun4v/include/proc.h	Sat Apr 24 12:11:41 2010	(r207151)
+++ head/sys/sun4v/include/proc.h	Sat Apr 24 12:49:52 2010	(r207152)
@@ -51,4 +51,6 @@ struct mdproc {
 	void	*md_sigtramp;
 };
 
+#define KINFO_PROC_SIZE 1088
+
 #endif /* !_MACHINE_PROC_H_ */

Modified: head/sys/sys/user.h
==============================================================================
--- head/sys/sys/user.h	Sat Apr 24 12:11:41 2010	(r207151)
+++ head/sys/sys/user.h	Sat Apr 24 12:49:52 2010	(r207152)
@@ -87,34 +87,11 @@
 #define	KI_NSPARE_LONG	12
 #define	KI_NSPARE_PTR	7
 
-#ifdef __amd64__
-#define	KINFO_PROC_SIZE	1088
-#endif
-#ifdef __arm__
-#define	KINFO_PROC_SIZE	792
-#endif
-#ifdef __ia64__
-#define	KINFO_PROC_SIZE 1088
-#endif
-#ifdef __i386__
-#define	KINFO_PROC_SIZE	768
-#endif
-#ifdef __mips__
-#ifdef __mips_n64
-#define	KINFO_PROC_SIZE	1088
-#else
-#define	KINFO_PROC_SIZE	816
-#endif
-#endif
-#ifdef __powerpc__
-#define	KINFO_PROC_SIZE	768
-#endif
-#ifdef __sparc64__
-#define	KINFO_PROC_SIZE 1088
-#endif
+#ifndef _KERNEL
 #ifndef KINFO_PROC_SIZE
 #error "Unknown architecture"
 #endif
+#endif /* !_KERNEL */
 
 #define	WMESGLEN	8		/* size of returned wchan message */
 #define	LOCKNAMELEN	8		/* size of returned lock name */

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 13:53: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 185D0106566B;
	Sat, 24 Apr 2010 13:53:13 +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 E231B8FC16;
	Sat, 24 Apr 2010 13:53: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 o3ODrCpt049713;
	Sat, 24 Apr 2010 13:53:12 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ODrC0L049712;
	Sat, 24 Apr 2010 13:53:12 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004241353.o3ODrC0L049712@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 24 Apr 2010 13:53: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: r207153 - head/usr.bin/stat
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, 24 Apr 2010 13:53:13 -0000

Author: jilles
Date: Sat Apr 24 13:53:12 2010
New Revision: 207153
URL: http://svn.freebsd.org/changeset/base/207153

Log:
  stat: Allow -f %Sf to display the file flags symbolically.
  
  I have changed the patch slightly to show '-' if there are no flags just
  like ls -ldo does.
  
  PR:		124349
  Submitted by:	Ighighi
  MFC after:	1 week

Modified:
  head/usr.bin/stat/stat.1
  head/usr.bin/stat/stat.c

Modified: head/usr.bin/stat/stat.1
==============================================================================
--- head/usr.bin/stat/stat.1	Sat Apr 24 12:49:52 2010	(r207152)
+++ head/usr.bin/stat/stat.1	Sat Apr 24 13:53:12 2010	(r207153)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 27, 2007
+.Dd April 24, 2010
 .Dt STAT 1
 .Os
 .Sh NAME
@@ -232,6 +232,11 @@ Display date in
 format.
 .It Cm dr
 Display actual device name.
+.It Cm f
+Display the flags of
+.Ar file
+as in
+.Nm ls Fl lTdo .
 .It Cm gu
 Display group or user name.
 .It Cm p

Modified: head/usr.bin/stat/stat.c
==============================================================================
--- head/usr.bin/stat/stat.c	Sat Apr 24 12:49:52 2010	(r207152)
+++ head/usr.bin/stat/stat.c	Sat Apr 24 13:53:12 2010	(r207153)
@@ -182,6 +182,9 @@ int	format1(const struct stat *,	/* stat
 	    char *, size_t,		/* a place to put the output */
 	    int, int, int, int,		/* the parsed format */
 	    int, int);
+#if HAVE_STRUCT_STAT_ST_FLAGS
+char   *xfflagstostr(unsigned long);
+#endif
 
 char *timefmt;
 int linkfail;
@@ -333,6 +336,25 @@ main(int argc, char *argv[])
 	return (am_readlink ? linkfail : errs);
 }
 
+#if HAVE_STRUCT_STAT_ST_FLAGS
+/*
+ * fflagstostr() wrapper that leaks only once
+ */
+char *
+xfflagstostr(unsigned long fflags)
+{
+	static char *str = NULL;
+
+	if (str != NULL)
+		free(str);
+
+	str = fflagstostr(fflags);
+	if (str == NULL)
+		err(1, "fflagstostr");
+	return (str);
+}
+#endif /* HAVE_STRUCT_STAT_ST_FLAGS */
+
 void
 usage(const char *synopsis)
 {
@@ -725,8 +747,11 @@ format1(const struct stat *st,
 	case SHOW_st_flags:
 		small = (sizeof(st->st_flags) == 4);
 		data = st->st_flags;
-		sdata = NULL;
-		formats = FMTF_DECIMAL | FMTF_OCTAL | FMTF_UNSIGNED | FMTF_HEX;
+		sdata = xfflagstostr(st->st_flags);
+		if (*sdata == '\0')
+			sdata = "-";
+		formats = FMTF_DECIMAL | FMTF_OCTAL | FMTF_UNSIGNED | FMTF_HEX |
+		    FMTF_STRING;
 		if (ofmt == 0)
 			ofmt = FMTF_UNSIGNED;
 		break;

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 16:27: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 70A001065670;
	Sat, 24 Apr 2010 16:27:44 +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 464B88FC0C;
	Sat, 24 Apr 2010 16:27: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 o3OGRiFt083785;
	Sat, 24 Apr 2010 16:27:44 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OGRiI2083784;
	Sat, 24 Apr 2010 16:27:44 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201004241627.o3OGRiI2083784@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 24 Apr 2010 16:27: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: r207154 - 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: Sat, 24 Apr 2010 16:27:44 -0000

Author: marius
Date: Sat Apr 24 16:27:43 2010
New Revision: 207154
URL: http://svn.freebsd.org/changeset/base/207154

Log:
  Fix some sorting and whitespace nits.

Modified:
  head/sys/conf/files.sparc64
  head/sys/conf/files.sun4v

Modified: head/sys/conf/files.sparc64
==============================================================================
--- head/sys/conf/files.sparc64	Sat Apr 24 13:53:12 2010	(r207153)
+++ head/sys/conf/files.sparc64	Sat Apr 24 16:27:43 2010	(r207154)
@@ -22,7 +22,7 @@ ukbdmap.h			optional	ukbd_dflt_keymap	\
 	no-obj no-implicit-rule before-depend				\
 	clean		"ukbdmap.h"
 #
-crypto/blowfish/bf_enc.c	optional	crypto | ipsec 
+crypto/blowfish/bf_enc.c	optional	crypto | ipsec
 crypto/des/des_enc.c		optional	crypto | ipsec | netsmb
 dev/atkbdc/atkbd.c		optional	atkbd atkbdc
 dev/atkbdc/atkbd_atkbdc.c	optional	atkbd atkbdc
@@ -42,11 +42,11 @@ dev/kbd/kbd.c			optional	atkbd | sc | uk
 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
-dev/ofw/ofw_if.m		standard
 dev/ofw/ofw_bus_if.m		standard
 dev/ofw/ofw_bus_subr.c		standard
-dev/ofw/ofw_standard.c		standard
 dev/ofw/ofw_console.c		optional	ofw_console
+dev/ofw/ofw_if.m		standard
+dev/ofw/ofw_standard.c		standard
 dev/ofw/openfirm.c		standard
 dev/ofw/openfirmio.c		standard
 dev/ofw/openpromio.c		standard
@@ -79,7 +79,7 @@ sparc64/pci/ofw_pcib.c		optional	pci
 sparc64/pci/ofw_pcib_subr.c	optional	pci
 sparc64/pci/ofw_pcibus.c	optional	pci
 sparc64/pci/psycho.c		optional	pci
-sparc64/pci/sbbc.c		optional	uart sbbc
+sparc64/pci/sbbc.c		optional	sbbc uart
 sparc64/pci/schizo.c		optional	pci
 sparc64/sbus/dma_sbus.c		optional	sbus
 sparc64/sbus/sbus.c		optional	sbus

Modified: head/sys/conf/files.sun4v
==============================================================================
--- head/sys/conf/files.sun4v	Sat Apr 24 13:53:12 2010	(r207153)
+++ head/sys/conf/files.sun4v	Sat Apr 24 16:27:43 2010	(r207154)
@@ -18,12 +18,12 @@ ukbdmap.h			optional	ukbd_dflt_keymap	\
 	clean		"ukbdmap.h"
 #
 #
-crypto/blowfish/bf_enc.c	optional	crypto | ipsec 
+crypto/blowfish/bf_enc.c	optional	crypto | ipsec
 crypto/des/des_enc.c		optional	crypto | ipsec | netsmb
 dev/ofw/ofw_bus_if.m		standard
-dev/ofw/ofw_if.m		standard
 dev/ofw/ofw_bus_subr.c		standard
 dev/ofw/ofw_console.c		optional	ofw_console
+dev/ofw/ofw_if.m		standard
 dev/ofw/ofw_standard.c		standard
 dev/ofw/openfirm.c		standard
 dev/ofw/openfirmio.c		standard

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 17:32: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 B984E106564A;
	Sat, 24 Apr 2010 17:32:53 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A55238FC0C;
	Sat, 24 Apr 2010 17:32: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 o3OHWr5e098654;
	Sat, 24 Apr 2010 17:32:53 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OHWrcB098640;
	Sat, 24 Apr 2010 17:32:53 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201004241732.o3OHWrcB098640@svn.freebsd.org>
From: Alan Cox 
Date: Sat, 24 Apr 2010 17:32: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: r207155 - in head/sys: amd64/amd64 arm/arm i386/i386
	i386/xen ia64/ia64 mips/mips powerpc/aim powerpc/booke
	powerpc/powerpc sparc64/sparc64 sun4v/sun4v 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, 24 Apr 2010 17:32:54 -0000

Author: alc
Date: Sat Apr 24 17:32:52 2010
New Revision: 207155
URL: http://svn.freebsd.org/changeset/base/207155

Log:
  Resurrect pmap_is_referenced() and use it in mincore().  Essentially,
  pmap_ts_referenced() is not always appropriate for checking whether or
  not pages have been referenced because it clears any reference bits
  that it encounters.  For example, in mincore(), clearing the reference
  bits has two negative consequences.  First, it throws off the activity
  count calculations performed by the page daemon.  Specifically, a page
  on which mincore() has called pmap_ts_referenced() looks less active
  to the page daemon than it should.  Consequently, the page could be
  deactivated prematurely by the page daemon.  Arguably, this problem
  could be fixed by having mincore() duplicate the activity count
  calculation on the page.  However, there is a second problem for which
  that is not a solution.  In order to clear a reference on a 4KB page,
  it may be necessary to demote a 2/4MB page mapping.  Thus, a mincore()
  by one process can have the side effect of demoting a superpage
  mapping within another process!

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/arm/arm/pmap.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/xen/pmap.c
  head/sys/ia64/ia64/pmap.c
  head/sys/mips/mips/pmap.c
  head/sys/powerpc/aim/mmu_oea.c
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/booke/pmap.c
  head/sys/powerpc/powerpc/mmu_if.m
  head/sys/powerpc/powerpc/pmap_dispatch.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/sun4v/sun4v/pmap.c
  head/sys/vm/pmap.h
  head/sys/vm/vm_mmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/amd64/amd64/pmap.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -236,6 +236,7 @@ static void pmap_fill_ptp(pt_entry_t *fi
 static void pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte);
 static void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva);
 static boolean_t pmap_is_modified_pvh(struct md_page *pvh);
+static boolean_t pmap_is_referenced_pvh(struct md_page *pvh);
 static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode);
 static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va);
 static void pmap_pde_attr(pd_entry_t *pde, int cache_bits);
@@ -4178,6 +4179,49 @@ pmap_is_prefaultable(pmap_t pmap, vm_off
 }
 
 /*
+ *	pmap_is_referenced:
+ *
+ *	Return whether or not the specified physical page was referenced
+ *	in any physical maps.
+ */
+boolean_t
+pmap_is_referenced(vm_page_t m)
+{
+
+	if (m->flags & PG_FICTITIOUS)
+		return (FALSE);
+	if (pmap_is_referenced_pvh(&m->md))
+		return (TRUE);
+	return (pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))));
+}
+
+/*
+ * Returns TRUE if any of the given mappings were referenced and FALSE
+ * otherwise.  Both page and 2mpage mappings are supported.
+ */
+static boolean_t
+pmap_is_referenced_pvh(struct md_page *pvh)
+{
+	pv_entry_t pv;
+	pt_entry_t *pte;
+	pmap_t pmap;
+	boolean_t rv;
+
+	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	rv = FALSE;
+	TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
+		pmap = PV_PMAP(pv);
+		PMAP_LOCK(pmap);
+		pte = pmap_pte(pmap, pv->pv_va);
+		rv = (*pte & (PG_A | PG_V)) == (PG_A | PG_V);
+		PMAP_UNLOCK(pmap);
+		if (rv)
+			break;
+	}
+	return (rv);
+}
+
+/*
  * Clear the write and modified bits in each of the given page's mappings.
  */
 void
@@ -4893,10 +4937,8 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 			 */
 			vm_page_lock_queues();
 			if ((m->flags & PG_REFERENCED) ||
-			    pmap_ts_referenced(m)) {
+			    pmap_is_referenced(m))
 				val |= MINCORE_REFERENCED_OTHER;
-				vm_page_flag_set(m, PG_REFERENCED);
-			}
 			vm_page_unlock_queues();
 		}
 	} 

Modified: head/sys/arm/arm/pmap.c
==============================================================================
--- head/sys/arm/arm/pmap.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/arm/arm/pmap.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -4493,6 +4493,20 @@ pmap_clear_modify(vm_page_t m)
 
 
 /*
+ *	pmap_is_referenced:
+ *
+ *	Return whether or not the specified physical page was referenced
+ *	in any physical maps.
+ */
+boolean_t
+pmap_is_referenced(vm_page_t m)
+{
+
+	return ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0 &&
+	    (m->md.pvh_attrs & PVF_REF) != 0);
+}
+
+/*
  *	pmap_clear_reference:
  *
  *	Clear the reference bit on the specified physical page.

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/i386/i386/pmap.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -296,6 +296,7 @@ static vm_page_t pmap_enter_quick_locked
 static void pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte);
 static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte);
 static boolean_t pmap_is_modified_pvh(struct md_page *pvh);
+static boolean_t pmap_is_referenced_pvh(struct md_page *pvh);
 static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode);
 static void pmap_kenter_pde(vm_offset_t va, pd_entry_t newpde);
 static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va);
@@ -4356,6 +4357,51 @@ pmap_is_prefaultable(pmap_t pmap, vm_off
 }
 
 /*
+ *	pmap_is_referenced:
+ *
+ *	Return whether or not the specified physical page was referenced
+ *	in any physical maps.
+ */
+boolean_t
+pmap_is_referenced(vm_page_t m)
+{
+
+	if (m->flags & PG_FICTITIOUS)
+		return (FALSE);
+	if (pmap_is_referenced_pvh(&m->md))
+		return (TRUE);
+	return (pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))));
+}
+
+/*
+ * Returns TRUE if any of the given mappings were referenced and FALSE
+ * otherwise.  Both page and 4mpage mappings are supported.
+ */
+static boolean_t
+pmap_is_referenced_pvh(struct md_page *pvh)
+{
+	pv_entry_t pv;
+	pt_entry_t *pte;
+	pmap_t pmap;
+	boolean_t rv;
+
+	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	rv = FALSE;
+	sched_pin();
+	TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
+		pmap = PV_PMAP(pv);
+		PMAP_LOCK(pmap);
+		pte = pmap_pte_quick(pmap, pv->pv_va);
+		rv = (*pte & (PG_A | PG_V)) == (PG_A | PG_V);
+		PMAP_UNLOCK(pmap);
+		if (rv)
+			break;
+	}
+	sched_unpin();
+	return (rv);
+}
+
+/*
  * Clear the write and modified bits in each of the given page's mappings.
  */
 void
@@ -4961,10 +5007,8 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 			 */
 			vm_page_lock_queues();
 			if ((m->flags & PG_REFERENCED) ||
-			    pmap_ts_referenced(m)) {
+			    pmap_is_referenced(m))
 				val |= MINCORE_REFERENCED_OTHER;
-				vm_page_flag_set(m, PG_REFERENCED);
-			}
 			vm_page_unlock_queues();
 		}
 	} 

Modified: head/sys/i386/xen/pmap.c
==============================================================================
--- head/sys/i386/xen/pmap.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/i386/xen/pmap.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -3718,6 +3718,34 @@ pmap_is_prefaultable(pmap_t pmap, vm_off
 	return (rv);
 }
 
+boolean_t
+pmap_is_referenced(vm_page_t m)
+{
+	pv_entry_t pv;
+	pt_entry_t *pte;
+	pmap_t pmap;
+	boolean_t rv;
+
+	rv = FALSE;
+	if (m->flags & PG_FICTITIOUS)
+		return (rv);
+	sched_pin();
+	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
+		pmap = PV_PMAP(pv);
+		PMAP_LOCK(pmap);
+		pte = pmap_pte_quick(pmap, pv->pv_va);
+		rv = (*pte & (PG_A | PG_V)) == (PG_A | PG_V);
+		PMAP_UNLOCK(pmap);
+		if (rv)
+			break;
+	}
+	if (*PMAP1)
+		PT_SET_MA(PADDR1, 0);
+	sched_unpin();
+	return (rv);
+}
+
 void
 pmap_map_readonly(pmap_t pmap, vm_offset_t va, int len)
 {
@@ -4145,10 +4173,8 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 			 */
 			vm_page_lock_queues();
 			if ((m->flags & PG_REFERENCED) ||
-			    pmap_ts_referenced(m)) {
+			    pmap_is_referenced(m))
 				val |= MINCORE_REFERENCED_OTHER;
-				vm_page_flag_set(m, PG_REFERENCED);
-			}
 			vm_page_unlock_queues();
 		}
 	} 

Modified: head/sys/ia64/ia64/pmap.c
==============================================================================
--- head/sys/ia64/ia64/pmap.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/ia64/ia64/pmap.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -2023,6 +2023,37 @@ pmap_is_prefaultable(pmap_t pmap, vm_off
 }
 
 /*
+ *	pmap_is_referenced:
+ *
+ *	Return whether or not the specified physical page was referenced
+ *	in any physical maps.
+ */
+boolean_t
+pmap_is_referenced(vm_page_t m)
+{
+	struct ia64_lpte *pte;
+	pmap_t oldpmap;
+	pv_entry_t pv;
+	boolean_t rv;
+
+	rv = FALSE;
+	if (m->flags & PG_FICTITIOUS)
+		return (rv);
+	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
+		PMAP_LOCK(pv->pv_pmap);
+		oldpmap = pmap_switch(pv->pv_pmap);
+		pte = pmap_find_vhpt(pv->pv_va);
+		pmap_switch(oldpmap);
+		KASSERT(pte != NULL, ("pte"));
+		rv = pmap_accessed(pte) ? TRUE : FALSE;
+		PMAP_UNLOCK(pv->pv_pmap);
+		if (rv)
+			break;
+	}
+	return (rv);
+}
+
+/*
  *	Clear the modify bits on the specified physical page.
  */
 void
@@ -2197,10 +2228,8 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 			 * Referenced by someone
 			 */
 			vm_page_lock_queues();
-			if (pmap_ts_referenced(m)) {
+			if (pmap_is_referenced(m))
 				val |= MINCORE_REFERENCED_OTHER;
-				vm_page_flag_set(m, PG_REFERENCED);
-			}
 			vm_page_unlock_queues();
 		}
 	} 

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/mips/mips/pmap.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -2626,6 +2626,20 @@ pmap_clear_modify(vm_page_t m)
 }
 
 /*
+ *	pmap_is_referenced:
+ *
+ *	Return whether or not the specified physical page was referenced
+ *	in any physical maps.
+ */
+boolean_t
+pmap_is_referenced(vm_page_t m)
+{
+
+	return ((m->flags & PG_FICTITIOUS) == 0 &&
+	    (m->md.pv_flags & PV_TABLE_REF) != 0);
+}
+
+/*
  *	pmap_clear_reference:
  *
  *	Clear the reference bit on the specified physical page.
@@ -2750,10 +2764,8 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 		 * Referenced by us or someone
 		 */
 		vm_page_lock_queues();
-		if ((m->flags & PG_REFERENCED) || pmap_ts_referenced(m)) {
+		if ((m->flags & PG_REFERENCED) || pmap_is_referenced(m))
 			val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER;
-			vm_page_flag_set(m, PG_REFERENCED);
-		}
 		vm_page_unlock_queues();
 	}
 	return val;

Modified: head/sys/powerpc/aim/mmu_oea.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/powerpc/aim/mmu_oea.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -305,6 +305,7 @@ vm_paddr_t moea_extract(mmu_t, pmap_t, v
 vm_page_t moea_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t);
 void moea_init(mmu_t);
 boolean_t moea_is_modified(mmu_t, vm_page_t);
+boolean_t moea_is_referenced(mmu_t, vm_page_t);
 boolean_t moea_ts_referenced(mmu_t, vm_page_t);
 vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int);
 boolean_t moea_page_exists_quick(mmu_t, pmap_t, vm_page_t);
@@ -344,6 +345,7 @@ static mmu_method_t moea_methods[] = {
 	MMUMETHOD(mmu_extract_and_hold,	moea_extract_and_hold),
 	MMUMETHOD(mmu_init,		moea_init),
 	MMUMETHOD(mmu_is_modified,	moea_is_modified),
+	MMUMETHOD(mmu_is_referenced,	moea_is_referenced),
 	MMUMETHOD(mmu_ts_referenced,	moea_ts_referenced),
 	MMUMETHOD(mmu_map,     		moea_map),
 	MMUMETHOD(mmu_page_exists_quick,moea_page_exists_quick),
@@ -1269,6 +1271,15 @@ moea_init(mmu_t mmu)
 }
 
 boolean_t
+moea_is_referenced(mmu_t mmu, vm_page_t m)
+{
+
+	if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0)
+		return (FALSE);
+	return (moea_query_bit(m, PTE_REF));
+}
+
+boolean_t
 moea_is_modified(mmu_t mmu, vm_page_t m)
 {
 

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/powerpc/aim/mmu_oea64.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -379,6 +379,7 @@ vm_paddr_t moea64_extract(mmu_t, pmap_t,
 vm_page_t moea64_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t);
 void moea64_init(mmu_t);
 boolean_t moea64_is_modified(mmu_t, vm_page_t);
+boolean_t moea64_is_referenced(mmu_t, vm_page_t);
 boolean_t moea64_ts_referenced(mmu_t, vm_page_t);
 vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int);
 boolean_t moea64_page_exists_quick(mmu_t, pmap_t, vm_page_t);
@@ -416,6 +417,7 @@ static mmu_method_t moea64_bridge_method
 	MMUMETHOD(mmu_extract_and_hold,	moea64_extract_and_hold),
 	MMUMETHOD(mmu_init,		moea64_init),
 	MMUMETHOD(mmu_is_modified,	moea64_is_modified),
+	MMUMETHOD(mmu_is_referenced,	moea64_is_referenced),
 	MMUMETHOD(mmu_ts_referenced,	moea64_ts_referenced),
 	MMUMETHOD(mmu_map,     		moea64_map),
 	MMUMETHOD(mmu_page_exists_quick,moea64_page_exists_quick),
@@ -1463,6 +1465,15 @@ moea64_init(mmu_t mmu)
 }
 
 boolean_t
+moea64_is_referenced(mmu_t mmu, vm_page_t m)
+{
+
+	if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0)
+		return (FALSE);
+	return (moea64_query_bit(m, PTE_REF));
+}
+
+boolean_t
 moea64_is_modified(mmu_t mmu, vm_page_t m)
 {
 

Modified: head/sys/powerpc/booke/pmap.c
==============================================================================
--- head/sys/powerpc/booke/pmap.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/powerpc/booke/pmap.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -288,6 +288,7 @@ static vm_page_t	mmu_booke_extract_and_h
 static void		mmu_booke_init(mmu_t);
 static boolean_t	mmu_booke_is_modified(mmu_t, vm_page_t);
 static boolean_t	mmu_booke_is_prefaultable(mmu_t, pmap_t, vm_offset_t);
+static boolean_t	mmu_booke_is_referenced(mmu_t, vm_page_t);
 static boolean_t	mmu_booke_ts_referenced(mmu_t, vm_page_t);
 static vm_offset_t	mmu_booke_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t,
     int);
@@ -342,6 +343,7 @@ static mmu_method_t mmu_booke_methods[] 
 	MMUMETHOD(mmu_init,		mmu_booke_init),
 	MMUMETHOD(mmu_is_modified,	mmu_booke_is_modified),
 	MMUMETHOD(mmu_is_prefaultable,	mmu_booke_is_prefaultable),
+	MMUMETHOD(mmu_is_referenced,	mmu_booke_is_referenced),
 	MMUMETHOD(mmu_ts_referenced,	mmu_booke_ts_referenced),
 	MMUMETHOD(mmu_map,		mmu_booke_map),
 	MMUMETHOD(mmu_mincore,		mmu_booke_mincore),
@@ -2181,6 +2183,33 @@ mmu_booke_is_prefaultable(mmu_t mmu, pma
 }
 
 /*
+ * Return whether or not the specified physical page was referenced
+ * in any physical maps.
+ */
+static boolean_t
+mmu_booke_is_referenced(mmu_t mmu, vm_page_t m)
+{
+	pte_t *pte;
+	pv_entry_t pv;
+	boolean_t rv;
+
+	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	rv = FALSE;
+	if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0)
+		return (rv);
+	TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) {
+		PMAP_LOCK(pv->pv_pmap);
+		if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL &&
+		    PTE_ISVALID(pte))
+			rv = PTE_ISREFERENCED(pte) ? TRUE : FALSE;
+		PMAP_UNLOCK(pv->pv_pmap);
+		if (rv)
+			break;
+	}
+	return (rv);
+}
+
+/*
  * Clear the modify bits on the specified physical page.
  */
 static void

Modified: head/sys/powerpc/powerpc/mmu_if.m
==============================================================================
--- head/sys/powerpc/powerpc/mmu_if.m	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/powerpc/powerpc/mmu_if.m	Sat Apr 24 17:32:52 2010	(r207155)
@@ -346,6 +346,20 @@ METHOD boolean_t is_prefaultable {
 
 
 /**
+ * @brief Return whether or not the specified physical page was referenced
+ * in any physical maps.
+ *
+ * @params _pg		physical page
+ *
+ * @retval boolean	TRUE if page has been referenced
+ */
+METHOD boolean_t is_referenced {
+	mmu_t		_mmu;
+	vm_page_t	_pg;
+};
+
+
+/**
  * @brief Return a count of referenced bits for a page, clearing those bits.
  * Not all referenced bits need to be cleared, but it is necessary that 0
  * only be returned when there are none set.

Modified: head/sys/powerpc/powerpc/pmap_dispatch.c
==============================================================================
--- head/sys/powerpc/powerpc/pmap_dispatch.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/powerpc/powerpc/pmap_dispatch.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -195,6 +195,14 @@ pmap_is_prefaultable(pmap_t pmap, vm_off
 }
 
 boolean_t
+pmap_is_referenced(vm_page_t m)
+{
+
+	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	return (MMU_IS_REFERENCED(mmu_obj, m));
+}
+
+boolean_t
 pmap_ts_referenced(vm_page_t m)
 {
 

Modified: head/sys/sparc64/sparc64/pmap.c
==============================================================================
--- head/sys/sparc64/sparc64/pmap.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/sparc64/sparc64/pmap.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -1917,6 +1917,27 @@ pmap_is_prefaultable(pmap_t pmap, vm_off
 	return (FALSE);
 }
 
+/*
+ * Return whether or not the specified physical page was referenced
+ * in any physical maps.
+ */
+boolean_t
+pmap_is_referenced(vm_page_t m)
+{
+	struct tte *tp;
+
+	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0)
+		return (FALSE);
+	TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) {
+		if ((tp->tte_data & TD_PV) == 0)
+			continue;
+		if ((tp->tte_data & TD_REF) != 0)
+			return (TRUE);
+	}
+	return (FALSE);
+}
+
 void
 pmap_clear_modify(vm_page_t m)
 {

Modified: head/sys/sun4v/sun4v/pmap.c
==============================================================================
--- head/sys/sun4v/sun4v/pmap.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/sun4v/sun4v/pmap.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -1592,6 +1592,17 @@ pmap_is_prefaultable(pmap_t pmap, vm_off
 }
 
 /*
+ * Return whether or not the specified physical page was referenced
+ * in any physical maps.
+ */
+boolean_t
+pmap_is_referenced(vm_page_t m)
+{
+
+	return (tte_get_phys_bit(m, VTD_REF));
+}
+
+/*
  * Extract the physical page address associated with the given kernel virtual
  * address.
  */

Modified: head/sys/vm/pmap.h
==============================================================================
--- head/sys/vm/pmap.h	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/vm/pmap.h	Sat Apr 24 17:32:52 2010	(r207155)
@@ -119,6 +119,7 @@ void		 pmap_growkernel(vm_offset_t);
 void		 pmap_init(void);
 boolean_t	 pmap_is_modified(vm_page_t m);
 boolean_t	 pmap_is_prefaultable(pmap_t pmap, vm_offset_t va);
+boolean_t	 pmap_is_referenced(vm_page_t m);
 boolean_t	 pmap_ts_referenced(vm_page_t m);
 vm_offset_t	 pmap_map(vm_offset_t *, vm_paddr_t, vm_paddr_t, int);
 void		 pmap_object_init_pt(pmap_t pmap, vm_offset_t addr,

Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c	Sat Apr 24 16:27:43 2010	(r207154)
+++ head/sys/vm/vm_mmap.c	Sat Apr 24 17:32:52 2010	(r207155)
@@ -871,10 +871,8 @@ RestartScan:
 						pmap_is_modified(m))
 						mincoreinfo |= MINCORE_MODIFIED_OTHER;
 					if ((m->flags & PG_REFERENCED) ||
-						pmap_ts_referenced(m)) {
-						vm_page_flag_set(m, PG_REFERENCED);
+					    pmap_is_referenced(m))
 						mincoreinfo |= MINCORE_REFERENCED_OTHER;
-					}
 					vm_page_unlock_queues();
 				}
 				VM_OBJECT_UNLOCK(current->object.vm_object);

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 18:13: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 4CFBB106564A;
	Sat, 24 Apr 2010 18:13:13 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C0EC8FC0A;
	Sat, 24 Apr 2010 18:13: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 o3OIDCWs007890;
	Sat, 24 Apr 2010 18:13:12 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OIDCxa007888;
	Sat, 24 Apr 2010 18:13:12 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <201004241813.o3OIDCxa007888@svn.freebsd.org>
From: Robert Noland 
Date: Sat, 24 Apr 2010 18:13: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: r207156 - head/sys/dev/drm
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, 24 Apr 2010 18:13:13 -0000

Author: rnoland
Date: Sat Apr 24 18:13:12 2010
New Revision: 207156
URL: http://svn.freebsd.org/changeset/base/207156

Log:
  remove vm obect tracker that slipped in from prior work.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/drm/drmP.h

Modified: head/sys/dev/drm/drmP.h
==============================================================================
--- head/sys/dev/drm/drmP.h	Sat Apr 24 17:32:52 2010	(r207155)
+++ head/sys/dev/drm/drmP.h	Sat Apr 24 18:13:12 2010	(r207156)
@@ -481,7 +481,6 @@ typedef struct drm_sg_mem {
 	vm_offset_t vaddr;
 	vm_paddr_t *busaddr;
 	vm_pindex_t pages;
-	vm_object_t obj;
 } drm_sg_mem_t;
 
 #define DRM_MAP_HANDLE_BITS	(sizeof(void *) == 4 ? 4 : 24)

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 19:51: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 5A763106564A;
	Sat, 24 Apr 2010 19:51:54 +0000 (UTC)
	(envelope-from a_best01@uni-muenster.de)
Received: from zivm-relay2.uni-muenster.de (ZIVM-RELAY2.UNI-MUENSTER.DE
	[128.176.192.13])
	by mx1.freebsd.org (Postfix) with ESMTP id B2D1F8FC14;
	Sat, 24 Apr 2010 19:51:53 +0000 (UTC)
X-IronPort-AV: E=Sophos;i="4.52,267,1270418400"; d="scan'208";a="242933116"
Received: from zivmaildisp1.uni-muenster.de (HELO
	ZIVMAILUSER03.UNI-MUENSTER.DE) ([128.176.188.85])
	by zivm-relay2.uni-muenster.de with ESMTP; 24 Apr 2010 21:51:52 +0200
Received: by ZIVMAILUSER03.UNI-MUENSTER.DE (Postfix, from userid 149459)
	id 8F6981B0758; Sat, 24 Apr 2010 21:51:52 +0200 (CEST)
Date: Sat, 24 Apr 2010 21:51:51 +0200 (CEST)
From: Alexander Best 
Sender: 
Organization: Westfaelische Wilhelms-Universitaet Muenster
To: Jeff Roberson 
Message-ID: 
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
Subject: Re: svn commit: r207141 - in head: lib/libufs sbin/dumpfs
 sbin/fsck_ffs sbin/fsdb sbin/tunefs sys/kern sys/sys sys/ufs/ffs
 sys/ufs/ufs usr.sbin/makefs/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, 24 Apr 2010 19:51:54 -0000

great news to finally have SUJ in HEAD. will you also be adding a -j switch to
newfs(8)? a SUJ entry in UPDATING will probably appear in the next few days i
believe?

-- 
Alexander Best

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 20:10: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 234C4106564A;
	Sat, 24 Apr 2010 20:10:39 +0000 (UTC)
	(envelope-from a_best01@uni-muenster.de)
Received: from zivm-relay3.uni-muenster.de (ZIVM-RELAY3.UNI-MUENSTER.DE
	[128.176.192.19])
	by mx1.freebsd.org (Postfix) with ESMTP id 4BBB78FC12;
	Sat, 24 Apr 2010 20:10:37 +0000 (UTC)
X-IronPort-AV: E=Sophos;i="4.52,267,1270418400"; 
	d="txt'?scan'208";a="32172949"
Received: from zivmaildisp1.uni-muenster.de (HELO
	ZIVMAILUSER05.UNI-MUENSTER.DE) ([128.176.188.85])
	by zivm-relay3.uni-muenster.de with ESMTP; 24 Apr 2010 22:10:25 +0200
Received: by ZIVMAILUSER05.UNI-MUENSTER.DE (Postfix, from userid 149459)
	id 5C9D81B07E7; Sat, 24 Apr 2010 22:10:25 +0200 (CEST)
Date: Sat, 24 Apr 2010 22:10:18 +0200 (CEST)
From: Alexander Best 
Sender: 
Organization: Westfaelische Wilhelms-Universitaet Muenster
To: Luigi Rizzo 
Message-ID: 
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary=+permail-20100424201018f7e55a9d00007b30-a_best01+
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r206497 - in head: sbin/geom/class
 sbin/geom/class/sched sys/geom/sched sys/modules/geom
 sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched
 sys/modules/geom/geom_sched/gsc...
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, 24 Apr 2010 20:10:39 -0000

  This is a MIME encoded multipart message.

--+permail-20100424201018f7e55a9d00007b30-a_best01+
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

tiny patch to fix a typo in the gsched(8) manual. ;)

-- 
Alexander Best

--+permail-20100424201018f7e55a9d00007b30-a_best01+
Content-Type: text/plain
Content-Transfer-Encoding: Base64
Content-Disposition: attachment; filename="gsched.8.patch.txt"

SW5kZXg6IHNiaW4vZ2VvbS9jbGFzcy9zY2hlZC9nc2NoZWQuOAo9PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzYmlu
L2dlb20vY2xhc3Mvc2NoZWQvZ3NjaGVkLjgJKHJldmlzaW9uIDIwNzE1NCkKKysrIHNiaW4vZ2Vv
bS9jbGFzcy9zY2hlZC9nc2NoZWQuOAkod29ya2luZyBjb3B5KQpAQCAtOTMsOCArOTMsOCBAQAog
b24gYW4gYWxyZWFkeSBleGlzdGluZyBwcm92aWRlci4KIC5QcAogQSBzdWJzZXF1ZW50ICdkZXN0
cm95JyB3aWxsIHJlbW92ZSB0aGUgbmV3bHkgY3JlYXRlZCBnZW9tIGFuZAotaG9vayB0aGUgcHJv
dmlkZXIgYmFjayB0byB0aGUgb3JpZ2luYWwgZ2VvbS4KLS5BciBhbGdvcml0aG0KK2hvb2sgdGhl
IHByb3ZpZGVyIGJhY2sgdG8gdGhlIG9yaWdpbmFsIGdlb20KKy5BciBhbGdvcml0aG0gLgogLkl0
IENtIGNvbmZpZ3VyZQogQ29uZmlndXJlIGV4aXN0aW5nIHNjaGVkdWxpbmcgcHJvdmlkZXIuICBJ
dCBzdXBwb3J0cyB0aGUgc2FtZSBvcHRpb25zCiBhcyB0aGUgCg==

--+permail-20100424201018f7e55a9d00007b30-a_best01+--

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 20:18: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 7FE361065673
	for ; Sat, 24 Apr 2010 20:18:36 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6])
	by mx1.freebsd.org (Postfix) with ESMTP id C53678FC1F
	for ; Sat, 24 Apr 2010 20:18:35 +0000 (UTC)
Received: (qmail 15779 invoked by uid 399); 24 Apr 2010 20:18:33 -0000
Received: from localhost (HELO foreign.dougb.net)
	(dougb@dougbarton.us@127.0.0.1)
	by localhost with ESMTPAM; 24 Apr 2010 20:18:33 -0000
X-Originating-IP: 127.0.0.1
X-Sender: dougb@dougbarton.us
Message-ID: <4BD35218.8000000@FreeBSD.org>
Date: Sat, 24 Apr 2010 13:18:32 -0700
From: Doug Barton 
Organization: http://SupersetSolutions.com/
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
	rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4
MIME-Version: 1.0
To: Jilles Tjoelker 
References: <201004241353.o3ODrC0L049712@svn.freebsd.org>
In-Reply-To: <201004241353.o3ODrC0L049712@svn.freebsd.org>
X-Enigmail-Version: 1.0.1
OpenPGP: id=1A1ABC84
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ighighi 
Subject: Re: svn commit: r207153 - head/usr.bin/stat
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, 24 Apr 2010 20:18:36 -0000

On 04/24/10 06:53, Jilles Tjoelker wrote:
> Author: jilles
> Date: Sat Apr 24 13:53:12 2010
> New Revision: 207153
> URL: http://svn.freebsd.org/changeset/base/207153
> 
> Log:
>   stat: Allow -f %Sf to display the file flags symbolically.
>   
>   I have changed the patch slightly to show '-' if there are no flags just
>   like ls -ldo does.
>   
>   PR:		124349
>   Submitted by:	Ighighi
>   MFC after:	1 week

FYI, I originally imported the version of stat(1) we have in our tree
from NetBSD, although admittedly I haven't kept up with the updates
they've made to it. You (either jilles or the PR submitter) might want
to communicate with the NetBSD folks about this change, and if you're
really interested compare our version to theirs and include any other
interesting updates from their tree.
http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/stat/

While you're certainly under no obligation to do any of this, please let
me know your intentions so that if you're not interested I can add it to
my TODO list. :)


Regards,

Doug

-- 

	... 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  Sat Apr 24 21:17: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 53F81106566C;
	Sat, 24 Apr 2010 21:17:08 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 434228FC14;
	Sat, 24 Apr 2010 21:17: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 o3OLH7Li048861;
	Sat, 24 Apr 2010 21:17:07 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OLH7Wd048859;
	Sat, 24 Apr 2010 21:17:07 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201004242117.o3OLH7Wd048859@svn.freebsd.org>
From: Kip Macy 
Date: Sat, 24 Apr 2010 21: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: r207161 - head/sys/amd64/amd64
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, 24 Apr 2010 21:17:08 -0000

Author: kmacy
Date: Sat Apr 24 21:17:07 2010
New Revision: 207161
URL: http://svn.freebsd.org/changeset/base/207161

Log:
  apply style(9) changes applied to head_page_lock_2
  
  requested by: kib@

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Sat Apr 24 21:05:08 2010	(r207160)
+++ head/sys/amd64/amd64/pmap.c	Sat Apr 24 21:17:07 2010	(r207161)
@@ -284,7 +284,7 @@ pmap_kmem_choose(vm_offset_t addr)
 	vm_offset_t newaddr = addr;
 
 	newaddr = (addr + (NBPDR - 1)) & ~(NBPDR - 1);
-	return newaddr;
+	return (newaddr);
 }
 
 /********************/
@@ -295,7 +295,7 @@ pmap_kmem_choose(vm_offset_t addr)
 static __inline vm_pindex_t
 pmap_pde_pindex(vm_offset_t va)
 {
-	return va >> PDRSHIFT;
+	return (va >> PDRSHIFT);
 }
 
 
@@ -354,7 +354,7 @@ pmap_pdpe(pmap_t pmap, vm_offset_t va)
 
 	pml4e = pmap_pml4e(pmap, va);
 	if ((*pml4e & PG_V) == 0)
-		return NULL;
+		return (NULL);
 	return (pmap_pml4e_to_pdpe(pml4e, va));
 }
 
@@ -376,7 +376,7 @@ pmap_pde(pmap_t pmap, vm_offset_t va)
 
 	pdpe = pmap_pdpe(pmap, va);
 	if (pdpe == NULL || (*pdpe & PG_V) == 0)
-		 return NULL;
+		return (NULL);
 	return (pmap_pdpe_to_pde(pdpe, va));
 }
 
@@ -398,7 +398,7 @@ pmap_pte(pmap_t pmap, vm_offset_t va)
 
 	pde = pmap_pde(pmap, va);
 	if (pde == NULL || (*pde & PG_V) == 0)
-		return NULL;
+		return (NULL);
 	if ((*pde & PG_PS) != 0)	/* compat with i386 pmap_pte() */
 		return ((pt_entry_t *)pde);
 	return (pmap_pde_to_pte(pde, va));
@@ -1237,7 +1237,7 @@ pmap_kextract(vm_offset_t va)
 			pa = (pa & PG_FRAME) | (va & PAGE_MASK);
 		}
 	}
-	return pa;
+	return (pa);
 }
 
 /***************************************************
@@ -1467,9 +1467,9 @@ pmap_unwire_pte_hold(pmap_t pmap, vm_off
 
 	--m->wire_count;
 	if (m->wire_count == 0)
-		return _pmap_unwire_pte_hold(pmap, va, m, free);
+		return (_pmap_unwire_pte_hold(pmap, va, m, free));
 	else
-		return 0;
+		return (0);
 }
 
 static int 
@@ -1525,7 +1525,7 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of
 	 */
 	pmap_add_delayed_free_list(m, free, TRUE);
 	
-	return 1;
+	return (1);
 }
 
 /*
@@ -1538,10 +1538,10 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v
 	vm_page_t mpte;
 
 	if (va >= VM_MAXUSER_ADDRESS)
-		return 0;
+		return (0);
 	KASSERT(ptepde != 0, ("pmap_unuse_pt: ptepde != 0"));
 	mpte = PHYS_TO_VM_PAGE(ptepde & PG_FRAME);
-	return pmap_unwire_pte_hold(pmap, va, mpte, free);
+	return (pmap_unwire_pte_hold(pmap, va, mpte, free));
 }
 
 void
@@ -1732,7 +1732,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t 
 
 	pmap->pm_stats.resident_count++;
 
-	return m;
+	return (m);
 }
 
 static vm_page_t
@@ -3510,7 +3510,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_
 		pte_store(pte, pa | PG_V | PG_U);
 	else
 		pte_store(pte, pa | PG_V | PG_U | PG_MANAGED);
-	return mpte;
+	return (mpte);
 }
 
 /*
@@ -3887,12 +3887,12 @@ pmap_page_exists_quick(pmap_t pmap, vm_p
 	int loops = 0;
 
 	if (m->flags & PG_FICTITIOUS)
-		return FALSE;
+		return (FALSE);
 
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
 	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
 		if (PV_PMAP(pv) == pmap) {
-			return TRUE;
+			return (TRUE);
 		}
 		loops++;
 		if (loops >= 16)
@@ -4908,7 +4908,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 	if (pte != 0) {
 		val |= MINCORE_INCORE;
 		if ((pte & PG_MANAGED) == 0)
-			return val;
+			return (val);
 
 		m = PHYS_TO_VM_PAGE(pa);
 
@@ -4942,7 +4942,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 			vm_page_unlock_queues();
 		}
 	} 
-	return val;
+	return (val);
 }
 
 void

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 21:36: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 30671106566B;
	Sat, 24 Apr 2010 21:36:53 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2009A8FC0A;
	Sat, 24 Apr 2010 21:36: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 o3OLarsg053293;
	Sat, 24 Apr 2010 21:36:53 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OLarpq053291;
	Sat, 24 Apr 2010 21:36:53 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201004242136.o3OLarpq053291@svn.freebsd.org>
From: Kip Macy 
Date: Sat, 24 Apr 2010 21:36:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207163 - head/sys/i386/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: Sat, 24 Apr 2010 21:36:53 -0000

Author: kmacy
Date: Sat Apr 24 21:36:52 2010
New Revision: 207163
URL: http://svn.freebsd.org/changeset/base/207163

Log:
  - fix style issues on i386 as well
  
  requested by: alc@

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Sat Apr 24 21:20:43 2010	(r207162)
+++ head/sys/i386/i386/pmap.c	Sat Apr 24 21:36:52 2010	(r207163)
@@ -1607,9 +1607,9 @@ pmap_unwire_pte_hold(pmap_t pmap, vm_pag
 
 	--m->wire_count;
 	if (m->wire_count == 0)
-		return _pmap_unwire_pte_hold(pmap, m, free);
+		return (_pmap_unwire_pte_hold(pmap, m, free));
 	else
-		return 0;
+		return (0);
 }
 
 static int 
@@ -1643,7 +1643,7 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_pa
 	 */
 	pmap_add_delayed_free_list(m, free, TRUE);
 
-	return 1;
+	return (1);
 }
 
 /*
@@ -1657,10 +1657,10 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v
 	vm_page_t mpte;
 
 	if (va >= VM_MAXUSER_ADDRESS)
-		return 0;
+		return (0);
 	ptepde = *pmap_pde(pmap, va);
 	mpte = PHYS_TO_VM_PAGE(ptepde & PG_FRAME);
-	return pmap_unwire_pte_hold(pmap, mpte, free);
+	return (pmap_unwire_pte_hold(pmap, mpte, free));
 }
 
 void
@@ -1811,7 +1811,7 @@ _pmap_allocpte(pmap_t pmap, unsigned pte
 	pmap->pm_pdir[ptepindex] =
 		(pd_entry_t) (ptepa | PG_U | PG_RW | PG_V | PG_A | PG_M);
 
-	return m;
+	return (m);
 }
 
 static vm_page_t
@@ -2009,7 +2009,7 @@ kvm_size(SYSCTL_HANDLER_ARGS)
 {
 	unsigned long ksize = VM_MAX_KERNEL_ADDRESS - KERNBASE;
 
-	return sysctl_handle_long(oidp, &ksize, 0, req);
+	return (sysctl_handle_long(oidp, &ksize, 0, req));
 }
 SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG|CTLFLAG_RD, 
     0, 0, kvm_size, "IU", "Size of KVM");
@@ -2019,7 +2019,7 @@ kvm_free(SYSCTL_HANDLER_ARGS)
 {
 	unsigned long kfree = VM_MAX_KERNEL_ADDRESS - kernel_vm_end;
 
-	return sysctl_handle_long(oidp, &kfree, 0, req);
+	return (sysctl_handle_long(oidp, &kfree, 0, req));
 }
 SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, 
     0, 0, kvm_free, "IU", "Amount of KVM free");
@@ -2083,7 +2083,7 @@ static __inline struct pv_chunk *
 pv_to_chunk(pv_entry_t pv)
 {
 
-	return (struct pv_chunk *)((uintptr_t)pv & ~(uintptr_t)PAGE_MASK);
+	return ((struct pv_chunk *)((uintptr_t)pv & ~(uintptr_t)PAGE_MASK));
 }
 
 #define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap)
@@ -3662,7 +3662,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_
 		pte_store(pte, pa | PG_V | PG_U);
 	else
 		pte_store(pte, pa | PG_V | PG_U | PG_MANAGED);
-	return mpte;
+	return (mpte);
 }
 
 /*
@@ -4059,12 +4059,12 @@ pmap_page_exists_quick(pmap_t pmap, vm_p
 	int loops = 0;
 
 	if (m->flags & PG_FICTITIOUS)
-		return FALSE;
+		return (FALSE);
 
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
 	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
 		if (PV_PMAP(pv) == pmap) {
-			return TRUE;
+			return (TRUE);
 		}
 		loops++;
 		if (loops >= 16)
@@ -4978,7 +4978,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 	if (pte != 0) {
 		val |= MINCORE_INCORE;
 		if ((pte & PG_MANAGED) == 0)
-			return val;
+			return (val);
 
 		m = PHYS_TO_VM_PAGE(pa);
 
@@ -5012,7 +5012,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 			vm_page_unlock_queues();
 		}
 	} 
-	return val;
+	return (val);
 }
 
 void
@@ -5107,7 +5107,7 @@ pmap_pid_dump(int pid)
 								printf("\n");
 							}
 							sx_sunlock(&allproc_lock);
-							return npte;
+							return (npte);
 						}
 						pte = pmap_pte(pmap, va);
 						if (pte && pmap_pte_v(pte)) {
@@ -5132,7 +5132,7 @@ pmap_pid_dump(int pid)
 		}
 	}
 	sx_sunlock(&allproc_lock);
-	return npte;
+	return (npte);
 }
 #endif
 

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 22:16: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 183E8106564A;
	Sat, 24 Apr 2010 22:16:02 +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 0712C8FC1B;
	Sat, 24 Apr 2010 22:16: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 o3OMG1ko062060;
	Sat, 24 Apr 2010 22:16:01 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OMG1Ue062059;
	Sat, 24 Apr 2010 22:16:01 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004242216.o3OMG1Ue062059@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 24 Apr 2010 22:16: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: r207166 - head/share/man/man1
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, 24 Apr 2010 22:16:02 -0000

Author: jilles
Date: Sat Apr 24 22:16:01 2010
New Revision: 207166
URL: http://svn.freebsd.org/changeset/base/207166

Log:
  builtin(1): Mention [ sh builtin.
  
  MFC after:	1 week

Modified:
  head/share/man/man1/builtin.1

Modified: head/share/man/man1/builtin.1
==============================================================================
--- head/share/man/man1/builtin.1	Sat Apr 24 22:09:13 2010	(r207165)
+++ head/share/man/man1/builtin.1	Sat Apr 24 22:16:01 2010	(r207166)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 14, 2006
+.Dd April 25, 2010
 .Dt BUILTIN 1
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@
 .Nm \&. ,
 .Nm \&: ,
 .Nm @ ,
+.Nm \&[ ,
 .Nm { ,
 .Nm } ,
 .Nm alias ,
@@ -200,6 +201,7 @@ but are implemented as scripts using a b
 .It Ic . Ta \&No Ta \&No Ta Yes
 .It Ic : Ta \&No Ta Yes Ta Yes
 .It Ic @ Ta \&No Ta Yes Ta Yes
+.It Ic \&[ Ta Yes Ta \&No Ta Yes
 .It Ic { Ta \&No Ta \&No Ta Yes
 .It Ic } Ta \&No Ta \&No Ta Yes
 .It Ic alias Ta No** Ta Yes Ta Yes

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 22:24: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 383061065670;
	Sat, 24 Apr 2010 22:24:27 +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 27EA48FC0C;
	Sat, 24 Apr 2010 22:24:27 +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 o3OMOR1k063986;
	Sat, 24 Apr 2010 22:24:27 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OMOR4g063984;
	Sat, 24 Apr 2010 22:24:27 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004242224.o3OMOR4g063984@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 24 Apr 2010 22:24:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207168 - head/share/man/man1
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, 24 Apr 2010 22:24:27 -0000

Author: jilles
Date: Sat Apr 24 22:24:26 2010
New Revision: 207168
URL: http://svn.freebsd.org/changeset/base/207168

Log:
  builtin(1): Add missing escaping for !, . and : in the table.
  
  This caused these commands to look differently (not bold) from the other
  commands in the table (bold).
  
  MFC after:	1 week

Modified:
  head/share/man/man1/builtin.1

Modified: head/share/man/man1/builtin.1
==============================================================================
--- head/share/man/man1/builtin.1	Sat Apr 24 22:23:49 2010	(r207167)
+++ head/share/man/man1/builtin.1	Sat Apr 24 22:24:26 2010	(r207168)
@@ -196,10 +196,10 @@ but are implemented as scripts using a b
 .It Xo
 .Em "Command	External" Ta Xr csh 1 Ta Xr sh 1
 .Xc
-.It Ic ! Ta \&No Ta \&No Ta Yes
+.It Ic \&! Ta \&No Ta \&No Ta Yes
 .It Ic % Ta \&No Ta Yes Ta \&No
-.It Ic . Ta \&No Ta \&No Ta Yes
-.It Ic : Ta \&No Ta Yes Ta Yes
+.It Ic \&. Ta \&No Ta \&No Ta Yes
+.It Ic \&: Ta \&No Ta Yes Ta Yes
 .It Ic @ Ta \&No Ta Yes Ta Yes
 .It Ic \&[ Ta Yes Ta \&No Ta Yes
 .It Ic { Ta \&No Ta \&No Ta Yes

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 22:52: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 3ABA11065676;
	Sat, 24 Apr 2010 22:52:15 +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 28B8B8FC15;
	Sat, 24 Apr 2010 22:52: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 o3OMqEGs070183;
	Sat, 24 Apr 2010 22:52:14 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OMqEd3070173;
	Sat, 24 Apr 2010 22:52:14 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004242252.o3OMqEd3070173@svn.freebsd.org>
From: Rick Macklem 
Date: Sat, 24 Apr 2010 22:52: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: r207170 - in head/sys/fs: 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: Sat, 24 Apr 2010 22:52:15 -0000

Author: rmacklem
Date: Sat Apr 24 22:52:14 2010
New Revision: 207170
URL: http://svn.freebsd.org/changeset/base/207170

Log:
  An NFSv4 server will reply NFSERR_GRACE for non-recovery RPCs
  during the grace period after startup. This grace period must
  be at least the lease duration, which is typically 1-2 minutes.
  It seems prudent for the experimental NFS client to wait a few
  seconds before retrying such an RPC, so that the server isn't
  flooded with non-recovery RPCs during recovery. This patch adds
  an argument to nfs_catnap() to implement a 5 second delay
  for this case.
  
  MFC after:	1 week

Modified:
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/fs/nfs/nfs_commonport.c
  head/sys/fs/nfs/nfs_var.h
  head/sys/fs/nfs/nfsport.h
  head/sys/fs/nfsclient/nfs_clrpcops.c
  head/sys/fs/nfsclient/nfs_clstate.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/fs/nfsclient/nfs_clvnops.c
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonkrpc.c	Sat Apr 24 22:31:51 2010	(r207169)
+++ head/sys/fs/nfs/nfs_commonkrpc.c	Sat Apr 24 22:52:14 2010	(r207170)
@@ -650,7 +650,7 @@ tryagain:
 					trylater_delay = NFS_TRYLATERDEL;
 				waituntil = NFSD_MONOSEC + trylater_delay;
 				while (NFSD_MONOSEC < waituntil)
-					(void) nfs_catnap(PZERO, "nfstry");
+					(void) nfs_catnap(PZERO, 0, "nfstry");
 				trylater_delay *= 2;
 				goto tryagain;
 			}

Modified: head/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonport.c	Sat Apr 24 22:31:51 2010	(r207169)
+++ head/sys/fs/nfs/nfs_commonport.c	Sat Apr 24 22:52:14 2010	(r207170)
@@ -345,17 +345,21 @@ newnfs_timer(void *arg)
 
 
 /*
- * sleep for a short period of time.
+ * Sleep for a short period of time unless errval == NFSERR_GRACE, where
+ * the sleep should be for 5 seconds.
  * Since lbolt doesn't exist in FreeBSD-CURRENT, just use a timeout on
  * an event that never gets a wakeup. Only return EINTR or 0.
  */
 int
-nfs_catnap(int prio, const char *wmesg)
+nfs_catnap(int prio, int errval, const char *wmesg)
 {
 	static int non_event;
 	int ret;
 
-	ret = tsleep(&non_event, prio, wmesg, 1);
+	if (errval == NFSERR_GRACE)
+		ret = tsleep(&non_event, prio, wmesg, 5 * hz);
+	else
+		ret = tsleep(&non_event, prio, wmesg, 1);
 	if (ret != EINTR)
 		ret = 0;
 	return (ret);

Modified: head/sys/fs/nfs/nfs_var.h
==============================================================================
--- head/sys/fs/nfs/nfs_var.h	Sat Apr 24 22:31:51 2010	(r207169)
+++ head/sys/fs/nfs/nfs_var.h	Sat Apr 24 22:52:14 2010	(r207170)
@@ -322,7 +322,7 @@ int nfsvno_v4rootexport(struct nfsrv_des
 void newnfs_portinit(void);
 struct ucred *newnfs_getcred(void);
 void newnfs_setroot(struct ucred *);
-int nfs_catnap(int, const char *);
+int nfs_catnap(int, int, const char *);
 struct nfsreferral *nfsv4root_getreferral(vnode_t, vnode_t, u_int32_t);
 int nfsrv_atroot(vnode_t, long *);
 void newnfs_timer(void *);

Modified: head/sys/fs/nfs/nfsport.h
==============================================================================
--- head/sys/fs/nfs/nfsport.h	Sat Apr 24 22:31:51 2010	(r207169)
+++ head/sys/fs/nfs/nfsport.h	Sat Apr 24 22:52:14 2010	(r207170)
@@ -143,21 +143,21 @@
 #define	NFSMGET(m)	do { 					\
 		MGET((m), M_TRYWAIT, MT_DATA); 			\
 		while ((m) == NULL ) { 				\
-			(void) nfs_catnap(PZERO, "nfsmget");	\
+			(void) nfs_catnap(PZERO, 0, "nfsmget");	\
 			MGET((m), M_TRYWAIT, MT_DATA); 		\
 		} 						\
 	} while (0)
 #define	NFSMGETHDR(m)	do { 					\
 		MGETHDR((m), M_TRYWAIT, MT_DATA);		\
 		while ((m) == NULL ) { 				\
-			(void) nfs_catnap(PZERO, "nfsmget");	\
+			(void) nfs_catnap(PZERO, 0, "nfsmget");	\
 			MGETHDR((m), M_TRYWAIT, MT_DATA); 	\
 		} 						\
 	} while (0)
 #define	NFSMCLGET(m, w)	do { 					\
 		MGET((m), M_TRYWAIT, MT_DATA); 			\
 		while ((m) == NULL ) { 				\
-			(void) nfs_catnap(PZERO, "nfsmget");	\
+			(void) nfs_catnap(PZERO, 0, "nfsmget");	\
 			MGET((m), M_TRYWAIT, MT_DATA); 		\
 		} 						\
 		MCLGET((m), (w));				\
@@ -165,7 +165,7 @@
 #define	NFSMCLGETHDR(m, w) do { 				\
 		MGETHDR((m), M_TRYWAIT, MT_DATA);		\
 		while ((m) == NULL ) { 				\
-			(void) nfs_catnap(PZERO, "nfsmget");	\
+			(void) nfs_catnap(PZERO, 0, "nfsmget");	\
 			MGETHDR((m), M_TRYWAIT, MT_DATA); 	\
 		} 						\
 	} while (0)

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clrpcops.c	Sat Apr 24 22:31:51 2010	(r207169)
+++ head/sys/fs/nfsclient/nfs_clrpcops.c	Sat Apr 24 22:52:14 2010	(r207170)
@@ -298,7 +298,7 @@ else printf(" fhl=0\n");
 	    nfscl_openrelease(op, error, newone);
 	    if (error == NFSERR_GRACE || error == NFSERR_STALECLIENTID ||
 		error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY) {
-		(void) nfs_catnap(PZERO, "nfs_open");
+		(void) nfs_catnap(PZERO, error, "nfs_open");
 	    } else if ((error == NFSERR_EXPIRED || error == NFSERR_BADSTATEID)
 		&& clidrev != 0) {
 		expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p);
@@ -460,7 +460,7 @@ nfsrpc_openrpc(struct nfsmount *nmp, vno
 			ret = nfsrpc_openconfirm(vp, newfhp, newfhlen, op,
 			    cred, p);
 			if (ret == NFSERR_DELAY)
-			    (void) nfs_catnap(PZERO, "nfs_open");
+			    (void) nfs_catnap(PZERO, ret, "nfs_open");
 		    } while (ret == NFSERR_DELAY);
 		    error = ret;
 		}
@@ -484,7 +484,7 @@ nfsrpc_openrpc(struct nfsmount *nmp, vno
 			    newfhlen, mode, op, name, namelen, &ndp, 0, 0x0,
 			    cred, p, syscred, 1);
 			if (ret == NFSERR_DELAY)
-			    (void) nfs_catnap(PZERO, "nfs_open2");
+			    (void) nfs_catnap(PZERO, ret, "nfs_open2");
 		    } while (ret == NFSERR_DELAY);
 		    if (ret) {
 			if (ndp != NULL)
@@ -624,6 +624,7 @@ nfsrpc_doclose(struct nfsmount *nmp, str
 					    nd->nd_repstat == NFSERR_DELAY) &&
 					    error == 0)
 						(void) nfs_catnap(PZERO,
+						    (int)nd->nd_repstat,
 						    "nfs_close");
 				} while ((nd->nd_repstat == NFSERR_GRACE ||
 				    nd->nd_repstat == NFSERR_DELAY) &&
@@ -645,7 +646,7 @@ nfsrpc_doclose(struct nfsmount *nmp, str
 	do {
 		error = nfscl_tryclose(op, tcred, nmp, p);
 		if (error == NFSERR_GRACE)
-			(void) nfs_catnap(PZERO, "nfs_close");
+			(void) nfs_catnap(PZERO, error, "nfs_close");
 	} while (error == NFSERR_GRACE);
 	NFSLOCKCLSTATE();
 	nfscl_lockunlock(&op->nfso_own->nfsow_rwlock);
@@ -999,7 +1000,7 @@ nfsrpc_setattr(vnode_t vp, struct vattr 
 		if (error == NFSERR_GRACE || error == NFSERR_STALESTATEID ||
 		    error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY ||
 		    error == NFSERR_OLDSTATEID) {
-			(void) nfs_catnap(PZERO, "nfs_setattr");
+			(void) nfs_catnap(PZERO, error, "nfs_setattr");
 		} else if ((error == NFSERR_EXPIRED ||
 		    error == NFSERR_BADSTATEID) && clidrev != 0) {
 			expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p);
@@ -1244,7 +1245,7 @@ nfsrpc_read(vnode_t vp, struct uio *uiop
 		if (error == NFSERR_GRACE || error == NFSERR_STALESTATEID ||
 		    error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY ||
 		    error == NFSERR_OLDSTATEID) {
-			(void) nfs_catnap(PZERO, "nfs_read");
+			(void) nfs_catnap(PZERO, error, "nfs_read");
 		} else if ((error == NFSERR_EXPIRED ||
 		    error == NFSERR_BADSTATEID) && clidrev != 0) {
 			expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p);
@@ -1409,7 +1410,7 @@ nfscl_dumpstate(nmp, 1, 1, 0, 0);
 		if (error == NFSERR_GRACE || error == NFSERR_STALESTATEID ||
 		    error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY ||
 		    error == NFSERR_OLDSTATEID) {
-			(void) nfs_catnap(PZERO, "nfs_write");
+			(void) nfs_catnap(PZERO, error, "nfs_write");
 		} else if ((error == NFSERR_EXPIRED ||
 		    error == NFSERR_BADSTATEID) && clidrev != 0) {
 			expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p);
@@ -1736,7 +1737,7 @@ nfsrpc_create(vnode_t dvp, char *name, i
 		nfscl_ownerrelease(owp, error, newone, unlocked);
 		if (error == NFSERR_GRACE || error == NFSERR_STALECLIENTID ||
 		    error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY) {
-			(void) nfs_catnap(PZERO, "nfs_open");
+			(void) nfs_catnap(PZERO, error, "nfs_open");
 		} else if ((error == NFSERR_EXPIRED ||
 		    error == NFSERR_BADSTATEID) && clidrev != 0) {
 			expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p);
@@ -1969,7 +1970,7 @@ nfsrpc_createv4(vnode_t dvp, char *name,
 			ret = nfsrpc_openconfirm(dvp, nfhp->nfh_fh,
 			    nfhp->nfh_len, op, cred, p);
 			if (ret == NFSERR_DELAY)
-			    (void) nfs_catnap(PZERO, "nfs_create");
+			    (void) nfs_catnap(PZERO, ret, "nfs_create");
 		    } while (ret == NFSERR_DELAY);
 		    error = ret;
 		}
@@ -1991,7 +1992,7 @@ nfsrpc_createv4(vnode_t dvp, char *name,
 			    (NFSV4OPEN_ACCESSWRITE | NFSV4OPEN_ACCESSREAD), op,
 			    name, namelen, &dp, 0, 0x0, cred, p, 0, 1);
 			if (ret == NFSERR_DELAY)
-			    (void) nfs_catnap(PZERO, "nfs_crt2");
+			    (void) nfs_catnap(PZERO, ret, "nfs_crt2");
 		    } while (ret == NFSERR_DELAY);
 		    if (ret) {
 			if (dp != NULL)
@@ -3533,7 +3534,8 @@ nfsrpc_advlock(vnode_t vp, off_t size, i
 			    if ((nd->nd_repstat == NFSERR_GRACE ||
 				 nd->nd_repstat == NFSERR_DELAY) &&
 				error == 0)
-				(void) nfs_catnap(PZERO, "nfs_advlock");
+				(void) nfs_catnap(PZERO, (int)nd->nd_repstat,
+				    "nfs_advlock");
 			} while ((nd->nd_repstat == NFSERR_GRACE ||
 			    nd->nd_repstat == NFSERR_DELAY) && error == 0);
 		    }
@@ -3570,7 +3572,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, i
 	    if (error == NFSERR_GRACE || error == NFSERR_STALESTATEID ||
 		error == NFSERR_STALEDONTRECOVER ||
 		error == NFSERR_STALECLIENTID || error == NFSERR_DELAY) {
-		(void) nfs_catnap(PZERO, "nfs_advlock");
+		(void) nfs_catnap(PZERO, error, "nfs_advlock");
 	    } else if ((error == NFSERR_EXPIRED || error == NFSERR_BADSTATEID)
 		&& clidrev != 0) {
 		expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p);

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Sat Apr 24 22:31:51 2010	(r207169)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Sat Apr 24 22:52:14 2010	(r207170)
@@ -784,7 +784,7 @@ nfscl_getcl(vnode_t vp, struct ucred *cr
 			if (error == NFSERR_STALECLIENTID ||
 			    error == NFSERR_STALEDONTRECOVER ||
 			    error == NFSERR_CLIDINUSE) {
-				(void) nfs_catnap(PZERO, "nfs_setcl");
+				(void) nfs_catnap(PZERO, error, "nfs_setcl");
 			}
 		} while (((error == NFSERR_STALECLIENTID ||
 		     error == NFSERR_STALEDONTRECOVER) && --trystalecnt > 0) ||
@@ -2046,7 +2046,7 @@ nfscl_recover(struct nfsclclient *clp, s
 			newnfs_copycred(&op->nfso_cred, tcred);
 			error = nfscl_tryclose(op, tcred, nmp, p);
 			if (error == NFSERR_GRACE)
-				(void) nfs_catnap(PZERO, "nfsexcls");
+				(void) nfs_catnap(PZERO, error, "nfsexcls");
 		} while (error == NFSERR_GRACE);
 		LIST_REMOVE(op, nfso_list);
 		FREE((caddr_t)op, M_NFSCLOPEN);
@@ -2059,7 +2059,7 @@ nfscl_recover(struct nfsclclient *clp, s
 			newnfs_copycred(&dp->nfsdl_cred, tcred);
 			error = nfscl_trydelegreturn(dp, tcred, nmp, p);
 			if (error == NFSERR_GRACE)
-				(void) nfs_catnap(PZERO, "nfsexdlg");
+				(void) nfs_catnap(PZERO, error, "nfsexdlg");
 		} while (error == NFSERR_GRACE);
 		TAILQ_REMOVE(&extra_deleg, dp, nfsdl_list);
 		FREE((caddr_t)dp, M_NFSCLDELEG);
@@ -3619,7 +3619,7 @@ nfscl_tryopen(struct nfsmount *nmp, vnod
 		    mode, op, name, namelen, ndpp, reclaim, delegtype, cred, p,
 		    0, 0);
 		if (error == NFSERR_DELAY)
-			(void) nfs_catnap(PZERO, "nfstryop");
+			(void) nfs_catnap(PZERO, error, "nfstryop");
 	} while (error == NFSERR_DELAY);
 	if (error == EAUTH || error == EACCES) {
 		/* Try again using system credentials */
@@ -3629,7 +3629,7 @@ nfscl_tryopen(struct nfsmount *nmp, vnod
 			newfhlen, mode, op, name, namelen, ndpp, reclaim,
 			delegtype, cred, p, 1, 0);
 		    if (error == NFSERR_DELAY)
-			(void) nfs_catnap(PZERO, "nfstryop");
+			(void) nfs_catnap(PZERO, error, "nfstryop");
 		} while (error == NFSERR_DELAY);
 	}
 	return (error);
@@ -3652,7 +3652,8 @@ nfscl_trylock(struct nfsmount *nmp, vnod
 		error = nfsrpc_lock(nd, nmp, vp, fhp, fhlen, nlp, newone,
 		    reclaim, off, len, type, cred, p, 0);
 		if (!error && nd->nd_repstat == NFSERR_DELAY)
-			(void) nfs_catnap(PZERO, "nfstrylck");
+			(void) nfs_catnap(PZERO, (int)nd->nd_repstat,
+			    "nfstrylck");
 	} while (!error && nd->nd_repstat == NFSERR_DELAY);
 	if (!error)
 		error = nd->nd_repstat;
@@ -3663,7 +3664,8 @@ nfscl_trylock(struct nfsmount *nmp, vnod
 			error = nfsrpc_lock(nd, nmp, vp, fhp, fhlen, nlp,
 			    newone, reclaim, off, len, type, cred, p, 1);
 			if (!error && nd->nd_repstat == NFSERR_DELAY)
-				(void) nfs_catnap(PZERO, "nfstrylck");
+				(void) nfs_catnap(PZERO, (int)nd->nd_repstat,
+				    "nfstrylck");
 		} while (!error && nd->nd_repstat == NFSERR_DELAY);
 		if (!error)
 			error = nd->nd_repstat;
@@ -3685,7 +3687,7 @@ nfscl_trydelegreturn(struct nfscldeleg *
 	do {
 		error = nfsrpc_delegreturn(dp, cred, nmp, p, 0);
 		if (error == NFSERR_DELAY)
-			(void) nfs_catnap(PZERO, "nfstrydp");
+			(void) nfs_catnap(PZERO, error, "nfstrydp");
 	} while (error == NFSERR_DELAY);
 	if (error == EAUTH || error == EACCES) {
 		/* Try again using system credentials */
@@ -3693,7 +3695,7 @@ nfscl_trydelegreturn(struct nfscldeleg *
 		do {
 			error = nfsrpc_delegreturn(dp, cred, nmp, p, 1);
 			if (error == NFSERR_DELAY)
-				(void) nfs_catnap(PZERO, "nfstrydp");
+				(void) nfs_catnap(PZERO, error, "nfstrydp");
 		} while (error == NFSERR_DELAY);
 	}
 	return (error);
@@ -3714,7 +3716,7 @@ nfscl_tryclose(struct nfsclopen *op, str
 	do {
 		error = nfsrpc_closerpc(nd, nmp, op, cred, p, 0);
 		if (error == NFSERR_DELAY)
-			(void) nfs_catnap(PZERO, "nfstrycl");
+			(void) nfs_catnap(PZERO, error, "nfstrycl");
 	} while (error == NFSERR_DELAY);
 	if (error == EAUTH || error == EACCES) {
 		/* Try again using system credentials */
@@ -3722,7 +3724,7 @@ nfscl_tryclose(struct nfsclopen *op, str
 		do {
 			error = nfsrpc_closerpc(nd, nmp, op, cred, p, 1);
 			if (error == NFSERR_DELAY)
-				(void) nfs_catnap(PZERO, "nfstrycl");
+				(void) nfs_catnap(PZERO, error, "nfstrycl");
 		} while (error == NFSERR_DELAY);
 	}
 	return (error);

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c	Sat Apr 24 22:31:51 2010	(r207169)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c	Sat Apr 24 22:52:14 2010	(r207170)
@@ -652,7 +652,7 @@ nfs_decode_args(struct mount *mp, struct
 			while (newnfs_connect(nmp, &nmp->nm_sockreq,
 			    cred, td, 0)) {
 				printf("newnfs_args: retrying connect\n");
-				(void) nfs_catnap(PSOCK, "newnfscon");
+				(void) nfs_catnap(PSOCK, 0, "newnfscon");
 			}
 		}
 	} else {
@@ -1188,7 +1188,7 @@ mountnfs(struct nfs_args *argp, struct m
 			error = nfsrpc_getdirpath(nmp, NFSMNT_DIRPATH(nmp),
 			    cred, td);
 			if (error)
-				(void) nfs_catnap(PZERO, "nfsgetdirp");
+				(void) nfs_catnap(PZERO, error, "nfsgetdirp");
 		} while (error && --trycnt > 0);
 		if (error) {
 			error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0);
@@ -1284,7 +1284,7 @@ nfs_unmount(struct mount *mp, int mntfla
 	do {
 		error = vflush(mp, 1, flags, td);
 		if ((mntflags & MNT_FORCE) && error != 0 && ++trycnt < 30)
-			(void) nfs_catnap(PSOCK, "newndm");
+			(void) nfs_catnap(PSOCK, error, "newndm");
 	} while ((mntflags & MNT_FORCE) && error != 0 && trycnt < 30);
 	if (error)
 		goto out;

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c	Sat Apr 24 22:31:51 2010	(r207169)
+++ head/sys/fs/nfsclient/nfs_clvnops.c	Sat Apr 24 22:52:14 2010	(r207170)
@@ -2871,7 +2871,8 @@ nfs_advlock(struct vop_advlock_args *ap)
 			if (ret == NFSERR_DENIED && (ap->a_flags & F_WAIT) &&
 			    ap->a_op == F_SETLK) {
 				VOP_UNLOCK(vp, 0);
-				error = nfs_catnap(PZERO | PCATCH, "ncladvl");
+				error = nfs_catnap(PZERO | PCATCH, ret,
+				    "ncladvl");
 				if (error)
 					return (EINTR);
 				vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdstate.c	Sat Apr 24 22:31:51 2010	(r207169)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c	Sat Apr 24 22:52:14 2010	(r207170)
@@ -4578,7 +4578,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO
 			    100000)
 				return;
 			/* Sleep for a short period of time */
-			(void) nfs_catnap(PZERO, "nfsremove");
+			(void) nfs_catnap(PZERO, 0, "nfsremove");
 		}
 	} while (error == NFSERR_DELAY);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 23:05: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 B4B10106564A;
	Sat, 24 Apr 2010 23:05:56 +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 A33658FC24;
	Sat, 24 Apr 2010 23:05: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 o3ON5uUJ073236;
	Sat, 24 Apr 2010 23:05:56 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ON5ucN073230;
	Sat, 24 Apr 2010 23:05:56 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004242305.o3ON5ucN073230@svn.freebsd.org>
From: Matt Jacob 
Date: Sat, 24 Apr 2010 23:05:56 +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: r207171 - 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: Sat, 24 Apr 2010 23:05:56 -0000

Author: mjacob
Date: Sat Apr 24 23:05:56 2010
New Revision: 207171
URL: http://svn.freebsd.org/changeset/base/207171

Log:
  This is an MFC of 205236
  
  Put gone device timer into a structure tag that can hold more than 32 seconds. Oops.
  
  Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM
  or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've
  turned off autologin and find them, or rather don't, via camcontrol rescan.

Modified:
  stable/8/sys/dev/isp/isp_freebsd.c
  stable/8/sys/dev/isp/isp_freebsd.h
  stable/8/sys/dev/isp/isp_pci.c
  stable/8/sys/dev/isp/isp_sbus.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/geom/sched/   (props changed)

Modified: stable/8/sys/dev/isp/isp_freebsd.c
==============================================================================
--- stable/8/sys/dev/isp/isp_freebsd.c	Sat Apr 24 22:52:14 2010	(r207170)
+++ stable/8/sys/dev/isp/isp_freebsd.c	Sat Apr 24 23:05:56 2010	(r207171)
@@ -3945,11 +3945,15 @@ isp_gdt(void *arg)
 		if (lp->dev_map_idx == 0 || lp->target_mode) {
 			continue;
 		}
-		if (lp->new_reserved == 0) {
+		/*
+		 * We can use new_portid here because it is untouched
+		 * while the state is ZOMBIE
+		 */
+		if (lp->new_portid == 0) {
 			continue;
 		}
-		lp->new_reserved -= 1;
-		if (lp->new_reserved != 0) {
+		lp->new_portid -= 1;
+		if (lp->new_portid != 0) {
 			more_to_do++;
 			continue;
 		}
@@ -4059,7 +4063,7 @@ isp_kthread(void *arg)
 		 *
 		 * If not, we simply just wait for loop to come up.
 		 */
-		if (lb && (fc->role & ISP_ROLE_INITIATOR)) {
+		if (lb && (FCPARAM(isp, chan)->role & ISP_ROLE_INITIATOR)) {
 			/*
 			 * Increment loop down time by the last sleep interval
 			 */
@@ -4927,7 +4931,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 			/*
 			 * We don't do any simq freezing if we are only in target mode
 			 */
-			if (fc->role & ISP_ROLE_INITIATOR) {
+			if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) {
 				if (fc->path) {
 					isp_freeze_loopdown(isp, bus, msg);
 				}
@@ -4963,7 +4967,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 		va_end(ap);
 		fc = ISP_FC_PC(isp, bus);
 		lp->reserved = 0;
-		if ((fc->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) {
+		if ((FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) {
 			int dbidx = lp - FCPARAM(isp, bus)->portdb;
 			int i;
 
@@ -5051,10 +5055,13 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 		 *
 		 * If it isn't marked that isp_gdt is going to get rid of it,
 		 * announce that it's gone.
+		 *
+		 * We can use new_portid for the gone timer because it's
+		 * undefined while the state is ZOMBIE.
 		 */
 		if (lp->dev_map_idx && lp->reserved == 0) {
 			lp->reserved = 1;
-			lp->new_reserved = ISP_FC_PC(isp, bus)->gone_device_time;
+			lp->new_portid = ISP_FC_PC(isp, bus)->gone_device_time;
 			lp->state = FC_PORTDB_STATE_ZOMBIE;
 			if (fc->ready && !callout_active(&fc->gdt)) {
 				isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d starting Gone Device Timer", bus);
@@ -5101,7 +5108,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 			callout_stop(&fc->ldt);
 		}
 		isp_prt(isp, ISP_LOGINFO, msg, bus);
-		if (fc->role & ISP_ROLE_INITIATOR) {
+		if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) {
 			isp_freeze_loopdown(isp, bus, msg);
 		}
 		wakeup(fc);

Modified: stable/8/sys/dev/isp/isp_freebsd.h
==============================================================================
--- stable/8/sys/dev/isp/isp_freebsd.h	Sat Apr 24 22:52:14 2010	(r207170)
+++ stable/8/sys/dev/isp/isp_freebsd.h	Sat Apr 24 23:05:56 2010	(r207171)
@@ -175,7 +175,7 @@ struct isp_fc {
 		simqfrozen	: 3,
 		default_id	: 8,
 		hysteresis	: 8,
-		role		: 2,
+		def_role	: 2,	/* default role */
 		gdt_running	: 1,
 		loop_dead	: 1,
 		fcbsy		: 1,
@@ -203,7 +203,7 @@ struct isp_spi {
 		tm_enabled	: 1,
 #endif
 		simqfrozen	: 3,
-		role		: 3,
+		def_role	: 2,
 		iid		: 4;
 #ifdef	ISP_TARGET_MODE
 	struct tslist lun_hash[LUN_HASH_SIZE];
@@ -469,12 +469,12 @@ default:							\
 #define	DEFAULT_EXEC_THROTTLE(isp)	isp->isp_osinfo.exec_throttle
 
 #define	GET_DEFAULT_ROLE(isp, chan)	\
-	(IS_FC(isp)? ISP_FC_PC(isp, chan)->role : ISP_SPI_PC(isp, chan)->role)
+	(IS_FC(isp)? ISP_FC_PC(isp, chan)->def_role : ISP_SPI_PC(isp, chan)->def_role)
 #define	SET_DEFAULT_ROLE(isp, chan, val)		\
 	if (IS_FC(isp)) { 				\
-		ISP_FC_PC(isp, chan)->role = val;	\
+		ISP_FC_PC(isp, chan)->def_role = val;	\
 	} else {					\
-		ISP_SPI_PC(isp, chan)->role = val;	\
+		ISP_SPI_PC(isp, chan)->def_role = val;	\
 	}
 
 #define	DEFAULT_IID(isp, chan)		isp->isp_osinfo.pc.spi[chan].iid

Modified: stable/8/sys/dev/isp/isp_pci.c
==============================================================================
--- stable/8/sys/dev/isp/isp_pci.c	Sat Apr 24 22:52:14 2010	(r207170)
+++ stable/8/sys/dev/isp/isp_pci.c	Sat Apr 24 23:05:56 2010	(r207171)
@@ -547,10 +547,10 @@ isp_get_specific_options(device_t dev, i
 	}
 
 	if (IS_SCSI(isp)) {
-		ISP_SPI_PC(isp, chan)->role = tval;
+		ISP_SPI_PC(isp, chan)->def_role = tval;
 		return;
 	}
-	ISP_FC_PC(isp, chan)->role = tval;
+	ISP_FC_PC(isp, chan)->def_role = tval;
 
 	tval = 0;
 	if (resource_int_value(device_get_name(dev), device_get_unit(dev), "fullduplex", &tval) == 0 && tval != 0) {
@@ -833,7 +833,7 @@ isp_pci_attach(device_t dev)
 	 * The 'it' suffix really only matters for SCSI cards in target mode.
 	 */
 	isp->isp_osinfo.fw = NULL;
-	if (IS_SCSI(isp) && (ISP_SPI_PC(isp, 0)->role & ISP_ROLE_TARGET)) {
+	if (IS_SCSI(isp) && (ISP_SPI_PC(isp, 0)->def_role & ISP_ROLE_TARGET)) {
 		snprintf(fwname, sizeof (fwname), "isp_%04x_it", did);
 		isp->isp_osinfo.fw = firmware_get(fwname);
 	} else if (IS_24XX(isp) && (isp->isp_nchan > 1 || isp->isp_osinfo.forcemulti)) {

Modified: stable/8/sys/dev/isp/isp_sbus.c
==============================================================================
--- stable/8/sys/dev/isp/isp_sbus.c	Sat Apr 24 22:52:14 2010	(r207170)
+++ stable/8/sys/dev/isp/isp_sbus.c	Sat Apr 24 23:05:56 2010	(r207171)
@@ -195,7 +195,7 @@ isp_sbus_attach(device_t dev)
 	isp->isp_revision = 0;	/* XXX */
 	isp->isp_dev = dev;
 	isp->isp_nchan = 1;
-	ISP_SET_PC(isp, 0, role, role);
+	ISP_SET_PC(isp, 0, def_role, role);
 
 	/*
 	 * Get the clock frequency and convert it from HZ to MHz,

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 23:07: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 83084106566B;
	Sat, 24 Apr 2010 23:07:34 +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 716C98FC13;
	Sat, 24 Apr 2010 23:07: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 o3ON7Yo6073645;
	Sat, 24 Apr 2010 23:07:34 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ON7YoW073640;
	Sat, 24 Apr 2010 23:07:34 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004242307.o3ON7YoW073640@svn.freebsd.org>
From: Matt Jacob 
Date: Sat, 24 Apr 2010 23:07:34 +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: r207172 - stable/7/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: Sat, 24 Apr 2010 23:07:34 -0000

Author: mjacob
Date: Sat Apr 24 23:07:34 2010
New Revision: 207172
URL: http://svn.freebsd.org/changeset/base/207172

Log:
  This is an MFC of 205236
  
  Put gone device timer into a structure tag that can hold more than 32 seconds. Oops.
  
  Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM
  or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've
  turned off autologin and find them, or rather don't, via camcontrol rescan.

Modified:
  stable/7/sys/dev/isp/isp_freebsd.c
  stable/7/sys/dev/isp/isp_freebsd.h
  stable/7/sys/dev/isp/isp_pci.c
  stable/7/sys/dev/isp/isp_sbus.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/dev/isp/isp_freebsd.c
==============================================================================
--- stable/7/sys/dev/isp/isp_freebsd.c	Sat Apr 24 23:05:56 2010	(r207171)
+++ stable/7/sys/dev/isp/isp_freebsd.c	Sat Apr 24 23:07:34 2010	(r207172)
@@ -3945,11 +3945,15 @@ isp_gdt(void *arg)
 		if (lp->dev_map_idx == 0 || lp->target_mode) {
 			continue;
 		}
-		if (lp->new_reserved == 0) {
+		/*
+		 * We can use new_portid here because it is untouched
+		 * while the state is ZOMBIE
+		 */
+		if (lp->new_portid == 0) {
 			continue;
 		}
-		lp->new_reserved -= 1;
-		if (lp->new_reserved != 0) {
+		lp->new_portid -= 1;
+		if (lp->new_portid != 0) {
 			more_to_do++;
 			continue;
 		}
@@ -4059,7 +4063,7 @@ isp_kthread(void *arg)
 		 *
 		 * If not, we simply just wait for loop to come up.
 		 */
-		if (lb && (fc->role & ISP_ROLE_INITIATOR)) {
+		if (lb && (FCPARAM(isp, chan)->role & ISP_ROLE_INITIATOR)) {
 			/*
 			 * Increment loop down time by the last sleep interval
 			 */
@@ -4927,7 +4931,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 			/*
 			 * We don't do any simq freezing if we are only in target mode
 			 */
-			if (fc->role & ISP_ROLE_INITIATOR) {
+			if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) {
 				if (fc->path) {
 					isp_freeze_loopdown(isp, bus, msg);
 				}
@@ -4963,7 +4967,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 		va_end(ap);
 		fc = ISP_FC_PC(isp, bus);
 		lp->reserved = 0;
-		if ((fc->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) {
+		if ((FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) {
 			int dbidx = lp - FCPARAM(isp, bus)->portdb;
 			int i;
 
@@ -5051,10 +5055,13 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 		 *
 		 * If it isn't marked that isp_gdt is going to get rid of it,
 		 * announce that it's gone.
+		 *
+		 * We can use new_portid for the gone timer because it's
+		 * undefined while the state is ZOMBIE.
 		 */
 		if (lp->dev_map_idx && lp->reserved == 0) {
 			lp->reserved = 1;
-			lp->new_reserved = ISP_FC_PC(isp, bus)->gone_device_time;
+			lp->new_portid = ISP_FC_PC(isp, bus)->gone_device_time;
 			lp->state = FC_PORTDB_STATE_ZOMBIE;
 			if (fc->ready && !callout_active(&fc->gdt)) {
 				isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d starting Gone Device Timer", bus);
@@ -5101,7 +5108,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 			callout_stop(&fc->ldt);
 		}
 		isp_prt(isp, ISP_LOGINFO, msg, bus);
-		if (fc->role & ISP_ROLE_INITIATOR) {
+		if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) {
 			isp_freeze_loopdown(isp, bus, msg);
 		}
 		wakeup(fc);

Modified: stable/7/sys/dev/isp/isp_freebsd.h
==============================================================================
--- stable/7/sys/dev/isp/isp_freebsd.h	Sat Apr 24 23:05:56 2010	(r207171)
+++ stable/7/sys/dev/isp/isp_freebsd.h	Sat Apr 24 23:07:34 2010	(r207172)
@@ -175,7 +175,7 @@ struct isp_fc {
 		simqfrozen	: 3,
 		default_id	: 8,
 		hysteresis	: 8,
-		role		: 2,
+		def_role	: 2,	/* default role */
 		gdt_running	: 1,
 		loop_dead	: 1,
 		fcbsy		: 1,
@@ -203,7 +203,7 @@ struct isp_spi {
 		tm_enabled	: 1,
 #endif
 		simqfrozen	: 3,
-		role		: 3,
+		def_role	: 2,
 		iid		: 4;
 #ifdef	ISP_TARGET_MODE
 	struct tslist lun_hash[LUN_HASH_SIZE];
@@ -469,12 +469,12 @@ default:							\
 #define	DEFAULT_EXEC_THROTTLE(isp)	isp->isp_osinfo.exec_throttle
 
 #define	GET_DEFAULT_ROLE(isp, chan)	\
-	(IS_FC(isp)? ISP_FC_PC(isp, chan)->role : ISP_SPI_PC(isp, chan)->role)
+	(IS_FC(isp)? ISP_FC_PC(isp, chan)->def_role : ISP_SPI_PC(isp, chan)->def_role)
 #define	SET_DEFAULT_ROLE(isp, chan, val)		\
 	if (IS_FC(isp)) { 				\
-		ISP_FC_PC(isp, chan)->role = val;	\
+		ISP_FC_PC(isp, chan)->def_role = val;	\
 	} else {					\
-		ISP_SPI_PC(isp, chan)->role = val;	\
+		ISP_SPI_PC(isp, chan)->def_role = val;	\
 	}
 
 #define	DEFAULT_IID(isp, chan)		isp->isp_osinfo.pc.spi[chan].iid

Modified: stable/7/sys/dev/isp/isp_pci.c
==============================================================================
--- stable/7/sys/dev/isp/isp_pci.c	Sat Apr 24 23:05:56 2010	(r207171)
+++ stable/7/sys/dev/isp/isp_pci.c	Sat Apr 24 23:07:34 2010	(r207172)
@@ -547,10 +547,10 @@ isp_get_specific_options(device_t dev, i
 	}
 
 	if (IS_SCSI(isp)) {
-		ISP_SPI_PC(isp, chan)->role = tval;
+		ISP_SPI_PC(isp, chan)->def_role = tval;
 		return;
 	}
-	ISP_FC_PC(isp, chan)->role = tval;
+	ISP_FC_PC(isp, chan)->def_role = tval;
 
 	tval = 0;
 	if (resource_int_value(device_get_name(dev), device_get_unit(dev), "fullduplex", &tval) == 0 && tval != 0) {
@@ -833,7 +833,7 @@ isp_pci_attach(device_t dev)
 	 * The 'it' suffix really only matters for SCSI cards in target mode.
 	 */
 	isp->isp_osinfo.fw = NULL;
-	if (IS_SCSI(isp) && (ISP_SPI_PC(isp, 0)->role & ISP_ROLE_TARGET)) {
+	if (IS_SCSI(isp) && (ISP_SPI_PC(isp, 0)->def_role & ISP_ROLE_TARGET)) {
 		snprintf(fwname, sizeof (fwname), "isp_%04x_it", did);
 		isp->isp_osinfo.fw = firmware_get(fwname);
 	} else if (IS_24XX(isp) && (isp->isp_nchan > 1 || isp->isp_osinfo.forcemulti)) {

Modified: stable/7/sys/dev/isp/isp_sbus.c
==============================================================================
--- stable/7/sys/dev/isp/isp_sbus.c	Sat Apr 24 23:05:56 2010	(r207171)
+++ stable/7/sys/dev/isp/isp_sbus.c	Sat Apr 24 23:07:34 2010	(r207172)
@@ -195,7 +195,7 @@ isp_sbus_attach(device_t dev)
 	isp->isp_revision = 0;	/* XXX */
 	isp->isp_dev = dev;
 	isp->isp_nchan = 1;
-	ISP_SET_PC(isp, 0, role, role);
+	ISP_SET_PC(isp, 0, def_role, role);
 
 	/*
 	 * Get the clock frequency and convert it from HZ to MHz,

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 23:10: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 3616F1065677;
	Sat, 24 Apr 2010 23:10:14 +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 250D18FC16;
	Sat, 24 Apr 2010 23:10: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 o3ONAEiC074281;
	Sat, 24 Apr 2010 23:10:14 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ONAEW2074279;
	Sat, 24 Apr 2010 23:10:14 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004242310.o3ONAEW2074279@svn.freebsd.org>
From: Matt Jacob 
Date: Sat, 24 Apr 2010 23:10: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: r207173 - stable/8/sys/cam/scsi
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, 24 Apr 2010 23:10:14 -0000

Author: mjacob
Date: Sat Apr 24 23:10:13 2010
New Revision: 207173
URL: http://svn.freebsd.org/changeset/base/207173

Log:
  This is an MFC of 205252.
  
  We actually can generate a host number.

Modified:
  stable/8/sys/cam/scsi/scsi_sg.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/geom/sched/   (props changed)

Modified: stable/8/sys/cam/scsi/scsi_sg.c
==============================================================================
--- stable/8/sys/cam/scsi/scsi_sg.c	Sat Apr 24 23:07:34 2010	(r207172)
+++ stable/8/sys/cam/scsi/scsi_sg.c	Sat Apr 24 23:10:13 2010	(r207173)
@@ -586,7 +586,7 @@ sgioctl(struct cdev *dev, u_long cmd, ca
 	{
 		struct sg_scsi_id id;
 
-		id.host_no = 0; /* XXX */
+		id.host_no = cam_sim_path(xpt_path_sim(periph->path));
 		id.channel = xpt_path_path_id(periph->path);
 		id.scsi_id = xpt_path_target_id(periph->path);
 		id.lun = xpt_path_lun_id(periph->path);

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 23:13: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 E08B4106564A;
	Sat, 24 Apr 2010 23:13:05 +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 CFB658FC1A;
	Sat, 24 Apr 2010 23:13:05 +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 o3OND54A074959;
	Sat, 24 Apr 2010 23:13:05 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OND5q9074957;
	Sat, 24 Apr 2010 23:13:05 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004242313.o3OND5q9074957@svn.freebsd.org>
From: Matt Jacob 
Date: Sat, 24 Apr 2010 23:13:05 +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: r207174 - stable/7/sys/cam/scsi
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, 24 Apr 2010 23:13:06 -0000

Author: mjacob
Date: Sat Apr 24 23:13:05 2010
New Revision: 207174
URL: http://svn.freebsd.org/changeset/base/207174

Log:
  This is an MFC of 205252.
  
  We actually can generate a host number.

Modified:
  stable/7/sys/cam/scsi/scsi_sg.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/cam/scsi/scsi_sg.c
==============================================================================
--- stable/7/sys/cam/scsi/scsi_sg.c	Sat Apr 24 23:10:13 2010	(r207173)
+++ stable/7/sys/cam/scsi/scsi_sg.c	Sat Apr 24 23:13:05 2010	(r207174)
@@ -583,7 +583,7 @@ sgioctl(struct cdev *dev, u_long cmd, ca
 	{
 		struct sg_scsi_id id;
 
-		id.host_no = 0; /* XXX */
+		id.host_no = cam_sim_path(xpt_path_sim(periph->path));
 		id.channel = xpt_path_path_id(periph->path);
 		id.scsi_id = xpt_path_target_id(periph->path);
 		id.lun = xpt_path_lun_id(periph->path);

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 23:20: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 94C031065670;
	Sat, 24 Apr 2010 23:20:51 +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 8321C8FC12;
	Sat, 24 Apr 2010 23:20: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 o3ONKpK1076678;
	Sat, 24 Apr 2010 23:20:51 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ONKpUB076676;
	Sat, 24 Apr 2010 23:20:51 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004242320.o3ONKpUB076676@svn.freebsd.org>
From: Matt Jacob 
Date: Sat, 24 Apr 2010 23:20: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: r207175 - 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: Sat, 24 Apr 2010 23:20:51 -0000

Author: mjacob
Date: Sat Apr 24 23:20:51 2010
New Revision: 207175
URL: http://svn.freebsd.org/changeset/base/207175

Log:
  This is an MFC of 204050.
  
  Don't try and re-use a handle, even if the firmware tells you that's what is logged in.
  
  PR:             kern/144026

Modified:
  stable/8/sys/dev/isp/isp.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/geom/sched/   (props changed)

Modified: stable/8/sys/dev/isp/isp.c
==============================================================================
--- stable/8/sys/dev/isp/isp.c	Sat Apr 24 23:13:05 2010	(r207174)
+++ stable/8/sys/dev/isp/isp.c	Sat Apr 24 23:20:51 2010	(r207175)
@@ -2167,9 +2167,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
 		msg = "no Exchange Control Block";
 		break;
 	case PLOGX_IOCBERR_FAILED:
-		ISP_SNPRINTF(buf, sizeof (buf),
-		    "reason 0x%x (last LOGIN state 0x%x)",
-		    parm1 & 0xff, (parm1 >> 8) & 0xff);
+		ISP_SNPRINTF(buf, sizeof (buf), "reason 0x%x (last LOGIN state 0x%x)", parm1 & 0xff, (parm1 >> 8) & 0xff);
 		msg = buf;
 		break;
 	case PLOGX_IOCBERR_NOFABRIC:
@@ -2179,8 +2177,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
 		msg = "firmware not ready";
 		break;
 	case PLOGX_IOCBERR_NOLOGIN:
-		ISP_SNPRINTF(buf, sizeof (buf), "not logged in (last state 0x%x)",
-		    parm1);
+		ISP_SNPRINTF(buf, sizeof (buf), "not logged in (last state 0x%x)", parm1);
 		msg = buf;
 		rval = MBOX_NOT_LOGGED_IN;
 		break;
@@ -2192,21 +2189,18 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
 		msg = "no PCB allocated";
 		break;
 	case PLOGX_IOCBERR_EINVAL:
-		ISP_SNPRINTF(buf, sizeof (buf), "invalid parameter at offset 0x%x",
-		    parm1);
+		ISP_SNPRINTF(buf, sizeof (buf), "invalid parameter at offset 0x%x", parm1);
 		msg = buf;
 		break;
 	case PLOGX_IOCBERR_PORTUSED:
 		lev = ISP_LOGSANCFG|ISP_LOGDEBUG0;
-		ISP_SNPRINTF(buf, sizeof (buf),
-		    "already logged in with N-Port handle 0x%x", parm1);
+		ISP_SNPRINTF(buf, sizeof (buf), "already logged in with N-Port handle 0x%x", parm1);
 		msg = buf;
 		rval = MBOX_PORT_ID_USED | (parm1 << 16);
 		break;
 	case PLOGX_IOCBERR_HNDLUSED:
 		lev = ISP_LOGSANCFG|ISP_LOGDEBUG0;
-		ISP_SNPRINTF(buf, sizeof (buf),
-		    "handle already used for PortID 0x%06x", parm1);
+		ISP_SNPRINTF(buf, sizeof (buf), "handle already used for PortID 0x%06x", parm1);
 		msg = buf;
 		rval = MBOX_LOOP_ID_USED;
 		break;
@@ -2217,15 +2211,12 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
 		msg = "no FLOGI_ACC";
 		break;
 	default:
-		ISP_SNPRINTF(buf, sizeof (buf), "status %x from %x",
-		    plp->plogx_status, flags);
+		ISP_SNPRINTF(buf, sizeof (buf), "status %x from %x", plp->plogx_status, flags);
 		msg = buf;
 		break;
 	}
 	if (msg) {
-		isp_prt(isp, ISP_LOGERR,
-		    "Chan %d PLOGX PortID 0x%06x to N-Port handle 0x%x: %s",
-		    chan, portid, handle, msg);
+		isp_prt(isp, ISP_LOGERR, "Chan %d PLOGX PortID 0x%06x to N-Port handle 0x%x: %s", chan, portid, handle, msg);
 	}
 out:
 	if (gs == 0) {
@@ -3886,8 +3877,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha
  * Find an unused handle and try and use to login to a port.
  */
 static int
-isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p,
-    uint16_t *ohp)
+isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p, uint16_t *ohp)
 {
 	int lim, i, r;
 	uint16_t handle;
@@ -3907,8 +3897,7 @@ isp_login_device(ispsoftc_t *isp, int ch
 		 */
 		r = isp_getpdb(isp, chan, handle, p, 0);
 		if (r == 0 && p->portid != portid) {
-			(void) isp_plogx(isp, chan, handle, portid,
-			    PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT, 1);
+			(void) isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 1);
 		} else if (r == 0) {
 			break;
 		}
@@ -3918,8 +3907,7 @@ isp_login_device(ispsoftc_t *isp, int ch
 		/*
 		 * Now try and log into the device
 		 */
-		r = isp_plogx(isp, chan, handle, portid,
-		    PLOGX_FLG_CMD_PLOGI, 1);
+		r = isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_PLOGI, 1);
 		if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) {
 			return (-1);
 		}
@@ -3927,7 +3915,26 @@ isp_login_device(ispsoftc_t *isp, int ch
 			*ohp = handle;
 			break;
 		} else if ((r & 0xffff) == MBOX_PORT_ID_USED) {
-			handle = r >> 16;
+			/*
+			 * If we get here, then the firmwware still thinks we're logged into this device, but with a different
+			 * handle. We need to break that association. We used to try and just substitute the handle, but then
+			 * failed to get any data via isp_getpdb (below).
+			 */
+			if (isp_plogx(isp, chan, r >> 16, portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 1)) {
+				isp_prt(isp, ISP_LOGERR, "baw... logout of %x failed", r >> 16);
+			}
+			if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) {
+				return (-1);
+			}
+			r = isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_PLOGI, 1);
+			if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) {
+				return (-1);
+			}
+			if (r == 0) {
+				*ohp = handle;
+			} else {
+				i = lim;
+			}
 			break;
 		} else if (r != MBOX_LOOP_ID_USED) {
 			i = lim;
@@ -3941,8 +3948,7 @@ isp_login_device(ispsoftc_t *isp, int ch
 	}
 
 	if (i == lim) {
-		isp_prt(isp, ISP_LOGWARN, "Chan %d PLOGI 0x%06x failed",
-		    chan, portid);
+		isp_prt(isp, ISP_LOGWARN, "Chan %d PLOGI 0x%06x failed", chan, portid);
 		return (-1);
 	}
 
@@ -3956,15 +3962,12 @@ isp_login_device(ispsoftc_t *isp, int ch
 		return (-1);
 	}
 	if (r != 0) {
-		isp_prt(isp, ISP_LOGERR,
-		    "Chan %d new device 0x%06x@0x%x disappeared",
-		    chan, portid, handle);
+		isp_prt(isp, ISP_LOGERR, "Chan %d new device 0x%06x@0x%x disappeared", chan, portid, handle);
 		return (-1);
 	}
 
 	if (p->handle != handle || p->portid != portid) {
-		isp_prt(isp, ISP_LOGERR,
-		    "Chan %d new device 0x%06x@0x%x changed (0x%06x@0x%0x)",
+		isp_prt(isp, ISP_LOGERR, "Chan %d new device 0x%06x@0x%x changed (0x%06x@0x%0x)",
 		    chan, portid, handle, p->portid, p->handle);
 		return (-1);
 	}

From owner-svn-src-all@FreeBSD.ORG  Sat Apr 24 23:32: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 24689106566B;
	Sat, 24 Apr 2010 23:32:25 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 145908FC12;
	Sat, 24 Apr 2010 23:32: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 o3ONWOIS079260;
	Sat, 24 Apr 2010 23:32:24 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ONWO7g079258;
	Sat, 24 Apr 2010 23:32:24 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004242332.o3ONWO7g079258@svn.freebsd.org>
From: Weongyo Jeong 
Date: Sat, 24 Apr 2010 23:32: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: r207176 - head/sys/dev/bwn
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, 24 Apr 2010 23:32:25 -0000

Author: weongyo
Date: Sat Apr 24 23:32:24 2010
New Revision: 207176
URL: http://svn.freebsd.org/changeset/base/207176

Log:
  ifp->if_ipackets++ when RX packet interrupts are occurred.
  
  MFC after:	3 days

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==============================================================================
--- head/sys/dev/bwn/if_bwn.c	Sat Apr 24 23:20:51 2010	(r207175)
+++ head/sys/dev/bwn/if_bwn.c	Sat Apr 24 23:32:24 2010	(r207176)
@@ -9368,6 +9368,8 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 	rssi = rxhdr->phy.abg.rssi;	/* XXX incorrect RSSI calculation? */
 	noise = mac->mac_stats.link_noise;
 
+	ifp->if_ipackets++;
+
 	BWN_UNLOCK(sc);
 
 	ni = ieee80211_find_rxnode(ic, wh);