From owner-svn-src-user@FreeBSD.ORG Sun Mar 7 09:02:52 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6263D106566B; Sun, 7 Mar 2010 09:02:52 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5145C8FC28; Sun, 7 Mar 2010 09:02: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 o2792qXA099996; Sun, 7 Mar 2010 09:02:52 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2792q4F099993; Sun, 7 Mar 2010 09:02:52 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201003070902.o2792q4F099993@svn.freebsd.org> From: Hiroki Sato Date: Sun, 7 Mar 2010 09:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204822 - user/hrs/ipv6/usr.sbin/route6d X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 09:02:52 -0000 Author: hrs Date: Sun Mar 7 09:02:52 2010 New Revision: 204822 URL: http://svn.freebsd.org/changeset/base/204822 Log: * Support RTM_IFANNOUNCE message. route6d now works even when an interface is added or removed dynamically. * Improve data structures for the prefix filter: - struct ifc (for interfaces) and struct iff (for filters) are now separated from each other; struct iff is now a separated singly-linked list which contains if_name in each entry. Linear search is used for the prefix matching. - interface specifier in filtering rule now accepts non-existent interfaces at boot time and glob characters like gif* or fxp[012]. (this is based on fnmatch(3)) * Add a new flags: - -P num: ignore routes marked as RTF_PROTO. - -Q num: set RTF_PROTO for routes added by route6d. - -p pidfile: specify the PID file. * Increase retry count for NET_RT_DUMP to 15. * Usage: These fix a typical issue when using route6d + other routing daemon. For example, net/openbgpd which uses RTF_PROTO1 for its routing entries. However, route6d adds/removes routing entries regardless of the RTF_PROTO* flags, it happens that routes added by openbgpd is removed by route6d, and vice versa. Adding "-P 1" solves this situation. This is applied to net/quagga, too. Also, the glob character support greatly simplifies your command line options like this: [before] route6d_flags="\ -N bge0,bge1,re0,gif0,gif1,gif4,gre0,gre1,gre2,gre3,gre4,gre5,gre6,\ gre7,gre8,gre9,gre10,gre11,gre12,gre13,gre14,bridge0 \ -T gif2 \ -O 2001:db8:705:ef00::/56,gif3 \ -A 2001:db8:705:ef00::/56,gif3 \ -L 2001:db8:19:ff::/64,gif3 \ " [after] route6d_flags="\ -P 1 \ -N bge*,re0,gif[014],gre*,bridge* \ -T gif2 \ -O 2001:db8:705:ef00::/56,gif3 \ -A 2001:db8:705:ef00::/56,gif3 \ -L 2001:db8:19:ff::/64,gif3 \ " Modified: user/hrs/ipv6/usr.sbin/route6d/route6d.8 user/hrs/ipv6/usr.sbin/route6d/route6d.c Modified: user/hrs/ipv6/usr.sbin/route6d/route6d.8 ============================================================================== --- user/hrs/ipv6/usr.sbin/route6d/route6d.8 Sun Mar 7 08:54:06 2010 (r204821) +++ user/hrs/ipv6/usr.sbin/route6d/route6d.8 Sun Mar 7 09:02:52 2010 (r204822) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 1997 +.Dd July 21, 2009 .Dt ROUTE6D 8 .Os .Sh NAME @@ -26,6 +26,15 @@ .Nm .Op Fl adDhlnqsS .Bk -words +.Op Fl p Ar pidfile +.Ek +.Bk -words +.Op Fl P Ar protonum +.Ek +.Bk -words +.Op Fl Q Ar protonum +.Ek +.Bk -words .Op Fl R Ar routelog .Ek .Bk -words @@ -62,6 +71,29 @@ statically defined routes will be remove arrive as if the routes are received at the startup of .Nm . .\" +.It Fl p Ar pidfile +This option specifies PID filename as +.Ar pidfile . +The default value is +.Pa /var/run/route6d.pid . +.It Fl P Ar protonum +This option makes the +.Nm +recognize a route with RTF_PROTO[123] flag as one with infinite lifetime. The +.Ar protonum +must be 1, 2, or 3 and they corresponds to RTF_PROTO1, RTF_PROTO2, and +RTF_PROTO3, respectively. Multiple +.Fl P +flags are allowed. +.It Fl Q Ar protonum +This option makes the +.Nm +add RTF_PROTO[123] flags to routes which are obtained via RIP sessions. The +.Ar protonum +must be 1, 2, or 3 and they corresponds to RTF_PROTO1, RTF_PROTO2, and +RTF_PROTO3, respectively. Multiple +.Fl Q +flags are allowed. .It Fl R Ar routelog This option makes the .Nm Modified: user/hrs/ipv6/usr.sbin/route6d/route6d.c ============================================================================== --- user/hrs/ipv6/usr.sbin/route6d/route6d.c Sun Mar 7 08:54:06 2010 (r204821) +++ user/hrs/ipv6/usr.sbin/route6d/route6d.c Sun Mar 7 09:02:52 2010 (r204822) @@ -38,6 +38,7 @@ static char _rcsid[] = "$KAME: route6d.c #include #include +#include #include #include #include @@ -103,7 +104,7 @@ static char _rcsid[] = "$KAME: route6d.c } while (0) struct ifc { /* Configuration of an interface */ - char *ifc_name; /* if name */ + char ifc_name[IFNAMSIZ]; /* if name */ struct ifc *ifc_next; int ifc_index; /* if index */ int ifc_mtu; /* if mtu */ @@ -112,7 +113,6 @@ struct ifc { /* Configuration of an in short ifc_cflags; /* IFC_XXX */ struct in6_addr ifc_mylladdr; /* my link-local address */ struct sockaddr_in6 ifc_ripsin; /* rip multicast address */ - struct iff *ifc_filter; /* filter structure */ struct ifac *ifc_addr; /* list of AF_INET6 addresses */ int ifc_joined; /* joined to ff02::9 */ }; @@ -126,6 +126,7 @@ struct ifac { /* Adddress associated t }; struct iff { + char iff_name[IFNAMSIZ]; int iff_type; struct in6_addr iff_addr; int iff_plen; @@ -133,6 +134,7 @@ struct iff { }; struct ifc *ifc; +struct iff *iff_head; int nifc; /* number of valid ifc's */ struct ifc **index2ifc; int nindex2ifc; @@ -181,6 +183,8 @@ int nflag = 0; /* don't update kernel ro int aflag = 0; /* age out even the statically defined routes */ int hflag = 0; /* don't split horizon */ int lflag = 0; /* exchange site local routes */ +int Pflag = 0; /* don't age out routes with RTF_PROTO[123] */ +int Qflag = 0; /* set RTF_PROTO[123] flag to routes by RIPng */ int sflag = 0; /* announce static routes w/ split horizon */ int Sflag = 0; /* announce static routes to every interface */ unsigned long routetag = 0; /* route tag attached on originating case */ @@ -222,7 +226,7 @@ int out_filter(struct riprt *, struct if void init(void); void sockopt(struct ifc *); void ifconfig(void); -void ifconfig1(const char *, const struct sockaddr *, struct ifc *, int); +int ifconfig1(const char *, const struct sockaddr *, struct ifc *, int); void rtrecv(void); int rt_del(const struct sockaddr_in6 *, const struct sockaddr_in6 *, const struct sockaddr_in6 *); @@ -276,6 +280,13 @@ void setindex2ifc(int, struct ifc *); #define MALLOC(type) ((type *)malloc(sizeof(type))) +#define IFIL_TYPE_ANY 0 +#define IFIL_TYPE_A 'A' +#define IFIL_TYPE_N 'N' +#define IFIL_TYPE_T 'T' +#define IFIL_TYPE_O 'O' +#define IFIL_TYPE_L 'L' + int main(argc, argv) int argc; @@ -283,9 +294,11 @@ main(argc, argv) { int ch; int error = 0; + unsigned long proto; struct ifc *ifcp; sigset_t mask, omask; - FILE *pidfile; + char *pidfile = ROUTE6D_PID; + FILE *pidfh; char *progname; char *ep; @@ -296,7 +309,7 @@ main(argc, argv) progname = *argv; pid = getpid(); - while ((ch = getopt(argc, argv, "A:N:O:R:T:L:t:adDhlnqsS")) != -1) { + while ((ch = getopt(argc, argv, "A:N:O:R:T:L:t:adDhlnp:P:Q:qsS")) != -1) { switch (ch) { case 'A': case 'N': @@ -318,6 +331,37 @@ main(argc, argv) /*NOTREACHED*/ } break; + case 'p': + pidfile = optarg; + break; + case 'P': + ep = NULL; + proto = strtoul(optarg, &ep, 0); + if (!ep || *ep != '\0' || (proto < 1) || (3 < proto)) { + fatal("invalid P flag"); + /*NOTREACHED*/ + } + if (proto == 1) + Pflag |= RTF_PROTO1; + if (proto == 2) + Pflag |= RTF_PROTO2; + if (proto == 3) + Pflag |= RTF_PROTO3; + break; + case 'Q': + ep = NULL; + proto = strtoul(optarg, &ep, 0); + if (!ep || *ep != '\0' || (proto < 1) || (3 < proto)) { + fatal("invalid Q flag"); + /*NOTREACHED*/ + } + if (proto == 1) + Qflag |= RTF_PROTO1; + if (proto == 2) + Qflag |= RTF_PROTO2; + if (proto == 3) + Qflag |= RTF_PROTO3; + break; case 'R': if ((rtlog = fopen(optarg, "w")) == NULL) { fatal("Can not write to routelog"); @@ -395,9 +439,9 @@ main(argc, argv) #if 1 pid = getpid(); - if ((pidfile = fopen(ROUTE6D_PID, "w")) != NULL) { - fprintf(pidfile, "%d\n", pid); - fclose(pidfile); + if ((pidfh = fopen(pidfile, "w")) != NULL) { + fprintf(pidfh, "%d\n", pid); + fclose(pidfh); } #endif @@ -428,7 +472,7 @@ main(argc, argv) alarm(ripinterval(INIT_INTERVAL6)); for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) { - if (iff_find(ifcp, 'N')) + if (iff_find(ifcp, IFIL_TYPE_N)) continue; if (ifcp->ifc_index > 0 && (ifcp->ifc_flags & IFF_UP)) sendrequest(ifcp); @@ -833,11 +877,11 @@ ripsend(ifcp, sin6, flag) return; /* -N: no use */ - if (iff_find(ifcp, 'N') != NULL) + if (iff_find(ifcp, IFIL_TYPE_N) != NULL) return; /* -T: generate default route only */ - if (iff_find(ifcp, 'T') != NULL) { + if (iff_find(ifcp, IFIL_TYPE_T) != NULL) { struct netinfo6 rrt_info; memset(&rrt_info, 0, sizeof(struct netinfo6)); rrt_info.rip6_dest = in6addr_any; @@ -931,9 +975,11 @@ out_filter(rrt, ifcp) * -A: filter out less specific routes, if we have aggregated * route configured. */ - for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) { + for (iffp = iff_head; iffp; iffp = iffp->iff_next) { if (iffp->iff_type != 'A') continue; + if (fnmatch(iffp->iff_name, ifcp->ifc_name, 0) != 0) + continue; if (rrt->rrt_info.rip6_plen <= iffp->iff_plen) continue; ia = rrt->rrt_info.rip6_dest; @@ -948,9 +994,11 @@ out_filter(rrt, ifcp) */ if ((rrt->rrt_rflags & RRTF_AGGREGATE) != 0) { ok = 0; - for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) { + for (iffp = iff_head; iffp; iffp = iffp->iff_next) { if (iffp->iff_type != 'A') continue; + if (fnmatch(iffp->iff_name, ifcp->ifc_name, 0) != 0) + continue; if (rrt->rrt_info.rip6_plen == iffp->iff_plen && IN6_ARE_ADDR_EQUAL(&rrt->rrt_info.rip6_dest, &iffp->iff_addr)) { @@ -965,11 +1013,13 @@ out_filter(rrt, ifcp) /* * -O: advertise only if prefix matches the configured prefix. */ - if (iff_find(ifcp, 'O')) { + if (iff_find(ifcp, IFIL_TYPE_O)) { ok = 0; - for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) { + for (iffp = iff_head; iffp; iffp = iffp->iff_next) { if (iffp->iff_type != 'O') continue; + if (fnmatch(iffp->iff_name, ifcp->ifc_name, 0) != 0) + continue; if (rrt->rrt_info.rip6_plen < iffp->iff_plen) continue; ia = rrt->rrt_info.rip6_dest; @@ -1235,7 +1285,7 @@ riprecv() } /* -N: no use */ - if (iff_find(ifcp, 'N') != NULL) + if (iff_find(ifcp, IFIL_TYPE_N) != NULL) return; tracet(1, "Recv(%s): from %s.%d info(%d)\n", @@ -1301,8 +1351,10 @@ riprecv() * -L: listen only if the prefix matches the configuration */ ok = 1; /* if there's no L filter, it is ok */ - for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) { - if (iffp->iff_type != 'L') + for (iffp = iff_head; iffp; iffp = iffp->iff_next) { + if (iffp->iff_type != IFIL_TYPE_L) + continue; + if (fnmatch(iffp->iff_name, ifcp->ifc_name, 0) != 0) continue; ok = 0; if (np->rip6_plen < iffp->iff_plen) @@ -1525,9 +1577,8 @@ ifconfig() ifcp->ifc_next = ifc; ifc = ifcp; nifc++; - ifcp->ifc_name = allocopy(ifa->ifa_name); + strlcpy(ifcp->ifc_name, ifa->ifa_name, sizeof(ifcp->ifc_name)); ifcp->ifc_addr = 0; - ifcp->ifc_filter = 0; ifcp->ifc_flags = ifa->ifa_flags; trace(1, "newif %s <%s>\n", ifcp->ifc_name, ifflags(ifcp->ifc_flags)); @@ -1543,7 +1594,10 @@ ifconfig() } ifcp->ifc_flags = ifa->ifa_flags; } - ifconfig1(ifa->ifa_name, ifa->ifa_addr, ifcp, s); + if (ifconfig1(ifa->ifa_name, ifa->ifa_addr, ifcp, s) < 0) { + /* maybe temporary failure */ + continue; + } if ((ifcp->ifc_flags & (IFF_LOOPBACK | IFF_UP)) == IFF_UP && 0 < ifcp->ifc_index && !ifcp->ifc_joined) { mreq.ipv6mr_multiaddr = ifcp->ifc_ripsin.sin6_addr; @@ -1561,7 +1615,7 @@ ifconfig() freeifaddrs(ifap); } -void +int ifconfig1(name, sa, ifcp, s) const char *name; const struct sockaddr *sa; @@ -1576,19 +1630,19 @@ ifconfig1(name, sa, ifcp, s) sin6 = (const struct sockaddr_in6 *)sa; if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && !lflag) - return; + return -1; ifr.ifr_addr = *sin6; strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGIFNETMASK_IN6, (char *)&ifr) < 0) { - fatal("ioctl: SIOCGIFNETMASK_IN6"); - /*NOTREACHED*/ + syslog(LOG_INFO, "ioctl: SIOCGIFNETMASK_IN6"); + return -1; } plen = sin6mask2len(&ifr.ifr_addr); if ((ifa = ifa_match(ifcp, &sin6->sin6_addr, plen)) != NULL) { /* same interface found */ /* need check if something changed */ /* XXX not yet implemented */ - return; + return -1; } /* * New address is found @@ -1636,6 +1690,38 @@ ifconfig1(name, sa, ifcp, s) ifcp->ifc_index, ifcp->ifc_mtu, ifcp->ifc_metric); } else ifcp->ifc_cflags |= IFC_CHANGED; + + return 0; +} + +void +ifremove(int ifindex) +{ + struct ifc *ifcp; + struct ifc *ifcp_prev = NULL; + struct riprt *rrt; + + for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) { + if (ifcp->ifc_index == ifindex) + break; + ifcp_prev = ifcp; + } + if (ifcp == NULL) + return; + + tracet(1, "ifremove: %s is departed.\n", ifcp->ifc_name); + if (ifcp_prev == NULL) { + ifc = ifcp->ifc_next; + } else { + ifcp_prev->ifc_next = ifcp->ifc_next; + } + + for (rrt = riprt; rrt; rrt = rrt->rrt_next) { + if (rrt->rrt_index == ifcp->ifc_index && + rrt->rrt_rflags & RRTF_AGGREGATE) + delroute(&rrt->rrt_info, &rrt->rrt_gw); + } + free(ifcp); } /* @@ -1650,6 +1736,7 @@ rtrecv() struct rt_msghdr *rtm; struct ifa_msghdr *ifam; struct if_msghdr *ifm; + struct if_announcemsghdr *ifan; int len; struct ifc *ifcp, *ic; int iface = 0, rtable = 0; @@ -1662,11 +1749,15 @@ rtrecv() perror("read from rtsock"); exit(1); } + if (len == 0) + return; +#if 0 if (len < sizeof(*rtm)) { trace(1, "short read from rtsock: %d (should be > %lu)\n", len, (u_long)sizeof(*rtm)); return; } +#endif if (dflag >= 2) { fprintf(stderr, "rtmsg:\n"); for (i = 0; i < len; i++) { @@ -1677,6 +1768,9 @@ rtrecv() } for (p = buf; p - buf < len; p += ((struct rt_msghdr *)p)->rtm_msglen) { + if (((struct rt_msghdr *)p)->rtm_version != RTM_VERSION) + continue; + /* safety against bogus message */ if (((struct rt_msghdr *)p)->rtm_msglen <= 0) { trace(1, "bogus rtmsg: length=%d\n", @@ -1698,6 +1792,18 @@ rtrecv() addrs = ifm->ifm_addrs; q = (char *)(ifm + 1); break; + case RTM_IFANNOUNCE: + ifan = (struct if_announcemsghdr *)p; + switch (ifan->ifan_what) { + case IFAN_ARRIVAL: + iface++; + break; + case IFAN_DEPARTURE: + ifremove(ifan->ifan_index); + iface++; + break; + } + break; default: rtm = (struct rt_msghdr *)p; addrs = rtm->rtm_addrs; @@ -2599,7 +2705,7 @@ krtread(again) errmsg = "sysctl NET_RT_DUMP"; continue; } - } while (retry < 5 && errmsg != NULL); + } while (retry < 15 && errmsg != NULL); if (errmsg) { fatal("%s (with %d retries, msize=%lu)", errmsg, retry, (u_long)msize); @@ -2690,6 +2796,8 @@ rt_entry(rtm, again) rrt->rrt_t = time(NULL); if (aflag == 0 && (rtm->rtm_flags & RTF_STATIC)) rrt->rrt_t = 0; /* Don't age static routes */ + if (rtm->rtm_flags & Pflag) + rrt->rrt_t = 0; /* Don't age PROTO[123] routes */ if ((rtm->rtm_flags & (RTF_HOST|RTF_GATEWAY)) == RTF_HOST) rrt->rrt_t = 0; /* Don't age non-gateway host routes */ np->rip6_tag = 0; @@ -2806,6 +2914,7 @@ addroute(rrt, gw, ifcp) rtm->rtm_seq = ++seq; rtm->rtm_pid = pid; rtm->rtm_flags = rrt->rrt_flags; + rtm->rtm_flags |= Qflag; rtm->rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK; rtm->rtm_rmx.rmx_hopcount = np->rip6_metric - 1; rtm->rtm_inits = RTV_HOPCOUNT; @@ -3003,10 +3112,11 @@ ifdump(sig) if (i == 0) { if ((ifcp->ifc_flags & IFF_UP) == 0) continue; - if (iff_find(ifcp, 'N') != NULL) + if (iff_find(ifcp, IFIL_TYPE_N) != NULL) continue; } else { - if (ifcp->ifc_flags & IFF_UP) + if (ifcp->ifc_flags & IFF_UP != 0 && + iff_find(ifcp, IFIL_TYPE_N) == NULL) continue; } ifdump0(dump, ifcp); @@ -3045,20 +3155,22 @@ ifdump0(dump, ifcp) ifa->ifa_plen); } } - if (ifcp->ifc_filter) { + if (1) { fprintf(dump, "\tFilter:"); - for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) { + for (iffp = iff_head; iffp; iffp = iffp->iff_next) { + if (fnmatch(iffp->iff_name, ifcp->ifc_name, 0) != 0) + continue; addr = 0; switch (iffp->iff_type) { - case 'A': + case IFIL_TYPE_A: ft = "Aggregate"; addr++; break; - case 'N': + case IFIL_TYPE_N: ft = "No-use"; break; - case 'O': + case IFIL_TYPE_O: ft = "Advertise-only"; addr++; break; - case 'T': + case IFIL_TYPE_T: ft = "Default-only"; break; - case 'L': + case IFIL_TYPE_L: ft = "Listen-only"; addr++; break; default: snprintf(buf, sizeof(buf), "Unknown-%c", iffp->iff_type); @@ -3131,8 +3243,8 @@ filterconfig() { int i; char *p, *ap, *iflp, *ifname, *ep; - struct iff ftmp, *iff_obj; - struct ifc *ifcp; + struct iff ftmp, *iffp; + struct ifc ctmp, *ifcp; struct riprt *rrt; #if 0 struct in6_addr gw; @@ -3143,7 +3255,8 @@ filterconfig() ap = filter[i]; iflp = NULL; ifcp = NULL; - if (filtertype[i] == 'N' || filtertype[i] == 'T') { + memset(&ftmp, 0, sizeof(ftmp)); + if (filtertype[i] == IFIL_TYPE_N || filtertype[i] == IFIL_TYPE_T) { iflp = ap; goto ifonly; } @@ -3181,21 +3294,19 @@ ifonly: ifname = iflp; if ((iflp = strchr(iflp, ',')) != NULL) *iflp++ = '\0'; - ifcp = ifc_find(ifname); - if (ifcp == NULL) { - fatal("no interface %s exists", ifname); - /*NOTREACHED*/ - } - iff_obj = (struct iff *)malloc(sizeof(struct iff)); - if (iff_obj == NULL) { - fatal("malloc of iff_obj"); + strlcpy(ctmp.ifc_name, ifname, sizeof(ctmp.ifc_name)); + strlcpy(ftmp.iff_name, ifname, sizeof(ftmp.iff_name)); +#if 0 + syslog(LOG_INFO, "Add filter: type %d, ifname %s.", ftmp.iff_type, ifname); +#endif + iffp = malloc(sizeof(struct iff)); + if (iffp == NULL) { + fatal("malloc of iff"); /*NOTREACHED*/ } - memcpy((void *)iff_obj, (void *)&ftmp, - sizeof(struct iff)); - /* link it to the interface filter */ - iff_obj->iff_next = ifcp->ifc_filter; - ifcp->ifc_filter = iff_obj; + ftmp.iff_next = iff_head; + iff_head = iffp; + memcpy(iffp, &ftmp, sizeof(struct iff)); } /* @@ -3243,7 +3354,7 @@ ifonly: riprt = rrt; trace(1, "Aggregate: %s/%d for %s\n", inet6_n2p(&ftmp.iff_addr), ftmp.iff_plen, - ifcp->ifc_name); + ftmp.iff_name); /* Add this route to the kernel */ if (nflag) /* do not modify kernel routing table */ continue; @@ -3588,9 +3699,13 @@ iff_find(ifcp, type) { struct iff *iffp; - for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) { - if (iffp->iff_type == type) - return iffp; + for (iffp = iff_head; iffp; iffp = iffp->iff_next) { + if (fnmatch(iffp->iff_name, ifcp->ifc_name, 0) == 0) { + if (type == IFIL_TYPE_ANY || + type == iffp->iff_type) { + return iffp; + } + } } return NULL; } From owner-svn-src-user@FreeBSD.ORG Sun Mar 7 12:41:42 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97E721065670; Sun, 7 Mar 2010 12:41:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D5928FC1E; Sun, 7 Mar 2010 12:41: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 o27Cfge8049849; Sun, 7 Mar 2010 12:41:42 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27CfgLP049847; Sun, 7 Mar 2010 12:41:42 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201003071241.o27CfgLP049847@svn.freebsd.org> From: Hiroki Sato Date: Sun, 7 Mar 2010 12:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204828 - user/hrs/ipv6/usr.sbin/route6d X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 12:41:42 -0000 Author: hrs Date: Sun Mar 7 12:41:42 2010 New Revision: 204828 URL: http://svn.freebsd.org/changeset/base/204828 Log: - Use RTF_PROTO2 for routes handled by RIPng and ignore the other routes. The route6d depends on RTF_WASCLONED to prevent connected network routes (normally configured automatically when ifconfig assigns an address with a prefix) from being removed. However, that flag is no longer used on 8.0 and later due to lltable rework. The route6d now sees routes with RTF_PROTO2 only. The flag can be changed by the -Q flag. The default is 2. - -Q and -P now allow the value "0". It clears the flag itself. Modified: user/hrs/ipv6/usr.sbin/route6d/route6d.c Modified: user/hrs/ipv6/usr.sbin/route6d/route6d.c ============================================================================== --- user/hrs/ipv6/usr.sbin/route6d/route6d.c Sun Mar 7 12:29:50 2010 (r204827) +++ user/hrs/ipv6/usr.sbin/route6d/route6d.c Sun Mar 7 12:41:42 2010 (r204828) @@ -184,7 +184,7 @@ int aflag = 0; /* age out even the stati int hflag = 0; /* don't split horizon */ int lflag = 0; /* exchange site local routes */ int Pflag = 0; /* don't age out routes with RTF_PROTO[123] */ -int Qflag = 0; /* set RTF_PROTO[123] flag to routes by RIPng */ +int Qflag = RTF_PROTO2; /* set RTF_PROTO[123] flag to routes by RIPng */ int sflag = 0; /* announce static routes w/ split horizon */ int Sflag = 0; /* announce static routes to every interface */ unsigned long routetag = 0; /* route tag attached on originating case */ @@ -337,10 +337,12 @@ main(argc, argv) case 'P': ep = NULL; proto = strtoul(optarg, &ep, 0); - if (!ep || *ep != '\0' || (proto < 1) || (3 < proto)) { + if (!ep || *ep != '\0' || 3 < proto) { fatal("invalid P flag"); /*NOTREACHED*/ } + if (proto == 0) + Pflag = 0; if (proto == 1) Pflag |= RTF_PROTO1; if (proto == 2) @@ -351,10 +353,12 @@ main(argc, argv) case 'Q': ep = NULL; proto = strtoul(optarg, &ep, 0); - if (!ep || *ep != '\0' || (proto < 1) || (3 < proto)) { + if (!ep || *ep != '\0' || 3 < proto) { fatal("invalid Q flag"); /*NOTREACHED*/ } + if (proto == 0) + Qflag = 0; if (proto == 1) Qflag |= RTF_PROTO1; if (proto == 2) @@ -2747,6 +2751,14 @@ rt_entry(rtm, again) if (rtm->rtm_flags & RTF_CLONED) return; #endif + /* Ignore RTF_PROTO mismached routes */ + /* + * XXX: can we know if it is a connected network route or not? + * RTF_WASCLONED was the flag for that, but we no longer + * use it. Rely on Qflag instead here. + */ + if (Qflag && !(rtm->rtm_flags & Qflag)) + return; /* * do not look at dynamic routes. * netbsd/openbsd cloned routes have UGHD. From owner-svn-src-user@FreeBSD.ORG Sun Mar 7 14:31:57 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E61B81065676; Sun, 7 Mar 2010 14:31:57 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBF5D8FC1A; Sun, 7 Mar 2010 14:31: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 o27EVvKU074274; Sun, 7 Mar 2010 14:31:57 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27EVvtG074273; Sun, 7 Mar 2010 14:31:57 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003071431.o27EVvtG074273@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 7 Mar 2010 14:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204832 - user/luigi/ipfw3-r8 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 14:31:58 -0000 Author: luigi Date: Sun Mar 7 14:31:57 2010 New Revision: 204832 URL: http://svn.freebsd.org/changeset/base/204832 Log: working area to merge recent ipfw and dummynet work to RELENG_8 Added: - copied from r204831, stable/8/ Directory Properties: user/luigi/ipfw3-r8/ (props changed) From owner-svn-src-user@FreeBSD.ORG Sun Mar 7 14:58:26 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25BC3106566B; Sun, 7 Mar 2010 14:58:26 +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 EFCBE8FC14; Sun, 7 Mar 2010 14:58: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 o27EwP2I080087; Sun, 7 Mar 2010 14:58:25 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27EwPVP080086; Sun, 7 Mar 2010 14:58:25 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003071458.o27EwPVP080086@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 7 Mar 2010 14:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204834 - user/luigi/ipfw3-head X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 14:58:26 -0000 Author: luigi Date: Sun Mar 7 14:58:25 2010 New Revision: 204834 URL: http://svn.freebsd.org/changeset/base/204834 Log: all important pieces in this branch are now in HEAD, so we don't need it anymore. Deleted: user/luigi/ipfw3-head/ From owner-svn-src-user@FreeBSD.ORG Sun Mar 7 16:54:56 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0B7A1065670; Sun, 7 Mar 2010 16:54:56 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C03A18FC08; Sun, 7 Mar 2010 16:54: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 o27GsucJ006347; Sun, 7 Mar 2010 16:54:56 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27Gsufu006344; Sun, 7 Mar 2010 16:54:56 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201003071654.o27Gsufu006344@svn.freebsd.org> From: Hiroki Sato Date: Sun, 7 Mar 2010 16:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204841 - user/hrs/ipv6/usr.sbin/route6d X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 16:54:57 -0000 Author: hrs Date: Sun Mar 7 16:54:56 2010 New Revision: 204841 URL: http://svn.freebsd.org/changeset/base/204841 Log: - Use !(rtm->rtm_flags & RTF_GATEWAY) as the condition for connected routes. - WARN=6. Modified: user/hrs/ipv6/usr.sbin/route6d/Makefile user/hrs/ipv6/usr.sbin/route6d/route6d.c Modified: user/hrs/ipv6/usr.sbin/route6d/Makefile ============================================================================== --- user/hrs/ipv6/usr.sbin/route6d/Makefile Sun Mar 7 16:45:18 2010 (r204840) +++ user/hrs/ipv6/usr.sbin/route6d/Makefile Sun Mar 7 16:54:56 2010 (r204841) @@ -6,6 +6,6 @@ MAN= route6d.8 CFLAGS+= -DHAVE_POLL_H -WARNS?= 1 +WARNS?= 6 .include Modified: user/hrs/ipv6/usr.sbin/route6d/route6d.c ============================================================================== --- user/hrs/ipv6/usr.sbin/route6d/route6d.c Sun Mar 7 16:45:18 2010 (r204840) +++ user/hrs/ipv6/usr.sbin/route6d/route6d.c Sun Mar 7 16:54:56 2010 (r204841) @@ -31,7 +31,7 @@ */ #ifndef lint -static char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itojun Exp $"; +static const char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itojun Exp $"; #endif #include @@ -137,7 +137,7 @@ struct ifc *ifc; struct iff *iff_head; int nifc; /* number of valid ifc's */ struct ifc **index2ifc; -int nindex2ifc; +unsigned int nindex2ifc; struct ifc *loopifcp = NULL; /* pointing to loopback */ #ifdef HAVE_POLL_H struct pollfd set[2]; @@ -244,12 +244,13 @@ void applyplen(struct in6_addr *, int); void ifrtdump(int); void ifdump(int); void ifdump0(FILE *, const struct ifc *); +void ifremove(int); void rtdump(int); void rt_entry(struct rt_msghdr *, int); void rtdexit(void); void riprequest(struct ifc *, struct netinfo6 *, int, struct sockaddr_in6 *); -void ripflush(struct ifc *, struct sockaddr_in6 *); +void ripflush(struct ifc *, struct sockaddr_in6 *, int, struct netinfo6 *np); void sendrequest(struct ifc *); int sin6mask2len(const struct sockaddr_in6 *); int mask2len(const struct in6_addr *, int); @@ -297,7 +298,7 @@ main(argc, argv) unsigned long proto; struct ifc *ifcp; sigset_t mask, omask; - char *pidfile = ROUTE6D_PID; + const char *pidfile = ROUTE6D_PID; FILE *pidfh; char *progname; char *ep; @@ -783,13 +784,8 @@ init() /* * ripflush flushes the rip datagram stored in the rip buffer */ -static int nrt; -static struct netinfo6 *np; - void -ripflush(ifcp, sin6) - struct ifc *ifcp; - struct sockaddr_in6 *sin6; +ripflush(struct ifc *ifcp, struct sockaddr_in6 *sin6, int nrt, struct netinfo6 *np) { int i; int error; @@ -831,21 +827,19 @@ ripflush(ifcp, sin6) ifcp->ifc_name, inet6_n2p(&ifcp->ifc_ripsin.sin6_addr)); ifcp->ifc_flags &= ~IFF_UP; /* As if down for AF_INET6 */ } - nrt = 0; np = ripbuf->rip6_nets; } /* * Generate RIP6_RESPONSE packets and send them. */ void -ripsend(ifcp, sin6, flag) - struct ifc *ifcp; - struct sockaddr_in6 *sin6; - int flag; +ripsend(struct ifc *ifcp, struct sockaddr_in6 *sin6, int flag) { struct riprt *rrt; struct in6_addr *nh; /* next hop */ + struct netinfo6 *np; int maxrte; + int nrt; if (qflag) return; @@ -859,7 +853,9 @@ ripsend(ifcp, sin6, flag) sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); - nrt = 0; np = ripbuf->rip6_nets; nh = NULL; + nh = NULL; + nrt = 0; + np = ripbuf->rip6_nets; for (rrt = riprt; rrt; rrt = rrt->rrt_next) { if (rrt->rrt_rflags & RRTF_NOADVERTISE) continue; @@ -867,12 +863,14 @@ ripsend(ifcp, sin6, flag) *np = rrt->rrt_info; np++; nrt++; if (nrt == maxrte) { - ripflush(NULL, sin6); + ripflush(NULL, sin6, nrt, np); nh = NULL; + nrt = 0; + np = ripbuf->rip6_nets; } } if (nrt) /* Send last packet */ - ripflush(NULL, sin6); + ripflush(NULL, sin6, nrt, np); return; } @@ -896,7 +894,7 @@ ripsend(ifcp, sin6, flag) np = ripbuf->rip6_nets; *np = rrt_info; nrt = 1; - ripflush(ifcp, sin6); + ripflush(ifcp, sin6, nrt, np); return; } @@ -928,8 +926,13 @@ ripsend(ifcp, sin6, flag) !IN6_IS_ADDR_UNSPECIFIED(&rrt->rrt_gw) && (rrt->rrt_rflags & RRTF_NH_NOT_LLADDR) == 0) { if (nh == NULL || !IN6_ARE_ADDR_EQUAL(nh, &rrt->rrt_gw)) { - if (nrt == maxrte - 2) - ripflush(ifcp, sin6); + if (nrt == maxrte - 2) { + ripflush(ifcp, sin6, nrt, np); + nh = NULL; + nrt = 0; + np = ripbuf->rip6_nets; + } + np->rip6_dest = rrt->rrt_gw; if (IN6_IS_ADDR_LINKLOCAL(&np->rip6_dest)) SET_IN6_LINKLOCAL_IFINDEX(np->rip6_dest, 0); @@ -943,8 +946,12 @@ ripsend(ifcp, sin6, flag) !IN6_ARE_ADDR_EQUAL(nh, &rrt->rrt_gw) || rrt->rrt_rflags & RRTF_NH_NOT_LLADDR)) { /* Reset nexthop */ - if (nrt == maxrte - 2) - ripflush(ifcp, sin6); + if (nrt == maxrte - 2) { + ripflush(ifcp, sin6, nrt, np); + nh = NULL; + nrt = 0; + np = ripbuf->rip6_nets; + } memset(np, 0, sizeof(struct netinfo6)); np->rip6_metric = NEXTHOP_METRIC; nh = NULL; @@ -955,12 +962,14 @@ ripsend(ifcp, sin6, flag) *np = rrt->rrt_info; np++; nrt++; if (nrt == maxrte) { - ripflush(ifcp, sin6); + ripflush(ifcp, sin6, nrt, np); nh = NULL; + nrt = 0; + np = ripbuf->rip6_nets; } } if (nrt) /* Send last packet */ - ripflush(ifcp, sin6); + ripflush(ifcp, sin6, nrt, np); } /* @@ -1201,7 +1210,7 @@ riprecv() if (idx && IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr)) SET_IN6_LINKLOCAL_IFINDEX(fsock.sin6_addr, idx); - if (len < sizeof(struct rip6)) { + if ((size_t)len < sizeof(struct rip6)) { trace(1, "Packet too short\n"); return; } @@ -1736,7 +1745,7 @@ void rtrecv() { char buf[BUFSIZ]; - char *p, *q; + char *p, *q = NULL; struct rt_msghdr *rtm; struct ifa_msghdr *ifam; struct if_msghdr *ifm; @@ -1746,7 +1755,7 @@ rtrecv() int iface = 0, rtable = 0; struct sockaddr_in6 *rta[RTAX_MAX]; struct sockaddr_in6 mask; - int i, addrs; + int i, addrs = 0; struct riprt *rrt; if ((len = read(rtsock, buf, sizeof(buf))) < 0) { @@ -2735,7 +2744,7 @@ rt_entry(rtm, again) char *rtmp, *ifname = NULL; struct riprt *rrt, *orrt; struct netinfo6 *np; - int s; + int ifindex; sin6_dst = sin6_gw = sin6_mask = sin6_genmask = sin6_ifp = 0; if ((rtm->rtm_flags & RTF_UP) == 0 || rtm->rtm_flags & @@ -2759,6 +2768,9 @@ rt_entry(rtm, again) */ if (Qflag && !(rtm->rtm_flags & Qflag)) return; + /* XXX: Ignore connected routes. */ + if (!(rtm->rtm_flags & RTF_GATEWAY)) + return; /* * do not look at dynamic routes. * netbsd/openbsd cloned routes have UGHD. @@ -2855,16 +2867,16 @@ rt_entry(rtm, again) trace(1, " gw %s", inet6_n2p(&rrt->rrt_gw)); /* Interface */ - s = rtm->rtm_index; - if (s < nindex2ifc && index2ifc[s]) - ifname = index2ifc[s]->ifc_name; + ifindex = rtm->rtm_index; + if ((unsigned int)ifindex < nindex2ifc && index2ifc[ifindex]) + ifname = index2ifc[ifindex]->ifc_name; else { trace(1, " not configured\n"); free(rrt); return; } - trace(1, " if %s sock %d", ifname, s); - rrt->rrt_index = s; + trace(1, " if %s sock %d", ifname, ifindex); + rrt->rrt_index = ifindex; trace(1, "\n"); @@ -3127,7 +3139,7 @@ ifdump(sig) if (iff_find(ifcp, IFIL_TYPE_N) != NULL) continue; } else { - if (ifcp->ifc_flags & IFF_UP != 0 && + if ((ifcp->ifc_flags & IFF_UP) && iff_find(ifcp, IFIL_TYPE_N) == NULL) continue; } From owner-svn-src-user@FreeBSD.ORG Sun Mar 7 21:39:48 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EEA61065675; Sun, 7 Mar 2010 21:39:48 +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 0D88E8FC0A; Sun, 7 Mar 2010 21:39:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o27LdloC071671; Sun, 7 Mar 2010 21:39:47 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27LdlwX071668; Sun, 7 Mar 2010 21:39:47 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003072139.o27LdlwX071668@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 7 Mar 2010 21:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204847 - user/edwin/ncal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 21:39:48 -0000 Author: edwin Date: Sun Mar 7 21:39:47 2010 New Revision: 204847 URL: http://svn.freebsd.org/changeset/base/204847 Log: - split highlighting-of-today code from the calculate-the-month code. - in case the output is not a terminal, use the _ backspace trick to highlight (keeps less(1) happy). Modified: user/edwin/ncal/Makefile user/edwin/ncal/ncal.c Modified: user/edwin/ncal/Makefile ============================================================================== --- user/edwin/ncal/Makefile Sun Mar 7 21:27:47 2010 (r204846) +++ user/edwin/ncal/Makefile Sun Mar 7 21:39:47 2010 (r204847) @@ -4,7 +4,6 @@ PROG= ncal DPADD= ${LIBCALENDAR} ${LIBTERMCAP} LDADD= -lcalendar -ltermcap -WARNS?= 6 LINKS= ${BINDIR}/ncal ${BINDIR}/cal MLINKS= ncal.1 cal.1 Modified: user/edwin/ncal/ncal.c ============================================================================== --- user/edwin/ncal/ncal.c Sun Mar 7 21:27:47 2010 (r204846) +++ user/edwin/ncal/ncal.c Sun Mar 7 21:39:47 2010 (r204847) @@ -159,10 +159,10 @@ char jdaystr[] = " 1 2 3 4 " 350 351 352 353 354 355 356 357 358 359" " 360 361 362 363 364 365 366"; +int flag_nohighlight; /* user doesn't want a highlighted today */ int flag_weeks; /* user wants number of week */ int nswitch; /* user defined switch date */ int nswitchb; /* switch date for backward compatibility */ -const char *term_so, *term_se; int today; char *center(char *s, char *t, int w); @@ -181,6 +181,7 @@ int sndaysb(struct date * d); static void usage(void); void monthranger(int year, int jd_flag, int m, int before, int after); void monthrangeb(int year, int jd_flag, int m, int before, int after); +void highlight(char *dst, char *src, int len, int *extraletters); int main(int argc, char *argv[]) @@ -204,15 +205,9 @@ main(int argc, char *argv[]) char *flag_highlightdate = NULL; int before, after; const char *locale; /* locale to get country code */ - char tbuf[1024], cbuf[512], *b; - /* On how to highlight on this terminal */ - term_se = term_so = NULL; - if (isatty(STDOUT_FILENO) && tgetent(tbuf, NULL) == 1) { - b = cbuf; - term_so = tgetstr("so", &b); - term_se = tgetstr("se", &b); - } + flag_nohighlight = 0; + flag_weeks = 0; /* * Use locale to determine the country code, @@ -283,7 +278,7 @@ main(int argc, char *argv[]) flag_highlightdate = optarg; break; case 'h': - term_so = term_se = NULL; + flag_nohighlight = 1; break; case 'e': if (flag_backward) @@ -723,27 +718,14 @@ mkmonthr(int y, int m, int jd_flag, stru for (i = 0; i != 7; i++) { l = 0; for (j = firstm + i, k = 0; j < last; j += 7, k += dw) { - if (j == today && - (term_so != NULL && term_se != NULL)) { - l = strlen(term_so); + if (j == today && !flag_nohighlight) { if (jd_flag) dt.d = j - jan1 + 1; else sdater(j, &dt); - /* separator */ - mlines->lines[i][k] = ' '; - /* the actual text */ - memcpy(mlines->lines[i] + k + l, - ds + dt.d * dw, dw); - /* highlight on */ - memcpy(mlines->lines[i] + k + 1, term_so, l); - /* highlight off */ - memcpy(mlines->lines[i] + k + l + dw, term_se, - strlen(term_se)); - l = strlen(term_se) + strlen(term_so); - continue; - } - if (j >= first) { + highlight(mlines->lines[i] + k, ds + dt.d * dw, + dw, &l); + } else if (j >= first) { if (jd_flag) dt.d = j - jan1 + 1; else @@ -843,27 +825,14 @@ mkmonthb(int y, int m, int jd_flag, stru l = 0; for (j = firsts + 7 * i, k = 0; j < last && k != dw * 7; j++, k += dw) { - if (j == today && - (term_so != NULL && term_se != NULL)) { - l = strlen(term_so); + if (j == today && !flag_nohighlight) { if (jd_flag) dt.d = j - jan1 + 1; else sdateb(j, &dt); - /* separator */ - mlines->lines[i][k] = ' '; - /* the actual text */ - memcpy(mlines->lines[i] + k + l, - ds + dt.d * dw, dw); - /* highlight on */ - memcpy(mlines->lines[i] + k + 1, term_so, l); - /* highlight off */ - memcpy(mlines->lines[i] + k + l + dw, term_se, - strlen(term_se)); - l = strlen(term_se) + strlen(term_so); - continue; - } - if (j >= first) { + highlight(mlines->lines[i] + k, ds + dt.d * dw, + dw, &l); + } else if (j >= first) { if (jd_flag) dt.d = j - jan1 + 1; else @@ -1037,3 +1006,70 @@ parsemonth(const char *s, int *m, int *y } return (1); } + +void +highlight(char *dst, char *src, int len, int *extralen) +{ + static int first = 1; + static const char *term_so, *term_se; + + if (first) { + char tbuf[1024], cbuf[512], *b; + + term_se = term_so = NULL; + + /* On how to highlight on this terminal */ + if (isatty(STDOUT_FILENO) && tgetent(tbuf, NULL) == 1) { + b = cbuf; + term_so = tgetstr("so", &b); + term_se = tgetstr("se", &b); + } + + first = 0; + } + + /* This check is not necessary */ + if (flag_nohighlight) { + memcpy(dst, src, len); + return; + } + + /* If it is a real terminal, use the data from the termcap database. */ + if (term_so != NULL && term_se != NULL) { + /* separator */ + dst[0] = ' '; + dst++; + /* highlight on */ + memcpy(dst, term_so, strlen(term_so)); + dst += strlen(term_so); + /* the actual text (minus leading space) */ + len--; + src++; + memcpy(dst, src, len); + dst += len; + /* highlight off */ + memcpy(dst, term_se, strlen(term_se)); + *extralen = strlen(term_so) + strlen(term_se); + return; + } + + /* + * Otherwise, print a _, backspace and the letter + */ + *extralen = 0; + /* skip leading space */ + src++; + len--; + /* separator */ + dst[0] = ' '; + dst++; + while (len > 0) { + /* _ and backspace */ + memcpy(dst, "_\010", 2); + dst += 2; + *extralen += 2; + /* the character */ + *dst++ = *src++; + len--; + } +} From owner-svn-src-user@FreeBSD.ORG Sun Mar 7 21:50:41 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0517C1065670; Sun, 7 Mar 2010 21:50: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 CDF928FC08; Sun, 7 Mar 2010 21:50: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 o27Loepj074605; Sun, 7 Mar 2010 21:50:40 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27Loe3B074603; Sun, 7 Mar 2010 21:50:40 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003072150.o27Loe3B074603@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 7 Mar 2010 21:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204848 - user/edwin/ncal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 21:50:41 -0000 Author: edwin Date: Sun Mar 7 21:50:40 2010 New Revision: 204848 URL: http://svn.freebsd.org/changeset/base/204848 Log: Cleanup duplicate code into a single path. Modified: user/edwin/ncal/ncal.c Modified: user/edwin/ncal/ncal.c ============================================================================== --- user/edwin/ncal/ncal.c Sun Mar 7 21:39:47 2010 (r204847) +++ user/edwin/ncal/ncal.c Sun Mar 7 21:50:40 2010 (r204848) @@ -718,20 +718,17 @@ mkmonthr(int y, int m, int jd_flag, stru for (i = 0; i != 7; i++) { l = 0; for (j = firstm + i, k = 0; j < last; j += 7, k += dw) { - if (j == today && !flag_nohighlight) { + if (j >= first) { if (jd_flag) dt.d = j - jan1 + 1; else sdater(j, &dt); - highlight(mlines->lines[i] + k, ds + dt.d * dw, - dw, &l); - } else if (j >= first) { - if (jd_flag) - dt.d = j - jan1 + 1; + if (j == today && !flag_nohighlight) + highlight(mlines->lines[i] + k, + ds + dt.d * dw, dw, &l); else - sdater(j, &dt); - memcpy(mlines->lines[i] + k + l, - ds + dt.d * dw, dw); + memcpy(mlines->lines[i] + k + l, + ds + dt.d * dw, dw); } else memcpy(mlines->lines[i] + k + l, " ", dw); } @@ -825,20 +822,17 @@ mkmonthb(int y, int m, int jd_flag, stru l = 0; for (j = firsts + 7 * i, k = 0; j < last && k != dw * 7; j++, k += dw) { - if (j == today && !flag_nohighlight) { + if (j >= first) { if (jd_flag) dt.d = j - jan1 + 1; else sdateb(j, &dt); - highlight(mlines->lines[i] + k, ds + dt.d * dw, - dw, &l); - } else if (j >= first) { - if (jd_flag) - dt.d = j - jan1 + 1; + if (j == today && !flag_nohighlight) + highlight(mlines->lines[i] + k, + ds + dt.d * dw, dw, &l); else - sdateb(j, &dt); - memcpy(mlines->lines[i] + k + l, - ds + dt.d * dw, dw); + memcpy(mlines->lines[i] + k + l, + ds + dt.d * dw, dw); } else memcpy(mlines->lines[i] + k + l, " ", dw); } @@ -1018,7 +1012,7 @@ highlight(char *dst, char *src, int len, term_se = term_so = NULL; - /* On how to highlight on this terminal */ + /* On how to highlight on this type of terminal (if any) */ if (isatty(STDOUT_FILENO) && tgetent(tbuf, NULL) == 1) { b = cbuf; term_so = tgetstr("so", &b); @@ -1028,7 +1022,10 @@ highlight(char *dst, char *src, int len, first = 0; } - /* This check is not necessary */ + /* + * This check is not necessary, should have been handled before calling + * this function. + */ if (flag_nohighlight) { memcpy(dst, src, len); return; From owner-svn-src-user@FreeBSD.ORG Sun Mar 7 23:58:45 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1110106564A; Sun, 7 Mar 2010 23:58:44 +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 CCB4D8FC15; Sun, 7 Mar 2010 23:58: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 o27Nwi45010163; Sun, 7 Mar 2010 23:58:44 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27Nwicr010160; Sun, 7 Mar 2010 23:58:44 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201003072358.o27Nwicr010160@svn.freebsd.org> From: Kip Macy Date: Sun, 7 Mar 2010 23:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204851 - in user/kmacy/head_page_lock/sys: amd64/amd64 amd64/include cddl/contrib/opensolaris/uts/common/fs/zfs dev/md kern nfsclient ufs/ffs vm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 23:58:45 -0000 Author: kmacy Date: Sun Mar 7 23:58:44 2010 New Revision: 204851 URL: http://svn.freebsd.org/changeset/base/204851 Log: This is the second iteration of incorporating Jeffr's patch to break down the vm_page_queue mutex for operations which don't actually manipulate the page queues in to a hashed set of locks. This time around, rather than exposing ourselves to a race condition by dropping the locks in pmap_collect, I have eliminated the need for pmap_collect altogether by pre-allocating any necessary pv_entrys before changing any pmap state. This complicated calls to demote slightly, but can probably be simplified later. Modified: user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c user/kmacy/head_page_lock/sys/amd64/include/pmap.h user/kmacy/head_page_lock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/kmacy/head_page_lock/sys/dev/md/md.c user/kmacy/head_page_lock/sys/kern/kern_exec.c user/kmacy/head_page_lock/sys/kern/subr_uio.c user/kmacy/head_page_lock/sys/kern/subr_witness.c user/kmacy/head_page_lock/sys/kern/sys_pipe.c user/kmacy/head_page_lock/sys/kern/sys_process.c user/kmacy/head_page_lock/sys/kern/uipc_cow.c user/kmacy/head_page_lock/sys/kern/uipc_shm.c user/kmacy/head_page_lock/sys/kern/uipc_syscalls.c user/kmacy/head_page_lock/sys/kern/vfs_bio.c user/kmacy/head_page_lock/sys/nfsclient/nfs_bio.c user/kmacy/head_page_lock/sys/ufs/ffs/ffs_vnops.c user/kmacy/head_page_lock/sys/vm/device_pager.c user/kmacy/head_page_lock/sys/vm/pmap.h user/kmacy/head_page_lock/sys/vm/sg_pager.c user/kmacy/head_page_lock/sys/vm/swap_pager.c user/kmacy/head_page_lock/sys/vm/uma_core.c user/kmacy/head_page_lock/sys/vm/vm_contig.c user/kmacy/head_page_lock/sys/vm/vm_fault.c user/kmacy/head_page_lock/sys/vm/vm_glue.c user/kmacy/head_page_lock/sys/vm/vm_kern.c user/kmacy/head_page_lock/sys/vm/vm_map.c user/kmacy/head_page_lock/sys/vm/vm_mmap.c user/kmacy/head_page_lock/sys/vm/vm_object.c user/kmacy/head_page_lock/sys/vm/vm_page.c user/kmacy/head_page_lock/sys/vm/vm_page.h user/kmacy/head_page_lock/sys/vm/vm_pageout.c user/kmacy/head_page_lock/sys/vm/vnode_pager.c Modified: user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c ============================================================================== --- user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c Sun Mar 7 22:37:35 2010 (r204850) +++ user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c Sun Mar 7 23:58:44 2010 (r204851) @@ -167,9 +167,29 @@ __FBSDID("$FreeBSD$"); #define PV_STAT(x) do { } while (0) #endif +#define CACHE_LINE_FETCH_SIZE 128 +#define PA_LOCK_PAD CACHE_LINE_FETCH_SIZE + +struct vp_lock { + struct mtx vp_lock; + unsigned char pad[(PA_LOCK_PAD - sizeof(struct mtx))]; +}; + #define pa_index(pa) ((pa) >> PDRSHIFT) #define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) +#define PA_LOCKPTR(pa) &pa_lock[pa_index((pa)) % PA_LOCK_COUNT].vp_lock +#define PA_LOCK(pa) mtx_lock(PA_LOCKPTR(pa)) +#define PA_TRYLOCK(pa) mtx_trylock(PA_LOCKPTR(pa)) +#define PA_UNLOCK(pa) mtx_unlock(PA_LOCKPTR(pa)) +#define PA_LOCK_ASSERT(pa, a) mtx_assert(PA_LOCKPTR(pa), (a)) + +#define PA_LOCK_COUNT 64 + +struct mtx pv_lock __aligned(128); +struct vp_lock pa_lock[PA_LOCK_COUNT] __aligned(128); + + struct pmap kernel_pmap_store; vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ @@ -188,6 +208,15 @@ static int pg_ps_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, "Are large page mappings enabled?"); +static uint64_t pmap_tryrelock_calls; +SYSCTL_QUAD(_vm_pmap, OID_AUTO, tryrelock_calls, CTLFLAG_RD, + &pmap_tryrelock_calls, 0, "Number of tryrelock calls"); + +static int pmap_tryrelock_restart; +SYSCTL_INT(_vm_pmap, OID_AUTO, tryrelock_restart, CTLFLAG_RD, + &pmap_tryrelock_restart, 0, "Number of tryrelock restarts"); + + static u_int64_t KPTphys; /* phys addr of kernel level 1 */ static u_int64_t KPDphys; /* phys addr of kernel level 2 */ u_int64_t KPDPphys; /* phys addr of kernel level 3 */ @@ -215,8 +244,9 @@ caddr_t CADDR1 = 0; static caddr_t crashdumpmap; static void free_pv_entry(pmap_t pmap, pv_entry_t pv); -static pv_entry_t get_pv_entry(pmap_t locked_pmap, int try); -static void pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); +static pv_entry_t get_pv_entry(pmap_t locked_pmap); +static void pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct pv_list_head *pv_list); static boolean_t pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); static void pmap_pv_promote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); @@ -225,7 +255,8 @@ static pv_entry_t pmap_pvh_remove(struct static int pmap_pvh_wired_mappings(struct md_page *pvh, int count); static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode); -static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); +static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, + struct pv_list_head *pv_list); static boolean_t pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va); static boolean_t pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t m, @@ -244,7 +275,7 @@ static boolean_t pmap_protect_pde(pmap_t vm_prot_t prot); static void pmap_pte_attr(pt_entry_t *pte, int cache_bits); static int pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, - vm_page_t *free); + vm_page_t *free, struct pv_list_head *pv_list); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, pd_entry_t ptepde, vm_page_t *free); static void pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte); @@ -252,14 +283,14 @@ static void pmap_remove_page(pmap_t pmap vm_page_t *free); static void pmap_remove_entry(struct pmap *pmap, vm_page_t m, vm_offset_t va); -static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); -static vm_page_t pmap_allocpde(pmap_t pmap, vm_offset_t va, int flags); -static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); +static vm_page_t pmap_allocpde(pmap_t pmap, vm_paddr_t pa, vm_offset_t va, int flags); +static vm_page_t pmap_allocpte(pmap_t pmap, vm_paddr_t pa, vm_offset_t va, int flags); -static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, int flags); +static vm_page_t _pmap_allocpte(pmap_t pmap, vm_paddr_t pa, vm_pindex_t ptepindex, + int flags); static int _pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t* free); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t, vm_page_t *); @@ -268,6 +299,76 @@ static vm_offset_t pmap_kmem_choose(vm_o CTASSERT(1 << PDESHIFT == sizeof(pd_entry_t)); CTASSERT(1 << PTESHIFT == sizeof(pt_entry_t)); + +#define LS_MAX 4 +struct lock_stack { + struct mtx *ls_array[LS_MAX]; + int ls_top; +}; + +static void +ls_init(struct lock_stack *ls) +{ + + ls->ls_top = 0; +} + +static void +ls_push(struct lock_stack *ls, struct mtx *lock) +{ + + KASSERT(ls->ls_top < LS_MAX, ("lock stack overflow")); + + ls->ls_array[ls->ls_top] = lock; + ls->ls_top++; + mtx_lock(lock); +} + + +static int +ls_trypush(struct lock_stack *ls, struct mtx *lock) +{ + + KASSERT(ls->ls_top < LS_MAX, ("lock stack overflow")); + + if (mtx_trylock(lock) == 0) + return (0); + + ls->ls_array[ls->ls_top] = lock; + ls->ls_top++; + return (1); +} + +#ifdef notyet +static void +ls_pop(struct lock_stack *ls) +{ + struct mtx *lock; + + KASSERT(ls->ls_top > 0, ("lock stack underflow")); + + ls->ls_top--; + lock = ls->ls_array[ls->ls_top]; + mtx_unlock(lock); +} +#endif + +static void +ls_popa(struct lock_stack *ls) +{ + struct mtx *lock; + + KASSERT(ls->ls_top > 0, ("lock stack underflow")); + + while (ls->ls_top > 0) { + ls->ls_top--; + lock = ls->ls_array[ls->ls_top]; + mtx_unlock(lock); + } +} +#ifdef INVARIANTS +extern void kdb_backtrace(void); +#endif /* * Move the kernel virtual free pointer to the next * 2MB. This is used to help improve performance @@ -417,6 +518,37 @@ vtopde(vm_offset_t va) return (PDmap + ((va >> PDRSHIFT) & mask)); } +/* + * Try to acquire a physical address lock while a pmap is locked. If we + * fail to trylock we unlock and lock the pmap directly and cache the + * locked pa in *locked. The caller should then restart their loop in case + * the virtual to physical mapping has changed. + */ +static int +pa_tryrelock(pmap_t pmap, vm_paddr_t pa, vm_paddr_t *locked) +{ + vm_paddr_t lockpa; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + atomic_add_long((volatile long *)&pmap_tryrelock_calls, 1); + lockpa = *locked; + *locked = pa; + if (lockpa) { + PA_LOCK_ASSERT(lockpa, MA_OWNED); + if (PA_LOCKPTR(pa) == PA_LOCKPTR(lockpa)) + return (0); + PA_UNLOCK(lockpa); + } + if (PA_TRYLOCK(pa)) + return 0; + PMAP_UNLOCK(pmap); + PA_LOCK(pa); + PMAP_LOCK(pmap); + atomic_add_int((volatile int *)&pmap_tryrelock_restart, 1); + + return (EAGAIN); +} + static u_int64_t allocpages(vm_paddr_t *firstaddr, int n) { @@ -526,6 +658,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) { vm_offset_t va; pt_entry_t *pte, *unused; + int i; /* * Create an initial set of page tables to run the kernel in. @@ -577,6 +710,13 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* Initialize the PAT MSR. */ pmap_init_pat(); + + /* Setup page locks. */ + for (i = 0; i < PA_LOCK_COUNT; i++) + mtx_init(&pa_lock[i].vp_lock, "page lock", NULL, + MTX_DEF | MTX_RECURSE | MTX_DUPOK); + mtx_init(&pv_lock, "pv list lock", NULL, MTX_DEF); + } /* @@ -650,6 +790,14 @@ pmap_page_init(vm_page_t m) m->md.pat_mode = PAT_WRITE_BACK; } +struct mtx * +pmap_page_lockptr(vm_page_t m) +{ + + KASSERT(m != NULL, ("pmap_page_lockptr: NULL page")); + return (PA_LOCKPTR(VM_PAGE_TO_PHYS(m))); +} + /* * Initialize the pmap module. * Called by vm_init, to initialize any structures that the pmap @@ -1070,15 +1218,20 @@ pmap_extract_and_hold(pmap_t pmap, vm_of { pd_entry_t pde, *pdep; pt_entry_t pte; + vm_paddr_t pa; vm_page_t m; + pa = 0; m = NULL; - vm_page_lock_queues(); PMAP_LOCK(pmap); +retry: pdep = pmap_pde(pmap, va); if (pdep != NULL && (pde = *pdep)) { if (pde & PG_PS) { if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) { + if (pa_tryrelock(pmap, pde & PG_PS_FRAME, &pa)) + goto retry; + m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | (va & PDRMASK)); vm_page_hold(m); @@ -1087,12 +1240,15 @@ pmap_extract_and_hold(pmap_t pmap, vm_of pte = *pmap_pde_to_pte(pdep, va); if ((pte & PG_V) && ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) { + if (pa_tryrelock(pmap, pte & PG_FRAME, &pa)) + goto retry; m = PHYS_TO_VM_PAGE(pte & PG_FRAME); vm_page_hold(m); } } } - vm_page_unlock_queues(); + if (pa) + PA_UNLOCK(pa); PMAP_UNLOCK(pmap); return (m); } @@ -1490,7 +1646,7 @@ pmap_pinit(pmap_t pmap) * race conditions. */ static vm_page_t -_pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, int flags) +_pmap_allocpte(pmap_t pmap, vm_paddr_t pa, vm_pindex_t ptepindex, int flags) { vm_page_t m, pdppg, pdpg; @@ -1505,9 +1661,9 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { if (flags & M_WAITOK) { PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + PA_UNLOCK(pa); VM_WAIT; - vm_page_lock_queues(); + PA_LOCK(pa); PMAP_LOCK(pmap); } @@ -1547,7 +1703,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t pml4 = &pmap->pm_pml4[pml4index]; if ((*pml4 & PG_V) == 0) { /* Have to allocate a new pdp, recurse */ - if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index, + if (_pmap_allocpte(pmap, pa, NUPDE + NUPDPE + pml4index, flags) == NULL) { --m->wire_count; atomic_subtract_int(&cnt.v_wire_count, 1); @@ -1580,7 +1736,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t pml4 = &pmap->pm_pml4[pml4index]; if ((*pml4 & PG_V) == 0) { /* Have to allocate a new pd, recurse */ - if (_pmap_allocpte(pmap, NUPDE + pdpindex, + if (_pmap_allocpte(pmap, pa, NUPDE + pdpindex, flags) == NULL) { --m->wire_count; atomic_subtract_int(&cnt.v_wire_count, 1); @@ -1594,7 +1750,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t pdp = &pdp[pdpindex & ((1ul << NPDPEPGSHIFT) - 1)]; if ((*pdp & PG_V) == 0) { /* Have to allocate a new pd, recurse */ - if (_pmap_allocpte(pmap, NUPDE + pdpindex, + if (_pmap_allocpte(pmap, pa, NUPDE + pdpindex, flags) == NULL) { --m->wire_count; atomic_subtract_int(&cnt.v_wire_count, @@ -1621,7 +1777,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t } static vm_page_t -pmap_allocpde(pmap_t pmap, vm_offset_t va, int flags) +pmap_allocpde(pmap_t pmap, vm_paddr_t pa, vm_offset_t va, int flags) { vm_pindex_t pdpindex, ptepindex; pdp_entry_t *pdpe; @@ -1640,7 +1796,7 @@ retry: /* Allocate a pd page. */ ptepindex = pmap_pde_pindex(va); pdpindex = ptepindex >> NPDPEPGSHIFT; - pdpg = _pmap_allocpte(pmap, NUPDE + pdpindex, flags); + pdpg = _pmap_allocpte(pmap, pa, NUPDE + pdpindex, flags); if (pdpg == NULL && (flags & M_WAITOK)) goto retry; } @@ -1648,11 +1804,12 @@ retry: } static vm_page_t -pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags) +pmap_allocpte(pmap_t pmap, vm_paddr_t pa, vm_offset_t va, int flags) { vm_pindex_t ptepindex; pd_entry_t *pd; vm_page_t m; + struct pv_list_head pv_list; KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, @@ -1673,7 +1830,8 @@ retry: * normal 4K page. */ if (pd != NULL && (*pd & (PG_PS | PG_V)) == (PG_PS | PG_V)) { - if (!pmap_demote_pde(pmap, pd, va)) { + TAILQ_INIT(&pv_list); + if (!pmap_demote_pde(pmap, pd, va, &pv_list)) { /* * Invalidation of the 2MB page mapping may have caused * the deallocation of the underlying PD page. @@ -1694,7 +1852,7 @@ retry: * Here if the pte page isn't mapped, or if it has been * deallocated. */ - m = _pmap_allocpte(pmap, ptepindex, flags); + m = _pmap_allocpte(pmap, pa, ptepindex, flags); if (m == NULL && (flags & M_WAITOK)) goto retry; } @@ -1900,6 +2058,7 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_coll * allocate per-page pv entries until repromotion occurs, thereby * exacerbating the shortage of free pv entries. */ +#ifdef nomore static void pmap_collect(pmap_t locked_pmap, struct vpgqueues *vpq) { @@ -1915,8 +2074,8 @@ pmap_collect(pmap_t locked_pmap, struct if (m->hold_count || m->busy) continue; TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) { - va = pv->pv_va; pmap = PV_PMAP(pv); + va = pv->pv_va; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) PMAP_LOCK(pmap); @@ -1950,7 +2109,7 @@ pmap_collect(pmap_t locked_pmap, struct } } } - +#endif /* * free the pv_entry back to the free list @@ -1962,8 +2121,8 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv struct pv_chunk *pc; int idx, field, bit; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); + mtx_lock(&pv_lock); PV_STAT(pv_entry_frees++); PV_STAT(pv_entry_spare++); pv_entry_count--; @@ -1977,6 +2136,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv if (pc->pc_map[0] != PC_FREE0 || pc->pc_map[1] != PC_FREE1 || pc->pc_map[2] != PC_FREE2) { TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); + mtx_unlock(&pv_lock); return; } PV_STAT(pv_entry_spare -= _NPCPV); @@ -1985,7 +2145,10 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_unwire(m, 0); + mtx_unlock(&pv_lock); + KASSERT(m->wire_count == 1, ("wire_count == %d", m->wire_count)); + m->wire_count--; + atomic_subtract_int(&cnt.v_wire_count, 1); vm_page_free(m); } @@ -1994,7 +2157,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv * when needed. */ static pv_entry_t -get_pv_entry(pmap_t pmap, int try) +get_pv_entry(pmap_t pmap) { static const struct timeval printinterval = { 60, 0 }; static struct timeval lastprint; @@ -2006,7 +2169,7 @@ get_pv_entry(pmap_t pmap, int try) vm_page_t m; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + mtx_lock(&pv_lock); PV_STAT(pv_entry_allocs++); pv_entry_count++; if (pv_entry_count > pv_entry_high_water) @@ -2015,7 +2178,6 @@ get_pv_entry(pmap_t pmap, int try) "increasing either the vm.pmap.shpgperproc or the " "vm.pmap.pv_entry_max sysctl.\n"); pq = NULL; -retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); if (pc != NULL) { for (field = 0; field < _NPCM; field++) { @@ -2034,6 +2196,7 @@ retry: TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); } PV_STAT(pv_entry_spare--); + mtx_unlock(&pv_lock); return (pv); } } @@ -2042,26 +2205,10 @@ retry: VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (m == NULL) { - if (try) { - pv_entry_count--; - PV_STAT(pc_chunk_tryfail++); - return (NULL); - } - /* - * Reclaim pv entries: At first, destroy mappings to inactive - * pages. After that, if a pv chunk entry is still needed, - * destroy mappings to active pages. - */ - if (pq == NULL) { - PV_STAT(pmap_collect_inactive++); - pq = &vm_page_queues[PQ_INACTIVE]; - } else if (pq == &vm_page_queues[PQ_INACTIVE]) { - PV_STAT(pmap_collect_active++); - pq = &vm_page_queues[PQ_ACTIVE]; - } else - panic("get_pv_entry: increase vm.pmap.shpgperproc"); - pmap_collect(pmap, pq); - goto retry; + pv_entry_count--; + PV_STAT(pc_chunk_tryfail++); + mtx_unlock(&pv_lock); + return (NULL); } PV_STAT(pc_chunk_count++); PV_STAT(pc_chunk_allocs++); @@ -2075,9 +2222,64 @@ retry: pv = &pc->pc_pventry[0]; TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); PV_STAT(pv_entry_spare += _NPCPV - 1); + + mtx_unlock(&pv_lock); return (pv); } +static void +pmap_pv_list_free(pmap_t pmap, struct pv_list_head *pv_list) +{ + pv_entry_t pv; + + while (!TAILQ_EMPTY(pv_list)) { + pv = TAILQ_FIRST(pv_list); + TAILQ_REMOVE(pv_list, pv, pv_list); + free_pv_entry(pmap, pv); + } +} + +static boolean_t +pmap_pv_list_alloc(pmap_t pmap, int count, struct pv_list_head *pv_list) +{ + pv_entry_t pv; + int i; + boolean_t slept; + + slept = FALSE; + for (i = 0; i < count; i++) { + while ((pv = get_pv_entry(pmap)) == NULL) { + PMAP_UNLOCK(pmap); + slept = TRUE; + VM_WAIT; + PMAP_LOCK(pmap); + } + TAILQ_INSERT_HEAD(pv_list, pv, pv_list); + } + + return (slept); +} + +static boolean_t +pmap_pv_list_try_alloc(pmap_t pmap, int count, struct pv_list_head *pv_list) +{ + pv_entry_t pv; + int i; + boolean_t success; + + success = TRUE; + for (i = 0; i < count; i++) { + if ((pv = get_pv_entry(pmap)) == NULL) { + success = FALSE; + pmap_pv_list_free(pmap, pv_list); + goto done; + } + TAILQ_INSERT_HEAD(pv_list, pv, pv_list); + } +done: + return (success); +} + /* * First find and then remove the pv entry for the specified pmap and virtual * address from the specified pv list. Returns the pv entry if found and NULL @@ -2089,7 +2291,8 @@ pmap_pvh_remove(struct md_page *pvh, pma { pv_entry_t pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); @@ -2105,27 +2308,37 @@ pmap_pvh_remove(struct md_page *pvh, pma * entries for each of the 4KB page mappings. */ static void -pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa) +pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct pv_list_head *pv_list) { struct md_page *pvh; pv_entry_t pv; vm_offset_t va_last; vm_page_t m; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + PA_LOCK_ASSERT(pa, MA_OWNED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_demote_pde: pa is not 2mpage aligned")); - /* - * Transfer the 2mpage's pv entry for this mapping to the first - * page's pv list. - */ + /* Transfer the 2mpage's pv entry for this mapping to the first + * page's pv list. + */ pvh = pa_to_pvh(pa); va = trunc_2mpage(va); pv = pmap_pvh_remove(pvh, pmap, va); KASSERT(pv != NULL, ("pmap_pv_demote_pde: pv not found")); m = PHYS_TO_VM_PAGE(pa); +#ifdef INVARIANTS + if (va == 0) { + printf("inserting va==0\n"); + kdb_backtrace(); + } +#endif + vm_page_lock(m); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + vm_page_unlock(m); + /* Instantiate the remaining NPTEPG - 1 pv entries. */ va_last = va + NBPDR - PAGE_SIZE; do { @@ -2133,8 +2346,20 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("pmap_pv_demote_pde: page %p is not managed", m)); va += PAGE_SIZE; - pmap_insert_entry(pmap, va, m); + pv = TAILQ_FIRST(pv_list); + TAILQ_REMOVE(pv_list, pv, pv_list); +#ifdef INVARIANTS + if (va == 0) { + printf("inserting va==0\n"); + kdb_backtrace(); + } +#endif + pv->pv_va = va; + vm_page_lock(m); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + vm_page_unlock(m); } while (va < va_last); + } /* @@ -2150,7 +2375,7 @@ pmap_pv_promote_pde(pmap_t pmap, vm_offs vm_offset_t va_last; vm_page_t m; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + PA_LOCK_ASSERT(pa, MA_OWNED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_promote_pde: pa is not 2mpage aligned")); @@ -2196,7 +2421,8 @@ pmap_remove_entry(pmap_t pmap, vm_page_t { struct md_page *pvh; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_assert(m, MA_OWNED); + pmap_pvh_free(&m->md, pmap, va); if (TAILQ_EMPTY(&m->md.pv_list)) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -2206,22 +2432,6 @@ pmap_remove_entry(pmap_t pmap, vm_page_t } /* - * Create a pv entry for page at pa for - * (pmap, va). - */ -static void -pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m) -{ - pv_entry_t pv; - - PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - pv = get_pv_entry(pmap, FALSE); - pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); -} - -/* * Conditionally create a pv entry. */ static boolean_t @@ -2230,9 +2440,15 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm pv_entry_t pv; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_assert(m, MA_OWNED); if (pv_entry_count < pv_entry_high_water && - (pv = get_pv_entry(pmap, TRUE)) != NULL) { + (pv = get_pv_entry(pmap)) != NULL) { +#ifdef INVARIANTS + if (va == 0) { + printf("inserting va==0\n"); + kdb_backtrace(); + } +#endif pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); return (TRUE); @@ -2249,9 +2465,16 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse struct md_page *pvh; pv_entry_t pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + PA_LOCK_ASSERT(pa, MA_OWNED); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); if (pv_entry_count < pv_entry_high_water && - (pv = get_pv_entry(pmap, TRUE)) != NULL) { + (pv = get_pv_entry(pmap)) != NULL) { +#ifdef INVARIANTS + if (va == 0) { + printf("inserting va==0\n"); + kdb_backtrace(); + } +#endif pv->pv_va = va; pvh = pa_to_pvh(pa); TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_list); @@ -2279,7 +2502,8 @@ pmap_fill_ptp(pt_entry_t *firstpte, pt_e * mapping is invalidated. */ static boolean_t -pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) +pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, + struct pv_list_head *pv_list) { pd_entry_t newpde, oldpde; pt_entry_t *firstpte, newpte; @@ -2315,7 +2539,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { free = NULL; - pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free); + pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free, pv_list); pmap_invalidate_page(pmap, trunc_2mpage(va)); pmap_free_zero_pages(free); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx" @@ -2325,6 +2549,10 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t if (va < VM_MAXUSER_ADDRESS) pmap->pm_stats.resident_count++; } + if (TAILQ_EMPTY(pv_list) && ((oldpde & PG_MANAGED) != 0)) { + if (pmap_pv_list_try_alloc(pmap, NPTEPG-1, pv_list) == FALSE) + return (FALSE); + } mptepa = VM_PAGE_TO_PHYS(mpte); firstpte = (pt_entry_t *)PHYS_TO_DMAP(mptepa); newpde = mptepa | PG_M | PG_A | (oldpde & PG_U) | PG_RW | PG_V; @@ -2379,7 +2607,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t * the 2mpage to referencing the page table page. */ if ((oldpde & PG_MANAGED) != 0) - pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME); + pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME, pv_list); pmap_pde_demotions++; CTR2(KTR_PMAP, "pmap_demote_pde: success for va %#lx" @@ -2392,7 +2620,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t */ static int pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, - vm_page_t *free) + vm_page_t *free, struct pv_list_head *pv_list) { struct md_page *pvh; pd_entry_t oldpde; @@ -2419,6 +2647,10 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t eva = sva + NBPDR; for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); va < eva; va += PAGE_SIZE, m++) { + /* + * XXX do we need to individually lock each page? + * + */ if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); if (oldpde & PG_A) @@ -2429,7 +2661,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t } } if (pmap == kernel_pmap) { - if (!pmap_demote_pde(pmap, pdq, sva)) + if (!pmap_demote_pde(pmap, pdq, sva, pv_list)) panic("pmap_remove_pde: failed demotion"); } else { mpte = pmap_lookup_pt_page(pmap, sva); @@ -2446,6 +2678,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t return (pmap_unuse_pt(pmap, sva, *pmap_pdpe(pmap, sva), free)); } + /* * pmap_remove_pte: do the things to unmap a page in a process */ @@ -2469,6 +2702,7 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t pmap->pm_stats.resident_count -= 1; if (oldpte & PG_MANAGED) { m = PHYS_TO_VM_PAGE(oldpte & PG_FRAME); + vm_page_lock_assert(m, MA_OWNED); if ((oldpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); if (oldpte & PG_A) @@ -2485,6 +2719,7 @@ static void pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, vm_page_t *free) { pt_entry_t *pte; + vm_page_t m = NULL; PMAP_LOCK_ASSERT(pmap, MA_OWNED); if ((*pde & PG_V) == 0) @@ -2492,10 +2727,94 @@ pmap_remove_page(pmap_t pmap, vm_offset_ pte = pmap_pde_to_pte(pde, va); if ((*pte & PG_V) == 0) return; + if (*pte & PG_MANAGED) { + m = PHYS_TO_VM_PAGE(*pte & PG_FRAME); + if (vm_page_trylock(m) == 0) { + PMAP_UNLOCK(pmap); + vm_page_lock(m); + PMAP_LOCK(pmap); + } + } pmap_remove_pte(pmap, pte, va, *pde, free); + if (m != NULL) + vm_page_unlock(m); pmap_invalidate_page(pmap, va); } +static void +pmap_prealloc_pv_list(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + struct pv_list_head *pv_list) +{ + vm_offset_t va_next; + pml4_entry_t *pml4e; + pdp_entry_t *pdpe; + pd_entry_t ptpaddr, *pde; + pt_entry_t *pte; + int i, alloc_count; + + alloc_count = 0; + PMAP_LOCK(pmap); + for (; sva < eva; sva = va_next) { + + pml4e = pmap_pml4e(pmap, sva); + if ((*pml4e & PG_V) == 0) { + va_next = (sva + NBPML4) & ~PML4MASK; + if (va_next < sva) + va_next = eva; + continue; + } + + pdpe = pmap_pml4e_to_pdpe(pml4e, sva); + if ((*pdpe & PG_V) == 0) { + va_next = (sva + NBPDP) & ~PDPMASK; + if (va_next < sva) + va_next = eva; + continue; + } + + /* + * Calculate index for next page table. + */ + va_next = (sva + NBPDR) & ~PDRMASK; + if (va_next < sva) + va_next = eva; + + pde = pmap_pdpe_to_pde(pdpe, sva); + ptpaddr = *pde; + + /* + * Weed out invalid mappings. + */ + if (ptpaddr == 0) + continue; + + /* + * Check for large page. + */ + if ((ptpaddr & PG_PS) != 0) { + alloc_count++; + continue; + } + /* + * Limit our scan to either the end of the va represented + * by the current page table page, or to the end of the + * range being removed. + */ + if (va_next > eva) + va_next = eva; + + for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, + sva += PAGE_SIZE) { + if (*pte == 0) + continue; + } + } + for (i = 0; i < alloc_count; i++) + pmap_pv_list_alloc(pmap, NPTEPG-1, pv_list); + + PMAP_UNLOCK(pmap); +} + /* * Remove the given range of addresses from the specified map. * @@ -2510,7 +2829,9 @@ pmap_remove(pmap_t pmap, vm_offset_t sva pdp_entry_t *pdpe; pd_entry_t ptpaddr, *pde; pt_entry_t *pte; + vm_paddr_t pa; vm_page_t free = NULL; + struct pv_list_head pv_list; int anyvalid; /* @@ -2519,11 +2840,19 @@ pmap_remove(pmap_t pmap, vm_offset_t sva if (pmap->pm_stats.resident_count == 0) return; - anyvalid = 0; + pa = anyvalid = 0; + TAILQ_INIT(&pv_list); - vm_page_lock_queues(); - PMAP_LOCK(pmap); + /* + * pre-allocate pvs + * + */ + if ((pmap == kernel_pmap) && + (sva + PAGE_SIZE != eva)) + pmap_prealloc_pv_list(pmap, sva, eva, &pv_list); + PMAP_LOCK(pmap); +restart: /* * special handling of removing one page. a very * common operation and easy to short circuit some @@ -2578,6 +2907,11 @@ pmap_remove(pmap_t pmap, vm_offset_t sva * Check for large page. */ if ((ptpaddr & PG_PS) != 0) { + if (pa_tryrelock(pmap, ptpaddr & PG_FRAME, &pa)) { + va_next = sva; + continue; + } + /* * Are we removing the entire large page? If not, * demote the mapping and fall through. @@ -2589,9 +2923,9 @@ pmap_remove(pmap_t pmap, vm_offset_t sva */ if ((ptpaddr & PG_G) == 0) anyvalid = 1; - pmap_remove_pde(pmap, pde, sva, &free); + pmap_remove_pde(pmap, pde, sva, &free, &pv_list); continue; - } else if (!pmap_demote_pde(pmap, pde, sva)) { + } else if (!pmap_demote_pde(pmap, pde, sva, &pv_list)) { /* The large page mapping was destroyed. */ continue; } else @@ -2608,23 +2942,46 @@ pmap_remove(pmap_t pmap, vm_offset_t sva for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, sva += PAGE_SIZE) { + int ret; + vm_page_t m = NULL; + if (*pte == 0) continue; + if (*pte & PG_MANAGED) { + m = PHYS_TO_VM_PAGE(*pte & PG_FRAME); + if (vm_page_trylock(m) == 0) { + PMAP_UNLOCK(pmap); + vm_page_lock(m); + PMAP_LOCK(pmap); + } + if (*pte != *pmap_pde_to_pte(pde, sva)) { + vm_page_unlock(m); + goto restart; + } + } /* * The TLB entry for a PG_G mapping is invalidated * by pmap_remove_pte(). */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 01:51:15 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424CC106564A; Mon, 8 Mar 2010 01:51:15 +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 321E18FC13; Mon, 8 Mar 2010 01:51: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 o281pEfO037618; Mon, 8 Mar 2010 01:51:14 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o281pE60037616; Mon, 8 Mar 2010 01:51:14 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201003080151.o281pE60037616@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Mar 2010 01:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204852 - user/kmacy/head_page_lock/sys/vm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 01:51:15 -0000 Author: kmacy Date: Mon Mar 8 01:51:14 2010 New Revision: 204852 URL: http://svn.freebsd.org/changeset/base/204852 Log: fix merge errors in vm_pageout - remove write from pages to be swapped - don't hold lock across vm_pageout_flush Modified: user/kmacy/head_page_lock/sys/vm/vm_pageout.c Modified: user/kmacy/head_page_lock/sys/vm/vm_pageout.c ============================================================================== --- user/kmacy/head_page_lock/sys/vm/vm_pageout.c Sun Mar 7 23:58:44 2010 (r204851) +++ user/kmacy/head_page_lock/sys/vm/vm_pageout.c Mon Mar 8 01:51:14 2010 (r204852) @@ -277,8 +277,7 @@ vm_pageout_fallback_object_lock(vm_page_ * late and we cannot do anything that will mess with the page. */ static int -vm_pageout_clean(m) - vm_page_t m; +vm_pageout_clean(vm_page_t m) { vm_object_t object; vm_page_t mc[2*vm_pageout_page_count]; @@ -286,7 +285,8 @@ vm_pageout_clean(m) int ib, is, page_base; vm_pindex_t pindex = m->pindex; - vm_page_lock_assert(m, MA_OWNED); + vm_page_lock_assert(m, MA_NOTOWNED); + vm_page_lock(m); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); /* @@ -303,6 +303,7 @@ vm_pageout_clean(m) */ if ((m->hold_count != 0) || ((m->busy != 0) || (m->oflags & VPO_BUSY))) { + vm_page_unlock(m); return 0; } mc[vm_pageout_page_count] = m; @@ -402,6 +403,7 @@ more: if (ib && pageout_count < vm_pageout_page_count) goto more; + vm_page_unlock(m); /* * we allow reads during pageouts... */ @@ -437,6 +439,10 @@ vm_pageout_flush(vm_page_t *mc, int coun KASSERT(mc[i]->valid == VM_PAGE_BITS_ALL, ("vm_pageout_flush: partially invalid page %p index %d/%d", mc[i], i, count)); + vm_page_io_start(mc[i]); + vm_page_lock(mc[i]); + pmap_remove_write(mc[i]); + vm_page_unlock(mc[i]); } vm_object_pip_add(object, count); @@ -1019,6 +1025,8 @@ rescan0: goto unlock_and_continue; } } + vm_page_unlock(m); + /* * If a page is dirty, then it is either being washed From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 03:20:27 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17DB41065670; Mon, 8 Mar 2010 03:20:27 +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 E28F48FC0C; Mon, 8 Mar 2010 03:20: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 o283KQ5I058678; Mon, 8 Mar 2010 03:20:26 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o283KQRI058677; Mon, 8 Mar 2010 03:20:26 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201003080320.o283KQRI058677@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Mar 2010 03:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204853 - user/kmacy/releng_8_page_lock X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 03:20:27 -0000 Author: kmacy Date: Mon Mar 8 03:20:26 2010 New Revision: 204853 URL: http://svn.freebsd.org/changeset/base/204853 Log: create branch for integrating page lock in to stable/8 Added: - copied from r204852, stable/8/ Directory Properties: user/kmacy/releng_8_page_lock/ (props changed) From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 04:56:40 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABEA0106564A; Mon, 8 Mar 2010 04:56:40 +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 9C4D38FC0C; Mon, 8 Mar 2010 04:56: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 o284ueFU082842; Mon, 8 Mar 2010 04:56:40 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o284ueXK082841; Mon, 8 Mar 2010 04:56:40 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201003080456.o284ueXK082841@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Mar 2010 04:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204854 - user/kmacy/head_page_lock/sys/amd64/amd64 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 04:56:40 -0000 Author: kmacy Date: Mon Mar 8 04:56:39 2010 New Revision: 204854 URL: http://svn.freebsd.org/changeset/base/204854 Log: switch to pa_retrylock to avoid deadlock with a previously acquired superpage Modified: user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c Modified: user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c ============================================================================== --- user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c Mon Mar 8 03:20:26 2010 (r204853) +++ user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c Mon Mar 8 04:56:39 2010 (r204854) @@ -2943,23 +2943,14 @@ restart: for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, sva += PAGE_SIZE) { int ret; - vm_page_t m = NULL; if (*pte == 0) continue; - if (*pte & PG_MANAGED) { - m = PHYS_TO_VM_PAGE(*pte & PG_FRAME); - if (vm_page_trylock(m) == 0) { - PMAP_UNLOCK(pmap); - vm_page_lock(m); - PMAP_LOCK(pmap); - } - if (*pte != *pmap_pde_to_pte(pde, sva)) { - vm_page_unlock(m); - goto restart; - } - } + if ((*pte & PG_MANAGED) && + pa_tryrelock(pmap, *pte & PG_FRAME, &pa)) + goto restart; + /* * The TLB entry for a PG_G mapping is invalidated * by pmap_remove_pte(). @@ -2968,8 +2959,10 @@ restart: anyvalid = 1; ret = pmap_remove_pte(pmap, pte, sva, ptpaddr, &free); - if (m != NULL) - vm_page_unlock(m); + if (pa) { + PA_UNLOCK(pa); + pa = 0; + } if (ret) break; } From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 05:03:25 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D8CA106564A; Mon, 8 Mar 2010 05:03:25 +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 2AA468FC12; Mon, 8 Mar 2010 05:03: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 o2853PoM084566; Mon, 8 Mar 2010 05:03:25 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2853Phw084563; Mon, 8 Mar 2010 05:03:25 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201003080503.o2853Phw084563@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Mar 2010 05:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204855 - in user/kmacy/releng_8_page_lock/sys: amd64/amd64 amd64/conf amd64/include cddl/contrib/opensolaris/uts/common/fs/zfs dev/md kern nfsclient ufs/ffs vm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 05:03:25 -0000 Author: kmacy Date: Mon Mar 8 05:03:24 2010 New Revision: 204855 URL: http://svn.freebsd.org/changeset/base/204855 Log: integrate page lock patch from HEAD Modified: user/kmacy/releng_8_page_lock/sys/amd64/amd64/pmap.c user/kmacy/releng_8_page_lock/sys/amd64/conf/GENERIC user/kmacy/releng_8_page_lock/sys/amd64/include/pmap.h user/kmacy/releng_8_page_lock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/kmacy/releng_8_page_lock/sys/dev/md/md.c user/kmacy/releng_8_page_lock/sys/kern/kern_exec.c user/kmacy/releng_8_page_lock/sys/kern/kern_subr.c user/kmacy/releng_8_page_lock/sys/kern/subr_witness.c user/kmacy/releng_8_page_lock/sys/kern/sys_pipe.c user/kmacy/releng_8_page_lock/sys/kern/sys_process.c user/kmacy/releng_8_page_lock/sys/kern/uipc_cow.c user/kmacy/releng_8_page_lock/sys/kern/uipc_shm.c user/kmacy/releng_8_page_lock/sys/kern/uipc_syscalls.c user/kmacy/releng_8_page_lock/sys/kern/vfs_bio.c user/kmacy/releng_8_page_lock/sys/nfsclient/nfs_bio.c user/kmacy/releng_8_page_lock/sys/ufs/ffs/ffs_vnops.c user/kmacy/releng_8_page_lock/sys/vm/device_pager.c user/kmacy/releng_8_page_lock/sys/vm/pmap.h user/kmacy/releng_8_page_lock/sys/vm/sg_pager.c user/kmacy/releng_8_page_lock/sys/vm/swap_pager.c user/kmacy/releng_8_page_lock/sys/vm/uma_core.c user/kmacy/releng_8_page_lock/sys/vm/vm_contig.c user/kmacy/releng_8_page_lock/sys/vm/vm_fault.c user/kmacy/releng_8_page_lock/sys/vm/vm_glue.c user/kmacy/releng_8_page_lock/sys/vm/vm_kern.c user/kmacy/releng_8_page_lock/sys/vm/vm_map.c user/kmacy/releng_8_page_lock/sys/vm/vm_mmap.c user/kmacy/releng_8_page_lock/sys/vm/vm_object.c user/kmacy/releng_8_page_lock/sys/vm/vm_page.c user/kmacy/releng_8_page_lock/sys/vm/vm_page.h user/kmacy/releng_8_page_lock/sys/vm/vm_pageout.c user/kmacy/releng_8_page_lock/sys/vm/vnode_pager.c Modified: user/kmacy/releng_8_page_lock/sys/amd64/amd64/pmap.c ============================================================================== --- user/kmacy/releng_8_page_lock/sys/amd64/amd64/pmap.c Mon Mar 8 04:56:39 2010 (r204854) +++ user/kmacy/releng_8_page_lock/sys/amd64/amd64/pmap.c Mon Mar 8 05:03:24 2010 (r204855) @@ -165,9 +165,29 @@ __FBSDID("$FreeBSD$"); #define PV_STAT(x) do { } while (0) #endif +#define CACHE_LINE_FETCH_SIZE 128 +#define PA_LOCK_PAD CACHE_LINE_FETCH_SIZE + +struct vp_lock { + struct mtx vp_lock; + unsigned char pad[(PA_LOCK_PAD - sizeof(struct mtx))]; +}; + #define pa_index(pa) ((pa) >> PDRSHIFT) #define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) +#define PA_LOCKPTR(pa) &pa_lock[pa_index((pa)) % PA_LOCK_COUNT].vp_lock +#define PA_LOCK(pa) mtx_lock(PA_LOCKPTR(pa)) +#define PA_TRYLOCK(pa) mtx_trylock(PA_LOCKPTR(pa)) +#define PA_UNLOCK(pa) mtx_unlock(PA_LOCKPTR(pa)) +#define PA_LOCK_ASSERT(pa, a) mtx_assert(PA_LOCKPTR(pa), (a)) + +#define PA_LOCK_COUNT 64 + +struct mtx pv_lock __aligned(128); +struct vp_lock pa_lock[PA_LOCK_COUNT] __aligned(128); + + struct pmap kernel_pmap_store; vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ @@ -184,6 +204,15 @@ static int pg_ps_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, "Are large page mappings enabled?"); +static uint64_t pmap_tryrelock_calls; +SYSCTL_QUAD(_vm_pmap, OID_AUTO, tryrelock_calls, CTLFLAG_RD, + &pmap_tryrelock_calls, 0, "Number of tryrelock calls"); + +static int pmap_tryrelock_restart; +SYSCTL_INT(_vm_pmap, OID_AUTO, tryrelock_restart, CTLFLAG_RD, + &pmap_tryrelock_restart, 0, "Number of tryrelock restarts"); + + static u_int64_t KPTphys; /* phys addr of kernel level 1 */ static u_int64_t KPDphys; /* phys addr of kernel level 2 */ u_int64_t KPDPphys; /* phys addr of kernel level 3 */ @@ -212,8 +241,9 @@ struct msgbuf *msgbufp = 0; static caddr_t crashdumpmap; static void free_pv_entry(pmap_t pmap, pv_entry_t pv); -static pv_entry_t get_pv_entry(pmap_t locked_pmap, int try); -static void pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); +static pv_entry_t get_pv_entry(pmap_t locked_pmap); +static void pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct pv_list_head *pv_list); static boolean_t pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); static void pmap_pv_promote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); @@ -222,7 +252,8 @@ static pv_entry_t pmap_pvh_remove(struct static int pmap_pvh_wired_mappings(struct md_page *pvh, int count); static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode); -static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); +static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, + struct pv_list_head *pv_list); static boolean_t pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va); static boolean_t pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t m, @@ -241,7 +272,7 @@ static boolean_t pmap_protect_pde(pmap_t vm_prot_t prot); static void pmap_pte_attr(pt_entry_t *pte, int cache_bits); static int pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, - vm_page_t *free); + vm_page_t *free, struct pv_list_head *pv_list); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, pd_entry_t ptepde, vm_page_t *free); static void pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte); @@ -249,14 +280,14 @@ static void pmap_remove_page(pmap_t pmap vm_page_t *free); static void pmap_remove_entry(struct pmap *pmap, vm_page_t m, vm_offset_t va); -static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); -static vm_page_t pmap_allocpde(pmap_t pmap, vm_offset_t va, int flags); -static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); +static vm_page_t pmap_allocpde(pmap_t pmap, vm_paddr_t pa, vm_offset_t va, int flags); +static vm_page_t pmap_allocpte(pmap_t pmap, vm_paddr_t pa, vm_offset_t va, int flags); -static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, int flags); +static vm_page_t _pmap_allocpte(pmap_t pmap, vm_paddr_t pa, vm_pindex_t ptepindex, + int flags); static int _pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t* free); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t, vm_page_t *); @@ -265,6 +296,76 @@ static vm_offset_t pmap_kmem_choose(vm_o CTASSERT(1 << PDESHIFT == sizeof(pd_entry_t)); CTASSERT(1 << PTESHIFT == sizeof(pt_entry_t)); + +#define LS_MAX 4 +struct lock_stack { + struct mtx *ls_array[LS_MAX]; + int ls_top; +}; + +static void +ls_init(struct lock_stack *ls) +{ + + ls->ls_top = 0; +} + +static void +ls_push(struct lock_stack *ls, struct mtx *lock) +{ + + KASSERT(ls->ls_top < LS_MAX, ("lock stack overflow")); + + ls->ls_array[ls->ls_top] = lock; + ls->ls_top++; + mtx_lock(lock); +} + + +static int +ls_trypush(struct lock_stack *ls, struct mtx *lock) +{ + + KASSERT(ls->ls_top < LS_MAX, ("lock stack overflow")); + + if (mtx_trylock(lock) == 0) + return (0); + + ls->ls_array[ls->ls_top] = lock; + ls->ls_top++; + return (1); +} + +#ifdef notyet +static void +ls_pop(struct lock_stack *ls) +{ + struct mtx *lock; + + KASSERT(ls->ls_top > 0, ("lock stack underflow")); + + ls->ls_top--; + lock = ls->ls_array[ls->ls_top]; + mtx_unlock(lock); +} +#endif + +static void +ls_popa(struct lock_stack *ls) +{ + struct mtx *lock; + + KASSERT(ls->ls_top > 0, ("lock stack underflow")); + + while (ls->ls_top > 0) { + ls->ls_top--; + lock = ls->ls_array[ls->ls_top]; + mtx_unlock(lock); + } +} +#ifdef INVARIANTS +extern void kdb_backtrace(void); +#endif /* * Move the kernel virtual free pointer to the next * 2MB. This is used to help improve performance @@ -414,6 +515,37 @@ vtopde(vm_offset_t va) return (PDmap + ((va >> PDRSHIFT) & mask)); } +/* + * Try to acquire a physical address lock while a pmap is locked. If we + * fail to trylock we unlock and lock the pmap directly and cache the + * locked pa in *locked. The caller should then restart their loop in case + * the virtual to physical mapping has changed. + */ +static int +pa_tryrelock(pmap_t pmap, vm_paddr_t pa, vm_paddr_t *locked) +{ + vm_paddr_t lockpa; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + atomic_add_long((volatile long *)&pmap_tryrelock_calls, 1); + lockpa = *locked; + *locked = pa; + if (lockpa) { + PA_LOCK_ASSERT(lockpa, MA_OWNED); + if (PA_LOCKPTR(pa) == PA_LOCKPTR(lockpa)) + return (0); + PA_UNLOCK(lockpa); + } + if (PA_TRYLOCK(pa)) + return 0; + PMAP_UNLOCK(pmap); + PA_LOCK(pa); + PMAP_LOCK(pmap); + atomic_add_int((volatile int *)&pmap_tryrelock_restart, 1); + + return (EAGAIN); +} + static u_int64_t allocpages(vm_paddr_t *firstaddr, int n) { @@ -523,6 +655,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) { vm_offset_t va; pt_entry_t *pte, *unused; + int i; /* * Create an initial set of page tables to run the kernel in. @@ -581,6 +714,13 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* Initialize the PAT MSR. */ pmap_init_pat(); + + /* Setup page locks. */ + for (i = 0; i < PA_LOCK_COUNT; i++) + mtx_init(&pa_lock[i].vp_lock, "page lock", NULL, + MTX_DEF | MTX_RECURSE | MTX_DUPOK); + mtx_init(&pv_lock, "pv list lock", NULL, MTX_DEF); + } /* @@ -618,6 +758,14 @@ pmap_page_init(vm_page_t m) m->md.pat_mode = PAT_WRITE_BACK; } +struct mtx * +pmap_page_lockptr(vm_page_t m) +{ + + KASSERT(m != NULL, ("pmap_page_lockptr: NULL page")); + return (PA_LOCKPTR(VM_PAGE_TO_PHYS(m))); +} + /* * Initialize the pmap module. * Called by vm_init, to initialize any structures that the pmap @@ -1017,15 +1165,20 @@ pmap_extract_and_hold(pmap_t pmap, vm_of { pd_entry_t pde, *pdep; pt_entry_t pte; + vm_paddr_t pa; vm_page_t m; + pa = 0; m = NULL; - vm_page_lock_queues(); PMAP_LOCK(pmap); +retry: pdep = pmap_pde(pmap, va); if (pdep != NULL && (pde = *pdep)) { if (pde & PG_PS) { if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) { + if (pa_tryrelock(pmap, pde & PG_PS_FRAME, &pa)) + goto retry; + m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | (va & PDRMASK)); vm_page_hold(m); @@ -1034,12 +1187,15 @@ pmap_extract_and_hold(pmap_t pmap, vm_of pte = *pmap_pde_to_pte(pdep, va); if ((pte & PG_V) && ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) { + if (pa_tryrelock(pmap, pte & PG_FRAME, &pa)) + goto retry; m = PHYS_TO_VM_PAGE(pte & PG_FRAME); vm_page_hold(m); } } } - vm_page_unlock_queues(); + if (pa) + PA_UNLOCK(pa); PMAP_UNLOCK(pmap); return (m); } @@ -1437,7 +1593,7 @@ pmap_pinit(pmap_t pmap) * race conditions. */ static vm_page_t -_pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, int flags) +_pmap_allocpte(pmap_t pmap, vm_paddr_t pa, vm_pindex_t ptepindex, int flags) { vm_page_t m, pdppg, pdpg; @@ -1452,9 +1608,9 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { if (flags & M_WAITOK) { PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + PA_UNLOCK(pa); VM_WAIT; - vm_page_lock_queues(); + PA_LOCK(pa); PMAP_LOCK(pmap); } @@ -1494,7 +1650,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t pml4 = &pmap->pm_pml4[pml4index]; if ((*pml4 & PG_V) == 0) { /* Have to allocate a new pdp, recurse */ - if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index, + if (_pmap_allocpte(pmap, pa, NUPDE + NUPDPE + pml4index, flags) == NULL) { --m->wire_count; atomic_subtract_int(&cnt.v_wire_count, 1); @@ -1527,7 +1683,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t pml4 = &pmap->pm_pml4[pml4index]; if ((*pml4 & PG_V) == 0) { /* Have to allocate a new pd, recurse */ - if (_pmap_allocpte(pmap, NUPDE + pdpindex, + if (_pmap_allocpte(pmap, pa, NUPDE + pdpindex, flags) == NULL) { --m->wire_count; atomic_subtract_int(&cnt.v_wire_count, 1); @@ -1541,7 +1697,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t pdp = &pdp[pdpindex & ((1ul << NPDPEPGSHIFT) - 1)]; if ((*pdp & PG_V) == 0) { /* Have to allocate a new pd, recurse */ - if (_pmap_allocpte(pmap, NUPDE + pdpindex, + if (_pmap_allocpte(pmap, pa, NUPDE + pdpindex, flags) == NULL) { --m->wire_count; atomic_subtract_int(&cnt.v_wire_count, @@ -1568,7 +1724,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t } static vm_page_t -pmap_allocpde(pmap_t pmap, vm_offset_t va, int flags) +pmap_allocpde(pmap_t pmap, vm_paddr_t pa, vm_offset_t va, int flags) { vm_pindex_t pdpindex, ptepindex; pdp_entry_t *pdpe; @@ -1587,7 +1743,7 @@ retry: /* Allocate a pd page. */ ptepindex = pmap_pde_pindex(va); pdpindex = ptepindex >> NPDPEPGSHIFT; - pdpg = _pmap_allocpte(pmap, NUPDE + pdpindex, flags); + pdpg = _pmap_allocpte(pmap, pa, NUPDE + pdpindex, flags); if (pdpg == NULL && (flags & M_WAITOK)) goto retry; } @@ -1595,11 +1751,12 @@ retry: } static vm_page_t -pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags) +pmap_allocpte(pmap_t pmap, vm_paddr_t pa, vm_offset_t va, int flags) { vm_pindex_t ptepindex; pd_entry_t *pd; vm_page_t m; + struct pv_list_head pv_list; KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, @@ -1620,7 +1777,8 @@ retry: * normal 4K page. */ if (pd != NULL && (*pd & (PG_PS | PG_V)) == (PG_PS | PG_V)) { - if (!pmap_demote_pde(pmap, pd, va)) { + TAILQ_INIT(&pv_list); + if (!pmap_demote_pde(pmap, pd, va, &pv_list)) { /* * Invalidation of the 2MB page mapping may have caused * the deallocation of the underlying PD page. @@ -1641,7 +1799,7 @@ retry: * Here if the pte page isn't mapped, or if it has been * deallocated. */ - m = _pmap_allocpte(pmap, ptepindex, flags); + m = _pmap_allocpte(pmap, pa, ptepindex, flags); if (m == NULL && (flags & M_WAITOK)) goto retry; } @@ -1847,6 +2005,7 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_coll * allocate per-page pv entries until repromotion occurs, thereby * exacerbating the shortage of free pv entries. */ +#ifdef nomore static void pmap_collect(pmap_t locked_pmap, struct vpgqueues *vpq) { @@ -1862,8 +2021,8 @@ pmap_collect(pmap_t locked_pmap, struct if (m->hold_count || m->busy) continue; TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) { - va = pv->pv_va; pmap = PV_PMAP(pv); + va = pv->pv_va; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) PMAP_LOCK(pmap); @@ -1897,7 +2056,7 @@ pmap_collect(pmap_t locked_pmap, struct } } } - +#endif /* * free the pv_entry back to the free list @@ -1909,8 +2068,8 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv struct pv_chunk *pc; int idx, field, bit; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); + mtx_lock(&pv_lock); PV_STAT(pv_entry_frees++); PV_STAT(pv_entry_spare++); pv_entry_count--; @@ -1924,6 +2083,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv if (pc->pc_map[0] != PC_FREE0 || pc->pc_map[1] != PC_FREE1 || pc->pc_map[2] != PC_FREE2) { TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); + mtx_unlock(&pv_lock); return; } PV_STAT(pv_entry_spare -= _NPCPV); @@ -1932,7 +2092,10 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_unwire(m, 0); + mtx_unlock(&pv_lock); + KASSERT(m->wire_count == 1, ("wire_count == %d", m->wire_count)); + m->wire_count--; + atomic_subtract_int(&cnt.v_wire_count, 1); vm_page_free(m); } @@ -1941,7 +2104,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv * when needed. */ static pv_entry_t -get_pv_entry(pmap_t pmap, int try) +get_pv_entry(pmap_t pmap) { static const struct timeval printinterval = { 60, 0 }; static struct timeval lastprint; @@ -1953,7 +2116,7 @@ get_pv_entry(pmap_t pmap, int try) vm_page_t m; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + mtx_lock(&pv_lock); PV_STAT(pv_entry_allocs++); pv_entry_count++; if (pv_entry_count > pv_entry_high_water) @@ -1962,7 +2125,6 @@ get_pv_entry(pmap_t pmap, int try) "increasing either the vm.pmap.shpgperproc or the " "vm.pmap.pv_entry_max sysctl.\n"); pq = NULL; -retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); if (pc != NULL) { for (field = 0; field < _NPCM; field++) { @@ -1981,6 +2143,7 @@ retry: TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); } PV_STAT(pv_entry_spare--); + mtx_unlock(&pv_lock); return (pv); } } @@ -1989,26 +2152,10 @@ retry: VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (m == NULL) { - if (try) { - pv_entry_count--; - PV_STAT(pc_chunk_tryfail++); - return (NULL); - } - /* - * Reclaim pv entries: At first, destroy mappings to inactive - * pages. After that, if a pv chunk entry is still needed, - * destroy mappings to active pages. - */ - if (pq == NULL) { - PV_STAT(pmap_collect_inactive++); - pq = &vm_page_queues[PQ_INACTIVE]; - } else if (pq == &vm_page_queues[PQ_INACTIVE]) { - PV_STAT(pmap_collect_active++); - pq = &vm_page_queues[PQ_ACTIVE]; - } else - panic("get_pv_entry: increase vm.pmap.shpgperproc"); - pmap_collect(pmap, pq); - goto retry; + pv_entry_count--; + PV_STAT(pc_chunk_tryfail++); + mtx_unlock(&pv_lock); + return (NULL); } PV_STAT(pc_chunk_count++); PV_STAT(pc_chunk_allocs++); @@ -2022,9 +2169,64 @@ retry: pv = &pc->pc_pventry[0]; TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); PV_STAT(pv_entry_spare += _NPCPV - 1); + + mtx_unlock(&pv_lock); return (pv); } +static void +pmap_pv_list_free(pmap_t pmap, struct pv_list_head *pv_list) +{ + pv_entry_t pv; + + while (!TAILQ_EMPTY(pv_list)) { + pv = TAILQ_FIRST(pv_list); + TAILQ_REMOVE(pv_list, pv, pv_list); + free_pv_entry(pmap, pv); + } +} + +static boolean_t +pmap_pv_list_alloc(pmap_t pmap, int count, struct pv_list_head *pv_list) +{ + pv_entry_t pv; + int i; + boolean_t slept; + + slept = FALSE; + for (i = 0; i < count; i++) { + while ((pv = get_pv_entry(pmap)) == NULL) { + PMAP_UNLOCK(pmap); + slept = TRUE; + VM_WAIT; + PMAP_LOCK(pmap); + } + TAILQ_INSERT_HEAD(pv_list, pv, pv_list); + } + + return (slept); +} + +static boolean_t +pmap_pv_list_try_alloc(pmap_t pmap, int count, struct pv_list_head *pv_list) +{ + pv_entry_t pv; + int i; + boolean_t success; + + success = TRUE; + for (i = 0; i < count; i++) { + if ((pv = get_pv_entry(pmap)) == NULL) { + success = FALSE; + pmap_pv_list_free(pmap, pv_list); + goto done; + } + TAILQ_INSERT_HEAD(pv_list, pv, pv_list); + } +done: + return (success); +} + /* * First find and then remove the pv entry for the specified pmap and virtual * address from the specified pv list. Returns the pv entry if found and NULL @@ -2036,7 +2238,8 @@ pmap_pvh_remove(struct md_page *pvh, pma { pv_entry_t pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); @@ -2052,27 +2255,37 @@ pmap_pvh_remove(struct md_page *pvh, pma * entries for each of the 4KB page mappings. */ static void -pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa) +pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct pv_list_head *pv_list) { struct md_page *pvh; pv_entry_t pv; vm_offset_t va_last; vm_page_t m; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + PA_LOCK_ASSERT(pa, MA_OWNED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_demote_pde: pa is not 2mpage aligned")); - /* - * Transfer the 2mpage's pv entry for this mapping to the first - * page's pv list. - */ + /* Transfer the 2mpage's pv entry for this mapping to the first + * page's pv list. + */ pvh = pa_to_pvh(pa); va = trunc_2mpage(va); pv = pmap_pvh_remove(pvh, pmap, va); KASSERT(pv != NULL, ("pmap_pv_demote_pde: pv not found")); m = PHYS_TO_VM_PAGE(pa); +#ifdef INVARIANTS + if (va == 0) { + printf("inserting va==0\n"); + kdb_backtrace(); + } +#endif + vm_page_lock(m); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + vm_page_unlock(m); + /* Instantiate the remaining NPTEPG - 1 pv entries. */ va_last = va + NBPDR - PAGE_SIZE; do { @@ -2080,8 +2293,20 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("pmap_pv_demote_pde: page %p is not managed", m)); va += PAGE_SIZE; - pmap_insert_entry(pmap, va, m); + pv = TAILQ_FIRST(pv_list); + TAILQ_REMOVE(pv_list, pv, pv_list); +#ifdef INVARIANTS + if (va == 0) { + printf("inserting va==0\n"); + kdb_backtrace(); + } +#endif + pv->pv_va = va; + vm_page_lock(m); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + vm_page_unlock(m); } while (va < va_last); + } /* @@ -2097,7 +2322,7 @@ pmap_pv_promote_pde(pmap_t pmap, vm_offs vm_offset_t va_last; vm_page_t m; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + PA_LOCK_ASSERT(pa, MA_OWNED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_promote_pde: pa is not 2mpage aligned")); @@ -2143,7 +2368,8 @@ pmap_remove_entry(pmap_t pmap, vm_page_t { struct md_page *pvh; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_assert(m, MA_OWNED); + pmap_pvh_free(&m->md, pmap, va); if (TAILQ_EMPTY(&m->md.pv_list)) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -2153,22 +2379,6 @@ pmap_remove_entry(pmap_t pmap, vm_page_t } /* - * Create a pv entry for page at pa for - * (pmap, va). - */ -static void -pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m) -{ - pv_entry_t pv; - - PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - pv = get_pv_entry(pmap, FALSE); - pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); -} - -/* * Conditionally create a pv entry. */ static boolean_t @@ -2177,9 +2387,15 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm pv_entry_t pv; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_assert(m, MA_OWNED); if (pv_entry_count < pv_entry_high_water && - (pv = get_pv_entry(pmap, TRUE)) != NULL) { + (pv = get_pv_entry(pmap)) != NULL) { +#ifdef INVARIANTS + if (va == 0) { + printf("inserting va==0\n"); + kdb_backtrace(); + } +#endif pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); return (TRUE); @@ -2196,9 +2412,16 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse struct md_page *pvh; pv_entry_t pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + PA_LOCK_ASSERT(pa, MA_OWNED); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); if (pv_entry_count < pv_entry_high_water && - (pv = get_pv_entry(pmap, TRUE)) != NULL) { + (pv = get_pv_entry(pmap)) != NULL) { +#ifdef INVARIANTS + if (va == 0) { + printf("inserting va==0\n"); + kdb_backtrace(); + } +#endif pv->pv_va = va; pvh = pa_to_pvh(pa); TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_list); @@ -2226,7 +2449,8 @@ pmap_fill_ptp(pt_entry_t *firstpte, pt_e * mapping is invalidated. */ static boolean_t -pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) +pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, + struct pv_list_head *pv_list) { pd_entry_t newpde, oldpde; pt_entry_t *firstpte, newpte; @@ -2262,7 +2486,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { free = NULL; - pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free); + pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free, pv_list); pmap_invalidate_page(pmap, trunc_2mpage(va)); pmap_free_zero_pages(free); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx" @@ -2272,6 +2496,10 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t if (va < VM_MAXUSER_ADDRESS) pmap->pm_stats.resident_count++; } + if (TAILQ_EMPTY(pv_list) && ((oldpde & PG_MANAGED) != 0)) { + if (pmap_pv_list_try_alloc(pmap, NPTEPG-1, pv_list) == FALSE) + return (FALSE); + } mptepa = VM_PAGE_TO_PHYS(mpte); firstpte = (pt_entry_t *)PHYS_TO_DMAP(mptepa); newpde = mptepa | PG_M | PG_A | (oldpde & PG_U) | PG_RW | PG_V; @@ -2326,7 +2554,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t * the 2mpage to referencing the page table page. */ if ((oldpde & PG_MANAGED) != 0) - pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME); + pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME, pv_list); pmap_pde_demotions++; CTR2(KTR_PMAP, "pmap_demote_pde: success for va %#lx" @@ -2339,7 +2567,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t */ static int pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, - vm_page_t *free) + vm_page_t *free, struct pv_list_head *pv_list) { struct md_page *pvh; pd_entry_t oldpde; @@ -2366,6 +2594,10 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t eva = sva + NBPDR; for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); va < eva; va += PAGE_SIZE, m++) { + /* + * XXX do we need to individually lock each page? + * + */ if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); if (oldpde & PG_A) @@ -2376,7 +2608,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t } } if (pmap == kernel_pmap) { - if (!pmap_demote_pde(pmap, pdq, sva)) + if (!pmap_demote_pde(pmap, pdq, sva, pv_list)) panic("pmap_remove_pde: failed demotion"); } else { mpte = pmap_lookup_pt_page(pmap, sva); @@ -2393,6 +2625,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t return (pmap_unuse_pt(pmap, sva, *pmap_pdpe(pmap, sva), free)); } + /* * pmap_remove_pte: do the things to unmap a page in a process */ @@ -2416,6 +2649,7 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t pmap->pm_stats.resident_count -= 1; if (oldpte & PG_MANAGED) { m = PHYS_TO_VM_PAGE(oldpte & PG_FRAME); + vm_page_lock_assert(m, MA_OWNED); if ((oldpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); if (oldpte & PG_A) @@ -2432,6 +2666,7 @@ static void pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, vm_page_t *free) { pt_entry_t *pte; + vm_page_t m = NULL; PMAP_LOCK_ASSERT(pmap, MA_OWNED); if ((*pde & PG_V) == 0) @@ -2439,10 +2674,94 @@ pmap_remove_page(pmap_t pmap, vm_offset_ pte = pmap_pde_to_pte(pde, va); if ((*pte & PG_V) == 0) return; + if (*pte & PG_MANAGED) { + m = PHYS_TO_VM_PAGE(*pte & PG_FRAME); + if (vm_page_trylock(m) == 0) { + PMAP_UNLOCK(pmap); + vm_page_lock(m); + PMAP_LOCK(pmap); + } + } pmap_remove_pte(pmap, pte, va, *pde, free); + if (m != NULL) + vm_page_unlock(m); pmap_invalidate_page(pmap, va); } +static void +pmap_prealloc_pv_list(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + struct pv_list_head *pv_list) +{ + vm_offset_t va_next; + pml4_entry_t *pml4e; + pdp_entry_t *pdpe; + pd_entry_t ptpaddr, *pde; + pt_entry_t *pte; + int i, alloc_count; + + alloc_count = 0; + PMAP_LOCK(pmap); + for (; sva < eva; sva = va_next) { + + pml4e = pmap_pml4e(pmap, sva); + if ((*pml4e & PG_V) == 0) { + va_next = (sva + NBPML4) & ~PML4MASK; + if (va_next < sva) + va_next = eva; + continue; + } + + pdpe = pmap_pml4e_to_pdpe(pml4e, sva); + if ((*pdpe & PG_V) == 0) { + va_next = (sva + NBPDP) & ~PDPMASK; + if (va_next < sva) + va_next = eva; + continue; + } + + /* + * Calculate index for next page table. + */ + va_next = (sva + NBPDR) & ~PDRMASK; + if (va_next < sva) + va_next = eva; + + pde = pmap_pdpe_to_pde(pdpe, sva); + ptpaddr = *pde; + + /* + * Weed out invalid mappings. + */ + if (ptpaddr == 0) + continue; + + /* + * Check for large page. + */ + if ((ptpaddr & PG_PS) != 0) { + alloc_count++; + continue; + } + /* + * Limit our scan to either the end of the va represented + * by the current page table page, or to the end of the + * range being removed. + */ + if (va_next > eva) + va_next = eva; + + for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, + sva += PAGE_SIZE) { + if (*pte == 0) + continue; + } + } + for (i = 0; i < alloc_count; i++) + pmap_pv_list_alloc(pmap, NPTEPG-1, pv_list); + + PMAP_UNLOCK(pmap); +} + /* * Remove the given range of addresses from the specified map. * @@ -2457,7 +2776,9 @@ pmap_remove(pmap_t pmap, vm_offset_t sva pdp_entry_t *pdpe; pd_entry_t ptpaddr, *pde; pt_entry_t *pte; + vm_paddr_t pa; vm_page_t free = NULL; + struct pv_list_head pv_list; int anyvalid; /* @@ -2466,11 +2787,19 @@ pmap_remove(pmap_t pmap, vm_offset_t sva if (pmap->pm_stats.resident_count == 0) return; - anyvalid = 0; + pa = anyvalid = 0; + TAILQ_INIT(&pv_list); - vm_page_lock_queues(); - PMAP_LOCK(pmap); + /* + * pre-allocate pvs + * + */ + if ((pmap == kernel_pmap) && + (sva + PAGE_SIZE != eva)) + pmap_prealloc_pv_list(pmap, sva, eva, &pv_list); + PMAP_LOCK(pmap); +restart: /* * special handling of removing one page. a very * common operation and easy to short circuit some @@ -2525,6 +2854,11 @@ pmap_remove(pmap_t pmap, vm_offset_t sva * Check for large page. */ if ((ptpaddr & PG_PS) != 0) { + if (pa_tryrelock(pmap, ptpaddr & PG_FRAME, &pa)) { + va_next = sva; + continue; + } + /* * Are we removing the entire large page? If not, * demote the mapping and fall through. @@ -2536,9 +2870,9 @@ pmap_remove(pmap_t pmap, vm_offset_t sva */ if ((ptpaddr & PG_G) == 0) anyvalid = 1; - pmap_remove_pde(pmap, pde, sva, &free); + pmap_remove_pde(pmap, pde, sva, &free, &pv_list); continue; - } else if (!pmap_demote_pde(pmap, pde, sva)) { + } else if (!pmap_demote_pde(pmap, pde, sva, &pv_list)) { /* The large page mapping was destroyed. */ continue; } else @@ -2555,23 +2889,39 @@ pmap_remove(pmap_t pmap, vm_offset_t sva for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, sva += PAGE_SIZE) { + int ret; + if (*pte == 0) continue; + if ((*pte & PG_MANAGED) && + pa_tryrelock(pmap, *pte & PG_FRAME, &pa)) + goto restart; + /* * The TLB entry for a PG_G mapping is invalidated * by pmap_remove_pte(). */ if ((*pte & PG_G) == 0) anyvalid = 1; - if (pmap_remove_pte(pmap, pte, sva, ptpaddr, &free)) + ret = pmap_remove_pte(pmap, pte, sva, ptpaddr, &free); + + if (pa) { + PA_UNLOCK(pa); + pa = 0; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 05:16:20 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCF21106564A; Mon, 8 Mar 2010 05:16:20 +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 97CD98FC12; Mon, 8 Mar 2010 05:16: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 o285GKRA087814; Mon, 8 Mar 2010 05:16:20 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o285GKBB087812; Mon, 8 Mar 2010 05:16:20 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201003080516.o285GKBB087812@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Mar 2010 05:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204856 - user/kmacy/head_page_lock/sys/amd64/amd64 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 05:16:20 -0000 Author: kmacy Date: Mon Mar 8 05:16:20 2010 New Revision: 204856 URL: http://svn.freebsd.org/changeset/base/204856 Log: - streamline pmap_remove_page using pa_retrylock - remove gratuitous unlock from pmap_remove_pages Modified: user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c Modified: user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c ============================================================================== --- user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c Mon Mar 8 05:03:24 2010 (r204855) +++ user/kmacy/head_page_lock/sys/amd64/amd64/pmap.c Mon Mar 8 05:16:20 2010 (r204856) @@ -2719,7 +2719,7 @@ static void pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, vm_page_t *free) { pt_entry_t *pte; - vm_page_t m = NULL; + vm_paddr_t pa = 0; PMAP_LOCK_ASSERT(pmap, MA_OWNED); if ((*pde & PG_V) == 0) @@ -2727,17 +2727,12 @@ pmap_remove_page(pmap_t pmap, vm_offset_ pte = pmap_pde_to_pte(pde, va); if ((*pte & PG_V) == 0) return; - if (*pte & PG_MANAGED) { - m = PHYS_TO_VM_PAGE(*pte & PG_FRAME); - if (vm_page_trylock(m) == 0) { - PMAP_UNLOCK(pmap); - vm_page_lock(m); - PMAP_LOCK(pmap); - } - } + if (*pte & PG_MANAGED) + (void)pa_tryrelock(pmap, *pte & PG_FRAME, &pa); + pmap_remove_pte(pmap, pte, va, *pde, free); - if (m != NULL) - vm_page_unlock(m); + if (pa) + PA_UNLOCK(pa); pmap_invalidate_page(pmap, va); } @@ -2959,10 +2954,6 @@ restart: anyvalid = 1; ret = pmap_remove_pte(pmap, pte, sva, ptpaddr, &free); - if (pa) { - PA_UNLOCK(pa); - pa = 0; - } if (ret) break; } From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 05:19:57 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 343D6106564A; Mon, 8 Mar 2010 05:19:57 +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 24AE48FC0C; Mon, 8 Mar 2010 05:19: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 o285Jvtc088745; Mon, 8 Mar 2010 05:19:57 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o285JvGF088743; Mon, 8 Mar 2010 05:19:57 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201003080519.o285JvGF088743@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Mar 2010 05:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204857 - user/kmacy/releng_8_page_lock/sys/amd64/amd64 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 05:19:57 -0000 Author: kmacy Date: Mon Mar 8 05:19:56 2010 New Revision: 204857 URL: http://svn.freebsd.org/changeset/base/204857 Log: MFH 204856 Modified: user/kmacy/releng_8_page_lock/sys/amd64/amd64/pmap.c (contents, props changed) Modified: user/kmacy/releng_8_page_lock/sys/amd64/amd64/pmap.c ============================================================================== --- user/kmacy/releng_8_page_lock/sys/amd64/amd64/pmap.c Mon Mar 8 05:16:20 2010 (r204856) +++ user/kmacy/releng_8_page_lock/sys/amd64/amd64/pmap.c Mon Mar 8 05:19:56 2010 (r204857) @@ -2666,7 +2666,7 @@ static void pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, vm_page_t *free) { pt_entry_t *pte; - vm_page_t m = NULL; + vm_paddr_t pa = 0; PMAP_LOCK_ASSERT(pmap, MA_OWNED); if ((*pde & PG_V) == 0) @@ -2674,17 +2674,12 @@ pmap_remove_page(pmap_t pmap, vm_offset_ pte = pmap_pde_to_pte(pde, va); if ((*pte & PG_V) == 0) return; - if (*pte & PG_MANAGED) { - m = PHYS_TO_VM_PAGE(*pte & PG_FRAME); - if (vm_page_trylock(m) == 0) { - PMAP_UNLOCK(pmap); - vm_page_lock(m); - PMAP_LOCK(pmap); - } - } + if (*pte & PG_MANAGED) + (void)pa_tryrelock(pmap, *pte & PG_FRAME, &pa); + pmap_remove_pte(pmap, pte, va, *pde, free); - if (m != NULL) - vm_page_unlock(m); + if (pa) + PA_UNLOCK(pa); pmap_invalidate_page(pmap, va); } @@ -2906,10 +2901,6 @@ restart: anyvalid = 1; ret = pmap_remove_pte(pmap, pte, sva, ptpaddr, &free); - if (pa) { - PA_UNLOCK(pa); - pa = 0; - } if (ret) break; } From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 13:12:36 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33F011065670; Mon, 8 Mar 2010 13:12:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09E3A8FC15; Mon, 8 Mar 2010 13:12: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 o28DCZZe001423; Mon, 8 Mar 2010 13:12:35 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28DCZdr001421; Mon, 8 Mar 2010 13:12:35 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201003081312.o28DCZdr001421@svn.freebsd.org> From: Hiroki Sato Date: Mon, 8 Mar 2010 13:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204867 - user/hrs/ipv6/usr.sbin/route6d X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 13:12:36 -0000 Author: hrs Date: Mon Mar 8 13:12:35 2010 New Revision: 204867 URL: http://svn.freebsd.org/changeset/base/204867 Log: - Handle routes which are not marked as Qflag again. - Ignore routes of !RTF_GATEWAY && !RTF_HOST && !RTF_STATIC. - Add sleep(1) between NET_RT_DUMP retries. Modified: user/hrs/ipv6/usr.sbin/route6d/route6d.c Modified: user/hrs/ipv6/usr.sbin/route6d/route6d.c ============================================================================== --- user/hrs/ipv6/usr.sbin/route6d/route6d.c Mon Mar 8 11:27:39 2010 (r204866) +++ user/hrs/ipv6/usr.sbin/route6d/route6d.c Mon Mar 8 13:12:35 2010 (r204867) @@ -79,6 +79,7 @@ static const char _rcsid[] = "$KAME: rou #include "route6d.h" #define MAXFILTER 40 +#define RT_DUMP_MAXRETRY 15 #ifdef DEBUG #define INIT_INTERVAL6 6 @@ -2702,6 +2703,8 @@ krtread(again) mib[4] = NET_RT_DUMP; /* Dump the kernel routing table */ mib[5] = 0; /* No flags */ do { + if (retry) + sleep(1); retry++; errmsg = NULL; if (buf) @@ -2718,7 +2721,7 @@ krtread(again) errmsg = "sysctl NET_RT_DUMP"; continue; } - } while (retry < 15 && errmsg != NULL); + } while (retry < RT_DUMP_MAXRETRY && errmsg != NULL); if (errmsg) { fatal("%s (with %d retries, msize=%lu)", errmsg, retry, (u_long)msize); @@ -2760,16 +2763,8 @@ rt_entry(rtm, again) if (rtm->rtm_flags & RTF_CLONED) return; #endif - /* Ignore RTF_PROTO mismached routes */ - /* - * XXX: can we know if it is a connected network route or not? - * RTF_WASCLONED was the flag for that, but we no longer - * use it. Rely on Qflag instead here. - */ - if (Qflag && !(rtm->rtm_flags & Qflag)) - return; /* XXX: Ignore connected routes. */ - if (!(rtm->rtm_flags & RTF_GATEWAY)) + if (!(rtm->rtm_flags & (RTF_GATEWAY|RTF_HOST|RTF_STATIC))) return; /* * do not look at dynamic routes. @@ -3006,6 +3001,7 @@ delroute(np, gw) rtm->rtm_seq = ++seq; rtm->rtm_pid = pid; rtm->rtm_flags = RTF_UP | RTF_GATEWAY; + rtm->rtm_flags |= Qflag; if (np->rip6_plen == sizeof(struct in6_addr) * 8) rtm->rtm_flags |= RTF_HOST; rtm->rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK; From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 20:57:36 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A772106564A; Mon, 8 Mar 2010 20:57:36 +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 4FA098FC0A; Mon, 8 Mar 2010 20:57: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 o28KvZOh005546; Mon, 8 Mar 2010 20:57:35 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28KvZhH005544; Mon, 8 Mar 2010 20:57:35 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003082057.o28KvZhH005544@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 8 Mar 2010 20:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204881 - user/edwin/ncal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 20:57:36 -0000 Author: edwin Date: Mon Mar 8 20:57:35 2010 New Revision: 204881 URL: http://svn.freebsd.org/changeset/base/204881 Log: Fixed issue with aligning of next month after a highlighted day for non-terminal output. Modified: user/edwin/ncal/ncal.c Modified: user/edwin/ncal/ncal.c ============================================================================== --- user/edwin/ncal/ncal.c Mon Mar 8 20:45:52 2010 (r204880) +++ user/edwin/ncal/ncal.c Mon Mar 8 20:57:35 2010 (r204881) @@ -60,7 +60,7 @@ struct monthlines { wchar_t name[MAX_WIDTH + 1]; char lines[7][MAX_WIDTH + 1]; char weeks[MAX_WIDTH + 1]; - unsigned int linelen[7]; + unsigned int extralen[7]; }; struct weekdays { @@ -336,14 +336,19 @@ main(int argc, char *argv[]) if (flag_easter) usage(); flag_month = *argv++; + before = 0; + after = 0; + m = strtol(flag_month, NULL, 10); /* FALLTHROUGH */ case 1: y = atoi(*argv++); if (y < 1 || y > 9999) errx(EX_USAGE, "year %d not in range 1..9999", y); - before = 0; - after = 11; - m = 1; + if (before == -1 && after == -1) { + before = 0; + after = 11; + m = 1; + } break; case 0: { @@ -470,8 +475,7 @@ printeaster(int y, int julian, int ortho printf("%s\n", buf); } -#define MW(mw, ms, ml) \ - strlen(ms) > (ml) ? (mw) + 9 : (mw) +#define MW(mw, me) ((mw) + me) #define DECREASEMONTH(m, y) \ if (--m == 0) { \ m = 12; \ @@ -564,7 +568,9 @@ monthrangeb(int y, int jd_flag, int m, i for (i = 0; i != 6; i++) { for (j = 0; j < count; j++) - printf("%-*s ", mw, year[j].lines[i]+1); + printf("%-*s ", + MW(mw, year[j].extralen[i]), + year[j].lines[i]+1); printf("\n"); } @@ -641,8 +647,8 @@ monthranger(int y, int jd_flag, int m, i /* Full months */ for (j = 0; j < count; j++) printf("%-*s", - MW(mw, year[j].lines[i], - year[j].linelen[i]), year[j].lines[i]); + MW(mw, year[j].extralen[i]), + year[j].lines[i]); printf("\n"); } @@ -733,7 +739,7 @@ mkmonthr(int y, int m, int jd_flag, stru memcpy(mlines->lines[i] + k + l, " ", dw); } mlines->lines[i][k + l] = '\0'; - mlines->linelen[i] = k; + mlines->extralen[i] = l; } /* fill the weeknumbers */ @@ -840,6 +846,7 @@ mkmonthb(int y, int m, int jd_flag, stru mlines->lines[i][1] = '\0'; else mlines->lines[i][k + l] = '\0'; + mlines->extralen[i] = l; } } From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 21:05:29 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6C291065672; Mon, 8 Mar 2010 21:05: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 BC30E8FC1A; Mon, 8 Mar 2010 21:05: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 o28L5T4K007369; Mon, 8 Mar 2010 21:05:29 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28L5TDv007367; Mon, 8 Mar 2010 21:05:29 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003082105.o28L5TDv007367@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 8 Mar 2010 21:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204882 - user/edwin/ncal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 21:05:30 -0000 Author: edwin Date: Mon Mar 8 21:05:29 2010 New Revision: 204882 URL: http://svn.freebsd.org/changeset/base/204882 Log: When -m is specified, display only one month. Modified: user/edwin/ncal/ncal.c Modified: user/edwin/ncal/ncal.c ============================================================================== --- user/edwin/ncal/ncal.c Mon Mar 8 20:57:35 2010 (r204881) +++ user/edwin/ncal/ncal.c Mon Mar 8 21:05:29 2010 (r204882) @@ -290,6 +290,8 @@ main(int argc, char *argv[]) break; case 'm': flag_month = optarg; + before = 0; + after = 0; break; case 'o': if (flag_backward) From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 21:09:48 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39D9F106564A; Mon, 8 Mar 2010 21:09:48 +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 2984B8FC08; Mon, 8 Mar 2010 21:09: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 o28L9mQk008358; Mon, 8 Mar 2010 21:09:48 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28L9mkP008356; Mon, 8 Mar 2010 21:09:48 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003082109.o28L9mkP008356@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 8 Mar 2010 21:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204883 - user/edwin/ncal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 21:09:48 -0000 Author: edwin Date: Mon Mar 8 21:09:47 2010 New Revision: 204883 URL: http://svn.freebsd.org/changeset/base/204883 Log: Add bug note: Running arguments in different orders may give varying results. Modified: user/edwin/ncal/ncal.1 Modified: user/edwin/ncal/ncal.1 ============================================================================== --- user/edwin/ncal/ncal.1 Mon Mar 8 21:05:29 2010 (r204882) +++ user/edwin/ncal/ncal.1 Mon Mar 8 21:09:47 2010 (r204883) @@ -169,3 +169,6 @@ command and manual were written by .Sh BUGS The assignment of Julian\(enGregorian switching dates to country codes is historically naive for many countries. +.Pp +Not all options are compatible and using them in different orders +will give varying results. From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 21:22:34 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5FCD106566C; Mon, 8 Mar 2010 21:22: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 934388FC13; Mon, 8 Mar 2010 21:22: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 o28LMY2r011480; Mon, 8 Mar 2010 21:22:34 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28LMYEi011472; Mon, 8 Mar 2010 21:22:34 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201003082122.o28LMYEi011472@svn.freebsd.org> From: Juli Mallett Date: Mon, 8 Mar 2010 21:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204888 - in user/jmallett/octeon: gnu/usr.bin/binutils/ld gnu/usr.bin/cc lib/libc sys/conf sys/mips/cavium sys/mips/conf X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 21:22:34 -0000 Author: jmallett Date: Mon Mar 8 21:22:34 2010 New Revision: 204888 URL: http://svn.freebsd.org/changeset/base/204888 Log: o) Add a TARGET_ABI flag which can be set to o32, n32 or n64. o) Select default ABI for GCC and emulation for binutils based on the value of TARGET_ABI at build time. o) Don't build quad support in libc for MIPS unless TARGET_ABI is o32. o) Don't specify emulation options gratuitously when building the kernel. o) Don't specify an ABI when building the kernel, though we are still stuck with ABI-specific loader scripts. o) Don't make any Octeon systems default to single user. Sponsored by: Packet Forensics Modified: user/jmallett/octeon/gnu/usr.bin/binutils/ld/Makefile.mips user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc user/jmallett/octeon/lib/libc/Makefile user/jmallett/octeon/sys/conf/Makefile.mips user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c user/jmallett/octeon/sys/mips/conf/OCTEON1-32 user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 Modified: user/jmallett/octeon/gnu/usr.bin/binutils/ld/Makefile.mips ============================================================================== --- user/jmallett/octeon/gnu/usr.bin/binutils/ld/Makefile.mips Mon Mar 8 21:17:10 2010 (r204887) +++ user/jmallett/octeon/gnu/usr.bin/binutils/ld/Makefile.mips Mon Mar 8 21:22:34 2010 (r204888) @@ -1,15 +1,22 @@ # $FreeBSD$ -#xxxIMPxxx: size? #xxxIMPxxx: TARGET_BIG_ENDIAN is lame. We should use the netbsd convention # of mipsel and mips. -_sz?=32 -.if defined(TARGET_BIG_ENDIAN) -NATIVE_EMULATION=elf${_sz}btsmip_fbsd +.if !defined(TARGET_BIG_ENDIAN) +_EMULATION_ENDIAN=l .else -NATIVE_EMULATION=elf${_sz}ltsmip_fbsd +_EMULATION_ENDIAN=b .endif +.if defined(TARGET_ABI) && ${TARGET_ABI} != "o32" +.if ${TARGET_ABI} == "n32" +NATIVE_EMULATION=elf32${_EMULATION_ENDIAN}tsmipn32_fbsd +.elif ${TARGET_ABI} == "n64" +NATIVE_EMULATION=elf64${_EMULATION_ENDIAN}tsmip_fbsd +.endif +.endif +NATIVE_EMULATION?=elf32${_EMULATION_ENDIAN}tsmip_fbsd + MIPS_ABIS=elf32btsmip_fbsd elf32ltsmip_fbsd elf64btsmip_fbsd elf64ltsmip_fbsd \ elf32btsmipn32_fbsd elf32ltsmipn32_fbsd .for abi in ${MIPS_ABIS} Modified: user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc ============================================================================== --- user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc Mon Mar 8 21:17:10 2010 (r204887) +++ user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc Mon Mar 8 21:22:34 2010 (r204888) @@ -30,10 +30,24 @@ CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SI CFLAGS+= -DCROSS_COMPILE .endif -.if ${TARGET_ARCH} == "mips" && !defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "mips" +# XXX This is backwards, MIPS should default to BE. +.if !defined(TARGET_BIG_ENDIAN) CFLAGS += -DTARGET_ENDIAN_DEFAULT=0 .endif +.if defined(TARGET_ABI) && ${TARGET_ABI} != "o32" +.if ${TARGET_ABI} == "n32" +MIPS_ABI_DEFAULT=ABI_N32 +.elif ${TARGET_ABI} == "n64" +MIPS_ABI_DEFAULT=ABI_64 +.endif +.endif + +MIPS_ABI_DEFAULT?=ABI_32 +CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT} +.endif + .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE) CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE} .endif Modified: user/jmallett/octeon/lib/libc/Makefile ============================================================================== --- user/jmallett/octeon/lib/libc/Makefile Mon Mar 8 21:17:10 2010 (r204887) +++ user/jmallett/octeon/lib/libc/Makefile Mon Mar 8 21:22:34 2010 (r204888) @@ -55,6 +55,10 @@ NOASM= ${MACHINE_ARCH} != "mips" .include "${.CURDIR}/quad/Makefile.inc" .endif +.if ${MACHINE_ARCH} == "mips" && \ + (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32") +.include "${.CURDIR}/quad/Makefile.inc" +.endif .include "${.CURDIR}/regex/Makefile.inc" .include "${.CURDIR}/resolv/Makefile.inc" .include "${.CURDIR}/stdio/Makefile.inc" @@ -65,8 +69,7 @@ NOASM= .include "${.CURDIR}/rpc/Makefile.inc" .include "${.CURDIR}/uuid/Makefile.inc" .include "${.CURDIR}/xdr/Makefile.inc" -.if ${MACHINE_ARCH} == "arm" || \ - ${MACHINE_ARCH} == "mips" +.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips" .include "${.CURDIR}/softfloat/Makefile.inc" .endif .if ${MK_NIS} != "no" Modified: user/jmallett/octeon/sys/conf/Makefile.mips ============================================================================== --- user/jmallett/octeon/sys/conf/Makefile.mips Mon Mar 8 21:17:10 2010 (r204887) +++ user/jmallett/octeon/sys/conf/Makefile.mips Mon Mar 8 21:22:34 2010 (r204888) @@ -48,42 +48,6 @@ ARCH_FLAGS?=-march=mips32 EXTRA_FLAGS=-fno-pic -mno-abicalls -G0 HACK_EXTRA_FLAGS=-shared -.if defined(TARGET_BIG_ENDIAN) -CFLAGS+=-EB -SYSTEM_LD+=-EB -EXTRA_FLAGS+=-EB -TRAMP_LDFLAGS+=-Wl,-EB -HACK_EXTRA_FLAGS+=-EB -Wl,-EB -.if defined(TARGET_64BIT) -SYSTEM_LD+=-m elf64btsmip_fbsd -HACK_EXTRA_FLAGS+=-Wl,-m,elf64btsmip_fbsd -.endif -.if defined(TARGET_N32) -SYSTEM_LD+=-m elf32btsmipn32_fbsd -HACK_EXTRA_FLAGS+=-Wl,-m,elf32btsmipn32_fbsd -.else -SYSTEM_LD+=-m elf32btsmip_fbsd -HACK_EXTRA_FLAGS+=-Wl,-m,elf32btsmip_fbsd -.endif -.else -CFLAGS+=-EL -SYSTEM_LD+=-EL -EXTRA_FLAGS+=-EL -TRAMP_LDFLAGS+=-Wl,-EL -HACK_EXTRA_FLAGS+=-EL -Wl,-EL -.if defined(TARGET_64BIT) -SYSTEM_LD+=-m elf64ltsmip_fbsd -HACK_EXTRA_FLAGS+=-Wl,-m,elf64ltsmip_fbsd -.endif -.if defined(TARGET_N32) -SYSTEM_LD+=-m elf32ltsmipn32_fbsd -HACK_EXTRA_FLAGS+=-Wl,-m,elf32ltsmipn32_fbsd -.else -SYSTEM_LD+=-m elf32ltsmip_fbsd -HACK_EXTRA_FLAGS+=-Wl,-m,elf32ltsmip_fbsd -.endif -.endif - # We add the -fno-pic flag to kernels because otherwise performance # is extremely poor, as well as -mno-abicalls to force no ABI usage. Modified: user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c ============================================================================== --- user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c Mon Mar 8 21:17:10 2010 (r204887) +++ user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c Mon Mar 8 21:22:34 2010 (r204888) @@ -730,10 +730,6 @@ platform_start(__register_t a0, __regist { uint64_t platform_counter_freq; -#if defined(__mips_o32) - boothowto |= RB_SINGLE; -#endif - /* Initialize pcpu stuff */ mips_pcpu0_init(); mips_timer_early_init(OCTEON_CLOCK_DEFAULT); Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1-32 ============================================================================== --- user/jmallett/octeon/sys/mips/conf/OCTEON1-32 Mon Mar 8 21:17:10 2010 (r204887) +++ user/jmallett/octeon/sys/mips/conf/OCTEON1-32 Mon Mar 8 21:22:34 2010 (r204888) @@ -24,8 +24,7 @@ ident OCTEON1 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" makeoptions TARGET_BIG_ENDIAN=defined -makeoptions TARGET_N32=defined -makeoptions ARCH_FLAGS="-march=mips64 -mabi=n32" +makeoptions ARCH_FLAGS="-march=mips64" makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.n32 makeoptions KERNLOADADDR=0xffffffff81000000 Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 ============================================================================== --- user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 Mon Mar 8 21:17:10 2010 (r204887) +++ user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 Mon Mar 8 21:22:34 2010 (r204888) @@ -24,7 +24,7 @@ ident OCTEON1 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" makeoptions TARGET_BIG_ENDIAN=defined -makeoptions ARCH_FLAGS="-march=mips64 -mabi=32" +makeoptions ARCH_FLAGS="-march=mips64" makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.32 makeoptions KERNLOADADDR=0xffffffff81000000 From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 21:25:38 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1E8F106564A; Mon, 8 Mar 2010 21:25:38 +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 C0C708FC12; Mon, 8 Mar 2010 21:25: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 o28LPcbC012189; Mon, 8 Mar 2010 21:25:38 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28LPc7e012182; Mon, 8 Mar 2010 21:25:38 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201003082125.o28LPc7e012182@svn.freebsd.org> From: Juli Mallett Date: Mon, 8 Mar 2010 21:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204889 - in user/jmallett/octeon: share/mk sys/mips/conf X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 21:25:39 -0000 Author: jmallett Date: Mon Mar 8 21:25:38 2010 New Revision: 204889 URL: http://svn.freebsd.org/changeset/base/204889 Log: Use the ABI and endianness of the compiler, get rid of TARGET_BIG_ENDIAN checks in setting default CFLAGS and LDFLAGS and settings of TARGET_BIG_ENDIAN, ABI and TARGET_64BIT in MIPS kernel configurations. Modified: user/jmallett/octeon/share/mk/bsd.cpu.mk user/jmallett/octeon/sys/mips/conf/AR71XX user/jmallett/octeon/sys/mips/conf/OCTEON1 user/jmallett/octeon/sys/mips/conf/OCTEON1-32 user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 user/jmallett/octeon/sys/mips/conf/XLR Modified: user/jmallett/octeon/share/mk/bsd.cpu.mk ============================================================================== --- user/jmallett/octeon/share/mk/bsd.cpu.mk Mon Mar 8 21:22:34 2010 (r204888) +++ user/jmallett/octeon/share/mk/bsd.cpu.mk Mon Mar 8 21:25:38 2010 (r204889) @@ -201,13 +201,6 @@ LD += -EB .endif .if ${MACHINE_ARCH} == "mips" -. if defined(TARGET_BIG_ENDIAN) -CFLAGS += -EB -LD += -EB -. else -CFLAGS += -EL -LD += -EL -. endif CFLAGS += -G0 .endif Modified: user/jmallett/octeon/sys/mips/conf/AR71XX ============================================================================== --- user/jmallett/octeon/sys/mips/conf/AR71XX Mon Mar 8 21:22:34 2010 (r204888) +++ user/jmallett/octeon/sys/mips/conf/AR71XX Mon Mar 8 21:25:38 2010 (r204889) @@ -7,7 +7,6 @@ ident AR71XX cpu CPU_MIPS4KC options ISA_MIPS32 -makeoptions TARGET_BIG_ENDIAN makeoptions KERNLOADADDR=0x80050000 options HZ=1000 Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1 ============================================================================== --- user/jmallett/octeon/sys/mips/conf/OCTEON1 Mon Mar 8 21:22:34 2010 (r204888) +++ user/jmallett/octeon/sys/mips/conf/OCTEON1 Mon Mar 8 21:25:38 2010 (r204889) @@ -28,13 +28,11 @@ machine mips cpu CPU_MIPS4KC ident OCTEON1 -makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" +makeoptions ARCH_FLAGS="-march=mips64" makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.64 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN=defined -makeoptions TARGET_64BIT=defined makeoptions KERNLOADADDR=0xffffffff81000000 Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1-32 ============================================================================== --- user/jmallett/octeon/sys/mips/conf/OCTEON1-32 Mon Mar 8 21:22:34 2010 (r204888) +++ user/jmallett/octeon/sys/mips/conf/OCTEON1-32 Mon Mar 8 21:25:38 2010 (r204889) @@ -23,7 +23,6 @@ ident OCTEON1 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN=defined makeoptions ARCH_FLAGS="-march=mips64" makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.n32 Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 ============================================================================== --- user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 Mon Mar 8 21:22:34 2010 (r204888) +++ user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 Mon Mar 8 21:25:38 2010 (r204889) @@ -23,7 +23,6 @@ ident OCTEON1 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN=defined makeoptions ARCH_FLAGS="-march=mips64" makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.32 Modified: user/jmallett/octeon/sys/mips/conf/XLR ============================================================================== --- user/jmallett/octeon/sys/mips/conf/XLR Mon Mar 8 21:22:34 2010 (r204888) +++ user/jmallett/octeon/sys/mips/conf/XLR Mon Mar 8 21:25:38 2010 (r204889) @@ -50,7 +50,6 @@ cpu CPU_MIPS4KC ident XLR makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN # include "../rmi/std.xlr" From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 23:01:29 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34307106567A; Mon, 8 Mar 2010 23:01:29 +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 E64D88FC2F; Mon, 8 Mar 2010 23:01: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 o28N1Sb9033614; Mon, 8 Mar 2010 23:01:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28N1SgP033613; Mon, 8 Mar 2010 23:01:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003082301.o28N1SgP033613@svn.freebsd.org> From: Xin LI Date: Mon, 8 Mar 2010 23:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204897 - user/delphij X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 23:01:29 -0000 Author: delphij Date: Mon Mar 8 23:01:28 2010 New Revision: 204897 URL: http://svn.freebsd.org/changeset/base/204897 Log: Create a workspace for myself. Added: user/delphij/ From owner-svn-src-user@FreeBSD.ORG Mon Mar 8 23:06:10 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 173AE10656A5; Mon, 8 Mar 2010 23:06:10 +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 056A78FC0A; Mon, 8 Mar 2010 23:06: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 o28N6Ath034716; Mon, 8 Mar 2010 23:06:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28N69sl034708; Mon, 8 Mar 2010 23:06:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003082306.o28N69sl034708@svn.freebsd.org> From: Xin LI Date: Mon, 8 Mar 2010 23:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204898 - user/delphij/patch X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 23:06:10 -0000 Author: delphij Date: Mon Mar 8 23:06:09 2010 New Revision: 204898 URL: http://svn.freebsd.org/changeset/base/204898 Log: Initial work on the fully BSD licensed patch(1). This is a port from OpenBSD's patch(1) as of today with local changes for WARNS=6. Obtained from: OpenBSD Added: user/delphij/patch/ user/delphij/patch/Makefile (contents, props changed) user/delphij/patch/README user/delphij/patch/backupfile.c (contents, props changed) user/delphij/patch/backupfile.h (contents, props changed) user/delphij/patch/common.h (contents, props changed) user/delphij/patch/inp.c (contents, props changed) user/delphij/patch/inp.h (contents, props changed) user/delphij/patch/mkpath.c (contents, props changed) user/delphij/patch/patch.1 (contents, props changed) user/delphij/patch/patch.c (contents, props changed) user/delphij/patch/pathnames.h (contents, props changed) user/delphij/patch/pch.c (contents, props changed) user/delphij/patch/pch.h (contents, props changed) user/delphij/patch/util.c (contents, props changed) user/delphij/patch/util.h (contents, props changed) Added: user/delphij/patch/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/delphij/patch/Makefile Mon Mar 8 23:06:09 2010 (r204898) @@ -0,0 +1,7 @@ +# $OpenBSD: Makefile,v 1.4 2005/05/16 15:22:46 espie Exp $ +# $FreeBSD$ + +PROG= patch +SRCS= patch.c pch.c inp.c util.c backupfile.c mkpath.c + +.include Added: user/delphij/patch/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/delphij/patch/README Mon Mar 8 23:06:09 2010 (r204898) @@ -0,0 +1,125 @@ +$FreeBSD$ + +this version modified to fit in with the 386bsd release. +this isn't gnu software, so we're not obligated to give +you the original sources -- if you want them, get them +from prep.ai.mit.edu:pub/gnu/patch-2.0.12u8.tar.z + + -- cgd + +####################################################################### + + +This version of patch contains modifications made by the Free Software +Foundation, summarized in the file ChangeLog. Primarily they are to +support the unified context diff format that GNU diff can produce, and +to support making GNU Emacs-style backup files. They also include +fixes for some bugs. + +There are two GNU variants of patch: this one, which retains Larry +Wall's interactive Configure script and has patchlevels starting with +`12u'; and another one that has a GNU-style non-interactive configure +script and accepts long-named options, and has patchlevels starting +with `12g'. Unlike the 12g variant, the 12u variant contains no +copylefted code, for the paranoid. The two variants are otherwise the +same. They should be available from the same places. + +The FSF is distributing this version of patch independently because as +of this writing, Larry Wall has not released a new version of patch +since mid-1988. I have heard that he has been too busy working on +other things, like Perl. + +Here is a wish list of some projects to improve patch: + +1. Correctly handle files and patchfiles that contain NUL characters. +This is hard to do straightforwardly; it would be less work to +adopt a kind of escape encoding internally. +Let ESC be a "control prefix". ESC @ stands for NUL. ESC [ stands for ESC. +You need to crunch this when reading input (replace fgets), +and when writing the output file (replace fputs), +but otherwise everything can go along as it does now. +Be careful to handle reject files correctly; +I think they are currently created using `write', not `fputs'. + +2. Correctly handle patches produced by GNU diff for files that do +not end with a newline. + +Please send bug reports for this version of patch to +bug-gnu-utils@prep.ai.mit.edu as well as to Larry Wall (lwall@netlabs.com). + --djm@gnu.ai.mit.edu (David MacKenzie) + + Patch Kit, Version 2.0 + + Copyright (c) 1988, Larry Wall + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following condition +is met: + 1. Redistributions of source code must retain the above copyright + notice, this condition and the following disclaimer. + +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. +-------------------------------------------------------------------------- + +Please read all the directions below before you proceed any further, and +then follow them carefully. Failure to do so may void your warranty. :-) + +After you have unpacked your kit, you should have all the files listed +in MANIFEST. + +Installation + +1) Run Configure. This will figure out various things about your system. + Some things Configure will figure out for itself, other things it will + ask you about. It will then proceed to make config.h, config.sh, and + Makefile. + + You might possibly have to trim # comments from the front of Configure + if your sh doesn't handle them, but all other # comments will be taken + care of. + + If you don't have sh, you'll have to rip the prototype of config.h out + of Configure and generate the defines by hand. + +2) Glance through config.h to make sure system dependencies are correct. + Most of them should have been taken care of by running the + Configure script. + + If you have any additional changes to make to the C definitions, they + can be done in the Makefile, or in config.h. Bear in mind that they may + get undone next time you run Configure. + +3) make + + This will attempt to make patch in the current directory. + +4) make install + + This will put patch into a public directory (normally /usr/local/bin). + It will also try to put the man pages in a reasonable place. It will not + nroff the man page, however. + +5) Read the manual entry before running patch. + +6) IMPORTANT! Help save the world! Communicate any problems and + suggested patches to me, lwall@netlabs.com (Larry Wall), + so we can keep the world in sync. If you have a problem, there's + someone else out there who either has had or will have the same problem. + + If possible, send in patches such that the patch program will apply them. + Context diffs are the best, then normal diffs. Don't send ed scripts-- + I've probably changed my copy since the version you have. + + Watch for patch patches in comp.sources.bugs. Patches will generally be + in a form usable by the patch program. Your current patch level + is shown in patchlevel.h. Added: user/delphij/patch/backupfile.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/delphij/patch/backupfile.c Mon Mar 8 23:06:09 2010 (r204898) @@ -0,0 +1,237 @@ +/* $OpenBSD: backupfile.c,v 1.20 2009/10/27 23:59:41 deraadt Exp $ */ + +/* + * backupfile.c -- make Emacs style backup file names Copyright (C) 1990 Free + * Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * without restriction. + * + * 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. + */ + +/* + * David MacKenzie . Some algorithms adapted from GNU Emacs. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include "backupfile.h" + + +#define ISDIGIT(c) (isascii (c) && isdigit (c)) + +/* Which type of backup file names are generated. */ +enum backup_type backup_type = none; + +/* + * The extension added to file names to produce a simple (as opposed to + * numbered) backup file name. + */ +const char *simple_backup_suffix = "~"; + +static char *concat(const char *, const char *); +static char *make_version_name(const char *, int); +static int max_backup_version(const char *, const char *); +static int version_number(const char *, const char *, size_t); +static int argmatch(const char *, const char **); +static void invalid_arg(const char *, const char *, int); + +/* + * Return the name of the new backup file for file FILE, allocated with + * malloc. Return 0 if out of memory. FILE must not end with a '/' unless it + * is the root directory. Do not call this function if backup_type == none. + */ +char * +find_backup_file_name(const char *file) +{ + char *dir, *base_versions; + int highest_backup; + + if (backup_type == simple) + return concat(file, simple_backup_suffix); + base_versions = concat(basename(file), ".~"); + if (base_versions == NULL) + return NULL; + dir = dirname(file); + if (dir == NULL) { + free(base_versions); + return NULL; + } + highest_backup = max_backup_version(base_versions, dir); + free(base_versions); + if (backup_type == numbered_existing && highest_backup == 0) + return concat(file, simple_backup_suffix); + return make_version_name(file, highest_backup + 1); +} + +/* + * Return the number of the highest-numbered backup file for file FILE in + * directory DIR. If there are no numbered backups of FILE in DIR, or an + * error occurs reading DIR, return 0. FILE should already have ".~" appended + * to it. + */ +static int +max_backup_version(const char *file, const char *dir) +{ + DIR *dirp; + struct dirent *dp; + int highest_version, this_version; + size_t file_name_length; + + dirp = opendir(dir); + if (dirp == NULL) + return 0; + + highest_version = 0; + file_name_length = strlen(file); + + while ((dp = readdir(dirp)) != NULL) { + if (dp->d_namlen <= file_name_length) + continue; + + this_version = version_number(file, dp->d_name, file_name_length); + if (this_version > highest_version) + highest_version = this_version; + } + closedir(dirp); + return highest_version; +} + +/* + * Return a string, allocated with malloc, containing "FILE.~VERSION~". + * Return 0 if out of memory. + */ +static char * +make_version_name(const char *file, int version) +{ + char *backup_name; + + if (asprintf(&backup_name, "%s.~%d~", file, version) == -1) + return NULL; + return backup_name; +} + +/* + * If BACKUP is a numbered backup of BASE, return its version number; + * otherwise return 0. BASE_LENGTH is the length of BASE. BASE should + * already have ".~" appended to it. + */ +static int +version_number(const char *base, const char *backup, size_t base_length) +{ + int version; + const char *p; + + version = 0; + if (!strncmp(base, backup, base_length) && ISDIGIT(backup[base_length])) { + for (p = &backup[base_length]; ISDIGIT(*p); ++p) + version = version * 10 + *p - '0'; + if (p[0] != '~' || p[1]) + version = 0; + } + return version; +} + +/* + * Return the newly-allocated concatenation of STR1 and STR2. If out of + * memory, return 0. + */ +static char * +concat(const char *str1, const char *str2) +{ + char *newstr; + + if (asprintf(&newstr, "%s%s", str1, str2) == -1) + return NULL; + return newstr; +} + +/* + * If ARG is an unambiguous match for an element of the null-terminated array + * OPTLIST, return the index in OPTLIST of the matched element, else -1 if it + * does not match any element or -2 if it is ambiguous (is a prefix of more + * than one element). + */ +static int +argmatch(const char *arg, const char **optlist) +{ + int i; /* Temporary index in OPTLIST. */ + size_t arglen; /* Length of ARG. */ + int matchind = -1; /* Index of first nonexact match. */ + int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */ + + arglen = strlen(arg); + + /* Test all elements for either exact match or abbreviated matches. */ + for (i = 0; optlist[i]; i++) { + if (!strncmp(optlist[i], arg, arglen)) { + if (strlen(optlist[i]) == arglen) + /* Exact match found. */ + return i; + else if (matchind == -1) + /* First nonexact match found. */ + matchind = i; + else + /* Second nonexact match found. */ + ambiguous = 1; + } + } + if (ambiguous) + return -2; + else + return matchind; +} + +/* + * Error reporting for argmatch. KIND is a description of the type of entity + * that was being matched. VALUE is the invalid value that was given. PROBLEM + * is the return value from argmatch. + */ +static void +invalid_arg(const char *kind, const char *value, int problem) +{ + fprintf(stderr, "patch: "); + if (problem == -1) + fprintf(stderr, "invalid"); + else /* Assume -2. */ + fprintf(stderr, "ambiguous"); + fprintf(stderr, " %s `%s'\n", kind, value); +} + +static const char *backup_args[] = { + "never", "simple", "nil", "existing", "t", "numbered", 0 +}; + +static enum backup_type backup_types[] = { + simple, simple, numbered_existing, + numbered_existing, numbered, numbered +}; + +/* + * Return the type of backup indicated by VERSION. Unique abbreviations are + * accepted. + */ +enum backup_type +get_version(const char *version) +{ + int i; + + if (version == NULL || *version == '\0') + return numbered_existing; + i = argmatch(version, backup_args); + if (i >= 0) + return backup_types[i]; + invalid_arg("version control type", version, i); + exit(2); +} Added: user/delphij/patch/backupfile.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/delphij/patch/backupfile.h Mon Mar 8 23:06:09 2010 (r204898) @@ -0,0 +1,39 @@ +/* $OpenBSD: backupfile.h,v 1.6 2003/07/28 18:35:36 otto Exp $ */ + +/* + * backupfile.h -- declarations for making Emacs style backup file names + * Copyright (C) 1990 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * without restriction. + * + * 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. + * + * $FreeBSD$ + */ + +/* When to make backup files. */ +enum backup_type { + /* Never make backups. */ + none, + + /* Make simple backups of every file. */ + simple, + + /* + * Make numbered backups of files that already have numbered backups, + * and simple backups of the others. + */ + numbered_existing, + + /* Make numbered backups of every file. */ + numbered +}; + +extern enum backup_type backup_type; +extern const char *simple_backup_suffix; + +char *find_backup_file_name(const char *file); +enum backup_type get_version(const char *version); Added: user/delphij/patch/common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/delphij/patch/common.h Mon Mar 8 23:06:09 2010 (r204898) @@ -0,0 +1,118 @@ +/* $OpenBSD: common.h,v 1.26 2006/03/11 19:41:30 otto Exp $ */ + +/* + * patch - a program to apply diffs to original files + * + * Copyright 1986, Larry Wall + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following condition is met: + * 1. Redistributions of source code must retain the above copyright notice, + * this condition and the following disclaimer. + * + * 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. + * + * -C option added in 1998, original code by Marc Espie, based on FreeBSD + * behaviour + * + * $FreeBSD$ + */ + +#include + +#include + +#define DEBUGGING + +/* constants */ + +#define MAXHUNKSIZE 100000 /* is this enough lines? */ +#define INITHUNKMAX 125 /* initial dynamic allocation size */ +#define MAXLINELEN 8192 +#define BUFFERSIZE 1024 + +#define SCCSPREFIX "s." +#define GET "get -e %s" +#define SCCSDIFF "get -p %s | diff - %s >/dev/null" + +#define RCSSUFFIX ",v" +#define CHECKOUT "co -l %s" +#define RCSDIFF "rcsdiff %s > /dev/null" + +#define ORIGEXT ".orig" +#define REJEXT ".rej" + +/* handy definitions */ + +#define strNE(s1,s2) (strcmp(s1, s2)) +#define strEQ(s1,s2) (!strcmp(s1, s2)) +#define strnNE(s1,s2,l) (strncmp(s1, s2, l)) +#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) + +/* typedefs */ + +typedef long LINENUM; /* must be signed */ + +/* globals */ + +extern mode_t filemode; + +extern char buf[MAXLINELEN];/* general purpose buffer */ + +extern bool using_plan_a; /* try to keep everything in memory */ +extern bool out_of_mem; /* ran out of memory in plan a */ + +#define MAXFILEC 2 + +extern char *filearg[MAXFILEC]; +extern bool ok_to_create_file; +extern char *outname; +extern char *origprae; + +extern char *TMPOUTNAME; +extern char *TMPINNAME; +extern char *TMPREJNAME; +extern char *TMPPATNAME; +extern bool toutkeep; +extern bool trejkeep; + +#ifdef DEBUGGING +extern int debug; +#endif + +extern bool force; +extern bool batch; +extern bool verbose; +extern bool reverse; +extern bool noreverse; +extern bool skip_rest_of_patch; +extern int strippath; +extern bool canonicalize; +/* TRUE if -C was specified on command line. */ +extern bool check_only; +extern bool warn_on_invalid_line; +extern bool last_line_missing_eol; + + +#define CONTEXT_DIFF 1 +#define NORMAL_DIFF 2 +#define ED_DIFF 3 +#define NEW_CONTEXT_DIFF 4 +#define UNI_DIFF 5 + +extern int diff_type; +extern char *revision; /* prerequisite revision, if any */ +extern LINENUM input_lines; /* how long is input file in lines */ + +extern int posix; + Added: user/delphij/patch/inp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/delphij/patch/inp.c Mon Mar 8 23:06:09 2010 (r204898) @@ -0,0 +1,468 @@ +/* $OpenBSD: inp.c,v 1.35 2009/10/27 23:59:41 deraadt Exp $ */ + +/* + * patch - a program to apply diffs to original files + * + * Copyright 1986, Larry Wall + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following condition is met: + * 1. Redistributions of source code must retain the above copyright notice, + * this condition and the following disclaimer. + * + * 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. + * + * -C option added in 1998, original code by Marc Espie, based on FreeBSD + * behaviour + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "util.h" +#include "pch.h" +#include "inp.h" + + +/* Input-file-with-indexable-lines abstract type */ + +static off_t i_size; /* size of the input file */ +static char *i_womp; /* plan a buffer for entire file */ +static char **i_ptr; /* pointers to lines in i_womp */ + +static int tifd = -1; /* plan b virtual string array */ +static char *tibuf[2]; /* plan b buffers */ +static LINENUM tiline[2] = {-1, -1}; /* 1st line in each buffer */ +static LINENUM lines_per_buf; /* how many lines per buffer */ +static int tireclen; /* length of records in tmp file */ + +static bool rev_in_string(const char *); +static bool reallocate_lines(size_t *); + +/* returns false if insufficient memory */ +static bool plan_a(const char *); + +static void plan_b(const char *); + +/* New patch--prepare to edit another file. */ + +void +re_input(void) +{ + if (using_plan_a) { + i_size = 0; + free(i_ptr); + i_ptr = NULL; + if (i_womp != NULL) { + munmap(i_womp, i_size); + i_womp = NULL; + } + } else { + using_plan_a = true; /* maybe the next one is smaller */ + close(tifd); + tifd = -1; + free(tibuf[0]); + free(tibuf[1]); + tibuf[0] = tibuf[1] = NULL; + tiline[0] = tiline[1] = -1; + tireclen = 0; + } +} + +/* Construct the line index, somehow or other. */ + +void +scan_input(const char *filename) +{ + if (!plan_a(filename)) + plan_b(filename); + if (verbose) { + say("Patching file %s using Plan %s...\n", filename, + (using_plan_a ? "A" : "B")); + } +} + +static bool +reallocate_lines(size_t *lines_allocated) +{ + char **p; + size_t new_size; + + new_size = *lines_allocated * 3 / 2; + p = realloc(i_ptr, (new_size + 2) * sizeof(char *)); + if (p == NULL) { /* shucks, it was a near thing */ + munmap(i_womp, i_size); + i_womp = NULL; + free(i_ptr); + i_ptr = NULL; + *lines_allocated = 0; + return false; + } + *lines_allocated = new_size; + i_ptr = p; + return true; +} + +/* Try keeping everything in memory. */ + +static bool +plan_a(const char *filename) +{ + int ifd, statfailed; + char *p, *s, lbuf[MAXLINELEN]; + struct stat filestat; + off_t i; + ptrdiff_t sz; + size_t iline, lines_allocated; + +#ifdef DEBUGGING + if (debug & 8) + return false; +#endif + + if (filename == NULL || *filename == '\0') + return false; + + statfailed = stat(filename, &filestat); + if (statfailed && ok_to_create_file) { + if (verbose) + say("(Creating file %s...)\n", filename); + + /* + * in check_patch case, we still display `Creating file' even + * though we're not. The rule is that -C should be as similar + * to normal patch behavior as possible + */ + if (check_only) + return true; + makedirs(filename, true); + close(creat(filename, 0666)); + statfailed = stat(filename, &filestat); + } + if (statfailed && check_only) + fatal("%s not found, -C mode, can't probe further\n", filename); + /* For nonexistent or read-only files, look for RCS or SCCS versions. */ + if (statfailed || + /* No one can write to it. */ + (filestat.st_mode & 0222) == 0 || + /* I can't write to it. */ + ((filestat.st_mode & 0022) == 0 && filestat.st_uid != getuid())) { + const char *cs = NULL, *filebase, *filedir; + struct stat cstat; + + filebase = basename(filename); + filedir = dirname(filename); + + /* Leave room in lbuf for the diff command. */ + s = lbuf + 20; + +#define try(f, a1, a2, a3) \ + (snprintf(s, sizeof lbuf - 20, f, a1, a2, a3), stat(s, &cstat) == 0) + + if (try("%s/RCS/%s%s", filedir, filebase, RCSSUFFIX) || + try("%s/RCS/%s%s", filedir, filebase, "") || + try("%s/%s%s", filedir, filebase, RCSSUFFIX)) { + snprintf(buf, sizeof buf, CHECKOUT, filename); + snprintf(lbuf, sizeof lbuf, RCSDIFF, filename); + cs = "RCS"; + } else if (try("%s/SCCS/%s%s", filedir, SCCSPREFIX, filebase) || + try("%s/%s%s", filedir, SCCSPREFIX, filebase)) { + snprintf(buf, sizeof buf, GET, s); + snprintf(lbuf, sizeof lbuf, SCCSDIFF, s, filename); + cs = "SCCS"; + } else if (statfailed) + fatal("can't find %s\n", filename); + /* + * else we can't write to it but it's not under a version + * control system, so just proceed. + */ + if (cs) { + if (!statfailed) { + if ((filestat.st_mode & 0222) != 0) + /* The owner can write to it. */ + fatal("file %s seems to be locked " + "by somebody else under %s\n", + filename, cs); + /* + * It might be checked out unlocked. See if + * it's safe to check out the default version + * locked. + */ + if (verbose) + say("Comparing file %s to default " + "%s version...\n", + filename, cs); + if (system(lbuf)) + fatal("can't check out file %s: " + "differs from default %s version\n", + filename, cs); + } + if (verbose) + say("Checking out file %s from %s...\n", + filename, cs); + if (system(buf) || stat(filename, &filestat)) + fatal("can't check out file %s from %s\n", + filename, cs); + } + } + filemode = filestat.st_mode; + if (!S_ISREG(filemode)) + fatal("%s is not a normal file--can't patch\n", filename); + i_size = filestat.st_size; + if (out_of_mem) { + set_hunkmax(); /* make sure dynamic arrays are allocated */ + out_of_mem = false; + return false; /* force plan b because plan a bombed */ + } + if ((ifd = open(filename, O_RDONLY)) < 0) + pfatal("can't open file %s", filename); + + i_womp = mmap(NULL, i_size, PROT_READ, MAP_PRIVATE, ifd, 0); + if (i_womp == MAP_FAILED) { + perror("mmap failed"); + i_womp = NULL; + close(ifd); + return false; + } + + close(ifd); + if (i_size) + madvise(i_womp, i_size, MADV_SEQUENTIAL); + + /* estimate the number of lines */ + lines_allocated = i_size / 25; + if (lines_allocated < 100) + lines_allocated = 100; + + if (!reallocate_lines(&lines_allocated)) + return false; + + /* now scan the buffer and build pointer array */ + iline = 1; + i_ptr[iline] = i_womp; + /* test for NUL too, to maintain the behavior of the original code */ + for (s = i_womp, i = 0; i < i_size && *s != '\0'; s++, i++) { + if (*s == '\n') { + if (iline == lines_allocated) { + if (!reallocate_lines(&lines_allocated)) + return false; + } + /* these are NOT NUL terminated */ + i_ptr[++iline] = s + 1; + } + } + /* if the last line contains no EOL, append one */ + if (i_size > 0 && i_womp[i_size - 1] != '\n') { + last_line_missing_eol = true; + /* fix last line */ + sz = s - i_ptr[iline]; + p = malloc(sz + 1); + if (p == NULL) { + free(i_ptr); + i_ptr = NULL; + munmap(i_womp, i_size); + i_womp = NULL; + return false; + } + + memcpy(p, i_ptr[iline], sz); + p[sz] = '\n'; + i_ptr[iline] = p; + /* count the extra line and make it point to some valid mem */ + i_ptr[++iline] = strdup(""); + } else + last_line_missing_eol = false; + + input_lines = iline - 1; + + /* now check for revision, if any */ + + if (revision != NULL) { + if (!rev_in_string(i_womp)) { + if (force) { + if (verbose) + say("Warning: this file doesn't appear " + "to be the %s version--patching anyway.\n", + revision); + } else if (batch) { + fatal("this file doesn't appear to be the " + "%s version--aborting.\n", + revision); + } else { + ask("This file doesn't appear to be the " + "%s version--patch anyway? [n] ", + revision); + if (*buf != 'y') + fatal("aborted\n"); + } + } else if (verbose) + say("Good. This file appears to be the %s version.\n", + revision); + } + return true; /* plan a will work */ +} + +/* Keep (virtually) nothing in memory. */ + +static void +plan_b(const char *filename) +{ + FILE *ifp; + size_t i = 0, j, maxlen = 1; + char *p; + bool found_revision = (revision == NULL); + + using_plan_a = false; + if ((ifp = fopen(filename, "r")) == NULL) + pfatal("can't open file %s", filename); + (void) unlink(TMPINNAME); + if ((tifd = open(TMPINNAME, O_EXCL | O_CREAT | O_WRONLY, 0666)) < 0) + pfatal("can't open file %s", TMPINNAME); + while (fgets(buf, sizeof buf, ifp) != NULL) { + if (revision != NULL && !found_revision && rev_in_string(buf)) + found_revision = true; + if ((i = strlen(buf)) > maxlen) + maxlen = i; /* find longest line */ + } + last_line_missing_eol = i > 0 && buf[i - 1] != '\n'; + if (last_line_missing_eol && maxlen == i) + maxlen++; + + if (revision != NULL) { + if (!found_revision) { + if (force) { + if (verbose) + say("Warning: this file doesn't appear " + "to be the %s version--patching anyway.\n", + revision); + } else if (batch) { + fatal("this file doesn't appear to be the " + "%s version--aborting.\n", + revision); + } else { + ask("This file doesn't appear to be the %s " + "version--patch anyway? [n] ", + revision); + if (*buf != 'y') + fatal("aborted\n"); + } + } else if (verbose) + say("Good. This file appears to be the %s version.\n", + revision); + } + fseek(ifp, 0L, SEEK_SET); /* rewind file */ + lines_per_buf = BUFFERSIZE / maxlen; + tireclen = maxlen; + tibuf[0] = malloc(BUFFERSIZE + 1); + if (tibuf[0] == NULL) + fatal("out of memory\n"); + tibuf[1] = malloc(BUFFERSIZE + 1); + if (tibuf[1] == NULL) + fatal("out of memory\n"); + for (i = 1;; i++) { + p = tibuf[0] + maxlen * (i % lines_per_buf); + if (i % lines_per_buf == 0) /* new block */ + if (write(tifd, tibuf[0], BUFFERSIZE) < BUFFERSIZE) + pfatal("can't write temp file"); + if (fgets(p, maxlen + 1, ifp) == NULL) { + input_lines = i - 1; + if (i % lines_per_buf != 0) + if (write(tifd, tibuf[0], BUFFERSIZE) < BUFFERSIZE) + pfatal("can't write temp file"); + break; + } + j = strlen(p); + /* These are '\n' terminated strings, so no need to add a NUL */ + if (j == 0 || p[j - 1] != '\n') + p[j] = '\n'; + } + fclose(ifp); + close(tifd); + if ((tifd = open(TMPINNAME, O_RDONLY)) < 0) + pfatal("can't reopen file %s", TMPINNAME); +} + +/* + * Fetch a line from the input file, \n terminated, not necessarily \0. + */ +char * +ifetch(LINENUM line, int whichbuf) +{ + if (line < 1 || line > input_lines) { + if (warn_on_invalid_line) { + say("No such line %ld in input file, ignoring\n", line); + warn_on_invalid_line = false; + } + return NULL; + } + if (using_plan_a) + return i_ptr[line]; + else { + LINENUM offline = line % lines_per_buf; + LINENUM baseline = line - offline; + + if (tiline[0] == baseline) + whichbuf = 0; + else if (tiline[1] == baseline) + whichbuf = 1; + else { + tiline[whichbuf] = baseline; + + if (lseek(tifd, (off_t) (baseline / lines_per_buf * + BUFFERSIZE), SEEK_SET) < 0) + pfatal("cannot seek in the temporary input file"); + + if (read(tifd, tibuf[whichbuf], BUFFERSIZE) < 0) + pfatal("error reading tmp file %s", TMPINNAME); + } + return tibuf[whichbuf] + (tireclen * offline); + } +} + +/* + * True if the string argument contains the revision number we want. + */ +static bool +rev_in_string(const char *string) +{ + const char *s; + size_t patlen; + + if (revision == NULL) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Tue Mar 9 20:25:40 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 715A2106566B; Tue, 9 Mar 2010 20:25:40 +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 604698FC12; Tue, 9 Mar 2010 20:25: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 o29KPei9020730; Tue, 9 Mar 2010 20:25:40 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o29KPe7g020728; Tue, 9 Mar 2010 20:25:40 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201003092025.o29KPe7g020728@svn.freebsd.org> From: Juli Mallett Date: Tue, 9 Mar 2010 20:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204924 - user/jmallett/octeon/usr.sbin X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2010 20:25:40 -0000 Author: jmallett Date: Tue Mar 9 20:25:40 2010 New Revision: 204924 URL: http://svn.freebsd.org/changeset/base/204924 Log: Disable uathload on MIPS for same reason as Itanium. Modified: user/jmallett/octeon/usr.sbin/Makefile Modified: user/jmallett/octeon/usr.sbin/Makefile ============================================================================== --- user/jmallett/octeon/usr.sbin/Makefile Tue Mar 9 20:07:41 2010 (r204923) +++ user/jmallett/octeon/usr.sbin/Makefile Tue Mar 9 20:25:40 2010 (r204924) @@ -407,7 +407,7 @@ _crunch= crunch .endif .if ${MK_USB} != "no" -.if ${MACHINE_ARCH} != "ia64" +.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "mips" _uathload= uathload .endif _uhsoctl= uhsoctl From owner-svn-src-user@FreeBSD.ORG Tue Mar 9 21:07:33 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC2C21065675; Tue, 9 Mar 2010 21:07:33 +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 CB6918FC1A; Tue, 9 Mar 2010 21: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 o29L7X0g030320; Tue, 9 Mar 2010 21:07:33 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o29L7XeT030318; Tue, 9 Mar 2010 21:07:33 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003092107.o29L7XeT030318@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 9 Mar 2010 21:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204929 - user/edwin/ncal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2010 21:07:33 -0000 Author: edwin Date: Tue Mar 9 21:07:33 2010 New Revision: 204929 URL: http://svn.freebsd.org/changeset/base/204929 Log: Make -3 option more urgent than with regarding to the number of months printed. Modified: user/edwin/ncal/ncal.c Modified: user/edwin/ncal/ncal.c ============================================================================== --- user/edwin/ncal/ncal.c Tue Mar 9 21:06:17 2010 (r204928) +++ user/edwin/ncal/ncal.c Tue Mar 9 21:07:33 2010 (r204929) @@ -338,8 +338,10 @@ main(int argc, char *argv[]) if (flag_easter) usage(); flag_month = *argv++; - before = 0; - after = 0; + if (before == -1 && after == -1) { + before = 0; + after = 0; + } m = strtol(flag_month, NULL, 10); /* FALLTHROUGH */ case 1: From owner-svn-src-user@FreeBSD.ORG Tue Mar 9 22:34:27 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8BA81065672; Tue, 9 Mar 2010 22: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 D77CA8FC18; Tue, 9 Mar 2010 22: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 o29MYQAM049648; Tue, 9 Mar 2010 22: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 o29MYQK9049643; Tue, 9 Mar 2010 22:34:26 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201003092234.o29MYQK9049643@svn.freebsd.org> From: Juli Mallett Date: Tue, 9 Mar 2010 22:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204932 - in user/jmallett/octeon/sys: conf mips/conf X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2010 22:34:27 -0000 Author: jmallett Date: Tue Mar 9 22:34:26 2010 New Revision: 204932 URL: http://svn.freebsd.org/changeset/base/204932 Log: Merge all the Octeon ldscripts. There are better ways to override the output binary format than doing it in the ldscript, and with TARGET_ABI we have the right default now anyway. Now, modulo checking uses of ISA_MIPS32 vs. ISA_MIPS64 here, the n32 and o32 kernel configurations are identical but for sorting and style issues. Added: user/jmallett/octeon/sys/conf/ldscript.mips.octeon1 Deleted: user/jmallett/octeon/sys/conf/ldscript.mips.octeon1.32 user/jmallett/octeon/sys/conf/ldscript.mips.octeon1.64 user/jmallett/octeon/sys/conf/ldscript.mips.octeon1.n32 Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1 user/jmallett/octeon/sys/mips/conf/OCTEON1-32 user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 Added: user/jmallett/octeon/sys/conf/ldscript.mips.octeon1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/jmallett/octeon/sys/conf/ldscript.mips.octeon1 Tue Mar 9 22:34:26 2010 (r204932) @@ -0,0 +1,58 @@ +/* $FreeBSD: user/jmallett/octeon/sys/conf/ldscript.mips.octeon1.32 204784 2010-03-05 23:14:01Z jmallett $ */ + +OUTPUT_ARCH(mips) +ENTRY(_start) + __DYNAMIC = 0; +PROVIDE (_DYNAMIC = 0); + +SECTIONS { + . = KERNLOADADDR + SIZEOF_HEADERS; + + .text . : { + *(.text) + *(.dynamic) + etext = .; + _etext = .; + . = ALIGN(0x2000); + } + + .rodata ALIGN(0x2000) : { + _fdata = .; + *(.rodata) + . = ALIGN(32); + } + + .data . : { + _rwdata = .; + *(.data) + . = ALIGN(32); + CONSTRUCTORS; + } + + _gp = (. + 0x8000); + + .sdata . : { + _small_start = .; + *(.sdata) + . = ALIGN(32); + edata = .; + _edata = .; + } + + .sbss . : { + __bss_start = .; + _fbss = .; + *(.sbss) *(.scommon) + _small_end = .; + . = ALIGN(32); + } + + .bss . : { + *(.bss) + *(COMMON) + . = ALIGN(32); + _end = .; + end = .; + } + +} Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1 ============================================================================== --- user/jmallett/octeon/sys/mips/conf/OCTEON1 Tue Mar 9 22:10:11 2010 (r204931) +++ user/jmallett/octeon/sys/mips/conf/OCTEON1 Tue Mar 9 22:34:26 2010 (r204932) @@ -29,7 +29,7 @@ cpu CPU_MIPS4KC ident OCTEON1 makeoptions ARCH_FLAGS="-march=mips64" -makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.64 +makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1-32 ============================================================================== --- user/jmallett/octeon/sys/mips/conf/OCTEON1-32 Tue Mar 9 22:10:11 2010 (r204931) +++ user/jmallett/octeon/sys/mips/conf/OCTEON1-32 Tue Mar 9 22:34:26 2010 (r204932) @@ -24,7 +24,7 @@ ident OCTEON1 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" makeoptions ARCH_FLAGS="-march=mips64" -makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.n32 +makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1 makeoptions KERNLOADADDR=0xffffffff81000000 Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 ============================================================================== --- user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 Tue Mar 9 22:10:11 2010 (r204931) +++ user/jmallett/octeon/sys/mips/conf/OCTEON1-o32 Tue Mar 9 22:34:26 2010 (r204932) @@ -24,7 +24,7 @@ ident OCTEON1 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" makeoptions ARCH_FLAGS="-march=mips64" -makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.32 +makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1 makeoptions KERNLOADADDR=0xffffffff81000000 From owner-svn-src-user@FreeBSD.ORG Tue Mar 9 23:12:19 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 590901065673; Tue, 9 Mar 2010 23:12:19 +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 43D288FC18; Tue, 9 Mar 2010 23:12: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 o29NCJwY058217; Tue, 9 Mar 2010 23:12:19 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o29NCJOo058197; Tue, 9 Mar 2010 23:12:19 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201003092312.o29NCJOo058197@svn.freebsd.org> From: Juli Mallett Date: Tue, 9 Mar 2010 23:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204935 - in user/jmallett/octeon: . bin/setfacl bin/sh contrib/ipfilter/ipsend contrib/tzdata crypto/openssh crypto/openssh/openbsd-compat etc etc/rc.d include lib/libc/posix1e lib/lib... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2010 23:12:19 -0000 Author: jmallett Date: Tue Mar 9 23:12:18 2010 New Revision: 204935 URL: http://svn.freebsd.org/changeset/base/204935 Log: Merge from head. Added: user/jmallett/octeon/crypto/openssh/PROTOCOL.certkeys - copied unchanged from r204934, head/crypto/openssh/PROTOCOL.certkeys user/jmallett/octeon/crypto/openssh/PROTOCOL.mux - copied unchanged from r204934, head/crypto/openssh/PROTOCOL.mux user/jmallett/octeon/crypto/openssh/openbsd-compat/pwcache.c - copied unchanged from r204934, head/crypto/openssh/openbsd-compat/pwcache.c user/jmallett/octeon/crypto/openssh/pkcs11.h - copied unchanged from r204934, head/crypto/openssh/pkcs11.h user/jmallett/octeon/crypto/openssh/roaming_client.c - copied unchanged from r204934, head/crypto/openssh/roaming_client.c user/jmallett/octeon/crypto/openssh/roaming_serv.c - copied unchanged from r204934, head/crypto/openssh/roaming_serv.c user/jmallett/octeon/crypto/openssh/ssh-pkcs11-client.c - copied unchanged from r204934, head/crypto/openssh/ssh-pkcs11-client.c user/jmallett/octeon/crypto/openssh/ssh-pkcs11-helper.0 - copied unchanged from r204934, head/crypto/openssh/ssh-pkcs11-helper.0 user/jmallett/octeon/crypto/openssh/ssh-pkcs11-helper.8 - copied unchanged from r204934, head/crypto/openssh/ssh-pkcs11-helper.8 user/jmallett/octeon/crypto/openssh/ssh-pkcs11-helper.c - copied unchanged from r204934, head/crypto/openssh/ssh-pkcs11-helper.c user/jmallett/octeon/crypto/openssh/ssh-pkcs11.c - copied unchanged from r204934, head/crypto/openssh/ssh-pkcs11.c user/jmallett/octeon/crypto/openssh/ssh-pkcs11.h - copied unchanged from r204934, head/crypto/openssh/ssh-pkcs11.h user/jmallett/octeon/secure/libexec/ssh-pkcs11-helper/ - copied from r204934, head/secure/libexec/ssh-pkcs11-helper/ user/jmallett/octeon/tools/regression/bin/sh/builtins/command10.0 - copied unchanged from r204934, head/tools/regression/bin/sh/builtins/command10.0 user/jmallett/octeon/tools/regression/bin/sh/builtins/command8.0 - copied unchanged from r204934, head/tools/regression/bin/sh/builtins/command8.0 user/jmallett/octeon/tools/regression/bin/sh/builtins/command9.0 - copied unchanged from r204934, head/tools/regression/bin/sh/builtins/command9.0 user/jmallett/octeon/tools/regression/bin/sh/builtins/var-assign2.0 - copied unchanged from r204934, head/tools/regression/bin/sh/builtins/var-assign2.0 user/jmallett/octeon/tools/regression/bin/sh/errors/redirection-error3.0 - copied unchanged from r204934, head/tools/regression/bin/sh/errors/redirection-error3.0 user/jmallett/octeon/tools/regression/bin/sh/expansion/assign1.0 - copied unchanged from r204934, head/tools/regression/bin/sh/expansion/assign1.0 user/jmallett/octeon/tools/regression/bin/sh/expansion/plus-minus1.0 - copied unchanged from r204934, head/tools/regression/bin/sh/expansion/plus-minus1.0 user/jmallett/octeon/tools/regression/bin/sh/parser/heredoc1.0 - copied unchanged from r204934, head/tools/regression/bin/sh/parser/heredoc1.0 user/jmallett/octeon/usr.bin/procstat/procstat_sigs.c - copied unchanged from r204934, head/usr.bin/procstat/procstat_sigs.c Deleted: user/jmallett/octeon/crypto/openssh/README.smartcard user/jmallett/octeon/crypto/openssh/scard-opensc.c user/jmallett/octeon/crypto/openssh/scard.c user/jmallett/octeon/crypto/openssh/scard.h Modified: user/jmallett/octeon/Makefile.inc1 user/jmallett/octeon/bin/setfacl/file.c user/jmallett/octeon/bin/setfacl/mask.c user/jmallett/octeon/bin/setfacl/merge.c user/jmallett/octeon/bin/setfacl/remove.c user/jmallett/octeon/bin/setfacl/setfacl.1 user/jmallett/octeon/bin/setfacl/setfacl.c user/jmallett/octeon/bin/setfacl/setfacl.h user/jmallett/octeon/bin/setfacl/util.c user/jmallett/octeon/bin/sh/eval.c user/jmallett/octeon/bin/sh/exec.c user/jmallett/octeon/bin/sh/exec.h user/jmallett/octeon/bin/sh/sh.1 user/jmallett/octeon/contrib/ipfilter/ipsend/sbpf.c user/jmallett/octeon/contrib/tzdata/asia user/jmallett/octeon/contrib/tzdata/australasia user/jmallett/octeon/contrib/tzdata/southamerica user/jmallett/octeon/crypto/openssh/ChangeLog user/jmallett/octeon/crypto/openssh/INSTALL user/jmallett/octeon/crypto/openssh/PROTOCOL user/jmallett/octeon/crypto/openssh/PROTOCOL.agent user/jmallett/octeon/crypto/openssh/README user/jmallett/octeon/crypto/openssh/addrmatch.c user/jmallett/octeon/crypto/openssh/auth-krb5.c user/jmallett/octeon/crypto/openssh/auth-options.c user/jmallett/octeon/crypto/openssh/auth-options.h user/jmallett/octeon/crypto/openssh/auth-rh-rsa.c user/jmallett/octeon/crypto/openssh/auth-rhosts.c user/jmallett/octeon/crypto/openssh/auth-rsa.c user/jmallett/octeon/crypto/openssh/auth.c user/jmallett/octeon/crypto/openssh/auth.h user/jmallett/octeon/crypto/openssh/auth2-hostbased.c user/jmallett/octeon/crypto/openssh/auth2-pubkey.c user/jmallett/octeon/crypto/openssh/authfd.c user/jmallett/octeon/crypto/openssh/authfd.h user/jmallett/octeon/crypto/openssh/authfile.c user/jmallett/octeon/crypto/openssh/authfile.h user/jmallett/octeon/crypto/openssh/bufaux.c user/jmallett/octeon/crypto/openssh/buffer.c user/jmallett/octeon/crypto/openssh/buffer.h user/jmallett/octeon/crypto/openssh/canohost.c user/jmallett/octeon/crypto/openssh/channels.c user/jmallett/octeon/crypto/openssh/channels.h user/jmallett/octeon/crypto/openssh/clientloop.c user/jmallett/octeon/crypto/openssh/clientloop.h user/jmallett/octeon/crypto/openssh/config.guess user/jmallett/octeon/crypto/openssh/config.h user/jmallett/octeon/crypto/openssh/config.h.in user/jmallett/octeon/crypto/openssh/defines.h user/jmallett/octeon/crypto/openssh/dh.c user/jmallett/octeon/crypto/openssh/dns.c user/jmallett/octeon/crypto/openssh/dns.h user/jmallett/octeon/crypto/openssh/hostfile.c user/jmallett/octeon/crypto/openssh/hostfile.h user/jmallett/octeon/crypto/openssh/kex.c user/jmallett/octeon/crypto/openssh/kex.h user/jmallett/octeon/crypto/openssh/kexdhs.c user/jmallett/octeon/crypto/openssh/kexgexs.c user/jmallett/octeon/crypto/openssh/key.c user/jmallett/octeon/crypto/openssh/key.h user/jmallett/octeon/crypto/openssh/loginrec.c user/jmallett/octeon/crypto/openssh/match.h user/jmallett/octeon/crypto/openssh/misc.c user/jmallett/octeon/crypto/openssh/misc.h user/jmallett/octeon/crypto/openssh/monitor.c user/jmallett/octeon/crypto/openssh/monitor_fdpass.c user/jmallett/octeon/crypto/openssh/monitor_wrap.c user/jmallett/octeon/crypto/openssh/mux.c user/jmallett/octeon/crypto/openssh/myproposal.h user/jmallett/octeon/crypto/openssh/nchan.c user/jmallett/octeon/crypto/openssh/openbsd-compat/bsd-cygwin_util.c user/jmallett/octeon/crypto/openssh/openbsd-compat/openbsd-compat.h user/jmallett/octeon/crypto/openssh/openbsd-compat/openssl-compat.c user/jmallett/octeon/crypto/openssh/openbsd-compat/port-aix.c user/jmallett/octeon/crypto/openssh/openbsd-compat/port-aix.h user/jmallett/octeon/crypto/openssh/openbsd-compat/port-linux.c user/jmallett/octeon/crypto/openssh/openbsd-compat/port-linux.h user/jmallett/octeon/crypto/openssh/openbsd-compat/readpassphrase.c user/jmallett/octeon/crypto/openssh/pathnames.h user/jmallett/octeon/crypto/openssh/platform.c user/jmallett/octeon/crypto/openssh/platform.h user/jmallett/octeon/crypto/openssh/readconf.c user/jmallett/octeon/crypto/openssh/readconf.h user/jmallett/octeon/crypto/openssh/roaming.h user/jmallett/octeon/crypto/openssh/roaming_common.c user/jmallett/octeon/crypto/openssh/scp.1 user/jmallett/octeon/crypto/openssh/scp.c user/jmallett/octeon/crypto/openssh/servconf.c user/jmallett/octeon/crypto/openssh/servconf.h user/jmallett/octeon/crypto/openssh/session.c user/jmallett/octeon/crypto/openssh/sftp-client.c user/jmallett/octeon/crypto/openssh/sftp-client.h user/jmallett/octeon/crypto/openssh/sftp-common.c user/jmallett/octeon/crypto/openssh/sftp-common.h user/jmallett/octeon/crypto/openssh/sftp-server.8 user/jmallett/octeon/crypto/openssh/sftp-server.c user/jmallett/octeon/crypto/openssh/sftp.1 user/jmallett/octeon/crypto/openssh/sftp.c user/jmallett/octeon/crypto/openssh/ssh-add.1 user/jmallett/octeon/crypto/openssh/ssh-add.c user/jmallett/octeon/crypto/openssh/ssh-agent.1 user/jmallett/octeon/crypto/openssh/ssh-agent.c user/jmallett/octeon/crypto/openssh/ssh-dss.c user/jmallett/octeon/crypto/openssh/ssh-keygen.1 user/jmallett/octeon/crypto/openssh/ssh-keygen.c user/jmallett/octeon/crypto/openssh/ssh-keyscan.1 user/jmallett/octeon/crypto/openssh/ssh-keyscan.c user/jmallett/octeon/crypto/openssh/ssh-keysign.c user/jmallett/octeon/crypto/openssh/ssh-rand-helper.c user/jmallett/octeon/crypto/openssh/ssh-rsa.c user/jmallett/octeon/crypto/openssh/ssh.1 user/jmallett/octeon/crypto/openssh/ssh.c user/jmallett/octeon/crypto/openssh/ssh2.h user/jmallett/octeon/crypto/openssh/ssh_config user/jmallett/octeon/crypto/openssh/ssh_config.5 user/jmallett/octeon/crypto/openssh/ssh_namespace.h user/jmallett/octeon/crypto/openssh/sshconnect.c user/jmallett/octeon/crypto/openssh/sshconnect2.c user/jmallett/octeon/crypto/openssh/sshd.8 user/jmallett/octeon/crypto/openssh/sshd.c user/jmallett/octeon/crypto/openssh/sshd_config user/jmallett/octeon/crypto/openssh/sshd_config.5 user/jmallett/octeon/crypto/openssh/sshpty.h user/jmallett/octeon/crypto/openssh/sshtty.c user/jmallett/octeon/crypto/openssh/version.h user/jmallett/octeon/etc/Makefile user/jmallett/octeon/etc/rc.d/jail user/jmallett/octeon/etc/termcap.small user/jmallett/octeon/include/regexp.h user/jmallett/octeon/lib/libc/posix1e/acl_strip.c user/jmallett/octeon/lib/libcompat/Makefile user/jmallett/octeon/lib/libpam/modules/pam_ssh/pam_ssh.c user/jmallett/octeon/sbin/ipfw/Makefile user/jmallett/octeon/sbin/mount/mount.c user/jmallett/octeon/sbin/newfs/mkfs.c user/jmallett/octeon/sbin/newfs/newfs.c user/jmallett/octeon/sbin/newfs/newfs.h user/jmallett/octeon/secure/lib/libssh/Makefile user/jmallett/octeon/secure/libexec/Makefile user/jmallett/octeon/secure/usr.bin/ssh/Makefile user/jmallett/octeon/secure/usr.sbin/sshd/Makefile user/jmallett/octeon/share/man/man4/acpi.4 user/jmallett/octeon/share/man/man4/ufm.4 user/jmallett/octeon/sys/amd64/amd64/mca.c user/jmallett/octeon/sys/amd64/amd64/pmap.c user/jmallett/octeon/sys/amd64/include/md_var.h user/jmallett/octeon/sys/amd64/include/specialreg.h user/jmallett/octeon/sys/boot/arm/at91/boot2/bwct_board.c user/jmallett/octeon/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c user/jmallett/octeon/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c user/jmallett/octeon/sys/compat/linprocfs/linprocfs.c user/jmallett/octeon/sys/conf/newvers.sh user/jmallett/octeon/sys/contrib/dev/acpica/hardware/hwsleep.c user/jmallett/octeon/sys/contrib/x86emu/x86emu.c user/jmallett/octeon/sys/dev/acpica/acpi.c user/jmallett/octeon/sys/dev/bwn/if_bwn.c user/jmallett/octeon/sys/dev/bwn/if_bwnvar.h user/jmallett/octeon/sys/dev/cxgb/common/cxgb_ael1002.c user/jmallett/octeon/sys/dev/cxgb/cxgb_main.c user/jmallett/octeon/sys/dev/hwpmc/hwpmc_logging.c user/jmallett/octeon/sys/dev/siba/siba.c user/jmallett/octeon/sys/dev/siba/siba_bwn.c user/jmallett/octeon/sys/dev/siba/siba_cc.c user/jmallett/octeon/sys/dev/siba/siba_core.c user/jmallett/octeon/sys/dev/siba/siba_pcib.c user/jmallett/octeon/sys/dev/siba/sibavar.h user/jmallett/octeon/sys/dev/sound/pci/es137x.h user/jmallett/octeon/sys/geom/vinum/geom_vinum.c user/jmallett/octeon/sys/ia64/ia64/nexus.c user/jmallett/octeon/sys/ia64/ia64/vm_machdep.c user/jmallett/octeon/sys/kern/subr_firmware.c user/jmallett/octeon/sys/mips/include/cpu.h user/jmallett/octeon/sys/mips/include/cpuregs.h user/jmallett/octeon/sys/modules/Makefile user/jmallett/octeon/sys/modules/acpi/acpi/Makefile user/jmallett/octeon/sys/net/flowtable.c user/jmallett/octeon/sys/net/if_epair.c user/jmallett/octeon/sys/net/if_lagg.c user/jmallett/octeon/sys/net/radix.c user/jmallett/octeon/sys/net/radix.h user/jmallett/octeon/sys/net/radix_mpath.c user/jmallett/octeon/sys/net/route.c user/jmallett/octeon/sys/net/route.h user/jmallett/octeon/sys/netinet/in.c user/jmallett/octeon/sys/netinet/in_pcb.h user/jmallett/octeon/sys/netinet/ip_divert.c user/jmallett/octeon/sys/netinet/ip_output.c user/jmallett/octeon/sys/netinet/ipfw/dn_heap.c user/jmallett/octeon/sys/netinet/ipfw/dn_heap.h user/jmallett/octeon/sys/netinet/ipfw/ip_dummynet.c user/jmallett/octeon/sys/netinet/ipfw/ip_fw2.c user/jmallett/octeon/sys/netinet/ipfw/ip_fw_private.h user/jmallett/octeon/sys/netinet/ipfw/ip_fw_table.c user/jmallett/octeon/sys/netinet/ipfw/test/dn_test.h user/jmallett/octeon/sys/netinet/tcp_input.c user/jmallett/octeon/sys/netinet/tcp_reass.c user/jmallett/octeon/sys/netinet/tcp_subr.c user/jmallett/octeon/sys/netinet/tcp_timer.c user/jmallett/octeon/sys/netinet/tcp_timewait.c user/jmallett/octeon/sys/netinet/tcp_usrreq.c user/jmallett/octeon/sys/netinet/tcp_var.h user/jmallett/octeon/sys/netinet/udp_usrreq.c user/jmallett/octeon/sys/powerpc/aim/interrupt.c user/jmallett/octeon/sys/powerpc/booke/interrupt.c user/jmallett/octeon/sys/sys/pmc.h user/jmallett/octeon/sys/sys/timeb.h user/jmallett/octeon/usr.bin/comm/comm.c user/jmallett/octeon/usr.bin/ncal/ncal.1 user/jmallett/octeon/usr.bin/ncal/ncal.c user/jmallett/octeon/usr.bin/procstat/Makefile user/jmallett/octeon/usr.bin/procstat/procstat.1 user/jmallett/octeon/usr.bin/procstat/procstat.c user/jmallett/octeon/usr.bin/procstat/procstat.h user/jmallett/octeon/usr.bin/uniq/uniq.c user/jmallett/octeon/usr.bin/xlint/lint1/scan.l user/jmallett/octeon/usr.sbin/pmcstat/pmcpl_callgraph.c user/jmallett/octeon/usr.sbin/pmcstat/pmcpl_calltree.c user/jmallett/octeon/usr.sbin/pmcstat/pmcstat.c user/jmallett/octeon/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: user/jmallett/octeon/ (props changed) user/jmallett/octeon/contrib/tzdata/ (props changed) user/jmallett/octeon/crypto/openssh/ (props changed) user/jmallett/octeon/sys/contrib/x86emu/ (props changed) Modified: user/jmallett/octeon/Makefile.inc1 ============================================================================== --- user/jmallett/octeon/Makefile.inc1 Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/Makefile.inc1 Tue Mar 9 23:12:18 2010 (r204935) @@ -1259,7 +1259,7 @@ delete-old-files: @echo ">>> Removing old files (only deletes safe to delete libs)" # Ask for every old file if the user really wants to remove it. # It's annoying, but better safe than sorry. - @for file in ${OLD_FILES}; do \ + @for file in ${OLD_FILES} ${OLD_FILES:Musr/share/*.gz:R}; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ rm ${RM_I} "${DESTDIR}/$${file}"; \ @@ -1279,7 +1279,7 @@ delete-old-files: check-old-files: @echo ">>> Checking for old files" - @for file in ${OLD_FILES}; do \ + @for file in ${OLD_FILES} ${OLD_FILES:Musr/share/*.gz:R}; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ echo "${DESTDIR}/$${file}"; \ fi; \ Modified: user/jmallett/octeon/bin/setfacl/file.c ============================================================================== --- user/jmallett/octeon/bin/setfacl/file.c Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/setfacl/file.c Tue Mar 9 23:12:18 2010 (r204935) @@ -14,14 +14,14 @@ * 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 THE VOICES IN HIS HEAD 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. + * 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 Modified: user/jmallett/octeon/bin/setfacl/mask.c ============================================================================== --- user/jmallett/octeon/bin/setfacl/mask.c Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/setfacl/mask.c Tue Mar 9 23:12:18 2010 (r204935) @@ -14,14 +14,14 @@ * 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 THE VOICES IN HIS HEAD 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. + * 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 Modified: user/jmallett/octeon/bin/setfacl/merge.c ============================================================================== --- user/jmallett/octeon/bin/setfacl/merge.c Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/setfacl/merge.c Tue Mar 9 23:12:18 2010 (r204935) @@ -14,14 +14,14 @@ * 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 THE VOICES IN HIS HEAD 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. + * 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 Modified: user/jmallett/octeon/bin/setfacl/remove.c ============================================================================== --- user/jmallett/octeon/bin/setfacl/remove.c Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/setfacl/remove.c Tue Mar 9 23:12:18 2010 (r204935) @@ -14,14 +14,14 @@ * 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 THE VOICES IN HIS HEAD 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. + * 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 Modified: user/jmallett/octeon/bin/setfacl/setfacl.1 ============================================================================== --- user/jmallett/octeon/bin/setfacl/setfacl.1 Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/setfacl/setfacl.1 Tue Mar 9 23:12:18 2010 (r204935) @@ -14,14 +14,14 @@ .\" 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 THE VOICES IN HIS HEAD 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. +.\" 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$ .\" Modified: user/jmallett/octeon/bin/setfacl/setfacl.c ============================================================================== --- user/jmallett/octeon/bin/setfacl/setfacl.c Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/setfacl/setfacl.c Tue Mar 9 23:12:18 2010 (r204935) @@ -14,14 +14,14 @@ * 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 THE VOICES IN HIS HEAD 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. + * 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 Modified: user/jmallett/octeon/bin/setfacl/setfacl.h ============================================================================== --- user/jmallett/octeon/bin/setfacl/setfacl.h Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/setfacl/setfacl.h Tue Mar 9 23:12:18 2010 (r204935) @@ -14,14 +14,14 @@ * 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 THE VOICES IN HIS HEAD 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. + * 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$ */ Modified: user/jmallett/octeon/bin/setfacl/util.c ============================================================================== --- user/jmallett/octeon/bin/setfacl/util.c Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/setfacl/util.c Tue Mar 9 23:12:18 2010 (r204935) @@ -14,14 +14,14 @@ * 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 THE VOICES IN HIS HEAD 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. + * 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 Modified: user/jmallett/octeon/bin/sh/eval.c ============================================================================== --- user/jmallett/octeon/bin/sh/eval.c Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/sh/eval.c Tue Mar 9 23:12:18 2010 (r204935) @@ -597,6 +597,7 @@ evalcommand(union node *cmd, int flags, char *lastarg; int realstatus; int do_clearcmdentry; + char *path = pathval(); /* First expand the arguments. */ TRACE(("evalcommand(%p, %d) called\n", (void *)cmd, flags)); @@ -682,7 +683,7 @@ evalcommand(union node *cmd, int flags, cmdentry.special = 1; } else { static const char PATH[] = "PATH="; - char *path = pathval(); + int cmd_flags = 0, bltinonly = 0; /* * Modify the command lookup path, if a PATH= assignment @@ -713,24 +714,68 @@ evalcommand(union node *cmd, int flags, do_clearcmdentry = 1; } - find_command(argv[0], &cmdentry, 0, path); - /* implement the bltin builtin here */ - if (cmdentry.cmdtype == CMDBUILTIN && cmdentry.u.index == BLTINCMD) { - for (;;) { - argv++; - if (--argc == 0) - break; - if ((cmdentry.u.index = find_builtin(*argv, - &cmdentry.special)) < 0) { + for (;;) { + if (bltinonly) { + cmdentry.u.index = find_builtin(*argv, &cmdentry.special); + if (cmdentry.u.index < 0) { cmdentry.u.index = BLTINCMD; argv--; argc++; break; } - if (cmdentry.u.index != BLTINCMD) + } else + find_command(argv[0], &cmdentry, cmd_flags, path); + /* implement the bltin and command builtins here */ + if (cmdentry.cmdtype != CMDBUILTIN) + break; + if (cmdentry.u.index == BLTINCMD) { + if (argc == 1) break; - } + argv++; + argc--; + bltinonly = 1; + } else if (cmdentry.u.index == COMMANDCMD) { + if (argc == 1) + break; + if (!strcmp(argv[1], "-p")) { + if (argc == 2) + break; + if (argv[2][0] == '-') { + if (strcmp(argv[2], "--")) + break; + if (argc == 3) + break; + argv += 3; + argc -= 3; + } else { + argv += 2; + argc -= 2; + } + path = _PATH_STDPATH; + clearcmdentry(0); + do_clearcmdentry = 1; + } else if (!strcmp(argv[1], "--")) { + if (argc == 2) + break; + argv += 2; + argc -= 2; + } else if (argv[1][0] == '-') + break; + else { + argv++; + argc--; + } + cmd_flags |= DO_NOFUNC; + bltinonly = 0; + } else + break; } + /* + * Special builtins lose their special properties when + * called via 'command'. + */ + if (cmd_flags & DO_NOFUNC) + cmdentry.special = 0; } /* Fork off a child process if necessary. */ @@ -741,9 +786,7 @@ evalcommand(union node *cmd, int flags, && (cmdentry.cmdtype != CMDBUILTIN || cmdentry.u.index == CDCMD || cmdentry.u.index == DOTCMD - || cmdentry.u.index == EVALCMD)) - || (cmdentry.cmdtype == CMDBUILTIN && - cmdentry.u.index == COMMANDCMD)) { + || cmdentry.u.index == EVALCMD))) { jp = makejob(cmd, 1); mode = cmd->ncmd.backgnd; if (flags & EV_BACKCMD) { @@ -770,7 +813,6 @@ evalcommand(union node *cmd, int flags, #ifdef DEBUG trputs("Shell function: "); trargs(argv); #endif - redirect(cmd->ncmd.redirect, REDIR_PUSH); saveparam = shellparam; shellparam.malloc = 0; shellparam.reset = 1; @@ -788,6 +830,8 @@ evalcommand(union node *cmd, int flags, else { freeparam(&shellparam); shellparam = saveparam; + if (exception == EXERROR || exception == EXEXEC) + popredir(); } unreffunc(cmdentry.u.func); poplocalvars(); @@ -798,6 +842,7 @@ evalcommand(union node *cmd, int flags, } handler = &jmploc; funcnest++; + redirect(cmd->ncmd.redirect, REDIR_PUSH); INTON; for (sp = varlist.list ; sp ; sp = sp->next) mklocal(sp->text); @@ -871,6 +916,9 @@ cmddone: backcmd->nleft = memout.nextc - memout.buf; memout.buf = NULL; } + if (cmdentry.u.index != EXECCMD && + (e == -1 || e == EXERROR || e == EXEXEC)) + popredir(); if (e != -1) { if ((e != EXERROR && e != EXEXEC) || cmdentry.special) @@ -879,8 +927,6 @@ cmddone: if (flags != EV_BACKCMD) FORCEINTON; } - if (cmdentry.u.index != EXECCMD) - popredir(); } else { #ifdef DEBUG trputs("normal command: "); trargs(argv); @@ -889,7 +935,7 @@ cmddone: for (sp = varlist.list ; sp ; sp = sp->next) setvareq(sp->text, VEXPORT|VSTACK); envp = environment(); - shellexec(argv, envp, pathval(), cmdentry.u.index); + shellexec(argv, envp, path, cmdentry.u.index); /*NOTREACHED*/ } goto out; @@ -996,15 +1042,11 @@ int commandcmd(int argc, char **argv) { static char stdpath[] = _PATH_STDPATH; - struct jmploc loc, *old; - struct strlist *sp; char *path; int ch; int cmd = -1; - for (sp = cmdenviron; sp ; sp = sp->next) - setvareq(sp->text, VEXPORT|VSTACK); - path = pathval(); + path = bltinlookup("PATH", 1); optind = optreset = 1; opterr = 0; @@ -1032,22 +1074,14 @@ commandcmd(int argc, char **argv) error("wrong number of arguments"); return typecmd_impl(2, argv - 1, cmd, path); } - if (argc != 0) { - old = handler; - handler = &loc; - if (setjmp(handler->loc) == 0) - shellexec(argv, environment(), path, 0); - handler = old; - if (exception == EXEXEC) - exit(exerrno); - exraise(exception); - } + if (argc != 0) + error("commandcmd() called while it should not be"); /* * Do nothing successfully if no command was specified; * ksh also does this. */ - exit(0); + return 0; } Modified: user/jmallett/octeon/bin/sh/exec.c ============================================================================== --- user/jmallett/octeon/bin/sh/exec.c Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/sh/exec.c Tue Mar 9 23:12:18 2010 (r204935) @@ -248,7 +248,7 @@ hashcmd(int argc __unused, char **argv _ && (cmdp->cmdtype == CMDNORMAL || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0))) delete_cmd_entry(); - find_command(name, &entry, 1, pathval()); + find_command(name, &entry, DO_ERR, pathval()); if (verbose) { if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */ cmdp = cmdlookup(name, 0); @@ -310,10 +310,10 @@ printentry(struct tblentry *cmdp, int ve */ void -find_command(const char *name, struct cmdentry *entry, int printerr, +find_command(const char *name, struct cmdentry *entry, int act, const char *path) { - struct tblentry *cmdp; + struct tblentry *cmdp, loc_cmd; int idx; int prev; char *fullname; @@ -330,13 +330,19 @@ find_command(const char *name, struct cm } /* If name is in the table, and not invalidated by cd, we're done */ - if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0) - goto success; + if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0) { + if (cmdp->cmdtype == CMDFUNCTION && act & DO_NOFUNC) + cmdp = NULL; + else + goto success; + } /* If %builtin not in path, check for builtin next */ if (builtinloc < 0 && (i = find_builtin(name, &spec)) >= 0) { INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDBUILTIN; cmdp->param.index = i; cmdp->special = spec; @@ -365,6 +371,8 @@ loop: goto loop; INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDBUILTIN; cmdp->param.index = i; cmdp->special = spec; @@ -414,6 +422,8 @@ loop: TRACE(("searchexec \"%s\" returns \"%s\"\n", name, fullname)); INTOFF; cmdp = cmdlookup(name, 1); + if (cmdp->cmdtype == CMDFUNCTION) + cmdp = &loc_cmd; cmdp->cmdtype = CMDNORMAL; cmdp->param.index = idx; INTON; @@ -421,9 +431,9 @@ loop: } /* We failed. If there was an entry for this command, delete it */ - if (cmdp) + if (cmdp && cmdp->cmdtype != CMDFUNCTION) delete_cmd_entry(); - if (printerr) { + if (act & DO_ERR) { if (e == ENOENT || e == ENOTDIR) outfmt(out2, "%s: not found\n", name); else Modified: user/jmallett/octeon/bin/sh/exec.h ============================================================================== --- user/jmallett/octeon/bin/sh/exec.h Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/sh/exec.h Tue Mar 9 23:12:18 2010 (r204935) @@ -57,6 +57,10 @@ struct cmdentry { }; +/* action to find_command() */ +#define DO_ERR 0x01 /* prints errors */ +#define DO_NOFUNC 0x02 /* don't return shell functions, for command */ + extern const char *pathopt; /* set by padvance */ extern int exerrno; /* last exec error */ Modified: user/jmallett/octeon/bin/sh/sh.1 ============================================================================== --- user/jmallett/octeon/bin/sh/sh.1 Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/bin/sh/sh.1 Tue Mar 9 23:12:18 2010 (r204935) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd December 31, 2009 +.Dd March 6, 2010 .Dt SH 1 .Os .Sh NAME @@ -1571,10 +1571,12 @@ built-in command. .It Ic command Oo Fl p Oc Op Ar utility Op Ar argument ... .It Ic command Oo Fl v | V Oc Op Ar utility The first form of invocation executes the specified +.Ar utility , +ignoring shell functions in the search. +If .Ar utility -as a simple command (see the -.Sx Simple Commands -section). +is a special builtin, +it is executed as if it were a regular builtin. .Pp If the .Fl p Modified: user/jmallett/octeon/contrib/ipfilter/ipsend/sbpf.c ============================================================================== --- user/jmallett/octeon/contrib/ipfilter/ipsend/sbpf.c Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/contrib/ipfilter/ipsend/sbpf.c Tue Mar 9 23:12:18 2010 (r204935) @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include Modified: user/jmallett/octeon/contrib/tzdata/asia ============================================================================== --- user/jmallett/octeon/contrib/tzdata/asia Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/contrib/tzdata/asia Tue Mar 9 23:12:18 2010 (r204935) @@ -1,4 +1,4 @@ -# @(#)asia 8.51 +# @(#)asia 8.55 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -225,11 +225,31 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # # until further notice." I take that last sentence as the # establishment of a rule. +# From Nobutomo Nakano (2010-02-19): +# We received a report from Bangladesh saying that the start/end of +# Bangladesh DST is incorrect. Currently we have only the Bengali version +# of the official mail from BTRC which describes the following: +# +# "From 2010 each year when local standard time is about to reach +# March 31 at 10:59:00 PM clocks are turned forward 1 hour (11:59:00 PM) +# and when local daylight time is about to October 31 at 11:59:00 PM +# clocks are turned backward 1 hour (10:59:00 PM)." +# +# So, DST will start/end 1 minute earlier. + +# From Arthur David Olson (2010-03-03): +# The file +# +# http://www.cabinet.gov/bd/file_upload/news_events/en_169.pdf +# +# is in Bengali; it does contain two "31"s as well as two "11.59"s and a "10.59" +# which is consistent with the information provided by Nobutomo Nakano. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Dhaka 2009 only - Jun 19 23:00 1:00 S -Rule Dhaka 2010 only - Jan 1 0:00 0 - -Rule Dhaka 2010 max - Mar 31 23:00 1:00 S -Rule Dhaka 2010 max - Nov 1 0:00 0 - +Rule Dhaka 2009 only - Dec 31 23:59 0 - +Rule Dhaka 2010 max - Mar 31 22:59 1:00 S +Rule Dhaka 2010 max - Oct 31 23:59 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 Modified: user/jmallett/octeon/contrib/tzdata/australasia ============================================================================== --- user/jmallett/octeon/contrib/tzdata/australasia Tue Mar 9 22:42:24 2010 (r204934) +++ user/jmallett/octeon/contrib/tzdata/australasia Tue Mar 9 23:12:18 2010 (r204935) @@ -1,5 +1,5 @@ #
-# @(#)australasia	8.15
+# @(#)australasia	8.16
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -267,11 +267,30 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
 # 
 # http://www.fiji.gov.fj/publish/page_16198.shtml
 # 
+
+# From Steffen Thorsen (2010-03-03):
+# The Cabinet in Fiji has decided to end DST about a month early, on
+# 2010-03-28 at 03:00.
+# The plan is to observe DST again, from 2010-10-24 to sometime in March
+# 2011 (last Sunday a good guess?).
+#
+# Official source:
+# 
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=1096:3310-cabinet-approves-change-in-daylight-savings-dates&catid=49:cabinet-releases&Itemid=166
+# 
+#
+# A bit more background info here:
+# 
+# http://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
 Rule	Fiji	2009	only	-	Nov	29	2:00	1:00	S
-Rule	Fiji	2010	only	-	Apr	25	3:00	0	-
+Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0	-
+Rule	Fiji	2010	only	-	Oct	24	2:00	1:00	S
+Rule	Fiji	2011	only	-	Mar	lastSun 3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
 			12:00	Fiji	FJ%sT	# Fiji Time
@@ -449,70 +468,30 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 
 # Samoa
 
-# From Alexander Krivenyshev (2008-12-06):
-# The Samoa government (Western Samoa) may implement DST on the first Sunday of 
-# October 2009 (October 4, 2009) until the last Sunday of March 2010 (March 28, 
-# 2010). 
-# 
-# "Selected Committee reports to Cabinet on Daylight Saving Time",
-# Government of Samoa:
-# 
-# http://www.govt.ws/pr_article.cfm?pr_id=560
-# 
-# or
-# 
-# http://www.worldtimezone.com/dst_news/dst_news_samoa01.html
-# 
-
-# From Steffen Thorsen (2009-08-27):
-# Samoa's parliament passed the Daylight Saving Bill 2009, and will start 
-# daylight saving time on the first Sunday of October 2009 and end on the 
-# last Sunday of March 2010. We hope that the full text will be published 
-# soon, but we believe that the bill is only valid for 2009-2010. Samoa's 
-# Daylight Saving Act 2009 will be enforced as soon as the Head of State 
-# executes a proclamation publicizing this Act.
+# From Steffen Thorsen (2009-10-16):
+# We have been in contact with the government of Samoa again, and received
+# the following info:
+#
+# "Cabinet has now approved Daylight Saving to be effected next year
+# commencing from the last Sunday of September 2010 and conclude first
+# Sunday of April 2011."
 #
-# Some background information here, which will be updated once we have 
-# more details:
+# Background info:
 # 
 # http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
 # 
-
-# From Alexander Krivenyshev (2009-10-03):
-# First, my deepest condolences to people of Samoa islands and all families and
-# loved ones around the world who lost their lives in the earthquake and tsunami.
-#
-# Considering the recent devastation on Samoa by earthquake and tsunami and that
-# many government offices/ ministers are closed- not sure if "Daylight Saving
-# Bill 2009" will be implemented in next few days- on October 4, 2009.
-#
-# Here is reply from Consulate-General of Samoa in New Zealand
-# ---------------------------
-# Consul General
-# consulgeneral@samoaconsulate.org.nz
-#
-# Talofa Alexander,
-#
-# Thank you for your sympathy for our country but at this time we have not
-# been informed about the Daylight Savings Time Change.  Most Ministries in
-# Apia are closed or relocating due to weather concerns.
-#
-# When we do find out if they are still proceeding with the time change we
-# will advise you soonest.
-#
-# Kind Regards,
-# Lana
-# for: Consul General
-
-# From Steffen Thorsen (2009-10-05):
-# We have called a hotel in Samoa and asked about local time there - they 
-# are still on standard time.
+#
+# Samoa's Daylight Saving Time Act 2009 is available here, but does not
+# contain any dates:
+# 
+# http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf
+# 
 
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
-			-11:00	-	WST	2009 Oct 4
-			-11:00	1:00	WSDT	2010 Mar 28
+			-11:00	-	WST	2010 Oct 24
+			-11:00	1:00	WSDT	2011 Apr 3
 			-11:00	-	WST
 
 # Solomon Is

Modified: user/jmallett/octeon/contrib/tzdata/southamerica
==============================================================================
--- user/jmallett/octeon/contrib/tzdata/southamerica	Tue Mar  9 22:42:24 2010	(r204934)
+++ user/jmallett/octeon/contrib/tzdata/southamerica	Tue Mar  9 23:12:18 2010	(r204935)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.41
+# @(#)southamerica	8.43
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1121,6 +1121,18 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # http://www.shoa.cl/noticias/2008/04hora/hora.htm
 # .
 
+# From Angel Chiang (2010-03-04):
+# Subject: DST in Chile exceptionally extended to 3 April due to earthquake
+# 
+# http://www.gobiernodechile.cl/viewNoticia.aspx?idArticulo=30098
+# 
+# (in Spanish, last paragraph).
+#
+# This is breaking news. There should be more information available later.
+
+# From Arthur Daivd Olson (2010-03-06):
+# Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1155,7 +1167,9 @@ Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	
 # N.B.: the end of March 29 in Chile is March 30 in Universal time,
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
-Rule	Chile	2009	max	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	 4	3:00u	0	-
+Rule	Chile	2011	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1380,7 +1394,7 @@ Rule	Para	2005	2009	-	Mar	Sun>=8	0:00	0	
 # and that on the first Sunday of the month of October, it is to be set
 # forward 60 minutes, in all the territory of the Paraguayan Republic.
 # ...
-Rule	Para	2010	max	-	Oct	Sun<=7	0:00	1:00	S
+Rule	Para	2010	max	-	Oct	Sun>=1	0:00	1:00	S
 Rule	Para	2010	max	-	Apr	Sun>=8	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: user/jmallett/octeon/crypto/openssh/ChangeLog
==============================================================================
--- user/jmallett/octeon/crypto/openssh/ChangeLog	Tue Mar  9 22:42:24 2010	(r204934)
+++ user/jmallett/octeon/crypto/openssh/ChangeLog	Tue Mar  9 23:12:18 2010	(r204935)
@@ -1,3 +1,982 @@
+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

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

From owner-svn-src-user@FreeBSD.ORG  Wed Mar 10 05:06:47 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E6BB7106564A;
	Wed, 10 Mar 2010 05:06:47 +0000 (UTC)
	(envelope-from lstewart@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D48858FC24;
	Wed, 10 Mar 2010 05:06: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 o2A56lP0036768;
	Wed, 10 Mar 2010 05:06:47 GMT
	(envelope-from lstewart@svn.freebsd.org)
Received: (from lstewart@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2A56lOs036765;
	Wed, 10 Mar 2010 05:06:47 GMT
	(envelope-from lstewart@svn.freebsd.org)
Message-Id: <201003100506.o2A56lOs036765@svn.freebsd.org>
From: Lawrence Stewart 
Date: Wed, 10 Mar 2010 05:06:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204940 - in user/lstewart/alq_varlen_head:
	share/man/man9 sys/kern sys/sys
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Mar 2010 05:06:48 -0000

Author: lstewart
Date: Wed Mar 10 05:06:47 2010
New Revision: 204940
URL: http://svn.freebsd.org/changeset/base/204940

Log:
  Add variable length message support to ALQ(9) (imported from the
  tcp_ffcaia2008_head project branch with tweaks). The KPI is completely backwards
  compatible and described in the updated man page. Invariants testing has been
  strengthened and style nits have also been addressed.
  
  Sponsored by:	FreeBSD Foundation

Modified:
  user/lstewart/alq_varlen_head/share/man/man9/alq.9
  user/lstewart/alq_varlen_head/sys/kern/kern_alq.c
  user/lstewart/alq_varlen_head/sys/sys/alq.h

Modified: user/lstewart/alq_varlen_head/share/man/man9/alq.9
==============================================================================
--- user/lstewart/alq_varlen_head/share/man/man9/alq.9	Wed Mar 10 02:17:57 2010	(r204939)
+++ user/lstewart/alq_varlen_head/share/man/man9/alq.9	Wed Mar 10 05:06:47 2010	(r204940)
@@ -1,7 +1,13 @@
 .\"
 .\" Copyright (c) 2003 Hiten Pandya 
+.\" Copyright (c) 2009-2010 The FreeBSD Foundation
 .\" All rights reserved.
 .\"
+.\" Portions of this software were developed at the Centre for Advanced
+.\" Internet Architectures, Swinburne University of Technology, Melbourne,
+.\" Australia by Lawrence Stewart 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:
@@ -25,17 +31,20 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 16, 2003
+.Dd March 7, 2010
 .Dt ALQ 9
 .Os
 .Sh NAME
 .Nm alq ,
 .Nm alq_open ,
 .Nm alq_write ,
+.Nm alq_writen ,
 .Nm alq_flush ,
 .Nm alq_close ,
 .Nm alq_get ,
-.Nm alq_post
+.Nm alq_getn ,
+.Nm alq_post ,
+.Nm alq_postn
 .Nd Asynchronous Logging Queues
 .Sh SYNOPSIS
 .In sys/alq.h
@@ -49,19 +58,25 @@
 .Fa "int count"
 .Fc
 .Ft int
-.Fn alq_write "struct alq *alq" "void *data" "int waitok"
+.Fn alq_write "struct alq *alq" "void *data" "int flags"
+.Ft int
+.Fn alq_writen "struct alq *alq" "void *data" "int len" "int flags"
 .Ft void
 .Fn alq_flush "struct alq *alq"
 .Ft void
 .Fn alq_close "struct alq *alq"
 .Ft struct ale *
-.Fn alq_get "struct alq *alq" "int waitok"
+.Fn alq_get "struct alq *alq" "int flags"
+.Ft struct ale *
+.Fn alq_getn "struct alq *alq" "int len" "int flags"
 .Ft void
 .Fn alq_post "struct alq *alq" "struct ale *ale"
+.Ft void
+.Fn alq_postn "struct alq *alq" "struct ale *ale" "int flags"
 .Sh DESCRIPTION
 The
 .Nm
-facility provides an asynchronous fixed length recording
+facility provides an asynchronous fixed or variable length recording
 mechanism, known as Asynchronous Logging Queues.
 It can record to any
 .Xr vnode 9 ,
@@ -81,26 +96,37 @@ is defined as
 which has the following members:
 .Bd -literal -offset indent
 struct ale {
-	struct ale	*ae_next;	/* Next Entry */
-	char		*ae_data;	/* Entry buffer */
-	int		ae_flags;	/* Entry flags */
+	intptr_t	ae_bytesused;	/* # bytes written to ALE. */
+	char		*ae_data;	/* Write ptr. */
+	int		ae_pad;		/* Unused, compat. */
 };
 .Ed
 .Pp
-The
-.Va ae_flags
-field is for internal use, clients of the
+An
+.Nm
+can be created in either fixed or variable length mode.
+A variable length
 .Nm
-interface should not modify this field.
-Behaviour is undefined if this field is modified.
+accommodates writes of varying length using
+.Fn alq_writen
+and
+.Fn alq_getn .
+A fixed length
+.Nm
+accommodates a fixed number of writes using
+.Fn alq_write
+and
+.Fn alq_get ,
+each of fixed size (set at queue creation time).
+Fixed length mode is deprecated in favour of variable length mode.
 .Sh FUNCTIONS
 The
 .Fn alq_open
-function creates a new logging queue.
+function creates a new asynchronous logging queue.
 The
 .Fa file
-argument is the name of the file to open for logging; if the file does not
-yet exist,
+argument is the name of the file to open for logging.
+If the file does not yet exist,
 .Fn alq_open
 will attempt to create it.
 The
@@ -115,30 +141,68 @@ a default creation mode suitable for mos
 The argument
 .Fa cred
 specifies the credentials to use when opening and performing I/O on the file.
-The size of each entry in the queue is determined by
-.Fa size .
-The
+To create a variable length mode
+.Nm ,
+the
+.Fa size
+argument should be set to the size (in bytes) of the underlying queue and the
+.Fa count
+argument should be set to 0.
+To create a fixed length mode
+.Nm ,
+the
+.Fa size
+argument should be set to the size (in bytes) of each write and the
 .Fa count
-argument determines the number of items to be stored in the
-asynchronous queue over an approximate period of a disk
-write operation.
+argument should be set to the number of
+.Fa size
+byte chunks to reserve capacity for.
 .Pp
 The
-.Fn alq_write
+.Fn alq_writen
 function writes
+.Fa len
+bytes from
 .Fa data
-to the designated queue,
+to the designated variable length mode queue
 .Fa alq .
-In the event that
-.Fn alq_write
-could not write the entry immediately, and
+If
+.Fn alq_writen
+could not write the entry immediately and
 .Dv ALQ_WAITOK
-is passed to
-.Fa waitok ,
-then
+is set in
+.Fa flags ,
+the function will be allowed to
+.Xr msleep_spin 9
+with the
+.Dq Li alqwriten
+wait message.
+A write will automatically schedule the queue
+.Fa alq
+to be flushed to disk.
+This behaviour can be controlled by passing ALQ_NOACTIVATE via
+.Fa flags
+to indicate that the write should not schedule
+.Fa alq
+to be flushed to disk.
+.Pp
+The
 .Fn alq_write
-will be allowed to
-.Xr tsleep 9 .
+function is implemented as a wrapper around
+.Fn alq_writen
+to provide backwards compatibility to consumers that have not been updated to
+utilise variable length mode queues.
+The function will write
+.Fa size
+bytes of data (where
+.Fa size
+was specified at queue creation time) from the
+.Fa data
+buffer to the
+.Fa alq .
+Note that it is an error to call
+.Fn alq_write
+on a variable length mode queue.
 .Pp
 The
 .Fn alq_flush
@@ -146,61 +210,138 @@ function is used for flushing
 .Fa alq
 to the log medium that was passed to
 .Fn alq_open .
+If
+.Fa alq
+has data to flush and is not already in the process of being flushed, the
+function will block doing IO.
+Otherwise, the function will return immediately.
 .Pp
 The
 .Fn alq_close
-function will close the asynchronous logging queue,
-.Fa alq ,
+function will close the asynchronous logging queue
+.Fa alq
 and flush all pending write requests to the log medium.
 It will free all resources that were previously allocated.
 .Pp
 The
-.Fn alq_get
-function returns the next available asynchronous logging entry
-from the queue,
-.Fa alq .
-This function leaves the queue in a locked state, until a subsequent
+.Fn alq_getn
+function returns an asynchronous log entry from
+.Fa alq ,
+initialised to point at a buffer capable of receiving
+.Fa len
+bytes of data.
+This function leaves
+.Fa alq
+in a locked state, until a subsequent
 .Fn alq_post
+or
+.Fn alq_postn
 call is made.
-In the event that
-.Fn alq_get
-could not retrieve an entry immediately, it will
-.Xr tsleep 9
+If
+.Fn alq_getn
+could not obtain
+.Fa len
+bytes of buffer immediately and
+.Dv ALQ_WAITOK
+is set in
+.Fa flags ,
+the function will be allowed to
+.Xr msleep_spin 9
 with the
-.Dq Li alqget
+.Dq Li alqgetn
 wait message.
+The caller can choose to write less than
+.Fa len
+bytes of data to the returned asynchronous log entry by setting the entry's
+ae_bytesused field to the number of bytes actually written.
+This must be done prior to calling
+.Fn alq_post .
 .Pp
 The
-.Fn alq_post
-function schedules the asynchronous logging entry,
-.Fa ale ,
-which is retrieved using the
 .Fn alq_get
-function,
-for writing to the asynchronous logging queue,
+function is implemented as a wrapper around
+.Fn alq_getn
+to provide backwards compatibility to consumers that have not been updated to
+utilise variable length mode queues.
+The asynchronous log entry returned will be initialised to point at a buffer
+capable of receiving
+.Fa size
+bytes of data (where
+.Fa size
+was specified at queue creation time).
+Note that it is an error to call
+.Fn alq_get
+on a variable length mode queue.
+.Pp
+The
+.Fn alq_postn
+function schedules the asynchronous log entry
+.Fa ale
+(obtained from
+.Fn alq_getn
+or
+.Fn alq_get )
+for writing to
 .Fa alq .
-This function leaves the queue,
-.Fa alq ,
+The ALQ_NOACTIVATE flag may be passed in via
+.Fa flags
+to indicate that the queue should not be immediately scheduled to be flushed to
+disk.
+This function leaves
+.Fa alq
 in an unlocked state.
+.Pp
+The
+.Fn alq_post
+function is implemented as a wrapper around
+.Fn alq_postn
+to provide backwards compatibility to consumers that have not been updated to
+utilise the newer
+.Fn alq_postn
+function.
+It simply passes
+.Fa alq
+and
+.Fa ale
+through to
+.Fn alq_postn
+untouched, and sets
+.Fa flags
+to 0.
 .Sh IMPLEMENTATION NOTES
 The
+.Fn alq_writen
+and
 .Fn alq_write
-function is a wrapper around the
+functions both perform a
+.Xr bcopy 3
+from the supplied
+.Fa data
+buffer into the underlying
+.Nm
+buffer.
+Performance critical code paths may wish to consider using
+.Fn alq_getn
+(variable length queues) or
+.Fn alq_get
+(fixed length queues) to avoid the extra memory copy. Note that a queue
+remains locked between calls to
+.Fn alq_getn
+or
 .Fn alq_get
 and
 .Fn alq_post
-functions; by using these functions separately, a call
-to
-.Fn bcopy
-can be avoided for performance critical code paths.
+or
+.Fn alq_postn ,
+so this method of writing to a queue is unsuitable for situations where the
+time between calls may be substantial.
 .Sh LOCKING
-Each asynchronous queue is protected by a spin mutex.
+Each asynchronous logging queue is protected by a spin mutex.
 .Pp
 Functions
-.Fn alq_flush ,
-.Fn alq_open
+.Fn alq_flush
 and
-.Fn alq_post
+.Fn alq_open
 may attempt to acquire an internal sleep mutex, and should
 consequently not be used in contexts where sleeping is
 not allowed.
@@ -214,32 +355,36 @@ if it fails to open
 or else it returns 0.
 .Pp
 The
+.Fn alq_writen
+and
 .Fn alq_write
-function returns
+functions return
 .Er EWOULDBLOCK
 if
 .Dv ALQ_NOWAIT
-was provided as a value to
-.Fa waitok
-and either the queue is full, or when the system is shutting down.
+was set in
+.Fa flags
+and either the queue is full or the system is shutting down.
 .Pp
 The
+.Fn alq_getn
+and
 .Fn alq_get
-function returns
-.Dv NULL ,
+functions return
+.Dv NULL
 if
 .Dv ALQ_NOWAIT
-was provided as a value to
-.Fa waitok
-and either the queue is full, or when the system is shutting down.
+was set in
+.Fa flags
+and either the queue is full or the system is shutting down.
 .Pp
 NOTE: invalid arguments to non-void functions will result in
 undefined behaviour.
 .Sh SEE ALSO
-.Xr syslog 3 ,
-.Xr kthread 9 ,
+.Xr kproc 9 ,
 .Xr ktr 9 ,
-.Xr tsleep 9 ,
+.Xr msleep_spin 9 ,
+.Xr syslog 3 ,
 .Xr vnode 9
 .Sh HISTORY
 The
@@ -250,7 +395,11 @@ Asynchronous Logging Queues (ALQ) facili
 The
 .Nm
 facility was written by
-.An Jeffrey Roberson Aq jeff@FreeBSD.org .
+.An Jeffrey Roberson Aq jeff@FreeBSD.org
+and extended by
+.An Lawrence Stewart Aq lstewart@freebsd.org .
 .Pp
 This manual page was written by
-.An Hiten Pandya Aq hmp@FreeBSD.org .
+.An Hiten Pandya Aq hmp@FreeBSD.org
+and revised by
+.An Lawrence Stewart Aq lstewart@freebsd.org .

Modified: user/lstewart/alq_varlen_head/sys/kern/kern_alq.c
==============================================================================
--- user/lstewart/alq_varlen_head/sys/kern/kern_alq.c	Wed Mar 10 02:17:57 2010	(r204939)
+++ user/lstewart/alq_varlen_head/sys/kern/kern_alq.c	Wed Mar 10 05:06:47 2010	(r204940)
@@ -56,14 +56,17 @@ __FBSDID("$FreeBSD$");
 struct alq {
 	int	aq_entmax;		/* Max entries */
 	int	aq_entlen;		/* Entry length */
+	int	aq_freebytes;		/* Bytes available in buffer */
+	int	aq_buflen;		/* Total length of our buffer */
 	char	*aq_entbuf;		/* Buffer for stored entries */
+	int	aq_writehead;		/* Location for next write */
+	int	aq_writetail;		/* Flush starts at this location */
+	int	aq_wrapearly;		/* # bytes left blank at end of buf */
 	int	aq_flags;		/* Queue flags */
+	struct	ale	aq_getpost;	/* ALE for use by get/post */
 	struct mtx	aq_mtx;		/* Queue lock */
 	struct vnode	*aq_vp;		/* Open vnode handle */
 	struct ucred	*aq_cred;	/* Credentials of the opening thread */
-	struct ale	*aq_first;	/* First ent */
-	struct ale	*aq_entfree;	/* First free ent */
-	struct ale	*aq_entvalid;	/* First ent valid for writing */
 	LIST_ENTRY(alq)	aq_act;		/* List of active queues */
 	LIST_ENTRY(alq)	aq_link;	/* List of all queues */
 };
@@ -76,6 +79,8 @@ struct alq {
 #define	ALQ_LOCK(alq)	mtx_lock_spin(&(alq)->aq_mtx)
 #define	ALQ_UNLOCK(alq)	mtx_unlock_spin(&(alq)->aq_mtx)
 
+#define HAS_PENDING_DATA(alq) ((alq)->aq_freebytes != (alq)->aq_buflen)
+
 static MALLOC_DEFINE(M_ALD, "ALD", "ALD");
 
 /*
@@ -90,7 +95,7 @@ static struct proc *ald_proc;
 #define	ALD_LOCK()	mtx_lock(&ald_mtx)
 #define	ALD_UNLOCK()	mtx_unlock(&ald_mtx)
 
-/* Daemon functions */
+/* Daemon functions. */
 static int ald_add(struct alq *);
 static int ald_rem(struct alq *);
 static void ald_startup(void *);
@@ -99,7 +104,7 @@ static void ald_shutdown(void *, int);
 static void ald_activate(struct alq *);
 static void ald_deactivate(struct alq *);
 
-/* Internal queue functions */
+/* Internal queue functions. */
 static void alq_shutdown(struct alq *);
 static void alq_destroy(struct alq *);
 static int alq_doio(struct alq *);
@@ -125,7 +130,7 @@ ald_add(struct alq *alq)
 
 /*
  * Remove a queue from the global list unless we're shutting down.  If so,
- * the ald will take care of cleaning up it's resources.
+ * the ALD will take care of cleaning up its resources.
  */
 static int
 ald_rem(struct alq *alq)
@@ -242,7 +247,21 @@ alq_shutdown(struct alq *alq)
 	/* Stop any new writers. */
 	alq->aq_flags |= AQ_SHUTDOWN;
 
-	/* Drain IO */
+	/*
+	 * If the ALQ isn't active but has unwritten data (possible if
+	 * the ALQ_NOACTIVATE flag has been used), explicitly activate the
+	 * ALQ here so that the pending data gets flushed by the ald_daemon.
+	 */
+	if (!(alq->aq_flags & AQ_ACTIVE) && HAS_PENDING_DATA(alq)) {
+		alq->aq_flags |= AQ_ACTIVE;
+		ALQ_UNLOCK(alq);
+		ALD_LOCK();
+		ald_activate(alq);
+		ALD_UNLOCK();
+		ALQ_LOCK(alq);
+	}
+
+	/* Drain IO. */
 	while (alq->aq_flags & AQ_ACTIVE) {
 		alq->aq_flags |= AQ_WANTED;
 		msleep_spin(alq, &alq->aq_mtx, "aldclose", 0);
@@ -260,7 +279,6 @@ alq_destroy(struct alq *alq)
 	alq_shutdown(alq);
 
 	mtx_destroy(&alq->aq_mtx);
-	free(alq->aq_first, M_ALD);
 	free(alq->aq_entbuf, M_ALD);
 	free(alq, M_ALD);
 }
@@ -276,58 +294,62 @@ alq_doio(struct alq *alq)
 	struct vnode *vp;
 	struct uio auio;
 	struct iovec aiov[2];
-	struct ale *ale;
-	struct ale *alstart;
 	int totlen;
 	int iov;
 	int vfslocked;
+	int wrapearly;
+
+	KASSERT((HAS_PENDING_DATA(alq)), ("%s: queue emtpy!", __func__));
 
 	vp = alq->aq_vp;
 	td = curthread;
 	totlen = 0;
-	iov = 0;
-
-	alstart = ale = alq->aq_entvalid;
-	alq->aq_entvalid = NULL;
+	iov = 1;
+	wrapearly = alq->aq_wrapearly;
 
 	bzero(&aiov, sizeof(aiov));
 	bzero(&auio, sizeof(auio));
 
-	do {
-		if (aiov[iov].iov_base == NULL)
-			aiov[iov].iov_base = ale->ae_data;
-		aiov[iov].iov_len += alq->aq_entlen;
-		totlen += alq->aq_entlen;
-		/* Check to see if we're wrapping the buffer */
-		if (ale->ae_data + alq->aq_entlen != ale->ae_next->ae_data)
-			iov++;
-		ale->ae_flags &= ~AE_VALID;
-		ale = ale->ae_next;
-	} while (ale->ae_flags & AE_VALID);
+	/* Start the write from the location of our buffer tail pointer. */
+	aiov[0].iov_base = alq->aq_entbuf + alq->aq_writetail;
+
+	if (alq->aq_writetail < alq->aq_writehead) {
+		/* Buffer not wrapped. */
+		totlen = aiov[0].iov_len = alq->aq_writehead - alq->aq_writetail;
+	} else if (alq->aq_writehead == 0) {
+		/* Buffer not wrapped (special case to avoid an empty iov). */
+		totlen = aiov[0].iov_len = alq->aq_buflen - alq->aq_writetail -
+		    wrapearly;
+	} else {
+		/*
+		 * Buffer wrapped, requires 2 aiov entries:
+		 * - first is from writetail to end of buffer
+		 * - second is from start of buffer to writehead
+		 */
+		aiov[0].iov_len = alq->aq_buflen - alq->aq_writetail -
+		    wrapearly;
+		iov++;
+		aiov[1].iov_base = alq->aq_entbuf;
+		aiov[1].iov_len =  alq->aq_writehead;
+		totlen = aiov[0].iov_len + aiov[1].iov_len;
+	}
 
 	alq->aq_flags |= AQ_FLUSHING;
 	ALQ_UNLOCK(alq);
 
-	if (iov == 2 || aiov[iov].iov_base == NULL)
-		iov--;
-
 	auio.uio_iov = &aiov[0];
 	auio.uio_offset = 0;
 	auio.uio_segflg = UIO_SYSSPACE;
 	auio.uio_rw = UIO_WRITE;
-	auio.uio_iovcnt = iov + 1;
+	auio.uio_iovcnt = iov;
 	auio.uio_resid = totlen;
 	auio.uio_td = td;
 
-	/*
-	 * Do all of the junk required to write now.
-	 */
+	/* Do all of the junk required to write now. */
 	vfslocked = VFS_LOCK_GIANT(vp->v_mount);
 	vn_start_write(vp, &mp, V_WAIT);
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-	/*
-	 * XXX: VOP_WRITE error checks are ignored.
-	 */
+	/* XXX: VOP_WRITE error checks are ignored. */
 #ifdef MAC
 	if (mac_vnode_check_write(alq->aq_cred, NOCRED, vp) == 0)
 #endif
@@ -339,8 +361,28 @@ alq_doio(struct alq *alq)
 	ALQ_LOCK(alq);
 	alq->aq_flags &= ~AQ_FLUSHING;
 
-	if (alq->aq_entfree == NULL)
-		alq->aq_entfree = alstart;
+	/* Adjust writetail as required, taking into account wrapping. */
+	alq->aq_writetail = (alq->aq_writetail + totlen + wrapearly) %
+	    alq->aq_buflen;
+	alq->aq_freebytes += totlen + wrapearly;
+
+	/*
+	 * If we just flushed part of the buffer which wrapped, reset the
+	 * wrapearly indicator.
+	 */
+	if (wrapearly)
+		alq->aq_wrapearly = 0;
+
+	/*
+	 * If we just flushed the buffer completely,
+	 * reset indexes to 0 to minimise buffer wraps.
+	 * This is also required to ensure alq_getn() can't wedge itself.
+	 */
+	if (!HAS_PENDING_DATA(alq))
+		alq->aq_writehead = alq->aq_writetail = 0;
+
+	KASSERT((alq->aq_writetail >= 0 && alq->aq_writetail < alq->aq_buflen),
+	    ("%s: aq_writetail < 0 || aq_writetail >= aq_buflen", __func__));
 
 	if (alq->aq_flags & AQ_WANTED) {
 		alq->aq_flags &= ~AQ_WANTED;
@@ -360,7 +402,7 @@ SYSINIT(aldthread, SI_SUB_KTHREAD_IDLE, 
 SYSINIT(ald, SI_SUB_LOCK, SI_ORDER_ANY, ald_startup, NULL);
 
 
-/* User visible queue functions */
+/* User visible queue functions. */
 
 /*
  * Create the queue data structure, allocate the buffer, and open the file.
@@ -371,13 +413,13 @@ alq_open(struct alq **alqp, const char *
 {
 	struct thread *td;
 	struct nameidata nd;
-	struct ale *ale;
-	struct ale *alp;
 	struct alq *alq;
-	char *bufp;
 	int flags;
 	int error;
-	int i, vfslocked;
+	int vfslocked;
+
+	KASSERT((size > 0), ("%s: size <= 0", __func__));
+	KASSERT((count >= 0), ("%s: count < 0", __func__));
 
 	*alqp = NULL;
 	td = curthread;
@@ -391,36 +433,31 @@ alq_open(struct alq **alqp, const char *
 
 	vfslocked = NDHASGIANT(&nd);
 	NDFREE(&nd, NDF_ONLY_PNBUF);
-	/* We just unlock so we hold a reference */
+	/* We just unlock so we hold a reference. */
 	VOP_UNLOCK(nd.ni_vp, 0);
 	VFS_UNLOCK_GIANT(vfslocked);
 
 	alq = malloc(sizeof(*alq), M_ALD, M_WAITOK|M_ZERO);
-	alq->aq_entbuf = malloc(count * size, M_ALD, M_WAITOK|M_ZERO);
-	alq->aq_first = malloc(sizeof(*ale) * count, M_ALD, M_WAITOK|M_ZERO);
 	alq->aq_vp = nd.ni_vp;
 	alq->aq_cred = crhold(cred);
-	alq->aq_entmax = count;
-	alq->aq_entlen = size;
-	alq->aq_entfree = alq->aq_first;
 
 	mtx_init(&alq->aq_mtx, "ALD Queue", NULL, MTX_SPIN|MTX_QUIET);
 
-	bufp = alq->aq_entbuf;
-	ale = alq->aq_first;
-	alp = NULL;
-
-	/* Match up entries with buffers */
-	for (i = 0; i < count; i++) {
-		if (alp)
-			alp->ae_next = ale;
-		ale->ae_data = bufp;
-		alp = ale;
-		ale++;
-		bufp += size;
+	if (count > 0) {
+		/* Fixed length messages. */
+		alq->aq_buflen = size * count;
+		alq->aq_entmax = count;
+		alq->aq_entlen = size;
+	} else {
+		/* Variable length messages. */
+		alq->aq_buflen = size;
+		alq->aq_entmax = 0;
+		alq->aq_entlen = 0;
 	}
 
-	alp->ae_next = alq->aq_first;
+	alq->aq_freebytes = alq->aq_buflen;
+	alq->aq_entbuf = malloc(alq->aq_buflen, M_ALD, M_WAITOK|M_ZERO);
+	alq->aq_writehead = alq->aq_writetail = 0;
 
 	if ((error = ald_add(alq)) != 0) {
 		alq_destroy(alq);
@@ -437,39 +474,205 @@ alq_open(struct alq **alqp, const char *
  * wait or return an error depending on the value of waitok.
  */
 int
-alq_write(struct alq *alq, void *data, int waitok)
+alq_writen(struct alq *alq, void *data, int len, int flags)
 {
-	struct ale *ale;
+	int activate, copy;
+
+	KASSERT((len > 0 && len <= alq->aq_buflen),
+	    ("%s: len <= 0 || len > aq_buflen", __func__));
+
+	activate = 0;
+	copy = len;
+
+	ALQ_LOCK(alq);
+
+	/*
+	 * Fail to perform the write and return EWOULDBLOCK if:
+	 * - The message is larger than our underlying buffer.
+	 * - There is insufficient free space in our underlying buffer
+	 *   to accept the message and the user can't wait for space.
+	 * - There is insufficient free space in our underlying buffer
+	 *   to accept the message and the alq is inactive due to prior
+	 *   use of the ALQ_NOACTIVATE flag (which would lead to deadlock).
+	 */
+	if (len > alq->aq_buflen ||
+	    (((flags & ALQ_NOWAIT) || (!(alq->aq_flags & AQ_ACTIVE) &&
+	    HAS_PENDING_DATA(alq))) && alq->aq_freebytes < len)) {
+		ALQ_UNLOCK(alq);
+		return (EWOULDBLOCK);
+	}
+
+	/*
+	 * ALQ_WAITOK or alq->aq_freebytes > len, either spin until
+	 * we have enough free bytes (former) or skip (latter). However in the
+	 * latter case, we can't skip if other threads are already
+	 * waiting (AQ_WANTED is set), otherwise records can get out of order.
+	 */
+	while ((alq->aq_freebytes < len && !(alq->aq_flags & AQ_SHUTDOWN))
+	    || alq->aq_flags & AQ_WANTED) {
+		alq->aq_flags |= AQ_WANTED;
+		msleep_spin(alq, &alq->aq_mtx, "alqwriten", 0);
+		KASSERT(!(alq->aq_flags & AQ_WANTED),
+		    ("AQ_WANTED should have been unset!"));
+	}
+
+	/*
+	 * We need to serialise wakeups to ensure records remain in order.
+	 * Therefore, wakeup the next thread in the queue waiting for
+	 * ALQ resources to be available.
+	 * (Technically this is only required if we actually entered the above
+	 * while loop.)
+	 */
+	wakeup_one(alq);
 
-	if ((ale = alq_get(alq, waitok)) == NULL)
+	/* Bail if we're shutting down. */
+	if (alq->aq_flags & AQ_SHUTDOWN) {
+		ALQ_UNLOCK(alq);
 		return (EWOULDBLOCK);
+	}
+
+	/*
+	 * If we need to wrap the buffer to accommodate the write,
+	 * we'll need 2 calls to bcopy.
+	 */
+	if ((alq->aq_buflen - alq->aq_writehead) < len)
+		copy = alq->aq_buflen - alq->aq_writehead;
+
+	/* Copy message (or part thereof if wrap required) to the buffer. */
+	bcopy(data, alq->aq_entbuf + alq->aq_writehead, copy);
+	alq->aq_writehead += copy;
+
+	if (alq->aq_writehead >= alq->aq_buflen) {
+		KASSERT((alq->aq_writehead == alq->aq_buflen),
+		    ("alq->aq_writehead (%d) > alq->aq_buflen (%d)",
+		    alq->aq_writehead,
+		    alq->aq_buflen));
+		alq->aq_writehead = 0;
+	}
+
+	if (copy != len) {
+		/*
+		 * Wrap the buffer by copying the remainder of our message
+		 * to the start of the buffer and resetting aq_writehead.
+		 */
+		bcopy(((uint8_t *)data)+copy, alq->aq_entbuf, len - copy);
+		alq->aq_writehead = len - copy;
+	}
+
+	KASSERT((alq->aq_writehead >= 0 && alq->aq_writehead < alq->aq_buflen),
+	    ("%s: aq_writehead < 0 || aq_writehead >= aq_buflen", __func__));
+
+	alq->aq_freebytes -= len;
+
+	if (!(alq->aq_flags & AQ_ACTIVE) && !(flags & ALQ_NOACTIVATE)) {
+		alq->aq_flags |= AQ_ACTIVE;
+		activate = 1;
+	}
+
+	ALQ_UNLOCK(alq);
 
-	bcopy(data, ale->ae_data, alq->aq_entlen);
-	alq_post(alq, ale);
+	if (activate) {
+		ALD_LOCK();
+		ald_activate(alq);
+		ALD_UNLOCK();
+	}
 
 	return (0);
 }
 
+int
+alq_write(struct alq *alq, void *data, int flags)
+{
+	/* Should only be called in fixed length message (legacy) mode. */
+	KASSERT((alq->aq_entmax > 0 && alq->aq_entlen > 0),
+	    ("%s: fixed length write on variable length queue", __func__));
+	return (alq_writen(alq, data, alq->aq_entlen, flags));
+}
+
+/*
+ * Retrieve a pointer for the ALQ to write directly into, avoiding bcopy.
+ */
 struct ale *
-alq_get(struct alq *alq, int waitok)
+alq_getn(struct alq *alq, int len, int flags)
 {
-	struct ale *ale;
-	struct ale *aln;
+	int contigbytes;
 
-	ale = NULL;
+	KASSERT((len > 0 && len <= alq->aq_buflen),
+	    ("%s: len <= 0 || len > alq->aq_buflen", __func__));
 
 	ALQ_LOCK(alq);
 
-	/* Loop until we get an entry or we're shutting down */
-	while ((alq->aq_flags & AQ_SHUTDOWN) == 0 && 
-	    (ale = alq->aq_entfree) == NULL &&
-	    (waitok & ALQ_WAITOK)) {
+	/*
+	 * Determine the number of free contiguous bytes.
+	 * We ensure elsewhere that if aq_writehead == aq_writetail because
+	 * the buffer is empty, they will both be set to 0 and therefore
+	 * aq_freebytes == aq_buflen and is fully contiguous.
+	 * If they are equal and the buffer is not empty, aq_freebytes will
+	 * be 0 indicating the buffer is full.
+	 */
+	if (alq->aq_writehead <= alq->aq_writetail)
+		contigbytes = alq->aq_freebytes;
+	else {
+		contigbytes = alq->aq_buflen - alq->aq_writehead;
+
+		if (contigbytes < len) {
+			/*
+			 * Insufficient space at end of buffer to handle a
+			 * contiguous write. Wrap early if there's space at
+			 * the beginning. This will leave a hole at the end
+			 * of the buffer which we will have to skip over when
+			 * flushing the buffer to disk.
+			 */
+			if (alq->aq_writetail >= len || flags & ALQ_WAITOK) {
+				/* Keep track of # bytes left blank. */
+				alq->aq_wrapearly = contigbytes;
+				/* Do the wrap and adjust counters. */
+				contigbytes = alq->aq_freebytes =
+				    alq->aq_writetail;
+				alq->aq_writehead = 0;
+			}
+		}
+	}
+
+	/*
+	 * Return a NULL ALE if:
+	 * - The message is larger than our underlying buffer.
+	 * - There is insufficient free space in our underlying buffer
+	 *   to accept the message and the user can't wait for space.
+	 * - There is insufficient free space in our underlying buffer
+	 *   to accept the message and the alq is inactive due to prior
+	 *   use of the ALQ_NOACTIVATE flag (which would lead to deadlock).
+	 */
+	if (len > alq->aq_buflen ||
+	    (((flags & ALQ_NOWAIT) || (!(alq->aq_flags & AQ_ACTIVE) &&
+	    HAS_PENDING_DATA(alq))) && contigbytes < len)) {
+		ALQ_UNLOCK(alq);
+		return (NULL);
+	}
+
+	/*
+	 * ALQ_WAITOK or contigbytes >= len,
+	 * either spin until we have enough free contiguous bytes (former)
+	 * or skip (latter). However, in the latter case, we can't skip if
+	 * other threads are already waiting (AQ_WANTED is set), otherwise
+	 * records can get out of order.
+	 */
+	while ((contigbytes < len && !(alq->aq_flags & AQ_SHUTDOWN))
+	    || alq->aq_flags & AQ_WANTED) {
 		alq->aq_flags |= AQ_WANTED;
-		msleep_spin(alq, &alq->aq_mtx, "alqget", 0);
+		msleep_spin(alq, &alq->aq_mtx, "alqgetn", 0);
+
+		KASSERT(!(alq->aq_flags & AQ_WANTED),
+		    ("AQ_WANTED should have been unset!"));
+
+		if (alq->aq_writehead <= alq->aq_writetail)
+			contigbytes = alq->aq_freebytes;
+		else
+			contigbytes = alq->aq_buflen - alq->aq_writehead;
 	}
 
 	/*
-	 * We need to serialise wakups to ensure records remain in order...
+	 * We need to serialise wakeups to ensure records remain in order.
 	 * Therefore, wakeup the next thread in the queue waiting for
 	 * ALQ resources to be available.
 	 * (Technically this is only required if we actually entered the above
@@ -477,36 +680,55 @@ alq_get(struct alq *alq, int waitok)
 	 */
 	wakeup_one(alq);
 
-	if (ale != NULL) {
-		aln = ale->ae_next;
-		if ((aln->ae_flags & AE_VALID) == 0)
-			alq->aq_entfree = aln;
-		else
-			alq->aq_entfree = NULL;
-	} else
+	/* Bail if we're shutting down. */
+	if (alq->aq_flags & AQ_SHUTDOWN) {
 		ALQ_UNLOCK(alq);
+		return (NULL);
+	}
+
+	/*
+	 * If we are here, we have a contiguous number of bytes >= len
+	 * available in our buffer starting at aq_writehead.
+	 */
+	alq->aq_getpost.ae_data = alq->aq_entbuf + alq->aq_writehead;
+	alq->aq_getpost.ae_bytesused = len;
 
+	return (&alq->aq_getpost);
+}
 
-	return (ale);
+struct ale *
+alq_get(struct alq *alq, int flags)
+{
+	/* Should only be called in fixed length message (legacy) mode. */
+	KASSERT((alq->aq_entmax > 0 && alq->aq_entlen > 0),
+	    ("%s: fixed length get on variable length queue", __func__));
+	return (alq_getn(alq, alq->aq_entlen, flags));
 }
 
 void
-alq_post(struct alq *alq, struct ale *ale)
+alq_postn(struct alq *alq, struct ale *ale, int flags)
 {
 	int activate;
 
-	ale->ae_flags |= AE_VALID;
+	activate = 0;
 
-	if (alq->aq_entvalid == NULL)
-		alq->aq_entvalid = ale;
-
-	if ((alq->aq_flags & AQ_ACTIVE) == 0) {
+	if (!(alq->aq_flags & AQ_ACTIVE) && !(flags & ALQ_NOACTIVATE)) {
 		alq->aq_flags |= AQ_ACTIVE;
 		activate = 1;
-	} else
-		activate = 0;
+	}
+

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

From owner-svn-src-user@FreeBSD.ORG  Wed Mar 10 07:07:13 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3DCDB106564A;
	Wed, 10 Mar 2010 07:07:13 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C8458FC0A;
	Wed, 10 Mar 2010 07:07: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 o2A77Dle063323;
	Wed, 10 Mar 2010 07:07:13 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2A77Dvp063320;
	Wed, 10 Mar 2010 07:07:13 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201003100707.o2A77Dvp063320@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 10 Mar 2010 07:07:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204944 - user/edwin/ncal
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Mar 2010 07:07:13 -0000

Author: edwin
Date: Wed Mar 10 07:07:12 2010
New Revision: 204944
URL: http://svn.freebsd.org/changeset/base/204944

Log:
  Do sanity checking: for various combinations of the options, do not
  allow them together.

Modified:
  user/edwin/ncal/ncal.1
  user/edwin/ncal/ncal.c

Modified: user/edwin/ncal/ncal.1
==============================================================================
--- user/edwin/ncal/ncal.1	Wed Mar 10 06:10:39 2010	(r204943)
+++ user/edwin/ncal/ncal.1	Wed Mar 10 07:07:12 2010	(r204944)
@@ -148,6 +148,14 @@ year default to those of the current sys
 will display a calendar for the month of August in the current
 year).
 .Pp
+Not all options can be used together. For example
+.Dq Li -3 -A 2 -B 3 -y -m 7
+would mean:
+show me the three months around the seventh month, three before
+that, two after that and the whole year.
+.Nm ncal
+will warn about these combinations.
+.Pp
 A year starts on January 1.
 .Sh SEE ALSO
 .Xr calendar 3 ,

Modified: user/edwin/ncal/ncal.c
==============================================================================
--- user/edwin/ncal/ncal.c	Wed Mar 10 06:10:39 2010	(r204943)
+++ user/edwin/ncal/ncal.c	Wed Mar 10 07:07:12 2010	(r204944)
@@ -194,12 +194,18 @@ main(int argc, char *argv[])
 	int     m = 0;			/* month */
 	int	y = 0;			/* year */
 	int     flag_backward = 0;	/* user called cal--backward compat. */
-	int     flag_hole_year = 0;	/* user wants the whole year */
+	int     flag_wholeyear = 0;	/* user wants the whole year */
 	int	flag_julian_cal = 0;	/* user wants Julian Calendar */
 	int     flag_julian_day = 0;	/* user wants the Julian day
 					 * numbers */
-	int	flag_orthodox = 0;	/* use wants Orthodox easter */
-	int	flag_easter = 0;	/* use wants easter date */
+	int	flag_orthodox = 0;	/* user wants Orthodox easter */
+	int	flag_easter = 0;	/* user wants easter date */
+	int	flag_3months = 0;	/* user wants 3 month display (-3) */
+	int	flag_after = 0;		/* user wants to see months after */
+	int	flag_before = 0;	/* user wants to see months before */
+	int	flag_specifiedmonth = 0;/* user wants to see this month (-m) */
+	int	flag_givenmonth = 0;	/* user has specified month [n] */
+	int	flag_givenyear = 0;	/* user has specified year [n] */
 	char	*cp;			/* character pointer */
 	char	*flag_month = NULL;	/* requested month as string */
 	char	*flag_highlightdate = NULL;
@@ -253,17 +259,23 @@ main(int argc, char *argv[])
 	while ((ch = getopt(argc, argv, "A:B:3Jbd:ehjm:ops:wy")) != -1)
 		switch (ch) {
 		case '3':
-			before = after = 1;
+			flag_3months = 1;
 			break;
 		case 'A':
-			after = strtol(optarg, NULL, 10);
-			if (after < 0)
-				errx(1, "Argument to -A must be positive");
+			if (flag_after > 0)
+				errx(EX_USAGE, "Double -A specified");
+			flag_after = strtol(optarg, NULL, 10);
+			if (flag_after <= 0)
+				errx(EX_USAGE,
+				    "Argument to -A must be positive");
 			break;
 		case 'B':
-			before = strtol(optarg, NULL, 10);
-			if (before < 0)
-				errx(1, "Argument to -B must be positive");
+			if (flag_before > 0)
+				errx(EX_USAGE, "Double -A specified");
+			flag_before = strtol(optarg, NULL, 10);
+			if (flag_before <= 0)
+				errx(EX_USAGE,
+				    "Argument to -B must be positive");
 			break;
 		case 'J':
 			if (flag_backward)
@@ -289,9 +301,10 @@ main(int argc, char *argv[])
 			flag_julian_day = 1;
 			break;
 		case 'm':
+			if (flag_specifiedmonth)
+				errx(EX_USAGE, "Double -m specified");
 			flag_month = optarg;
-			before = 0;
-			after = 0;
+			flag_specifiedmonth = 1;
 			break;
 		case 'o':
 			if (flag_backward)
@@ -324,7 +337,7 @@ main(int argc, char *argv[])
 			flag_weeks = 1;
 			break;
 		case 'y':
-			flag_hole_year = 1;
+			flag_wholeyear = 1;
 			break;
 		default:
 			usage();
@@ -338,21 +351,15 @@ main(int argc, char *argv[])
 		if (flag_easter)
 			usage();
 		flag_month = *argv++;
-		if (before == -1 && after == -1) {
-			before = 0;
-			after = 0;
-		}
+		flag_givenmonth = 1;
 		m = strtol(flag_month, NULL, 10);
 		/* FALLTHROUGH */
 	case 1:
-		y = atoi(*argv++);
+		y = atoi(*argv);
 		if (y < 1 || y > 9999)
-			errx(EX_USAGE, "year %d not in range 1..9999", y);
-		if (before == -1 && after == -1) {
-			before = 0;
-			after = 11;
-			m = 1;
-		}
+			errx(EX_USAGE, "year `%s' not in range 1..9999", *argv);
+		argv++;
+		flag_givenyear = 1;
 		break;
 	case 0:
 		{
@@ -363,22 +370,12 @@ main(int argc, char *argv[])
 			tm = localtime(&t);
 			y = tm->tm_year + 1900;
 			m = tm->tm_mon + 1;
-			if (before == -1)
-				before = 0;
-			if (after == -1)
-				after = 0;
 		}
 		break;
 	default:
 		usage();
 	}
 
-	if (flag_hole_year) {
-		m = 1;
-		before = 0;
-		after = 11;
-	}
-
 	if (flag_month != NULL) {
 		if (parsemonth(flag_month, &m, &y)) {
 			errx(EX_USAGE,
@@ -387,6 +384,67 @@ main(int argc, char *argv[])
 		}
 	}
 
+	/*
+	 * What do we support and what do we not support
+	 * flag_3month, flag_before, flag_after
+	 * flag_givenyear, flag_givenmonth
+	 * 
+	 */
+
+	/* -3 together with -A or -B */
+	if (flag_3months && (flag_after || flag_before))
+		errx(EX_USAGE, "-3 together with -A and -B is not supported.");
+	/* -3 together with -y */
+	if (flag_3months && flag_wholeyear)
+		errx(EX_USAGE, "-3 together with -y is not supported.");
+	/* -3 together with givenyear but no givenmonth */
+	if (flag_3months && flag_givenyear &&
+	    !(flag_givenmonth || flag_specifiedmonth))
+		errx(EX_USAGE,
+		    "-3 together with a given year but no given month is "
+		    "not supported.");
+	/* -m together with xx xxxx */
+	if (flag_specifiedmonth && flag_givenmonth)
+		errx(EX_USAGE,
+		    "-m together with a given month is not supported.");
+	/* -y together with -m */
+	if (flag_wholeyear && flag_specifiedmonth)
+		errx(EX_USAGE, "-y together with -m is not supported.");
+	/* -y together with xx xxxx */
+	if (flag_wholeyear && flag_givenmonth)
+		errx(EX_USAGE, "-y together a given month is not supported.");
+	/* -y together with -A or -B */
+	if (flag_wholeyear && (flag_before > 0 || flag_after > 0))
+		errx(EX_USAGE, "-y together a -A or -B is not supported.");
+	/* The rest should be fine */
+
+	/* Select the period to display, in order of increasing priority */
+	if (flag_wholeyear ||
+	    (flag_givenyear && !(flag_givenmonth || flag_specifiedmonth))) {
+		m = 1;
+		before = 0;
+		after = 11;
+	}
+	if (flag_givenyear && flag_givenmonth) {
+		before = 0;
+		after = 0;
+	}
+	if (flag_specifiedmonth) {
+		before = 0;
+		after = 0;
+	}
+	if (flag_before) {
+		before = flag_before;
+	}
+	if (flag_after) {
+		after = flag_after;
+	}
+	if (flag_3months) {
+		before = 1;
+		after = 1;
+	}
+
+	/* Highlight a specified day or today */
 	if (flag_highlightdate != NULL) {
 		dt.y = strtol(flag_highlightdate, NULL, 10);
 		dt.m = strtol(flag_highlightdate + 5, NULL, 10);

From owner-svn-src-user@FreeBSD.ORG  Wed Mar 10 07:25:17 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0EF551065679;
	Wed, 10 Mar 2010 07:25:17 +0000 (UTC)
	(envelope-from lstewart@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F1E7F8FC13;
	Wed, 10 Mar 2010 07:25: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 o2A7PGgQ067289;
	Wed, 10 Mar 2010 07:25:16 GMT
	(envelope-from lstewart@svn.freebsd.org)
Received: (from lstewart@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2A7PGv9067287;
	Wed, 10 Mar 2010 07:25:16 GMT
	(envelope-from lstewart@svn.freebsd.org)
Message-Id: <201003100725.o2A7PGv9067287@svn.freebsd.org>
From: Lawrence Stewart 
Date: Wed, 10 Mar 2010 07:25:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204945 - user/lstewart/alq_varlen_head/sys/kern
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Mar 2010 07:25:17 -0000

Author: lstewart
Date: Wed Mar 10 07:25:16 2010
New Revision: 204945
URL: http://svn.freebsd.org/changeset/base/204945

Log:
  This change should have been in r204749 instead of what was actually committed.
  Module unloading now works again.
  
  Sponsored by:	FreeBSD Foundation

Modified:
  user/lstewart/alq_varlen_head/sys/kern/kern_alq.c

Modified: user/lstewart/alq_varlen_head/sys/kern/kern_alq.c
==============================================================================
--- user/lstewart/alq_varlen_head/sys/kern/kern_alq.c	Wed Mar 10 07:07:12 2010	(r204944)
+++ user/lstewart/alq_varlen_head/sys/kern/kern_alq.c	Wed Mar 10 07:25:16 2010	(r204945)
@@ -787,7 +787,6 @@ alq_load_handler(module_t mod, int what,
 	case MOD_SHUTDOWN:
 		break;
 
-	case MOD_UNLOAD:
 	case MOD_QUIESCE:
 		ALD_LOCK();
 		/* Only allow unload if there are no open queues. */
@@ -802,6 +801,12 @@ alq_load_handler(module_t mod, int what,
 		}
 		break;
 
+	case MOD_UNLOAD:
+		/* If MOD_QUIESCE failed we must fail here too. */
+		if (ald_shutingdown == 0)
+			ret = EBUSY;
+		break;
+
 	default:
 		ret = EINVAL;
 		break;

From owner-svn-src-user@FreeBSD.ORG  Wed Mar 10 07:49:18 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04806106564A;
	Wed, 10 Mar 2010 07:49: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 E73E58FC14;
	Wed, 10 Mar 2010 07:49: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 o2A7nHCm072510;
	Wed, 10 Mar 2010 07:49:17 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2A7nHxV072508;
	Wed, 10 Mar 2010 07:49:17 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003100749.o2A7nHxV072508@svn.freebsd.org>
From: Juli Mallett 
Date: Wed, 10 Mar 2010 07:49:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204946 - user/jmallett/octeon/gnu/usr.bin/cc
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Mar 2010 07:49:18 -0000

Author: jmallett
Date: Wed Mar 10 07:49:17 2010
New Revision: 204946
URL: http://svn.freebsd.org/changeset/base/204946

Log:
  If TARGET_CPUTYPE is set while building world, we have to set GCC's default ISA,
  or binutils will refuse to link things built as part of world with things compiled
  without specifying the right -march.

Modified:
  user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc

Modified: user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc
==============================================================================
--- user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc	Wed Mar 10 07:25:16 2010	(r204945)
+++ user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc	Wed Mar 10 07:49:17 2010	(r204946)
@@ -44,6 +44,30 @@ MIPS_ABI_DEFAULT=ABI_64
 .endif
 .endif
 
+# GCC by default takes the ISA from the ABI's requirements.  If world is built
+# with a superior ISA, since we lack multilib, we have to set the right
+# default ISA to be able to link against what's in /usr/lib.  Terrible stuff.
+.if defined(TARGET_CPUTYPE)
+.if ${TARGET_CPUTYPE} == "mips1"
+MIPS_ISA_DEFAULT=1
+.elif ${TARGET_CPUTYPE} == "mips2"
+MIPS_ISA_DEFAULT=2
+.elif ${TARGET_CPUTYPE} == "mips3"
+MIPS_ISA_DEFAULT=3
+.elif ${TARGET_CPUTYPE} == "mips4"
+MIPS_ISA_DEFAULT=4
+.elif ${TARGET_CPUTYPE} == "mips32"
+MIPS_ISA_DEFAULT=32
+.elif ${TARGET_CPUTYPE} == "mips32r2"
+MIPS_ISA_DEFAULT=32r2
+.elif ${TARGET_CPUTYPE} == "mips64"
+MIPS_ISA_DEFAULT=64
+.else
+# Let's hope from-abi is good enough.
+.endif
+CFLAGS += -DMIPS_ISA_DEFAULT=${MIPS_ISA_DEFAULT}
+.endif
+
 MIPS_ABI_DEFAULT?=ABI_32
 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
 .endif

From owner-svn-src-user@FreeBSD.ORG  Wed Mar 10 07:55:56 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 46737106566B;
	Wed, 10 Mar 2010 07:55: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 343BF8FC18;
	Wed, 10 Mar 2010 07:55: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 o2A7tuJO074040;
	Wed, 10 Mar 2010 07:55:56 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2A7tuYL074034;
	Wed, 10 Mar 2010 07:55:56 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003100755.o2A7tuYL074034@svn.freebsd.org>
From: Juli Mallett 
Date: Wed, 10 Mar 2010 07:55:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204947 - in user/jmallett/octeon: . sbin/newfs
	secure/libexec sys/conf sys/dev/mii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Mar 2010 07:55:56 -0000

Author: jmallett
Date: Wed Mar 10 07:55:55 2010
New Revision: 204947
URL: http://svn.freebsd.org/changeset/base/204947

Log:
  Merge build un-breakage from head.

Modified:
  user/jmallett/octeon/UPDATING
  user/jmallett/octeon/sbin/newfs/newfs.8
  user/jmallett/octeon/secure/libexec/Makefile
  user/jmallett/octeon/sys/conf/newvers.sh
  user/jmallett/octeon/sys/dev/mii/brgphy.c
Directory Properties:
  user/jmallett/octeon/   (props changed)
  user/jmallett/octeon/sys/contrib/x86emu/   (props changed)

Modified: user/jmallett/octeon/UPDATING
==============================================================================
--- user/jmallett/octeon/UPDATING	Wed Mar 10 07:49:17 2010	(r204946)
+++ user/jmallett/octeon/UPDATING	Wed Mar 10 07:55:55 2010	(r204947)
@@ -497,7 +497,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 
 20090313:
 	The k8temp(4) driver has been renamed to amdtemp(4) since
-	support for K10 and K11 CPU families was added.
+	support for Family 10 and Family 11 CPU families was added.
 
 20090309:
 	IGMPv3 and Source-Specific Multicast (SSM) have been merged
@@ -983,7 +983,7 @@ COMMON ITEMS:
 	mergemaster -p					[5]
 	make installworld
 	make delete-old
-	mergemaster					[4]
+	mergemaster -i					[4]
 	
 
 
@@ -1054,7 +1054,8 @@ COMMON ITEMS:
 	system.  Attempting to do it by hand is not recommended and those
 	that pursue this avenue should read this file carefully, as well
 	as the archives of freebsd-current and freebsd-hackers mailing lists
-	for potential gotchas.
+	for potential gotchas.  The -U option is also useful to consider.
+	See mergemaster(8) for more information.
 
 	[5] Usually this step is a noop.  However, from time to time
 	you may need to do this if you get unknown user in the following

Modified: user/jmallett/octeon/sbin/newfs/newfs.8
==============================================================================
--- user/jmallett/octeon/sbin/newfs/newfs.8	Wed Mar 10 07:49:17 2010	(r204946)
+++ user/jmallett/octeon/sbin/newfs/newfs.8	Wed Mar 10 07:55:55 2010	(r204947)
@@ -78,10 +78,10 @@ The following options define the general
 .It Fl E
 Erase the content of the disk before making the filesystem.
 The reserved area in front of the superblock (for bootcode) will not be erased.
-
+.Pp
 This is a relevant option for flash based storage devices that use
 wear levelling algorithms.
-
+.Pp
 NB: Erasing may take as long time as writing every sector on the disk.
 .It Fl J
 Enable journaling on the new file system via gjournal.

Modified: user/jmallett/octeon/secure/libexec/Makefile
==============================================================================
--- user/jmallett/octeon/secure/libexec/Makefile	Wed Mar 10 07:49:17 2010	(r204946)
+++ user/jmallett/octeon/secure/libexec/Makefile	Wed Mar 10 07:55:55 2010	(r204947)
@@ -4,7 +4,7 @@
 
 SUBDIR=
 .if ${MK_OPENSSH} != "no"
-SUBDIR+=sftp-server ssh-keysign ssh-pkcs11-helper
+SUBDIR+=sftp-server ssh-keysign
 .endif
 
 .include 

Modified: user/jmallett/octeon/sys/conf/newvers.sh
==============================================================================
--- user/jmallett/octeon/sys/conf/newvers.sh	Wed Mar 10 07:49:17 2010	(r204946)
+++ user/jmallett/octeon/sys/conf/newvers.sh	Wed Mar 10 07:55:55 2010	(r204947)
@@ -88,15 +88,15 @@ v=`cat version` u=${USER:-root} d=`pwd` 
 i=`${MAKE:-make} -V KERN_IDENT`
 
 case "$d" in
-*/compile/*)
+*/sys/*)
 	SRCDIR=${d##*obj}
 	if [ -n "$MACHINE" ]; then
 		SRCDIR=${SRCDIR##/$MACHINE}
 	fi
-	SRCDIR=$(cd ${SRCDIR%%/compile/*}/.. && pwd)
+	SRCDIR=${SRCDIR%%/sys/*}
 
 	for dir in /bin /usr/bin /usr/local/bin; do
-		if [ -d "${SRCDIR}/.svn" -a -x "${dir}/svnversion" ] ; then
+		if [ -d "${SRCDIR}/sys/.svn" -a -x "${dir}/svnversion" ] ; then
 			svnversion=${dir}/svnversion
 			break
 		fi
@@ -107,7 +107,7 @@ case "$d" in
 	done
 
 	if [ -n "$svnversion" ] ; then
-		svn=" r`cd ${SRCDIR} && $svnversion`"
+		svn=" r`cd ${SRCDIR}/sys && $svnversion`"
 	fi
 	if [ -n "$git_cmd" ] ; then
 		git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null`

Modified: user/jmallett/octeon/sys/dev/mii/brgphy.c
==============================================================================
--- user/jmallett/octeon/sys/dev/mii/brgphy.c	Wed Mar 10 07:49:17 2010	(r204946)
+++ user/jmallett/octeon/sys/dev/mii/brgphy.c	Wed Mar 10 07:55:55 2010	(r204947)
@@ -66,14 +66,17 @@ __FBSDID("$FreeBSD$");
 static int brgphy_probe(device_t);
 static int brgphy_attach(device_t);
 
+#define BCM5708S_BAD_CHIPID	0x57081021
+
 struct brgphy_softc {
 	struct mii_softc mii_sc;
 	int mii_oui;
 	int mii_model;
 	int mii_rev;
 	int serdes_flags;	/* Keeps track of the serdes type used */
-#define BRGPHY_5706S	0x0001
-#define BRGPHY_5708S	0x0002
+#define BRGPHY_5706S		0x0001
+#define BRGPHY_5708S		0x0002
+#define BRGPHY_NOANWAIT		0x0004
 	int bce_phy_flags;	/* PHY flags transferred from the MAC driver */
 };
 
@@ -291,6 +294,19 @@ brgphy_attach(device_t dev)
 		if (bce_sc && (bce_sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG)) {
 			ADD(IFM_MAKEWORD(IFM_ETHER, IFM_2500_SX, IFM_FDX, sc->mii_inst), 0);
 			printf("2500baseSX-FDX, ");
+		} else if ((bsc->serdes_flags & BRGPHY_5708S) && bce_sc &&
+		    (bce_sc->bce_chipid == BCM5708S_BAD_CHIPID)) {
+			/*
+			 * There appears to be certain silicon revision
+			 * usually used in blades that is having issues with
+			 * this driver wating for the auto-negotiation to
+			 * complete. This happens with a specific chip id
+			 * only and when the 1000baseSX-FDX is the only
+			 * mode. Workaround this issue since it's unlikely
+			 * to be ever addressed.
+			 */
+			printf("auto-neg workaround, ");
+			bsc->serdes_flags |= BRGPHY_NOANWAIT;
 		}
 	}
 
@@ -544,7 +560,8 @@ brgphy_status(struct mii_softc *sc)
 
 	/* Autoneg is still in progress. */
 	if ((bmcr & BRGPHY_BMCR_AUTOEN) &&
-	    (bmsr & BRGPHY_BMSR_ACOMP) == 0) {
+	    (bmsr & BRGPHY_BMSR_ACOMP) == 0 &&
+	    (bsc->serdes_flags & BRGPHY_NOANWAIT) == 0) {
 		/* Erg, still trying, I guess... */
 		mii->mii_media_active |= IFM_NONE;
 		goto brgphy_status_exit;

From owner-svn-src-user@FreeBSD.ORG  Wed Mar 10 21:42:05 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C557C106566B;
	Wed, 10 Mar 2010 21:42:05 +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 B5BA98FC16;
	Wed, 10 Mar 2010 21:42: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 o2ALg5WT069927;
	Wed, 10 Mar 2010 21:42:05 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2ALg5CG069924;
	Wed, 10 Mar 2010 21:42:05 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201003102142.o2ALg5CG069924@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 10 Mar 2010 21:42:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204982 - user/edwin/ncal
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Mar 2010 21:42:05 -0000

Author: edwin
Date: Wed Mar 10 21:42:05 2010
New Revision: 204982
URL: http://svn.freebsd.org/changeset/base/204982

Log:
  Move -d to -H.
  Use -d to select the current date.

Modified:
  user/edwin/ncal/ncal.1
  user/edwin/ncal/ncal.c

Modified: user/edwin/ncal/ncal.1
==============================================================================
--- user/edwin/ncal/ncal.1	Wed Mar 10 21:37:19 2010	(r204981)
+++ user/edwin/ncal/ncal.1	Wed Mar 10 21:42:05 2010	(r204982)
@@ -117,12 +117,6 @@ Britain and her colonies switched to the
 Print the number of the week below each week column.
 .It Fl y
 Display a calendar for the specified year.
-.It Fl b
-Switch to backwards compatibility mode (for debugging).
-.It Fl d Ar yyyy-mm-dd
-Use
-.Ar yyyy-mm-dd
-as the current date (for debugging of highlighting).
 .It Fl 3
 Display the previous, current and next month surrounding today.
 .It Fl A Ar number
@@ -133,6 +127,16 @@ of months after the current month.
 Display the
 .Ar number
 of months before the current month.
+.It Fl b
+Switch to backwards compatibility mode (for debugging).
+.It Fl d Ar yyyy-mm
+Use
+.Ar yyyy-mm
+as the current date (for debugging of date selection).
+.It Fl H Ar yyyy-mm-dd
+Use
+.Ar yyyy-mm-dd
+as the current date (for debugging of highlighting).
 .El
 .Pp
 A single parameter specifies the year (1\(en9999) to be displayed;

Modified: user/edwin/ncal/ncal.c
==============================================================================
--- user/edwin/ncal/ncal.c	Wed Mar 10 21:37:19 2010	(r204981)
+++ user/edwin/ncal/ncal.c	Wed Mar 10 21:42:05 2010	(r204982)
@@ -163,7 +163,7 @@ int	flag_nohighlight;	/* user doesn't wa
 int     flag_weeks;		/* user wants number of week */
 int     nswitch;		/* user defined switch date */
 int	nswitchb;		/* switch date for backward compatibility */
-int	today;
+int	highlightdate;
 
 char	*center(char *s, char *t, int w);
 wchar_t *wcenter(wchar_t *s, wchar_t *t, int w);
@@ -196,8 +196,7 @@ main(int argc, char *argv[])
 	int     flag_backward = 0;	/* user called cal--backward compat. */
 	int     flag_wholeyear = 0;	/* user wants the whole year */
 	int	flag_julian_cal = 0;	/* user wants Julian Calendar */
-	int     flag_julian_day = 0;	/* user wants the Julian day
-					 * numbers */
+	int     flag_julian_day = 0;	/* user wants the Julian day numbers */
 	int	flag_orthodox = 0;	/* user wants Orthodox easter */
 	int	flag_easter = 0;	/* user wants easter date */
 	int	flag_3months = 0;	/* user wants 3 month display (-3) */
@@ -207,8 +206,9 @@ main(int argc, char *argv[])
 	int	flag_givenmonth = 0;	/* user has specified month [n] */
 	int	flag_givenyear = 0;	/* user has specified year [n] */
 	char	*cp;			/* character pointer */
+	char	*flag_today = NULL;	/* debug: use date as being today */
 	char	*flag_month = NULL;	/* requested month as string */
-	char	*flag_highlightdate = NULL;
+	char	*flag_highlightdate = NULL; /* debug: date to highlight */
 	int	before, after;
 	const char    *locale;		/* locale to get country code */
 
@@ -256,7 +256,7 @@ main(int argc, char *argv[])
 
 	before = after = -1;
 
-	while ((ch = getopt(argc, argv, "A:B:3Jbd:ehjm:ops:wy")) != -1)
+	while ((ch = getopt(argc, argv, "A:B:3Jbd:eH:hjm:ops:wy")) != -1)
 		switch (ch) {
 		case '3':
 			flag_3months = 1;
@@ -287,6 +287,9 @@ main(int argc, char *argv[])
 			flag_backward = 1;
 			break;
 		case 'd':
+			flag_today = optarg;
+			break;
+		case 'H':
 			flag_highlightdate = optarg;
 			break;
 		case 'h':
@@ -362,7 +365,10 @@ main(int argc, char *argv[])
 		flag_givenyear = 1;
 		break;
 	case 0:
-		{
+		if (flag_today != NULL) {
+			y = strtol(flag_today, NULL, 10);
+			m = strtol(flag_today + 5, NULL, 10);
+		} else {
 			time_t t;
 			struct tm *tm;
 
@@ -443,6 +449,10 @@ main(int argc, char *argv[])
 		before = 1;
 		after = 1;
 	}
+	if (after == -1)
+		after = 0;
+	if (before == -1)
+		before = 0;
 
 	/* Highlight a specified day or today */
 	if (flag_highlightdate != NULL) {
@@ -459,7 +469,7 @@ main(int argc, char *argv[])
 		dt.m = tm1->tm_mon + 1;
 		dt.d = tm1->tm_mday;
 	}
-	today = sndaysb(&dt);
+	highlightdate = sndaysb(&dt);
 
 	if (flag_easter)
 		printeaster(y, flag_julian_cal, flag_orthodox);
@@ -480,7 +490,7 @@ usage(void)
 	    "       cal [-hj] [-m month] [year]\n"
 	    "       ncal [-hJjpwy] [-s country_code] [[month] year]\n"
 	    "       ncal [-hJeo] [year]\n"
-	    "for debug the highlighting: [-b] [-d yyyy-mm-dd]\n",
+	    "for debug the highlighting: [-b] [-H yyyy-mm-dd] [-d yyyy-mm]\n",
 	    stderr);
 	exit(EX_USAGE);
 }
@@ -791,7 +801,7 @@ mkmonthr(int y, int m, int jd_flag, stru
 					dt.d = j - jan1 + 1;
 				else
 					sdater(j, &dt);
-				if (j == today && !flag_nohighlight)
+				if (j == highlightdate && !flag_nohighlight)
 					highlight(mlines->lines[i] + k,
 					    ds + dt.d * dw, dw, &l);
 				else
@@ -895,7 +905,7 @@ mkmonthb(int y, int m, int jd_flag, stru
 					dt.d = j - jan1 + 1;
 				else
 					sdateb(j, &dt);
-				if (j == today && !flag_nohighlight)
+				if (j == highlightdate && !flag_nohighlight)
 					highlight(mlines->lines[i] + k,
 					    ds + dt.d * dw, dw, &l);
 				else

From owner-svn-src-user@FreeBSD.ORG  Wed Mar 10 22:10:36 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C099A1065692;
	Wed, 10 Mar 2010 22:10:36 +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 AFD828FC24;
	Wed, 10 Mar 2010 22:10: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 o2AMAa3T076475;
	Wed, 10 Mar 2010 22:10:36 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2AMAaKO076473;
	Wed, 10 Mar 2010 22:10:36 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201003102210.o2AMAaKO076473@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 10 Mar 2010 22:10:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204984 - user/edwin/ncal
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Mar 2010 22:10:36 -0000

Author: edwin
Date: Wed Mar 10 22:10:36 2010
New Revision: 204984
URL: http://svn.freebsd.org/changeset/base/204984

Log:
  Style police - update the comments in the code.

Modified:
  user/edwin/ncal/ncal.c

Modified: user/edwin/ncal/ncal.c
==============================================================================
--- user/edwin/ncal/ncal.c	Wed Mar 10 21:45:40 2010	(r204983)
+++ user/edwin/ncal/ncal.c	Wed Mar 10 22:10:36 2010	(r204984)
@@ -167,21 +167,21 @@ int	highlightdate;
 
 char	*center(char *s, char *t, int w);
 wchar_t *wcenter(wchar_t *s, wchar_t *t, int w);
+int	firstday(int y, int m);
+void	highlight(char *dst, char *src, int len, int *extraletters);
 void	mkmonthr(int year, int month, int jd_flag, struct monthlines * monthl);
 void	mkmonthb(int year, int month, int jd_flag, struct monthlines * monthl);
 void	mkweekdays(struct weekdays * wds);
+void	monthranger(int year, int m, int jd_flag, int before, int after);
+void	monthrangeb(int year, int m, int jd_flag, int before, int after);
 int	parsemonth(const char *s, int *m, int *y);
 void	printcc(void);
 void	printeaster(int year, int julian, int orthodox);
-int	firstday(int y, int m);
 date	*sdater(int ndays, struct date * d);
 date	*sdateb(int ndays, struct date * d);
 int	sndaysr(struct date * d);
 int	sndaysb(struct date * d);
 static void	usage(void);
-void	monthranger(int year, int jd_flag, int m, int before, int after);
-void	monthrangeb(int year, int jd_flag, int m, int before, int after);
-void	highlight(char *dst, char *src, int len, int *extraletters);
 
 int
 main(int argc, char *argv[])
@@ -391,40 +391,53 @@ main(int argc, char *argv[])
 	}
 
 	/*
-	 * What do we support and what do we not support
-	 * flag_3month, flag_before, flag_after
-	 * flag_givenyear, flag_givenmonth
-	 * 
+	 * What is not supported:
+	 * -3 with -A or -B
+	 *	-3 displays 3 months, -A and -B change that behaviour.
+	 * -3 with -y
+	 *	-3 displays 3 months, -y says display a whole year.
+	 * -3 with a given year but no given month or without -m
+	 *	-3 displays 3 months, no month specified doesn't make clear
+	 *      which three months.
+	 * -m with a given month
+	 *	conflicting arguments, both specify the same field.
+	 * -y with -m
+	 *	-y displays the whole year, -m displays a single month.
+	 * -y with a given month
+	 *	-y displays the whole year, the given month displays a single
+	 *	month.
+	 * -y with -A or -B
+	 *	-y displays the whole year, -A and -B display extra months.
 	 */
 
-	/* -3 together with -A or -B */
+	/* -3 together with -A or -B. */
 	if (flag_3months && (flag_after || flag_before))
 		errx(EX_USAGE, "-3 together with -A and -B is not supported.");
-	/* -3 together with -y */
+	/* -3 together with -y. */
 	if (flag_3months && flag_wholeyear)
 		errx(EX_USAGE, "-3 together with -y is not supported.");
-	/* -3 together with givenyear but no givenmonth */
+	/* -3 together with givenyear but no givenmonth. */
 	if (flag_3months && flag_givenyear &&
 	    !(flag_givenmonth || flag_specifiedmonth))
 		errx(EX_USAGE,
 		    "-3 together with a given year but no given month is "
 		    "not supported.");
-	/* -m together with xx xxxx */
+	/* -m together with xx xxxx. */
 	if (flag_specifiedmonth && flag_givenmonth)
 		errx(EX_USAGE,
 		    "-m together with a given month is not supported.");
-	/* -y together with -m */
+	/* -y together with -m. */
 	if (flag_wholeyear && flag_specifiedmonth)
 		errx(EX_USAGE, "-y together with -m is not supported.");
-	/* -y together with xx xxxx */
+	/* -y together with xx xxxx. */
 	if (flag_wholeyear && flag_givenmonth)
 		errx(EX_USAGE, "-y together a given month is not supported.");
-	/* -y together with -A or -B */
+	/* -y together with -A or -B. */
 	if (flag_wholeyear && (flag_before > 0 || flag_after > 0))
 		errx(EX_USAGE, "-y together a -A or -B is not supported.");
-	/* The rest should be fine */
+	/* The rest should be fine. */
 
-	/* Select the period to display, in order of increasing priority */
+	/* Select the period to display, in order of increasing priority .*/
 	if (flag_wholeyear ||
 	    (flag_givenyear && !(flag_givenmonth || flag_specifiedmonth))) {
 		m = 1;
@@ -454,7 +467,7 @@ main(int argc, char *argv[])
 	if (before == -1)
 		before = 0;
 
-	/* Highlight a specified day or today */
+	/* Highlight a specified day or today .*/
 	if (flag_highlightdate != NULL) {
 		dt.y = strtol(flag_highlightdate, NULL, 10);
 		dt.m = strtol(flag_highlightdate + 5, NULL, 10);
@@ -471,13 +484,14 @@ main(int argc, char *argv[])
 	}
 	highlightdate = sndaysb(&dt);
 
+	/* And now we finally start to calculate and output calendars. */
 	if (flag_easter)
 		printeaster(y, flag_julian_cal, flag_orthodox);
 	else
 		if (flag_backward)
-			monthrangeb(y, flag_julian_day, m, before, after);
+			monthrangeb(y, m, flag_julian_day, before, after);
 		else
-			monthranger(y, flag_julian_day, m, before, after);
+			monthranger(y, m, flag_julian_day, before, after);
 	return (0);
 }
 
@@ -495,7 +509,7 @@ usage(void)
 	exit(EX_USAGE);
 }
 
-/* print the assumed switches for all countries */
+/* Print the assumed switches for all countries. */
 void
 printcc(void)
 {
@@ -516,7 +530,7 @@ printcc(void)
 		printf(FSTR"\n", FSTRARG(p));
 }
 
-/* print the date of easter sunday */
+/* Print the date of easter sunday. */
 void
 printeaster(int y, int julian, int orthodox)
 {
@@ -561,8 +575,9 @@ printeaster(int y, int julian, int ortho
 #define	M2Y(m)	((m) / 12)
 #define	M2M(m)	(1 + (m) % 12) 
 
+/* Print all months for the period in the range [ before .. y-m .. after ]. */
 void
-monthrangeb(int y, int jd_flag, int m, int before, int after)
+monthrangeb(int y, int m, int jd_flag, int before, int after)
 {
 	struct monthlines year[12];
 	struct weekdays wds;
@@ -609,14 +624,14 @@ monthrangeb(int y, int jd_flag, int m, i
 		if (m != m1)
 			printf("\n");
 
-		/* Year at the top */
+		/* Year at the top. */
 		if (printyearheader && M2Y(m) != prevyear) {
 			sprintf(s, "%d", M2Y(m));
 			printf("%s\n", center(t, s, mpl * mw));
 			prevyear = M2Y(m);
 		}
 
-		/* Month names */
+		/* Month names. */
 		for (i = 0; i < count; i++)
 			if (printyearheader)
 				wprintf(L"%-*ls  ",
@@ -628,7 +643,7 @@ monthrangeb(int y, int jd_flag, int m, i
 			}
 		printf("\n");
 
-		/* Day of the week names */
+		/* Day of the week names. */
 		for (i = 0; i < count; i++) {
 			wprintf(L"%s%ls%s%ls%s%ls%s%ls%s%ls%s%ls%s%ls ",
 				wdss, wds.names[6], wdss, wds.names[0],
@@ -638,6 +653,7 @@ monthrangeb(int y, int jd_flag, int m, i
 		}
 		printf("\n");
 
+		/* And the days of the month. */
 		for (i = 0; i != 6; i++) {
 			for (j = 0; j < count; j++)
 				printf("%-*s  ",
@@ -651,7 +667,7 @@ monthrangeb(int y, int jd_flag, int m, i
 }
 
 void
-monthranger(int y, int jd_flag, int m, int before, int after)
+monthranger(int y, int m, int jd_flag, int before, int after)
 {
 	struct monthlines year[12];
 	struct weekdays wds;
@@ -691,18 +707,18 @@ monthranger(int y, int jd_flag, int m, i
 			count++;
 		}
 
-		/* Empty line between two rows of months */
+		/* Empty line between two rows of months. */
 		if (m != m1)
 			printf("\n");
 
-		/* Year at the top */
+		/* Year at the top. */
 		if (printyearheader && M2Y(m) != prevyear) {
 			sprintf(s, "%d", M2Y(m));
 			printf("%s\n", center(t, s, mpl * mw));
 			prevyear = M2Y(m);
 		}
 
-		/* Month names */
+		/* Month names. */
 		wprintf(L"    ");
 		for (i = 0; i < count; i++)
 			if (printyearheader)
@@ -712,6 +728,7 @@ monthranger(int y, int jd_flag, int m, i
 				    mw - wcslen(year[i].name) - 1, M2Y(m + i));
 		printf("\n");
 
+		/* And the days of the month. */
 		for (i = 0; i != 7; i++) {
 			/* Week day */
 			wprintf(L"%.2ls", wds.names[i]);
@@ -724,6 +741,7 @@ monthranger(int y, int jd_flag, int m, i
 			printf("\n");
 		}
 
+		/* Week numbers. */
 		if (flag_weeks) {
 			printf("  ");
 			for (i = 0; i < count; i++)
@@ -779,7 +797,7 @@ mkmonthr(int y, int m, int jd_flag, stru
 	 */
 	firstm = first - weekday(first);
 
-	/* Set ds (daystring) and dw (daywidth) according to the jd_flag */
+	/* Set ds (daystring) and dw (daywidth) according to the jd_flag. */
 	if (jd_flag) {
 		ds = jdaystr;
 		dw = 4;
@@ -814,7 +832,7 @@ mkmonthr(int y, int m, int jd_flag, stru
 		mlines->extralen[i] = l;
 	}
 
-	/* fill the weeknumbers */
+	/* fill the weeknumbers. */
 	if (flag_weeks) {
 		for (j = firstm, k = 0; j < last;  k += dw, j += 7)
 			if (j <= nswitch)
@@ -851,7 +869,7 @@ mkmonthb(int y, int m, int jd_flag, stru
 		dw = 3;
 	}
 
-	/* Set name of month centered */
+	/* Set name of month centered. */
 	memset(&tm, 0, sizeof(tm));
 	tm.tm_mon = m;
 	wcsftime(mlines->name, sizeof(mlines->name) / sizeof(mlines->name[0]),
@@ -922,7 +940,7 @@ mkmonthb(int y, int m, int jd_flag, stru
 	}
 }
 
-/* Put the local names of weekdays into the wds */
+/* Put the local names of weekdays into the wds. */
 void
 mkweekdays(struct weekdays *wds)
 {
@@ -948,9 +966,8 @@ mkweekdays(struct weekdays *wds)
 }
 
 /*
- * Compute the day number of the first
- * existing date after the first day in month.
- * (the first day in month and even the month might not exist!)
+ * Compute the day number of the first existing date after the first day in
+ * month. (the first day in month and even the month might not exist!)
  */
 int
 firstday(int y, int m)
@@ -1003,7 +1020,7 @@ sndaysb(struct date *d)
 		return (ndaysj(d));
 }
 
-/* Inverse of sndays */
+/* Inverse of sndays. */
 struct date *
 sdater(int nd, struct date *d)
 {
@@ -1014,7 +1031,7 @@ sdater(int nd, struct date *d)
 		return (jdate(nd, d));
 }
 
-/* Inverse of sndaysb */
+/* Inverse of sndaysb. */
 struct date *
 sdateb(int nd, struct date *d)
 {
@@ -1025,7 +1042,7 @@ sdateb(int nd, struct date *d)
 		return (jdate(nd, d));
 }
 
-/* Center string t in string s of length w by putting enough leading blanks */
+/* Center string t in string s of length w by putting enough leading blanks. */
 char *
 center(char *s, char *t, int w)
 {
@@ -1036,7 +1053,7 @@ center(char *s, char *t, int w)
 	return (s);
 }
 
-/* Center string t in string s of length w by putting enough leading blanks */
+/* Center string t in string s of length w by putting enough leading blanks. */
 wchar_t *
 wcenter(wchar_t *s, wchar_t *t, int w)
 {
@@ -1091,7 +1108,7 @@ highlight(char *dst, char *src, int len,
 
 		term_se = term_so = NULL;
 
-		/* On how to highlight on this type of terminal (if any) */
+		/* On how to highlight on this type of terminal (if any). */
 		if (isatty(STDOUT_FILENO) && tgetent(tbuf, NULL) == 1) {
 			b = cbuf;
 			term_so = tgetstr("so", &b);
@@ -1110,42 +1127,45 @@ highlight(char *dst, char *src, int len,
 		return;
 	}
 
-	/* If it is a real terminal, use the data from the termcap database. */
+	/*
+	 * If it is a real terminal, use the data from the termcap database.
+	 */
 	if (term_so != NULL && term_se != NULL) {
-		/* separator */
+		/* separator. */
 		dst[0] = ' ';
 		dst++;
-		/* highlight on */
+		/* highlight on. */
 		memcpy(dst, term_so, strlen(term_so));
 		dst += strlen(term_so);
-		/* the actual text (minus leading space) */
+		/* the actual text. (minus leading space) */
 		len--;
 		src++;
 		memcpy(dst, src, len);
 		dst += len;
-		/* highlight off */
+		/* highlight off. */
 		memcpy(dst, term_se, strlen(term_se));
 		*extralen = strlen(term_so) + strlen(term_se);
 		return;
 	}
 
 	/*
-	 * Otherwise, print a _, backspace and the letter
+	 * Otherwise, print a _, backspace and the letter.
 	 */
 	*extralen = 0;
-	/* skip leading space */
+	/* skip leading space. */
 	src++;
 	len--;
-	/* separator */
+	/* separator. */
 	dst[0] = ' ';
 	dst++;
 	while (len > 0) {
-		/* _ and backspace */
+		/* _ and backspace. */
 		memcpy(dst, "_\010", 2);
 		dst += 2;
 		*extralen += 2;
-		/* the character */
+		/* the character. */
 		*dst++ = *src++;
 		len--;
 	}
+	return;
 }

From owner-svn-src-user@FreeBSD.ORG  Wed Mar 10 22:33:32 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BAC74106564A;
	Wed, 10 Mar 2010 22:33:32 +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 AA7888FC1E;
	Wed, 10 Mar 2010 22:33: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 o2AMXWfZ081919;
	Wed, 10 Mar 2010 22:33:32 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2AMXW1V081917;
	Wed, 10 Mar 2010 22:33:32 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003102233.o2AMXW1V081917@svn.freebsd.org>
From: Juli Mallett 
Date: Wed, 10 Mar 2010 22:33:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204987 - user/jmallett/octeon/contrib/gcc/config/mips
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Mar 2010 22:33:32 -0000

Author: jmallett
Date: Wed Mar 10 22:33:32 2010
New Revision: 204987
URL: http://svn.freebsd.org/changeset/base/204987

Log:
  Don't set a default ISA like that.  The from-abi default is good enough and
  more correct.  This hopefully unbreaks my overriding of the default ISA based
  on the TARGET_CPUTYPE.

Modified:
  user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h

Modified: user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h
==============================================================================
--- user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h	Wed Mar 10 22:23:55 2010	(r204986)
+++ user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h	Wed Mar 10 22:33:32 2010	(r204987)
@@ -259,22 +259,18 @@ Boston, MA 02110-1301, USA.  */
 #if MIPS_ABI_DEFAULT == ABI_N32
 #define DRIVER_SELF_SPECS \
 	"%{!EB:%{!EL:%(endian_spec)}}", \
-	"%{!march=*: -march=mips64}",   \
 	"%{!mabi=*: -mabi=n32}"
 #elif MIPS_ABI_DEFAULT == ABI_64
 #define DRIVER_SELF_SPECS \
 	"%{!EB:%{!EL:%(endian_spec)}}", \
-	"%{!march=*: -march=mips64}",   \
 	"%{!mabi=*: -mabi=64}"
 #elif MIPS_ABI_DEFAULT == ABI_O64
 #define DRIVER_SELF_SPECS \
 	"%{!EB:%{!EL:%(endian_spec)}}", \
-	"%{!march=*: -march=mips64}",   \
 	"%{!mabi=*: -mabi=o64}"
 #else /* default to o32 */
 #define DRIVER_SELF_SPECS \
 	"%{!EB:%{!EL:%(endian_spec)}}", \
-	"%{!march=*: -march=mips32}",   \
 	"%{!mabi=*: -mabi=32}"
 #endif
 

From owner-svn-src-user@FreeBSD.ORG  Wed Mar 10 22:34:00 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 503241065672;
	Wed, 10 Mar 2010 22:34:00 +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 4004A8FC1F;
	Wed, 10 Mar 2010 22:34: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 o2AMY0Fn082052;
	Wed, 10 Mar 2010 22:34:00 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2AMY0Uf082050;
	Wed, 10 Mar 2010 22:34:00 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003102234.o2AMY0Uf082050@svn.freebsd.org>
From: Juli Mallett 
Date: Wed, 10 Mar 2010 22:34:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204988 - user/jmallett/octeon/gnu/usr.bin/cc
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Mar 2010 22:34:00 -0000

Author: jmallett
Date: Wed Mar 10 22:33:59 2010
New Revision: 204988
URL: http://svn.freebsd.org/changeset/base/204988

Log:
  Pass on TARGET_CPUTYPE as a string rather than trying to parse it.

Modified:
  user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc

Modified: user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc
==============================================================================
--- user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc	Wed Mar 10 22:33:32 2010	(r204987)
+++ user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc	Wed Mar 10 22:33:59 2010	(r204988)
@@ -44,32 +44,15 @@ MIPS_ABI_DEFAULT=ABI_64
 .endif
 .endif
 
+MIPS_ABI_DEFAULT?=ABI_32
+CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
+
 # GCC by default takes the ISA from the ABI's requirements.  If world is built
 # with a superior ISA, since we lack multilib, we have to set the right
 # default ISA to be able to link against what's in /usr/lib.  Terrible stuff.
 .if defined(TARGET_CPUTYPE)
-.if ${TARGET_CPUTYPE} == "mips1"
-MIPS_ISA_DEFAULT=1
-.elif ${TARGET_CPUTYPE} == "mips2"
-MIPS_ISA_DEFAULT=2
-.elif ${TARGET_CPUTYPE} == "mips3"
-MIPS_ISA_DEFAULT=3
-.elif ${TARGET_CPUTYPE} == "mips4"
-MIPS_ISA_DEFAULT=4
-.elif ${TARGET_CPUTYPE} == "mips32"
-MIPS_ISA_DEFAULT=32
-.elif ${TARGET_CPUTYPE} == "mips32r2"
-MIPS_ISA_DEFAULT=32r2
-.elif ${TARGET_CPUTYPE} == "mips64"
-MIPS_ISA_DEFAULT=64
-.else
-# Let's hope from-abi is good enough.
+CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\"
 .endif
-CFLAGS += -DMIPS_ISA_DEFAULT=${MIPS_ISA_DEFAULT}
-.endif
-
-MIPS_ABI_DEFAULT?=ABI_32
-CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
 .endif
 
 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 01:48:00 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 20577106564A;
	Thu, 11 Mar 2010 01:48:00 +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 E923A8FC14;
	Thu, 11 Mar 2010 01: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 o2B1lxqH024955;
	Thu, 11 Mar 2010 01:47:59 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2B1lxBS024953;
	Thu, 11 Mar 2010 01:47:59 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003110147.o2B1lxBS024953@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 01:47:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204993 - user/jmallett/octeon/contrib/gcc/config/mips
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 01:48:00 -0000

Author: jmallett
Date: Thu Mar 11 01:47:59 2010
New Revision: 204993
URL: http://svn.freebsd.org/changeset/base/204993

Log:
  Integrate MIPS_CPU_STRING_DEFAULT into DRIVER_SELF_SPECS so that we see it as
  an argument and can pass it to the assembler.  It'd be nice if the mips.h
  assembler and linker specs could take into account the CPU architecture as it
  may be intuited within GCC rather than having to do this.  This is so ugly.
  
  Then again, it's pretty stupid to refuse to link modules using the same ABI but
  different -march values.  Perhaps fixing binutils and undoing some of this is
  the right way to go.

Modified:
  user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h

Modified: user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h
==============================================================================
--- user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h	Thu Mar 11 01:35:38 2010	(r204992)
+++ user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h	Thu Mar 11 01:47:59 2010	(r204993)
@@ -255,23 +255,37 @@ Boston, MA 02110-1301, USA.  */
   while (0)
 
 /* Default ABI and ISA */
+/*
+ * XXX/juli
+ * Shouldn't this also be dependent on !mips*?
+ */
+#ifdef MIPS_CPU_STRING_DEFAULT
+#define DRIVER_SELF_ISA_SPEC	"{!march=*: -march=" MIPS_CPU_STRING_DEFAULT "}"
+#else
+#define	DRIVER_SELF_ISA_SPEC	"{!march=*: -march=from-abi}"
+#endif
+
 #undef DRIVER_SELF_SPECS
 #if MIPS_ABI_DEFAULT == ABI_N32
 #define DRIVER_SELF_SPECS \
 	"%{!EB:%{!EL:%(endian_spec)}}", \
-	"%{!mabi=*: -mabi=n32}"
+	"%{!mabi=*: -mabi=n32}", \
+	DRIVER_SELF_ISA_SPEC
 #elif MIPS_ABI_DEFAULT == ABI_64
 #define DRIVER_SELF_SPECS \
 	"%{!EB:%{!EL:%(endian_spec)}}", \
-	"%{!mabi=*: -mabi=64}"
+	"%{!mabi=*: -mabi=64}", \
+	DRIVER_SELF_ISA_SPEC
 #elif MIPS_ABI_DEFAULT == ABI_O64
 #define DRIVER_SELF_SPECS \
 	"%{!EB:%{!EL:%(endian_spec)}}", \
-	"%{!mabi=*: -mabi=o64}"
+	"%{!mabi=*: -mabi=o64}", \
+	DRIVER_SELF_ISA_SPEC
 #else /* default to o32 */
 #define DRIVER_SELF_SPECS \
 	"%{!EB:%{!EL:%(endian_spec)}}", \
-	"%{!mabi=*: -mabi=32}"
+	"%{!mabi=*: -mabi=32}", \
+	DRIVER_SELF_ISA_SPEC
 #endif
 
 #if 0

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 02:01:55 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E5FC106564A;
	Thu, 11 Mar 2010 02:01:55 +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 6D8F38FC1A;
	Thu, 11 Mar 2010 02:01: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 o2B21tL2028097;
	Thu, 11 Mar 2010 02:01:55 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2B21t0l028095;
	Thu, 11 Mar 2010 02:01:55 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003110201.o2B21t0l028095@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 02:01:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204995 - user/jmallett/octeon/contrib/gcc/config/mips
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 02:01:55 -0000

Author: jmallett
Date: Thu Mar 11 02:01:55 2010
New Revision: 204995
URL: http://svn.freebsd.org/changeset/base/204995

Log:
  Fix typo from pre-commit cleanup.  Pre-commit cleanups are always a bad idea.

Modified:
  user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h

Modified: user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h
==============================================================================
--- user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h	Thu Mar 11 01:48:25 2010	(r204994)
+++ user/jmallett/octeon/contrib/gcc/config/mips/freebsd.h	Thu Mar 11 02:01:55 2010	(r204995)
@@ -260,9 +260,9 @@ Boston, MA 02110-1301, USA.  */
  * Shouldn't this also be dependent on !mips*?
  */
 #ifdef MIPS_CPU_STRING_DEFAULT
-#define DRIVER_SELF_ISA_SPEC	"{!march=*: -march=" MIPS_CPU_STRING_DEFAULT "}"
+#define DRIVER_SELF_ISA_SPEC	"%{!march=*: -march=" MIPS_CPU_STRING_DEFAULT "}"
 #else
-#define	DRIVER_SELF_ISA_SPEC	"{!march=*: -march=from-abi}"
+#define	DRIVER_SELF_ISA_SPEC	"%{!march=*: -march=from-abi}"
 #endif
 
 #undef DRIVER_SELF_SPECS

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 08:30:05 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6FEBF106566B;
	Thu, 11 Mar 2010 08:30:05 +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 5FDF78FC08;
	Thu, 11 Mar 2010 08:30: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 o2B8U5vI014316;
	Thu, 11 Mar 2010 08:30:05 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2B8U5Vu014314;
	Thu, 11 Mar 2010 08:30:05 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003110830.o2B8U5Vu014314@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 08:30:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205004 - user/jmallett/octeon/sys/mips/cavium
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 08:30:05 -0000

Author: jmallett
Date: Thu Mar 11 08:30:05 2010
New Revision: 205004
URL: http://svn.freebsd.org/changeset/base/205004

Log:
  I would've expected the Octeon to have a double-counting timer as the code
  suggests, but at least on my CAM-0100 this seems to not be the case.  Pass 0
  to mips_timer_init_params for double_count instead of 1 -- now timings on my
  system match wall clock.
  
  The tick code really should be updated for 64-bit counter reads on the CPUs
  that support them -- I wonder if the t_delta wrongness is due to inaccuracy
  from the hand-rolled counter wrapping.

Modified:
  user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c

Modified: user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c	Thu Mar 11 08:03:56 2010	(r205003)
+++ user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c	Thu Mar 11 08:30:05 2010	(r205004)
@@ -760,7 +760,7 @@ platform_start(__register_t a0, __regist
 		kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger");
 #endif
 	platform_counter_freq = octeon_get_clock_rate();
-	mips_timer_init_params(platform_counter_freq, 1);
+	mips_timer_init_params(platform_counter_freq, 0);
 }
 
 /* impSTART: This stuff should move back into the Cavium SDK */

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 20:32:29 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 47166106566C;
	Thu, 11 Mar 2010 20:32:29 +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 37F498FC08;
	Thu, 11 Mar 2010 20:32: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 o2BKWT4J089156;
	Thu, 11 Mar 2010 20:32:29 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BKWTrG089154;
	Thu, 11 Mar 2010 20:32:29 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003112032.o2BKWTrG089154@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 20:32:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205025 - user/jmallett/octeon/sys/mips/mips
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 20:32:29 -0000

Author: jmallett
Date: Thu Mar 11 20:32:28 2010
New Revision: 205025
URL: http://svn.freebsd.org/changeset/base/205025

Log:
  I don't know that a critical section is required here, but if it is we really
  don't want to get interrupted between reading the counter and calculating the
  ticks.

Modified:
  user/jmallett/octeon/sys/mips/mips/tick.c

Modified: user/jmallett/octeon/sys/mips/mips/tick.c
==============================================================================
--- user/jmallett/octeon/sys/mips/mips/tick.c	Thu Mar 11 17:56:46 2010	(r205024)
+++ user/jmallett/octeon/sys/mips/mips/tick.c	Thu Mar 11 20:32:28 2010	(r205025)
@@ -117,8 +117,8 @@ tick_ticker(void)
 	 * from the time counter, so I'm not sure why all these hoops
 	 * are even necessary.
 	 */
-	ticktock = mips_rd_count();
 	critical_enter();
+	ticktock = mips_rd_count();
 	if (ticktock < counter_lower_last)
 		counter_upper++;
 	counter_lower_last = ticktock;

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 21:33:55 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 508CF1065670;
	Thu, 11 Mar 2010 21:33:55 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C71E8FC20;
	Thu, 11 Mar 2010 21:33:55 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id BA10546B66;
	Thu, 11 Mar 2010 16:33:54 -0500 (EST)
Date: Thu, 11 Mar 2010 21:33:54 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Juli Mallett 
In-Reply-To: <201003112032.o2BKWTrG089154@svn.freebsd.org>
Message-ID: 
References: <201003112032.o2BKWTrG089154@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: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: Re: svn commit: r205025 - user/jmallett/octeon/sys/mips/mips
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 21:33:55 -0000


On Thu, 11 Mar 2010, Juli Mallett wrote:

>  I don't know that a critical section is required here, but if it is we really
>  don't want to get interrupted between reading the counter and calculating the
>  ticks.

Will/does MIPS implement soft critical sections as an alternative to hard 
interrupt disabling, in which case will this change actually have the desired 
effect?  (Note that on i386/amd64, critical_enter can still be interrupted by 
fast interrupt handlers)

Robert

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 21:54:09 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C75AD1065670;
	Thu, 11 Mar 2010 21:54:09 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B7AE98FC1F;
	Thu, 11 Mar 2010 21:54: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 o2BLs9nc068216;
	Thu, 11 Mar 2010 21:54:09 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BLs9Vj068214;
	Thu, 11 Mar 2010 21:54:09 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003112154.o2BLs9Vj068214@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 21:54:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205037 - user/jmallett/octeon/sys/mips/cavium/dev/rgmii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 21:54:09 -0000

Author: jmallett
Date: Thu Mar 11 21:54:09 2010
New Revision: 205037
URL: http://svn.freebsd.org/changeset/base/205037

Log:
  Report media status.

Modified:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Thu Mar 11 21:50:36 2010	(r205036)
+++ user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Thu Mar 11 21:54:09 2010	(r205037)
@@ -1652,9 +1652,47 @@ static int octeon_rgmx_medchange (struct
 
 static void octeon_rgmx_medstat (struct ifnet *ifp, struct ifmediareq *ifm)
 {
-    /*
-     * No support for Media Status callback
-     */
+    	struct rgmx_softc_dev *sc = ifp->if_softc;
+	octeon_rgmx_rxx_rx_inbnd_t link_status;
+
+	octeon_rgmx_config_speed(sc->port, 1);
+
+	RGMX_LOCK(sc);
+
+	ifm->ifm_status = IFM_AVALID;
+	ifm->ifm_active = IFM_ETHER;
+
+	/*
+	 * Parse link status.
+	 */
+	link_status.word64 = sc->link_status;
+
+	if (!link_status.bits.status) {
+		RGMX_UNLOCK(sc);
+		return;
+	}
+
+	ifm->ifm_status |= IFM_ACTIVE;
+
+	switch (link_status.bits.speed) {
+	case 0:
+		ifm->ifm_active |= IFM_10_T;
+		break;
+	case 1:
+		ifm->ifm_active |= IFM_100_TX;
+		break;
+	case 2:
+		ifm->ifm_active |= IFM_1000_T;;
+		break;
+	default:
+		/* Unknown!  */
+		break;
+	}
+
+	/* Always full duplex.  */
+	ifm->ifm_active |= IFM_FDX;
+
+	RGMX_UNLOCK(sc);
 }
 
 static int octeon_rgmx_ioctl (struct ifnet * ifp, u_long command, caddr_t data)

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 22:01:49 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 108F7106566B;
	Thu, 11 Mar 2010 22:01:49 +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 E94018FC19;
	Thu, 11 Mar 2010 22:01: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 o2BM1mVg076005;
	Thu, 11 Mar 2010 22:01:48 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BM1m1H076003;
	Thu, 11 Mar 2010 22:01:48 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003112201.o2BM1m1H076003@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 22:01:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205041 - user/jmallett/octeon/sys/mips/cavium/dev/rgmii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 22:01:49 -0000

Author: jmallett
Date: Thu Mar 11 22:01:48 2010
New Revision: 205041
URL: http://svn.freebsd.org/changeset/base/205041

Log:
  Inline a function only referenced once and remove a comment about not calling
  that function from some place in the code.
  
  Make the ifinit function set the link status.  This fixes rgmx with the recent
  routing changes.

Modified:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Thu Mar 11 21:57:01 2010	(r205040)
+++ user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Thu Mar 11 22:01:48 2010	(r205041)
@@ -184,7 +184,6 @@ static u_int get_rgmx_port_ordinal(u_int
 static void octeon_rgmx_set_mac(u_int port);
 static void octeon_rgmx_init_sc(struct rgmx_softc_dev *sc, device_t dev, u_int port, u_int num_devices);
 static int octeon_rgmx_init_ifnet(struct rgmx_softc_dev *sc);
-static void octeon_rgmx_mark_ready(struct rgmx_softc_dev *sc);
 static void octeon_rgmx_stop(struct rgmx_softc_dev *sc);
 static void octeon_rgmx_config_speed(u_int port, u_int);
 #ifdef DEBUG_RGMX_DUMP
@@ -451,12 +450,6 @@ static int rgmii_attach (device_t dev)
                             	device_printf(dev, "  ifinit failed for rgmx port %u\n", port);
                                 return (ENOSPC);
                         }
-/*
- * Don't call octeon_rgmx_mark_ready()
- * ifnet will call it indirectly via  octeon_rgmx_init()
- *
- *                         octeon_rgmx_mark_ready(sc);
- */
                         num_devices++;
                 }
 	}
@@ -1770,17 +1763,16 @@ static int octeon_rgmx_ioctl (struct ifn
         return (error);
 }
 
-
-
-
-/*
- * octeon_rgmx_mark_ready
- *
- * Initialize the rgmx driver for this instance
- * Initialize device.
- */
-static void octeon_rgmx_mark_ready (struct rgmx_softc_dev *sc)
+static void  octeon_rgmx_init (void *xsc)
 {
+	struct rgmx_softc_dev *sc = xsc;
+	octeon_rgmx_rxx_rx_inbnd_t link_status;
+
+	/*
+	 * Called mostly from ifnet interface  ifp->if_init();
+	 * I think we can anchor most of our iniialization here and
+	 * not do it in different places  from driver_attach().
+	 */
 
         /* Enable interrupts.  */
     	/* For RGMX they are already enabled earlier */
@@ -1799,21 +1791,22 @@ static void octeon_rgmx_mark_ready (stru
 
         /* Kick start the output */
         /* Hopefully PKO is running and will pick up packets via the timer  or receive loop */
-}
 
+	/* Set link status.  */
+	octeon_rgmx_config_speed(sc->port, 0);
 
-static void  octeon_rgmx_init (void *xsc)
-{
+	RGMX_LOCK(sc);
+	/*
+	 * Parse link status.
+	 */
+	link_status.word64 = sc->link_status;
 
-    /*
-     * Called mostly from ifnet interface  ifp->if_init();
-     * I think we can anchor most of our iniialization here and
-     * not do it in different places  from driver_attach().
-     */
-    /*
-     * For now, we only mark the interface ready
-     */
-    octeon_rgmx_mark_ready((struct rgmx_softc_dev *) xsc);
+	if (link_status.bits.status) {
+		if_link_state_change(sc->ifp, LINK_STATE_UP);
+	} else {
+		if_link_state_change(sc->ifp, LINK_STATE_DOWN);
+	}
+	RGMX_UNLOCK(sc);
 }
 
 

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 22:11:25 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D4638106564A;
	Thu, 11 Mar 2010 22:11:25 +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 C0BB98FC15;
	Thu, 11 Mar 2010 22:11: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 o2BMBPI5085803;
	Thu, 11 Mar 2010 22:11:25 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BMBOev085752;
	Thu, 11 Mar 2010 22:11:24 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003112211.o2BMBOev085752@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 22:11:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205044 - in user/jmallett/octeon: . lib/libc/rpc
	lib/libc/sparc64/fpu lib/libc/stdio sbin/nos-tun
	secure/libexec secure/libexec/ssh-pkcs11-helper
	sys/amd64/amd64 sys/amd64/conf sys/amd...
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 22:11:25 -0000

Author: jmallett
Date: Thu Mar 11 22:11:24 2010
New Revision: 205044
URL: http://svn.freebsd.org/changeset/base/205044

Log:
  Merge from head.

Added:
  user/jmallett/octeon/secure/libexec/ssh-pkcs11-helper/Makefile
     - copied unchanged from r205041, head/secure/libexec/ssh-pkcs11-helper/Makefile
Modified:
  user/jmallett/octeon/UPDATING
  user/jmallett/octeon/lib/libc/rpc/Symbol.map
  user/jmallett/octeon/lib/libc/rpc/clnt_simple.c
  user/jmallett/octeon/lib/libc/rpc/getnetconfig.c
  user/jmallett/octeon/lib/libc/rpc/key_call.c
  user/jmallett/octeon/lib/libc/rpc/mt_misc.c
  user/jmallett/octeon/lib/libc/rpc/mt_misc.h
  user/jmallett/octeon/lib/libc/rpc/rpc_generic.c
  user/jmallett/octeon/lib/libc/rpc/rpc_soc.c
  user/jmallett/octeon/lib/libc/sparc64/fpu/fpu.c
  user/jmallett/octeon/lib/libc/sparc64/fpu/fpu_emu.h
  user/jmallett/octeon/lib/libc/stdio/findfp.c
  user/jmallett/octeon/lib/libc/stdio/local.h
  user/jmallett/octeon/lib/libc/stdio/snprintf.c
  user/jmallett/octeon/lib/libc/stdio/vasprintf.c
  user/jmallett/octeon/lib/libc/stdio/vdprintf.c
  user/jmallett/octeon/lib/libc/stdio/vfprintf.c
  user/jmallett/octeon/lib/libc/stdio/vsnprintf.c
  user/jmallett/octeon/lib/libc/stdio/vsprintf.c
  user/jmallett/octeon/lib/libc/stdio/vsscanf.c
  user/jmallett/octeon/lib/libc/stdio/vswprintf.c
  user/jmallett/octeon/lib/libc/stdio/vswscanf.c
  user/jmallett/octeon/lib/libc/stdio/xprintf.c
  user/jmallett/octeon/sbin/nos-tun/Makefile
  user/jmallett/octeon/sbin/nos-tun/nos-tun.c
  user/jmallett/octeon/secure/libexec/Makefile
  user/jmallett/octeon/sys/amd64/amd64/db_trace.c
  user/jmallett/octeon/sys/amd64/amd64/exception.S
  user/jmallett/octeon/sys/amd64/amd64/identcpu.c
  user/jmallett/octeon/sys/amd64/amd64/pmap.c
  user/jmallett/octeon/sys/amd64/amd64/vm_machdep.c
  user/jmallett/octeon/sys/amd64/conf/GENERIC
  user/jmallett/octeon/sys/amd64/conf/NOTES
  user/jmallett/octeon/sys/amd64/conf/XENHVM
  user/jmallett/octeon/sys/amd64/include/elf.h
  user/jmallett/octeon/sys/amd64/include/reg.h
  user/jmallett/octeon/sys/amd64/linux32/linux32_sysvec.c
  user/jmallett/octeon/sys/arm/arm/busdma_machdep.c
  user/jmallett/octeon/sys/arm/arm/identcpu.c
  user/jmallett/octeon/sys/arm/arm/vm_machdep.c
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32.h
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_misc.c
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_proto.h
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_syscall.h
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_syscalls.c
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_sysent.c
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_util.h
  user/jmallett/octeon/sys/compat/freebsd32/syscalls.master
  user/jmallett/octeon/sys/compat/ia32/ia32_reg.h
  user/jmallett/octeon/sys/compat/ia32/ia32_sysvec.c
  user/jmallett/octeon/sys/conf/files.amd64
  user/jmallett/octeon/sys/conf/files.ia64
  user/jmallett/octeon/sys/conf/options.amd64
  user/jmallett/octeon/sys/conf/options.i386
  user/jmallett/octeon/sys/conf/options.ia64
  user/jmallett/octeon/sys/dev/acpica/acpi_video.c
  user/jmallett/octeon/sys/dev/bge/if_bge.c
  user/jmallett/octeon/sys/dev/bwn/if_bwn.c
  user/jmallett/octeon/sys/dev/mii/brgphy.c
  user/jmallett/octeon/sys/dev/pci/vga_pci.c
  user/jmallett/octeon/sys/dev/siba/siba_core.c
  user/jmallett/octeon/sys/dev/usb/controller/usb_controller.c
  user/jmallett/octeon/sys/dev/usb/controller/uss820dci.c
  user/jmallett/octeon/sys/dev/usb/input/ukbd.c
  user/jmallett/octeon/sys/dev/usb/serial/uftdi.c
  user/jmallett/octeon/sys/dev/usb/serial/uvisor.c
  user/jmallett/octeon/sys/dev/usb/template/usb_template.c
  user/jmallett/octeon/sys/dev/usb/template/usb_template.h
  user/jmallett/octeon/sys/dev/usb/template/usb_template_mtp.c
  user/jmallett/octeon/sys/dev/usb/usb_device.c
  user/jmallett/octeon/sys/dev/usb/usb_device.h
  user/jmallett/octeon/sys/dev/usb/usb_generic.c
  user/jmallett/octeon/sys/dev/usb/usb_transfer.c
  user/jmallett/octeon/sys/dev/usb/usbdevs
  user/jmallett/octeon/sys/fs/nfsserver/nfs_nfsdport.c
  user/jmallett/octeon/sys/fs/procfs/procfs_dbregs.c
  user/jmallett/octeon/sys/fs/procfs/procfs_fpregs.c
  user/jmallett/octeon/sys/fs/procfs/procfs_ioctl.c
  user/jmallett/octeon/sys/fs/procfs/procfs_map.c
  user/jmallett/octeon/sys/fs/procfs/procfs_regs.c
  user/jmallett/octeon/sys/i386/conf/NOTES
  user/jmallett/octeon/sys/i386/i386/identcpu.c
  user/jmallett/octeon/sys/i386/i386/mp_machdep.c
  user/jmallett/octeon/sys/i386/i386/pmap.c
  user/jmallett/octeon/sys/i386/xen/mp_machdep.c
  user/jmallett/octeon/sys/ia64/conf/NOTES
  user/jmallett/octeon/sys/ia64/ia64/exception.S
  user/jmallett/octeon/sys/ia64/ia64/genassym.c
  user/jmallett/octeon/sys/ia64/ia64/machdep.c
  user/jmallett/octeon/sys/ia64/include/elf.h
  user/jmallett/octeon/sys/ia64/include/reg.h
  user/jmallett/octeon/sys/kern/imgact_elf.c
  user/jmallett/octeon/sys/kern/kern_jail.c
  user/jmallett/octeon/sys/kern/kern_ktr.c
  user/jmallett/octeon/sys/kern/kern_module.c
  user/jmallett/octeon/sys/kern/kern_thr.c
  user/jmallett/octeon/sys/kern/kern_umtx.c
  user/jmallett/octeon/sys/kern/sys_generic.c
  user/jmallett/octeon/sys/kern/sys_process.c
  user/jmallett/octeon/sys/kern/uipc_socket.c
  user/jmallett/octeon/sys/kern/vfs_aio.c
  user/jmallett/octeon/sys/kern/vfs_syscalls.c
  user/jmallett/octeon/sys/mips/include/kdb.h
  user/jmallett/octeon/sys/mips/include/smp.h
  user/jmallett/octeon/sys/mips/mips/db_trace.c
  user/jmallett/octeon/sys/mips/mips/mp_machdep.c
  user/jmallett/octeon/sys/mips/mips/swtch.S
  user/jmallett/octeon/sys/modules/linux/Makefile
  user/jmallett/octeon/sys/modules/procfs/Makefile
  user/jmallett/octeon/sys/net/if_tap.c
  user/jmallett/octeon/sys/net/route.h
  user/jmallett/octeon/sys/netinet/ipfw/ip_dn_glue.c
  user/jmallett/octeon/sys/netinet/ipfw/ip_fw_sockopt.c
  user/jmallett/octeon/sys/sys/pcpu.h
  user/jmallett/octeon/sys/sys/pioctl.h
  user/jmallett/octeon/sys/sys/ptrace.h
  user/jmallett/octeon/usr.bin/perror/perror.1
  user/jmallett/octeon/usr.bin/script/script.c
  user/jmallett/octeon/usr.bin/truss/amd64-fbsd.c
  user/jmallett/octeon/usr.bin/truss/amd64-fbsd32.c
  user/jmallett/octeon/usr.bin/truss/amd64-linux32.c
  user/jmallett/octeon/usr.bin/truss/extern.h
  user/jmallett/octeon/usr.bin/truss/i386-fbsd.c
  user/jmallett/octeon/usr.bin/truss/i386-linux.c
  user/jmallett/octeon/usr.bin/truss/ia64-fbsd.c
  user/jmallett/octeon/usr.bin/truss/main.c
  user/jmallett/octeon/usr.bin/truss/mips-fbsd.c
  user/jmallett/octeon/usr.bin/truss/powerpc-fbsd.c
  user/jmallett/octeon/usr.bin/truss/setup.c
  user/jmallett/octeon/usr.bin/truss/sparc64-fbsd.c
  user/jmallett/octeon/usr.bin/truss/syscalls.c
  user/jmallett/octeon/usr.bin/truss/truss.h
Directory Properties:
  user/jmallett/octeon/   (props changed)
  user/jmallett/octeon/sys/contrib/x86emu/   (props changed)

Modified: user/jmallett/octeon/UPDATING
==============================================================================
--- user/jmallett/octeon/UPDATING	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/UPDATING	Thu Mar 11 22:11:24 2010	(r205044)
@@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20100311:
+	The kernel option COMPAT_IA32 has been replaced with COMPAT_FREEBSD32
+	to allow 32-bit compatibility on non-x86 platforms. All kernel
+	configurations on amd64 and ia64 platforms using these options must
+	be modified accordingly.
+
 20100113:
 	The utmp user accounting database has been replaced with utmpx,
 	the user accounting interface standardized by POSIX.

Modified: user/jmallett/octeon/lib/libc/rpc/Symbol.map
==============================================================================
--- user/jmallett/octeon/lib/libc/rpc/Symbol.map	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/rpc/Symbol.map	Thu Mar 11 22:11:24 2010	(r205044)
@@ -239,10 +239,6 @@ FBSDprivate_1.0 {
 	__key_encryptsession_pk_LOCAL;
 	__key_decryptsession_pk_LOCAL;
 	__key_gendes_LOCAL;
-	__tsd_lock;	/*
-			 * Why does usr.bin/rpcinfo/Makefile need rpc_generic.c?
-			 * Remove this hack if rpcinfo stops building with it.
-			 */
 	__svc_clean_idle;
 	__rpc_gss_unwrap;
 	__rpc_gss_unwrap_stub;

Modified: user/jmallett/octeon/lib/libc/rpc/clnt_simple.c
==============================================================================
--- user/jmallett/octeon/lib/libc/rpc/clnt_simple.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/rpc/clnt_simple.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -76,7 +76,11 @@ struct rpc_call_private {
 	char	nettype[NETIDLEN];	/* Network type */
 };
 static struct rpc_call_private *rpc_call_private_main;
+static thread_key_t rpc_call_key;
+static once_t rpc_call_once = ONCE_INITIALIZER;
+static int rpc_call_key_error;
 
+static void rpc_call_key_init(void);
 static void rpc_call_destroy(void *);
 
 static void
@@ -91,6 +95,13 @@ rpc_call_destroy(void *vp)
 	}
 }
 
+static void
+rpc_call_key_init(void)
+{
+
+	rpc_call_key_error = thr_keycreate(&rpc_call_key, rpc_call_destroy);
+}
+
 /*
  * This is the simplified interface to the client rpc layer.
  * The client handle is not destroyed here and is reused for
@@ -112,17 +123,16 @@ rpc_call(host, prognum, versnum, procnum
 	struct rpc_call_private *rcp = (struct rpc_call_private *) 0;
 	enum clnt_stat clnt_stat;
 	struct timeval timeout, tottimeout;
-	static thread_key_t rpc_call_key;
 	int main_thread = 1;
 
 	if ((main_thread = thr_main())) {
 		rcp = rpc_call_private_main;
 	} else {
-		if (rpc_call_key == 0) {
-			mutex_lock(&tsd_lock);
-			if (rpc_call_key == 0)
-				thr_keycreate(&rpc_call_key, rpc_call_destroy);
-			mutex_unlock(&tsd_lock);
+		if (thr_once(&rpc_call_once, rpc_call_key_init) != 0 ||
+		    rpc_call_key_error != 0) {
+			rpc_createerr.cf_stat = RPC_SYSTEMERROR;
+			rpc_createerr.cf_error.re_errno = rpc_call_key_error;
+			return (rpc_createerr.cf_stat);
 		}
 		rcp = (struct rpc_call_private *)thr_getspecific(rpc_call_key);
 	}

Modified: user/jmallett/octeon/lib/libc/rpc/getnetconfig.c
==============================================================================
--- user/jmallett/octeon/lib/libc/rpc/getnetconfig.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/rpc/getnetconfig.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -130,21 +130,29 @@ static struct netconfig *dup_ncp(struct 
 
 
 static FILE *nc_file;		/* for netconfig db */
-static pthread_mutex_t nc_file_lock = PTHREAD_MUTEX_INITIALIZER;
+static mutex_t nc_file_lock = MUTEX_INITIALIZER;
 
 static struct netconfig_info	ni = { 0, 0, NULL, NULL};
-static pthread_mutex_t ni_lock = PTHREAD_MUTEX_INITIALIZER;
+static mutex_t ni_lock = MUTEX_INITIALIZER;
 
+static thread_key_t nc_key;
+static once_t nc_once = ONCE_INITIALIZER;
+static int nc_key_error;
+
+static void
+nc_key_init(void)
+{
+
+	nc_key_error = thr_keycreate(&nc_key, free);
+}
 
 #define MAXNETCONFIGLINE    1000
 
 static int *
 __nc_error()
 {
-	static pthread_mutex_t nc_lock = PTHREAD_MUTEX_INITIALIZER;
-	static thread_key_t nc_key = 0;
 	static int nc_error = 0;
-	int error, *nc_addr;
+	int *nc_addr;
 
 	/*
 	 * Use the static `nc_error' if we are the main thread
@@ -153,15 +161,8 @@ __nc_error()
 	 */
 	if (thr_main())
 		return (&nc_error);
-	if (nc_key == 0) {
-		error = 0;
-		mutex_lock(&nc_lock);
-		if (nc_key == 0)
-			error = thr_keycreate(&nc_key, free);
-		mutex_unlock(&nc_lock);
-		if (error)
-			return (&nc_error);
-	}
+	if (thr_once(&nc_once, nc_key_init) != 0 || nc_key_error != 0)
+		return (&nc_error);
 	if ((nc_addr = (int *)thr_getspecific(nc_key)) == NULL) {
 		nc_addr = (int *)malloc(sizeof (int));
 		if (thr_setspecific(nc_key, (void *) nc_addr) != 0) {

Modified: user/jmallett/octeon/lib/libc/rpc/key_call.c
==============================================================================
--- user/jmallett/octeon/lib/libc/rpc/key_call.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/rpc/key_call.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -279,6 +279,9 @@ struct  key_call_private {
 	uid_t	uid;		/* user-id at last authorization */
 };
 static struct key_call_private *key_call_private_main = NULL;
+static thread_key_t key_call_key;
+static once_t key_call_once = ONCE_INITIALIZER;
+static int key_call_key_error;
 
 static void
 key_call_destroy(void *vp)
@@ -292,6 +295,13 @@ key_call_destroy(void *vp)
 	}
 }
 
+static void
+key_call_init(void)
+{
+
+	key_call_key_error = thr_keycreate(&key_call_key, key_call_destroy);
+}
+
 /*
  * Keep the handle cached.  This call may be made quite often.
  */
@@ -307,7 +317,6 @@ int	vers;
 	struct utsname u;
 	int main_thread;
 	int fd;
-	static thread_key_t key_call_key;
 
 #define	TOTAL_TIMEOUT	30	/* total timeout talking to keyserver */
 #define	TOTAL_TRIES	5	/* Number of tries */
@@ -315,12 +324,9 @@ int	vers;
 	if ((main_thread = thr_main())) {
 		kcp = key_call_private_main;
 	} else {
-		if (key_call_key == 0) {
-			mutex_lock(&tsd_lock);
-			if (key_call_key == 0)
-				thr_keycreate(&key_call_key, key_call_destroy);
-			mutex_unlock(&tsd_lock);
-		}
+		if (thr_once(&key_call_once, key_call_init) != 0 ||
+		    key_call_key_error != 0)
+			return ((CLIENT *) NULL);
 		kcp = (struct key_call_private *)thr_getspecific(key_call_key);
 	}	
 	if (kcp == (struct key_call_private *)NULL) {

Modified: user/jmallett/octeon/lib/libc/rpc/mt_misc.c
==============================================================================
--- user/jmallett/octeon/lib/libc/rpc/mt_misc.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/rpc/mt_misc.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$");
 #define	proglst_lock		__proglst_lock
 #define	rpcsoc_lock		__rpcsoc_lock
 #define	svcraw_lock		__svcraw_lock
-#define	tsd_lock		__tsd_lock
 #define	xprtlist_lock		__xprtlist_lock
 
 /* protects the services list (svc.c) */
@@ -76,33 +75,33 @@ pthread_mutex_t	rpcsoc_lock = PTHREAD_MU
 /* svc_raw.c serialization */
 pthread_mutex_t	svcraw_lock = PTHREAD_MUTEX_INITIALIZER;
 
-/* protects TSD key creation */
-pthread_mutex_t	tsd_lock = PTHREAD_MUTEX_INITIALIZER;
-
 /* xprtlist (svc_generic.c) */
 pthread_mutex_t	xprtlist_lock = PTHREAD_MUTEX_INITIALIZER;
 
 #undef	rpc_createerr
 
 struct rpc_createerr rpc_createerr;
+static thread_key_t rce_key;
+static once_t rce_once = ONCE_INITIALIZER;
+static int rce_key_error;
+
+static void
+rce_key_init(void)
+{
+
+	rce_key_error = thr_keycreate(&rce_key, free);
+}
 
 struct rpc_createerr *
 __rpc_createerr()
 {
-	static thread_key_t rce_key = 0;
 	struct rpc_createerr *rce_addr = 0;
 
 	if (thr_main())
 		return (&rpc_createerr);
-	if ((rce_addr =
-	    (struct rpc_createerr *)thr_getspecific(rce_key)) != 0) {
-		mutex_lock(&tsd_lock);
-		if (thr_keycreate(&rce_key, free) != 0) {
-			mutex_unlock(&tsd_lock);
-			return (&rpc_createerr);
-		}
-		mutex_unlock(&tsd_lock);
-	}
+	if (thr_once(&rce_once, rce_key_init) != 0 || rce_key_error != 0)
+		return (&rpc_createerr);
+	rce_addr = (struct rpc_createerr *)thr_getspecific(rce_key);
 	if (!rce_addr) {
 		rce_addr = (struct rpc_createerr *)
 			malloc(sizeof (struct rpc_createerr));

Modified: user/jmallett/octeon/lib/libc/rpc/mt_misc.h
==============================================================================
--- user/jmallett/octeon/lib/libc/rpc/mt_misc.h	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/rpc/mt_misc.h	Thu Mar 11 22:11:24 2010	(r205044)
@@ -42,7 +42,6 @@
 #define	proglst_lock		__proglst_lock
 #define	rpcsoc_lock		__rpcsoc_lock
 #define	svcraw_lock		__svcraw_lock
-#define	tsd_lock		__tsd_lock
 #define	xprtlist_lock		__xprtlist_lock
 
 extern pthread_rwlock_t	svc_lock;

Modified: user/jmallett/octeon/lib/libc/rpc/rpc_generic.c
==============================================================================
--- user/jmallett/octeon/lib/libc/rpc/rpc_generic.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/rpc/rpc_generic.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -221,6 +221,18 @@ getnettype(nettype)
 	return (_rpctypelist[i].type);
 }
 
+static thread_key_t tcp_key, udp_key;
+static once_t keys_once = ONCE_INITIALIZER;
+static int tcp_key_error, udp_key_error;
+
+static void
+keys_init(void)
+{
+
+	tcp_key_error = thr_keycreate(&tcp_key, free);
+	udp_key_error = thr_keycreate(&udp_key, free);
+}
+
 /*
  * For the given nettype (tcp or udp only), return the first structure found.
  * This should be freed by calling freenetconfigent()
@@ -236,25 +248,15 @@ __rpc_getconfip(nettype)
 	static char *netid_udp_main;
 	struct netconfig *dummy;
 	int main_thread;
-	static thread_key_t tcp_key, udp_key;
 
 	if ((main_thread = thr_main())) {
 		netid_udp = netid_udp_main;
 		netid_tcp = netid_tcp_main;
 	} else {
-		if (tcp_key == 0) {
-			mutex_lock(&tsd_lock);
-			if (tcp_key == 0)
-				thr_keycreate(&tcp_key, free);
-			mutex_unlock(&tsd_lock);
-		}
+		if (thr_once(&keys_once, keys_init) != 0 ||
+		    tcp_key_error != 0 || udp_key_error != 0)
+			return (NULL);
 		netid_tcp = (char *)thr_getspecific(tcp_key);
-		if (udp_key == 0) {
-			mutex_lock(&tsd_lock);
-			if (udp_key == 0)
-				thr_keycreate(&udp_key, free);
-			mutex_unlock(&tsd_lock);
-		}
 		netid_udp = (char *)thr_getspecific(udp_key);
 	}
 	if (!netid_udp && !netid_tcp) {

Modified: user/jmallett/octeon/lib/libc/rpc/rpc_soc.c
==============================================================================
--- user/jmallett/octeon/lib/libc/rpc/rpc_soc.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/rpc/rpc_soc.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -360,6 +360,14 @@ registerrpc(prognum, versnum, procnum, p
  */
 static thread_key_t	clnt_broadcast_key;
 static resultproc_t	clnt_broadcast_result_main;
+static once_t		clnt_broadcast_once = ONCE_INITIALIZER;
+
+static void
+clnt_broadcast_key_init(void)
+{
+
+	thr_keycreate(&clnt_broadcast_key, free);
+}
 
 /*
  * Need to translate the netbuf address into sockaddr_in address.
@@ -402,12 +410,7 @@ clnt_broadcast(prog, vers, proc, xargs, 
 	if (thr_main())
 		clnt_broadcast_result_main = eachresult;
 	else {
-		if (clnt_broadcast_key == 0) {
-			mutex_lock(&tsd_lock);
-			if (clnt_broadcast_key == 0)
-				thr_keycreate(&clnt_broadcast_key, free);
-			mutex_unlock(&tsd_lock);
-		}
+		thr_once(&clnt_broadcast_once, clnt_broadcast_key_init);
 		thr_setspecific(clnt_broadcast_key, (void *) eachresult);
 	}
 	return rpc_broadcast((rpcprog_t)prog, (rpcvers_t)vers,

Modified: user/jmallett/octeon/lib/libc/sparc64/fpu/fpu.c
==============================================================================
--- user/jmallett/octeon/lib/libc/sparc64/fpu/fpu.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/sparc64/fpu/fpu.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -97,7 +97,7 @@ __FBSDID("$FreeBSD$");
 #define	X8(x) X4(x),X4(x)
 #define	X16(x) X8(x),X8(x)
 
-static char cx_to_trapx[] = {
+static const char cx_to_trapx[] = {
 	X1(FSR_NX),
 	X2(FSR_DZ),
 	X4(FSR_UF),
@@ -113,7 +113,8 @@ int __fpe_debug = 0;
 #endif
 #endif	/* FPU_DEBUG */
 
-static int __fpu_execute(struct utrapframe *, struct fpemu *, u_int32_t, u_long);
+static int __fpu_execute(struct utrapframe *, struct fpemu *, u_int32_t,
+    u_long);
 
 /*
  * Need to use an fpstate on the stack; we could switch, so we cannot safely
@@ -169,7 +170,7 @@ __fpu_exception(struct utrapframe *uf)
 void
 __fpu_dumpfpn(struct fpn *fp)
 {
-	static char *class[] = {
+	static const char *const class[] = {
 		"SNAN", "QNAN", "ZERO", "NUM", "INF"
 	};
 
@@ -181,15 +182,11 @@ __fpu_dumpfpn(struct fpn *fp)
 }
 #endif
 
-static int opmask[] = {0, 0, 1, 3};
+static const int opmask[] = {0, 0, 1, 3, 1};
 
 /* Decode 5 bit register field depending on the type. */
 #define	RN_DECODE(tp, rn) \
-	((tp == FTYPE_DBL || tp == FTYPE_EXT ? INSFPdq_RN((rn)) : (rn)) & \
-	    ~opmask[tp])
-
-/* Operand size in 32-bit registers. */
-#define	OPSZ(tp)	((tp) == FTYPE_LNG ? 2 : (1 << (tp)))
+	((tp) >= FTYPE_DBL ? INSFPdq_RN(rn) & ~opmask[tp] : (rn))
 
 /*
  * Helper for forming the below case statements. Build only the op3 and opf
@@ -209,8 +206,6 @@ static void
 __fpu_mov(struct fpemu *fe, int type, int rd, int rs2, u_int32_t nand,
     u_int32_t xor)
 {
-	u_int64_t tmp64;
-	int i;
 
 	if (type == FTYPE_INT || type == FTYPE_SNG)
 		__fpu_setreg(rd, (__fpu_getreg(rs2) & ~nand) ^ xor);
@@ -219,13 +214,10 @@ __fpu_mov(struct fpemu *fe, int type, in
 		 * Need to use the double versions to be able to access
 		 * the upper 32 fp registers.
 		 */
-		for (i = 0; i < OPSZ(type); i += 2, rd += 2, rs2 += 2) {
-			tmp64 = __fpu_getreg64(rs2);
-			if (i == 0)
-				tmp64 = (tmp64 & ~((u_int64_t)nand << 32)) ^
-				    ((u_int64_t)xor << 32);
-			__fpu_setreg64(rd, tmp64);
-		}
+		__fpu_setreg64(rd, (__fpu_getreg64(rs2) &
+		    ~((u_int64_t)nand << 32)) ^ ((u_int64_t)xor << 32));
+		if (type == FTYPE_EXT)
+			__fpu_setreg64(rd + 2, __fpu_getreg64(rs2 + 2));
 	}
 }
 
@@ -271,17 +263,17 @@ __fpu_cmpck(struct fpemu *fe)
  * multiply two integers this way.
  */
 static int
-__fpu_execute(struct utrapframe *uf, struct fpemu *fe, u_int32_t insn, u_long tstate)
+__fpu_execute(struct utrapframe *uf, struct fpemu *fe, u_int32_t insn,
+    u_long tstate)
 {
 	struct fpn *fp;
 	int opf, rs1, rs2, rd, type, mask, cx, cond;
 	u_long reg, fsr;
 	u_int space[4];
-	int i;
 
 	/*
 	 * `Decode' and execute instruction.  Start with no exceptions.
-	 * The type of any opf opcode is in the bottom two bits, so we
+	 * The type of almost any OPF opcode is in the bottom two bits, so we
 	 * squish them out here.
 	 */
 	opf = insn & (IF_MASK(IF_F3_OP3_SHIFT, IF_F3_OP3_BITS) |
@@ -359,7 +351,7 @@ __fpu_execute(struct utrapframe *uf, str
 		__fpu_explode(fe, &fe->fe_f2, type, rs2);
 		__fpu_compare(fe, 1, IF_F3_CC(insn));
 		return (__fpu_cmpck(fe));
-	case FOP(INS2_FPop1, INSFP1_FMOV):	/* these should all be pretty obvious */
+	case FOP(INS2_FPop1, INSFP1_FMOV):
 		__fpu_mov(fe, type, rd, rs2, 0, 0);
 		return (0);
 	case FOP(INS2_FPop1, INSFP1_FNEG):
@@ -410,6 +402,7 @@ __fpu_execute(struct utrapframe *uf, str
 	case FOP(INS2_FPop1, INSFP1_FxTOd):
 	case FOP(INS2_FPop1, INSFP1_FxTOq):
 		type = FTYPE_LNG;
+		rs2 = RN_DECODE(type, IF_F3_RS2(insn));
 		__fpu_explode(fe, fp = &fe->fe_f1, type, rs2);
 		/* sneaky; depends on instruction encoding */
 		type = (IF_F3_OPF(insn) >> 2) & 3;
@@ -418,8 +411,7 @@ __fpu_execute(struct utrapframe *uf, str
 	case FOP(INS2_FPop1, INSFP1_FTOx):
 		__fpu_explode(fe, fp = &fe->fe_f1, type, rs2);
 		type = FTYPE_LNG;
-		mask = 1;	/* needs 2 registers */
-		rd = IF_F3_RD(insn) & ~mask;
+		rd = RN_DECODE(type, IF_F3_RD(insn));
 		break;
 	case FOP(INS2_FPop1, INSFP1_FTOs):
 	case FOP(INS2_FPop1, INSFP1_FTOd):
@@ -457,10 +449,10 @@ __fpu_execute(struct utrapframe *uf, str
 	if (type == FTYPE_INT || type == FTYPE_SNG)
 		__fpu_setreg(rd, space[0]);
 	else {
-		for (i = 0; i < OPSZ(type); i += 2) {
-			__fpu_setreg64(rd + i, ((u_int64_t)space[i] << 32) |
-			    space[i + 1]);
-		}
+		__fpu_setreg64(rd, ((u_int64_t)space[0] << 32) | space[1]);
+		if (type == FTYPE_EXT)
+			__fpu_setreg64(rd + 2,
+			    ((u_int64_t)space[2] << 32) | space[3]);
 	}
 	return (0);	/* success */
 }

Modified: user/jmallett/octeon/lib/libc/sparc64/fpu/fpu_emu.h
==============================================================================
--- user/jmallett/octeon/lib/libc/sparc64/fpu/fpu_emu.h	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/sparc64/fpu/fpu_emu.h	Thu Mar 11 22:11:24 2010	(r205044)
@@ -140,7 +140,7 @@ struct fpn {
 #define	FTYPE_SNG	INSFP_s
 #define	FTYPE_DBL	INSFP_d
 #define	FTYPE_EXT	INSFP_q
-#define	FTYPE_LNG	-1
+#define	FTYPE_LNG	4
 
 /*
  * Emulator state.

Modified: user/jmallett/octeon/lib/libc/stdio/findfp.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/findfp.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/findfp.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -61,6 +61,7 @@ int	__sdidinit;
 	._read = __sread,		\
 	._seek = __sseek,		\
 	._write = __swrite,		\
+	._fl_mutex = PTHREAD_MUTEX_INITIALIZER, \
 }
 				/* the usual - (stdin + stdout + stderr) */
 static FILE usual[FOPEN_MAX - 3];
@@ -96,7 +97,7 @@ moreglue(n)
 	int n;
 {
 	struct glue *g;
-	static FILE empty;
+	static FILE empty = { ._fl_mutex = PTHREAD_MUTEX_INITIALIZER };
 	FILE *p;
 
 	g = (struct glue *)malloc(sizeof(*g) + ALIGNBYTES + n * sizeof(FILE));
@@ -154,7 +155,7 @@ found:
 	fp->_ub._size = 0;
 	fp->_lb._base = NULL;	/* no line buffer */
 	fp->_lb._size = 0;
-/*	fp->_lock = NULL; */	/* once set always set (reused) */
+/*	fp->_fl_mutex = NULL; */ /* once set always set (reused) */
 	fp->_orientation = 0;
 	memset(&fp->_mbstate, 0, sizeof(mbstate_t));
 	return (fp);

Modified: user/jmallett/octeon/lib/libc/stdio/local.h
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/local.h	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/local.h	Thu Mar 11 22:11:24 2010	(r205044)
@@ -110,6 +110,14 @@ extern int	__sdidinit;
 }
 
 /*
+ * Structure initializations for 'fake' FILE objects.
+ */
+#define	FAKE_FILE {				\
+	._file = -1,				\
+	._fl_mutex = PTHREAD_MUTEX_INITIALIZER, \
+}
+
+/*
  * Set the orientation for a stream. If o > 0, the stream has wide-
  * orientation. If o < 0, the stream has byte-orientation.
  */

Modified: user/jmallett/octeon/lib/libc/stdio/snprintf.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/snprintf.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/snprintf.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -48,7 +48,7 @@ snprintf(char * __restrict str, size_t n
 	size_t on;
 	int ret;
 	va_list ap;
-	FILE f;
+	FILE f = FAKE_FILE;
 
 	on = n;
 	if (n != 0)
@@ -56,12 +56,9 @@ snprintf(char * __restrict str, size_t n
 	if (n > INT_MAX)
 		n = INT_MAX;
 	va_start(ap, fmt);
-	f._file = -1;
 	f._flags = __SWR | __SSTR;
 	f._bf._base = f._p = (unsigned char *)str;
 	f._bf._size = f._w = n;
-	f._orientation = 0;
-	memset(&f._mbstate, 0, sizeof(mbstate_t));
 	ret = __vfprintf(&f, fmt, ap);
 	if (on > 0)
 		*f._p = '\0';

Modified: user/jmallett/octeon/lib/libc/stdio/vasprintf.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/vasprintf.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/vasprintf.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -42,9 +42,8 @@ vasprintf(str, fmt, ap)
 	__va_list ap;
 {
 	int ret;
-	FILE f;
+	FILE f = FAKE_FILE;
 
-	f._file = -1;
 	f._flags = __SWR | __SSTR | __SALC;
 	f._bf._base = f._p = (unsigned char *)malloc(128);
 	if (f._bf._base == NULL) {
@@ -53,8 +52,6 @@ vasprintf(str, fmt, ap)
 		return (-1);
 	}
 	f._bf._size = f._w = 127;		/* Leave room for the NUL */
-	f._orientation = 0;
-	memset(&f._mbstate, 0, sizeof(mbstate_t));
 	ret = __vfprintf(&f, fmt, ap);
 	if (ret < 0) {
 		free(f._bf._base);

Modified: user/jmallett/octeon/lib/libc/stdio/vdprintf.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/vdprintf.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/vdprintf.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
 int
 vdprintf(int fd, const char * __restrict fmt, va_list ap)
 {
-	FILE f;
+	FILE f = FAKE_FILE;
 	unsigned char buf[BUFSIZ];
 	int ret;
 
@@ -56,8 +56,6 @@ vdprintf(int fd, const char * __restrict
 	f._write = __swrite;
 	f._bf._base = buf;
 	f._bf._size = sizeof(buf);
-	f._orientation = 0;
-	bzero(&f._mbstate, sizeof(f._mbstate));
 
 	if ((ret = __vfprintf(&f, fmt, ap)) < 0)
 		return (ret);

Modified: user/jmallett/octeon/lib/libc/stdio/vfprintf.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/vfprintf.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/vfprintf.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -169,7 +169,7 @@ static int
 __sbprintf(FILE *fp, const char *fmt, va_list ap)
 {
 	int ret;
-	FILE fake;
+	FILE fake = FAKE_FILE;
 	unsigned char buf[BUFSIZ];
 
 	/* XXX This is probably not needed. */

Modified: user/jmallett/octeon/lib/libc/stdio/vsnprintf.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/vsnprintf.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/vsnprintf.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -47,7 +47,7 @@ vsnprintf(char * __restrict str, size_t 
 	size_t on;
 	int ret;
 	char dummy[2];
-	FILE f;
+	FILE f = FAKE_FILE;
 
 	on = n;
 	if (n != 0)
@@ -61,12 +61,9 @@ vsnprintf(char * __restrict str, size_t 
 		str = dummy;
 		n = 1;
 	}
-	f._file = -1;
 	f._flags = __SWR | __SSTR;
 	f._bf._base = f._p = (unsigned char *)str;
 	f._bf._size = f._w = n;
-	f._orientation = 0;
-	memset(&f._mbstate, 0, sizeof(mbstate_t));
 	ret = __vfprintf(&f, fmt, ap);
 	if (on > 0)
 		*f._p = '\0';

Modified: user/jmallett/octeon/lib/libc/stdio/vsprintf.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/vsprintf.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/vsprintf.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -44,14 +44,11 @@ int
 vsprintf(char * __restrict str, const char * __restrict fmt, __va_list ap)
 {
 	int ret;
-	FILE f;
+	FILE f = FAKE_FILE;
 
-	f._file = -1;
 	f._flags = __SWR | __SSTR;
 	f._bf._base = f._p = (unsigned char *)str;
 	f._bf._size = f._w = INT_MAX;
-	f._orientation = 0;
-	memset(&f._mbstate, 0, sizeof(mbstate_t));
 	ret = __vfprintf(&f, fmt, ap);
 	*f._p = 0;
 	return (ret);

Modified: user/jmallett/octeon/lib/libc/stdio/vsscanf.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/vsscanf.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/vsscanf.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -55,16 +55,11 @@ int
 vsscanf(const char * __restrict str, const char * __restrict fmt,
 	__va_list ap)
 {
-	FILE f;
+	FILE f = FAKE_FILE;
 
-	f._file = -1;
 	f._flags = __SRD;
 	f._bf._base = f._p = (unsigned char *)str;
 	f._bf._size = f._r = strlen(str);
 	f._read = eofread;
-	f._ub._base = NULL;
-	f._lb._base = NULL;
-	f._orientation = 0;
-	memset(&f._mbstate, 0, sizeof(mbstate_t));
 	return (__svfscanf(&f, fmt, ap));
 }

Modified: user/jmallett/octeon/lib/libc/stdio/vswprintf.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/vswprintf.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/vswprintf.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -45,7 +45,7 @@ vswprintf(wchar_t * __restrict s, size_t
 {
 	static const mbstate_t initial;
 	mbstate_t mbs;
-	FILE f;
+	FILE f = FAKE_FILE;
 	char *mbp;
 	int ret, sverrno;
 	size_t nwc;
@@ -55,7 +55,6 @@ vswprintf(wchar_t * __restrict s, size_t
 		return (-1);
 	}
 
-	f._file = -1;
 	f._flags = __SWR | __SSTR | __SALC;
 	f._bf._base = f._p = (unsigned char *)malloc(128);
 	if (f._bf._base == NULL) {
@@ -63,8 +62,6 @@ vswprintf(wchar_t * __restrict s, size_t
 		return (-1);
 	}
 	f._bf._size = f._w = 127;		/* Leave room for the NUL */
-	f._orientation = 0;
-	memset(&f._mbstate, 0, sizeof(mbstate_t));
 	ret = __vfwprintf(&f, fmt, ap);
 	if (ret < 0) {
 		sverrno = errno;

Modified: user/jmallett/octeon/lib/libc/stdio/vswscanf.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/vswscanf.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/vswscanf.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -62,7 +62,7 @@ vswscanf(const wchar_t * __restrict str,
 {
 	static const mbstate_t initial;
 	mbstate_t mbs;
-	FILE f;
+	FILE f = FAKE_FILE;
 	char *mbstr;
 	size_t mlen;
 	int r;
@@ -80,15 +80,10 @@ vswscanf(const wchar_t * __restrict str,
 		free(mbstr);
 		return (EOF);
 	}
-	f._file = -1;
 	f._flags = __SRD;
 	f._bf._base = f._p = (unsigned char *)mbstr;
 	f._bf._size = f._r = mlen;
 	f._read = eofread;
-	f._ub._base = NULL;
-	f._lb._base = NULL;
-	f._orientation = 0;
-	memset(&f._mbstate, 0, sizeof(mbstate_t));
 	r = __vfwscanf(&f, fmt, ap);
 	free(mbstr);
 

Modified: user/jmallett/octeon/lib/libc/stdio/xprintf.c
==============================================================================
--- user/jmallett/octeon/lib/libc/stdio/xprintf.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/lib/libc/stdio/xprintf.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -48,6 +48,7 @@
 #include 
 #include "un-namespace.h"
 
+#include "local.h"
 #include "printf.h"
 #include "fvwrite.h"
 
@@ -575,7 +576,7 @@ static int
 __v3printf(FILE *fp, const char *fmt, int pct, va_list ap)
 {
 	int ret;
-	FILE fake;
+	FILE fake = FAKE_FILE;
 	unsigned char buf[BUFSIZ];
 
 	/* copy the important variables */

Modified: user/jmallett/octeon/sbin/nos-tun/Makefile
==============================================================================
--- user/jmallett/octeon/sbin/nos-tun/Makefile	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sbin/nos-tun/Makefile	Thu Mar 11 22:11:24 2010	(r205044)
@@ -1,8 +1,8 @@
 # $FreeBSD$
 
 PROG=	nos-tun
-WARNS?=	0
 MAN=	nos-tun.8
+WARNS?=	3
 
 .include 
 

Modified: user/jmallett/octeon/sbin/nos-tun/nos-tun.c
==============================================================================
--- user/jmallett/octeon/sbin/nos-tun/nos-tun.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sbin/nos-tun/nos-tun.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -89,7 +89,8 @@ int tun;                          /* tun
 
 static void usage(void);
 
-int Set_address(char *addr, struct sockaddr_in *sin)
+static int
+Set_address(char *addr, struct sockaddr_in *sin)
 {
   struct hostent *hp;
 
@@ -107,15 +108,16 @@ int Set_address(char *addr, struct socka
   return 0;
 }
 
-int tun_open(char *devname, struct sockaddr *ouraddr, char *theiraddr)
+static int
+tun_open(char *dev_name, struct sockaddr *ouraddr, char *theiraddr)
 {
   int s;
   struct sockaddr_in *sin;
 
   /* Open tun device */
-  tun = open (devname, O_RDWR);
+  tun = open(dev_name, O_RDWR);
   if (tun < 0) {
-    syslog(LOG_ERR,"can't open %s - %m",devname);
+    syslog(LOG_ERR,"can't open %s - %m", dev_name);
     return(1);
   }
 
@@ -125,8 +127,8 @@ int tun_open(char *devname, struct socka
   bzero((char *)&ifra, sizeof(ifra));
   bzero((char *)&ifrq, sizeof(ifrq));
 
-  strncpy(ifrq.ifr_name, devname+5, IFNAMSIZ);
-  strncpy(ifra.ifra_name, devname+5, IFNAMSIZ);
+  strncpy(ifrq.ifr_name, dev_name+5, IFNAMSIZ);
+  strncpy(ifra.ifra_name, dev_name+5, IFNAMSIZ);
 
   s = socket(AF_INET, SOCK_DGRAM, 0);
   if (s < 0) {
@@ -189,7 +191,8 @@ tunc_return:
   return(1);
 }
 
-void Finish(int signum)
+static void
+Finish(int signum)
 {
   int s;
 
@@ -238,7 +241,7 @@ int main (int argc, char **argv)
 {
   int  c, len, ipoff;
 
-  char *devname = NULL;
+  char *dev_name = NULL;
   char *point_to = NULL;
   char *to_point = NULL;
   char *target;
@@ -268,7 +271,7 @@ int main (int argc, char **argv)
       point_to = optarg;
       break;
     case 't':
-      devname = optarg;
+      dev_name = optarg;
       break;
     case 'p':
       protocol = optarg;
@@ -278,7 +281,7 @@ int main (int argc, char **argv)
   argc -= optind;
   argv += optind;
 
-  if ((argc != 1 && argc != 2) || (devname == NULL) ||
+  if ((argc != 1 && argc != 2) || (dev_name == NULL) ||
       (point_to == NULL) || (to_point == NULL)) {
     usage();
   }
@@ -302,7 +305,7 @@ int main (int argc, char **argv)
     exit(2);
   }
 
-  if(tun_open(devname, &t_laddr, to_point)) {
+  if(tun_open(dev_name, &t_laddr, to_point)) {
     closelog();
     exit(3);
   }
@@ -386,7 +389,7 @@ int main (int argc, char **argv)
 }
 
 static void
-usage()
+usage(void)
 {
 	fprintf(stderr,
 "usage: nos-tun -t tunnel -s source -d destination -p protocol_number [source] target\n");

Modified: user/jmallett/octeon/secure/libexec/Makefile
==============================================================================
--- user/jmallett/octeon/secure/libexec/Makefile	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/secure/libexec/Makefile	Thu Mar 11 22:11:24 2010	(r205044)
@@ -4,7 +4,7 @@
 
 SUBDIR=
 .if ${MK_OPENSSH} != "no"
-SUBDIR+=sftp-server ssh-keysign
+SUBDIR+=sftp-server ssh-keysign ssh-pkcs11-helper
 .endif
 
 .include 

Copied: user/jmallett/octeon/secure/libexec/ssh-pkcs11-helper/Makefile (from r205041, head/secure/libexec/ssh-pkcs11-helper/Makefile)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jmallett/octeon/secure/libexec/ssh-pkcs11-helper/Makefile	Thu Mar 11 22:11:24 2010	(r205044, copy of r205041, head/secure/libexec/ssh-pkcs11-helper/Makefile)
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+PROG=	ssh-pkcs11-helper
+SRCS=	ssh-pkcs11.c ssh-pkcs11-helper.c
+SRCS+=	roaming_dummy.c
+MAN=	ssh-pkcs11-helper.8
+CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
+
+DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD=	-lssh -lcrypt -lcrypto -lz
+
+.include 
+
+.PATH:	${SSHDIR}
+
+${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h

Modified: user/jmallett/octeon/sys/amd64/amd64/db_trace.c
==============================================================================
--- user/jmallett/octeon/sys/amd64/amd64/db_trace.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sys/amd64/amd64/db_trace.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -319,7 +319,7 @@ db_nextframe(struct amd64_frame **fp, db
 			frame_type = INTERRUPT;
 		else if (strcmp(name, "Xfast_syscall") == 0)
 			frame_type = SYSCALL;
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
 		else if (strcmp(name, "Xint0x80_syscall") == 0)
 			frame_type = SYSCALL;
 #endif

Modified: user/jmallett/octeon/sys/amd64/amd64/exception.S
==============================================================================
--- user/jmallett/octeon/sys/amd64/amd64/exception.S	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sys/amd64/amd64/exception.S	Thu Mar 11 22:11:24 2010	(r205044)
@@ -572,7 +572,7 @@ ENTRY(fork_trampoline)
  * included.
  */
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
 	.data
 	.p2align 4
 	.text

Modified: user/jmallett/octeon/sys/amd64/amd64/identcpu.c
==============================================================================
--- user/jmallett/octeon/sys/amd64/amd64/identcpu.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sys/amd64/amd64/identcpu.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -187,7 +187,9 @@ printcpuinfo(void)
 	if (cpu_vendor_id == CPU_VENDOR_INTEL ||
 	    cpu_vendor_id == CPU_VENDOR_AMD ||
 	    cpu_vendor_id == CPU_VENDOR_CENTAUR) {
-		printf("  Stepping = %u", cpu_id & 0xf);
+		printf("  Family = %x", CPUID_TO_FAMILY(cpu_id));
+		printf("  Model = %x", CPUID_TO_MODEL(cpu_id));
+		printf("  Stepping = %u", cpu_id & CPUID_STEPPING);
 		if (cpu_high > 0) {
 
 			/*

Modified: user/jmallett/octeon/sys/amd64/amd64/pmap.c
==============================================================================
--- user/jmallett/octeon/sys/amd64/amd64/pmap.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sys/amd64/amd64/pmap.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -1105,7 +1105,8 @@ pmap_invalidate_cache_range(vm_offset_t 
 
 	if (cpu_feature & CPUID_SS)
 		; /* If "Self Snoop" is supported, do nothing. */
-	else if (cpu_feature & CPUID_CLFSH) {
+	else if ((cpu_feature & CPUID_CLFSH) != 0 &&
+		 eva - sva < 2 * 1024 * 1024) {
 
 		/*
 		 * Otherwise, do per-cache line flush.  Use the mfence
@@ -1122,7 +1123,8 @@ pmap_invalidate_cache_range(vm_offset_t 
 
 		/*
 		 * No targeted cache flush methods are supported by CPU,
-		 * globally invalidate cache as a last resort.
+		 * or the supplied range is bigger then 2MB.
+		 * Globally invalidate cache.
 		 */
 		pmap_invalidate_cache();
 	}

Modified: user/jmallett/octeon/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- user/jmallett/octeon/sys/amd64/amd64/vm_machdep.c	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sys/amd64/amd64/vm_machdep.c	Thu Mar 11 22:11:24 2010	(r205044)
@@ -439,7 +439,7 @@ cpu_set_upcall_kse(struct thread *td, vo
 	 */
 	cpu_thread_clean(td);
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
 	if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
 		/*
 	 	 * Set the trap frame to point at the beginning of the uts
@@ -490,7 +490,7 @@ cpu_set_user_tls(struct thread *td, void
 	if ((u_int64_t)tls_base >= VM_MAXUSER_ADDRESS)
 		return (EINVAL);
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
 	if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
 		td->td_pcb->pcb_gsbase = (register_t)tls_base;
 		return (0);

Modified: user/jmallett/octeon/sys/amd64/conf/GENERIC
==============================================================================
--- user/jmallett/octeon/sys/amd64/conf/GENERIC	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sys/amd64/conf/GENERIC	Thu Mar 11 22:11:24 2010	(r205044)
@@ -45,7 +45,7 @@ options 	PSEUDOFS		# Pseudo-filesystem f
 options 	GEOM_PART_GPT		# GUID Partition Tables.
 options 	GEOM_LABEL		# Provides labelization
 options 	COMPAT_43TTY		# BSD 4.3 TTY compat (sgtty)
-options 	COMPAT_IA32		# Compatible with i386 binaries
+options 	COMPAT_FREEBSD32	# Compatible with i386 binaries
 options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
 options 	COMPAT_FREEBSD5		# Compatible with FreeBSD5
 options 	COMPAT_FREEBSD6		# Compatible with FreeBSD6

Modified: user/jmallett/octeon/sys/amd64/conf/NOTES
==============================================================================
--- user/jmallett/octeon/sys/amd64/conf/NOTES	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sys/amd64/conf/NOTES	Thu Mar 11 22:11:24 2010	(r205044)
@@ -483,7 +483,7 @@ options 	PMAP_SHPGPERPROC=201
 #XXX these 32 bit binaries is added.
 
 # Enable 32-bit runtime support for FreeBSD/i386 binaries.
-options 	COMPAT_IA32
+options 	COMPAT_FREEBSD32
 
 # Enable iBCS2 runtime support for SCO and ISC binaries
 #XXX#options 	IBCS2
@@ -494,7 +494,7 @@ options 	COMPAT_IA32
 # Enable Linux ABI emulation
 #XXX#options 	COMPAT_LINUX
 
-# Enable 32-bit Linux ABI emulation (requires COMPAT_43 and COMPAT_IA32)
+# Enable 32-bit Linux ABI emulation (requires COMPAT_43 and COMPAT_FREEBSD32)
 options 	COMPAT_LINUX32
 
 # Enable the linux-like proc filesystem support (requires COMPAT_LINUX32

Modified: user/jmallett/octeon/sys/amd64/conf/XENHVM
==============================================================================
--- user/jmallett/octeon/sys/amd64/conf/XENHVM	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sys/amd64/conf/XENHVM	Thu Mar 11 22:11:24 2010	(r205044)
@@ -46,7 +46,7 @@ options 	PSEUDOFS		# Pseudo-filesystem f
 options 	GEOM_PART_GPT		# GUID Partition Tables.
 options 	GEOM_LABEL		# Provides labelization
 options 	COMPAT_43TTY		# BSD 4.3 TTY compat (sgtty)
-options 	COMPAT_IA32		# Compatible with i386 binaries
+options 	COMPAT_FREEBSD32	# Compatible with i386 binaries
 options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
 options 	COMPAT_FREEBSD5		# Compatible with FreeBSD5
 options 	COMPAT_FREEBSD6		# Compatible with FreeBSD6

Modified: user/jmallett/octeon/sys/amd64/include/elf.h
==============================================================================
--- user/jmallett/octeon/sys/amd64/include/elf.h	Thu Mar 11 22:09:21 2010	(r205043)
+++ user/jmallett/octeon/sys/amd64/include/elf.h	Thu Mar 11 22:11:24 2010	(r205044)

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

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 22:13:17 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 618301065672;
	Thu, 11 Mar 2010 22:13:17 +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 51EE48FC1B;
	Thu, 11 Mar 2010 22:13: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 o2BMDHNd087714;
	Thu, 11 Mar 2010 22:13:17 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BMDHEp087711;
	Thu, 11 Mar 2010 22:13:17 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003112213.o2BMDHEp087711@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 22:13:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205045 - user/jmallett/octeon/sys/mips/cavium/dev/rgmii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 22:13:17 -0000

Author: jmallett
Date: Thu Mar 11 22:13:16 2010
New Revision: 205045
URL: http://svn.freebsd.org/changeset/base/205045

Log:
  Remove a silly comment, remove gratuitous braces.
  
  Suggested by:	imp

Modified:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Thu Mar 11 22:11:24 2010	(r205044)
+++ user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Thu Mar 11 22:13:16 2010	(r205045)
@@ -1768,12 +1768,6 @@ static void  octeon_rgmx_init (void *xsc
 	struct rgmx_softc_dev *sc = xsc;
 	octeon_rgmx_rxx_rx_inbnd_t link_status;
 
-	/*
-	 * Called mostly from ifnet interface  ifp->if_init();
-	 * I think we can anchor most of our iniialization here and
-	 * not do it in different places  from driver_attach().
-	 */
-
         /* Enable interrupts.  */
     	/* For RGMX they are already enabled earlier */
 
@@ -1801,11 +1795,10 @@ static void  octeon_rgmx_init (void *xsc
 	 */
 	link_status.word64 = sc->link_status;
 
-	if (link_status.bits.status) {
+	if (link_status.bits.status)
 		if_link_state_change(sc->ifp, LINK_STATE_UP);
-	} else {
+	else
 		if_link_state_change(sc->ifp, LINK_STATE_DOWN);
-	}
 	RGMX_UNLOCK(sc);
 }
 

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 22:14:07 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C58451065670;
	Thu, 11 Mar 2010 22:14:07 +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 B5AAA8FC0C;
	Thu, 11 Mar 2010 22:14: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 o2BME79U088557;
	Thu, 11 Mar 2010 22:14:07 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BME7lG088551;
	Thu, 11 Mar 2010 22:14:07 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003112214.o2BME7lG088551@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 22:14:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205046 - user/jmallett/octeon/sys/mips/cavium/dev/rgmii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 22:14:07 -0000

Author: jmallett
Date: Thu Mar 11 22:14:07 2010
New Revision: 205046
URL: http://svn.freebsd.org/changeset/base/205046

Log:
  Remove use of typestr.

Modified:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Thu Mar 11 22:13:16 2010	(r205045)
+++ user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Thu Mar 11 22:14:07 2010	(r205046)
@@ -136,9 +136,6 @@ struct rgmx_softc_dev {
 	u_int			idx;
         u_char                  ieee[6];
 
-#if 0
-        char const * typestr;   /* printable name of the interface.  */
-#endif
         u_short txb_size;       /* size of TX buffer, in bytes  */
 
         /* Transmission buffer management.  */
@@ -350,10 +347,6 @@ static int octeon_rgmx_init_ifnet (struc
         ifmedia_set(&sc->media, bit2media[0]);
 
         ether_ifattach(sc->ifp, sc->ieee);
-        /* Print additional info when attached.  */
-#if 0
-        device_printf(sc->sc_dev, "type %s, full duplex\n", sc->typestr);
-#endif
 
         return (0);
 }

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 22:44:01 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5CA75106566B;
	Thu, 11 Mar 2010 22:44:01 +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 320BB8FC08;
	Thu, 11 Mar 2010 22:44: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 o2BMi1eV018146;
	Thu, 11 Mar 2010 22:44:01 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BMi14r018144;
	Thu, 11 Mar 2010 22:44:01 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003112244.o2BMi14r018144@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 22:44:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205051 - user/jmallett/octeon/sys/mips/include
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 22:44:01 -0000

Author: jmallett
Date: Thu Mar 11 22:44:00 2010
New Revision: 205051
URL: http://svn.freebsd.org/changeset/base/205051

Log:
  Add my copyright.  This file seems to consist of my cpufunc.h and pefo's pio.h.

Modified:
  user/jmallett/octeon/sys/mips/include/cpufunc.h

Modified: user/jmallett/octeon/sys/mips/include/cpufunc.h
==============================================================================
--- user/jmallett/octeon/sys/mips/include/cpufunc.h	Thu Mar 11 22:42:33 2010	(r205050)
+++ user/jmallett/octeon/sys/mips/include/cpufunc.h	Thu Mar 11 22:44:00 2010	(r205051)
@@ -1,5 +1,29 @@
 /*	$OpenBSD: pio.h,v 1.2 1998/09/15 10:50:12 pefo Exp $	*/
 
+/*-
+ * Copyright (c) 2002-2004 Juli Mallett.  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.
+ */
 /*
  * Copyright (c) 1995-1999 Per Fogelstrom.  All rights reserved.
  *

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 23:05:14 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E2C5106564A;
	Thu, 11 Mar 2010 23:05:14 +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 3D5F08FC20;
	Thu, 11 Mar 2010 23:05: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 o2BN5EST038467;
	Thu, 11 Mar 2010 23:05:14 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BN5EFq038465;
	Thu, 11 Mar 2010 23:05:14 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003112305.o2BN5EFq038465@svn.freebsd.org>
From: Juli Mallett 
Date: Thu, 11 Mar 2010 23:05:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205052 - user/jmallett/octeon/sys/mips/cavium
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 23:05:14 -0000

Author: jmallett
Date: Thu Mar 11 23:05:13 2010
New Revision: 205052
URL: http://svn.freebsd.org/changeset/base/205052

Log:
  o) Use standard interrupt disable/restore functions.
  o) Spell __func__ properly.

Modified:
  user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c

Modified: user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c	Thu Mar 11 22:44:00 2010	(r205051)
+++ user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c	Thu Mar 11 23:05:13 2010	(r205052)
@@ -111,25 +111,6 @@ platform_reset(void)
 	oct_write64(OCTEON_CIU_SOFT_RST, 1);
 }
 
-
-static inline uint32_t
-octeon_disable_interrupts(void)
-{
-	uint32_t status_bits;
-
-	status_bits = mips_rd_status();
-	mips_wr_status(status_bits & ~MIPS_SR_INT_IE);
-	return (status_bits);
-}
-
-
-static inline void
-octeon_set_interrupts(uint32_t status_bits)
-{
-	mips_wr_status(status_bits);
-}
-
-
 void
 octeon_led_write_char(int char_position, char val)
 {
@@ -315,7 +296,7 @@ octeon_wait_uart_flush(int uart_index, u
 	if (uart_index < 0 || uart_index > 1)
 		return;
 
-	cpu_status_bits = octeon_disable_interrupts();
+	cpu_status_bits = intr_disable();
 	/* Force Flush the IOBus */
 	oct_read64(OCTEON_MIO_BOOT_BIST_STAT);
 	for (val3 = 0xfffffffff; val3 > 0; val3--) {
@@ -323,7 +304,7 @@ octeon_wait_uart_flush(int uart_index, u
 		if (((uint8_t) val) & LSR_TEMT)
 			break;
 	}
-	octeon_set_interrupts(cpu_status_bits);
+	intr_restore(cpu_status_bits);
 }
 
 
@@ -450,17 +431,17 @@ ciu_get_en_reg_addr_new(int corenum, int
 	/* XXX kasserts? */
 	if (enx < CIU_EN_0 || enx > CIU_EN_1) {
 		printf("%s: invalid enx value %d, should be %d or %d\n",
-		    __FUNCTION__, enx, CIU_EN_0, CIU_EN_1);
+		    __func__, enx, CIU_EN_0, CIU_EN_1);
 		return 0;
 	}
 	if (intx < CIU_INT_0 || intx > CIU_INT_1) {
 		printf("%s: invalid intx value %d, should be %d or %d\n",
-		    __FUNCTION__, enx, CIU_INT_0, CIU_INT_1);
+		    __func__, enx, CIU_INT_0, CIU_INT_1);
 		return 0;
 	}
 	if (ciu_ip < CIU_MIPS_IP2 || ciu_ip > CIU_MIPS_IP3) {
 		printf("%s: invalid ciu_ip value %d, should be %d or %d\n",
-		    __FUNCTION__, ciu_ip, CIU_MIPS_IP2, CIU_MIPS_IP3);
+		    __func__, ciu_ip, CIU_MIPS_IP2, CIU_MIPS_IP3);
 		return 0;
 	}
 
@@ -517,7 +498,7 @@ ciu_clear_int_summary(int core_num, int 
 	    core_num, intx, enx, write_bits);
 #endif
 
-	cpu_status_bits = octeon_disable_interrupts();
+	cpu_status_bits = intr_disable();
 
 	ciu_intr_sum_reg_addr = ciu_get_intr_sum_reg_addr(core_num, intx, enx);
 
@@ -535,7 +516,7 @@ ciu_clear_int_summary(int core_num, int 
         printf(" Readback: 0x%llX\n\n   ", (uint64_t) oct_read64(ciu_intr_sum_reg_addr));
 #endif
     
-	octeon_set_interrupts(cpu_status_bits);
+	intr_restore(cpu_status_bits);
 }
 
 /*
@@ -550,7 +531,7 @@ ciu_disable_intr(int core_num, int intx,
 	if (core_num == CIU_THIS_CORE)
         	core_num = octeon_get_core_num();
 
-	cpu_status_bits = octeon_disable_interrupts();
+	cpu_status_bits = intr_disable();
     
 	ciu_intr_reg_addr = ciu_get_intr_en_reg_addr(core_num, intx, enx);
 
@@ -559,7 +540,7 @@ ciu_disable_intr(int core_num, int intx,
 	oct_write64(ciu_intr_reg_addr, 0LL);
 	oct_read64(OCTEON_MIO_BOOT_BIST_STAT);	/* Bus Barrier */
 
-	octeon_set_interrupts(cpu_status_bits);
+	intr_restore(cpu_status_bits);
 }
 
 void
@@ -580,7 +561,7 @@ ciu_dump_interrutps_enabled(int core_num
 #endif
 
         if (!ciu_intr_reg_addr) {
-            printf("Bad call to %s\n", __FUNCTION__);
+            printf("Bad call to %s\n", __func__);
             while(1);
             return;
         }
@@ -612,7 +593,7 @@ void ciu_enable_interrupts(int core_num,
 	    core_num, intx, enx, ciu_ip, set_these_interrupt_bits);
 #endif
 
-	cpu_status_bits = octeon_disable_interrupts();
+	cpu_status_bits = intr_disable();
 
 #ifndef OCTEON_SMP_1
 	ciu_intr_reg_addr = ciu_get_intr_en_reg_addr(core_num, intx, enx);
@@ -621,7 +602,7 @@ void ciu_enable_interrupts(int core_num,
 #endif
 
         if (!ciu_intr_reg_addr) {
-		printf("Bad call to %s\n", __FUNCTION__);
+		printf("Bad call to %s\n", __func__);
 		while(1);
 		return;	/* XXX */
         }
@@ -644,7 +625,7 @@ void ciu_enable_interrupts(int core_num,
 	    (uint64_t)oct_read64(ciu_intr_reg_addr));
 #endif
 
-	octeon_set_interrupts(cpu_status_bits);
+	intr_restore(cpu_status_bits);
 }
 
 unsigned long

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 23:27:17 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B476106566B;
	Thu, 11 Mar 2010 23:27:17 +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 E443F8FC0C;
	Thu, 11 Mar 2010 23:27: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 o2BNRGtT059799;
	Thu, 11 Mar 2010 23:27:16 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BNRGtr059796;
	Thu, 11 Mar 2010 23:27:16 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201003112327.o2BNRGtr059796@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 11 Mar 2010 23:27:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205053 - in user/kmacy/head_page_lock/sys:
	amd64/include vm
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 23:27:17 -0000

Author: kmacy
Date: Thu Mar 11 23:27:16 2010
New Revision: 205053
URL: http://svn.freebsd.org/changeset/base/205053

Log:
  alias page lock to page queue lock for architectures with pmaps without page lock

Modified:
  user/kmacy/head_page_lock/sys/amd64/include/vmparam.h
  user/kmacy/head_page_lock/sys/vm/vm_page.h

Modified: user/kmacy/head_page_lock/sys/amd64/include/vmparam.h
==============================================================================
--- user/kmacy/head_page_lock/sys/amd64/include/vmparam.h	Thu Mar 11 23:05:13 2010	(r205052)
+++ user/kmacy/head_page_lock/sys/amd64/include/vmparam.h	Thu Mar 11 23:27:16 2010	(r205053)
@@ -88,6 +88,12 @@
 #define	UMA_MD_SMALL_ALLOC
 
 /*
+ * We support hashing pages to an entry in array of locks on amd64
+ */
+
+#define VM_PAGE_LOCK
+
+/*
  * The physical address space is densely populated.
  */
 #define	VM_PHYSSEG_DENSE

Modified: user/kmacy/head_page_lock/sys/vm/vm_page.h
==============================================================================
--- user/kmacy/head_page_lock/sys/vm/vm_page.h	Thu Mar 11 23:05:13 2010	(r205052)
+++ user/kmacy/head_page_lock/sys/vm/vm_page.h	Thu Mar 11 23:27:16 2010	(r205053)
@@ -273,11 +273,20 @@ extern struct vpglocks vm_page_queue_loc
 #define vm_page_unlock_queues() mtx_unlock(&vm_page_queue_mtx)
 #define	vm_page_trylock_queues() mtx_trylock(&vm_page_queue_mtx)
 
+#ifdef VM_PAGE_LOCK
 #define	vm_page_lockptr(m)		pmap_page_lockptr(m)
 #define	vm_page_lock(m)		mtx_lock(vm_page_lockptr((m)))
 #define	vm_page_unlock(m)	mtx_unlock(vm_page_lockptr((m)))
 #define	vm_page_trylock(m)	mtx_trylock(vm_page_lockptr((m)))
 #define	vm_page_lock_assert(m, a)	mtx_assert(vm_page_lockptr((m)), (a))
+#else
+#define	vm_page_lockptr(m)	(&vm_page_queue_mtx)
+#define	vm_page_lock(m)		mtx_lock(vm_page_lockptr((m)))
+#define	vm_page_unlock(m)	mtx_unlock(vm_page_lockptr((m)))
+#define	vm_page_trylock(m)	mtx_trylock(vm_page_lockptr((m)))
+#define	vm_page_lock_assert(m, a)	mtx_assert(vm_page_lockptr((m)), (a))
+#endif
+
 
 #if PAGE_SIZE == 4096
 #define VM_PAGE_BITS_ALL 0xffu

From owner-svn-src-user@FreeBSD.ORG  Thu Mar 11 23:32:11 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 10062106566C;
	Thu, 11 Mar 2010 23:32:11 +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 F39228FC1B;
	Thu, 11 Mar 2010 23:32: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 o2BNWAB5064586;
	Thu, 11 Mar 2010 23:32:10 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BNWAYC064583;
	Thu, 11 Mar 2010 23:32:10 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201003112332.o2BNWAYC064583@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 11 Mar 2010 23:32:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205054 - user/kmacy/head_page_lock/sys/vm
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 11 Mar 2010 23:32:11 -0000

Author: kmacy
Date: Thu Mar 11 23:32:10 2010
New Revision: 205054
URL: http://svn.freebsd.org/changeset/base/205054

Log:
  further narrow diff

Modified:
  user/kmacy/head_page_lock/sys/vm/vm_page.h

Modified: user/kmacy/head_page_lock/sys/vm/vm_page.h
==============================================================================
--- user/kmacy/head_page_lock/sys/vm/vm_page.h	Thu Mar 11 23:27:16 2010	(r205053)
+++ user/kmacy/head_page_lock/sys/vm/vm_page.h	Thu Mar 11 23:32:10 2010	(r205054)
@@ -275,17 +275,13 @@ extern struct vpglocks vm_page_queue_loc
 
 #ifdef VM_PAGE_LOCK
 #define	vm_page_lockptr(m)		pmap_page_lockptr(m)
-#define	vm_page_lock(m)		mtx_lock(vm_page_lockptr((m)))
-#define	vm_page_unlock(m)	mtx_unlock(vm_page_lockptr((m)))
-#define	vm_page_trylock(m)	mtx_trylock(vm_page_lockptr((m)))
-#define	vm_page_lock_assert(m, a)	mtx_assert(vm_page_lockptr((m)), (a))
 #else
-#define	vm_page_lockptr(m)	(&vm_page_queue_mtx)
+#define	vm_page_lockptr(m)		(&vm_page_queue_mtx)
+#endif
 #define	vm_page_lock(m)		mtx_lock(vm_page_lockptr((m)))
 #define	vm_page_unlock(m)	mtx_unlock(vm_page_lockptr((m)))
 #define	vm_page_trylock(m)	mtx_trylock(vm_page_lockptr((m)))
 #define	vm_page_lock_assert(m, a)	mtx_assert(vm_page_lockptr((m)), (a))
-#endif
 
 
 #if PAGE_SIZE == 4096

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 00:25:05 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E68A1106566B;
	Fri, 12 Mar 2010 00:25:04 +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 D52708FC0A;
	Fri, 12 Mar 2010 00:25: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 o2C0P4Hb016263;
	Fri, 12 Mar 2010 00:25:04 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2C0P4S3016259;
	Fri, 12 Mar 2010 00:25:04 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201003120025.o2C0P4S3016259@svn.freebsd.org>
From: Kip Macy 
Date: Fri, 12 Mar 2010 00:25:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205055 - user/kmacy/head_page_lock/sys/vm
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 00:25:05 -0000

Author: kmacy
Date: Fri Mar 12 00:25:04 2010
New Revision: 205055
URL: http://svn.freebsd.org/changeset/base/205055

Log:
  - we can't assert that the page queue mutex is not owned if we're aliasing the
    page lock to it
  - we need to acquire the page queue lock before calling pmap_enter_object
    on architectures that don't use page lock

Modified:
  user/kmacy/head_page_lock/sys/vm/vm_map.c
  user/kmacy/head_page_lock/sys/vm/vm_page.c
  user/kmacy/head_page_lock/sys/vm/vm_page.h

Modified: user/kmacy/head_page_lock/sys/vm/vm_map.c
==============================================================================
--- user/kmacy/head_page_lock/sys/vm/vm_map.c	Thu Mar 11 23:32:10 2010	(r205054)
+++ user/kmacy/head_page_lock/sys/vm/vm_map.c	Fri Mar 12 00:25:04 2010	(r205055)
@@ -1714,6 +1714,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse
 	vm_offset_t start;
 	vm_page_t p, p_start;
 	vm_pindex_t psize, tmpidx;
+	boolean_t are_queues_locked;
 
 	if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL)
 		return;
@@ -1735,6 +1736,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse
 		psize = object->size - pindex;
 	}
 
+	are_queues_locked = FALSE;
 	start = 0;
 	p_start = NULL;
 
@@ -1768,15 +1770,31 @@ vm_map_pmap_enter(vm_map_t map, vm_offse
 				p_start = p;
 			}
 		} else if (p_start != NULL) {
+#ifndef VM_PAGE_LOCK
+			if (!are_queues_locked) {
+				are_queues_locked = TRUE;
+				vm_page_lock_queues();
+			}
+#endif			
 			pmap_enter_object(map->pmap, start, addr +
 			    ptoa(tmpidx), p_start, prot);
 			p_start = NULL;
 		}
 	}
 	if (p_start != NULL) {
+#ifndef VM_PAGE_LOCK
+		if (!are_queues_locked) {
+			are_queues_locked = TRUE;
+			vm_page_lock_queues();
+		}
+#endif		
 		pmap_enter_object(map->pmap, start, addr + ptoa(psize),
 		    p_start, prot);
 	}
+#ifndef VM_PAGE_LOCK
+	if (are_queues_locked)
+		vm_page_unlock_queues();
+#endif	
 unlock_return:
 	VM_OBJECT_UNLOCK(object);
 }

Modified: user/kmacy/head_page_lock/sys/vm/vm_page.c
==============================================================================
--- user/kmacy/head_page_lock/sys/vm/vm_page.c	Thu Mar 11 23:32:10 2010	(r205054)
+++ user/kmacy/head_page_lock/sys/vm/vm_page.c	Fri Mar 12 00:25:04 2010	(r205055)
@@ -1318,7 +1318,7 @@ vm_pageq_remove_locked(vm_page_t m)
 void
 vm_pageq_remove(vm_page_t m)
 {
-	mtx_assert(&vm_page_queue_mtx, MA_NOTOWNED);
+	vm_page_lock_queues_assert_notowned();
 	_vm_pageq_remove(m, FALSE);
 }
 
@@ -1335,7 +1335,7 @@ _vm_page_enqueue(int queue, vm_page_t m,
 	struct vpgqueues *vpq;
 
 	if (locked == FALSE) {
-		mtx_assert(&vm_page_queue_mtx, MA_NOTOWNED);
+		vm_page_lock_queues_assert_notowned();
 		vm_page_lock_queues();
 	}
 #ifdef INVARIANTS

Modified: user/kmacy/head_page_lock/sys/vm/vm_page.h
==============================================================================
--- user/kmacy/head_page_lock/sys/vm/vm_page.h	Thu Mar 11 23:32:10 2010	(r205054)
+++ user/kmacy/head_page_lock/sys/vm/vm_page.h	Fri Mar 12 00:25:04 2010	(r205055)
@@ -275,8 +275,10 @@ extern struct vpglocks vm_page_queue_loc
 
 #ifdef VM_PAGE_LOCK
 #define	vm_page_lockptr(m)		pmap_page_lockptr(m)
+#define	vm_page_lock_queues_assert_notowned()   mtx_assert(vm_page_lockptr((m)), MA_NOTOWNED)
 #else
 #define	vm_page_lockptr(m)		(&vm_page_queue_mtx)
+#define	vm_page_lock_queues_assert_notowned()   
 #endif
 #define	vm_page_lock(m)		mtx_lock(vm_page_lockptr((m)))
 #define	vm_page_unlock(m)	mtx_unlock(vm_page_lockptr((m)))

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 01:20:11 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 910F6106566B;
	Fri, 12 Mar 2010 01:20:11 +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 7E8268FC14;
	Fri, 12 Mar 2010 01:20: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 o2C1KBNu048047;
	Fri, 12 Mar 2010 01:20:11 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2C1KBhW048046;
	Fri, 12 Mar 2010 01:20:11 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003120120.o2C1KBhW048046@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 12 Mar 2010 01:20:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205058 - user/jmallett/octeon/sys/mips/cavium/dev/rgmii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 01:20:11 -0000

Author: jmallett
Date: Fri Mar 12 01:20:10 2010
New Revision: 205058
URL: http://svn.freebsd.org/changeset/base/205058

Log:
  o) Send outgoing packets to BPF on transmit.
  o) Handle setting promiscuous mode.

Modified:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Fri Mar 12 00:51:25 2010	(r205057)
+++ user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Fri Mar 12 01:20:10 2010	(r205058)
@@ -209,6 +209,7 @@ static int octeon_rgmx_intr(void *arg);
 /* Standard driver entry points.  These can be static.  */
 static void  octeon_rgmx_init	      (void *);
 //static driver_intr_t    rgmx_intr;
+static void  octeon_rgmx_rx_promiscuous (struct ifnet *, int);
 static int   octeon_rgmx_ioctl        (struct ifnet *, u_long, caddr_t);
 static void  octeon_rgmx_output_start (struct ifnet *);
 static void  octeon_rgmx_output_start_locked (struct ifnet *);
@@ -1225,6 +1226,8 @@ static void octeon_rgmx_output_start_loc
                 for (ii = 0; ii < len; ii++) printf(" %X", dc[ii]); printf("\n");
 #endif
 
+		ETHER_BPF_MTAP(ifp, m);
+
         	IF_ENQUEUE(&sc->tx_pending_queue, m);
 
                 /*
@@ -1681,6 +1684,56 @@ static void octeon_rgmx_medstat (struct 
 	RGMX_UNLOCK(sc);
 }
 
+static void octeon_rgmx_rx_promiscuous (struct ifnet *ifp, int promisc)
+{
+    	struct rgmx_softc_dev *sc = ifp->if_softc;
+	u_int port = sc->port;
+    	int index = INDEX(port);
+        int iface = INTERFACE(port);
+	u_int last_enabled;
+	uint64_t adr_ctl;
+
+	last_enabled = octeon_rgmx_stop_port(port);
+
+	adr_ctl = oct_read64(OCTEON_RGMX_RXX_ADR_CTL(index, iface));
+
+	/*
+	 * Always accept broadcast traffic.
+	 */
+	if ((adr_ctl & OCTEON_RGMX_ADRCTL_ACCEPT_BROADCAST) == 0)
+		adr_ctl |= OCTEON_RGMX_ADRCTL_ACCEPT_BROADCAST;
+
+	/*
+	 * For now always accept all multicast.
+	 */
+	adr_ctl &= ~OCTEON_RGMX_ADRCTL_REJECT_ALL_MULTICAST;
+	adr_ctl |= OCTEON_RGMX_ADRCTL_ACCEPT_ALL_MULTICAST;
+
+	/*
+	 * In promiscuous mode, the CAM is shut off, so reject everything.
+	 * Otherwise, filter using the CAM.
+	 */
+	if (promisc) {
+		adr_ctl &= ~OCTEON_RGMX_ADRCTL_CAM_MODE_ACCEPT_DMAC;
+		adr_ctl |= OCTEON_RGMX_ADRCTL_CAM_MODE_REJECT_DMAC;
+	} else {
+		adr_ctl &= ~OCTEON_RGMX_ADRCTL_CAM_MODE_REJECT_DMAC;
+		adr_ctl |= OCTEON_RGMX_ADRCTL_CAM_MODE_ACCEPT_DMAC;
+	}
+
+	oct_write64(OCTEON_RGMX_RXX_ADR_CTL(index, iface), adr_ctl);
+
+	/*
+	 * If in promiscuous mode, disable the CAM.
+	 */
+	if (promisc)
+		oct_write64(OCTEON_RGMX_RXX_ADR_CAM_EN(index, iface), 0);
+	else
+		oct_write64(OCTEON_RGMX_RXX_ADR_CAM_EN(index, iface), 1);
+
+	if (last_enabled) octeon_rgmx_start_port(port);
+}
+
 static int octeon_rgmx_ioctl (struct ifnet * ifp, u_long command, caddr_t data)
 {
     	struct rgmx_softc_dev *sc = ifp->if_softc;
@@ -1699,8 +1752,6 @@ static int octeon_rgmx_ioctl (struct ifn
                      * "stopped", reflecting the UP flag.
                      */
                     if (ifp->if_flags & IFF_UP) {
-
-
                         /*
                          * New state is IFF_UP
                          * Restart or Start now, if driver is not running currently.
@@ -1708,6 +1759,11 @@ static int octeon_rgmx_ioctl (struct ifn
                         if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
                             octeon_rgmx_init(sc);
                         }
+
+			if ((ifp->if_flags & IFF_PROMISC) == 0)
+				octeon_rgmx_rx_promiscuous(ifp, 0);
+			else
+				octeon_rgmx_rx_promiscuous(ifp, 1);
                     } else {
                         /*
                          * New state is IFF_DOWN.

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 01:51:39 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD497106564A;
	Fri, 12 Mar 2010 01:51:39 +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 7A2E58FC14;
	Fri, 12 Mar 2010 01:51: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 o2C1pdZZ054929;
	Fri, 12 Mar 2010 01:51:39 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2C1pdFt054927;
	Fri, 12 Mar 2010 01:51:39 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003120151.o2C1pdFt054927@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 12 Mar 2010 01:51:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205059 - user/jmallett/octeon/sys/mips/cavium/dev/rgmii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 01:51:40 -0000

Author: jmallett
Date: Fri Mar 12 01:51:39 2010
New Revision: 205059
URL: http://svn.freebsd.org/changeset/base/205059

Log:
  Change octeon_rgmx_rx_promiscuous into octeon_rgmx_config_cam which does
  general CAM configuration stuff (in theory) and checks interface flags for
  its own use rather than expecting a caller to.

Modified:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Fri Mar 12 01:20:10 2010	(r205058)
+++ user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Fri Mar 12 01:51:39 2010	(r205059)
@@ -209,7 +209,7 @@ static int octeon_rgmx_intr(void *arg);
 /* Standard driver entry points.  These can be static.  */
 static void  octeon_rgmx_init	      (void *);
 //static driver_intr_t    rgmx_intr;
-static void  octeon_rgmx_rx_promiscuous (struct ifnet *, int);
+static void  octeon_rgmx_config_cam   (struct ifnet *);
 static int   octeon_rgmx_ioctl        (struct ifnet *, u_long, caddr_t);
 static void  octeon_rgmx_output_start (struct ifnet *);
 static void  octeon_rgmx_output_start_locked (struct ifnet *);
@@ -1684,7 +1684,7 @@ static void octeon_rgmx_medstat (struct 
 	RGMX_UNLOCK(sc);
 }
 
-static void octeon_rgmx_rx_promiscuous (struct ifnet *ifp, int promisc)
+static void octeon_rgmx_config_cam(struct ifnet *ifp)
 {
     	struct rgmx_softc_dev *sc = ifp->if_softc;
 	u_int port = sc->port;
@@ -1704,7 +1704,11 @@ static void octeon_rgmx_rx_promiscuous (
 		adr_ctl |= OCTEON_RGMX_ADRCTL_ACCEPT_BROADCAST;
 
 	/*
-	 * For now always accept all multicast.
+	 * Accept all multicast in all multicast mode and in
+	 * promiscuous mode.
+	 *
+	 * XXX Since we don't handle programming the CAM for
+	 * multicast filtering, always accept all multicast.
 	 */
 	adr_ctl &= ~OCTEON_RGMX_ADRCTL_REJECT_ALL_MULTICAST;
 	adr_ctl |= OCTEON_RGMX_ADRCTL_ACCEPT_ALL_MULTICAST;
@@ -1713,7 +1717,7 @@ static void octeon_rgmx_rx_promiscuous (
 	 * In promiscuous mode, the CAM is shut off, so reject everything.
 	 * Otherwise, filter using the CAM.
 	 */
-	if (promisc) {
+	if ((ifp->if_flags & IFF_PROMISC) != 0) {
 		adr_ctl &= ~OCTEON_RGMX_ADRCTL_CAM_MODE_ACCEPT_DMAC;
 		adr_ctl |= OCTEON_RGMX_ADRCTL_CAM_MODE_REJECT_DMAC;
 	} else {
@@ -1726,7 +1730,7 @@ static void octeon_rgmx_rx_promiscuous (
 	/*
 	 * If in promiscuous mode, disable the CAM.
 	 */
-	if (promisc)
+	if ((ifp->if_flags & IFF_PROMISC) != 0)
 		oct_write64(OCTEON_RGMX_RXX_ADR_CAM_EN(index, iface), 0);
 	else
 		oct_write64(OCTEON_RGMX_RXX_ADR_CAM_EN(index, iface), 1);
@@ -1759,11 +1763,7 @@ static int octeon_rgmx_ioctl (struct ifn
                         if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
                             octeon_rgmx_init(sc);
                         }
-
-			if ((ifp->if_flags & IFF_PROMISC) == 0)
-				octeon_rgmx_rx_promiscuous(ifp, 0);
-			else
-				octeon_rgmx_rx_promiscuous(ifp, 1);
+			octeon_rgmx_config_cam(ifp);
                     } else {
                         /*
                          * New state is IFF_DOWN.

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 04:44:20 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6C2091065689;
	Fri, 12 Mar 2010 04:44:20 +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 5C4328FC1F;
	Fri, 12 Mar 2010 04:44: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 o2C4iKvM093295;
	Fri, 12 Mar 2010 04:44:20 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2C4iKHq093293;
	Fri, 12 Mar 2010 04:44:20 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201003120444.o2C4iKHq093293@svn.freebsd.org>
From: Kip Macy 
Date: Fri, 12 Mar 2010 04:44:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205065 - user/kmacy/head_flowtable_v6/sys/net
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 04:44:20 -0000

Author: kmacy
Date: Fri Mar 12 04:44:20 2010
New Revision: 205065
URL: http://svn.freebsd.org/changeset/base/205065

Log:
  - cleanup whitespace
  - keep statistics per-cpu for per-cpu flowtables to avoid cache line contention
  - add sysctls to accumulate stats and report aggregate

Modified:
  user/kmacy/head_flowtable_v6/sys/net/flowtable.c

Modified: user/kmacy/head_flowtable_v6/sys/net/flowtable.c
==============================================================================
--- user/kmacy/head_flowtable_v6/sys/net/flowtable.c	Fri Mar 12 03:49:17 2010	(r205064)
+++ user/kmacy/head_flowtable_v6/sys/net/flowtable.c	Fri Mar 12 04:44:20 2010	(r205065)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -145,14 +146,22 @@ union flentryp {
 	struct flentry		**pcpu[MAXCPU];
 };
 
+struct flowtable_stats {
+	uint64_t	ft_collisions;
+	uint64_t	ft_allocated;
+	uint64_t	ft_misses;
+	uint64_t	ft_max_depth;
+	uint64_t	ft_free_checks;
+	uint64_t	ft_frees;
+	uint64_t	ft_hits;
+	uint64_t	ft_lookups;
+} __aligned(128);
+
 struct flowtable {
+	struct	flowtable_stats ft_stats[MAXCPU];
 	int 		ft_size;
 	int 		ft_lock_count;
 	uint32_t	ft_flags;
-	uint32_t	ft_collisions;
-	uint32_t	ft_allocated;
-	uint32_t	ft_misses;
-	uint64_t	ft_hits;
 
 	uint32_t	ft_udp_idle;
 	uint32_t	ft_fin_wait_idle;
@@ -169,7 +178,7 @@ struct flowtable {
 	bitstr_t 	*ft_masks[MAXCPU];
 	bitstr_t	*ft_tmpmask;
 	struct flowtable *ft_next;
-};
+} __aligned(128);
 
 static struct proc *flowcleanerproc;
 static VNET_DEFINE(struct flowtable *, flow_list_head);
@@ -217,13 +226,6 @@ do {		  				\
  */
 VNET_DEFINE(int, flowtable_enable) = 1;
 static VNET_DEFINE(int, flowtable_debug);
-static VNET_DEFINE(int, flowtable_hits);
-static VNET_DEFINE(int, flowtable_lookups);
-static VNET_DEFINE(int, flowtable_misses);
-static VNET_DEFINE(int, flowtable_frees);
-static VNET_DEFINE(int, flowtable_free_checks);
-static VNET_DEFINE(int, flowtable_max_depth);
-static VNET_DEFINE(int, flowtable_collisions);
 static VNET_DEFINE(int, flowtable_syn_expire) = SYN_IDLE;
 static VNET_DEFINE(int, flowtable_udp_expire) = UDP_IDLE;
 static VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE;
@@ -233,13 +235,6 @@ static VNET_DEFINE(int, flowtable_ready)
 
 #define	V_flowtable_enable		VNET(flowtable_enable)
 #define	V_flowtable_debug		VNET(flowtable_debug)
-#define	V_flowtable_hits		VNET(flowtable_hits)
-#define	V_flowtable_lookups		VNET(flowtable_lookups)
-#define	V_flowtable_misses		VNET(flowtable_misses)
-#define	V_flowtable_frees		VNET(flowtable_frees)
-#define	V_flowtable_free_checks		VNET(flowtable_free_checks)
-#define	V_flowtable_max_depth		VNET(flowtable_max_depth)
-#define	V_flowtable_collisions		VNET(flowtable_collisions)
 #define	V_flowtable_syn_expire		VNET(flowtable_syn_expire)
 #define	V_flowtable_udp_expire		VNET(flowtable_udp_expire)
 #define	V_flowtable_fin_wait_expire	VNET(flowtable_fin_wait_expire)
@@ -252,20 +247,6 @@ SYSCTL_VNET_INT(_net_inet_flowtable, OID
     &VNET_NAME(flowtable_debug), 0, "print debug info.");
 SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, enable, CTLFLAG_RW,
     &VNET_NAME(flowtable_enable), 0, "enable flowtable caching.");
-SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, hits, CTLFLAG_RD,
-    &VNET_NAME(flowtable_hits), 0, "# flowtable hits.");
-SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, lookups, CTLFLAG_RD,
-    &VNET_NAME(flowtable_lookups), 0, "# flowtable lookups.");
-SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, misses, CTLFLAG_RD,
-    &VNET_NAME(flowtable_misses), 0, "#flowtable misses.");
-SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, frees, CTLFLAG_RD,
-    &VNET_NAME(flowtable_frees), 0, "#flows freed.");
-SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, free_checks, CTLFLAG_RD,
-    &VNET_NAME(flowtable_free_checks), 0, "#flows free checks.");
-SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, max_depth, CTLFLAG_RD,
-    &VNET_NAME(flowtable_max_depth), 0, "max collision list length.");
-SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, collisions, CTLFLAG_RD,
-    &VNET_NAME(flowtable_collisions), 0, "#flowtable collisions.");
 
 /*
  * XXX This does not end up updating timeouts at runtime
@@ -315,6 +296,77 @@ SYSCTL_VNET_PROC(_net_inet_flowtable, OI
     CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_nmbflows, "IU",
     "Maximum number of flows allowed");
 
+
+
+#define FS_PRINT(sb, field)	sbuf_printf((sb), "\t%s=%jd", #field, fs->ft_##field)
+
+static void
+fs_print(struct flowtable_stats *fs)
+{
+	struct sbuf *sb;
+
+	sb = sbuf_new(NULL, NULL, 32*1024, SBUF_FIXEDLEN);
+
+	FS_PRINT(sb, collisions);
+	FS_PRINT(sb, allocated);
+	FS_PRINT(sb, misses);
+	FS_PRINT(sb, max_depth);
+	FS_PRINT(sb, free_checks);
+	FS_PRINT(sb, frees);
+	FS_PRINT(sb, hits);
+	FS_PRINT(sb, lookups);
+	sbuf_finish(sb);
+	
+}
+
+static void
+flowtable_show_stats(struct flowtable *ft)
+{
+	int i;
+	struct flowtable_stats fs, *pfs;
+
+	if (ft->ft_flags & FL_PCPU) {
+		bzero(&fs, sizeof(fs));
+		pfs = &fs;
+		for (i = 0; i <= mp_maxid; i++) {
+			if (CPU_ABSENT(i))
+				continue;
+			pfs->ft_collisions  += ft->ft_stats[i].ft_collisions;
+			pfs->ft_allocated   += ft->ft_stats[i].ft_allocated;
+			pfs->ft_misses      += ft->ft_stats[i].ft_misses;
+			pfs->ft_free_checks += ft->ft_stats[i].ft_free_checks;
+			pfs->ft_frees       += ft->ft_stats[i].ft_frees;
+			pfs->ft_hits        += ft->ft_stats[i].ft_hits;
+			pfs->ft_lookups     += ft->ft_stats[i].ft_lookups;
+			if (ft->ft_stats[i].ft_max_depth > pfs->ft_max_depth)
+				pfs->ft_max_depth = ft->ft_stats[i].ft_max_depth;
+		}
+	} else {
+		pfs = &ft->ft_stats[0];
+	}
+
+	fs_print(pfs);
+}
+
+static int
+sysctl_flowtable_stats(SYSCTL_HANDLER_ARGS)
+{
+	struct flowtable *ft;
+
+	ft = V_flow_list_head;
+	while (ft != NULL) {
+		printf("name: %s\n", ft->ft_name);
+		flowtable_show_stats(ft);
+		ft = ft->ft_next;
+	}
+
+	return (0);
+}
+SYSCTL_VNET_PROC(_net_inet_flowtable, OID_AUTO, stats,
+    CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_flowtable_stats, "IU",
+    "flowtable statistics");
+
+
 #ifndef RADIX_MPATH
 static void
 in_rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum)
@@ -867,6 +919,7 @@ flowtable_insert(struct flowtable *ft, u
     uint32_t fibnum, struct route *ro, uint16_t flags)
 {
 	struct flentry *fle, *fletail, *newfle, **flep;
+	struct flowtable_stats *fs = &ft->ft_stats[curcpu];
 	int depth;
 	uma_zone_t flezone;
 	bitstr_t *mask;
@@ -892,7 +945,7 @@ flowtable_insert(struct flowtable *ft, u
 	} 
 	
 	depth = 0;
-	V_flowtable_collisions++;
+	fs->ft_collisions++;
 	/*
 	 * find end of list and make sure that we were not
 	 * preempted by another thread handling this flow
@@ -921,8 +974,8 @@ flowtable_insert(struct flowtable *ft, u
 		fle = fle->f_next;
 	} 
 
-	if (depth > V_flowtable_max_depth)
-		V_flowtable_max_depth = depth;
+	if (depth > fs->ft_max_depth)
+		fs->ft_max_depth = depth;
 	fletail->f_next = newfle;
 	fle = newfle;
 skip:
@@ -1014,6 +1067,7 @@ flowtable_lookup(struct flowtable *ft, s
 {
 	uint32_t key[9], hash;
 	struct flentry *fle;
+	struct flowtable_stats *fs = &ft->ft_stats[curcpu];
 	uint8_t proto = 0;
 	int error = 0;
 	struct rtentry *rt;
@@ -1066,7 +1120,7 @@ flowtable_lookup(struct flowtable *ft, s
 	if (hash == 0 || (key[0] == 0 && (ft->ft_flags & FL_HASH_ALL)))
 		return (NULL);
 
-	V_flowtable_lookups++;
+	fs->ft_lookups++;
 	FL_ENTRY_LOCK(ft, hash);
 	if ((fle = FL_ENTRY(ft, hash)) == NULL) {
 		FL_ENTRY_UNLOCK(ft, hash);
@@ -1082,7 +1136,7 @@ keycheck:	
 	    && (fibnum == fle->f_fibnum)
 	    && (rt->rt_flags & RTF_UP)
 	    && (rt->rt_ifp != NULL)) {
-		V_flowtable_hits++;
+		fs->ft_hits++;
 		fle->f_uptime = time_uptime;
 		fle->f_flags |= flags;
 		FL_ENTRY_UNLOCK(ft, hash);
@@ -1096,7 +1150,7 @@ uncached:
 	if (flags & FL_NOAUTO)
 		return (NULL);
 
-	V_flowtable_misses++;
+	fs->ft_misses++;
 	/*
 	 * This bit of code ends up locking the
 	 * same route 3 times (just like ip_output + ether_output)
@@ -1291,7 +1345,8 @@ flowtable_free_stale(struct flowtable *f
 	struct flentry *fle,  **flehead, *fleprev;
 	struct flentry *flefreehead, *flefreetail, *fletmp;
 	bitstr_t *mask, *tmpmask;
-	
+	struct flowtable_stats *fs = &ft->ft_stats[curcpu];
+
 	flefreehead = flefreetail = NULL;
 	mask = flowtable_mask(ft);
 	tmpmask = ft->ft_tmpmask;
@@ -1308,12 +1363,12 @@ flowtable_free_stale(struct flowtable *f
 			    curbit);
 			break;
 		}
-		
+
 		FL_ENTRY_LOCK(ft, curbit);
 		flehead = flowtable_entry(ft, curbit);
 		fle = fleprev = *flehead;
 
-		V_flowtable_free_checks++;
+		fs->ft_free_checks++;
 #ifdef DIAGNOSTIC
 		if (fle == NULL && curbit > 0) {
 			log(LOG_ALERT,
@@ -1351,7 +1406,7 @@ flowtable_free_stale(struct flowtable *f
 				fleprev->f_next = fle->f_next;
 				fle = fleprev->f_next;
 			}
-			
+
 			if (flefreehead == NULL)
 				flefreehead = flefreetail = fletmp;
 			else {
@@ -1370,7 +1425,7 @@ flowtable_free_stale(struct flowtable *f
 	while ((fle = flefreehead) != NULL) {
 		flefreehead = fle->f_next;
 		count++;
-		V_flowtable_frees++;
+		fs->ft_frees++;
 		fle_free(fle);
 	}
 	if (V_flowtable_debug && count)
@@ -1381,6 +1436,7 @@ void
 flowtable_route_flush(struct flowtable *ft, struct rtentry *rt)
 {
 	int i;
+
 	if (ft->ft_flags & FL_PCPU) {
 		for (i = 0; i <= mp_maxid; i++) {
 			if (CPU_ABSENT(i))
@@ -1471,7 +1527,7 @@ static void
 flowtable_flush(void *unused __unused)
 {
 	uint64_t start;
-	
+
 	mtx_lock(&flowclean_lock);
 	start = flowclean_cycles;
 	while (start == flowclean_cycles) {

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 05:08:06 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1E6BE106566C;
	Fri, 12 Mar 2010 05:08:06 +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 E9CBB8FC0A;
	Fri, 12 Mar 2010 05:08: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 o2C585qB098630;
	Fri, 12 Mar 2010 05:08:05 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2C5856Q098629;
	Fri, 12 Mar 2010 05:08:05 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201003120508.o2C5856Q098629@svn.freebsd.org>
From: Kip Macy 
Date: Fri, 12 Mar 2010 05:08:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205067 - user/kmacy/head_zfs_updates
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 05:08:06 -0000

Author: kmacy
Date: Fri Mar 12 05:08:05 2010
New Revision: 205067
URL: http://svn.freebsd.org/changeset/base/205067

Log:
  create branch for integrating ZFS updates

Added:
     - copied from r205066, head/
Directory Properties:
  user/kmacy/head_zfs_updates/   (props changed)

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 13:53:52 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE9651065672;
	Fri, 12 Mar 2010 13:53:52 +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 DC1D48FC2B;
	Fri, 12 Mar 2010 13:53: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 o2CDrqDd017138;
	Fri, 12 Mar 2010 13:53:52 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2CDrqLd017131;
	Fri, 12 Mar 2010 13:53:52 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201003121353.o2CDrqLd017131@svn.freebsd.org>
From: Luigi Rizzo 
Date: Fri, 12 Mar 2010 13:53:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205081 - in user/luigi/ipfw3-r8/release/picobsd:
	bridge build floppy.tree floppy.tree/etc qemu
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 13:53:53 -0000

Author: luigi
Date: Fri Mar 12 13:53:52 2010
New Revision: 205081
URL: http://svn.freebsd.org/changeset/base/205081

Log:
  svn merge -r 204832:205079 svn+ssh://svn.freebsd.org/base/stable/8/release/picobsd

Added:
  user/luigi/ipfw3-r8/release/picobsd/floppy.tree/sbin
     - copied unchanged from r205079, stable/8/release/picobsd/floppy.tree/sbin
  user/luigi/ipfw3-r8/release/picobsd/qemu/
     - copied from r205079, stable/8/release/picobsd/qemu/
Modified:
  user/luigi/ipfw3-r8/release/picobsd/bridge/PICOBSD
  user/luigi/ipfw3-r8/release/picobsd/bridge/crunch.conf
  user/luigi/ipfw3-r8/release/picobsd/build/mfs.mtree
  user/luigi/ipfw3-r8/release/picobsd/build/picobsd
  user/luigi/ipfw3-r8/release/picobsd/floppy.tree/etc/master.passwd
Directory Properties:
  user/luigi/ipfw3-r8/release/picobsd/   (props changed)

Modified: user/luigi/ipfw3-r8/release/picobsd/bridge/PICOBSD
==============================================================================
--- user/luigi/ipfw3-r8/release/picobsd/bridge/PICOBSD	Fri Mar 12 13:36:58 2010	(r205080)
+++ user/luigi/ipfw3-r8/release/picobsd/bridge/PICOBSD	Fri Mar 12 13:53:52 2010	(r205081)
@@ -16,8 +16,8 @@ cpu		I586_CPU
 cpu		I686_CPU
 ident		PICOBSD
 
-options                SMP
-device apic
+options		SMP
+device	apic
 
 options		SCHED_4BSD		# mandatory to have one scheduler
 #options	MATH_EMULATE		#Support for x87 emulation
@@ -48,7 +48,7 @@ options		DUMMYNET
 device		if_bridge
 # Running with less than 1000 seems to give poor timing on
 # qemu, so we set HZ explicitly.
-options         HZ=1000
+options		HZ=1000
 
 device		random			# used by ssh
 device		pci

Modified: user/luigi/ipfw3-r8/release/picobsd/bridge/crunch.conf
==============================================================================
--- user/luigi/ipfw3-r8/release/picobsd/bridge/crunch.conf	Fri Mar 12 13:36:58 2010	(r205080)
+++ user/luigi/ipfw3-r8/release/picobsd/bridge/crunch.conf	Fri Mar 12 13:53:52 2010	(r205081)
@@ -180,4 +180,4 @@ libs_so -lkvm
 libs_so -lz
 libs_so -lbsdxml
 libs_so -lsbuf
-libs_so -ljail		# used by ifconfig
+libs_so -ljail	# used by ifconfig

Modified: user/luigi/ipfw3-r8/release/picobsd/build/mfs.mtree
==============================================================================
--- user/luigi/ipfw3-r8/release/picobsd/build/mfs.mtree	Fri Mar 12 13:36:58 2010	(r205080)
+++ user/luigi/ipfw3-r8/release/picobsd/build/mfs.mtree	Fri Mar 12 13:53:52 2010	(r205081)
@@ -58,6 +58,8 @@
     var            
         db             
         ..
+	empty
+	..
         run            
         ..
         spool          

Modified: user/luigi/ipfw3-r8/release/picobsd/build/picobsd
==============================================================================
--- user/luigi/ipfw3-r8/release/picobsd/build/picobsd	Fri Mar 12 13:36:58 2010	(r205080)
+++ user/luigi/ipfw3-r8/release/picobsd/build/picobsd	Fri Mar 12 13:53:52 2010	(r205081)
@@ -167,7 +167,7 @@ create_includes_and_libraries2() { # opt
     local no
     log "create_includes_and_libraries2() for ${SRC}"
     if [ ${OSVERSION} -ge 600000 ] ; then
-	no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITOUT_CDDL=1"
+	no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1"
     else
 	no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R"
     fi
@@ -568,10 +568,17 @@ do_links() {	# rootdir varname
 # find_progs is a helper function to locate the named programs
 # or libraries in ${o_objdir} or ${_SHLIBDIRPREFIX},
 # and return the full pathnames.
-# Sets ${u_progs} to the list of programs, and ${u_libs}
+# Called as "find_progs [-L libpath] [-P binpath] prog1 prog2 ... "
+# On return it sets ${u_progs} to the list of programs, and ${u_libs}
 # to the list of shared libraries used.
+# 
+# '-L path' can be used to specify a search path for libraries
+#    (which searches in $path/lib:$path/usr/lib:$path/usr/local/lib
+# '-P binpath' can be used to specify a search path for programs
+#    (which searches in a lot of places in the subtree)
+# -L must be the first, followed by -P
 #
-# You can use it e.g. in a local configuration file by writing
+# You can use it e.g. in a local confign file by writing
 #
 #  do_copyfiles_user() {
 #	local dst=$1
@@ -580,41 +587,61 @@ do_links() {	# rootdir varname
 #	cp -p ${u_libs} ${dst}/lib
 #	mkdir -p ${dst}/libexec
 #	find_progs ld-elf.so.1
-#	cp -p ${u_progs} ${dst}/libexec
+#	cp -p ${u_progs} ${dst}/libexec # ignore errors
 #  }
 
 find_progs() {	# programs
 	local i
+	local oo=${o_objdir:-${_SHLIBDIRPREFIX}} # default objdir
+	local lp=$oo/lib			# default lib.prefix
+	local o=""				# additional objdir
+	if [ x"$1" = "x-L" -a -d "$2" ] ; then # set lib search path
+		o=$2; shift; shift
+		lp="$lp:$o/lib:$o/usr/lib:$o/usr/local/lib"
+		o="-P $o"
+	fi
+	u_libs=""
 	u_progs="`find_progs_helper $*`"
-	local o=${o_objdir:-${_SHLIBDIRPREFIX}}
-	log "looking for libs for $u_progs in $_SHLIBDIRPREFIX"
+	log "looking for libs for <$u_progs> in $lp"
 	[ -z "${u_progs}" ] && return 1	# not found, error
-	i="`LD_LIBRARY_PATH=$o/lib ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`"
-	u_libs="`find_progs_helper $i`"
+	i="`( LD_LIBRARY_PATH=$lp ldd ${u_progs} ) | \
+		grep -v '^/' | awk '{print $1}' | sort | uniq`"
+	u_libs="`find_progs_helper $o $i`"
 	return 0
 }
 
 find_progs_helper() {	# programs
+	local dir=${o_objdir:-${_SHLIBDIRPREFIX}/..}
+	local ldir=""
+	if [ x"$1" = "x-P" -a -d "$2" ] ; then # set path
+		ldir=$2; shift; shift
+	fi
 	local progs="$*"
-	local i o places names
-	local subdirs="bin sbin usr.bin usr.sbin libexec lib \
+	local subdirs=". local/bin local/sbin local/lib local/libexec \
+		bin sbin usr.bin usr.sbin libexec lib \
 		gnu/usr.bin gnu/lib \
 		secure/usr.bin secure/usr.sbin secure/libexec secure/lib"
-	names=""	# files to search
-	o=""
+	local names=""	# files to search
+	local o=""
+	local i
 	for i in $progs ; do
-		# plain programs come out verbatim
+		# full pathnames are just listed
 		[ -f "$i" ] && echo $i && continue
 		names="${names} ${o} -name $i"
 		o="-o"
 	done
 	[ -z "${names}" ] && return 0
-	places=""				# places to search
-	o=${o_objdir:-${_SHLIBDIRPREFIX}/..}
+	local places=""				# places to search
 	for i in $subdirs ; do
-		[ -d "${o}/${i}" ] && places="${places} ${o}/${i}"
+		[ -d "${dir}/${i}" ] && places="${places} ${dir}/${i}"
 	done
-	find ${places} -type f \( ${names} \)
+	if [ -n "${ldir}" ] ; then
+	    for i in $subdirs ; do
+		[ -d "${ldir}/${i}" ] && places="${places} ${ldir}/${i}"
+	    done
+	fi
+	# use maxdepth 3 because some libs are way down
+	find ${places} -maxdepth 3 -type f \( ${names} \)
 }
 
 # Populate the memory filesystem with binaries and non-variable
@@ -862,7 +889,7 @@ fill_floppy_image() {
     if [ ${mfs_start} -gt 0 -a ${mfs_size} -ge ${imgsize} ] ; then
 	mfs_ofs=$((${mfs_start} + 8192))
 	log "Preload kernel with file ${c_fs} at ${mfs_ofs}"
-	logverbose "`ls -l ${c_fs}` to fit in ${mfs_size}"
+	log "`ls -l ${c_fs}` to fit in ${mfs_size}"
 	dd if=${c_fs} ibs=8192 iseek=1 of=kernel obs=${mfs_ofs} \
 	    oseek=1 conv=notrunc # 2> /dev/null
     else
@@ -917,7 +944,7 @@ fill_floppy_image() {
 
     ls -l ${c_img}
     ${c_label} -f `pwd`/${c_img}
-    logverbose "after disklabel"
+    log "after disklabel"
     )
 
     echo "BUILDDIR ${BUILDDIR}"
@@ -931,7 +958,7 @@ fill_floppy_image() {
 
     dd if=${b2} iseek=1 ibs=276 2> /dev/null | \
 	dd of=${BUILDDIR}/${c_img} oseek=1 obs=788 conv=notrunc 2>/dev/null
-    logverbose "done floppy image"
+    log "done disk image"
     # XXX (log "Fixing permissions"; cd ${dst}; chown -R root *)
     rm -rf ${BUILDDIR}/floppy.tree || true # cleanup
     # df -ik ${dst} | colrm 70 > .build.reply

Modified: user/luigi/ipfw3-r8/release/picobsd/floppy.tree/etc/master.passwd
==============================================================================
--- user/luigi/ipfw3-r8/release/picobsd/floppy.tree/etc/master.passwd	Fri Mar 12 13:36:58 2010	(r205080)
+++ user/luigi/ipfw3-r8/release/picobsd/floppy.tree/etc/master.passwd	Fri Mar 12 13:53:52 2010	(r205081)
@@ -1,3 +1,4 @@
+# $FreeBSD$
 root:$1$xOOaGnKU$U9QdsCI40XXcCUMBN.7Az.:0:0::0:0:Charlie &:/root:/bin/sh
 toor:*:0:0::0:0:Bourne-again Superuser:/root:
 daemon:*:1:1::0:0:Owner of many system processes:/root:/nonexistent
@@ -5,4 +6,5 @@ operator:*:2:20::0:0:System &:/usr/guest
 bin:*:3:7::0:0:Binaries Commands and Source,,,:/:/nonexistent
 tty:*:4:65533::0:0:Tty Sandbox:/:/nonexistent
 nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/nonexistent
+_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
 user:*:1002:1002:Sample User:0:0:user:/home/user:/bin/sh

Copied: user/luigi/ipfw3-r8/release/picobsd/floppy.tree/sbin (from r205079, stable/8/release/picobsd/floppy.tree/sbin)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/luigi/ipfw3-r8/release/picobsd/floppy.tree/sbin	Fri Mar 12 13:53:52 2010	(r205081, copy of r205079, stable/8/release/picobsd/floppy.tree/sbin)
@@ -0,0 +1,384 @@
+#!/bin/sh
+#
+# $OpenBSD: dhclient-script,v 1.6 2004/05/06 18:22:41 claudio Exp $
+# $FreeBSD$
+#
+# Copyright (c) 2003 Kenneth R Westerback 
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+#
+
+ARP=/usr/sbin/arp
+HOSTNAME=/bin/hostname
+IFCONFIG='/sbin/ifconfig -n'
+
+LOCALHOST=127.0.0.1
+
+if [ -x /usr/bin/logger ]; then
+	LOGGER="/usr/bin/logger -s -p user.notice -t dhclient"
+else
+	LOGGER=echo
+fi
+
+#
+# Helper functions that implement common actions.
+#
+
+check_hostname() {
+	current_hostname=`$HOSTNAME`
+	if [ -z "$current_hostname" ]; then
+		$LOGGER "New Hostname ($interface): $new_host_name"
+		$HOSTNAME $new_host_name
+	elif [ "$current_hostname" = "$old_host_name" -a \
+	       "$new_host_name" != "$old_host_name" ]; then
+		$LOGGER "New Hostname ($interface): $new_host_name"
+		$HOSTNAME $new_host_name
+	fi
+}
+
+arp_flush() {
+	arp -an -i $interface | \
+		sed -n -e 's/^.*(\(.*\)) at .*$/arp -d \1/p' | \
+		sh >/dev/null 2>&1
+}
+
+delete_old_address() {
+	eval "$IFCONFIG $interface inet -alias $old_ip_address $medium"
+}
+
+add_new_address() {
+	eval "$IFCONFIG $interface \
+		inet $new_ip_address \
+		netmask $new_subnet_mask \
+		broadcast $new_broadcast_address \
+		$medium"
+
+	$LOGGER "New IP Address ($interface): $new_ip_address"
+	$LOGGER "New Subnet Mask ($interface): $new_subnet_mask"
+	$LOGGER "New Broadcast Address ($interface): $new_broadcast_address"
+	$LOGGER "New Routers ($interface): $new_routers"
+}
+
+delete_old_alias() {
+	if [ -n "$alias_ip_address" ]; then
+		$IFCONFIG $interface inet -alias $alias_ip_address > /dev/null 2>&1
+		#route delete $alias_ip_address $LOCALHOST > /dev/null 2>&1
+	fi
+}
+
+add_new_alias() {
+	if [ -n "$alias_ip_address" ]; then
+		$IFCONFIG $interface inet alias $alias_ip_address netmask \
+		    $alias_subnet_mask
+		#route add $alias_ip_address $LOCALHOST
+	fi
+}
+
+fill_classless_routes() {
+	set $1
+	while [ $# -ge 5 ]; do
+		if [ $1 -eq 0 ]; then
+			route="default"
+		elif [ $1 -le 8 ]; then
+			route="$2.0.0.0/$1"
+			shift
+		elif [ $1 -le 16 ]; then
+			route="$2.$3.0.0/$1"
+			shift; shift
+		elif [ $1 -le 24 ]; then
+			route="$2.$3.$4.0/$1"
+			shift; shift; shift
+		else
+			route="$2.$3.$4.$5/$1"
+			shift; shift; shift; shift
+		fi
+		shift
+		router="$1.$2.$3.$4"
+		classless_routes="$classless_routes $route $router"
+		shift; shift; shift; shift
+	done
+}
+
+delete_old_routes() {
+	#route delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1
+	if [ -n "$old_classless_routes" ]; then
+		fill_classless_routes "$old_classless_routes"
+		set $classless_routes
+		while [ $# -gt 1 ]; do
+			route delete "$1" "$2"
+			shift; shift
+		done
+		return 0;
+	fi
+
+	# If we supported multiple default routes, we'd be removing each
+	# one here.  We don't so just delete the default route if it's
+	# through our interface.
+	if is_default_interface; then
+		route delete default >/dev/null 2>&1
+	fi
+
+	if [ -n "$old_static_routes" ]; then
+		set $old_static_routes
+		while [ $# -gt 1 ]; do
+			route delete "$1" "$2"
+			shift; shift
+		done
+	fi
+
+	arp_flush
+}
+
+add_new_routes() {
+	#route add $new_ip_address $LOCALHOST >/dev/null 2>&1
+
+	# RFC 3442: If the DHCP server returns both a Classless Static
+	# Routes option and a Router option, the DHCP client MUST ignore
+	# the Router option.
+	#
+	# DHCP clients that support this option (Classless Static Routes)
+	# MUST NOT install the routes specified in the Static Routes
+	# option (option code 33) if both a Static Routes option and the
+	# Classless Static Routes option are provided.
+
+	if [ -n "$new_classless_routes" ]; then
+		fill_classless_routes "$new_classless_routes"
+		$LOGGER "New Classless Static Routes ($interface): $classless_routes"
+		set $classless_routes
+		while [ $# -gt 1 ]; do
+			if [ "0.0.0.0" = "$2" ]; then
+				route add "$1" -iface "$interface"
+			else
+				route add "$1" "$2"
+			fi
+			shift; shift
+		done
+		return
+	fi
+
+	for router in $new_routers; do
+		if is_default_interface; then
+
+			if [ "$new_ip_address" = "$router" ]; then
+				route add default -iface $router >/dev/null 2>&1
+			else
+				route add default $router >/dev/null 2>&1
+			fi
+		fi
+		# 2nd and subsequent default routers error out, so explicitly
+		# stop processing the list after the first one.
+		break
+	done
+
+	if [ -n "$new_static_routes" ]; then
+		$LOGGER "New Static Routes ($interface): $new_static_routes"
+		set $new_static_routes
+		while [ $# -gt 1 ]; do
+			route add $1 $2
+			shift; shift
+		done
+	fi
+}
+
+add_new_resolv_conf() {
+	# XXX Old code did not create/update resolv.conf unless both
+	# $new_domain_name and $new_domain_name_servers were provided.  PR
+	# #3135 reported some ISP's only provide $new_domain_name_servers and
+	# thus broke the script. This code creates the resolv.conf if either
+	# are provided.
+
+	local tmpres=/var/run/resolv.conf.${interface}
+	rm -f $tmpres
+
+	if [ -n "$new_domain_name" ]; then
+		echo "search $new_domain_name" >>$tmpres
+	fi
+
+	if [ -n "$new_domain_name_servers" ]; then
+		for nameserver in $new_domain_name_servers; do
+			echo "nameserver $nameserver" >>$tmpres
+		done
+	fi
+
+	if [ -f $tmpres ]; then
+		if [ -f /etc/resolv.conf.tail ]; then
+			cat /etc/resolv.conf.tail >>$tmpres
+		fi
+
+		# When resolv.conf is not changed actually, we don't
+		# need to update it.
+		# If /usr is not mounted yet, we cannot use cmp, then
+		# the following test fails.  In such case, we simply
+		# ignore an error and do update resolv.conf.
+		if cmp -s $tmpres /etc/resolv.conf; then
+			rm -f $tmpres
+			return 0
+		fi 2>/dev/null
+
+		# In case (e.g. during OpenBSD installs) /etc/resolv.conf
+		# is a symbolic link, take care to preserve the link and write
+		# the new data in the correct location.
+
+		if [ -f /etc/resolv.conf ]; then
+			cat /etc/resolv.conf > /etc/resolv.conf.save
+		fi
+		cat $tmpres > /etc/resolv.conf
+		rm -f $tmpres
+
+		# Try to ensure correct ownership and permissions.
+		chown -RL root:wheel /etc/resolv.conf
+		chmod -RL 644 /etc/resolv.conf
+
+		return 0
+	fi
+
+	return 1
+}
+
+# Must be used on exit.   Invokes the local dhcp client exit hooks, if any.
+exit_with_hooks() {
+	exit_status=$1
+	if [ -f /etc/dhclient-exit-hooks ]; then
+		. /etc/dhclient-exit-hooks
+	fi
+	# probably should do something with exit status of the local script
+	exit $exit_status
+}
+
+# Get the interface with the current ipv4 default route on it using only
+# commands that are available prior to /usr being mounted.
+is_default_interface()
+{
+	routeget="`route -n get -inet default`"
+	oldifs="$IFS"
+	IFS="
+"
+	defif=
+	for line in $routeget ; do
+		case $line in
+		*interface:*)
+			defif=${line##*: }
+			;;
+		esac
+	done
+	IFS=${oldifs}
+
+	if [ -z "$defif" -o "$defif" = "$interface" ]; then
+		return 0
+	else
+		return 1
+	fi
+}
+
+#
+# Start of active code.
+#
+
+# Invoke the local dhcp client enter hooks, if they exist.
+if [ -f /etc/dhclient-enter-hooks ]; then
+	exit_status=0
+	. /etc/dhclient-enter-hooks
+	# allow the local script to abort processing of this state
+	# local script must set exit_status variable to nonzero.
+	if [ $exit_status -ne 0 ]; then
+		exit $exit_status
+	fi
+fi
+
+case $reason in
+MEDIUM)
+	eval "$IFCONFIG $interface $medium"
+	eval "$IFCONFIG $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1
+	sleep 1
+	;;
+
+PREINIT)
+	delete_old_alias
+	$IFCONFIG $interface inet alias 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.255 up
+	;;
+
+ARPCHECK|ARPSEND)
+	;;
+
+BOUND|RENEW|REBIND|REBOOT)
+	check_hostname
+	if [ -n "$old_ip_address" ]; then
+		if [ "$old_ip_address" != "$alias_ip_address" ]; then
+			delete_old_alias
+		fi
+		if [ "$old_ip_address" != "$new_ip_address" ]; then
+			delete_old_address
+			delete_old_routes
+		fi
+	fi
+	if [ "$reason" = BOUND ] || \
+	   [ "$reason" = REBOOT ] || \
+	   [ -z "$old_ip_address" ] || \
+	   [ "$old_ip_address" != "$new_ip_address" ]; then
+		add_new_address
+		add_new_routes
+	fi
+	if [ "$new_ip_address" != "$alias_ip_address" ]; then
+		add_new_alias
+	fi
+	if is_default_interface; then
+		add_new_resolv_conf
+	fi
+	;;
+
+EXPIRE|FAIL)
+	delete_old_alias
+	if [ -n "$old_ip_address" ]; then
+		delete_old_address
+		delete_old_routes
+	fi
+	if [ -x $ARP ]; then
+		$ARP -d -a -i $interface
+	fi
+	# XXX Why add alias we just deleted above?
+	add_new_alias
+	if is_default_interface; then
+		if [ -f /etc/resolv.conf.save ]; then
+			cat /etc/resolv.conf.save > /etc/resolv.conf
+		fi
+	fi
+	;;
+
+TIMEOUT)
+	delete_old_alias
+	add_new_address
+	sleep 1
+	if [ -n "$new_routers" ]; then
+		$LOGGER "New Routers ($interface): $new_routers"
+		set "$new_routers"
+		if ping -q -c 1 -t 1 "$1"; then
+			if [ "$new_ip_address" != "$alias_ip_address" ]; then
+				add_new_alias
+			fi
+			add_new_routes
+			if ! is_default_interface; then
+				exit_with_hooks 0
+			fi
+			if add_new_resolv_conf; then
+				exit_with_hooks 0
+			fi
+		fi
+	fi
+	eval "$IFCONFIG $interface inet -alias $new_ip_address $medium"
+	delete_old_routes
+	exit_with_hooks 1
+	;;
+esac
+
+exit_with_hooks 0

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 15:21:14 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B4FC3106566B;
	Fri, 12 Mar 2010 15:21: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 A12888FC0C;
	Fri, 12 Mar 2010 15:21: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 o2CFLExK036641;
	Fri, 12 Mar 2010 15:21:14 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2CFLEsW036640;
	Fri, 12 Mar 2010 15:21:14 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201003121521.o2CFLEsW036640@svn.freebsd.org>
From: Luigi Rizzo 
Date: Fri, 12 Mar 2010 15:21:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205084 - in user/luigi/ipfw3-r8: sbin/ipfw sys/netinet
	sys/netinet/ipfw sys/netinet/ipfw/test
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 15:21:14 -0000

Author: luigi
Date: Fri Mar 12 15:21:13 2010
New Revision: 205084
URL: http://svn.freebsd.org/changeset/base/205084

Log:
  partial merge of ipfw3 changes in preparation for MFC to RELENG_8

Added:
  user/luigi/ipfw3-r8/sys/netinet/ipfw/dn_heap.c
     - copied, changed from r204610, head/sys/netinet/ipfw/dn_heap.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/dn_heap.h
     - copied, changed from r204610, head/sys/netinet/ipfw/dn_heap.h
  user/luigi/ipfw3-r8/sys/netinet/ipfw/dn_sched.h
     - copied unchanged from r204610, head/sys/netinet/ipfw/dn_sched.h
  user/luigi/ipfw3-r8/sys/netinet/ipfw/dn_sched_fifo.c
     - copied unchanged from r204610, head/sys/netinet/ipfw/dn_sched_fifo.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/dn_sched_qfq.c
     - copied unchanged from r204610, head/sys/netinet/ipfw/dn_sched_qfq.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/dn_sched_rr.c
     - copied unchanged from r204610, head/sys/netinet/ipfw/dn_sched_rr.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/dn_sched_wf2q.c
     - copied unchanged from r204610, head/sys/netinet/ipfw/dn_sched_wf2q.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/dummynet.txt
     - copied unchanged from r204610, head/sys/netinet/ipfw/dummynet.txt
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_dn_glue.c
     - copied, changed from r204610, head/sys/netinet/ipfw/ip_dn_glue.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_dn_io.c
     - copied unchanged from r204610, head/sys/netinet/ipfw/ip_dn_io.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_dn_private.h
     - copied, changed from r204610, head/sys/netinet/ipfw/ip_dn_private.h
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_fw_dynamic.c
     - copied, changed from r200583, head/sys/netinet/ipfw/ip_fw_dynamic.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_fw_log.c
     - copied, changed from r200583, head/sys/netinet/ipfw/ip_fw_log.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_fw_private.h
     - copied, changed from r200583, head/sys/netinet/ipfw/ip_fw_private.h
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_fw_sockopt.c
     - copied, changed from r200590, head/sys/netinet/ipfw/ip_fw_sockopt.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_fw_table.c
     - copied, changed from r200590, head/sys/netinet/ipfw/ip_fw_table.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/test/
     - copied from r204610, head/sys/netinet/ipfw/test/
Modified:
  user/luigi/ipfw3-r8/sbin/ipfw/Makefile
  user/luigi/ipfw3-r8/sbin/ipfw/altq.c
  user/luigi/ipfw3-r8/sbin/ipfw/dummynet.c
  user/luigi/ipfw3-r8/sbin/ipfw/ipfw.8
  user/luigi/ipfw3-r8/sbin/ipfw/ipfw2.c
  user/luigi/ipfw3-r8/sbin/ipfw/ipfw2.h
  user/luigi/ipfw3-r8/sbin/ipfw/main.c
  user/luigi/ipfw3-r8/sys/netinet/ip_dummynet.h
  user/luigi/ipfw3-r8/sys/netinet/ip_fw.h
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_dummynet.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_fw2.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_fw_nat.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/ip_fw_pfil.c
  user/luigi/ipfw3-r8/sys/netinet/ipfw/test/dn_test.h
  user/luigi/ipfw3-r8/sys/netinet/ipfw/test/mylist.h
  user/luigi/ipfw3-r8/sys/netinet/ipfw/test/test_dn_sched.c
Directory Properties:
  user/luigi/ipfw3-r8/sbin/ipfw/   (props changed)
  user/luigi/ipfw3-r8/sys/netinet/ipfw/   (props changed)

Modified: user/luigi/ipfw3-r8/sbin/ipfw/Makefile
==============================================================================
--- user/luigi/ipfw3-r8/sbin/ipfw/Makefile	Fri Mar 12 15:04:59 2010	(r205083)
+++ user/luigi/ipfw3-r8/sbin/ipfw/Makefile	Fri Mar 12 15:21:13 2010	(r205084)
@@ -3,6 +3,7 @@
 PROG=	ipfw
 SRCS=	ipfw2.c dummynet.c ipv6.c main.c nat.c altq.c
 WARNS?=	2
+DPADD=	${LIBUTIL}
 LDADD=	-lutil
 MAN=	ipfw.8
 

Modified: user/luigi/ipfw3-r8/sbin/ipfw/altq.c
==============================================================================
--- user/luigi/ipfw3-r8/sbin/ipfw/altq.c	Fri Mar 12 15:04:59 2010	(r205083)
+++ user/luigi/ipfw3-r8/sbin/ipfw/altq.c	Fri Mar 12 15:21:13 2010	(r205084)
@@ -39,6 +39,7 @@
 
 #include 		/* IFNAMSIZ */
 #include 
+#include 	/* in_addr */
 #include 
 
 /*

Modified: user/luigi/ipfw3-r8/sbin/ipfw/dummynet.c
==============================================================================
--- user/luigi/ipfw3-r8/sbin/ipfw/dummynet.c	Fri Mar 12 15:04:59 2010	(r205083)
+++ user/luigi/ipfw3-r8/sbin/ipfw/dummynet.c	Fri Mar 12 15:21:13 2010	(r205084)
@@ -1,10 +1,5 @@
 /*
- * Copyright (c) 2002-2003 Luigi Rizzo
- * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp
- * Copyright (c) 1994 Ugen J.S.Antsilevich
- *
- * Idea and grammar partially left from:
- * Copyright (c) 1993 Daniel Boulet
+ * Copyright (c) 2002-2003,2010 Luigi Rizzo
  *
  * Redistribution and use in source forms, with and without modification,
  * are permitted provided that this entire comment appears intact.
@@ -15,8 +10,6 @@
  *
  * This software is provided ``AS IS'' without any warranties of any kind.
  *
- * NEW command line interface for IP firewall facility
- *
  * $FreeBSD$
  *
  * dummynet support
@@ -24,7 +17,6 @@
 
 #include 
 #include 
-#include 
 /* XXX there are several sysctl leftover here */
 #include 
 
@@ -46,6 +38,7 @@
 #include 
 #include 	/* inet_ntoa */
 
+
 static struct _s_x dummynet_params[] = {
 	{ "plr",		TOK_PLR },
 	{ "noerror",		TOK_NOERROR },
@@ -56,27 +49,59 @@ static struct _s_x dummynet_params[] = {
 	{ "src-port",		TOK_SRCPORT },
 	{ "proto",		TOK_PROTO },
 	{ "weight",		TOK_WEIGHT },
+	{ "lmax",		TOK_LMAX },
+	{ "maxlen",		TOK_LMAX },
 	{ "all",		TOK_ALL },
-	{ "mask",		TOK_MASK },
+	{ "mask",		TOK_MASK }, /* alias for both */
+	{ "sched_mask",		TOK_SCHED_MASK },
+	{ "flow_mask",		TOK_FLOW_MASK },
 	{ "droptail",		TOK_DROPTAIL },
 	{ "red",		TOK_RED },
 	{ "gred",		TOK_GRED },
 	{ "bw",			TOK_BW },
 	{ "bandwidth",		TOK_BW },
 	{ "delay",		TOK_DELAY },
+	{ "link",		TOK_LINK },
 	{ "pipe",		TOK_PIPE },
 	{ "queue",		TOK_QUEUE },
+	{ "flowset",		TOK_FLOWSET },
+	{ "sched",		TOK_SCHED },
+	{ "pri",		TOK_PRI },
+	{ "priority",		TOK_PRI },
+	{ "type",		TOK_TYPE },
 	{ "flow-id",		TOK_FLOWID},
 	{ "dst-ipv6",		TOK_DSTIP6},
 	{ "dst-ip6",		TOK_DSTIP6},
 	{ "src-ipv6",		TOK_SRCIP6},
 	{ "src-ip6",		TOK_SRCIP6},
-	{ "profile",		TOK_PIPE_PROFILE},
+	{ "profile",		TOK_PROFILE},
 	{ "burst",		TOK_BURST},
 	{ "dummynet-params",	TOK_NULL },
 	{ NULL, 0 }	/* terminator */
 };
 
+#define O_NEXT(p, len) ((void *)((char *)p + len))
+
+static void
+oid_fill(struct dn_id *oid, int len, int type, uintptr_t id)
+{
+	oid->len = len;
+	oid->type = type;
+	oid->subtype = 0;
+	oid->id = id;
+}
+
+/* make room in the buffer and move the pointer forward */
+static void *
+o_next(struct dn_id **o, int len, int type)
+{
+	struct dn_id *ret = *o;
+	oid_fill(ret, len, type, 0);
+	*o = O_NEXT(*o, len);
+	return ret;
+}
+
+#if 0
 static int
 sort_q(void *arg, const void *pa, const void *pb)
 {
@@ -108,117 +133,81 @@ sort_q(void *arg, const void *pa, const 
 		res = 1;
 	return (int)(rev ? res : -res);
 }
+#endif
 
+/* print a mask and header for the subsequent list of flows */
 static void
-list_queues(struct dn_flow_set *fs, struct dn_flow_queue *q)
+print_mask(struct ipfw_flow_id *id)
+{
+	if (!IS_IP6_FLOW_ID(id)) {
+		printf("    "
+		    "mask: 0x%02x 0x%08x/0x%04x -> 0x%08x/0x%04x\n",
+		    id->proto,
+		    id->src_ip, id->src_port,
+		    id->dst_ip, id->dst_port);
+
+		printf("BKT Prot ___Source IP/port____ "
+		    "____Dest. IP/port____ "
+		    "Tot_pkt/bytes Pkt/Byte Drp\n");
+	} else {
+		char buf[255];
+		printf("\n        mask: proto: 0x%02x, flow_id: 0x%08x,  ",
+		    id->proto, id->flow_id6);
+		inet_ntop(AF_INET6, &(id->src_ip6), buf, sizeof(buf));
+		printf("%s/0x%04x -> ", buf, id->src_port);
+		inet_ntop(AF_INET6, &(id->dst_ip6), buf, sizeof(buf));
+		printf("%s/0x%04x\n", buf, id->dst_port);
+
+		printf("BKT ___Prot___ _flow-id_ "
+		    "______________Source IPv6/port_______________ "
+		    "_______________Dest. IPv6/port_______________ "
+		    "Tot_pkt/bytes Pkt/Byte Drp\n");
+	}
+}
+
+static void
+list_flow(struct dn_flow *ni)
 {
-	int l;
-	int index_printed, indexes = 0;
 	char buff[255];
 	struct protoent *pe;
+	struct in_addr ina;
+	struct ipfw_flow_id *id = &ni->fid;
 
-	if (fs->rq_elements == 0)
-		return;
-
-	if (co.do_sort != 0)
-		qsort_r(q, fs->rq_elements, sizeof *q, NULL, sort_q);
-
-	/* Print IPv4 flows */
-	index_printed = 0;
-	for (l = 0; l < fs->rq_elements; l++) {
-		struct in_addr ina;
-
+	pe = getprotobynumber(id->proto);
 		/* XXX: Should check for IPv4 flows */
-		if (IS_IP6_FLOW_ID(&(q[l].id)))
-			continue;
-
-		if (!index_printed) {
-			index_printed = 1;
-			if (indexes > 0)	/* currently a no-op */
-				printf("\n");
-			indexes++;
-			printf("    "
-			    "mask: 0x%02x 0x%08x/0x%04x -> 0x%08x/0x%04x\n",
-			    fs->flow_mask.proto,
-			    fs->flow_mask.src_ip, fs->flow_mask.src_port,
-			    fs->flow_mask.dst_ip, fs->flow_mask.dst_port);
-
-			printf("BKT Prot ___Source IP/port____ "
-			    "____Dest. IP/port____ "
-			    "Tot_pkt/bytes Pkt/Byte Drp\n");
-		}
-
-		printf("%3d ", q[l].hash_slot);
-		pe = getprotobynumber(q[l].id.proto);
+	printf("%3u ", (ni->oid.id) & 0xff);
+	if (!IS_IP6_FLOW_ID(id)) {
 		if (pe)
 			printf("%-4s ", pe->p_name);
 		else
-			printf("%4u ", q[l].id.proto);
-		ina.s_addr = htonl(q[l].id.src_ip);
+			printf("%4u ", id->proto);
+		ina.s_addr = htonl(id->src_ip);
 		printf("%15s/%-5d ",
-		    inet_ntoa(ina), q[l].id.src_port);
-		ina.s_addr = htonl(q[l].id.dst_ip);
+		    inet_ntoa(ina), id->src_port);
+		ina.s_addr = htonl(id->dst_ip);
 		printf("%15s/%-5d ",
-		    inet_ntoa(ina), q[l].id.dst_port);
-		printf("%4llu %8llu %2u %4u %3u\n",
-		    align_uint64(&q[l].tot_pkts),
-		    align_uint64(&q[l].tot_bytes),
-		    q[l].len, q[l].len_bytes, q[l].drops);
-		if (co.verbose)
-			printf("   S %20llu  F %20llu\n",
-			    align_uint64(&q[l].S), align_uint64(&q[l].F));
-	}
-
-	/* Print IPv6 flows */
-	index_printed = 0;
-	for (l = 0; l < fs->rq_elements; l++) {
-		if (!IS_IP6_FLOW_ID(&(q[l].id)))
-			continue;
-
-		if (!index_printed) {
-			index_printed = 1;
-			if (indexes > 0)
-				printf("\n");
-			indexes++;
-			printf("\n        mask: proto: 0x%02x, flow_id: 0x%08x,  ",
-			    fs->flow_mask.proto, fs->flow_mask.flow_id6);
-			inet_ntop(AF_INET6, &(fs->flow_mask.src_ip6),
-			    buff, sizeof(buff));
-			printf("%s/0x%04x -> ", buff, fs->flow_mask.src_port);
-			inet_ntop( AF_INET6, &(fs->flow_mask.dst_ip6),
-			    buff, sizeof(buff) );
-			printf("%s/0x%04x\n", buff, fs->flow_mask.dst_port);
-
-			printf("BKT ___Prot___ _flow-id_ "
-			    "______________Source IPv6/port_______________ "
-			    "_______________Dest. IPv6/port_______________ "
-			    "Tot_pkt/bytes Pkt/Byte Drp\n");
-		}
-		printf("%3d ", q[l].hash_slot);
-		pe = getprotobynumber(q[l].id.proto);
+		    inet_ntoa(ina), id->dst_port);
+	} else {
+		/* Print IPv6 flows */
 		if (pe != NULL)
 			printf("%9s ", pe->p_name);
 		else
-			printf("%9u ", q[l].id.proto);
-		printf("%7d  %39s/%-5d ", q[l].id.flow_id6,
-		    inet_ntop(AF_INET6, &(q[l].id.src_ip6), buff, sizeof(buff)),
-		    q[l].id.src_port);
+			printf("%9u ", id->proto);
+		printf("%7d  %39s/%-5d ", id->flow_id6,
+		    inet_ntop(AF_INET6, &(id->src_ip6), buff, sizeof(buff)),
+		    id->src_port);
 		printf(" %39s/%-5d ",
-		    inet_ntop(AF_INET6, &(q[l].id.dst_ip6), buff, sizeof(buff)),
-		    q[l].id.dst_port);
-		printf(" %4llu %8llu %2u %4u %3u\n",
-		    align_uint64(&q[l].tot_pkts),
-		    align_uint64(&q[l].tot_bytes),
-		    q[l].len, q[l].len_bytes, q[l].drops);
-		if (co.verbose)
-			printf("   S %20llu  F %20llu\n",
-			    align_uint64(&q[l].S),
-			    align_uint64(&q[l].F));
+		    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),
+	    ni->length, ni->len_bytes, ni->drops);
 }
 
 static void
-print_flowset_parms(struct dn_flow_set *fs, char *prefix)
+print_flowset_parms(struct dn_fs *fs, char *prefix)
 {
 	int l;
 	char qs[30];
@@ -226,7 +215,7 @@ print_flowset_parms(struct dn_flow_set *
 	char red[90];	/* Display RED parameters */
 
 	l = fs->qsize;
-	if (fs->flags_fs & DN_QSIZE_IS_BYTES) {
+	if (fs->flags & DN_QSIZE_BYTES) {
 		if (l >= 8192)
 			sprintf(qs, "%d KB", l / 1024);
 		else
@@ -237,23 +226,34 @@ print_flowset_parms(struct dn_flow_set *
 		sprintf(plr, "plr %f", 1.0 * fs->plr / (double)(0x7fffffff));
 	else
 		plr[0] = '\0';
-	if (fs->flags_fs & DN_IS_RED)	/* RED parameters */
+
+	if (fs->flags & DN_IS_RED)	/* RED parameters */
 		sprintf(red,
 		    "\n\t %cRED w_q %f min_th %d max_th %d max_p %f",
-		    (fs->flags_fs & DN_IS_GENTLE_RED) ? 'G' : ' ',
+		    (fs->flags & DN_IS_GENTLE_RED) ? 'G' : ' ',
 		    1.0 * fs->w_q / (double)(1 << SCALE_RED),
-		    SCALE_VAL(fs->min_th),
-		    SCALE_VAL(fs->max_th),
+		    fs->min_th,
+		    fs->max_th,
 		    1.0 * fs->max_p / (double)(1 << SCALE_RED));
 	else
 		sprintf(red, "droptail");
 
-	printf("%s %s%s %d queues (%d buckets) %s\n",
-	    prefix, qs, plr, fs->rq_elements, fs->rq_size, red);
+	if (prefix[0]) {
+	    printf("%s %s%s %d queues (%d buckets) %s\n",
+		prefix, qs, plr, fs->oid.id, fs->buckets, red);
+	    prefix[0] = '\0';
+	} else {
+	    printf("q%05d %s%s %d flows (%d buckets) sched %d "
+			"weight %d lmax %d pri %d %s\n",
+		fs->fs_nr, qs, plr, fs->oid.id, fs->buckets,
+		fs->sched_nr, fs->par[0], fs->par[1], fs->par[2], red);
+	    if (fs->flags & DN_HAVE_MASK)
+		print_mask(&fs->flow_mask);
+	}
 }
 
 static void
-print_extra_delay_parms(struct dn_pipe *p)
+print_extra_delay_parms(struct dn_profile *p)
 {
 	double loss;
 	if (p->samples_no <= 0)
@@ -265,105 +265,126 @@ print_extra_delay_parms(struct dn_pipe *
 		p->name, loss, p->samples_no);
 }
 
-void
-ipfw_list_pipes(void *data, uint nbytes, int ac, char *av[])
+static void
+flush_buf(char *buf)
 {
-	int rulenum;
-	void *next = data;
-	struct dn_pipe *p = (struct dn_pipe *) data;
-	struct dn_flow_set *fs;
-	struct dn_flow_queue *q;
-	int l;
-
-	if (ac > 0)
-		rulenum = strtoul(*av++, NULL, 10);
-	else
-		rulenum = 0;
-	for (; nbytes >= sizeof *p; p = (struct dn_pipe *)next) {
-		double b = p->bandwidth;
-		char buf[30];
-		char prefix[80];
-		char burst[5 + 7];
-
-		if (SLIST_NEXT(p, next) != (struct dn_pipe *)DN_IS_PIPE)
-			break;	/* done with pipes, now queues */
-
-		/*
-		 * compute length, as pipe have variable size
-		 */
-		l = sizeof(*p) + p->fs.rq_elements * sizeof(*q);
-		next = (char *)p + l;
-		nbytes -= l;
-
-		if ((rulenum != 0 && rulenum != p->pipe_nr) || co.do_pipe == 2)
-			continue;
-
-		/*
-		 * Print rate (or clocking interface)
-		 */
-		if (p->if_name[0] != '\0')
-			sprintf(buf, "%s", p->if_name);
-		else if (b == 0)
-			sprintf(buf, "unlimited");
-		else if (b >= 1000000)
-			sprintf(buf, "%7.3f Mbit/s", b/1000000);
-		else if (b >= 1000)
-			sprintf(buf, "%7.3f Kbit/s", b/1000);
-		else
-			sprintf(buf, "%7.3f bit/s ", b);
-
-		sprintf(prefix, "%05d: %s %4d ms ",
-		    p->pipe_nr, buf, p->delay);
-
-		print_flowset_parms(&(p->fs), prefix);
-
-		if (humanize_number(burst, sizeof(burst), p->burst,
-		    "Byte", HN_AUTOSCALE, 0) < 0 || co.verbose)
-			printf("\t burst: %ju Byte\n", p->burst);
-		else
-			printf("\t burst: %s\n", burst);
-
-		print_extra_delay_parms(p);
-
-		q = (struct dn_flow_queue *)(p+1);
-		list_queues(&(p->fs), q);
-	}
-	for (fs = next; nbytes >= sizeof *fs; fs = next) {
-		char prefix[80];
+	if (buf[0])
+		printf("%s\n", buf);
+	buf[0] = '\0';
+}
+	
+/*
+ * generic list routine. We expect objects in a specific order, i.e.
+ * PIPES AND SCHEDULERS:
+ *	link; scheduler; internal flowset if any; instances
+ * we can tell a pipe from the number.
+ *
+ * FLOWSETS:
+ *	flowset; queues;
+ * link i (int queue); scheduler i; si(i) { flowsets() : queues }
+ */
+static void
+list_pipes(struct dn_id *oid, struct dn_id *end)
+{
+    char buf[160];	/* pending buffer */
+    buf[0] = '\0';
 
-		if (SLIST_NEXT(fs, next) != (struct dn_flow_set *)DN_IS_QUEUE)
-			break;
-		l = sizeof(*fs) + fs->rq_elements * sizeof(*q);
-		next = (char *)fs + l;
-		nbytes -= l;
+    for (; oid != end; oid = O_NEXT(oid, oid->len)) {
+	if (oid->len < sizeof(*oid))
+		errx(1, "invalid oid len %d\n", oid->len);
+
+	switch (oid->type) {
+	default:
+	    flush_buf(buf);
+	    printf("unrecognized object %d size %d\n", oid->type, oid->len);
+	    break;
+	case DN_TEXT: /* list of attached flowsets */
+	    {
+		int i, l;
+		struct {
+			struct dn_id id;
+			uint32_t p[0];
+		} *d = (void *)oid;
+		l = (oid->len - sizeof(*oid))/sizeof(d->p[0]);
+		if (l == 0)
+		    break;
+		printf("   Children flowsets: ");
+		for (i = 0; i < l; i++)
+			printf("%u ", d->p[i]);
+		printf("\n");
+		break;
+	    }
+	case DN_CMD_GET:
+	    if (co.verbose)
+		printf("answer for cmd %d, len %d\n", oid->type, oid->id);
+	    break;
+	case DN_SCH: {
+	    struct dn_sch *s = (struct dn_sch *)oid;
+	    flush_buf(buf);
+	    printf(" sched %d type %s flags 0x%x %d buckets %d active\n",
+			s->sched_nr,
+			s->name, s->flags, s->buckets, s->oid.id);
+	    if (s->flags & DN_HAVE_MASK)
+		print_mask(&s->sched_mask);
+	    }
+	    break;
 
-		if (rulenum != 0 && ((rulenum != fs->fs_nr && co.do_pipe == 2) ||
-		    (rulenum != fs->parent_nr && co.do_pipe == 1))) {
-			continue;
-		}
+	case DN_FLOW:
+	    list_flow((struct dn_flow *)oid);
+	    break;
+
+	case DN_LINK: {
+	    struct dn_link *p = (struct dn_link *)oid;
+	    double b = p->bandwidth;
+	    char bwbuf[30];
+	    char burst[5 + 7];
+
+	    /* This starts a new object so flush buffer */
+	    flush_buf(buf);
+	    /* data rate */
+	    if (b == 0)
+		sprintf(bwbuf, "unlimited     ");
+	    else if (b >= 1000000)
+		sprintf(bwbuf, "%7.3f Mbit/s", b/1000000);
+	    else if (b >= 1000)
+		sprintf(bwbuf, "%7.3f Kbit/s", b/1000);
+	    else
+		sprintf(bwbuf, "%7.3f bit/s ", b);
+
+	    if (humanize_number(burst, sizeof(burst), p->burst,
+		    "", HN_AUTOSCALE, 0) < 0 || co.verbose)
+		sprintf(burst, "%d", (int)p->burst);
+	    sprintf(buf, "%05d: %s %4d ms burst %s",
+		p->link_nr % DN_MAX_ID, bwbuf, p->delay, burst);
+	    }
+	    break;
 
-		q = (struct dn_flow_queue *)(fs+1);
-		sprintf(prefix, "q%05d: weight %d pipe %d ",
-		    fs->fs_nr, fs->weight, fs->parent_nr);
-		print_flowset_parms(fs, prefix);
-		list_queues(fs, q);
+	case DN_FS:
+	    print_flowset_parms((struct dn_fs *)oid, buf);
+	    break;
+	case DN_PROFILE:
+	    flush_buf(buf);
+	    print_extra_delay_parms((struct dn_profile *)oid);
 	}
+	flush_buf(buf); // XXX does it really go here ?
+    }
 }
 
 /*
- * Delete pipe or queue i
+ * Delete pipe, queue or scheduler i
  */
 int
-ipfw_delete_pipe(int pipe_or_queue, int i)
+ipfw_delete_pipe(int do_pipe, int i)
 {
-	struct dn_pipe p;
-
-	memset(&p, 0, sizeof p);
-	if (pipe_or_queue == 1)
-		p.pipe_nr = i;		/* pipe */
-	else
-		p.fs.fs_nr = i;		/* queue */
-	i = do_cmd(IP_DUMMYNET_DEL, &p, sizeof p);
+	struct {
+		struct dn_id oid;
+		uintptr_t a[1];	/* add more if we want a list */
+	} cmd;
+	oid_fill((void *)&cmd, sizeof(cmd), DN_CMD_DELETE, DN_API_VERSION);
+	cmd.oid.subtype = (do_pipe == 1) ? DN_LINK :
+		( (do_pipe == 2) ? DN_FS : DN_SCH);
+	cmd.a[0] = i;
+	i = do_cmd(IP_DUMMYNET3, &cmd, cmd.oid.len);
 	if (i) {
 		i = 1;
 		warn("rule %u: setsockopt(IP_DUMMYNET_DEL)", i);
@@ -400,7 +421,7 @@ ipfw_delete_pipe(int pipe_or_queue, int 
  * The empirical curve may have both vertical and horizontal lines.
  * Vertical lines represent constant delay for a range of
  * probabilities; horizontal lines correspond to a discontinuty
- * in the delay distribution: the pipe will use the largest delay
+ * in the delay distribution: the link will use the largest delay
  * for a given probability.
  * 
  * To pass the curve to dummynet, we must store the parameters
@@ -490,9 +511,12 @@ static void
 read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen)
 {
 	if (*bandwidth != -1)
-		warn("duplicate token, override bandwidth value!");
+		warnx("duplicate token, override bandwidth value!");
 
 	if (arg[0] >= 'a' && arg[0] <= 'z') {
+		if (!if_name) {
+			errx(1, "no if support");
+		}
 		if (namelen >= IFNAMSIZ)
 			warn("interface name truncated");
 		namelen--;
@@ -521,7 +545,8 @@ read_bandwidth(char *arg, int *bandwidth
 			errx(EX_DATAERR, "bandwidth too large");
 
 		*bandwidth = bw;
-		if_name[0] = '\0';
+		if (if_name)
+			if_name[0] = '\0';
 	}
 }
 
@@ -551,7 +576,8 @@ compare_points(const void *vp1, const vo
 #define ED_EFMT(s) EX_DATAERR,"error in %s at line %d: "#s,filename,lineno
 
 static void
-load_extra_delays(const char *filename, struct dn_pipe *p)
+load_extra_delays(const char *filename, struct dn_profile *p,
+	struct dn_link *link)
 {
 	char    line[ED_MAX_LINE_LEN];
 	FILE    *f;
@@ -566,6 +592,9 @@ load_extra_delays(const char *filename, 
 	struct point    points[ED_MAX_SAMPLES_NO];
 	int     points_no = 0;
 
+	/* XXX link never NULL? */
+	p->link_nr = link->link_nr;
+
 	profile_name[0] = '\0';
 	f = fopen(filename, "r");
 	if (f == NULL)
@@ -606,7 +635,8 @@ load_extra_delays(const char *filename, 
 				ED_MAX_SAMPLES_NO);
 		    do_points = 0;
 		} else if (!strcasecmp(name, ED_TOK_BW)) {
-		    read_bandwidth(arg, &p->bandwidth, p->if_name, sizeof(p->if_name));
+		    char buf[IFNAMSIZ];
+		    read_bandwidth(arg, &link->bandwidth, buf, sizeof(buf));
 		} else if (!strcasecmp(name, ED_TOK_LOSS)) {
 		    if (loss != -1.0)
 			errx(ED_EFMT("duplicated token: %s"), name);
@@ -676,17 +706,17 @@ load_extra_delays(const char *filename, 
 	    double y2 = points[i+1].prob * samples;
 	    double x2 = points[i+1].delay;
 
-	    int index = y1;
+	    int ix = y1;
 	    int stop = y2;
 
 	    if (x1 == x2) {
-		for (; indexsamples[index] = x1;
+		for (; ixsamples[ix] = x1;
 	    } else {
 		double m = (y2-y1)/(x2-x1);
 		double c = y1 - m*x1;
-		for (; indexsamples[index] = (index - c)/m;
+		for (; ixsamples[ix] = (ix - c)/m;
 	    }
 	}
 	p->samples_no = samples;
@@ -694,27 +724,120 @@ load_extra_delays(const char *filename, 
 	strncpy(p->name, profile_name, sizeof(p->name));
 }
 
+/*
+ * configuration of pipes, schedulers, flowsets.
+ * When we configure a new scheduler, an empty pipe is created, so:
+ * 
+ * do_pipe = 1 -> "pipe N config ..." only for backward compatibility
+ *	sched N+Delta type fifo sched_mask ...
+ *	pipe N+Delta 
+ *	flowset N+Delta pipe N+Delta (no parameters)
+ *	sched N type wf2q+ sched_mask ...
+ *	pipe N 
+ *
+ * do_pipe = 2 -> flowset N config
+ *	flowset N parameters
+ *
+ * do_pipe = 3 -> sched N config
+ *	sched N parameters (default no pipe)
+ *	optional Pipe N config ...
+ * pipe ==>
+ */
 void
 ipfw_config_pipe(int ac, char **av)
 {
-	int samples[ED_MAX_SAMPLES_NO];
-	struct dn_pipe p;
-	int i;
+	int i, j;
 	char *end;
 	void *par = NULL;
-
-	memset(&p, 0, sizeof p);
-	p.bandwidth = -1;
+	struct dn_id *buf, *base;
+	struct dn_sch *sch = NULL;
+	struct dn_link *p = NULL;
+	struct dn_fs *fs = NULL;
+	struct dn_profile *pf = NULL;
+	struct ipfw_flow_id *mask = NULL;
+	int lmax;
+	uint32_t _foo = 0, *flags = &_foo , *buckets = &_foo;
+
+	/*
+	 * allocate space for 1 header,
+	 * 1 scheduler, 1 link, 1 flowset, 1 profile
+	 */
+	lmax = sizeof(struct dn_id);	/* command header */
+	lmax += sizeof(struct dn_sch) + sizeof(struct dn_link) +
+		sizeof(struct dn_fs) + sizeof(struct dn_profile);
 
 	av++; ac--;
 	/* Pipe number */
 	if (ac && isdigit(**av)) {
 		i = atoi(*av); av++; ac--;
-		if (co.do_pipe == 1)
-			p.pipe_nr = i;
-		else
-			p.fs.fs_nr = i;
+	} else
+		i = -1;
+	if (i <= 0)
+		errx(EX_USAGE, "need a pipe/flowset/sched number");
+	base = buf = safe_calloc(1, lmax);
+	/* all commands start with a 'CONFIGURE' and a version */
+	o_next(&buf, sizeof(struct dn_id), DN_CMD_CONFIG);
+	base->id = DN_API_VERSION;
+
+	switch (co.do_pipe) {
+	case 1: /* "pipe N config ..." */
+		/* Allocate space for the WF2Q+ scheduler, its link
+		 * and the FIFO flowset. Set the number, but leave
+		 * the scheduler subtype and other parameters to 0
+		 * so the kernel will use appropriate defaults.
+		 * XXX todo: add a flag to record if a parameter
+		 * is actually configured.
+		 * If we do a 'pipe config' mask -> sched_mask.
+		 * The FIFO scheduler and link are derived from the
+		 * WF2Q+ one in the kernel.
+		 */
+		sch = o_next(&buf, sizeof(*sch), DN_SCH);
+		p = o_next(&buf, sizeof(*p), DN_LINK);
+		fs = o_next(&buf, sizeof(*fs), DN_FS);
+
+		sch->sched_nr = i;
+		sch->oid.subtype = 0;	/* defaults to WF2Q+ */
+		mask = &sch->sched_mask;
+		flags = &sch->flags;
+		buckets = &sch->buckets;
+		*flags |= DN_PIPE_CMD;
+
+		p->link_nr = i;
+
+		/* This flowset is only for the FIFO scheduler */
+		fs->fs_nr = i + 2*DN_MAX_ID;
+		fs->sched_nr = i + DN_MAX_ID;
+		break;
+
+	case 2: /* "queue N config ... " */
+		fs = o_next(&buf, sizeof(*fs), DN_FS);
+		fs->fs_nr = i;
+		mask = &fs->flow_mask;
+		flags = &fs->flags;
+		buckets = &fs->buckets;
+		break;
+
+	case 3: /* "sched N config ..." */
+		sch = o_next(&buf, sizeof(*sch), DN_SCH);
+		fs = o_next(&buf, sizeof(*fs), DN_FS);
+		sch->sched_nr = i;
+		mask = &sch->sched_mask;
+		flags = &sch->flags;
+		buckets = &sch->buckets;
+		/* fs is used only with !MULTIQUEUE schedulers */
+		fs->fs_nr = i + DN_MAX_ID;
+		fs->sched_nr = i;
+		break;
 	}
+	/* set to -1 those fields for which we want to reuse existing
+	 * values from the kernel.
+	 * Also, *_nr and subtype = 0 mean reuse the value from the kernel.
+	 * XXX todo: support reuse of the mask.
+	 */
+	if (p)
+		p->bandwidth = -1;
+	for (j = 0; j < sizeof(fs->par)/sizeof(fs->par[0]); j++)
+		fs->par[j] = -1;
 	while (ac > 0) {
 		double d;
 		int tok = match_token(dummynet_params, *av);
@@ -722,41 +845,48 @@ ipfw_config_pipe(int ac, char **av)
 
 		switch(tok) {
 		case TOK_NOERROR:
-			p.fs.flags_fs |= DN_NOERROR;
+			NEED(fs, "noerror is only for pipes");
+			fs->flags |= DN_NOERROR;
 			break;
 
 		case TOK_PLR:
+			NEED(fs, "plr is only for pipes");
 			NEED1("plr needs argument 0..1\n");
 			d = strtod(av[0], NULL);
 			if (d > 1)
 				d = 1;
 			else if (d < 0)
 				d = 0;
-			p.fs.plr = (int)(d*0x7fffffff);
+			fs->plr = (int)(d*0x7fffffff);
 			ac--; av++;
 			break;
 
 		case TOK_QUEUE:
+			NEED(fs, "queue is only for pipes or flowsets");
 			NEED1("queue needs queue size\n");
 			end = NULL;
-			p.fs.qsize = strtoul(av[0], &end, 0);
+			fs->qsize = strtoul(av[0], &end, 0);
 			if (*end == 'K' || *end == 'k') {
-				p.fs.flags_fs |= DN_QSIZE_IS_BYTES;
-				p.fs.qsize *= 1024;
+				fs->flags |= DN_QSIZE_BYTES;
+				fs->qsize *= 1024;
 			} else if (*end == 'B' ||
 			    _substrcmp2(end, "by", "bytes") == 0) {
-				p.fs.flags_fs |= DN_QSIZE_IS_BYTES;
+				fs->flags |= DN_QSIZE_BYTES;
 			}
 			ac--; av++;
 			break;
 
 		case TOK_BUCKETS:
+			NEED(fs, "buckets is only for pipes or flowsets");
 			NEED1("buckets needs argument\n");
-			p.fs.rq_size = strtoul(av[0], NULL, 0);
+			*buckets = strtoul(av[0], NULL, 0);
 			ac--; av++;
 			break;
 
+		case TOK_FLOW_MASK:
+		case TOK_SCHED_MASK:
 		case TOK_MASK:
+			NEED(mask, "tok_mask");
 			NEED1("mask needs mask specifier\n");
 			/*
 			 * per-flow queue, mask is dst_ip, dst_port,
@@ -764,7 +894,7 @@ ipfw_config_pipe(int ac, char **av)
 			 */
 			par = NULL;
 
-			bzero(&p.fs.flow_mask, sizeof(p.fs.flow_mask));
+			bzero(mask, sizeof(*mask));
 			end = NULL;
 
 			while (ac >= 1) {
@@ -781,43 +911,48 @@ ipfw_config_pipe(int ac, char **av)
 				    /*
 				     * special case, all bits significant
 				     */
-				    p.fs.flow_mask.dst_ip = ~0;
-				    p.fs.flow_mask.src_ip = ~0;
-				    p.fs.flow_mask.dst_port = ~0;
-				    p.fs.flow_mask.src_port = ~0;
-				    p.fs.flow_mask.proto = ~0;
-				    n2mask(&(p.fs.flow_mask.dst_ip6), 128);
-				    n2mask(&(p.fs.flow_mask.src_ip6), 128);
-				    p.fs.flow_mask.flow_id6 = ~0;
-				    p.fs.flags_fs |= DN_HAVE_FLOW_MASK;
+				    mask->dst_ip = ~0;
+				    mask->src_ip = ~0;
+				    mask->dst_port = ~0;
+				    mask->src_port = ~0;
+				    mask->proto = ~0;
+				    n2mask(&mask->dst_ip6, 128);
+				    n2mask(&mask->src_ip6, 128);
+				    mask->flow_id6 = ~0;
+				    *flags |= DN_HAVE_MASK;
 				    goto end_mask;
 
 			    case TOK_DSTIP:
-				    p32 = &p.fs.flow_mask.dst_ip;
+				    mask->addr_type = 4;
+				    p32 = &mask->dst_ip;
 				    break;
 
 			    case TOK_SRCIP:
-				    p32 = &p.fs.flow_mask.src_ip;
+				    mask->addr_type = 4;
+				    p32 = &mask->src_ip;
 				    break;
 
 			    case TOK_DSTIP6:
-				    pa6 = &(p.fs.flow_mask.dst_ip6);
+				    mask->addr_type = 6;
+				    pa6 = &mask->dst_ip6;
 				    break;
 			    
 			    case TOK_SRCIP6:
-				    pa6 = &(p.fs.flow_mask.src_ip6);
+				    mask->addr_type = 6;
+				    pa6 = &mask->src_ip6;
 				    break;
 
 			    case TOK_FLOWID:
-				    p20 = &p.fs.flow_mask.flow_id6;
+				    mask->addr_type = 6;
+				    p20 = &mask->flow_id6;
 				    break;
 
 			    case TOK_DSTPORT:
-				    p16 = &p.fs.flow_mask.dst_port;
+				    p16 = &mask->dst_port;
 				    break;
 
 			    case TOK_SRCPORT:
-				    p16 = &p.fs.flow_mask.src_port;
+				    p16 = &mask->src_port;
 				    break;
 
 			    case TOK_PROTO:
@@ -857,10 +992,10 @@ ipfw_config_pipe(int ac, char **av)
 				    if (a > 0xFF)
 					    errx(EX_DATAERR,
 						"proto mask must be 8 bit");
-				    p.fs.flow_mask.proto = (uint8_t)a;
+				    fs->flow_mask.proto = (uint8_t)a;
 			    }
 			    if (a != 0)
-				    p.fs.flags_fs |= DN_HAVE_FLOW_MASK;
+				    *flags |= DN_HAVE_MASK;
 			    ac--; av++;
 			} /* end while, config masks */
 end_mask:
@@ -869,9 +1004,9 @@ end_mask:
 		case TOK_RED:
 		case TOK_GRED:
 			NEED1("red/gred needs w_q/min_th/max_th/max_p\n");
-			p.fs.flags_fs |= DN_IS_RED;
+			fs->flags |= DN_IS_RED;
 			if (tok == TOK_GRED)
-				p.fs.flags_fs |= DN_IS_GENTLE_RED;
+				fs->flags |= DN_IS_GENTLE_RED;
 			/*
 			 * the format for parameters is w_q/min_th/max_th/max_p
 			 */
@@ -879,82 +1014,108 @@ end_mask:
 			    double w_q = strtod(end, NULL);
 			    if (w_q > 1 || w_q <= 0)
 				errx(EX_DATAERR, "0 < w_q <= 1");
-			    p.fs.w_q = (int) (w_q * (1 << SCALE_RED));
+			    fs->w_q = (int) (w_q * (1 << SCALE_RED));
 			}
 			if ((end = strsep(&av[0], "/"))) {
-			    p.fs.min_th = strtoul(end, &end, 0);
+			    fs->min_th = strtoul(end, &end, 0);
 			    if (*end == 'K' || *end == 'k')
-				p.fs.min_th *= 1024;
+				fs->min_th *= 1024;
 			}
 			if ((end = strsep(&av[0], "/"))) {
-			    p.fs.max_th = strtoul(end, &end, 0);
+			    fs->max_th = strtoul(end, &end, 0);
 			    if (*end == 'K' || *end == 'k')
-				p.fs.max_th *= 1024;
+				fs->max_th *= 1024;
 			}
 			if ((end = strsep(&av[0], "/"))) {
 			    double max_p = strtod(end, NULL);
 			    if (max_p > 1 || max_p <= 0)
 				errx(EX_DATAERR, "0 < max_p <= 1");
-			    p.fs.max_p = (int)(max_p * (1 << SCALE_RED));
+			    fs->max_p = (int)(max_p * (1 << SCALE_RED));
 			}
 			ac--; av++;
 			break;
 
 		case TOK_DROPTAIL:
-			p.fs.flags_fs &= ~(DN_IS_RED|DN_IS_GENTLE_RED);
+			NEED(fs, "droptail is only for flowsets");
+			fs->flags &= ~(DN_IS_RED|DN_IS_GENTLE_RED);
 			break;
 
 		case TOK_BW:
+			NEED(p, "bw is only for links");
 			NEED1("bw needs bandwidth or interface\n");
-			if (co.do_pipe != 1)
-			    errx(EX_DATAERR, "bandwidth only valid for pipes");
-			read_bandwidth(av[0], &p.bandwidth, p.if_name, sizeof(p.if_name));
+			read_bandwidth(av[0], &p->bandwidth, NULL, 0);
 			ac--; av++;
 			break;
 
 		case TOK_DELAY:
-			if (co.do_pipe != 1)
-				errx(EX_DATAERR, "delay only valid for pipes");
+			NEED(p, "delay is only for links");
 			NEED1("delay needs argument 0..10000ms\n");
-			p.delay = strtoul(av[0], NULL, 0);
+			p->delay = strtoul(av[0], NULL, 0);
+			ac--; av++;
+			break;
+
+		case TOK_TYPE: {
+			int l;
+			NEED(sch, "type is only for schedulers");
+			NEED1("type needs a string");
+			l = strlen(av[0]);
+			if (l == 0 || l > 15)
+				errx(1, "type %s too long\n", av[0]);
+			strcpy(sch->name, av[0]);
+			sch->oid.subtype = 0; /* use string */
 			ac--; av++;
 			break;

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

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 17:45:27 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A4B30106566C;
	Fri, 12 Mar 2010 17:45:27 +0000 (UTC) (envelope-from john@baldwin.cx)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 7621D8FC16;
	Fri, 12 Mar 2010 17:45:27 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 14B4046B3B;
	Fri, 12 Mar 2010 12:45:27 -0500 (EST)
Received: from zion.baldwin.cx (pool-98-109-181-99.nwrknj.fios.verizon.net
	[98.109.181.99])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 4C5BC8A026;
	Fri, 12 Mar 2010 12:45:26 -0500 (EST)
From: John Baldwin 
To: Juli Mallett 
Date: Fri, 12 Mar 2010 12:03:44 -0500
User-Agent: KMail/1.12.4 (FreeBSD/7.3-PRERELEASE; KDE/4.3.4; i386; ; )
References: <201003112032.o2BKWTrG089154@svn.freebsd.org>
In-Reply-To: <201003112032.o2BKWTrG089154@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201003121203.44340.john@baldwin.cx>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Fri, 12 Mar 2010 12:45:26 -0500 (EST)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.3 required=4.2 tests=AWL,BAYES_00,
	FH_HOST_EQ_VERIZON_P,RDNS_DYNAMIC autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: Re: svn commit: r205025 - user/jmallett/octeon/sys/mips/mips
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 17:45:27 -0000

On Thursday 11 March 2010 03:32:29 pm Juli Mallett wrote:
> Author: jmallett
> Date: Thu Mar 11 20:32:28 2010
> New Revision: 205025
> URL: http://svn.freebsd.org/changeset/base/205025
> 
> Log:
>   I don't know that a critical section is required here, but if it is we
>  really don't want to get interrupted between reading the counter and
>  calculating the ticks.

In practice I think cputicks are only queried while holding a spin lock (so 
interrupts are disabled).  Part of the comment before this is wrong as the 
cputicks are completely divorced from the timecounter code, so the tc code 
handling wrapping doesn't help any.  However, if there is a way to use a 
single instruction to read all 64-bits of the ticker on mips64, it would 
probably be best to add a mips64-specific ticker method and use that for 
set_cputicker() instead of this one.

-- 
John Baldwin

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 19:29:01 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE3CB1065674;
	Fri, 12 Mar 2010 19:29:01 +0000 (UTC)
	(envelope-from juli@clockworksquid.com)
Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153])
	by mx1.freebsd.org (Postfix) with ESMTP id 66C8B8FC0A;
	Fri, 12 Mar 2010 19:29:01 +0000 (UTC)
Received: by fg-out-1718.google.com with SMTP id e21so466157fga.13
	for ; Fri, 12 Mar 2010 11:29:00 -0800 (PST)
MIME-Version: 1.0
Sender: juli@clockworksquid.com
Received: by 10.103.86.39 with SMTP id o39mr3151565mul.58.1268422140190; Fri, 
	12 Mar 2010 11:29:00 -0800 (PST)
In-Reply-To: <201003121203.44340.john@baldwin.cx>
References: <201003112032.o2BKWTrG089154@svn.freebsd.org>
	<201003121203.44340.john@baldwin.cx>
From: Juli Mallett 
Date: Fri, 12 Mar 2010 11:28:40 -0800
X-Google-Sender-Auth: 076c9f9306f2a437
Message-ID: 
To: John Baldwin 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: Re: svn commit: r205025 - user/jmallett/octeon/sys/mips/mips
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 19:29:02 -0000

On Fri, Mar 12, 2010 at 09:03, John Baldwin  wrote:
> On Thursday 11 March 2010 03:32:29 pm Juli Mallett wrote:
>> Author: jmallett
>> Date: Thu Mar 11 20:32:28 2010
>> New Revision: 205025
>> URL: http://svn.freebsd.org/changeset/base/205025
>>
>> Log:
>> =A0 I don't know that a critical section is required here, but if it is =
we
>> =A0really don't want to get interrupted between reading the counter and
>> =A0calculating the ticks.
>
> In practice I think cputicks are only queried while holding a spin lock (=
so
> interrupts are disabled). =A0Part of the comment before this is wrong as =
the
> cputicks are completely divorced from the timecounter code, so the tc cod=
e
> handling wrapping doesn't help any. =A0However, if there is a way to use =
a
> single instruction to read all 64-bits of the ticker on mips64, it would
> probably be best to add a mips64-specific ticker method and use that for
> set_cputicker() instead of this one.

Alas, that comment is the only reference I can find to a 64-bit count
register on any MIPS platform when I set out looking as I implemented
exactly that.  I suspected the critical sections were gratuitous, but
wanted to at least make the code do look less wrong, even if it is
still wrong.  Thanks for clarifying that we're always in a spinlock
there.

Juli.

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 19:29:27 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CAEC2106564A;
	Fri, 12 Mar 2010 19:29:27 +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 BB6308FC21;
	Fri, 12 Mar 2010 19: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 o2CJTRZp091907;
	Fri, 12 Mar 2010 19:29:27 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2CJTRgE091905;
	Fri, 12 Mar 2010 19:29:27 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201003121929.o2CJTRgE091905@svn.freebsd.org>
From: Kip Macy 
Date: Fri, 12 Mar 2010 19:29:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205094 -
	user/kmacy/head_zfs_updates/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 19:29:27 -0000

Author: kmacy
Date: Fri Mar 12 19:29:27 2010
New Revision: 205094
URL: http://svn.freebsd.org/changeset/base/205094

Log:
  don't block on stream locking, too many parallel prefetches can
  kill performance

Modified:
  user/kmacy/head_zfs_updates/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c

Modified: user/kmacy/head_zfs_updates/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
==============================================================================
--- user/kmacy/head_zfs_updates/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Fri Mar 12 19:26:45 2010	(r205093)
+++ user/kmacy/head_zfs_updates/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Fri Mar 12 19:29:27 2010	(r205094)
@@ -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:
 
 			reset = !prefetched && zs->zst_len > 1;
 
-			mutex_enter(&zs->zst_lock);
-
+			if (mutex_tryenter(&zs->zst_lock) == 0) {
+				rc = 1;
+				goto out;
+			}
 			if (zh->zst_offset != zs->zst_offset + zs->zst_len) {
 				mutex_exit(&zs->zst_lock);
 				goto top;
@@ -363,8 +365,10 @@ top:
 
 			reset = !prefetched && zs->zst_len > 1;
 
-			mutex_enter(&zs->zst_lock);
-
+			if (mutex_tryenter(&zs->zst_lock) == 0) {
+				rc = 1;
+				goto out;
+			}
 			if (zh->zst_offset != zs->zst_offset - zh->zst_len) {
 				mutex_exit(&zs->zst_lock);
 				goto top;
@@ -391,8 +395,10 @@ top:
 		    zs->zst_len) && (zs->zst_len != zs->zst_stride)) {
 			/* strided forward access */
 
-			mutex_enter(&zs->zst_lock);
-
+			if (mutex_tryenter(&zs->zst_lock) == 0) {
+				rc = 1;
+				goto out;
+			}
 			if ((zh->zst_offset - zs->zst_offset - zs->zst_stride >=
 			    zs->zst_len) || (zs->zst_len == zs->zst_stride)) {
 				mutex_exit(&zs->zst_lock);
@@ -408,8 +414,10 @@ top:
 		    zs->zst_len) && (zs->zst_len != zs->zst_stride)) {
 			/* strided reverse access */
 
-			mutex_enter(&zs->zst_lock);
-
+			if (mutex_tryenter(&zs->zst_lock) == 0) {
+				rc = 1;
+				goto out;
+			}
 			if ((zh->zst_offset - zs->zst_offset + zs->zst_stride >=
 			    zs->zst_len) || (zs->zst_len == zs->zst_stride)) {
 				mutex_exit(&zs->zst_lock);

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 21:06:35 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E413D1065670;
	Fri, 12 Mar 2010 21:06:35 +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 D4F108FC18;
	Fri, 12 Mar 2010 21:06: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 o2CL6ZHB013862;
	Fri, 12 Mar 2010 21:06:35 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2CL6Zlq013860;
	Fri, 12 Mar 2010 21:06:35 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003122106.o2CL6Zlq013860@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 12 Mar 2010 21:06:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205098 - user/jmallett/octeon/sys/mips/cavium/dev/rgmii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 21:06:36 -0000

Author: jmallett
Date: Fri Mar 12 21:06:35 2010
New Revision: 205098
URL: http://svn.freebsd.org/changeset/base/205098

Log:
  Use octeon_fpa_alloc_phys in a situation in which we don't need a usable pointer,
  rather than octeon_fpa_alloc.

Modified:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Fri Mar 12 19:58:51 2010	(r205097)
+++ user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Fri Mar 12 21:06:35 2010	(r205098)
@@ -1015,10 +1015,9 @@ static u_int octeon_rgmx_pko_xmit_packet
          * 3 words or less are left. We write our 2nd word now and then put in a chain link
          * to new PKO cmd buf.
          */
-        void *pko_cmd_buf = octeon_fpa_alloc(OCTEON_FPA_TX_CMDBUF_POOL);
-        uint64_t phys_cmd_buf;
+        uint64_t phys_cmd_buf = octeon_fpa_alloc_phys(OCTEON_FPA_TX_CMDBUF_POOL);
 
-        if (!pko_cmd_buf) {
+        if (!phys_cmd_buf) {
             /*
              * FPA pool for xmit-buffer-commands is empty.
              */
@@ -1026,7 +1025,6 @@ static u_int octeon_rgmx_pko_xmit_packet
             octeon_spinlock_unlock(&(sc->outq_ptr[queue].lock));
             return (0);
         }
-        phys_cmd_buf = OCTEON_PTR2PHYS(pko_cmd_buf);
 
         xmit_cmd_ptr[1] = pko_pkt_word.word64;
         xmit_cmd_ptr[2] = phys_cmd_buf;

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 21:20:36 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E8D31065673;
	Fri, 12 Mar 2010 21:20: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 6F6BE8FC1E;
	Fri, 12 Mar 2010 21:20: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 o2CLKabq017058;
	Fri, 12 Mar 2010 21:20:36 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2CLKa6v017056;
	Fri, 12 Mar 2010 21:20:36 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003122120.o2CLKa6v017056@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 12 Mar 2010 21:20:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205101 - user/jmallett/octeon/sys/mips/cavium/dev/rgmii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 21:20:36 -0000

Author: jmallett
Date: Fri Mar 12 21:20:36 2010
New Revision: 205101
URL: http://svn.freebsd.org/changeset/base/205101

Log:
  Remove FAU initialize/enable/disable stubs, which are unused and as far as I
  can tell from the Simple Executive, entirely unnecessary.

Deleted:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_fau.c
Modified:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_fau.h

Modified: user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_fau.h
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_fau.h	Fri Mar 12 21:15:35 2010	(r205100)
+++ user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_fau.h	Fri Mar 12 21:20:36 2010	(r205101)
@@ -217,9 +217,4 @@ static inline void octeon_fau_atomic_add
 }
 
 
-extern void octeon_fau_init(void);
-extern void octeon_fau_enable(void);
-extern void octeon_fau_disable(void);
-
-
 #endif  /* ___OCTEON_FAU__H___ */

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 23:46:26 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E718C106566C;
	Fri, 12 Mar 2010 23:46: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 D68908FC14;
	Fri, 12 Mar 2010 23:46: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 o2CNkQPS049565;
	Fri, 12 Mar 2010 23:46:26 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2CNkQvk049563;
	Fri, 12 Mar 2010 23:46:26 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003122346.o2CNkQvk049563@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 12 Mar 2010 23:46:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205106 - user/jmallett/octeon/sys/mips/cavium
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 23:46:27 -0000

Author: jmallett
Date: Fri Mar 12 23:46:26 2010
New Revision: 205106
URL: http://svn.freebsd.org/changeset/base/205106

Log:
  Actually remove fau.c reference.

Modified:
  user/jmallett/octeon/sys/mips/cavium/files.octeon1

Modified: user/jmallett/octeon/sys/mips/cavium/files.octeon1
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/files.octeon1	Fri Mar 12 23:23:46 2010	(r205105)
+++ user/jmallett/octeon/sys/mips/cavium/files.octeon1	Fri Mar 12 23:46:26 2010	(r205106)
@@ -2,7 +2,6 @@
 # Octeon Support Files
 #
 mips/mips/mp_machdep.c				optional smp
-mips/cavium/dev/rgmii/octeon_fau.c		optional rgmii
 mips/cavium/dev/rgmii/octeon_fpa.c		optional rgmii
 mips/cavium/dev/rgmii/octeon_ipd.c 		optional rgmii
 mips/cavium/dev/rgmii/octeon_pko.c		optional rgmii

From owner-svn-src-user@FreeBSD.ORG  Fri Mar 12 23:57:27 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E824C1065672;
	Fri, 12 Mar 2010 23:57:27 +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 CB7788FC12;
	Fri, 12 Mar 2010 23:57: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 o2CNvR9I052056;
	Fri, 12 Mar 2010 23:57:27 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2CNvRI0052053;
	Fri, 12 Mar 2010 23:57:27 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003122357.o2CNvRI0052053@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 12 Mar 2010 23:57:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205107 - user/jmallett/octeon/sys/mips/cavium
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 12 Mar 2010 23:57:28 -0000

Author: jmallett
Date: Fri Mar 12 23:57:27 2010
New Revision: 205107
URL: http://svn.freebsd.org/changeset/base/205107

Log:
  Remove some unused functions and macros.

Modified:
  user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c
  user/jmallett/octeon/sys/mips/cavium/octeon_pcmap_regs.h

Modified: user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c	Fri Mar 12 23:46:26 2010	(r205106)
+++ user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c	Fri Mar 12 23:57:27 2010	(r205107)
@@ -184,82 +184,6 @@ octeon_led_run_wheel(int *prog_count, in
 	*prog_count &= 0x7;
 }
 
-#define LSR_DATAREADY        0x01    /* Data ready */
-#define LSR_THRE             0x20    /* Transmit holding register empty */
-#define LSR_TEMT	     0x40    /* Transmitter Empty. THR, TSR & FIFO */
-#define USR_TXFIFO_NOTFULL   0x02    /* Uart TX FIFO Not full */
-
-/*
- * octeon_uart_write_byte
- * 
- * Put out a single byte off of uart port.
- */
-
-void
-octeon_uart_write_byte(int uart_index, uint8_t ch)
-{
-	uint64_t val, val2;
-	if (uart_index < 0 || uart_index > 1)
-		return;
-
-	while (1) {
-		val = oct_read64(OCTEON_MIO_UART0_LSR + (uart_index * 0x400));
-		val2 = oct_read64(OCTEON_MIO_UART0_USR + (uart_index * 0x400));
-		if ((((uint8_t) val) & LSR_THRE) ||
-		    (((uint8_t) val2) & USR_TXFIFO_NOTFULL)) {
-			break;
-		}
-	}
-
-	/* Write the byte */
-	oct_write8(OCTEON_MIO_UART0_THR + (uart_index * 0x400), (uint64_t) ch);
-
-	/* Force Flush the IOBus */
-	oct_read64(OCTEON_MIO_BOOT_BIST_STAT);
-}
-
-
-void
-octeon_uart_write_byte0(uint8_t ch)
-{
-	uint64_t val, val2;
-
-	while (1) {
-		val = oct_read64(OCTEON_MIO_UART0_LSR);
-		val2 = oct_read64(OCTEON_MIO_UART0_USR);
-		if ((((uint8_t) val) & LSR_THRE) ||
-		    (((uint8_t) val2) & USR_TXFIFO_NOTFULL)) {
-			break;
-		}
-	}
-
-	/* Write the byte */
-	oct_write8(OCTEON_MIO_UART0_THR, (uint64_t) ch);
-
-	/* Force Flush the IOBus */
-	oct_read64(OCTEON_MIO_BOOT_BIST_STAT);
-}
-
-/*
- * octeon_uart_write_string
- * 
- */
-void
-octeon_uart_write_string(int uart_index, const char *str)
-{
-	/* Just loop writing one byte at a time */
-    
-	while (*str) {
-		octeon_uart_write_byte(uart_index, *str);
-		if (*str == '\n') {
-			octeon_uart_write_byte(uart_index, '\r');
-		}
-		str++;
-	}
-}
-
-static char wstr[30];
-
 void
 octeon_led_write_hex(uint32_t wl)
 {
@@ -270,44 +194,6 @@ octeon_led_write_hex(uint32_t wl)
 }
 
 
-void octeon_uart_write_hex2(uint32_t wl, uint32_t wh)
-{
-	sprintf(wstr, "0x%X-0x%X  ", wh, wl);
-	octeon_uart_write_string(0, wstr);
-}
-
-void
-octeon_uart_write_hex(uint32_t wl)
-{
-	sprintf(wstr, " 0x%X  ", wl);
-	octeon_uart_write_string(0, wstr);
-}
-
-/*
- * octeon_wait_uart_flush
- */
-void
-octeon_wait_uart_flush(int uart_index, uint8_t ch)
-{
-	uint64_t val;
-	int64_t val3;
-	uint32_t cpu_status_bits;
-
-	if (uart_index < 0 || uart_index > 1)
-		return;
-
-	cpu_status_bits = intr_disable();
-	/* Force Flush the IOBus */
-	oct_read64(OCTEON_MIO_BOOT_BIST_STAT);
-	for (val3 = 0xfffffffff; val3 > 0; val3--) {
-		val = oct_read64(OCTEON_MIO_UART0_LSR + (uart_index * 0x400));
-		if (((uint8_t) val) & LSR_TEMT)
-			break;
-	}
-	intr_restore(cpu_status_bits);
-}
-
-
 /*
  * octeon_debug_symbol
  *

Modified: user/jmallett/octeon/sys/mips/cavium/octeon_pcmap_regs.h
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octeon_pcmap_regs.h	Fri Mar 12 23:46:26 2010	(r205106)
+++ user/jmallett/octeon/sys/mips/cavium/octeon_pcmap_regs.h	Fri Mar 12 23:57:27 2010	(r205107)
@@ -324,62 +324,6 @@ static inline void oct_write32 (uint64_t
 #define OCTEON_SCRATCH_2   32
 
 
-static inline uint64_t oct_mf_chord (void)
-{
-    uint64_t dest;
-
-    __asm __volatile (	".set push\n"
-                        ".set noreorder\n"
-                        ".set noat\n"
-                        ".set mips64\n"
-			"dmfc2 $1, 0x400\n"
-                        "move %0, $1\n"
-        		".set pop\n"
- 			: "=r" (dest) :  : "$1");
-    return dest;
-}
-
-
-#define MIPS64_DMFCz(cop,regnum,cp0reg,select)  \
-        .word   (0x40200000 | (cop << 25) | (regnum << 16) | (cp0reg << 11) | select)
-
-
-#define mips64_getcpz_xstr(s) mips64_getcpz_str(s)
-#define mips64_getcpz_str(s) #s
-
-#define mips64_dgetcpz(cop,cpzreg,sel,val_ptr) \
-    ({ __asm __volatile( \
-            ".set push\n" \
-            ".set mips3\n" \
-            ".set noreorder\n" \
-            ".set noat\n" \
-            mips64_getcpz_xstr(MIPS64_DMFCz(cop,1,cpzreg,sel)) "\n" \
-            "nop\n" \
-            "nop\n" \
-            "nop\n" \
-            "nop\n" \
-            "sd $1,0(%0)\n" \
-            ".set pop" \
-            : /* no outputs */ : "r" (val_ptr) : "$1"); \
-    })
-
-
-#define mips64_dgetcp2(cp2reg,sel,retval_ptr) \
-    mips64_dgetcpz(2,cp2reg,sel,retval_ptr)
-
-
-#define OCTEON_MF_CHORD(dest)  mips64_dgetcp2(0x400, 0, &dest)
-
-
-
-#define OCTEON_RDHWR(result, regstr) \
-	__asm __volatile (		\
-        		".set mips3\n"		\
-			"rdhwr %0,$" OCTEON_TMP_STR(regstr) "\n"	\
-        		".set mips\n"		\
-			 : "=d" (result));
-
-#define CVMX_MF_CHORD(dest)         OCTEON_RDHWR(dest, 30)
 
 #define OCTEON_CHORD_HEX(dest_ptr)  \
     ({ __asm __volatile( \
@@ -397,15 +341,6 @@ static inline uint64_t oct_mf_chord (voi
             : /* no outputs */ : "r" (dest_ptr) : "$2"); \
     })
 
-
-
-#define OCTEON_MF_CHORD_BAD(dest)	\
-         __asm __volatile (		\
-        		".set mips3\n"		\
-			"dmfc2 %0, 0x400\n"	\
-        		".set mips0\n"		\
- 			: "=&r" (dest) : )
-
 static inline uint64_t oct_scratch_read64 (uint64_t address)
 {
     return(*((volatile uint64_t *)(OCTEON_SCRATCH_BASE + address)));
@@ -417,17 +352,6 @@ static inline void oct_scratch_write64 (
 }
 
 
-#define OCTEON_READ_CSR32(addr, val) \
-	addr_ptr = addr; \
-	oct_read_32_ptr(&addr_ptr, &val);
-
-#define OCTEON_WRITE_CSR32(addr, val, val_dummy) \
-	addr_ptr = addr; \
-	oct_write_32_ptr(&addr_ptr, &val); \
-	oct_read64(OCTEON_MIO_BOOT_BIST_STAT);
-
-
-
 /*
  * Octeon Address Space Definitions
  */
@@ -791,12 +715,6 @@ extern void octeon_led_write_hexchar(int
 extern void octeon_led_write_hex(uint32_t wl);
 extern void octeon_led_write_string(const char *str);
 extern void octeon_reset(void);
-extern void octeon_uart_write_byte(int uart_index, uint8_t ch);
-extern void octeon_uart_write_string(int uart_index, const char *str);
-extern void octeon_uart_write_hex(uint32_t wl);
-extern void octeon_uart_write_hex2(uint32_t wl, uint32_t wh);
-extern void octeon_wait_uart_flush(int uart_index, uint8_t ch);
-extern void octeon_uart_write_byte0(uint8_t ch);
 extern void octeon_led_write_char0(char val);
 extern void octeon_led_run_wheel(int *pos, int led_position);
 extern void octeon_debug_symbol(void);

From owner-svn-src-user@FreeBSD.ORG  Sat Mar 13 01:09:15 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 02134106566B;
	Sat, 13 Mar 2010 01:09:15 +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 E48318FC15;
	Sat, 13 Mar 2010 01:09: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 o2D19Ehc067919;
	Sat, 13 Mar 2010 01:09:14 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2D19ET6067917;
	Sat, 13 Mar 2010 01:09:14 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003130109.o2D19ET6067917@svn.freebsd.org>
From: Juli Mallett 
Date: Sat, 13 Mar 2010 01:09:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205109 - user/jmallett/octeon/sys/mips/cavium/dev/rgmii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 13 Mar 2010 01:09:15 -0000

Author: jmallett
Date: Sat Mar 13 01:09:14 2010
New Revision: 205109
URL: http://svn.freebsd.org/changeset/base/205109

Log:
  o) Do not unconditionally update the last known link status in the softc.  If
     report_link isn't set, when octeon_rgmx_config_speed is called the first
     time it will tell the driver (essentially) that we have already marked the
     interface up.  Likewise, don't change media speed and duplex if only the
     link status is at issue.
  o) Remove manual changing of link state and let octeon_rgmx_config_speed do the
     heavy lifting.
  
  Sponsored by:	Packet Forensics

Modified:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Sat Mar 13 00:15:06 2010	(r205108)
+++ user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Sat Mar 13 01:09:14 2010	(r205109)
@@ -1813,7 +1813,6 @@ static int octeon_rgmx_ioctl (struct ifn
 static void  octeon_rgmx_init (void *xsc)
 {
 	struct rgmx_softc_dev *sc = xsc;
-	octeon_rgmx_rxx_rx_inbnd_t link_status;
 
         /* Enable interrupts.  */
     	/* For RGMX they are already enabled earlier */
@@ -1834,19 +1833,7 @@ static void  octeon_rgmx_init (void *xsc
         /* Hopefully PKO is running and will pick up packets via the timer  or receive loop */
 
 	/* Set link status.  */
-	octeon_rgmx_config_speed(sc->port, 0);
-
-	RGMX_LOCK(sc);
-	/*
-	 * Parse link status.
-	 */
-	link_status.word64 = sc->link_status;
-
-	if (link_status.bits.status)
-		if_link_state_change(sc->ifp, LINK_STATE_UP);
-	else
-		if_link_state_change(sc->ifp, LINK_STATE_DOWN);
-	RGMX_UNLOCK(sc);
+	octeon_rgmx_config_speed(sc->port, 1);
 }
 
 
@@ -1861,7 +1848,6 @@ static void octeon_rgmx_config_speed (u_
         uint64_t			val64_tx_clk, val64_tx_slot, val64_tx_burst;
         u_int				last_enabled;
 
-
         sc = get_rgmx_softc(port);
         if (!sc) {
             printf(" config_speed didn't find sc int:%u port:%u", iface, port);
@@ -1873,79 +1859,96 @@ static void octeon_rgmx_config_speed (u_
          */
         link_status.word64 = oct_read64(OCTEON_RGMX_RXX_RX_INBND(index, iface));
 
+        RGMX_LOCK(sc);
+
         /*
          * Compre to prev known state. If same then nothing to do.
          */
         if (link_status.word64 == sc->link_status) {
+		RGMX_UNLOCK(sc);
             	return;
         }
-
-        RGMX_LOCK(sc);
-
         old_link_status.word64 = sc->link_status;
 
-        sc->link_status = link_status.word64;
-
-        last_enabled = octeon_rgmx_stop_port(port);
-
-        gmx_cfg.word64 = oct_read64(OCTEON_RGMX_PRTX_CFG(index, iface));
-
-        /*
-         * Duplex
-         */
-        gmx_cfg.bits.duplex = 1;
-
-        switch (link_status.bits.speed) {
-        case 0:	/* 10Mbps */
-            gmx_cfg.bits.speed = 0;
-            gmx_cfg.bits.slottime = 0;
-            val64_tx_clk = 50; val64_tx_slot = 0x40; val64_tx_burst = 0;
-            break;
-        case 1:	/* 100Mbps */
-            gmx_cfg.bits.speed = 0;
-            gmx_cfg.bits.slottime = 0;
-            val64_tx_clk = 5; val64_tx_slot = 0x40; val64_tx_burst = 0;
-            break;
-
-        case 2:	/* 1Gbps */
-            gmx_cfg.bits.speed = 1;
-            gmx_cfg.bits.slottime = 1;
-            val64_tx_clk = 1; val64_tx_slot = 0x200; val64_tx_burst = 0x2000;
-            break;
-
-        case 3:	/* ?? */
-        default:
-            gmx_cfg.bits.speed = 1;
-            gmx_cfg.bits.slottime = 1;
-            val64_tx_clk = 1; val64_tx_slot = 0x200; val64_tx_burst = 0x2000;
-            break;
-        }
-
-        oct_write64(OCTEON_RGMX_TXX_CLK(index, iface), val64_tx_clk);
-        oct_write64(OCTEON_RGMX_TXX_SLOT(index, iface), val64_tx_slot);
-        oct_write64(OCTEON_RGMX_TXX_BURST(index, iface), val64_tx_burst);
-
-        oct_write64(OCTEON_RGMX_PRTX_CFG(index, iface), gmx_cfg.word64);
+	/*
+	 * Compare to previous state modulo link status.  If only link
+	 * status is different, we don't need to change media.
+	 */
+	if (old_link_status.bits.duplex != link_status.bits.duplex ||
+	    old_link_status.bits.speed != link_status.bits.speed) {
+		last_enabled = octeon_rgmx_stop_port(port);
+		
+		gmx_cfg.word64 = oct_read64(OCTEON_RGMX_PRTX_CFG(index, iface));
+
+		/*
+		 * Duplex
+		 * XXX Set based on link_status.bits.duplex?
+		 */
+		gmx_cfg.bits.duplex = 1;
+		
+		switch (link_status.bits.speed) {
+		case 0:	/* 10Mbps */
+			gmx_cfg.bits.speed = 0;
+			gmx_cfg.bits.slottime = 0;
+			val64_tx_clk = 50; val64_tx_slot = 0x40; val64_tx_burst = 0;
+			break;
+
+		case 1:	/* 100Mbps */
+			gmx_cfg.bits.speed = 0;
+			gmx_cfg.bits.slottime = 0;
+			val64_tx_clk = 5; val64_tx_slot = 0x40; val64_tx_burst = 0;
+			break;
+
+		case 2:	/* 1Gbps */
+			gmx_cfg.bits.speed = 1;
+			gmx_cfg.bits.slottime = 1;
+			val64_tx_clk = 1; val64_tx_slot = 0x200; val64_tx_burst = 0x2000;
+			break;
+
+		case 3:	/* ?? */
+		default:
+			gmx_cfg.bits.speed = 1;
+			gmx_cfg.bits.slottime = 1;
+			val64_tx_clk = 1; val64_tx_slot = 0x200; val64_tx_burst = 0x2000;
+			break;
+		}
+
+		oct_write64(OCTEON_RGMX_TXX_CLK(index, iface), val64_tx_clk);
+		oct_write64(OCTEON_RGMX_TXX_SLOT(index, iface), val64_tx_slot);
+		oct_write64(OCTEON_RGMX_TXX_BURST(index, iface), val64_tx_burst);
+		
+		oct_write64(OCTEON_RGMX_PRTX_CFG(index, iface), gmx_cfg.word64);
+		
+		if (last_enabled) octeon_rgmx_start_port(port);
+	}
 
-        if (last_enabled) octeon_rgmx_start_port(port);
+	/*
+	 * Now check and possibly change link status.
+	 */
+	if (link_status.bits.status != old_link_status.bits.status) {
+		if (report_link) {
+			if (link_status.bits.status) {
+				if_link_state_change(sc->ifp, LINK_STATE_UP);
+			} else {
+				if_link_state_change(sc->ifp, LINK_STATE_DOWN);
+			}
+		}
+	}
 
-        if (link_status.bits.status != old_link_status.bits.status) {
+	if (report_link) {
+		sc->link_status = link_status.word64;
+	} else {
+		/*
+		 * We can't update link status proper since we can't
+		 * change it in the interface, so keep the old link
+		 * status intact but note the current speed and duplex
+		 * settings.
+		 */
+		link_status.bits.status = old_link_status.bits.status;
+		sc->link_status = link_status.word64;
+	}
 
-//#define DEBUG_LINESTATUS
-            if (link_status.bits.status) {
-#ifdef DEBUG_LINESTATUS
-                printf(" %u/%u: Interface is now alive\n", iface, port);
-#endif
-                if (report_link)  if_link_state_change(sc->ifp, LINK_STATE_UP);
-            } else {
-#ifdef DEBUG_LINESTATUS
-                printf(" %u/%u: Interface went down\n", iface, port);
-#endif
-                if (report_link)  if_link_state_change(sc->ifp, LINK_STATE_DOWN);
-            }
-        }
         RGMX_UNLOCK(sc);
-
 }
 
 
@@ -2165,7 +2168,6 @@ static void octeon_config_rgmii_port (u_
         gmx_cfg.bits.en = 1;
         oct_write64(OCTEON_RGMX_PRTX_CFG(index, iface), gmx_cfg.word64);
 
-
         octeon_rgmx_config_speed(port, 0);
 
         oct_write64(OCTEON_RGMX_TXX_THRESH(index, iface), 32);

From owner-svn-src-user@FreeBSD.ORG  Sat Mar 13 01:18:34 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4D15D106564A;
	Sat, 13 Mar 2010 01:18: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 3C58C8FC0A;
	Sat, 13 Mar 2010 01:18: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 o2D1IYas069983;
	Sat, 13 Mar 2010 01:18:34 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2D1IYAR069981;
	Sat, 13 Mar 2010 01:18:34 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003130118.o2D1IYAR069981@svn.freebsd.org>
From: Juli Mallett 
Date: Sat, 13 Mar 2010 01:18:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205110 - user/jmallett/octeon/sys/mips/cavium/dev/rgmii
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 13 Mar 2010 01:18:34 -0000

Author: jmallett
Date: Sat Mar 13 01:18:33 2010
New Revision: 205110
URL: http://svn.freebsd.org/changeset/base/205110

Log:
  Report half duplex status properly.

Modified:
  user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Sat Mar 13 01:09:14 2010	(r205109)
+++ user/jmallett/octeon/sys/mips/cavium/dev/rgmii/octeon_rgmx.c	Sat Mar 13 01:18:33 2010	(r205110)
@@ -1676,8 +1676,13 @@ static void octeon_rgmx_medstat (struct 
 		break;
 	}
 
-	/* Always full duplex.  */
-	ifm->ifm_active |= IFM_FDX;
+	/*
+	 * Check duplex.
+	 */
+	if (link_status.bits.duplex == 1)
+		ifm->ifm_active |= IFM_FDX;
+	else
+		ifm->ifm_active |= IFM_HDX;
 
 	RGMX_UNLOCK(sc);
 }

From owner-svn-src-user@FreeBSD.ORG  Sat Mar 13 02:09:16 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0205C106564A;
	Sat, 13 Mar 2010 02:09:16 +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 E5FEC8FC18;
	Sat, 13 Mar 2010 02:09: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 o2D29Fum081095;
	Sat, 13 Mar 2010 02:09:15 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2D29Fdj081094;
	Sat, 13 Mar 2010 02:09:15 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003130209.o2D29Fdj081094@svn.freebsd.org>
From: Juli Mallett 
Date: Sat, 13 Mar 2010 02:09:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205111 - user/jmallett/octeon/lib/csu/mips
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 13 Mar 2010 02:09:16 -0000

Author: jmallett
Date: Sat Mar 13 02:09:15 2010
New Revision: 205111
URL: http://svn.freebsd.org/changeset/base/205111

Log:
  Fix spelling of noreorder.

Modified:
  user/jmallett/octeon/lib/csu/mips/crti.S

Modified: user/jmallett/octeon/lib/csu/mips/crti.S
==============================================================================
--- user/jmallett/octeon/lib/csu/mips/crti.S	Sat Mar 13 01:18:33 2010	(r205110)
+++ user/jmallett/octeon/lib/csu/mips/crti.S	Sat Mar 13 02:09:15 2010	(r205111)
@@ -6,7 +6,7 @@ __FBSDID("$FreeBSD$");
 	.globl	_init
 	.type	_init,%function
 _init:
-	.set nreoorder
+	.set noreorder
 #if defined(__ABICALLS__) && (defined(__mips_o32) || defined(__mips_o64))
 	SETUP_GP
 #endif

From owner-svn-src-user@FreeBSD.ORG  Sat Mar 13 04:00:37 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C38B106566B;
	Sat, 13 Mar 2010 04:00:37 +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 4B8458FC14;
	Sat, 13 Mar 2010 04:00: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 o2D40bBk005930;
	Sat, 13 Mar 2010 04:00:37 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2D40bXG005926;
	Sat, 13 Mar 2010 04:00:37 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201003130400.o2D40bXG005926@svn.freebsd.org>
From: Juli Mallett 
Date: Sat, 13 Mar 2010 04:00:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205114 - user/jmallett/octeon/lib/libc/mips/gen
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 13 Mar 2010 04:00:37 -0000

Author: jmallett
Date: Sat Mar 13 04:00:36 2010
New Revision: 205114
URL: http://svn.freebsd.org/changeset/base/205114

Log:
  Add an implementation, only compile-tested, of makecontext with ABI-correct
  argument encoding from NetBSD.

Added:
  user/jmallett/octeon/lib/libc/mips/gen/_ctx_start.S
Modified:
  user/jmallett/octeon/lib/libc/mips/gen/Makefile.inc
  user/jmallett/octeon/lib/libc/mips/gen/makecontext.c

Modified: user/jmallett/octeon/lib/libc/mips/gen/Makefile.inc
==============================================================================
--- user/jmallett/octeon/lib/libc/mips/gen/Makefile.inc	Sat Mar 13 03:06:48 2010	(r205113)
+++ user/jmallett/octeon/lib/libc/mips/gen/Makefile.inc	Sat Mar 13 04:00:36 2010	(r205114)
@@ -6,4 +6,4 @@ SRCS+=	infinity.c fabs.c ldexp.c modf.c
 # SRCS+=	flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
 #	fpsetround.c fpsetsticky.c
 
-SRCS+=	_set_tp.c _setjmp.S makecontext.c setjmp.S signalcontext.c sigsetjmp.S
+SRCS+=	_ctx_start.S _set_tp.c _setjmp.S makecontext.c setjmp.S signalcontext.c sigsetjmp.S

Added: user/jmallett/octeon/lib/libc/mips/gen/_ctx_start.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jmallett/octeon/lib/libc/mips/gen/_ctx_start.S	Sat Mar 13 04:00:36 2010	(r205114)
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2010 Juli Mallett.
+ * 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$");
+
+/*
+ * XXX gp?
+ */
+ENTRY(_ctx_start)
+	jalr	t9
+
+	move	a0, s0
+	PTR_LA	t9, _ctx_done
+	jalr	t9
+
+	break	0
+END(_ctx_start)

Modified: user/jmallett/octeon/lib/libc/mips/gen/makecontext.c
==============================================================================
--- user/jmallett/octeon/lib/libc/mips/gen/makecontext.c	Sat Mar 13 03:06:48 2010	(r205113)
+++ user/jmallett/octeon/lib/libc/mips/gen/makecontext.c	Sat Mar 13 04:00:36 2010	(r205114)
@@ -1,4 +1,4 @@
-/*	$NetBSD: makecontext.c,v 1.3 2003/01/19 08:53:36 matt Exp $	*/
+/*	$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -15,13 +15,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -39,48 +32,92 @@
 #include 
 __FBSDID("$FreeBSD$");
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.3 2003/01/19 08:53:36 matt Exp $");
+__RCSID("$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $");
 #endif
 
-#include 
-#include 
+#include 
+#include 
+
 #include 
+#include 
+#include 
+#include 
+#include 
+
+__weak_reference(__makecontext, makecontext);
+
+void _ctx_done(ucontext_t *);
+void _ctx_start(void);
 
 void
-makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
+__makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
 {
-	/* XXXMIPS: Implement me */
-#if 0
-	__greg_t *gr = ucp->uc_mcontext.__gregs;
-	uintptr_t *sp;
+	mcontext_t *mc;
+	register_t *sp;
 	int i;
 	va_list ap;
 
-	void __resumecontext(void);
+	/*
+	 * XXX/juli
+	 * We need an mc_len or mc_flags like other architectures
+	 * so that we can mark a context as invalid.  Store it in
+	 * mc->mc_regs[ZERO] perhaps?
+	 */
+	if (argc < 0 || argc > 6 || ucp == NULL ||
+	    ucp->uc_stack.ss_sp == NULL ||
+	    ucp->uc_stack.ss_size < MINSIGSTKSZ)
+		return;
+	mc = &ucp->uc_mcontext;
 
-	/* LINTED uintptr_t is safe */
-	sp  = (uintptr_t *)
+	sp  = (register_t *)
 	    ((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
-	/* LINTED uintptr_t is safe */
+#if defined(__mips_o32) || defined(__mips_o64)
 	sp -= (argc >= 4 ? argc : 4);	/* Make room for >=4 arguments. */
-	sp  = (uintptr_t *)
-	      ((uintptr_t)sp & ~0x7);	/* Align on double-word boundary. */
+	sp  = (register_t *)
+	    ((uintptr_t)sp & ~0x7);	/* Align on double-word boundary. */
+#elif defined(__mips_n32) || defined(__mips_n64)
+	sp -= (argc > 8 ? argc - 8 : 0); /* Make room for > 8 arguments. */
+	sp  = (register_t *)
+	    ((uintptr_t)sp & ~0xf);	/* Align on quad-word boundary. */
+#endif
 
-	gr[_REG_SP]  = (__greg_t)sp;
-	gr[_REG_RA]  = (__greg_t)__resumecontext;
-	gr[_REG_T9]  = (__greg_t)func;	/* required for .abicalls */
-	gr[_REG_EPC] = (__greg_t)func;
+	mc->mc_regs[SP] = (intptr_t)sp;
+	mc->mc_regs[S0] = (intptr_t)ucp;
+	mc->mc_regs[T9] = (intptr_t)func;
+	mc->mc_pc = (intptr_t)_ctx_start;
 
 	/* Construct argument list. */
 	va_start(ap, argc);
+#if defined(__mips_o32) || defined(__mips_o64)
 	/* Up to the first four arguments are passed in $a0-3. */
 	for (i = 0; i < argc && i < 4; i++)
-		/* LINTED uintptr_t is safe */
-		gr[_REG_A0 + i] = va_arg(ap, uintptr_t);
+		/* LINTED register_t is safe */
+		mc->mc_regs[A0 + i] = va_arg(ap, register_t);
+	/* Pass remaining arguments on the stack above the $a0-3 gap. */
+	sp += i;
+#endif
+#if defined(__mips_n32) || defined(__mips_n64)
+	/* Up to the first 8 arguments are passed in $a0-7. */
+	for (i = 0; i < argc && i < 8; i++)
+		/* LINTED register_t is safe */
+		mc->mc_regs[A0 + i] = va_arg(ap, register_t);
 	/* Pass remaining arguments on the stack above the $a0-3 gap. */
-	for (sp += 4; i < argc; i++)
+#endif
+	/* Pass remaining arguments on the stack above the $a0-3 gap. */
+	for (; i < argc; i++)
 		/* LINTED uintptr_t is safe */
-		*sp++ = va_arg(ap, uintptr_t);
+		*sp++ = va_arg(ap, register_t);
 	va_end(ap);
-#endif
+}
+
+void
+_ctx_done(ucontext_t *ucp)
+{
+
+	if (ucp->uc_link == NULL)
+		exit(0);
+	else {
+		setcontext((const ucontext_t *)ucp->uc_link);
+		abort();
+	}
 }

From owner-svn-src-user@FreeBSD.ORG  Sat Mar 13 11:06:50 2010
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 37A37106564A;
	Sat, 13 Mar 2010 11:06:50 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 20D778FC08;
	Sat, 13 Mar 2010 11:06: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 o2DB6oJl000965;
	Sat, 13 Mar 2010 11:06:50 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2DB6n0f000930;
	Sat, 13 Mar 2010 11:06:49 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201003131106.o2DB6n0f000930@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 13 Mar 2010 11:06:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205117 - in user/ed/newcons: . bin/ed bin/kill
	bin/pkill bin/ps bin/rmail bin/setfacl bin/sh cddl
	cddl/lib/drti cddl/lib/libavl cddl/lib/libctf
	cddl/lib/libdtrace cddl/lib/libnvpair cd...
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 13 Mar 2010 11:06:50 -0000

Author: ed
Date: Sat Mar 13 11:06:47 2010
New Revision: 205117
URL: http://svn.freebsd.org/changeset/base/205117

Log:
  MFH the Newcons branch.

Added:
  user/ed/newcons/contrib/dtc/
     - copied from r205116, head/contrib/dtc/
  user/ed/newcons/contrib/gdb/gdb/config/mips/nm-fbsd.h
     - copied unchanged from r205116, head/contrib/gdb/gdb/config/mips/nm-fbsd.h
  user/ed/newcons/contrib/gdb/gdb/config/mips/tm-fbsd.h
     - copied unchanged from r205116, head/contrib/gdb/gdb/config/mips/tm-fbsd.h
  user/ed/newcons/contrib/gdb/gdb/mipsfbsd-nat.c
     - copied unchanged from r205116, head/contrib/gdb/gdb/mipsfbsd-nat.c
  user/ed/newcons/contrib/gdb/gdb/mipsfbsd-tdep.c
     - copied unchanged from r205116, head/contrib/gdb/gdb/mipsfbsd-tdep.c
  user/ed/newcons/contrib/gdb/gdb/mipsfbsd-tdep.h
     - copied unchanged from r205116, head/contrib/gdb/gdb/mipsfbsd-tdep.h
  user/ed/newcons/contrib/tzcode/
     - copied from r205116, head/contrib/tzcode/
     - copied from r205116, head/contrib/tzdata/
  user/ed/newcons/crypto/openssh/PROTOCOL.certkeys
     - copied unchanged from r205116, head/crypto/openssh/PROTOCOL.certkeys
  user/ed/newcons/crypto/openssh/PROTOCOL.mux
     - copied unchanged from r205116, head/crypto/openssh/PROTOCOL.mux
  user/ed/newcons/crypto/openssh/openbsd-compat/pwcache.c
     - copied unchanged from r205116, head/crypto/openssh/openbsd-compat/pwcache.c
  user/ed/newcons/crypto/openssh/pkcs11.h
     - copied unchanged from r205116, head/crypto/openssh/pkcs11.h
  user/ed/newcons/crypto/openssh/roaming_client.c
     - copied unchanged from r205116, head/crypto/openssh/roaming_client.c
  user/ed/newcons/crypto/openssh/roaming_serv.c
     - copied unchanged from r205116, head/crypto/openssh/roaming_serv.c
  user/ed/newcons/crypto/openssh/ssh-pkcs11-client.c
     - copied unchanged from r205116, head/crypto/openssh/ssh-pkcs11-client.c
  user/ed/newcons/crypto/openssh/ssh-pkcs11-helper.0
     - copied unchanged from r205116, head/crypto/openssh/ssh-pkcs11-helper.0
  user/ed/newcons/crypto/openssh/ssh-pkcs11-helper.8
     - copied unchanged from r205116, head/crypto/openssh/ssh-pkcs11-helper.8
  user/ed/newcons/crypto/openssh/ssh-pkcs11-helper.c
     - copied unchanged from r205116, head/crypto/openssh/ssh-pkcs11-helper.c
  user/ed/newcons/crypto/openssh/ssh-pkcs11.c
     - copied unchanged from r205116, head/crypto/openssh/ssh-pkcs11.c
  user/ed/newcons/crypto/openssh/ssh-pkcs11.h
     - copied unchanged from r205116, head/crypto/openssh/ssh-pkcs11.h
  user/ed/newcons/etc/rc.d/hastd
     - copied unchanged from r205116, head/etc/rc.d/hastd
  user/ed/newcons/gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh
     - copied unchanged from r205116, head/gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh
  user/ed/newcons/gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh
     - copied unchanged from r205116, head/gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh
  user/ed/newcons/gnu/usr.bin/dtc/
     - copied from r205116, head/gnu/usr.bin/dtc/
  user/ed/newcons/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c
     - copied unchanged from r205116, head/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c
  user/ed/newcons/gnu/usr.bin/gdb/gdbserver/reg-x86-64.c
     - copied unchanged from r205116, head/gnu/usr.bin/gdb/gdbserver/reg-x86-64.c
  user/ed/newcons/lib/libalias/Makefile.inc
     - copied unchanged from r205116, head/lib/libalias/Makefile.inc
  user/ed/newcons/lib/libpmc/pmc.mips.3
     - copied unchanged from r205116, head/lib/libpmc/pmc.mips.3
  user/ed/newcons/release/scripts/make-memstick.sh
     - copied unchanged from r205116, head/release/scripts/make-memstick.sh
  user/ed/newcons/sbin/hastctl/
     - copied from r205116, head/sbin/hastctl/
  user/ed/newcons/sbin/hastd/
     - copied from r205116, head/sbin/hastd/
  user/ed/newcons/secure/libexec/ssh-pkcs11-helper/
     - copied from r205116, head/secure/libexec/ssh-pkcs11-helper/
  user/ed/newcons/share/examples/hast/
     - copied from r205116, head/share/examples/hast/
  user/ed/newcons/share/man/man4/alpm.4
     - copied unchanged from r205116, head/share/man/man4/alpm.4
  user/ed/newcons/share/man/man4/amdpm.4
     - copied unchanged from r205116, head/share/man/man4/amdpm.4
  user/ed/newcons/share/man/man4/bwn.4
     - copied unchanged from r205116, head/share/man/man4/bwn.4
  user/ed/newcons/share/man/man4/man4.powerpc/smu.4
     - copied unchanged from r205116, head/share/man/man4/man4.powerpc/smu.4
  user/ed/newcons/share/man/man4/mcd.4
     - copied unchanged from r205116, head/share/man/man4/mcd.4
  user/ed/newcons/share/man/man4/padlock.4
     - copied unchanged from r205116, head/share/man/man4/padlock.4
  user/ed/newcons/share/man/man4/pcf.4
     - copied unchanged from r205116, head/share/man/man4/pcf.4
  user/ed/newcons/share/man/man4/scd.4
     - copied unchanged from r205116, head/share/man/man4/scd.4
  user/ed/newcons/share/man/man4/viapm.4
     - copied unchanged from r205116, head/share/man/man4/viapm.4
  user/ed/newcons/sys/amd64/amd64/atpic_vector.S
     - copied unchanged from r205116, head/sys/amd64/amd64/atpic_vector.S
  user/ed/newcons/sys/contrib/dev/acpica/compiler/aslpredef.c
     - copied unchanged from r205116, head/sys/contrib/dev/acpica/compiler/aslpredef.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exdebug.c
     - copied unchanged from r205116, head/sys/contrib/dev/acpica/executer/exdebug.c
  user/ed/newcons/sys/contrib/libfdt/
     - copied from r205116, head/sys/contrib/libfdt/
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar9285.c
     - copied unchanged from r205116, head/sys/dev/ath/ath_hal/ar5416/ar9285.c
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar9285.h
     - copied unchanged from r205116, head/sys/dev/ath/ath_hal/ar5416/ar9285.h
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c
     - copied unchanged from r205116, head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c
     - copied unchanged from r205116, head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c
  user/ed/newcons/sys/dev/bwn/
     - copied from r205116, head/sys/dev/bwn/
  user/ed/newcons/sys/dev/hwpmc/hwpmc_mips.c
     - copied unchanged from r205116, head/sys/dev/hwpmc/hwpmc_mips.c
  user/ed/newcons/sys/dev/hwpmc/hwpmc_mips24k.c
     - copied unchanged from r205116, head/sys/dev/hwpmc/hwpmc_mips24k.c
  user/ed/newcons/sys/dev/hwpmc/hwpmc_mips24k.h
     - copied unchanged from r205116, head/sys/dev/hwpmc/hwpmc_mips24k.h
  user/ed/newcons/sys/i386/i386/atpic_vector.s
     - copied unchanged from r205116, head/sys/i386/i386/atpic_vector.s
  user/ed/newcons/sys/kern/kern_gzio.c
     - copied unchanged from r205116, head/sys/kern/kern_gzio.c
  user/ed/newcons/sys/kern/subr_hash.c
     - copied unchanged from r205116, head/sys/kern/subr_hash.c
  user/ed/newcons/sys/kern/subr_uio.c
     - copied unchanged from r205116, head/sys/kern/subr_uio.c
  user/ed/newcons/sys/mips/conf/SWARM_SMP
     - copied unchanged from r205116, head/sys/mips/conf/SWARM_SMP
  user/ed/newcons/sys/mips/mips/mpboot.S
     - copied unchanged from r205116, head/sys/mips/mips/mpboot.S
  user/ed/newcons/sys/mips/rmi/bus_space_rmi_pci.c
     - copied unchanged from r205116, head/sys/mips/rmi/bus_space_rmi_pci.c
  user/ed/newcons/sys/mips/sibyte/sb_bus_space.h
     - copied unchanged from r205116, head/sys/mips/sibyte/sb_bus_space.h
  user/ed/newcons/sys/modules/bwn/
     - copied from r205116, head/sys/modules/bwn/
  user/ed/newcons/sys/modules/nfs_common/
     - copied from r205116, head/sys/modules/nfs_common/
  user/ed/newcons/sys/net/netisr_internal.h
     - copied unchanged from r205116, head/sys/net/netisr_internal.h
  user/ed/newcons/sys/net/zutil.h
     - copied unchanged from r205116, head/sys/net/zutil.h
  user/ed/newcons/sys/netinet/ipfw/dn_heap.c
     - copied unchanged from r205116, head/sys/netinet/ipfw/dn_heap.c
  user/ed/newcons/sys/netinet/ipfw/dn_heap.h
     - copied unchanged from r205116, head/sys/netinet/ipfw/dn_heap.h
  user/ed/newcons/sys/netinet/ipfw/dn_sched.h
     - copied unchanged from r205116, head/sys/netinet/ipfw/dn_sched.h
  user/ed/newcons/sys/netinet/ipfw/dn_sched_fifo.c
     - copied unchanged from r205116, head/sys/netinet/ipfw/dn_sched_fifo.c
  user/ed/newcons/sys/netinet/ipfw/dn_sched_qfq.c
     - copied unchanged from r205116, head/sys/netinet/ipfw/dn_sched_qfq.c
  user/ed/newcons/sys/netinet/ipfw/dn_sched_rr.c
     - copied unchanged from r205116, head/sys/netinet/ipfw/dn_sched_rr.c
  user/ed/newcons/sys/netinet/ipfw/dn_sched_wf2q.c
     - copied unchanged from r205116, head/sys/netinet/ipfw/dn_sched_wf2q.c
  user/ed/newcons/sys/netinet/ipfw/dummynet.txt
     - copied unchanged from r205116, head/sys/netinet/ipfw/dummynet.txt
  user/ed/newcons/sys/netinet/ipfw/ip_dn_glue.c
     - copied unchanged from r205116, head/sys/netinet/ipfw/ip_dn_glue.c
  user/ed/newcons/sys/netinet/ipfw/ip_dn_io.c
     - copied unchanged from r205116, head/sys/netinet/ipfw/ip_dn_io.c
  user/ed/newcons/sys/netinet/ipfw/ip_dn_private.h
     - copied unchanged from r205116, head/sys/netinet/ipfw/ip_dn_private.h
  user/ed/newcons/sys/netinet/ipfw/test/
     - copied from r205116, head/sys/netinet/ipfw/test/
  user/ed/newcons/sys/sparc64/include/cmt.h
     - copied unchanged from r205116, head/sys/sparc64/include/cmt.h
  user/ed/newcons/sys/sparc64/include/fireplane.h
     - copied unchanged from r205116, head/sys/sparc64/include/fireplane.h
  user/ed/newcons/sys/sparc64/include/jbus.h
     - copied unchanged from r205116, head/sys/sparc64/include/jbus.h
  user/ed/newcons/sys/sparc64/include/nexusvar.h
     - copied unchanged from r205116, head/sys/sparc64/include/nexusvar.h
  user/ed/newcons/sys/sparc64/sparc64/ssm.c
     - copied unchanged from r205116, head/sys/sparc64/sparc64/ssm.c
  user/ed/newcons/sys/sun4v/include/cmt.h
     - copied unchanged from r205116, head/sys/sun4v/include/cmt.h
  user/ed/newcons/sys/sun4v/include/fireplane.h
     - copied unchanged from r205116, head/sys/sun4v/include/fireplane.h
  user/ed/newcons/sys/sun4v/include/jbus.h
     - copied unchanged from r205116, head/sys/sun4v/include/jbus.h
  user/ed/newcons/sys/x86/
     - copied from r205116, head/sys/x86/
  user/ed/newcons/tools/regression/bin/sh/builtins/command10.0
     - copied unchanged from r205116, head/tools/regression/bin/sh/builtins/command10.0
  user/ed/newcons/tools/regression/bin/sh/builtins/command8.0
     - copied unchanged from r205116, head/tools/regression/bin/sh/builtins/command8.0
  user/ed/newcons/tools/regression/bin/sh/builtins/command9.0
     - copied unchanged from r205116, head/tools/regression/bin/sh/builtins/command9.0
  user/ed/newcons/tools/regression/bin/sh/builtins/var-assign2.0
     - copied unchanged from r205116, head/tools/regression/bin/sh/builtins/var-assign2.0
  user/ed/newcons/tools/regression/bin/sh/errors/redirection-error3.0
     - copied unchanged from r205116, head/tools/regression/bin/sh/errors/redirection-error3.0
  user/ed/newcons/tools/regression/bin/sh/expansion/arith3.0
     - copied unchanged from r205116, head/tools/regression/bin/sh/expansion/arith3.0
  user/ed/newcons/tools/regression/bin/sh/expansion/assign1.0
     - copied unchanged from r205116, head/tools/regression/bin/sh/expansion/assign1.0
  user/ed/newcons/tools/regression/bin/sh/expansion/cmdsubst2.0
     - copied unchanged from r205116, head/tools/regression/bin/sh/expansion/cmdsubst2.0
  user/ed/newcons/tools/regression/bin/sh/expansion/plus-minus1.0
     - copied unchanged from r205116, head/tools/regression/bin/sh/expansion/plus-minus1.0
  user/ed/newcons/tools/regression/bin/sh/parser/heredoc1.0
     - copied unchanged from r205116, head/tools/regression/bin/sh/parser/heredoc1.0
  user/ed/newcons/tools/regression/kthread/
     - copied from r205116, head/tools/regression/kthread/
  user/ed/newcons/tools/regression/usr.bin/apply/
     - copied from r205116, head/tools/regression/usr.bin/apply/
  user/ed/newcons/tools/regression/usr.bin/pkill/pgrep-q.t
     - copied unchanged from r205116, head/tools/regression/usr.bin/pkill/pgrep-q.t
  user/ed/newcons/tools/tools/mcgrab/
     - copied from r205116, head/tools/tools/mcgrab/
  user/ed/newcons/usr.bin/csup/README
     - copied unchanged from r205116, head/usr.bin/csup/README
  user/ed/newcons/usr.bin/csup/TODO
     - copied unchanged from r205116, head/usr.bin/csup/TODO
  user/ed/newcons/usr.bin/csup/attrstack.c
     - copied unchanged from r205116, head/usr.bin/csup/attrstack.c
  user/ed/newcons/usr.bin/csup/attrstack.h
     - copied unchanged from r205116, head/usr.bin/csup/attrstack.h
  user/ed/newcons/usr.bin/csup/auth.c
     - copied unchanged from r205116, head/usr.bin/csup/auth.c
  user/ed/newcons/usr.bin/csup/auth.h
     - copied unchanged from r205116, head/usr.bin/csup/auth.h
  user/ed/newcons/usr.bin/csup/config.c
     - copied unchanged from r205116, head/usr.bin/csup/config.c
  user/ed/newcons/usr.bin/csup/config.h
     - copied unchanged from r205116, head/usr.bin/csup/config.h
  user/ed/newcons/usr.bin/csup/cpasswd.1
     - copied unchanged from r205116, head/usr.bin/csup/cpasswd.1
  user/ed/newcons/usr.bin/csup/cpasswd.sh
     - copied unchanged from r205116, head/usr.bin/csup/cpasswd.sh
  user/ed/newcons/usr.bin/csup/csup.1
     - copied unchanged from r205116, head/usr.bin/csup/csup.1
  user/ed/newcons/usr.bin/csup/detailer.c
     - copied unchanged from r205116, head/usr.bin/csup/detailer.c
  user/ed/newcons/usr.bin/csup/detailer.h
     - copied unchanged from r205116, head/usr.bin/csup/detailer.h
  user/ed/newcons/usr.bin/csup/diff.c
     - copied unchanged from r205116, head/usr.bin/csup/diff.c
  user/ed/newcons/usr.bin/csup/diff.h
     - copied unchanged from r205116, head/usr.bin/csup/diff.h
  user/ed/newcons/usr.bin/csup/fattr.c
     - copied unchanged from r205116, head/usr.bin/csup/fattr.c
  user/ed/newcons/usr.bin/csup/fattr.h
     - copied unchanged from r205116, head/usr.bin/csup/fattr.h
  user/ed/newcons/usr.bin/csup/fattr_bsd.h
     - copied unchanged from r205116, head/usr.bin/csup/fattr_bsd.h
  user/ed/newcons/usr.bin/csup/fattr_posix.h
     - copied unchanged from r205116, head/usr.bin/csup/fattr_posix.h
  user/ed/newcons/usr.bin/csup/fixups.c
     - copied unchanged from r205116, head/usr.bin/csup/fixups.c
  user/ed/newcons/usr.bin/csup/fixups.h
     - copied unchanged from r205116, head/usr.bin/csup/fixups.h
  user/ed/newcons/usr.bin/csup/fnmatch.c
     - copied unchanged from r205116, head/usr.bin/csup/fnmatch.c
  user/ed/newcons/usr.bin/csup/fnmatch.h
     - copied unchanged from r205116, head/usr.bin/csup/fnmatch.h
  user/ed/newcons/usr.bin/csup/globtree.c
     - copied unchanged from r205116, head/usr.bin/csup/globtree.c
  user/ed/newcons/usr.bin/csup/globtree.h
     - copied unchanged from r205116, head/usr.bin/csup/globtree.h
  user/ed/newcons/usr.bin/csup/idcache.c
     - copied unchanged from r205116, head/usr.bin/csup/idcache.c
  user/ed/newcons/usr.bin/csup/idcache.h
     - copied unchanged from r205116, head/usr.bin/csup/idcache.h
  user/ed/newcons/usr.bin/csup/keyword.c
     - copied unchanged from r205116, head/usr.bin/csup/keyword.c
  user/ed/newcons/usr.bin/csup/keyword.h
     - copied unchanged from r205116, head/usr.bin/csup/keyword.h
  user/ed/newcons/usr.bin/csup/lex.rcs.c
     - copied unchanged from r205116, head/usr.bin/csup/lex.rcs.c
  user/ed/newcons/usr.bin/csup/lister.c
     - copied unchanged from r205116, head/usr.bin/csup/lister.c
  user/ed/newcons/usr.bin/csup/lister.h
     - copied unchanged from r205116, head/usr.bin/csup/lister.h
  user/ed/newcons/usr.bin/csup/main.c
     - copied unchanged from r205116, head/usr.bin/csup/main.c
  user/ed/newcons/usr.bin/csup/main.h
     - copied unchanged from r205116, head/usr.bin/csup/main.h
  user/ed/newcons/usr.bin/csup/misc.c
     - copied unchanged from r205116, head/usr.bin/csup/misc.c
  user/ed/newcons/usr.bin/csup/misc.h
     - copied unchanged from r205116, head/usr.bin/csup/misc.h
  user/ed/newcons/usr.bin/csup/mux.c
     - copied unchanged from r205116, head/usr.bin/csup/mux.c
  user/ed/newcons/usr.bin/csup/mux.h
     - copied unchanged from r205116, head/usr.bin/csup/mux.h
  user/ed/newcons/usr.bin/csup/parse.y
     - copied unchanged from r205116, head/usr.bin/csup/parse.y
  user/ed/newcons/usr.bin/csup/pathcomp.c
     - copied unchanged from r205116, head/usr.bin/csup/pathcomp.c
  user/ed/newcons/usr.bin/csup/pathcomp.h
     - copied unchanged from r205116, head/usr.bin/csup/pathcomp.h
  user/ed/newcons/usr.bin/csup/proto.c
     - copied unchanged from r205116, head/usr.bin/csup/proto.c
  user/ed/newcons/usr.bin/csup/proto.h
     - copied unchanged from r205116, head/usr.bin/csup/proto.h
  user/ed/newcons/usr.bin/csup/queue.h
     - copied unchanged from r205116, head/usr.bin/csup/queue.h
  user/ed/newcons/usr.bin/csup/rcsfile.c
     - copied unchanged from r205116, head/usr.bin/csup/rcsfile.c
  user/ed/newcons/usr.bin/csup/rcsfile.h
     - copied unchanged from r205116, head/usr.bin/csup/rcsfile.h
  user/ed/newcons/usr.bin/csup/rcsparse.c
     - copied unchanged from r205116, head/usr.bin/csup/rcsparse.c
  user/ed/newcons/usr.bin/csup/rcsparse.h
     - copied unchanged from r205116, head/usr.bin/csup/rcsparse.h
  user/ed/newcons/usr.bin/csup/rcstokenizer.h
     - copied unchanged from r205116, head/usr.bin/csup/rcstokenizer.h
  user/ed/newcons/usr.bin/csup/rcstokenizer.l
     - copied unchanged from r205116, head/usr.bin/csup/rcstokenizer.l
  user/ed/newcons/usr.bin/csup/rsyncfile.c
     - copied unchanged from r205116, head/usr.bin/csup/rsyncfile.c
  user/ed/newcons/usr.bin/csup/rsyncfile.h
     - copied unchanged from r205116, head/usr.bin/csup/rsyncfile.h
  user/ed/newcons/usr.bin/csup/status.c
     - copied unchanged from r205116, head/usr.bin/csup/status.c
  user/ed/newcons/usr.bin/csup/status.h
     - copied unchanged from r205116, head/usr.bin/csup/status.h
  user/ed/newcons/usr.bin/csup/stream.c
     - copied unchanged from r205116, head/usr.bin/csup/stream.c
  user/ed/newcons/usr.bin/csup/stream.h
     - copied unchanged from r205116, head/usr.bin/csup/stream.h
  user/ed/newcons/usr.bin/csup/threads.c
     - copied unchanged from r205116, head/usr.bin/csup/threads.c
  user/ed/newcons/usr.bin/csup/threads.h
     - copied unchanged from r205116, head/usr.bin/csup/threads.h
  user/ed/newcons/usr.bin/csup/token.h
     - copied unchanged from r205116, head/usr.bin/csup/token.h
  user/ed/newcons/usr.bin/csup/token.l
     - copied unchanged from r205116, head/usr.bin/csup/token.l
  user/ed/newcons/usr.bin/csup/updater.c
     - copied unchanged from r205116, head/usr.bin/csup/updater.c
  user/ed/newcons/usr.bin/csup/updater.h
     - copied unchanged from r205116, head/usr.bin/csup/updater.h
  user/ed/newcons/usr.bin/ee/nls/pt_BR.ISO8859-1/
     - copied from r205116, head/usr.bin/ee/nls/pt_BR.ISO8859-1/
  user/ed/newcons/usr.bin/netstat/netisr.c
     - copied unchanged from r205116, head/usr.bin/netstat/netisr.c
  user/ed/newcons/usr.bin/procstat/procstat_sigs.c
     - copied unchanged from r205116, head/usr.bin/procstat/procstat_sigs.c
  user/ed/newcons/usr.bin/seq/
     - copied from r205116, head/usr.bin/seq/
  user/ed/newcons/usr.sbin/pmcstat/pmcpl_annotate.c
     - copied unchanged from r205116, head/usr.sbin/pmcstat/pmcpl_annotate.c
  user/ed/newcons/usr.sbin/pmcstat/pmcpl_annotate.h
     - copied unchanged from r205116, head/usr.sbin/pmcstat/pmcpl_annotate.h
  user/ed/newcons/usr.sbin/pmcstat/pmcpl_callgraph.c
     - copied unchanged from r205116, head/usr.sbin/pmcstat/pmcpl_callgraph.c
  user/ed/newcons/usr.sbin/pmcstat/pmcpl_callgraph.h
     - copied unchanged from r205116, head/usr.sbin/pmcstat/pmcpl_callgraph.h
  user/ed/newcons/usr.sbin/pmcstat/pmcpl_calltree.c
     - copied unchanged from r205116, head/usr.sbin/pmcstat/pmcpl_calltree.c
  user/ed/newcons/usr.sbin/pmcstat/pmcpl_calltree.h
     - copied unchanged from r205116, head/usr.sbin/pmcstat/pmcpl_calltree.h
  user/ed/newcons/usr.sbin/pmcstat/pmcpl_gprof.c
     - copied unchanged from r205116, head/usr.sbin/pmcstat/pmcpl_gprof.c
  user/ed/newcons/usr.sbin/pmcstat/pmcpl_gprof.h
     - copied unchanged from r205116, head/usr.sbin/pmcstat/pmcpl_gprof.h
  user/ed/newcons/usr.sbin/pmcstat/pmcstat_log.h
     - copied unchanged from r205116, head/usr.sbin/pmcstat/pmcstat_log.h
  user/ed/newcons/usr.sbin/pmcstat/pmcstat_top.h
     - copied unchanged from r205116, head/usr.sbin/pmcstat/pmcstat_top.h
Directory Properties:
  user/ed/newcons/contrib/tzdata/   (props changed)
Replaced:
  user/ed/newcons/usr.bin/csup/Makefile
     - copied unchanged from r205116, head/usr.bin/csup/Makefile
Deleted:
  user/ed/newcons/contrib/bc/
  user/ed/newcons/contrib/csup/
  user/ed/newcons/crypto/openssh/README.smartcard
  user/ed/newcons/crypto/openssh/scard-opensc.c
  user/ed/newcons/crypto/openssh/scard.c
  user/ed/newcons/crypto/openssh/scard.h
  user/ed/newcons/gnu/usr.bin/bc/
  user/ed/newcons/gnu/usr.bin/dc/
  user/ed/newcons/include/utmp.h
  user/ed/newcons/lib/libc/stdtime/asctime.c
  user/ed/newcons/lib/libc/stdtime/ctime.3
  user/ed/newcons/lib/libc/stdtime/difftime.c
  user/ed/newcons/lib/libc/stdtime/localtime.c
  user/ed/newcons/lib/libc/stdtime/private.h
  user/ed/newcons/lib/libc/stdtime/time2posix.3
  user/ed/newcons/lib/libc/stdtime/tzfile.5
  user/ed/newcons/lib/libc/stdtime/tzfile.h
  user/ed/newcons/share/man/man4/man4.i386/alpm.4
  user/ed/newcons/share/man/man4/man4.i386/amdpm.4
  user/ed/newcons/share/man/man4/man4.i386/mcd.4
  user/ed/newcons/share/man/man4/man4.i386/padlock.4
  user/ed/newcons/share/man/man4/man4.i386/pcf.4
  user/ed/newcons/share/man/man4/man4.i386/scd.4
  user/ed/newcons/share/man/man4/man4.i386/viapm.4
  user/ed/newcons/share/zoneinfo/africa
  user/ed/newcons/share/zoneinfo/antarctica
  user/ed/newcons/share/zoneinfo/asia
  user/ed/newcons/share/zoneinfo/australasia
  user/ed/newcons/share/zoneinfo/backward
  user/ed/newcons/share/zoneinfo/etcetera
  user/ed/newcons/share/zoneinfo/europe
  user/ed/newcons/share/zoneinfo/factory
  user/ed/newcons/share/zoneinfo/leapseconds
  user/ed/newcons/share/zoneinfo/northamerica
  user/ed/newcons/share/zoneinfo/pacificnew
  user/ed/newcons/share/zoneinfo/southamerica
  user/ed/newcons/share/zoneinfo/systemv
  user/ed/newcons/share/zoneinfo/yearistype.sh
  user/ed/newcons/share/zoneinfo/zone.tab
  user/ed/newcons/sys/amd64/isa/
  user/ed/newcons/sys/dev/cxgb/common/cxgb_version.h
  user/ed/newcons/sys/dev/cxgb/cxgb_config.h
  user/ed/newcons/sys/i386/bios/smbios.c
  user/ed/newcons/sys/i386/bios/vpd.c
  user/ed/newcons/sys/i386/cpufreq/
  user/ed/newcons/sys/i386/isa/atpic.c
  user/ed/newcons/sys/i386/isa/atpic_vector.s
  user/ed/newcons/sys/i386/isa/clock.c
  user/ed/newcons/sys/i386/isa/elcr.c
  user/ed/newcons/sys/i386/isa/icu.h
  user/ed/newcons/sys/i386/isa/isa.c
  user/ed/newcons/sys/i386/isa/isa.h
  user/ed/newcons/sys/i386/isa/isa_dma.c
  user/ed/newcons/sys/i386/isa/nmi.c
  user/ed/newcons/sys/ia64/include/sapicreg.h
  user/ed/newcons/sys/ia64/include/sapicvar.h
  user/ed/newcons/sys/isa/atrtc.c
  user/ed/newcons/sys/isa/orm.c
  user/ed/newcons/sys/kern/kern_subr.c
  user/ed/newcons/tools/tools/mctest/mcgrab.1
  user/ed/newcons/tools/tools/mctest/mcgrab.cc
  user/ed/newcons/usr.sbin/zic/Theory
  user/ed/newcons/usr.sbin/zic/ialloc.c
  user/ed/newcons/usr.sbin/zic/private.h
  user/ed/newcons/usr.sbin/zic/scheck.c
  user/ed/newcons/usr.sbin/zic/zdump.8
  user/ed/newcons/usr.sbin/zic/zdump.c
  user/ed/newcons/usr.sbin/zic/zic.8
  user/ed/newcons/usr.sbin/zic/zic.c
Modified:
  user/ed/newcons/MAINTAINERS
  user/ed/newcons/Makefile
  user/ed/newcons/Makefile.inc1
  user/ed/newcons/ObsoleteFiles.inc
  user/ed/newcons/UPDATING
  user/ed/newcons/bin/ed/Makefile
  user/ed/newcons/bin/ed/main.c
  user/ed/newcons/bin/kill/kill.c
  user/ed/newcons/bin/pkill/pkill.1
  user/ed/newcons/bin/pkill/pkill.c
  user/ed/newcons/bin/ps/ps.1
  user/ed/newcons/bin/ps/ps.c
  user/ed/newcons/bin/rmail/Makefile
  user/ed/newcons/bin/setfacl/file.c
  user/ed/newcons/bin/setfacl/mask.c
  user/ed/newcons/bin/setfacl/merge.c
  user/ed/newcons/bin/setfacl/remove.c
  user/ed/newcons/bin/setfacl/setfacl.1
  user/ed/newcons/bin/setfacl/setfacl.c
  user/ed/newcons/bin/setfacl/setfacl.h
  user/ed/newcons/bin/setfacl/util.c
  user/ed/newcons/bin/sh/eval.c
  user/ed/newcons/bin/sh/exec.c
  user/ed/newcons/bin/sh/exec.h
  user/ed/newcons/bin/sh/parser.c
  user/ed/newcons/bin/sh/sh.1
  user/ed/newcons/cddl/Makefile.inc
  user/ed/newcons/cddl/lib/drti/Makefile
  user/ed/newcons/cddl/lib/libavl/Makefile
  user/ed/newcons/cddl/lib/libctf/Makefile
  user/ed/newcons/cddl/lib/libdtrace/Makefile
  user/ed/newcons/cddl/lib/libnvpair/Makefile
  user/ed/newcons/cddl/lib/libumem/Makefile
  user/ed/newcons/cddl/lib/libuutil/Makefile
  user/ed/newcons/cddl/lib/libzfs/Makefile
  user/ed/newcons/cddl/lib/libzpool/Makefile
  user/ed/newcons/cddl/sbin/zfs/Makefile
  user/ed/newcons/cddl/sbin/zpool/Makefile
  user/ed/newcons/cddl/usr.bin/ctfconvert/Makefile
  user/ed/newcons/cddl/usr.bin/ctfdump/Makefile
  user/ed/newcons/cddl/usr.bin/ctfmerge/Makefile
  user/ed/newcons/cddl/usr.bin/sgsmsg/Makefile
  user/ed/newcons/cddl/usr.bin/zinject/Makefile
  user/ed/newcons/cddl/usr.bin/ztest/Makefile
  user/ed/newcons/cddl/usr.sbin/dtrace/Makefile
  user/ed/newcons/cddl/usr.sbin/lockstat/Makefile
  user/ed/newcons/cddl/usr.sbin/zdb/Makefile
  user/ed/newcons/contrib/bind9/CHANGES
  user/ed/newcons/contrib/bind9/COPYRIGHT
  user/ed/newcons/contrib/bind9/FAQ
  user/ed/newcons/contrib/bind9/FAQ.xml
  user/ed/newcons/contrib/bind9/NSEC3-NOTES
  user/ed/newcons/contrib/bind9/README
  user/ed/newcons/contrib/bind9/bin/check/named-checkconf.8
  user/ed/newcons/contrib/bind9/bin/check/named-checkconf.html
  user/ed/newcons/contrib/bind9/bin/check/named-checkzone.8
  user/ed/newcons/contrib/bind9/bin/check/named-checkzone.c
  user/ed/newcons/contrib/bind9/bin/check/named-checkzone.docbook
  user/ed/newcons/contrib/bind9/bin/check/named-checkzone.html
  user/ed/newcons/contrib/bind9/bin/dig/dig.1
  user/ed/newcons/contrib/bind9/bin/dig/dig.html
  user/ed/newcons/contrib/bind9/bin/dig/dighost.c
  user/ed/newcons/contrib/bind9/bin/dig/host.1
  user/ed/newcons/contrib/bind9/bin/dig/host.c
  user/ed/newcons/contrib/bind9/bin/dig/host.html
  user/ed/newcons/contrib/bind9/bin/dig/nslookup.1
  user/ed/newcons/contrib/bind9/bin/dig/nslookup.c
  user/ed/newcons/contrib/bind9/bin/dig/nslookup.html
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-dsfromkey.c
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.8
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.html
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-keygen.8
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-keygen.c
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-keygen.docbook
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-keygen.html
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-signzone.8
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-signzone.c
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-signzone.docbook
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssec-signzone.html
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssectool.c
  user/ed/newcons/contrib/bind9/bin/dnssec/dnssectool.h
  user/ed/newcons/contrib/bind9/bin/named/control.c
  user/ed/newcons/contrib/bind9/bin/named/include/named/server.h
  user/ed/newcons/contrib/bind9/bin/named/lwresd.8
  user/ed/newcons/contrib/bind9/bin/named/lwresd.html
  user/ed/newcons/contrib/bind9/bin/named/named.8
  user/ed/newcons/contrib/bind9/bin/named/named.conf.5
  user/ed/newcons/contrib/bind9/bin/named/named.conf.html
  user/ed/newcons/contrib/bind9/bin/named/named.docbook
  user/ed/newcons/contrib/bind9/bin/named/named.html
  user/ed/newcons/contrib/bind9/bin/named/query.c
  user/ed/newcons/contrib/bind9/bin/named/server.c
  user/ed/newcons/contrib/bind9/bin/named/statschannel.c
  user/ed/newcons/contrib/bind9/bin/named/update.c
  user/ed/newcons/contrib/bind9/bin/nsupdate/nsupdate.1
  user/ed/newcons/contrib/bind9/bin/nsupdate/nsupdate.html
  user/ed/newcons/contrib/bind9/bin/rndc/rndc-confgen.8
  user/ed/newcons/contrib/bind9/bin/rndc/rndc-confgen.html
  user/ed/newcons/contrib/bind9/bin/rndc/rndc.8
  user/ed/newcons/contrib/bind9/bin/rndc/rndc.conf.5
  user/ed/newcons/contrib/bind9/bin/rndc/rndc.conf.html
  user/ed/newcons/contrib/bind9/bin/rndc/rndc.html
  user/ed/newcons/contrib/bind9/config.h.in
  user/ed/newcons/contrib/bind9/configure.in
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM-book.xml
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.ch01.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.ch02.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.ch03.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.ch04.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.ch05.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.ch06.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.ch07.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.ch08.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.ch09.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.ch10.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.html
  user/ed/newcons/contrib/bind9/doc/arm/Bv9ARM.pdf
  user/ed/newcons/contrib/bind9/doc/arm/man.dig.html
  user/ed/newcons/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html
  user/ed/newcons/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html
  user/ed/newcons/contrib/bind9/doc/arm/man.dnssec-keygen.html
  user/ed/newcons/contrib/bind9/doc/arm/man.dnssec-signzone.html
  user/ed/newcons/contrib/bind9/doc/arm/man.host.html
  user/ed/newcons/contrib/bind9/doc/arm/man.named-checkconf.html
  user/ed/newcons/contrib/bind9/doc/arm/man.named-checkzone.html
  user/ed/newcons/contrib/bind9/doc/arm/man.named.html
  user/ed/newcons/contrib/bind9/doc/arm/man.nsupdate.html
  user/ed/newcons/contrib/bind9/doc/arm/man.rndc-confgen.html
  user/ed/newcons/contrib/bind9/doc/arm/man.rndc.conf.html
  user/ed/newcons/contrib/bind9/doc/arm/man.rndc.html
  user/ed/newcons/contrib/bind9/doc/misc/Makefile.in
  user/ed/newcons/contrib/bind9/lib/dns/api
  user/ed/newcons/contrib/bind9/lib/dns/db.c
  user/ed/newcons/contrib/bind9/lib/dns/dispatch.c
  user/ed/newcons/contrib/bind9/lib/dns/dnssec.c
  user/ed/newcons/contrib/bind9/lib/dns/dst_api.c
  user/ed/newcons/contrib/bind9/lib/dns/dst_internal.h
  user/ed/newcons/contrib/bind9/lib/dns/dst_parse.c
  user/ed/newcons/contrib/bind9/lib/dns/include/dns/db.h
  user/ed/newcons/contrib/bind9/lib/dns/include/dns/dnssec.h
  user/ed/newcons/contrib/bind9/lib/dns/include/dns/journal.h
  user/ed/newcons/contrib/bind9/lib/dns/include/dns/keyvalues.h
  user/ed/newcons/contrib/bind9/lib/dns/include/dns/name.h
  user/ed/newcons/contrib/bind9/lib/dns/include/dns/ncache.h
  user/ed/newcons/contrib/bind9/lib/dns/include/dns/nsec3.h
  user/ed/newcons/contrib/bind9/lib/dns/include/dns/rbt.h
  user/ed/newcons/contrib/bind9/lib/dns/include/dns/types.h
  user/ed/newcons/contrib/bind9/lib/dns/include/dns/zone.h
  user/ed/newcons/contrib/bind9/lib/dns/include/dst/dst.h
  user/ed/newcons/contrib/bind9/lib/dns/journal.c
  user/ed/newcons/contrib/bind9/lib/dns/masterdump.c
  user/ed/newcons/contrib/bind9/lib/dns/message.c
  user/ed/newcons/contrib/bind9/lib/dns/nsec3.c
  user/ed/newcons/contrib/bind9/lib/dns/opensslrsa_link.c
  user/ed/newcons/contrib/bind9/lib/dns/rbt.c
  user/ed/newcons/contrib/bind9/lib/dns/rbtdb.c
  user/ed/newcons/contrib/bind9/lib/dns/rcode.c
  user/ed/newcons/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.c
  user/ed/newcons/contrib/bind9/lib/dns/resolver.c
  user/ed/newcons/contrib/bind9/lib/dns/sdb.c
  user/ed/newcons/contrib/bind9/lib/dns/sdlz.c
  user/ed/newcons/contrib/bind9/lib/dns/spnego.c
  user/ed/newcons/contrib/bind9/lib/dns/validator.c
  user/ed/newcons/contrib/bind9/lib/dns/view.c
  user/ed/newcons/contrib/bind9/lib/dns/zone.c
  user/ed/newcons/contrib/bind9/lib/isc/api
  user/ed/newcons/contrib/bind9/lib/isc/base32.c
  user/ed/newcons/contrib/bind9/lib/isc/base64.c
  user/ed/newcons/contrib/bind9/lib/isc/heap.c
  user/ed/newcons/contrib/bind9/lib/isc/httpd.c
  user/ed/newcons/contrib/bind9/lib/isc/ia64/include/isc/atomic.h
  user/ed/newcons/contrib/bind9/lib/isc/include/isc/entropy.h
  user/ed/newcons/contrib/bind9/lib/isc/include/isc/netscope.h
  user/ed/newcons/contrib/bind9/lib/isc/include/isc/portset.h
  user/ed/newcons/contrib/bind9/lib/isc/include/isc/sha2.h
  user/ed/newcons/contrib/bind9/lib/isc/include/isc/util.h
  user/ed/newcons/contrib/bind9/lib/isc/inet_ntop.c
  user/ed/newcons/contrib/bind9/lib/isc/powerpc/include/isc/atomic.h
  user/ed/newcons/contrib/bind9/lib/isc/random.c
  user/ed/newcons/contrib/bind9/lib/isc/sha2.c
  user/ed/newcons/contrib/bind9/lib/isc/unix/ifiter_getifaddrs.c
  user/ed/newcons/contrib/bind9/lib/isc/unix/socket.c
  user/ed/newcons/contrib/bind9/lib/isccc/api
  user/ed/newcons/contrib/bind9/lib/isccfg/aclconf.c
  user/ed/newcons/contrib/bind9/lib/isccfg/api
  user/ed/newcons/contrib/bind9/lib/isccfg/include/isccfg/namedconf.h
  user/ed/newcons/contrib/bind9/lib/lwres/api
  user/ed/newcons/contrib/bind9/lib/lwres/context.c
  user/ed/newcons/contrib/bind9/lib/lwres/getipnode.c
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_buffer.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_buffer.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_config.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_config.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_context.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_context.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_gabn.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_gabn.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_gai_strerror.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_gai_strerror.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_gethostent.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_gethostent.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_getipnode.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_getipnode.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_getnameinfo.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_getnameinfo.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_gnba.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_gnba.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_hstrerror.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_hstrerror.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_inetntop.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_inetntop.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_noop.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_noop.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_packet.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_packet.html
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_resutil.3
  user/ed/newcons/contrib/bind9/lib/lwres/man/lwres_resutil.html
  user/ed/newcons/contrib/bind9/version
  user/ed/newcons/contrib/bsnmp/gensnmptree/gensnmptree.1
  user/ed/newcons/contrib/bsnmp/snmpd/snmpmod.3
  user/ed/newcons/contrib/gcc/config/mips/freebsd.h
  user/ed/newcons/contrib/gdb/gdb/mips-tdep.h
  user/ed/newcons/contrib/ipfilter/ipsend/sbpf.c
  user/ed/newcons/crypto/openssh/ChangeLog
  user/ed/newcons/crypto/openssh/INSTALL
  user/ed/newcons/crypto/openssh/PROTOCOL
  user/ed/newcons/crypto/openssh/PROTOCOL.agent
  user/ed/newcons/crypto/openssh/README
  user/ed/newcons/crypto/openssh/addrmatch.c
  user/ed/newcons/crypto/openssh/auth-krb5.c
  user/ed/newcons/crypto/openssh/auth-options.c
  user/ed/newcons/crypto/openssh/auth-options.h
  user/ed/newcons/crypto/openssh/auth-rh-rsa.c
  user/ed/newcons/crypto/openssh/auth-rhosts.c
  user/ed/newcons/crypto/openssh/auth-rsa.c
  user/ed/newcons/crypto/openssh/auth.c
  user/ed/newcons/crypto/openssh/auth.h
  user/ed/newcons/crypto/openssh/auth2-hostbased.c
  user/ed/newcons/crypto/openssh/auth2-pubkey.c
  user/ed/newcons/crypto/openssh/authfd.c
  user/ed/newcons/crypto/openssh/authfd.h
  user/ed/newcons/crypto/openssh/authfile.c
  user/ed/newcons/crypto/openssh/authfile.h
  user/ed/newcons/crypto/openssh/bufaux.c
  user/ed/newcons/crypto/openssh/buffer.c
  user/ed/newcons/crypto/openssh/buffer.h
  user/ed/newcons/crypto/openssh/canohost.c
  user/ed/newcons/crypto/openssh/channels.c
  user/ed/newcons/crypto/openssh/channels.h
  user/ed/newcons/crypto/openssh/clientloop.c
  user/ed/newcons/crypto/openssh/clientloop.h
  user/ed/newcons/crypto/openssh/config.guess
  user/ed/newcons/crypto/openssh/config.h
  user/ed/newcons/crypto/openssh/config.h.in
  user/ed/newcons/crypto/openssh/defines.h
  user/ed/newcons/crypto/openssh/dh.c
  user/ed/newcons/crypto/openssh/dns.c
  user/ed/newcons/crypto/openssh/dns.h
  user/ed/newcons/crypto/openssh/hostfile.c
  user/ed/newcons/crypto/openssh/hostfile.h
  user/ed/newcons/crypto/openssh/kex.c
  user/ed/newcons/crypto/openssh/kex.h
  user/ed/newcons/crypto/openssh/kexdhs.c
  user/ed/newcons/crypto/openssh/kexgexs.c
  user/ed/newcons/crypto/openssh/key.c
  user/ed/newcons/crypto/openssh/key.h
  user/ed/newcons/crypto/openssh/loginrec.c
  user/ed/newcons/crypto/openssh/match.h
  user/ed/newcons/crypto/openssh/misc.c
  user/ed/newcons/crypto/openssh/misc.h
  user/ed/newcons/crypto/openssh/monitor.c
  user/ed/newcons/crypto/openssh/monitor_fdpass.c
  user/ed/newcons/crypto/openssh/monitor_wrap.c
  user/ed/newcons/crypto/openssh/mux.c
  user/ed/newcons/crypto/openssh/myproposal.h
  user/ed/newcons/crypto/openssh/nchan.c
  user/ed/newcons/crypto/openssh/openbsd-compat/bsd-cygwin_util.c
  user/ed/newcons/crypto/openssh/openbsd-compat/openbsd-compat.h
  user/ed/newcons/crypto/openssh/openbsd-compat/openssl-compat.c
  user/ed/newcons/crypto/openssh/openbsd-compat/port-aix.c
  user/ed/newcons/crypto/openssh/openbsd-compat/port-aix.h
  user/ed/newcons/crypto/openssh/openbsd-compat/port-linux.c
  user/ed/newcons/crypto/openssh/openbsd-compat/port-linux.h
  user/ed/newcons/crypto/openssh/openbsd-compat/readpassphrase.c
  user/ed/newcons/crypto/openssh/pathnames.h
  user/ed/newcons/crypto/openssh/platform.c
  user/ed/newcons/crypto/openssh/platform.h
  user/ed/newcons/crypto/openssh/readconf.c
  user/ed/newcons/crypto/openssh/readconf.h
  user/ed/newcons/crypto/openssh/roaming.h
  user/ed/newcons/crypto/openssh/roaming_common.c
  user/ed/newcons/crypto/openssh/scp.1
  user/ed/newcons/crypto/openssh/scp.c
  user/ed/newcons/crypto/openssh/servconf.c
  user/ed/newcons/crypto/openssh/servconf.h
  user/ed/newcons/crypto/openssh/session.c
  user/ed/newcons/crypto/openssh/sftp-client.c
  user/ed/newcons/crypto/openssh/sftp-client.h
  user/ed/newcons/crypto/openssh/sftp-common.c
  user/ed/newcons/crypto/openssh/sftp-common.h
  user/ed/newcons/crypto/openssh/sftp-server.8
  user/ed/newcons/crypto/openssh/sftp-server.c
  user/ed/newcons/crypto/openssh/sftp.1
  user/ed/newcons/crypto/openssh/sftp.c
  user/ed/newcons/crypto/openssh/ssh-add.1
  user/ed/newcons/crypto/openssh/ssh-add.c
  user/ed/newcons/crypto/openssh/ssh-agent.1
  user/ed/newcons/crypto/openssh/ssh-agent.c
  user/ed/newcons/crypto/openssh/ssh-dss.c
  user/ed/newcons/crypto/openssh/ssh-keygen.1
  user/ed/newcons/crypto/openssh/ssh-keygen.c
  user/ed/newcons/crypto/openssh/ssh-keyscan.1
  user/ed/newcons/crypto/openssh/ssh-keyscan.c
  user/ed/newcons/crypto/openssh/ssh-keysign.c
  user/ed/newcons/crypto/openssh/ssh-rand-helper.c
  user/ed/newcons/crypto/openssh/ssh-rsa.c
  user/ed/newcons/crypto/openssh/ssh.1
  user/ed/newcons/crypto/openssh/ssh.c
  user/ed/newcons/crypto/openssh/ssh2.h
  user/ed/newcons/crypto/openssh/ssh_config
  user/ed/newcons/crypto/openssh/ssh_config.5
  user/ed/newcons/crypto/openssh/ssh_namespace.h
  user/ed/newcons/crypto/openssh/sshconnect.c
  user/ed/newcons/crypto/openssh/sshconnect2.c
  user/ed/newcons/crypto/openssh/sshd.8
  user/ed/newcons/crypto/openssh/sshd.c
  user/ed/newcons/crypto/openssh/sshd_config
  user/ed/newcons/crypto/openssh/sshd_config.5
  user/ed/newcons/crypto/openssh/sshpty.h
  user/ed/newcons/crypto/openssh/sshtty.c
  user/ed/newcons/crypto/openssh/version.h
  user/ed/newcons/etc/Makefile
  user/ed/newcons/etc/defaults/rc.conf
  user/ed/newcons/etc/mtree/BSD.usr.dist
  user/ed/newcons/etc/ppp/ppp.conf
  user/ed/newcons/etc/rc.d/Makefile
  user/ed/newcons/etc/rc.d/ipfw
  user/ed/newcons/etc/rc.d/jail
  user/ed/newcons/etc/rc.d/rtsold
  user/ed/newcons/etc/termcap.small
  user/ed/newcons/games/Makefile.inc
  user/ed/newcons/games/bcd/Makefile
  user/ed/newcons/games/bcd/bcd.c
  user/ed/newcons/games/caesar/Makefile
  user/ed/newcons/games/caesar/caesar.c
  user/ed/newcons/games/fortune/datfiles/fortunes
  user/ed/newcons/games/fortune/fortune/Makefile
  user/ed/newcons/games/fortune/fortune/fortune.6
  user/ed/newcons/games/fortune/fortune/fortune.c
  user/ed/newcons/games/fortune/fortune/pathnames.h
  user/ed/newcons/games/fortune/strfile/Makefile
  user/ed/newcons/games/fortune/strfile/strfile.8
  user/ed/newcons/games/fortune/strfile/strfile.c
  user/ed/newcons/games/fortune/strfile/strfile.h
  user/ed/newcons/games/fortune/unstr/Makefile
  user/ed/newcons/games/fortune/unstr/unstr.c
  user/ed/newcons/games/grdc/Makefile
  user/ed/newcons/games/grdc/grdc.c
  user/ed/newcons/games/morse/morse.c
  user/ed/newcons/games/number/Makefile
  user/ed/newcons/games/number/number.c
  user/ed/newcons/games/pom/Makefile
  user/ed/newcons/games/pom/pom.6
  user/ed/newcons/games/pom/pom.c
  user/ed/newcons/games/ppt/Makefile
  user/ed/newcons/games/ppt/ppt.c
  user/ed/newcons/games/primes/pattern.c
  user/ed/newcons/games/primes/pr_tbl.c
  user/ed/newcons/games/primes/primes.c
  user/ed/newcons/games/primes/primes.h
  user/ed/newcons/games/random/Makefile
  user/ed/newcons/games/random/random.c
  user/ed/newcons/gnu/usr.bin/Makefile
  user/ed/newcons/gnu/usr.bin/binutils/ld/Makefile.mips
  user/ed/newcons/gnu/usr.bin/binutils/ld/genscripts.sh
  user/ed/newcons/gnu/usr.bin/cc/Makefile.inc
  user/ed/newcons/gnu/usr.bin/diff/Makefile
  user/ed/newcons/gnu/usr.bin/diff3/Makefile
  user/ed/newcons/gnu/usr.bin/gdb/Makefile
  user/ed/newcons/gnu/usr.bin/gdb/arch/ia64/Makefile
  user/ed/newcons/gnu/usr.bin/gdb/arch/ia64/init.c
  user/ed/newcons/gnu/usr.bin/gdb/arch/mips/Makefile
  user/ed/newcons/gnu/usr.bin/gdb/arch/mips/init.c
  user/ed/newcons/gnu/usr.bin/gdb/gdbserver/Makefile
  user/ed/newcons/gnu/usr.bin/gdb/kgdb/kthr.c
  user/ed/newcons/gnu/usr.bin/gdb/kgdb/trgt_mips.c
  user/ed/newcons/gnu/usr.bin/groff/tmac/mdoc.local
  user/ed/newcons/gnu/usr.bin/sdiff/Makefile
  user/ed/newcons/include/Makefile
  user/ed/newcons/include/_ctype.h
  user/ed/newcons/include/a.out.h
  user/ed/newcons/include/ar.h
  user/ed/newcons/include/arpa/ftp.h
  user/ed/newcons/include/arpa/inet.h
  user/ed/newcons/include/arpa/nameser.h
  user/ed/newcons/include/arpa/nameser_compat.h
  user/ed/newcons/include/arpa/telnet.h
  user/ed/newcons/include/arpa/tftp.h
  user/ed/newcons/include/assert.h
  user/ed/newcons/include/ctype.h
  user/ed/newcons/include/db.h
  user/ed/newcons/include/dirent.h
  user/ed/newcons/include/dlfcn.h
  user/ed/newcons/include/err.h
  user/ed/newcons/include/fnmatch.h
  user/ed/newcons/include/fstab.h
  user/ed/newcons/include/fts.h
  user/ed/newcons/include/getopt.h
  user/ed/newcons/include/glob.h
  user/ed/newcons/include/grp.h
  user/ed/newcons/include/hesiod.h
  user/ed/newcons/include/limits.h
  user/ed/newcons/include/locale.h
  user/ed/newcons/include/memory.h
  user/ed/newcons/include/mpool.h
  user/ed/newcons/include/ndbm.h
  user/ed/newcons/include/netdb.h
  user/ed/newcons/include/nl_types.h
  user/ed/newcons/include/nlist.h
  user/ed/newcons/include/nsswitch.h
  user/ed/newcons/include/paths.h
  user/ed/newcons/include/protocols/dumprestore.h
  user/ed/newcons/include/protocols/routed.h
  user/ed/newcons/include/protocols/rwhod.h
  user/ed/newcons/include/protocols/talkd.h
  user/ed/newcons/include/protocols/timed.h
  user/ed/newcons/include/pwd.h
  user/ed/newcons/include/ranlib.h
  user/ed/newcons/include/regex.h
  user/ed/newcons/include/regexp.h
  user/ed/newcons/include/resolv.h
  user/ed/newcons/include/runetype.h
  user/ed/newcons/include/setjmp.h
  user/ed/newcons/include/signal.h
  user/ed/newcons/include/stab.h
  user/ed/newcons/include/stddef.h
  user/ed/newcons/include/stdio.h
  user/ed/newcons/include/stdlib.h
  user/ed/newcons/include/string.h
  user/ed/newcons/include/sysexits.h
  user/ed/newcons/include/tar.h
  user/ed/newcons/include/termios.h
  user/ed/newcons/include/time.h
  user/ed/newcons/include/timeconv.h
  user/ed/newcons/include/ttyent.h
  user/ed/newcons/include/unistd.h
  user/ed/newcons/include/utime.h
  user/ed/newcons/include/vis.h
  user/ed/newcons/include/wchar.h
  user/ed/newcons/lib/Makefile
  user/ed/newcons/lib/bind/config.h
  user/ed/newcons/lib/csu/Makefile.inc
  user/ed/newcons/lib/csu/amd64/crt1.c
  user/ed/newcons/lib/csu/arm/Makefile
  user/ed/newcons/lib/csu/arm/crt1.c
  user/ed/newcons/lib/csu/ia64/Makefile
  user/ed/newcons/lib/csu/mips/Makefile
  user/ed/newcons/lib/csu/mips/crt1.c
  user/ed/newcons/lib/csu/mips/crti.S
  user/ed/newcons/lib/csu/mips/crtn.S
  user/ed/newcons/lib/csu/powerpc/Makefile
  user/ed/newcons/lib/csu/powerpc/crt1.c
  user/ed/newcons/lib/csu/sparc64/crt1.c
  user/ed/newcons/lib/libalias/libalias/Makefile
  user/ed/newcons/lib/libarchive/archive_write_disk.3
  user/ed/newcons/lib/libarchive/test/Makefile
  user/ed/newcons/lib/libbsnmp/Makefile.inc
  user/ed/newcons/lib/libbsnmp/libbsnmp/Makefile
  user/ed/newcons/lib/libc/arm/gen/makecontext.c
  user/ed/newcons/lib/libc/arm/string/bzero.S
  user/ed/newcons/lib/libc/arm/string/memcpy_arm.S
  user/ed/newcons/lib/libc/arm/string/memmove.S
  user/ed/newcons/lib/libc/compat-43/sigpause.2
  user/ed/newcons/lib/libc/gen/fmtcheck.3
  user/ed/newcons/lib/libc/gen/pause.c
  user/ed/newcons/lib/libc/gen/stringlist.3
  user/ed/newcons/lib/libc/gen/sysconf.c
  user/ed/newcons/lib/libc/gen/sysctl.3
  user/ed/newcons/lib/libc/gen/sysctl.c
  user/ed/newcons/lib/libc/gen/sysctlbyname.c
  user/ed/newcons/lib/libc/gen/sysctlnametomib.c
  user/ed/newcons/lib/libc/gen/tls.c
  user/ed/newcons/lib/libc/include/reentrant.h
  user/ed/newcons/lib/libc/nls/msgcat.c
  user/ed/newcons/lib/libc/posix1e/acl_add_flag_np.3
  user/ed/newcons/lib/libc/posix1e/acl_clear_flags_np.3
  user/ed/newcons/lib/libc/posix1e/acl_delete_flag_np.3
  user/ed/newcons/lib/libc/posix1e/acl_get_brand_np.3
  user/ed/newcons/lib/libc/posix1e/acl_get_entry_type_np.3
  user/ed/newcons/lib/libc/posix1e/acl_get_flag_np.3
  user/ed/newcons/lib/libc/posix1e/acl_get_flagset_np.3
  user/ed/newcons/lib/libc/posix1e/acl_set_entry_type_np.3
  user/ed/newcons/lib/libc/posix1e/acl_set_flagset_np.3
  user/ed/newcons/lib/libc/posix1e/acl_strip.c
  user/ed/newcons/lib/libc/posix1e/mac.3
  user/ed/newcons/lib/libc/powerpc/gen/fpgetmask.c
  user/ed/newcons/lib/libc/powerpc/gen/fpgetround.c
  user/ed/newcons/lib/libc/powerpc/gen/fpgetsticky.c
  user/ed/newcons/lib/libc/powerpc/gen/fpsetmask.c
  user/ed/newcons/lib/libc/powerpc/gen/fpsetround.c
  user/ed/newcons/lib/libc/rpc/Symbol.map
  user/ed/newcons/lib/libc/rpc/clnt_simple.c
  user/ed/newcons/lib/libc/rpc/getnetconfig.c
  user/ed/newcons/lib/libc/rpc/key_call.c
  user/ed/newcons/lib/libc/rpc/mt_misc.c
  user/ed/newcons/lib/libc/rpc/mt_misc.h
  user/ed/newcons/lib/libc/rpc/rpc_generic.c
  user/ed/newcons/lib/libc/rpc/rpc_soc.c
  user/ed/newcons/lib/libc/sparc64/fpu/fpu.c
  user/ed/newcons/lib/libc/sparc64/fpu/fpu_emu.h
  user/ed/newcons/lib/libc/sparc64/fpu/fpu_extern.h
  user/ed/newcons/lib/libc/stdio/findfp.c
  user/ed/newcons/lib/libc/stdio/local.h
  user/ed/newcons/lib/libc/stdio/mktemp.c
  user/ed/newcons/lib/libc/stdio/printf.3
  user/ed/newcons/lib/libc/stdio/snprintf.c
  user/ed/newcons/lib/libc/stdio/vasprintf.c
  user/ed/newcons/lib/libc/stdio/vdprintf.c
  user/ed/newcons/lib/libc/stdio/vfprintf.c
  user/ed/newcons/lib/libc/stdio/vsnprintf.c
  user/ed/newcons/lib/libc/stdio/vsprintf.c
  user/ed/newcons/lib/libc/stdio/vsscanf.c
  user/ed/newcons/lib/libc/stdio/vswprintf.c
  user/ed/newcons/lib/libc/stdio/vswscanf.c
  user/ed/newcons/lib/libc/stdio/xprintf.c
  user/ed/newcons/lib/libc/stdlib/malloc.c
  user/ed/newcons/lib/libc/stdlib/rb.h
  user/ed/newcons/lib/libc/stdlib/reallocf.c
  user/ed/newcons/lib/libc/stdlib/strfmon.c
  user/ed/newcons/lib/libc/stdtime/Makefile.inc
  user/ed/newcons/lib/libc/stdtime/strptime.3
  user/ed/newcons/lib/libc/string/strlen.c
  user/ed/newcons/lib/libc/sys/mlockall.2
  user/ed/newcons/lib/libc/sys/ntp_adjtime.2
  user/ed/newcons/lib/libc/sys/ptrace.2
  user/ed/newcons/lib/libc/sys/unlink.2
  user/ed/newcons/lib/libc/sys/utrace.2
  user/ed/newcons/lib/libc_r/Makefile
  user/ed/newcons/lib/libcompat/Makefile
  user/ed/newcons/lib/libdwarf/Makefile
  user/ed/newcons/lib/libedit/editline.3
  user/ed/newcons/lib/libedit/editrc.5
  user/ed/newcons/lib/libedit/read.h
  user/ed/newcons/lib/libefi/libefi.3
  user/ed/newcons/lib/libgssapi/gss_init_sec_context.3
  user/ed/newcons/lib/libgssapi/gss_unwrap.3
  user/ed/newcons/lib/libjail/jail.c
  user/ed/newcons/lib/libkse/Makefile
  user/ed/newcons/lib/libkvm/Makefile
  user/ed/newcons/lib/libkvm/kvm.c
  user/ed/newcons/lib/libkvm/kvm.h
  user/ed/newcons/lib/libkvm/kvm_getpcpu.3
  user/ed/newcons/lib/libkvm/kvm_pcpu.c
  user/ed/newcons/lib/libkvm/kvm_private.h
  user/ed/newcons/lib/libkvm/kvm_vnet.c
  user/ed/newcons/lib/libpam/Makefile.inc
  user/ed/newcons/lib/libpam/modules/Makefile.inc
  user/ed/newcons/lib/libpam/modules/pam_echo/pam_echo.8
  user/ed/newcons/lib/libpam/modules/pam_krb5/Makefile
  user/ed/newcons/lib/libpam/modules/pam_ssh/pam_ssh.c
  user/ed/newcons/lib/libpmc/libpmc.c
  user/ed/newcons/lib/libproc/Makefile
  user/ed/newcons/lib/librpcsec_gss/rpcsec_gss.3
  user/ed/newcons/lib/librt/Makefile
  user/ed/newcons/lib/libsm/Makefile
  user/ed/newcons/lib/libufs/cgroup.c
  user/ed/newcons/lib/libufs/sblock.c
  user/ed/newcons/lib/libusb/libusb.h
  user/ed/newcons/lib/libusb/libusb10.c
  user/ed/newcons/lib/libusb/libusb10_desc.c
  user/ed/newcons/lib/libusb/libusb10_io.c
  user/ed/newcons/lib/libusb/libusb20.c
  user/ed/newcons/lib/libusb/libusb20.h
  user/ed/newcons/lib/libusb/libusb20_compat01.c
  user/ed/newcons/lib/libusb/libusb20_desc.c
  user/ed/newcons/lib/libusb/libusb20_ugen20.c
  user/ed/newcons/lib/libusb/usb.h
  user/ed/newcons/lib/libutil/humanize_number.3
  user/ed/newcons/lib/msun/man/cimag.3
  user/ed/newcons/libexec/ftpd/logwtmp.c
  user/ed/newcons/libexec/rpc.rstatd/Makefile
  user/ed/newcons/libexec/rtld-elf/arm/rtld_start.S
  user/ed/newcons/libexec/rtld-elf/mips/reloc.c
  user/ed/newcons/libexec/rtld-elf/mips/rtld_start.S
  user/ed/newcons/libexec/rtld-elf/powerpc/reloc.c
  user/ed/newcons/libexec/rtld-elf/powerpc/rtld_machdep.h
  user/ed/newcons/libexec/rtld-elf/powerpc/rtld_start.S
  user/ed/newcons/libexec/rtld-elf/rtld.c
  user/ed/newcons/libexec/tftpd/tftpd.8
  user/ed/newcons/libexec/ulog-helper/Makefile
  user/ed/newcons/release/picobsd/build/picobsd
  user/ed/newcons/release/picobsd/tinyware/login/pico-login.c
  user/ed/newcons/sbin/Makefile
  user/ed/newcons/sbin/atacontrol/atacontrol.c
  user/ed/newcons/sbin/camcontrol/camcontrol.c
  user/ed/newcons/sbin/ddb/Makefile
  user/ed/newcons/sbin/devd/Makefile
  user/ed/newcons/sbin/devfs/Makefile
  user/ed/newcons/sbin/devfs/devfs.8
  user/ed/newcons/sbin/ffsinfo/Makefile
  user/ed/newcons/sbin/fsck_msdosfs/boot.c
  user/ed/newcons/sbin/fsck_msdosfs/check.c
  user/ed/newcons/sbin/fsck_msdosfs/dir.c
  user/ed/newcons/sbin/fsck_msdosfs/dosfs.h
  user/ed/newcons/sbin/fsck_msdosfs/ext.h
  user/ed/newcons/sbin/fsck_msdosfs/fat.c
  user/ed/newcons/sbin/fsck_msdosfs/fsck_msdosfs.8
  user/ed/newcons/sbin/fsck_msdosfs/main.c
  user/ed/newcons/sbin/gbde/Makefile
  user/ed/newcons/sbin/geom/class/cache/gcache.8
  user/ed/newcons/sbin/geom/class/mountver/gmountver.8
  user/ed/newcons/sbin/geom/class/part/Makefile
  user/ed/newcons/sbin/ggate/ggatec/ggatec.c
  user/ed/newcons/sbin/ggate/ggated/ggated.c
  user/ed/newcons/sbin/ggate/ggatel/ggatel.c
  user/ed/newcons/sbin/ggate/shared/ggate.c
  user/ed/newcons/sbin/growfs/growfs.c
  user/ed/newcons/sbin/gvinum/gvinum.c
  user/ed/newcons/sbin/ifconfig/Makefile
  user/ed/newcons/sbin/ifconfig/ifconfig.8
  user/ed/newcons/sbin/ifconfig/ifconfig.c
  user/ed/newcons/sbin/ifconfig/ifieee80211.c
  user/ed/newcons/sbin/ifconfig/ifvlan.c
  user/ed/newcons/sbin/ipf/ipftest/Makefile
  user/ed/newcons/sbin/ipfw/Makefile
  user/ed/newcons/sbin/ipfw/altq.c
  user/ed/newcons/sbin/ipfw/dummynet.c
  user/ed/newcons/sbin/ipfw/ipfw.8
  user/ed/newcons/sbin/ipfw/ipfw2.c
  user/ed/newcons/sbin/ipfw/ipfw2.h
  user/ed/newcons/sbin/ipfw/main.c
  user/ed/newcons/sbin/mknod/Makefile
  user/ed/newcons/sbin/mount/mount.8
  user/ed/newcons/sbin/mount/mount.c
  user/ed/newcons/sbin/mount_hpfs/Makefile
  user/ed/newcons/sbin/mount_hpfs/mount_hpfs.c
  user/ed/newcons/sbin/mount_ntfs/Makefile
  user/ed/newcons/sbin/mount_ntfs/mount_ntfs.c
  user/ed/newcons/sbin/mount_std/Makefile
  user/ed/newcons/sbin/newfs/Makefile
  user/ed/newcons/sbin/newfs/mkfs.c
  user/ed/newcons/sbin/newfs/newfs.8
  user/ed/newcons/sbin/newfs/newfs.c
  user/ed/newcons/sbin/newfs/newfs.h
  user/ed/newcons/sbin/newfs_msdos/newfs_msdos.8
  user/ed/newcons/sbin/newfs_msdos/newfs_msdos.c
  user/ed/newcons/sbin/nos-tun/Makefile
  user/ed/newcons/sbin/nos-tun/nos-tun.c
  user/ed/newcons/sbin/quotacheck/quotacheck.8
  user/ed/newcons/sbin/restore/restore.h
  user/ed/newcons/sbin/restore/tape.c
  user/ed/newcons/sbin/route/Makefile
  user/ed/newcons/sbin/route/route.c
  user/ed/newcons/sbin/routed/Makefile
  user/ed/newcons/sbin/routed/if.c
  user/ed/newcons/sbin/routed/rtquery/Makefile
  user/ed/newcons/sbin/rtsol/Makefile
  user/ed/newcons/sbin/sunlabel/Makefile
  user/ed/newcons/sbin/sysctl/Makefile
  user/ed/newcons/sbin/sysctl/sysctl.c
  user/ed/newcons/sbin/tunefs/tunefs.c
  user/ed/newcons/secure/lib/libssh/Makefile
  user/ed/newcons/secure/libexec/Makefile
  user/ed/newcons/secure/libexec/sftp-server/Makefile
  user/ed/newcons/secure/usr.bin/ssh/Makefile
  user/ed/newcons/secure/usr.sbin/sshd/Makefile
  user/ed/newcons/share/examples/Makefile
  user/ed/newcons/share/examples/autofs/driver/Makefile
  user/ed/newcons/share/man/man4/Makefile
  user/ed/newcons/share/man/man4/acpi.4
  user/ed/newcons/share/man/man4/acpi_asus.4
  user/ed/newcons/share/man/man4/acpi_fujitsu.4
  user/ed/newcons/share/man/man4/acpi_hp.4
  user/ed/newcons/share/man/man4/acpi_ibm.4
  user/ed/newcons/share/man/man4/acpi_panasonic.4
  user/ed/newcons/share/man/man4/acpi_sony.4
  user/ed/newcons/share/man/man4/acpi_toshiba.4
  user/ed/newcons/share/man/man4/acpi_wmi.4
  user/ed/newcons/share/man/man4/ada.4
  user/ed/newcons/share/man/man4/ahci.4
  user/ed/newcons/share/man/man4/altq.4
  user/ed/newcons/share/man/man4/amdtemp.4
  user/ed/newcons/share/man/man4/ata.4
  user/ed/newcons/share/man/man4/cd.4
  user/ed/newcons/share/man/man4/ch.4
  user/ed/newcons/share/man/man4/cxgb.4
  user/ed/newcons/share/man/man4/da.4
  user/ed/newcons/share/man/man4/ddb.4
  user/ed/newcons/share/man/man4/ehci.4
  user/ed/newcons/share/man/man4/gem.4
  user/ed/newcons/share/man/man4/gre.4
  user/ed/newcons/share/man/man4/hme.4
  user/ed/newcons/share/man/man4/io.4
  user/ed/newcons/share/man/man4/iscsi_initiator.4
  user/ed/newcons/share/man/man4/iwn.4
  user/ed/newcons/share/man/man4/iwnfw.4
  user/ed/newcons/share/man/man4/linux.4
  user/ed/newcons/share/man/man4/man4.i386/Makefile
  user/ed/newcons/share/man/man4/man4.powerpc/Makefile
  user/ed/newcons/share/man/man4/man4.sparc64/sbus.4
  user/ed/newcons/share/man/man4/msk.4
  user/ed/newcons/share/man/man4/ndis.4
  user/ed/newcons/share/man/man4/ng_ipfw.4
  user/ed/newcons/share/man/man4/nvram.4
  user/ed/newcons/share/man/man4/ohci.4
  user/ed/newcons/share/man/man4/pass.4
  user/ed/newcons/share/man/man4/pt.4
  user/ed/newcons/share/man/man4/sa.4
  user/ed/newcons/share/man/man4/scsi.4
  user/ed/newcons/share/man/man4/sctp.4
  user/ed/newcons/share/man/man4/siis.4
  user/ed/newcons/share/man/man4/snd_uaudio.4
  user/ed/newcons/share/man/man4/stge.4
  user/ed/newcons/share/man/man4/textdump.4
  user/ed/newcons/share/man/man4/uart.4
  user/ed/newcons/share/man/man4/ubsa.4
  user/ed/newcons/share/man/man4/ucom.4
  user/ed/newcons/share/man/man4/udbp.4
  user/ed/newcons/share/man/man4/ufm.4
  user/ed/newcons/share/man/man4/uftdi.4
  user/ed/newcons/share/man/man4/ugen.4
  user/ed/newcons/share/man/man4/uhci.4
  user/ed/newcons/share/man/man4/uhid.4
  user/ed/newcons/share/man/man4/ukbd.4
  user/ed/newcons/share/man/man4/ulpt.4
  user/ed/newcons/share/man/man4/umass.4
  user/ed/newcons/share/man/man4/umodem.4
  user/ed/newcons/share/man/man4/ums.4
  user/ed/newcons/share/man/man4/uplcom.4
  user/ed/newcons/share/man/man4/usb.4
  user/ed/newcons/share/man/man4/uvisor.4
  user/ed/newcons/share/man/man4/uvscom.4
  user/ed/newcons/share/man/man5/core.5
  user/ed/newcons/share/man/man5/devfs.rules.5
  user/ed/newcons/share/man/man5/rc.conf.5
  user/ed/newcons/share/man/man5/tmpfs.5
  user/ed/newcons/share/man/man9/BUF_ISLOCKED.9
  user/ed/newcons/share/man/man9/BUF_RECURSED.9
  user/ed/newcons/share/man/man9/DEVICE_PROBE.9
  user/ed/newcons/share/man/man9/VFS.9
  user/ed/newcons/share/man/man9/VOP_LOCK.9
  user/ed/newcons/share/man/man9/devfs_set_cdevpriv.9
  user/ed/newcons/share/man/man9/driver.9
  user/ed/newcons/share/man/man9/fail.9
  user/ed/newcons/share/man/man9/ieee80211_scan.9
  user/ed/newcons/share/man/man9/kernacc.9
  user/ed/newcons/share/man/man9/locking.9
  user/ed/newcons/share/man/man9/malloc.9
  user/ed/newcons/share/man/man9/mi_switch.9
  user/ed/newcons/share/man/man9/namei.9
  user/ed/newcons/share/man/man9/netisr.9
  user/ed/newcons/share/man/man9/physio.9
  user/ed/newcons/share/man/man9/psignal.9
  user/ed/newcons/share/man/man9/timeout.9
  user/ed/newcons/share/man/man9/vm_page_alloc.9
  user/ed/newcons/share/man/man9/vnode.9
  user/ed/newcons/share/man/man9/vslock.9
  user/ed/newcons/share/misc/committers-src.dot
  user/ed/newcons/share/misc/pci_vendors
  user/ed/newcons/share/mk/bsd.cpu.mk
  user/ed/newcons/share/mk/bsd.libnames.mk
  user/ed/newcons/share/mk/bsd.prog.mk
  user/ed/newcons/share/mk/bsd.sys.mk
  user/ed/newcons/share/mk/sys.mk
  user/ed/newcons/share/syscons/keymaps/fr.dvorak.acc.kbd
  user/ed/newcons/share/zoneinfo/Makefile
  user/ed/newcons/sys/amd64/amd64/busdma_machdep.c
  user/ed/newcons/sys/amd64/amd64/db_trace.c
  user/ed/newcons/sys/amd64/amd64/exception.S
  user/ed/newcons/sys/amd64/amd64/identcpu.c
  user/ed/newcons/sys/amd64/amd64/intr_machdep.c
  user/ed/newcons/sys/amd64/amd64/local_apic.c
  user/ed/newcons/sys/amd64/amd64/machdep.c
  user/ed/newcons/sys/amd64/amd64/mca.c
  user/ed/newcons/sys/amd64/amd64/nexus.c
  user/ed/newcons/sys/amd64/amd64/pmap.c
  user/ed/newcons/sys/amd64/amd64/vm_machdep.c
  user/ed/newcons/sys/amd64/conf/GENERIC
  user/ed/newcons/sys/amd64/conf/NOTES
  user/ed/newcons/sys/amd64/conf/XENHVM
  user/ed/newcons/sys/amd64/include/_inttypes.h
  user/ed/newcons/sys/amd64/include/apicvar.h
  user/ed/newcons/sys/amd64/include/elf.h
  user/ed/newcons/sys/amd64/include/md_var.h
  user/ed/newcons/sys/amd64/include/reg.h
  user/ed/newcons/sys/amd64/include/specialreg.h
  user/ed/newcons/sys/amd64/include/sysarch.h
  user/ed/newcons/sys/amd64/linux32/linux32_sysvec.c
  user/ed/newcons/sys/arm/arm/busdma_machdep.c
  user/ed/newcons/sys/arm/arm/cpufunc.c
  user/ed/newcons/sys/arm/arm/identcpu.c
  user/ed/newcons/sys/arm/arm/pmap.c
  user/ed/newcons/sys/arm/arm/support.S
  user/ed/newcons/sys/arm/arm/vm_machdep.c
  user/ed/newcons/sys/arm/at91/if_ate.c
  user/ed/newcons/sys/arm/conf/AVILA
  user/ed/newcons/sys/arm/conf/BWCT
  user/ed/newcons/sys/arm/conf/BWCT.hints
  user/ed/newcons/sys/arm/conf/CAMBRIA
  user/ed/newcons/sys/arm/conf/CNS11XXNAS
  user/ed/newcons/sys/arm/conf/CRB
  user/ed/newcons/sys/arm/conf/DB-78XXX
  user/ed/newcons/sys/arm/conf/DB-88F5XXX
  user/ed/newcons/sys/arm/conf/DB-88F6XXX
  user/ed/newcons/sys/arm/conf/EP80219
  user/ed/newcons/sys/arm/conf/GUMSTIX
  user/ed/newcons/sys/arm/conf/HL200
  user/ed/newcons/sys/arm/conf/IQ31244
  user/ed/newcons/sys/arm/conf/KB920X
  user/ed/newcons/sys/arm/conf/NSLU
  user/ed/newcons/sys/arm/conf/SIMICS
  user/ed/newcons/sys/arm/conf/SKYEYE
  user/ed/newcons/sys/arm/include/_inttypes.h
  user/ed/newcons/sys/arm/include/_stdint.h
  user/ed/newcons/sys/arm/include/armreg.h
  user/ed/newcons/sys/arm/include/bus.h
  user/ed/newcons/sys/arm/include/bus_dma.h
  user/ed/newcons/sys/arm/include/md_var.h
  user/ed/newcons/sys/arm/include/ucontext.h
  user/ed/newcons/sys/arm/mv/common.c
  user/ed/newcons/sys/arm/mv/kirkwood/kirkwood.c
  user/ed/newcons/sys/arm/mv/mv_machdep.c
  user/ed/newcons/sys/arm/sa11x0/sa11x0.c
  user/ed/newcons/sys/arm/sa11x0/sa11x0_dmacreg.h
  user/ed/newcons/sys/arm/sa11x0/sa11x0_gpioreg.h
  user/ed/newcons/sys/arm/sa11x0/sa11x0_irq.S
  user/ed/newcons/sys/arm/sa11x0/sa11x0_irqhandler.c
  user/ed/newcons/sys/arm/sa11x0/sa11x0_ostreg.h
  user/ed/newcons/sys/arm/sa11x0/sa11x0_ppcreg.h
  user/ed/newcons/sys/arm/sa11x0/sa11x0_reg.h
  user/ed/newcons/sys/arm/sa11x0/sa11x0_var.h
  user/ed/newcons/sys/arm/xscale/ixp425/cambria_fled.c
  user/ed/newcons/sys/boot/arm/at91/boot2/bwct_board.c
  user/ed/newcons/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c
  user/ed/newcons/sys/boot/forth/loader.conf
  user/ed/newcons/sys/boot/powerpc/ofw/Makefile
  user/ed/newcons/sys/boot/powerpc/uboot/Makefile
  user/ed/newcons/sys/boot/powerpc/uboot/conf.c
  user/ed/newcons/sys/boot/sparc64/loader/main.c
  user/ed/newcons/sys/boot/uboot/common/main.c
  user/ed/newcons/sys/boot/uboot/lib/disk.c
  user/ed/newcons/sys/boot/uboot/lib/time.c
  user/ed/newcons/sys/boot/zfs/zfs.c
  user/ed/newcons/sys/cam/ata/ata_xpt.c
  user/ed/newcons/sys/cam/cam_xpt.c
  user/ed/newcons/sys/cam/cam_xpt_internal.h
  user/ed/newcons/sys/cam/scsi/scsi_cd.c
  user/ed/newcons/sys/cam/scsi/scsi_xpt.c
  user/ed/newcons/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S
  user/ed/newcons/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  user/ed/newcons/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  user/ed/newcons/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  user/ed/newcons/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  user/ed/newcons/sys/compat/freebsd32/freebsd32.h
  user/ed/newcons/sys/compat/freebsd32/freebsd32_misc.c
  user/ed/newcons/sys/compat/freebsd32/freebsd32_proto.h
  user/ed/newcons/sys/compat/freebsd32/freebsd32_syscall.h
  user/ed/newcons/sys/compat/freebsd32/freebsd32_syscalls.c
  user/ed/newcons/sys/compat/freebsd32/freebsd32_sysent.c
  user/ed/newcons/sys/compat/freebsd32/freebsd32_util.h
  user/ed/newcons/sys/compat/freebsd32/syscalls.master
  user/ed/newcons/sys/compat/ia32/ia32_reg.h
  user/ed/newcons/sys/compat/ia32/ia32_sysvec.c
  user/ed/newcons/sys/compat/linprocfs/linprocfs.c
  user/ed/newcons/sys/compat/linux/linux_getcwd.c
  user/ed/newcons/sys/compat/linux/linux_socket.c
  user/ed/newcons/sys/compat/linux/linux_stats.c
  user/ed/newcons/sys/compat/linux/linux_time.c
  user/ed/newcons/sys/conf/NOTES
  user/ed/newcons/sys/conf/files
  user/ed/newcons/sys/conf/files.amd64
  user/ed/newcons/sys/conf/files.i386
  user/ed/newcons/sys/conf/files.ia64
  user/ed/newcons/sys/conf/files.mips
  user/ed/newcons/sys/conf/files.pc98
  user/ed/newcons/sys/conf/files.sparc64
  user/ed/newcons/sys/conf/kmod.mk
  user/ed/newcons/sys/conf/ldscript.mips.cfe
  user/ed/newcons/sys/conf/ldscript.mips.octeon1.32   (contents, props changed)
  user/ed/newcons/sys/conf/ldscript.mips.octeon1.64   (contents, props changed)
  user/ed/newcons/sys/conf/ldscript.mips.octeon1.n32   (contents, props changed)
  user/ed/newcons/sys/conf/options
  user/ed/newcons/sys/conf/options.amd64
  user/ed/newcons/sys/conf/options.i386
  user/ed/newcons/sys/conf/options.ia64
  user/ed/newcons/sys/conf/options.mips
  user/ed/newcons/sys/contrib/dev/acpica/changes.txt
  user/ed/newcons/sys/contrib/dev/acpica/common/dmextern.c
  user/ed/newcons/sys/contrib/dev/acpica/common/dmtable.c
  user/ed/newcons/sys/contrib/dev/acpica/common/dmtbdump.c
  user/ed/newcons/sys/contrib/dev/acpica/common/dmtbinfo.c
  user/ed/newcons/sys/contrib/dev/acpica/compiler/aslanalyze.c
  user/ed/newcons/sys/contrib/dev/acpica/compiler/aslcompiler.h
  user/ed/newcons/sys/contrib/dev/acpica/compiler/aslglobal.h
  user/ed/newcons/sys/contrib/dev/acpica/compiler/aslmain.c
  user/ed/newcons/sys/contrib/dev/acpica/compiler/aslmap.c
  user/ed/newcons/sys/contrib/dev/acpica/compiler/aslstubs.c
  user/ed/newcons/sys/contrib/dev/acpica/compiler/asltypes.h
  user/ed/newcons/sys/contrib/dev/acpica/dispatcher/dsfield.c
  user/ed/newcons/sys/contrib/dev/acpica/dispatcher/dsmethod.c
  user/ed/newcons/sys/contrib/dev/acpica/dispatcher/dsmthdat.c
  user/ed/newcons/sys/contrib/dev/acpica/dispatcher/dsobject.c
  user/ed/newcons/sys/contrib/dev/acpica/dispatcher/dsopcode.c
  user/ed/newcons/sys/contrib/dev/acpica/dispatcher/dswexec.c
  user/ed/newcons/sys/contrib/dev/acpica/dispatcher/dswstate.c
  user/ed/newcons/sys/contrib/dev/acpica/events/evevent.c
  user/ed/newcons/sys/contrib/dev/acpica/events/evgpe.c
  user/ed/newcons/sys/contrib/dev/acpica/events/evgpeblk.c
  user/ed/newcons/sys/contrib/dev/acpica/events/evmisc.c
  user/ed/newcons/sys/contrib/dev/acpica/events/evxface.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exconvrt.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/excreate.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exfield.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exfldio.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exmisc.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exmutex.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exnames.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exoparg1.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exoparg2.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exoparg3.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exoparg6.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exprep.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exregion.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exresnte.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exresolv.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exresop.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exstore.c
  user/ed/newcons/sys/contrib/dev/acpica/executer/exsystem.c
  user/ed/newcons/sys/contrib/dev/acpica/hardware/hwregs.c
  user/ed/newcons/sys/contrib/dev/acpica/hardware/hwsleep.c
  user/ed/newcons/sys/contrib/dev/acpica/hardware/hwvalid.c
  user/ed/newcons/sys/contrib/dev/acpica/include/acdisasm.h
  user/ed/newcons/sys/contrib/dev/acpica/include/acglobal.h
  user/ed/newcons/sys/contrib/dev/acpica/include/acinterp.h
  user/ed/newcons/sys/contrib/dev/acpica/include/acoutput.h
  user/ed/newcons/sys/contrib/dev/acpica/include/acpixf.h
  user/ed/newcons/sys/contrib/dev/acpica/include/actbl2.h
  user/ed/newcons/sys/contrib/dev/acpica/namespace/nsaccess.c
  user/ed/newcons/sys/contrib/dev/acpica/namespace/nsdump.c
  user/ed/newcons/sys/contrib/dev/acpica/namespace/nsnames.c
  user/ed/newcons/sys/contrib/dev/acpica/namespace/nssearch.c
  user/ed/newcons/sys/contrib/dev/acpica/namespace/nsutils.c
  user/ed/newcons/sys/contrib/dev/acpica/parser/psargs.c
  user/ed/newcons/sys/contrib/dev/acpica/parser/psloop.c
  user/ed/newcons/sys/contrib/dev/acpica/resources/rscreate.c
  user/ed/newcons/sys/contrib/dev/acpica/resources/rslist.c
  user/ed/newcons/sys/contrib/dev/acpica/resources/rsmisc.c
  user/ed/newcons/sys/contrib/dev/acpica/tables/tbfadt.c
  user/ed/newcons/sys/contrib/dev/acpica/tables/tbutils.c
  user/ed/newcons/sys/contrib/dev/acpica/tables/tbxfroot.c
  user/ed/newcons/sys/contrib/dev/acpica/utilities/utalloc.c
  user/ed/newcons/sys/contrib/dev/acpica/utilities/utdelete.c
  user/ed/newcons/sys/contrib/dev/acpica/utilities/uteval.c
  user/ed/newcons/sys/contrib/dev/acpica/utilities/utmisc.c
  user/ed/newcons/sys/contrib/dev/acpica/utilities/utmutex.c
  user/ed/newcons/sys/contrib/dev/acpica/utilities/utobject.c
  user/ed/newcons/sys/contrib/dev/acpica/utilities/uttrack.c
  user/ed/newcons/sys/contrib/x86emu/x86emu.c
  user/ed/newcons/sys/ddb/db_thread.c
  user/ed/newcons/sys/dev/aac/aac.c
  user/ed/newcons/sys/dev/aac/aac_cam.c
  user/ed/newcons/sys/dev/aac/aac_pci.c
  user/ed/newcons/sys/dev/aac/aacreg.h
  user/ed/newcons/sys/dev/aac/aacvar.h
  user/ed/newcons/sys/dev/acpi_support/acpi_asus.c
  user/ed/newcons/sys/dev/acpica/acpi.c
  user/ed/newcons/sys/dev/acpica/acpi_cpu.c
  user/ed/newcons/sys/dev/acpica/acpi_video.c
  user/ed/newcons/sys/dev/age/if_age.c
  user/ed/newcons/sys/dev/agp/agp_i810.c
  user/ed/newcons/sys/dev/ahci/ahci.c
  user/ed/newcons/sys/dev/ahci/ahci.h
  user/ed/newcons/sys/dev/aic7xxx/aic79xx_osm.c
  user/ed/newcons/sys/dev/alc/if_alc.c
  user/ed/newcons/sys/dev/ale/if_ale.c
  user/ed/newcons/sys/dev/ata/ata-all.c
  user/ed/newcons/sys/dev/ata/ata-pci.c
  user/ed/newcons/sys/dev/ata/ata-pci.h
  user/ed/newcons/sys/dev/ata/ata-raid.c
  user/ed/newcons/sys/dev/ata/ata-sata.c
  user/ed/newcons/sys/dev/ata/chipsets/ata-acerlabs.c
  user/ed/newcons/sys/dev/ata/chipsets/ata-intel.c
  user/ed/newcons/sys/dev/ath/ath_hal/ah.h
  user/ed/newcons/sys/dev/ath/ath_hal/ah_debug.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ah_decode.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ah_devid.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ah_eeprom.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ah_eeprom_v1.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ah_eeprom_v1.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ah_eeprom_v14.h
  user/ed/newcons/sys/dev/ath/ath_hal/ah_eeprom_v3.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ah_internal.h
  user/ed/newcons/sys/dev/ath/ath_hal/ah_soc.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5210/ar5210_power.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5210/ar5210desc.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5210/ar5210phy.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5210/ar5210reg.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5210/ar5k_0007.ini   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5211/ar5211_power.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5211/ar5211desc.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5211/ar5211phy.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5211/ar5211reg.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5211/boss.ini   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5212/ar5212.h
  user/ed/newcons/sys/dev/ath/ath_hal/ar5212/ar5212.ini   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
  user/ed/newcons/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c
  user/ed/newcons/sys/dev/ath/ath_hal/ar5212/ar5212desc.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5212/ar5212phy.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5212/ar5311reg.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5312/ar5312_misc.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5312/ar5312_power.c   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5312/ar5312phy.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5312/ar5312reg.h   (contents, props changed)
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar5416.h
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar5416phy.h
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar9280.h
  user/ed/newcons/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c
  user/ed/newcons/sys/dev/ath/if_ath.c
  user/ed/newcons/sys/dev/ath/if_athvar.h
  user/ed/newcons/sys/dev/bce/if_bce.c
  user/ed/newcons/sys/dev/bge/if_bge.c
  user/ed/newcons/sys/dev/ciss/ciss.c
  user/ed/newcons/sys/dev/ciss/cissvar.h
  user/ed/newcons/sys/dev/cm/if_cm_isa.c
  user/ed/newcons/sys/dev/cm/smc90cx6.c
  user/ed/newcons/sys/dev/cm/smc90cx6reg.h
  user/ed/newcons/sys/dev/cm/smc90cx6var.h
  user/ed/newcons/sys/dev/cxgb/common/cxgb_ael1002.c
  user/ed/newcons/sys/dev/cxgb/common/cxgb_common.h
  user/ed/newcons/sys/dev/cxgb/common/cxgb_t3_hw.c
  user/ed/newcons/sys/dev/cxgb/cxgb_adapter.h
  user/ed/newcons/sys/dev/cxgb/cxgb_main.c
  user/ed/newcons/sys/dev/cxgb/cxgb_offload.h
  user/ed/newcons/sys/dev/cxgb/cxgb_osdep.h
  user/ed/newcons/sys/dev/cxgb/cxgb_sge.c
  user/ed/newcons/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
  user/ed/newcons/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c
  user/ed/newcons/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c
  user/ed/newcons/sys/dev/e1000/if_em.c
  user/ed/newcons/sys/dev/e1000/if_igb.c
  user/ed/newcons/sys/dev/fb/fb.c
  user/ed/newcons/sys/dev/fb/vesa.c
  user/ed/newcons/sys/dev/gem/if_gem.c
  user/ed/newcons/sys/dev/hme/if_hme_sbus.c
  user/ed/newcons/sys/dev/hme/if_hmereg.h
  user/ed/newcons/sys/dev/hme/if_hmevar.h
  user/ed/newcons/sys/dev/hwpmc/hwpmc_logging.c
  user/ed/newcons/sys/dev/hwpmc/pmc_events.h
  user/ed/newcons/sys/dev/isp/isp.c
  user/ed/newcons/sys/dev/isp/isp_freebsd.c
  user/ed/newcons/sys/dev/isp/isp_library.c
  user/ed/newcons/sys/dev/isp/isp_library.h
  user/ed/newcons/sys/dev/isp/isp_pci.c
  user/ed/newcons/sys/dev/isp/isp_target.c
  user/ed/newcons/sys/dev/isp/ispmbox.h
  user/ed/newcons/sys/dev/isp/ispreg.h
  user/ed/newcons/sys/dev/ispfw/ispfw.c
  user/ed/newcons/sys/dev/iwn/if_iwn.c
  user/ed/newcons/sys/dev/ixgbe/ixgbe.c
  user/ed/newcons/sys/dev/jme/if_jme.c
  user/ed/newcons/sys/dev/le/am79900var.h
  user/ed/newcons/sys/dev/le/am7990var.h
  user/ed/newcons/sys/dev/le/if_le_ledma.c
  user/ed/newcons/sys/dev/le/lancevar.h
  user/ed/newcons/sys/dev/md/md.c
  user/ed/newcons/sys/dev/mfi/mfi_cam.c
  user/ed/newcons/sys/dev/mfi/mfi_pci.c
  user/ed/newcons/sys/dev/mge/if_mge.c
  user/ed/newcons/sys/dev/mii/bmtphyreg.h
  user/ed/newcons/sys/dev/mii/brgphy.c
  user/ed/newcons/sys/dev/mii/e1000phy.c
  user/ed/newcons/sys/dev/mii/icsphyreg.h
  user/ed/newcons/sys/dev/mii/lxtphyreg.h
  user/ed/newcons/sys/dev/mii/mii.c
  user/ed/newcons/sys/dev/mii/mii_physubr.c
  user/ed/newcons/sys/dev/mii/miidevs
  user/ed/newcons/sys/dev/mii/miivar.h
  user/ed/newcons/sys/dev/mii/nsphyreg.h
  user/ed/newcons/sys/dev/mii/nsphyterreg.h
  user/ed/newcons/sys/dev/mii/qsphyreg.h
  user/ed/newcons/sys/dev/mii/ukphy_subr.c
  user/ed/newcons/sys/dev/mpt/mpt_raid.c
  user/ed/newcons/sys/dev/msk/if_msk.c
  user/ed/newcons/sys/dev/msk/if_mskreg.h
  user/ed/newcons/sys/dev/mxge/if_mxge.c
  user/ed/newcons/sys/dev/ofw/ofw_pci.h
  user/ed/newcons/sys/dev/pci/vga_pci.c
  user/ed/newcons/sys/dev/re/if_re.c
  user/ed/newcons/sys/dev/siba/siba.c
  user/ed/newcons/sys/dev/siba/siba_bwn.c
  user/ed/newcons/sys/dev/siba/siba_cc.c
  user/ed/newcons/sys/dev/siba/siba_core.c
  user/ed/newcons/sys/dev/siba/siba_pcib.c
  user/ed/newcons/sys/dev/siba/sibareg.h
  user/ed/newcons/sys/dev/siba/sibavar.h
  user/ed/newcons/sys/dev/siis/siis.c
  user/ed/newcons/sys/dev/sound/pci/es137x.h
  user/ed/newcons/sys/dev/sound/pci/hda/hdac.c
  user/ed/newcons/sys/dev/sound/usb/uaudio.c
  user/ed/newcons/sys/dev/sound/usb/uaudioreg.h
  user/ed/newcons/sys/dev/stge/if_stge.c
  user/ed/newcons/sys/dev/stge/if_stgereg.h
  user/ed/newcons/sys/dev/syscons/scvidctl.c
  user/ed/newcons/sys/dev/syscons/snake/snake_saver.c
  user/ed/newcons/sys/dev/syscons/syscons.c
  user/ed/newcons/sys/dev/syscons/syscons.h
  user/ed/newcons/sys/dev/uart/uart_bus_pci.c
  user/ed/newcons/sys/dev/usb/controller/ehci.c
  user/ed/newcons/sys/dev/usb/controller/ehci.h
  user/ed/newcons/sys/dev/usb/controller/ehci_pci.c
  user/ed/newcons/sys/dev/usb/controller/ehcireg.h
  user/ed/newcons/sys/dev/usb/controller/ohci.h
  user/ed/newcons/sys/dev/usb/controller/ohci_pci.c
  user/ed/newcons/sys/dev/usb/controller/ohcireg.h
  user/ed/newcons/sys/dev/usb/controller/uhci.h
  user/ed/newcons/sys/dev/usb/controller/uhci_pci.c
  user/ed/newcons/sys/dev/usb/controller/uhcireg.h
  user/ed/newcons/sys/dev/usb/controller/usb_controller.c
  user/ed/newcons/sys/dev/usb/controller/uss820dci.c
  user/ed/newcons/sys/dev/usb/input/uhid.c
  user/ed/newcons/sys/dev/usb/input/ukbd.c
  user/ed/newcons/sys/dev/usb/input/ums.c
  user/ed/newcons/sys/dev/usb/quirk/usb_quirk.c
  user/ed/newcons/sys/dev/usb/quirk/usb_quirk.h
  user/ed/newcons/sys/dev/usb/serial/u3g.c
  user/ed/newcons/sys/dev/usb/serial/uftdi.c
  user/ed/newcons/sys/dev/usb/serial/ugensa.c
  user/ed/newcons/sys/dev/usb/serial/uipaq.c
  user/ed/newcons/sys/dev/usb/serial/ulpt.c
  user/ed/newcons/sys/dev/usb/serial/umodem.c
  user/ed/newcons/sys/dev/usb/serial/uvisor.c
  user/ed/newcons/sys/dev/usb/template/usb_template.c
  user/ed/newcons/sys/dev/usb/template/usb_template.h
  user/ed/newcons/sys/dev/usb/template/usb_template_mtp.c
  user/ed/newcons/sys/dev/usb/usb_cdc.h
  user/ed/newcons/sys/dev/usb/usb_device.c
  user/ed/newcons/sys/dev/usb/usb_device.h
  user/ed/newcons/sys/dev/usb/usb_generic.c
  user/ed/newcons/sys/dev/usb/usb_hid.c
  user/ed/newcons/sys/dev/usb/usb_msctest.c
  user/ed/newcons/sys/dev/usb/usb_msctest.h
  user/ed/newcons/sys/dev/usb/usb_transfer.c
  user/ed/newcons/sys/dev/usb/usbdevs
  user/ed/newcons/sys/dev/usb/wlan/if_run.c
  user/ed/newcons/sys/dev/usb/wlan/if_runreg.h
  user/ed/newcons/sys/dev/usb/wlan/if_runvar.h
  user/ed/newcons/sys/dev/xen/netback/netback.c
  user/ed/newcons/sys/dev/xen/netfront/netfront.c
  user/ed/newcons/sys/fs/ext2fs/ext2_vnops.c
  user/ed/newcons/sys/fs/msdosfs/bootsect.h
  user/ed/newcons/sys/fs/msdosfs/bpb.h
  user/ed/newcons/sys/fs/msdosfs/denode.h
  user/ed/newcons/sys/fs/msdosfs/direntry.h
  user/ed/newcons/sys/fs/msdosfs/msdosfs_conv.c
  user/ed/newcons/sys/fs/msdosfs/msdosfs_denode.c
  user/ed/newcons/sys/fs/msdosfs/msdosfs_fat.c
  user/ed/newcons/sys/fs/msdosfs/msdosfs_fileno.c
  user/ed/newcons/sys/fs/msdosfs/msdosfs_lookup.c
  user/ed/newcons/sys/fs/msdosfs/msdosfs_vfsops.c
  user/ed/newcons/sys/fs/msdosfs/msdosfs_vnops.c
  user/ed/newcons/sys/fs/msdosfs/msdosfsmount.h
  user/ed/newcons/sys/fs/nfsserver/nfs_nfsdcache.c
  user/ed/newcons/sys/fs/nfsserver/nfs_nfsdport.c
  user/ed/newcons/sys/fs/nfsserver/nfs_nfsdstate.c
  user/ed/newcons/sys/fs/procfs/procfs_dbregs.c
  user/ed/newcons/sys/fs/procfs/procfs_fpregs.c
  user/ed/newcons/sys/fs/procfs/procfs_ioctl.c
  user/ed/newcons/sys/fs/procfs/procfs_map.c
  user/ed/newcons/sys/fs/procfs/procfs_regs.c
  user/ed/newcons/sys/geom/gate/g_gate.c
  user/ed/newcons/sys/geom/gate/g_gate.h
  user/ed/newcons/sys/geom/geom_subr.c
  user/ed/newcons/sys/geom/multipath/g_multipath.c
  user/ed/newcons/sys/geom/stripe/g_stripe.c
  user/ed/newcons/sys/geom/vinum/geom_vinum.c
  user/ed/newcons/sys/i386/conf/GENERIC
  user/ed/newcons/sys/i386/conf/NOTES
  user/ed/newcons/sys/i386/conf/XEN
  user/ed/newcons/sys/i386/i386/exception.s
  user/ed/newcons/sys/i386/i386/identcpu.c
  user/ed/newcons/sys/i386/i386/local_apic.c
  user/ed/newcons/sys/i386/i386/machdep.c
  user/ed/newcons/sys/i386/i386/mca.c
  user/ed/newcons/sys/i386/i386/mp_machdep.c
  user/ed/newcons/sys/i386/i386/nexus.c
  user/ed/newcons/sys/i386/i386/pmap.c
  user/ed/newcons/sys/i386/i386/vm_machdep.c
  user/ed/newcons/sys/i386/include/_inttypes.h
  user/ed/newcons/sys/i386/include/apicvar.h
  user/ed/newcons/sys/i386/xen/clock.c
  user/ed/newcons/sys/i386/xen/mp_machdep.c
  user/ed/newcons/sys/i386/xen/pmap.c
  user/ed/newcons/sys/i386/xen/xen_machdep.c
  user/ed/newcons/sys/ia64/acpica/madt.c
  user/ed/newcons/sys/ia64/conf/GENERIC
  user/ed/newcons/sys/ia64/conf/NOTES
  user/ed/newcons/sys/ia64/ia64/bus_machdep.c
  user/ed/newcons/sys/ia64/ia64/context.S
  user/ed/newcons/sys/ia64/ia64/efi.c
  user/ed/newcons/sys/ia64/ia64/exception.S
  user/ed/newcons/sys/ia64/ia64/genassym.c
  user/ed/newcons/sys/ia64/ia64/interrupt.c
  user/ed/newcons/sys/ia64/ia64/locore.S
  user/ed/newcons/sys/ia64/ia64/machdep.c
  user/ed/newcons/sys/ia64/ia64/mp_machdep.c
  user/ed/newcons/sys/ia64/ia64/nexus.c
  user/ed/newcons/sys/ia64/ia64/pmap.c
  user/ed/newcons/sys/ia64/ia64/sapic.c
  user/ed/newcons/sys/ia64/ia64/support.S
  user/ed/newcons/sys/ia64/ia64/syscall.S
  user/ed/newcons/sys/ia64/ia64/vm_machdep.c
  user/ed/newcons/sys/ia64/include/_inttypes.h
  user/ed/newcons/sys/ia64/include/bus.h
  user/ed/newcons/sys/ia64/include/elf.h
  user/ed/newcons/sys/ia64/include/intr.h
  user/ed/newcons/sys/ia64/include/md_var.h
  user/ed/newcons/sys/ia64/include/pci_cfgreg.h
  user/ed/newcons/sys/ia64/include/pmap.h
  user/ed/newcons/sys/ia64/include/reg.h
  user/ed/newcons/sys/ia64/include/vmparam.h
  user/ed/newcons/sys/kern/imgact_elf.c
  user/ed/newcons/sys/kern/kern_conf.c
  user/ed/newcons/sys/kern/kern_event.c
  user/ed/newcons/sys/kern/kern_jail.c
  user/ed/newcons/sys/kern/kern_kthread.c
  user/ed/newcons/sys/kern/kern_ktr.c
  user/ed/newcons/sys/kern/kern_module.c
  user/ed/newcons/sys/kern/kern_proc.c
  user/ed/newcons/sys/kern/kern_resource.c
  user/ed/newcons/sys/kern/kern_sig.c
  user/ed/newcons/sys/kern/kern_thr.c
  user/ed/newcons/sys/kern/kern_umtx.c
  user/ed/newcons/sys/kern/ksched.c
  user/ed/newcons/sys/kern/link_elf_obj.c
  user/ed/newcons/sys/kern/subr_firmware.c
  user/ed/newcons/sys/kern/subr_param.c
  user/ed/newcons/sys/kern/sys_generic.c
  user/ed/newcons/sys/kern/sys_process.c
  user/ed/newcons/sys/kern/uipc_socket.c
  user/ed/newcons/sys/kern/uipc_syscalls.c
  user/ed/newcons/sys/kern/vfs_aio.c
  user/ed/newcons/sys/kern/vfs_default.c
  user/ed/newcons/sys/kern/vfs_mount.c
  user/ed/newcons/sys/kern/vfs_syscalls.c
  user/ed/newcons/sys/mips/alchemy/obio.c
  user/ed/newcons/sys/mips/atheros/ar71xxreg.h
  user/ed/newcons/sys/mips/cavium/dev/rgmii/octeon_fpa.c
  user/ed/newcons/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
  user/ed/newcons/sys/mips/cavium/octeon_ebt3000_cf.c
  user/ed/newcons/sys/mips/cavium/octeon_machdep.c
  user/ed/newcons/sys/mips/cavium/octeon_pcmap_regs.h
  user/ed/newcons/sys/mips/conf/ADM5120
  user/ed/newcons/sys/mips/conf/ALCHEMY
  user/ed/newcons/sys/mips/conf/AR71XX
  user/ed/newcons/sys/mips/conf/IDT
  user/ed/newcons/sys/mips/conf/MALTA
  user/ed/newcons/sys/mips/conf/MALTA64
  user/ed/newcons/sys/mips/conf/OCTEON1
  user/ed/newcons/sys/mips/conf/OCTEON1-32
  user/ed/newcons/sys/mips/conf/QEMU
  user/ed/newcons/sys/mips/conf/SENTRY5
  user/ed/newcons/sys/mips/conf/SWARM
  user/ed/newcons/sys/mips/conf/XLR
  user/ed/newcons/sys/mips/include/_inttypes.h
  user/ed/newcons/sys/mips/include/asm.h
  user/ed/newcons/sys/mips/include/bus.h
  user/ed/newcons/sys/mips/include/cdefs.h
  user/ed/newcons/sys/mips/include/cpu.h
  user/ed/newcons/sys/mips/include/cpufunc.h
  user/ed/newcons/sys/mips/include/cpuinfo.h
  user/ed/newcons/sys/mips/include/cpuregs.h
  user/ed/newcons/sys/mips/include/hwfunc.h
  user/ed/newcons/sys/mips/include/intr_machdep.h
  user/ed/newcons/sys/mips/include/kdb.h
  user/ed/newcons/sys/mips/include/param.h
  user/ed/newcons/sys/mips/include/pcpu.h
  user/ed/newcons/sys/mips/include/pmap.h
  user/ed/newcons/sys/mips/include/pmc_mdep.h
  user/ed/newcons/sys/mips/include/smp.h
  user/ed/newcons/sys/mips/include/ucontext.h
  user/ed/newcons/sys/mips/malta/gtreg.h
  user/ed/newcons/sys/mips/mips/bus_space_generic.c
  user/ed/newcons/sys/mips/mips/busdma_machdep.c
  user/ed/newcons/sys/mips/mips/cpu.c
  user/ed/newcons/sys/mips/mips/db_trace.c
  user/ed/newcons/sys/mips/mips/elf_machdep.c
  user/ed/newcons/sys/mips/mips/elf_trampoline.c
  user/ed/newcons/sys/mips/mips/exception.S
  user/ed/newcons/sys/mips/mips/intr_machdep.c
  user/ed/newcons/sys/mips/mips/locore.S
  user/ed/newcons/sys/mips/mips/machdep.c
  user/ed/newcons/sys/mips/mips/mp_machdep.c
  user/ed/newcons/sys/mips/mips/nexus.c
  user/ed/newcons/sys/mips/mips/pmap.c
  user/ed/newcons/sys/mips/mips/support.S
  user/ed/newcons/sys/mips/mips/swtch.S
  user/ed/newcons/sys/mips/mips/tick.c
  user/ed/newcons/sys/mips/mips/vm_machdep.c
  user/ed/newcons/sys/mips/rmi/board.c
  user/ed/newcons/sys/mips/rmi/bus_space_rmi.c
  user/ed/newcons/sys/mips/rmi/dev/xlr/rge.c
  user/ed/newcons/sys/mips/rmi/ehcireg.h
  user/ed/newcons/sys/mips/rmi/ehcivar.h
  user/ed/newcons/sys/mips/rmi/files.xlr
  user/ed/newcons/sys/mips/rmi/interrupt.h
  user/ed/newcons/sys/mips/rmi/intr_machdep.c
  user/ed/newcons/sys/mips/rmi/iodi.c
  user/ed/newcons/sys/mips/rmi/pcibus.h
  user/ed/newcons/sys/mips/rmi/xlr_pci.c
  user/ed/newcons/sys/mips/rmi/xls_ehci.c
  user/ed/newcons/sys/mips/sibyte/sb_asm.S
  user/ed/newcons/sys/mips/sibyte/sb_machdep.c
  user/ed/newcons/sys/mips/sibyte/sb_scd.c
  user/ed/newcons/sys/mips/sibyte/sb_scd.h
  user/ed/newcons/sys/mips/sibyte/sb_zbbus.c
  user/ed/newcons/sys/mips/sibyte/sb_zbpci.c
  user/ed/newcons/sys/modules/Makefile
  user/ed/newcons/sys/modules/acpi/acpi/Makefile
  user/ed/newcons/sys/modules/ath/Makefile
  user/ed/newcons/sys/modules/bios/smbios/Makefile
  user/ed/newcons/sys/modules/bios/vpd/Makefile
  user/ed/newcons/sys/modules/cpufreq/Makefile
  user/ed/newcons/sys/modules/cxgb/cxgb/Makefile
  user/ed/newcons/sys/modules/linux/Makefile
  user/ed/newcons/sys/modules/nfsclient/Makefile
  user/ed/newcons/sys/modules/nfsserver/Makefile
  user/ed/newcons/sys/modules/procfs/Makefile
  user/ed/newcons/sys/net/bpf.c
  user/ed/newcons/sys/net/flowtable.c
  user/ed/newcons/sys/net/flowtable.h
  user/ed/newcons/sys/net/if.c
  user/ed/newcons/sys/net/if.h
  user/ed/newcons/sys/net/if_bridge.c
  user/ed/newcons/sys/net/if_epair.c
  user/ed/newcons/sys/net/if_ethersubr.c
  user/ed/newcons/sys/net/if_gre.c
  user/ed/newcons/sys/net/if_gre.h
  user/ed/newcons/sys/net/if_lagg.c
  user/ed/newcons/sys/net/if_llatbl.c
  user/ed/newcons/sys/net/if_llatbl.h
  user/ed/newcons/sys/net/if_loop.c
  user/ed/newcons/sys/net/if_tap.c
  user/ed/newcons/sys/net/if_tun.c
  user/ed/newcons/sys/net/if_var.h
  user/ed/newcons/sys/net/if_vlan.c
  user/ed/newcons/sys/net/netisr.c
  user/ed/newcons/sys/net/netisr.h
  user/ed/newcons/sys/net/radix.c
  user/ed/newcons/sys/net/radix.h
  user/ed/newcons/sys/net/radix_mpath.c
  user/ed/newcons/sys/net/route.c
  user/ed/newcons/sys/net/route.h
  user/ed/newcons/sys/net/vnet.c
  user/ed/newcons/sys/net/zlib.h
  user/ed/newcons/sys/netgraph/ng_socket.c
  user/ed/newcons/sys/netgraph/ng_socketvar.h
  user/ed/newcons/sys/netinet/in.c
  user/ed/newcons/sys/netinet/in_pcb.h
  user/ed/newcons/sys/netinet/in_proto.c
  user/ed/newcons/sys/netinet/ip_divert.c
  user/ed/newcons/sys/netinet/ip_dummynet.h
  user/ed/newcons/sys/netinet/ip_fw.h
  user/ed/newcons/sys/netinet/ip_gre.c
  user/ed/newcons/sys/netinet/ip_gre.h
  user/ed/newcons/sys/netinet/ip_input.c
  user/ed/newcons/sys/netinet/ip_ipsec.c
  user/ed/newcons/sys/netinet/ip_mroute.c
  user/ed/newcons/sys/netinet/ip_options.c
  user/ed/newcons/sys/netinet/ip_output.c
  user/ed/newcons/sys/netinet/ip_var.h
  user/ed/newcons/sys/netinet/ipfw/ip_dummynet.c
  user/ed/newcons/sys/netinet/ipfw/ip_fw2.c
  user/ed/newcons/sys/netinet/ipfw/ip_fw_dynamic.c
  user/ed/newcons/sys/netinet/ipfw/ip_fw_log.c
  user/ed/newcons/sys/netinet/ipfw/ip_fw_pfil.c
  user/ed/newcons/sys/netinet/ipfw/ip_fw_private.h
  user/ed/newcons/sys/netinet/ipfw/ip_fw_sockopt.c
  user/ed/newcons/sys/netinet/ipfw/ip_fw_table.c
  user/ed/newcons/sys/netinet/sctp_crc32.c
  user/ed/newcons/sys/netinet/sctp_crc32.h
  user/ed/newcons/sys/netinet/sctp_header.h
  user/ed/newcons/sys/netinet/sctp_indata.c
  user/ed/newcons/sys/netinet/sctp_input.c
  user/ed/newcons/sys/netinet/sctp_output.c
  user/ed/newcons/sys/netinet/sctp_output.h
  user/ed/newcons/sys/netinet/sctp_usrreq.c
  user/ed/newcons/sys/netinet/sctputil.c
  user/ed/newcons/sys/netinet/tcp_hostcache.c
  user/ed/newcons/sys/netinet/tcp_input.c
  user/ed/newcons/sys/netinet/tcp_reass.c
  user/ed/newcons/sys/netinet/tcp_subr.c
  user/ed/newcons/sys/netinet/tcp_syncache.c
  user/ed/newcons/sys/netinet/tcp_timer.c
  user/ed/newcons/sys/netinet/tcp_timewait.c
  user/ed/newcons/sys/netinet/tcp_usrreq.c
  user/ed/newcons/sys/netinet/tcp_var.h
  user/ed/newcons/sys/netinet/udp_usrreq.c
  user/ed/newcons/sys/netinet6/in6_pcb.c
  user/ed/newcons/sys/netinet6/ip6_output.c
  user/ed/newcons/sys/netinet6/nd6.c
  user/ed/newcons/sys/netipsec/keydb.h
  user/ed/newcons/sys/nfs/nfs_common.c
  user/ed/newcons/sys/nfs/nfs_common.h
  user/ed/newcons/sys/nfsclient/nfs_kdtrace.c
  user/ed/newcons/sys/nfsclient/nfs_krpc.c
  user/ed/newcons/sys/nfsclient/nfs_vfsops.c
  user/ed/newcons/sys/nfsserver/nfs.h
  user/ed/newcons/sys/nfsserver/nfs_fha.c
  user/ed/newcons/sys/nfsserver/nfs_srvkrpc.c
  user/ed/newcons/sys/nfsserver/nfs_srvsubs.c
  user/ed/newcons/sys/pc98/cbus/clock.c
  user/ed/newcons/sys/pc98/conf/GENERIC
  user/ed/newcons/sys/pc98/pc98/machdep.c
  user/ed/newcons/sys/powerpc/aim/interrupt.c
  user/ed/newcons/sys/powerpc/aim/machdep.c
  user/ed/newcons/sys/powerpc/aim/mmu_oea.c
  user/ed/newcons/sys/powerpc/aim/mmu_oea64.c
  user/ed/newcons/sys/powerpc/aim/ofwmagic.S
  user/ed/newcons/sys/powerpc/aim/trap.c
  user/ed/newcons/sys/powerpc/aim/uma_machdep.c
  user/ed/newcons/sys/powerpc/booke/copyinout.c
  user/ed/newcons/sys/powerpc/booke/interrupt.c
  user/ed/newcons/sys/powerpc/booke/machdep.c
  user/ed/newcons/sys/powerpc/conf/GENERIC
  user/ed/newcons/sys/powerpc/conf/MPC85XX
  user/ed/newcons/sys/powerpc/fpu/fpu_extern.h
  user/ed/newcons/sys/powerpc/include/_inttypes.h
  user/ed/newcons/sys/powerpc/include/intr.h
  user/ed/newcons/sys/powerpc/include/pte.h
  user/ed/newcons/sys/powerpc/include/spr.h
  user/ed/newcons/sys/powerpc/include/sr.h
  user/ed/newcons/sys/powerpc/include/vmparam.h
  user/ed/newcons/sys/powerpc/powermac/smu.c
  user/ed/newcons/sys/powerpc/powerpc/cpu.c
  user/ed/newcons/sys/powerpc/powerpc/mem.c
  user/ed/newcons/sys/security/mac_biba/mac_biba.c
  user/ed/newcons/sys/security/mac_lomac/mac_lomac.c
  user/ed/newcons/sys/security/mac_mls/mac_mls.c
  user/ed/newcons/sys/sparc64/conf/GENERIC
  user/ed/newcons/sys/sparc64/include/_inttypes.h
  user/ed/newcons/sys/sparc64/include/asi.h
  user/ed/newcons/sys/sparc64/include/asmacros.h
  user/ed/newcons/sys/sparc64/include/cache.h
  user/ed/newcons/sys/sparc64/include/cpu.h
  user/ed/newcons/sys/sparc64/include/ktr.h
  user/ed/newcons/sys/sparc64/include/md_var.h
  user/ed/newcons/sys/sparc64/include/pcpu.h
  user/ed/newcons/sys/sparc64/include/pmap.h
  user/ed/newcons/sys/sparc64/include/smp.h
  user/ed/newcons/sys/sparc64/include/tick.h
  user/ed/newcons/sys/sparc64/include/upa.h
  user/ed/newcons/sys/sparc64/include/ver.h
  user/ed/newcons/sys/sparc64/sbus/lsi64854reg.h
  user/ed/newcons/sys/sparc64/sbus/lsi64854var.h
  user/ed/newcons/sys/sparc64/sbus/ofw_sbus.h
  user/ed/newcons/sys/sparc64/sparc64/cache.c
  user/ed/newcons/sys/sparc64/sparc64/cheetah.c
  user/ed/newcons/sys/sparc64/sparc64/identcpu.c
  user/ed/newcons/sys/sparc64/sparc64/iommu.c
  user/ed/newcons/sys/sparc64/sparc64/locore.S
  user/ed/newcons/sys/sparc64/sparc64/machdep.c
  user/ed/newcons/sys/sparc64/sparc64/mp_locore.S
  user/ed/newcons/sys/sparc64/sparc64/mp_machdep.c
  user/ed/newcons/sys/sparc64/sparc64/nexus.c
  user/ed/newcons/sys/sparc64/sparc64/pmap.c
  user/ed/newcons/sys/sparc64/sparc64/spitfire.c
  user/ed/newcons/sys/sparc64/sparc64/tick.c
  user/ed/newcons/sys/sparc64/sparc64/trap.c
  user/ed/newcons/sys/sun4v/conf/GENERIC
  user/ed/newcons/sys/sun4v/include/_inttypes.h
  user/ed/newcons/sys/sun4v/include/asi.h
  user/ed/newcons/sys/sys/ata.h
  user/ed/newcons/sys/sys/clock.h
  user/ed/newcons/sys/sys/eventhandler.h
  user/ed/newcons/sys/sys/fbio.h
  user/ed/newcons/sys/sys/imgact.h
  user/ed/newcons/sys/sys/imgact_aout.h
  user/ed/newcons/sys/sys/imgact_elf.h
  user/ed/newcons/sys/sys/pcpu.h
  user/ed/newcons/sys/sys/pioctl.h
  user/ed/newcons/sys/sys/pmc.h
  user/ed/newcons/sys/sys/ptrace.h
  user/ed/newcons/sys/sys/queue.h
  user/ed/newcons/sys/sys/sysctl.h
  user/ed/newcons/sys/sys/sysent.h
  user/ed/newcons/sys/sys/systm.h
  user/ed/newcons/sys/sys/timeb.h
  user/ed/newcons/sys/sys/user.h
  user/ed/newcons/sys/ufs/ffs/ffs_alloc.c
  user/ed/newcons/sys/ufs/ffs/ffs_vfsops.c
  user/ed/newcons/sys/ufs/ffs/fs.h
  user/ed/newcons/sys/vm/vm_init.c
  user/ed/newcons/sys/vm/vm_page.c
  user/ed/newcons/sys/vm/vnode_pager.c
  user/ed/newcons/sys/xen/evtchn/evtchn_dev.c
  user/ed/newcons/tools/build/mk/OptionalObsoleteFiles.inc
  user/ed/newcons/tools/regression/bin/sh/expansion/arith2.0
  user/ed/newcons/tools/regression/bin/sh/parameters/mail2.0
  user/ed/newcons/tools/regression/file/closefrom/Makefile
  user/ed/newcons/tools/regression/file/flock/Makefile
  user/ed/newcons/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c
  user/ed/newcons/tools/regression/gaithrstress/Makefile
  user/ed/newcons/tools/regression/gaithrstress/gaithrstress.c
  user/ed/newcons/tools/regression/kgssapi/Makefile
  user/ed/newcons/tools/regression/kqueue/Makefile
  user/ed/newcons/tools/regression/lib/libc/resolv/resolv.c
  user/ed/newcons/tools/regression/mqueue/mqtest1/Makefile
  user/ed/newcons/tools/regression/mqueue/mqtest2/Makefile
  user/ed/newcons/tools/regression/mqueue/mqtest3/Makefile
  user/ed/newcons/tools/regression/mqueue/mqtest4/Makefile
  user/ed/newcons/tools/regression/mqueue/mqtest5/Makefile
  user/ed/newcons/tools/regression/netipx/ipxdgramloopback/Makefile
  user/ed/newcons/tools/regression/netipx/spxabort/Makefile
  user/ed/newcons/tools/regression/netipx/spxloopback/Makefile
  user/ed/newcons/tools/regression/priv/Makefile
  user/ed/newcons/tools/regression/pthread/cv_cancel1/Makefile
  user/ed/newcons/tools/regression/pthread/mutex_isowned_np/Makefile
  user/ed/newcons/tools/regression/rpcsec_gss/Makefile
  user/ed/newcons/tools/regression/sigqueue/sigqtest1/Makefile
  user/ed/newcons/tools/regression/sigqueue/sigqtest2/Makefile
  user/ed/newcons/tools/regression/sockets/sendfile/Makefile
  user/ed/newcons/tools/regression/sockets/sendfile/sendfile.c
  user/ed/newcons/tools/regression/sockets/unix_gc/Makefile
  user/ed/newcons/tools/regression/sockets/unix_sorflush/Makefile
  user/ed/newcons/tools/regression/sysvmsg/msgtest.c
  user/ed/newcons/tools/regression/sysvsem/semtest.c
  user/ed/newcons/tools/regression/sysvshm/shmtest.c
  user/ed/newcons/tools/regression/tls/libxx/Makefile
  user/ed/newcons/tools/regression/tls/libyy/Makefile
  user/ed/newcons/tools/regression/tls/ttls1/Makefile
  user/ed/newcons/tools/regression/tls/ttls2/Makefile
  user/ed/newcons/tools/regression/tls/ttls4/Makefile
  user/ed/newcons/tools/regression/tmpfs/Makefile
  user/ed/newcons/tools/regression/tmpfs/h_funcs.subr
  user/ed/newcons/tools/regression/tmpfs/h_tools.c
  user/ed/newcons/tools/regression/tmpfs/t_create
  user/ed/newcons/tools/regression/tmpfs/t_dots
  user/ed/newcons/tools/regression/tmpfs/t_exec
  user/ed/newcons/tools/regression/tmpfs/t_link
  user/ed/newcons/tools/regression/tmpfs/t_mkdir
  user/ed/newcons/tools/regression/tmpfs/t_mount
  user/ed/newcons/tools/regression/tmpfs/t_pipes
  user/ed/newcons/tools/regression/tmpfs/t_read_write
  user/ed/newcons/tools/regression/tmpfs/t_readdir
  user/ed/newcons/tools/regression/tmpfs/t_remove
  user/ed/newcons/tools/regression/tmpfs/t_rename
  user/ed/newcons/tools/regression/tmpfs/t_rmdir
  user/ed/newcons/tools/regression/tmpfs/t_setattr
  user/ed/newcons/tools/regression/tmpfs/t_sizes
  user/ed/newcons/tools/regression/tmpfs/t_sockets
  user/ed/newcons/tools/regression/tmpfs/t_statvfs
  user/ed/newcons/tools/regression/tmpfs/t_symlink
  user/ed/newcons/tools/regression/tmpfs/t_times
  user/ed/newcons/tools/regression/tmpfs/t_trail_slash
  user/ed/newcons/tools/regression/tmpfs/t_truncate
  user/ed/newcons/tools/regression/tmpfs/t_vnd
  user/ed/newcons/tools/regression/tmpfs/t_vnode_leak
  user/ed/newcons/tools/regression/usr.bin/Makefile
  user/ed/newcons/tools/regression/usr.bin/env/Makefile
  user/ed/newcons/tools/tools/ether_reflect/Makefile
  user/ed/newcons/tools/tools/mctest/Makefile
  user/ed/newcons/tools/tools/mctest/mctest.1
  user/ed/newcons/tools/tools/mctest/mctest.cc
  user/ed/newcons/tools/tools/net80211/stumbler/Makefile
  user/ed/newcons/tools/tools/net80211/w00t/Makefile.inc
  user/ed/newcons/tools/tools/netrate/http/Makefile
  user/ed/newcons/tools/tools/netrate/http/http.c
  user/ed/newcons/tools/tools/netrate/httpd/Makefile
  user/ed/newcons/tools/tools/netrate/httpd/httpd.c
  user/ed/newcons/tools/tools/netrate/juggle/Makefile
  user/ed/newcons/tools/tools/netrate/juggle/juggle.c
  user/ed/newcons/tools/tools/netrate/tcpconnect/Makefile
  user/ed/newcons/tools/tools/netrate/tcpp/Makefile
  user/ed/newcons/tools/tools/netrate/tcpreceive/Makefile
  user/ed/newcons/tools/tools/umastat/Makefile
  user/ed/newcons/usr.bin/Makefile
  user/ed/newcons/usr.bin/apply/Makefile
  user/ed/newcons/usr.bin/apply/apply.c
  user/ed/newcons/usr.bin/chpass/Makefile
  user/ed/newcons/usr.bin/comm/comm.c
  user/ed/newcons/usr.bin/cpio/Makefile
  user/ed/newcons/usr.bin/cpio/bsdcpio.1
  user/ed/newcons/usr.bin/ee/Makefile
  user/ed/newcons/usr.bin/elf2aout/elf2aout.1
  user/ed/newcons/usr.bin/elf2aout/elf2aout.c
  user/ed/newcons/usr.bin/fetch/Makefile
  user/ed/newcons/usr.bin/find/Makefile
  user/ed/newcons/usr.bin/find/extern.h
  user/ed/newcons/usr.bin/find/function.c
  user/ed/newcons/usr.bin/find/getdate.y
  user/ed/newcons/usr.bin/gcore/Makefile
  user/ed/newcons/usr.bin/gencat/gencat.c
  user/ed/newcons/usr.bin/getent/getent.1
  user/ed/newcons/usr.bin/getent/getent.c
  user/ed/newcons/usr.bin/hexdump/hexdump.1
  user/ed/newcons/usr.bin/hexdump/od.1
  user/ed/newcons/usr.bin/jot/jot.1
  user/ed/newcons/usr.bin/kdump/kdump.c
  user/ed/newcons/usr.bin/locale/Makefile
  user/ed/newcons/usr.bin/ncal/Makefile
  user/ed/newcons/usr.bin/ncal/ncal.1
  user/ed/newcons/usr.bin/ncal/ncal.c
  user/ed/newcons/usr.bin/netstat/Makefile
  user/ed/newcons/usr.bin/netstat/main.c
  user/ed/newcons/usr.bin/netstat/netgraph.c
  user/ed/newcons/usr.bin/netstat/netstat.1
  user/ed/newcons/usr.bin/netstat/netstat.h
  user/ed/newcons/usr.bin/nl/nl.1
  user/ed/newcons/usr.bin/nl/nl.c
  user/ed/newcons/usr.bin/perror/perror.1
  user/ed/newcons/usr.bin/pr/Makefile
  user/ed/newcons/usr.bin/pr/egetopt.c
  user/ed/newcons/usr.bin/pr/pr.c
  user/ed/newcons/usr.bin/procstat/Makefile
  user/ed/newcons/usr.bin/procstat/procstat.1
  user/ed/newcons/usr.bin/procstat/procstat.c
  user/ed/newcons/usr.bin/procstat/procstat.h
  user/ed/newcons/usr.bin/script/script.c
  user/ed/newcons/usr.bin/stat/stat.1
  user/ed/newcons/usr.bin/stat/stat.c
  user/ed/newcons/usr.bin/systat/Makefile
  user/ed/newcons/usr.bin/tar/Makefile
  user/ed/newcons/usr.bin/tar/bsdtar.1
  user/ed/newcons/usr.bin/tar/test/test_option_T.c
  user/ed/newcons/usr.bin/tar/test/test_option_s.c
  user/ed/newcons/usr.bin/tar/tree.c
  user/ed/newcons/usr.bin/truncate/Makefile
  user/ed/newcons/usr.bin/truncate/truncate.c
  user/ed/newcons/usr.bin/truss/amd64-fbsd.c
  user/ed/newcons/usr.bin/truss/amd64-fbsd32.c
  user/ed/newcons/usr.bin/truss/amd64-linux32.c
  user/ed/newcons/usr.bin/truss/extern.h
  user/ed/newcons/usr.bin/truss/i386-fbsd.c
  user/ed/newcons/usr.bin/truss/i386-linux.c
  user/ed/newcons/usr.bin/truss/ia64-fbsd.c
  user/ed/newcons/usr.bin/truss/main.c
  user/ed/newcons/usr.bin/truss/mips-fbsd.c
  user/ed/newcons/usr.bin/truss/powerpc-fbsd.c
  user/ed/newcons/usr.bin/truss/setup.c
  user/ed/newcons/usr.bin/truss/sparc64-fbsd.c
  user/ed/newcons/usr.bin/truss/syscalls.c
  user/ed/newcons/usr.bin/truss/truss.h
  user/ed/newcons/usr.bin/uname/uname.1
  user/ed/newcons/usr.bin/uname/uname.c
  user/ed/newcons/usr.bin/unifdef/unifdef.1
  user/ed/newcons/usr.bin/unifdef/unifdef.c
  user/ed/newcons/usr.bin/unifdef/unifdefall.sh
  user/ed/newcons/usr.bin/uniq/uniq.c
  user/ed/newcons/usr.bin/unzip/Makefile
  user/ed/newcons/usr.bin/unzip/unzip.1
  user/ed/newcons/usr.bin/unzip/unzip.c
  user/ed/newcons/usr.bin/usbhidaction/usbhidaction.1
  user/ed/newcons/usr.bin/usbhidaction/usbhidaction.c
  user/ed/newcons/usr.bin/usbhidctl/usbhid.c
  user/ed/newcons/usr.bin/usbhidctl/usbhidctl.1
  user/ed/newcons/usr.bin/w/w.c
  user/ed/newcons/usr.bin/xinstall/xinstall.c
  user/ed/newcons/usr.bin/xlint/lint1/makeman
  user/ed/newcons/usr.bin/xlint/lint1/scan.l
  user/ed/newcons/usr.sbin/Makefile
  user/ed/newcons/usr.sbin/acpi/acpidb/Makefile
  user/ed/newcons/usr.sbin/acpi/iasl/Makefile
  user/ed/newcons/usr.sbin/arp/arp.c
  user/ed/newcons/usr.sbin/auditd/Makefile
  user/ed/newcons/usr.sbin/bluetooth/bthidd/Makefile
  user/ed/newcons/usr.sbin/boot0cfg/Makefile
  user/ed/newcons/usr.sbin/bsnmpd/modules/Makefile.inc
  user/ed/newcons/usr.sbin/chown/chgrp.1
  user/ed/newcons/usr.sbin/chown/chown.8
  user/ed/newcons/usr.sbin/chown/chown.c
  user/ed/newcons/usr.sbin/cxgbtool/Makefile
  user/ed/newcons/usr.sbin/cxgbtool/cxgbtool.c
  user/ed/newcons/usr.sbin/cxgbtool/reg_defs.c
  user/ed/newcons/usr.sbin/cxgbtool/reg_defs_t3.c
  user/ed/newcons/usr.sbin/cxgbtool/reg_defs_t3b.c
  user/ed/newcons/usr.sbin/cxgbtool/reg_defs_t3c.c
  user/ed/newcons/usr.sbin/eeprom/eeprom.8
  user/ed/newcons/usr.sbin/eeprom/eeprom.c
  user/ed/newcons/usr.sbin/freebsd-update/freebsd-update.8
  user/ed/newcons/usr.sbin/ftp-proxy/Makefile.inc
  user/ed/newcons/usr.sbin/fwcontrol/Makefile
  user/ed/newcons/usr.sbin/jail/jail.8
  user/ed/newcons/usr.sbin/makefs/compat/pwcache.c
  user/ed/newcons/usr.sbin/makefs/compat/strsuftoll.c
  user/ed/newcons/usr.sbin/makefs/getid.c
  user/ed/newcons/usr.sbin/mfiutil/Makefile
  user/ed/newcons/usr.sbin/mount_nwfs/Makefile
  user/ed/newcons/usr.sbin/mount_nwfs/mount_nwfs.c
  user/ed/newcons/usr.sbin/mptable/mptable.c
  user/ed/newcons/usr.sbin/mptutil/Makefile
  user/ed/newcons/usr.sbin/mptutil/mpt_cam.c
  user/ed/newcons/usr.sbin/mptutil/mpt_show.c
  user/ed/newcons/usr.sbin/mtree/mtree.5
  user/ed/newcons/usr.sbin/pkg_install/updating/pkg_updating.1
  user/ed/newcons/usr.sbin/pmcannotate/pmcannotate.8
  user/ed/newcons/usr.sbin/pmcstat/Makefile
  user/ed/newcons/usr.sbin/pmcstat/pmcstat.8
  user/ed/newcons/usr.sbin/pmcstat/pmcstat.c
  user/ed/newcons/usr.sbin/pmcstat/pmcstat.h
  user/ed/newcons/usr.sbin/pmcstat/pmcstat_log.c
  user/ed/newcons/usr.sbin/rpcbind/rpcbind.c
  user/ed/newcons/usr.sbin/rpcbind/rpcbind.h
  user/ed/newcons/usr.sbin/rpcbind/util.c
  user/ed/newcons/usr.sbin/rtsold/Makefile
  user/ed/newcons/usr.sbin/rtsold/dump.c
  user/ed/newcons/usr.sbin/rtsold/if.c
  user/ed/newcons/usr.sbin/rtsold/rtsock.c
  user/ed/newcons/usr.sbin/rtsold/rtsol.c
  user/ed/newcons/usr.sbin/rtsold/rtsold.c
  user/ed/newcons/usr.sbin/rtsold/rtsold.h
  user/ed/newcons/usr.sbin/sysinstall/devices.c
  user/ed/newcons/usr.sbin/sysinstall/package.c
  user/ed/newcons/usr.sbin/uhsoctl/Makefile
  user/ed/newcons/usr.sbin/uhsoctl/uhsoctl.1
  user/ed/newcons/usr.sbin/usbdevs/usbdevs.8
  user/ed/newcons/usr.sbin/usbdevs/usbdevs.c
  user/ed/newcons/usr.sbin/wake/Makefile
  user/ed/newcons/usr.sbin/wake/wake.8
  user/ed/newcons/usr.sbin/wake/wake.c
  user/ed/newcons/usr.sbin/yppoll/yppoll.8
  user/ed/newcons/usr.sbin/zic/zdump/Makefile
  user/ed/newcons/usr.sbin/zic/zic/Makefile
Directory Properties:
  user/ed/newcons/   (props changed)
  user/ed/newcons/contrib/bind9/   (props changed)
  user/ed/newcons/contrib/expat/   (props changed)
  user/ed/newcons/contrib/groff/   (props changed)
  user/ed/newcons/contrib/one-true-awk/   (props changed)
  user/ed/newcons/contrib/tzcode/stdtime/   (props changed)
  user/ed/newcons/contrib/tzcode/zic/   (props changed)
  user/ed/newcons/crypto/openssh/   (props changed)
  user/ed/newcons/lib/libz/   (props changed)
  user/ed/newcons/sys/contrib/dev/acpica/   (props changed)
  user/ed/newcons/sys/contrib/x86emu/   (props changed)

Modified: user/ed/newcons/MAINTAINERS
==============================================================================
--- user/ed/newcons/MAINTAINERS	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/MAINTAINERS	Sat Mar 13 11:06:47 2010	(r205117)
@@ -125,6 +125,12 @@ gnu/usr.bin/send-pr	bugmaster	Pre-commit
 ncurses		rafan	Heads-up appreciated, try not to break it.
 *env(3)		secteam	Due to the problematic security history of this
 			code, please have patches reviewed by secteam.
+share/zoneinfo		edwin	Heads-up appreciated, since our data is coming
+				from a third party source.
+usr.sbin/zic		edwin   Heads-up appreciated, since this code is
+				maintained by a third party source.
+lib/libc/stdtime	edwin   Heads-up appreciated, since parts of this code
+				is maintained by a third party source.
 
 Following are the entries from the Makefiles, and a few other sources.
 Please remove stale entries from both their origin, and this file.

Modified: user/ed/newcons/Makefile
==============================================================================
--- user/ed/newcons/Makefile	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/Makefile	Sat Mar 13 11:06:47 2010	(r205117)
@@ -15,6 +15,7 @@
 # reinstallkernel     - Reinstall the kernel and the kernel-modules.
 # reinstallkernel.debug
 # kernel              - buildkernel + installkernel.
+# kernel-toolchain    - Builds the subset of world necessary to build a kernel
 # doxygen             - Build API documentation of the kernel, needs doxygen.
 # update              - Convenient way to update your source tree (cvs).
 # check-old           - List obsolete directories/files/libraries.

Modified: user/ed/newcons/Makefile.inc1
==============================================================================
--- user/ed/newcons/Makefile.inc1	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/Makefile.inc1	Sat Mar 13 11:06:47 2010	(r205117)
@@ -1259,7 +1259,7 @@ delete-old-files:
 	@echo ">>> Removing old files (only deletes safe to delete libs)"
 # Ask for every old file if the user really wants to remove it.
 # It's annoying, but better safe than sorry.
-	@for file in ${OLD_FILES}; do \
+	@for file in ${OLD_FILES} ${OLD_FILES:Musr/share/*.gz:R}; do \
 		if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
 			chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
 			rm ${RM_I} "${DESTDIR}/$${file}"; \
@@ -1279,7 +1279,7 @@ delete-old-files:
 
 check-old-files:
 	@echo ">>> Checking for old files"
-	@for file in ${OLD_FILES}; do \
+	@for file in ${OLD_FILES} ${OLD_FILES:Musr/share/*.gz:R}; do \
 		if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
 		 	echo "${DESTDIR}/$${file}"; \
 		fi; \

Modified: user/ed/newcons/ObsoleteFiles.inc
==============================================================================
--- user/ed/newcons/ObsoleteFiles.inc	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/ObsoleteFiles.inc	Sat Mar 13 11:06:47 2010	(r205117)
@@ -14,6 +14,23 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20100303: actual removal of utmp.h
+OLD_FILES+=usr/include/utmp.h
+# 20100227: [ia64] removed  and 
+.if ${TARGET_ARCH} == "ia64"
+OLD_FILES+=usr/include/machine/sapicreg.h
+OLD_FILES+=usr/include/machine/sapicvar.h
+.endif
+# 20100208: man pages moved
+.if ${TARGET_ARCH} == "i386"
+OLD_FILES+=usr/share/man/man4/i386/alpm.4.gz
+OLD_FILES+=usr/share/man/man4/i386/amdpm.4.gz
+OLD_FILES+=usr/share/man/man4/i386/mcd.4.gz
+OLD_FILES+=usr/share/man/man4/i386/padlock.4.gz
+OLD_FILES+=usr/share/man/man4/i386/pcf.4.gz
+OLD_FILES+=usr/share/man/man4/i386/scd.4.gz
+OLD_FILES+=usr/share/man/man4/i386/viapm.4.gz
+.endif
 # 20100122: move BSDL bc/dc USD documents to /usr/share/doc/usd
 OLD_FILES+=usr/share/doc/papers/bc.ascii.gz
 OLD_FILES+=usr/share/doc/papers/dc.ascii.gz
@@ -2275,7 +2292,7 @@ OLD_FILES+=usr/lib/libpam_ssh.a
 OLD_FILES+=usr/lib/libpam_ssh_p.a
 OLD_FILES+=usr/bin/help
 OLD_FILES+=usr/bin/sccs
-.if ${TARGET_ARCH} != "arm" && ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "powerpc"
+.if ${TARGET_ARCH} != "amd64" && ${TARGET_ARCH} != "arm" && ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "powerpc"
 OLD_FILES+=usr/bin/gdbserver
 .endif
 OLD_FILES+=usr/bin/ssh-keysign

Modified: user/ed/newcons/UPDATING
==============================================================================
--- user/ed/newcons/UPDATING	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/UPDATING	Sat Mar 13 11:06:47 2010	(r205117)
@@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20100311:
+	The kernel option COMPAT_IA32 has been replaced with COMPAT_FREEBSD32
+	to allow 32-bit compatibility on non-x86 platforms. All kernel
+	configurations on amd64 and ia64 platforms using these options must
+	be modified accordingly.
+
 20100113:
 	The utmp user accounting database has been replaced with utmpx,
 	the user accounting interface standardized by POSIX.
@@ -497,7 +503,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 
 20090313:
 	The k8temp(4) driver has been renamed to amdtemp(4) since
-	support for K10 and K11 CPU families was added.
+	support for Family 10 and Family 11 CPU families was added.
 
 20090309:
 	IGMPv3 and Source-Specific Multicast (SSM) have been merged
@@ -983,7 +989,7 @@ COMMON ITEMS:
 	mergemaster -p					[5]
 	make installworld
 	make delete-old
-	mergemaster					[4]
+	mergemaster -i					[4]
 	
 
 
@@ -1054,7 +1060,8 @@ COMMON ITEMS:
 	system.  Attempting to do it by hand is not recommended and those
 	that pursue this avenue should read this file carefully, as well
 	as the archives of freebsd-current and freebsd-hackers mailing lists
-	for potential gotchas.
+	for potential gotchas.  The -U option is also useful to consider.
+	See mergemaster(8) for more information.
 
 	[5] Usually this step is a noop.  However, from time to time
 	you may need to do this if you get unknown user in the following

Modified: user/ed/newcons/bin/ed/Makefile
==============================================================================
--- user/ed/newcons/bin/ed/Makefile	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/ed/Makefile	Sat Mar 13 11:06:47 2010	(r205117)
@@ -4,7 +4,6 @@
 
 PROG=	ed
 SRCS=	buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
-WARNS?=	2
 LINKS=	${BINDIR}/ed ${BINDIR}/red
 MLINKS=	ed.1 red.1
 

Modified: user/ed/newcons/bin/ed/main.c
==============================================================================
--- user/ed/newcons/bin/ed/main.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/ed/main.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -103,15 +103,10 @@ const char usage[] = "usage: %s [-] [-sx
 
 /* ed: line editor */
 int
-main(int argc, char *argv[])
+main(volatile int argc, char ** volatile argv)
 {
 	int c, n;
 	long status = 0;
-#if __GNUC__
-	/* Avoid longjmp clobbering */
-	(void) &argc;
-	(void) &argv;
-#endif
 
 	(void)setlocale(LC_ALL, "");
 

Modified: user/ed/newcons/bin/kill/kill.c
==============================================================================
--- user/ed/newcons/bin/kill/kill.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/kill/kill.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -108,7 +108,7 @@ main(int argc, char *argv[])
 			numsig = strtol(*argv, &ep, 10);
 			if (!**argv || *ep)
 				errx(1, "illegal signal number: %s", *argv);
-			if (numsig < 0 || numsig >= sys_nsig)
+			if (numsig < 0)
 				nosig(*argv);
 		} else
 			nosig(*argv);

Modified: user/ed/newcons/bin/pkill/pkill.1
==============================================================================
--- user/ed/newcons/bin/pkill/pkill.1	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/pkill/pkill.1	Sat Mar 13 11:06:47 2010	(r205117)
@@ -16,13 +16,6 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"        This product includes software developed by the NetBSD
-.\"        Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\"    contributors may be used to endorse or promote products derived
-.\"    from this software without specific prior written permission.
 .\"
 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -36,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 16, 2009
+.Dd February 11, 2010
 .Dt PKILL 1
 .Os
 .Sh NAME
@@ -44,7 +37,7 @@
 .Nd find or signal processes by name
 .Sh SYNOPSIS
 .Nm pgrep
-.Op Fl LSafilnovx
+.Op Fl LSafilnoqvx
 .Op Fl F Ar pidfile
 .Op Fl G Ar gid
 .Op Fl M Ar core
@@ -175,6 +168,8 @@ command.
 Select only the newest (most recently started) of the matching processes.
 .It Fl o
 Select only the oldest (least recently started) of the matching processes.
+.It Fl q
+Do not write anything to standard output.
 .It Fl s Ar sid
 Restrict matches to processes with a session ID in the comma-separated
 list

Modified: user/ed/newcons/bin/pkill/pkill.c
==============================================================================
--- user/ed/newcons/bin/pkill/pkill.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/pkill/pkill.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -16,13 +16,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the NetBSD
- *	Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -49,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -110,6 +104,7 @@ static int	matchargs;
 static int	fullmatch;
 static int	kthreads;
 static int	cflags = REG_EXTENDED;
+static int	quiet;
 static kvm_t	*kd;
 static pid_t	mypid;
 
@@ -180,9 +175,11 @@ main(int argc, char **argv)
 	debug_opt = 0;
 	pidfile = NULL;
 	pidfilelock = 0;
-	execf = coref = _PATH_DEVNULL;
+	quiet = 0;
+	execf = NULL;
+	coref = _PATH_DEVNULL;
 
-	while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1)
+	while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnoqs:t:u:vx")) != -1)
 		switch (ch) {
 		case 'D':
 			debug_opt++;
@@ -257,6 +254,11 @@ main(int argc, char **argv)
 			oldest = 1;
 			criteria = 1;
 			break;
+		case 'q':
+			if (!pgrep)
+				usage();
+			quiet = 1;
+			break;
 		case 's':
 			makelist(&sidlist, LT_SID, optarg);
 			criteria = 1;
@@ -548,7 +550,7 @@ usage(void)
 	const char *ustr;
 
 	if (pgrep)
-		ustr = "[-LSfilnovx] [-d delim]";
+		ustr = "[-LSfilnoqvx] [-d delim]";
 	else
 		ustr = "[-signal] [-ILfinovx]";
 
@@ -566,6 +568,10 @@ show_process(const struct kinfo_proc *kp
 {
 	char **argv;
 
+	if (quiet) {
+		assert(pgrep);
+		return;
+	}
 	if ((longfmt || !pgrep) && matchargs &&
 	    (argv = kvm_getargv(kd, kp, 0)) != NULL) {
 		printf("%d ", (int)kp->ki_pid);
@@ -622,7 +628,8 @@ grepact(const struct kinfo_proc *kp)
 {
 
 	show_process(kp);
-	printf("%s", delim);
+	if (!quiet)
+		printf("%s", delim);
 	return (1);
 }
 

Modified: user/ed/newcons/bin/ps/ps.1
==============================================================================
--- user/ed/newcons/bin/ps/ps.1	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/ps/ps.1	Sat Mar 13 11:06:47 2010	(r205117)
@@ -29,7 +29,7 @@
 .\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd July 9, 2009
+.Dd March 5, 2010
 .Dt PS 1
 .Os
 .Sh NAME
@@ -284,11 +284,10 @@ The percentage of real memory used by th
 The flags associated with the process as in
 the include file
 .In sys/proc.h :
-.Bl -column P_STOPPED_SINGLE 0x4000000
+.Bl -column P_SINGLE_BOUNDARY 0x40000000
 .It Dv "P_ADVLOCK" Ta No "0x00001	Process may hold a POSIX advisory lock"
 .It Dv "P_CONTROLT" Ta No "0x00002	Has a controlling terminal"
 .It Dv "P_KTHREAD" Ta No "0x00004	Kernel thread"
-.It Dv "P_NOLOAD" Ta No "0x00008	Ignore during load avg calculations"
 .It Dv "P_PPWAIT" Ta No "0x00010	Parent is waiting for child to exec/exit"
 .It Dv "P_PROFIL" Ta No "0x00020	Has started profiling"
 .It Dv "P_STOPPROF" Ta No "0x00040	Has thread in requesting to stop prof"
@@ -305,8 +304,14 @@ the include file
 .It Dv "P_STOPPED_SINGLE" Ta No "0x80000	Only one thread can continue"
 .It Dv "P_PROTECTED" Ta No "0x100000	Do not kill on memory overcommit"
 .It Dv "P_SIGEVENT" Ta No "0x200000	Process pending signals changed"
+.It Dv "P_SINGLE_BOUNDARY" Ta No "0x400000	Threads should suspend at user boundary"
+.It Dv "P_HWPMC" Ta No "0x800000	Process is using HWPMCs"
 .It Dv "P_JAILED" Ta No "0x1000000	Process is in jail"
 .It Dv "P_INEXEC" Ta No "0x4000000	Process is in execve()"
+.It Dv "P_STATCHILD" Ta No "0x8000000	Child process stopped or exited"
+.It Dv "P_INMEM" Ta No "0x10000000	Loaded into memory"
+.It Dv "P_SWAPPINGOUT" Ta No "0x20000000	Process is being swapped out"
+.It Dv "P_SWAPPINGIN" Ta No "0x40000000	Process is being swapped in"
 .El
 .It Cm label
 The MAC label of the process.
@@ -615,6 +620,13 @@ wait channel (as a symbolic name)
 .It Cm xstat
 exit or stop status (valid only for stopped or zombie process)
 .El
+.Pp
+Note that the
+.Cm pending
+column displays bitmask of signals pending in the process queue when
+.Fl H
+option is not specified, otherwise the per-thread queue of pending signals
+is shown.
 .Sh ENVIRONMENT
 The following environment variables affect the execution of
 .Nm :

Modified: user/ed/newcons/bin/ps/ps.c
==============================================================================
--- user/ed/newcons/bin/ps/ps.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/ps/ps.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -212,7 +212,8 @@ main(int argc, char *argv[])
 	init_list(&sesslist, addelem_pid, sizeof(pid_t), "session id");
 	init_list(&ttylist, addelem_tty, sizeof(dev_t), "tty");
 	init_list(&uidlist, addelem_uid, sizeof(uid_t), "user");
-	memf = nlistf = _PATH_DEVNULL;
+	memf = _PATH_DEVNULL;
+	nlistf = NULL;
 	while ((ch = getopt(argc, argv, PS_ARGS)) != -1)
 		switch (ch) {
 		case 'A':

Modified: user/ed/newcons/bin/rmail/Makefile
==============================================================================
--- user/ed/newcons/bin/rmail/Makefile	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/rmail/Makefile	Sat Mar 13 11:06:47 2010	(r205117)
@@ -11,7 +11,7 @@ PROG=	rmail
 SRCS=	rmail.c
 MAN=	rmail.8
 
-WARNS?=	0
+WARNS?=	2
 CFLAGS+=-I${SENDMAIL_DIR}/include -I.
 
 LIBSMDIR=	${.OBJDIR}/../../lib/libsm

Modified: user/ed/newcons/bin/setfacl/file.c
==============================================================================
--- user/ed/newcons/bin/setfacl/file.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/setfacl/file.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -14,14 +14,14 @@
  * 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 THE VOICES IN HIS HEAD 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.
+ * 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 

Modified: user/ed/newcons/bin/setfacl/mask.c
==============================================================================
--- user/ed/newcons/bin/setfacl/mask.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/setfacl/mask.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -14,14 +14,14 @@
  * 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 THE VOICES IN HIS HEAD 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.
+ * 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 

Modified: user/ed/newcons/bin/setfacl/merge.c
==============================================================================
--- user/ed/newcons/bin/setfacl/merge.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/setfacl/merge.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -14,14 +14,14 @@
  * 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 THE VOICES IN HIS HEAD 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.
+ * 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 

Modified: user/ed/newcons/bin/setfacl/remove.c
==============================================================================
--- user/ed/newcons/bin/setfacl/remove.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/setfacl/remove.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -14,14 +14,14 @@
  * 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 THE VOICES IN HIS HEAD 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.
+ * 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 

Modified: user/ed/newcons/bin/setfacl/setfacl.1
==============================================================================
--- user/ed/newcons/bin/setfacl/setfacl.1	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/setfacl/setfacl.1	Sat Mar 13 11:06:47 2010	(r205117)
@@ -14,14 +14,14 @@
 .\" 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 THE VOICES IN HIS HEAD 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.
+.\" 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$
 .\"

Modified: user/ed/newcons/bin/setfacl/setfacl.c
==============================================================================
--- user/ed/newcons/bin/setfacl/setfacl.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/setfacl/setfacl.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -14,14 +14,14 @@
  * 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 THE VOICES IN HIS HEAD 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.
+ * 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 

Modified: user/ed/newcons/bin/setfacl/setfacl.h
==============================================================================
--- user/ed/newcons/bin/setfacl/setfacl.h	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/setfacl/setfacl.h	Sat Mar 13 11:06:47 2010	(r205117)
@@ -14,14 +14,14 @@
  * 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 THE VOICES IN HIS HEAD 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.
+ * 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$
  */

Modified: user/ed/newcons/bin/setfacl/util.c
==============================================================================
--- user/ed/newcons/bin/setfacl/util.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/setfacl/util.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -14,14 +14,14 @@
  * 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 THE VOICES IN HIS HEAD 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.
+ * 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 

Modified: user/ed/newcons/bin/sh/eval.c
==============================================================================
--- user/ed/newcons/bin/sh/eval.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/sh/eval.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -597,6 +597,7 @@ evalcommand(union node *cmd, int flags, 
 	char *lastarg;
 	int realstatus;
 	int do_clearcmdentry;
+	char *path = pathval();
 
 	/* First expand the arguments. */
 	TRACE(("evalcommand(%p, %d) called\n", (void *)cmd, flags));
@@ -682,7 +683,7 @@ evalcommand(union node *cmd, int flags, 
 		cmdentry.special = 1;
 	} else {
 		static const char PATH[] = "PATH=";
-		char *path = pathval();
+		int cmd_flags = 0, bltinonly = 0;
 
 		/*
 		 * Modify the command lookup path, if a PATH= assignment
@@ -713,24 +714,68 @@ evalcommand(union node *cmd, int flags, 
 				do_clearcmdentry = 1;
 			}
 
-		find_command(argv[0], &cmdentry, 0, path);
-		/* implement the bltin builtin here */
-		if (cmdentry.cmdtype == CMDBUILTIN && cmdentry.u.index == BLTINCMD) {
-			for (;;) {
-				argv++;
-				if (--argc == 0)
-					break;
-				if ((cmdentry.u.index = find_builtin(*argv,
-				    &cmdentry.special)) < 0) {
+		for (;;) {
+			if (bltinonly) {
+				cmdentry.u.index = find_builtin(*argv, &cmdentry.special);
+				if (cmdentry.u.index < 0) {
 					cmdentry.u.index = BLTINCMD;
 					argv--;
 					argc++;
 					break;
 				}
-				if (cmdentry.u.index != BLTINCMD)
+			} else
+				find_command(argv[0], &cmdentry, cmd_flags, path);
+			/* implement the bltin and command builtins here */
+			if (cmdentry.cmdtype != CMDBUILTIN)
+				break;
+			if (cmdentry.u.index == BLTINCMD) {
+				if (argc == 1)
 					break;
-			}
+				argv++;
+				argc--;
+				bltinonly = 1;
+			} else if (cmdentry.u.index == COMMANDCMD) {
+				if (argc == 1)
+					break;
+				if (!strcmp(argv[1], "-p")) {
+					if (argc == 2)
+						break;
+					if (argv[2][0] == '-') {
+						if (strcmp(argv[2], "--"))
+							break;
+						if (argc == 3)
+							break;
+						argv += 3;
+						argc -= 3;
+					} else {
+						argv += 2;
+						argc -= 2;
+					}
+					path = _PATH_STDPATH;
+					clearcmdentry(0);
+					do_clearcmdentry = 1;
+				} else if (!strcmp(argv[1], "--")) {
+					if (argc == 2)
+						break;
+					argv += 2;
+					argc -= 2;
+				} else if (argv[1][0] == '-')
+					break;
+				else {
+					argv++;
+					argc--;
+				}
+				cmd_flags |= DO_NOFUNC;
+				bltinonly = 0;
+			} else
+				break;
 		}
+		/*
+		 * Special builtins lose their special properties when
+		 * called via 'command'.
+		 */
+		if (cmd_flags & DO_NOFUNC)
+			cmdentry.special = 0;
 	}
 
 	/* Fork off a child process if necessary. */
@@ -741,9 +786,7 @@ evalcommand(union node *cmd, int flags, 
 	    && (cmdentry.cmdtype != CMDBUILTIN
 		 || cmdentry.u.index == CDCMD
 		 || cmdentry.u.index == DOTCMD
-		 || cmdentry.u.index == EVALCMD))
-	 || (cmdentry.cmdtype == CMDBUILTIN &&
-	    cmdentry.u.index == COMMANDCMD)) {
+		 || cmdentry.u.index == EVALCMD))) {
 		jp = makejob(cmd, 1);
 		mode = cmd->ncmd.backgnd;
 		if (flags & EV_BACKCMD) {
@@ -770,7 +813,6 @@ evalcommand(union node *cmd, int flags, 
 #ifdef DEBUG
 		trputs("Shell function:  ");  trargs(argv);
 #endif
-		redirect(cmd->ncmd.redirect, REDIR_PUSH);
 		saveparam = shellparam;
 		shellparam.malloc = 0;
 		shellparam.reset = 1;
@@ -788,6 +830,8 @@ evalcommand(union node *cmd, int flags, 
 			else {
 				freeparam(&shellparam);
 				shellparam = saveparam;
+				if (exception == EXERROR || exception == EXEXEC)
+					popredir();
 			}
 			unreffunc(cmdentry.u.func);
 			poplocalvars();
@@ -798,6 +842,7 @@ evalcommand(union node *cmd, int flags, 
 		}
 		handler = &jmploc;
 		funcnest++;
+		redirect(cmd->ncmd.redirect, REDIR_PUSH);
 		INTON;
 		for (sp = varlist.list ; sp ; sp = sp->next)
 			mklocal(sp->text);
@@ -871,6 +916,9 @@ cmddone:
 			backcmd->nleft = memout.nextc - memout.buf;
 			memout.buf = NULL;
 		}
+		if (cmdentry.u.index != EXECCMD &&
+				(e == -1 || e == EXERROR || e == EXEXEC))
+			popredir();
 		if (e != -1) {
 			if ((e != EXERROR && e != EXEXEC)
 			    || cmdentry.special)
@@ -879,8 +927,6 @@ cmddone:
 			if (flags != EV_BACKCMD)
 				FORCEINTON;
 		}
-		if (cmdentry.u.index != EXECCMD)
-			popredir();
 	} else {
 #ifdef DEBUG
 		trputs("normal command:  ");  trargs(argv);
@@ -889,7 +935,7 @@ cmddone:
 		for (sp = varlist.list ; sp ; sp = sp->next)
 			setvareq(sp->text, VEXPORT|VSTACK);
 		envp = environment();
-		shellexec(argv, envp, pathval(), cmdentry.u.index);
+		shellexec(argv, envp, path, cmdentry.u.index);
 		/*NOTREACHED*/
 	}
 	goto out;
@@ -996,15 +1042,11 @@ int
 commandcmd(int argc, char **argv)
 {
 	static char stdpath[] = _PATH_STDPATH;
-	struct jmploc loc, *old;
-	struct strlist *sp;
 	char *path;
 	int ch;
 	int cmd = -1;
 
-	for (sp = cmdenviron; sp ; sp = sp->next)
-		setvareq(sp->text, VEXPORT|VSTACK);
-	path = pathval();
+	path = bltinlookup("PATH", 1);
 
 	optind = optreset = 1;
 	opterr = 0;
@@ -1032,22 +1074,14 @@ commandcmd(int argc, char **argv)
 			error("wrong number of arguments");
 		return typecmd_impl(2, argv - 1, cmd, path);
 	}
-	if (argc != 0) {
-		old = handler;
-		handler = &loc;
-		if (setjmp(handler->loc) == 0)
-			shellexec(argv, environment(), path, 0);
-		handler = old;
-		if (exception == EXEXEC)
-			exit(exerrno);
-		exraise(exception);
-	}
+	if (argc != 0)
+		error("commandcmd() called while it should not be");
 
 	/*
 	 * Do nothing successfully if no command was specified;
 	 * ksh also does this.
 	 */
-	exit(0);
+	return 0;
 }
 
 

Modified: user/ed/newcons/bin/sh/exec.c
==============================================================================
--- user/ed/newcons/bin/sh/exec.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/sh/exec.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -248,7 +248,7 @@ hashcmd(int argc __unused, char **argv _
 		 && (cmdp->cmdtype == CMDNORMAL
 		     || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0)))
 			delete_cmd_entry();
-		find_command(name, &entry, 1, pathval());
+		find_command(name, &entry, DO_ERR, pathval());
 		if (verbose) {
 			if (entry.cmdtype != CMDUNKNOWN) {	/* if no error msg */
 				cmdp = cmdlookup(name, 0);
@@ -310,10 +310,10 @@ printentry(struct tblentry *cmdp, int ve
  */
 
 void
-find_command(const char *name, struct cmdentry *entry, int printerr,
+find_command(const char *name, struct cmdentry *entry, int act,
     const char *path)
 {
-	struct tblentry *cmdp;
+	struct tblentry *cmdp, loc_cmd;
 	int idx;
 	int prev;
 	char *fullname;
@@ -330,13 +330,19 @@ find_command(const char *name, struct cm
 	}
 
 	/* If name is in the table, and not invalidated by cd, we're done */
-	if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0)
-		goto success;
+	if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0) {
+		if (cmdp->cmdtype == CMDFUNCTION && act & DO_NOFUNC)
+			cmdp = NULL;
+		else
+			goto success;
+	}
 
 	/* If %builtin not in path, check for builtin next */
 	if (builtinloc < 0 && (i = find_builtin(name, &spec)) >= 0) {
 		INTOFF;
 		cmdp = cmdlookup(name, 1);
+		if (cmdp->cmdtype == CMDFUNCTION)
+			cmdp = &loc_cmd;
 		cmdp->cmdtype = CMDBUILTIN;
 		cmdp->param.index = i;
 		cmdp->special = spec;
@@ -365,6 +371,8 @@ loop:
 					goto loop;
 				INTOFF;
 				cmdp = cmdlookup(name, 1);
+				if (cmdp->cmdtype == CMDFUNCTION)
+					cmdp = &loc_cmd;
 				cmdp->cmdtype = CMDBUILTIN;
 				cmdp->param.index = i;
 				cmdp->special = spec;
@@ -414,6 +422,8 @@ loop:
 		TRACE(("searchexec \"%s\" returns \"%s\"\n", name, fullname));
 		INTOFF;
 		cmdp = cmdlookup(name, 1);
+		if (cmdp->cmdtype == CMDFUNCTION)
+			cmdp = &loc_cmd;
 		cmdp->cmdtype = CMDNORMAL;
 		cmdp->param.index = idx;
 		INTON;
@@ -421,9 +431,9 @@ loop:
 	}
 
 	/* We failed.  If there was an entry for this command, delete it */
-	if (cmdp)
+	if (cmdp && cmdp->cmdtype != CMDFUNCTION)
 		delete_cmd_entry();
-	if (printerr) {
+	if (act & DO_ERR) {
 		if (e == ENOENT || e == ENOTDIR)
 			outfmt(out2, "%s: not found\n", name);
 		else

Modified: user/ed/newcons/bin/sh/exec.h
==============================================================================
--- user/ed/newcons/bin/sh/exec.h	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/sh/exec.h	Sat Mar 13 11:06:47 2010	(r205117)
@@ -57,6 +57,10 @@ struct cmdentry {
 };
 
 
+/* action to find_command() */
+#define DO_ERR		0x01	/* prints errors */
+#define DO_NOFUNC	0x02	/* don't return shell functions, for command */
+
 extern const char *pathopt;	/* set by padvance */
 extern int exerrno;		/* last exec error */
 

Modified: user/ed/newcons/bin/sh/parser.c
==============================================================================
--- user/ed/newcons/bin/sh/parser.c	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/sh/parser.c	Sat Mar 13 11:06:47 2010	(r205117)
@@ -1641,7 +1641,7 @@ getprompt(void *unused __unused)
 			case 'w':
 				ps[i] = '\0';
 				getcwd(&ps[i], PROMPTLEN - i);
-				if (*fmt == 'W') {
+				if (*fmt == 'W' && ps[i + 1] != '\0') {
 					/* Final path component only. */
 					trim = 1;
 					for (j = i; ps[j] != '\0'; j++)

Modified: user/ed/newcons/bin/sh/sh.1
==============================================================================
--- user/ed/newcons/bin/sh/sh.1	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/bin/sh/sh.1	Sat Mar 13 11:06:47 2010	(r205117)
@@ -32,7 +32,7 @@
 .\"	from: @(#)sh.1	8.6 (Berkeley) 5/4/95
 .\" $FreeBSD$
 .\"
-.Dd December 31, 2009
+.Dd March 6, 2010
 .Dt SH 1
 .Os
 .Sh NAME
@@ -1571,10 +1571,12 @@ built-in command.
 .It Ic command Oo Fl p Oc Op Ar utility Op Ar argument ...
 .It Ic command Oo Fl v | V Oc Op Ar utility
 The first form of invocation executes the specified
+.Ar utility ,
+ignoring shell functions in the search.
+If
 .Ar utility
-as a simple command (see the
-.Sx Simple Commands
-section).
+is a special builtin,
+it is executed as if it were a regular builtin.
 .Pp
 If the
 .Fl p

Modified: user/ed/newcons/cddl/Makefile.inc
==============================================================================
--- user/ed/newcons/cddl/Makefile.inc	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/cddl/Makefile.inc	Sat Mar 13 11:06:47 2010	(r205117)
@@ -7,4 +7,5 @@ IGNORE_PRAGMA=	YES
 
 CFLAGS+=	-DNEED_SOLARIS_BOOLEAN
 
+WARNS?=		6
 CSTD?=		gnu89

Modified: user/ed/newcons/cddl/lib/drti/Makefile
==============================================================================
--- user/ed/newcons/cddl/lib/drti/Makefile	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/cddl/lib/drti/Makefile	Sat Mar 13 11:06:47 2010	(r205117)
@@ -1,8 +1,6 @@
 # $FreeBSD$
 
-.include	"../../Makefile.inc"
-
-.PATH:		${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common
+.PATH:		${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/common
 
 SRCS=		drti.c
 FILES=		${SRCS:R:S/$/.o/g}
@@ -10,7 +8,6 @@ FILESOWN=	${LIBOWN}
 FILESGRP=	${LIBGRP}
 FILESMODE=	${LIBMODE}
 FILESDIR=	${LIBDIR}/dtrace
-WARNS?=		6
 CLEANFILES=	${FILES}
 
 CFLAGS+=	-I${.CURDIR}/../../../sys/cddl/compat/opensolaris \

Modified: user/ed/newcons/cddl/lib/libavl/Makefile
==============================================================================
--- user/ed/newcons/cddl/lib/libavl/Makefile	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/cddl/lib/libavl/Makefile	Sat Mar 13 11:06:47 2010	(r205117)
@@ -4,6 +4,7 @@
 
 LIB=	avl
 SRCS=	avl.c
+WARNS?=	0
 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
 

Modified: user/ed/newcons/cddl/lib/libctf/Makefile
==============================================================================
--- user/ed/newcons/cddl/lib/libctf/Makefile	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/cddl/lib/libctf/Makefile	Sat Mar 13 11:06:47 2010	(r205117)
@@ -1,10 +1,10 @@
 # $FreeBSD$
 
-.include	"../../Makefile.inc"
+.PATH:		${.CURDIR}/../../../cddl/contrib/opensolaris/common/ctf
+.PATH:		${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libctf/common
+.PATH:		${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/ctf
 
 LIB=		ctf
-SHLIB_MAJOR=	2
-
 SRCS=		ctf_create.c \
 		ctf_decl.c \
 		ctf_error.c \
@@ -17,10 +17,7 @@ SRCS=		ctf_create.c \
 		ctf_types.c \
 		ctf_util.c
 
-.PATH:		${OPENSOLARIS_USR_DISTDIR}/common/ctf
-.PATH:		${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common
-.PATH:		${OPENSOLARIS_SYS_DISTDIR}/common/ctf
-
+WARNS?=		0
 CFLAGS+=	-DCTF_OLD_VERSIONS
 
 CFLAGS+=	-I${.CURDIR}/../../../sys/cddl/compat/opensolaris \

Modified: user/ed/newcons/cddl/lib/libdtrace/Makefile
==============================================================================
--- user/ed/newcons/cddl/lib/libdtrace/Makefile	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/cddl/lib/libdtrace/Makefile	Sat Mar 13 11:06:47 2010	(r205117)
@@ -1,12 +1,9 @@
 # $FreeBSD$
 
-.include	"../../Makefile.inc"
+.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/common
+.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libgen/common
 
 LIB=		dtrace
-SHLIB_MAJOR=	2
-
-WARNS=		1
-
 SRCS=		dt_aggregate.c \
 		dt_as.c \
 		dt_buf.c \
@@ -51,8 +48,7 @@ DSRCS=		errno.d			\
 		signal.d		\
 		unistd.d
 
-.PATH:		${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common
-.PATH:		${OPENSOLARIS_USR_DISTDIR}/lib/libgen/common
+WARNS?=		1
 
 CFLAGS+=	-I${.OBJDIR} \
 		-I${.CURDIR}/../../../sys/cddl/compat/opensolaris \

Modified: user/ed/newcons/cddl/lib/libnvpair/Makefile
==============================================================================
--- user/ed/newcons/cddl/lib/libnvpair/Makefile	Sat Mar 13 09:21:00 2010	(r205116)
+++ user/ed/newcons/cddl/lib/libnvpair/Makefile	Sat Mar 13 11:06:47 2010	(r205117)
@@ -10,6 +10,7 @@ SRCS=	libnvpair.c \
 	nvpair_alloc_fixed.c \

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