From owner-svn-src-stable-7@FreeBSD.ORG Sun Sep 13 11:45:32 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFFD7106566C; Sun, 13 Sep 2009 11:45:31 +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 9EC8A8FC14; Sun, 13 Sep 2009 11:45: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 n8DBjVXC020150; Sun, 13 Sep 2009 11:45:31 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DBjVkw020148; Sun, 13 Sep 2009 11:45:31 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131145.n8DBjVkw020148@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 11:45:31 +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: r197159 - stable/7/sbin/ifconfig X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 11:45:32 -0000 Author: ume Date: Sun Sep 13 11:45:31 2009 New Revision: 197159 URL: http://svn.freebsd.org/changeset/base/197159 Log: MFC r196929: Suppress an options line when no bit is on. Modified: stable/7/sbin/ifconfig/ (props changed) stable/7/sbin/ifconfig/ifgif.c Modified: stable/7/sbin/ifconfig/ifgif.c ============================================================================== --- stable/7/sbin/ifconfig/ifgif.c Sun Sep 13 11:34:33 2009 (r197158) +++ stable/7/sbin/ifconfig/ifgif.c Sun Sep 13 11:45:31 2009 (r197159) @@ -71,6 +71,8 @@ gif_status(int s) ifr.ifr_data = (caddr_t)&opts; if (ioctl(s, GIFGOPTS, &ifr) == -1) return; + if (opts == 0) + return; printf("\toptions=%d<", opts); for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) { From owner-svn-src-stable-7@FreeBSD.ORG Sun Sep 13 11:52:18 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A22A106566B; Sun, 13 Sep 2009 11:52:18 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 172588FC19; Sun, 13 Sep 2009 11:52: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 n8DBqHoo020428; Sun, 13 Sep 2009 11:52:17 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DBqHAk020421; Sun, 13 Sep 2009 11:52:17 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131152.n8DBqHAk020421@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 11:52:17 +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: r197162 - in stable/7: contrib/traceroute usr.sbin/traceroute6 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 11:52:18 -0000 Author: ume Date: Sun Sep 13 11:52:17 2009 New Revision: 197162 URL: http://svn.freebsd.org/changeset/base/197162 Log: MFC r196475: - Add AS lookup functionality to traceroute6(8) as well. - Support for IPv6 transport for AS lookup. - Introduce $RA_SERVER to set whois server. - Support for 4 byte ASN. - ANSIfy function declaration in as.c. Modified: stable/7/contrib/traceroute/ (props changed) stable/7/contrib/traceroute/as.c stable/7/contrib/traceroute/as.h stable/7/contrib/traceroute/traceroute.c stable/7/usr.sbin/traceroute6/ (props changed) stable/7/usr.sbin/traceroute6/Makefile stable/7/usr.sbin/traceroute6/traceroute6.8 stable/7/usr.sbin/traceroute6/traceroute6.c Modified: stable/7/contrib/traceroute/as.c ============================================================================== --- stable/7/contrib/traceroute/as.c Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/contrib/traceroute/as.c Sun Sep 13 11:52:17 2009 (r197162) @@ -63,55 +63,42 @@ struct aslookup { }; void * -as_setup(server) - char *server; +as_setup(char *server) { struct aslookup *asn; - struct hostent *he = NULL; - struct servent *se; - struct sockaddr_in in; + struct addrinfo hints, *res0, *res; FILE *f; - int s; + int s, error; if (server == NULL) + server = getenv("RA_SERVER"); + if (server == NULL) server = DEFAULT_AS_SERVER; - (void)memset(&in, 0, sizeof(in)); - in.sin_family = AF_INET; - in.sin_len = sizeof(in); - if ((se = getservbyname("whois", "tcp")) == NULL) { + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo(server, "whois", &hints, &res0); + if (error == EAI_SERVICE) { warnx("warning: whois/tcp service not found"); - in.sin_port = ntohs(43); - } else - in.sin_port = se->s_port; - - if (inet_aton(server, &in.sin_addr) == 0 && - ((he = gethostbyname(server)) == NULL || - he->h_addr == NULL)) { - warnx("%s: %s", server, hstrerror(h_errno)); - return (NULL); + error = getaddrinfo(server, "43", &hints, &res0); } - - if ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) { - warn("socket"); + if (error != 0) { + warnx("%s: %s", server, gai_strerror(error)); return (NULL); } - do { - if (he != NULL) { - memcpy(&in.sin_addr, he->h_addr, he->h_length); - he->h_addr_list++; - } - if (connect(s, (struct sockaddr *)&in, sizeof(in)) == 0) + for (res = res0; res; res = res->ai_next) { + s = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (s < 0) + continue; + if (connect(s, res->ai_addr, res->ai_addrlen) >= 0) break; - if (he == NULL || he->h_addr == NULL) { - close(s); - s = -1; - break; - } - } while (1); - - if (s == -1) { + close(s); + s = -1; + } + freeaddrinfo(res0); + if (s < 0) { warn("connect"); return (NULL); } @@ -137,23 +124,23 @@ as_setup(server) return (asn); } -int -as_lookup(_asn, addr) - void *_asn; - struct in_addr *addr; +unsigned int +as_lookup(void *_asn, char *addr, sa_family_t family) { struct aslookup *asn = _asn; char buf[1024]; - int as, rc, dlen; + unsigned int as; + int rc, dlen, plen; - as = rc = dlen = 0; - (void)fprintf(asn->as_f, "!r%s/32,l\n", inet_ntoa(*addr)); + as = 0; + rc = dlen = 0; + plen = (family == AF_INET6) ? 128 : 32; + (void)fprintf(asn->as_f, "!r%s/%d,l\n", addr, plen); (void)fflush(asn->as_f); #ifdef AS_DEBUG_FILE if (asn->as_debug) { - (void)fprintf(asn->as_debug, ">> !r%s/32,l\n", - inet_ntoa(*addr)); + (void)fprintf(asn->as_debug, ">> !r%s/%d,l\n", addr, plen); (void)fflush(asn->as_debug); } #endif /* AS_DEBUG_FILE */ @@ -182,7 +169,7 @@ as_lookup(_asn, addr) } #endif /* AS_DEBUG_FILE */ break; - case 'C': + case 'C': case 'D': case 'E': case 'F': @@ -209,7 +196,7 @@ as_lookup(_asn, addr) /* origin line is the interesting bit */ if (as == 0 && strncasecmp(buf, "origin:", 7) == 0) { - sscanf(buf + 7, " AS%d", &as); + sscanf(buf + 7, " AS%u", &as); #ifdef AS_DEBUG_FILE if (asn->as_debug) { (void)fprintf(asn->as_debug, "as: %d\n", as); @@ -223,8 +210,7 @@ as_lookup(_asn, addr) } void -as_shutdown(_asn) - void *_asn; +as_shutdown(void *_asn) { struct aslookup *asn = _asn; Modified: stable/7/contrib/traceroute/as.h ============================================================================== --- stable/7/contrib/traceroute/as.h Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/contrib/traceroute/as.h Sun Sep 13 11:52:17 2009 (r197162) @@ -37,6 +37,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -void *as_setup __P((char *)); -int as_lookup __P((void *, struct in_addr *)); -void as_shutdown __P((void *)); +void *as_setup(char *); +unsigned int as_lookup(void *, char *, sa_family_t); +void as_shutdown(void *); Modified: stable/7/contrib/traceroute/traceroute.c ============================================================================== --- stable/7/contrib/traceroute/traceroute.c Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/contrib/traceroute/traceroute.c Sun Sep 13 11:52:17 2009 (r197162) @@ -1477,19 +1477,21 @@ print(register u_char *buf, register int { register struct ip *ip; register int hlen; + char addr[INET_ADDRSTRLEN]; ip = (struct ip *) buf; hlen = ip->ip_hl << 2; cc -= hlen; + strlcpy(addr, inet_ntoa(from->sin_addr), sizeof(addr)); + if (as_path) - Printf(" [AS%d]", as_lookup(asn, &from->sin_addr)); + Printf(" [AS%u]", as_lookup(asn, addr, AF_INET)); if (nflag) - Printf(" %s", inet_ntoa(from->sin_addr)); + Printf(" %s", addr); else - Printf(" %s (%s)", inetname(from->sin_addr), - inet_ntoa(from->sin_addr)); + Printf(" %s (%s)", inetname(from->sin_addr), addr); if (verbose) Printf(" %d bytes to %s", cc, inet_ntoa (ip->ip_dst)); Modified: stable/7/usr.sbin/traceroute6/Makefile ============================================================================== --- stable/7/usr.sbin/traceroute6/Makefile Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/usr.sbin/traceroute6/Makefile Sun Sep 13 11:52:17 2009 (r197162) @@ -13,12 +13,17 @@ # A PARTICULAR PURPOSE. # $FreeBSD$ +TRACEROUTE_DISTDIR?= ${.CURDIR}/../../contrib/traceroute +.PATH: ${TRACEROUTE_DISTDIR} + PROG= traceroute6 MAN= traceroute6.8 +SRCS= as.c traceroute6.c BINOWN= root BINMODE= 4555 CFLAGS+= -DIPSEC -DUSE_RFC2292BIS -DHAVE_POLL +CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I. DPADD= ${LIBIPSEC} LDADD= -lipsec Modified: stable/7/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- stable/7/usr.sbin/traceroute6/traceroute6.8 Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/usr.sbin/traceroute6/traceroute6.8 Sun Sep 13 11:52:17 2009 (r197162) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 1998 +.Dd August 24, 2009 .Dt TRACEROUTE6 8 .Os .\" @@ -40,7 +40,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl dIlnNrvU +.Op Fl adIlnNrvU .Ek .Bk -words .Op Fl f Ar firsthop @@ -64,6 +64,9 @@ .Op Fl w Ar waittime .Ek .Bk -words +.Op Fl A Ar as_server +.Ek +.Bk -words .Ar target .Op Ar datalen .Ek @@ -84,6 +87,10 @@ after the destination host name. .Pp Other options are: .Bl -tag -width Ds +.It Fl a +Turn on AS# lookups for each hop encountered. +.It Fl A Ar as_server +Turn on AS# lookups and use the given server instead of the default. .It Fl d Debug mode. .It Fl f Ar firsthop Modified: stable/7/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/7/usr.sbin/traceroute6/traceroute6.c Sun Sep 13 11:52:15 2009 (r197161) +++ stable/7/usr.sbin/traceroute6/traceroute6.c Sun Sep 13 11:52:17 2009 (r197162) @@ -282,6 +282,8 @@ static const char rcsid[] = #include #endif +#include "as.h" + #define DUMMY_PORT 10010 #define MAXPACKET 65535 /* max ip packet size */ @@ -359,6 +361,9 @@ int waittime = 5; /* time to wait for r int nflag; /* print addresses numerically */ int useproto = IPPROTO_UDP; /* protocol to use to send packet */ int lflag; /* print both numerical address & hostname */ +int as_path; /* print as numbers for each hop */ +char *as_server = NULL; +void *asn; int main(argc, argv) @@ -411,8 +416,15 @@ main(argc, argv) seq = 0; - while ((ch = getopt(argc, argv, "df:g:Ilm:nNp:q:rs:Uvw:")) != -1) + while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:Uvw:")) != -1) switch (ch) { + case 'a': + as_path = 1; + break; + case 'A': + as_path = 1; + as_server = optarg; + break; case 'd': options |= SO_DEBUG; break; @@ -867,6 +879,17 @@ main(argc, argv) srcport = ntohs(Src.sin6_port); } + if (as_path) { + asn = as_setup(as_server); + if (asn == NULL) { + fprintf(stderr, + "traceroute6: as_setup failed, AS# lookups" + " disabled\n"); + (void)fflush(stderr); + as_path = 0; + } + } + /* * Message to users */ @@ -948,6 +971,8 @@ main(argc, argv) exit(0); } } + if (as_path) + as_shutdown(asn); exit(0); } @@ -1361,6 +1386,8 @@ print(mhdr, cc) if (getnameinfo((struct sockaddr *)from, from->sin6_len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(hbuf, "invalid", sizeof(hbuf)); + if (as_path) + printf(" [AS%u]", as_lookup(asn, hbuf, AF_INET6)); if (nflag) printf(" %s", hbuf); else if (lflag) From owner-svn-src-stable-7@FreeBSD.ORG Sun Sep 13 17:05:56 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDDAF1065672; Sun, 13 Sep 2009 17:05:56 +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 BC7358FC08; Sun, 13 Sep 2009 17: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 n8DH5uUp026724; Sun, 13 Sep 2009 17:05:56 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DH5uLn026723; Sun, 13 Sep 2009 17:05:56 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131705.n8DH5uLn026723@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 17:05:56 +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: r197170 - stable/7/share/timedef X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 17:05:56 -0000 Author: ume Date: Sun Sep 13 17:05:56 2009 New Revision: 197170 URL: http://svn.freebsd.org/changeset/base/197170 Log: MFC r196651: AM/PM date format for ja_JP.eucJP and ja_JP.SJIS were localized by r193869. However, ja_JP.UTF-8 wasn't. So, reflect it to ja_JP.UTF-8 as well. Modified: stable/7/share/timedef/ (props changed) stable/7/share/timedef/ja_JP.UTF-8.src Modified: stable/7/share/timedef/ja_JP.UTF-8.src ============================================================================== --- stable/7/share/timedef/ja_JP.UTF-8.src Sun Sep 13 17:01:34 2009 (r197169) +++ stable/7/share/timedef/ja_JP.UTF-8.src Sun Sep 13 17:05:56 2009 (r197170) @@ -68,13 +68,11 @@ # # am # -#午前 -AM +午前 # # pm # -#午後 -PM +午後 # # date_fmt # From owner-svn-src-stable-7@FreeBSD.ORG Sun Sep 13 17:08:58 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF59D106566C; Sun, 13 Sep 2009 17:08:58 +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 755608FC0C; Sun, 13 Sep 2009 17:08: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 n8DH8w5Z026822; Sun, 13 Sep 2009 17:08:58 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DH8wlY026818; Sun, 13 Sep 2009 17:08:58 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909131708.n8DH8wlY026818@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 13 Sep 2009 17:08:58 +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: r197171 - stable/7/usr.bin/w X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 17:08:59 -0000 Author: ume Date: Sun Sep 13 17:08:58 2009 New Revision: 197171 URL: http://svn.freebsd.org/changeset/base/197171 Log: MFC r196652: Fix the problem that the entry broke into two lines with multi-byte AM/PM date format. Modified: stable/7/usr.bin/w/ (props changed) stable/7/usr.bin/w/extern.h stable/7/usr.bin/w/pr_time.c stable/7/usr.bin/w/w.c Modified: stable/7/usr.bin/w/extern.h ============================================================================== --- stable/7/usr.bin/w/extern.h Sun Sep 13 17:05:56 2009 (r197170) +++ stable/7/usr.bin/w/extern.h Sun Sep 13 17:08:58 2009 (r197171) @@ -38,6 +38,6 @@ extern int use_ampm; struct kinfo_proc; -void pr_attime(time_t *, time_t *); +int pr_attime(time_t *, time_t *); int pr_idle(time_t); int proc_compare(struct kinfo_proc *, struct kinfo_proc *); Modified: stable/7/usr.bin/w/pr_time.c ============================================================================== --- stable/7/usr.bin/w/pr_time.c Sun Sep 13 17:05:56 2009 (r197170) +++ stable/7/usr.bin/w/pr_time.c Sun Sep 13 17:08:58 2009 (r197171) @@ -52,13 +52,14 @@ static const char sccsid[] = "@(#)pr_tim * pr_attime -- * Print the time since the user logged in. */ -void +int pr_attime(time_t *started, time_t *now) { - static char buf[256]; + static wchar_t buf[256]; struct tm tp, tm; time_t diff; - char fmt[20]; + wchar_t *fmt; + int len, width, offset = 0; tp = *localtime(started); tm = *localtime(now); @@ -66,7 +67,7 @@ pr_attime(time_t *started, time_t *now) /* If more than a week, use day-month-year. */ if (diff > 86400 * 7) - (void)strcpy(fmt, "%d%b%y"); + fmt = L"%d%b%y"; /* If not today, use day-hour-am/pm. */ else if (tm.tm_mday != tp.tm_mday || @@ -74,16 +75,26 @@ pr_attime(time_t *started, time_t *now) tm.tm_year != tp.tm_year) { /* The line below does not take DST into consideration */ /* else if (*now / 86400 != *started / 86400) { */ - (void)strcpy(fmt, use_ampm ? "%a%I%p" : "%a%H"); + fmt = use_ampm ? L"%a%I%p" : L"%a%H"; } /* Default is hh:mm{am,pm}. */ else { - (void)strcpy(fmt, use_ampm ? "%l:%M%p" : "%k:%M"); + fmt = use_ampm ? L"%l:%M%p" : L"%k:%M"; } - (void)strftime(buf, sizeof(buf), fmt, &tp); - (void)wprintf(L"%-7.7s", buf); + (void)wcsftime(buf, sizeof(buf), fmt, &tp); + len = wcslen(buf); + width = wcswidth(buf, len); + if (len == width) + (void)wprintf(L"%-7.7ls", buf); + else if (width < 7) + (void)wprintf(L"%ls%.*s", buf, 7 - width, " "); + else { + (void)wprintf(L"%ls", buf); + offset = width - 7; + } + return (offset); } /* Modified: stable/7/usr.bin/w/w.c ============================================================================== --- stable/7/usr.bin/w/w.c Sun Sep 13 17:05:56 2009 (r197170) +++ stable/7/usr.bin/w/w.c Sun Sep 13 17:08:58 2009 (r197171) @@ -137,7 +137,7 @@ main(int argc, char *argv[]) struct stat *stp; FILE *ut; time_t touched; - int ch, i, nentries, nusers, wcmd, longidle, dropgid; + int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid; const char *memf, *nlistf, *p; char *x_suffix; char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX]; @@ -406,9 +406,10 @@ main(int argc, char *argv[]) ep->utmp.ut_line : ep->utmp.ut_line + 3, W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-"); t = _time_to_time32(ep->utmp.ut_time); - pr_attime(&t, &now); + longattime = pr_attime(&t, &now); longidle = pr_idle(ep->idle); - (void)printf("%.*s\n", argwidth - longidle, ep->args); + (void)printf("%.*s\n", argwidth - longidle - longattime, + ep->args); } (void)kvm_close(kd); exit(0); From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 14 17:34:50 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6480E106566B; Mon, 14 Sep 2009 17:34:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50AA58FC25; Mon, 14 Sep 2009 17:34: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 n8EHYobK061414; Mon, 14 Sep 2009 17:34:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EHYng3061392; Mon, 14 Sep 2009 17:34:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909141734.n8EHYng3061392@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Sep 2009 17:34:49 +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: r197197 - in stable/7: sys sys/amd64/amd64 sys/arm/arm sys/conf sys/contrib/pf sys/fs/procfs sys/i386/i386 sys/ia64/ia64 sys/kern sys/sparc64/sparc64 sys/sys sys/vm usr.bin/procstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 17:34:50 -0000 Author: jhb Date: Mon Sep 14 17:34:49 2009 New Revision: 197197 URL: http://svn.freebsd.org/changeset/base/197197 Log: MFC 195840, 195844, and 196637: Add a new type of VM object: OBJT_SG. An OBJT_SG object is very similar to a device pager (OBJT_DEVICE) object in that it uses fictitious pages to provide aliases to other memory addresses. The primary difference is that it uses an sglist(9) to determine the physical addresses for a given offset into the object instead of invoking the d_mmap() method in a device driver. Added: stable/7/sys/vm/sg_pager.c - copied, changed from r195840, head/sys/vm/sg_pager.c Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/pmap.c stable/7/sys/arm/arm/pmap.c stable/7/sys/conf/files stable/7/sys/contrib/pf/ (props changed) stable/7/sys/fs/procfs/procfs_map.c stable/7/sys/i386/i386/pmap.c stable/7/sys/ia64/ia64/pmap.c stable/7/sys/kern/kern_proc.c stable/7/sys/sparc64/sparc64/pmap.c stable/7/sys/sys/user.h stable/7/sys/vm/vm.h stable/7/sys/vm/vm_fault.c stable/7/sys/vm/vm_map.c stable/7/sys/vm/vm_meter.c stable/7/sys/vm/vm_object.c stable/7/sys/vm/vm_object.h stable/7/sys/vm/vm_page.c stable/7/sys/vm/vm_pageout.c stable/7/sys/vm/vm_pager.c stable/7/sys/vm/vm_pager.h stable/7/usr.bin/procstat/ (props changed) stable/7/usr.bin/procstat/procstat_vm.c Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/amd64/amd64/pmap.c Mon Sep 14 17:34:49 2009 (r197197) @@ -3350,7 +3350,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs int pat_mode; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if ((addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { if (!vm_object_populate(object, pindex, pindex + atop(size))) @@ -4592,7 +4592,8 @@ vm_offset_t pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size) { - if ((obj == NULL) || (size < NBPDR) || (obj->type != OBJT_DEVICE)) { + if ((obj == NULL) || (size < NBPDR) || + (obj->type != OBJT_DEVICE && obj->type != OBJT_SG)) { return addr; } Modified: stable/7/sys/arm/arm/pmap.c ============================================================================== --- stable/7/sys/arm/arm/pmap.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/arm/arm/pmap.c Mon Sep 14 17:34:49 2009 (r197197) @@ -3071,7 +3071,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/conf/files Mon Sep 14 17:34:49 2009 (r197197) @@ -2210,6 +2210,7 @@ vm/default_pager.c standard vm/device_pager.c standard vm/phys_pager.c standard vm/redzone.c optional DEBUG_REDZONE +vm/sg_pager.c standard vm/swap_pager.c standard vm/uma_core.c standard vm/uma_dbg.c standard Modified: stable/7/sys/fs/procfs/procfs_map.c ============================================================================== --- stable/7/sys/fs/procfs/procfs_map.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/fs/procfs/procfs_map.c Mon Sep 14 17:34:49 2009 (r197197) @@ -177,6 +177,7 @@ procfs_doprocmap(PFS_FILL_ARGS) type = "swap"; vp = NULL; break; + case OBJT_SG: case OBJT_DEVICE: type = "device"; vp = NULL; Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/i386/i386/pmap.c Mon Sep 14 17:34:49 2009 (r197197) @@ -3474,7 +3474,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs int pat_mode; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if (pseflag && (addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { @@ -4712,7 +4712,8 @@ vm_offset_t pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size) { - if ((obj == NULL) || (size < NBPDR) || (obj->type != OBJT_DEVICE)) { + if ((obj == NULL) || (size < NBPDR) || + (obj->type != OBJT_DEVICE && obj->type != OBJT_SG)) { return addr; } Modified: stable/7/sys/ia64/ia64/pmap.c ============================================================================== --- stable/7/sys/ia64/ia64/pmap.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/ia64/ia64/pmap.c Mon Sep 14 17:34:49 2009 (r197197) @@ -1737,7 +1737,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/kern/kern_proc.c Mon Sep 14 17:34:49 2009 (r197197) @@ -1488,6 +1488,9 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A case OBJT_DEAD: kve->kve_type = KVME_TYPE_DEAD; break; + case OBJT_SG: + kve->kve_type = KVME_TYPE_SG; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; @@ -1659,6 +1662,9 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR case OBJT_DEAD: kve->kve_type = KVME_TYPE_DEAD; break; + case OBJT_SG: + kve->kve_type = KVME_TYPE_SG; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Sep 14 17:34:49 2009 (r197197) @@ -1495,7 +1495,7 @@ pmap_object_init_pt(pmap_t pm, vm_offset { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } Modified: stable/7/sys/sys/user.h ============================================================================== --- stable/7/sys/sys/user.h Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/sys/user.h Mon Sep 14 17:34:49 2009 (r197197) @@ -334,6 +334,7 @@ struct kinfo_file { #define KVME_TYPE_DEVICE 4 #define KVME_TYPE_PHYS 5 #define KVME_TYPE_DEAD 6 +#define KVME_TYPE_SG 7 #define KVME_TYPE_UNKNOWN 255 #define KVME_PROT_READ 0x00000001 Copied and modified: stable/7/sys/vm/sg_pager.c (from r195840, head/sys/vm/sg_pager.c) ============================================================================== --- head/sys/vm/sg_pager.c Fri Jul 24 13:50:29 2009 (r195840, copy source) +++ stable/7/sys/vm/sg_pager.c Mon Sep 14 17:34:49 2009 (r197197) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -45,7 +46,7 @@ __FBSDID("$FreeBSD$"); static void sg_pager_init(void); static vm_object_t sg_pager_alloc(void *, vm_ooffset_t, vm_prot_t, - vm_ooffset_t, struct ucred *); + vm_ooffset_t); static void sg_pager_dealloc(vm_object_t); static int sg_pager_getpages(vm_object_t, vm_page_t *, int, int); static void sg_pager_putpages(vm_object_t, vm_page_t *, int, @@ -78,7 +79,7 @@ sg_pager_init(void) static vm_object_t sg_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, - vm_ooffset_t foff, struct ucred *cred) + vm_ooffset_t foff) { struct sglist *sg; vm_object_t object; @@ -193,21 +194,18 @@ sg_pager_getpages(vm_object_t object, vm ("backing page for SG is fake")); /* Construct a new fake page. */ - printf("SG: getting fake page for paddr %lx\n", paddr); page = sg_pager_getfake(paddr, memattr); VM_OBJECT_LOCK(object); TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, pageq); /* Free the original pages and insert this fake page into the object. */ vm_page_lock_queues(); - for (i = 0; i < count; i++) { - printf("SG: freeing VM page %p\n", m[i]); + for (i = 0; i < count; i++) vm_page_free(m[i]); - } vm_page_unlock_queues(); - printf("SG: Inserting new fake page\n"); vm_page_insert(page, object, offset); m[reqpage] = page; + page->valid = VM_PAGE_BITS_ALL; return (VM_PAGER_OK); } Modified: stable/7/sys/vm/vm.h ============================================================================== --- stable/7/sys/vm/vm.h Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm.h Mon Sep 14 17:34:49 2009 (r197197) @@ -89,7 +89,7 @@ typedef u_char vm_prot_t; /* protection #define VM_PROT_DEFAULT VM_PROT_ALL enum obj_type { OBJT_DEFAULT, OBJT_SWAP, OBJT_VNODE, OBJT_DEVICE, OBJT_PHYS, - OBJT_DEAD }; + OBJT_DEAD, OBJT_SG }; typedef u_char objtype_t; union vm_map_object; Modified: stable/7/sys/vm/vm_fault.c ============================================================================== --- stable/7/sys/vm/vm_fault.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_fault.c Mon Sep 14 17:34:49 2009 (r197197) @@ -485,7 +485,8 @@ readrest: (fs.first_object == fs.object || (is_first_object_locked = VM_OBJECT_TRYLOCK(fs.first_object))) && fs.first_object->type != OBJT_DEVICE && - fs.first_object->type != OBJT_PHYS) { + fs.first_object->type != OBJT_PHYS && + fs.first_object->type != OBJT_SG) { vm_pindex_t firstpindex, tmppindex; if (fs.first_pindex < 2 * VM_FAULT_READ) Modified: stable/7/sys/vm/vm_map.c ============================================================================== --- stable/7/sys/vm/vm_map.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_map.c Mon Sep 14 17:34:49 2009 (r197197) @@ -1478,7 +1478,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL) return; VM_OBJECT_LOCK(object); - if (object->type == OBJT_DEVICE) { + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { pmap_object_init_pt(map->pmap, addr, object, pindex, size); goto unlock_return; } @@ -1954,7 +1954,8 @@ done: */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); } } KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION, @@ -2073,7 +2074,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st saved_start = entry->start; saved_end = entry->end; fictitious = entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE; + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG); /* * Release the map lock, relying on the in-transition * mark. @@ -2169,7 +2171,8 @@ done: */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); } } next_entry_done: @@ -2294,7 +2297,8 @@ vm_map_entry_unwire(vm_map_t map, vm_map { vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); entry->wired_count = 0; } Modified: stable/7/sys/vm/vm_meter.c ============================================================================== --- stable/7/sys/vm/vm_meter.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_meter.c Mon Sep 14 17:34:49 2009 (r197197) @@ -211,7 +211,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) * synchronization should not impair the accuracy of * the reported statistics. */ - if (object->type == OBJT_DEVICE) { + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { /* * Devices, like /dev/mem, will badly skew our totals. */ Modified: stable/7/sys/vm/vm_object.c ============================================================================== --- stable/7/sys/vm/vm_object.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_object.c Mon Sep 14 17:34:49 2009 (r197197) @@ -306,6 +306,7 @@ vm_object_set_memattr(vm_object_t object case OBJT_DEFAULT: case OBJT_DEVICE: case OBJT_PHYS: + case OBJT_SG: case OBJT_SWAP: case OBJT_VNODE: if (!TAILQ_EMPTY(&object->memq)) Modified: stable/7/sys/vm/vm_object.h ============================================================================== --- stable/7/sys/vm/vm_object.h Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_object.h Mon Sep 14 17:34:49 2009 (r197197) @@ -124,6 +124,15 @@ struct vm_object { } devp; /* + * SG pager + * + * sgp_pglist - list of allocated pages + */ + struct { + TAILQ_HEAD(, vm_page) sgp_pglist; + } sgp; + + /* * Swap pager * * swp_bcount - number of swap 'swblock' metablocks, each Modified: stable/7/sys/vm/vm_page.c ============================================================================== --- stable/7/sys/vm/vm_page.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_page.c Mon Sep 14 17:34:49 2009 (r197197) @@ -1149,7 +1149,7 @@ vm_page_alloc(vm_object_t object, vm_pin if (object != NULL) { /* Ignore device objects; the pager sets "memattr" for them. */ if (object->memattr != VM_MEMATTR_DEFAULT && - object->type != OBJT_DEVICE) + object->type != OBJT_DEVICE && object->type != OBJT_SG) pmap_page_set_memattr(m, object->memattr); vm_page_insert(m, object, pindex); } else Modified: stable/7/sys/vm/vm_pageout.c ============================================================================== --- stable/7/sys/vm/vm_pageout.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_pageout.c Mon Sep 14 17:34:49 2009 (r197197) @@ -516,7 +516,9 @@ vm_pageout_object_deactivate_pages(pmap, int actcount, rcount, remove_mode; VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); - if (first_object->type == OBJT_DEVICE || first_object->type == OBJT_PHYS) + if (first_object->type == OBJT_DEVICE || + first_object->type == OBJT_SG || + first_object->type == OBJT_PHYS) return; for (object = first_object;; object = backing_object) { if (pmap_resident_count(pmap) <= desired) Modified: stable/7/sys/vm/vm_pager.c ============================================================================== --- stable/7/sys/vm/vm_pager.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_pager.c Mon Sep 14 17:34:49 2009 (r197197) @@ -160,7 +160,8 @@ struct pagerops *pagertab[] = { &vnodepagerops, /* OBJT_VNODE */ &devicepagerops, /* OBJT_DEVICE */ &physpagerops, /* OBJT_PHYS */ - &deadpagerops /* OBJT_DEAD */ + &deadpagerops, /* OBJT_DEAD */ + &sgpagerops /* OBJT_SG */ }; static const int npagers = sizeof(pagertab) / sizeof(pagertab[0]); Modified: stable/7/sys/vm/vm_pager.h ============================================================================== --- stable/7/sys/vm/vm_pager.h Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/sys/vm/vm_pager.h Mon Sep 14 17:34:49 2009 (r197197) @@ -71,6 +71,7 @@ extern struct pagerops swappagerops; extern struct pagerops vnodepagerops; extern struct pagerops devicepagerops; extern struct pagerops physpagerops; +extern struct pagerops sgpagerops; /* * get/put return values Modified: stable/7/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/7/usr.bin/procstat/procstat_vm.c Mon Sep 14 16:52:38 2009 (r197196) +++ stable/7/usr.bin/procstat/procstat_vm.c Mon Sep 14 17:34:49 2009 (r197197) @@ -93,6 +93,9 @@ procstat_vm(pid_t pid, struct kinfo_proc case KVME_TYPE_DEAD: str = "dd"; break; + case KVME_TYPE_SG: + str = "sg"; + break; case KVME_TYPE_UNKNOWN: default: str = "??"; From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 14 17:45:59 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A0871065693; Mon, 14 Sep 2009 17:45:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE0548FC0C; Mon, 14 Sep 2009 17:45: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 n8EHjwYB061686; Mon, 14 Sep 2009 17:45:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8EHjwOT061684; Mon, 14 Sep 2009 17:45:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909141745.n8EHjwOT061684@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Sep 2009 17:45:58 +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: r197198 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 17:45:59 -0000 Author: jhb Date: Mon Sep 14 17:45:58 2009 New Revision: 197198 URL: http://svn.freebsd.org/changeset/base/197198 Log: Bump __FreeBSD_version to 702106 for the recent PAT, d_mmap_single(), and OBJT_SG changes. Modified: stable/7/sys/sys/param.h Modified: stable/7/sys/sys/param.h ============================================================================== --- stable/7/sys/sys/param.h Mon Sep 14 17:34:49 2009 (r197197) +++ stable/7/sys/sys/param.h Mon Sep 14 17:45:58 2009 (r197198) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 702105 /* Master, propagated to newvers */ +#define __FreeBSD_version 702106 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-stable-7@FreeBSD.ORG Tue Sep 15 02:23:17 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ADB6106566C; Tue, 15 Sep 2009 02:23:17 +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 EC97A8FC12; Tue, 15 Sep 2009 02:23: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 n8F2NGBi073049; Tue, 15 Sep 2009 02:23:16 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8F2NGeu073047; Tue, 15 Sep 2009 02:23:16 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200909150223.n8F2NGeu073047@svn.freebsd.org> From: Ed Maste Date: Tue, 15 Sep 2009 02:23: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: r197213 - stable/7/sys/cam X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 02:23:17 -0000 Author: emaste Date: Tue Sep 15 02:23:16 2009 New Revision: 197213 URL: http://svn.freebsd.org/changeset/base/197213 Log: MFC r195685: Fix leaks in probestart, probedone, and scsi_scan_bus. Also free page_list using the matching malloc type for the allocation. (In HEAD these functions have moved to scsi_xpt.c) Reviewed by: scottl Modified: stable/7/sys/cam/cam_xpt.c Modified: stable/7/sys/cam/cam_xpt.c ============================================================================== --- stable/7/sys/cam/cam_xpt.c Tue Sep 15 02:22:57 2009 (r197212) +++ stable/7/sys/cam/cam_xpt.c Tue Sep 15 02:23:16 2009 (r197213) @@ -5240,6 +5240,7 @@ xpt_scan_bus(struct cam_periph *periph, } work_ccb = xpt_alloc_ccb_nowait(); if (work_ccb == NULL) { + xpt_free_ccb((union ccb *)scan_info->cpi); free(scan_info, M_CAMXPT); xpt_free_path(path); request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; @@ -5360,6 +5361,7 @@ xpt_scan_bus(struct cam_periph *periph, } if ((scan_info->cpi->hba_misc & PIM_SEQSCAN) == 0) { + xpt_free_ccb(request_ccb); break; } status = xpt_create_path(&path, xpt_periph, @@ -5828,8 +5830,11 @@ probestart(struct cam_periph *periph, un serial_buf = NULL; device = periph->path->device; - device->serial_num = NULL; - device->serial_num_len = 0; + if (device->serial_num != NULL) { + free(device->serial_num, M_CAMXPT); + device->serial_num = NULL; + device->serial_num_len = 0; + } serial_buf = (struct scsi_vpd_unit_serial_number *) malloc(sizeof(*serial_buf), M_CAMXPT, M_NOWAIT|M_ZERO); @@ -6168,7 +6173,7 @@ probedone(struct cam_periph *periph, uni } if (page_list != NULL) - free(page_list, M_DEVBUF); + free(page_list, M_CAMXPT); if (serialnum_supported) { xpt_release_ccb(done_ccb); From owner-svn-src-stable-7@FreeBSD.ORG Thu Sep 17 12:44:59 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70E20106566C; Thu, 17 Sep 2009 12:44: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 453068FC1F; Thu, 17 Sep 2009 12:44: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 n8HCixGv056994; Thu, 17 Sep 2009 12:44:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HCix5Y056991; Thu, 17 Sep 2009 12:44:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200909171244.n8HCix5Y056991@svn.freebsd.org> From: Andriy Gapon Date: Thu, 17 Sep 2009 12:44:59 +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: r197271 - in stable/7/sys: . contrib/pf dev/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 12:44:59 -0000 Author: avg Date: Thu Sep 17 12:44:58 2009 New Revision: 197271 URL: http://svn.freebsd.org/changeset/base/197271 Log: MFC r197077: pci: remove definitions of duplicate constants Suggested by: jhb Reviewed by: jhb Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/pci/pcireg.h stable/7/sys/dev/pci/pcivar.h Modified: stable/7/sys/dev/pci/pcireg.h ============================================================================== --- stable/7/sys/dev/pci/pcireg.h Thu Sep 17 12:41:27 2009 (r197270) +++ stable/7/sys/dev/pci/pcireg.h Thu Sep 17 12:44:58 2009 (r197271) @@ -39,11 +39,11 @@ */ /* some PCI bus constants */ - -#define PCI_BUSMAX 255 -#define PCI_SLOTMAX 31 -#define PCI_FUNCMAX 7 -#define PCI_REGMAX 255 +#define PCI_DOMAINMAX 65535 /* highest supported domain number */ +#define PCI_BUSMAX 255 /* highest supported bus number */ +#define PCI_SLOTMAX 31 /* highest supported slot number */ +#define PCI_FUNCMAX 7 /* highest supported function number */ +#define PCI_REGMAX 255 /* highest supported config register addr. */ #define PCI_MAXHDRTYPE 2 /* PCI config header registers for all devices */ Modified: stable/7/sys/dev/pci/pcivar.h ============================================================================== --- stable/7/sys/dev/pci/pcivar.h Thu Sep 17 12:41:27 2009 (r197270) +++ stable/7/sys/dev/pci/pcivar.h Thu Sep 17 12:44:58 2009 (r197271) @@ -33,13 +33,6 @@ #include /* some PCI bus constants */ - -#define PCI_DOMAINMAX 65535 /* highest supported domain number */ -#define PCI_BUSMAX 255 /* highest supported bus number */ -#define PCI_SLOTMAX 31 /* highest supported slot number */ -#define PCI_FUNCMAX 7 /* highest supported function number */ -#define PCI_REGMAX 255 /* highest supported config register addr. */ - #define PCI_MAXMAPS_0 6 /* max. no. of memory/port maps */ #define PCI_MAXMAPS_1 2 /* max. no. of maps for PCI to PCI bridge */ #define PCI_MAXMAPS_2 1 /* max. no. of maps for CardBus bridge */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Sep 17 14:23:51 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DDF21065670; Thu, 17 Sep 2009 14:23:51 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8ACB48FC1B; Thu, 17 Sep 2009 14:23: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 n8HENpbv060086; Thu, 17 Sep 2009 14:23:51 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8HENpJt060084; Thu, 17 Sep 2009 14:23:51 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200909171423.n8HENpJt060084@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 17 Sep 2009 14:23:51 +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: r197283 - in stable/7/sys: . boot/pc98 contrib/pf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 14:23:51 -0000 Author: nyan Date: Thu Sep 17 14:23:51 2009 New Revision: 197283 URL: http://svn.freebsd.org/changeset/base/197283 Log: MFC: r197156 MFi386: Move the loader's entry point to 0x200000. This change is also needed for pc98. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/pc98/Makefile.inc stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/7/sys/boot/pc98/Makefile.inc Thu Sep 17 14:12:21 2009 (r197282) +++ stable/7/sys/boot/pc98/Makefile.inc Thu Sep 17 14:23:51 2009 (r197283) @@ -4,7 +4,7 @@ BINDIR?= /boot -LOADER_ADDRESS?=0x100000 +LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -Os From owner-svn-src-stable-7@FreeBSD.ORG Fri Sep 18 14:12:40 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D57681065670; Fri, 18 Sep 2009 14:12:40 +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 C22AA8FC27; Fri, 18 Sep 2009 14:12:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8IECe11093025; Fri, 18 Sep 2009 14:12:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IECecw093023; Fri, 18 Sep 2009 14:12:40 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200909181412.n8IECecw093023@svn.freebsd.org> From: Andriy Gapon Date: Fri, 18 Sep 2009 14:12: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: r197311 - in stable/7/sys: . contrib/pf dev/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 14:12:40 -0000 Author: avg Date: Fri Sep 18 14:12:40 2009 New Revision: 197311 URL: http://svn.freebsd.org/changeset/base/197311 Log: MFC r197099: pci(4): don't perform maximum register number check Different sub-kinds of PCI buses may have different rules and thus it is up for the bus backends to do proper input checks. For example, PCIe allows configuration register numbers < 0x1000, while for PCI proper the limit is 0x100. And, in fact, the buses already do the checks. Reviewed by: jhb Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/pci/pci_user.c Modified: stable/7/sys/dev/pci/pci_user.c ============================================================================== --- stable/7/sys/dev/pci/pci_user.c Fri Sep 18 14:05:56 2009 (r197310) +++ stable/7/sys/dev/pci/pci_user.c Fri Sep 18 14:12:40 2009 (r197311) @@ -605,9 +605,8 @@ getconfexit: case 4: case 2: case 1: - /* Make sure register is in bounds and aligned. */ + /* Make sure register is not negative and aligned. */ if (io->pi_reg < 0 || - io->pi_reg + io->pi_width > PCI_REGMAX + 1 || io->pi_reg & (io->pi_width - 1)) { error = EINVAL; break;